]> git.sesse.net Git - casparcg/blob - dependencies/ffmpeg/doc/ffmpeg-all.html
Check in complete ffmpeg-20131215-git-ec13849-win32 Zeranoe build with README updates...
[casparcg] / dependencies / ffmpeg / doc / ffmpeg-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 : ffmpeg </title>
16
17 <meta name="description" content="ffmpeg Documentation: ">
18 <meta name="keywords" content="FFmpeg documentation : ffmpeg ">
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">ffmpeg 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-Detailed-description" href="#Detailed-description">3. Detailed description</a>
40   <ul class="toc">
41     <li><a name="toc-Filtering" href="#Filtering">3.1 Filtering</a>
42     <ul class="toc">
43       <li><a name="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
44       <li><a name="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.1.2 Complex filtergraphs</a></li>
45     </ul></li>
46     <li><a name="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
47   </ul></li>
48   <li><a name="toc-Stream-selection" href="#Stream-selection">4. Stream selection</a></li>
49   <li><a name="toc-Options-10" href="#Options-10">5. Options</a>
50   <ul class="toc">
51     <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
52     <li><a name="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
53     <li><a name="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
54     <li><a name="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
55     <li><a name="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
56     <li><a name="toc-Advanced-Video-Options" href="#Advanced-Video-Options">5.6 Advanced Video Options</a></li>
57     <li><a name="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
58     <li><a name="toc-Advanced-Audio-options_003a" href="#Advanced-Audio-options_003a">5.8 Advanced Audio options:</a></li>
59     <li><a name="toc-Subtitle-options_003a" href="#Subtitle-options_003a">5.9 Subtitle options:</a></li>
60     <li><a name="toc-Advanced-Subtitle-options_003a" href="#Advanced-Subtitle-options_003a">5.10 Advanced Subtitle options:</a></li>
61     <li><a name="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
62     <li><a name="toc-Preset-files" href="#Preset-files">5.12 Preset files</a></li>
63   </ul></li>
64   <li><a name="toc-Tips" href="#Tips">6. Tips</a></li>
65   <li><a name="toc-Examples-28" href="#Examples-28">7. Examples</a>
66   <ul class="toc">
67     <li><a name="toc-Preset-files-1" href="#Preset-files-1">7.1 Preset files</a></li>
68     <li><a name="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">7.2 Video and Audio grabbing</a></li>
69     <li><a name="toc-X11-grabbing" href="#X11-grabbing">7.3 X11 grabbing</a></li>
70     <li><a name="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">7.4 Video and Audio file format conversion</a></li>
71   </ul></li>
72   <li><a name="toc-Syntax-2" href="#Syntax-2">8. Syntax</a>
73   <ul class="toc">
74     <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">8.1 Quoting and escaping</a>
75     <ul class="toc">
76       <li><a name="toc-Examples-40" href="#Examples-40">8.1.1 Examples</a></li>
77     </ul></li>
78     <li><a name="toc-Date" href="#Date">8.2 Date</a></li>
79     <li><a name="toc-Time-duration" href="#Time-duration">8.3 Time duration</a>
80     <ul class="toc">
81       <li><a name="toc-Examples-89" href="#Examples-89">8.3.1 Examples</a></li>
82     </ul></li>
83     <li><a name="toc-Video-size" href="#Video-size">8.4 Video size</a></li>
84     <li><a name="toc-Video-rate" href="#Video-rate">8.5 Video rate</a></li>
85     <li><a name="toc-Ratio" href="#Ratio">8.6 Ratio</a></li>
86     <li><a name="toc-Color" href="#Color">8.7 Color</a></li>
87     <li><a name="toc-Channel-Layout" href="#Channel-Layout">8.8 Channel Layout</a></li>
88   </ul></li>
89   <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">9. Expression Evaluation</a></li>
90   <li><a name="toc-OpenCL-Options" href="#OpenCL-Options">10. OpenCL Options</a></li>
91   <li><a name="toc-Codec-Options" href="#Codec-Options">11. Codec Options</a></li>
92   <li><a name="toc-Decoders" href="#Decoders">12. Decoders</a></li>
93   <li><a name="toc-Video-Decoders" href="#Video-Decoders">13. Video Decoders</a>
94   <ul class="toc">
95     <li><a name="toc-rawvideo-1" href="#rawvideo-1">13.1 rawvideo</a>
96     <ul class="toc">
97       <li><a name="toc-Options-7" href="#Options-7">13.1.1 Options</a></li>
98     </ul>
99 </li>
100   </ul></li>
101   <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">14. Audio Decoders</a>
102   <ul class="toc">
103     <li><a name="toc-ffwavesynth" href="#ffwavesynth">14.1 ffwavesynth</a></li>
104     <li><a name="toc-libcelt" href="#libcelt">14.2 libcelt</a></li>
105     <li><a name="toc-libgsm" href="#libgsm">14.3 libgsm</a></li>
106     <li><a name="toc-libilbc" href="#libilbc">14.4 libilbc</a>
107     <ul class="toc">
108       <li><a name="toc-Options-26" href="#Options-26">14.4.1 Options</a></li>
109     </ul></li>
110     <li><a name="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">14.5 libopencore-amrnb</a></li>
111     <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">14.6 libopencore-amrwb</a></li>
112     <li><a name="toc-libopus-1" href="#libopus-1">14.7 libopus</a></li>
113   </ul></li>
114   <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">15. Subtitles Decoders</a>
115   <ul class="toc">
116     <li><a name="toc-dvdsub" href="#dvdsub">15.1 dvdsub</a>
117     <ul class="toc">
118       <li><a name="toc-Options-30" href="#Options-30">15.1.1 Options</a></li>
119     </ul></li>
120     <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">15.2 libzvbi-teletext</a>
121     <ul class="toc">
122       <li><a name="toc-Options-18" href="#Options-18">15.2.1 Options</a></li>
123     </ul>
124 </li>
125   </ul></li>
126   <li><a name="toc-Encoders" href="#Encoders">16. Encoders</a></li>
127   <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">17. Audio Encoders</a>
128   <ul class="toc">
129     <li><a name="toc-aac" href="#aac">17.1 aac</a>
130     <ul class="toc">
131       <li><a name="toc-Options-9" href="#Options-9">17.1.1 Options</a></li>
132     </ul></li>
133     <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">17.2 ac3 and ac3_fixed</a>
134     <ul class="toc">
135       <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">17.2.1 AC-3 Metadata</a>
136       <ul class="toc">
137         <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">17.2.1.1 Metadata Control Options</a></li>
138         <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">17.2.1.2 Downmix Levels</a></li>
139         <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">17.2.1.3 Audio Production Information</a></li>
140         <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">17.2.1.4 Other Metadata Options</a></li>
141       </ul></li>
142       <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">17.2.2 Extended Bitstream Information</a>
143       <ul class="toc">
144         <li><a name="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">17.2.2.1 Extended Bitstream Information - Part 1</a></li>
145         <li><a name="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">17.2.2.2 Extended Bitstream Information - Part 2</a></li>
146       </ul></li>
147       <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">17.2.3 Other AC-3 Encoding Options</a></li>
148       <li><a name="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">17.2.4 Floating-Point-Only AC-3 Encoding Options</a></li>
149     </ul></li>
150     <li><a name="toc-libfaac-1" href="#libfaac-1">17.3 libfaac</a>
151     <ul class="toc">
152       <li><a name="toc-Options-16" href="#Options-16">17.3.1 Options</a></li>
153       <li><a name="toc-Examples-27" href="#Examples-27">17.3.2 Examples</a></li>
154     </ul></li>
155     <li><a name="toc-libfdk_005faac" href="#libfdk_005faac">17.4 libfdk_aac</a>
156     <ul class="toc">
157       <li><a name="toc-Options-6" href="#Options-6">17.4.1 Options</a></li>
158       <li><a name="toc-Examples-12" href="#Examples-12">17.4.2 Examples</a></li>
159     </ul></li>
160     <li><a name="toc-libmp3lame-1" href="#libmp3lame-1">17.5 libmp3lame</a>
161     <ul class="toc">
162       <li><a name="toc-Options-21" href="#Options-21">17.5.1 Options</a></li>
163     </ul></li>
164     <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">17.6 libopencore-amrnb</a>
165     <ul class="toc">
166       <li><a name="toc-Options-31" href="#Options-31">17.6.1 Options</a></li>
167     </ul></li>
168     <li><a name="toc-libshine-1" href="#libshine-1">17.7 libshine</a>
169     <ul class="toc">
170       <li><a name="toc-Options-13" href="#Options-13">17.7.1 Options</a></li>
171     </ul></li>
172     <li><a name="toc-libtwolame" href="#libtwolame">17.8 libtwolame</a>
173     <ul class="toc">
174       <li><a name="toc-Options-8" href="#Options-8">17.8.1 Options</a></li>
175     </ul></li>
176     <li><a name="toc-libvo_002daacenc-1" href="#libvo_002daacenc-1">17.9 libvo-aacenc</a>
177     <ul class="toc">
178       <li><a name="toc-Options-5" href="#Options-5">17.9.1 Options</a></li>
179     </ul></li>
180     <li><a name="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">17.10 libvo-amrwbenc</a>
181     <ul class="toc">
182       <li><a name="toc-Options-22" href="#Options-22">17.10.1 Options</a></li>
183     </ul></li>
184     <li><a name="toc-libopus" href="#libopus">17.11 libopus</a>
185     <ul class="toc">
186       <li><a name="toc-Option-Mapping" href="#Option-Mapping">17.11.1 Option Mapping</a></li>
187     </ul></li>
188     <li><a name="toc-libvorbis" href="#libvorbis">17.12 libvorbis</a>
189     <ul class="toc">
190       <li><a name="toc-Options-27" href="#Options-27">17.12.1 Options</a></li>
191     </ul></li>
192     <li><a name="toc-libwavpack" href="#libwavpack">17.13 libwavpack</a></li>
193   </ul></li>
194   <li><a name="toc-Video-Encoders" href="#Video-Encoders">18. Video Encoders</a>
195   <ul class="toc">
196     <li><a name="toc-libtheora" href="#libtheora">18.1 libtheora</a>
197     <ul class="toc">
198       <li><a name="toc-Options-23" href="#Options-23">18.1.1 Options</a></li>
199       <li><a name="toc-Examples-62" href="#Examples-62">18.1.2 Examples</a></li>
200     </ul></li>
201     <li><a name="toc-libvpx" href="#libvpx">18.2 libvpx</a>
202     <ul class="toc">
203       <li><a name="toc-Options-32" href="#Options-32">18.2.1 Options</a></li>
204     </ul></li>
205     <li><a name="toc-libx264" href="#libx264">18.3 libx264</a>
206     <ul class="toc">
207       <li><a name="toc-Options-19" href="#Options-19">18.3.1 Options</a></li>
208     </ul></li>
209     <li><a name="toc-libxvid" href="#libxvid">18.4 libxvid</a>
210     <ul class="toc">
211       <li><a name="toc-Options-28" href="#Options-28">18.4.1 Options</a></li>
212     </ul></li>
213     <li><a name="toc-png" href="#png">18.5 png</a>
214     <ul class="toc">
215       <li><a name="toc-Private-options" href="#Private-options">18.5.1 Private options</a></li>
216     </ul></li>
217     <li><a name="toc-ProRes" href="#ProRes">18.6 ProRes</a>
218     <ul class="toc">
219       <li><a name="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">18.6.1 Private Options for prores-ks</a></li>
220       <li><a name="toc-Speed-considerations" href="#Speed-considerations">18.6.2 Speed considerations</a></li>
221     </ul>
222 </li>
223   </ul></li>
224   <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">19. Bitstream Filters</a>
225   <ul class="toc">
226     <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">19.1 aac_adtstoasc</a></li>
227     <li><a name="toc-chomp" href="#chomp">19.2 chomp</a></li>
228     <li><a name="toc-dump_005fextra" href="#dump_005fextra">19.3 dump_extra</a></li>
229     <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">19.4 h264_mp4toannexb</a></li>
230     <li><a name="toc-imx_005fdump_005fheader" href="#imx_005fdump_005fheader">19.5 imx_dump_header</a></li>
231     <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">19.6 mjpeg2jpeg</a></li>
232     <li><a name="toc-mjpega_005fdump_005fheader" href="#mjpega_005fdump_005fheader">19.7 mjpega_dump_header</a></li>
233     <li><a name="toc-movsub" href="#movsub">19.8 movsub</a></li>
234     <li><a name="toc-mp3_005fheader_005fdecompress" href="#mp3_005fheader_005fdecompress">19.9 mp3_header_decompress</a></li>
235     <li><a name="toc-noise-1" href="#noise-1">19.10 noise</a></li>
236     <li><a name="toc-remove_005fextra" href="#remove_005fextra">19.11 remove_extra</a></li>
237   </ul></li>
238   <li><a name="toc-Format-Options" href="#Format-Options">20. Format Options</a>
239   <ul class="toc">
240     <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">20.1 Format stream specifiers</a></li>
241   </ul></li>
242   <li><a name="toc-Demuxers" href="#Demuxers">21. Demuxers</a>
243   <ul class="toc">
244     <li><a name="toc-applehttp" href="#applehttp">21.1 applehttp</a></li>
245     <li><a name="toc-asf" href="#asf">21.2 asf</a></li>
246     <li><a name="toc-concat-3" href="#concat-3">21.3 concat</a>
247     <ul class="toc">
248       <li><a name="toc-Syntax-1" href="#Syntax-1">21.3.1 Syntax</a></li>
249       <li><a name="toc-Options-12" href="#Options-12">21.3.2 Options</a></li>
250     </ul></li>
251     <li><a name="toc-flv" href="#flv">21.4 flv</a></li>
252     <li><a name="toc-libgme" href="#libgme">21.5 libgme</a></li>
253     <li><a name="toc-libquvi" href="#libquvi">21.6 libquvi</a></li>
254     <li><a name="toc-image2-2" href="#image2-2">21.7 image2</a>
255     <ul class="toc">
256       <li><a name="toc-Examples-69" href="#Examples-69">21.7.1 Examples</a></li>
257     </ul></li>
258     <li><a name="toc-mpegts-1" href="#mpegts-1">21.8 mpegts</a></li>
259     <li><a name="toc-rawvideo" href="#rawvideo">21.9 rawvideo</a></li>
260     <li><a name="toc-sbg" href="#sbg">21.10 sbg</a></li>
261     <li><a name="toc-tedcaptions" href="#tedcaptions">21.11 tedcaptions</a></li>
262   </ul></li>
263   <li><a name="toc-Muxers" href="#Muxers">22. Muxers</a>
264   <ul class="toc">
265     <li><a name="toc-aiff-1" href="#aiff-1">22.1 aiff</a></li>
266     <li><a name="toc-crc-1" href="#crc-1">22.2 crc</a></li>
267     <li><a name="toc-framecrc-1" href="#framecrc-1">22.3 framecrc</a></li>
268     <li><a name="toc-framemd5-1" href="#framemd5-1">22.4 framemd5</a></li>
269     <li><a name="toc-gif-1" href="#gif-1">22.5 gif</a></li>
270     <li><a name="toc-hls-1" href="#hls-1">22.6 hls</a></li>
271     <li><a name="toc-ico-1" href="#ico-1">22.7 ico</a></li>
272     <li><a name="toc-image2-1" href="#image2-1">22.8 image2</a></li>
273     <li><a name="toc-matroska" href="#matroska">22.9 matroska</a></li>
274     <li><a name="toc-md5-1" href="#md5-1">22.10 md5</a></li>
275     <li><a name="toc-mov_002fmp4_002fismv" href="#mov_002fmp4_002fismv">22.11 mov/mp4/ismv</a></li>
276     <li><a name="toc-mp3" href="#mp3">22.12 mp3</a></li>
277     <li><a name="toc-mpegts" href="#mpegts">22.13 mpegts</a></li>
278     <li><a name="toc-null-1" href="#null-1">22.14 null</a></li>
279     <li><a name="toc-ogg" href="#ogg">22.15 ogg</a></li>
280     <li><a name="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">22.16 segment, stream_segment, ssegment</a>
281     <ul class="toc">
282       <li><a name="toc-Examples-41" href="#Examples-41">22.16.1 Examples</a></li>
283     </ul></li>
284     <li><a name="toc-tee" href="#tee">22.17 tee</a></li>
285   </ul></li>
286   <li><a name="toc-Metadata" href="#Metadata">23. Metadata</a></li>
287   <li><a name="toc-Protocols" href="#Protocols">24. Protocols</a>
288   <ul class="toc">
289     <li><a name="toc-bluray" href="#bluray">24.1 bluray</a></li>
290     <li><a name="toc-cache" href="#cache">24.2 cache</a></li>
291     <li><a name="toc-concat-2" href="#concat-2">24.3 concat</a></li>
292     <li><a name="toc-crypto" href="#crypto">24.4 crypto</a></li>
293     <li><a name="toc-data" href="#data">24.5 data</a></li>
294     <li><a name="toc-file" href="#file">24.6 file</a></li>
295     <li><a name="toc-ftp" href="#ftp">24.7 ftp</a></li>
296     <li><a name="toc-gopher" href="#gopher">24.8 gopher</a></li>
297     <li><a name="toc-hls-2" href="#hls-2">24.9 hls</a></li>
298     <li><a name="toc-http" href="#http">24.10 http</a>
299     <ul class="toc">
300       <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">24.10.1 HTTP Cookies</a></li>
301     </ul></li>
302     <li><a name="toc-mmst" href="#mmst">24.11 mmst</a></li>
303     <li><a name="toc-mmsh" href="#mmsh">24.12 mmsh</a></li>
304     <li><a name="toc-md5-2" href="#md5-2">24.13 md5</a></li>
305     <li><a name="toc-pipe" href="#pipe">24.14 pipe</a></li>
306     <li><a name="toc-rtmp" href="#rtmp">24.15 rtmp</a></li>
307     <li><a name="toc-rtmpe" href="#rtmpe">24.16 rtmpe</a></li>
308     <li><a name="toc-rtmps" href="#rtmps">24.17 rtmps</a></li>
309     <li><a name="toc-rtmpt" href="#rtmpt">24.18 rtmpt</a></li>
310     <li><a name="toc-rtmpte" href="#rtmpte">24.19 rtmpte</a></li>
311     <li><a name="toc-rtmpts" href="#rtmpts">24.20 rtmpts</a></li>
312     <li><a name="toc-libssh" href="#libssh">24.21 libssh</a></li>
313     <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">24.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
314     <li><a name="toc-rtp" href="#rtp">24.23 rtp</a></li>
315     <li><a name="toc-rtsp" href="#rtsp">24.24 rtsp</a></li>
316     <li><a name="toc-sap" href="#sap">24.25 sap</a>
317     <ul class="toc">
318       <li><a name="toc-Muxer" href="#Muxer">24.25.1 Muxer</a></li>
319       <li><a name="toc-Demuxer" href="#Demuxer">24.25.2 Demuxer</a></li>
320     </ul></li>
321     <li><a name="toc-sctp" href="#sctp">24.26 sctp</a></li>
322     <li><a name="toc-srtp" href="#srtp">24.27 srtp</a></li>
323     <li><a name="toc-tcp" href="#tcp">24.28 tcp</a></li>
324     <li><a name="toc-tls" href="#tls">24.29 tls</a></li>
325     <li><a name="toc-udp" href="#udp">24.30 udp</a></li>
326     <li><a name="toc-unix" href="#unix">24.31 unix</a></li>
327   </ul></li>
328   <li><a name="toc-Device-Options" href="#Device-Options">25. Device Options</a></li>
329   <li><a name="toc-Input-Devices" href="#Input-Devices">26. Input Devices</a>
330   <ul class="toc">
331     <li><a name="toc-alsa" href="#alsa">26.1 alsa</a></li>
332     <li><a name="toc-bktr" href="#bktr">26.2 bktr</a></li>
333     <li><a name="toc-dshow" href="#dshow">26.3 dshow</a>
334     <ul class="toc">
335       <li><a name="toc-Options-4" href="#Options-4">26.3.1 Options</a></li>
336       <li><a name="toc-Examples-49" href="#Examples-49">26.3.2 Examples</a></li>
337     </ul></li>
338     <li><a name="toc-dv1394" href="#dv1394">26.4 dv1394</a></li>
339     <li><a name="toc-fbdev" href="#fbdev">26.5 fbdev</a></li>
340     <li><a name="toc-iec61883" href="#iec61883">26.6 iec61883</a>
341     <ul class="toc">
342       <li><a name="toc-Options-11" href="#Options-11">26.6.1 Options</a></li>
343       <li><a name="toc-Examples-44" href="#Examples-44">26.6.2 Examples</a></li>
344     </ul></li>
345     <li><a name="toc-jack" href="#jack">26.7 jack</a></li>
346     <li><a name="toc-lavfi" href="#lavfi">26.8 lavfi</a>
347     <ul class="toc">
348       <li><a name="toc-Options-14" href="#Options-14">26.8.1 Options</a></li>
349       <li><a name="toc-Examples-26" href="#Examples-26">26.8.2 Examples</a></li>
350     </ul></li>
351     <li><a name="toc-libdc1394" href="#libdc1394">26.9 libdc1394</a></li>
352     <li><a name="toc-openal" href="#openal">26.10 openal</a>
353     <ul class="toc">
354       <li><a name="toc-Options-15" href="#Options-15">26.10.1 Options</a></li>
355       <li><a name="toc-Examples-85" href="#Examples-85">26.10.2 Examples</a></li>
356     </ul></li>
357     <li><a name="toc-oss-1" href="#oss-1">26.11 oss</a></li>
358     <li><a name="toc-pulse" href="#pulse">26.12 pulse</a>
359     <ul class="toc">
360       <li><a name="toc-Options-1" href="#Options-1">26.12.1 Options</a></li>
361       <li><a name="toc-Examples-52" href="#Examples-52">26.12.2 Examples</a></li>
362     </ul></li>
363     <li><a name="toc-sndio-1" href="#sndio-1">26.13 sndio</a></li>
364     <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.14 video4linux2, v4l2</a>
365     <ul class="toc">
366       <li><a name="toc-Options-24" href="#Options-24">26.14.1 Options</a></li>
367     </ul></li>
368     <li><a name="toc-vfwcap" href="#vfwcap">26.15 vfwcap</a></li>
369     <li><a name="toc-x11grab" href="#x11grab">26.16 x11grab</a>
370     <ul class="toc">
371       <li><a name="toc-Options-20" href="#Options-20">26.16.1 Options</a></li>
372     </ul>
373 </li>
374   </ul></li>
375   <li><a name="toc-Output-Devices" href="#Output-Devices">27. Output Devices</a>
376   <ul class="toc">
377     <li><a name="toc-alsa-1" href="#alsa-1">27.1 alsa</a>
378     <ul class="toc">
379       <li><a name="toc-Examples-61" href="#Examples-61">27.1.1 Examples</a></li>
380     </ul></li>
381     <li><a name="toc-caca" href="#caca">27.2 caca</a>
382     <ul class="toc">
383       <li><a name="toc-Options-17" href="#Options-17">27.2.1 Options</a></li>
384       <li><a name="toc-Examples-43" href="#Examples-43">27.2.2 Examples</a></li>
385     </ul></li>
386     <li><a name="toc-fbdev-1" href="#fbdev-1">27.3 fbdev</a>
387     <ul class="toc">
388       <li><a name="toc-Options-29" href="#Options-29">27.3.1 Options</a></li>
389       <li><a name="toc-Examples-5" href="#Examples-5">27.3.2 Examples</a></li>
390     </ul></li>
391     <li><a name="toc-oss" href="#oss">27.4 oss</a></li>
392     <li><a name="toc-pulse-1" href="#pulse-1">27.5 pulse</a>
393     <ul class="toc">
394       <li><a name="toc-Options-3" href="#Options-3">27.5.1 Options</a></li>
395       <li><a name="toc-Examples-74" href="#Examples-74">27.5.2 Examples</a></li>
396     </ul></li>
397     <li><a name="toc-sdl" href="#sdl">27.6 sdl</a>
398     <ul class="toc">
399       <li><a name="toc-Options-25" href="#Options-25">27.6.1 Options</a></li>
400       <li><a name="toc-Interactive-commands" href="#Interactive-commands">27.6.2 Interactive commands</a></li>
401       <li><a name="toc-Examples-84" href="#Examples-84">27.6.3 Examples</a></li>
402     </ul></li>
403     <li><a name="toc-sndio" href="#sndio">27.7 sndio</a></li>
404     <li><a name="toc-xv" href="#xv">27.8 xv</a>
405     <ul class="toc">
406       <li><a name="toc-Options-2" href="#Options-2">27.8.1 Options</a></li>
407       <li><a name="toc-Examples-20" href="#Examples-20">27.8.2 Examples</a></li>
408     </ul>
409 </li>
410   </ul></li>
411   <li><a name="toc-Resampler-Options" href="#Resampler-Options">28. Resampler Options</a></li>
412   <li><a name="toc-Scaler-Options" href="#Scaler-Options">29. Scaler Options</a></li>
413   <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">30. Filtering Introduction</a></li>
414   <li><a name="toc-graph2dot" href="#graph2dot">31. graph2dot</a></li>
415   <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">32. Filtergraph description</a>
416   <ul class="toc">
417     <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
418     <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
419   </ul></li>
420   <li><a name="toc-Timeline-editing" href="#Timeline-editing">33. Timeline editing</a></li>
421   <li><a name="toc-Audio-Filters" href="#Audio-Filters">34. Audio Filters</a>
422   <ul class="toc">
423     <li><a name="toc-aconvert" href="#aconvert">34.1 aconvert</a>
424     <ul class="toc">
425       <li><a name="toc-Examples-38" href="#Examples-38">34.1.1 Examples</a></li>
426     </ul></li>
427     <li><a name="toc-adelay" href="#adelay">34.2 adelay</a>
428     <ul class="toc">
429       <li><a name="toc-Examples-22" href="#Examples-22">34.2.1 Examples</a></li>
430     </ul></li>
431     <li><a name="toc-aecho" href="#aecho">34.3 aecho</a>
432     <ul class="toc">
433       <li><a name="toc-Examples-76" href="#Examples-76">34.3.1 Examples</a></li>
434     </ul></li>
435     <li><a name="toc-aeval" href="#aeval">34.4 aeval</a>
436     <ul class="toc">
437       <li><a name="toc-Examples-90" href="#Examples-90">34.4.1 Examples</a></li>
438     </ul></li>
439     <li><a name="toc-afade" href="#afade">34.5 afade</a>
440     <ul class="toc">
441       <li><a name="toc-Examples-53" href="#Examples-53">34.5.1 Examples</a></li>
442     </ul></li>
443     <li><a name="toc-aformat-1" href="#aformat-1">34.6 aformat</a></li>
444     <li><a name="toc-allpass" href="#allpass">34.7 allpass</a></li>
445     <li><a name="toc-amerge" href="#amerge">34.8 amerge</a>
446     <ul class="toc">
447       <li><a name="toc-Examples-56" href="#Examples-56">34.8.1 Examples</a></li>
448     </ul></li>
449     <li><a name="toc-amix" href="#amix">34.9 amix</a></li>
450     <li><a name="toc-anull" href="#anull">34.10 anull</a></li>
451     <li><a name="toc-apad" href="#apad">34.11 apad</a></li>
452     <li><a name="toc-aphaser" href="#aphaser">34.12 aphaser</a></li>
453     <li><a name="toc-aresample-1" href="#aresample-1">34.13 aresample</a>
454     <ul class="toc">
455       <li><a name="toc-Examples-18" href="#Examples-18">34.13.1 Examples</a></li>
456     </ul></li>
457     <li><a name="toc-asetnsamples" href="#asetnsamples">34.14 asetnsamples</a></li>
458     <li><a name="toc-asetrate" href="#asetrate">34.15 asetrate</a></li>
459     <li><a name="toc-ashowinfo" href="#ashowinfo">34.16 ashowinfo</a></li>
460     <li><a name="toc-astats" href="#astats">34.17 astats</a></li>
461     <li><a name="toc-astreamsync" href="#astreamsync">34.18 astreamsync</a>
462     <ul class="toc">
463       <li><a name="toc-Examples-31" href="#Examples-31">34.18.1 Examples</a></li>
464     </ul></li>
465     <li><a name="toc-asyncts" href="#asyncts">34.19 asyncts</a></li>
466     <li><a name="toc-atempo" href="#atempo">34.20 atempo</a>
467     <ul class="toc">
468       <li><a name="toc-Examples-39" href="#Examples-39">34.20.1 Examples</a></li>
469     </ul></li>
470     <li><a name="toc-atrim" href="#atrim">34.21 atrim</a></li>
471     <li><a name="toc-bandpass" href="#bandpass">34.22 bandpass</a></li>
472     <li><a name="toc-bandreject" href="#bandreject">34.23 bandreject</a></li>
473     <li><a name="toc-bass" href="#bass">34.24 bass</a></li>
474     <li><a name="toc-biquad" href="#biquad">34.25 biquad</a></li>
475     <li><a name="toc-channelmap" href="#channelmap">34.26 channelmap</a></li>
476     <li><a name="toc-channelsplit" href="#channelsplit">34.27 channelsplit</a></li>
477     <li><a name="toc-compand" href="#compand">34.28 compand</a>
478     <ul class="toc">
479       <li><a name="toc-Examples-79" href="#Examples-79">34.28.1 Examples</a></li>
480     </ul></li>
481     <li><a name="toc-earwax" href="#earwax">34.29 earwax</a></li>
482     <li><a name="toc-equalizer" href="#equalizer">34.30 equalizer</a></li>
483     <li><a name="toc-highpass" href="#highpass">34.31 highpass</a></li>
484     <li><a name="toc-join" href="#join">34.32 join</a></li>
485     <li><a name="toc-ladspa" href="#ladspa">34.33 ladspa</a>
486     <ul class="toc">
487       <li><a name="toc-Examples-75" href="#Examples-75">34.33.1 Examples</a></li>
488       <li><a name="toc-Commands-1" href="#Commands-1">34.33.2 Commands</a></li>
489     </ul></li>
490     <li><a name="toc-lowpass" href="#lowpass">34.34 lowpass</a></li>
491     <li><a name="toc-pan" href="#pan">34.35 pan</a>
492     <ul class="toc">
493       <li><a name="toc-Mixing-examples" href="#Mixing-examples">34.35.1 Mixing examples</a></li>
494       <li><a name="toc-Remapping-examples" href="#Remapping-examples">34.35.2 Remapping examples</a></li>
495     </ul></li>
496     <li><a name="toc-replaygain" href="#replaygain">34.36 replaygain</a></li>
497     <li><a name="toc-resample" href="#resample">34.37 resample</a></li>
498     <li><a name="toc-silencedetect" href="#silencedetect">34.38 silencedetect</a>
499     <ul class="toc">
500       <li><a name="toc-Examples-24" href="#Examples-24">34.38.1 Examples</a></li>
501     </ul></li>
502     <li><a name="toc-treble" href="#treble">34.39 treble</a></li>
503     <li><a name="toc-volume" href="#volume">34.40 volume</a>
504     <ul class="toc">
505       <li><a name="toc-Examples-70" href="#Examples-70">34.40.1 Examples</a></li>
506     </ul></li>
507     <li><a name="toc-volumedetect" href="#volumedetect">34.41 volumedetect</a>
508     <ul class="toc">
509       <li><a name="toc-Examples-51" href="#Examples-51">34.41.1 Examples</a></li>
510     </ul>
511 </li>
512   </ul></li>
513   <li><a name="toc-Audio-Sources" href="#Audio-Sources">35. Audio Sources</a>
514   <ul class="toc">
515     <li><a name="toc-abuffer" href="#abuffer">35.1 abuffer</a>
516     <ul class="toc">
517       <li><a name="toc-Examples-46" href="#Examples-46">35.1.1 Examples</a></li>
518     </ul></li>
519     <li><a name="toc-aevalsrc" href="#aevalsrc">35.2 aevalsrc</a>
520     <ul class="toc">
521       <li><a name="toc-Examples-32" href="#Examples-32">35.2.1 Examples</a></li>
522     </ul></li>
523     <li><a name="toc-anullsrc" href="#anullsrc">35.3 anullsrc</a>
524     <ul class="toc">
525       <li><a name="toc-Examples-91" href="#Examples-91">35.3.1 Examples</a></li>
526     </ul></li>
527     <li><a name="toc-flite" href="#flite">35.4 flite</a>
528     <ul class="toc">
529       <li><a name="toc-Examples-13" href="#Examples-13">35.4.1 Examples</a></li>
530     </ul></li>
531     <li><a name="toc-sine" href="#sine">35.5 sine</a>
532     <ul class="toc">
533       <li><a name="toc-Examples-50" href="#Examples-50">35.5.1 Examples</a></li>
534     </ul>
535 </li>
536   </ul></li>
537   <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">36. Audio Sinks</a>
538   <ul class="toc">
539     <li><a name="toc-abuffersink" href="#abuffersink">36.1 abuffersink</a></li>
540     <li><a name="toc-anullsink" href="#anullsink">36.2 anullsink</a></li>
541   </ul></li>
542   <li><a name="toc-Video-Filters" href="#Video-Filters">37. Video Filters</a>
543   <ul class="toc">
544     <li><a name="toc-alphaextract" href="#alphaextract">37.1 alphaextract</a></li>
545     <li><a name="toc-alphamerge" href="#alphamerge">37.2 alphamerge</a></li>
546     <li><a name="toc-ass" href="#ass">37.3 ass</a></li>
547     <li><a name="toc-bbox" href="#bbox">37.4 bbox</a></li>
548     <li><a name="toc-blackdetect" href="#blackdetect">37.5 blackdetect</a></li>
549     <li><a name="toc-blackframe" href="#blackframe">37.6 blackframe</a></li>
550     <li><a name="toc-blend" href="#blend">37.7 blend</a>
551     <ul class="toc">
552       <li><a name="toc-Examples-25" href="#Examples-25">37.7.1 Examples</a></li>
553     </ul></li>
554     <li><a name="toc-boxblur" href="#boxblur">37.8 boxblur</a>
555     <ul class="toc">
556       <li><a name="toc-Examples-83" href="#Examples-83">37.8.1 Examples</a></li>
557     </ul></li>
558     <li><a name="toc-colorbalance" href="#colorbalance">37.9 colorbalance</a>
559     <ul class="toc">
560       <li><a name="toc-Examples-57" href="#Examples-57">37.9.1 Examples</a></li>
561     </ul></li>
562     <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">37.10 colorchannelmixer</a>
563     <ul class="toc">
564       <li><a name="toc-Examples-34" href="#Examples-34">37.10.1 Examples</a></li>
565     </ul></li>
566     <li><a name="toc-colormatrix" href="#colormatrix">37.11 colormatrix</a></li>
567     <li><a name="toc-copy" href="#copy">37.12 copy</a></li>
568     <li><a name="toc-crop" href="#crop">37.13 crop</a>
569     <ul class="toc">
570       <li><a name="toc-Examples-8" href="#Examples-8">37.13.1 Examples</a></li>
571     </ul></li>
572     <li><a name="toc-cropdetect" href="#cropdetect">37.14 cropdetect</a></li>
573     <li><a name="toc-curves-1" href="#curves-1">37.15 curves</a>
574     <ul class="toc">
575       <li><a name="toc-Examples-16" href="#Examples-16">37.15.1 Examples</a></li>
576     </ul></li>
577     <li><a name="toc-dctdnoiz" href="#dctdnoiz">37.16 dctdnoiz</a>
578     <ul class="toc">
579       <li><a name="toc-Examples-3" href="#Examples-3">37.16.1 Examples</a></li>
580     </ul></li>
581     <li><a name="toc-decimate-1" href="#decimate-1">37.17 decimate</a></li>
582     <li><a name="toc-delogo" href="#delogo">37.18 delogo</a>
583     <ul class="toc">
584       <li><a name="toc-Examples-67" href="#Examples-67">37.18.1 Examples</a></li>
585     </ul></li>
586     <li><a name="toc-deshake" href="#deshake">37.19 deshake</a></li>
587     <li><a name="toc-drawbox" href="#drawbox">37.20 drawbox</a>
588     <ul class="toc">
589       <li><a name="toc-Examples-42" href="#Examples-42">37.20.1 Examples</a></li>
590     </ul></li>
591     <li><a name="toc-drawgrid" href="#drawgrid">37.21 drawgrid</a>
592     <ul class="toc">
593       <li><a name="toc-Examples-54" href="#Examples-54">37.21.1 Examples</a></li>
594     </ul></li>
595     <li><a name="toc-drawtext-1" href="#drawtext-1">37.22 drawtext</a>
596     <ul class="toc">
597       <li><a name="toc-Syntax" href="#Syntax">37.22.1 Syntax</a></li>
598       <li><a name="toc-Text-expansion" href="#Text-expansion">37.22.2 Text expansion</a></li>
599       <li><a name="toc-Examples-30" href="#Examples-30">37.22.3 Examples</a></li>
600     </ul></li>
601     <li><a name="toc-edgedetect" href="#edgedetect">37.23 edgedetect</a></li>
602     <li><a name="toc-extractplanes" href="#extractplanes">37.24 extractplanes</a>
603     <ul class="toc">
604       <li><a name="toc-Examples-11" href="#Examples-11">37.24.1 Examples</a></li>
605     </ul></li>
606     <li><a name="toc-elbg" href="#elbg">37.25 elbg</a></li>
607     <li><a name="toc-fade" href="#fade">37.26 fade</a>
608     <ul class="toc">
609       <li><a name="toc-Examples-14" href="#Examples-14">37.26.1 Examples</a></li>
610     </ul></li>
611     <li><a name="toc-field" href="#field">37.27 field</a></li>
612     <li><a name="toc-fieldmatch" href="#fieldmatch">37.28 fieldmatch</a>
613     <ul class="toc">
614       <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">37.28.1 p/c/n/u/b meaning</a>
615       <ul class="toc">
616         <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">37.28.1.1 p/c/n</a></li>
617         <li><a name="toc-u_002fb" href="#u_002fb">37.28.1.2 u/b</a></li>
618       </ul></li>
619       <li><a name="toc-Examples-35" href="#Examples-35">37.28.2 Examples</a></li>
620     </ul></li>
621     <li><a name="toc-fieldorder" href="#fieldorder">37.29 fieldorder</a></li>
622     <li><a name="toc-fifo" href="#fifo">37.30 fifo</a></li>
623     <li><a name="toc-format-1" href="#format-1">37.31 format</a>
624     <ul class="toc">
625       <li><a name="toc-Examples-81" href="#Examples-81">37.31.1 Examples</a></li>
626     </ul></li>
627     <li><a name="toc-fps-1" href="#fps-1">37.32 fps</a>
628     <ul class="toc">
629       <li><a name="toc-Examples-6" href="#Examples-6">37.32.1 Examples</a></li>
630     </ul></li>
631     <li><a name="toc-framestep" href="#framestep">37.33 framestep</a></li>
632     <li><a name="toc-frei0r-1" href="#frei0r-1">37.34 frei0r</a>
633     <ul class="toc">
634       <li><a name="toc-Examples-73" href="#Examples-73">37.34.1 Examples</a></li>
635     </ul></li>
636     <li><a name="toc-geq" href="#geq">37.35 geq</a>
637     <ul class="toc">
638       <li><a name="toc-Examples-15" href="#Examples-15">37.35.1 Examples</a></li>
639     </ul></li>
640     <li><a name="toc-gradfun" href="#gradfun">37.36 gradfun</a>
641     <ul class="toc">
642       <li><a name="toc-Examples-80" href="#Examples-80">37.36.1 Examples</a></li>
643     </ul></li>
644     <li><a name="toc-haldclut-1" href="#haldclut-1">37.37 haldclut</a>
645     <ul class="toc">
646       <li><a name="toc-Workflow-examples" href="#Workflow-examples">37.37.1 Workflow examples</a>
647       <ul class="toc">
648         <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">37.37.1.1 Hald CLUT video stream</a></li>
649         <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">37.37.1.2 Hald CLUT with preview</a></li>
650       </ul>
651 </li>
652     </ul></li>
653     <li><a name="toc-hflip" href="#hflip">37.38 hflip</a></li>
654     <li><a name="toc-histeq" href="#histeq">37.39 histeq</a></li>
655     <li><a name="toc-histogram" href="#histogram">37.40 histogram</a>
656     <ul class="toc">
657       <li><a name="toc-Examples-55" href="#Examples-55">37.40.1 Examples</a></li>
658     </ul></li>
659     <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">37.41 hqdn3d</a></li>
660     <li><a name="toc-hue" href="#hue">37.42 hue</a>
661     <ul class="toc">
662       <li><a name="toc-Examples-66" href="#Examples-66">37.42.1 Examples</a></li>
663       <li><a name="toc-Commands" href="#Commands">37.42.2 Commands</a></li>
664     </ul></li>
665     <li><a name="toc-idet" href="#idet">37.43 idet</a></li>
666     <li><a name="toc-il" href="#il">37.44 il</a></li>
667     <li><a name="toc-interlace" href="#interlace">37.45 interlace</a></li>
668     <li><a name="toc-kerndeint" href="#kerndeint">37.46 kerndeint</a>
669     <ul class="toc">
670       <li><a name="toc-Examples-48" href="#Examples-48">37.46.1 Examples</a></li>
671     </ul></li>
672     <li><a name="toc-lut3d-1" href="#lut3d-1">37.47 lut3d</a></li>
673     <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">37.48 lut, lutrgb, lutyuv</a>
674     <ul class="toc">
675       <li><a name="toc-Examples-10" href="#Examples-10">37.48.1 Examples</a></li>
676     </ul></li>
677     <li><a name="toc-mergeplanes" href="#mergeplanes">37.49 mergeplanes</a>
678     <ul class="toc">
679       <li><a name="toc-Examples-71" href="#Examples-71">37.49.1 Examples</a></li>
680     </ul></li>
681     <li><a name="toc-mcdeint" href="#mcdeint">37.50 mcdeint</a></li>
682     <li><a name="toc-mp" href="#mp">37.51 mp</a>
683     <ul class="toc">
684       <li><a name="toc-Examples-68" href="#Examples-68">37.51.1 Examples</a></li>
685     </ul></li>
686     <li><a name="toc-mpdecimate" href="#mpdecimate">37.52 mpdecimate</a></li>
687     <li><a name="toc-negate" href="#negate">37.53 negate</a></li>
688     <li><a name="toc-noformat" href="#noformat">37.54 noformat</a>
689     <ul class="toc">
690       <li><a name="toc-Examples-9" href="#Examples-9">37.54.1 Examples</a></li>
691     </ul></li>
692     <li><a name="toc-noise" href="#noise">37.55 noise</a>
693     <ul class="toc">
694       <li><a name="toc-Examples-86" href="#Examples-86">37.55.1 Examples</a></li>
695     </ul></li>
696     <li><a name="toc-null" href="#null">37.56 null</a></li>
697     <li><a name="toc-ocv" href="#ocv">37.57 ocv</a>
698     <ul class="toc">
699       <li><a name="toc-dilate-1" href="#dilate-1">37.57.1 dilate</a></li>
700       <li><a name="toc-erode" href="#erode">37.57.2 erode</a></li>
701       <li><a name="toc-smooth" href="#smooth">37.57.3 smooth</a></li>
702     </ul></li>
703     <li><a name="toc-overlay-1" href="#overlay-1">37.58 overlay</a>
704     <ul class="toc">
705       <li><a name="toc-Commands-2" href="#Commands-2">37.58.1 Commands</a></li>
706       <li><a name="toc-Examples-82" href="#Examples-82">37.58.2 Examples</a></li>
707     </ul></li>
708     <li><a name="toc-owdenoise" href="#owdenoise">37.59 owdenoise</a></li>
709     <li><a name="toc-pad" href="#pad">37.60 pad</a>
710     <ul class="toc">
711       <li><a name="toc-Examples-87" href="#Examples-87">37.60.1 Examples</a></li>
712     </ul></li>
713     <li><a name="toc-perspective" href="#perspective">37.61 perspective</a></li>
714     <li><a name="toc-phase" href="#phase">37.62 phase</a></li>
715     <li><a name="toc-pixdesctest" href="#pixdesctest">37.63 pixdesctest</a></li>
716     <li><a name="toc-pp" href="#pp">37.64 pp</a>
717     <ul class="toc">
718       <li><a name="toc-Examples-7" href="#Examples-7">37.64.1 Examples</a></li>
719     </ul></li>
720     <li><a name="toc-psnr" href="#psnr">37.65 psnr</a></li>
721     <li><a name="toc-pullup" href="#pullup">37.66 pullup</a></li>
722     <li><a name="toc-removelogo" href="#removelogo">37.67 removelogo</a></li>
723     <li><a name="toc-rotate" href="#rotate">37.68 rotate</a>
724     <ul class="toc">
725       <li><a name="toc-Examples-78" href="#Examples-78">37.68.1 Examples</a></li>
726       <li><a name="toc-Commands-3" href="#Commands-3">37.68.2 Commands</a></li>
727     </ul></li>
728     <li><a name="toc-sab" href="#sab">37.69 sab</a></li>
729     <li><a name="toc-scale-1" href="#scale-1">37.70 scale</a>
730     <ul class="toc">
731       <li><a name="toc-Options" href="#Options">37.70.1 Options</a></li>
732       <li><a name="toc-Examples-23" href="#Examples-23">37.70.2 Examples</a></li>
733     </ul></li>
734     <li><a name="toc-separatefields" href="#separatefields">37.71 separatefields</a></li>
735     <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">37.72 setdar, setsar</a>
736     <ul class="toc">
737       <li><a name="toc-Examples-45" href="#Examples-45">37.72.1 Examples</a></li>
738     </ul></li>
739     <li><a name="toc-setfield-1" href="#setfield-1">37.73 setfield</a></li>
740     <li><a name="toc-showinfo" href="#showinfo">37.74 showinfo</a></li>
741     <li><a name="toc-smartblur-1" href="#smartblur-1">37.75 smartblur</a></li>
742     <li><a name="toc-stereo3d" href="#stereo3d">37.76 stereo3d</a>
743     <ul class="toc">
744       <li><a name="toc-Examples" href="#Examples">37.76.1 Examples</a></li>
745     </ul></li>
746     <li><a name="toc-spp" href="#spp">37.77 spp</a></li>
747     <li><a name="toc-subtitles-1" href="#subtitles-1">37.78 subtitles</a></li>
748     <li><a name="toc-super2xsai" href="#super2xsai">37.79 super2xsai</a></li>
749     <li><a name="toc-swapuv" href="#swapuv">37.80 swapuv</a></li>
750     <li><a name="toc-telecine" href="#telecine">37.81 telecine</a></li>
751     <li><a name="toc-thumbnail" href="#thumbnail">37.82 thumbnail</a>
752     <ul class="toc">
753       <li><a name="toc-Examples-17" href="#Examples-17">37.82.1 Examples</a></li>
754     </ul></li>
755     <li><a name="toc-tile" href="#tile">37.83 tile</a>
756     <ul class="toc">
757       <li><a name="toc-Examples-33" href="#Examples-33">37.83.1 Examples</a></li>
758     </ul></li>
759     <li><a name="toc-tinterlace" href="#tinterlace">37.84 tinterlace</a></li>
760     <li><a name="toc-transpose" href="#transpose">37.85 transpose</a></li>
761     <li><a name="toc-trim" href="#trim">37.86 trim</a></li>
762     <li><a name="toc-unsharp" href="#unsharp">37.87 unsharp</a>
763     <ul class="toc">
764       <li><a name="toc-Examples-63" href="#Examples-63">37.87.1 Examples</a></li>
765     </ul></li>
766     <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">37.88 vidstabdetect</a>
767     <ul class="toc">
768       <li><a name="toc-Examples-58" href="#Examples-58">37.88.1 Examples</a></li>
769     </ul></li>
770     <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">37.89 vidstabtransform</a>
771     <ul class="toc">
772       <li><a name="toc-Examples-4" href="#Examples-4">37.89.1 Examples</a></li>
773     </ul></li>
774     <li><a name="toc-vflip" href="#vflip">37.90 vflip</a></li>
775     <li><a name="toc-vignette" href="#vignette">37.91 vignette</a>
776     <ul class="toc">
777       <li><a name="toc-Expressions" href="#Expressions">37.91.1 Expressions</a></li>
778       <li><a name="toc-Examples-37" href="#Examples-37">37.91.2 Examples</a></li>
779     </ul></li>
780     <li><a name="toc-w3fdif" href="#w3fdif">37.92 w3fdif</a></li>
781     <li><a name="toc-yadif-1" href="#yadif-1">37.93 yadif</a></li>
782   </ul></li>
783   <li><a name="toc-Video-Sources" href="#Video-Sources">38. Video Sources</a>
784   <ul class="toc">
785     <li><a name="toc-buffer" href="#buffer">38.1 buffer</a></li>
786     <li><a name="toc-cellauto" href="#cellauto">38.2 cellauto</a>
787     <ul class="toc">
788       <li><a name="toc-Examples-77" href="#Examples-77">38.2.1 Examples</a></li>
789     </ul></li>
790     <li><a name="toc-mandelbrot" href="#mandelbrot">38.3 mandelbrot</a></li>
791     <li><a name="toc-mptestsrc" href="#mptestsrc">38.4 mptestsrc</a></li>
792     <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">38.5 frei0r_src</a></li>
793     <li><a name="toc-life" href="#life">38.6 life</a>
794     <ul class="toc">
795       <li><a name="toc-Examples-2" href="#Examples-2">38.6.1 Examples</a></li>
796     </ul></li>
797     <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">38.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a>
798     <ul class="toc">
799       <li><a name="toc-Commands-4" href="#Commands-4">38.7.1 Commands</a></li>
800     </ul>
801 </li>
802   </ul></li>
803   <li><a name="toc-Video-Sinks" href="#Video-Sinks">39. Video Sinks</a>
804   <ul class="toc">
805     <li><a name="toc-buffersink" href="#buffersink">39.1 buffersink</a></li>
806     <li><a name="toc-nullsink" href="#nullsink">39.2 nullsink</a></li>
807   </ul></li>
808   <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">40. Multimedia Filters</a>
809   <ul class="toc">
810     <li><a name="toc-avectorscope" href="#avectorscope">40.1 avectorscope</a>
811     <ul class="toc">
812       <li><a name="toc-Examples-72" href="#Examples-72">40.1.1 Examples</a></li>
813     </ul></li>
814     <li><a name="toc-concat-1" href="#concat-1">40.2 concat</a>
815     <ul class="toc">
816       <li><a name="toc-Examples-29" href="#Examples-29">40.2.1 Examples</a></li>
817     </ul></li>
818     <li><a name="toc-ebur128" href="#ebur128">40.3 ebur128</a>
819     <ul class="toc">
820       <li><a name="toc-Examples-92" href="#Examples-92">40.3.1 Examples</a></li>
821     </ul></li>
822     <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">40.4 interleave, ainterleave</a>
823     <ul class="toc">
824       <li><a name="toc-Examples-21" href="#Examples-21">40.4.1 Examples</a></li>
825     </ul></li>
826     <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">40.5 perms, aperms</a></li>
827     <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">40.6 select, aselect</a>
828     <ul class="toc">
829       <li><a name="toc-Examples-19" href="#Examples-19">40.6.1 Examples</a></li>
830     </ul></li>
831     <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">40.7 sendcmd, asendcmd</a>
832     <ul class="toc">
833       <li><a name="toc-Commands-syntax" href="#Commands-syntax">40.7.1 Commands syntax</a></li>
834       <li><a name="toc-Examples-59" href="#Examples-59">40.7.2 Examples</a></li>
835     </ul></li>
836     <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">40.8 setpts, asetpts</a>
837     <ul class="toc">
838       <li><a name="toc-Examples-47" href="#Examples-47">40.8.1 Examples</a></li>
839     </ul></li>
840     <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">40.9 settb, asettb</a>
841     <ul class="toc">
842       <li><a name="toc-Examples-65" href="#Examples-65">40.9.1 Examples</a></li>
843     </ul></li>
844     <li><a name="toc-showspectrum" href="#showspectrum">40.10 showspectrum</a>
845     <ul class="toc">
846       <li><a name="toc-Examples-88" href="#Examples-88">40.10.1 Examples</a></li>
847     </ul></li>
848     <li><a name="toc-showwaves" href="#showwaves">40.11 showwaves</a>
849     <ul class="toc">
850       <li><a name="toc-Examples-36" href="#Examples-36">40.11.1 Examples</a></li>
851     </ul></li>
852     <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">40.12 split, asplit</a>
853     <ul class="toc">
854       <li><a name="toc-Examples-1" href="#Examples-1">40.12.1 Examples</a></li>
855     </ul></li>
856     <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">40.13 zmq, azmq</a>
857     <ul class="toc">
858       <li><a name="toc-Examples-64" href="#Examples-64">40.13.1 Examples</a></li>
859     </ul>
860 </li>
861   </ul></li>
862   <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">41. Multimedia Sources</a>
863   <ul class="toc">
864     <li><a name="toc-amovie" href="#amovie">41.1 amovie</a></li>
865     <li><a name="toc-movie-1" href="#movie-1">41.2 movie</a>
866     <ul class="toc">
867       <li><a name="toc-Examples-60" href="#Examples-60">41.2.1 Examples</a></li>
868     </ul>
869 </li>
870   </ul></li>
871   <li><a name="toc-See-Also" href="#See-Also">42. See Also</a></li>
872   <li><a name="toc-Authors" href="#Authors">43. Authors</a></li>
873 </ul>
874 </div>
875
876 <a name="Synopsis"></a>
877 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Synopsis">1. Synopsis</a></h1>
878
879 <p>ffmpeg [<var>global_options</var>] {[<var>input_file_options</var>] -i &lsquo;<tt>input_file</tt>&rsquo;} ... {[<var>output_file_options</var>] &lsquo;<tt>output_file</tt>&rsquo;} ...
880 </p>
881 <a name="Description"></a>
882 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Description">2. Description</a></h1>
883
884 <p><code>ffmpeg</code> is a very fast video and audio converter that can also grab from
885 a live audio/video source. It can also convert between arbitrary sample
886 rates and resize video on the fly with a high quality polyphase filter.
887 </p>
888 <p><code>ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
889 files, pipes, network streams, grabbing devices, etc.), specified by the
890 <code>-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
891 specified by a plain output filename. Anything found on the command line which
892 cannot be interpreted as an option is considered to be an output filename.
893 </p>
894 <p>Each input or output file can, in principle, contain any number of streams of
895 different types (video/audio/subtitle/attachment/data). The allowed number and/or
896 types of streams may be limited by the container format. Selecting which
897 streams from which inputs will go into which output is either done automatically
898 or with the <code>-map</code> option (see the Stream selection chapter).
899 </p>
900 <p>To refer to input files in options, you must use their indices (0-based). E.g.
901 the first input file is <code>0</code>, the second is <code>1</code>, etc. Similarly, streams
902 within a file are referred to by their indices. E.g. <code>2:3</code> refers to the
903 fourth stream in the third input file. Also see the Stream specifiers chapter.
904 </p>
905 <p>As a general rule, options are applied to the next specified
906 file. Therefore, order is important, and you can have the same
907 option on the command line multiple times. Each occurrence is
908 then applied to the next input or output file.
909 Exceptions from this rule are the global options (e.g. verbosity level),
910 which should be specified first.
911 </p>
912 <p>Do not mix input and output files &ndash; first specify all input files, then all
913 output files. Also do not mix options which belong to different files. All
914 options apply ONLY to the next input or output file and are reset between files.
915 </p>
916 <ul>
917 <li>
918 To set the video bitrate of the output file to 64 kbit/s:
919 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
920 </pre></td></tr></table>
921
922 </li><li>
923 To force the frame rate of the output file to 24 fps:
924 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.avi -r 24 output.avi
925 </pre></td></tr></table>
926
927 </li><li>
928 To force the frame rate of the input file (valid for raw formats only)
929 to 1 fps and the frame rate of the output file to 24 fps:
930 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
931 </pre></td></tr></table>
932 </li></ul>
933
934 <p>The format option may be needed for raw input files.
935 </p>
936
937 <a name="Detailed-description"></a>
938 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Detailed-description">3. Detailed description</a></h1>
939
940 <p>The transcoding process in <code>ffmpeg</code> for each output can be described by
941 the following diagram:
942 </p>
943 <table><tr><td>&nbsp;</td><td><pre class="example"> _______              ______________               _________              ______________            ________
944 |       |            |              |             |         |            |              |          |        |
945 | input |  demuxer   | encoded data |   decoder   | decoded |  encoder   | encoded data |  muxer   | output |
946 | file  | ---------&gt; | packets      |  ---------&gt; | frames  | ---------&gt; | packets      | -------&gt; | file   |
947 |_______|            |______________|             |_________|            |______________|          |________|
948
949 </pre></td></tr></table>
950
951 <p><code>ffmpeg</code> calls the libavformat library (containing demuxers) to read
952 input files and get packets containing encoded data from them. When there are
953 multiple input files, <code>ffmpeg</code> tries to keep them synchronized by
954 tracking lowest timestamp on any active input stream.
955 </p>
956 <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
957 for the stream, see further for a description). The decoder produces
958 uncompressed frames (raw video/PCM audio/...) which can be processed further by
959 filtering (see next section). After filtering, the frames are passed to the
960 encoder, which encodes them and outputs encoded packets. Finally those are
961 passed to the muxer, which writes the encoded packets to the output file.
962 </p>
963 <a name="Filtering"></a>
964 <h2 class="section"><a href="ffmpeg-all.html#toc-Filtering">3.1 Filtering</a></h2>
965 <p>Before encoding, <code>ffmpeg</code> can process raw audio and video frames using
966 filters from the libavfilter library. Several chained filters form a filter
967 graph. <code>ffmpeg</code> distinguishes between two types of filtergraphs:
968 simple and complex.
969 </p>
970 <a name="Simple-filtergraphs"></a>
971 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Simple-filtergraphs">3.1.1 Simple filtergraphs</a></h3>
972 <p>Simple filtergraphs are those that have exactly one input and output, both of
973 the same type. In the above diagram they can be represented by simply inserting
974 an additional step between decoding and encoding:
975 </p>
976 <table><tr><td>&nbsp;</td><td><pre class="example"> _________                        __________              ______________
977 |         |                      |          |            |              |
978 | decoded |  simple filtergraph  | filtered |  encoder   | encoded data |
979 | frames  | -------------------&gt; | frames   | ---------&gt; | packets      |
980 |_________|                      |__________|            |______________|
981
982 </pre></td></tr></table>
983
984 <p>Simple filtergraphs are configured with the per-stream &lsquo;<samp>-filter</samp>&rsquo; option
985 (with &lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-af</samp>&rsquo; aliases for video and audio respectively).
986 A simple filtergraph for video can look for example like this:
987 </p>
988 <table><tr><td>&nbsp;</td><td><pre class="example"> _______        _____________        _______        _____        ________
989 |       |      |             |      |       |      |     |      |        |
990 | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | fps | ---&gt; | output |
991 |_______|      |_____________|      |_______|      |_____|      |________|
992
993 </pre></td></tr></table>
994
995 <p>Note that some filters change frame properties but not frame contents. E.g. the
996 <code>fps</code> filter in the example above changes number of frames, but does not
997 touch the frame contents. Another example is the <code>setpts</code> filter, which
998 only sets timestamps and otherwise passes the frames unchanged.
999 </p>
1000 <a name="Complex-filtergraphs"></a>
1001 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Complex-filtergraphs">3.1.2 Complex filtergraphs</a></h3>
1002 <p>Complex filtergraphs are those which cannot be described as simply a linear
1003 processing chain applied to one stream. This is the case, for example, when the graph has
1004 more than one input and/or output, or when output stream type is different from
1005 input. They can be represented with the following diagram:
1006 </p>
1007 <table><tr><td>&nbsp;</td><td><pre class="example"> _________
1008 |         |
1009 | input 0 |\                    __________
1010 |_________| \                  |          |
1011              \   _________    /| output 0 |
1012               \ |         |  / |__________|
1013  _________     \| complex | /
1014 |         |     |         |/
1015 | input 1 |----&gt;| filter  |\
1016 |_________|     |         | \   __________
1017                /| graph   |  \ |          |
1018               / |         |   \| output 1 |
1019  _________   /  |_________|    |__________|
1020 |         | /
1021 | input 2 |/
1022 |_________|
1023
1024 </pre></td></tr></table>
1025
1026 <p>Complex filtergraphs are configured with the &lsquo;<samp>-filter_complex</samp>&rsquo; option.
1027 Note that this option is global, since a complex filtergraph, by its nature,
1028 cannot be unambiguously associated with a single stream or file.
1029 </p>
1030 <p>The &lsquo;<samp>-lavfi</samp>&rsquo; option is equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
1031 </p>
1032 <p>A trivial example of a complex filtergraph is the <code>overlay</code> filter, which
1033 has two video inputs and one video output, containing one video overlaid on top
1034 of the other. Its audio counterpart is the <code>amix</code> filter.
1035 </p>
1036 <a name="Stream-copy"></a>
1037 <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-copy">3.2 Stream copy</a></h2>
1038 <p>Stream copy is a mode selected by supplying the <code>copy</code> parameter to the
1039 &lsquo;<samp>-codec</samp>&rsquo; option. It makes <code>ffmpeg</code> omit the decoding and encoding
1040 step for the specified stream, so it does only demuxing and muxing. It is useful
1041 for changing the container format or modifying container-level metadata. The
1042 diagram above will, in this case, simplify to this:
1043 </p>
1044 <table><tr><td>&nbsp;</td><td><pre class="example"> _______              ______________            ________
1045 |       |            |              |          |        |
1046 | input |  demuxer   | encoded data |  muxer   | output |
1047 | file  | ---------&gt; | packets      | -------&gt; | file   |
1048 |_______|            |______________|          |________|
1049
1050 </pre></td></tr></table>
1051
1052 <p>Since there is no decoding or encoding, it is very fast and there is no quality
1053 loss. However, it might not work in some cases because of many factors. Applying
1054 filters is obviously also impossible, since filters work on uncompressed data.
1055 </p>
1056
1057 <a name="Stream-selection"></a>
1058 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Stream-selection">4. Stream selection</a></h1>
1059
1060 <p>By default, <code>ffmpeg</code> includes only one stream of each type (video, audio, subtitle)
1061 present in the input files and adds them to each output file.  It picks the
1062 &quot;best&quot; of each based upon the following criteria: for video, it is the stream
1063 with the highest resolution, for audio, it is the stream with the most channels, for
1064 subtitles, it is the first subtitle stream. In the case where several streams of
1065 the same type rate equally, the stream with the lowest index is chosen.
1066 </p>
1067 <p>You can disable some of those defaults by using the <code>-vn/-an/-sn</code> options. For
1068 full manual control, use the <code>-map</code> option, which disables the defaults just
1069 described.
1070 </p>
1071
1072 <a name="Options-10"></a>
1073 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Options-10">5. Options</a></h1>
1074
1075 <p>All the numerical options, if not specified otherwise, accept a string
1076 representing a number as input, which may be followed by one of the SI
1077 unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
1078 </p>
1079 <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
1080 interpreted as a unit prefix for binary multiplies, which are based on
1081 powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
1082 prefix multiplies the value by 8. This allows using, for example:
1083 &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
1084 </p>
1085 <p>Options which do not take arguments are boolean options, and set the
1086 corresponding value to true. They can be set to false by prefixing
1087 the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
1088 will set the boolean option with name &quot;foo&quot; to false.
1089 </p>
1090 <p><a name="Stream-specifiers"></a>
1091 </p><a name="Stream-specifiers-1"></a>
1092 <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-specifiers-1">5.1 Stream specifiers</a></h2>
1093 <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
1094 are used to precisely specify which stream(s) a given option belongs to.
1095 </p>
1096 <p>A stream specifier is a string generally appended to the option name and
1097 separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
1098 <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
1099 would select the ac3 codec for the second audio stream.
1100 </p>
1101 <p>A stream specifier can match several streams, so that the option is applied to all
1102 of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
1103 streams.
1104 </p>
1105 <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
1106 or <code>-codec: copy</code> would copy all the streams without reencoding.
1107 </p>
1108 <p>Possible forms of stream specifiers are:
1109 </p><dl compact="compact">
1110 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
1111 <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
1112 thread count for the second stream to 4.
1113 </p></dd>
1114 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
1115 <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,
1116 &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If <var>stream_index</var> is given, then it matches
1117 stream number <var>stream_index</var> of this type. Otherwise, it matches all
1118 streams of this type.
1119 </p></dd>
1120 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
1121 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number <var>stream_index</var>
1122 in the program with the id <var>program_id</var>. Otherwise, it matches all streams in the
1123 program.
1124 </p></dd>
1125 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
1126 <dd><p>Matches the stream by a format-specific ID.
1127 </p></dd>
1128 </dl>
1129
1130 <a name="Generic-options"></a>
1131 <h2 class="section"><a href="ffmpeg-all.html#toc-Generic-options">5.2 Generic options</a></h2>
1132
1133 <p>These options are shared amongst the ff* tools.
1134 </p>
1135 <dl compact="compact">
1136 <dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
1137 <dd><p>Show license.
1138 </p>
1139 </dd>
1140 <dt> &lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</dt>
1141 <dd><p>Show help. An optional parameter may be specified to print help about a specific
1142 item. If no argument is specified, only basic (non advanced) tool
1143 options are shown.
1144 </p>
1145 <p>Possible values of <var>arg</var> are:
1146 </p><dl compact="compact">
1147 <dt> &lsquo;<samp>long</samp>&rsquo;</dt>
1148 <dd><p>Print advanced tool options in addition to the basic tool options.
1149 </p>
1150 </dd>
1151 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
1152 <dd><p>Print complete list of options, including shared and private options
1153 for encoders, decoders, demuxers, muxers, filters, etc.
1154 </p>
1155 </dd>
1156 <dt> &lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
1157 <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
1158 &lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
1159 </p>
1160 </dd>
1161 <dt> &lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
1162 <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
1163 &lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
1164 </p>
1165 </dd>
1166 <dt> &lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
1167 <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
1168 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
1169 </p>
1170 </dd>
1171 <dt> &lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
1172 <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
1173 &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
1174 </p>
1175 </dd>
1176 <dt> &lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
1177 <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
1178 &lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
1179 </p></dd>
1180 </dl>
1181
1182 </dd>
1183 <dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
1184 <dd><p>Show version.
1185 </p>
1186 </dd>
1187 <dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
1188 <dd><p>Show available formats.
1189 </p>
1190 </dd>
1191 <dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
1192 <dd><p>Show all codecs known to libavcodec.
1193 </p>
1194 <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
1195 for what is more correctly called a media bitstream format.
1196 </p>
1197 </dd>
1198 <dt> &lsquo;<samp>-decoders</samp>&rsquo;</dt>
1199 <dd><p>Show available decoders.
1200 </p>
1201 </dd>
1202 <dt> &lsquo;<samp>-encoders</samp>&rsquo;</dt>
1203 <dd><p>Show all available encoders.
1204 </p>
1205 </dd>
1206 <dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
1207 <dd><p>Show available bitstream filters.
1208 </p>
1209 </dd>
1210 <dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
1211 <dd><p>Show available protocols.
1212 </p>
1213 </dd>
1214 <dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
1215 <dd><p>Show available libavfilter filters.
1216 </p>
1217 </dd>
1218 <dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
1219 <dd><p>Show available pixel formats.
1220 </p>
1221 </dd>
1222 <dt> &lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
1223 <dd><p>Show available sample formats.
1224 </p>
1225 </dd>
1226 <dt> &lsquo;<samp>-layouts</samp>&rsquo;</dt>
1227 <dd><p>Show channel names and standard channel layouts.
1228 </p>
1229 </dd>
1230 <dt> &lsquo;<samp>-colors</samp>&rsquo;</dt>
1231 <dd><p>Show recognized color names.
1232 </p>
1233 </dd>
1234 <dt> &lsquo;<samp>-loglevel [repeat+]<var>loglevel</var> | -v [repeat+]<var>loglevel</var></samp>&rsquo;</dt>
1235 <dd><p>Set the logging level used by the library.
1236 Adding &quot;repeat+&quot; indicates that repeated log output should not be compressed
1237 to the first line and the &quot;Last message repeated n times&quot; line will be
1238 omitted. &quot;repeat&quot; can also be used alone.
1239 If &quot;repeat&quot; is used alone, and with no prior loglevel set, the default
1240 loglevel will be used. If multiple loglevel parameters are given, using
1241 &rsquo;repeat&rsquo; will not change the loglevel.
1242 <var>loglevel</var> is a number or a string containing one of the following values:
1243 </p><dl compact="compact">
1244 <dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
1245 <dd><p>Show nothing at all; be silent.
1246 </p></dd>
1247 <dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
1248 <dd><p>Only show fatal errors which could lead the process to crash, such as
1249 and assert failure. This is not currently used for anything.
1250 </p></dd>
1251 <dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
1252 <dd><p>Only show fatal errors. These are errors after which the process absolutely
1253 cannot continue after.
1254 </p></dd>
1255 <dt> &lsquo;<samp>error</samp>&rsquo;</dt>
1256 <dd><p>Show all errors, including ones which can be recovered from.
1257 </p></dd>
1258 <dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
1259 <dd><p>Show all warnings and errors. Any message related to possibly
1260 incorrect or unexpected events will be shown.
1261 </p></dd>
1262 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
1263 <dd><p>Show informative messages during processing. This is in addition to
1264 warnings and errors. This is the default value.
1265 </p></dd>
1266 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
1267 <dd><p>Same as <code>info</code>, except more verbose.
1268 </p></dd>
1269 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
1270 <dd><p>Show everything, including debugging information.
1271 </p></dd>
1272 </dl>
1273
1274 <p>By default the program logs to stderr, if coloring is supported by the
1275 terminal, colors are used to mark errors and warnings. Log coloring
1276 can be disabled setting the environment variable
1277 <code>AV_LOG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
1278 the environment variable <code>AV_LOG_FORCE_COLOR</code>.
1279 The use of the environment variable <code>NO_COLOR</code> is deprecated and
1280 will be dropped in a following FFmpeg version.
1281 </p>
1282 </dd>
1283 <dt> &lsquo;<samp>-report</samp>&rsquo;</dt>
1284 <dd><p>Dump full command line and console output to a file named
1285 <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
1286 directory.
1287 This file can be useful for bug reports.
1288 It also implies <code>-loglevel verbose</code>.
1289 </p>
1290 <p>Setting the environment variable <code>FFREPORT</code> to any value has the
1291 same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
1292 options will affect the report; options values must be escaped if they
1293 contain special characters or the options delimiter &rsquo;:&rsquo; (see the
1294 &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual). The
1295 following option is recognized:
1296 </p><dl compact="compact">
1297 <dt> &lsquo;<samp>file</samp>&rsquo;</dt>
1298 <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
1299 of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
1300 to a plain <code>%</code>
1301 </p></dd>
1302 </dl>
1303
1304 <p>Errors in parsing the environment variable are not fatal, and will not
1305 appear in the report.
1306 </p>
1307 </dd>
1308 <dt> &lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</dt>
1309 <dd><p>Allows setting and clearing cpu flags. This option is intended
1310 for testing. Do not use it unless you know what you&rsquo;re doing.
1311 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -cpuflags -sse+mmx ...
1312 ffmpeg -cpuflags mmx ...
1313 ffmpeg -cpuflags 0 ...
1314 </pre></td></tr></table>
1315 <p>Possible flags for this option are:
1316 </p><dl compact="compact">
1317 <dt> &lsquo;<samp>x86</samp>&rsquo;</dt>
1318 <dd><dl compact="compact">
1319 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
1320 <dt> &lsquo;<samp>mmxext</samp>&rsquo;</dt>
1321 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
1322 <dt> &lsquo;<samp>sse2</samp>&rsquo;</dt>
1323 <dt> &lsquo;<samp>sse2slow</samp>&rsquo;</dt>
1324 <dt> &lsquo;<samp>sse3</samp>&rsquo;</dt>
1325 <dt> &lsquo;<samp>sse3slow</samp>&rsquo;</dt>
1326 <dt> &lsquo;<samp>ssse3</samp>&rsquo;</dt>
1327 <dt> &lsquo;<samp>atom</samp>&rsquo;</dt>
1328 <dt> &lsquo;<samp>sse4.1</samp>&rsquo;</dt>
1329 <dt> &lsquo;<samp>sse4.2</samp>&rsquo;</dt>
1330 <dt> &lsquo;<samp>avx</samp>&rsquo;</dt>
1331 <dt> &lsquo;<samp>xop</samp>&rsquo;</dt>
1332 <dt> &lsquo;<samp>fma4</samp>&rsquo;</dt>
1333 <dt> &lsquo;<samp>3dnow</samp>&rsquo;</dt>
1334 <dt> &lsquo;<samp>3dnowext</samp>&rsquo;</dt>
1335 <dt> &lsquo;<samp>cmov</samp>&rsquo;</dt>
1336 </dl>
1337 </dd>
1338 <dt> &lsquo;<samp>ARM</samp>&rsquo;</dt>
1339 <dd><dl compact="compact">
1340 <dt> &lsquo;<samp>armv5te</samp>&rsquo;</dt>
1341 <dt> &lsquo;<samp>armv6</samp>&rsquo;</dt>
1342 <dt> &lsquo;<samp>armv6t2</samp>&rsquo;</dt>
1343 <dt> &lsquo;<samp>vfp</samp>&rsquo;</dt>
1344 <dt> &lsquo;<samp>vfpv3</samp>&rsquo;</dt>
1345 <dt> &lsquo;<samp>neon</samp>&rsquo;</dt>
1346 </dl>
1347 </dd>
1348 <dt> &lsquo;<samp>PowerPC</samp>&rsquo;</dt>
1349 <dd><dl compact="compact">
1350 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
1351 </dl>
1352 </dd>
1353 <dt> &lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
1354 <dd><dl compact="compact">
1355 <dt> &lsquo;<samp>pentium2</samp>&rsquo;</dt>
1356 <dt> &lsquo;<samp>pentium3</samp>&rsquo;</dt>
1357 <dt> &lsquo;<samp>pentium4</samp>&rsquo;</dt>
1358 <dt> &lsquo;<samp>k6</samp>&rsquo;</dt>
1359 <dt> &lsquo;<samp>k62</samp>&rsquo;</dt>
1360 <dt> &lsquo;<samp>athlon</samp>&rsquo;</dt>
1361 <dt> &lsquo;<samp>athlonxp</samp>&rsquo;</dt>
1362 <dt> &lsquo;<samp>k8</samp>&rsquo;</dt>
1363 </dl>
1364 </dd>
1365 </dl>
1366
1367 </dd>
1368 <dt> &lsquo;<samp>-opencl_bench</samp>&rsquo;</dt>
1369 <dd><p>Benchmark all available OpenCL devices and show the results. This option
1370 is only available when FFmpeg has been compiled with <code>--enable-opencl</code>.
1371 </p>
1372 </dd>
1373 <dt> &lsquo;<samp>-opencl_options options (<em>global</em>)</samp>&rsquo;</dt>
1374 <dd><p>Set OpenCL environment options. This option is only available when
1375 FFmpeg has been compiled with <code>--enable-opencl</code>.
1376 </p>
1377 <p><var>options</var> must be a list of <var>key</var>=<var>value</var> option pairs
1378 separated by &rsquo;:&rsquo;. See the &ldquo;OpenCL Options&rdquo; section in the
1379 ffmpeg-utils manual for the list of supported options.
1380 </p></dd>
1381 </dl>
1382
1383 <a name="AVOptions"></a>
1384 <h2 class="section"><a href="ffmpeg-all.html#toc-AVOptions">5.3 AVOptions</a></h2>
1385
1386 <p>These options are provided directly by the libavformat, libavdevice and
1387 libavcodec libraries. To see the list of available AVOptions, use the
1388 &lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
1389 </p><dl compact="compact">
1390 <dt> &lsquo;<samp>generic</samp>&rsquo;</dt>
1391 <dd><p>These options can be set for any container, codec or device. Generic options
1392 are listed under AVFormatContext options for containers/devices and under
1393 AVCodecContext options for codecs.
1394 </p></dd>
1395 <dt> &lsquo;<samp>private</samp>&rsquo;</dt>
1396 <dd><p>These options are specific to the given container, device or codec. Private
1397 options are listed under their corresponding containers/devices/codecs.
1398 </p></dd>
1399 </dl>
1400
1401 <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
1402 an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
1403 muxer:
1404 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
1405 </pre></td></tr></table>
1406
1407 <p>All codec AVOptions are per-stream, and thus a stream specifier
1408 should be attached to them.
1409 </p>
1410 <p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
1411 AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
1412 </p>
1413 <p>Note: the old undocumented way of specifying per-stream AVOptions by
1414 prepending v/a/s to the options name is now obsolete and will be
1415 removed soon.
1416 </p>
1417 <a name="Main-options"></a>
1418 <h2 class="section"><a href="ffmpeg-all.html#toc-Main-options">5.4 Main options</a></h2>
1419
1420 <dl compact="compact">
1421 <dt> &lsquo;<samp>-f <var>fmt</var> (<em>input/output</em>)</samp>&rsquo;</dt>
1422 <dd><p>Force input or output file format. The format is normally auto detected for input
1423 files and guessed from the file extension for output files, so this option is not
1424 needed in most cases.
1425 </p>
1426 </dd>
1427 <dt> &lsquo;<samp>-i <var>filename</var> (<em>input</em>)</samp>&rsquo;</dt>
1428 <dd><p>input file name
1429 </p>
1430 </dd>
1431 <dt> &lsquo;<samp>-y (<em>global</em>)</samp>&rsquo;</dt>
1432 <dd><p>Overwrite output files without asking.
1433 </p>
1434 </dd>
1435 <dt> &lsquo;<samp>-n (<em>global</em>)</samp>&rsquo;</dt>
1436 <dd><p>Do not overwrite output files, and exit immediately if a specified
1437 output file already exists.
1438 </p>
1439 </dd>
1440 <dt> &lsquo;<samp>-c[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1441 <dt> &lsquo;<samp>-codec[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1442 <dd><p>Select an encoder (when used before an output file) or a decoder (when used
1443 before an input file) for one or more streams. <var>codec</var> is the name of a
1444 decoder/encoder or a special value <code>copy</code> (output only) to indicate that
1445 the stream is not to be re-encoded.
1446 </p>
1447 <p>For example
1448 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
1449 </pre></td></tr></table>
1450 <p>encodes all video streams with libx264 and copies all audio streams.
1451 </p>
1452 <p>For each stream, the last matching <code>c</code> option is applied, so
1453 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
1454 </pre></td></tr></table>
1455 <p>will copy all the streams except the second video, which will be encoded with
1456 libx264, and the 138th audio, which will be encoded with libvorbis.
1457 </p>
1458 </dd>
1459 <dt> &lsquo;<samp>-t <var>duration</var> (<em>output</em>)</samp>&rsquo;</dt>
1460 <dd><p>Stop writing the output after its duration reaches <var>duration</var>.
1461 <var>duration</var> may be a number in seconds, or in <code>hh:mm:ss[.xxx]</code> form.
1462 </p>
1463 <p>-to and -t are mutually exclusive and -t has priority.
1464 </p>
1465 </dd>
1466 <dt> &lsquo;<samp>-to <var>position</var> (<em>output</em>)</samp>&rsquo;</dt>
1467 <dd><p>Stop writing the output at <var>position</var>.
1468 <var>position</var> may be a number in seconds, or in <code>hh:mm:ss[.xxx]</code> form.
1469 </p>
1470 <p>-to and -t are mutually exclusive and -t has priority.
1471 </p>
1472 </dd>
1473 <dt> &lsquo;<samp>-fs <var>limit_size</var> (<em>output</em>)</samp>&rsquo;</dt>
1474 <dd><p>Set the file size limit, expressed in bytes.
1475 </p>
1476 </dd>
1477 <dt> &lsquo;<samp>-ss <var>position</var> (<em>input/output</em>)</samp>&rsquo;</dt>
1478 <dd><p>When used as an input option (before <code>-i</code>), seeks in this input file to
1479 <var>position</var>. Note the in most formats it is not possible to seek exactly, so
1480 <code>ffmpeg</code> will seek to the closest seek point before <var>position</var>.
1481 When transcoding and &lsquo;<samp>-accurate_seek</samp>&rsquo; is enabled (the default), this
1482 extra segment between the seek point and <var>position</var> will be decoded and
1483 discarded. When doing stream copy or when &lsquo;<samp>-noaccurate_seek</samp>&rsquo; is used, it
1484 will be preserved.
1485 </p>
1486 <p>When used as an output option (before an output filename), decodes but discards
1487 input until the timestamps reach <var>position</var>.
1488 </p>
1489 <p><var>position</var> may be either in seconds or in <code>hh:mm:ss[.xxx]</code> form.
1490 </p>
1491 </dd>
1492 <dt> &lsquo;<samp>-itsoffset <var>offset</var> (<em>input</em>)</samp>&rsquo;</dt>
1493 <dd><p>Set the input time offset in seconds.
1494 <code>[-]hh:mm:ss[.xxx]</code> syntax is also supported.
1495 The offset is added to the timestamps of the input files.
1496 Specifying a positive offset means that the corresponding
1497 streams are delayed by <var>offset</var> seconds.
1498 </p>
1499 </dd>
1500 <dt> &lsquo;<samp>-timestamp <var>time</var> (<em>output</em>)</samp>&rsquo;</dt>
1501 <dd><p>Set the recording timestamp in the container.
1502 The syntax for <var>time</var> is:
1503 </p><table><tr><td>&nbsp;</td><td><pre class="example">now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...])|(HHMMSS[.m...]))[Z|z])
1504 </pre></td></tr></table>
1505 <p>If the value is &quot;now&quot; it takes the current time.
1506 Time is local time unless &rsquo;Z&rsquo; or &rsquo;z&rsquo; is appended, in which case it is
1507 interpreted as UTC.
1508 If the year-month-day part is not specified it takes the current
1509 year-month-day.
1510 </p>
1511 </dd>
1512 <dt> &lsquo;<samp>-metadata[:metadata_specifier] <var>key</var>=<var>value</var> (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
1513 <dd><p>Set a metadata key/value pair.
1514 </p>
1515 <p>An optional <var>metadata_specifier</var> may be given to set metadata
1516 on streams or chapters. See <code>-map_metadata</code> documentation for
1517 details.
1518 </p>
1519 <p>This option overrides metadata set with <code>-map_metadata</code>. It is
1520 also possible to delete metadata by using an empty value.
1521 </p>
1522 <p>For example, for setting the title in the output file:
1523 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
1524 </pre></td></tr></table>
1525
1526 <p>To set the language of the first audio stream:
1527 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -metadata:s:a:1 language=eng OUTPUT
1528 </pre></td></tr></table>
1529
1530 </dd>
1531 <dt> &lsquo;<samp>-target <var>type</var> (<em>output</em>)</samp>&rsquo;</dt>
1532 <dd><p>Specify target file type (<code>vcd</code>, <code>svcd</code>, <code>dvd</code>, <code>dv</code>,
1533 <code>dv50</code>). <var>type</var> may be prefixed with <code>pal-</code>, <code>ntsc-</code> or
1534 <code>film-</code> to use the corresponding standard. All the format options
1535 (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
1536 </p>
1537 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
1538 </pre></td></tr></table>
1539
1540 <p>Nevertheless you can specify additional options as long as you know
1541 they do not conflict with the standard, as in:
1542 </p>
1543 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
1544 </pre></td></tr></table>
1545
1546 </dd>
1547 <dt> &lsquo;<samp>-dframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
1548 <dd><p>Set the number of data frames to record. This is an alias for <code>-frames:d</code>.
1549 </p>
1550 </dd>
1551 <dt> &lsquo;<samp>-frames[:<var>stream_specifier</var>] <var>framecount</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1552 <dd><p>Stop writing to the stream after <var>framecount</var> frames.
1553 </p>
1554 </dd>
1555 <dt> &lsquo;<samp>-q[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1556 <dt> &lsquo;<samp>-qscale[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1557 <dd><p>Use fixed quality scale (VBR). The meaning of <var>q</var>/<var>qscale</var> is
1558 codec-dependent.
1559 If <var>qscale</var> is used without a <var>stream_specifier</var> then it applies only
1560 to the video stream, this is to maintain compatibility with previous behavior
1561 and as specifying the same codec specific value to 2 different codecs that is
1562 audio and video generally is not what is intended when no stream_specifier is
1563 used.
1564 </p>
1565 <p><a name="filter_005foption"></a>
1566 </p></dd>
1567 <dt> &lsquo;<samp>-filter[:<var>stream_specifier</var>] <var>filtergraph</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1568 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1569 filter the stream.
1570 </p>
1571 <p><var>filtergraph</var> is a description of the filtergraph to apply to
1572 the stream, and must have a single input and a single output of the
1573 same type of the stream. In the filtergraph, the input is associated
1574 to the label <code>in</code>, and the output to the label <code>out</code>. See
1575 the ffmpeg-filters manual for more information about the filtergraph
1576 syntax.
1577 </p>
1578 <p>See the <a href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
1579 want to create filtergraphs with multiple inputs and/or outputs.
1580 </p>
1581 </dd>
1582 <dt> &lsquo;<samp>-filter_script[:<var>stream_specifier</var>] <var>filename</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1583 <dd><p>This option is similar to &lsquo;<samp>-filter</samp>&rsquo;, the only difference is that its
1584 argument is the name of the file from which a filtergraph description is to be
1585 read.
1586 </p>
1587 </dd>
1588 <dt> &lsquo;<samp>-pre[:<var>stream_specifier</var>] <var>preset_name</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1589 <dd><p>Specify the preset for matching stream(s).
1590 </p>
1591 </dd>
1592 <dt> &lsquo;<samp>-stats (<em>global</em>)</samp>&rsquo;</dt>
1593 <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
1594 disable it you need to specify <code>-nostats</code>.
1595 </p>
1596 </dd>
1597 <dt> &lsquo;<samp>-progress <var>url</var> (<em>global</em>)</samp>&rsquo;</dt>
1598 <dd><p>Send program-friendly progress information to <var>url</var>.
1599 </p>
1600 <p>Progress information is written approximately every second and at the end of
1601 the encoding process. It is made of &quot;<var>key</var>=<var>value</var>&quot; lines. <var>key</var>
1602 consists of only alphanumeric characters. The last key of a sequence of
1603 progress information is always &quot;progress&quot;.
1604 </p>
1605 </dd>
1606 <dt> &lsquo;<samp>-stdin</samp>&rsquo;</dt>
1607 <dd><p>Enable interaction on standard input. On by default unless standard input is
1608 used as an input. To explicitly disable interaction you need to specify
1609 <code>-nostdin</code>.
1610 </p>
1611 <p>Disabling interaction on standard input is useful, for example, if
1612 ffmpeg is in the background process group. Roughly the same result can
1613 be achieved with <code>ffmpeg ... &lt; /dev/null</code> but it requires a
1614 shell.
1615 </p>
1616 </dd>
1617 <dt> &lsquo;<samp>-debug_ts (<em>global</em>)</samp>&rsquo;</dt>
1618 <dd><p>Print timestamp information. It is off by default. This option is
1619 mostly useful for testing and debugging purposes, and the output
1620 format may change from one version to another, so it should not be
1621 employed by portable scripts.
1622 </p>
1623 <p>See also the option <code>-fdebug ts</code>.
1624 </p>
1625 </dd>
1626 <dt> &lsquo;<samp>-attach <var>filename</var> (<em>output</em>)</samp>&rsquo;</dt>
1627 <dd><p>Add an attachment to the output file. This is supported by a few formats
1628 like Matroska for e.g. fonts used in rendering subtitles. Attachments
1629 are implemented as a specific type of stream, so this option will add
1630 a new stream to the file. It is then possible to use per-stream options
1631 on this stream in the usual way. Attachment streams created with this
1632 option will be created after all the other streams (i.e. those created
1633 with <code>-map</code> or automatic mappings).
1634 </p>
1635 <p>Note that for Matroska you also have to set the mimetype metadata tag:
1636 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
1637 </pre></td></tr></table>
1638 <p>(assuming that the attachment stream will be third in the output file).
1639 </p>
1640 </dd>
1641 <dt> &lsquo;<samp>-dump_attachment[:<var>stream_specifier</var>] <var>filename</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
1642 <dd><p>Extract the matching attachment stream into a file named <var>filename</var>. If
1643 <var>filename</var> is empty, then the value of the <code>filename</code> metadata tag
1644 will be used.
1645 </p>
1646 <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
1647 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
1648 </pre></td></tr></table>
1649 <p>To extract all attachments to files determined by the <code>filename</code> tag:
1650 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
1651 </pre></td></tr></table>
1652
1653 <p>Technical note &ndash; attachments are implemented as codec extradata, so this
1654 option can actually be used to extract extradata from any stream, not just
1655 attachments.
1656 </p>
1657 </dd>
1658 </dl>
1659
1660 <a name="Video-Options"></a>
1661 <h2 class="section"><a href="ffmpeg-all.html#toc-Video-Options">5.5 Video Options</a></h2>
1662
1663 <dl compact="compact">
1664 <dt> &lsquo;<samp>-vframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
1665 <dd><p>Set the number of video frames to record. This is an alias for <code>-frames:v</code>.
1666 </p></dd>
1667 <dt> &lsquo;<samp>-r[:<var>stream_specifier</var>] <var>fps</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1668 <dd><p>Set frame rate (Hz value, fraction or abbreviation).
1669 </p>
1670 <p>As an input option, ignore any timestamps stored in the file and instead
1671 generate timestamps assuming constant frame rate <var>fps</var>.
1672 </p>
1673 <p>As an output option, duplicate or drop input frames to achieve constant output
1674 frame rate <var>fps</var>.
1675 </p>
1676 </dd>
1677 <dt> &lsquo;<samp>-s[:<var>stream_specifier</var>] <var>size</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1678 <dd><p>Set frame size.
1679 </p>
1680 <p>As an input option, this is a shortcut for the &lsquo;<samp>video_size</samp>&rsquo; private
1681 option, recognized by some demuxers for which the frame size is either not
1682 stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
1683 </p>
1684 <p>As an output option, this inserts the <code>scale</code> video filter to the
1685 <em>end</em> of the corresponding filtergraph. Please use the <code>scale</code> filter
1686 directly to insert it at the beginning or some other place.
1687 </p>
1688 <p>The format is &lsquo;<samp>wxh</samp>&rsquo; (default - same as source).
1689 </p>
1690 </dd>
1691 <dt> &lsquo;<samp>-aspect[:<var>stream_specifier</var>] <var>aspect</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1692 <dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
1693 </p>
1694 <p><var>aspect</var> can be a floating point number string, or a string of the
1695 form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
1696 numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
1697 &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
1698 </p>
1699 <p>If used together with &lsquo;<samp>-vcodec copy</samp>&rsquo;, it will affect the aspect ratio
1700 stored at container level, but not the aspect ratio stored in encoded
1701 frames, if it exists.
1702 </p>
1703 </dd>
1704 <dt> &lsquo;<samp>-vn (<em>output</em>)</samp>&rsquo;</dt>
1705 <dd><p>Disable video recording.
1706 </p>
1707 </dd>
1708 <dt> &lsquo;<samp>-vcodec <var>codec</var> (<em>output</em>)</samp>&rsquo;</dt>
1709 <dd><p>Set the video codec. This is an alias for <code>-codec:v</code>.
1710 </p>
1711 </dd>
1712 <dt> &lsquo;<samp>-pass[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1713 <dd><p>Select the pass number (1 or 2). It is used to do two-pass
1714 video encoding. The statistics of the video are recorded in the first
1715 pass into a log file (see also the option -passlogfile),
1716 and in the second pass that log file is used to generate the video
1717 at the exact requested bitrate.
1718 On pass 1, you may just deactivate audio and set output to null,
1719 examples for Windows and Unix:
1720 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
1721 ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
1722 </pre></td></tr></table>
1723
1724 </dd>
1725 <dt> &lsquo;<samp>-passlogfile[:<var>stream_specifier</var>] <var>prefix</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1726 <dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
1727 prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
1728 &lsquo;<tt>PREFIX-N.log</tt>&rsquo;, where N is a number specific to the output
1729 stream
1730 </p>
1731 </dd>
1732 <dt> &lsquo;<samp>-vlang <var>code</var></samp>&rsquo;</dt>
1733 <dd><p>Set the ISO 639 language code (3 letters) of the current video stream.
1734 </p>
1735 </dd>
1736 <dt> &lsquo;<samp>-vf <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
1737 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1738 filter the stream.
1739 </p>
1740 <p>This is an alias for <code>-filter:v</code>, see the <a href="#filter_005foption">-filter option</a>.
1741 </p></dd>
1742 </dl>
1743
1744 <a name="Advanced-Video-Options"></a>
1745 <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Video-Options">5.6 Advanced Video Options</a></h2>
1746
1747 <dl compact="compact">
1748 <dt> &lsquo;<samp>-pix_fmt[:<var>stream_specifier</var>] <var>format</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1749 <dd><p>Set pixel format. Use <code>-pix_fmts</code> to show all the supported
1750 pixel formats.
1751 If the selected pixel format can not be selected, ffmpeg will print a
1752 warning and select the best pixel format supported by the encoder.
1753 If <var>pix_fmt</var> is prefixed by a <code>+</code>, ffmpeg will exit with an error
1754 if the requested pixel format can not be selected, and automatic conversions
1755 inside filtergraphs are disabled.
1756 If <var>pix_fmt</var> is a single <code>+</code>, ffmpeg selects the same pixel format
1757 as the input (or graph output) and automatic conversions are disabled.
1758 </p>
1759 </dd>
1760 <dt> &lsquo;<samp>-sws_flags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
1761 <dd><p>Set SwScaler flags.
1762 </p></dd>
1763 <dt> &lsquo;<samp>-vdt <var>n</var></samp>&rsquo;</dt>
1764 <dd><p>Discard threshold.
1765 </p>
1766 </dd>
1767 <dt> &lsquo;<samp>-rc_override[:<var>stream_specifier</var>] <var>override</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1768 <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
1769 list separated with slashes. Two first values are the beginning and
1770 end frame numbers, last one is quantizer to use if positive, or quality
1771 factor if negative.
1772 </p>
1773 </dd>
1774 <dt> &lsquo;<samp>-ilme</samp>&rsquo;</dt>
1775 <dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
1776 Use this option if your input file is interlaced and you want
1777 to keep the interlaced format for minimum losses.
1778 The alternative is to deinterlace the input stream with
1779 &lsquo;<samp>-deinterlace</samp>&rsquo;, but deinterlacing introduces losses.
1780 </p></dd>
1781 <dt> &lsquo;<samp>-psnr</samp>&rsquo;</dt>
1782 <dd><p>Calculate PSNR of compressed frames.
1783 </p></dd>
1784 <dt> &lsquo;<samp>-vstats</samp>&rsquo;</dt>
1785 <dd><p>Dump video coding statistics to &lsquo;<tt>vstats_HHMMSS.log</tt>&rsquo;.
1786 </p></dd>
1787 <dt> &lsquo;<samp>-vstats_file <var>file</var></samp>&rsquo;</dt>
1788 <dd><p>Dump video coding statistics to <var>file</var>.
1789 </p></dd>
1790 <dt> &lsquo;<samp>-top[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1791 <dd><p>top=1/bottom=0/auto=-1 field first
1792 </p></dd>
1793 <dt> &lsquo;<samp>-dc <var>precision</var></samp>&rsquo;</dt>
1794 <dd><p>Intra_dc_precision.
1795 </p></dd>
1796 <dt> &lsquo;<samp>-vtag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
1797 <dd><p>Force video tag/fourcc. This is an alias for <code>-tag:v</code>.
1798 </p></dd>
1799 <dt> &lsquo;<samp>-qphist (<em>global</em>)</samp>&rsquo;</dt>
1800 <dd><p>Show QP histogram
1801 </p></dd>
1802 <dt> &lsquo;<samp>-vbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
1803 <dd><p>Deprecated see -bsf
1804 </p>
1805 </dd>
1806 <dt> &lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] <var>time</var>[,<var>time</var>...] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1807 <dt> &lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] expr:<var>expr</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1808 <dd><p>Force key frames at the specified timestamps, more precisely at the first
1809 frames after each specified time.
1810 </p>
1811 <p>If the argument is prefixed with <code>expr:</code>, the string <var>expr</var>
1812 is interpreted like an expression and is evaluated for each frame. A
1813 key frame is forced in case the evaluation is non-zero.
1814 </p>
1815 <p>If one of the times is &quot;<code>chapters</code>[<var>delta</var>]&quot;, it is expanded into
1816 the time of the beginning of all chapters in the file, shifted by
1817 <var>delta</var>, expressed as a time in seconds.
1818 This option can be useful to ensure that a seek point is present at a
1819 chapter mark or any other designated place in the output file.
1820 </p>
1821 <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
1822 before the beginning of every chapter:
1823 </p><table><tr><td>&nbsp;</td><td><pre class="example">-force_key_frames 0:05:00,chapters-0.1
1824 </pre></td></tr></table>
1825
1826 <p>The expression in <var>expr</var> can contain the following constants:
1827 </p><dl compact="compact">
1828 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
1829 <dd><p>the number of current processed frame, starting from 0
1830 </p></dd>
1831 <dt> &lsquo;<samp>n_forced</samp>&rsquo;</dt>
1832 <dd><p>the number of forced frames
1833 </p></dd>
1834 <dt> &lsquo;<samp>prev_forced_n</samp>&rsquo;</dt>
1835 <dd><p>the number of the previous forced frame, it is <code>NAN</code> when no
1836 keyframe was forced yet
1837 </p></dd>
1838 <dt> &lsquo;<samp>prev_forced_t</samp>&rsquo;</dt>
1839 <dd><p>the time of the previous forced frame, it is <code>NAN</code> when no
1840 keyframe was forced yet
1841 </p></dd>
1842 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
1843 <dd><p>the time of the current processed frame
1844 </p></dd>
1845 </dl>
1846
1847 <p>For example to force a key frame every 5 seconds, you can specify:
1848 </p><table><tr><td>&nbsp;</td><td><pre class="example">-force_key_frames expr:gte(t,n_forced*5)
1849 </pre></td></tr></table>
1850
1851 <p>To force a key frame 5 seconds after the time of the last forced one,
1852 starting from second 13:
1853 </p><table><tr><td>&nbsp;</td><td><pre class="example">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
1854 </pre></td></tr></table>
1855
1856 <p>Note that forcing too many keyframes is very harmful for the lookahead
1857 algorithms of certain encoders: using fixed-GOP options or similar
1858 would be more efficient.
1859 </p>
1860 </dd>
1861 <dt> &lsquo;<samp>-copyinkf[:<var>stream_specifier</var>] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1862 <dd><p>When doing stream copy, copy also non-key frames found at the
1863 beginning.
1864 </p>
1865 </dd>
1866 <dt> &lsquo;<samp>-hwaccel[:<var>stream_specifier</var>] <var>hwaccel</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
1867 <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
1868 of <var>hwaccel</var> are:
1869 </p><dl compact="compact">
1870 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
1871 <dd><p>Do not use any hardware acceleration (the default).
1872 </p>
1873 </dd>
1874 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
1875 <dd><p>Automatically select the hardware acceleration method.
1876 </p>
1877 </dd>
1878 <dt> &lsquo;<samp>vdpau</samp>&rsquo;</dt>
1879 <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
1880 </p></dd>
1881 </dl>
1882
1883 <p>This option has no effect if the selected hwaccel is not available or not
1884 supported by the chosen decoder.
1885 </p>
1886 <p>Note that most acceleration methods are intended for playback and will not be
1887 faster than software decoding on modern CPUs. Additionally, <code>ffmpeg</code>
1888 will usually need to copy the decoded frames from the GPU memory into the system
1889 memory, resulting in further performance loss. This option is thus mainly
1890 useful for testing.
1891 </p>
1892 </dd>
1893 <dt> &lsquo;<samp>-hwaccel_device[:<var>stream_specifier</var>] <var>hwaccel_device</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
1894 <dd><p>Select a device to use for hardware acceleration.
1895 </p>
1896 <p>This option only makes sense when the &lsquo;<samp>-hwaccel</samp>&rsquo; option is also
1897 specified. Its exact meaning depends on the specific hardware acceleration
1898 method chosen.
1899 </p>
1900 <dl compact="compact">
1901 <dt> &lsquo;<samp>vdpau</samp>&rsquo;</dt>
1902 <dd><p>For VDPAU, this option specifies the X11 display/screen to use. If this option
1903 is not specified, the value of the <var>DISPLAY</var> environment variable is used
1904 </p></dd>
1905 </dl>
1906 </dd>
1907 </dl>
1908
1909 <a name="Audio-Options"></a>
1910 <h2 class="section"><a href="ffmpeg-all.html#toc-Audio-Options">5.7 Audio Options</a></h2>
1911
1912 <dl compact="compact">
1913 <dt> &lsquo;<samp>-aframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
1914 <dd><p>Set the number of audio frames to record. This is an alias for <code>-frames:a</code>.
1915 </p></dd>
1916 <dt> &lsquo;<samp>-ar[:<var>stream_specifier</var>] <var>freq</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1917 <dd><p>Set the audio sampling frequency. For output streams it is set by
1918 default to the frequency of the corresponding input stream. For input
1919 streams this option only makes sense for audio grabbing devices and raw
1920 demuxers and is mapped to the corresponding demuxer options.
1921 </p></dd>
1922 <dt> &lsquo;<samp>-aq <var>q</var> (<em>output</em>)</samp>&rsquo;</dt>
1923 <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
1924 </p></dd>
1925 <dt> &lsquo;<samp>-ac[:<var>stream_specifier</var>] <var>channels</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
1926 <dd><p>Set the number of audio channels. For output streams it is set by
1927 default to the number of input audio channels. For input streams
1928 this option only makes sense for audio grabbing devices and raw demuxers
1929 and is mapped to the corresponding demuxer options.
1930 </p></dd>
1931 <dt> &lsquo;<samp>-an (<em>output</em>)</samp>&rsquo;</dt>
1932 <dd><p>Disable audio recording.
1933 </p></dd>
1934 <dt> &lsquo;<samp>-acodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
1935 <dd><p>Set the audio codec. This is an alias for <code>-codec:a</code>.
1936 </p></dd>
1937 <dt> &lsquo;<samp>-sample_fmt[:<var>stream_specifier</var>] <var>sample_fmt</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
1938 <dd><p>Set the audio sample format. Use <code>-sample_fmts</code> to get a list
1939 of supported sample formats.
1940 </p>
1941 </dd>
1942 <dt> &lsquo;<samp>-af <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
1943 <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
1944 filter the stream.
1945 </p>
1946 <p>This is an alias for <code>-filter:a</code>, see the <a href="#filter_005foption">-filter option</a>.
1947 </p></dd>
1948 </dl>
1949
1950 <a name="Advanced-Audio-options_003a"></a>
1951 <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Audio-options_003a">5.8 Advanced Audio options:</a></h2>
1952
1953 <dl compact="compact">
1954 <dt> &lsquo;<samp>-atag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
1955 <dd><p>Force audio tag/fourcc. This is an alias for <code>-tag:a</code>.
1956 </p></dd>
1957 <dt> &lsquo;<samp>-absf <var>bitstream_filter</var></samp>&rsquo;</dt>
1958 <dd><p>Deprecated, see -bsf
1959 </p></dd>
1960 <dt> &lsquo;<samp>-guess_layout_max <var>channels</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
1961 <dd><p>If some input channel layout is not known, try to guess only if it
1962 corresponds to at most the specified number of channels. For example, 2
1963 tells to <code>ffmpeg</code> to recognize 1 channel as mono and 2 channels as
1964 stereo but not 6 channels as 5.1. The default is to always try to guess. Use
1965 0 to disable all guessing.
1966 </p></dd>
1967 </dl>
1968
1969 <a name="Subtitle-options_003a"></a>
1970 <h2 class="section"><a href="ffmpeg-all.html#toc-Subtitle-options_003a">5.9 Subtitle options:</a></h2>
1971
1972 <dl compact="compact">
1973 <dt> &lsquo;<samp>-slang <var>code</var></samp>&rsquo;</dt>
1974 <dd><p>Set the ISO 639 language code (3 letters) of the current subtitle stream.
1975 </p></dd>
1976 <dt> &lsquo;<samp>-scodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
1977 <dd><p>Set the subtitle codec. This is an alias for <code>-codec:s</code>.
1978 </p></dd>
1979 <dt> &lsquo;<samp>-sn (<em>output</em>)</samp>&rsquo;</dt>
1980 <dd><p>Disable subtitle recording.
1981 </p></dd>
1982 <dt> &lsquo;<samp>-sbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
1983 <dd><p>Deprecated, see -bsf
1984 </p></dd>
1985 </dl>
1986
1987 <a name="Advanced-Subtitle-options_003a"></a>
1988 <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Subtitle-options_003a">5.10 Advanced Subtitle options:</a></h2>
1989
1990 <dl compact="compact">
1991 <dt> &lsquo;<samp>-fix_sub_duration</samp>&rsquo;</dt>
1992 <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
1993 same stream and adjust the duration of the first to avoid overlap. This is
1994 necessary with some subtitles codecs, especially DVB subtitles, because the
1995 duration in the original packet is only a rough estimate and the end is
1996 actually marked by an empty subtitle frame. Failing to use this option when
1997 necessary can result in exaggerated durations or muxing failures due to
1998 non-monotonic timestamps.
1999 </p>
2000 <p>Note that this option will delay the output of all data until the next
2001 subtitle packet is decoded: it may increase memory consumption and latency a
2002 lot.
2003 </p>
2004 </dd>
2005 <dt> &lsquo;<samp>-canvas_size <var>size</var></samp>&rsquo;</dt>
2006 <dd><p>Set the size of the canvas used to render subtitles.
2007 </p>
2008 </dd>
2009 </dl>
2010
2011 <a name="Advanced-options"></a>
2012 <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-options">5.11 Advanced options</a></h2>
2013
2014 <dl compact="compact">
2015 <dt> &lsquo;<samp>-map [-]<var>input_file_id</var>[:<var>stream_specifier</var>][,<var>sync_file_id</var>[:<var>stream_specifier</var>]] | <var>[linklabel]</var> (<em>output</em>)</samp>&rsquo;</dt>
2016 <dd>
2017 <p>Designate one or more input streams as a source for the output file. Each input
2018 stream is identified by the input file index <var>input_file_id</var> and
2019 the input stream index <var>input_stream_id</var> within the input
2020 file. Both indices start at 0. If specified,
2021 <var>sync_file_id</var>:<var>stream_specifier</var> sets which input stream
2022 is used as a presentation sync reference.
2023 </p>
2024 <p>The first <code>-map</code> option on the command line specifies the
2025 source for output stream 0, the second <code>-map</code> option specifies
2026 the source for output stream 1, etc.
2027 </p>
2028 <p>A <code>-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
2029 It disables matching streams from already created mappings.
2030 </p>
2031 <p>An alternative <var>[linklabel]</var> form will map outputs from complex filter
2032 graphs (see the &lsquo;<samp>-filter_complex</samp>&rsquo; option) to the output file.
2033 <var>linklabel</var> must correspond to a defined output link label in the graph.
2034 </p>
2035 <p>For example, to map ALL streams from the first input file to output
2036 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0 output
2037 </pre></td></tr></table>
2038
2039 <p>For example, if you have two audio streams in the first input file,
2040 these streams are identified by &quot;0:0&quot; and &quot;0:1&quot;. You can use
2041 <code>-map</code> to select which streams to place in an output file. For
2042 example:
2043 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0:1 out.wav
2044 </pre></td></tr></table>
2045 <p>will map the input stream in &lsquo;<tt>INPUT</tt>&rsquo; identified by &quot;0:1&quot; to
2046 the (single) output stream in &lsquo;<tt>out.wav</tt>&rsquo;.
2047 </p>
2048 <p>For example, to select the stream with index 2 from input file
2049 &lsquo;<tt>a.mov</tt>&rsquo; (specified by the identifier &quot;0:2&quot;), and stream with
2050 index 6 from input &lsquo;<tt>b.mov</tt>&rsquo; (specified by the identifier &quot;1:6&quot;),
2051 and copy them to the output file &lsquo;<tt>out.mov</tt>&rsquo;:
2052 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
2053 </pre></td></tr></table>
2054
2055 <p>To select all video and the third audio stream from an input file:
2056 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
2057 </pre></td></tr></table>
2058
2059 <p>To map all the streams except the second audio, use negative mappings
2060 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
2061 </pre></td></tr></table>
2062
2063 <p>Note that using this option disables the default mappings for this output file.
2064 </p>
2065 </dd>
2066 <dt> &lsquo;<samp>-map_channel [<var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var>|-1][:<var>output_file_id</var>.<var>stream_specifier</var>]</samp>&rsquo;</dt>
2067 <dd><p>Map an audio channel from a given input to an output. If
2068 <var>output_file_id</var>.<var>stream_specifier</var> is not set, the audio channel will
2069 be mapped on all the audio streams.
2070 </p>
2071 <p>Using &quot;-1&quot; instead of
2072 <var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var> will map a muted
2073 channel.
2074 </p>
2075 <p>For example, assuming <var>INPUT</var> is a stereo audio file, you can switch the
2076 two audio channels with the following command:
2077 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
2078 </pre></td></tr></table>
2079
2080 <p>If you want to mute the first channel and keep the second:
2081 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
2082 </pre></td></tr></table>
2083
2084 <p>The order of the &quot;-map_channel&quot; option specifies the order of the channels in
2085 the output stream. The output channel layout is guessed from the number of
2086 channels mapped (mono if one &quot;-map_channel&quot;, stereo if two, etc.). Using &quot;-ac&quot;
2087 in combination of &quot;-map_channel&quot; makes the channel gain levels to be updated if
2088 input and output channel layouts don&rsquo;t match (for instance two &quot;-map_channel&quot;
2089 options and &quot;-ac 6&quot;).
2090 </p>
2091 <p>You can also extract each channel of an input to specific outputs; the following
2092 command extracts two channels of the <var>INPUT</var> audio stream (file 0, stream 0)
2093 to the respective <var>OUTPUT_CH0</var> and <var>OUTPUT_CH1</var> outputs:
2094 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
2095 </pre></td></tr></table>
2096
2097 <p>The following example splits the channels of a stereo input into two separate
2098 streams, which are put into the same output file:
2099 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
2100 </pre></td></tr></table>
2101
2102 <p>Note that currently each output stream can only contain channels from a single
2103 input stream; you can&rsquo;t for example use &quot;-map_channel&quot; to pick multiple input
2104 audio channels contained in different streams (from the same or different files)
2105 and merge them into a single output stream. It is therefore not currently
2106 possible, for example, to turn two separate mono streams into a single stereo
2107 stream. However splitting a stereo stream into two single channel mono streams
2108 is possible.
2109 </p>
2110 <p>If you need this feature, a possible workaround is to use the <em>amerge</em>
2111 filter. For example, if you need to merge a media (here &lsquo;<tt>input.mkv</tt>&rsquo;) with 2
2112 mono audio streams into one single stereo channel audio stream (and keep the
2113 video stream), you can use the following command:
2114 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1] [0:2] amerge&quot; -c:a pcm_s16le -c:v copy output.mkv
2115 </pre></td></tr></table>
2116
2117 </dd>
2118 <dt> &lsquo;<samp>-map_metadata[:<var>metadata_spec_out</var>] <var>infile</var>[:<var>metadata_spec_in</var>] (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
2119 <dd><p>Set metadata information of the next output file from <var>infile</var>. Note that
2120 those are file indices (zero-based), not filenames.
2121 Optional <var>metadata_spec_in/out</var> parameters specify, which metadata to copy.
2122 A metadata specifier can have the following forms:
2123 </p><dl compact="compact">
2124 <dt> &lsquo;<samp><var>g</var></samp>&rsquo;</dt>
2125 <dd><p>global metadata, i.e. metadata that applies to the whole file
2126 </p>
2127 </dd>
2128 <dt> &lsquo;<samp><var>s</var>[:<var>stream_spec</var>]</samp>&rsquo;</dt>
2129 <dd><p>per-stream metadata. <var>stream_spec</var> is a stream specifier as described
2130 in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
2131 matching stream is copied from. In an output metadata specifier, all matching
2132 streams are copied to.
2133 </p>
2134 </dd>
2135 <dt> &lsquo;<samp><var>c</var>:<var>chapter_index</var></samp>&rsquo;</dt>
2136 <dd><p>per-chapter metadata. <var>chapter_index</var> is the zero-based chapter index.
2137 </p>
2138 </dd>
2139 <dt> &lsquo;<samp><var>p</var>:<var>program_index</var></samp>&rsquo;</dt>
2140 <dd><p>per-program metadata. <var>program_index</var> is the zero-based program index.
2141 </p></dd>
2142 </dl>
2143 <p>If metadata specifier is omitted, it defaults to global.
2144 </p>
2145 <p>By default, global metadata is copied from the first input file,
2146 per-stream and per-chapter metadata is copied along with streams/chapters. These
2147 default mappings are disabled by creating any mapping of the relevant type. A negative
2148 file index can be used to create a dummy mapping that just disables automatic copying.
2149 </p>
2150 <p>For example to copy metadata from the first stream of the input file to global metadata
2151 of the output file:
2152 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
2153 </pre></td></tr></table>
2154
2155 <p>To do the reverse, i.e. copy global metadata to all audio streams:
2156 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
2157 </pre></td></tr></table>
2158 <p>Note that simple <code>0</code> would work as well in this example, since global
2159 metadata is assumed by default.
2160 </p>
2161 </dd>
2162 <dt> &lsquo;<samp>-map_chapters <var>input_file_index</var> (<em>output</em>)</samp>&rsquo;</dt>
2163 <dd><p>Copy chapters from input file with index <var>input_file_index</var> to the next
2164 output file. If no chapter mapping is specified, then chapters are copied from
2165 the first input file with at least one chapter. Use a negative file index to
2166 disable any chapter copying.
2167 </p>
2168 </dd>
2169 <dt> &lsquo;<samp>-benchmark (<em>global</em>)</samp>&rsquo;</dt>
2170 <dd><p>Show benchmarking information at the end of an encode.
2171 Shows CPU time used and maximum memory consumption.
2172 Maximum memory consumption is not supported on all systems,
2173 it will usually display as 0 if not supported.
2174 </p></dd>
2175 <dt> &lsquo;<samp>-benchmark_all (<em>global</em>)</samp>&rsquo;</dt>
2176 <dd><p>Show benchmarking information during the encode.
2177 Shows CPU time used in various steps (audio/video encode/decode).
2178 </p></dd>
2179 <dt> &lsquo;<samp>-timelimit <var>duration</var> (<em>global</em>)</samp>&rsquo;</dt>
2180 <dd><p>Exit after ffmpeg has been running for <var>duration</var> seconds.
2181 </p></dd>
2182 <dt> &lsquo;<samp>-dump (<em>global</em>)</samp>&rsquo;</dt>
2183 <dd><p>Dump each input packet to stderr.
2184 </p></dd>
2185 <dt> &lsquo;<samp>-hex (<em>global</em>)</samp>&rsquo;</dt>
2186 <dd><p>When dumping packets, also dump the payload.
2187 </p></dd>
2188 <dt> &lsquo;<samp>-re (<em>input</em>)</samp>&rsquo;</dt>
2189 <dd><p>Read input at native frame rate. Mainly used to simulate a grab device.
2190 or live input stream (e.g. when reading from a file). Should not be used
2191 with actual grab devices or live input streams (where it can cause packet
2192 loss).
2193 By default <code>ffmpeg</code> attempts to read the input(s) as fast as possible.
2194 This option will slow down the reading of the input(s) to the native frame rate
2195 of the input(s). It is useful for real-time output (e.g. live streaming).
2196 </p></dd>
2197 <dt> &lsquo;<samp>-loop_input</samp>&rsquo;</dt>
2198 <dd><p>Loop over the input stream. Currently it works only for image
2199 streams. This option is used for automatic FFserver testing.
2200 This option is deprecated, use -loop 1.
2201 </p></dd>
2202 <dt> &lsquo;<samp>-loop_output <var>number_of_times</var></samp>&rsquo;</dt>
2203 <dd><p>Repeatedly loop output for formats that support looping such as animated GIF
2204 (0 will loop the output infinitely).
2205 This option is deprecated, use -loop.
2206 </p></dd>
2207 <dt> &lsquo;<samp>-vsync <var>parameter</var></samp>&rsquo;</dt>
2208 <dd><p>Video sync method.
2209 For compatibility reasons old values can be specified as numbers.
2210 Newly added values will have to be specified as strings always.
2211 </p>
2212 <dl compact="compact">
2213 <dt> &lsquo;<samp>0, passthrough</samp>&rsquo;</dt>
2214 <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
2215 </p></dd>
2216 <dt> &lsquo;<samp>1, cfr</samp>&rsquo;</dt>
2217 <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
2218 constant frame rate.
2219 </p></dd>
2220 <dt> &lsquo;<samp>2, vfr</samp>&rsquo;</dt>
2221 <dd><p>Frames are passed through with their timestamp or dropped so as to
2222 prevent 2 frames from having the same timestamp.
2223 </p></dd>
2224 <dt> &lsquo;<samp>drop</samp>&rsquo;</dt>
2225 <dd><p>As passthrough but destroys all timestamps, making the muxer generate
2226 fresh timestamps based on frame-rate.
2227 </p></dd>
2228 <dt> &lsquo;<samp>-1, auto</samp>&rsquo;</dt>
2229 <dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
2230 default method.
2231 </p></dd>
2232 </dl>
2233
2234 <p>Note that the timestamps may be further modified by the muxer, after this.
2235 For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
2236 is enabled.
2237 </p>
2238 <p>With -map you can select from which stream the timestamps should be
2239 taken. You can leave either video or audio unchanged and sync the
2240 remaining stream(s) to the unchanged one.
2241 </p>
2242 </dd>
2243 <dt> &lsquo;<samp>-async <var>samples_per_second</var></samp>&rsquo;</dt>
2244 <dd><p>Audio sync method. &quot;Stretches/squeezes&quot; the audio stream to match the timestamps,
2245 the parameter is the maximum samples per second by which the audio is changed.
2246 -async 1 is a special case where only the start of the audio stream is corrected
2247 without any later correction.
2248 </p>
2249 <p>Note that the timestamps may be further modified by the muxer, after this.
2250 For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
2251 is enabled.
2252 </p>
2253 <p>This option has been deprecated. Use the <code>aresample</code> audio filter instead.
2254 </p>
2255 </dd>
2256 <dt> &lsquo;<samp>-copyts</samp>&rsquo;</dt>
2257 <dd><p>Do not process input timestamps, but keep their values without trying
2258 to sanitize them. In particular, do not remove the initial start time
2259 offset value.
2260 </p>
2261 <p>Note that, depending on the &lsquo;<samp>vsync</samp>&rsquo; option or on specific muxer
2262 processing (e.g. in case the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
2263 is enabled) the output timestamps may mismatch with the input
2264 timestamps even when this option is selected.
2265 </p>
2266 </dd>
2267 <dt> &lsquo;<samp>-copytb <var>mode</var></samp>&rsquo;</dt>
2268 <dd><p>Specify how to set the encoder timebase when stream copying.  <var>mode</var> is an
2269 integer numeric value, and can assume one of the following values:
2270 </p>
2271 <dl compact="compact">
2272 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
2273 <dd><p>Use the demuxer timebase.
2274 </p>
2275 <p>The time base is copied to the output encoder from the corresponding input
2276 demuxer. This is sometimes required to avoid non monotonically increasing
2277 timestamps when copying video streams with variable frame rate.
2278 </p>
2279 </dd>
2280 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
2281 <dd><p>Use the decoder timebase.
2282 </p>
2283 <p>The time base is copied to the output encoder from the corresponding input
2284 decoder.
2285 </p>
2286 </dd>
2287 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
2288 <dd><p>Try to make the choice automatically, in order to generate a sane output.
2289 </p></dd>
2290 </dl>
2291
2292 <p>Default value is -1.
2293 </p>
2294 </dd>
2295 <dt> &lsquo;<samp>-shortest (<em>output</em>)</samp>&rsquo;</dt>
2296 <dd><p>Finish encoding when the shortest input stream ends.
2297 </p></dd>
2298 <dt> &lsquo;<samp>-dts_delta_threshold</samp>&rsquo;</dt>
2299 <dd><p>Timestamp discontinuity delta threshold.
2300 </p></dd>
2301 <dt> &lsquo;<samp>-muxdelay <var>seconds</var> (<em>input</em>)</samp>&rsquo;</dt>
2302 <dd><p>Set the maximum demux-decode delay.
2303 </p></dd>
2304 <dt> &lsquo;<samp>-muxpreload <var>seconds</var> (<em>input</em>)</samp>&rsquo;</dt>
2305 <dd><p>Set the initial demux-decode delay.
2306 </p></dd>
2307 <dt> &lsquo;<samp>-streamid <var>output-stream-index</var>:<var>new-value</var> (<em>output</em>)</samp>&rsquo;</dt>
2308 <dd><p>Assign a new stream-id value to an output stream. This option should be
2309 specified prior to the output filename to which it applies.
2310 For the situation where multiple output files exist, a streamid
2311 may be reassigned to a different value.
2312 </p>
2313 <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
2314 an output mpegts file:
2315 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
2316 </pre></td></tr></table>
2317
2318 </dd>
2319 <dt> &lsquo;<samp>-bsf[:<var>stream_specifier</var>] <var>bitstream_filters</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
2320 <dd><p>Set bitstream filters for matching streams. <var>bitstream_filters</var> is
2321 a comma-separated list of bitstream filters. Use the <code>-bsfs</code> option
2322 to get the list of bitstream filters.
2323 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
2324 </pre></td></tr></table>
2325 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
2326 </pre></td></tr></table>
2327
2328 </dd>
2329 <dt> &lsquo;<samp>-tag[:<var>stream_specifier</var>] <var>codec_tag</var> (<em>per-stream</em>)</samp>&rsquo;</dt>
2330 <dd><p>Force a tag/fourcc for matching streams.
2331 </p>
2332 </dd>
2333 <dt> &lsquo;<samp>-timecode <var>hh</var>:<var>mm</var>:<var>ss</var>SEP<var>ff</var></samp>&rsquo;</dt>
2334 <dd><p>Specify Timecode for writing. <var>SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
2335 (or &rsquo;.&rsquo;) for drop.
2336 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
2337 </pre></td></tr></table>
2338
2339 <p><a name="filter_005fcomplex_005foption"></a>
2340 </p></dd>
2341 <dt> &lsquo;<samp>-filter_complex <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
2342 <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
2343 outputs. For simple graphs &ndash; those with one input and one output of the same
2344 type &ndash; see the &lsquo;<samp>-filter</samp>&rsquo; options. <var>filtergraph</var> is a description of
2345 the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
2346 ffmpeg-filters manual.
2347 </p>
2348 <p>Input link labels must refer to input streams using the
2349 <code>[file_index:stream_specifier]</code> syntax (i.e. the same as &lsquo;<samp>-map</samp>&rsquo;
2350 uses). If <var>stream_specifier</var> matches multiple streams, the first one will be
2351 used. An unlabeled input will be connected to the first unused input stream of
2352 the matching type.
2353 </p>
2354 <p>Output link labels are referred to with &lsquo;<samp>-map</samp>&rsquo;. Unlabeled outputs are
2355 added to the first output file.
2356 </p>
2357 <p>Note that with this option it is possible to use only lavfi sources without
2358 normal input files.
2359 </p>
2360 <p>For example, to overlay an image over video
2361 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
2362 '[out]' out.mkv
2363 </pre></td></tr></table>
2364 <p>Here <code>[0:v]</code> refers to the first video stream in the first input file,
2365 which is linked to the first (main) input of the overlay filter. Similarly the
2366 first video stream in the second input is linked to the second (overlay) input
2367 of overlay.
2368 </p>
2369 <p>Assuming there is only one video stream in each input file, we can omit input
2370 labels, so the above is equivalent to
2371 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
2372 '[out]' out.mkv
2373 </pre></td></tr></table>
2374
2375 <p>Furthermore we can omit the output label and the single output from the filter
2376 graph will be added to the output file automatically, so we can simply write
2377 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
2378 </pre></td></tr></table>
2379
2380 <p>To generate 5 seconds of pure red video using lavfi <code>color</code> source:
2381 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
2382 </pre></td></tr></table>
2383
2384 </dd>
2385 <dt> &lsquo;<samp>-lavfi <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
2386 <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
2387 outputs. Equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
2388 </p>
2389 </dd>
2390 <dt> &lsquo;<samp>-filter_complex_script <var>filename</var> (<em>global</em>)</samp>&rsquo;</dt>
2391 <dd><p>This option is similar to &lsquo;<samp>-filter_complex</samp>&rsquo;, the only difference is that
2392 its argument is the name of the file from which a complex filtergraph
2393 description is to be read.
2394 </p>
2395 </dd>
2396 <dt> &lsquo;<samp>-accurate_seek (<em>input</em>)</samp>&rsquo;</dt>
2397 <dd><p>This option enables or disables accurate seeking in input files with the
2398 &lsquo;<samp>-ss</samp>&rsquo; option. It is enabled by default, so seeking is accurate when
2399 transcoding. Use &lsquo;<samp>-noaccurate_seek</samp>&rsquo; to disable it, which may be useful
2400 e.g. when copying some streams and transcoding the others.
2401 </p>
2402 </dd>
2403 <dt> &lsquo;<samp>-override_ffserver (<em>global</em>)</samp>&rsquo;</dt>
2404 <dd><p>Overrides the input specifications from <code>ffserver</code>. Using this
2405 option you can map any input stream to <code>ffserver</code> and control
2406 many aspects of the encoding from <code>ffmpeg</code>. Without this
2407 option <code>ffmpeg</code> will transmit to <code>ffserver</code> what is
2408 requested by <code>ffserver</code>.
2409 </p>
2410 <p>The option is intended for cases where features are needed that cannot be
2411 specified to <code>ffserver</code> but can be to <code>ffmpeg</code>.
2412 </p>
2413 </dd>
2414 </dl>
2415
2416 <p>As a special exception, you can use a bitmap subtitle stream as input: it
2417 will be converted into a video with the same size as the largest video in
2418 the file, or 720x576 if no video is present. Note that this is an
2419 experimental and temporary solution. It will be removed once libavfilter has
2420 proper support for subtitles.
2421 </p>
2422 <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
2423 MPEG-TS format, delaying the subtitles by 1 second:
2424 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.ts -filter_complex \
2425   '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
2426   -sn -map '#0x2dc' output.mkv
2427 </pre></td></tr></table>
2428 <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
2429 audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
2430 </p>
2431 <a name="Preset-files"></a>
2432 <h2 class="section"><a href="ffmpeg-all.html#toc-Preset-files">5.12 Preset files</a></h2>
2433 <p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
2434 one for each line, specifying a sequence of options which would be
2435 awkward to specify on the command line. Lines starting with the hash
2436 (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
2437 the &lsquo;<tt>presets</tt>&rsquo; directory in the FFmpeg source tree for examples.
2438 </p>
2439 <p>Preset files are specified with the <code>vpre</code>, <code>apre</code>,
2440 <code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
2441 filename of the preset instead of a preset name as input and can be
2442 used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
2443 <code>spre</code> options, the options specified in a preset file are
2444 applied to the currently selected codec of the same type as the preset
2445 option.
2446 </p>
2447 <p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
2448 preset options identifies the preset file to use according to the
2449 following rules:
2450 </p>
2451 <p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
2452 directories &lsquo;<tt>$FFMPEG_DATADIR</tt>&rsquo; (if set), and &lsquo;<tt>$HOME/.ffmpeg</tt>&rsquo;, and in
2453 the datadir defined at configuration time (usually &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;)
2454 or in a &lsquo;<tt>ffpresets</tt>&rsquo; folder along the executable on win32,
2455 in that order. For example, if the argument is <code>libvpx-1080p</code>, it will
2456 search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
2457 </p>
2458 <p>If no such file is found, then ffmpeg will search for a file named
2459 <var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
2460 directories, where <var>codec_name</var> is the name of the codec to which
2461 the preset file options will be applied. For example, if you select
2462 the video codec with <code>-vcodec libvpx</code> and use <code>-vpre 1080p</code>,
2463 then it will search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
2464 </p>
2465 <a name="Tips"></a>
2466 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Tips">6. Tips</a></h1>
2467
2468 <ul>
2469 <li>
2470 For streaming at very low bitrates, use a low frame rate
2471 and a small GOP size. This is especially true for RealVideo where
2472 the Linux player does not seem to be very fast, so it can miss
2473 frames. An example is:
2474
2475 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
2476 </pre></td></tr></table>
2477
2478 </li><li>
2479 The parameter &rsquo;q&rsquo; which is displayed while encoding is the current
2480 quantizer. The value 1 indicates that a very good quality could
2481 be achieved. The value 31 indicates the worst quality. If q=31 appears
2482 too often, it means that the encoder cannot compress enough to meet
2483 your bitrate. You must either increase the bitrate, decrease the
2484 frame rate or decrease the frame size.
2485
2486 </li><li>
2487 If your computer is not fast enough, you can speed up the
2488 compression at the expense of the compression ratio. You can use
2489 &rsquo;-me zero&rsquo; to speed up motion estimation, and &rsquo;-g 0&rsquo; to disable
2490 motion estimation completely (you have only I-frames, which means it
2491 is about as good as JPEG compression).
2492
2493 </li><li>
2494 To have very low audio bitrates, reduce the sampling frequency
2495 (down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
2496
2497 </li><li>
2498 To have a constant quality (but a variable bitrate), use the option
2499 &rsquo;-qscale n&rsquo; when &rsquo;n&rsquo; is between 1 (excellent quality) and 31 (worst
2500 quality).
2501
2502 </li></ul>
2503
2504 <a name="Examples-28"></a>
2505 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Examples-28">7. Examples</a></h1>
2506
2507 <a name="Preset-files-1"></a>
2508 <h2 class="section"><a href="ffmpeg-all.html#toc-Preset-files-1">7.1 Preset files</a></h2>
2509
2510 <p>A preset file contains a sequence of <var>option=value</var> pairs, one for
2511 each line, specifying a sequence of options which can be specified also on
2512 the command line. Lines starting with the hash (&rsquo;#&rsquo;) character are ignored and
2513 are used to provide comments. Empty lines are also ignored. Check the
2514 &lsquo;<tt>presets</tt>&rsquo; directory in the FFmpeg source tree for examples.
2515 </p>
2516 <p>Preset files are specified with the <code>pre</code> option, this option takes a
2517 preset name as input.  FFmpeg searches for a file named <var>preset_name</var>.avpreset in
2518 the directories &lsquo;<tt>$AVCONV_DATADIR</tt>&rsquo; (if set), and &lsquo;<tt>$HOME/.ffmpeg</tt>&rsquo;, and in
2519 the data directory defined at configuration time (usually &lsquo;<tt>$PREFIX/share/ffmpeg</tt>&rsquo;)
2520 in that order.  For example, if the argument is <code>libx264-max</code>, it will
2521 search for the file &lsquo;<tt>libx264-max.avpreset</tt>&rsquo;.
2522 </p>
2523 <a name="Video-and-Audio-grabbing"></a>
2524 <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-grabbing">7.2 Video and Audio grabbing</a></h2>
2525
2526 <p>If you specify the input format and device then ffmpeg can grab video
2527 and audio directly.
2528 </p>
2529 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
2530 </pre></td></tr></table>
2531
2532 <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
2533 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
2534 </pre></td></tr></table>
2535
2536 <p>Note that you must activate the right video source and channel before
2537 launching ffmpeg with any TV viewer such as
2538 <a href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
2539 have to set the audio recording levels correctly with a
2540 standard mixer.
2541 </p>
2542 <a name="X11-grabbing"></a>
2543 <h2 class="section"><a href="ffmpeg-all.html#toc-X11-grabbing">7.3 X11 grabbing</a></h2>
2544
2545 <p>Grab the X11 display with ffmpeg via
2546 </p>
2547 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
2548 </pre></td></tr></table>
2549
2550 <p>0.0 is display.screen number of your X11 server, same as
2551 the DISPLAY environment variable.
2552 </p>
2553 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
2554 </pre></td></tr></table>
2555
2556 <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
2557 variable. 10 is the x-offset and 20 the y-offset for the grabbing.
2558 </p>
2559 <a name="Video-and-Audio-file-format-conversion"></a>
2560 <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-file-format-conversion">7.4 Video and Audio file format conversion</a></h2>
2561
2562 <p>Any supported file format and protocol can serve as input to ffmpeg:
2563 </p>
2564 <p>Examples:
2565 </p><ul>
2566 <li>
2567 You can use YUV files as input:
2568
2569 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
2570 </pre></td></tr></table>
2571
2572 <p>It will use the files:
2573 </p><table><tr><td>&nbsp;</td><td><pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
2574 /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
2575 </pre></td></tr></table>
2576
2577 <p>The Y files use twice the resolution of the U and V files. They are
2578 raw files, without header. They can be generated by all decent video
2579 decoders. You must specify the size of the image with the &lsquo;<samp>-s</samp>&rsquo; option
2580 if ffmpeg cannot guess it.
2581 </p>
2582 </li><li>
2583 You can input from a raw YUV420P file:
2584
2585 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
2586 </pre></td></tr></table>
2587
2588 <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
2589 of the Y plane followed by the U and V planes at half vertical and
2590 horizontal resolution.
2591 </p>
2592 </li><li>
2593 You can output to a raw YUV420P file:
2594
2595 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
2596 </pre></td></tr></table>
2597
2598 </li><li>
2599 You can set several input files and output files:
2600
2601 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
2602 </pre></td></tr></table>
2603
2604 <p>Converts the audio file a.wav and the raw YUV video file a.yuv
2605 to MPEG file a.mpg.
2606 </p>
2607 </li><li>
2608 You can also do audio and video conversions at the same time:
2609
2610 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
2611 </pre></td></tr></table>
2612
2613 <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
2614 </p>
2615 </li><li>
2616 You can encode to several formats at the same time and define a
2617 mapping from input stream to output streams:
2618
2619 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
2620 </pre></td></tr></table>
2621
2622 <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
2623 file:index&rsquo; specifies which input stream is used for each output
2624 stream, in the order of the definition of output streams.
2625 </p>
2626 </li><li>
2627 You can transcode decrypted VOBs:
2628
2629 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
2630 </pre></td></tr></table>
2631
2632 <p>This is a typical DVD ripping example; the input is a VOB file, the
2633 output an AVI file with MPEG-4 video and MP3 audio. Note that in this
2634 command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
2635 GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
2636 input video. Furthermore, the audio stream is MP3-encoded so you need
2637 to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
2638 The mapping is particularly useful for DVD transcoding
2639 to get the desired audio language.
2640 </p>
2641 <p>NOTE: To see the supported input formats, use <code>ffmpeg -formats</code>.
2642 </p>
2643 </li><li>
2644 You can extract images from a video, or create a video from many images:
2645
2646 <p>For extracting images from a video:
2647 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
2648 </pre></td></tr></table>
2649
2650 <p>This will extract one video frame per second from the video and will
2651 output them in files named &lsquo;<tt>foo-001.jpeg</tt>&rsquo;, &lsquo;<tt>foo-002.jpeg</tt>&rsquo;,
2652 etc. Images will be rescaled to fit the new WxH values.
2653 </p>
2654 <p>If you want to extract just a limited number of frames, you can use the
2655 above command in combination with the -vframes or -t option, or in
2656 combination with -ss to start extracting from a certain point in time.
2657 </p>
2658 <p>For creating a video from many images:
2659 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
2660 </pre></td></tr></table>
2661
2662 <p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
2663 composed of three digits padded with zeroes to express the sequence
2664 number. It is the same syntax supported by the C printf function, but
2665 only formats accepting a normal integer are suitable.
2666 </p>
2667 <p>When importing an image sequence, -i also supports expanding
2668 shell-like wildcard patterns (globbing) internally, by selecting the
2669 image2-specific <code>-pattern_type glob</code> option.
2670 </p>
2671 <p>For example, for creating a video from filenames matching the glob pattern
2672 <code>foo-*.jpeg</code>:
2673 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
2674 </pre></td></tr></table>
2675
2676 </li><li>
2677 You can put many streams of the same type in the output:
2678
2679 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test1.avi -i test2.avi -map 0:3 -map 0:2 -map 0:1 -map 0:0 -c copy test12.nut
2680 </pre></td></tr></table>
2681
2682 <p>The resulting output file &lsquo;<tt>test12.avi</tt>&rsquo; will contain first four streams from
2683 the input file in reverse order.
2684 </p>
2685 </li><li>
2686 To force CBR video output:
2687 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
2688 </pre></td></tr></table>
2689
2690 </li><li>
2691 The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
2692 but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
2693 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
2694 </pre></td></tr></table>
2695
2696 </li></ul>
2697
2698 <a name="Syntax-2"></a>
2699 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Syntax-2">8. Syntax</a></h1>
2700
2701 <p>This section documents the syntax and formats employed by the FFmpeg
2702 libraries and tools.
2703 </p>
2704 <p><a name="quoting_005fand_005fescaping"></a>
2705 </p><a name="Quoting-and-escaping"></a>
2706 <h2 class="section"><a href="ffmpeg-all.html#toc-Quoting-and-escaping">8.1 Quoting and escaping</a></h2>
2707
2708 <p>FFmpeg adopts the following quoting and escaping mechanism, unless
2709 explicitly specified. The following rules are applied:
2710 </p>
2711 <ul>
2712 <li>
2713 <code>'</code> and <code>\</code> are special characters (respectively used for
2714 quoting and escaping). In addition to them, there might be other
2715 special characters depending on the specific syntax where the escaping
2716 and quoting are employed.
2717
2718 </li><li>
2719 A special character is escaped by prefixing it with a &rsquo;\&rsquo;.
2720
2721 </li><li>
2722 All characters enclosed between &rdquo; are included literally in the
2723 parsed string. The quote character <code>'</code> itself cannot be quoted,
2724 so you may need to close the quote and escape it.
2725
2726 </li><li>
2727 Leading and trailing whitespaces, unless escaped or quoted, are
2728 removed from the parsed string.
2729 </li></ul>
2730
2731 <p>Note that you may need to add a second level of escaping when using
2732 the command line or a script, which depends on the syntax of the
2733 adopted shell language.
2734 </p>
2735 <p>The function <code>av_get_token</code> defined in
2736 &lsquo;<tt>libavutil/avstring.h</tt>&rsquo; can be used to parse a token quoted or
2737 escaped according to the rules defined above.
2738 </p>
2739 <p>The tool &lsquo;<tt>tools/ffescape</tt>&rsquo; in the FFmpeg source tree can be used
2740 to automatically quote or escape a string in a script.
2741 </p>
2742 <a name="Examples-40"></a>
2743 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-40">8.1.1 Examples</a></h3>
2744
2745 <ul>
2746 <li>
2747 Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
2748 character:
2749 <table><tr><td>&nbsp;</td><td><pre class="example">Crime d\'Amour
2750 </pre></td></tr></table>
2751
2752 </li><li>
2753 The string above contains a quote, so the <code>'</code> needs to be escaped
2754 when quoting it:
2755 <table><tr><td>&nbsp;</td><td><pre class="example">'Crime d'\''Amour'
2756 </pre></td></tr></table>
2757
2758 </li><li>
2759 Include leading or trailing whitespaces using quoting:
2760 <table><tr><td>&nbsp;</td><td><pre class="example">'  this string starts and ends with whitespaces  '
2761 </pre></td></tr></table>
2762
2763 </li><li>
2764 Escaping and quoting can be mixed together:
2765 <table><tr><td>&nbsp;</td><td><pre class="example">' The string '\'string\'' is a string '
2766 </pre></td></tr></table>
2767
2768 </li><li>
2769 To include a literal <code>\</code> you can use either escaping or quoting:
2770 <table><tr><td>&nbsp;</td><td><pre class="example">'c:\foo' can be written as c:\\foo
2771 </pre></td></tr></table>
2772 </li></ul>
2773
2774 <p><a name="date-syntax"></a>
2775 </p><a name="Date"></a>
2776 <h2 class="section"><a href="ffmpeg-all.html#toc-Date">8.2 Date</a></h2>
2777
2778 <p>The accepted syntax is:
2779 </p><table><tr><td>&nbsp;</td><td><pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
2780 now
2781 </pre></td></tr></table>
2782
2783 <p>If the value is &quot;now&quot; it takes the current time.
2784 </p>
2785 <p>Time is local time unless Z is appended, in which case it is
2786 interpreted as UTC.
2787 If the year-month-day part is not specified it takes the current
2788 year-month-day.
2789 </p>
2790 <p><a name="time-duration-syntax"></a>
2791 </p><a name="Time-duration"></a>
2792 <h2 class="section"><a href="ffmpeg-all.html#toc-Time-duration">8.3 Time duration</a></h2>
2793
2794 <p>There are two accepted syntaxes for expressing time duration.
2795 </p>
2796 <table><tr><td>&nbsp;</td><td><pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
2797 </pre></td></tr></table>
2798
2799 <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
2800 for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
2801 maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
2802 <var>SS</var>.
2803 </p>
2804 <p><em>or</em>
2805 </p>
2806 <table><tr><td>&nbsp;</td><td><pre class="example">[-]<var>S</var>+[.<var>m</var>...]
2807 </pre></td></tr></table>
2808
2809 <p><var>S</var> expresses the number of seconds, with the optional decimal part
2810 <var>m</var>.
2811 </p>
2812 <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
2813 </p>
2814 <a name="Examples-89"></a>
2815 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-89">8.3.1 Examples</a></h3>
2816
2817 <p>The following examples are all valid time duration:
2818 </p>
2819 <dl compact="compact">
2820 <dt> &lsquo;<samp>55</samp>&rsquo;</dt>
2821 <dd><p>55 seconds
2822 </p>
2823 </dd>
2824 <dt> &lsquo;<samp>12:03:45</samp>&rsquo;</dt>
2825 <dd><p>12 hours, 03 minutes and 45 seconds
2826 </p>
2827 </dd>
2828 <dt> &lsquo;<samp>23.189</samp>&rsquo;</dt>
2829 <dd><p>23.189 seconds
2830 </p></dd>
2831 </dl>
2832
2833 <p><a name="video-size-syntax"></a>
2834 </p><a name="Video-size"></a>
2835 <h2 class="section"><a href="ffmpeg-all.html#toc-Video-size">8.4 Video size</a></h2>
2836 <p>Specify the size of the sourced video, it may be a string of the form
2837 <var>width</var>x<var>height</var>, or the name of a size abbreviation.
2838 </p>
2839 <p>The following abbreviations are recognized:
2840 </p><dl compact="compact">
2841 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
2842 <dd><p>720x480
2843 </p></dd>
2844 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
2845 <dd><p>720x576
2846 </p></dd>
2847 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
2848 <dd><p>352x240
2849 </p></dd>
2850 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
2851 <dd><p>352x288
2852 </p></dd>
2853 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
2854 <dd><p>640x480
2855 </p></dd>
2856 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
2857 <dd><p>768x576
2858 </p></dd>
2859 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
2860 <dd><p>352x240
2861 </p></dd>
2862 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
2863 <dd><p>352x240
2864 </p></dd>
2865 <dt> &lsquo;<samp>sqcif</samp>&rsquo;</dt>
2866 <dd><p>128x96
2867 </p></dd>
2868 <dt> &lsquo;<samp>qcif</samp>&rsquo;</dt>
2869 <dd><p>176x144
2870 </p></dd>
2871 <dt> &lsquo;<samp>cif</samp>&rsquo;</dt>
2872 <dd><p>352x288
2873 </p></dd>
2874 <dt> &lsquo;<samp>4cif</samp>&rsquo;</dt>
2875 <dd><p>704x576
2876 </p></dd>
2877 <dt> &lsquo;<samp>16cif</samp>&rsquo;</dt>
2878 <dd><p>1408x1152
2879 </p></dd>
2880 <dt> &lsquo;<samp>qqvga</samp>&rsquo;</dt>
2881 <dd><p>160x120
2882 </p></dd>
2883 <dt> &lsquo;<samp>qvga</samp>&rsquo;</dt>
2884 <dd><p>320x240
2885 </p></dd>
2886 <dt> &lsquo;<samp>vga</samp>&rsquo;</dt>
2887 <dd><p>640x480
2888 </p></dd>
2889 <dt> &lsquo;<samp>svga</samp>&rsquo;</dt>
2890 <dd><p>800x600
2891 </p></dd>
2892 <dt> &lsquo;<samp>xga</samp>&rsquo;</dt>
2893 <dd><p>1024x768
2894 </p></dd>
2895 <dt> &lsquo;<samp>uxga</samp>&rsquo;</dt>
2896 <dd><p>1600x1200
2897 </p></dd>
2898 <dt> &lsquo;<samp>qxga</samp>&rsquo;</dt>
2899 <dd><p>2048x1536
2900 </p></dd>
2901 <dt> &lsquo;<samp>sxga</samp>&rsquo;</dt>
2902 <dd><p>1280x1024
2903 </p></dd>
2904 <dt> &lsquo;<samp>qsxga</samp>&rsquo;</dt>
2905 <dd><p>2560x2048
2906 </p></dd>
2907 <dt> &lsquo;<samp>hsxga</samp>&rsquo;</dt>
2908 <dd><p>5120x4096
2909 </p></dd>
2910 <dt> &lsquo;<samp>wvga</samp>&rsquo;</dt>
2911 <dd><p>852x480
2912 </p></dd>
2913 <dt> &lsquo;<samp>wxga</samp>&rsquo;</dt>
2914 <dd><p>1366x768
2915 </p></dd>
2916 <dt> &lsquo;<samp>wsxga</samp>&rsquo;</dt>
2917 <dd><p>1600x1024
2918 </p></dd>
2919 <dt> &lsquo;<samp>wuxga</samp>&rsquo;</dt>
2920 <dd><p>1920x1200
2921 </p></dd>
2922 <dt> &lsquo;<samp>woxga</samp>&rsquo;</dt>
2923 <dd><p>2560x1600
2924 </p></dd>
2925 <dt> &lsquo;<samp>wqsxga</samp>&rsquo;</dt>
2926 <dd><p>3200x2048
2927 </p></dd>
2928 <dt> &lsquo;<samp>wquxga</samp>&rsquo;</dt>
2929 <dd><p>3840x2400
2930 </p></dd>
2931 <dt> &lsquo;<samp>whsxga</samp>&rsquo;</dt>
2932 <dd><p>6400x4096
2933 </p></dd>
2934 <dt> &lsquo;<samp>whuxga</samp>&rsquo;</dt>
2935 <dd><p>7680x4800
2936 </p></dd>
2937 <dt> &lsquo;<samp>cga</samp>&rsquo;</dt>
2938 <dd><p>320x200
2939 </p></dd>
2940 <dt> &lsquo;<samp>ega</samp>&rsquo;</dt>
2941 <dd><p>640x350
2942 </p></dd>
2943 <dt> &lsquo;<samp>hd480</samp>&rsquo;</dt>
2944 <dd><p>852x480
2945 </p></dd>
2946 <dt> &lsquo;<samp>hd720</samp>&rsquo;</dt>
2947 <dd><p>1280x720
2948 </p></dd>
2949 <dt> &lsquo;<samp>hd1080</samp>&rsquo;</dt>
2950 <dd><p>1920x1080
2951 </p></dd>
2952 <dt> &lsquo;<samp>2k</samp>&rsquo;</dt>
2953 <dd><p>2048x1080
2954 </p></dd>
2955 <dt> &lsquo;<samp>2kflat</samp>&rsquo;</dt>
2956 <dd><p>1998x1080
2957 </p></dd>
2958 <dt> &lsquo;<samp>2kscope</samp>&rsquo;</dt>
2959 <dd><p>2048x858
2960 </p></dd>
2961 <dt> &lsquo;<samp>4k</samp>&rsquo;</dt>
2962 <dd><p>4096x2160
2963 </p></dd>
2964 <dt> &lsquo;<samp>4kflat</samp>&rsquo;</dt>
2965 <dd><p>3996x2160
2966 </p></dd>
2967 <dt> &lsquo;<samp>4kscope</samp>&rsquo;</dt>
2968 <dd><p>4096x1716
2969 </p></dd>
2970 <dt> &lsquo;<samp>nhd</samp>&rsquo;</dt>
2971 <dd><p>640x360
2972 </p></dd>
2973 <dt> &lsquo;<samp>hqvga</samp>&rsquo;</dt>
2974 <dd><p>240x160
2975 </p></dd>
2976 <dt> &lsquo;<samp>wqvga</samp>&rsquo;</dt>
2977 <dd><p>400x240
2978 </p></dd>
2979 <dt> &lsquo;<samp>fwqvga</samp>&rsquo;</dt>
2980 <dd><p>432x240
2981 </p></dd>
2982 <dt> &lsquo;<samp>hvga</samp>&rsquo;</dt>
2983 <dd><p>480x320
2984 </p></dd>
2985 <dt> &lsquo;<samp>qhd</samp>&rsquo;</dt>
2986 <dd><p>960x540
2987 </p></dd>
2988 </dl>
2989
2990 <p><a name="video-rate-syntax"></a>
2991 </p><a name="Video-rate"></a>
2992 <h2 class="section"><a href="ffmpeg-all.html#toc-Video-rate">8.5 Video rate</a></h2>
2993
2994 <p>Specify the frame rate of a video, expressed as the number of frames
2995 generated per second. It has to be a string in the format
2996 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
2997 number or a valid video frame rate abbreviation.
2998 </p>
2999 <p>The following abbreviations are recognized:
3000 </p><dl compact="compact">
3001 <dt> &lsquo;<samp>ntsc</samp>&rsquo;</dt>
3002 <dd><p>30000/1001
3003 </p></dd>
3004 <dt> &lsquo;<samp>pal</samp>&rsquo;</dt>
3005 <dd><p>25/1
3006 </p></dd>
3007 <dt> &lsquo;<samp>qntsc</samp>&rsquo;</dt>
3008 <dd><p>30000/1001
3009 </p></dd>
3010 <dt> &lsquo;<samp>qpal</samp>&rsquo;</dt>
3011 <dd><p>25/1
3012 </p></dd>
3013 <dt> &lsquo;<samp>sntsc</samp>&rsquo;</dt>
3014 <dd><p>30000/1001
3015 </p></dd>
3016 <dt> &lsquo;<samp>spal</samp>&rsquo;</dt>
3017 <dd><p>25/1
3018 </p></dd>
3019 <dt> &lsquo;<samp>film</samp>&rsquo;</dt>
3020 <dd><p>24/1
3021 </p></dd>
3022 <dt> &lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
3023 <dd><p>24000/1001
3024 </p></dd>
3025 </dl>
3026
3027 <p><a name="ratio-syntax"></a>
3028 </p><a name="Ratio"></a>
3029 <h2 class="section"><a href="ffmpeg-all.html#toc-Ratio">8.6 Ratio</a></h2>
3030
3031 <p>A ratio can be expressed as an expression, or in the form
3032 <var>numerator</var>:<var>denominator</var>.
3033 </p>
3034 <p>Note that a ratio with infinite (1/0) or negative value is
3035 considered valid, so you should check on the returned value if you
3036 want to exclude those values.
3037 </p>
3038 <p>The undefined value can be expressed using the &quot;0:0&quot; string.
3039 </p>
3040 <p><a name="color-syntax"></a>
3041 </p><a name="Color"></a>
3042 <h2 class="section"><a href="ffmpeg-all.html#toc-Color">8.7 Color</a></h2>
3043
3044 <p>It can be the name of a color as defined below (case insensitive match) or a
3045 <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
3046 representing the alpha component.
3047 </p>
3048 <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
3049 hexadecimal number or a decimal number between 0.0 and 1.0, which
3050 represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
3051 transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
3052 component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
3053 </p>
3054 <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
3055 </p>
3056 <p>The following names of colors are recognized:
3057 </p><dl compact="compact">
3058 <dt> &lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
3059 <dd><p>0xF0F8FF
3060 </p></dd>
3061 <dt> &lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
3062 <dd><p>0xFAEBD7
3063 </p></dd>
3064 <dt> &lsquo;<samp>Aqua</samp>&rsquo;</dt>
3065 <dd><p>0x00FFFF
3066 </p></dd>
3067 <dt> &lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
3068 <dd><p>0x7FFFD4
3069 </p></dd>
3070 <dt> &lsquo;<samp>Azure</samp>&rsquo;</dt>
3071 <dd><p>0xF0FFFF
3072 </p></dd>
3073 <dt> &lsquo;<samp>Beige</samp>&rsquo;</dt>
3074 <dd><p>0xF5F5DC
3075 </p></dd>
3076 <dt> &lsquo;<samp>Bisque</samp>&rsquo;</dt>
3077 <dd><p>0xFFE4C4
3078 </p></dd>
3079 <dt> &lsquo;<samp>Black</samp>&rsquo;</dt>
3080 <dd><p>0x000000
3081 </p></dd>
3082 <dt> &lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
3083 <dd><p>0xFFEBCD
3084 </p></dd>
3085 <dt> &lsquo;<samp>Blue</samp>&rsquo;</dt>
3086 <dd><p>0x0000FF
3087 </p></dd>
3088 <dt> &lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
3089 <dd><p>0x8A2BE2
3090 </p></dd>
3091 <dt> &lsquo;<samp>Brown</samp>&rsquo;</dt>
3092 <dd><p>0xA52A2A
3093 </p></dd>
3094 <dt> &lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
3095 <dd><p>0xDEB887
3096 </p></dd>
3097 <dt> &lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
3098 <dd><p>0x5F9EA0
3099 </p></dd>
3100 <dt> &lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
3101 <dd><p>0x7FFF00
3102 </p></dd>
3103 <dt> &lsquo;<samp>Chocolate</samp>&rsquo;</dt>
3104 <dd><p>0xD2691E
3105 </p></dd>
3106 <dt> &lsquo;<samp>Coral</samp>&rsquo;</dt>
3107 <dd><p>0xFF7F50
3108 </p></dd>
3109 <dt> &lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
3110 <dd><p>0x6495ED
3111 </p></dd>
3112 <dt> &lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
3113 <dd><p>0xFFF8DC
3114 </p></dd>
3115 <dt> &lsquo;<samp>Crimson</samp>&rsquo;</dt>
3116 <dd><p>0xDC143C
3117 </p></dd>
3118 <dt> &lsquo;<samp>Cyan</samp>&rsquo;</dt>
3119 <dd><p>0x00FFFF
3120 </p></dd>
3121 <dt> &lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
3122 <dd><p>0x00008B
3123 </p></dd>
3124 <dt> &lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
3125 <dd><p>0x008B8B
3126 </p></dd>
3127 <dt> &lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
3128 <dd><p>0xB8860B
3129 </p></dd>
3130 <dt> &lsquo;<samp>DarkGray</samp>&rsquo;</dt>
3131 <dd><p>0xA9A9A9
3132 </p></dd>
3133 <dt> &lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
3134 <dd><p>0x006400
3135 </p></dd>
3136 <dt> &lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
3137 <dd><p>0xBDB76B
3138 </p></dd>
3139 <dt> &lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
3140 <dd><p>0x8B008B
3141 </p></dd>
3142 <dt> &lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
3143 <dd><p>0x556B2F
3144 </p></dd>
3145 <dt> &lsquo;<samp>Darkorange</samp>&rsquo;</dt>
3146 <dd><p>0xFF8C00
3147 </p></dd>
3148 <dt> &lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
3149 <dd><p>0x9932CC
3150 </p></dd>
3151 <dt> &lsquo;<samp>DarkRed</samp>&rsquo;</dt>
3152 <dd><p>0x8B0000
3153 </p></dd>
3154 <dt> &lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
3155 <dd><p>0xE9967A
3156 </p></dd>
3157 <dt> &lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
3158 <dd><p>0x8FBC8F
3159 </p></dd>
3160 <dt> &lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
3161 <dd><p>0x483D8B
3162 </p></dd>
3163 <dt> &lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
3164 <dd><p>0x2F4F4F
3165 </p></dd>
3166 <dt> &lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
3167 <dd><p>0x00CED1
3168 </p></dd>
3169 <dt> &lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
3170 <dd><p>0x9400D3
3171 </p></dd>
3172 <dt> &lsquo;<samp>DeepPink</samp>&rsquo;</dt>
3173 <dd><p>0xFF1493
3174 </p></dd>
3175 <dt> &lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
3176 <dd><p>0x00BFFF
3177 </p></dd>
3178 <dt> &lsquo;<samp>DimGray</samp>&rsquo;</dt>
3179 <dd><p>0x696969
3180 </p></dd>
3181 <dt> &lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
3182 <dd><p>0x1E90FF
3183 </p></dd>
3184 <dt> &lsquo;<samp>FireBrick</samp>&rsquo;</dt>
3185 <dd><p>0xB22222
3186 </p></dd>
3187 <dt> &lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
3188 <dd><p>0xFFFAF0
3189 </p></dd>
3190 <dt> &lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
3191 <dd><p>0x228B22
3192 </p></dd>
3193 <dt> &lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
3194 <dd><p>0xFF00FF
3195 </p></dd>
3196 <dt> &lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
3197 <dd><p>0xDCDCDC
3198 </p></dd>
3199 <dt> &lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
3200 <dd><p>0xF8F8FF
3201 </p></dd>
3202 <dt> &lsquo;<samp>Gold</samp>&rsquo;</dt>
3203 <dd><p>0xFFD700
3204 </p></dd>
3205 <dt> &lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
3206 <dd><p>0xDAA520
3207 </p></dd>
3208 <dt> &lsquo;<samp>Gray</samp>&rsquo;</dt>
3209 <dd><p>0x808080
3210 </p></dd>
3211 <dt> &lsquo;<samp>Green</samp>&rsquo;</dt>
3212 <dd><p>0x008000
3213 </p></dd>
3214 <dt> &lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
3215 <dd><p>0xADFF2F
3216 </p></dd>
3217 <dt> &lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
3218 <dd><p>0xF0FFF0
3219 </p></dd>
3220 <dt> &lsquo;<samp>HotPink</samp>&rsquo;</dt>
3221 <dd><p>0xFF69B4
3222 </p></dd>
3223 <dt> &lsquo;<samp>IndianRed</samp>&rsquo;</dt>
3224 <dd><p>0xCD5C5C
3225 </p></dd>
3226 <dt> &lsquo;<samp>Indigo</samp>&rsquo;</dt>
3227 <dd><p>0x4B0082
3228 </p></dd>
3229 <dt> &lsquo;<samp>Ivory</samp>&rsquo;</dt>
3230 <dd><p>0xFFFFF0
3231 </p></dd>
3232 <dt> &lsquo;<samp>Khaki</samp>&rsquo;</dt>
3233 <dd><p>0xF0E68C
3234 </p></dd>
3235 <dt> &lsquo;<samp>Lavender</samp>&rsquo;</dt>
3236 <dd><p>0xE6E6FA
3237 </p></dd>
3238 <dt> &lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
3239 <dd><p>0xFFF0F5
3240 </p></dd>
3241 <dt> &lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
3242 <dd><p>0x7CFC00
3243 </p></dd>
3244 <dt> &lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
3245 <dd><p>0xFFFACD
3246 </p></dd>
3247 <dt> &lsquo;<samp>LightBlue</samp>&rsquo;</dt>
3248 <dd><p>0xADD8E6
3249 </p></dd>
3250 <dt> &lsquo;<samp>LightCoral</samp>&rsquo;</dt>
3251 <dd><p>0xF08080
3252 </p></dd>
3253 <dt> &lsquo;<samp>LightCyan</samp>&rsquo;</dt>
3254 <dd><p>0xE0FFFF
3255 </p></dd>
3256 <dt> &lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
3257 <dd><p>0xFAFAD2
3258 </p></dd>
3259 <dt> &lsquo;<samp>LightGreen</samp>&rsquo;</dt>
3260 <dd><p>0x90EE90
3261 </p></dd>
3262 <dt> &lsquo;<samp>LightGrey</samp>&rsquo;</dt>
3263 <dd><p>0xD3D3D3
3264 </p></dd>
3265 <dt> &lsquo;<samp>LightPink</samp>&rsquo;</dt>
3266 <dd><p>0xFFB6C1
3267 </p></dd>
3268 <dt> &lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
3269 <dd><p>0xFFA07A
3270 </p></dd>
3271 <dt> &lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
3272 <dd><p>0x20B2AA
3273 </p></dd>
3274 <dt> &lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
3275 <dd><p>0x87CEFA
3276 </p></dd>
3277 <dt> &lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
3278 <dd><p>0x778899
3279 </p></dd>
3280 <dt> &lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
3281 <dd><p>0xB0C4DE
3282 </p></dd>
3283 <dt> &lsquo;<samp>LightYellow</samp>&rsquo;</dt>
3284 <dd><p>0xFFFFE0
3285 </p></dd>
3286 <dt> &lsquo;<samp>Lime</samp>&rsquo;</dt>
3287 <dd><p>0x00FF00
3288 </p></dd>
3289 <dt> &lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
3290 <dd><p>0x32CD32
3291 </p></dd>
3292 <dt> &lsquo;<samp>Linen</samp>&rsquo;</dt>
3293 <dd><p>0xFAF0E6
3294 </p></dd>
3295 <dt> &lsquo;<samp>Magenta</samp>&rsquo;</dt>
3296 <dd><p>0xFF00FF
3297 </p></dd>
3298 <dt> &lsquo;<samp>Maroon</samp>&rsquo;</dt>
3299 <dd><p>0x800000
3300 </p></dd>
3301 <dt> &lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
3302 <dd><p>0x66CDAA
3303 </p></dd>
3304 <dt> &lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
3305 <dd><p>0x0000CD
3306 </p></dd>
3307 <dt> &lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
3308 <dd><p>0xBA55D3
3309 </p></dd>
3310 <dt> &lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
3311 <dd><p>0x9370D8
3312 </p></dd>
3313 <dt> &lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
3314 <dd><p>0x3CB371
3315 </p></dd>
3316 <dt> &lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
3317 <dd><p>0x7B68EE
3318 </p></dd>
3319 <dt> &lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
3320 <dd><p>0x00FA9A
3321 </p></dd>
3322 <dt> &lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
3323 <dd><p>0x48D1CC
3324 </p></dd>
3325 <dt> &lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
3326 <dd><p>0xC71585
3327 </p></dd>
3328 <dt> &lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
3329 <dd><p>0x191970
3330 </p></dd>
3331 <dt> &lsquo;<samp>MintCream</samp>&rsquo;</dt>
3332 <dd><p>0xF5FFFA
3333 </p></dd>
3334 <dt> &lsquo;<samp>MistyRose</samp>&rsquo;</dt>
3335 <dd><p>0xFFE4E1
3336 </p></dd>
3337 <dt> &lsquo;<samp>Moccasin</samp>&rsquo;</dt>
3338 <dd><p>0xFFE4B5
3339 </p></dd>
3340 <dt> &lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
3341 <dd><p>0xFFDEAD
3342 </p></dd>
3343 <dt> &lsquo;<samp>Navy</samp>&rsquo;</dt>
3344 <dd><p>0x000080
3345 </p></dd>
3346 <dt> &lsquo;<samp>OldLace</samp>&rsquo;</dt>
3347 <dd><p>0xFDF5E6
3348 </p></dd>
3349 <dt> &lsquo;<samp>Olive</samp>&rsquo;</dt>
3350 <dd><p>0x808000
3351 </p></dd>
3352 <dt> &lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
3353 <dd><p>0x6B8E23
3354 </p></dd>
3355 <dt> &lsquo;<samp>Orange</samp>&rsquo;</dt>
3356 <dd><p>0xFFA500
3357 </p></dd>
3358 <dt> &lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
3359 <dd><p>0xFF4500
3360 </p></dd>
3361 <dt> &lsquo;<samp>Orchid</samp>&rsquo;</dt>
3362 <dd><p>0xDA70D6
3363 </p></dd>
3364 <dt> &lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
3365 <dd><p>0xEEE8AA
3366 </p></dd>
3367 <dt> &lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
3368 <dd><p>0x98FB98
3369 </p></dd>
3370 <dt> &lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
3371 <dd><p>0xAFEEEE
3372 </p></dd>
3373 <dt> &lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
3374 <dd><p>0xD87093
3375 </p></dd>
3376 <dt> &lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
3377 <dd><p>0xFFEFD5
3378 </p></dd>
3379 <dt> &lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
3380 <dd><p>0xFFDAB9
3381 </p></dd>
3382 <dt> &lsquo;<samp>Peru</samp>&rsquo;</dt>
3383 <dd><p>0xCD853F
3384 </p></dd>
3385 <dt> &lsquo;<samp>Pink</samp>&rsquo;</dt>
3386 <dd><p>0xFFC0CB
3387 </p></dd>
3388 <dt> &lsquo;<samp>Plum</samp>&rsquo;</dt>
3389 <dd><p>0xDDA0DD
3390 </p></dd>
3391 <dt> &lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
3392 <dd><p>0xB0E0E6
3393 </p></dd>
3394 <dt> &lsquo;<samp>Purple</samp>&rsquo;</dt>
3395 <dd><p>0x800080
3396 </p></dd>
3397 <dt> &lsquo;<samp>Red</samp>&rsquo;</dt>
3398 <dd><p>0xFF0000
3399 </p></dd>
3400 <dt> &lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
3401 <dd><p>0xBC8F8F
3402 </p></dd>
3403 <dt> &lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
3404 <dd><p>0x4169E1
3405 </p></dd>
3406 <dt> &lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
3407 <dd><p>0x8B4513
3408 </p></dd>
3409 <dt> &lsquo;<samp>Salmon</samp>&rsquo;</dt>
3410 <dd><p>0xFA8072
3411 </p></dd>
3412 <dt> &lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
3413 <dd><p>0xF4A460
3414 </p></dd>
3415 <dt> &lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
3416 <dd><p>0x2E8B57
3417 </p></dd>
3418 <dt> &lsquo;<samp>SeaShell</samp>&rsquo;</dt>
3419 <dd><p>0xFFF5EE
3420 </p></dd>
3421 <dt> &lsquo;<samp>Sienna</samp>&rsquo;</dt>
3422 <dd><p>0xA0522D
3423 </p></dd>
3424 <dt> &lsquo;<samp>Silver</samp>&rsquo;</dt>
3425 <dd><p>0xC0C0C0
3426 </p></dd>
3427 <dt> &lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
3428 <dd><p>0x87CEEB
3429 </p></dd>
3430 <dt> &lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
3431 <dd><p>0x6A5ACD
3432 </p></dd>
3433 <dt> &lsquo;<samp>SlateGray</samp>&rsquo;</dt>
3434 <dd><p>0x708090
3435 </p></dd>
3436 <dt> &lsquo;<samp>Snow</samp>&rsquo;</dt>
3437 <dd><p>0xFFFAFA
3438 </p></dd>
3439 <dt> &lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
3440 <dd><p>0x00FF7F
3441 </p></dd>
3442 <dt> &lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
3443 <dd><p>0x4682B4
3444 </p></dd>
3445 <dt> &lsquo;<samp>Tan</samp>&rsquo;</dt>
3446 <dd><p>0xD2B48C
3447 </p></dd>
3448 <dt> &lsquo;<samp>Teal</samp>&rsquo;</dt>
3449 <dd><p>0x008080
3450 </p></dd>
3451 <dt> &lsquo;<samp>Thistle</samp>&rsquo;</dt>
3452 <dd><p>0xD8BFD8
3453 </p></dd>
3454 <dt> &lsquo;<samp>Tomato</samp>&rsquo;</dt>
3455 <dd><p>0xFF6347
3456 </p></dd>
3457 <dt> &lsquo;<samp>Turquoise</samp>&rsquo;</dt>
3458 <dd><p>0x40E0D0
3459 </p></dd>
3460 <dt> &lsquo;<samp>Violet</samp>&rsquo;</dt>
3461 <dd><p>0xEE82EE
3462 </p></dd>
3463 <dt> &lsquo;<samp>Wheat</samp>&rsquo;</dt>
3464 <dd><p>0xF5DEB3
3465 </p></dd>
3466 <dt> &lsquo;<samp>White</samp>&rsquo;</dt>
3467 <dd><p>0xFFFFFF
3468 </p></dd>
3469 <dt> &lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
3470 <dd><p>0xF5F5F5
3471 </p></dd>
3472 <dt> &lsquo;<samp>Yellow</samp>&rsquo;</dt>
3473 <dd><p>0xFFFF00
3474 </p></dd>
3475 <dt> &lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
3476 <dd><p>0x9ACD32
3477 </p></dd>
3478 </dl>
3479
3480 <p><a name="channel-layout-syntax"></a>
3481 </p><a name="Channel-Layout"></a>
3482 <h2 class="section"><a href="ffmpeg-all.html#toc-Channel-Layout">8.8 Channel Layout</a></h2>
3483
3484 <p>A channel layout specifies the spatial disposition of the channels in
3485 a multi-channel audio stream. To specify a channel layout, FFmpeg
3486 makes use of a special syntax.
3487 </p>
3488 <p>Individual channels are identified by an id, as given by the table
3489 below:
3490 </p><dl compact="compact">
3491 <dt> &lsquo;<samp>FL</samp>&rsquo;</dt>
3492 <dd><p>front left
3493 </p></dd>
3494 <dt> &lsquo;<samp>FR</samp>&rsquo;</dt>
3495 <dd><p>front right
3496 </p></dd>
3497 <dt> &lsquo;<samp>FC</samp>&rsquo;</dt>
3498 <dd><p>front center
3499 </p></dd>
3500 <dt> &lsquo;<samp>LFE</samp>&rsquo;</dt>
3501 <dd><p>low frequency
3502 </p></dd>
3503 <dt> &lsquo;<samp>BL</samp>&rsquo;</dt>
3504 <dd><p>back left
3505 </p></dd>
3506 <dt> &lsquo;<samp>BR</samp>&rsquo;</dt>
3507 <dd><p>back right
3508 </p></dd>
3509 <dt> &lsquo;<samp>FLC</samp>&rsquo;</dt>
3510 <dd><p>front left-of-center
3511 </p></dd>
3512 <dt> &lsquo;<samp>FRC</samp>&rsquo;</dt>
3513 <dd><p>front right-of-center
3514 </p></dd>
3515 <dt> &lsquo;<samp>BC</samp>&rsquo;</dt>
3516 <dd><p>back center
3517 </p></dd>
3518 <dt> &lsquo;<samp>SL</samp>&rsquo;</dt>
3519 <dd><p>side left
3520 </p></dd>
3521 <dt> &lsquo;<samp>SR</samp>&rsquo;</dt>
3522 <dd><p>side right
3523 </p></dd>
3524 <dt> &lsquo;<samp>TC</samp>&rsquo;</dt>
3525 <dd><p>top center
3526 </p></dd>
3527 <dt> &lsquo;<samp>TFL</samp>&rsquo;</dt>
3528 <dd><p>top front left
3529 </p></dd>
3530 <dt> &lsquo;<samp>TFC</samp>&rsquo;</dt>
3531 <dd><p>top front center
3532 </p></dd>
3533 <dt> &lsquo;<samp>TFR</samp>&rsquo;</dt>
3534 <dd><p>top front right
3535 </p></dd>
3536 <dt> &lsquo;<samp>TBL</samp>&rsquo;</dt>
3537 <dd><p>top back left
3538 </p></dd>
3539 <dt> &lsquo;<samp>TBC</samp>&rsquo;</dt>
3540 <dd><p>top back center
3541 </p></dd>
3542 <dt> &lsquo;<samp>TBR</samp>&rsquo;</dt>
3543 <dd><p>top back right
3544 </p></dd>
3545 <dt> &lsquo;<samp>DL</samp>&rsquo;</dt>
3546 <dd><p>downmix left
3547 </p></dd>
3548 <dt> &lsquo;<samp>DR</samp>&rsquo;</dt>
3549 <dd><p>downmix right
3550 </p></dd>
3551 <dt> &lsquo;<samp>WL</samp>&rsquo;</dt>
3552 <dd><p>wide left
3553 </p></dd>
3554 <dt> &lsquo;<samp>WR</samp>&rsquo;</dt>
3555 <dd><p>wide right
3556 </p></dd>
3557 <dt> &lsquo;<samp>SDL</samp>&rsquo;</dt>
3558 <dd><p>surround direct left
3559 </p></dd>
3560 <dt> &lsquo;<samp>SDR</samp>&rsquo;</dt>
3561 <dd><p>surround direct right
3562 </p></dd>
3563 <dt> &lsquo;<samp>LFE2</samp>&rsquo;</dt>
3564 <dd><p>low frequency 2
3565 </p></dd>
3566 </dl>
3567
3568 <p>Standard channel layout compositions can be specified by using the
3569 following identifiers:
3570 </p><dl compact="compact">
3571 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
3572 <dd><p>FC
3573 </p></dd>
3574 <dt> &lsquo;<samp>stereo</samp>&rsquo;</dt>
3575 <dd><p>FL+FR
3576 </p></dd>
3577 <dt> &lsquo;<samp>2.1</samp>&rsquo;</dt>
3578 <dd><p>FL+FR+LFE
3579 </p></dd>
3580 <dt> &lsquo;<samp>3.0</samp>&rsquo;</dt>
3581 <dd><p>FL+FR+FC
3582 </p></dd>
3583 <dt> &lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
3584 <dd><p>FL+FR+BC
3585 </p></dd>
3586 <dt> &lsquo;<samp>4.0</samp>&rsquo;</dt>
3587 <dd><p>FL+FR+FC+BC
3588 </p></dd>
3589 <dt> &lsquo;<samp>quad</samp>&rsquo;</dt>
3590 <dd><p>FL+FR+BL+BR
3591 </p></dd>
3592 <dt> &lsquo;<samp>quad(side)</samp>&rsquo;</dt>
3593 <dd><p>FL+FR+SL+SR
3594 </p></dd>
3595 <dt> &lsquo;<samp>3.1</samp>&rsquo;</dt>
3596 <dd><p>FL+FR+FC+LFE
3597 </p></dd>
3598 <dt> &lsquo;<samp>5.0</samp>&rsquo;</dt>
3599 <dd><p>FL+FR+FC+BL+BR
3600 </p></dd>
3601 <dt> &lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
3602 <dd><p>FL+FR+FC+SL+SR
3603 </p></dd>
3604 <dt> &lsquo;<samp>4.1</samp>&rsquo;</dt>
3605 <dd><p>FL+FR+FC+LFE+BC
3606 </p></dd>
3607 <dt> &lsquo;<samp>5.1</samp>&rsquo;</dt>
3608 <dd><p>FL+FR+FC+LFE+BL+BR
3609 </p></dd>
3610 <dt> &lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
3611 <dd><p>FL+FR+FC+LFE+SL+SR
3612 </p></dd>
3613 <dt> &lsquo;<samp>6.0</samp>&rsquo;</dt>
3614 <dd><p>FL+FR+FC+BC+SL+SR
3615 </p></dd>
3616 <dt> &lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
3617 <dd><p>FL+FR+FLC+FRC+SL+SR
3618 </p></dd>
3619 <dt> &lsquo;<samp>hexagonal</samp>&rsquo;</dt>
3620 <dd><p>FL+FR+FC+BL+BR+BC
3621 </p></dd>
3622 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
3623 <dd><p>FL+FR+FC+LFE+BC+SL+SR
3624 </p></dd>
3625 <dt> &lsquo;<samp>6.1</samp>&rsquo;</dt>
3626 <dd><p>FL+FR+FC+LFE+BL+BR+BC
3627 </p></dd>
3628 <dt> &lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
3629 <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
3630 </p></dd>
3631 <dt> &lsquo;<samp>7.0</samp>&rsquo;</dt>
3632 <dd><p>FL+FR+FC+BL+BR+SL+SR
3633 </p></dd>
3634 <dt> &lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
3635 <dd><p>FL+FR+FC+FLC+FRC+SL+SR
3636 </p></dd>
3637 <dt> &lsquo;<samp>7.1</samp>&rsquo;</dt>
3638 <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
3639 </p></dd>
3640 <dt> &lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
3641 <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
3642 </p></dd>
3643 <dt> &lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
3644 <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
3645 </p></dd>
3646 <dt> &lsquo;<samp>octagonal</samp>&rsquo;</dt>
3647 <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
3648 </p></dd>
3649 <dt> &lsquo;<samp>downmix</samp>&rsquo;</dt>
3650 <dd><p>DL+DR
3651 </p></dd>
3652 </dl>
3653
3654 <p>A custom channel layout can be specified as a sequence of terms, separated by
3655 &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
3656 </p><ul>
3657 <li>
3658 the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
3659 &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
3660
3661 </li><li>
3662 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.)
3663
3664 </li><li>
3665 a number of channels, in decimal, optionally followed by &rsquo;c&rsquo;, yielding
3666 the default channel layout for that number of channels (see the
3667 function <code>av_get_default_channel_layout</code>)
3668
3669 </li><li>
3670 a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
3671 <code>AV_CH_*</code> macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
3672 </li></ul>
3673
3674 <p>Starting from libavutil version 53 the trailing character &quot;c&quot; to
3675 specify a number of channels will be required, while a channel layout
3676 mask could also be specified as a decimal number (if and only if not
3677 followed by &quot;c&quot;).
3678 </p>
3679 <p>See also the function <code>av_get_channel_layout</code> defined in
3680 &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
3681 </p>
3682 <a name="Expression-Evaluation"></a>
3683 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Expression-Evaluation">9. Expression Evaluation</a></h1>
3684
3685 <p>When evaluating an arithmetic expression, FFmpeg uses an internal
3686 formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
3687 interface.
3688 </p>
3689 <p>An expression may contain unary, binary operators, constants, and
3690 functions.
3691 </p>
3692 <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
3693 another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
3694 <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
3695 expression evaluates to the value of <var>expr2</var>.
3696 </p>
3697 <p>The following binary operators are available: <code>+</code>, <code>-</code>,
3698 <code>*</code>, <code>/</code>, <code>^</code>.
3699 </p>
3700 <p>The following unary operators are available: <code>+</code>, <code>-</code>.
3701 </p>
3702 <p>The following functions are available:
3703 </p><dl compact="compact">
3704 <dt> &lsquo;<samp>abs(x)</samp>&rsquo;</dt>
3705 <dd><p>Compute absolute value of <var>x</var>.
3706 </p>
3707 </dd>
3708 <dt> &lsquo;<samp>acos(x)</samp>&rsquo;</dt>
3709 <dd><p>Compute arccosine of <var>x</var>.
3710 </p>
3711 </dd>
3712 <dt> &lsquo;<samp>asin(x)</samp>&rsquo;</dt>
3713 <dd><p>Compute arcsine of <var>x</var>.
3714 </p>
3715 </dd>
3716 <dt> &lsquo;<samp>atan(x)</samp>&rsquo;</dt>
3717 <dd><p>Compute arctangent of <var>x</var>.
3718 </p>
3719 </dd>
3720 <dt> &lsquo;<samp>between(x, min, max)</samp>&rsquo;</dt>
3721 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
3722 equal to <var>max</var>, 0 otherwise.
3723 </p>
3724 </dd>
3725 <dt> &lsquo;<samp>bitand(x, y)</samp>&rsquo;</dt>
3726 <dt> &lsquo;<samp>bitor(x, y)</samp>&rsquo;</dt>
3727 <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
3728 </p>
3729 <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
3730 integers before executing the bitwise operation.
3731 </p>
3732 <p>Note that both the conversion to integer and the conversion back to
3733 floating point can lose precision. Beware of unexpected results for
3734 large numbers (usually 2^53 and larger).
3735 </p>
3736 </dd>
3737 <dt> &lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
3738 <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
3739 integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
3740 </p>
3741 </dd>
3742 <dt> &lsquo;<samp>cos(x)</samp>&rsquo;</dt>
3743 <dd><p>Compute cosine of <var>x</var>.
3744 </p>
3745 </dd>
3746 <dt> &lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
3747 <dd><p>Compute hyperbolic cosine of <var>x</var>.
3748 </p>
3749 </dd>
3750 <dt> &lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
3751 <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
3752 </p>
3753 </dd>
3754 <dt> &lsquo;<samp>exp(x)</samp>&rsquo;</dt>
3755 <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
3756 </p>
3757 </dd>
3758 <dt> &lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
3759 <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
3760 integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
3761 </p>
3762 </dd>
3763 <dt> &lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
3764 <dd><p>Compute Gauss function of <var>x</var>, corresponding to
3765 <code>exp(-x*x/2) / sqrt(2*PI)</code>.
3766 </p>
3767 </dd>
3768 <dt> &lsquo;<samp>gcd(x, y)</samp>&rsquo;</dt>
3769 <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
3770 <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
3771 </p>
3772 </dd>
3773 <dt> &lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
3774 <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
3775 </p>
3776 </dd>
3777 <dt> &lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
3778 <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
3779 </p>
3780 </dd>
3781 <dt> &lsquo;<samp>hypot(x, y)</samp>&rsquo;</dt>
3782 <dd><p>This function is similar to the C function with the same name; it returns
3783 &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
3784 right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
3785 point (<var>x</var>, <var>y</var>) from the origin.
3786 </p>
3787 </dd>
3788 <dt> &lsquo;<samp>if(x, y)</samp>&rsquo;</dt>
3789 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
3790 the evaluation of <var>y</var>, return 0 otherwise.
3791 </p>
3792 </dd>
3793 <dt> &lsquo;<samp>if(x, y, z)</samp>&rsquo;</dt>
3794 <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
3795 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
3796 </p>
3797 </dd>
3798 <dt> &lsquo;<samp>ifnot(x, y)</samp>&rsquo;</dt>
3799 <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
3800 evaluation of <var>y</var>, return 0 otherwise.
3801 </p>
3802 </dd>
3803 <dt> &lsquo;<samp>ifnot(x, y, z)</samp>&rsquo;</dt>
3804 <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
3805 result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
3806 </p>
3807 </dd>
3808 <dt> &lsquo;<samp>isinf(x)</samp>&rsquo;</dt>
3809 <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
3810 </p>
3811 </dd>
3812 <dt> &lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
3813 <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
3814 </p>
3815 </dd>
3816 <dt> &lsquo;<samp>ld(var)</samp>&rsquo;</dt>
3817 <dd><p>Allow to load the value of the internal variable with number
3818 <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
3819 The function returns the loaded value.
3820 </p>
3821 </dd>
3822 <dt> &lsquo;<samp>log(x)</samp>&rsquo;</dt>
3823 <dd><p>Compute natural logarithm of <var>x</var>.
3824 </p>
3825 </dd>
3826 <dt> &lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
3827 <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
3828 </p>
3829 </dd>
3830 <dt> &lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
3831 <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
3832 </p>
3833 </dd>
3834 <dt> &lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
3835 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
3836 </p>
3837 </dd>
3838 <dt> &lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
3839 <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
3840 </p>
3841 </dd>
3842 <dt> &lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
3843 <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
3844 </p>
3845 </dd>
3846 <dt> &lsquo;<samp>not(expr)</samp>&rsquo;</dt>
3847 <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
3848 </p>
3849 </dd>
3850 <dt> &lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
3851 <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
3852 &quot;(<var>x</var>)^(<var>y</var>)&quot;.
3853 </p>
3854 </dd>
3855 <dt> &lsquo;<samp>print(t)</samp>&rsquo;</dt>
3856 <dt> &lsquo;<samp>print(t, l)</samp>&rsquo;</dt>
3857 <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
3858 <var>l</var> is not specified then a default log level is used.
3859 Returns the value of the expression printed.
3860 </p>
3861 <p>Prints t with loglevel l
3862 </p>
3863 </dd>
3864 <dt> &lsquo;<samp>random(x)</samp>&rsquo;</dt>
3865 <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
3866 internal variable which will be used to save the seed/state.
3867 </p>
3868 </dd>
3869 <dt> &lsquo;<samp>root(expr, max)</samp>&rsquo;</dt>
3870 <dd><p>Find an input value for which the function represented by <var>expr</var>
3871 with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
3872 </p>
3873 <p>The expression in <var>expr</var> must denote a continuous function or the
3874 result is undefined.
3875 </p>
3876 <p><var>ld(0)</var> is used to represent the function input value, which means
3877 that the given expression will be evaluated multiple times with
3878 various input values that the expression can access through
3879 <code>ld(0)</code>. When the expression evaluates to 0 then the
3880 corresponding input value will be returned.
3881 </p>
3882 </dd>
3883 <dt> &lsquo;<samp>sin(x)</samp>&rsquo;</dt>
3884 <dd><p>Compute sine of <var>x</var>.
3885 </p>
3886 </dd>
3887 <dt> &lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
3888 <dd><p>Compute hyperbolic sine of <var>x</var>.
3889 </p>
3890 </dd>
3891 <dt> &lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
3892 <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
3893 &quot;(<var>expr</var>)^.5&quot;.
3894 </p>
3895 </dd>
3896 <dt> &lsquo;<samp>squish(x)</samp>&rsquo;</dt>
3897 <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
3898 </p>
3899 </dd>
3900 <dt> &lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
3901 <dd><p>Allow to store the value of the expression <var>expr</var> in an internal
3902 variable. <var>var</var> specifies the number of the variable where to
3903 store the value, and it is a value ranging from 0 to 9. The function
3904 returns the value stored in the internal variable.
3905 Note, Variables are currently not shared between expressions.
3906 </p>
3907 </dd>
3908 <dt> &lsquo;<samp>tan(x)</samp>&rsquo;</dt>
3909 <dd><p>Compute tangent of <var>x</var>.
3910 </p>
3911 </dd>
3912 <dt> &lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
3913 <dd><p>Compute hyperbolic tangent of <var>x</var>.
3914 </p>
3915 </dd>
3916 <dt> &lsquo;<samp>taylor(expr, x)</samp>&rsquo;</dt>
3917 <dt> &lsquo;<samp>taylor(expr, x, id)</samp>&rsquo;</dt>
3918 <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
3919 the <code>ld(id)</code>-th derivative of a function at 0.
3920 </p>
3921 <p>When the series does not converge the result is undefined.
3922 </p>
3923 <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
3924 which means that the given expression will be evaluated multiple times
3925 with various input values that the expression can access through
3926 <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
3927 </p>
3928 <p>Note, when you have the derivatives at y instead of 0,
3929 <code>taylor(expr, x-y)</code> can be used.
3930 </p>
3931 </dd>
3932 <dt> &lsquo;<samp>time(0)</samp>&rsquo;</dt>
3933 <dd><p>Return the current (wallclock) time in seconds.
3934 </p>
3935 </dd>
3936 <dt> &lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
3937 <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
3938 integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
3939 </p>
3940 </dd>
3941 <dt> &lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
3942 <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
3943 non-zero, and returns the value of the last <var>expr</var> evaluation, or
3944 NAN if <var>cond</var> was always false.
3945 </p></dd>
3946 </dl>
3947
3948 <p>The following constants are available:
3949 </p><dl compact="compact">
3950 <dt> &lsquo;<samp>PI</samp>&rsquo;</dt>
3951 <dd><p>area of the unit disc, approximately 3.14
3952 </p></dd>
3953 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
3954 <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
3955 </p></dd>
3956 <dt> &lsquo;<samp>PHI</samp>&rsquo;</dt>
3957 <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
3958 </p></dd>
3959 </dl>
3960
3961 <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
3962 value, note that:
3963 </p>
3964 <p><code>*</code> works like AND
3965 </p>
3966 <p><code>+</code> works like OR
3967 </p>
3968 <p>For example the construct:
3969 </p><table><tr><td>&nbsp;</td><td><pre class="example">if (A AND B) then C
3970 </pre></td></tr></table>
3971 <p>is equivalent to:
3972 </p><table><tr><td>&nbsp;</td><td><pre class="example">if(A*B, C)
3973 </pre></td></tr></table>
3974
3975 <p>In your C code, you can extend the list of unary and binary functions,
3976 and define recognized constants, so that they are available for your
3977 expressions.
3978 </p>
3979 <p>The evaluator also recognizes the International System unit prefixes.
3980 If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
3981 are based on powers of 1024 instead of powers of 1000.
3982 The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
3983 unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
3984 &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
3985 </p>
3986 <p>The list of available International System prefixes follows, with
3987 indication of the corresponding powers of 10 and of 2.
3988 </p><dl compact="compact">
3989 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
3990 <dd><p>10^-24 / 2^-80
3991 </p></dd>
3992 <dt> &lsquo;<samp>z</samp>&rsquo;</dt>
3993 <dd><p>10^-21 / 2^-70
3994 </p></dd>
3995 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
3996 <dd><p>10^-18 / 2^-60
3997 </p></dd>
3998 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
3999 <dd><p>10^-15 / 2^-50
4000 </p></dd>
4001 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
4002 <dd><p>10^-12 / 2^-40
4003 </p></dd>
4004 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
4005 <dd><p>10^-9 / 2^-30
4006 </p></dd>
4007 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
4008 <dd><p>10^-6 / 2^-20
4009 </p></dd>
4010 <dt> &lsquo;<samp>m</samp>&rsquo;</dt>
4011 <dd><p>10^-3 / 2^-10
4012 </p></dd>
4013 <dt> &lsquo;<samp>c</samp>&rsquo;</dt>
4014 <dd><p>10^-2
4015 </p></dd>
4016 <dt> &lsquo;<samp>d</samp>&rsquo;</dt>
4017 <dd><p>10^-1
4018 </p></dd>
4019 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
4020 <dd><p>10^2
4021 </p></dd>
4022 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
4023 <dd><p>10^3 / 2^10
4024 </p></dd>
4025 <dt> &lsquo;<samp>K</samp>&rsquo;</dt>
4026 <dd><p>10^3 / 2^10
4027 </p></dd>
4028 <dt> &lsquo;<samp>M</samp>&rsquo;</dt>
4029 <dd><p>10^6 / 2^20
4030 </p></dd>
4031 <dt> &lsquo;<samp>G</samp>&rsquo;</dt>
4032 <dd><p>10^9 / 2^30
4033 </p></dd>
4034 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
4035 <dd><p>10^12 / 2^40
4036 </p></dd>
4037 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
4038 <dd><p>10^15 / 2^40
4039 </p></dd>
4040 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
4041 <dd><p>10^18 / 2^50
4042 </p></dd>
4043 <dt> &lsquo;<samp>Z</samp>&rsquo;</dt>
4044 <dd><p>10^21 / 2^60
4045 </p></dd>
4046 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
4047 <dd><p>10^24 / 2^70
4048 </p></dd>
4049 </dl>
4050
4051
4052 <a name="OpenCL-Options"></a>
4053 <h1 class="chapter"><a href="ffmpeg-all.html#toc-OpenCL-Options">10. OpenCL Options</a></h1>
4054
4055 <p>When FFmpeg is configured with <code>--enable-opencl</code>, it is possible
4056 to set the options for the global OpenCL context.
4057 </p>
4058 <p>The list of supported options follows:
4059 </p>
4060 <dl compact="compact">
4061 <dt> &lsquo;<samp>build_options</samp>&rsquo;</dt>
4062 <dd><p>Set build options used to compile the registered kernels.
4063 </p>
4064 <p>See reference &quot;OpenCL Specification Version: 1.2 chapter 5.6.4&quot;.
4065 </p>
4066 </dd>
4067 <dt> &lsquo;<samp>platform_idx</samp>&rsquo;</dt>
4068 <dd><p>Select the index of the platform to run OpenCL code.
4069 </p>
4070 <p>The specified index must be one of the indexes in the device list
4071 which can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
4072 </p>
4073 </dd>
4074 <dt> &lsquo;<samp>device_idx</samp>&rsquo;</dt>
4075 <dd><p>Select the index of the device used to run OpenCL code.
4076 </p>
4077 <p>The specifed index must be one of the indexes in the device list which
4078 can be obtained with <code>ffmpeg -opencl_bench</code> or <code>av_opencl_get_device_list()</code>.
4079 </p>
4080 </dd>
4081 </dl>
4082
4083 <p><a name="codec_002doptions"></a>
4084 </p><a name="Codec-Options"></a>
4085 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Codec-Options">11. Codec Options</a></h1>
4086
4087 <p>libavcodec provides some generic global options, which can be set on
4088 all the encoders and decoders. In addition each codec may support
4089 so-called private options, which are specific for a given codec.
4090 </p>
4091 <p>Sometimes, a global option may only affect a specific kind of codec,
4092 and may be unsensical or ignored by another, so you need to be aware
4093 of the meaning of the specified options. Also some options are
4094 meant only for decoding or encoding.
4095 </p>
4096 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
4097 FFmpeg tools, or by setting the value explicitly in the
4098 <code>AVCodecContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
4099 for programmatic use.
4100 </p>
4101 <p>The list of supported options follow:
4102 </p>
4103 <dl compact="compact">
4104 <dt> &lsquo;<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4105 <dd><p>Set bitrate in bits/s. Default value is 200K.
4106 </p>
4107 </dd>
4108 <dt> &lsquo;<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4109 <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
4110 </p>
4111 </dd>
4112 <dt> &lsquo;<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4113 <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
4114 tolerance specifies how far ratecontrol is willing to deviate from the
4115 target average bitrate value. This is not related to min/max
4116 bitrate. Lowering tolerance too much has an adverse effect on quality.
4117 </p>
4118 </dd>
4119 <dt> &lsquo;<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
4120 <dd><p>Set generic flags.
4121 </p>
4122 <p>Possible values:
4123 </p><dl compact="compact">
4124 <dt> &lsquo;<samp>mv4</samp>&rsquo;</dt>
4125 <dd><p>Use four motion vector by macroblock (mpeg4).
4126 </p></dd>
4127 <dt> &lsquo;<samp>qpel</samp>&rsquo;</dt>
4128 <dd><p>Use 1/4 pel motion compensation.
4129 </p></dd>
4130 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
4131 <dd><p>Use loop filter.
4132 </p></dd>
4133 <dt> &lsquo;<samp>qscale</samp>&rsquo;</dt>
4134 <dd><p>Use fixed qscale.
4135 </p></dd>
4136 <dt> &lsquo;<samp>gmc</samp>&rsquo;</dt>
4137 <dd><p>Use gmc.
4138 </p></dd>
4139 <dt> &lsquo;<samp>mv0</samp>&rsquo;</dt>
4140 <dd><p>Always try a mb with mv=&lt;0,0&gt;.
4141 </p></dd>
4142 <dt> &lsquo;<samp>input_preserved</samp>&rsquo;</dt>
4143 <dt> &lsquo;<samp>pass1</samp>&rsquo;</dt>
4144 <dd><p>Use internal 2pass ratecontrol in first pass mode.
4145 </p></dd>
4146 <dt> &lsquo;<samp>pass2</samp>&rsquo;</dt>
4147 <dd><p>Use internal 2pass ratecontrol in second pass mode.
4148 </p></dd>
4149 <dt> &lsquo;<samp>gray</samp>&rsquo;</dt>
4150 <dd><p>Only decode/encode grayscale.
4151 </p></dd>
4152 <dt> &lsquo;<samp>emu_edge</samp>&rsquo;</dt>
4153 <dd><p>Do not draw edges.
4154 </p></dd>
4155 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4156 <dd><p>Set error[?] variables during encoding.
4157 </p></dd>
4158 <dt> &lsquo;<samp>truncated</samp>&rsquo;</dt>
4159 <dt> &lsquo;<samp>naq</samp>&rsquo;</dt>
4160 <dd><p>Normalize adaptive quantization.
4161 </p></dd>
4162 <dt> &lsquo;<samp>ildct</samp>&rsquo;</dt>
4163 <dd><p>Use interlaced DCT.
4164 </p></dd>
4165 <dt> &lsquo;<samp>low_delay</samp>&rsquo;</dt>
4166 <dd><p>Force low delay.
4167 </p></dd>
4168 <dt> &lsquo;<samp>global_header</samp>&rsquo;</dt>
4169 <dd><p>Place global headers in extradata instead of every keyframe.
4170 </p></dd>
4171 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
4172 <dd><p>Use only bitexact stuff (except (I)DCT).
4173 </p></dd>
4174 <dt> &lsquo;<samp>aic</samp>&rsquo;</dt>
4175 <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
4176 </p></dd>
4177 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
4178 <dd><p>Deprecated, use mpegvideo private options instead.
4179 </p></dd>
4180 <dt> &lsquo;<samp>qprd</samp>&rsquo;</dt>
4181 <dd><p>Deprecated, use mpegvideo private options instead.
4182 </p></dd>
4183 <dt> &lsquo;<samp>ilme</samp>&rsquo;</dt>
4184 <dd><p>Apply interlaced motion estimation.
4185 </p></dd>
4186 <dt> &lsquo;<samp>cgop</samp>&rsquo;</dt>
4187 <dd><p>Use closed gop.
4188 </p></dd>
4189 </dl>
4190
4191 </dd>
4192 <dt> &lsquo;<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4193 <dd><p>Set motion estimation method.
4194 </p>
4195 <p>Possible values:
4196 </p><dl compact="compact">
4197 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4198 <dd><p>zero motion estimation (fastest)
4199 </p></dd>
4200 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
4201 <dd><p>full motion estimation (slowest)
4202 </p></dd>
4203 <dt> &lsquo;<samp>epzs</samp>&rsquo;</dt>
4204 <dd><p>EPZS motion estimation (default)
4205 </p></dd>
4206 <dt> &lsquo;<samp>esa</samp>&rsquo;</dt>
4207 <dd><p>esa motion estimation (alias for full)
4208 </p></dd>
4209 <dt> &lsquo;<samp>tesa</samp>&rsquo;</dt>
4210 <dd><p>tesa motion estimation
4211 </p></dd>
4212 <dt> &lsquo;<samp>dia</samp>&rsquo;</dt>
4213 <dd><p>dia motion estimation (alias for epzs)
4214 </p></dd>
4215 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
4216 <dd><p>log motion estimation
4217 </p></dd>
4218 <dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
4219 <dd><p>phods motion estimation
4220 </p></dd>
4221 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
4222 <dd><p>X1 motion estimation
4223 </p></dd>
4224 <dt> &lsquo;<samp>hex</samp>&rsquo;</dt>
4225 <dd><p>hex motion estimation
4226 </p></dd>
4227 <dt> &lsquo;<samp>umh</samp>&rsquo;</dt>
4228 <dd><p>umh motion estimation
4229 </p></dd>
4230 <dt> &lsquo;<samp>iter</samp>&rsquo;</dt>
4231 <dd><p>iter motion estimation
4232 </p></dd>
4233 </dl>
4234
4235 </dd>
4236 <dt> &lsquo;<samp>extradata_size <var>integer</var></samp>&rsquo;</dt>
4237 <dd><p>Set extradata size.
4238 </p>
4239 </dd>
4240 <dt> &lsquo;<samp>time_base <var>rational number</var></samp>&rsquo;</dt>
4241 <dd><p>Set codec time base.
4242 </p>
4243 <p>It is the fundamental unit of time (in seconds) in terms of which
4244 frame timestamps are represented. For fixed-fps content, timebase
4245 should be <code>1 / frame_rate</code> and timestamp increments should be
4246 identically 1.
4247 </p>
4248 </dd>
4249 <dt> &lsquo;<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4250 <dd><p>Set the group of picture size. Default value is 12.
4251 </p>
4252 </dd>
4253 <dt> &lsquo;<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
4254 <dd><p>Set audio sampling rate (in Hz).
4255 </p>
4256 </dd>
4257 <dt> &lsquo;<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
4258 <dd><p>Set number of audio channels.
4259 </p>
4260 </dd>
4261 <dt> &lsquo;<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4262 <dd><p>Set cutoff bandwidth.
4263 </p>
4264 </dd>
4265 <dt> &lsquo;<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
4266 <dd><p>Set audio frame size.
4267 </p>
4268 <p>Each submitted frame except the last must contain exactly frame_size
4269 samples per channel. May be 0 when the codec has
4270 CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
4271 restricted. It is set by some decoders to indicate constant frame
4272 size.
4273 </p>
4274 </dd>
4275 <dt> &lsquo;<samp>frame_number <var>integer</var></samp>&rsquo;</dt>
4276 <dd><p>Set the frame number.
4277 </p>
4278 </dd>
4279 <dt> &lsquo;<samp>delay <var>integer</var></samp>&rsquo;</dt>
4280 <dt> &lsquo;<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4281 <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
4282 in the ratecontrol equation. Recommended range for default rc_eq:
4283 0.0-1.0.
4284 </p>
4285 </dd>
4286 <dt> &lsquo;<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4287 <dd><p>Set video quantizer scale blur (VBR).
4288 </p>
4289 </dd>
4290 <dt> &lsquo;<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4291 <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
4292 69, default value is 2.
4293 </p>
4294 </dd>
4295 <dt> &lsquo;<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4296 <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
4297 1024, default value is 31.
4298 </p>
4299 </dd>
4300 <dt> &lsquo;<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4301 <dd><p>Set max difference between the quantizer scale (VBR).
4302 </p>
4303 </dd>
4304 <dt> &lsquo;<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4305 <dd><p>Set max number of B frames between non-B-frames.
4306 </p>
4307 <p>Must be an integer between -1 and 16. 0 means that B-frames are
4308 disabled. If a value of -1 is used, it will choose an automatic value
4309 depending on the encoder.
4310 </p>
4311 <p>Default value is 0.
4312 </p>
4313 </dd>
4314 <dt> &lsquo;<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4315 <dd><p>Set qp factor between P and B frames.
4316 </p>
4317 </dd>
4318 <dt> &lsquo;<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4319 <dd><p>Set ratecontrol method.
4320 </p>
4321 </dd>
4322 <dt> &lsquo;<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4323 <dd><p>Set strategy to choose between I/P/B-frames.
4324 </p>
4325 </dd>
4326 <dt> &lsquo;<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4327 <dd><p>Set RTP payload size in bytes.
4328 </p>
4329 </dd>
4330 <dt> &lsquo;<samp>mv_bits <var>integer</var></samp>&rsquo;</dt>
4331 <dt> &lsquo;<samp>header_bits <var>integer</var></samp>&rsquo;</dt>
4332 <dt> &lsquo;<samp>i_tex_bits <var>integer</var></samp>&rsquo;</dt>
4333 <dt> &lsquo;<samp>p_tex_bits <var>integer</var></samp>&rsquo;</dt>
4334 <dt> &lsquo;<samp>i_count <var>integer</var></samp>&rsquo;</dt>
4335 <dt> &lsquo;<samp>p_count <var>integer</var></samp>&rsquo;</dt>
4336 <dt> &lsquo;<samp>skip_count <var>integer</var></samp>&rsquo;</dt>
4337 <dt> &lsquo;<samp>misc_bits <var>integer</var></samp>&rsquo;</dt>
4338 <dt> &lsquo;<samp>frame_bits <var>integer</var></samp>&rsquo;</dt>
4339 <dt> &lsquo;<samp>codec_tag <var>integer</var></samp>&rsquo;</dt>
4340 <dt> &lsquo;<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
4341 <dd><p>Workaround not auto detected encoder bugs.
4342 </p>
4343 <p>Possible values:
4344 </p><dl compact="compact">
4345 <dt> &lsquo;<samp>autodetect</samp>&rsquo;</dt>
4346 <dt> &lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
4347 <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
4348 </p></dd>
4349 <dt> &lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
4350 <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
4351 </p></dd>
4352 <dt> &lsquo;<samp>ump4</samp>&rsquo;</dt>
4353 <dd><p>(autodetected if fourcc==UMP4)
4354 </p></dd>
4355 <dt> &lsquo;<samp>no_padding</samp>&rsquo;</dt>
4356 <dd><p>padding bug (autodetected)
4357 </p></dd>
4358 <dt> &lsquo;<samp>amv</samp>&rsquo;</dt>
4359 <dt> &lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
4360 <dd><p>illegal vlc bug (autodetected per fourcc)
4361 </p></dd>
4362 <dt> &lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
4363 <dt> &lsquo;<samp>std_qpel</samp>&rsquo;</dt>
4364 <dd><p>old standard qpel (autodetected per fourcc/version)
4365 </p></dd>
4366 <dt> &lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
4367 <dt> &lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
4368 <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
4369 </p></dd>
4370 <dt> &lsquo;<samp>edge</samp>&rsquo;</dt>
4371 <dd><p>edge padding bug (autodetected per fourcc/version)
4372 </p></dd>
4373 <dt> &lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
4374 <dt> &lsquo;<samp>dc_clip</samp>&rsquo;</dt>
4375 <dt> &lsquo;<samp>ms</samp>&rsquo;</dt>
4376 <dd><p>Workaround various bugs in microsoft broken decoders.
4377 </p></dd>
4378 <dt> &lsquo;<samp>trunc</samp>&rsquo;</dt>
4379 <dd><p>trancated frames
4380 </p></dd>
4381 </dl>
4382
4383 </dd>
4384 <dt> &lsquo;<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4385 <dd><p>Set single coefficient elimination threshold for luminance (negative
4386 values also consider DC coefficient).
4387 </p>
4388 </dd>
4389 <dt> &lsquo;<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4390 <dd><p>Set single coefficient elimination threshold for chrominance (negative
4391 values also consider dc coefficient)
4392 </p>
4393 </dd>
4394 <dt> &lsquo;<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
4395 <dd><p>Specify how strictly to follow the standards.
4396 </p>
4397 <p>Possible values:
4398 </p><dl compact="compact">
4399 <dt> &lsquo;<samp>very</samp>&rsquo;</dt>
4400 <dd><p>strictly conform to a older more strict version of the spec or reference software
4401 </p></dd>
4402 <dt> &lsquo;<samp>strict</samp>&rsquo;</dt>
4403 <dd><p>strictly conform to all the things in the spec no matter what consequences
4404 </p></dd>
4405 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
4406 <dt> &lsquo;<samp>unofficial</samp>&rsquo;</dt>
4407 <dd><p>allow unofficial extensions
4408 </p></dd>
4409 <dt> &lsquo;<samp>experimental</samp>&rsquo;</dt>
4410 <dd><p>allow non standardized experimental things, experimental
4411 (unfinished/work in progress/not well tested) decoders and encoders.
4412 Note: experimental decoders can pose a security risk, do not use this for
4413 decoding untrusted input.
4414 </p></dd>
4415 </dl>
4416
4417 </dd>
4418 <dt> &lsquo;<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4419 <dd><p>Set QP offset between P and B frames.
4420 </p>
4421 </dd>
4422 <dt> &lsquo;<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
4423 <dd><p>Set error detection flags.
4424 </p>
4425 <p>Possible values:
4426 </p><dl compact="compact">
4427 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
4428 <dd><p>verify embedded CRCs
4429 </p></dd>
4430 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
4431 <dd><p>detect bitstream specification deviations
4432 </p></dd>
4433 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
4434 <dd><p>detect improper bitstream length
4435 </p></dd>
4436 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
4437 <dd><p>abort decoding on minor error detection
4438 </p></dd>
4439 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
4440 <dd><p>consider things that violate the spec and have not been seen in the wild as errors
4441 </p></dd>
4442 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
4443 <dd><p>consider all spec non compliancies as errors
4444 </p></dd>
4445 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
4446 <dd><p>consider things that a sane encoder should not do as an error
4447 </p></dd>
4448 </dl>
4449
4450 </dd>
4451 <dt> &lsquo;<samp>has_b_frames <var>integer</var></samp>&rsquo;</dt>
4452 <dt> &lsquo;<samp>block_align <var>integer</var></samp>&rsquo;</dt>
4453 <dt> &lsquo;<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4454 <dd><p>Use MPEG quantizers instead of H.263.
4455 </p>
4456 </dd>
4457 <dt> &lsquo;<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4458 <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
4459 differentiable function).
4460 </p>
4461 </dd>
4462 <dt> &lsquo;<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4463 <dd><p>Set experimental quantizer modulation.
4464 </p>
4465 </dd>
4466 <dt> &lsquo;<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4467 <dd><p>Set experimental quantizer modulation.
4468 </p>
4469 </dd>
4470 <dt> &lsquo;<samp>rc_override_count <var>integer</var></samp>&rsquo;</dt>
4471 <dt> &lsquo;<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4472 <dd><p>Set rate control equation. When computing the expression, besides the
4473 standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, the
4474 following functions are available: bits2qp(bits), qp2bits(qp). Also
4475 the following constants are available: iTex pTex tex mv fCode iCount
4476 mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
4477 avgTex.
4478 </p>
4479 </dd>
4480 <dt> &lsquo;<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4481 <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
4482 </p>
4483 </dd>
4484 <dt> &lsquo;<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4485 <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
4486 encode. It is of little use elsewise.
4487 </p>
4488 </dd>
4489 <dt> &lsquo;<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4490 <dd><p>Set ratecontrol buffer size (in bits).
4491 </p>
4492 </dd>
4493 <dt> &lsquo;<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4494 <dd><p>Currently useless.
4495 </p>
4496 </dd>
4497 <dt> &lsquo;<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4498 <dd><p>Set QP factor between P and I frames.
4499 </p>
4500 </dd>
4501 <dt> &lsquo;<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4502 <dd><p>Set QP offset between P and I frames.
4503 </p>
4504 </dd>
4505 <dt> &lsquo;<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4506 <dd><p>Set initial complexity for 1-pass encoding.
4507 </p>
4508 </dd>
4509 <dt> &lsquo;<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4510 <dd><p>Set DCT algorithm.
4511 </p>
4512 <p>Possible values:
4513 </p><dl compact="compact">
4514 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
4515 <dd><p>autoselect a good one (default)
4516 </p></dd>
4517 <dt> &lsquo;<samp>fastint</samp>&rsquo;</dt>
4518 <dd><p>fast integer
4519 </p></dd>
4520 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
4521 <dd><p>accurate integer
4522 </p></dd>
4523 <dt> &lsquo;<samp>mmx</samp>&rsquo;</dt>
4524 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
4525 <dt> &lsquo;<samp>faan</samp>&rsquo;</dt>
4526 <dd><p>floating point AAN DCT
4527 </p></dd>
4528 </dl>
4529
4530 </dd>
4531 <dt> &lsquo;<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4532 <dd><p>Compress bright areas stronger than medium ones.
4533 </p>
4534 </dd>
4535 <dt> &lsquo;<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4536 <dd><p>Set temporal complexity masking.
4537 </p>
4538 </dd>
4539 <dt> &lsquo;<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4540 <dd><p>Set spatial complexity masking.
4541 </p>
4542 </dd>
4543 <dt> &lsquo;<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4544 <dd><p>Set inter masking.
4545 </p>
4546 </dd>
4547 <dt> &lsquo;<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4548 <dd><p>Compress dark areas stronger than medium ones.
4549 </p>
4550 </dd>
4551 <dt> &lsquo;<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
4552 <dd><p>Select IDCT implementation.
4553 </p>
4554 <p>Possible values:
4555 </p><dl compact="compact">
4556 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
4557 <dt> &lsquo;<samp>int</samp>&rsquo;</dt>
4558 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
4559 <dt> &lsquo;<samp>simplemmx</samp>&rsquo;</dt>
4560 <dt> &lsquo;<samp>arm</samp>&rsquo;</dt>
4561 <dt> &lsquo;<samp>altivec</samp>&rsquo;</dt>
4562 <dt> &lsquo;<samp>sh4</samp>&rsquo;</dt>
4563 <dt> &lsquo;<samp>simplearm</samp>&rsquo;</dt>
4564 <dt> &lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
4565 <dt> &lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
4566 <dt> &lsquo;<samp>simpleneon</samp>&rsquo;</dt>
4567 <dt> &lsquo;<samp>simplealpha</samp>&rsquo;</dt>
4568 <dt> &lsquo;<samp>ipp</samp>&rsquo;</dt>
4569 <dt> &lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
4570 <dt> &lsquo;<samp>faani</samp>&rsquo;</dt>
4571 <dd><p>floating point AAN IDCT
4572 </p></dd>
4573 </dl>
4574
4575 </dd>
4576 <dt> &lsquo;<samp>slice_count <var>integer</var></samp>&rsquo;</dt>
4577 <dt> &lsquo;<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
4578 <dd><p>Set error concealment strategy.
4579 </p>
4580 <p>Possible values:
4581 </p><dl compact="compact">
4582 <dt> &lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
4583 <dd><p>iterative motion vector (MV) search (slow)
4584 </p></dd>
4585 <dt> &lsquo;<samp>deblock</samp>&rsquo;</dt>
4586 <dd><p>use strong deblock filter for damaged MBs
4587 </p></dd>
4588 </dl>
4589
4590 </dd>
4591 <dt> &lsquo;<samp>bits_per_coded_sample <var>integer</var></samp>&rsquo;</dt>
4592 <dt> &lsquo;<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4593 <dd><p>Set prediction method.
4594 </p>
4595 <p>Possible values:
4596 </p><dl compact="compact">
4597 <dt> &lsquo;<samp>left</samp>&rsquo;</dt>
4598 <dt> &lsquo;<samp>plane</samp>&rsquo;</dt>
4599 <dt> &lsquo;<samp>median</samp>&rsquo;</dt>
4600 </dl>
4601
4602 </dd>
4603 <dt> &lsquo;<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4604 <dd><p>Set sample aspect ratio.
4605 </p>
4606 </dd>
4607 <dt> &lsquo;<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
4608 <dd><p>Print specific debug info.
4609 </p>
4610 <p>Possible values:
4611 </p><dl compact="compact">
4612 <dt> &lsquo;<samp>pict</samp>&rsquo;</dt>
4613 <dd><p>picture info
4614 </p></dd>
4615 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
4616 <dd><p>rate control
4617 </p></dd>
4618 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
4619 <dt> &lsquo;<samp>mb_type</samp>&rsquo;</dt>
4620 <dd><p>macroblock (MB) type
4621 </p></dd>
4622 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
4623 <dd><p>per-block quantization parameter (QP)
4624 </p></dd>
4625 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
4626 <dd><p>motion vector
4627 </p></dd>
4628 <dt> &lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
4629 <dt> &lsquo;<samp>skip</samp>&rsquo;</dt>
4630 <dt> &lsquo;<samp>startcode</samp>&rsquo;</dt>
4631 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
4632 <dt> &lsquo;<samp>er</samp>&rsquo;</dt>
4633 <dd><p>error recognition
4634 </p></dd>
4635 <dt> &lsquo;<samp>mmco</samp>&rsquo;</dt>
4636 <dd><p>memory management control operations (H.264)
4637 </p></dd>
4638 <dt> &lsquo;<samp>bugs</samp>&rsquo;</dt>
4639 <dt> &lsquo;<samp>vis_qp</samp>&rsquo;</dt>
4640 <dd><p>visualize quantization parameter (QP), lower QP are tinted greener
4641 </p></dd>
4642 <dt> &lsquo;<samp>vis_mb_type</samp>&rsquo;</dt>
4643 <dd><p>visualize block types
4644 </p></dd>
4645 <dt> &lsquo;<samp>buffers</samp>&rsquo;</dt>
4646 <dd><p>picture buffer allocations
4647 </p></dd>
4648 <dt> &lsquo;<samp>thread_ops</samp>&rsquo;</dt>
4649 <dd><p>threading operations
4650 </p></dd>
4651 </dl>
4652
4653 </dd>
4654 <dt> &lsquo;<samp>vismv <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
4655 <dd><p>Visualize motion vectors (MVs).
4656 </p>
4657 <p>Possible values:
4658 </p><dl compact="compact">
4659 <dt> &lsquo;<samp>pf</samp>&rsquo;</dt>
4660 <dd><p>forward predicted MVs of P-frames
4661 </p></dd>
4662 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
4663 <dd><p>forward predicted MVs of B-frames
4664 </p></dd>
4665 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
4666 <dd><p>backward predicted MVs of B-frames
4667 </p></dd>
4668 </dl>
4669
4670 </dd>
4671 <dt> &lsquo;<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4672 <dd><p>Set full pel me compare function.
4673 </p>
4674 <p>Possible values:
4675 </p><dl compact="compact">
4676 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
4677 <dd><p>sum of absolute differences, fast (default)
4678 </p></dd>
4679 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
4680 <dd><p>sum of squared errors
4681 </p></dd>
4682 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
4683 <dd><p>sum of absolute Hadamard transformed differences
4684 </p></dd>
4685 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
4686 <dd><p>sum of absolute DCT transformed differences
4687 </p></dd>
4688 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4689 <dd><p>sum of squared quantization errors (avoid, low quality)
4690 </p></dd>
4691 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
4692 <dd><p>number of bits needed for the block
4693 </p></dd>
4694 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4695 <dd><p>rate distortion optimal, slow
4696 </p></dd>
4697 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4698 <dd><p>0
4699 </p></dd>
4700 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
4701 <dd><p>sum of absolute vertical differences
4702 </p></dd>
4703 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
4704 <dd><p>sum of squared vertical differences
4705 </p></dd>
4706 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
4707 <dd><p>noise preserving sum of squared differences
4708 </p></dd>
4709 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
4710 <dd><p>5/3 wavelet, only used in snow
4711 </p></dd>
4712 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
4713 <dd><p>9/7 wavelet, only used in snow
4714 </p></dd>
4715 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
4716 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
4717 </dl>
4718
4719 </dd>
4720 <dt> &lsquo;<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4721 <dd><p>Set sub pel me compare function.
4722 </p>
4723 <p>Possible values:
4724 </p><dl compact="compact">
4725 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
4726 <dd><p>sum of absolute differences, fast (default)
4727 </p></dd>
4728 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
4729 <dd><p>sum of squared errors
4730 </p></dd>
4731 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
4732 <dd><p>sum of absolute Hadamard transformed differences
4733 </p></dd>
4734 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
4735 <dd><p>sum of absolute DCT transformed differences
4736 </p></dd>
4737 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4738 <dd><p>sum of squared quantization errors (avoid, low quality)
4739 </p></dd>
4740 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
4741 <dd><p>number of bits needed for the block
4742 </p></dd>
4743 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4744 <dd><p>rate distortion optimal, slow
4745 </p></dd>
4746 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4747 <dd><p>0
4748 </p></dd>
4749 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
4750 <dd><p>sum of absolute vertical differences
4751 </p></dd>
4752 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
4753 <dd><p>sum of squared vertical differences
4754 </p></dd>
4755 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
4756 <dd><p>noise preserving sum of squared differences
4757 </p></dd>
4758 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
4759 <dd><p>5/3 wavelet, only used in snow
4760 </p></dd>
4761 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
4762 <dd><p>9/7 wavelet, only used in snow
4763 </p></dd>
4764 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
4765 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
4766 </dl>
4767
4768 </dd>
4769 <dt> &lsquo;<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4770 <dd><p>Set macroblock compare function.
4771 </p>
4772 <p>Possible values:
4773 </p><dl compact="compact">
4774 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
4775 <dd><p>sum of absolute differences, fast (default)
4776 </p></dd>
4777 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
4778 <dd><p>sum of squared errors
4779 </p></dd>
4780 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
4781 <dd><p>sum of absolute Hadamard transformed differences
4782 </p></dd>
4783 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
4784 <dd><p>sum of absolute DCT transformed differences
4785 </p></dd>
4786 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4787 <dd><p>sum of squared quantization errors (avoid, low quality)
4788 </p></dd>
4789 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
4790 <dd><p>number of bits needed for the block
4791 </p></dd>
4792 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4793 <dd><p>rate distortion optimal, slow
4794 </p></dd>
4795 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4796 <dd><p>0
4797 </p></dd>
4798 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
4799 <dd><p>sum of absolute vertical differences
4800 </p></dd>
4801 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
4802 <dd><p>sum of squared vertical differences
4803 </p></dd>
4804 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
4805 <dd><p>noise preserving sum of squared differences
4806 </p></dd>
4807 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
4808 <dd><p>5/3 wavelet, only used in snow
4809 </p></dd>
4810 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
4811 <dd><p>9/7 wavelet, only used in snow
4812 </p></dd>
4813 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
4814 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
4815 </dl>
4816
4817 </dd>
4818 <dt> &lsquo;<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4819 <dd><p>Set interlaced dct compare function.
4820 </p>
4821 <p>Possible values:
4822 </p><dl compact="compact">
4823 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
4824 <dd><p>sum of absolute differences, fast (default)
4825 </p></dd>
4826 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
4827 <dd><p>sum of squared errors
4828 </p></dd>
4829 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
4830 <dd><p>sum of absolute Hadamard transformed differences
4831 </p></dd>
4832 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
4833 <dd><p>sum of absolute DCT transformed differences
4834 </p></dd>
4835 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4836 <dd><p>sum of squared quantization errors (avoid, low quality)
4837 </p></dd>
4838 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
4839 <dd><p>number of bits needed for the block
4840 </p></dd>
4841 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4842 <dd><p>rate distortion optimal, slow
4843 </p></dd>
4844 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4845 <dd><p>0
4846 </p></dd>
4847 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
4848 <dd><p>sum of absolute vertical differences
4849 </p></dd>
4850 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
4851 <dd><p>sum of squared vertical differences
4852 </p></dd>
4853 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
4854 <dd><p>noise preserving sum of squared differences
4855 </p></dd>
4856 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
4857 <dd><p>5/3 wavelet, only used in snow
4858 </p></dd>
4859 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
4860 <dd><p>9/7 wavelet, only used in snow
4861 </p></dd>
4862 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
4863 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
4864 </dl>
4865
4866 </dd>
4867 <dt> &lsquo;<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4868 <dd><p>Set diamond type &amp; size for motion estimation.
4869 </p>
4870 </dd>
4871 <dt> &lsquo;<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4872 <dd><p>Set amount of motion predictors from the previous frame.
4873 </p>
4874 </dd>
4875 <dt> &lsquo;<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4876 <dd><p>Set pre motion estimation.
4877 </p>
4878 </dd>
4879 <dt> &lsquo;<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4880 <dd><p>Set pre motion estimation compare function.
4881 </p>
4882 <p>Possible values:
4883 </p><dl compact="compact">
4884 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
4885 <dd><p>sum of absolute differences, fast (default)
4886 </p></dd>
4887 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
4888 <dd><p>sum of squared errors
4889 </p></dd>
4890 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
4891 <dd><p>sum of absolute Hadamard transformed differences
4892 </p></dd>
4893 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
4894 <dd><p>sum of absolute DCT transformed differences
4895 </p></dd>
4896 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
4897 <dd><p>sum of squared quantization errors (avoid, low quality)
4898 </p></dd>
4899 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
4900 <dd><p>number of bits needed for the block
4901 </p></dd>
4902 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4903 <dd><p>rate distortion optimal, slow
4904 </p></dd>
4905 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
4906 <dd><p>0
4907 </p></dd>
4908 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
4909 <dd><p>sum of absolute vertical differences
4910 </p></dd>
4911 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
4912 <dd><p>sum of squared vertical differences
4913 </p></dd>
4914 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
4915 <dd><p>noise preserving sum of squared differences
4916 </p></dd>
4917 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
4918 <dd><p>5/3 wavelet, only used in snow
4919 </p></dd>
4920 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
4921 <dd><p>9/7 wavelet, only used in snow
4922 </p></dd>
4923 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
4924 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
4925 </dl>
4926
4927 </dd>
4928 <dt> &lsquo;<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4929 <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
4930 </p>
4931 </dd>
4932 <dt> &lsquo;<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4933 <dd><p>Set sub pel motion estimation quality.
4934 </p>
4935 </dd>
4936 <dt> &lsquo;<samp>dtg_active_format <var>integer</var></samp>&rsquo;</dt>
4937 <dt> &lsquo;<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4938 <dd><p>Set limit motion vectors range (1023 for DivX player).
4939 </p>
4940 </dd>
4941 <dt> &lsquo;<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4942 <dd><p>Set intra quant bias.
4943 </p>
4944 </dd>
4945 <dt> &lsquo;<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4946 <dd><p>Set inter quant bias.
4947 </p>
4948 </dd>
4949 <dt> &lsquo;<samp>color_table_id <var>integer</var></samp>&rsquo;</dt>
4950 <dt> &lsquo;<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
4951 <dt> &lsquo;<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4952 <dd>
4953 <p>Possible values:
4954 </p><dl compact="compact">
4955 <dt> &lsquo;<samp>vlc</samp>&rsquo;</dt>
4956 <dd><p>variable length coder / huffman coder
4957 </p></dd>
4958 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
4959 <dd><p>arithmetic coder
4960 </p></dd>
4961 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
4962 <dd><p>raw (no encoding)
4963 </p></dd>
4964 <dt> &lsquo;<samp>rle</samp>&rsquo;</dt>
4965 <dd><p>run-length coder
4966 </p></dd>
4967 <dt> &lsquo;<samp>deflate</samp>&rsquo;</dt>
4968 <dd><p>deflate-based coder
4969 </p></dd>
4970 </dl>
4971
4972 </dd>
4973 <dt> &lsquo;<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4974 <dd><p>Set context model.
4975 </p>
4976 </dd>
4977 <dt> &lsquo;<samp>slice_flags <var>integer</var></samp>&rsquo;</dt>
4978 <dt> &lsquo;<samp>xvmc_acceleration <var>integer</var></samp>&rsquo;</dt>
4979 <dt> &lsquo;<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4980 <dd><p>Set macroblock decision algorithm (high quality mode).
4981 </p>
4982 <p>Possible values:
4983 </p><dl compact="compact">
4984 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
4985 <dd><p>use mbcmp (default)
4986 </p></dd>
4987 <dt> &lsquo;<samp>bits</samp>&rsquo;</dt>
4988 <dd><p>use fewest bits
4989 </p></dd>
4990 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
4991 <dd><p>use best rate distortion
4992 </p></dd>
4993 </dl>
4994
4995 </dd>
4996 <dt> &lsquo;<samp>stream_codec_tag <var>integer</var></samp>&rsquo;</dt>
4997 <dt> &lsquo;<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
4998 <dd><p>Set scene change threshold.
4999 </p>
5000 </dd>
5001 <dt> &lsquo;<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5002 <dd><p>Set min lagrange factor (VBR).
5003 </p>
5004 </dd>
5005 <dt> &lsquo;<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5006 <dd><p>Set max lagrange factor (VBR).
5007 </p>
5008 </dd>
5009 <dt> &lsquo;<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5010 <dd><p>Set noise reduction.
5011 </p>
5012 </dd>
5013 <dt> &lsquo;<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5014 <dd><p>Set number of bits which should be loaded into the rc buffer before
5015 decoding starts.
5016 </p>
5017 </dd>
5018 <dt> &lsquo;<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
5019 <dd>
5020 <p>Possible values:
5021 </p><dl compact="compact">
5022 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
5023 <dd><p>Allow non spec compliant speedup tricks.
5024 </p></dd>
5025 <dt> &lsquo;<samp>sgop</samp>&rsquo;</dt>
5026 <dd><p>Deprecated, use mpegvideo private options instead.
5027 </p></dd>
5028 <dt> &lsquo;<samp>noout</samp>&rsquo;</dt>
5029 <dd><p>Skip bitstream encoding.
5030 </p></dd>
5031 <dt> &lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
5032 <dd><p>Ignore cropping information from sps.
5033 </p></dd>
5034 <dt> &lsquo;<samp>local_header</samp>&rsquo;</dt>
5035 <dd><p>Place global headers at every keyframe instead of in extradata.
5036 </p></dd>
5037 <dt> &lsquo;<samp>chunks</samp>&rsquo;</dt>
5038 <dd><p>Frame data might be split into multiple chunks.
5039 </p></dd>
5040 <dt> &lsquo;<samp>showall</samp>&rsquo;</dt>
5041 <dd><p>Show all frames before the first keyframe.
5042 </p></dd>
5043 <dt> &lsquo;<samp>skiprd</samp>&rsquo;</dt>
5044 <dd><p>Deprecated, use mpegvideo private options instead.
5045 </p></dd>
5046 </dl>
5047
5048 </dd>
5049 <dt> &lsquo;<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5050 <dt> &lsquo;<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5051 <dd><p>Deprecated, use mpegvideo private options instead.
5052 </p>
5053 </dd>
5054 <dt> &lsquo;<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5055 <dd>
5056 <p>Possible values:
5057 </p><dl compact="compact">
5058 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
5059 <dd><p>detect a good number of threads
5060 </p></dd>
5061 </dl>
5062
5063 </dd>
5064 <dt> &lsquo;<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5065 <dd><p>Set motion estimation threshold.
5066 </p>
5067 </dd>
5068 <dt> &lsquo;<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5069 <dd><p>Set macroblock threshold.
5070 </p>
5071 </dd>
5072 <dt> &lsquo;<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5073 <dd><p>Set intra_dc_precision.
5074 </p>
5075 </dd>
5076 <dt> &lsquo;<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5077 <dd><p>Set nsse weight.
5078 </p>
5079 </dd>
5080 <dt> &lsquo;<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5081 <dd><p>Set number of macroblock rows at the top which are skipped.
5082 </p>
5083 </dd>
5084 <dt> &lsquo;<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5085 <dd><p>Set number of macroblock rows at the bottom which are skipped.
5086 </p>
5087 </dd>
5088 <dt> &lsquo;<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
5089 <dd>
5090 <p>Possible values:
5091 </p><dl compact="compact">
5092 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
5093 <dt> &lsquo;<samp>aac_main</samp>&rsquo;</dt>
5094 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
5095 <dt> &lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
5096 <dt> &lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
5097 <dt> &lsquo;<samp>aac_he</samp>&rsquo;</dt>
5098 <dt> &lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
5099 <dt> &lsquo;<samp>aac_ld</samp>&rsquo;</dt>
5100 <dt> &lsquo;<samp>aac_eld</samp>&rsquo;</dt>
5101 <dt> &lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
5102 <dt> &lsquo;<samp>mpeg2_aac_he</samp>&rsquo;</dt>
5103 <dt> &lsquo;<samp>dts</samp>&rsquo;</dt>
5104 <dt> &lsquo;<samp>dts_es</samp>&rsquo;</dt>
5105 <dt> &lsquo;<samp>dts_96_24</samp>&rsquo;</dt>
5106 <dt> &lsquo;<samp>dts_hd_hra</samp>&rsquo;</dt>
5107 <dt> &lsquo;<samp>dts_hd_ma</samp>&rsquo;</dt>
5108 </dl>
5109
5110 </dd>
5111 <dt> &lsquo;<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
5112 <dd>
5113 <p>Possible values:
5114 </p><dl compact="compact">
5115 <dt> &lsquo;<samp>unknown</samp>&rsquo;</dt>
5116 </dl>
5117
5118 </dd>
5119 <dt> &lsquo;<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
5120 <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
5121 </p>
5122 </dd>
5123 <dt> &lsquo;<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5124 <dd><p>Set frame skip threshold.
5125 </p>
5126 </dd>
5127 <dt> &lsquo;<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5128 <dd><p>Set frame skip factor.
5129 </p>
5130 </dd>
5131 <dt> &lsquo;<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5132 <dd><p>Set frame skip exponent.
5133 </p>
5134 </dd>
5135 <dt> &lsquo;<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5136 <dd><p>Set frame skip compare function.
5137 </p>
5138 <p>Possible values:
5139 </p><dl compact="compact">
5140 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
5141 <dd><p>sum of absolute differences, fast (default)
5142 </p></dd>
5143 <dt> &lsquo;<samp>sse</samp>&rsquo;</dt>
5144 <dd><p>sum of squared errors
5145 </p></dd>
5146 <dt> &lsquo;<samp>satd</samp>&rsquo;</dt>
5147 <dd><p>sum of absolute Hadamard transformed differences
5148 </p></dd>
5149 <dt> &lsquo;<samp>dct</samp>&rsquo;</dt>
5150 <dd><p>sum of absolute DCT transformed differences
5151 </p></dd>
5152 <dt> &lsquo;<samp>psnr</samp>&rsquo;</dt>
5153 <dd><p>sum of squared quantization errors (avoid, low quality)
5154 </p></dd>
5155 <dt> &lsquo;<samp>bit</samp>&rsquo;</dt>
5156 <dd><p>number of bits needed for the block
5157 </p></dd>
5158 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
5159 <dd><p>rate distortion optimal, slow
5160 </p></dd>
5161 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
5162 <dd><p>0
5163 </p></dd>
5164 <dt> &lsquo;<samp>vsad</samp>&rsquo;</dt>
5165 <dd><p>sum of absolute vertical differences
5166 </p></dd>
5167 <dt> &lsquo;<samp>vsse</samp>&rsquo;</dt>
5168 <dd><p>sum of squared vertical differences
5169 </p></dd>
5170 <dt> &lsquo;<samp>nsse</samp>&rsquo;</dt>
5171 <dd><p>noise preserving sum of squared differences
5172 </p></dd>
5173 <dt> &lsquo;<samp>w53</samp>&rsquo;</dt>
5174 <dd><p>5/3 wavelet, only used in snow
5175 </p></dd>
5176 <dt> &lsquo;<samp>w97</samp>&rsquo;</dt>
5177 <dd><p>9/7 wavelet, only used in snow
5178 </p></dd>
5179 <dt> &lsquo;<samp>dctmax</samp>&rsquo;</dt>
5180 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
5181 </dl>
5182
5183 </dd>
5184 <dt> &lsquo;<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5185 <dd><p>Increase the quantizer for macroblocks close to borders.
5186 </p>
5187 </dd>
5188 <dt> &lsquo;<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5189 <dd><p>Set min macroblock lagrange factor (VBR).
5190 </p>
5191 </dd>
5192 <dt> &lsquo;<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5193 <dd><p>Set max macroblock lagrange factor (VBR).
5194 </p>
5195 </dd>
5196 <dt> &lsquo;<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5197 <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
5198 </p>
5199 </dd>
5200 <dt> &lsquo;<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5201 <dt> &lsquo;<samp>skip_idct        <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5202 <dt> &lsquo;<samp>skip_frame       <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5203 <dd>
5204 <p>Make decoder discard processing depending on the frame type selected
5205 by the option value.
5206 </p>
5207 <p>&lsquo;<samp>skip_loop_filter</samp>&rsquo; skips frame loop filtering, &lsquo;<samp>skip_idct</samp>&rsquo;
5208 skips frame IDCT/dequantization, &lsquo;<samp>skip_frame</samp>&rsquo; skips decoding.
5209 </p>
5210 <p>Possible values:
5211 </p><dl compact="compact">
5212 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
5213 <dd><p>Discard no frame.
5214 </p>
5215 </dd>
5216 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
5217 <dd><p>Discard useless frames like 0-sized frames.
5218 </p>
5219 </dd>
5220 <dt> &lsquo;<samp>noref</samp>&rsquo;</dt>
5221 <dd><p>Discard all non-reference frames.
5222 </p>
5223 </dd>
5224 <dt> &lsquo;<samp>bidir</samp>&rsquo;</dt>
5225 <dd><p>Discard all bidirectional frames.
5226 </p>
5227 </dd>
5228 <dt> &lsquo;<samp>nokey</samp>&rsquo;</dt>
5229 <dd><p>Discard all frames excepts keyframes.
5230 </p>
5231 </dd>
5232 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
5233 <dd><p>Discard all frames.
5234 </p></dd>
5235 </dl>
5236
5237 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
5238 </p>
5239 </dd>
5240 <dt> &lsquo;<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5241 <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
5242 </p>
5243 </dd>
5244 <dt> &lsquo;<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5245 <dd><p>Downscale frames for dynamic B-frame decision.
5246 </p>
5247 </dd>
5248 <dt> &lsquo;<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5249 <dd><p>Set minimum interval between IDR-frames.
5250 </p>
5251 </dd>
5252 <dt> &lsquo;<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5253 <dd><p>Set reference frames to consider for motion compensation.
5254 </p>
5255 </dd>
5256 <dt> &lsquo;<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5257 <dd><p>Set chroma qp offset from luma.
5258 </p>
5259 </dd>
5260 <dt> &lsquo;<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
5261 <dd><p>Set rate-distortion optimal quantization.
5262 </p>
5263 </dd>
5264 <dt> &lsquo;<samp>sc_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5265 <dd><p>Set value multiplied by qscale for each frame and added to
5266 scene_change_score.
5267 </p>
5268 </dd>
5269 <dt> &lsquo;<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5270 <dt> &lsquo;<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5271 <dd><p>Adjust sensitivity of b_frame_strategy 1.
5272 </p>
5273 </dd>
5274 <dt> &lsquo;<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
5275 <dt> &lsquo;<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
5276 <dt> &lsquo;<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
5277 <dt> &lsquo;<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5278 <dd><p>Set GOP timecode frame start number, in non drop frame format.
5279 </p>
5280 </dd>
5281 <dt> &lsquo;<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
5282 <dd><p>Set desired number of audio channels.
5283 </p>
5284 </dd>
5285 <dt> &lsquo;<samp>bits_per_raw_sample <var>integer</var></samp>&rsquo;</dt>
5286 <dt> &lsquo;<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
5287 <dd>
5288 <p>Possible values:
5289 </p></dd>
5290 <dt> &lsquo;<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
5291 <dd>
5292 <p>Possible values:
5293 </p></dd>
5294 <dt> &lsquo;<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5295 <dt> &lsquo;<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5296 <dt> &lsquo;<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
5297 <dt> &lsquo;<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5298 <dt> &lsquo;<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5299 <dt> &lsquo;<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5300 <dt> &lsquo;<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5301 <dt> &lsquo;<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5302 <dt> &lsquo;<samp>log_level_offset <var>integer</var></samp>&rsquo;</dt>
5303 <dd><p>Set the log level offset.
5304 </p>
5305 </dd>
5306 <dt> &lsquo;<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
5307 <dd><p>Number of slices, used in parallelized encoding.
5308 </p>
5309 </dd>
5310 <dt> &lsquo;<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
5311 <dd><p>Select multithreading type.
5312 </p>
5313 <p>Possible values:
5314 </p><dl compact="compact">
5315 <dt> &lsquo;<samp>slice</samp>&rsquo;</dt>
5316 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
5317 </dl>
5318 </dd>
5319 <dt> &lsquo;<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
5320 <dd><p>Set audio service type.
5321 </p>
5322 <p>Possible values:
5323 </p><dl compact="compact">
5324 <dt> &lsquo;<samp>ma</samp>&rsquo;</dt>
5325 <dd><p>Main Audio Service
5326 </p></dd>
5327 <dt> &lsquo;<samp>ef</samp>&rsquo;</dt>
5328 <dd><p>Effects
5329 </p></dd>
5330 <dt> &lsquo;<samp>vi</samp>&rsquo;</dt>
5331 <dd><p>Visually Impaired
5332 </p></dd>
5333 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
5334 <dd><p>Hearing Impaired
5335 </p></dd>
5336 <dt> &lsquo;<samp>di</samp>&rsquo;</dt>
5337 <dd><p>Dialogue
5338 </p></dd>
5339 <dt> &lsquo;<samp>co</samp>&rsquo;</dt>
5340 <dd><p>Commentary
5341 </p></dd>
5342 <dt> &lsquo;<samp>em</samp>&rsquo;</dt>
5343 <dd><p>Emergency
5344 </p></dd>
5345 <dt> &lsquo;<samp>vo</samp>&rsquo;</dt>
5346 <dd><p>Voice Over
5347 </p></dd>
5348 <dt> &lsquo;<samp>ka</samp>&rsquo;</dt>
5349 <dd><p>Karaoke
5350 </p></dd>
5351 </dl>
5352
5353 </dd>
5354 <dt> &lsquo;<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
5355 <dd><p>Set sample format audio decoders should prefer. Default value is
5356 <code>none</code>.
5357 </p>
5358 </dd>
5359 <dt> &lsquo;<samp>pkt_timebase <var>rational number</var></samp>&rsquo;</dt>
5360 <dt> &lsquo;<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>&rsquo;</dt>
5361 <dd><p>Set the input subtitles character encoding.
5362 </p>
5363 </dd>
5364 <dt> &lsquo;<samp>field_order  <var>field_order</var> (<em>video</em>)</samp>&rsquo;</dt>
5365 <dd><p>Set/override the field order of the video.
5366 Possible values:
5367 </p><dl compact="compact">
5368 <dt> &lsquo;<samp>progressive</samp>&rsquo;</dt>
5369 <dd><p>Progressive video
5370 </p></dd>
5371 <dt> &lsquo;<samp>tt</samp>&rsquo;</dt>
5372 <dd><p>Interlaced video, top field coded and displayed first
5373 </p></dd>
5374 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
5375 <dd><p>Interlaced video, bottom field coded and displayed first
5376 </p></dd>
5377 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
5378 <dd><p>Interlaced video, top coded first, bottom displayed first
5379 </p></dd>
5380 <dt> &lsquo;<samp>bt</samp>&rsquo;</dt>
5381 <dd><p>Interlaced video, bottom coded first, top displayed first
5382 </p></dd>
5383 </dl>
5384
5385 </dd>
5386 <dt> &lsquo;<samp>skip_alpha <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
5387 <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
5388 &lsquo;<samp>gray</samp>&rsquo; flag in the &lsquo;<samp>flags</samp>&rsquo; option which skips chroma information
5389 instead of alpha. Default is 0.
5390 </p></dd>
5391 </dl>
5392
5393
5394 <a name="Decoders"></a>
5395 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Decoders">12. Decoders</a></h1>
5396
5397 <p>Decoders are configured elements in FFmpeg which allow the decoding of
5398 multimedia streams.
5399 </p>
5400 <p>When you configure your FFmpeg build, all the supported native decoders
5401 are enabled by default. Decoders requiring an external library must be enabled
5402 manually via the corresponding <code>--enable-lib</code> option. You can list all
5403 available decoders using the configure option <code>--list-decoders</code>.
5404 </p>
5405 <p>You can disable all the decoders with the configure option
5406 <code>--disable-decoders</code> and selectively enable / disable single decoders
5407 with the options <code>--enable-decoder=<var>DECODER</var></code> /
5408 <code>--disable-decoder=<var>DECODER</var></code>.
5409 </p>
5410 <p>The option <code>-codecs</code> of the ff* tools will display the list of
5411 enabled decoders.
5412 </p>
5413
5414 <a name="Video-Decoders"></a>
5415 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Decoders">13. Video Decoders</a></h1>
5416
5417 <p>A description of some of the currently available video decoders
5418 follows.
5419 </p>
5420 <a name="rawvideo-1"></a>
5421 <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo-1">13.1 rawvideo</a></h2>
5422
5423 <p>Raw video decoder.
5424 </p>
5425 <p>This decoder decodes rawvideo streams.
5426 </p>
5427 <a name="Options-7"></a>
5428 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-7">13.1.1 Options</a></h3>
5429
5430 <dl compact="compact">
5431 <dt> &lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
5432 <dd><p>Specify the assumed field type of the input video.
5433 </p><dl compact="compact">
5434 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
5435 <dd><p>the video is assumed to be progressive (default)
5436 </p></dd>
5437 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5438 <dd><p>bottom-field-first is assumed
5439 </p></dd>
5440 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5441 <dd><p>top-field-first is assumed
5442 </p></dd>
5443 </dl>
5444
5445 </dd>
5446 </dl>
5447
5448
5449 <a name="Audio-Decoders"></a>
5450 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Decoders">14. Audio Decoders</a></h1>
5451
5452 <a name="ffwavesynth"></a>
5453 <h2 class="section"><a href="ffmpeg-all.html#toc-ffwavesynth">14.1 ffwavesynth</a></h2>
5454
5455 <p>Internal wave synthetizer.
5456 </p>
5457 <p>This decoder generates wave patterns according to predefined sequences. Its
5458 use is purely internal and the format of the data it accepts is not publicly
5459 documented.
5460 </p>
5461 <a name="libcelt"></a>
5462 <h2 class="section"><a href="ffmpeg-all.html#toc-libcelt">14.2 libcelt</a></h2>
5463
5464 <p>libcelt decoder wrapper.
5465 </p>
5466 <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
5467 Requires the presence of the libcelt headers and library during configuration.
5468 You need to explicitly configure the build with <code>--enable-libcelt</code>.
5469 </p>
5470 <a name="libgsm"></a>
5471 <h2 class="section"><a href="ffmpeg-all.html#toc-libgsm">14.3 libgsm</a></h2>
5472
5473 <p>libgsm decoder wrapper.
5474 </p>
5475 <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
5476 the presence of the libgsm headers and library during configuration. You need
5477 to explicitly configure the build with <code>--enable-libgsm</code>.
5478 </p>
5479 <p>This decoder supports both the ordinary GSM and the Microsoft variant.
5480 </p>
5481 <a name="libilbc"></a>
5482 <h2 class="section"><a href="ffmpeg-all.html#toc-libilbc">14.4 libilbc</a></h2>
5483
5484 <p>libilbc decoder wrapper.
5485 </p>
5486 <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
5487 audio codec. Requires the presence of the libilbc headers and library during
5488 configuration. You need to explicitly configure the build with
5489 <code>--enable-libilbc</code>.
5490 </p>
5491 <a name="Options-26"></a>
5492 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-26">14.4.1 Options</a></h3>
5493
5494 <p>The following option is supported by the libilbc wrapper.
5495 </p>
5496 <dl compact="compact">
5497 <dt> &lsquo;<samp>enhance</samp>&rsquo;</dt>
5498 <dd>
5499 <p>Enable the enhancement of the decoded audio when set to 1. The default
5500 value is 0 (disabled).
5501 </p>
5502 </dd>
5503 </dl>
5504
5505 <a name="libopencore_002damrnb-1"></a>
5506 <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb-1">14.5 libopencore-amrnb</a></h2>
5507
5508 <p>libopencore-amrnb decoder wrapper.
5509 </p>
5510 <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
5511 Narrowband audio codec. Using it requires the presence of the
5512 libopencore-amrnb headers and library during configuration. You need to
5513 explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
5514 </p>
5515 <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
5516 without this library.
5517 </p>
5518 <a name="libopencore_002damrwb"></a>
5519 <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrwb">14.6 libopencore-amrwb</a></h2>
5520
5521 <p>libopencore-amrwb decoder wrapper.
5522 </p>
5523 <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
5524 Wideband audio codec. Using it requires the presence of the
5525 libopencore-amrwb headers and library during configuration. You need to
5526 explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
5527 </p>
5528 <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
5529 without this library.
5530 </p>
5531 <a name="libopus-1"></a>
5532 <h2 class="section"><a href="ffmpeg-all.html#toc-libopus-1">14.7 libopus</a></h2>
5533
5534 <p>libopus decoder wrapper.
5535 </p>
5536 <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
5537 Requires the presence of the libopus headers and library during
5538 configuration. You need to explicitly configure the build with
5539 <code>--enable-libopus</code>.
5540 </p>
5541
5542 <a name="Subtitles-Decoders"></a>
5543 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Subtitles-Decoders">15. Subtitles Decoders</a></h1>
5544
5545 <a name="dvdsub"></a>
5546 <h2 class="section"><a href="ffmpeg-all.html#toc-dvdsub">15.1 dvdsub</a></h2>
5547
5548 <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
5549 also be found in VobSub file pairs and in some Matroska files.
5550 </p>
5551 <a name="Options-30"></a>
5552 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-30">15.1.1 Options</a></h3>
5553
5554 <dl compact="compact">
5555 <dt> &lsquo;<samp>palette</samp>&rsquo;</dt>
5556 <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
5557 palette is normally specified in the index file; in Matroska, the palette is
5558 stored in the codec extra-data in the same format as in VobSub. In DVDs, the
5559 palette is stored in the IFO file, and therefore not available when reading
5560 from dumped VOB files.
5561 </p>
5562 <p>The format for this option is a string containing 16 24-bits hexadecimal
5563 numbers (without 0x prefix) separated by comas, for example <code>0d00ee,
5564 ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
5565 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
5566 </p></dd>
5567 </dl>
5568
5569 <a name="libzvbi_002dteletext"></a>
5570 <h2 class="section"><a href="ffmpeg-all.html#toc-libzvbi_002dteletext">15.2 libzvbi-teletext</a></h2>
5571
5572 <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
5573 subtitles. Requires the presence of the libzvbi headers and library during
5574 configuration. You need to explicitly configure the build with
5575 <code>--enable-libzvbi</code>.
5576 </p>
5577 <a name="Options-18"></a>
5578 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-18">15.2.1 Options</a></h3>
5579
5580 <dl compact="compact">
5581 <dt> &lsquo;<samp>txt_page</samp>&rsquo;</dt>
5582 <dd><p>List of teletext page numbers to decode. You may use the special * string to
5583 match all pages. Pages that do not match the specified list are dropped.
5584 Default value is *.
5585 </p></dd>
5586 <dt> &lsquo;<samp>txt_chop_top</samp>&rsquo;</dt>
5587 <dd><p>Discards the top teletext line. Default value is 1.
5588 </p></dd>
5589 <dt> &lsquo;<samp>txt_format</samp>&rsquo;</dt>
5590 <dd><p>Specifies the format of the decoded subtitles. The teletext decoder is capable
5591 of decoding the teletext pages to bitmaps or to simple text, you should use
5592 &quot;bitmap&quot; for teletext pages, because certain graphics and colors cannot be
5593 expressed in simple text. You might use &quot;text&quot; for teletext based subtitles if
5594 your application can handle simple text based subtitles. Default value is
5595 bitmap.
5596 </p></dd>
5597 <dt> &lsquo;<samp>txt_left</samp>&rsquo;</dt>
5598 <dd><p>X offset of generated bitmaps, default is 0.
5599 </p></dd>
5600 <dt> &lsquo;<samp>txt_top</samp>&rsquo;</dt>
5601 <dd><p>Y offset of generated bitmaps, default is 0.
5602 </p></dd>
5603 <dt> &lsquo;<samp>txt_chop_spaces</samp>&rsquo;</dt>
5604 <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
5605 text. This option is useful for teletext based subtitles where empty spaces may
5606 be present at the start or at the end of the lines or empty lines may be
5607 present between the subtitle lines because of double-sized teletext charactes.
5608 Default value is 1.
5609 </p></dd>
5610 <dt> &lsquo;<samp>txt_duration</samp>&rsquo;</dt>
5611 <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
5612 miliseconds. Default value is 30000 which is 30 seconds.
5613 </p></dd>
5614 <dt> &lsquo;<samp>txt_transparent</samp>&rsquo;</dt>
5615 <dd><p>Force transparent background of the generated teletext bitmaps. Default value
5616 is 0 which means an opaque (black) background.
5617 </p></dd>
5618 </dl>
5619
5620 <a name="Encoders"></a>
5621 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Encoders">16. Encoders</a></h1>
5622
5623 <p>Encoders are configured elements in FFmpeg which allow the encoding of
5624 multimedia streams.
5625 </p>
5626 <p>When you configure your FFmpeg build, all the supported native encoders
5627 are enabled by default. Encoders requiring an external library must be enabled
5628 manually via the corresponding <code>--enable-lib</code> option. You can list all
5629 available encoders using the configure option <code>--list-encoders</code>.
5630 </p>
5631 <p>You can disable all the encoders with the configure option
5632 <code>--disable-encoders</code> and selectively enable / disable single encoders
5633 with the options <code>--enable-encoder=<var>ENCODER</var></code> /
5634 <code>--disable-encoder=<var>ENCODER</var></code>.
5635 </p>
5636 <p>The option <code>-codecs</code> of the ff* tools will display the list of
5637 enabled encoders.
5638 </p>
5639
5640 <a name="Audio-Encoders"></a>
5641 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Encoders">17. Audio Encoders</a></h1>
5642
5643 <p>A description of some of the currently available audio encoders
5644 follows.
5645 </p>
5646 <p><a name="aacenc"></a>
5647 </p><a name="aac"></a>
5648 <h2 class="section"><a href="ffmpeg-all.html#toc-aac">17.1 aac</a></h2>
5649
5650 <p>Advanced Audio Coding (AAC) encoder.
5651 </p>
5652 <p>This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
5653 low complexity (AAC-LC) profile is supported. To use this encoder, you must set
5654 &lsquo;<samp>strict</samp>&rsquo; option to &lsquo;<samp>experimental</samp>&rsquo; or lower.
5655 </p>
5656 <p>As this encoder is experimental, unexpected behavior may exist from time to
5657 time. For a more stable AAC encoder, see <a href="#libvo_002daacenc">libvo-aacenc</a>. However, be warned
5658 that it has a worse quality reported by some users.
5659 </p>
5660 <p>See also <a href="#libfdk_002daac_002denc">libfdk_aac</a> and <a href="#libfaac">libfaac</a>.
5661 </p>
5662 <a name="Options-9"></a>
5663 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-9">17.1.1 Options</a></h3>
5664
5665 <dl compact="compact">
5666 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
5667 <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
5668 (CBR) mode.
5669 </p>
5670 </dd>
5671 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
5672 <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
5673 the <code>ffmpeg</code> command-line tool. For library interface users, use
5674 &lsquo;<samp>global_quality</samp>&rsquo;.
5675 </p>
5676 </dd>
5677 <dt> &lsquo;<samp>stereo_mode</samp>&rsquo;</dt>
5678 <dd><p>Set stereo encoding mode. Possible values:
5679 </p>
5680 <dl compact="compact">
5681 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
5682 <dd><p>Automatically selected by the encoder.
5683 </p>
5684 </dd>
5685 <dt> &lsquo;<samp>ms_off</samp>&rsquo;</dt>
5686 <dd><p>Disable middle/side encoding. This is the default.
5687 </p>
5688 </dd>
5689 <dt> &lsquo;<samp>ms_force</samp>&rsquo;</dt>
5690 <dd><p>Force middle/side encoding.
5691 </p></dd>
5692 </dl>
5693
5694 </dd>
5695 <dt> &lsquo;<samp>aac_coder</samp>&rsquo;</dt>
5696 <dd><p>Set AAC encoder coding method. Possible values:
5697 </p>
5698 <dl compact="compact">
5699 <dt> &lsquo;<samp>faac</samp>&rsquo;</dt>
5700 <dd><p>FAAC-inspired method.
5701 </p>
5702 <p>This method is a simplified reimplementation of the method used in FAAC, which
5703 sets thresholds proportional to the band energies, and then decreases all the
5704 thresholds with quantizer steps to find the appropriate quantization with
5705 distortion below threshold band by band.
5706 </p>
5707 <p>The quality of this method is comparable to the two loop searching method
5708 descibed below, but somewhat a little better and slower.
5709 </p>
5710 </dd>
5711 <dt> &lsquo;<samp>anmr</samp>&rsquo;</dt>
5712 <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
5713 </p>
5714 <p>This has a theoretic best quality out of all the coding methods, but at the
5715 cost of the slowest speed.
5716 </p>
5717 </dd>
5718 <dt> &lsquo;<samp>twoloop</samp>&rsquo;</dt>
5719 <dd><p>Two loop searching (TLS) method.
5720 </p>
5721 <p>This method first sets quantizers depending on band thresholds and then tries
5722 to find an optimal combination by adding or subtracting a specific value from
5723 all quantizers and adjusting some individual quantizer a little.
5724 </p>
5725 <p>This method produces similar quality with the FAAC method and is the default.
5726 </p>
5727 </dd>
5728 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
5729 <dd><p>Constant quantizer method.
5730 </p>
5731 <p>This method sets a constant quantizer for all bands. This is the fastest of all
5732 the methods, yet produces the worst quality.
5733 </p>
5734 </dd>
5735 </dl>
5736
5737 </dd>
5738 </dl>
5739
5740 <a name="ac3-and-ac3_005ffixed"></a>
5741 <h2 class="section"><a href="ffmpeg-all.html#toc-ac3-and-ac3_005ffixed">17.2 ac3 and ac3_fixed</a></h2>
5742
5743 <p>AC-3 audio encoders.
5744 </p>
5745 <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
5746 the undocumented RealAudio 3 (a.k.a. dnet).
5747 </p>
5748 <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
5749 encoder only uses fixed-point integer math. This does not mean that one is
5750 always faster, just that one or the other may be better suited to a
5751 particular system. The floating-point encoder will generally produce better
5752 quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
5753 default codec for any of the output formats, so it must be specified explicitly
5754 using the option <code>-acodec ac3_fixed</code> in order to use it.
5755 </p>
5756 <a name="AC_002d3-Metadata"></a>
5757 <h3 class="subsection"><a href="ffmpeg-all.html#toc-AC_002d3-Metadata">17.2.1 AC-3 Metadata</a></h3>
5758
5759 <p>The AC-3 metadata options are used to set parameters that describe the audio,
5760 but in most cases do not affect the audio encoding itself. Some of the options
5761 do directly affect or influence the decoding and playback of the resulting
5762 bitstream, while others are just for informational purposes. A few of the
5763 options will add bits to the output stream that could otherwise be used for
5764 audio data, and will thus affect the quality of the output. Those will be
5765 indicated accordingly with a note in the option list below.
5766 </p>
5767 <p>These parameters are described in detail in several publicly-available
5768 documents.
5769 </p><ul>
5770 <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>
5771 </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>
5772 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
5773 </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
5774 </li></ul>
5775
5776 <a name="Metadata-Control-Options"></a>
5777 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Metadata-Control-Options">17.2.1.1 Metadata Control Options</a></h4>
5778
5779 <dl compact="compact">
5780 <dt> &lsquo;<samp>-per_frame_metadata <var>boolean</var></samp>&rsquo;</dt>
5781 <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
5782 metadata for each frame.
5783 </p><dl compact="compact">
5784 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5785 <dd><p>The metadata values set at initialization will be used for every frame in the
5786 stream. (default)
5787 </p></dd>
5788 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5789 <dd><p>Metadata values can be changed before encoding each frame.
5790 </p></dd>
5791 </dl>
5792
5793 </dd>
5794 </dl>
5795
5796 <a name="Downmix-Levels"></a>
5797 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Downmix-Levels">17.2.1.2 Downmix Levels</a></h4>
5798
5799 <dl compact="compact">
5800 <dt> &lsquo;<samp>-center_mixlev <var>level</var></samp>&rsquo;</dt>
5801 <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
5802 channel when downmixing to stereo. This field will only be written to the
5803 bitstream if a center channel is present. The value is specified as a scale
5804 factor. There are 3 valid values:
5805 </p><dl compact="compact">
5806 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
5807 <dd><p>Apply -3dB gain
5808 </p></dd>
5809 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
5810 <dd><p>Apply -4.5dB gain (default)
5811 </p></dd>
5812 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
5813 <dd><p>Apply -6dB gain
5814 </p></dd>
5815 </dl>
5816
5817 </dd>
5818 <dt> &lsquo;<samp>-surround_mixlev <var>level</var></samp>&rsquo;</dt>
5819 <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
5820 channel(s) when downmixing to stereo. This field will only be written to the
5821 bitstream if one or more surround channels are present. The value is specified
5822 as a scale factor.  There are 3 valid values:
5823 </p><dl compact="compact">
5824 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
5825 <dd><p>Apply -3dB gain
5826 </p></dd>
5827 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
5828 <dd><p>Apply -6dB gain (default)
5829 </p></dd>
5830 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
5831 <dd><p>Silence Surround Channel(s)
5832 </p></dd>
5833 </dl>
5834
5835 </dd>
5836 </dl>
5837
5838 <a name="Audio-Production-Information"></a>
5839 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Audio-Production-Information">17.2.1.3 Audio Production Information</a></h4>
5840 <p>Audio Production Information is optional information describing the mixing
5841 environment.  Either none or both of the fields are written to the bitstream.
5842 </p>
5843 <dl compact="compact">
5844 <dt> &lsquo;<samp>-mixing_level <var>number</var></samp>&rsquo;</dt>
5845 <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
5846 environment when the mix was mastered. Valid values are 80 to 111, or -1 for
5847 unknown or not indicated. The default value is -1, but that value cannot be
5848 used if the Audio Production Information is written to the bitstream. Therefore,
5849 if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
5850 option must not be -1.
5851 </p>
5852 </dd>
5853 <dt> &lsquo;<samp>-room_type <var>type</var></samp>&rsquo;</dt>
5854 <dd><p>Room Type. Describes the equalization used during the final mixing session at
5855 the studio or on the dubbing stage. A large room is a dubbing stage with the
5856 industry standard X-curve equalization; a small room has flat equalization.
5857 This field will not be written to the bitstream if both the <code>mixing_level</code>
5858 option and the <code>room_type</code> option have the default values.
5859 </p><dl compact="compact">
5860 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5861 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
5862 <dd><p>Not Indicated (default)
5863 </p></dd>
5864 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5865 <dt> &lsquo;<samp>large</samp>&rsquo;</dt>
5866 <dd><p>Large Room
5867 </p></dd>
5868 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
5869 <dt> &lsquo;<samp>small</samp>&rsquo;</dt>
5870 <dd><p>Small Room
5871 </p></dd>
5872 </dl>
5873
5874 </dd>
5875 </dl>
5876
5877 <a name="Other-Metadata-Options"></a>
5878 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Other-Metadata-Options">17.2.1.4 Other Metadata Options</a></h4>
5879
5880 <dl compact="compact">
5881 <dt> &lsquo;<samp>-copyright <var>boolean</var></samp>&rsquo;</dt>
5882 <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
5883 </p><dl compact="compact">
5884 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5885 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
5886 <dd><p>No Copyright Exists (default)
5887 </p></dd>
5888 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5889 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
5890 <dd><p>Copyright Exists
5891 </p></dd>
5892 </dl>
5893
5894 </dd>
5895 <dt> &lsquo;<samp>-dialnorm <var>value</var></samp>&rsquo;</dt>
5896 <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
5897 program is below digital 100% full scale (0 dBFS). This parameter determines a
5898 level shift during audio reproduction that sets the average volume of the
5899 dialogue to a preset level. The goal is to match volume level between program
5900 sources. A value of -31dB will result in no volume level change, relative to
5901 the source volume, during audio reproduction. Valid values are whole numbers in
5902 the range -31 to -1, with -31 being the default.
5903 </p>
5904 </dd>
5905 <dt> &lsquo;<samp>-dsur_mode <var>mode</var></samp>&rsquo;</dt>
5906 <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
5907 (Pro Logic). This field will only be written to the bitstream if the audio
5908 stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
5909 apply Dolby Surround processing.
5910 </p><dl compact="compact">
5911 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5912 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
5913 <dd><p>Not Indicated (default)
5914 </p></dd>
5915 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5916 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
5917 <dd><p>Not Dolby Surround Encoded
5918 </p></dd>
5919 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
5920 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
5921 <dd><p>Dolby Surround Encoded
5922 </p></dd>
5923 </dl>
5924
5925 </dd>
5926 <dt> &lsquo;<samp>-original <var>boolean</var></samp>&rsquo;</dt>
5927 <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
5928 original source and not a copy.
5929 </p><dl compact="compact">
5930 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5931 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
5932 <dd><p>Not Original Source
5933 </p></dd>
5934 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5935 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
5936 <dd><p>Original Source (default)
5937 </p></dd>
5938 </dl>
5939
5940 </dd>
5941 </dl>
5942
5943 <a name="Extended-Bitstream-Information"></a>
5944 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information">17.2.2 Extended Bitstream Information</a></h3>
5945 <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
5946 specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
5947 If any one parameter in a group is specified, all values in that group will be
5948 written to the bitstream.  Default values are used for those that are written
5949 but have not been specified.  If the mixing levels are written, the decoder
5950 will use these values instead of the ones specified in the <code>center_mixlev</code>
5951 and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
5952 Syntax.
5953 </p>
5954 <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
5955 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-1">17.2.2.1 Extended Bitstream Information - Part 1</a></h4>
5956
5957 <dl compact="compact">
5958 <dt> &lsquo;<samp>-dmix_mode <var>mode</var></samp>&rsquo;</dt>
5959 <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
5960 (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
5961 </p><dl compact="compact">
5962 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
5963 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
5964 <dd><p>Not Indicated (default)
5965 </p></dd>
5966 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
5967 <dt> &lsquo;<samp>ltrt</samp>&rsquo;</dt>
5968 <dd><p>Lt/Rt Downmix Preferred
5969 </p></dd>
5970 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
5971 <dt> &lsquo;<samp>loro</samp>&rsquo;</dt>
5972 <dd><p>Lo/Ro Downmix Preferred
5973 </p></dd>
5974 </dl>
5975
5976 </dd>
5977 <dt> &lsquo;<samp>-ltrt_cmixlev <var>level</var></samp>&rsquo;</dt>
5978 <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
5979 center channel when downmixing to stereo in Lt/Rt mode.
5980 </p><dl compact="compact">
5981 <dt> &lsquo;<samp>1.414</samp>&rsquo;</dt>
5982 <dd><p>Apply +3dB gain
5983 </p></dd>
5984 <dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
5985 <dd><p>Apply +1.5dB gain
5986 </p></dd>
5987 <dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
5988 <dd><p>Apply 0dB gain
5989 </p></dd>
5990 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
5991 <dd><p>Apply -1.5dB gain
5992 </p></dd>
5993 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
5994 <dd><p>Apply -3.0dB gain
5995 </p></dd>
5996 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
5997 <dd><p>Apply -4.5dB gain (default)
5998 </p></dd>
5999 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
6000 <dd><p>Apply -6.0dB gain
6001 </p></dd>
6002 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
6003 <dd><p>Silence Center Channel
6004 </p></dd>
6005 </dl>
6006
6007 </dd>
6008 <dt> &lsquo;<samp>-ltrt_surmixlev <var>level</var></samp>&rsquo;</dt>
6009 <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
6010 surround channel(s) when downmixing to stereo in Lt/Rt mode.
6011 </p><dl compact="compact">
6012 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
6013 <dd><p>Apply -1.5dB gain
6014 </p></dd>
6015 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
6016 <dd><p>Apply -3.0dB gain
6017 </p></dd>
6018 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
6019 <dd><p>Apply -4.5dB gain
6020 </p></dd>
6021 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
6022 <dd><p>Apply -6.0dB gain (default)
6023 </p></dd>
6024 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
6025 <dd><p>Silence Surround Channel(s)
6026 </p></dd>
6027 </dl>
6028
6029 </dd>
6030 <dt> &lsquo;<samp>-loro_cmixlev <var>level</var></samp>&rsquo;</dt>
6031 <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
6032 center channel when downmixing to stereo in Lo/Ro mode.
6033 </p><dl compact="compact">
6034 <dt> &lsquo;<samp>1.414</samp>&rsquo;</dt>
6035 <dd><p>Apply +3dB gain
6036 </p></dd>
6037 <dt> &lsquo;<samp>1.189</samp>&rsquo;</dt>
6038 <dd><p>Apply +1.5dB gain
6039 </p></dd>
6040 <dt> &lsquo;<samp>1.000</samp>&rsquo;</dt>
6041 <dd><p>Apply 0dB gain
6042 </p></dd>
6043 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
6044 <dd><p>Apply -1.5dB gain
6045 </p></dd>
6046 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
6047 <dd><p>Apply -3.0dB gain
6048 </p></dd>
6049 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
6050 <dd><p>Apply -4.5dB gain (default)
6051 </p></dd>
6052 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
6053 <dd><p>Apply -6.0dB gain
6054 </p></dd>
6055 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
6056 <dd><p>Silence Center Channel
6057 </p></dd>
6058 </dl>
6059
6060 </dd>
6061 <dt> &lsquo;<samp>-loro_surmixlev <var>level</var></samp>&rsquo;</dt>
6062 <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
6063 surround channel(s) when downmixing to stereo in Lo/Ro mode.
6064 </p><dl compact="compact">
6065 <dt> &lsquo;<samp>0.841</samp>&rsquo;</dt>
6066 <dd><p>Apply -1.5dB gain
6067 </p></dd>
6068 <dt> &lsquo;<samp>0.707</samp>&rsquo;</dt>
6069 <dd><p>Apply -3.0dB gain
6070 </p></dd>
6071 <dt> &lsquo;<samp>0.595</samp>&rsquo;</dt>
6072 <dd><p>Apply -4.5dB gain
6073 </p></dd>
6074 <dt> &lsquo;<samp>0.500</samp>&rsquo;</dt>
6075 <dd><p>Apply -6.0dB gain (default)
6076 </p></dd>
6077 <dt> &lsquo;<samp>0.000</samp>&rsquo;</dt>
6078 <dd><p>Silence Surround Channel(s)
6079 </p></dd>
6080 </dl>
6081
6082 </dd>
6083 </dl>
6084
6085 <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
6086 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-2">17.2.2.2 Extended Bitstream Information - Part 2</a></h4>
6087
6088 <dl compact="compact">
6089 <dt> &lsquo;<samp>-dsurex_mode <var>mode</var></samp>&rsquo;</dt>
6090 <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
6091 (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
6092 apply Dolby Surround EX processing.
6093 </p><dl compact="compact">
6094 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
6095 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
6096 <dd><p>Not Indicated (default)
6097 </p></dd>
6098 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6099 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
6100 <dd><p>Dolby Surround EX Off
6101 </p></dd>
6102 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
6103 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
6104 <dd><p>Dolby Surround EX On
6105 </p></dd>
6106 </dl>
6107
6108 </dd>
6109 <dt> &lsquo;<samp>-dheadphone_mode <var>mode</var></samp>&rsquo;</dt>
6110 <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
6111 encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
6112 option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
6113 processing.
6114 </p><dl compact="compact">
6115 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
6116 <dt> &lsquo;<samp>notindicated</samp>&rsquo;</dt>
6117 <dd><p>Not Indicated (default)
6118 </p></dd>
6119 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6120 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
6121 <dd><p>Dolby Headphone Off
6122 </p></dd>
6123 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
6124 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
6125 <dd><p>Dolby Headphone On
6126 </p></dd>
6127 </dl>
6128
6129 </dd>
6130 <dt> &lsquo;<samp>-ad_conv_type <var>type</var></samp>&rsquo;</dt>
6131 <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
6132 conversion.
6133 </p><dl compact="compact">
6134 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
6135 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
6136 <dd><p>Standard A/D Converter (default)
6137 </p></dd>
6138 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6139 <dt> &lsquo;<samp>hdcd</samp>&rsquo;</dt>
6140 <dd><p>HDCD A/D Converter
6141 </p></dd>
6142 </dl>
6143
6144 </dd>
6145 </dl>
6146
6147 <a name="Other-AC_002d3-Encoding-Options"></a>
6148 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Other-AC_002d3-Encoding-Options">17.2.3 Other AC-3 Encoding Options</a></h3>
6149
6150 <dl compact="compact">
6151 <dt> &lsquo;<samp>-stereo_rematrixing <var>boolean</var></samp>&rsquo;</dt>
6152 <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
6153 is an optional AC-3 feature that increases quality by selectively encoding
6154 the left/right channels as mid/side. This option is enabled by default, and it
6155 is highly recommended that it be left as enabled except for testing purposes.
6156 </p>
6157 </dd>
6158 </dl>
6159
6160 <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
6161 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">17.2.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
6162
6163 <p>These options are only valid for the floating-point encoder and do not exist
6164 for the fixed-point encoder due to the corresponding features not being
6165 implemented in fixed-point.
6166 </p>
6167 <dl compact="compact">
6168 <dt> &lsquo;<samp>-channel_coupling <var>boolean</var></samp>&rsquo;</dt>
6169 <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
6170 that increases quality by combining high frequency information from multiple
6171 channels into a single channel. The per-channel high frequency information is
6172 sent with less accuracy in both the frequency and time domains. This allows
6173 more bits to be used for lower frequencies while preserving enough information
6174 to reconstruct the high frequencies. This option is enabled by default for the
6175 floating-point encoder and should generally be left as enabled except for
6176 testing purposes or to increase encoding speed.
6177 </p><dl compact="compact">
6178 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
6179 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
6180 <dd><p>Selected by Encoder (default)
6181 </p></dd>
6182 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
6183 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
6184 <dd><p>Disable Channel Coupling
6185 </p></dd>
6186 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6187 <dt> &lsquo;<samp>on</samp>&rsquo;</dt>
6188 <dd><p>Enable Channel Coupling
6189 </p></dd>
6190 </dl>
6191
6192 </dd>
6193 <dt> &lsquo;<samp>-cpl_start_band <var>number</var></samp>&rsquo;</dt>
6194 <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
6195 value higher than the bandwidth is used, it will be reduced to 1 less than the
6196 coupling end band. If <var>auto</var> is used, the start band will be determined by
6197 the encoder based on the bit rate, sample rate, and channel layout. This option
6198 has no effect if channel coupling is disabled.
6199 </p><dl compact="compact">
6200 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
6201 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
6202 <dd><p>Selected by Encoder (default)
6203 </p></dd>
6204 </dl>
6205
6206 </dd>
6207 </dl>
6208
6209 <p><a name="libfaac"></a>
6210 </p><a name="libfaac-1"></a>
6211 <h2 class="section"><a href="ffmpeg-all.html#toc-libfaac-1">17.3 libfaac</a></h2>
6212
6213 <p>libfaac AAC (Advanced Audio Coding) encoder wrapper.
6214 </p>
6215 <p>Requires the presence of the libfaac headers and library during
6216 configuration. You need to explicitly configure the build with
6217 <code>--enable-libfaac --enable-nonfree</code>.
6218 </p>
6219 <p>This encoder is considered to be of higher quality with respect to the
6220 <a href="#aacenc">the native experimental FFmpeg AAC encoder</a>.
6221 </p>
6222 <p>For more information see the libfaac project at
6223 <a href="http://www.audiocoding.com/faac.html/">http://www.audiocoding.com/faac.html/</a>.
6224 </p>
6225 <a name="Options-16"></a>
6226 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-16">17.3.1 Options</a></h3>
6227
6228 <p>The following shared FFmpeg codec options are recognized.
6229 </p>
6230 <p>The following options are supported by the libfaac wrapper. The
6231 <code>faac</code>-equivalent of the options are listed in parentheses.
6232 </p>
6233 <dl compact="compact">
6234 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
6235 <dd><p>Set bit rate in bits/s for ABR (Average Bit Rate) mode. If the bit rate
6236 is not explicitly specified, it is automatically set to a suitable
6237 value depending on the selected profile. <code>faac</code> bitrate is
6238 expressed in kilobits/s.
6239 </p>
6240 <p>Note that libfaac does not support CBR (Constant Bit Rate) but only
6241 ABR (Average Bit Rate).
6242 </p>
6243 <p>If VBR mode is enabled this option is ignored.
6244 </p>
6245 </dd>
6246 <dt> &lsquo;<samp>ar (<em>-R</em>)</samp>&rsquo;</dt>
6247 <dd><p>Set audio sampling rate (in Hz).
6248 </p>
6249 </dd>
6250 <dt> &lsquo;<samp>ac (<em>-c</em>)</samp>&rsquo;</dt>
6251 <dd><p>Set the number of audio channels.
6252 </p>
6253 </dd>
6254 <dt> &lsquo;<samp>cutoff (<em>-C</em>)</samp>&rsquo;</dt>
6255 <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
6256 will use a value automatically computed by the library. Default value
6257 is 0.
6258 </p>
6259 </dd>
6260 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
6261 <dd><p>Set audio profile.
6262 </p>
6263 <p>The following profiles are recognized:
6264 </p><dl compact="compact">
6265 <dt> &lsquo;<samp>aac_main</samp>&rsquo;</dt>
6266 <dd><p>Main AAC (Main)
6267 </p>
6268 </dd>
6269 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
6270 <dd><p>Low Complexity AAC (LC)
6271 </p>
6272 </dd>
6273 <dt> &lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
6274 <dd><p>Scalable Sample Rate (SSR)
6275 </p>
6276 </dd>
6277 <dt> &lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
6278 <dd><p>Long Term Prediction (LTP)
6279 </p></dd>
6280 </dl>
6281
6282 <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
6283 </p>
6284 </dd>
6285 <dt> &lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
6286 <dd><p>Set constant quality VBR (Variable Bit Rate) mode.
6287 </p>
6288 </dd>
6289 <dt> &lsquo;<samp>global_quality</samp>&rsquo;</dt>
6290 <dd><p>Set quality in VBR mode as an integer number of lambda units.
6291 </p>
6292 <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>.  The
6293 value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
6294 and used to set the quality value used by libfaac. A reasonable range
6295 for the option value in QP units is [10-500], the higher the value the
6296 higher the quality.
6297 </p>
6298 </dd>
6299 <dt> &lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</dt>
6300 <dd><p>Enable VBR mode when set to a non-negative value, and set constant
6301 quality value as a double floating point value in QP units.
6302 </p>
6303 <p>The value sets the quality value used by libfaac. A reasonable range
6304 for the option value is [10-500], the higher the value the higher the
6305 quality.
6306 </p>
6307 <p>This option is valid only using the <code>ffmpeg</code> command-line
6308 tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
6309 </p></dd>
6310 </dl>
6311
6312 <a name="Examples-27"></a>
6313 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-27">17.3.2 Examples</a></h3>
6314
6315 <ul>
6316 <li>
6317 Use <code>ffmpeg</code> to convert an audio file to ABR 128 kbps AAC in an M4A (MP4)
6318 container:
6319 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.wav -codec:a libfaac -b:a 128k -output.m4a
6320 </pre></td></tr></table>
6321
6322 </li><li>
6323 Use <code>ffmpeg</code> to convert an audio file to VBR AAC, using the
6324 LTP AAC profile:
6325 <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
6326 </pre></td></tr></table>
6327 </li></ul>
6328
6329 <p><a name="libfdk_002daac_002denc"></a>
6330 </p><a name="libfdk_005faac"></a>
6331 <h2 class="section"><a href="ffmpeg-all.html#toc-libfdk_005faac">17.4 libfdk_aac</a></h2>
6332
6333 <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
6334 </p>
6335 <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
6336 the Android project.
6337 </p>
6338 <p>Requires the presence of the libfdk-aac headers and library during
6339 configuration. You need to explicitly configure the build with
6340 <code>--enable-libfdk-aac</code>. The library is also incompatible with GPL,
6341 so if you allow the use of GPL, you should configure with
6342 <code>--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
6343 </p>
6344 <p>This encoder is considered to be of higher quality with respect to
6345 both <a href="#aacenc">the native experimental FFmpeg AAC encoder</a> and
6346 <a href="#libfaac">libfaac</a>.
6347 </p>
6348 <p>VBR encoding, enabled through the &lsquo;<samp>vbr</samp>&rsquo; or &lsquo;<samp>flags
6349 +qscale</samp>&rsquo; options, is experimental and only works with some
6350 combinations of parameters.
6351 </p>
6352 <p>For more information see the fdk-aac project at
6353 <a href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
6354 </p>
6355 <a name="Options-6"></a>
6356 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-6">17.4.1 Options</a></h3>
6357
6358 <p>The following options are mapped on the shared FFmpeg codec options.
6359 </p>
6360 <dl compact="compact">
6361 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
6362 <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
6363 is automatically set to a suitable value depending on the selected
6364 profile.
6365 </p>
6366 <p>In case VBR mode is enabled the option is ignored.
6367 </p>
6368 </dd>
6369 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
6370 <dd><p>Set audio sampling rate (in Hz).
6371 </p>
6372 </dd>
6373 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
6374 <dd><p>Set the number of audio channels.
6375 </p>
6376 </dd>
6377 <dt> &lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
6378 <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
6379 Note that VBR is implicitly enabled when the &lsquo;<samp>vbr</samp>&rsquo; value is
6380 positive.
6381 </p>
6382 </dd>
6383 <dt> &lsquo;<samp>cutoff</samp>&rsquo;</dt>
6384 <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
6385 will use a value automatically computed by the library. Default value
6386 is 0.
6387 </p>
6388 </dd>
6389 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
6390 <dd><p>Set audio profile.
6391 </p>
6392 <p>The following profiles are recognized:
6393 </p><dl compact="compact">
6394 <dt> &lsquo;<samp>aac_low</samp>&rsquo;</dt>
6395 <dd><p>Low Complexity AAC (LC)
6396 </p>
6397 </dd>
6398 <dt> &lsquo;<samp>aac_he</samp>&rsquo;</dt>
6399 <dd><p>High Efficiency AAC (HE-AAC)
6400 </p>
6401 </dd>
6402 <dt> &lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
6403 <dd><p>High Efficiency AAC version 2 (HE-AACv2)
6404 </p>
6405 </dd>
6406 <dt> &lsquo;<samp>aac_ld</samp>&rsquo;</dt>
6407 <dd><p>Low Delay AAC (LD)
6408 </p>
6409 </dd>
6410 <dt> &lsquo;<samp>aac_eld</samp>&rsquo;</dt>
6411 <dd><p>Enhanced Low Delay AAC (ELD)
6412 </p></dd>
6413 </dl>
6414
6415 <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
6416 </p></dd>
6417 </dl>
6418
6419 <p>The following are private options of the libfdk_aac encoder.
6420 </p>
6421 <dl compact="compact">
6422 <dt> &lsquo;<samp>afterburner</samp>&rsquo;</dt>
6423 <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
6424 improves the quality but also the required processing power.
6425 </p>
6426 <p>Default value is 1.
6427 </p>
6428 </dd>
6429 <dt> &lsquo;<samp>eld_sbr</samp>&rsquo;</dt>
6430 <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
6431 if set to 0.
6432 </p>
6433 <p>Default value is 0.
6434 </p>
6435 </dd>
6436 <dt> &lsquo;<samp>signaling</samp>&rsquo;</dt>
6437 <dd><p>Set SBR/PS signaling style.
6438 </p>
6439 <p>It can assume one of the following values:
6440 </p><dl compact="compact">
6441 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
6442 <dd><p>choose signaling implicitly (explicit hierarchical by default,
6443 implicit if global header is disabled)
6444 </p>
6445 </dd>
6446 <dt> &lsquo;<samp>implicit</samp>&rsquo;</dt>
6447 <dd><p>implicit backwards compatible signaling
6448 </p>
6449 </dd>
6450 <dt> &lsquo;<samp>explicit_sbr</samp>&rsquo;</dt>
6451 <dd><p>explicit SBR, implicit PS signaling
6452 </p>
6453 </dd>
6454 <dt> &lsquo;<samp>explicit_hierarchical</samp>&rsquo;</dt>
6455 <dd><p>explicit hierarchical signaling
6456 </p></dd>
6457 </dl>
6458
6459 <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
6460 </p>
6461 </dd>
6462 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
6463 <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
6464 </p>
6465 <p>Default value is 0.
6466 </p>
6467 </dd>
6468 <dt> &lsquo;<samp>header_period</samp>&rsquo;</dt>
6469 <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
6470 in-band configuration buffers within LATM/LOAS transport layer.
6471 </p>
6472 <p>Must be a 16-bits non-negative integer.
6473 </p>
6474 <p>Default value is 0.
6475 </p>
6476 </dd>
6477 <dt> &lsquo;<samp>vbr</samp>&rsquo;</dt>
6478 <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
6479 good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
6480 (Constant Bit Rate) is enabled.
6481 </p>
6482 <p>Currently only the &lsquo;<samp>aac_low</samp>&rsquo; profile supports VBR encoding.
6483 </p>
6484 <p>VBR modes 1-5 correspond to roughly the following average bit rates:
6485 </p>
6486 <dl compact="compact">
6487 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6488 <dd><p>32 kbps/channel
6489 </p></dd>
6490 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
6491 <dd><p>40 kbps/channel
6492 </p></dd>
6493 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
6494 <dd><p>48-56 kbps/channel
6495 </p></dd>
6496 <dt> &lsquo;<samp>4</samp>&rsquo;</dt>
6497 <dd><p>64 kbps/channel
6498 </p></dd>
6499 <dt> &lsquo;<samp>5</samp>&rsquo;</dt>
6500 <dd><p>about 80-96 kbps/channel
6501 </p></dd>
6502 </dl>
6503
6504 <p>Default value is 0.
6505 </p></dd>
6506 </dl>
6507
6508 <a name="Examples-12"></a>
6509 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-12">17.4.2 Examples</a></h3>
6510
6511 <ul>
6512 <li>
6513 Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
6514 container:
6515 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
6516 </pre></td></tr></table>
6517
6518 </li><li>
6519 Use <code>ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
6520 High-Efficiency AAC profile:
6521 <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
6522 </pre></td></tr></table>
6523 </li></ul>
6524
6525 <p><a name="libmp3lame"></a>
6526 </p><a name="libmp3lame-1"></a>
6527 <h2 class="section"><a href="ffmpeg-all.html#toc-libmp3lame-1">17.5 libmp3lame</a></h2>
6528
6529 <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
6530 </p>
6531 <p>Requires the presence of the libmp3lame headers and library during
6532 configuration. You need to explicitly configure the build with
6533 <code>--enable-libmp3lame</code>.
6534 </p>
6535 <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
6536 lower quality.
6537 </p>
6538 <a name="Options-21"></a>
6539 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-21">17.5.1 Options</a></h3>
6540
6541 <p>The following options are supported by the libmp3lame wrapper. The
6542 <code>lame</code>-equivalent of the options are listed in parentheses.
6543 </p>
6544 <dl compact="compact">
6545 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
6546 <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
6547 expressed in kilobits/s.
6548 </p>
6549 </dd>
6550 <dt> &lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
6551 <dd><p>Set constant quality setting for VBR. This option is valid only
6552 using the <code>ffmpeg</code> command-line tool. For library interface
6553 users, use &lsquo;<samp>global_quality</samp>&rsquo;.
6554 </p>
6555 </dd>
6556 <dt> &lsquo;<samp>compression_level (<em>-q</em>)</samp>&rsquo;</dt>
6557 <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
6558 with 0 meaning highest quality but slowest, and 9 meaning fastest
6559 while producing the worst quality.
6560 </p>
6561 </dd>
6562 <dt> &lsquo;<samp>reservoir</samp>&rsquo;</dt>
6563 <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
6564 has this enabled by default, but can be overriden by use
6565 &lsquo;<samp>--nores</samp>&rsquo; option.
6566 </p>
6567 </dd>
6568 <dt> &lsquo;<samp>joint_stereo (<em>-m j</em>)</samp>&rsquo;</dt>
6569 <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
6570 stereo or mid/side stereo. Default value is 1.
6571 </p>
6572 </dd>
6573 <dt> &lsquo;<samp>abr (<em>--abr</em>)</samp>&rsquo;</dt>
6574 <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
6575 &lsquo;<samp>--abr</samp>&rsquo; sets the target bitrate, while this options only
6576 tells FFmpeg to use ABR still relies on &lsquo;<samp>b</samp>&rsquo; to set bitrate.
6577 </p>
6578 </dd>
6579 </dl>
6580
6581 <a name="libopencore_002damrnb"></a>
6582 <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb">17.6 libopencore-amrnb</a></h2>
6583
6584 <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
6585 </p>
6586 <p>Requires the presence of the libopencore-amrnb headers and library during
6587 configuration. You need to explicitly configure the build with
6588 <code>--enable-libopencore-amrnb --enable-version3</code>.
6589 </p>
6590 <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
6591 but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to &lsquo;<samp>unofficial</samp>&rsquo; or
6592 lower.
6593 </p>
6594 <a name="Options-31"></a>
6595 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-31">17.6.1 Options</a></h3>
6596
6597 <dl compact="compact">
6598 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
6599 <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
6600 otherwise libavcodec will round to the nearest valid bitrate.
6601 </p>
6602 <dl compact="compact">
6603 <dt> &lsquo;<samp>4750</samp>&rsquo;</dt>
6604 <dt> &lsquo;<samp>5150</samp>&rsquo;</dt>
6605 <dt> &lsquo;<samp>5900</samp>&rsquo;</dt>
6606 <dt> &lsquo;<samp>6700</samp>&rsquo;</dt>
6607 <dt> &lsquo;<samp>7400</samp>&rsquo;</dt>
6608 <dt> &lsquo;<samp>7950</samp>&rsquo;</dt>
6609 <dt> &lsquo;<samp>10200</samp>&rsquo;</dt>
6610 <dt> &lsquo;<samp>12200</samp>&rsquo;</dt>
6611 </dl>
6612
6613 </dd>
6614 <dt> &lsquo;<samp>dtx</samp>&rsquo;</dt>
6615 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
6616 default value is 0 (disabled).
6617 </p>
6618 </dd>
6619 </dl>
6620
6621 <p><a name="libshine"></a>
6622 </p><a name="libshine-1"></a>
6623 <h2 class="section"><a href="ffmpeg-all.html#toc-libshine-1">17.7 libshine</a></h2>
6624
6625 <p>Shine Fixed-Point MP3 encoder wrapper.
6626 </p>
6627 <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
6628 platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
6629 However, as it is more targeted on performance than quality, it is not on par
6630 with LAME and other production-grade encoders quality-wise. Also, according to
6631 the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
6632 written a long time ago and the project was dead for at least 5 years.
6633 </p>
6634 <p>This encoder only supports stereo and mono input. This is also CBR-only.
6635 </p>
6636 <p>The original project (last updated in early 2007) is at
6637 <a href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
6638 updated fork by the Savonet/Liquidsoap project at <a href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
6639 </p>
6640 <p>Requires the presence of the libshine headers and library during
6641 configuration. You need to explicitly configure the build with
6642 <code>--enable-libshine</code>.
6643 </p>
6644 <p>See also <a href="#libmp3lame">libmp3lame</a>.
6645 </p>
6646 <a name="Options-13"></a>
6647 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-13">17.7.1 Options</a></h3>
6648
6649 <p>The following options are supported by the libshine wrapper. The
6650 <code>shineenc</code>-equivalent of the options are listed in parentheses.
6651 </p>
6652 <dl compact="compact">
6653 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
6654 <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> &lsquo;<samp>-b</samp>&rsquo; option
6655 is expressed in kilobits/s.
6656 </p>
6657 </dd>
6658 </dl>
6659
6660 <a name="libtwolame"></a>
6661 <h2 class="section"><a href="ffmpeg-all.html#toc-libtwolame">17.8 libtwolame</a></h2>
6662
6663 <p>TwoLAME MP2 encoder wrapper.
6664 </p>
6665 <p>Requires the presence of the libtwolame headers and library during
6666 configuration. You need to explicitly configure the build with
6667 <code>--enable-libtwolame</code>.
6668 </p>
6669 <a name="Options-8"></a>
6670 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-8">17.8.1 Options</a></h3>
6671
6672 <p>The following options are supported by the libtwolame wrapper. The
6673 <code>twolame</code>-equivalent options follow the FFmpeg ones and are in
6674 parentheses.
6675 </p>
6676 <dl compact="compact">
6677 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
6678 <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> &lsquo;<samp>b</samp>&rsquo;
6679 option is expressed in kilobits/s. Default value is 128k.
6680 </p>
6681 </dd>
6682 <dt> &lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
6683 <dd><p>Set quality for experimental VBR support. Maximum value range is
6684 from -50 to 50, useful range is from -10 to 10. The higher the
6685 value, the better the quality. This option is valid only using the
6686 <code>ffmpeg</code> command-line tool. For library interface users,
6687 use &lsquo;<samp>global_quality</samp>&rsquo;.
6688 </p>
6689 </dd>
6690 <dt> &lsquo;<samp>mode (<em>--mode</em>)</samp>&rsquo;</dt>
6691 <dd><p>Set the mode of the resulting audio. Possible values:
6692 </p>
6693 <dl compact="compact">
6694 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
6695 <dd><p>Choose mode automatically based on the input. This is the default.
6696 </p></dd>
6697 <dt> &lsquo;<samp>stereo</samp>&rsquo;</dt>
6698 <dd><p>Stereo
6699 </p></dd>
6700 <dt> &lsquo;<samp>joint_stereo</samp>&rsquo;</dt>
6701 <dd><p>Joint stereo
6702 </p></dd>
6703 <dt> &lsquo;<samp>dual_channel</samp>&rsquo;</dt>
6704 <dd><p>Dual channel
6705 </p></dd>
6706 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
6707 <dd><p>Mono
6708 </p></dd>
6709 </dl>
6710
6711 </dd>
6712 <dt> &lsquo;<samp>psymodel (<em>--psyc-mode</em>)</samp>&rsquo;</dt>
6713 <dd><p>Set psychoacoustic model to use in encoding. The argument must be
6714 an integer between -1 and 4, inclusive. The higher the value, the
6715 better the quality. The default value is 3.
6716 </p>
6717 </dd>
6718 <dt> &lsquo;<samp>energy_levels (<em>--energy</em>)</samp>&rsquo;</dt>
6719 <dd><p>Enable energy levels extensions when set to 1. The default value is
6720 0 (disabled).
6721 </p>
6722 </dd>
6723 <dt> &lsquo;<samp>error_protection (<em>--protect</em>)</samp>&rsquo;</dt>
6724 <dd><p>Enable CRC error protection when set to 1. The default value is 0
6725 (disabled).
6726 </p>
6727 </dd>
6728 <dt> &lsquo;<samp>copyright (<em>--copyright</em>)</samp>&rsquo;</dt>
6729 <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
6730 (disabled).
6731 </p>
6732 </dd>
6733 <dt> &lsquo;<samp>original (<em>--original</em>)</samp>&rsquo;</dt>
6734 <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
6735 (disabled).
6736 </p>
6737 </dd>
6738 </dl>
6739
6740 <p><a name="libvo_002daacenc"></a>
6741 </p><a name="libvo_002daacenc-1"></a>
6742 <h2 class="section"><a href="ffmpeg-all.html#toc-libvo_002daacenc-1">17.9 libvo-aacenc</a></h2>
6743
6744 <p>VisualOn AAC encoder.
6745 </p>
6746 <p>Requires the presence of the libvo-aacenc headers and library during
6747 configuration. You need to explicitly configure the build with
6748 <code>--enable-libvo-aacenc --enable-version3</code>.
6749 </p>
6750 <p>This encoder is considered to be worse than the
6751 <a href="#aacenc">native experimental FFmpeg AAC encoder</a>, according to
6752 multiple sources.
6753 </p>
6754 <a name="Options-5"></a>
6755 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-5">17.9.1 Options</a></h3>
6756
6757 <p>The VisualOn AAC encoder only support encoding AAC-LC and up to 2
6758 channels. It is also CBR-only.
6759 </p>
6760 <dl compact="compact">
6761 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
6762 <dd><p>Set bit rate in bits/s.
6763 </p>
6764 </dd>
6765 </dl>
6766
6767 <a name="libvo_002damrwbenc"></a>
6768 <h2 class="section"><a href="ffmpeg-all.html#toc-libvo_002damrwbenc">17.10 libvo-amrwbenc</a></h2>
6769
6770 <p>VisualOn Adaptive Multi-Rate Wideband encoder.
6771 </p>
6772 <p>Requires the presence of the libvo-amrwbenc headers and library during
6773 configuration. You need to explicitly configure the build with
6774 <code>--enable-libvo-amrwbenc --enable-version3</code>.
6775 </p>
6776 <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
6777 rate, but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to
6778 &lsquo;<samp>unofficial</samp>&rsquo; or lower.
6779 </p>
6780 <a name="Options-22"></a>
6781 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-22">17.10.1 Options</a></h3>
6782
6783 <dl compact="compact">
6784 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
6785 <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
6786 libavcodec will round to the nearest valid bitrate.
6787 </p>
6788 <dl compact="compact">
6789 <dt> &lsquo;<samp>6600</samp>&rsquo;</dt>
6790 <dt> &lsquo;<samp>8850</samp>&rsquo;</dt>
6791 <dt> &lsquo;<samp>12650</samp>&rsquo;</dt>
6792 <dt> &lsquo;<samp>14250</samp>&rsquo;</dt>
6793 <dt> &lsquo;<samp>15850</samp>&rsquo;</dt>
6794 <dt> &lsquo;<samp>18250</samp>&rsquo;</dt>
6795 <dt> &lsquo;<samp>19850</samp>&rsquo;</dt>
6796 <dt> &lsquo;<samp>23050</samp>&rsquo;</dt>
6797 <dt> &lsquo;<samp>23850</samp>&rsquo;</dt>
6798 </dl>
6799
6800 </dd>
6801 <dt> &lsquo;<samp>dtx</samp>&rsquo;</dt>
6802 <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
6803 default value is 0 (disabled).
6804 </p>
6805 </dd>
6806 </dl>
6807
6808 <a name="libopus"></a>
6809 <h2 class="section"><a href="ffmpeg-all.html#toc-libopus">17.11 libopus</a></h2>
6810
6811 <p>libopus Opus Interactive Audio Codec encoder wrapper.
6812 </p>
6813 <p>Requires the presence of the libopus headers and library during
6814 configuration. You need to explicitly configure the build with
6815 <code>--enable-libopus</code>.
6816 </p>
6817 <a name="Option-Mapping"></a>
6818 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Option-Mapping">17.11.1 Option Mapping</a></h3>
6819
6820 <p>Most libopus options are modeled after the <code>opusenc</code> utility from
6821 opus-tools. The following is an option mapping chart describing options
6822 supported by the libopus wrapper, and their <code>opusenc</code>-equivalent
6823 in parentheses.
6824 </p>
6825 <dl compact="compact">
6826 <dt> &lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
6827 <dd><p>Set the bit rate in bits/s.  FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
6828 expressed in bits/s, while <code>opusenc</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; in
6829 kilobits/s.
6830 </p>
6831 </dd>
6832 <dt> &lsquo;<samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp>&rsquo;</dt>
6833 <dd><p>Set VBR mode. The FFmpeg &lsquo;<samp>vbr</samp>&rsquo; option has the following
6834 valid arguments, with the their <code>opusenc</code> equivalent options
6835 in parentheses:
6836 </p>
6837 <dl compact="compact">
6838 <dt> &lsquo;<samp>off (<em>hard-cbr</em>)</samp>&rsquo;</dt>
6839 <dd><p>Use constant bit rate encoding.
6840 </p>
6841 </dd>
6842 <dt> &lsquo;<samp>on (<em>vbr</em>)</samp>&rsquo;</dt>
6843 <dd><p>Use variable bit rate encoding (the default).
6844 </p>
6845 </dd>
6846 <dt> &lsquo;<samp>constrained (<em>cvbr</em>)</samp>&rsquo;</dt>
6847 <dd><p>Use constrained variable bit rate encoding.
6848 </p></dd>
6849 </dl>
6850
6851 </dd>
6852 <dt> &lsquo;<samp>compression_level (<em>comp</em>)</samp>&rsquo;</dt>
6853 <dd><p>Set encoding algorithm complexity. Valid options are integers in
6854 the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
6855 gives the highest quality but slowest encoding. The default is 10.
6856 </p>
6857 </dd>
6858 <dt> &lsquo;<samp>frame_duration (<em>framesize</em>)</samp>&rsquo;</dt>
6859 <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
6860 argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
6861 frame sizes achieve lower latency but less quality at a given bitrate.
6862 Sizes greater than 20ms are only interesting at fairly low bitrates.
6863 The default is 20ms.
6864 </p>
6865 </dd>
6866 <dt> &lsquo;<samp>packet_loss (<em>expect-loss</em>)</samp>&rsquo;</dt>
6867 <dd><p>Set expected packet loss percentage. The default is 0.
6868 </p>
6869 </dd>
6870 <dt> &lsquo;<samp>application (N.A.)</samp>&rsquo;</dt>
6871 <dd><p>Set intended application type. Valid options are listed below:
6872 </p>
6873 <dl compact="compact">
6874 <dt> &lsquo;<samp>voip</samp>&rsquo;</dt>
6875 <dd><p>Favor improved speech intelligibility.
6876 </p></dd>
6877 <dt> &lsquo;<samp>audio</samp>&rsquo;</dt>
6878 <dd><p>Favor faithfulness to the input (the default).
6879 </p></dd>
6880 <dt> &lsquo;<samp>lowdelay</samp>&rsquo;</dt>
6881 <dd><p>Restrict to only the lowest delay modes.
6882 </p></dd>
6883 </dl>
6884
6885 </dd>
6886 <dt> &lsquo;<samp>cutoff (N.A.)</samp>&rsquo;</dt>
6887 <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
6888 following: 4000, 6000, 8000, 12000, or 20000, corresponding to
6889 narrowband, mediumband, wideband, super wideband, and fullband
6890 respectively. The default is 0 (cutoff disabled).
6891 </p>
6892 </dd>
6893 </dl>
6894
6895 <a name="libvorbis"></a>
6896 <h2 class="section"><a href="ffmpeg-all.html#toc-libvorbis">17.12 libvorbis</a></h2>
6897
6898 <p>libvorbis encoder wrapper.
6899 </p>
6900 <p>Requires the presence of the libvorbisenc headers and library during
6901 configuration. You need to explicitly configure the build with
6902 <code>--enable-libvorbis</code>.
6903 </p>
6904 <a name="Options-27"></a>
6905 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-27">17.12.1 Options</a></h3>
6906
6907 <p>The following options are supported by the libvorbis wrapper. The
6908 <code>oggenc</code>-equivalent of the options are listed in parentheses.
6909 </p>
6910 <p>To get a more accurate and extensive documentation of the libvorbis
6911 options, consult the libvorbisenc&rsquo;s and <code>oggenc</code>&rsquo;s documentations.
6912 See <a href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
6913 <a href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
6914 </p>
6915 <dl compact="compact">
6916 <dt> &lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
6917 <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> &lsquo;<samp>-b</samp>&rsquo; is
6918 expressed in kilobits/s.
6919 </p>
6920 </dd>
6921 <dt> &lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</dt>
6922 <dd><p>Set constant quality setting for VBR. The value should be a float
6923 number in the range of -1.0 to 10.0. The higher the value, the better
6924 the quality. The default value is &lsquo;<samp>3.0</samp>&rsquo;.
6925 </p>
6926 <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
6927 For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
6928 </p>
6929 </dd>
6930 <dt> &lsquo;<samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp>&rsquo;</dt>
6931 <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>&rsquo;s
6932 related option is expressed in kHz. The default value is &lsquo;<samp>0</samp>&rsquo; (cutoff
6933 disabled).
6934 </p>
6935 </dd>
6936 <dt> &lsquo;<samp>minrate (<em>-m</em>)</samp>&rsquo;</dt>
6937 <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-m</samp>&rsquo; is
6938 expressed in kilobits/s.
6939 </p>
6940 </dd>
6941 <dt> &lsquo;<samp>maxrate (<em>-M</em>)</samp>&rsquo;</dt>
6942 <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-M</samp>&rsquo; is
6943 expressed in kilobits/s. This only has effect on ABR mode.
6944 </p>
6945 </dd>
6946 <dt> &lsquo;<samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp>&rsquo;</dt>
6947 <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
6948 -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
6949 to the crispness of transients in the encoded audio. The tradeoff for better
6950 transient response is a higher bitrate.
6951 </p>
6952 </dd>
6953 </dl>
6954
6955 <a name="libwavpack"></a>
6956 <h2 class="section"><a href="ffmpeg-all.html#toc-libwavpack">17.13 libwavpack</a></h2>
6957
6958 <p>A wrapper providing WavPack encoding through libwavpack.
6959 </p>
6960 <p>Only lossless mode using 32-bit integer samples is supported currently.
6961 The &lsquo;<samp>compression_level</samp>&rsquo; option can be used to control speed vs.
6962 compression tradeoff, with the values mapped to libwavpack as follows:
6963 </p>
6964 <dl compact="compact">
6965 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
6966 <dd><p>Fast mode - corresponding to the wavpack &lsquo;<samp>-f</samp>&rsquo; option.
6967 </p>
6968 </dd>
6969 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
6970 <dd><p>Normal (default) settings.
6971 </p>
6972 </dd>
6973 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
6974 <dd><p>High quality - corresponding to the wavpack &lsquo;<samp>-h</samp>&rsquo; option.
6975 </p>
6976 </dd>
6977 <dt> &lsquo;<samp>3</samp>&rsquo;</dt>
6978 <dd><p>Very high quality - corresponding to the wavpack &lsquo;<samp>-hh</samp>&rsquo; option.
6979 </p>
6980 </dd>
6981 <dt> &lsquo;<samp>4-8</samp>&rsquo;</dt>
6982 <dd><p>Same as 3, but with extra processing enabled - corresponding to the wavpack
6983 &lsquo;<samp>-x</samp>&rsquo; option. I.e. 4 is the same as &lsquo;<samp>-x2</samp>&rsquo; and 8 is the same as
6984 &lsquo;<samp>-x6</samp>&rsquo;.
6985 </p>
6986 </dd>
6987 </dl>
6988
6989
6990 <a name="Video-Encoders"></a>
6991 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Encoders">18. Video Encoders</a></h1>
6992
6993 <p>A description of some of the currently available video encoders
6994 follows.
6995 </p>
6996 <a name="libtheora"></a>
6997 <h2 class="section"><a href="ffmpeg-all.html#toc-libtheora">18.1 libtheora</a></h2>
6998
6999 <p>libtheora Theora encoder wrapper.
7000 </p>
7001 <p>Requires the presence of the libtheora headers and library during
7002 configuration. You need to explicitly configure the build with
7003 <code>--enable-libtheora</code>.
7004 </p>
7005 <p>For more informations about the libtheora project see
7006 <a href="http://www.theora.org/">http://www.theora.org/</a>.
7007 </p>
7008 <a name="Options-23"></a>
7009 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-23">18.1.1 Options</a></h3>
7010
7011 <p>The following global options are mapped to internal libtheora options
7012 which affect the quality and the bitrate of the encoded stream.
7013 </p>
7014 <dl compact="compact">
7015 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
7016 <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode.  In
7017 case VBR (Variable Bit Rate) mode is enabled this option is ignored.
7018 </p>
7019 </dd>
7020 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
7021 <dd><p>Used to enable constant quality mode (VBR) encoding through the
7022 &lsquo;<samp>qscale</samp>&rsquo; flag, and to enable the <code>pass1</code> and <code>pass2</code>
7023 modes.
7024 </p>
7025 </dd>
7026 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
7027 <dd><p>Set the GOP size.
7028 </p>
7029 </dd>
7030 <dt> &lsquo;<samp>global_quality</samp>&rsquo;</dt>
7031 <dd><p>Set the global quality as an integer in lambda units.
7032 </p>
7033 <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
7034 value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
7035 clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
7036 value in the native libtheora range [0-63]. A higher value corresponds
7037 to a higher quality.
7038 </p>
7039 </dd>
7040 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
7041 <dd><p>Enable VBR mode when set to a non-negative value, and set constant
7042 quality value as a double floating point value in QP units.
7043 </p>
7044 <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
7045 to get a value in the native libtheora range [0-63].
7046 </p>
7047 <p>This option is valid only using the <code>ffmpeg</code> command-line
7048 tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
7049 </p></dd>
7050 </dl>
7051
7052 <a name="Examples-62"></a>
7053 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-62">18.1.2 Examples</a></h3>
7054
7055 <ul>
7056 <li>
7057 Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
7058 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
7059 </pre></td></tr></table>
7060
7061 </li><li>
7062 Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
7063 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
7064 </pre></td></tr></table>
7065 </li></ul>
7066
7067 <a name="libvpx"></a>
7068 <h2 class="section"><a href="ffmpeg-all.html#toc-libvpx">18.2 libvpx</a></h2>
7069
7070 <p>VP8 format supported through libvpx.
7071 </p>
7072 <p>Requires the presence of the libvpx headers and library during configuration.
7073 You need to explicitly configure the build with <code>--enable-libvpx</code>.
7074 </p>
7075 <a name="Options-32"></a>
7076 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-32">18.2.1 Options</a></h3>
7077
7078 <p>Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
7079 </p>
7080 <dl compact="compact">
7081 <dt> &lsquo;<samp>threads</samp>&rsquo;</dt>
7082 <dd><p>g_threads
7083 </p>
7084 </dd>
7085 <dt> &lsquo;<samp>profile</samp>&rsquo;</dt>
7086 <dd><p>g_profile
7087 </p>
7088 </dd>
7089 <dt> &lsquo;<samp>vb</samp>&rsquo;</dt>
7090 <dd><p>rc_target_bitrate
7091 </p>
7092 </dd>
7093 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
7094 <dd><p>kf_max_dist
7095 </p>
7096 </dd>
7097 <dt> &lsquo;<samp>keyint_min</samp>&rsquo;</dt>
7098 <dd><p>kf_min_dist
7099 </p>
7100 </dd>
7101 <dt> &lsquo;<samp>qmin</samp>&rsquo;</dt>
7102 <dd><p>rc_min_quantizer
7103 </p>
7104 </dd>
7105 <dt> &lsquo;<samp>qmax</samp>&rsquo;</dt>
7106 <dd><p>rc_max_quantizer
7107 </p>
7108 </dd>
7109 <dt> &lsquo;<samp>bufsize, vb</samp>&rsquo;</dt>
7110 <dd><p>rc_buf_sz
7111 <code>(bufsize * 1000 / vb)</code>
7112 </p>
7113 <p>rc_buf_optimal_sz
7114 <code>(bufsize * 1000 / vb * 5 / 6)</code>
7115 </p>
7116 </dd>
7117 <dt> &lsquo;<samp>rc_init_occupancy, vb</samp>&rsquo;</dt>
7118 <dd><p>rc_buf_initial_sz
7119 <code>(rc_init_occupancy * 1000 / vb)</code>
7120 </p>
7121 </dd>
7122 <dt> &lsquo;<samp>rc_buffer_aggressivity</samp>&rsquo;</dt>
7123 <dd><p>rc_undershoot_pct
7124 </p>
7125 </dd>
7126 <dt> &lsquo;<samp>skip_threshold</samp>&rsquo;</dt>
7127 <dd><p>rc_dropframe_thresh
7128 </p>
7129 </dd>
7130 <dt> &lsquo;<samp>qcomp</samp>&rsquo;</dt>
7131 <dd><p>rc_2pass_vbr_bias_pct
7132 </p>
7133 </dd>
7134 <dt> &lsquo;<samp>maxrate, vb</samp>&rsquo;</dt>
7135 <dd><p>rc_2pass_vbr_maxsection_pct
7136 <code>(maxrate * 100 / vb)</code>
7137 </p>
7138 </dd>
7139 <dt> &lsquo;<samp>minrate, vb</samp>&rsquo;</dt>
7140 <dd><p>rc_2pass_vbr_minsection_pct
7141 <code>(minrate * 100 / vb)</code>
7142 </p>
7143 </dd>
7144 <dt> &lsquo;<samp>minrate, maxrate, vb</samp>&rsquo;</dt>
7145 <dd><p><code>VPX_CBR</code>
7146 <code>(minrate == maxrate == vb)</code>
7147 </p>
7148 </dd>
7149 <dt> &lsquo;<samp>crf</samp>&rsquo;</dt>
7150 <dd><p><code>VPX_CQ</code>, <code>VP8E_SET_CQ_LEVEL</code>
7151 </p>
7152 </dd>
7153 <dt> &lsquo;<samp>quality</samp>&rsquo;</dt>
7154 <dd><dl compact="compact">
7155 <dt> &lsquo;<samp><var>best</var></samp>&rsquo;</dt>
7156 <dd><p><code>VPX_DL_BEST_QUALITY</code>
7157 </p></dd>
7158 <dt> &lsquo;<samp><var>good</var></samp>&rsquo;</dt>
7159 <dd><p><code>VPX_DL_GOOD_QUALITY</code>
7160 </p></dd>
7161 <dt> &lsquo;<samp><var>realtime</var></samp>&rsquo;</dt>
7162 <dd><p><code>VPX_DL_REALTIME</code>
7163 </p></dd>
7164 </dl>
7165
7166 </dd>
7167 <dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
7168 <dd><p><code>VP8E_SET_CPUUSED</code>
7169 </p>
7170 </dd>
7171 <dt> &lsquo;<samp>nr</samp>&rsquo;</dt>
7172 <dd><p><code>VP8E_SET_NOISE_SENSITIVITY</code>
7173 </p>
7174 </dd>
7175 <dt> &lsquo;<samp>mb_threshold</samp>&rsquo;</dt>
7176 <dd><p><code>VP8E_SET_STATIC_THRESHOLD</code>
7177 </p>
7178 </dd>
7179 <dt> &lsquo;<samp>slices</samp>&rsquo;</dt>
7180 <dd><p><code>VP8E_SET_TOKEN_PARTITIONS</code>
7181 </p>
7182 </dd>
7183 <dt> &lsquo;<samp>max-intra-rate</samp>&rsquo;</dt>
7184 <dd><p><code>VP8E_SET_MAX_INTRA_BITRATE_PCT</code>
7185 </p>
7186 </dd>
7187 <dt> &lsquo;<samp>force_key_frames</samp>&rsquo;</dt>
7188 <dd><p><code>VPX_EFLAG_FORCE_KF</code>
7189 </p>
7190 </dd>
7191 <dt> &lsquo;<samp>Alternate reference frame related</samp>&rsquo;</dt>
7192 <dd><dl compact="compact">
7193 <dt> &lsquo;<samp>vp8flags altref</samp>&rsquo;</dt>
7194 <dd><p><code>VP8E_SET_ENABLEAUTOALTREF</code>
7195 </p></dd>
7196 <dt> &lsquo;<samp><var>arnr_max_frames</var></samp>&rsquo;</dt>
7197 <dd><p><code>VP8E_SET_ARNR_MAXFRAMES</code>
7198 </p></dd>
7199 <dt> &lsquo;<samp><var>arnr_type</var></samp>&rsquo;</dt>
7200 <dd><p><code>VP8E_SET_ARNR_TYPE</code>
7201 </p></dd>
7202 <dt> &lsquo;<samp><var>arnr_strength</var></samp>&rsquo;</dt>
7203 <dd><p><code>VP8E_SET_ARNR_STRENGTH</code>
7204 </p></dd>
7205 <dt> &lsquo;<samp><var>rc_lookahead</var></samp>&rsquo;</dt>
7206 <dd><p>g_lag_in_frames
7207 </p></dd>
7208 </dl>
7209
7210 </dd>
7211 <dt> &lsquo;<samp>vp8flags error_resilient</samp>&rsquo;</dt>
7212 <dd><p>g_error_resilient
7213 </p>
7214 </dd>
7215 </dl>
7216
7217 <p>For more information about libvpx see:
7218 <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
7219 </p>
7220 <a name="libx264"></a>
7221 <h2 class="section"><a href="ffmpeg-all.html#toc-libx264">18.3 libx264</a></h2>
7222
7223 <p>x264 H.264/MPEG-4 AVC encoder wrapper.
7224 </p>
7225 <p>This encoder requires the presence of the libx264 headers and library
7226 during configuration. You need to explicitly configure the build with
7227 <code>--enable-libx264</code>.
7228 </p>
7229 <p>libx264 supports an impressive number of features, including 8x8 and
7230 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
7231 entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
7232 for detail retention (adaptive quantization, psy-RD, psy-trellis).
7233 </p>
7234 <p>Many libx264 encoder options are mapped to FFmpeg global codec
7235 options, while unique encoder options are provided through private
7236 options. Additionally the &lsquo;<samp>x264opts</samp>&rsquo; and &lsquo;<samp>x264-params</samp>&rsquo;
7237 private options allows to pass a list of key=value tuples as accepted
7238 by the libx264 <code>x264_param_parse</code> function.
7239 </p>
7240 <p>The x264 project website is at
7241 <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
7242 </p>
7243 <a name="Options-19"></a>
7244 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-19">18.3.1 Options</a></h3>
7245
7246 <p>The following options are supported by the libx264 wrapper. The
7247 <code>x264</code>-equivalent options or values are listed in parentheses
7248 for easy migration.
7249 </p>
7250 <p>To reduce the duplication of documentation, only the private options
7251 and some others requiring special attention are documented here. For
7252 the documentation of the undocumented generic options, see
7253 <a href="#codec_002doptions">the Codec Options chapter</a>.
7254 </p>
7255 <p>To get a more accurate and extensive documentation of the libx264
7256 options, invoke the command <code>x264 --full-help</code> or consult
7257 the libx264 documentation.
7258 </p>
7259 <dl compact="compact">
7260 <dt> &lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
7261 <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
7262 expressed in bits/s, while <code>x264</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; is in
7263 kilobits/s.
7264 </p>
7265 </dd>
7266 <dt> &lsquo;<samp>bf (<em>bframes</em>)</samp>&rsquo;</dt>
7267 <dt> &lsquo;<samp>g (<em>keyint</em>)</samp>&rsquo;</dt>
7268 <dt> &lsquo;<samp>qmax (<em>qpmax</em>)</samp>&rsquo;</dt>
7269 <dt> &lsquo;<samp>qmin (<em>qpmin</em>)</samp>&rsquo;</dt>
7270 <dt> &lsquo;<samp>qdiff (<em>qpstep</em>)</samp>&rsquo;</dt>
7271 <dt> &lsquo;<samp>qblur (<em>qblur</em>)</samp>&rsquo;</dt>
7272 <dt> &lsquo;<samp>qcomp (<em>qcomp</em>)</samp>&rsquo;</dt>
7273 <dt> &lsquo;<samp>refs (<em>ref</em>)</samp>&rsquo;</dt>
7274 <dt> &lsquo;<samp>sc_threshold (<em>scenecut</em>)</samp>&rsquo;</dt>
7275 <dt> &lsquo;<samp>trellis (<em>trellis</em>)</samp>&rsquo;</dt>
7276 <dt> &lsquo;<samp>nr  (<em>nr</em>)</samp>&rsquo;</dt>
7277 <dt> &lsquo;<samp>me_range (<em>merange</em>)</samp>&rsquo;</dt>
7278 <dt> &lsquo;<samp>me_method (<em>me</em>)</samp>&rsquo;</dt>
7279 <dd><p>Set motion estimation method. Possible values in the decreasing order
7280 of speed:
7281 </p>
7282 <dl compact="compact">
7283 <dt> &lsquo;<samp>dia (<em>dia</em>)</samp>&rsquo;</dt>
7284 <dt> &lsquo;<samp>epzs (<em>dia</em>)</samp>&rsquo;</dt>
7285 <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp>epzs</samp>&rsquo; is an alias for
7286 &lsquo;<samp>dia</samp>&rsquo;.
7287 </p></dd>
7288 <dt> &lsquo;<samp>hex (<em>hex</em>)</samp>&rsquo;</dt>
7289 <dd><p>Hexagonal search with radius 2.
7290 </p></dd>
7291 <dt> &lsquo;<samp>umh (<em>umh</em>)</samp>&rsquo;</dt>
7292 <dd><p>Uneven multi-hexagon search.
7293 </p></dd>
7294 <dt> &lsquo;<samp>esa (<em>esa</em>)</samp>&rsquo;</dt>
7295 <dd><p>Exhaustive search.
7296 </p></dd>
7297 <dt> &lsquo;<samp>tesa (<em>tesa</em>)</samp>&rsquo;</dt>
7298 <dd><p>Hadamard exhaustive search (slowest).
7299 </p></dd>
7300 </dl>
7301
7302 </dd>
7303 <dt> &lsquo;<samp>subq (<em>subme</em>)</samp>&rsquo;</dt>
7304 <dt> &lsquo;<samp>b_strategy (<em>b-adapt</em>)</samp>&rsquo;</dt>
7305 <dt> &lsquo;<samp>keyint_min (<em>min-keyint</em>)</samp>&rsquo;</dt>
7306 <dt> &lsquo;<samp>coder</samp>&rsquo;</dt>
7307 <dd><p>Set entropy encoder. Possible values:
7308 </p>
7309 <dl compact="compact">
7310 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
7311 <dd><p>Enable CABAC.
7312 </p>
7313 </dd>
7314 <dt> &lsquo;<samp>vlc</samp>&rsquo;</dt>
7315 <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
7316 <code>x264</code>&rsquo;s &lsquo;<samp>--no-cabac</samp>&rsquo; option.
7317 </p></dd>
7318 </dl>
7319
7320 </dd>
7321 <dt> &lsquo;<samp>cmp</samp>&rsquo;</dt>
7322 <dd><p>Set full pixel motion estimation comparation algorithm. Possible values:
7323 </p>
7324 <dl compact="compact">
7325 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
7326 <dd><p>Enable chroma in motion estimation.
7327 </p>
7328 </dd>
7329 <dt> &lsquo;<samp>sad</samp>&rsquo;</dt>
7330 <dd><p>Ignore chroma in motion estimation. It generates the same effect as
7331 <code>x264</code>&rsquo;s &lsquo;<samp>--no-chroma-me</samp>&rsquo; option.
7332 </p></dd>
7333 </dl>
7334
7335 </dd>
7336 <dt> &lsquo;<samp>threads (<em>threads</em>)</samp>&rsquo;</dt>
7337 <dt> &lsquo;<samp>thread_type</samp>&rsquo;</dt>
7338 <dd><p>Set multithreading technique. Possible values:
7339 </p>
7340 <dl compact="compact">
7341 <dt> &lsquo;<samp>slice</samp>&rsquo;</dt>
7342 <dd><p>Slice-based multithreading. It generates the same effect as
7343 <code>x264</code>&rsquo;s &lsquo;<samp>--sliced-threads</samp>&rsquo; option.
7344 </p></dd>
7345 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
7346 <dd><p>Frame-based multithreading.
7347 </p></dd>
7348 </dl>
7349
7350 </dd>
7351 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
7352 <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
7353 open GOP by setting it to <code>-cgop</code>. The result is similar to
7354 the behavior of <code>x264</code>&rsquo;s &lsquo;<samp>--open-gop</samp>&rsquo; option.
7355 </p>
7356 </dd>
7357 <dt> &lsquo;<samp>rc_init_occupancy (<em>vbv-init</em>)</samp>&rsquo;</dt>
7358 <dt> &lsquo;<samp>preset (<em>preset</em>)</samp>&rsquo;</dt>
7359 <dd><p>Set the encoding preset.
7360 </p>
7361 </dd>
7362 <dt> &lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
7363 <dd><p>Set tuning of the encoding params.
7364 </p>
7365 </dd>
7366 <dt> &lsquo;<samp>profile (<em>profile</em>)</samp>&rsquo;</dt>
7367 <dd><p>Set profile restrictions.
7368 </p>
7369 </dd>
7370 <dt> &lsquo;<samp>fastfirstpass</samp>&rsquo;</dt>
7371 <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
7372 to 0, it has the same effect of <code>x264</code>&rsquo;s
7373 &lsquo;<samp>--slow-firstpass</samp>&rsquo; option.
7374 </p>
7375 </dd>
7376 <dt> &lsquo;<samp>crf (<em>crf</em>)</samp>&rsquo;</dt>
7377 <dd><p>Set the quality for constant quality mode.
7378 </p>
7379 </dd>
7380 <dt> &lsquo;<samp>crf_max (<em>crf-max</em>)</samp>&rsquo;</dt>
7381 <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
7382 </p>
7383 </dd>
7384 <dt> &lsquo;<samp>qp (<em>qp</em>)</samp>&rsquo;</dt>
7385 <dd><p>Set constant quantization rate control method parameter.
7386 </p>
7387 </dd>
7388 <dt> &lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
7389 <dd><p>Set AQ method. Possible values:
7390 </p>
7391 <dl compact="compact">
7392 <dt> &lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
7393 <dd><p>Disabled.
7394 </p>
7395 </dd>
7396 <dt> &lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
7397 <dd><p>Variance AQ (complexity mask).
7398 </p>
7399 </dd>
7400 <dt> &lsquo;<samp>autovariance (<em>2</em>)</samp>&rsquo;</dt>
7401 <dd><p>Auto-variance AQ (experimental).
7402 </p></dd>
7403 </dl>
7404
7405 </dd>
7406 <dt> &lsquo;<samp>aq-strength (<em>aq-strength</em>)</samp>&rsquo;</dt>
7407 <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
7408 </p>
7409 </dd>
7410 <dt> &lsquo;<samp>psy</samp>&rsquo;</dt>
7411 <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
7412 same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-psy</samp>&rsquo; option.
7413 </p>
7414 </dd>
7415 <dt> &lsquo;<samp>psy-rd  (<em>psy-rd</em>)</samp>&rsquo;</dt>
7416 <dd><p>Set strength of psychovisual optimization, in
7417 <var>psy-rd</var>:<var>psy-trellis</var> format.
7418 </p>
7419 </dd>
7420 <dt> &lsquo;<samp>rc-lookahead (<em>rc-lookahead</em>)</samp>&rsquo;</dt>
7421 <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
7422 </p>
7423 </dd>
7424 <dt> &lsquo;<samp>weightb</samp>&rsquo;</dt>
7425 <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
7426 it has the same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-weightb</samp>&rsquo; option.
7427 </p>
7428 </dd>
7429 <dt> &lsquo;<samp>weightp (<em>weightp</em>)</samp>&rsquo;</dt>
7430 <dd><p>Set weighted prediction method for P-frames. Possible values:
7431 </p>
7432 <dl compact="compact">
7433 <dt> &lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
7434 <dd><p>Disabled
7435 </p></dd>
7436 <dt> &lsquo;<samp>simple (<em>1</em>)</samp>&rsquo;</dt>
7437 <dd><p>Enable only weighted refs
7438 </p></dd>
7439 <dt> &lsquo;<samp>smart (<em>2</em>)</samp>&rsquo;</dt>
7440 <dd><p>Enable both weighted refs and duplicates
7441 </p></dd>
7442 </dl>
7443
7444 </dd>
7445 <dt> &lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
7446 <dd><p>Enable calculation and printing SSIM stats after the encoding.
7447 </p>
7448 </dd>
7449 <dt> &lsquo;<samp>intra-refresh (<em>intra-refresh</em>)</samp>&rsquo;</dt>
7450 <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
7451 to 1.
7452 </p>
7453 </dd>
7454 <dt> &lsquo;<samp>bluray-compat (<em>bluray-compat</em>)</samp>&rsquo;</dt>
7455 <dd><p>Configure the encoder to be compatible with the bluray standard.
7456 It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
7457 </p>
7458 </dd>
7459 <dt> &lsquo;<samp>b-bias (<em>b-bias</em>)</samp>&rsquo;</dt>
7460 <dd><p>Set the influence on how often B-frames are used.
7461 </p>
7462 </dd>
7463 <dt> &lsquo;<samp>b-pyramid (<em>b-pyramid</em>)</samp>&rsquo;</dt>
7464 <dd><p>Set method for keeping of some B-frames as references. Possible values:
7465 </p>
7466 <dl compact="compact">
7467 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
7468 <dd><p>Disabled.
7469 </p></dd>
7470 <dt> &lsquo;<samp>strict (<em>strict</em>)</samp>&rsquo;</dt>
7471 <dd><p>Strictly hierarchical pyramid.
7472 </p></dd>
7473 <dt> &lsquo;<samp>normal (<em>normal</em>)</samp>&rsquo;</dt>
7474 <dd><p>Non-strict (not Blu-ray compatible).
7475 </p></dd>
7476 </dl>
7477
7478 </dd>
7479 <dt> &lsquo;<samp>mixed-refs</samp>&rsquo;</dt>
7480 <dd><p>Enable the use of one reference per partition, as opposed to one
7481 reference per macroblock when set to 1. When set to 0, it has the
7482 same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-mixed-refs</samp>&rsquo; option.
7483 </p>
7484 </dd>
7485 <dt> &lsquo;<samp>8x8dct</samp>&rsquo;</dt>
7486 <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
7487 when set to 1. When set to 0, it has the same effect as
7488 <code>x264</code>&rsquo;s &lsquo;<samp>--no-8x8dct</samp>&rsquo; option.
7489 </p>
7490 </dd>
7491 <dt> &lsquo;<samp>fast-pskip</samp>&rsquo;</dt>
7492 <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
7493 to 0, it has the same effect as <code>x264</code>&rsquo;s
7494 &lsquo;<samp>--no-fast-pskip</samp>&rsquo; option.
7495 </p>
7496 </dd>
7497 <dt> &lsquo;<samp>aud (<em>aud</em>)</samp>&rsquo;</dt>
7498 <dd><p>Enable use of access unit delimiters when set to 1.
7499 </p>
7500 </dd>
7501 <dt> &lsquo;<samp>mbtree</samp>&rsquo;</dt>
7502 <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
7503 to 0, it has the same effect as <code>x264</code>&rsquo;s
7504 &lsquo;<samp>--no-mbtree</samp>&rsquo; option.
7505 </p>
7506 </dd>
7507 <dt> &lsquo;<samp>deblock (<em>deblock</em>)</samp>&rsquo;</dt>
7508 <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
7509 </p>
7510 </dd>
7511 <dt> &lsquo;<samp>cplxblur (<em>cplxblur</em>)</samp>&rsquo;</dt>
7512 <dd><p>Set fluctuations reduction in QP (before curve compression).
7513 </p>
7514 </dd>
7515 <dt> &lsquo;<samp>partitions (<em>partitions</em>)</samp>&rsquo;</dt>
7516 <dd><p>Set partitions to consider as a comma-separated list of. Possible
7517 values in the list:
7518 </p>
7519 <dl compact="compact">
7520 <dt> &lsquo;<samp>p8x8</samp>&rsquo;</dt>
7521 <dd><p>8x8 P-frame partition.
7522 </p></dd>
7523 <dt> &lsquo;<samp>p4x4</samp>&rsquo;</dt>
7524 <dd><p>4x4 P-frame partition.
7525 </p></dd>
7526 <dt> &lsquo;<samp>b8x8</samp>&rsquo;</dt>
7527 <dd><p>4x4 B-frame partition.
7528 </p></dd>
7529 <dt> &lsquo;<samp>i8x8</samp>&rsquo;</dt>
7530 <dd><p>8x8 I-frame partition.
7531 </p></dd>
7532 <dt> &lsquo;<samp>i4x4</samp>&rsquo;</dt>
7533 <dd><p>4x4 I-frame partition.
7534 (Enabling &lsquo;<samp>p4x4</samp>&rsquo; requires &lsquo;<samp>p8x8</samp>&rsquo; to be enabled. Enabling
7535 &lsquo;<samp>i8x8</samp>&rsquo; requires adaptive spatial transform (&lsquo;<samp>8x8dct</samp>&rsquo;
7536 option) to be enabled.)
7537 </p></dd>
7538 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
7539 <dd><p>Do not consider any partitions.
7540 </p></dd>
7541 <dt> &lsquo;<samp>all (<em>all</em>)</samp>&rsquo;</dt>
7542 <dd><p>Consider every partition.
7543 </p></dd>
7544 </dl>
7545
7546 </dd>
7547 <dt> &lsquo;<samp>direct-pred (<em>direct</em>)</samp>&rsquo;</dt>
7548 <dd><p>Set direct MV prediction mode. Possible values:
7549 </p>
7550 <dl compact="compact">
7551 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
7552 <dd><p>Disable MV prediction.
7553 </p></dd>
7554 <dt> &lsquo;<samp>spatial (<em>spatial</em>)</samp>&rsquo;</dt>
7555 <dd><p>Enable spatial predicting.
7556 </p></dd>
7557 <dt> &lsquo;<samp>temporal (<em>temporal</em>)</samp>&rsquo;</dt>
7558 <dd><p>Enable temporal predicting.
7559 </p></dd>
7560 <dt> &lsquo;<samp>auto (<em>auto</em>)</samp>&rsquo;</dt>
7561 <dd><p>Automatically decided.
7562 </p></dd>
7563 </dl>
7564
7565 </dd>
7566 <dt> &lsquo;<samp>slice-max-size (<em>slice-max-size</em>)</samp>&rsquo;</dt>
7567 <dd><p>Set the limit of the size of each slice in bytes. If not specified
7568 but RTP payload size (&lsquo;<samp>ps</samp>&rsquo;) is specified, that is used.
7569 </p>
7570 </dd>
7571 <dt> &lsquo;<samp>stats (<em>stats</em>)</samp>&rsquo;</dt>
7572 <dd><p>Set the file name for multi-pass stats.
7573 </p>
7574 </dd>
7575 <dt> &lsquo;<samp>nal-hrd (<em>nal-hrd</em>)</samp>&rsquo;</dt>
7576 <dd><p>Set signal HRD information (requires &lsquo;<samp>vbv-bufsize</samp>&rsquo; to be set).
7577 Possible values:
7578 </p>
7579 <dl compact="compact">
7580 <dt> &lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
7581 <dd><p>Disable HRD information signaling.
7582 </p></dd>
7583 <dt> &lsquo;<samp>vbr (<em>vbr</em>)</samp>&rsquo;</dt>
7584 <dd><p>Variable bit rate.
7585 </p></dd>
7586 <dt> &lsquo;<samp>cbr (<em>cbr</em>)</samp>&rsquo;</dt>
7587 <dd><p>Constant bit rate (not allowed in MP4 container).
7588 </p></dd>
7589 </dl>
7590
7591 </dd>
7592 <dt> &lsquo;<samp>x264opts (N.A.)</samp>&rsquo;</dt>
7593 <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
7594 </p>
7595 <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
7596 &quot;:&quot;. In <var>filter</var> and <var>psy-rd</var> options that use &quot;:&quot; as a separator
7597 themselves, use &quot;,&quot; instead. They accept it as well since long ago but this
7598 is kept undocumented for some reason.
7599 </p>
7600 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
7601 </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
7602 </pre></td></tr></table>
7603
7604 </dd>
7605 <dt> &lsquo;<samp>x264-params (N.A.)</samp>&rsquo;</dt>
7606 <dd><p>Override the x264 configuration using a :-separated list of key=value
7607 parameters.
7608 </p>
7609 <p>This option is functionally the same as the &lsquo;<samp>x264opts</samp>&rsquo;, but is
7610 duplicated for compability with the Libav fork.
7611 </p>
7612 <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
7613 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
7614 cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
7615 no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
7616 </pre></td></tr></table>
7617 </dd>
7618 </dl>
7619
7620 <p>Encoding ffpresets for common usages are provided so they can be used with the
7621 general presets system (e.g. passing the &lsquo;<samp>pre</samp>&rsquo; option).
7622 </p>
7623 <a name="libxvid"></a>
7624 <h2 class="section"><a href="ffmpeg-all.html#toc-libxvid">18.4 libxvid</a></h2>
7625
7626 <p>Xvid MPEG-4 Part 2 encoder wrapper.
7627 </p>
7628 <p>This encoder requires the presence of the libxvidcore headers and library
7629 during configuration. You need to explicitly configure the build with
7630 <code>--enable-libxvid --enable-gpl</code>.
7631 </p>
7632 <p>The native <code>mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
7633 users can encode to this format without this library.
7634 </p>
7635 <a name="Options-28"></a>
7636 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-28">18.4.1 Options</a></h3>
7637
7638 <p>The following options are supported by the libxvid wrapper. Some of
7639 the following options are listed but are not documented, and
7640 correspond to shared codec options. See <a href="#codec_002doptions">the Codec Options chapter</a> for their documentation. The other shared options
7641 which are not listed have no effect for the libxvid encoder.
7642 </p>
7643 <dl compact="compact">
7644 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
7645 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
7646 <dt> &lsquo;<samp>qmin</samp>&rsquo;</dt>
7647 <dt> &lsquo;<samp>qmax</samp>&rsquo;</dt>
7648 <dt> &lsquo;<samp>mpeg_quant</samp>&rsquo;</dt>
7649 <dt> &lsquo;<samp>threads</samp>&rsquo;</dt>
7650 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
7651 <dt> &lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
7652 <dt> &lsquo;<samp>b_qoffset</samp>&rsquo;</dt>
7653 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
7654 <dd><p>Set specific encoding flags. Possible values:
7655 </p>
7656 <dl compact="compact">
7657 <dt> &lsquo;<samp>mv4</samp>&rsquo;</dt>
7658 <dd><p>Use four motion vector by macroblock.
7659 </p>
7660 </dd>
7661 <dt> &lsquo;<samp>aic</samp>&rsquo;</dt>
7662 <dd><p>Enable high quality AC prediction.
7663 </p>
7664 </dd>
7665 <dt> &lsquo;<samp>gray</samp>&rsquo;</dt>
7666 <dd><p>Only encode grayscale.
7667 </p>
7668 </dd>
7669 <dt> &lsquo;<samp>gmc</samp>&rsquo;</dt>
7670 <dd><p>Enable the use of global motion compensation (GMC).
7671 </p>
7672 </dd>
7673 <dt> &lsquo;<samp>qpel</samp>&rsquo;</dt>
7674 <dd><p>Enable quarter-pixel motion compensation.
7675 </p>
7676 </dd>
7677 <dt> &lsquo;<samp>cgop</samp>&rsquo;</dt>
7678 <dd><p>Enable closed GOP.
7679 </p>
7680 </dd>
7681 <dt> &lsquo;<samp>global_header</samp>&rsquo;</dt>
7682 <dd><p>Place global headers in extradata instead of every keyframe.
7683 </p>
7684 </dd>
7685 </dl>
7686
7687 </dd>
7688 <dt> &lsquo;<samp>trellis</samp>&rsquo;</dt>
7689 <dt> &lsquo;<samp>me_method</samp>&rsquo;</dt>
7690 <dd><p>Set motion estimation method. Possible values in decreasing order of
7691 speed and increasing order of quality:
7692 </p>
7693 <dl compact="compact">
7694 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
7695 <dd><p>Use no motion estimation (default).
7696 </p>
7697 </dd>
7698 <dt> &lsquo;<samp>phods</samp>&rsquo;</dt>
7699 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
7700 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
7701 <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
7702 refinement for 16x16 blocks. &lsquo;<samp>x1</samp>&rsquo; and &lsquo;<samp>log</samp>&rsquo; are aliases for
7703 &lsquo;<samp>phods</samp>&rsquo;.
7704 </p>
7705 </dd>
7706 <dt> &lsquo;<samp>epzs</samp>&rsquo;</dt>
7707 <dd><p>Enable all of the things described above, plus advanced diamond zonal
7708 search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
7709 estimation on chroma planes.
7710 </p>
7711 </dd>
7712 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
7713 <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
7714 blocks search.
7715 </p></dd>
7716 </dl>
7717
7718 </dd>
7719 <dt> &lsquo;<samp>mbd</samp>&rsquo;</dt>
7720 <dd><p>Set macroblock decision algorithm. Possible values in the increasing
7721 order of quality:
7722 </p>
7723 <dl compact="compact">
7724 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
7725 <dd><p>Use macroblock comparing function algorithm (default).
7726 </p>
7727 </dd>
7728 <dt> &lsquo;<samp>bits</samp>&rsquo;</dt>
7729 <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
7730 16x16 blocks.
7731 </p>
7732 </dd>
7733 <dt> &lsquo;<samp>rd</samp>&rsquo;</dt>
7734 <dd><p>Enable all of the things described above, plus rate distortion-based
7735 half pixel and quarter pixel refinement for 8x8 blocks, and rate
7736 distortion-based search using square pattern.
7737 </p></dd>
7738 </dl>
7739
7740 </dd>
7741 <dt> &lsquo;<samp>lumi_aq</samp>&rsquo;</dt>
7742 <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
7743 (disabled).
7744 </p>
7745 </dd>
7746 <dt> &lsquo;<samp>variance_aq</samp>&rsquo;</dt>
7747 <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
7748 (disabled).
7749 </p>
7750 <p>When combined with &lsquo;<samp>lumi_aq</samp>&rsquo;, the resulting quality will not
7751 be better than any of the two specified individually. In other
7752 words, the resulting quality will be the worse one of the two
7753 effects.
7754 </p>
7755 </dd>
7756 <dt> &lsquo;<samp>ssim</samp>&rsquo;</dt>
7757 <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
7758 </p>
7759 <dl compact="compact">
7760 <dt> &lsquo;<samp>off</samp>&rsquo;</dt>
7761 <dd><p>Disable displaying of SSIM information.
7762 </p>
7763 </dd>
7764 <dt> &lsquo;<samp>avg</samp>&rsquo;</dt>
7765 <dd><p>Output average SSIM at the end of encoding to stdout. The format of
7766 showing the average SSIM is:
7767 </p>
7768 <table><tr><td>&nbsp;</td><td><pre class="example">Average SSIM: %f
7769 </pre></td></tr></table>
7770
7771 <p>For users who are not familiar with C, %f means a float number, or
7772 a decimal (e.g. 0.939232).
7773 </p>
7774 </dd>
7775 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
7776 <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
7777 the end of encoding to stdout. The format of per-frame information
7778 is:
7779 </p>
7780 <table><tr><td>&nbsp;</td><td><pre class="example">       SSIM: avg: %1.3f min: %1.3f max: %1.3f
7781 </pre></td></tr></table>
7782
7783 <p>For users who are not familiar with C, %1.3f means a float number
7784 rounded to 3 digits after the dot (e.g. 0.932).
7785 </p>
7786 </dd>
7787 </dl>
7788
7789 </dd>
7790 <dt> &lsquo;<samp>ssim_acc</samp>&rsquo;</dt>
7791 <dd><p>Set SSIM accuracy. Valid options are integers within the range of
7792 0-4, while 0 gives the most accurate result and 4 computes the
7793 fastest.
7794 </p>
7795 </dd>
7796 </dl>
7797
7798 <a name="png"></a>
7799 <h2 class="section"><a href="ffmpeg-all.html#toc-png">18.5 png</a></h2>
7800
7801 <p>PNG image encoder.
7802 </p>
7803 <a name="Private-options"></a>
7804 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-options">18.5.1 Private options</a></h3>
7805
7806 <dl compact="compact">
7807 <dt> &lsquo;<samp>dpi <var>integer</var></samp>&rsquo;</dt>
7808 <dd><p>Set physical density of pixels, in dots per inch, unset by default
7809 </p></dd>
7810 <dt> &lsquo;<samp>dpm <var>integer</var></samp>&rsquo;</dt>
7811 <dd><p>Set physical density of pixels, in dots per meter, unset by default
7812 </p></dd>
7813 </dl>
7814
7815 <a name="ProRes"></a>
7816 <h2 class="section"><a href="ffmpeg-all.html#toc-ProRes">18.6 ProRes</a></h2>
7817
7818 <p>Apple ProRes encoder.
7819 </p>
7820 <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
7821 The used encoder can be choosen with the <code>-vcodec</code> option.
7822 </p>
7823 <a name="Private-Options-for-prores_002dks"></a>
7824 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-Options-for-prores_002dks">18.6.1 Private Options for prores-ks</a></h3>
7825
7826 <dl compact="compact">
7827 <dt> &lsquo;<samp>profile <var>integer</var></samp>&rsquo;</dt>
7828 <dd><p>Select the ProRes profile to encode
7829 </p><dl compact="compact">
7830 <dt> &lsquo;<samp>proxy</samp>&rsquo;</dt>
7831 <dt> &lsquo;<samp>lt</samp>&rsquo;</dt>
7832 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
7833 <dt> &lsquo;<samp>hq</samp>&rsquo;</dt>
7834 <dt> &lsquo;<samp>4444</samp>&rsquo;</dt>
7835 </dl>
7836
7837 </dd>
7838 <dt> &lsquo;<samp>quant_mat <var>integer</var></samp>&rsquo;</dt>
7839 <dd><p>Select quantization matrix.
7840 </p><dl compact="compact">
7841 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
7842 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
7843 <dt> &lsquo;<samp>proxy</samp>&rsquo;</dt>
7844 <dt> &lsquo;<samp>lt</samp>&rsquo;</dt>
7845 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
7846 <dt> &lsquo;<samp>hq</samp>&rsquo;</dt>
7847 </dl>
7848 <p>If set to <var>auto</var>, the matrix matching the profile will be picked.
7849 If not set, the matrix providing the highest quality, <var>default</var>, will be
7850 picked.
7851 </p>
7852 </dd>
7853 <dt> &lsquo;<samp>bits_per_mb <var>integer</var></samp>&rsquo;</dt>
7854 <dd><p>How many bits to allot for coding one macroblock. Different profiles use
7855 between 200 and 2400 bits per macroblock, the maximum is 8000.
7856 </p>
7857 </dd>
7858 <dt> &lsquo;<samp>mbs_per_slice <var>integer</var></samp>&rsquo;</dt>
7859 <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
7860 should be good in almost all situations.
7861 </p>
7862 </dd>
7863 <dt> &lsquo;<samp>vendor <var>string</var></samp>&rsquo;</dt>
7864 <dd><p>Override the 4-byte vendor ID.
7865 A custom vendor ID like <var>apl0</var> would claim the stream was produced by
7866 the Apple encoder.
7867 </p>
7868 </dd>
7869 <dt> &lsquo;<samp>alpha_bits <var>integer</var></samp>&rsquo;</dt>
7870 <dd><p>Specify number of bits for alpha component.
7871 Possible values are <var>0</var>, <var>8</var> and <var>16</var>.
7872 Use <var>0</var> to disable alpha plane coding.
7873 </p>
7874 </dd>
7875 </dl>
7876
7877 <a name="Speed-considerations"></a>
7878 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Speed-considerations">18.6.2 Speed considerations</a></h3>
7879
7880 <p>In the default mode of operation the encoder has to honor frame constraints
7881 (i.e. not produc frames with size bigger than requested) while still making
7882 output picture as good as possible.
7883 A frame containing a lot of small details is harder to compress and the encoder
7884 would spend more time searching for appropriate quantizers for each slice.
7885 </p>
7886 <p>Setting a higher &lsquo;<samp>bits_per_mb</samp>&rsquo; limit will improve the speed.
7887 </p>
7888 <p>For the fastest encoding speed set the &lsquo;<samp>qscale</samp>&rsquo; parameter (4 is the
7889 recommended value) and do not set a size constraint.
7890 </p>
7891 <a name="Bitstream-Filters"></a>
7892 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Bitstream-Filters">19. Bitstream Filters</a></h1>
7893
7894 <p>When you configure your FFmpeg build, all the supported bitstream
7895 filters are enabled by default. You can list all available ones using
7896 the configure option <code>--list-bsfs</code>.
7897 </p>
7898 <p>You can disable all the bitstream filters using the configure option
7899 <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
7900 the option <code>--enable-bsf=BSF</code>, or you can disable a particular
7901 bitstream filter using the option <code>--disable-bsf=BSF</code>.
7902 </p>
7903 <p>The option <code>-bsfs</code> of the ff* tools will display the list of
7904 all the supported bitstream filters included in your build.
7905 </p>
7906 <p>Below is a description of the currently available bitstream filters.
7907 </p>
7908 <a name="aac_005fadtstoasc"></a>
7909 <h2 class="section"><a href="ffmpeg-all.html#toc-aac_005fadtstoasc">19.1 aac_adtstoasc</a></h2>
7910
7911 <p>Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration
7912 bitstream filter.
7913 </p>
7914 <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
7915 ADTS header and removes the ADTS header.
7916 </p>
7917 <p>This is required for example when copying an AAC stream from a raw
7918 ADTS AAC container to a FLV or a MOV/MP4 file.
7919 </p>
7920 <a name="chomp"></a>
7921 <h2 class="section"><a href="ffmpeg-all.html#toc-chomp">19.2 chomp</a></h2>
7922
7923 <p>Remove zero padding at the end of a packet.
7924 </p>
7925 <a name="dump_005fextra"></a>
7926 <h2 class="section"><a href="ffmpeg-all.html#toc-dump_005fextra">19.3 dump_extra</a></h2>
7927
7928 <p>Add extradata to the beginning of the filtered packets.
7929 </p>
7930 <p>The additional argument specifies which packets should be filtered.
7931 It accepts the values:
7932 </p><dl compact="compact">
7933 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
7934 <dd><p>add extradata to all key packets, but only if <var>local_header</var> is
7935 set in the &lsquo;<samp>flags2</samp>&rsquo; codec context field
7936 </p>
7937 </dd>
7938 <dt> &lsquo;<samp>k</samp>&rsquo;</dt>
7939 <dd><p>add extradata to all key packets
7940 </p>
7941 </dd>
7942 <dt> &lsquo;<samp>e</samp>&rsquo;</dt>
7943 <dd><p>add extradata to all packets
7944 </p></dd>
7945 </dl>
7946
7947 <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
7948 </p>
7949 <p>For example the following <code>ffmpeg</code> command forces a global
7950 header (thus disabling individual packet headers) in the H.264 packets
7951 generated by the <code>libx264</code> encoder, but corrects them by adding
7952 the header stored in extradata to the key packets:
7953 </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
7954 </pre></td></tr></table>
7955
7956 <a name="h264_005fmp4toannexb"></a>
7957 <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fmp4toannexb">19.4 h264_mp4toannexb</a></h2>
7958
7959 <p>Convert an H.264 bitstream from length prefixed mode to start code
7960 prefixed mode (as defined in the Annex B of the ITU-T H.264
7961 specification).
7962 </p>
7963 <p>This is required by some streaming formats, typically the MPEG-2
7964 transport stream format (&quot;mpegts&quot;).
7965 </p>
7966 <p>For example to remux an MP4 file containing an H.264 stream to mpegts
7967 format with <code>ffmpeg</code>, you can use the command:
7968 </p>
7969 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
7970 </pre></td></tr></table>
7971
7972 <a name="imx_005fdump_005fheader"></a>
7973 <h2 class="section"><a href="ffmpeg-all.html#toc-imx_005fdump_005fheader">19.5 imx_dump_header</a></h2>
7974
7975 <a name="mjpeg2jpeg"></a>
7976 <h2 class="section"><a href="ffmpeg-all.html#toc-mjpeg2jpeg">19.6 mjpeg2jpeg</a></h2>
7977
7978 <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
7979 </p>
7980 <p>MJPEG is a video codec wherein each video frame is essentially a
7981 JPEG image. The individual frames can be extracted without loss,
7982 e.g. by
7983 </p>
7984 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
7985 </pre></td></tr></table>
7986
7987 <p>Unfortunately, these chunks are incomplete JPEG images, because
7988 they lack the DHT segment required for decoding. Quoting from
7989 <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
7990 </p>
7991 <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
7992 commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
7993 MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
7994 Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
7995 and it must use basic Huffman encoding, not arithmetic or
7996 progressive. . . . You can indeed extract the MJPEG frames and
7997 decode them with a regular JPEG decoder, but you have to prepend
7998 the DHT segment to them, or else the decoder won&rsquo;t have any idea
7999 how to decompress the data. The exact table necessary is given in
8000 the OpenDML spec.&quot;
8001 </p>
8002 <p>This bitstream filter patches the header of frames extracted from an MJPEG
8003 stream (carrying the AVI1 header ID and lacking a DHT segment) to
8004 produce fully qualified JPEG images.
8005 </p>
8006 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
8007 exiftran -i -9 frame*.jpg
8008 ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
8009 </pre></td></tr></table>
8010
8011 <a name="mjpega_005fdump_005fheader"></a>
8012 <h2 class="section"><a href="ffmpeg-all.html#toc-mjpega_005fdump_005fheader">19.7 mjpega_dump_header</a></h2>
8013
8014 <a name="movsub"></a>
8015 <h2 class="section"><a href="ffmpeg-all.html#toc-movsub">19.8 movsub</a></h2>
8016
8017 <a name="mp3_005fheader_005fdecompress"></a>
8018 <h2 class="section"><a href="ffmpeg-all.html#toc-mp3_005fheader_005fdecompress">19.9 mp3_header_decompress</a></h2>
8019
8020 <a name="noise-1"></a>
8021 <h2 class="section"><a href="ffmpeg-all.html#toc-noise-1">19.10 noise</a></h2>
8022
8023 <a name="remove_005fextra"></a>
8024 <h2 class="section"><a href="ffmpeg-all.html#toc-remove_005fextra">19.11 remove_extra</a></h2>
8025
8026 <a name="Format-Options"></a>
8027 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Format-Options">20. Format Options</a></h1>
8028
8029 <p>The libavformat library provides some generic global options, which
8030 can be set on all the muxers and demuxers. In addition each muxer or
8031 demuxer may support so-called private options, which are specific for
8032 that component.
8033 </p>
8034 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
8035 FFmpeg tools, or by setting the value explicitly in the
8036 <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
8037 for programmatic use.
8038 </p>
8039 <p>The list of supported options follows:
8040 </p>
8041 <dl compact="compact">
8042 <dt> &lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
8043 <dd><p>Possible values:
8044 </p><dl compact="compact">
8045 <dt> &lsquo;<samp>direct</samp>&rsquo;</dt>
8046 <dd><p>Reduce buffering.
8047 </p></dd>
8048 </dl>
8049
8050 </dd>
8051 <dt> &lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8052 <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
8053 stream information. A higher value will allow to detect more
8054 information in case it is dispersed into the stream, but will increase
8055 latency. Must be an integer not lesser than 32. It is 5000000 by default.
8056 </p>
8057 </dd>
8058 <dt> &lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8059 <dd><p>Set packet size.
8060 </p>
8061 </dd>
8062 <dt> &lsquo;<samp>fflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
8063 <dd><p>Set format flags.
8064 </p>
8065 <p>Possible values:
8066 </p><dl compact="compact">
8067 <dt> &lsquo;<samp>ignidx</samp>&rsquo;</dt>
8068 <dd><p>Ignore index.
8069 </p></dd>
8070 <dt> &lsquo;<samp>genpts</samp>&rsquo;</dt>
8071 <dd><p>Generate PTS.
8072 </p></dd>
8073 <dt> &lsquo;<samp>nofillin</samp>&rsquo;</dt>
8074 <dd><p>Do not fill in missing values that can be exactly calculated.
8075 </p></dd>
8076 <dt> &lsquo;<samp>noparse</samp>&rsquo;</dt>
8077 <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
8078 </p></dd>
8079 <dt> &lsquo;<samp>igndts</samp>&rsquo;</dt>
8080 <dd><p>Ignore DTS.
8081 </p></dd>
8082 <dt> &lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
8083 <dd><p>Discard corrupted frames.
8084 </p></dd>
8085 <dt> &lsquo;<samp>sortdts</samp>&rsquo;</dt>
8086 <dd><p>Try to interleave output packets by DTS.
8087 </p></dd>
8088 <dt> &lsquo;<samp>keepside</samp>&rsquo;</dt>
8089 <dd><p>Do not merge side data.
8090 </p></dd>
8091 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
8092 <dd><p>Enable RTP MP4A-LATM payload.
8093 </p></dd>
8094 <dt> &lsquo;<samp>nobuffer</samp>&rsquo;</dt>
8095 <dd><p>Reduce the latency introduced by optional buffering
8096 </p></dd>
8097 </dl>
8098
8099 </dd>
8100 <dt> &lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8101 <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
8102 Default is 0.
8103 </p>
8104 </dd>
8105 <dt> &lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8106 <dd><p>Specify how many microseconds are analyzed to probe the input. A
8107 higher value will allow to detect more accurate information, but will
8108 increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
8109 </p>
8110 </dd>
8111 <dt> &lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
8112 <dd><p>Set decryption key.
8113 </p>
8114 </dd>
8115 <dt> &lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8116 <dd><p>Set max memory used for timestamp index (per stream).
8117 </p>
8118 </dd>
8119 <dt> &lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8120 <dd><p>Set max memory used for buffering real-time frames.
8121 </p>
8122 </dd>
8123 <dt> &lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
8124 <dd><p>Print specific debug info.
8125 </p>
8126 <p>Possible values:
8127 </p><dl compact="compact">
8128 <dt> &lsquo;<samp>ts</samp>&rsquo;</dt>
8129 </dl>
8130
8131 </dd>
8132 <dt> &lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
8133 <dd><p>Set maximum muxing or demuxing delay in microseconds.
8134 </p>
8135 </dd>
8136 <dt> &lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8137 <dd><p>Set number of frames used to probe fps.
8138 </p>
8139 </dd>
8140 <dt> &lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8141 <dd><p>Set microseconds by which audio packets should be interleaved earlier.
8142 </p>
8143 </dd>
8144 <dt> &lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8145 <dd><p>Set microseconds for each chunk.
8146 </p>
8147 </dd>
8148 <dt> &lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8149 <dd><p>Set size in bytes for each chunk.
8150 </p>
8151 </dd>
8152 <dt> &lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</dt>
8153 <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
8154 should be used only via the <code>ffmpeg</code> tool.
8155 </p>
8156 <p>Possible values:
8157 </p><dl compact="compact">
8158 <dt> &lsquo;<samp>crccheck</samp>&rsquo;</dt>
8159 <dd><p>Verify embedded CRCs.
8160 </p></dd>
8161 <dt> &lsquo;<samp>bitstream</samp>&rsquo;</dt>
8162 <dd><p>Detect bitstream specification deviations.
8163 </p></dd>
8164 <dt> &lsquo;<samp>buffer</samp>&rsquo;</dt>
8165 <dd><p>Detect improper bitstream length.
8166 </p></dd>
8167 <dt> &lsquo;<samp>explode</samp>&rsquo;</dt>
8168 <dd><p>Abort decoding on minor error detection.
8169 </p></dd>
8170 <dt> &lsquo;<samp>careful</samp>&rsquo;</dt>
8171 <dd><p>Consider things that violate the spec and have not been seen in the
8172 wild as errors.
8173 </p></dd>
8174 <dt> &lsquo;<samp>compliant</samp>&rsquo;</dt>
8175 <dd><p>Consider all spec non compliancies as errors.
8176 </p></dd>
8177 <dt> &lsquo;<samp>aggressive</samp>&rsquo;</dt>
8178 <dd><p>Consider things that a sane encoder should not do as an error.
8179 </p></dd>
8180 </dl>
8181
8182 </dd>
8183 <dt> &lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8184 <dd><p>Use wallclock as timestamps.
8185 </p>
8186 </dd>
8187 <dt> &lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8188 <dd><p>Shift timestamps to make them non-negative. A value of 1 enables shifting,
8189 a value of 0 disables it, the default value of -1 enables shifting
8190 when required by the target format.
8191 </p>
8192 <p>When shifting is enabled, all output timestamps are shifted by the
8193 same amount. Audio, video, and subtitles desynching and relative
8194 timestamp differences are preserved compared to how they would have
8195 been without shifting.
8196 </p>
8197 <p>Also note that this affects only leading negative timestamps, and not
8198 non-monotonic negative timestamps.
8199 </p>
8200 </dd>
8201 <dt> &lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8202 <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
8203 Default is 0.
8204 </p>
8205 </dd>
8206 <dt> &lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
8207 <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
8208 </p>
8209 </dd>
8210 <dt> &lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
8211 <dd><p>Flush the underlying I/O stream after each packet. Default 1 enables it, and
8212 has the effect of reducing the latency; 0 disables it and may slightly
8213 increase performance in some cases.
8214 </p></dd>
8215 </dl>
8216
8217
8218 <p><a name="Format-stream-specifiers"></a>
8219 </p><a name="Format-stream-specifiers-1"></a>
8220 <h2 class="section"><a href="ffmpeg-all.html#toc-Format-stream-specifiers-1">20.1 Format stream specifiers</a></h2>
8221
8222 <p>Format stream specifiers allow selection of one or more streams that
8223 match specific properties.
8224 </p>
8225 <p>Possible forms of stream specifiers are:
8226 </p><dl compact="compact">
8227 <dt> &lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
8228 <dd><p>Matches the stream with this index.
8229 </p>
8230 </dd>
8231 <dt> &lsquo;<samp><var>stream_type</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
8232 <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; for video, &rsquo;a&rsquo; for audio,
8233 &rsquo;s&rsquo; for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. If
8234 <var>stream_index</var> is given, then it matches the stream number
8235 <var>stream_index</var> of this type. Otherwise, it matches all streams of
8236 this type.
8237 </p>
8238 </dd>
8239 <dt> &lsquo;<samp>p:<var>program_id</var>[:<var>stream_index</var>]</samp>&rsquo;</dt>
8240 <dd><p>If <var>stream_index</var> is given, then it matches the stream with number
8241 <var>stream_index</var> in the program with the id
8242 <var>program_id</var>. Otherwise, it matches all streams in the program.
8243 </p>
8244 </dd>
8245 <dt> &lsquo;<samp>#<var>stream_id</var></samp>&rsquo;</dt>
8246 <dd><p>Matches the stream by a format-specific ID.
8247 </p></dd>
8248 </dl>
8249
8250 <p>The exact semantics of stream specifiers is defined by the
8251 <code>avformat_match_stream_specifier()</code> function declared in the
8252 &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header.
8253 </p>
8254 <a name="Demuxers"></a>
8255 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Demuxers">21. Demuxers</a></h1>
8256
8257 <p>Demuxers are configured elements in FFmpeg that can read the
8258 multimedia streams from a particular type of file.
8259 </p>
8260 <p>When you configure your FFmpeg build, all the supported demuxers
8261 are enabled by default. You can list all available ones using the
8262 configure option <code>--list-demuxers</code>.
8263 </p>
8264 <p>You can disable all the demuxers using the configure option
8265 <code>--disable-demuxers</code>, and selectively enable a single demuxer with
8266 the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
8267 with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
8268 </p>
8269 <p>The option <code>-formats</code> of the ff* tools will display the list of
8270 enabled demuxers.
8271 </p>
8272 <p>The description of some of the currently available demuxers follows.
8273 </p>
8274 <a name="applehttp"></a>
8275 <h2 class="section"><a href="ffmpeg-all.html#toc-applehttp">21.1 applehttp</a></h2>
8276
8277 <p>Apple HTTP Live Streaming demuxer.
8278 </p>
8279 <p>This demuxer presents all AVStreams from all variant streams.
8280 The id field is set to the bitrate variant index number. By setting
8281 the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
8282 the caller can decide which variant streams to actually receive.
8283 The total bitrate of the variant that the stream belongs to is
8284 available in a metadata key named &quot;variant_bitrate&quot;.
8285 </p>
8286 <a name="asf"></a>
8287 <h2 class="section"><a href="ffmpeg-all.html#toc-asf">21.2 asf</a></h2>
8288
8289 <p>Advanced Systems Format demuxer.
8290 </p>
8291 <p>This demuxer is used to demux ASF files and MMS network streams.
8292 </p>
8293 <dl compact="compact">
8294 <dt> &lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
8295 <dd><p>Do not try to resynchronize by looking for a certain optional start code.
8296 </p></dd>
8297 </dl>
8298
8299 <p><a name="concat"></a>
8300 </p><a name="concat-3"></a>
8301 <h2 class="section"><a href="ffmpeg-all.html#toc-concat-3">21.3 concat</a></h2>
8302
8303 <p>Virtual concatenation script demuxer.
8304 </p>
8305 <p>This demuxer reads a list of files and other directives from a text file and
8306 demuxes them one after the other, as if all their packet had been muxed
8307 together.
8308 </p>
8309 <p>The timestamps in the files are adjusted so that the first file starts at 0
8310 and each next file starts where the previous one finishes. Note that it is
8311 done globally and may cause gaps if all streams do not have exactly the same
8312 length.
8313 </p>
8314 <p>All files must have the same streams (same codecs, same time base, etc.).
8315 </p>
8316 <p>The duration of each file is used to adjust the timestamps of the next file:
8317 if the duration is incorrect (because it was computed using the bit-rate or
8318 because the file is truncated, for example), it can cause artifacts. The
8319 <code>duration</code> directive can be used to override the duration stored in
8320 each file.
8321 </p>
8322 <a name="Syntax-1"></a>
8323 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax-1">21.3.1 Syntax</a></h3>
8324
8325 <p>The script is a text file in extended-ASCII, with one directive per line.
8326 Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
8327 following directive is recognized:
8328 </p>
8329 <dl compact="compact">
8330 <dt> &lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
8331 <dd><p>Path to a file to read; special characters and spaces must be escaped with
8332 backslash or single quotes.
8333 </p>
8334 <p>All subsequent directives apply to that file.
8335 </p>
8336 </dd>
8337 <dt> &lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
8338 <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
8339 to 1 if it was to its default -1.
8340 </p>
8341 <p>To make FFmpeg recognize the format automatically, this directive must
8342 appears exactly as is (no extra space or byte-order-mark) on the very first
8343 line of the script.
8344 </p>
8345 </dd>
8346 <dt> &lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</dt>
8347 <dd><p>Duration of the file. This information can be specified from the file;
8348 specifying it here may be more efficient or help if the information from the
8349 file is not available or accurate.
8350 </p>
8351 <p>If the duration is set for all files, then it is possible to seek in the
8352 whole concatenated video.
8353 </p>
8354 </dd>
8355 </dl>
8356
8357 <a name="Options-12"></a>
8358 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-12">21.3.2 Options</a></h3>
8359
8360 <p>This demuxer accepts the following option:
8361 </p>
8362 <dl compact="compact">
8363 <dt> &lsquo;<samp>safe</samp>&rsquo;</dt>
8364 <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
8365 does not contain a protocol specification and is relative and all components
8366 only contain characters from the portable character set (letters, digits,
8367 period, underscore and hyphen) and have no period at the beginning of a
8368 component.
8369 </p>
8370 <p>If set to 0, any file name is accepted.
8371 </p>
8372 <p>The default is -1, it is equivalent to 1 if the format was automatically
8373 probed and 0 otherwise.
8374 </p>
8375 </dd>
8376 </dl>
8377
8378 <a name="flv"></a>
8379 <h2 class="section"><a href="ffmpeg-all.html#toc-flv">21.4 flv</a></h2>
8380
8381 <p>Adobe Flash Video Format demuxer.
8382 </p>
8383 <p>This demuxer is used to demux FLV files and RTMP network streams.
8384 </p>
8385 <dl compact="compact">
8386 <dt> &lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
8387 <dd><p>Allocate the streams according to the onMetaData array content.
8388 </p></dd>
8389 </dl>
8390
8391 <a name="libgme"></a>
8392 <h2 class="section"><a href="ffmpeg-all.html#toc-libgme">21.5 libgme</a></h2>
8393
8394 <p>The Game Music Emu library is a collection of video game music file emulators.
8395 </p>
8396 <p>See <a href="http://code.google.com/p/game-music-emu/">http://code.google.com/p/game-music-emu/</a> for more information.
8397 </p>
8398 <p>Some files have multiple tracks. The demuxer will pick the first track by
8399 default. The &lsquo;<samp>track_index</samp>&rsquo; option can be used to select a different
8400 track. Track indexes start at 0. The demuxer exports the number of tracks as
8401 <var>tracks</var> meta data entry.
8402 </p>
8403 <p>For very large files, the &lsquo;<samp>max_size</samp>&rsquo; option may have to be adjusted.
8404 </p>
8405 <a name="libquvi"></a>
8406 <h2 class="section"><a href="ffmpeg-all.html#toc-libquvi">21.6 libquvi</a></h2>
8407
8408 <p>Play media from Internet services using the quvi project.
8409 </p>
8410 <p>The demuxer accepts a &lsquo;<samp>format</samp>&rsquo; option to request a specific quality. It
8411 is by default set to <var>best</var>.
8412 </p>
8413 <p>See <a href="http://quvi.sourceforge.net/">http://quvi.sourceforge.net/</a> for more information.
8414 </p>
8415 <p>FFmpeg needs to be built with <code>--enable-libquvi</code> for this demuxer to be
8416 enabled.
8417 </p>
8418 <a name="image2-2"></a>
8419 <h2 class="section"><a href="ffmpeg-all.html#toc-image2-2">21.7 image2</a></h2>
8420
8421 <p>Image file demuxer.
8422 </p>
8423 <p>This demuxer reads from a list of image files specified by a pattern.
8424 The syntax and meaning of the pattern is specified by the
8425 option <var>pattern_type</var>.
8426 </p>
8427 <p>The pattern may contain a suffix which is used to automatically
8428 determine the format of the images contained in the files.
8429 </p>
8430 <p>The size, the pixel format, and the format of each image must be the
8431 same for all the files in the sequence.
8432 </p>
8433 <p>This demuxer accepts the following options:
8434 </p><dl compact="compact">
8435 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
8436 <dd><p>Set the frame rate for the video stream. It defaults to 25.
8437 </p></dd>
8438 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
8439 <dd><p>If set to 1, loop over the input. Default value is 0.
8440 </p></dd>
8441 <dt> &lsquo;<samp>pattern_type</samp>&rsquo;</dt>
8442 <dd><p>Select the pattern type used to interpret the provided filename.
8443 </p>
8444 <p><var>pattern_type</var> accepts one of the following values.
8445 </p><dl compact="compact">
8446 <dt> &lsquo;<samp>sequence</samp>&rsquo;</dt>
8447 <dd><p>Select a sequence pattern type, used to specify a sequence of files
8448 indexed by sequential numbers.
8449 </p>
8450 <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
8451 specifies the position of the characters representing a sequential
8452 number in each filename matched by the pattern. If the form
8453 &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
8454 filename is 0-padded and <var>N</var> is the total number of 0-padded
8455 digits representing the number. The literal character &rsquo;%&rsquo; can be
8456 specified in the pattern with the string &quot;%%&quot;.
8457 </p>
8458 <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
8459 the file list specified by the pattern must contain a number
8460 inclusively contained between <var>start_number</var> and
8461 <var>start_number</var>+<var>start_number_range</var>-1, and all the following
8462 numbers must be sequential.
8463 </p>
8464 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
8465 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
8466 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
8467 sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
8468 &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
8469 </p>
8470 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
8471 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
8472 &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
8473 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i img.jpeg img.png
8474 </pre></td></tr></table>
8475
8476 </dd>
8477 <dt> &lsquo;<samp>glob</samp>&rsquo;</dt>
8478 <dd><p>Select a glob wildcard pattern type.
8479 </p>
8480 <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
8481 selectable if libavformat was compiled with globbing support.
8482 </p>
8483 </dd>
8484 <dt> &lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
8485 <dd><p>Select a mixed glob wildcard/sequence pattern.
8486 </p>
8487 <p>If your version of libavformat was compiled with globbing support, and
8488 the provided pattern contains at least one glob meta character among
8489 <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
8490 interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
8491 like a sequence pattern.
8492 </p>
8493 <p>All glob special characters <code>%*?[]{}</code> must be prefixed
8494 with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
8495 </p>
8496 <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
8497 filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
8498 <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
8499 &quot;foo-&quot;, followed by a sequence of three characters, and terminating
8500 with &quot;.jpeg&quot;.
8501 </p>
8502 <p>This pattern type is deprecated in favor of <var>glob</var> and
8503 <var>sequence</var>.
8504 </p></dd>
8505 </dl>
8506
8507 <p>Default value is <var>glob_sequence</var>.
8508 </p></dd>
8509 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
8510 <dd><p>Set the pixel format of the images to read. If not specified the pixel
8511 format is guessed from the first image file in the sequence.
8512 </p></dd>
8513 <dt> &lsquo;<samp>start_number</samp>&rsquo;</dt>
8514 <dd><p>Set the index of the file matched by the image file pattern to start
8515 to read from. Default value is 0.
8516 </p></dd>
8517 <dt> &lsquo;<samp>start_number_range</samp>&rsquo;</dt>
8518 <dd><p>Set the index interval range to check when looking for the first image
8519 file in the sequence, starting from <var>start_number</var>. Default value
8520 is 5.
8521 </p></dd>
8522 <dt> &lsquo;<samp>ts_from_file</samp>&rsquo;</dt>
8523 <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
8524 that monotonity of timestamps is not provided: images go in the same order as
8525 without this option. Default value is 0.
8526 </p></dd>
8527 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
8528 <dd><p>Set the video size of the images to read. If not specified the video
8529 size is guessed from the first image file in the sequence.
8530 </p></dd>
8531 </dl>
8532
8533 <a name="Examples-69"></a>
8534 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-69">21.7.1 Examples</a></h3>
8535
8536 <ul>
8537 <li>
8538 Use <code>ffmpeg</code> for creating a video from the images in the file
8539 sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
8540 input frame rate of 10 frames per second:
8541 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
8542 </pre></td></tr></table>
8543
8544 </li><li>
8545 As above, but start by reading from a file with index 100 in the sequence:
8546 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
8547 </pre></td></tr></table>
8548
8549 </li><li>
8550 Read images matching the &quot;*.png&quot; glob pattern , that is all the files
8551 terminating with the &quot;.png&quot; suffix:
8552 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
8553 </pre></td></tr></table>
8554 </li></ul>
8555
8556 <a name="mpegts-1"></a>
8557 <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts-1">21.8 mpegts</a></h2>
8558
8559 <p>MPEG-2 transport stream demuxer.
8560 </p>
8561 <dl compact="compact">
8562 <dt> &lsquo;<samp>fix_teletext_pts</samp>&rsquo;</dt>
8563 <dd><p>Overrides teletext packet PTS and DTS values with the timestamps calculated
8564 from the PCR of the first program which the teletext stream is part of and is
8565 not discarded. Default value is 1, set this option to 0 if you want your
8566 teletext packet PTS and DTS values untouched.
8567 </p></dd>
8568 </dl>
8569
8570 <a name="rawvideo"></a>
8571 <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo">21.9 rawvideo</a></h2>
8572
8573 <p>Raw video demuxer.
8574 </p>
8575 <p>This demuxer allows to read raw video data. Since there is no header
8576 specifying the assumed video parameters, the user must specify them
8577 in order to be able to decode the data correctly.
8578 </p>
8579 <p>This demuxer accepts the following options:
8580 </p><dl compact="compact">
8581 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
8582 <dd><p>Set input video frame rate. Default value is 25.
8583 </p>
8584 </dd>
8585 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
8586 <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
8587 </p>
8588 </dd>
8589 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
8590 <dd><p>Set the input video size. This value must be specified explicitly.
8591 </p></dd>
8592 </dl>
8593
8594 <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; with
8595 <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
8596 size of <code>320x240</code>, and a frame rate of 10 images per second, use
8597 the command:
8598 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
8599 </pre></td></tr></table>
8600
8601 <a name="sbg"></a>
8602 <h2 class="section"><a href="ffmpeg-all.html#toc-sbg">21.10 sbg</a></h2>
8603
8604 <p>SBaGen script demuxer.
8605 </p>
8606 <p>This demuxer reads the script language used by SBaGen
8607 <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
8608 script looks like that:
8609 </p><table><tr><td>&nbsp;</td><td><pre class="example">-SE
8610 a: 300-2.5/3 440+4.5/0
8611 b: 300-2.5/0 440+4.5/3
8612 off: -
8613 NOW      == a
8614 +0:07:00 == b
8615 +0:14:00 == a
8616 +0:21:00 == b
8617 +0:30:00    off
8618 </pre></td></tr></table>
8619
8620 <p>A SBG script can mix absolute and relative timestamps. If the script uses
8621 either only absolute timestamps (including the script start time) or only
8622 relative ones, then its layout is fixed, and the conversion is
8623 straightforward. On the other hand, if the script mixes both kind of
8624 timestamps, then the <var>NOW</var> reference for relative timestamps will be
8625 taken from the current time of day at the time the script is read, and the
8626 script layout will be frozen according to that reference. That means that if
8627 the script is directly played, the actual times will match the absolute
8628 timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
8629 somehow pauses the playback or seeks, all times will be shifted accordingly.
8630 </p>
8631 <a name="tedcaptions"></a>
8632 <h2 class="section"><a href="ffmpeg-all.html#toc-tedcaptions">21.11 tedcaptions</a></h2>
8633
8634 <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
8635 </p>
8636 <p>TED does not provide links to the captions, but they can be guessed from the
8637 page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
8638 contains a bookmarklet to expose them.
8639 </p>
8640 <p>This demuxer accepts the following option:
8641 </p><dl compact="compact">
8642 <dt> &lsquo;<samp>start_time</samp>&rsquo;</dt>
8643 <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
8644 (15s). It is used to sync the captions with the downloadable videos, because
8645 they include a 15s intro.
8646 </p></dd>
8647 </dl>
8648
8649 <p>Example: convert the captions to a format most players understand:
8650 </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
8651 </pre></td></tr></table>
8652
8653 <a name="Muxers"></a>
8654 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Muxers">22. Muxers</a></h1>
8655
8656 <p>Muxers are configured elements in FFmpeg which allow writing
8657 multimedia streams to a particular type of file.
8658 </p>
8659 <p>When you configure your FFmpeg build, all the supported muxers
8660 are enabled by default. You can list all available muxers using the
8661 configure option <code>--list-muxers</code>.
8662 </p>
8663 <p>You can disable all the muxers with the configure option
8664 <code>--disable-muxers</code> and selectively enable / disable single muxers
8665 with the options <code>--enable-muxer=<var>MUXER</var></code> /
8666 <code>--disable-muxer=<var>MUXER</var></code>.
8667 </p>
8668 <p>The option <code>-formats</code> of the ff* tools will display the list of
8669 enabled muxers.
8670 </p>
8671 <p>A description of some of the currently available muxers follows.
8672 </p>
8673 <p><a name="aiff"></a>
8674 </p><a name="aiff-1"></a>
8675 <h2 class="section"><a href="ffmpeg-all.html#toc-aiff-1">22.1 aiff</a></h2>
8676
8677 <p>Audio Interchange File Format muxer.
8678 </p>
8679 <p>It accepts the following options:
8680 </p>
8681 <dl compact="compact">
8682 <dt> &lsquo;<samp>write_id3v2</samp>&rsquo;</dt>
8683 <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
8684 </p>
8685 </dd>
8686 <dt> &lsquo;<samp>id3v2_version</samp>&rsquo;</dt>
8687 <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
8688 ID3v2.3 and ID3v2.4) are supported. The default is version 4.
8689 </p>
8690 </dd>
8691 </dl>
8692
8693 <p><a name="crc"></a>
8694 </p><a name="crc-1"></a>
8695 <h2 class="section"><a href="ffmpeg-all.html#toc-crc-1">22.2 crc</a></h2>
8696
8697 <p>CRC (Cyclic Redundancy Check) testing format.
8698 </p>
8699 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
8700 and video frames. By default audio frames are converted to signed
8701 16-bit raw audio and video frames to raw video before computing the
8702 CRC.
8703 </p>
8704 <p>The output of the muxer consists of a single line of the form:
8705 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
8706 8 digits containing the CRC for all the decoded input frames.
8707 </p>
8708 <p>For example to compute the CRC of the input, and store it in the file
8709 &lsquo;<tt>out.crc</tt>&rsquo;:
8710 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
8711 </pre></td></tr></table>
8712
8713 <p>You can print the CRC to stdout with the command:
8714 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
8715 </pre></td></tr></table>
8716
8717 <p>You can select the output format of each frame with <code>ffmpeg</code> by
8718 specifying the audio and video codec and format. For example to
8719 compute the CRC of the input audio converted to PCM unsigned 8-bit
8720 and the input video converted to MPEG-2 video, use the command:
8721 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
8722 </pre></td></tr></table>
8723
8724 <p>See also the <a href="#framecrc">framecrc</a> muxer.
8725 </p>
8726 <p><a name="framecrc"></a>
8727 </p><a name="framecrc-1"></a>
8728 <h2 class="section"><a href="ffmpeg-all.html#toc-framecrc-1">22.3 framecrc</a></h2>
8729
8730 <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
8731 </p>
8732 <p>This muxer computes and prints the Adler-32 CRC for each audio
8733 and video packet. By default audio frames are converted to signed
8734 16-bit raw audio and video frames to raw video before computing the
8735 CRC.
8736 </p>
8737 <p>The output of the muxer consists of a line for each audio and video
8738 packet of the form:
8739 </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>
8740 </pre></td></tr></table>
8741
8742 <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
8743 CRC of the packet.
8744 </p>
8745 <p>For example to compute the CRC of the audio and video frames in
8746 &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
8747 in the file &lsquo;<tt>out.crc</tt>&rsquo;:
8748 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
8749 </pre></td></tr></table>
8750
8751 <p>To print the information to stdout, use the command:
8752 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
8753 </pre></td></tr></table>
8754
8755 <p>With <code>ffmpeg</code>, you can select the output format to which the
8756 audio and video frames are encoded before computing the CRC for each
8757 packet by specifying the audio and video codec. For example, to
8758 compute the CRC of each decoded input audio frame converted to PCM
8759 unsigned 8-bit and of each decoded input video frame converted to
8760 MPEG-2 video, use the command:
8761 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
8762 </pre></td></tr></table>
8763
8764 <p>See also the <a href="#crc">crc</a> muxer.
8765 </p>
8766 <p><a name="framemd5"></a>
8767 </p><a name="framemd5-1"></a>
8768 <h2 class="section"><a href="ffmpeg-all.html#toc-framemd5-1">22.4 framemd5</a></h2>
8769
8770 <p>Per-packet MD5 testing format.
8771 </p>
8772 <p>This muxer computes and prints the MD5 hash for each audio
8773 and video packet. By default audio frames are converted to signed
8774 16-bit raw audio and video frames to raw video before computing the
8775 hash.
8776 </p>
8777 <p>The output of the muxer consists of a line for each audio and video
8778 packet of the form:
8779 </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>
8780 </pre></td></tr></table>
8781
8782 <p><var>MD5</var> is a hexadecimal number representing the computed MD5 hash
8783 for the packet.
8784 </p>
8785 <p>For example to compute the MD5 of the audio and video frames in
8786 &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
8787 in the file &lsquo;<tt>out.md5</tt>&rsquo;:
8788 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
8789 </pre></td></tr></table>
8790
8791 <p>To print the information to stdout, use the command:
8792 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framemd5 -
8793 </pre></td></tr></table>
8794
8795 <p>See also the <a href="#md5">md5</a> muxer.
8796 </p>
8797 <p><a name="gif"></a>
8798 </p><a name="gif-1"></a>
8799 <h2 class="section"><a href="ffmpeg-all.html#toc-gif-1">22.5 gif</a></h2>
8800
8801 <p>Animated GIF muxer.
8802 </p>
8803 <p>It accepts the following options:
8804 </p>
8805 <dl compact="compact">
8806 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
8807 <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
8808 for looping indefinitely (default).
8809 </p>
8810 </dd>
8811 <dt> &lsquo;<samp>final_delay</samp>&rsquo;</dt>
8812 <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
8813 ends with a delay until the next frame. The default is <code>-1</code>, which is a
8814 special value to tell the muxer to re-use the previous delay. In case of a
8815 loop, you might want to customize this value to mark a pause for instance.
8816 </p></dd>
8817 </dl>
8818
8819 <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
8820 the loops:
8821 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
8822 </pre></td></tr></table>
8823
8824 <p>Note 1: if you wish to extract the frames in separate GIF files, you need to
8825 force the <a href="#image2">image2</a> muxer:
8826 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
8827 </pre></td></tr></table>
8828
8829 <p>Note 2: the GIF format has a very small time base: the delay between two frames
8830 can not be smaller than one centi second.
8831 </p>
8832 <p><a name="hls"></a>
8833 </p><a name="hls-1"></a>
8834 <h2 class="section"><a href="ffmpeg-all.html#toc-hls-1">22.6 hls</a></h2>
8835
8836 <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
8837 the HTTP Live Streaming specification.
8838 </p>
8839 <p>It creates a playlist file and numbered segment files. The output
8840 filename specifies the playlist filename; the segment filenames
8841 receive the same basename as the playlist, a sequential number and
8842 a .ts extension.
8843 </p>
8844 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.nut out.m3u8
8845 </pre></td></tr></table>
8846
8847 <dl compact="compact">
8848 <dt> &lsquo;<samp>-hls_time <var>seconds</var></samp>&rsquo;</dt>
8849 <dd><p>Set the segment length in seconds.
8850 </p></dd>
8851 <dt> &lsquo;<samp>-hls_list_size <var>size</var></samp>&rsquo;</dt>
8852 <dd><p>Set the maximum number of playlist entries.
8853 </p></dd>
8854 <dt> &lsquo;<samp>-hls_wrap <var>wrap</var></samp>&rsquo;</dt>
8855 <dd><p>Set the number after which index wraps.
8856 </p></dd>
8857 <dt> &lsquo;<samp>-start_number <var>number</var></samp>&rsquo;</dt>
8858 <dd><p>Start the sequence from <var>number</var>.
8859 </p></dd>
8860 </dl>
8861
8862 <p><a name="ico"></a>
8863 </p><a name="ico-1"></a>
8864 <h2 class="section"><a href="ffmpeg-all.html#toc-ico-1">22.7 ico</a></h2>
8865
8866 <p>ICO file muxer.
8867 </p>
8868 <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
8869 </p>
8870 <ul>
8871 <li>
8872 Size cannot exceed 256 pixels in any dimension
8873
8874 </li><li>
8875 Only BMP and PNG images can be stored
8876
8877 </li><li>
8878 If a BMP image is used, it must be one of the following pixel formats:
8879 <table><tr><td>&nbsp;</td><td><pre class="example">BMP Bit Depth      FFmpeg Pixel Format
8880 1bit               pal8
8881 4bit               pal8
8882 8bit               pal8
8883 16bit              rgb555le
8884 24bit              bgr24
8885 32bit              bgra
8886 </pre></td></tr></table>
8887
8888 </li><li>
8889 If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
8890
8891 </li><li>
8892 If a PNG image is used, it must use the rgba pixel format
8893 </li></ul>
8894
8895 <p><a name="image2"></a>
8896 </p><a name="image2-1"></a>
8897 <h2 class="section"><a href="ffmpeg-all.html#toc-image2-1">22.8 image2</a></h2>
8898
8899 <p>Image file muxer.
8900 </p>
8901 <p>The image file muxer writes video frames to image files.
8902 </p>
8903 <p>The output filenames are specified by a pattern, which can be used to
8904 produce sequentially numbered series of files.
8905 The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
8906 specifies the position of the characters representing a numbering in
8907 the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
8908 representing the number in each filename is 0-padded to <var>N</var>
8909 digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
8910 the string &quot;%%&quot;.
8911 </p>
8912 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
8913 the file list specified will contain the number 1, all the following
8914 numbers will be sequential.
8915 </p>
8916 <p>The pattern may contain a suffix which is used to automatically
8917 determine the format of the image files to write.
8918 </p>
8919 <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
8920 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
8921 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
8922 The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
8923 form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
8924 etc.
8925 </p>
8926 <p>The following example shows how to use <code>ffmpeg</code> for creating a
8927 sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
8928 taking one image every second from the input video:
8929 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
8930 </pre></td></tr></table>
8931
8932 <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
8933 <code>-f</code> option and the output filename specifies an image file
8934 format, the image2 muxer is automatically selected, so the previous
8935 command can be written as:
8936 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
8937 </pre></td></tr></table>
8938
8939 <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
8940 &quot;%0<var>N</var>d&quot;, for example to create a single image file
8941 &lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
8942 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
8943 </pre></td></tr></table>
8944
8945 <dl compact="compact">
8946 <dt> &lsquo;<samp>start_number <var>number</var></samp>&rsquo;</dt>
8947 <dd><p>Start the sequence from <var>number</var>. Default value is 1. Must be a
8948 non-negative number.
8949 </p>
8950 </dd>
8951 <dt> &lsquo;<samp>-update <var>number</var></samp>&rsquo;</dt>
8952 <dd><p>If <var>number</var> is nonzero, the filename will always be interpreted as just a
8953 filename, not a pattern, and this file will be continuously overwritten with new
8954 images.
8955 </p>
8956 </dd>
8957 </dl>
8958
8959 <p>The image muxer supports the .Y.U.V image file format. This format is
8960 special in that that each image frame consists of three files, for
8961 each of the YUV420P components. To read or write this image file format,
8962 specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
8963 &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
8964 </p>
8965 <a name="matroska"></a>
8966 <h2 class="section"><a href="ffmpeg-all.html#toc-matroska">22.9 matroska</a></h2>
8967
8968 <p>Matroska container muxer.
8969 </p>
8970 <p>This muxer implements the matroska and webm container specs.
8971 </p>
8972 <p>The recognized metadata settings in this muxer are:
8973 </p>
8974 <dl compact="compact">
8975 <dt> &lsquo;<samp>title=<var>title name</var></samp>&rsquo;</dt>
8976 <dd><p>Name provided to a single track
8977 </p></dd>
8978 </dl>
8979
8980 <dl compact="compact">
8981 <dt> &lsquo;<samp>language=<var>language name</var></samp>&rsquo;</dt>
8982 <dd><p>Specifies the language of the track in the Matroska languages form
8983 </p></dd>
8984 </dl>
8985
8986 <dl compact="compact">
8987 <dt> &lsquo;<samp>stereo_mode=<var>mode</var></samp>&rsquo;</dt>
8988 <dd><p>Stereo 3D video layout of two views in a single video track
8989 </p><dl compact="compact">
8990 <dt> &lsquo;<samp>mono</samp>&rsquo;</dt>
8991 <dd><p>video is not stereo
8992 </p></dd>
8993 <dt> &lsquo;<samp>left_right</samp>&rsquo;</dt>
8994 <dd><p>Both views are arranged side by side, Left-eye view is on the left
8995 </p></dd>
8996 <dt> &lsquo;<samp>bottom_top</samp>&rsquo;</dt>
8997 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
8998 </p></dd>
8999 <dt> &lsquo;<samp>top_bottom</samp>&rsquo;</dt>
9000 <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
9001 </p></dd>
9002 <dt> &lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
9003 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
9004 </p></dd>
9005 <dt> &lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
9006 <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
9007 </p></dd>
9008 <dt> &lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
9009 <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
9010 </p></dd>
9011 <dt> &lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
9012 <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
9013 </p></dd>
9014 <dt> &lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
9015 <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
9016 </p></dd>
9017 <dt> &lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
9018 <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
9019 </p></dd>
9020 <dt> &lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
9021 <dd><p>All frames are in anaglyph format viewable through red-cyan filters
9022 </p></dd>
9023 <dt> &lsquo;<samp>right_left</samp>&rsquo;</dt>
9024 <dd><p>Both views are arranged side by side, Right-eye view is on the left
9025 </p></dd>
9026 <dt> &lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
9027 <dd><p>All frames are in anaglyph format viewable through green-magenta filters
9028 </p></dd>
9029 <dt> &lsquo;<samp>block_lr</samp>&rsquo;</dt>
9030 <dd><p>Both eyes laced in one Block, Left-eye view is first
9031 </p></dd>
9032 <dt> &lsquo;<samp>block_rl</samp>&rsquo;</dt>
9033 <dd><p>Both eyes laced in one Block, Right-eye view is first
9034 </p></dd>
9035 </dl>
9036 </dd>
9037 </dl>
9038
9039 <p>For example a 3D WebM clip can be created using the following command line:
9040 </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
9041 </pre></td></tr></table>
9042
9043 <p>This muxer supports the following options:
9044 </p>
9045 <dl compact="compact">
9046 <dt> &lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
9047 <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
9048 terms) at the end of the file, because it cannot know in advance how much space
9049 to leave for the index at the beginning of the file. However for some use cases
9050 &ndash; e.g.  streaming where seeking is possible but slow &ndash; it is useful to put the
9051 index at the beginning of the file.
9052 </p>
9053 <p>If this option is set to a non-zero value, the muxer will reserve a given amount
9054 of space in the file header and then try to write the cues there when the muxing
9055 finishes. If the available space does not suffice, muxing will fail. A safe size
9056 for most use cases should be about 50kB per hour of video.
9057 </p>
9058 <p>Note that cues are only written if the output is seekable and this option will
9059 have no effect if it is not.
9060 </p>
9061 </dd>
9062 </dl>
9063
9064 <p><a name="md5"></a>
9065 </p><a name="md5-1"></a>
9066 <h2 class="section"><a href="ffmpeg-all.html#toc-md5-1">22.10 md5</a></h2>
9067
9068 <p>MD5 testing format.
9069 </p>
9070 <p>This muxer computes and prints the MD5 hash of all the input audio
9071 and video frames. By default audio frames are converted to signed
9072 16-bit raw audio and video frames to raw video before computing the
9073 hash.
9074 </p>
9075 <p>The output of the muxer consists of a single line of the form:
9076 MD5=<var>MD5</var>, where <var>MD5</var> is a hexadecimal number representing
9077 the computed MD5 hash.
9078 </p>
9079 <p>For example to compute the MD5 hash of the input converted to raw
9080 audio and video, and store it in the file &lsquo;<tt>out.md5</tt>&rsquo;:
9081 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f md5 out.md5
9082 </pre></td></tr></table>
9083
9084 <p>You can print the MD5 to stdout with the command:
9085 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f md5 -
9086 </pre></td></tr></table>
9087
9088 <p>See also the <a href="#framemd5">framemd5</a> muxer.
9089 </p>
9090 <a name="mov_002fmp4_002fismv"></a>
9091 <h2 class="section"><a href="ffmpeg-all.html#toc-mov_002fmp4_002fismv">22.11 mov/mp4/ismv</a></h2>
9092
9093 <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
9094 </p>
9095 <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
9096 file has all the metadata about all packets stored in one location
9097 (written at the end of the file, it can be moved to the start for
9098 better playback by adding <var>faststart</var> to the <var>movflags</var>, or
9099 using the <code>qt-faststart</code> tool). A fragmented
9100 file consists of a number of fragments, where packets and metadata
9101 about these packets are stored together. Writing a fragmented
9102 file has the advantage that the file is decodable even if the
9103 writing is interrupted (while a normal MOV/MP4 is undecodable if
9104 it is not properly finished), and it requires less memory when writing
9105 very long files (since writing normal MOV/MP4 files stores info about
9106 every single packet in memory until the file is closed). The downside
9107 is that it is less compatible with other applications.
9108 </p>
9109 <p>Fragmentation is enabled by setting one of the AVOptions that define
9110 how to cut the file into fragments:
9111 </p>
9112 <dl compact="compact">
9113 <dt> &lsquo;<samp>-moov_size <var>bytes</var></samp>&rsquo;</dt>
9114 <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
9115 moov atom at the end. If the space reserved is insufficient, muxing will fail.
9116 </p></dd>
9117 <dt> &lsquo;<samp>-movflags frag_keyframe</samp>&rsquo;</dt>
9118 <dd><p>Start a new fragment at each video keyframe.
9119 </p></dd>
9120 <dt> &lsquo;<samp>-frag_duration <var>duration</var></samp>&rsquo;</dt>
9121 <dd><p>Create fragments that are <var>duration</var> microseconds long.
9122 </p></dd>
9123 <dt> &lsquo;<samp>-frag_size <var>size</var></samp>&rsquo;</dt>
9124 <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
9125 </p></dd>
9126 <dt> &lsquo;<samp>-movflags frag_custom</samp>&rsquo;</dt>
9127 <dd><p>Allow the caller to manually choose when to cut fragments, by
9128 calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
9129 the packets written so far. (This is only useful with other
9130 applications integrating libavformat, not from <code>ffmpeg</code>.)
9131 </p></dd>
9132 <dt> &lsquo;<samp>-min_frag_duration <var>duration</var></samp>&rsquo;</dt>
9133 <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
9134 </p></dd>
9135 </dl>
9136
9137 <p>If more than one condition is specified, fragments are cut when
9138 one of the specified conditions is fulfilled. The exception to this is
9139 <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
9140 conditions to apply.
9141 </p>
9142 <p>Additionally, the way the output file is written can be adjusted
9143 through a few other options:
9144 </p>
9145 <dl compact="compact">
9146 <dt> &lsquo;<samp>-movflags empty_moov</samp>&rsquo;</dt>
9147 <dd><p>Write an initial moov atom directly at the start of the file, without
9148 describing any samples in it. Generally, an mdat/moov pair is written
9149 at the start of the file, as a normal MOV/MP4 file, containing only
9150 a short portion of the file. With this option set, there is no initial
9151 mdat atom, and the moov atom only describes the tracks but has
9152 a zero duration.
9153 </p>
9154 <p>Files written with this option set do not work in QuickTime.
9155 This option is implicitly set when writing ismv (Smooth Streaming) files.
9156 </p></dd>
9157 <dt> &lsquo;<samp>-movflags separate_moof</samp>&rsquo;</dt>
9158 <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
9159 packets for all tracks are written in a moof atom (which is slightly
9160 more efficient), but with this option set, the muxer writes one moof/mdat
9161 pair for each track, making it easier to separate tracks.
9162 </p>
9163 <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
9164 </p></dd>
9165 <dt> &lsquo;<samp>-movflags faststart</samp>&rsquo;</dt>
9166 <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
9167 This operation can take a while, and will not work in various situations such
9168 as fragmented output, thus it is not enabled by default.
9169 </p></dd>
9170 <dt> &lsquo;<samp>-movflags rtphint</samp>&rsquo;</dt>
9171 <dd><p>Add RTP hinting tracks to the output file.
9172 </p></dd>
9173 </dl>
9174
9175 <p>Smooth Streaming content can be pushed in real time to a publishing
9176 point on IIS with this muxer. Example:
9177 </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)
9178 </pre></td></tr></table>
9179
9180 <a name="mp3"></a>
9181 <h2 class="section"><a href="ffmpeg-all.html#toc-mp3">22.12 mp3</a></h2>
9182
9183 <p>The MP3 muxer writes a raw MP3 stream with an ID3v2 header at the beginning and
9184 optionally an ID3v1 tag at the end. ID3v2.3 and ID3v2.4 are supported, the
9185 <code>id3v2_version</code> option controls which one is used. The legacy ID3v1 tag is
9186 not written by default, but may be enabled with the <code>write_id3v1</code> option.
9187 </p>
9188 <p>For seekable output the muxer also writes a Xing frame at the beginning, which
9189 contains the number of frames in the file. It is useful for computing duration
9190 of VBR files.
9191 </p>
9192 <p>The muxer supports writing ID3v2 attached pictures (APIC frames). The pictures
9193 are supplied to the muxer in form of a video stream with a single packet. There
9194 can be any number of those streams, each will correspond to a single APIC frame.
9195 The stream metadata tags <var>title</var> and <var>comment</var> map to APIC
9196 <var>description</var> and <var>picture type</var> respectively. See
9197 <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
9198 </p>
9199 <p>Note that the APIC frames must be written at the beginning, so the muxer will
9200 buffer the audio frames until it gets all the pictures. It is therefore advised
9201 to provide the pictures as soon as possible to avoid excessive buffering.
9202 </p>
9203 <p>Examples:
9204 </p>
9205 <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
9206 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
9207 </pre></td></tr></table>
9208
9209 <p>To attach a picture to an mp3 file select both the audio and the picture stream
9210 with <code>map</code>:
9211 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
9212 -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
9213 </pre></td></tr></table>
9214
9215 <a name="mpegts"></a>
9216 <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts">22.13 mpegts</a></h2>
9217
9218 <p>MPEG transport stream muxer.
9219 </p>
9220 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
9221 </p>
9222 <p>The muxer options are:
9223 </p>
9224 <dl compact="compact">
9225 <dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</dt>
9226 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
9227 of a network in DVB. Its main use is in the unique identification of a
9228 service through the path Original_Network_ID, Transport_Stream_ID.
9229 </p></dd>
9230 <dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
9231 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
9232 transponder in DVB.
9233 </p></dd>
9234 <dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
9235 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
9236 </p></dd>
9237 <dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
9238 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
9239 </p></dd>
9240 <dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
9241 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
9242 </p></dd>
9243 <dt> &lsquo;<samp>-mpegts_m2ts_mode <var>number</var></samp>&rsquo;</dt>
9244 <dd><p>Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
9245 </p></dd>
9246 <dt> &lsquo;<samp>-muxrate <var>number</var></samp>&rsquo;</dt>
9247 <dd><p>Set muxrate.
9248 </p></dd>
9249 <dt> &lsquo;<samp>-pes_payload_size <var>number</var></samp>&rsquo;</dt>
9250 <dd><p>Set minimum PES packet payload in bytes.
9251 </p></dd>
9252 <dt> &lsquo;<samp>-mpegts_flags <var>flags</var></samp>&rsquo;</dt>
9253 <dd><p>Set flags (see below).
9254 </p></dd>
9255 <dt> &lsquo;<samp>-mpegts_copyts <var>number</var></samp>&rsquo;</dt>
9256 <dd><p>Preserve original timestamps, if value is set to 1. Default value is -1, which
9257 results in shifting timestamps so that they start from 0.
9258 </p></dd>
9259 <dt> &lsquo;<samp>-tables_version <var>number</var></samp>&rsquo;</dt>
9260 <dd><p>Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively).
9261 This option allows updating stream structure so that standard consumer may
9262 detect the change. To do so, reopen output AVFormatContext (in case of API
9263 usage) or restart ffmpeg instance, cyclically changing tables_version value:
9264 </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
9265 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
9266 ...
9267 ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
9268 ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
9269 ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
9270 ...
9271 </pre></td></tr></table>
9272 </dd>
9273 </dl>
9274
9275 <p>Option mpegts_flags may take a set of such flags:
9276 </p>
9277 <dl compact="compact">
9278 <dt> &lsquo;<samp>resend_headers</samp>&rsquo;</dt>
9279 <dd><p>Reemit PAT/PMT before writing the next packet.
9280 </p></dd>
9281 <dt> &lsquo;<samp>latm</samp>&rsquo;</dt>
9282 <dd><p>Use LATM packetization for AAC.
9283 </p></dd>
9284 </dl>
9285
9286 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
9287 and <code>service_name</code>. If they are not set the default for
9288 <code>service_provider</code> is &quot;FFmpeg&quot; and the default for
9289 <code>service_name</code> is &quot;Service01&quot;.
9290 </p>
9291 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -c copy \
9292      -mpegts_original_network_id 0x1122 \
9293      -mpegts_transport_stream_id 0x3344 \
9294      -mpegts_service_id 0x5566 \
9295      -mpegts_pmt_start_pid 0x1500 \
9296      -mpegts_start_pid 0x150 \
9297      -metadata service_provider=&quot;Some provider&quot; \
9298      -metadata service_name=&quot;Some Channel&quot; \
9299      -y out.ts
9300 </pre></td></tr></table>
9301
9302 <a name="null-1"></a>
9303 <h2 class="section"><a href="ffmpeg-all.html#toc-null-1">22.14 null</a></h2>
9304
9305 <p>Null muxer.
9306 </p>
9307 <p>This muxer does not generate any output file, it is mainly useful for
9308 testing or benchmarking purposes.
9309 </p>
9310 <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
9311 command:
9312 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
9313 </pre></td></tr></table>
9314
9315 <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
9316 file, but specifying the output file is required by the <code>ffmpeg</code>
9317 syntax.
9318 </p>
9319 <p>Alternatively you can write the command as:
9320 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
9321 </pre></td></tr></table>
9322
9323 <a name="ogg"></a>
9324 <h2 class="section"><a href="ffmpeg-all.html#toc-ogg">22.15 ogg</a></h2>
9325
9326 <p>Ogg container muxer.
9327 </p>
9328 <dl compact="compact">
9329 <dt> &lsquo;<samp>-page_duration <var>duration</var></samp>&rsquo;</dt>
9330 <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
9331 pages that are approximately <var>duration</var> microseconds long. This allows the
9332 user to compromise between seek granularity and container overhead. The default
9333 is 1 second. A value of 0 will fill all segments, making pages as large as
9334 possible. A value of 1 will effectively use 1 packet-per-page in most
9335 situations, giving a small seek granularity at the cost of additional container
9336 overhead.
9337 </p></dd>
9338 </dl>
9339
9340 <a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
9341 <h2 class="section"><a href="ffmpeg-all.html#toc-segment_002c-stream_005fsegment_002c-ssegment">22.16 segment, stream_segment, ssegment</a></h2>
9342
9343 <p>Basic stream segmenter.
9344 </p>
9345 <p>The segmenter muxer outputs streams to a number of separate files of nearly
9346 fixed duration. Output filename pattern can be set in a fashion similar to
9347 <a href="#image2">image2</a>.
9348 </p>
9349 <p><code>stream_segment</code> is a variant of the muxer used to write to
9350 streaming output formats, i.e. which do not require global headers,
9351 and is recommended for outputting e.g. to MPEG transport stream segments.
9352 <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
9353 </p>
9354 <p>Every segment starts with a keyframe of the selected reference stream,
9355 which is set through the &lsquo;<samp>reference_stream</samp>&rsquo; option.
9356 </p>
9357 <p>Note that if you want accurate splitting for a video file, you need to
9358 make the input key frames correspond to the exact splitting times
9359 expected by the segmenter, or the segment muxer will start the new
9360 segment with the key frame found next after the specified start
9361 time.
9362 </p>
9363 <p>The segment muxer works best with a single constant frame rate video.
9364 </p>
9365 <p>Optionally it can generate a list of the created segments, by setting
9366 the option <var>segment_list</var>. The list type is specified by the
9367 <var>segment_list_type</var> option. The entry filenames in the segment
9368 list are set by default to the basename of the corresponding segment
9369 files.
9370 </p>
9371 <p>The segment muxer supports the following options:
9372 </p>
9373 <dl compact="compact">
9374 <dt> &lsquo;<samp>reference_stream <var>specifier</var></samp>&rsquo;</dt>
9375 <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
9376 If <var>specifier</var> is set to <code>auto</code>, the reference is choosen
9377 automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
9378 specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
9379 reference stream. The default value is <code>auto</code>.
9380 </p>
9381 </dd>
9382 <dt> &lsquo;<samp>segment_format <var>format</var></samp>&rsquo;</dt>
9383 <dd><p>Override the inner container format, by default it is guessed by the filename
9384 extension.
9385 </p>
9386 </dd>
9387 <dt> &lsquo;<samp>segment_list <var>name</var></samp>&rsquo;</dt>
9388 <dd><p>Generate also a listfile named <var>name</var>. If not specified no
9389 listfile is generated.
9390 </p>
9391 </dd>
9392 <dt> &lsquo;<samp>segment_list_flags <var>flags</var></samp>&rsquo;</dt>
9393 <dd><p>Set flags affecting the segment list generation.
9394 </p>
9395 <p>It currently supports the following flags:
9396 </p><dl compact="compact">
9397 <dt> &lsquo;<samp>cache</samp>&rsquo;</dt>
9398 <dd><p>Allow caching (only affects M3U8 list files).
9399 </p>
9400 </dd>
9401 <dt> &lsquo;<samp>live</samp>&rsquo;</dt>
9402 <dd><p>Allow live-friendly file generation.
9403 </p></dd>
9404 </dl>
9405
9406 </dd>
9407 <dt> &lsquo;<samp>segment_list_size <var>size</var></samp>&rsquo;</dt>
9408 <dd><p>Update the list file so that it contains at most the last <var>size</var>
9409 segments. If 0 the list file will contain all the segments. Default
9410 value is 0.
9411 </p>
9412 </dd>
9413 <dt> &lsquo;<samp>segment_list_entry_prefix <var>prefix</var></samp>&rsquo;</dt>
9414 <dd><p>Set <var>prefix</var> to prepend to the name of each entry filename. By
9415 default no prefix is applied.
9416 </p>
9417 </dd>
9418 <dt> &lsquo;<samp>segment_list_type <var>type</var></samp>&rsquo;</dt>
9419 <dd><p>Specify the format for the segment list file.
9420 </p>
9421 <p>The following values are recognized:
9422 </p><dl compact="compact">
9423 <dt> &lsquo;<samp>flat</samp>&rsquo;</dt>
9424 <dd><p>Generate a flat list for the created segments, one segment per line.
9425 </p>
9426 </dd>
9427 <dt> &lsquo;<samp>csv, ext</samp>&rsquo;</dt>
9428 <dd><p>Generate a list for the created segments, one segment per line,
9429 each line matching the format (comma-separated values):
9430 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
9431 </pre></td></tr></table>
9432
9433 <p><var>segment_filename</var> is the name of the output file generated by the
9434 muxer according to the provided pattern. CSV escaping (according to
9435 RFC4180) is applied if required.
9436 </p>
9437 <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
9438 the segment start and end time expressed in seconds.
9439 </p>
9440 <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
9441 auto-select this format.
9442 </p>
9443 <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
9444 </p>
9445 </dd>
9446 <dt> &lsquo;<samp>ffconcat</samp>&rsquo;</dt>
9447 <dd><p>Generate an ffconcat file for the created segments. The resulting file
9448 can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
9449 </p>
9450 <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
9451 auto-select this format.
9452 </p>
9453 </dd>
9454 <dt> &lsquo;<samp>m3u8</samp>&rsquo;</dt>
9455 <dd><p>Generate an extended M3U8 file, version 3, compliant with
9456 <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
9457 </p>
9458 <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
9459 </p></dd>
9460 </dl>
9461
9462 <p>If not specified the type is guessed from the list file name suffix.
9463 </p>
9464 </dd>
9465 <dt> &lsquo;<samp>segment_time <var>time</var></samp>&rsquo;</dt>
9466 <dd><p>Set segment duration to <var>time</var>, the value must be a duration
9467 specification. Default value is &quot;2&quot;. See also the
9468 &lsquo;<samp>segment_times</samp>&rsquo; option.
9469 </p>
9470 <p>Note that splitting may not be accurate, unless you force the
9471 reference stream key-frames at the given time. See the introductory
9472 notice and the examples below.
9473 </p>
9474 </dd>
9475 <dt> &lsquo;<samp>segment_time_delta <var>delta</var></samp>&rsquo;</dt>
9476 <dd><p>Specify the accuracy time when selecting the start time for a
9477 segment, expressed as a duration specification. Default value is &quot;0&quot;.
9478 </p>
9479 <p>When delta is specified a key-frame will start a new segment if its
9480 PTS satisfies the relation:
9481 </p><table><tr><td>&nbsp;</td><td><pre class="example">PTS &gt;= start_time - time_delta
9482 </pre></td></tr></table>
9483
9484 <p>This option is useful when splitting video content, which is always
9485 split at GOP boundaries, in case a key frame is found just before the
9486 specified split time.
9487 </p>
9488 <p>In particular may be used in combination with the &lsquo;<tt>ffmpeg</tt>&rsquo; option
9489 <var>force_key_frames</var>. The key frame times specified by
9490 <var>force_key_frames</var> may not be set accurately because of rounding
9491 issues, with the consequence that a key frame time may result set just
9492 before the specified time. For constant frame rate videos a value of
9493 1/2*<var>frame_rate</var> should address the worst case mismatch between
9494 the specified time and the time set by <var>force_key_frames</var>.
9495 </p>
9496 </dd>
9497 <dt> &lsquo;<samp>segment_times <var>times</var></samp>&rsquo;</dt>
9498 <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
9499 separated duration specifications, in increasing order. See also
9500 the &lsquo;<samp>segment_time</samp>&rsquo; option.
9501 </p>
9502 </dd>
9503 <dt> &lsquo;<samp>segment_frames <var>frames</var></samp>&rsquo;</dt>
9504 <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
9505 list of comma separated integer numbers, in increasing order.
9506 </p>
9507 <p>This option specifies to start a new segment whenever a reference
9508 stream key frame is found and the sequential number (starting from 0)
9509 of the frame is greater or equal to the next value in the list.
9510 </p>
9511 </dd>
9512 <dt> &lsquo;<samp>segment_wrap <var>limit</var></samp>&rsquo;</dt>
9513 <dd><p>Wrap around segment index once it reaches <var>limit</var>.
9514 </p>
9515 </dd>
9516 <dt> &lsquo;<samp>segment_start_number <var>number</var></samp>&rsquo;</dt>
9517 <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
9518 </p>
9519 </dd>
9520 <dt> &lsquo;<samp>reset_timestamps <var>1|0</var></samp>&rsquo;</dt>
9521 <dd><p>Reset timestamps at the begin of each segment, so that each segment
9522 will start with near-zero timestamps. It is meant to ease the playback
9523 of the generated segments. May not work with some combinations of
9524 muxers/codecs. It is set to <code>0</code> by default.
9525 </p>
9526 </dd>
9527 <dt> &lsquo;<samp>initial_offset <var>offset</var></samp>&rsquo;</dt>
9528 <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
9529 argument must be a time duration specification, and defaults to 0.
9530 </p></dd>
9531 </dl>
9532
9533 <a name="Examples-41"></a>
9534 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-41">22.16.1 Examples</a></h3>
9535
9536 <ul>
9537 <li>
9538 To remux the content of file &lsquo;<tt>in.mkv</tt>&rsquo; to a list of segments
9539 &lsquo;<tt>out-000.nut</tt>&rsquo;, &lsquo;<tt>out-001.nut</tt>&rsquo;, etc., and write the list of
9540 generated segments to &lsquo;<tt>out.list</tt>&rsquo;:
9541 <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
9542 </pre></td></tr></table>
9543
9544 </li><li>
9545 As the example above, but segment the input file according to the split
9546 points specified by the <var>segment_times</var> option:
9547 <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
9548 </pre></td></tr></table>
9549
9550 </li><li>
9551 As the example above, but use the <code>ffmpeg</code> &lsquo;<samp>force_key_frames</samp>&rsquo;
9552 option to force key frames in the input at the specified location, together
9553 with the segment option &lsquo;<samp>segment_time_delta</samp>&rsquo; to account for
9554 possible roundings operated when setting key frame times.
9555 <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 \
9556 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
9557 </pre></td></tr></table>
9558 <p>In order to force key frames on the input file, transcoding is
9559 required.
9560 </p>
9561 </li><li>
9562 Segment the input file by splitting the input file according to the
9563 frame numbers sequence specified with the &lsquo;<samp>segment_frames</samp>&rsquo; option:
9564 <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
9565 </pre></td></tr></table>
9566
9567 </li><li>
9568 To convert the &lsquo;<tt>in.mkv</tt>&rsquo; to TS segments using the <code>libx264</code>
9569 and <code>libfaac</code> encoders:
9570 <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
9571 </pre></td></tr></table>
9572
9573 </li><li>
9574 Segment the input file, and create an M3U8 live playlist (can be used
9575 as live HLS source):
9576 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
9577 -segment_list_flags +live -segment_time 10 out%03d.mkv
9578 </pre></td></tr></table>
9579 </li></ul>
9580
9581 <a name="tee"></a>
9582 <h2 class="section"><a href="ffmpeg-all.html#toc-tee">22.17 tee</a></h2>
9583
9584 <p>The tee muxer can be used to write the same data to several files or any
9585 other kind of muxer. It can be used, for example, to both stream a video to
9586 the network and save it to disk at the same time.
9587 </p>
9588 <p>It is different from specifying several outputs to the <code>ffmpeg</code>
9589 command-line tool because the audio and video data will be encoded only once
9590 with the tee muxer; encoding can be a very expensive process. It is not
9591 useful when using the libavformat API directly because it is then possible
9592 to feed the same packets to several muxers directly.
9593 </p>
9594 <p>The slave outputs are specified in the file name given to the muxer,
9595 separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
9596 leading or trailing spaces or any special character, it must be
9597 escaped (see the &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils
9598 manual).
9599 </p>
9600 <p>Muxer options can be specified for each slave by prepending them as a list of
9601 <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
9602 the options values contain a special character or the &rsquo;:&rsquo; separator, they
9603 must be escaped; note that this is a second level escaping.
9604 </p>
9605 <p>The following special options are also recognized:
9606 </p><dl compact="compact">
9607 <dt> &lsquo;<samp>f</samp>&rsquo;</dt>
9608 <dd><p>Specify the format name. Useful if it cannot be guessed from the
9609 output name suffix.
9610 </p>
9611 </dd>
9612 <dt> &lsquo;<samp>bsfs[/<var>spec</var>]</samp>&rsquo;</dt>
9613 <dd><p>Specify a list of bitstream filters to apply to the specified
9614 output. It is possible to specify to which streams a given bitstream
9615 filter applies, by appending a stream specifier to the option
9616 separated by <code>/</code>. If the stream specifier is not specified, the
9617 bistream filters will be applied to all streams in the output.
9618 </p>
9619 <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
9620 </p>
9621 </dd>
9622 <dt> &lsquo;<samp>select</samp>&rsquo;</dt>
9623 <dd><p>Select the streams that should be mapped to the slave output,
9624 specified by a stream specifier. If not specified, this defaults to
9625 all the input streams.
9626 </p></dd>
9627 </dl>
9628
9629 <p>Some examples follow.
9630 </p><ul>
9631 <li>
9632 Encode something and both archive it in a WebM file and stream it
9633 as MPEG-TS over UDP (the streams need to be explicitly mapped):
9634 <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
9635   &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
9636 </pre></td></tr></table>
9637
9638 </li><li>
9639 Use <code>ffmpeg</code> to encode the input, and send the output
9640 to three different destinations. The <code>dump_extra</code> bitstream
9641 filter is used to add extradata information to all the output video
9642 keyframes packets, as requested by the MPEG-TS format. The select
9643 option is applied to &lsquo;<tt>out.aac</tt>&rsquo; in order to make it contain only
9644 audio packets.
9645 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac -strict experimental
9646        -f tee &quot;[bsfs/v=dump_extra]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
9647 </pre></td></tr></table>
9648 </li></ul>
9649
9650 <p>Note: some codecs may need different options depending on the output format;
9651 the auto-detection of this can not work with the tee muxer. The main example
9652 is the &lsquo;<samp>global_header</samp>&rsquo; flag.
9653 </p>
9654 <a name="Metadata"></a>
9655 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Metadata">23. Metadata</a></h1>
9656
9657 <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
9658 INI-like text file and then load it back using the metadata muxer/demuxer.
9659 </p>
9660 <p>The file format is as follows:
9661 </p><ol>
9662 <li>
9663 A file consists of a header and a number of metadata tags divided into sections,
9664 each on its own line.
9665
9666 </li><li>
9667 The header is a &rsquo;;FFMETADATA&rsquo; string, followed by a version number (now 1).
9668
9669 </li><li>
9670 Metadata tags are of the form &rsquo;key=value&rsquo;
9671
9672 </li><li>
9673 Immediately after header follows global metadata
9674
9675 </li><li>
9676 After global metadata there may be sections with per-stream/per-chapter
9677 metadata.
9678
9679 </li><li>
9680 A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
9681 brackets (&rsquo;[&rsquo;, &rsquo;]&rsquo;) and ends with next section or end of file.
9682
9683 </li><li>
9684 At the beginning of a chapter section there may be an optional timebase to be
9685 used for start/end values. It must be in form &rsquo;TIMEBASE=num/den&rsquo;, where num and
9686 den are integers. If the timebase is missing then start/end times are assumed to
9687 be in milliseconds.
9688 Next a chapter section must contain chapter start and end times in form
9689 &rsquo;START=num&rsquo;, &rsquo;END=num&rsquo;, where num is a positive integer.
9690
9691 </li><li>
9692 Empty lines and lines starting with &rsquo;;&rsquo; or &rsquo;#&rsquo; are ignored.
9693
9694 </li><li>
9695 Metadata keys or values containing special characters (&rsquo;=&rsquo;, &rsquo;;&rsquo;, &rsquo;#&rsquo;, &rsquo;\&rsquo; and a
9696 newline) must be escaped with a backslash &rsquo;\&rsquo;.
9697
9698 </li><li>
9699 Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
9700 the tag (in the example above key is &rsquo;foo &rsquo;, value is &rsquo; bar&rsquo;).
9701 </li></ol>
9702
9703 <p>A ffmetadata file might look like this:
9704 </p><table><tr><td>&nbsp;</td><td><pre class="example">;FFMETADATA1
9705 title=bike\\shed
9706 ;this is a comment
9707 artist=FFmpeg troll team
9708
9709 [CHAPTER]
9710 TIMEBASE=1/1000
9711 START=0
9712 #chapter ends at 0:01:00
9713 END=60000
9714 title=chapter \#1
9715 [STREAM]
9716 title=multi\
9717 line
9718 </pre></td></tr></table>
9719
9720 <p>By using the ffmetadata muxer and demuxer it is possible to extract
9721 metadata from an input file to an ffmetadata file, and then transcode
9722 the file into an output file with the edited ffmetadata file.
9723 </p>
9724 <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
9725 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
9726 </pre></td></tr></table>
9727
9728 <p>Reinserting edited metadata information from the FFMETADATAFILE file can
9729 be done as:
9730 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
9731 </pre></td></tr></table>
9732
9733 <a name="Protocols"></a>
9734 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Protocols">24. Protocols</a></h1>
9735
9736 <p>Protocols are configured elements in FFmpeg that enable access to
9737 resources that require specific protocols.
9738 </p>
9739 <p>When you configure your FFmpeg build, all the supported protocols are
9740 enabled by default. You can list all available ones using the
9741 configure option &quot;&ndash;list-protocols&quot;.
9742 </p>
9743 <p>You can disable all the protocols using the configure option
9744 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
9745 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
9746 particular protocol using the option
9747 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
9748 </p>
9749 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
9750 supported protocols.
9751 </p>
9752 <p>A description of the currently available protocols follows.
9753 </p>
9754 <a name="bluray"></a>
9755 <h2 class="section"><a href="ffmpeg-all.html#toc-bluray">24.1 bluray</a></h2>
9756
9757 <p>Read BluRay playlist.
9758 </p>
9759 <p>The accepted options are:
9760 </p><dl compact="compact">
9761 <dt> &lsquo;<samp>angle</samp>&rsquo;</dt>
9762 <dd><p>BluRay angle
9763 </p>
9764 </dd>
9765 <dt> &lsquo;<samp>chapter</samp>&rsquo;</dt>
9766 <dd><p>Start chapter (1...N)
9767 </p>
9768 </dd>
9769 <dt> &lsquo;<samp>playlist</samp>&rsquo;</dt>
9770 <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
9771 </p>
9772 </dd>
9773 </dl>
9774
9775 <p>Examples:
9776 </p>
9777 <p>Read longest playlist from BluRay mounted to /mnt/bluray:
9778 </p><table><tr><td>&nbsp;</td><td><pre class="example">bluray:/mnt/bluray
9779 </pre></td></tr></table>
9780
9781 <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
9782 </p><table><tr><td>&nbsp;</td><td><pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
9783 </pre></td></tr></table>
9784
9785 <a name="cache"></a>
9786 <h2 class="section"><a href="ffmpeg-all.html#toc-cache">24.2 cache</a></h2>
9787
9788 <p>Caching wrapper for input stream.
9789 </p>
9790 <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
9791 </p>
9792 <table><tr><td>&nbsp;</td><td><pre class="example">cache:<var>URL</var>
9793 </pre></td></tr></table>
9794
9795 <a name="concat-2"></a>
9796 <h2 class="section"><a href="ffmpeg-all.html#toc-concat-2">24.3 concat</a></h2>
9797
9798 <p>Physical concatenation protocol.
9799 </p>
9800 <p>Allow to read and seek from many resource in sequence as if they were
9801 a unique resource.
9802 </p>
9803 <p>A URL accepted by this protocol has the syntax:
9804 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
9805 </pre></td></tr></table>
9806
9807 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
9808 resource to be concatenated, each one possibly specifying a distinct
9809 protocol.
9810 </p>
9811 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
9812 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
9813 command:
9814 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
9815 </pre></td></tr></table>
9816
9817 <p>Note that you may need to escape the character &quot;|&quot; which is special for
9818 many shells.
9819 </p>
9820 <a name="crypto"></a>
9821 <h2 class="section"><a href="ffmpeg-all.html#toc-crypto">24.4 crypto</a></h2>
9822
9823 <p>AES-encrypted stream reading protocol.
9824 </p>
9825 <p>The accepted options are:
9826 </p><dl compact="compact">
9827 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
9828 <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
9829 </p>
9830 </dd>
9831 <dt> &lsquo;<samp>iv</samp>&rsquo;</dt>
9832 <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
9833 </p></dd>
9834 </dl>
9835
9836 <p>Accepted URL formats:
9837 </p><table><tr><td>&nbsp;</td><td><pre class="example">crypto:<var>URL</var>
9838 crypto+<var>URL</var>
9839 </pre></td></tr></table>
9840
9841 <a name="data"></a>
9842 <h2 class="section"><a href="ffmpeg-all.html#toc-data">24.5 data</a></h2>
9843
9844 <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>.
9845 </p>
9846 <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
9847 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
9848 </pre></td></tr></table>
9849
9850 <a name="file"></a>
9851 <h2 class="section"><a href="ffmpeg-all.html#toc-file">24.6 file</a></h2>
9852
9853 <p>File access protocol.
9854 </p>
9855 <p>Allow to read from or read to a file.
9856 </p>
9857 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
9858 use the command:
9859 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
9860 </pre></td></tr></table>
9861
9862 <p>The ff* tools default to the file protocol, that is a resource
9863 specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
9864 &quot;file:FILE.mpeg&quot;.
9865 </p>
9866 <p>This protocol accepts the following options:
9867 </p>
9868 <dl compact="compact">
9869 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
9870 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
9871 truncating. Default value is 1.
9872 </p>
9873 </dd>
9874 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
9875 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
9876 <code>INT_MAX</code>, which results in not limiting the requested block size.
9877 Setting this value reasonably low improves user termination request reaction
9878 time, which is valuable for files on slow medium.
9879 </p></dd>
9880 </dl>
9881
9882 <a name="ftp"></a>
9883 <h2 class="section"><a href="ffmpeg-all.html#toc-ftp">24.7 ftp</a></h2>
9884
9885 <p>FTP (File Transfer Protocol).
9886 </p>
9887 <p>Allow to read from or write to remote resources using FTP protocol.
9888 </p>
9889 <p>Following syntax is required.
9890 </p><table><tr><td>&nbsp;</td><td><pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
9891 </pre></td></tr></table>
9892
9893 <p>This protocol accepts the following options.
9894 </p>
9895 <dl compact="compact">
9896 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
9897 <dd><p>Set timeout of socket I/O operations used by the underlying low level
9898 operation. By default it is set to -1, which means that the timeout is
9899 not specified.
9900 </p>
9901 </dd>
9902 <dt> &lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
9903 <dd><p>Password used when login as anonymous user. Typically an e-mail address
9904 should be used.
9905 </p>
9906 </dd>
9907 <dt> &lsquo;<samp>ftp-write-seekable</samp>&rsquo;</dt>
9908 <dd><p>Control seekability of connection during encoding. If set to 1 the
9909 resource is supposed to be seekable, if set to 0 it is assumed not
9910 to be seekable. Default value is 0.
9911 </p></dd>
9912 </dl>
9913
9914 <p>NOTE: Protocol can be used as output, but it is recommended to not do
9915 it, unless special care is taken (tests, customized server configuration
9916 etc.). Different FTP servers behave in different way during seek
9917 operation. ff* tools may produce incomplete content due to server limitations.
9918 </p>
9919 <a name="gopher"></a>
9920 <h2 class="section"><a href="ffmpeg-all.html#toc-gopher">24.8 gopher</a></h2>
9921
9922 <p>Gopher protocol.
9923 </p>
9924 <a name="hls-2"></a>
9925 <h2 class="section"><a href="ffmpeg-all.html#toc-hls-2">24.9 hls</a></h2>
9926
9927 <p>Read Apple HTTP Live Streaming compliant segmented stream as
9928 a uniform one. The M3U8 playlists describing the segments can be
9929 remote HTTP resources or local files, accessed using the standard
9930 file protocol.
9931 The nested protocol is declared by specifying
9932 &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
9933 is either &quot;file&quot; or &quot;http&quot;.
9934 </p>
9935 <table><tr><td>&nbsp;</td><td><pre class="example">hls+http://host/path/to/remote/resource.m3u8
9936 hls+file://path/to/local/resource.m3u8
9937 </pre></td></tr></table>
9938
9939 <p>Using this protocol is discouraged - the hls demuxer should work
9940 just as well (if not, please report the issues) and is more complete.
9941 To use the hls demuxer instead, simply use the direct URLs to the
9942 m3u8 files.
9943 </p>
9944 <a name="http"></a>
9945 <h2 class="section"><a href="ffmpeg-all.html#toc-http">24.10 http</a></h2>
9946
9947 <p>HTTP (Hyper Text Transfer Protocol).
9948 </p>
9949 <p>This protocol accepts the following options.
9950 </p>
9951 <dl compact="compact">
9952 <dt> &lsquo;<samp>seekable</samp>&rsquo;</dt>
9953 <dd><p>Control seekability of connection. If set to 1 the resource is
9954 supposed to be seekable, if set to 0 it is assumed not to be seekable,
9955 if set to -1 it will try to autodetect if it is seekable. Default
9956 value is -1.
9957 </p>
9958 </dd>
9959 <dt> &lsquo;<samp>chunked_post</samp>&rsquo;</dt>
9960 <dd><p>If set to 1 use chunked transfer-encoding for posts, default is 1.
9961 </p>
9962 </dd>
9963 <dt> &lsquo;<samp>headers</samp>&rsquo;</dt>
9964 <dd><p>Set custom HTTP headers, can override built in default headers. The
9965 value must be a string encoding the headers.
9966 </p>
9967 </dd>
9968 <dt> &lsquo;<samp>content_type</samp>&rsquo;</dt>
9969 <dd><p>Force a content type.
9970 </p>
9971 </dd>
9972 <dt> &lsquo;<samp>user-agent</samp>&rsquo;</dt>
9973 <dd><p>Override User-Agent header. If not specified the protocol will use a
9974 string describing the libavformat build.
9975 </p>
9976 </dd>
9977 <dt> &lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
9978 <dd><p>Use persistent connections if set to 1. By default it is 0.
9979 </p>
9980 </dd>
9981 <dt> &lsquo;<samp>post_data</samp>&rsquo;</dt>
9982 <dd><p>Set custom HTTP post data.
9983 </p>
9984 </dd>
9985 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
9986 <dd><p>Set timeout of socket I/O operations used by the underlying low level
9987 operation. By default it is set to -1, which means that the timeout is
9988 not specified.
9989 </p>
9990 </dd>
9991 <dt> &lsquo;<samp>mime_type</samp>&rsquo;</dt>
9992 <dd><p>Set MIME type.
9993 </p>
9994 </dd>
9995 <dt> &lsquo;<samp>icy</samp>&rsquo;</dt>
9996 <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
9997 supports this, the metadata has to be retrieved by the application by reading
9998 the &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
9999 The default is 0.
10000 </p>
10001 </dd>
10002 <dt> &lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
10003 <dd><p>If the server supports ICY metadata, this contains the ICY specific HTTP reply
10004 headers, separated with newline characters.
10005 </p>
10006 </dd>
10007 <dt> &lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
10008 <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
10009 contains the last non-empty metadata packet sent by the server.
10010 </p>
10011 </dd>
10012 <dt> &lsquo;<samp>cookies</samp>&rsquo;</dt>
10013 <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
10014 same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
10015 delimited by a newline character.
10016 </p></dd>
10017 </dl>
10018
10019 <a name="HTTP-Cookies"></a>
10020 <h3 class="subsection"><a href="ffmpeg-all.html#toc-HTTP-Cookies">24.10.1 HTTP Cookies</a></h3>
10021
10022 <p>Some HTTP requests will be denied unless cookie values are passed in with the
10023 request. The &lsquo;<samp>cookies</samp>&rsquo; option allows these cookies to be specified. At
10024 the very least, each cookie must specify a value along with a path and domain.
10025 HTTP requests that match both the domain and path will automatically include the
10026 cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
10027 by a newline.
10028 </p>
10029 <p>The required syntax to play a stream specifying a cookie is:
10030 </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
10031 </pre></td></tr></table>
10032
10033 <a name="mmst"></a>
10034 <h2 class="section"><a href="ffmpeg-all.html#toc-mmst">24.11 mmst</a></h2>
10035
10036 <p>MMS (Microsoft Media Server) protocol over TCP.
10037 </p>
10038 <a name="mmsh"></a>
10039 <h2 class="section"><a href="ffmpeg-all.html#toc-mmsh">24.12 mmsh</a></h2>
10040
10041 <p>MMS (Microsoft Media Server) protocol over HTTP.
10042 </p>
10043 <p>The required syntax is:
10044 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
10045 </pre></td></tr></table>
10046
10047 <a name="md5-2"></a>
10048 <h2 class="section"><a href="ffmpeg-all.html#toc-md5-2">24.13 md5</a></h2>
10049
10050 <p>MD5 output protocol.
10051 </p>
10052 <p>Computes the MD5 hash of the data to be written, and on close writes
10053 this to the designated output or stdout if none is specified. It can
10054 be used to test muxers without writing an actual file.
10055 </p>
10056 <p>Some examples follow.
10057 </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.
10058 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
10059
10060 # Write the MD5 hash of the encoded AVI file to stdout.
10061 ffmpeg -i input.flv -f avi -y md5:
10062 </pre></td></tr></table>
10063
10064 <p>Note that some formats (typically MOV) require the output protocol to
10065 be seekable, so they will fail with the MD5 output protocol.
10066 </p>
10067 <a name="pipe"></a>
10068 <h2 class="section"><a href="ffmpeg-all.html#toc-pipe">24.14 pipe</a></h2>
10069
10070 <p>UNIX pipe access protocol.
10071 </p>
10072 <p>Allow to read and write from UNIX pipes.
10073 </p>
10074 <p>The accepted syntax is:
10075 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
10076 </pre></td></tr></table>
10077
10078 <p><var>number</var> is the number corresponding to the file descriptor of the
10079 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
10080 is not specified, by default the stdout file descriptor will be used
10081 for writing, stdin for reading.
10082 </p>
10083 <p>For example to read from stdin with <code>ffmpeg</code>:
10084 </p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
10085 # ...this is the same as...
10086 cat test.wav | ffmpeg -i pipe:
10087 </pre></td></tr></table>
10088
10089 <p>For writing to stdout with <code>ffmpeg</code>:
10090 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
10091 # ...this is the same as...
10092 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
10093 </pre></td></tr></table>
10094
10095 <p>This protocol accepts the following options:
10096 </p>
10097 <dl compact="compact">
10098 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
10099 <dd><p>Set I/O operation maximum block size, in bytes. Default value is
10100 <code>INT_MAX</code>, which results in not limiting the requested block size.
10101 Setting this value reasonably low improves user termination request reaction
10102 time, which is valuable if data transmission is slow.
10103 </p></dd>
10104 </dl>
10105
10106 <p>Note that some formats (typically MOV), require the output protocol to
10107 be seekable, so they will fail with the pipe output protocol.
10108 </p>
10109 <a name="rtmp"></a>
10110 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmp">24.15 rtmp</a></h2>
10111
10112 <p>Real-Time Messaging Protocol.
10113 </p>
10114 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
10115 content across a TCP/IP network.
10116 </p>
10117 <p>The required syntax is:
10118 </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>]
10119 </pre></td></tr></table>
10120
10121 <p>The accepted parameters are:
10122 </p><dl compact="compact">
10123 <dt> &lsquo;<samp>username</samp>&rsquo;</dt>
10124 <dd><p>An optional username (mostly for publishing).
10125 </p>
10126 </dd>
10127 <dt> &lsquo;<samp>password</samp>&rsquo;</dt>
10128 <dd><p>An optional password (mostly for publishing).
10129 </p>
10130 </dd>
10131 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
10132 <dd><p>The address of the RTMP server.
10133 </p>
10134 </dd>
10135 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
10136 <dd><p>The number of the TCP port to use (by default is 1935).
10137 </p>
10138 </dd>
10139 <dt> &lsquo;<samp>app</samp>&rsquo;</dt>
10140 <dd><p>It is the name of the application to access. It usually corresponds to
10141 the path where the application is installed on the RTMP server
10142 (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
10143 the value parsed from the URI through the <code>rtmp_app</code> option, too.
10144 </p>
10145 </dd>
10146 <dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
10147 <dd><p>It is the path or name of the resource to play with reference to the
10148 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
10149 can override the value parsed from the URI through the <code>rtmp_playpath</code>
10150 option, too.
10151 </p>
10152 </dd>
10153 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
10154 <dd><p>Act as a server, listening for an incoming connection.
10155 </p>
10156 </dd>
10157 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
10158 <dd><p>Maximum time to wait for the incoming connection. Implies listen.
10159 </p></dd>
10160 </dl>
10161
10162 <p>Additionally, the following parameters can be set via command line options
10163 (or in code via <code>AVOption</code>s):
10164 </p><dl compact="compact">
10165 <dt> &lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
10166 <dd><p>Name of application to connect on the RTMP server. This option
10167 overrides the parameter specified in the URI.
10168 </p>
10169 </dd>
10170 <dt> &lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
10171 <dd><p>Set the client buffer time in milliseconds. The default is 3000.
10172 </p>
10173 </dd>
10174 <dt> &lsquo;<samp>rtmp_conn</samp>&rsquo;</dt>
10175 <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
10176 e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
10177 Each value is prefixed by a single character denoting the type,
10178 B for Boolean, N for number, S for string, O for object, or Z for null,
10179 followed by a colon. For Booleans the data must be either 0 or 1 for
10180 FALSE or TRUE, respectively.  Likewise for Objects the data must be 0 or
10181 1 to end or begin an object, respectively. Data items in subobjects may
10182 be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
10183 the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
10184 times to construct arbitrary AMF sequences.
10185 </p>
10186 </dd>
10187 <dt> &lsquo;<samp>rtmp_flashver</samp>&rsquo;</dt>
10188 <dd><p>Version of the Flash plugin used to run the SWF player. The default
10189 is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
10190 &lt;libavformat version&gt;).)
10191 </p>
10192 </dd>
10193 <dt> &lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
10194 <dd><p>Number of packets flushed in the same request (RTMPT only). The default
10195 is 10.
10196 </p>
10197 </dd>
10198 <dt> &lsquo;<samp>rtmp_live</samp>&rsquo;</dt>
10199 <dd><p>Specify that the media is a live stream. No resuming or seeking in
10200 live streams is possible. The default value is <code>any</code>, which means the
10201 subscriber first tries to play the live stream specified in the
10202 playpath. If a live stream of that name is not found, it plays the
10203 recorded stream. The other possible values are <code>live</code> and
10204 <code>recorded</code>.
10205 </p>
10206 </dd>
10207 <dt> &lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
10208 <dd><p>URL of the web page in which the media was embedded. By default no
10209 value will be sent.
10210 </p>
10211 </dd>
10212 <dt> &lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
10213 <dd><p>Stream identifier to play or to publish. This option overrides the
10214 parameter specified in the URI.
10215 </p>
10216 </dd>
10217 <dt> &lsquo;<samp>rtmp_subscribe</samp>&rsquo;</dt>
10218 <dd><p>Name of live stream to subscribe to. By default no value will be sent.
10219 It is only sent if the option is specified or if rtmp_live
10220 is set to live.
10221 </p>
10222 </dd>
10223 <dt> &lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
10224 <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
10225 </p>
10226 </dd>
10227 <dt> &lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
10228 <dd><p>Size of the decompressed SWF file, required for SWFVerification.
10229 </p>
10230 </dd>
10231 <dt> &lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
10232 <dd><p>URL of the SWF player for the media. By default no value will be sent.
10233 </p>
10234 </dd>
10235 <dt> &lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
10236 <dd><p>URL to player swf file, compute hash/size automatically.
10237 </p>
10238 </dd>
10239 <dt> &lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
10240 <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
10241 </p>
10242 </dd>
10243 </dl>
10244
10245 <p>For example to read with <code>ffplay</code> a multimedia resource named
10246 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
10247 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
10248 </pre></td></tr></table>
10249
10250 <p>To publish to a password protected server, passing the playpath and
10251 app names separately:
10252 </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/
10253 </pre></td></tr></table>
10254
10255 <a name="rtmpe"></a>
10256 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpe">24.16 rtmpe</a></h2>
10257
10258 <p>Encrypted Real-Time Messaging Protocol.
10259 </p>
10260 <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
10261 streaming multimedia content within standard cryptographic primitives,
10262 consisting of Diffie-Hellman key exchange and HMACSHA256, generating
10263 a pair of RC4 keys.
10264 </p>
10265 <a name="rtmps"></a>
10266 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmps">24.17 rtmps</a></h2>
10267
10268 <p>Real-Time Messaging Protocol over a secure SSL connection.
10269 </p>
10270 <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
10271 multimedia content across an encrypted connection.
10272 </p>
10273 <a name="rtmpt"></a>
10274 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpt">24.18 rtmpt</a></h2>
10275
10276 <p>Real-Time Messaging Protocol tunneled through HTTP.
10277 </p>
10278 <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
10279 for streaming multimedia content within HTTP requests to traverse
10280 firewalls.
10281 </p>
10282 <a name="rtmpte"></a>
10283 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpte">24.19 rtmpte</a></h2>
10284
10285 <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
10286 </p>
10287 <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
10288 is used for streaming multimedia content within HTTP requests to traverse
10289 firewalls.
10290 </p>
10291 <a name="rtmpts"></a>
10292 <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpts">24.20 rtmpts</a></h2>
10293
10294 <p>Real-Time Messaging Protocol tunneled through HTTPS.
10295 </p>
10296 <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
10297 for streaming multimedia content within HTTPS requests to traverse
10298 firewalls.
10299 </p>
10300 <a name="libssh"></a>
10301 <h2 class="section"><a href="ffmpeg-all.html#toc-libssh">24.21 libssh</a></h2>
10302
10303 <p>Secure File Transfer Protocol via libssh
10304 </p>
10305 <p>Allow to read from or write to remote resources using SFTP protocol.
10306 </p>
10307 <p>Following syntax is required.
10308 </p>
10309 <table><tr><td>&nbsp;</td><td><pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
10310 </pre></td></tr></table>
10311
10312 <p>This protocol accepts the following options.
10313 </p>
10314 <dl compact="compact">
10315 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
10316 <dd><p>Set timeout of socket I/O operations used by the underlying low level
10317 operation. By default it is set to -1, which means that the timeout
10318 is not specified.
10319 </p>
10320 </dd>
10321 <dt> &lsquo;<samp>truncate</samp>&rsquo;</dt>
10322 <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
10323 truncating. Default value is 1.
10324 </p>
10325 </dd>
10326 </dl>
10327
10328 <p>Example: Play a file stored on remote server.
10329 </p>
10330 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
10331 </pre></td></tr></table>
10332
10333 <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
10334 <h2 class="section"><a href="ffmpeg-all.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">24.22 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
10335
10336 <p>Real-Time Messaging Protocol and its variants supported through
10337 librtmp.
10338 </p>
10339 <p>Requires the presence of the librtmp headers and library during
10340 configuration. You need to explicitly configure the build with
10341 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
10342 protocol.
10343 </p>
10344 <p>This protocol provides most client functions and a few server
10345 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
10346 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
10347 variants of these encrypted types (RTMPTE, RTMPTS).
10348 </p>
10349 <p>The required syntax is:
10350 </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>
10351 </pre></td></tr></table>
10352
10353 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
10354 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
10355 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
10356 meaning as specified for the RTMP native protocol.
10357 <var>options</var> contains a list of space-separated options of the form
10358 <var>key</var>=<var>val</var>.
10359 </p>
10360 <p>See the librtmp manual page (man 3 librtmp) for more information.
10361 </p>
10362 <p>For example, to stream a file in real-time to an RTMP server using
10363 <code>ffmpeg</code>:
10364 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
10365 </pre></td></tr></table>
10366
10367 <p>To play the same stream using <code>ffplay</code>:
10368 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
10369 </pre></td></tr></table>
10370
10371 <a name="rtp"></a>
10372 <h2 class="section"><a href="ffmpeg-all.html#toc-rtp">24.23 rtp</a></h2>
10373
10374 <p>Real-time Transport Protocol.
10375 </p>
10376 <p>The required syntax for an RTP URL is:
10377 rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
10378 </p>
10379 <p><var>port</var> specifies the RTP port to use.
10380 </p>
10381 <p>The following URL options are supported:
10382 </p>
10383 <dl compact="compact">
10384 <dt> &lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
10385 <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
10386 </p>
10387 </dd>
10388 <dt> &lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
10389 <dd><p>Set the remote RTCP port to <var>n</var>.
10390 </p>
10391 </dd>
10392 <dt> &lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
10393 <dd><p>Set the local RTP port to <var>n</var>.
10394 </p>
10395 </dd>
10396 <dt> &lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
10397 <dd><p>Set the local RTCP port to <var>n</var>.
10398 </p>
10399 </dd>
10400 <dt> &lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
10401 <dd><p>Set max packet size (in bytes) to <var>n</var>.
10402 </p>
10403 </dd>
10404 <dt> &lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
10405 <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
10406 to 0).
10407 </p>
10408 </dd>
10409 <dt> &lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
10410 <dd><p>List allowed source IP addresses.
10411 </p>
10412 </dd>
10413 <dt> &lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
10414 <dd><p>List disallowed (blocked) source IP addresses.
10415 </p>
10416 </dd>
10417 <dt> &lsquo;<samp>write_to_source=0|1</samp>&rsquo;</dt>
10418 <dd><p>Send packets to the source address of the latest received packet (if
10419 set to 1) or to a default remote address (if set to 0).
10420 </p>
10421 </dd>
10422 <dt> &lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
10423 <dd><p>Set the local RTP port to <var>n</var>.
10424 </p>
10425 <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
10426 used.
10427 </p>
10428 </dd>
10429 </dl>
10430
10431 <p>Important notes:
10432 </p>
10433 <ol>
10434 <li>
10435 If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
10436 port value plus 1.
10437
10438 </li><li>
10439 If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
10440 port will be used for the local RTP and RTCP ports.
10441
10442 </li><li>
10443 If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
10444 set to the the local RTP port value plus 1.
10445 </li></ol>
10446
10447 <a name="rtsp"></a>
10448 <h2 class="section"><a href="ffmpeg-all.html#toc-rtsp">24.24 rtsp</a></h2>
10449
10450 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
10451 and muxer. The demuxer supports both normal RTSP (with data transferred
10452 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
10453 data transferred over RDT).
10454 </p>
10455 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
10456 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
10457 <a href="http://github.com/revmischa/rtsp-server">RTSP server</a>).
10458 </p>
10459 <p>The required syntax for a RTSP url is:
10460 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
10461 </pre></td></tr></table>
10462
10463 <p>The following options (set on the <code>ffmpeg</code>/<code>ffplay</code> command
10464 line, or set in code via <code>AVOption</code>s or in <code>avformat_open_input</code>),
10465 are supported:
10466 </p>
10467 <p>Flags for <code>rtsp_transport</code>:
10468 </p>
10469 <dl compact="compact">
10470 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
10471 <dd><p>Use UDP as lower transport protocol.
10472 </p>
10473 </dd>
10474 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
10475 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
10476 transport protocol.
10477 </p>
10478 </dd>
10479 <dt> &lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
10480 <dd><p>Use UDP multicast as lower transport protocol.
10481 </p>
10482 </dd>
10483 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
10484 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
10485 passing proxies.
10486 </p></dd>
10487 </dl>
10488
10489 <p>Multiple lower transport protocols may be specified, in that case they are
10490 tried one at a time (if the setup of one fails, the next one is tried).
10491 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
10492 </p>
10493 <p>Flags for <code>rtsp_flags</code>:
10494 </p>
10495 <dl compact="compact">
10496 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
10497 <dd><p>Accept packets only from negotiated peer address and port.
10498 </p></dd>
10499 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
10500 <dd><p>Act as a server, listening for an incoming connection.
10501 </p></dd>
10502 </dl>
10503
10504 <p>When receiving data over UDP, the demuxer tries to reorder received packets
10505 (since they may arrive out of order, or packets may get lost totally). This
10506 can be disabled by setting the maximum demuxing delay to zero (via
10507 the <code>max_delay</code> field of AVFormatContext).
10508 </p>
10509 <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
10510 streams to display can be chosen with <code>-vst</code> <var>n</var> and
10511 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
10512 on the fly by pressing <code>v</code> and <code>a</code>.
10513 </p>
10514 <p>Example command lines:
10515 </p>
10516 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
10517 </p>
10518 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
10519 </pre></td></tr></table>
10520
10521 <p>To watch a stream tunneled over HTTP:
10522 </p>
10523 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
10524 </pre></td></tr></table>
10525
10526 <p>To send a stream in realtime to a RTSP server, for others to watch:
10527 </p>
10528 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
10529 </pre></td></tr></table>
10530
10531 <p>To receive a stream in realtime:
10532 </p>
10533 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
10534 </pre></td></tr></table>
10535
10536 <dl compact="compact">
10537 <dt> &lsquo;<samp>stimeout</samp>&rsquo;</dt>
10538 <dd><p>Socket IO timeout in micro seconds.
10539 </p></dd>
10540 </dl>
10541
10542 <a name="sap"></a>
10543 <h2 class="section"><a href="ffmpeg-all.html#toc-sap">24.25 sap</a></h2>
10544
10545 <p>Session Announcement Protocol (RFC 2974). This is not technically a
10546 protocol handler in libavformat, it is a muxer and demuxer.
10547 It is used for signalling of RTP streams, by announcing the SDP for the
10548 streams regularly on a separate port.
10549 </p>
10550 <a name="Muxer"></a>
10551 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Muxer">24.25.1 Muxer</a></h3>
10552
10553 <p>The syntax for a SAP url given to the muxer is:
10554 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
10555 </pre></td></tr></table>
10556
10557 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
10558 or to port 5004 if no port is specified.
10559 <var>options</var> is a <code>&amp;</code>-separated list. The following options
10560 are supported:
10561 </p>
10562 <dl compact="compact">
10563 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
10564 <dd><p>Specify the destination IP address for sending the announcements to.
10565 If omitted, the announcements are sent to the commonly used SAP
10566 announcement multicast address 224.2.127.254 (sap.mcast.net), or
10567 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
10568 </p>
10569 </dd>
10570 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
10571 <dd><p>Specify the port to send the announcements on, defaults to
10572 9875 if not specified.
10573 </p>
10574 </dd>
10575 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
10576 <dd><p>Specify the time to live value for the announcements and RTP packets,
10577 defaults to 255.
10578 </p>
10579 </dd>
10580 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
10581 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
10582 default), all streams are sent on unique ports, with each stream on a
10583 port 2 numbers higher than the previous.
10584 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
10585 The RTP stack in libavformat for receiving requires all streams to be sent
10586 on unique ports.
10587 </p></dd>
10588 </dl>
10589
10590 <p>Example command lines follow.
10591 </p>
10592 <p>To broadcast a stream on the local subnet, for watching in VLC:
10593 </p>
10594 <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
10595 </pre></td></tr></table>
10596
10597 <p>Similarly, for watching in <code>ffplay</code>:
10598 </p>
10599 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
10600 </pre></td></tr></table>
10601
10602 <p>And for watching in <code>ffplay</code>, over IPv6:
10603 </p>
10604 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
10605 </pre></td></tr></table>
10606
10607 <a name="Demuxer"></a>
10608 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Demuxer">24.25.2 Demuxer</a></h3>
10609
10610 <p>The syntax for a SAP url given to the demuxer is:
10611 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
10612 </pre></td></tr></table>
10613
10614 <p><var>address</var> is the multicast address to listen for announcements on,
10615 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
10616 is the port that is listened on, 9875 if omitted.
10617 </p>
10618 <p>The demuxers listens for announcements on the given address and port.
10619 Once an announcement is received, it tries to receive that particular stream.
10620 </p>
10621 <p>Example command lines follow.
10622 </p>
10623 <p>To play back the first stream announced on the normal SAP multicast address:
10624 </p>
10625 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
10626 </pre></td></tr></table>
10627
10628 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
10629 </p>
10630 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
10631 </pre></td></tr></table>
10632
10633 <a name="sctp"></a>
10634 <h2 class="section"><a href="ffmpeg-all.html#toc-sctp">24.26 sctp</a></h2>
10635
10636 <p>Stream Control Transmission Protocol.
10637 </p>
10638 <p>The accepted URL syntax is:
10639 </p><table><tr><td>&nbsp;</td><td><pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
10640 </pre></td></tr></table>
10641
10642 <p>The protocol accepts the following options:
10643 </p><dl compact="compact">
10644 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
10645 <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
10646 </p>
10647 </dd>
10648 <dt> &lsquo;<samp>max_streams</samp>&rsquo;</dt>
10649 <dd><p>Set the maximum number of streams. By default no limit is set.
10650 </p></dd>
10651 </dl>
10652
10653 <a name="srtp"></a>
10654 <h2 class="section"><a href="ffmpeg-all.html#toc-srtp">24.27 srtp</a></h2>
10655
10656 <p>Secure Real-time Transport Protocol.
10657 </p>
10658 <p>The accepted options are:
10659 </p><dl compact="compact">
10660 <dt> &lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
10661 <dt> &lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
10662 <dd><p>Select input and output encoding suites.
10663 </p>
10664 <p>Supported values:
10665 </p><dl compact="compact">
10666 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
10667 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
10668 <dt> &lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
10669 <dt> &lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
10670 </dl>
10671
10672 </dd>
10673 <dt> &lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
10674 <dt> &lsquo;<samp>srtp_out_params</samp>&rsquo;</dt>
10675 <dd><p>Set input and output encoding parameters, which are expressed by a
10676 base64-encoded representation of a binary block. The first 16 bytes of
10677 this binary block are used as master key, the following 14 bytes are
10678 used as master salt.
10679 </p></dd>
10680 </dl>
10681
10682 <a name="tcp"></a>
10683 <h2 class="section"><a href="ffmpeg-all.html#toc-tcp">24.28 tcp</a></h2>
10684
10685 <p>Trasmission Control Protocol.
10686 </p>
10687 <p>The required syntax for a TCP url is:
10688 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
10689 </pre></td></tr></table>
10690
10691 <dl compact="compact">
10692 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
10693 <dd><p>Listen for an incoming connection
10694 </p>
10695 </dd>
10696 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
10697 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
10698 In write mode: if socket cannot be written in more than this time interval, raise error.
10699 This also sets timeout on TCP connection establishing.
10700 </p>
10701 <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
10702 ffplay tcp://<var>hostname</var>:<var>port</var>
10703 </pre></td></tr></table>
10704
10705 </dd>
10706 </dl>
10707
10708 <a name="tls"></a>
10709 <h2 class="section"><a href="ffmpeg-all.html#toc-tls">24.29 tls</a></h2>
10710
10711 <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
10712 </p>
10713 <p>The required syntax for a TLS/SSL url is:
10714 </p><table><tr><td>&nbsp;</td><td><pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
10715 </pre></td></tr></table>
10716
10717 <p>The following parameters can be set via command line options
10718 (or in code via <code>AVOption</code>s):
10719 </p>
10720 <dl compact="compact">
10721 <dt> &lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</dt>
10722 <dd><p>A file containing certificate authority (CA) root certificates to treat
10723 as trusted. If the linked TLS library contains a default this might not
10724 need to be specified for verification to work, but not all libraries and
10725 setups have defaults built in.
10726 The file must be in OpenSSL PEM format.
10727 </p>
10728 </dd>
10729 <dt> &lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</dt>
10730 <dd><p>If enabled, try to verify the peer that we are communicating with.
10731 Note, if using OpenSSL, this currently only makes sure that the
10732 peer certificate is signed by one of the root certificates in the CA
10733 database, but it does not validate that the certificate actually
10734 matches the host name we are trying to connect to. (With GnuTLS,
10735 the host name is validated as well.)
10736 </p>
10737 <p>This is disabled by default since it requires a CA database to be
10738 provided by the caller in many cases.
10739 </p>
10740 </dd>
10741 <dt> &lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</dt>
10742 <dd><p>A file containing a certificate to use in the handshake with the peer.
10743 (When operating as server, in listen mode, this is more often required
10744 by the peer, while client certificates only are mandated in certain
10745 setups.)
10746 </p>
10747 </dd>
10748 <dt> &lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
10749 <dd><p>A file containing the private key for the certificate.
10750 </p>
10751 </dd>
10752 <dt> &lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
10753 <dd><p>If enabled, listen for connections on the provided port, and assume
10754 the server role in the handshake instead of the client role.
10755 </p>
10756 </dd>
10757 </dl>
10758
10759 <p>Example command lines:
10760 </p>
10761 <p>To create a TLS/SSL server that serves an input stream.
10762 </p>
10763 <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>
10764 </pre></td></tr></table>
10765
10766 <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
10767 </p>
10768 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
10769 </pre></td></tr></table>
10770
10771 <a name="udp"></a>
10772 <h2 class="section"><a href="ffmpeg-all.html#toc-udp">24.30 udp</a></h2>
10773
10774 <p>User Datagram Protocol.
10775 </p>
10776 <p>The required syntax for a UDP url is:
10777 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
10778 </pre></td></tr></table>
10779
10780 <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
10781 </p>
10782 <p>In case threading is enabled on the system, a circular buffer is used
10783 to store the incoming data, which allows to reduce loss of data due to
10784 UDP socket buffer overruns. The <var>fifo_size</var> and
10785 <var>overrun_nonfatal</var> options are related to this buffer.
10786 </p>
10787 <p>The list of supported options follows.
10788 </p>
10789 <dl compact="compact">
10790 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
10791 <dd><p>Set the UDP socket buffer size in bytes. This is used both for the
10792 receiving and the sending buffer size.
10793 </p>
10794 </dd>
10795 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
10796 <dd><p>Override the local UDP port to bind with.
10797 </p>
10798 </dd>
10799 <dt> &lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</dt>
10800 <dd><p>Choose the local IP address. This is useful e.g. if sending multicast
10801 and the host has multiple interfaces, where the user can choose
10802 which interface to send on by specifying the IP address of that interface.
10803 </p>
10804 </dd>
10805 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
10806 <dd><p>Set the size in bytes of UDP packets.
10807 </p>
10808 </dd>
10809 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
10810 <dd><p>Explicitly allow or disallow reusing UDP sockets.
10811 </p>
10812 </dd>
10813 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
10814 <dd><p>Set the time to live value (for multicast only).
10815 </p>
10816 </dd>
10817 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
10818 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
10819 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
10820 If the destination address isn&rsquo;t known at the start, this option can
10821 be specified in ff_udp_set_remote_url, too.
10822 This allows finding out the source address for the packets with getsockname,
10823 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
10824 unreachable&quot; is received.
10825 For receiving, this gives the benefit of only receiving packets from
10826 the specified peer address/port.
10827 </p>
10828 </dd>
10829 <dt> &lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
10830 <dd><p>Only receive packets sent to the multicast group from one of the
10831 specified sender IP addresses.
10832 </p>
10833 </dd>
10834 <dt> &lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
10835 <dd><p>Ignore packets sent to the multicast group from the specified
10836 sender IP addresses.
10837 </p>
10838 </dd>
10839 <dt> &lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</dt>
10840 <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
10841 packets with size of 188 bytes. If not specified defaults to 7*4096.
10842 </p>
10843 </dd>
10844 <dt> &lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
10845 <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
10846 value is 0.
10847 </p>
10848 </dd>
10849 <dt> &lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
10850 <dd><p>In read mode: if no data arrived in more than this time interval, raise error.
10851 </p></dd>
10852 </dl>
10853
10854 <p>Some usage examples of the UDP protocol with <code>ffmpeg</code> follow.
10855 </p>
10856 <p>To stream over UDP to a remote endpoint:
10857 </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>
10858 </pre></td></tr></table>
10859
10860 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
10861 </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
10862 </pre></td></tr></table>
10863
10864 <p>To receive over UDP from a remote endpoint:
10865 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
10866 </pre></td></tr></table>
10867
10868 <a name="unix"></a>
10869 <h2 class="section"><a href="ffmpeg-all.html#toc-unix">24.31 unix</a></h2>
10870
10871 <p>Unix local socket
10872 </p>
10873 <p>The required syntax for a Unix socket URL is:
10874 </p>
10875 <table><tr><td>&nbsp;</td><td><pre class="example">unix://<var>filepath</var>
10876 </pre></td></tr></table>
10877
10878 <p>The following parameters can be set via command line options
10879 (or in code via <code>AVOption</code>s):
10880 </p>
10881 <dl compact="compact">
10882 <dt> &lsquo;<samp>timeout</samp>&rsquo;</dt>
10883 <dd><p>Timeout in ms.
10884 </p></dd>
10885 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
10886 <dd><p>Create the Unix socket in listening mode.
10887 </p></dd>
10888 </dl>
10889
10890 <a name="Device-Options"></a>
10891 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Device-Options">25. Device Options</a></h1>
10892
10893 <p>The libavdevice library provides the same interface as
10894 libavformat. Namely, an input device is considered like a demuxer, and
10895 an output device like a muxer, and the interface and generic device
10896 options are the same provided by libavformat (see the ffmpeg-formats
10897 manual).
10898 </p>
10899 <p>In addition each input or output device may support so-called private
10900 options, which are specific for that component.
10901 </p>
10902 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
10903 FFmpeg tools, or by setting the value explicitly in the device
10904 <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
10905 for programmatic use.
10906 </p>
10907
10908 <a name="Input-Devices"></a>
10909 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Input-Devices">26. Input Devices</a></h1>
10910
10911 <p>Input devices are configured elements in FFmpeg which allow to access
10912 the data coming from a multimedia device attached to your system.
10913 </p>
10914 <p>When you configure your FFmpeg build, all the supported input devices
10915 are enabled by default. You can list all available ones using the
10916 configure option &quot;&ndash;list-indevs&quot;.
10917 </p>
10918 <p>You can disable all the input devices using the configure option
10919 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
10920 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
10921 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
10922 </p>
10923 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
10924 supported input devices (amongst the demuxers).
10925 </p>
10926 <p>A description of the currently available input devices follows.
10927 </p>
10928 <a name="alsa"></a>
10929 <h2 class="section"><a href="ffmpeg-all.html#toc-alsa">26.1 alsa</a></h2>
10930
10931 <p>ALSA (Advanced Linux Sound Architecture) input device.
10932 </p>
10933 <p>To enable this input device during configuration you need libasound
10934 installed on your system.
10935 </p>
10936 <p>This device allows capturing from an ALSA device. The name of the
10937 device to capture has to be an ALSA card identifier.
10938 </p>
10939 <p>An ALSA identifier has the syntax:
10940 </p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
10941 </pre></td></tr></table>
10942
10943 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
10944 </p>
10945 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
10946 specify card number or identifier, device number and subdevice number
10947 (-1 means any).
10948 </p>
10949 <p>To see the list of cards currently recognized by your system check the
10950 files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
10951 </p>
10952 <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
10953 card id 0, you may run the command:
10954 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
10955 </pre></td></tr></table>
10956
10957 <p>For more information see:
10958 <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>
10959 </p>
10960 <a name="bktr"></a>
10961 <h2 class="section"><a href="ffmpeg-all.html#toc-bktr">26.2 bktr</a></h2>
10962
10963 <p>BSD video input device.
10964 </p>
10965 <a name="dshow"></a>
10966 <h2 class="section"><a href="ffmpeg-all.html#toc-dshow">26.3 dshow</a></h2>
10967
10968 <p>Windows DirectShow input device.
10969 </p>
10970 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
10971 Currently only audio and video devices are supported.
10972 </p>
10973 <p>Multiple devices may be opened as separate inputs, but they may also be
10974 opened on the same input, which should improve synchronism between them.
10975 </p>
10976 <p>The input name should be in the format:
10977 </p>
10978 <table><tr><td>&nbsp;</td><td><pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
10979 </pre></td></tr></table>
10980
10981 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
10982 and <var>NAME</var> is the device&rsquo;s name.
10983 </p>
10984 <a name="Options-4"></a>
10985 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-4">26.3.1 Options</a></h3>
10986
10987 <p>If no options are specified, the device&rsquo;s defaults are used.
10988 If the device does not support the requested options, it will
10989 fail to open.
10990 </p>
10991 <dl compact="compact">
10992 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
10993 <dd><p>Set the video size in the captured video.
10994 </p>
10995 </dd>
10996 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
10997 <dd><p>Set the frame rate in the captured video.
10998 </p>
10999 </dd>
11000 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
11001 <dd><p>Set the sample rate (in Hz) of the captured audio.
11002 </p>
11003 </dd>
11004 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
11005 <dd><p>Set the sample size (in bits) of the captured audio.
11006 </p>
11007 </dd>
11008 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
11009 <dd><p>Set the number of channels in the captured audio.
11010 </p>
11011 </dd>
11012 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
11013 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
11014 </p>
11015 </dd>
11016 <dt> &lsquo;<samp>list_options</samp>&rsquo;</dt>
11017 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of selected device&rsquo;s options
11018 and exit.
11019 </p>
11020 </dd>
11021 <dt> &lsquo;<samp>video_device_number</samp>&rsquo;</dt>
11022 <dd><p>Set video device number for devices with same name (starts at 0,
11023 defaults to 0).
11024 </p>
11025 </dd>
11026 <dt> &lsquo;<samp>audio_device_number</samp>&rsquo;</dt>
11027 <dd><p>Set audio device number for devices with same name (starts at 0,
11028 defaults to 0).
11029 </p>
11030 </dd>
11031 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
11032 <dd><p>Select pixel format to be used by DirectShow. This may only be set when
11033 the video codec is not set or set to rawvideo.
11034 </p>
11035 </dd>
11036 <dt> &lsquo;<samp>audio_buffer_size</samp>&rsquo;</dt>
11037 <dd><p>Set audio device buffer size in milliseconds (which can directly
11038 impact latency, depending on the device).
11039 Defaults to using the audio device&rsquo;s
11040 default buffer size (typically some multiple of 500ms).
11041 Setting this value too low can degrade performance.
11042 See also
11043 <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>
11044 </p>
11045 </dd>
11046 </dl>
11047
11048 <a name="Examples-49"></a>
11049 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-49">26.3.2 Examples</a></h3>
11050
11051 <ul>
11052 <li>
11053 Print the list of DirectShow supported devices and exit:
11054 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
11055 </pre></td></tr></table>
11056
11057 </li><li>
11058 Open video device <var>Camera</var>:
11059 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
11060 </pre></td></tr></table>
11061
11062 </li><li>
11063 Open second video device with name <var>Camera</var>:
11064 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
11065 </pre></td></tr></table>
11066
11067 </li><li>
11068 Open video device <var>Camera</var> and audio device <var>Microphone</var>:
11069 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
11070 </pre></td></tr></table>
11071
11072 </li><li>
11073 Print the list of supported options in selected device and exit:
11074 <table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
11075 </pre></td></tr></table>
11076
11077 </li></ul>
11078
11079 <a name="dv1394"></a>
11080 <h2 class="section"><a href="ffmpeg-all.html#toc-dv1394">26.4 dv1394</a></h2>
11081
11082 <p>Linux DV 1394 input device.
11083 </p>
11084 <a name="fbdev"></a>
11085 <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev">26.5 fbdev</a></h2>
11086
11087 <p>Linux framebuffer input device.
11088 </p>
11089 <p>The Linux framebuffer is a graphic hardware-independent abstraction
11090 layer to show graphics on a computer monitor, typically on the
11091 console. It is accessed through a file device node, usually
11092 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
11093 </p>
11094 <p>For more detailed information read the file
11095 Documentation/fb/framebuffer.txt included in the Linux source tree.
11096 </p>
11097 <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
11098 <code>ffmpeg</code>:
11099 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
11100 </pre></td></tr></table>
11101
11102 <p>You can take a single screenshot image with the command:
11103 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
11104 </pre></td></tr></table>
11105
11106 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
11107 </p>
11108 <a name="iec61883"></a>
11109 <h2 class="section"><a href="ffmpeg-all.html#toc-iec61883">26.6 iec61883</a></h2>
11110
11111 <p>FireWire DV/HDV input device using libiec61883.
11112 </p>
11113 <p>To enable this input device, you need libiec61883, libraw1394 and
11114 libavc1394 installed on your system. Use the configure option
11115 <code>--enable-libiec61883</code> to compile with the device enabled.
11116 </p>
11117 <p>The iec61883 capture device supports capturing from a video device
11118 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
11119 FireWire stack (juju). This is the default DV/HDV input method in Linux
11120 Kernel 2.6.37 and later, since the old FireWire stack was removed.
11121 </p>
11122 <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
11123 to choose the first port connected.
11124 </p>
11125 <a name="Options-11"></a>
11126 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-11">26.6.1 Options</a></h3>
11127
11128 <dl compact="compact">
11129 <dt> &lsquo;<samp>dvtype</samp>&rsquo;</dt>
11130 <dd><p>Override autodetection of DV/HDV. This should only be used if auto
11131 detection does not work, or if usage of a different device type
11132 should be prohibited. Treating a DV device as HDV (or vice versa) will
11133 not work and result in undefined behavior.
11134 The values &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>dv</samp>&rsquo; and &lsquo;<samp>hdv</samp>&rsquo; are supported.
11135 </p>
11136 </dd>
11137 <dt> &lsquo;<samp>dvbuffer</samp>&rsquo;</dt>
11138 <dd><p>Set maxiumum size of buffer for incoming data, in frames. For DV, this
11139 is an exact value. For HDV, it is not frame exact, since HDV does
11140 not have a fixed frame size.
11141 </p>
11142 </dd>
11143 <dt> &lsquo;<samp>dvguid</samp>&rsquo;</dt>
11144 <dd><p>Select the capture device by specifying it&rsquo;s GUID. Capturing will only
11145 be performed from the specified device and fails if no device with the
11146 given GUID is found. This is useful to select the input if multiple
11147 devices are connected at the same time.
11148 Look at /sys/bus/firewire/devices to find out the GUIDs.
11149 </p>
11150 </dd>
11151 </dl>
11152
11153 <a name="Examples-44"></a>
11154 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-44">26.6.2 Examples</a></h3>
11155
11156 <ul>
11157 <li>
11158 Grab and show the input of a FireWire DV/HDV device.
11159 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f iec61883 -i auto
11160 </pre></td></tr></table>
11161
11162 </li><li>
11163 Grab and record the input of a FireWire DV/HDV device,
11164 using a packet buffer of 100000 packets if the source is HDV.
11165 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
11166 </pre></td></tr></table>
11167
11168 </li></ul>
11169
11170 <a name="jack"></a>
11171 <h2 class="section"><a href="ffmpeg-all.html#toc-jack">26.7 jack</a></h2>
11172
11173 <p>JACK input device.
11174 </p>
11175 <p>To enable this input device during configuration you need libjack
11176 installed on your system.
11177 </p>
11178 <p>A JACK input device creates one or more JACK writable clients, one for
11179 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
11180 <var>client_name</var> is the name provided by the application, and <var>N</var>
11181 is a number which identifies the channel.
11182 Each writable client will send the acquired data to the FFmpeg input
11183 device.
11184 </p>
11185 <p>Once you have created one or more JACK readable clients, you need to
11186 connect them to one or more JACK writable clients.
11187 </p>
11188 <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
11189 and <code>jack_disconnect</code> programs, or do it through a graphical interface,
11190 for example with <code>qjackctl</code>.
11191 </p>
11192 <p>To list the JACK clients and their properties you can invoke the command
11193 <code>jack_lsp</code>.
11194 </p>
11195 <p>Follows an example which shows how to capture a JACK readable client
11196 with <code>ffmpeg</code>.
11197 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
11198 $ ffmpeg -f jack -i ffmpeg -y out.wav
11199
11200 # Start the sample jack_metro readable client.
11201 $ jack_metro -b 120 -d 0.2 -f 4000
11202
11203 # List the current JACK clients.
11204 $ jack_lsp -c
11205 system:capture_1
11206 system:capture_2
11207 system:playback_1
11208 system:playback_2
11209 ffmpeg:input_1
11210 metro:120_bpm
11211
11212 # Connect metro to the ffmpeg writable client.
11213 $ jack_connect metro:120_bpm ffmpeg:input_1
11214 </pre></td></tr></table>
11215
11216 <p>For more information read:
11217 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
11218 </p>
11219 <a name="lavfi"></a>
11220 <h2 class="section"><a href="ffmpeg-all.html#toc-lavfi">26.8 lavfi</a></h2>
11221
11222 <p>Libavfilter input virtual device.
11223 </p>
11224 <p>This input device reads data from the open output pads of a libavfilter
11225 filtergraph.
11226 </p>
11227 <p>For each filtergraph open output, the input device will create a
11228 corresponding stream which is mapped to the generated output. Currently
11229 only video data is supported. The filtergraph is specified through the
11230 option &lsquo;<samp>graph</samp>&rsquo;.
11231 </p>
11232 <a name="Options-14"></a>
11233 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-14">26.8.1 Options</a></h3>
11234
11235 <dl compact="compact">
11236 <dt> &lsquo;<samp>graph</samp>&rsquo;</dt>
11237 <dd><p>Specify the filtergraph to use as input. Each video open output must be
11238 labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
11239 number starting from 0 corresponding to the mapped input stream
11240 generated by the device.
11241 The first unlabelled output is automatically assigned to the &quot;out0&quot;
11242 label, but all the others need to be specified explicitly.
11243 </p>
11244 <p>If not specified defaults to the filename specified for the input
11245 device.
11246 </p>
11247 </dd>
11248 <dt> &lsquo;<samp>graph_file</samp>&rsquo;</dt>
11249 <dd><p>Set the filename of the filtergraph to be read and sent to the other
11250 filters. Syntax of the filtergraph is the same as the one specified by
11251 the option <var>graph</var>.
11252 </p>
11253 </dd>
11254 </dl>
11255
11256 <a name="Examples-26"></a>
11257 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-26">26.8.2 Examples</a></h3>
11258
11259 <ul>
11260 <li>
11261 Create a color video stream and play it back with <code>ffplay</code>:
11262 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
11263 </pre></td></tr></table>
11264
11265 </li><li>
11266 As the previous example, but use filename for specifying the graph
11267 description, and omit the &quot;out0&quot; label:
11268 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi color=c=pink
11269 </pre></td></tr></table>
11270
11271 </li><li>
11272 Create three different video test filtered sources and play them:
11273 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
11274 </pre></td></tr></table>
11275
11276 </li><li>
11277 Read an audio stream from a file using the amovie source and play it
11278 back with <code>ffplay</code>:
11279 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
11280 </pre></td></tr></table>
11281
11282 </li><li>
11283 Read an audio stream and a video stream and play it back with
11284 <code>ffplay</code>:
11285 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
11286 </pre></td></tr></table>
11287
11288 </li></ul>
11289
11290 <a name="libdc1394"></a>
11291 <h2 class="section"><a href="ffmpeg-all.html#toc-libdc1394">26.9 libdc1394</a></h2>
11292
11293 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
11294 </p>
11295 <a name="openal"></a>
11296 <h2 class="section"><a href="ffmpeg-all.html#toc-openal">26.10 openal</a></h2>
11297
11298 <p>The OpenAL input device provides audio capture on all systems with a
11299 working OpenAL 1.1 implementation.
11300 </p>
11301 <p>To enable this input device during configuration, you need OpenAL
11302 headers and libraries installed on your system, and need to configure
11303 FFmpeg with <code>--enable-openal</code>.
11304 </p>
11305 <p>OpenAL headers and libraries should be provided as part of your OpenAL
11306 implementation, or as an additional download (an SDK). Depending on your
11307 installation you may need to specify additional flags via the
11308 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
11309 system to locate the OpenAL headers and libraries.
11310 </p>
11311 <p>An incomplete list of OpenAL implementations follows:
11312 </p>
11313 <dl compact="compact">
11314 <dt> <strong>Creative</strong></dt>
11315 <dd><p>The official Windows implementation, providing hardware acceleration
11316 with supported devices and software fallback.
11317 See <a href="http://openal.org/">http://openal.org/</a>.
11318 </p></dd>
11319 <dt> <strong>OpenAL Soft</strong></dt>
11320 <dd><p>Portable, open source (LGPL) software implementation. Includes
11321 backends for the most common sound APIs on the Windows, Linux,
11322 Solaris, and BSD operating systems.
11323 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
11324 </p></dd>
11325 <dt> <strong>Apple</strong></dt>
11326 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
11327 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
11328 </p></dd>
11329 </dl>
11330
11331 <p>This device allows to capture from an audio input device handled
11332 through OpenAL.
11333 </p>
11334 <p>You need to specify the name of the device to capture in the provided
11335 filename. If the empty string is provided, the device will
11336 automatically select the default device. You can get the list of the
11337 supported devices by using the option <var>list_devices</var>.
11338 </p>
11339 <a name="Options-15"></a>
11340 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-15">26.10.1 Options</a></h3>
11341
11342 <dl compact="compact">
11343 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
11344 <dd><p>Set the number of channels in the captured audio. Only the values
11345 &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
11346 Defaults to &lsquo;<samp>2</samp>&rsquo;.
11347 </p>
11348 </dd>
11349 <dt> &lsquo;<samp>sample_size</samp>&rsquo;</dt>
11350 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
11351 &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
11352 &lsquo;<samp>16</samp>&rsquo;.
11353 </p>
11354 </dd>
11355 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
11356 <dd><p>Set the sample rate (in Hz) of the captured audio.
11357 Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
11358 </p>
11359 </dd>
11360 <dt> &lsquo;<samp>list_devices</samp>&rsquo;</dt>
11361 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
11362 Defaults to &lsquo;<samp>false</samp>&rsquo;.
11363 </p>
11364 </dd>
11365 </dl>
11366
11367 <a name="Examples-85"></a>
11368 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-85">26.10.2 Examples</a></h3>
11369
11370 <p>Print the list of OpenAL supported devices and exit:
11371 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
11372 </pre></td></tr></table>
11373
11374 <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
11375 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
11376 </pre></td></tr></table>
11377
11378 <p>Capture from the default device (note the empty string &rdquo; as filename):
11379 </p><table><tr><td>&nbsp;</td><td><pre class="example">$ ffmpeg -f openal -i '' out.ogg
11380 </pre></td></tr></table>
11381
11382 <p>Capture from two devices simultaneously, writing to two different files,
11383 within the same <code>ffmpeg</code> command:
11384 </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
11385 </pre></td></tr></table>
11386 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
11387 try the latest OpenAL Soft if the above does not work.
11388 </p>
11389 <a name="oss-1"></a>
11390 <h2 class="section"><a href="ffmpeg-all.html#toc-oss-1">26.11 oss</a></h2>
11391
11392 <p>Open Sound System input device.
11393 </p>
11394 <p>The filename to provide to the input device is the device node
11395 representing the OSS input device, and is usually set to
11396 &lsquo;<tt>/dev/dsp</tt>&rsquo;.
11397 </p>
11398 <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using <code>ffmpeg</code> use the
11399 command:
11400 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
11401 </pre></td></tr></table>
11402
11403 <p>For more information about OSS see:
11404 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
11405 </p>
11406 <a name="pulse"></a>
11407 <h2 class="section"><a href="ffmpeg-all.html#toc-pulse">26.12 pulse</a></h2>
11408
11409 <p>PulseAudio input device.
11410 </p>
11411 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
11412 </p>
11413 <p>The filename to provide to the input device is a source device or the
11414 string &quot;default&quot;
11415 </p>
11416 <p>To list the PulseAudio source devices and their properties you can invoke
11417 the command <code>pactl list sources</code>.
11418 </p>
11419 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
11420 </p>
11421 <a name="Options-1"></a>
11422 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-1">26.12.1 Options</a></h3>
11423 <dl compact="compact">
11424 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
11425 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
11426 Default server is used when not provided.
11427 </p>
11428 </dd>
11429 <dt> &lsquo;<samp>name</samp>&rsquo;</dt>
11430 <dd><p>Specify the application name PulseAudio will use when showing active clients,
11431 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
11432 </p>
11433 </dd>
11434 <dt> &lsquo;<samp>stream_name</samp>&rsquo;</dt>
11435 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
11436 by default it is &quot;record&quot;.
11437 </p>
11438 </dd>
11439 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
11440 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
11441 </p>
11442 </dd>
11443 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
11444 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
11445 </p>
11446 </dd>
11447 <dt> &lsquo;<samp>frame_size</samp>&rsquo;</dt>
11448 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
11449 </p>
11450 </dd>
11451 <dt> &lsquo;<samp>fragment_size</samp>&rsquo;</dt>
11452 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
11453 audio latency. By default it is unset.
11454 </p></dd>
11455 </dl>
11456
11457 <a name="Examples-52"></a>
11458 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-52">26.12.2 Examples</a></h3>
11459 <p>Record a stream from default device:
11460 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
11461 </pre></td></tr></table>
11462
11463 <a name="sndio-1"></a>
11464 <h2 class="section"><a href="ffmpeg-all.html#toc-sndio-1">26.13 sndio</a></h2>
11465
11466 <p>sndio input device.
11467 </p>
11468 <p>To enable this input device during configuration you need libsndio
11469 installed on your system.
11470 </p>
11471 <p>The filename to provide to the input device is the device node
11472 representing the sndio input device, and is usually set to
11473 &lsquo;<tt>/dev/audio0</tt>&rsquo;.
11474 </p>
11475 <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using <code>ffmpeg</code> use the
11476 command:
11477 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
11478 </pre></td></tr></table>
11479
11480 <a name="video4linux2_002c-v4l2"></a>
11481 <h2 class="section"><a href="ffmpeg-all.html#toc-video4linux2_002c-v4l2">26.14 video4linux2, v4l2</a></h2>
11482
11483 <p>Video4Linux2 input video device.
11484 </p>
11485 <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
11486 </p>
11487 <p>If FFmpeg is built with v4l-utils support (by using the
11488 <code>--enable-libv4l2</code> configure option), it is possible to use it with the
11489 <code>-use_libv4l2</code> input device option.
11490 </p>
11491 <p>The name of the device to grab is a file device node, usually Linux
11492 systems tend to automatically create such nodes when the device
11493 (e.g. an USB webcam) is plugged into the system, and has a name of the
11494 kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
11495 the device.
11496 </p>
11497 <p>Video4Linux2 devices usually support a limited set of
11498 <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
11499 supported using <code>-list_formats all</code> for Video4Linux2 devices.
11500 Some devices, like TV cards, support one or more standards. It is possible
11501 to list all the supported standards using <code>-list_standards all</code>.
11502 </p>
11503 <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
11504 version and configuration, the timestamps may be derived from the real time
11505 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
11506 boot time, unaffected by NTP or manual changes to the clock). The
11507 &lsquo;<samp>-timestamps abs</samp>&rsquo; or &lsquo;<samp>-ts abs</samp>&rsquo; option can be used to force
11508 conversion into the real time clock.
11509 </p>
11510 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
11511 and <code>ffplay</code>:
11512 </p><ul>
11513 <li>
11514 Grab and show the input of a video4linux2 device:
11515 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
11516 </pre></td></tr></table>
11517
11518 </li><li>
11519 Grab and record the input of a video4linux2 device, leave the
11520 frame rate and size as previously set:
11521 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
11522 </pre></td></tr></table>
11523 </li></ul>
11524
11525 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
11526 </p>
11527 <a name="Options-24"></a>
11528 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-24">26.14.1 Options</a></h3>
11529
11530 <dl compact="compact">
11531 <dt> &lsquo;<samp>standard</samp>&rsquo;</dt>
11532 <dd><p>Set the standard. Must be the name of a supported standard. To get a
11533 list of the supported standards, use the &lsquo;<samp>list_standards</samp>&rsquo;
11534 option.
11535 </p>
11536 </dd>
11537 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
11538 <dd><p>Set the input channel number. Default to -1, which means using the
11539 previously selected channel.
11540 </p>
11541 </dd>
11542 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
11543 <dd><p>Set the video frame size. The argument must be a string in the form
11544 <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
11545 </p>
11546 </dd>
11547 <dt> &lsquo;<samp>pixel_format</samp>&rsquo;</dt>
11548 <dd><p>Select the pixel format (only valid for raw video input).
11549 </p>
11550 </dd>
11551 <dt> &lsquo;<samp>input_format</samp>&rsquo;</dt>
11552 <dd><p>Set the preferred pixel format (for raw video) or a codec name.
11553 This option allows to select the input format, when several are
11554 available.
11555 </p>
11556 </dd>
11557 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
11558 <dd><p>Set the preferred video frame rate.
11559 </p>
11560 </dd>
11561 <dt> &lsquo;<samp>list_formats</samp>&rsquo;</dt>
11562 <dd><p>List available formats (supported pixel formats, codecs, and frame
11563 sizes) and exit.
11564 </p>
11565 <p>Available values are:
11566 </p><dl compact="compact">
11567 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
11568 <dd><p>Show all available (compressed and non-compressed) formats.
11569 </p>
11570 </dd>
11571 <dt> &lsquo;<samp>raw</samp>&rsquo;</dt>
11572 <dd><p>Show only raw video (non-compressed) formats.
11573 </p>
11574 </dd>
11575 <dt> &lsquo;<samp>compressed</samp>&rsquo;</dt>
11576 <dd><p>Show only compressed formats.
11577 </p></dd>
11578 </dl>
11579
11580 </dd>
11581 <dt> &lsquo;<samp>list_standards</samp>&rsquo;</dt>
11582 <dd><p>List supported standards and exit.
11583 </p>
11584 <p>Available values are:
11585 </p><dl compact="compact">
11586 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
11587 <dd><p>Show all supported standards.
11588 </p></dd>
11589 </dl>
11590
11591 </dd>
11592 <dt> &lsquo;<samp>timestamps, ts</samp>&rsquo;</dt>
11593 <dd><p>Set type of timestamps for grabbed frames.
11594 </p>
11595 <p>Available values are:
11596 </p><dl compact="compact">
11597 <dt> &lsquo;<samp>default</samp>&rsquo;</dt>
11598 <dd><p>Use timestamps from the kernel.
11599 </p>
11600 </dd>
11601 <dt> &lsquo;<samp>abs</samp>&rsquo;</dt>
11602 <dd><p>Use absolute timestamps (wall clock).
11603 </p>
11604 </dd>
11605 <dt> &lsquo;<samp>mono2abs</samp>&rsquo;</dt>
11606 <dd><p>Force conversion from monotonic to absolute timestamps.
11607 </p></dd>
11608 </dl>
11609
11610 <p>Default value is <code>default</code>.
11611 </p></dd>
11612 </dl>
11613
11614 <a name="vfwcap"></a>
11615 <h2 class="section"><a href="ffmpeg-all.html#toc-vfwcap">26.15 vfwcap</a></h2>
11616
11617 <p>VfW (Video for Windows) capture input device.
11618 </p>
11619 <p>The filename passed as input is the capture driver number, ranging from
11620 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
11621 other filename will be interpreted as device number 0.
11622 </p>
11623 <a name="x11grab"></a>
11624 <h2 class="section"><a href="ffmpeg-all.html#toc-x11grab">26.16 x11grab</a></h2>
11625
11626 <p>X11 video input device.
11627 </p>
11628 <p>This device allows to capture a region of an X11 display.
11629 </p>
11630 <p>The filename passed as input has the syntax:
11631 </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>]
11632 </pre></td></tr></table>
11633
11634 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
11635 X11 display name of the screen to grab from. <var>hostname</var> can be
11636 omitted, and defaults to &quot;localhost&quot;. The environment variable
11637 <code>DISPLAY</code> contains the default display name.
11638 </p>
11639 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
11640 area with respect to the top-left border of the X11 screen. They
11641 default to 0.
11642 </p>
11643 <p>Check the X11 documentation (e.g. man X) for more detailed information.
11644 </p>
11645 <p>Use the <code>dpyinfo</code> program for getting basic information about the
11646 properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
11647 </p>
11648 <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using <code>ffmpeg</code>:
11649 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
11650 </pre></td></tr></table>
11651
11652 <p>Grab at position <code>10,20</code>:
11653 </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
11654 </pre></td></tr></table>
11655
11656 <a name="Options-20"></a>
11657 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-20">26.16.1 Options</a></h3>
11658
11659 <dl compact="compact">
11660 <dt> &lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
11661 <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specify
11662 not to draw the pointer. Default value is <code>1</code>.
11663 </p>
11664 </dd>
11665 <dt> &lsquo;<samp>follow_mouse</samp>&rsquo;</dt>
11666 <dd><p>Make the grabbed area follow the mouse. The argument can be
11667 <code>centered</code> or a number of pixels <var>PIXELS</var>.
11668 </p>
11669 <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
11670 pointer and keeps the pointer at the center of region; otherwise, the region
11671 follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
11672 zero) to the edge of region.
11673 </p>
11674 <p>For example:
11675 </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
11676 </pre></td></tr></table>
11677
11678 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
11679 </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
11680 </pre></td></tr></table>
11681
11682 </dd>
11683 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
11684 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
11685 corresponding to a frame rate of <code>30000/1001</code>.
11686 </p>
11687 </dd>
11688 <dt> &lsquo;<samp>show_region</samp>&rsquo;</dt>
11689 <dd><p>Show grabbed region on screen.
11690 </p>
11691 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
11692 region will be indicated on screen. With this option, it is easy to
11693 know what is being grabbed if only a portion of the screen is grabbed.
11694 </p>
11695 <p>For example:
11696 </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
11697 </pre></td></tr></table>
11698
11699 <p>With <var>follow_mouse</var>:
11700 </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
11701 </pre></td></tr></table>
11702
11703 </dd>
11704 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
11705 <dd><p>Set the video frame size. Default value is <code>vga</code>.
11706 </p></dd>
11707 </dl>
11708
11709 <a name="Output-Devices"></a>
11710 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Output-Devices">27. Output Devices</a></h1>
11711
11712 <p>Output devices are configured elements in FFmpeg that can write
11713 multimedia data to an output device attached to your system.
11714 </p>
11715 <p>When you configure your FFmpeg build, all the supported output devices
11716 are enabled by default. You can list all available ones using the
11717 configure option &quot;&ndash;list-outdevs&quot;.
11718 </p>
11719 <p>You can disable all the output devices using the configure option
11720 &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
11721 option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
11722 input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
11723 </p>
11724 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
11725 enabled output devices (amongst the muxers).
11726 </p>
11727 <p>A description of the currently available output devices follows.
11728 </p>
11729 <a name="alsa-1"></a>
11730 <h2 class="section"><a href="ffmpeg-all.html#toc-alsa-1">27.1 alsa</a></h2>
11731
11732 <p>ALSA (Advanced Linux Sound Architecture) output device.
11733 </p>
11734 <a name="Examples-61"></a>
11735 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-61">27.1.1 Examples</a></h3>
11736
11737 <ul>
11738 <li>
11739 Play a file on default ALSA device:
11740 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f alsa default
11741 </pre></td></tr></table>
11742
11743 </li><li>
11744 Play a file on soundcard 1, audio device 7:
11745 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
11746 </pre></td></tr></table>
11747 </li></ul>
11748
11749 <a name="caca"></a>
11750 <h2 class="section"><a href="ffmpeg-all.html#toc-caca">27.2 caca</a></h2>
11751
11752 <p>CACA output device.
11753 </p>
11754 <p>This output device allows to show a video stream in CACA window.
11755 Only one CACA window is allowed per application, so you can
11756 have only one instance of this output device in an application.
11757 </p>
11758 <p>To enable this output device you need to configure FFmpeg with
11759 <code>--enable-libcaca</code>.
11760 libcaca is a graphics library that outputs text instead of pixels.
11761 </p>
11762 <p>For more information about libcaca, check:
11763 <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
11764 </p>
11765 <a name="Options-17"></a>
11766 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-17">27.2.1 Options</a></h3>
11767
11768 <dl compact="compact">
11769 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
11770 <dd><p>Set the CACA window title, if not specified default to the filename
11771 specified for the output device.
11772 </p>
11773 </dd>
11774 <dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
11775 <dd><p>Set the CACA window size, can be a string of the form
11776 <var>width</var>x<var>height</var> or a video size abbreviation.
11777 If not specified it defaults to the size of the input video.
11778 </p>
11779 </dd>
11780 <dt> &lsquo;<samp>driver</samp>&rsquo;</dt>
11781 <dd><p>Set display driver.
11782 </p>
11783 </dd>
11784 <dt> &lsquo;<samp>algorithm</samp>&rsquo;</dt>
11785 <dd><p>Set dithering algorithm. Dithering is necessary
11786 because the picture being rendered has usually far more colours than
11787 the available palette.
11788 The accepted values are listed with <code>-list_dither algorithms</code>.
11789 </p>
11790 </dd>
11791 <dt> &lsquo;<samp>antialias</samp>&rsquo;</dt>
11792 <dd><p>Set antialias method. Antialiasing smoothens the rendered
11793 image and avoids the commonly seen staircase effect.
11794 The accepted values are listed with <code>-list_dither antialiases</code>.
11795 </p>
11796 </dd>
11797 <dt> &lsquo;<samp>charset</samp>&rsquo;</dt>
11798 <dd><p>Set which characters are going to be used when rendering text.
11799 The accepted values are listed with <code>-list_dither charsets</code>.
11800 </p>
11801 </dd>
11802 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
11803 <dd><p>Set color to be used when rendering text.
11804 The accepted values are listed with <code>-list_dither colors</code>.
11805 </p>
11806 </dd>
11807 <dt> &lsquo;<samp>list_drivers</samp>&rsquo;</dt>
11808 <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of available drivers and exit.
11809 </p>
11810 </dd>
11811 <dt> &lsquo;<samp>list_dither</samp>&rsquo;</dt>
11812 <dd><p>List available dither options related to the argument.
11813 The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
11814 <code>charsets</code>, <code>colors</code>.
11815 </p></dd>
11816 </dl>
11817
11818 <a name="Examples-43"></a>
11819 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-43">27.2.2 Examples</a></h3>
11820
11821 <ul>
11822 <li>
11823 The following command shows the <code>ffmpeg</code> output is an
11824 CACA window, forcing its size to 80x25:
11825 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
11826 </pre></td></tr></table>
11827
11828 </li><li>
11829 Show the list of available drivers and exit:
11830 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
11831 </pre></td></tr></table>
11832
11833 </li><li>
11834 Show the list of available dither colors and exit:
11835 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
11836 </pre></td></tr></table>
11837 </li></ul>
11838
11839 <a name="fbdev-1"></a>
11840 <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev-1">27.3 fbdev</a></h2>
11841
11842 <p>Linux framebuffer output device.
11843 </p>
11844 <p>The Linux framebuffer is a graphic hardware-independent abstraction
11845 layer to show graphics on a computer monitor, typically on the
11846 console. It is accessed through a file device node, usually
11847 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
11848 </p>
11849 <p>For more detailed information read the file
11850 &lsquo;<tt>Documentation/fb/framebuffer.txt</tt>&rsquo; included in the Linux source tree.
11851 </p>
11852 <a name="Options-29"></a>
11853 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-29">27.3.1 Options</a></h3>
11854 <dl compact="compact">
11855 <dt> &lsquo;<samp>xoffset</samp>&rsquo;</dt>
11856 <dt> &lsquo;<samp>yoffset</samp>&rsquo;</dt>
11857 <dd><p>Set x/y coordinate of top left corner. Default is 0.
11858 </p></dd>
11859 </dl>
11860
11861 <a name="Examples-5"></a>
11862 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-5">27.3.2 Examples</a></h3>
11863 <p>Play a file on framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo;.
11864 Required pixel format depends on current framebuffer settings.
11865 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
11866 </pre></td></tr></table>
11867
11868 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
11869 </p>
11870 <a name="oss"></a>
11871 <h2 class="section"><a href="ffmpeg-all.html#toc-oss">27.4 oss</a></h2>
11872
11873 <p>OSS (Open Sound System) output device.
11874 </p>
11875 <a name="pulse-1"></a>
11876 <h2 class="section"><a href="ffmpeg-all.html#toc-pulse-1">27.5 pulse</a></h2>
11877
11878 <p>PulseAudio output device.
11879 </p>
11880 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
11881 </p>
11882 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
11883 </p>
11884 <a name="Options-3"></a>
11885 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-3">27.5.1 Options</a></h3>
11886 <dl compact="compact">
11887 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
11888 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
11889 Default server is used when not provided.
11890 </p>
11891 </dd>
11892 <dt> &lsquo;<samp>name</samp>&rsquo;</dt>
11893 <dd><p>Specify the application name PulseAudio will use when showing active clients,
11894 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
11895 </p>
11896 </dd>
11897 <dt> &lsquo;<samp>stream_name</samp>&rsquo;</dt>
11898 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
11899 by default it is set to the specified output name.
11900 </p>
11901 </dd>
11902 <dt> &lsquo;<samp>device</samp>&rsquo;</dt>
11903 <dd><p>Specify the device to use. Default device is used when not provided.
11904 List of output devices can be obtained with command <code>pactl list sinks</code>.
11905 </p>
11906 </dd>
11907 <dt> &lsquo;<samp>buffer_size</samp>&rsquo;</dt>
11908 <dt> &lsquo;<samp>buffer_duration</samp>&rsquo;</dt>
11909 <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
11910 gives more control, but requires more frequent updates.
11911 </p>
11912 <p>&lsquo;<samp>buffer_size</samp>&rsquo; specifies size in bytes while
11913 &lsquo;<samp>buffer_duration</samp>&rsquo; specifies duration in milliseconds.
11914 </p>
11915 <p>When both options are provided then the highest value is used
11916 (duration is recalculated to bytes using stream parameters). If they
11917 are set to 0 (which is default), the device will use the default
11918 PulseAudio duration value. By default PulseAudio set buffer duration
11919 to around 2 seconds.
11920 </p></dd>
11921 </dl>
11922
11923 <a name="Examples-74"></a>
11924 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-74">27.5.2 Examples</a></h3>
11925 <p>Play a file on default device on default server:
11926 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg  -i INPUT -f pulse &quot;stream name&quot;
11927 </pre></td></tr></table>
11928
11929 <a name="sdl"></a>
11930 <h2 class="section"><a href="ffmpeg-all.html#toc-sdl">27.6 sdl</a></h2>
11931
11932 <p>SDL (Simple DirectMedia Layer) output device.
11933 </p>
11934 <p>This output device allows to show a video stream in an SDL
11935 window. Only one SDL window is allowed per application, so you can
11936 have only one instance of this output device in an application.
11937 </p>
11938 <p>To enable this output device you need libsdl installed on your system
11939 when configuring your build.
11940 </p>
11941 <p>For more information about SDL, check:
11942 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
11943 </p>
11944 <a name="Options-25"></a>
11945 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-25">27.6.1 Options</a></h3>
11946
11947 <dl compact="compact">
11948 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
11949 <dd><p>Set the SDL window title, if not specified default to the filename
11950 specified for the output device.
11951 </p>
11952 </dd>
11953 <dt> &lsquo;<samp>icon_title</samp>&rsquo;</dt>
11954 <dd><p>Set the name of the iconified SDL window, if not specified it is set
11955 to the same value of <var>window_title</var>.
11956 </p>
11957 </dd>
11958 <dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
11959 <dd><p>Set the SDL window size, can be a string of the form
11960 <var>width</var>x<var>height</var> or a video size abbreviation.
11961 If not specified it defaults to the size of the input video,
11962 downscaled according to the aspect ratio.
11963 </p>
11964 </dd>
11965 <dt> &lsquo;<samp>window_fullscreen</samp>&rsquo;</dt>
11966 <dd><p>Set fullscreen mode when non-zero value is provided.
11967 Default value is zero.
11968 </p></dd>
11969 </dl>
11970
11971 <a name="Interactive-commands"></a>
11972 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Interactive-commands">27.6.2 Interactive commands</a></h3>
11973
11974 <p>The window created by the device can be controlled through the
11975 following interactive commands.
11976 </p>
11977 <dl compact="compact">
11978 <dt> &lt;q, ESC&gt;</dt>
11979 <dd><p>Quit the device immediately.
11980 </p></dd>
11981 </dl>
11982
11983 <a name="Examples-84"></a>
11984 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-84">27.6.3 Examples</a></h3>
11985
11986 <p>The following command shows the <code>ffmpeg</code> output is an
11987 SDL window, forcing its size to the qcif format:
11988 </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;
11989 </pre></td></tr></table>
11990
11991 <a name="sndio"></a>
11992 <h2 class="section"><a href="ffmpeg-all.html#toc-sndio">27.7 sndio</a></h2>
11993
11994 <p>sndio audio output device.
11995 </p>
11996 <a name="xv"></a>
11997 <h2 class="section"><a href="ffmpeg-all.html#toc-xv">27.8 xv</a></h2>
11998
11999 <p>XV (XVideo) output device.
12000 </p>
12001 <p>This output device allows to show a video stream in a X Window System
12002 window.
12003 </p>
12004 <a name="Options-2"></a>
12005 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-2">27.8.1 Options</a></h3>
12006
12007 <dl compact="compact">
12008 <dt> &lsquo;<samp>display_name</samp>&rsquo;</dt>
12009 <dd><p>Specify the hardware display name, which determines the display and
12010 communications domain to be used.
12011 </p>
12012 <p>The display name or DISPLAY environment variable can be a string in
12013 the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
12014 </p>
12015 <p><var>hostname</var> specifies the name of the host machine on which the
12016 display is physically attached. <var>number</var> specifies the number of
12017 the display server on that host machine. <var>screen_number</var> specifies
12018 the screen to be used on that server.
12019 </p>
12020 <p>If unspecified, it defaults to the value of the DISPLAY environment
12021 variable.
12022 </p>
12023 <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
12024 0 on the machine named &ldquo;dual-headed&rdquo;.
12025 </p>
12026 <p>Check the X11 specification for more detailed information about the
12027 display name format.
12028 </p>
12029 </dd>
12030 <dt> &lsquo;<samp>window_size</samp>&rsquo;</dt>
12031 <dd><p>Set the created window size, can be a string of the form
12032 <var>width</var>x<var>height</var> or a video size abbreviation. If not
12033 specified it defaults to the size of the input video.
12034 </p>
12035 </dd>
12036 <dt> &lsquo;<samp>window_x</samp>&rsquo;</dt>
12037 <dt> &lsquo;<samp>window_y</samp>&rsquo;</dt>
12038 <dd><p>Set the X and Y window offsets for the created window. They are both
12039 set to 0 by default. The values may be ignored by the window manager.
12040 </p>
12041 </dd>
12042 <dt> &lsquo;<samp>window_title</samp>&rsquo;</dt>
12043 <dd><p>Set the window title, if not specified default to the filename
12044 specified for the output device.
12045 </p></dd>
12046 </dl>
12047
12048 <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
12049 </p>
12050 <a name="Examples-20"></a>
12051 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-20">27.8.2 Examples</a></h3>
12052
12053 <ul>
12054 <li>
12055 Decode, display and encode video input with <code>ffmpeg</code> at the
12056 same time:
12057 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
12058 </pre></td></tr></table>
12059
12060 </li><li>
12061 Decode and display the input video to multiple X11 windows:
12062 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
12063 </pre></td></tr></table>
12064 </li></ul>
12065
12066 <a name="Resampler-Options"></a>
12067 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Resampler-Options">28. Resampler Options</a></h1>
12068
12069 <p>The audio resampler supports the following named options.
12070 </p>
12071 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
12072 FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
12073 by setting the value explicitly in the
12074 <code>SwrContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
12075 programmatic use.
12076 </p>
12077 <dl compact="compact">
12078 <dt> &lsquo;<samp>ich, in_channel_count</samp>&rsquo;</dt>
12079 <dd><p>Set the number of input channels. Default value is 0. Setting this
12080 value is not mandatory if the corresponding channel layout
12081 &lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
12082 </p>
12083 </dd>
12084 <dt> &lsquo;<samp>och, out_channel_count</samp>&rsquo;</dt>
12085 <dd><p>Set the number of output channels. Default value is 0. Setting this
12086 value is not mandatory if the corresponding channel layout
12087 &lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
12088 </p>
12089 </dd>
12090 <dt> &lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
12091 <dd><p>Set the number of used input channels. Default value is 0. This option is
12092 only used for special remapping.
12093 </p>
12094 </dd>
12095 <dt> &lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
12096 <dd><p>Set the input sample rate. Default value is 0.
12097 </p>
12098 </dd>
12099 <dt> &lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
12100 <dd><p>Set the output sample rate. Default value is 0.
12101 </p>
12102 </dd>
12103 <dt> &lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
12104 <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
12105 </p>
12106 </dd>
12107 <dt> &lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
12108 <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
12109 </p>
12110 </dd>
12111 <dt> &lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</dt>
12112 <dd><p>Set the internal sample format. Default value is <code>none</code>.
12113 This will automatically be chosen when it is not explicitly set.
12114 </p>
12115 </dd>
12116 <dt> &lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
12117 <dt> &lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
12118 <dd><p>Set the input/output channel layout.
12119 </p>
12120 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
12121 for the required syntax.
12122 </p>
12123 </dd>
12124 <dt> &lsquo;<samp>clev, center_mix_level</samp>&rsquo;</dt>
12125 <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
12126 in the interval [-32,32].
12127 </p>
12128 </dd>
12129 <dt> &lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</dt>
12130 <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
12131 be in the interval [-32,32].
12132 </p>
12133 </dd>
12134 <dt> &lsquo;<samp>lfe_mix_level</samp>&rsquo;</dt>
12135 <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
12136 LFE output. It is a value expressed in deciBel, and must
12137 be in the interval [-32,32].
12138 </p>
12139 </dd>
12140 <dt> &lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
12141 <dd><p>Set rematrix volume. Default value is 1.0.
12142 </p>
12143 </dd>
12144 <dt> &lsquo;<samp>rematrix_maxval</samp>&rsquo;</dt>
12145 <dd><p>Set maximum output value for rematrixing.
12146 This can be used to prevent clipping vs. preventing volumn reduction
12147 A value of 1.0 prevents cliping.
12148 </p>
12149 </dd>
12150 <dt> &lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
12151 <dd><p>Set flags used by the converter. Default value is 0.
12152 </p>
12153 <p>It supports the following individual flags:
12154 </p><dl compact="compact">
12155 <dt> &lsquo;<samp>res</samp>&rsquo;</dt>
12156 <dd><p>force resampling, this flag forces resampling to be used even when the
12157 input and output sample rates match.
12158 </p></dd>
12159 </dl>
12160
12161 </dd>
12162 <dt> &lsquo;<samp>dither_scale</samp>&rsquo;</dt>
12163 <dd><p>Set the dither scale. Default value is 1.
12164 </p>
12165 </dd>
12166 <dt> &lsquo;<samp>dither_method</samp>&rsquo;</dt>
12167 <dd><p>Set dither method. Default value is 0.
12168 </p>
12169 <p>Supported values:
12170 </p><dl compact="compact">
12171 <dt> &lsquo;<samp>rectangular</samp>&rsquo;</dt>
12172 <dd><p>select rectangular dither
12173 </p></dd>
12174 <dt> &lsquo;<samp>triangular</samp>&rsquo;</dt>
12175 <dd><p>select triangular dither
12176 </p></dd>
12177 <dt> &lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
12178 <dd><p>select triangular dither with high pass
12179 </p></dd>
12180 <dt> &lsquo;<samp>lipshitz</samp>&rsquo;</dt>
12181 <dd><p>select lipshitz noise shaping dither
12182 </p></dd>
12183 <dt> &lsquo;<samp>shibata</samp>&rsquo;</dt>
12184 <dd><p>select shibata noise shaping dither
12185 </p></dd>
12186 <dt> &lsquo;<samp>low_shibata</samp>&rsquo;</dt>
12187 <dd><p>select low shibata noise shaping dither
12188 </p></dd>
12189 <dt> &lsquo;<samp>high_shibata</samp>&rsquo;</dt>
12190 <dd><p>select high shibata noise shaping dither
12191 </p></dd>
12192 <dt> &lsquo;<samp>f_weighted</samp>&rsquo;</dt>
12193 <dd><p>select f-weighted noise shaping dither
12194 </p></dd>
12195 <dt> &lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
12196 <dd><p>select modified-e-weighted noise shaping dither
12197 </p></dd>
12198 <dt> &lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
12199 <dd><p>select improved-e-weighted noise shaping dither
12200 </p>
12201 </dd>
12202 </dl>
12203
12204 </dd>
12205 <dt> &lsquo;<samp>resampler</samp>&rsquo;</dt>
12206 <dd><p>Set resampling engine. Default value is swr.
12207 </p>
12208 <p>Supported values:
12209 </p><dl compact="compact">
12210 <dt> &lsquo;<samp>swr</samp>&rsquo;</dt>
12211 <dd><p>select the native SW Resampler; filter options precision and cheby are not
12212 applicable in this case.
12213 </p></dd>
12214 <dt> &lsquo;<samp>soxr</samp>&rsquo;</dt>
12215 <dd><p>select the SoX Resampler (where available); compensation, and filter options
12216 filter_size, phase_shift, filter_type &amp; kaiser_beta, are not applicable in this
12217 case.
12218 </p></dd>
12219 </dl>
12220
12221 </dd>
12222 <dt> &lsquo;<samp>filter_size</samp>&rsquo;</dt>
12223 <dd><p>For swr only, set resampling filter size, default value is 32.
12224 </p>
12225 </dd>
12226 <dt> &lsquo;<samp>phase_shift</samp>&rsquo;</dt>
12227 <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
12228 the interval [0,30].
12229 </p>
12230 </dd>
12231 <dt> &lsquo;<samp>linear_interp</samp>&rsquo;</dt>
12232 <dd><p>Use Linear Interpolation if set to 1, default value is 0.
12233 </p>
12234 </dd>
12235 <dt> &lsquo;<samp>cutoff</samp>&rsquo;</dt>
12236 <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
12237 value between 0 and 1.  Default value is 0.97 with swr, and 0.91 with soxr
12238 (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
12239 </p>
12240 </dd>
12241 <dt> &lsquo;<samp>precision</samp>&rsquo;</dt>
12242 <dd><p>For soxr only, the precision in bits to which the resampled signal will be
12243 calculated.  The default value of 20 (which, with suitable dithering, is
12244 appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
12245 value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
12246 </p>
12247 </dd>
12248 <dt> &lsquo;<samp>cheby</samp>&rsquo;</dt>
12249 <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
12250 approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
12251 </p>
12252 </dd>
12253 <dt> &lsquo;<samp>async</samp>&rsquo;</dt>
12254 <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
12255 squeezing, filling and trimming. Setting this to 1 will enable filling and
12256 trimming, larger values represent the maximum amount in samples that the data
12257 may be stretched or squeezed for each second.
12258 Default value is 0, thus no compensation is applied to make the samples match
12259 the audio timestamps.
12260 </p>
12261 </dd>
12262 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</dt>
12263 <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
12264 This allows for padding/trimming at the start of stream. By default, no
12265 assumption is made about the first frame&rsquo;s expected pts, so no padding or
12266 trimming is done. For example, this could be set to 0 to pad the beginning with
12267 silence if an audio stream starts after the video stream or to trim any samples
12268 with a negative pts due to encoder delay.
12269 </p>
12270 </dd>
12271 <dt> &lsquo;<samp>min_comp</samp>&rsquo;</dt>
12272 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
12273 seconds) to trigger stretching/squeezing/filling or trimming of the
12274 data to make it match the timestamps. The default is that
12275 stretching/squeezing/filling and trimming is disabled
12276 (&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
12277 </p>
12278 </dd>
12279 <dt> &lsquo;<samp>min_hard_comp</samp>&rsquo;</dt>
12280 <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
12281 seconds) to trigger adding/dropping samples to make it match the
12282 timestamps.  This option effectively is a threshold to select between
12283 hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
12284 all compensation is by default disabled through &lsquo;<samp>min_comp</samp>&rsquo;.
12285 The default is 0.1.
12286 </p>
12287 </dd>
12288 <dt> &lsquo;<samp>comp_duration</samp>&rsquo;</dt>
12289 <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
12290 to make it match the timestamps. Must be a non-negative double float value,
12291 default value is 1.0.
12292 </p>
12293 </dd>
12294 <dt> &lsquo;<samp>max_soft_comp</samp>&rsquo;</dt>
12295 <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
12296 match the timestamps. Must be a non-negative double float value, default value
12297 is 0.
12298 </p>
12299 </dd>
12300 <dt> &lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
12301 <dd><p>Select matrixed stereo encoding.
12302 </p>
12303 <p>It accepts the following values:
12304 </p><dl compact="compact">
12305 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
12306 <dd><p>select none
12307 </p></dd>
12308 <dt> &lsquo;<samp>dolby</samp>&rsquo;</dt>
12309 <dd><p>select Dolby
12310 </p></dd>
12311 <dt> &lsquo;<samp>dplii</samp>&rsquo;</dt>
12312 <dd><p>select Dolby Pro Logic II
12313 </p></dd>
12314 </dl>
12315
12316 <p>Default value is <code>none</code>.
12317 </p>
12318 </dd>
12319 <dt> &lsquo;<samp>filter_type</samp>&rsquo;</dt>
12320 <dd><p>For swr only, select resampling filter type. This only affects resampling
12321 operations.
12322 </p>
12323 <p>It accepts the following values:
12324 </p><dl compact="compact">
12325 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
12326 <dd><p>select cubic
12327 </p></dd>
12328 <dt> &lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
12329 <dd><p>select Blackman Nuttall Windowed Sinc
12330 </p></dd>
12331 <dt> &lsquo;<samp>kaiser</samp>&rsquo;</dt>
12332 <dd><p>select Kaiser Windowed Sinc
12333 </p></dd>
12334 </dl>
12335
12336 </dd>
12337 <dt> &lsquo;<samp>kaiser_beta</samp>&rsquo;</dt>
12338 <dd><p>For swr only, set Kaiser Window Beta value. Must be an integer in the
12339 interval [2,16], default value is 9.
12340 </p>
12341 </dd>
12342 <dt> &lsquo;<samp>output_sample_bits</samp>&rsquo;</dt>
12343 <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
12344 interval [0,64], default value is 0, which means it&rsquo;s not used.
12345 </p>
12346 </dd>
12347 </dl>
12348
12349 <p><a name="scaler_005foptions"></a>
12350 </p><a name="Scaler-Options"></a>
12351 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Scaler-Options">29. Scaler Options</a></h1>
12352
12353 <p>The video scaler supports the following named options.
12354 </p>
12355 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
12356 FFmpeg tools. For programmatic use, they can be set explicitly in the
12357 <code>SwsContext</code> options or through the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
12358 </p>
12359 <dl compact="compact">
12360 <dd>
12361 <p><a name="sws_005fflags"></a>
12362 </p></dd>
12363 <dt> &lsquo;<samp>sws_flags</samp>&rsquo;</dt>
12364 <dd><p>Set the scaler flags. This is also used to set the scaling
12365 algorithm. Only a single algorithm should be selected.
12366 </p>
12367 <p>It accepts the following values:
12368 </p><dl compact="compact">
12369 <dt> &lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
12370 <dd><p>Select fast bilinear scaling algorithm.
12371 </p>
12372 </dd>
12373 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
12374 <dd><p>Select bilinear scaling algorithm.
12375 </p>
12376 </dd>
12377 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
12378 <dd><p>Select bicubic scaling algorithm.
12379 </p>
12380 </dd>
12381 <dt> &lsquo;<samp>experimental</samp>&rsquo;</dt>
12382 <dd><p>Select experimental scaling algorithm.
12383 </p>
12384 </dd>
12385 <dt> &lsquo;<samp>neighbor</samp>&rsquo;</dt>
12386 <dd><p>Select nearest neighbor rescaling algorithm.
12387 </p>
12388 </dd>
12389 <dt> &lsquo;<samp>area</samp>&rsquo;</dt>
12390 <dd><p>Select averaging area rescaling algorithm.
12391 </p>
12392 </dd>
12393 <dt> &lsquo;<samp>bicubiclin</samp>&rsquo;</dt>
12394 <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
12395 chroma components.
12396 </p>
12397 </dd>
12398 <dt> &lsquo;<samp>gauss</samp>&rsquo;</dt>
12399 <dd><p>Select Gaussian rescaling algorithm.
12400 </p>
12401 </dd>
12402 <dt> &lsquo;<samp>sinc</samp>&rsquo;</dt>
12403 <dd><p>Select sinc rescaling algorithm.
12404 </p>
12405 </dd>
12406 <dt> &lsquo;<samp>lanczos</samp>&rsquo;</dt>
12407 <dd><p>Select lanczos rescaling algorithm.
12408 </p>
12409 </dd>
12410 <dt> &lsquo;<samp>spline</samp>&rsquo;</dt>
12411 <dd><p>Select natural bicubic spline rescaling algorithm.
12412 </p>
12413 </dd>
12414 <dt> &lsquo;<samp>print_info</samp>&rsquo;</dt>
12415 <dd><p>Enable printing/debug logging.
12416 </p>
12417 </dd>
12418 <dt> &lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
12419 <dd><p>Enable accurate rounding.
12420 </p>
12421 </dd>
12422 <dt> &lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
12423 <dd><p>Enable full chroma interpolation.
12424 </p>
12425 </dd>
12426 <dt> &lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
12427 <dd><p>Select full chroma input.
12428 </p>
12429 </dd>
12430 <dt> &lsquo;<samp>bitexact</samp>&rsquo;</dt>
12431 <dd><p>Enable bitexact output.
12432 </p></dd>
12433 </dl>
12434
12435 </dd>
12436 <dt> &lsquo;<samp>srcw</samp>&rsquo;</dt>
12437 <dd><p>Set source width.
12438 </p>
12439 </dd>
12440 <dt> &lsquo;<samp>srch</samp>&rsquo;</dt>
12441 <dd><p>Set source height.
12442 </p>
12443 </dd>
12444 <dt> &lsquo;<samp>dstw</samp>&rsquo;</dt>
12445 <dd><p>Set destination width.
12446 </p>
12447 </dd>
12448 <dt> &lsquo;<samp>dsth</samp>&rsquo;</dt>
12449 <dd><p>Set destination height.
12450 </p>
12451 </dd>
12452 <dt> &lsquo;<samp>src_format</samp>&rsquo;</dt>
12453 <dd><p>Set source pixel format (must be expressed as an integer).
12454 </p>
12455 </dd>
12456 <dt> &lsquo;<samp>dst_format</samp>&rsquo;</dt>
12457 <dd><p>Set destination pixel format (must be expressed as an integer).
12458 </p>
12459 </dd>
12460 <dt> &lsquo;<samp>src_range</samp>&rsquo;</dt>
12461 <dd><p>Select source range.
12462 </p>
12463 </dd>
12464 <dt> &lsquo;<samp>dst_range</samp>&rsquo;</dt>
12465 <dd><p>Select destination range.
12466 </p>
12467 </dd>
12468 <dt> &lsquo;<samp>param0, param1</samp>&rsquo;</dt>
12469 <dd><p>Set scaling algorithm parameters. The specified values are specific of
12470 some scaling algorithms and ignored by others. The specified values
12471 are floating point number values.
12472 </p>
12473 </dd>
12474 <dt> &lsquo;<samp>sws_dither</samp>&rsquo;</dt>
12475 <dd><p>Set the dithering algorithm. Accepts one of the following
12476 values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
12477 </p>
12478 <dl compact="compact">
12479 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
12480 <dd><p>automatic choice
12481 </p>
12482 </dd>
12483 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
12484 <dd><p>no dithering
12485 </p>
12486 </dd>
12487 <dt> &lsquo;<samp>bayer</samp>&rsquo;</dt>
12488 <dd><p>bayer dither
12489 </p>
12490 </dd>
12491 <dt> &lsquo;<samp>ed</samp>&rsquo;</dt>
12492 <dd><p>error diffusion dither
12493 </p></dd>
12494 </dl>
12495
12496 </dd>
12497 </dl>
12498
12499 <a name="Filtering-Introduction"></a>
12500 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtering-Introduction">30. Filtering Introduction</a></h1>
12501
12502 <p>Filtering in FFmpeg is enabled through the libavfilter library.
12503 </p>
12504 <p>In libavfilter, a filter can have multiple inputs and multiple
12505 outputs.
12506 To illustrate the sorts of things that are possible, we consider the
12507 following filtergraph.
12508 </p>
12509 <table><tr><td>&nbsp;</td><td><pre class="example">                [main]
12510 input --&gt; split ---------------------&gt; overlay --&gt; output
12511             |                             ^
12512             |[tmp]                  [flip]|
12513             +-----&gt; crop --&gt; vflip -------+
12514 </pre></td></tr></table>
12515
12516 <p>This filtergraph splits the input stream in two streams, sends one
12517 stream through the crop filter and the vflip filter before merging it
12518 back with the other stream by overlaying it on top. You can use the
12519 following command to achieve this:
12520 </p>
12521 <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
12522 </pre></td></tr></table>
12523
12524 <p>The result will be that in output the top half of the video is mirrored
12525 onto the bottom half.
12526 </p>
12527 <p>Filters in the same linear chain are separated by commas, and distinct
12528 linear chains of filters are separated by semicolons. In our example,
12529 <var>crop,vflip</var> are in one linear chain, <var>split</var> and
12530 <var>overlay</var> are separately in another. The points where the linear
12531 chains join are labelled by names enclosed in square brackets. In the
12532 example, the split filter generates two outputs that are associated to
12533 the labels <var>[main]</var> and <var>[tmp]</var>.
12534 </p>
12535 <p>The stream sent to the second output of <var>split</var>, labelled as
12536 <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
12537 away the lower half part of the video, and then vertically flipped. The
12538 <var>overlay</var> filter takes in input the first unchanged output of the
12539 split filter (which was labelled as <var>[main]</var>), and overlay on its
12540 lower half the output generated by the <var>crop,vflip</var> filterchain.
12541 </p>
12542 <p>Some filters take in input a list of parameters: they are specified
12543 after the filter name and an equal sign, and are separated from each other
12544 by a colon.
12545 </p>
12546 <p>There exist so-called <var>source filters</var> that do not have an
12547 audio/video input, and <var>sink filters</var> that will not have audio/video
12548 output.
12549 </p>
12550
12551 <a name="graph2dot"></a>
12552 <h1 class="chapter"><a href="ffmpeg-all.html#toc-graph2dot">31. graph2dot</a></h1>
12553
12554 <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
12555 directory can be used to parse a filtergraph description and issue a
12556 corresponding textual representation in the dot language.
12557 </p>
12558 <p>Invoke the command:
12559 </p><table><tr><td>&nbsp;</td><td><pre class="example">graph2dot -h
12560 </pre></td></tr></table>
12561
12562 <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
12563 </p>
12564 <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
12565 the graphviz suite of programs) and obtain a graphical representation
12566 of the filtergraph.
12567 </p>
12568 <p>For example the sequence of commands:
12569 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
12570 tools/graph2dot -o graph.tmp &amp;&amp; \
12571 dot -Tpng graph.tmp -o graph.png &amp;&amp; \
12572 display graph.png
12573 </pre></td></tr></table>
12574
12575 <p>can be used to create and display an image representing the graph
12576 described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
12577 a complete self-contained graph, with its inputs and outputs explicitly defined.
12578 For example if your command line is of the form:
12579 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
12580 </pre></td></tr></table>
12581 <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
12582 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc,scale=640:360,nullsink
12583 </pre></td></tr></table>
12584 <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
12585 filter in order to simulate a specific input file.
12586 </p>
12587
12588 <a name="Filtergraph-description"></a>
12589 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtergraph-description">32. Filtergraph description</a></h1>
12590
12591 <p>A filtergraph is a directed graph of connected filters. It can contain
12592 cycles, and there can be multiple links between a pair of
12593 filters. Each link has one input pad on one side connecting it to one
12594 filter from which it takes its input, and one output pad on the other
12595 side connecting it to the one filter accepting its output.
12596 </p>
12597 <p>Each filter in a filtergraph is an instance of a filter class
12598 registered in the application, which defines the features and the
12599 number of input and output pads of the filter.
12600 </p>
12601 <p>A filter with no input pads is called a &quot;source&quot;, a filter with no
12602 output pads is called a &quot;sink&quot;.
12603 </p>
12604 <p><a name="Filtergraph-syntax"></a>
12605 </p><a name="Filtergraph-syntax-1"></a>
12606 <h2 class="section"><a href="ffmpeg-all.html#toc-Filtergraph-syntax-1">32.1 Filtergraph syntax</a></h2>
12607
12608 <p>A filtergraph can be represented using a textual representation, which is
12609 recognized by the &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-filter_complex</samp>&rsquo;
12610 options in <code>ffmpeg</code> and &lsquo;<samp>-vf</samp>&rsquo; in <code>ffplay</code>, and by the
12611 <code>avfilter_graph_parse()</code>/<code>avfilter_graph_parse2()</code> function defined in
12612 &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
12613 </p>
12614 <p>A filterchain consists of a sequence of connected filters, each one
12615 connected to the previous one in the sequence. A filterchain is
12616 represented by a list of &quot;,&quot;-separated filter descriptions.
12617 </p>
12618 <p>A filtergraph consists of a sequence of filterchains. A sequence of
12619 filterchains is represented by a list of &quot;;&quot;-separated filterchain
12620 descriptions.
12621 </p>
12622 <p>A filter is represented by a string of the form:
12623 [<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>]
12624 </p>
12625 <p><var>filter_name</var> is the name of the filter class of which the
12626 described filter is an instance of, and has to be the name of one of
12627 the filter classes registered in the program.
12628 The name of the filter class is optionally followed by a string
12629 &quot;=<var>arguments</var>&quot;.
12630 </p>
12631 <p><var>arguments</var> is a string which contains the parameters used to
12632 initialize the filter instance. It may have one of the following forms:
12633 </p><ul>
12634 <li>
12635 A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
12636
12637 </li><li>
12638 A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
12639 the option names in the order they are declared. E.g. the <code>fade</code> filter
12640 declares three options in this order &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
12641 &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
12642 <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
12643 &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
12644
12645 </li><li>
12646 A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
12647 pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
12648 follow the same constraints order of the previous point. The following
12649 <var>key=value</var> pairs can be set in any preferred order.
12650
12651 </li></ul>
12652
12653 <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
12654 takes a list of pixel formats), the items in the list are usually separated by
12655 &rsquo;|&rsquo;.
12656 </p>
12657 <p>The list of arguments can be quoted using the character &quot;&rsquo;&quot; as initial
12658 and ending mark, and the character &rsquo;\&rsquo; for escaping the characters
12659 within the quoted text; otherwise the argument string is considered
12660 terminated when the next special character (belonging to the set
12661 &quot;[]=;,&quot;) is encountered.
12662 </p>
12663 <p>The name and arguments of the filter are optionally preceded and
12664 followed by a list of link labels.
12665 A link label allows to name a link and associate it to a filter output
12666 or input pad. The preceding labels <var>in_link_1</var>
12667 ... <var>in_link_N</var>, are associated to the filter input pads,
12668 the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
12669 associated to the output pads.
12670 </p>
12671 <p>When two link labels with the same name are found in the
12672 filtergraph, a link between the corresponding input and output pad is
12673 created.
12674 </p>
12675 <p>If an output pad is not labelled, it is linked by default to the first
12676 unlabelled input pad of the next filter in the filterchain.
12677 For example in the filterchain:
12678 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
12679 </pre></td></tr></table>
12680 <p>the split filter instance has two output pads, and the overlay filter
12681 instance two input pads. The first output pad of split is labelled
12682 &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
12683 output pad of split is linked to the second input pad of overlay,
12684 which are both unlabelled.
12685 </p>
12686 <p>In a complete filterchain all the unlabelled filter input and output
12687 pads must be connected. A filtergraph is considered valid if all the
12688 filter input and output pads of all the filterchains are connected.
12689 </p>
12690 <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
12691 conversion is required. It is possible to specify swscale flags
12692 for those automatically inserted scalers by prepending
12693 <code>sws_flags=<var>flags</var>;</code>
12694 to the filtergraph description.
12695 </p>
12696 <p>Follows a BNF description for the filtergraph syntax:
12697 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>NAME</var>             ::= sequence of alphanumeric characters and '_'
12698 <var>LINKLABEL</var>        ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
12699 <var>LINKLABELS</var>       ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
12700 <var>FILTER_ARGUMENTS</var> ::= sequence of chars (eventually quoted)
12701 <var>FILTER</var>           ::= [<var>LINKLABELS</var>] <var>NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
12702 <var>FILTERCHAIN</var>      ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
12703 <var>FILTERGRAPH</var>      ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
12704 </pre></td></tr></table>
12705
12706 <a name="Notes-on-filtergraph-escaping"></a>
12707 <h2 class="section"><a href="ffmpeg-all.html#toc-Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></h2>
12708
12709 <p>Some filter arguments require the use of special characters, typically
12710 <code>:</code> to separate key=value pairs in a named options list. In this
12711 case the user should perform a first level escaping when specifying
12712 the filter arguments. For example, consider the following literal
12713 string to be embedded in the <a href="#drawtext">drawtext</a> filter arguments:
12714 </p><table><tr><td>&nbsp;</td><td><pre class="example">this is a 'string': may contain one, or more, special characters
12715 </pre></td></tr></table>
12716
12717 <p>Since <code>:</code> is special for the filter arguments syntax, it needs to
12718 be escaped, so you get:
12719 </p><table><tr><td>&nbsp;</td><td><pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
12720 </pre></td></tr></table>
12721
12722 <p>A second level of escaping is required when embedding the filter
12723 arguments in a filtergraph description, in order to escape all the
12724 filtergraph special characters. Thus the example above becomes:
12725 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
12726 </pre></td></tr></table>
12727
12728 <p>Finally an additional level of escaping may be needed when writing the
12729 filtergraph description in a shell command, which depends on the
12730 escaping rules of the adopted shell. For example, assuming that
12731 <code>\</code> is special and needs to be escaped with another <code>\</code>, the
12732 previous string will finally result in:
12733 </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;
12734 </pre></td></tr></table>
12735
12736 <p>Sometimes, it might be more convenient to employ quoting in place of
12737 escaping. For example the string:
12738 </p><table><tr><td>&nbsp;</td><td><pre class="example">Caesar: tu quoque, Brute, fili mi
12739 </pre></td></tr></table>
12740
12741 <p>Can be quoted in the filter arguments as:
12742 </p><table><tr><td>&nbsp;</td><td><pre class="example">text='Caesar: tu quoque, Brute, fili mi'
12743 </pre></td></tr></table>
12744
12745 <p>And finally inserted in a filtergraph like:
12746 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawtext=text=\'Caesar: tu quoque\, Brute\, fili mi\'
12747 </pre></td></tr></table>
12748
12749 <p>See the &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual
12750 for more information about the escaping and quoting rules adopted by
12751 FFmpeg.
12752 </p>
12753 <a name="Timeline-editing"></a>
12754 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Timeline-editing">33. Timeline editing</a></h1>
12755
12756 <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; option. For the filters
12757 supporting timeline editing, this option can be set to an expression which is
12758 evaluated before sending a frame to the filter. If the evaluation is non-zero,
12759 the filter will be enabled, otherwise the frame will be sent unchanged to the
12760 next filter in the filtergraph.
12761 </p>
12762 <p>The expression accepts the following values:
12763 </p><dl compact="compact">
12764 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
12765 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
12766 </p>
12767 </dd>
12768 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
12769 <dd><p>sequential number of the input frame, starting from 0
12770 </p>
12771 </dd>
12772 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
12773 <dd><p>the position in the file of the input frame, NAN if unknown
12774 </p></dd>
12775 </dl>
12776
12777 <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
12778 to re-define the expression.
12779 </p>
12780 <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
12781 rules.
12782 </p>
12783 <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
12784 minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
12785 </p><table><tr><td>&nbsp;</td><td><pre class="example">smartblur = enable='between(t,10,3*60)',
12786 curves    = enable='gte(t,3)' : preset=cross_process
12787 </pre></td></tr></table>
12788
12789
12790 <a name="Audio-Filters"></a>
12791 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Filters">34. Audio Filters</a></h1>
12792
12793 <p>When you configure your FFmpeg build, you can disable any of the
12794 existing filters using <code>--disable-filters</code>.
12795 The configure output will show the audio filters included in your
12796 build.
12797 </p>
12798 <p>Below is a description of the currently available audio filters.
12799 </p>
12800 <a name="aconvert"></a>
12801 <h2 class="section"><a href="ffmpeg-all.html#toc-aconvert">34.1 aconvert</a></h2>
12802
12803 <p>Convert the input audio format to the specified formats.
12804 </p>
12805 <p><em>This filter is deprecated. Use <a href="#aformat">aformat</a> instead.</em>
12806 </p>
12807 <p>The filter accepts a string of the form:
12808 &quot;<var>sample_format</var>:<var>channel_layout</var>&quot;.
12809 </p>
12810 <p><var>sample_format</var> specifies the sample format, and can be a string or the
12811 corresponding numeric value defined in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;. Use &rsquo;p&rsquo;
12812 suffix for a planar sample format.
12813 </p>
12814 <p><var>channel_layout</var> specifies the channel layout, and can be a string
12815 or the corresponding number value defined in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
12816 </p>
12817 <p>The special parameter &quot;auto&quot;, signifies that the filter will
12818 automatically select the output format depending on the output filter.
12819 </p>
12820 <a name="Examples-38"></a>
12821 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-38">34.1.1 Examples</a></h3>
12822
12823 <ul>
12824 <li>
12825 Convert input to float, planar, stereo:
12826 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=fltp:stereo
12827 </pre></td></tr></table>
12828
12829 </li><li>
12830 Convert input to unsigned 8-bit, automatically select out channel layout:
12831 <table><tr><td>&nbsp;</td><td><pre class="example">aconvert=u8:auto
12832 </pre></td></tr></table>
12833 </li></ul>
12834
12835 <a name="adelay"></a>
12836 <h2 class="section"><a href="ffmpeg-all.html#toc-adelay">34.2 adelay</a></h2>
12837
12838 <p>Delay one or more audio channels.
12839 </p>
12840 <p>Samples in delayed channel are filled with silence.
12841 </p>
12842 <p>The filter accepts the following option:
12843 </p>
12844 <dl compact="compact">
12845 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
12846 <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
12847 At least one delay greater than 0 should be provided.
12848 Unused delays will be silently ignored. If number of given delays is
12849 smaller than number of channels all remaining channels will not be delayed.
12850 </p></dd>
12851 </dl>
12852
12853 <a name="Examples-22"></a>
12854 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-22">34.2.1 Examples</a></h3>
12855
12856 <ul>
12857 <li>
12858 Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
12859 the second channel (and any other channels that may be present) unchanged.
12860 <table><tr><td>&nbsp;</td><td><pre class="example">adelay=1500|0|500
12861 </pre></td></tr></table>
12862 </li></ul>
12863
12864 <a name="aecho"></a>
12865 <h2 class="section"><a href="ffmpeg-all.html#toc-aecho">34.3 aecho</a></h2>
12866
12867 <p>Apply echoing to the input audio.
12868 </p>
12869 <p>Echoes are reflected sound and can occur naturally amongst mountains
12870 (and sometimes large buildings) when talking or shouting; digital echo
12871 effects emulate this behaviour and are often used to help fill out the
12872 sound of a single instrument or vocal. The time difference between the
12873 original signal and the reflection is the <code>delay</code>, and the
12874 loudness of the reflected signal is the <code>decay</code>.
12875 Multiple echoes can have different delays and decays.
12876 </p>
12877 <p>A description of the accepted parameters follows.
12878 </p>
12879 <dl compact="compact">
12880 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
12881 <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
12882 </p>
12883 </dd>
12884 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
12885 <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
12886 </p>
12887 </dd>
12888 <dt> &lsquo;<samp>delays</samp>&rsquo;</dt>
12889 <dd><p>Set list of time intervals in milliseconds between original signal and reflections
12890 separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
12891 Default is <code>1000</code>.
12892 </p>
12893 </dd>
12894 <dt> &lsquo;<samp>decays</samp>&rsquo;</dt>
12895 <dd><p>Set list of loudnesses of reflected signals separated by &rsquo;|&rsquo;.
12896 Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
12897 Default is <code>0.5</code>.
12898 </p></dd>
12899 </dl>
12900
12901 <a name="Examples-76"></a>
12902 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-76">34.3.1 Examples</a></h3>
12903
12904 <ul>
12905 <li>
12906 Make it sound as if there are twice as many instruments as are actually playing:
12907 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:60:0.4
12908 </pre></td></tr></table>
12909
12910 </li><li>
12911 If delay is very short, then it sound like a (metallic) robot playing music:
12912 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.88:6:0.4
12913 </pre></td></tr></table>
12914
12915 </li><li>
12916 A longer delay will sound like an open air concert in the mountains:
12917 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000:0.3
12918 </pre></td></tr></table>
12919
12920 </li><li>
12921 Same as above but with one more mountain:
12922 <table><tr><td>&nbsp;</td><td><pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
12923 </pre></td></tr></table>
12924 </li></ul>
12925
12926 <a name="aeval"></a>
12927 <h2 class="section"><a href="ffmpeg-all.html#toc-aeval">34.4 aeval</a></h2>
12928
12929 <p>Modify an audio signal according to the specified expressions.
12930 </p>
12931 <p>This filter accepts one or more expressions (one for each channel),
12932 which are evaluated and used to modify a corresponding audio signal.
12933 </p>
12934 <p>This filter accepts the following options:
12935 </p>
12936 <dl compact="compact">
12937 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
12938 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
12939 the number of input channels is greater than the number of
12940 expressions, the last specified expression is used for the remaining
12941 output channels.
12942 </p>
12943 </dd>
12944 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
12945 <dd><p>Set output channel layout. If not specified, the channel layout is
12946 specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
12947 use by default the same input channel layout.
12948 </p></dd>
12949 </dl>
12950
12951 <p>Each expression in <var>exprs</var> can contain the following constants and functions:
12952 </p>
12953 <dl compact="compact">
12954 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
12955 <dd><p>channel number of the current expression
12956 </p>
12957 </dd>
12958 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
12959 <dd><p>number of the evaluated sample, starting from 0
12960 </p>
12961 </dd>
12962 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
12963 <dd><p>sample rate
12964 </p>
12965 </dd>
12966 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
12967 <dd><p>time of the evaluated sample expressed in seconds
12968 </p>
12969 </dd>
12970 <dt> &lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
12971 <dt> &lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
12972 <dd><p>input and output number of channels
12973 </p>
12974 </dd>
12975 <dt> &lsquo;<samp>val(CH)</samp>&rsquo;</dt>
12976 <dd><p>the value of input channel with number <var>CH</var>
12977 </p></dd>
12978 </dl>
12979
12980 <p>Note: this filter is slow. For faster processing you should use a
12981 dedicated filter.
12982 </p>
12983 <a name="Examples-90"></a>
12984 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-90">34.4.1 Examples</a></h3>
12985
12986 <ul>
12987 <li>
12988 Half volume:
12989 <table><tr><td>&nbsp;</td><td><pre class="example">aeval=val(ch)/2:c=same
12990 </pre></td></tr></table>
12991
12992 </li><li>
12993 Invert phase of the second channel:
12994 <table><tr><td>&nbsp;</td><td><pre class="example">eval=val(0)|-val(1)
12995 </pre></td></tr></table>
12996 </li></ul>
12997
12998 <a name="afade"></a>
12999 <h2 class="section"><a href="ffmpeg-all.html#toc-afade">34.5 afade</a></h2>
13000
13001 <p>Apply fade-in/out effect to input audio.
13002 </p>
13003 <p>A description of the accepted parameters follows.
13004 </p>
13005 <dl compact="compact">
13006 <dt> &lsquo;<samp>type, t</samp>&rsquo;</dt>
13007 <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
13008 <code>out</code> for a fade-out effect. Default is <code>in</code>.
13009 </p>
13010 </dd>
13011 <dt> &lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
13012 <dd><p>Specify the number of the start sample for starting to apply the fade
13013 effect. Default is 0.
13014 </p>
13015 </dd>
13016 <dt> &lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
13017 <dd><p>Specify the number of samples for which the fade effect has to last. At
13018 the end of the fade-in effect the output audio will have the same
13019 volume as the input audio, at the end of the fade-out transition
13020 the output audio will be silence. Default is 44100.
13021 </p>
13022 </dd>
13023 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</dt>
13024 <dd><p>Specify time for starting to apply the fade effect. Default is 0.
13025 The accepted syntax is:
13026 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
13027 [-]S+[.m...]
13028 </pre></td></tr></table>
13029 <p>See also the function <code>av_parse_time()</code>.
13030 If set this option is used instead of <var>start_sample</var> one.
13031 </p>
13032 </dd>
13033 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
13034 <dd><p>Specify the duration for which the fade effect has to last. Default is 0.
13035 The accepted syntax is:
13036 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
13037 [-]S+[.m...]
13038 </pre></td></tr></table>
13039 <p>See also the function <code>av_parse_time()</code>.
13040 At the end of the fade-in effect the output audio will have the same
13041 volume as the input audio, at the end of the fade-out transition
13042 the output audio will be silence.
13043 If set this option is used instead of <var>nb_samples</var> one.
13044 </p>
13045 </dd>
13046 <dt> &lsquo;<samp>curve</samp>&rsquo;</dt>
13047 <dd><p>Set curve for fade transition.
13048 </p>
13049 <p>It accepts the following values:
13050 </p><dl compact="compact">
13051 <dt> &lsquo;<samp>tri</samp>&rsquo;</dt>
13052 <dd><p>select triangular, linear slope (default)
13053 </p></dd>
13054 <dt> &lsquo;<samp>qsin</samp>&rsquo;</dt>
13055 <dd><p>select quarter of sine wave
13056 </p></dd>
13057 <dt> &lsquo;<samp>hsin</samp>&rsquo;</dt>
13058 <dd><p>select half of sine wave
13059 </p></dd>
13060 <dt> &lsquo;<samp>esin</samp>&rsquo;</dt>
13061 <dd><p>select exponential sine wave
13062 </p></dd>
13063 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
13064 <dd><p>select logarithmic
13065 </p></dd>
13066 <dt> &lsquo;<samp>par</samp>&rsquo;</dt>
13067 <dd><p>select inverted parabola
13068 </p></dd>
13069 <dt> &lsquo;<samp>qua</samp>&rsquo;</dt>
13070 <dd><p>select quadratic
13071 </p></dd>
13072 <dt> &lsquo;<samp>cub</samp>&rsquo;</dt>
13073 <dd><p>select cubic
13074 </p></dd>
13075 <dt> &lsquo;<samp>squ</samp>&rsquo;</dt>
13076 <dd><p>select square root
13077 </p></dd>
13078 <dt> &lsquo;<samp>cbr</samp>&rsquo;</dt>
13079 <dd><p>select cubic root
13080 </p></dd>
13081 </dl>
13082 </dd>
13083 </dl>
13084
13085 <a name="Examples-53"></a>
13086 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-53">34.5.1 Examples</a></h3>
13087
13088 <ul>
13089 <li>
13090 Fade in first 15 seconds of audio:
13091 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=in:ss=0:d=15
13092 </pre></td></tr></table>
13093
13094 </li><li>
13095 Fade out last 25 seconds of a 900 seconds audio:
13096 <table><tr><td>&nbsp;</td><td><pre class="example">afade=t=out:st=875:d=25
13097 </pre></td></tr></table>
13098 </li></ul>
13099
13100 <p><a name="aformat"></a>
13101 </p><a name="aformat-1"></a>
13102 <h2 class="section"><a href="ffmpeg-all.html#toc-aformat-1">34.6 aformat</a></h2>
13103
13104 <p>Set output format constraints for the input audio. The framework will
13105 negotiate the most appropriate format to minimize conversions.
13106 </p>
13107 <p>The filter accepts the following named parameters:
13108 </p><dl compact="compact">
13109 <dt> &lsquo;<samp>sample_fmts</samp>&rsquo;</dt>
13110 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
13111 </p>
13112 </dd>
13113 <dt> &lsquo;<samp>sample_rates</samp>&rsquo;</dt>
13114 <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
13115 </p>
13116 </dd>
13117 <dt> &lsquo;<samp>channel_layouts</samp>&rsquo;</dt>
13118 <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
13119 </p>
13120 <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)channel layout syntax</a>
13121 for the required syntax.
13122 </p></dd>
13123 </dl>
13124
13125 <p>If a parameter is omitted, all values are allowed.
13126 </p>
13127 <p>For example to force the output to either unsigned 8-bit or signed 16-bit stereo:
13128 </p><table><tr><td>&nbsp;</td><td><pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
13129 </pre></td></tr></table>
13130
13131 <a name="allpass"></a>
13132 <h2 class="section"><a href="ffmpeg-all.html#toc-allpass">34.7 allpass</a></h2>
13133
13134 <p>Apply a two-pole all-pass filter with central frequency (in Hz)
13135 <var>frequency</var>, and filter-width <var>width</var>.
13136 An all-pass filter changes the audio&rsquo;s frequency to phase relationship
13137 without changing its frequency to amplitude relationship.
13138 </p>
13139 <p>The filter accepts the following options:
13140 </p>
13141 <dl compact="compact">
13142 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13143 <dd><p>Set frequency in Hz.
13144 </p>
13145 </dd>
13146 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13147 <dd><p>Set method to specify band-width of filter.
13148 </p><dl compact="compact">
13149 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13150 <dd><p>Hz
13151 </p></dd>
13152 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13153 <dd><p>Q-Factor
13154 </p></dd>
13155 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13156 <dd><p>octave
13157 </p></dd>
13158 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13159 <dd><p>slope
13160 </p></dd>
13161 </dl>
13162
13163 </dd>
13164 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
13165 <dd><p>Specify the band-width of a filter in width_type units.
13166 </p></dd>
13167 </dl>
13168
13169 <a name="amerge"></a>
13170 <h2 class="section"><a href="ffmpeg-all.html#toc-amerge">34.8 amerge</a></h2>
13171
13172 <p>Merge two or more audio streams into a single multi-channel stream.
13173 </p>
13174 <p>The filter accepts the following options:
13175 </p>
13176 <dl compact="compact">
13177 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
13178 <dd><p>Set the number of inputs. Default is 2.
13179 </p>
13180 </dd>
13181 </dl>
13182
13183 <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
13184 the channel layout of the output will be set accordingly and the channels
13185 will be reordered as necessary. If the channel layouts of the inputs are not
13186 disjoint, the output will have all the channels of the first input then all
13187 the channels of the second input, in that order, and the channel layout of
13188 the output will be the default value corresponding to the total number of
13189 channels.
13190 </p>
13191 <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
13192 is FC+BL+BR, then the output will be in 5.1, with the channels in the
13193 following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
13194 first input, b1 is the first channel of the second input).
13195 </p>
13196 <p>On the other hand, if both input are in stereo, the output channels will be
13197 in the default order: a1, a2, b1, b2, and the channel layout will be
13198 arbitrarily set to 4.0, which may or may not be the expected value.
13199 </p>
13200 <p>All inputs must have the same sample rate, and format.
13201 </p>
13202 <p>If inputs do not have the same duration, the output will stop with the
13203 shortest.
13204 </p>
13205 <a name="Examples-56"></a>
13206 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-56">34.8.1 Examples</a></h3>
13207
13208 <ul>
13209 <li>
13210 Merge two mono files into a stereo stream:
13211 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
13212 </pre></td></tr></table>
13213
13214 </li><li>
13215 Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
13216 <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
13217 </pre></td></tr></table>
13218 </li></ul>
13219
13220 <a name="amix"></a>
13221 <h2 class="section"><a href="ffmpeg-all.html#toc-amix">34.9 amix</a></h2>
13222
13223 <p>Mixes multiple audio inputs into a single output.
13224 </p>
13225 <p>For example
13226 </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
13227 </pre></td></tr></table>
13228 <p>will mix 3 input audio streams to a single output with the same duration as the
13229 first input and a dropout transition time of 3 seconds.
13230 </p>
13231 <p>The filter accepts the following named parameters:
13232 </p><dl compact="compact">
13233 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
13234 <dd><p>Number of inputs. If unspecified, it defaults to 2.
13235 </p>
13236 </dd>
13237 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
13238 <dd><p>How to determine the end-of-stream.
13239 </p><dl compact="compact">
13240 <dt> &lsquo;<samp>longest</samp>&rsquo;</dt>
13241 <dd><p>Duration of longest input. (default)
13242 </p>
13243 </dd>
13244 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
13245 <dd><p>Duration of shortest input.
13246 </p>
13247 </dd>
13248 <dt> &lsquo;<samp>first</samp>&rsquo;</dt>
13249 <dd><p>Duration of first input.
13250 </p>
13251 </dd>
13252 </dl>
13253
13254 </dd>
13255 <dt> &lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
13256 <dd><p>Transition time, in seconds, for volume renormalization when an input
13257 stream ends. The default value is 2 seconds.
13258 </p>
13259 </dd>
13260 </dl>
13261
13262 <a name="anull"></a>
13263 <h2 class="section"><a href="ffmpeg-all.html#toc-anull">34.10 anull</a></h2>
13264
13265 <p>Pass the audio source unchanged to the output.
13266 </p>
13267 <a name="apad"></a>
13268 <h2 class="section"><a href="ffmpeg-all.html#toc-apad">34.11 apad</a></h2>
13269
13270 <p>Pad the end of a audio stream with silence, this can be used together with
13271 -shortest to extend audio streams to the same length as the video stream.
13272 </p>
13273 <a name="aphaser"></a>
13274 <h2 class="section"><a href="ffmpeg-all.html#toc-aphaser">34.12 aphaser</a></h2>
13275 <p>Add a phasing effect to the input audio.
13276 </p>
13277 <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
13278 The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
13279 </p>
13280 <p>A description of the accepted parameters follows.
13281 </p>
13282 <dl compact="compact">
13283 <dt> &lsquo;<samp>in_gain</samp>&rsquo;</dt>
13284 <dd><p>Set input gain. Default is 0.4.
13285 </p>
13286 </dd>
13287 <dt> &lsquo;<samp>out_gain</samp>&rsquo;</dt>
13288 <dd><p>Set output gain. Default is 0.74
13289 </p>
13290 </dd>
13291 <dt> &lsquo;<samp>delay</samp>&rsquo;</dt>
13292 <dd><p>Set delay in milliseconds. Default is 3.0.
13293 </p>
13294 </dd>
13295 <dt> &lsquo;<samp>decay</samp>&rsquo;</dt>
13296 <dd><p>Set decay. Default is 0.4.
13297 </p>
13298 </dd>
13299 <dt> &lsquo;<samp>speed</samp>&rsquo;</dt>
13300 <dd><p>Set modulation speed in Hz. Default is 0.5.
13301 </p>
13302 </dd>
13303 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
13304 <dd><p>Set modulation type. Default is triangular.
13305 </p>
13306 <p>It accepts the following values:
13307 </p><dl compact="compact">
13308 <dt> &lsquo;<samp>triangular, t</samp>&rsquo;</dt>
13309 <dt> &lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
13310 </dl>
13311 </dd>
13312 </dl>
13313
13314 <p><a name="aresample"></a>
13315 </p><a name="aresample-1"></a>
13316 <h2 class="section"><a href="ffmpeg-all.html#toc-aresample-1">34.13 aresample</a></h2>
13317
13318 <p>Resample the input audio to the specified parameters, using the
13319 libswresample library. If none are specified then the filter will
13320 automatically convert between its input and output.
13321 </p>
13322 <p>This filter is also able to stretch/squeeze the audio data to make it match
13323 the timestamps or to inject silence / cut out audio to make it match the
13324 timestamps, do a combination of both or do neither.
13325 </p>
13326 <p>The filter accepts the syntax
13327 [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
13328 expresses a sample rate and <var>resampler_options</var> is a list of
13329 <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
13330 ffmpeg-resampler manual for the complete list of supported options.
13331 </p>
13332 <a name="Examples-18"></a>
13333 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-18">34.13.1 Examples</a></h3>
13334
13335 <ul>
13336 <li>
13337 Resample the input audio to 44100Hz:
13338 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=44100
13339 </pre></td></tr></table>
13340
13341 </li><li>
13342 Stretch/squeeze samples to the given timestamps, with a maximum of 1000
13343 samples per second compensation:
13344 <table><tr><td>&nbsp;</td><td><pre class="example">aresample=async=1000
13345 </pre></td></tr></table>
13346 </li></ul>
13347
13348 <a name="asetnsamples"></a>
13349 <h2 class="section"><a href="ffmpeg-all.html#toc-asetnsamples">34.14 asetnsamples</a></h2>
13350
13351 <p>Set the number of samples per each output audio frame.
13352 </p>
13353 <p>The last output packet may contain a different number of samples, as
13354 the filter will flush all the remaining samples when the input audio
13355 signal its end.
13356 </p>
13357 <p>The filter accepts the following options:
13358 </p>
13359 <dl compact="compact">
13360 <dt> &lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
13361 <dd><p>Set the number of frames per each output audio frame. The number is
13362 intended as the number of samples <em>per each channel</em>.
13363 Default value is 1024.
13364 </p>
13365 </dd>
13366 <dt> &lsquo;<samp>pad, p</samp>&rsquo;</dt>
13367 <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
13368 that the last frame will contain the same number of samples as the
13369 previous ones. Default value is 1.
13370 </p></dd>
13371 </dl>
13372
13373 <p>For example, to set the number of per-frame samples to 1234 and
13374 disable padding for the last frame, use:
13375 </p><table><tr><td>&nbsp;</td><td><pre class="example">asetnsamples=n=1234:p=0
13376 </pre></td></tr></table>
13377
13378 <a name="asetrate"></a>
13379 <h2 class="section"><a href="ffmpeg-all.html#toc-asetrate">34.15 asetrate</a></h2>
13380
13381 <p>Set the sample rate without altering the PCM data.
13382 This will result in a change of speed and pitch.
13383 </p>
13384 <p>The filter accepts the following options:
13385 </p>
13386 <dl compact="compact">
13387 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
13388 <dd><p>Set the output sample rate. Default is 44100 Hz.
13389 </p></dd>
13390 </dl>
13391
13392 <a name="ashowinfo"></a>
13393 <h2 class="section"><a href="ffmpeg-all.html#toc-ashowinfo">34.16 ashowinfo</a></h2>
13394
13395 <p>Show a line containing various information for each input audio frame.
13396 The input audio is not modified.
13397 </p>
13398 <p>The shown line contains a sequence of key/value pairs of the form
13399 <var>key</var>:<var>value</var>.
13400 </p>
13401 <p>A description of each shown parameter follows:
13402 </p>
13403 <dl compact="compact">
13404 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
13405 <dd><p>sequential number of the input frame, starting from 0
13406 </p>
13407 </dd>
13408 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
13409 <dd><p>Presentation timestamp of the input frame, in time base units; the time base
13410 depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
13411 </p>
13412 </dd>
13413 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
13414 <dd><p>presentation timestamp of the input frame in seconds
13415 </p>
13416 </dd>
13417 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
13418 <dd><p>position of the frame in the input stream, -1 if this information in
13419 unavailable and/or meaningless (for example in case of synthetic audio)
13420 </p>
13421 </dd>
13422 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
13423 <dd><p>sample format
13424 </p>
13425 </dd>
13426 <dt> &lsquo;<samp>chlayout</samp>&rsquo;</dt>
13427 <dd><p>channel layout
13428 </p>
13429 </dd>
13430 <dt> &lsquo;<samp>rate</samp>&rsquo;</dt>
13431 <dd><p>sample rate for the audio frame
13432 </p>
13433 </dd>
13434 <dt> &lsquo;<samp>nb_samples</samp>&rsquo;</dt>
13435 <dd><p>number of samples (per channel) in the frame
13436 </p>
13437 </dd>
13438 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
13439 <dd><p>Adler-32 checksum (printed in hexadecimal) of the audio data. For planar audio
13440 the data is treated as if all the planes were concatenated.
13441 </p>
13442 </dd>
13443 <dt> &lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
13444 <dd><p>A list of Adler-32 checksums for each data plane.
13445 </p></dd>
13446 </dl>
13447
13448 <a name="astats"></a>
13449 <h2 class="section"><a href="ffmpeg-all.html#toc-astats">34.17 astats</a></h2>
13450
13451 <p>Display time domain statistical information about the audio channels.
13452 Statistics are calculated and displayed for each audio channel and,
13453 where applicable, an overall figure is also given.
13454 </p>
13455 <p>The filter accepts the following option:
13456 </p><dl compact="compact">
13457 <dt> &lsquo;<samp>length</samp>&rsquo;</dt>
13458 <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
13459 Default is <code>0.05</code> (50 miliseconds). Allowed range is <code>[0.1 - 10]</code>.
13460 </p></dd>
13461 </dl>
13462
13463 <p>A description of each shown parameter follows:
13464 </p>
13465 <dl compact="compact">
13466 <dt> &lsquo;<samp>DC offset</samp>&rsquo;</dt>
13467 <dd><p>Mean amplitude displacement from zero.
13468 </p>
13469 </dd>
13470 <dt> &lsquo;<samp>Min level</samp>&rsquo;</dt>
13471 <dd><p>Minimal sample level.
13472 </p>
13473 </dd>
13474 <dt> &lsquo;<samp>Max level</samp>&rsquo;</dt>
13475 <dd><p>Maximal sample level.
13476 </p>
13477 </dd>
13478 <dt> &lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
13479 <dt> &lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
13480 <dd><p>Standard peak and RMS level measured in dBFS.
13481 </p>
13482 </dd>
13483 <dt> &lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
13484 <dt> &lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
13485 <dd><p>Peak and trough values for RMS level measured over a short window.
13486 </p>
13487 </dd>
13488 <dt> &lsquo;<samp>Crest factor</samp>&rsquo;</dt>
13489 <dd><p>Standard ratio of peak to RMS level (note: not in dB).
13490 </p>
13491 </dd>
13492 <dt> &lsquo;<samp>Flat factor</samp>&rsquo;</dt>
13493 <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
13494 (i.e. either <var>Min level</var> or <var>Max level</var>).
13495 </p>
13496 </dd>
13497 <dt> &lsquo;<samp>Peak count</samp>&rsquo;</dt>
13498 <dd><p>Number of occasions (not the number of samples) that the signal attained either
13499 <var>Min level</var> or <var>Max level</var>.
13500 </p></dd>
13501 </dl>
13502
13503 <a name="astreamsync"></a>
13504 <h2 class="section"><a href="ffmpeg-all.html#toc-astreamsync">34.18 astreamsync</a></h2>
13505
13506 <p>Forward two audio streams and control the order the buffers are forwarded.
13507 </p>
13508 <p>The filter accepts the following options:
13509 </p>
13510 <dl compact="compact">
13511 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
13512 <dd><p>Set the expression deciding which stream should be
13513 forwarded next: if the result is negative, the first stream is forwarded; if
13514 the result is positive or zero, the second stream is forwarded. It can use
13515 the following variables:
13516 </p>
13517 <dl compact="compact">
13518 <dt> <var>b1 b2</var></dt>
13519 <dd><p>number of buffers forwarded so far on each stream
13520 </p></dd>
13521 <dt> <var>s1 s2</var></dt>
13522 <dd><p>number of samples forwarded so far on each stream
13523 </p></dd>
13524 <dt> <var>t1 t2</var></dt>
13525 <dd><p>current timestamp of each stream
13526 </p></dd>
13527 </dl>
13528
13529 <p>The default value is <code>t1-t2</code>, which means to always forward the stream
13530 that has a smaller timestamp.
13531 </p></dd>
13532 </dl>
13533
13534 <a name="Examples-31"></a>
13535 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-31">34.18.1 Examples</a></h3>
13536
13537 <p>Stress-test <code>amerge</code> by randomly sending buffers on the wrong
13538 input, while avoiding too much of a desynchronization:
13539 </p><table><tr><td>&nbsp;</td><td><pre class="example">amovie=file.ogg [a] ; amovie=file.mp3 [b] ;
13540 [a] [b] astreamsync=(2*random(1))-1+tanh(5*(t1-t2)) [a2] [b2] ;
13541 [a2] [b2] amerge
13542 </pre></td></tr></table>
13543
13544 <a name="asyncts"></a>
13545 <h2 class="section"><a href="ffmpeg-all.html#toc-asyncts">34.19 asyncts</a></h2>
13546
13547 <p>Synchronize audio data with timestamps by squeezing/stretching it and/or
13548 dropping samples/adding silence when needed.
13549 </p>
13550 <p>This filter is not built by default, please use <a href="#aresample">aresample</a> to do squeezing/stretching.
13551 </p>
13552 <p>The filter accepts the following named parameters:
13553 </p><dl compact="compact">
13554 <dt> &lsquo;<samp>compensate</samp>&rsquo;</dt>
13555 <dd><p>Enable stretching/squeezing the data to make it match the timestamps. Disabled
13556 by default. When disabled, time gaps are covered with silence.
13557 </p>
13558 </dd>
13559 <dt> &lsquo;<samp>min_delta</samp>&rsquo;</dt>
13560 <dd><p>Minimum difference between timestamps and audio data (in seconds) to trigger
13561 adding/dropping samples. Default value is 0.1. If you get non-perfect sync with
13562 this filter, try setting this parameter to 0.
13563 </p>
13564 </dd>
13565 <dt> &lsquo;<samp>max_comp</samp>&rsquo;</dt>
13566 <dd><p>Maximum compensation in samples per second. Relevant only with compensate=1.
13567 Default value 500.
13568 </p>
13569 </dd>
13570 <dt> &lsquo;<samp>first_pts</samp>&rsquo;</dt>
13571 <dd><p>Assume the first pts should be this value. The time base is 1 / sample rate.
13572 This allows for padding/trimming at the start of stream. By default, no
13573 assumption is made about the first frame&rsquo;s expected pts, so no padding or
13574 trimming is done. For example, this could be set to 0 to pad the beginning with
13575 silence if an audio stream starts after the video stream or to trim any samples
13576 with a negative pts due to encoder delay.
13577 </p>
13578 </dd>
13579 </dl>
13580
13581 <a name="atempo"></a>
13582 <h2 class="section"><a href="ffmpeg-all.html#toc-atempo">34.20 atempo</a></h2>
13583
13584 <p>Adjust audio tempo.
13585 </p>
13586 <p>The filter accepts exactly one parameter, the audio tempo. If not
13587 specified then the filter will assume nominal 1.0 tempo. Tempo must
13588 be in the [0.5, 2.0] range.
13589 </p>
13590 <a name="Examples-39"></a>
13591 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-39">34.20.1 Examples</a></h3>
13592
13593 <ul>
13594 <li>
13595 Slow down audio to 80% tempo:
13596 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=0.8
13597 </pre></td></tr></table>
13598
13599 </li><li>
13600 To speed up audio to 125% tempo:
13601 <table><tr><td>&nbsp;</td><td><pre class="example">atempo=1.25
13602 </pre></td></tr></table>
13603 </li></ul>
13604
13605 <a name="atrim"></a>
13606 <h2 class="section"><a href="ffmpeg-all.html#toc-atrim">34.21 atrim</a></h2>
13607
13608 <p>Trim the input so that the output contains one continuous subpart of the input.
13609 </p>
13610 <p>This filter accepts the following options:
13611 </p><dl compact="compact">
13612 <dt> &lsquo;<samp>start</samp>&rsquo;</dt>
13613 <dd><p>Specify time of the start of the kept section, i.e. the audio sample
13614 with the timestamp <var>start</var> will be the first sample in the output.
13615 </p>
13616 </dd>
13617 <dt> &lsquo;<samp>end</samp>&rsquo;</dt>
13618 <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
13619 audio sample immediately preceding the one with the timestamp <var>end</var> will be
13620 the last sample in the output.
13621 </p>
13622 </dd>
13623 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
13624 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
13625 instead of seconds.
13626 </p>
13627 </dd>
13628 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
13629 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
13630 of seconds.
13631 </p>
13632 </dd>
13633 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
13634 <dd><p>Specify maximum duration of the output.
13635 </p>
13636 </dd>
13637 <dt> &lsquo;<samp>start_sample</samp>&rsquo;</dt>
13638 <dd><p>Number of the first sample that should be passed to output.
13639 </p>
13640 </dd>
13641 <dt> &lsquo;<samp>end_sample</samp>&rsquo;</dt>
13642 <dd><p>Number of the first sample that should be dropped.
13643 </p></dd>
13644 </dl>
13645
13646 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
13647 duration specifications, check the &quot;Time duration&quot; section in the
13648 ffmpeg-utils manual.
13649 </p>
13650 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
13651 option look at the frame timestamp, while the _sample options simply count the
13652 samples that pass through the filter. So start/end_pts and start/end_sample will
13653 give different results when the timestamps are wrong, inexact or do not start at
13654 zero. Also note that this filter does not modify the timestamps. If you wish
13655 that the output timestamps start at zero, insert the asetpts filter after the
13656 atrim filter.
13657 </p>
13658 <p>If multiple start or end options are set, this filter tries to be greedy and
13659 keep all samples that match at least one of the specified constraints. To keep
13660 only the part that matches all the constraints at once, chain multiple atrim
13661 filters.
13662 </p>
13663 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
13664 just the end values to keep everything before the specified time.
13665 </p>
13666 <p>Examples:
13667 </p><ul>
13668 <li>
13669 drop everything except the second minute of input
13670 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=60:120
13671 </pre></td></tr></table>
13672
13673 </li><li>
13674 keep only the first 1000 samples
13675 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
13676 </pre></td></tr></table>
13677
13678 </li></ul>
13679
13680 <a name="bandpass"></a>
13681 <h2 class="section"><a href="ffmpeg-all.html#toc-bandpass">34.22 bandpass</a></h2>
13682
13683 <p>Apply a two-pole Butterworth band-pass filter with central
13684 frequency <var>frequency</var>, and (3dB-point) band-width width.
13685 The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
13686 instead of the default: constant 0dB peak gain.
13687 The filter roll off at 6dB per octave (20dB per decade).
13688 </p>
13689 <p>The filter accepts the following options:
13690 </p>
13691 <dl compact="compact">
13692 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13693 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
13694 </p>
13695 </dd>
13696 <dt> &lsquo;<samp>csg</samp>&rsquo;</dt>
13697 <dd><p>Constant skirt gain if set to 1. Defaults to 0.
13698 </p>
13699 </dd>
13700 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13701 <dd><p>Set method to specify band-width of filter.
13702 </p><dl compact="compact">
13703 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13704 <dd><p>Hz
13705 </p></dd>
13706 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13707 <dd><p>Q-Factor
13708 </p></dd>
13709 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13710 <dd><p>octave
13711 </p></dd>
13712 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13713 <dd><p>slope
13714 </p></dd>
13715 </dl>
13716
13717 </dd>
13718 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
13719 <dd><p>Specify the band-width of a filter in width_type units.
13720 </p></dd>
13721 </dl>
13722
13723 <a name="bandreject"></a>
13724 <h2 class="section"><a href="ffmpeg-all.html#toc-bandreject">34.23 bandreject</a></h2>
13725
13726 <p>Apply a two-pole Butterworth band-reject filter with central
13727 frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
13728 The filter roll off at 6dB per octave (20dB per decade).
13729 </p>
13730 <p>The filter accepts the following options:
13731 </p>
13732 <dl compact="compact">
13733 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13734 <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
13735 </p>
13736 </dd>
13737 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13738 <dd><p>Set method to specify band-width of filter.
13739 </p><dl compact="compact">
13740 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13741 <dd><p>Hz
13742 </p></dd>
13743 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13744 <dd><p>Q-Factor
13745 </p></dd>
13746 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13747 <dd><p>octave
13748 </p></dd>
13749 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13750 <dd><p>slope
13751 </p></dd>
13752 </dl>
13753
13754 </dd>
13755 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
13756 <dd><p>Specify the band-width of a filter in width_type units.
13757 </p></dd>
13758 </dl>
13759
13760 <a name="bass"></a>
13761 <h2 class="section"><a href="ffmpeg-all.html#toc-bass">34.24 bass</a></h2>
13762
13763 <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
13764 shelving filter with a response similar to that of a standard
13765 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
13766 </p>
13767 <p>The filter accepts the following options:
13768 </p>
13769 <dl compact="compact">
13770 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
13771 <dd><p>Give the gain at 0 Hz. Its useful range is about -20
13772 (for a large cut) to +20 (for a large boost).
13773 Beware of clipping when using a positive gain.
13774 </p>
13775 </dd>
13776 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13777 <dd><p>Set the filter&rsquo;s central frequency and so can be used
13778 to extend or reduce the frequency range to be boosted or cut.
13779 The default value is <code>100</code> Hz.
13780 </p>
13781 </dd>
13782 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13783 <dd><p>Set method to specify band-width of filter.
13784 </p><dl compact="compact">
13785 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13786 <dd><p>Hz
13787 </p></dd>
13788 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13789 <dd><p>Q-Factor
13790 </p></dd>
13791 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13792 <dd><p>octave
13793 </p></dd>
13794 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13795 <dd><p>slope
13796 </p></dd>
13797 </dl>
13798
13799 </dd>
13800 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
13801 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
13802 </p></dd>
13803 </dl>
13804
13805 <a name="biquad"></a>
13806 <h2 class="section"><a href="ffmpeg-all.html#toc-biquad">34.25 biquad</a></h2>
13807
13808 <p>Apply a biquad IIR filter with the given coefficients.
13809 Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
13810 are the numerator and denominator coefficients respectively.
13811 </p>
13812 <a name="channelmap"></a>
13813 <h2 class="section"><a href="ffmpeg-all.html#toc-channelmap">34.26 channelmap</a></h2>
13814
13815 <p>Remap input channels to new locations.
13816 </p>
13817 <p>This filter accepts the following named parameters:
13818 </p><dl compact="compact">
13819 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
13820 <dd><p>Channel layout of the output stream.
13821 </p>
13822 </dd>
13823 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
13824 <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
13825 mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
13826 <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
13827 channel (e.g. FL for front left) or its index in the input channel layout.
13828 <var>out_channel</var> is the name of the output channel or its index in the output
13829 channel layout. If <var>out_channel</var> is not given then it is implicitly an
13830 index, starting with zero and increasing by one for each mapping.
13831 </p></dd>
13832 </dl>
13833
13834 <p>If no mapping is present, the filter will implicitly map input channels to
13835 output channels preserving index.
13836 </p>
13837 <p>For example, assuming a 5.1+downmix input MOV file
13838 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
13839 </pre></td></tr></table>
13840 <p>will create an output WAV file tagged as stereo from the downmix channels of
13841 the input.
13842 </p>
13843 <p>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
13844 </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
13845 </pre></td></tr></table>
13846
13847 <a name="channelsplit"></a>
13848 <h2 class="section"><a href="ffmpeg-all.html#toc-channelsplit">34.27 channelsplit</a></h2>
13849
13850 <p>Split each channel in input audio stream into a separate output stream.
13851 </p>
13852 <p>This filter accepts the following named parameters:
13853 </p><dl compact="compact">
13854 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
13855 <dd><p>Channel layout of the input stream. Default is &quot;stereo&quot;.
13856 </p></dd>
13857 </dl>
13858
13859 <p>For example, assuming a stereo input MP3 file
13860 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
13861 </pre></td></tr></table>
13862 <p>will create an output Matroska file with two audio streams, one containing only
13863 the left channel and the other the right channel.
13864 </p>
13865 <p>To split a 5.1 WAV file into per-channel files
13866 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.wav -filter_complex
13867 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
13868 -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
13869 front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
13870 side_right.wav
13871 </pre></td></tr></table>
13872
13873 <a name="compand"></a>
13874 <h2 class="section"><a href="ffmpeg-all.html#toc-compand">34.28 compand</a></h2>
13875
13876 <p>Compress or expand audio dynamic range.
13877 </p>
13878 <p>A description of the accepted options follows.
13879 </p>
13880 <dl compact="compact">
13881 <dt> &lsquo;<samp>attacks</samp>&rsquo;</dt>
13882 <dt> &lsquo;<samp>decays</samp>&rsquo;</dt>
13883 <dd><p>Set list of times in seconds for each channel over which the instantaneous
13884 level of the input signal is averaged to determine its volume.
13885 &lsquo;<samp>attacks</samp>&rsquo; refers to increase of volume and &lsquo;<samp>decays</samp>&rsquo; refers
13886 to decrease of volume.
13887 For most situations, the attack time (response to the audio getting louder)
13888 should be shorter than the decay time because the human ear is more sensitive
13889 to sudden loud audio than sudden soft audio.
13890 Typical value for attack is <code>0.3</code> seconds and for decay <code>0.8</code>
13891 seconds.
13892 </p>
13893 </dd>
13894 <dt> &lsquo;<samp>points</samp>&rsquo;</dt>
13895 <dd><p>Set list of points for transfer function, specified in dB relative to maximum
13896 possible signal amplitude.
13897 Each key points list need to be defined using the following syntax:
13898 <code>x0/y0 x1/y1 x2/y2 ...</code>.
13899 </p>
13900 <p>The input values must be in strictly increasing order but the transfer
13901 function does not have to be monotonically rising.
13902 The point <code>0/0</code> is assumed but may be overridden (by <code>0/out-dBn</code>).
13903 Typical values for the transfer function are <code>-70/-70 -60/-20</code>.
13904 </p>
13905 </dd>
13906 <dt> &lsquo;<samp>soft-knee</samp>&rsquo;</dt>
13907 <dd><p>Set amount for which the points at where adjacent line segments on the
13908 transfer function meet will be rounded. Defaults is <code>0.01</code>.
13909 </p>
13910 </dd>
13911 <dt> &lsquo;<samp>gain</samp>&rsquo;</dt>
13912 <dd><p>Set additional gain in dB to be applied at all points on the transfer function
13913 and allows easy adjustment of the overall gain.
13914 Default is <code>0</code>.
13915 </p>
13916 </dd>
13917 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
13918 <dd><p>Set initial volume in dB to be assumed for each channel when filtering starts.
13919 This permits the user to supply a nominal level initially, so that,
13920 for example, a very large gain is not applied to initial signal levels before
13921 the companding has begun to operate. A typical value for audio which is
13922 initially quiet is -90 dB. Default is <code>0</code>.
13923 </p>
13924 </dd>
13925 <dt> &lsquo;<samp>delay</samp>&rsquo;</dt>
13926 <dd><p>Set delay in seconds. Default is <code>0</code>. The input audio
13927 is analysed immediately, but audio is delayed before being fed to the
13928 volume adjuster. Specifying a delay approximately equal to the attack/decay
13929 times allows the filter to effectively operate in predictive rather than
13930 reactive mode.
13931 </p></dd>
13932 </dl>
13933
13934 <a name="Examples-79"></a>
13935 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-79">34.28.1 Examples</a></h3>
13936 <ul>
13937 <li>
13938 Make music with both quiet and loud passages suitable for listening
13939 in a noisy environment:
13940 <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
13941 </pre></td></tr></table>
13942
13943 </li><li>
13944 Noise-gate for when the noise is at a lower level than the signal:
13945 <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
13946 </pre></td></tr></table>
13947
13948 </li><li>
13949 Here is another noise-gate, this time for when the noise is at a higher level
13950 than the signal (making it, in some ways, similar to squelch):
13951 <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
13952 </pre></td></tr></table>
13953 </li></ul>
13954
13955 <a name="earwax"></a>
13956 <h2 class="section"><a href="ffmpeg-all.html#toc-earwax">34.29 earwax</a></h2>
13957
13958 <p>Make audio easier to listen to on headphones.
13959 </p>
13960 <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
13961 so that when listened to on headphones the stereo image is moved from
13962 inside your head (standard for headphones) to outside and in front of
13963 the listener (standard for speakers).
13964 </p>
13965 <p>Ported from SoX.
13966 </p>
13967 <a name="equalizer"></a>
13968 <h2 class="section"><a href="ffmpeg-all.html#toc-equalizer">34.30 equalizer</a></h2>
13969
13970 <p>Apply a two-pole peaking equalisation (EQ) filter. With this
13971 filter, the signal-level at and around a selected frequency can
13972 be increased or decreased, whilst (unlike bandpass and bandreject
13973 filters) that at all other frequencies is unchanged.
13974 </p>
13975 <p>In order to produce complex equalisation curves, this filter can
13976 be given several times, each with a different central frequency.
13977 </p>
13978 <p>The filter accepts the following options:
13979 </p>
13980 <dl compact="compact">
13981 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
13982 <dd><p>Set the filter&rsquo;s central frequency in Hz.
13983 </p>
13984 </dd>
13985 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
13986 <dd><p>Set method to specify band-width of filter.
13987 </p><dl compact="compact">
13988 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
13989 <dd><p>Hz
13990 </p></dd>
13991 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
13992 <dd><p>Q-Factor
13993 </p></dd>
13994 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
13995 <dd><p>octave
13996 </p></dd>
13997 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
13998 <dd><p>slope
13999 </p></dd>
14000 </dl>
14001
14002 </dd>
14003 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14004 <dd><p>Specify the band-width of a filter in width_type units.
14005 </p>
14006 </dd>
14007 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
14008 <dd><p>Set the required gain or attenuation in dB.
14009 Beware of clipping when using a positive gain.
14010 </p></dd>
14011 </dl>
14012
14013 <a name="highpass"></a>
14014 <h2 class="section"><a href="ffmpeg-all.html#toc-highpass">34.31 highpass</a></h2>
14015
14016 <p>Apply a high-pass filter with 3dB point frequency.
14017 The filter can be either single-pole, or double-pole (the default).
14018 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
14019 </p>
14020 <p>The filter accepts the following options:
14021 </p>
14022 <dl compact="compact">
14023 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
14024 <dd><p>Set frequency in Hz. Default is 3000.
14025 </p>
14026 </dd>
14027 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
14028 <dd><p>Set number of poles. Default is 2.
14029 </p>
14030 </dd>
14031 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
14032 <dd><p>Set method to specify band-width of filter.
14033 </p><dl compact="compact">
14034 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14035 <dd><p>Hz
14036 </p></dd>
14037 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
14038 <dd><p>Q-Factor
14039 </p></dd>
14040 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
14041 <dd><p>octave
14042 </p></dd>
14043 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
14044 <dd><p>slope
14045 </p></dd>
14046 </dl>
14047
14048 </dd>
14049 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14050 <dd><p>Specify the band-width of a filter in width_type units.
14051 Applies only to double-pole filter.
14052 The default is 0.707q and gives a Butterworth response.
14053 </p></dd>
14054 </dl>
14055
14056 <a name="join"></a>
14057 <h2 class="section"><a href="ffmpeg-all.html#toc-join">34.32 join</a></h2>
14058
14059 <p>Join multiple input streams into one multi-channel stream.
14060 </p>
14061 <p>The filter accepts the following named parameters:
14062 </p><dl compact="compact">
14063 <dt> &lsquo;<samp>inputs</samp>&rsquo;</dt>
14064 <dd><p>Number of input streams. Defaults to 2.
14065 </p>
14066 </dd>
14067 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
14068 <dd><p>Desired output channel layout. Defaults to stereo.
14069 </p>
14070 </dd>
14071 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
14072 <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
14073 mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
14074 form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
14075 can be either the name of the input channel (e.g. FL for front left) or its
14076 index in the specified input stream. <var>out_channel</var> is the name of the output
14077 channel.
14078 </p></dd>
14079 </dl>
14080
14081 <p>The filter will attempt to guess the mappings when those are not specified
14082 explicitly. It does so by first trying to find an unused matching input channel
14083 and if that fails it picks the first unused input channel.
14084 </p>
14085 <p>E.g. to join 3 inputs (with properly set channel layouts)
14086 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
14087 </pre></td></tr></table>
14088
14089 <p>To build a 5.1 output from 6 single-channel streams:
14090 </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
14091 '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'
14092 out
14093 </pre></td></tr></table>
14094
14095 <a name="ladspa"></a>
14096 <h2 class="section"><a href="ffmpeg-all.html#toc-ladspa">34.33 ladspa</a></h2>
14097
14098 <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
14099 </p>
14100 <p>To enable compilation of this filter you need to configure FFmpeg with
14101 <code>--enable-ladspa</code>.
14102 </p>
14103 <dl compact="compact">
14104 <dt> &lsquo;<samp>file, f</samp>&rsquo;</dt>
14105 <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
14106 variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
14107 each one of the directories specified by the colon separated list in
14108 <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
14109 this order: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
14110 &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
14111 </p>
14112 </dd>
14113 <dt> &lsquo;<samp>plugin, p</samp>&rsquo;</dt>
14114 <dd><p>Specifies the plugin within the library. Some libraries contain only
14115 one plugin, but others contain many of them. If this is not set filter
14116 will list all available plugins within the specified library.
14117 </p>
14118 </dd>
14119 <dt> &lsquo;<samp>controls, c</samp>&rsquo;</dt>
14120 <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
14121 values that determine the behavior of the loaded plugin (for example delay,
14122 threshold or gain).
14123 Controls need to be defined using the following syntax:
14124 c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
14125 <var>valuei</var> is the value set on the <var>i</var>-th control.
14126 If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
14127 their valid ranges are printed.
14128 </p>
14129 </dd>
14130 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
14131 <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
14132 zero inputs.
14133 </p>
14134 </dd>
14135 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
14136 <dd><p>Set the number of samples per channel per each output frame, default
14137 is 1024. Only used if plugin have zero inputs.
14138 </p>
14139 </dd>
14140 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
14141 <dd><p>Set the minimum duration of the sourced audio. See the function
14142 <code>av_parse_time()</code> for the accepted format, also check the &quot;Time duration&quot;
14143 section in the ffmpeg-utils manual.
14144 Note that the resulting duration may be greater than the specified duration,
14145 as the generated audio is always cut at the end of a complete frame.
14146 If not specified, or the expressed duration is negative, the audio is
14147 supposed to be generated forever.
14148 Only used if plugin have zero inputs.
14149 </p>
14150 </dd>
14151 </dl>
14152
14153 <a name="Examples-75"></a>
14154 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-75">34.33.1 Examples</a></h3>
14155
14156 <ul>
14157 <li>
14158 List all available plugins within amp (LADSPA example plugin) library:
14159 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=amp
14160 </pre></td></tr></table>
14161
14162 </li><li>
14163 List all available controls and their valid ranges for <code>vcf_notch</code>
14164 plugin from <code>VCF</code> library:
14165 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
14166 </pre></td></tr></table>
14167
14168 </li><li>
14169 Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
14170 plugin library:
14171 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
14172 </pre></td></tr></table>
14173
14174 </li><li>
14175 Add reverberation to the audio using TAP-plugins
14176 (Tom&rsquo;s Audio Processing plugins):
14177 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=tap_reverb:tap_reverb
14178 </pre></td></tr></table>
14179
14180 </li><li>
14181 Generate white noise, with 0.2 amplitude:
14182 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
14183 </pre></td></tr></table>
14184
14185 </li><li>
14186 Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
14187 <code>C* Audio Plugin Suite</code> (CAPS) library:
14188 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=file=caps:Click:c=c1=20'
14189 </pre></td></tr></table>
14190
14191 </li><li>
14192 Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
14193 <table><tr><td>&nbsp;</td><td><pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
14194 </pre></td></tr></table>
14195 </li></ul>
14196
14197 <a name="Commands-1"></a>
14198 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-1">34.33.2 Commands</a></h3>
14199
14200 <p>This filter supports the following commands:
14201 </p><dl compact="compact">
14202 <dt> &lsquo;<samp>cN</samp>&rsquo;</dt>
14203 <dd><p>Modify the <var>N</var>-th control value.
14204 </p>
14205 <p>If the specified value is not valid, it is ignored and prior one is kept.
14206 </p></dd>
14207 </dl>
14208
14209 <a name="lowpass"></a>
14210 <h2 class="section"><a href="ffmpeg-all.html#toc-lowpass">34.34 lowpass</a></h2>
14211
14212 <p>Apply a low-pass filter with 3dB point frequency.
14213 The filter can be either single-pole or double-pole (the default).
14214 The filter roll off at 6dB per pole per octave (20dB per pole per decade).
14215 </p>
14216 <p>The filter accepts the following options:
14217 </p>
14218 <dl compact="compact">
14219 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
14220 <dd><p>Set frequency in Hz. Default is 500.
14221 </p>
14222 </dd>
14223 <dt> &lsquo;<samp>poles, p</samp>&rsquo;</dt>
14224 <dd><p>Set number of poles. Default is 2.
14225 </p>
14226 </dd>
14227 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
14228 <dd><p>Set method to specify band-width of filter.
14229 </p><dl compact="compact">
14230 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14231 <dd><p>Hz
14232 </p></dd>
14233 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
14234 <dd><p>Q-Factor
14235 </p></dd>
14236 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
14237 <dd><p>octave
14238 </p></dd>
14239 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
14240 <dd><p>slope
14241 </p></dd>
14242 </dl>
14243
14244 </dd>
14245 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14246 <dd><p>Specify the band-width of a filter in width_type units.
14247 Applies only to double-pole filter.
14248 The default is 0.707q and gives a Butterworth response.
14249 </p></dd>
14250 </dl>
14251
14252 <a name="pan"></a>
14253 <h2 class="section"><a href="ffmpeg-all.html#toc-pan">34.35 pan</a></h2>
14254
14255 <p>Mix channels with specific gain levels. The filter accepts the output
14256 channel layout followed by a set of channels definitions.
14257 </p>
14258 <p>This filter is also designed to remap efficiently the channels of an audio
14259 stream.
14260 </p>
14261 <p>The filter accepts parameters of the form:
14262 &quot;<var>l</var>:<var>outdef</var>:<var>outdef</var>:...&quot;
14263 </p>
14264 <dl compact="compact">
14265 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
14266 <dd><p>output channel layout or number of channels
14267 </p>
14268 </dd>
14269 <dt> &lsquo;<samp>outdef</samp>&rsquo;</dt>
14270 <dd><p>output channel specification, of the form:
14271 &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[+[<var>gain</var>*]<var>in_name</var>...]&quot;
14272 </p>
14273 </dd>
14274 <dt> &lsquo;<samp>out_name</samp>&rsquo;</dt>
14275 <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
14276 number (c0, c1, etc.)
14277 </p>
14278 </dd>
14279 <dt> &lsquo;<samp>gain</samp>&rsquo;</dt>
14280 <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
14281 </p>
14282 </dd>
14283 <dt> &lsquo;<samp>in_name</samp>&rsquo;</dt>
14284 <dd><p>input channel to use, see out_name for details; it is not possible to mix
14285 named and numbered input channels
14286 </p></dd>
14287 </dl>
14288
14289 <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
14290 that specification will be renormalized so that the total is 1, thus
14291 avoiding clipping noise.
14292 </p>
14293 <a name="Mixing-examples"></a>
14294 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Mixing-examples">34.35.1 Mixing examples</a></h3>
14295
14296 <p>For example, if you want to down-mix from stereo to mono, but with a bigger
14297 factor for the left channel:
14298 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=1:c0=0.9*c0+0.1*c1
14299 </pre></td></tr></table>
14300
14301 <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
14302 7-channels surround:
14303 </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
14304 </pre></td></tr></table>
14305
14306 <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
14307 that should be preferred (see &quot;-ac&quot; option) unless you have very specific
14308 needs.
14309 </p>
14310 <a name="Remapping-examples"></a>
14311 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Remapping-examples">34.35.2 Remapping examples</a></h3>
14312
14313 <p>The channel remapping will be effective if, and only if:
14314 </p>
14315 <ul>
14316 <li> gain coefficients are zeroes or ones,
14317 </li><li> only one input per channel output,
14318 </li></ul>
14319
14320 <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
14321 channel mapping detected&quot;), and use an optimized and lossless method to do the
14322 remapping.
14323 </p>
14324 <p>For example, if you have a 5.1 source and want a stereo audio stream by
14325 dropping the extra channels:
14326 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FL : c1=FR&quot;
14327 </pre></td></tr></table>
14328
14329 <p>Given the same source, you can also switch front left and front right channels
14330 and keep the input channel layout:
14331 </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;
14332 </pre></td></tr></table>
14333
14334 <p>If the input is a stereo audio stream, you can mute the front left channel (and
14335 still keep the stereo channel layout) with:
14336 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo:c1=c1&quot;
14337 </pre></td></tr></table>
14338
14339 <p>Still with a stereo audio stream input, you can copy the right channel in both
14340 front left and right:
14341 </p><table><tr><td>&nbsp;</td><td><pre class="example">pan=&quot;stereo: c0=FR : c1=FR&quot;
14342 </pre></td></tr></table>
14343
14344 <a name="replaygain"></a>
14345 <h2 class="section"><a href="ffmpeg-all.html#toc-replaygain">34.36 replaygain</a></h2>
14346
14347 <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
14348 outputs it unchanged.
14349 At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
14350 </p>
14351 <a name="resample"></a>
14352 <h2 class="section"><a href="ffmpeg-all.html#toc-resample">34.37 resample</a></h2>
14353
14354 <p>Convert the audio sample format, sample rate and channel layout. This filter is
14355 not meant to be used directly.
14356 </p>
14357 <a name="silencedetect"></a>
14358 <h2 class="section"><a href="ffmpeg-all.html#toc-silencedetect">34.38 silencedetect</a></h2>
14359
14360 <p>Detect silence in an audio stream.
14361 </p>
14362 <p>This filter logs a message when it detects that the input audio volume is less
14363 or equal to a noise tolerance value for a duration greater or equal to the
14364 minimum detected noise duration.
14365 </p>
14366 <p>The printed times and duration are expressed in seconds.
14367 </p>
14368 <p>The filter accepts the following options:
14369 </p>
14370 <dl compact="compact">
14371 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
14372 <dd><p>Set silence duration until notification (default is 2 seconds).
14373 </p>
14374 </dd>
14375 <dt> &lsquo;<samp>noise, n</samp>&rsquo;</dt>
14376 <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
14377 specified value) or amplitude ratio. Default is -60dB, or 0.001.
14378 </p></dd>
14379 </dl>
14380
14381 <a name="Examples-24"></a>
14382 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-24">34.38.1 Examples</a></h3>
14383
14384 <ul>
14385 <li>
14386 Detect 5 seconds of silence with -50dB noise tolerance:
14387 <table><tr><td>&nbsp;</td><td><pre class="example">silencedetect=n=-50dB:d=5
14388 </pre></td></tr></table>
14389
14390 </li><li>
14391 Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
14392 tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
14393 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
14394 </pre></td></tr></table>
14395 </li></ul>
14396
14397 <a name="treble"></a>
14398 <h2 class="section"><a href="ffmpeg-all.html#toc-treble">34.39 treble</a></h2>
14399
14400 <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
14401 shelving filter with a response similar to that of a standard
14402 hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
14403 </p>
14404 <p>The filter accepts the following options:
14405 </p>
14406 <dl compact="compact">
14407 <dt> &lsquo;<samp>gain, g</samp>&rsquo;</dt>
14408 <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
14409 Nyquist frequency. Its useful range is about -20 (for a large cut)
14410 to +20 (for a large boost). Beware of clipping when using a positive gain.
14411 </p>
14412 </dd>
14413 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
14414 <dd><p>Set the filter&rsquo;s central frequency and so can be used
14415 to extend or reduce the frequency range to be boosted or cut.
14416 The default value is <code>3000</code> Hz.
14417 </p>
14418 </dd>
14419 <dt> &lsquo;<samp>width_type</samp>&rsquo;</dt>
14420 <dd><p>Set method to specify band-width of filter.
14421 </p><dl compact="compact">
14422 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
14423 <dd><p>Hz
14424 </p></dd>
14425 <dt> &lsquo;<samp>q</samp>&rsquo;</dt>
14426 <dd><p>Q-Factor
14427 </p></dd>
14428 <dt> &lsquo;<samp>o</samp>&rsquo;</dt>
14429 <dd><p>octave
14430 </p></dd>
14431 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
14432 <dd><p>slope
14433 </p></dd>
14434 </dl>
14435
14436 </dd>
14437 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
14438 <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
14439 </p></dd>
14440 </dl>
14441
14442 <a name="volume"></a>
14443 <h2 class="section"><a href="ffmpeg-all.html#toc-volume">34.40 volume</a></h2>
14444
14445 <p>Adjust the input audio volume.
14446 </p>
14447 <p>The filter accepts the following options:
14448 </p>
14449 <dl compact="compact">
14450 <dt> &lsquo;<samp>volume</samp>&rsquo;</dt>
14451 <dd><p>Expresses how the audio volume will be increased or decreased.
14452 </p>
14453 <p>Output values are clipped to the maximum value.
14454 </p>
14455 <p>The output audio volume is given by the relation:
14456 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
14457 </pre></td></tr></table>
14458
14459 <p>Default value for <var>volume</var> is 1.0.
14460 </p>
14461 </dd>
14462 <dt> &lsquo;<samp>precision</samp>&rsquo;</dt>
14463 <dd><p>Set the mathematical precision.
14464 </p>
14465 <p>This determines which input sample formats will be allowed, which affects the
14466 precision of the volume scaling.
14467 </p>
14468 <dl compact="compact">
14469 <dt> &lsquo;<samp>fixed</samp>&rsquo;</dt>
14470 <dd><p>8-bit fixed-point; limits input sample format to U8, S16, and S32.
14471 </p></dd>
14472 <dt> &lsquo;<samp>float</samp>&rsquo;</dt>
14473 <dd><p>32-bit floating-point; limits input sample format to FLT. (default)
14474 </p></dd>
14475 <dt> &lsquo;<samp>double</samp>&rsquo;</dt>
14476 <dd><p>64-bit floating-point; limits input sample format to DBL.
14477 </p></dd>
14478 </dl>
14479 </dd>
14480 </dl>
14481
14482 <a name="Examples-70"></a>
14483 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-70">34.40.1 Examples</a></h3>
14484
14485 <ul>
14486 <li>
14487 Halve the input audio volume:
14488 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=0.5
14489 volume=volume=1/2
14490 volume=volume=-6.0206dB
14491 </pre></td></tr></table>
14492
14493 <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
14494 omitted, for example like in:
14495 </p><table><tr><td>&nbsp;</td><td><pre class="example">volume=0.5
14496 </pre></td></tr></table>
14497
14498 </li><li>
14499 Increase input audio power by 6 decibels using fixed-point precision:
14500 <table><tr><td>&nbsp;</td><td><pre class="example">volume=volume=6dB:precision=fixed
14501 </pre></td></tr></table>
14502 </li></ul>
14503
14504 <a name="volumedetect"></a>
14505 <h2 class="section"><a href="ffmpeg-all.html#toc-volumedetect">34.41 volumedetect</a></h2>
14506
14507 <p>Detect the volume of the input video.
14508 </p>
14509 <p>The filter has no parameters. The input is not modified. Statistics about
14510 the volume will be printed in the log when the input stream end is reached.
14511 </p>
14512 <p>In particular it will show the mean volume (root mean square), maximum
14513 volume (on a per-sample basis), and the beginning of a histogram of the
14514 registered volume values (from the maximum value to a cumulated 1/1000 of
14515 the samples).
14516 </p>
14517 <p>All volumes are in decibels relative to the maximum PCM value.
14518 </p>
14519 <a name="Examples-51"></a>
14520 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-51">34.41.1 Examples</a></h3>
14521
14522 <p>Here is an excerpt of the output:
14523 </p><table><tr><td>&nbsp;</td><td><pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
14524 [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
14525 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
14526 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
14527 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
14528 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
14529 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
14530 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
14531 [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
14532 </pre></td></tr></table>
14533
14534 <p>It means that:
14535 </p><ul>
14536 <li>
14537 The mean square energy is approximately -27 dB, or 10^-2.7.
14538 </li><li>
14539 The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
14540 </li><li>
14541 There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
14542 </li></ul>
14543
14544 <p>In other words, raising the volume by +4 dB does not cause any clipping,
14545 raising it by +5 dB causes clipping for 6 samples, etc.
14546 </p>
14547
14548 <a name="Audio-Sources"></a>
14549 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sources">35. Audio Sources</a></h1>
14550
14551 <p>Below is a description of the currently available audio sources.
14552 </p>
14553 <a name="abuffer"></a>
14554 <h2 class="section"><a href="ffmpeg-all.html#toc-abuffer">35.1 abuffer</a></h2>
14555
14556 <p>Buffer audio frames, and make them available to the filter chain.
14557 </p>
14558 <p>This source is mainly intended for a programmatic use, in particular
14559 through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
14560 </p>
14561 <p>It accepts the following named parameters:
14562 </p>
14563 <dl compact="compact">
14564 <dt> &lsquo;<samp>time_base</samp>&rsquo;</dt>
14565 <dd><p>Timebase which will be used for timestamps of submitted frames. It must be
14566 either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
14567 </p>
14568 </dd>
14569 <dt> &lsquo;<samp>sample_rate</samp>&rsquo;</dt>
14570 <dd><p>The sample rate of the incoming audio buffers.
14571 </p>
14572 </dd>
14573 <dt> &lsquo;<samp>sample_fmt</samp>&rsquo;</dt>
14574 <dd><p>The sample format of the incoming audio buffers.
14575 Either a sample format name or its corresponging integer representation from
14576 the enum AVSampleFormat in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
14577 </p>
14578 </dd>
14579 <dt> &lsquo;<samp>channel_layout</samp>&rsquo;</dt>
14580 <dd><p>The channel layout of the incoming audio buffers.
14581 Either a channel layout name from channel_layout_map in
14582 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
14583 from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
14584 </p>
14585 </dd>
14586 <dt> &lsquo;<samp>channels</samp>&rsquo;</dt>
14587 <dd><p>The number of channels of the incoming audio buffers.
14588 If both <var>channels</var> and <var>channel_layout</var> are specified, then they
14589 must be consistent.
14590 </p>
14591 </dd>
14592 </dl>
14593
14594 <a name="Examples-46"></a>
14595 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-46">35.1.1 Examples</a></h3>
14596
14597 <table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
14598 </pre></td></tr></table>
14599
14600 <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
14601 Since the sample format with name &quot;s16p&quot; corresponds to the number
14602 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
14603 equivalent to:
14604 </p><table><tr><td>&nbsp;</td><td><pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
14605 </pre></td></tr></table>
14606
14607 <a name="aevalsrc"></a>
14608 <h2 class="section"><a href="ffmpeg-all.html#toc-aevalsrc">35.2 aevalsrc</a></h2>
14609
14610 <p>Generate an audio signal specified by an expression.
14611 </p>
14612 <p>This source accepts in input one or more expressions (one for each
14613 channel), which are evaluated and used to generate a corresponding
14614 audio signal.
14615 </p>
14616 <p>This source accepts the following options:
14617 </p>
14618 <dl compact="compact">
14619 <dt> &lsquo;<samp>exprs</samp>&rsquo;</dt>
14620 <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
14621 &lsquo;<samp>channel_layout</samp>&rsquo; option is not specified, the selected channel layout
14622 depends on the number of provided expressions. Otherwise the last
14623 specified expression is applied to the remaining output channels.
14624 </p>
14625 </dd>
14626 <dt> &lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
14627 <dd><p>Set the channel layout. The number of channels in the specified layout
14628 must be equal to the number of specified expressions.
14629 </p>
14630 </dd>
14631 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
14632 <dd><p>Set the minimum duration of the sourced audio. See the function
14633 <code>av_parse_time()</code> for the accepted format.
14634 Note that the resulting duration may be greater than the specified
14635 duration, as the generated audio is always cut at the end of a
14636 complete frame.
14637 </p>
14638 <p>If not specified, or the expressed duration is negative, the audio is
14639 supposed to be generated forever.
14640 </p>
14641 </dd>
14642 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
14643 <dd><p>Set the number of samples per channel per each output frame,
14644 default to 1024.
14645 </p>
14646 </dd>
14647 <dt> &lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
14648 <dd><p>Specify the sample rate, default to 44100.
14649 </p></dd>
14650 </dl>
14651
14652 <p>Each expression in <var>exprs</var> can contain the following constants:
14653 </p>
14654 <dl compact="compact">
14655 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
14656 <dd><p>number of the evaluated sample, starting from 0
14657 </p>
14658 </dd>
14659 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
14660 <dd><p>time of the evaluated sample expressed in seconds, starting from 0
14661 </p>
14662 </dd>
14663 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
14664 <dd><p>sample rate
14665 </p>
14666 </dd>
14667 </dl>
14668
14669 <a name="Examples-32"></a>
14670 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-32">35.2.1 Examples</a></h3>
14671
14672 <ul>
14673 <li>
14674 Generate silence:
14675 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=0
14676 </pre></td></tr></table>
14677
14678 </li><li>
14679 Generate a sin signal with frequency of 440 Hz, set sample rate to
14680 8000 Hz:
14681 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
14682 </pre></td></tr></table>
14683
14684 </li><li>
14685 Generate a two channels signal, specify the channel layout (Front
14686 Center + Back Center) explicitly:
14687 <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;
14688 </pre></td></tr></table>
14689
14690 </li><li>
14691 Generate white noise:
14692 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;-2+random(0)&quot;
14693 </pre></td></tr></table>
14694
14695 </li><li>
14696 Generate an amplitude modulated signal:
14697 <table><tr><td>&nbsp;</td><td><pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
14698 </pre></td></tr></table>
14699
14700 </li><li>
14701 Generate 2.5 Hz binaural beats on a 360 Hz carrier:
14702 <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;
14703 </pre></td></tr></table>
14704
14705 </li></ul>
14706
14707 <a name="anullsrc"></a>
14708 <h2 class="section"><a href="ffmpeg-all.html#toc-anullsrc">35.3 anullsrc</a></h2>
14709
14710 <p>Null audio source, return unprocessed audio frames. It is mainly useful
14711 as a template and to be employed in analysis / debugging tools, or as
14712 the source for filters which ignore the input data (for example the sox
14713 synth filter).
14714 </p>
14715 <p>This source accepts the following options:
14716 </p>
14717 <dl compact="compact">
14718 <dt> &lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
14719 <dd>
14720 <p>Specify the channel layout, and can be either an integer or a string
14721 representing a channel layout. The default value of <var>channel_layout</var>
14722 is &quot;stereo&quot;.
14723 </p>
14724 <p>Check the channel_layout_map definition in
14725 &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
14726 channel layout values.
14727 </p>
14728 </dd>
14729 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
14730 <dd><p>Specify the sample rate, and defaults to 44100.
14731 </p>
14732 </dd>
14733 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
14734 <dd><p>Set the number of samples per requested frames.
14735 </p>
14736 </dd>
14737 </dl>
14738
14739 <a name="Examples-91"></a>
14740 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-91">35.3.1 Examples</a></h3>
14741
14742 <ul>
14743 <li>
14744 Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
14745 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=4
14746 </pre></td></tr></table>
14747
14748 </li><li>
14749 Do the same operation with a more obvious syntax:
14750 <table><tr><td>&nbsp;</td><td><pre class="example">anullsrc=r=48000:cl=mono
14751 </pre></td></tr></table>
14752 </li></ul>
14753
14754 <p>All the parameters need to be explicitly defined.
14755 </p>
14756 <a name="flite"></a>
14757 <h2 class="section"><a href="ffmpeg-all.html#toc-flite">35.4 flite</a></h2>
14758
14759 <p>Synthesize a voice utterance using the libflite library.
14760 </p>
14761 <p>To enable compilation of this filter you need to configure FFmpeg with
14762 <code>--enable-libflite</code>.
14763 </p>
14764 <p>Note that the flite library is not thread-safe.
14765 </p>
14766 <p>The filter accepts the following options:
14767 </p>
14768 <dl compact="compact">
14769 <dt> &lsquo;<samp>list_voices</samp>&rsquo;</dt>
14770 <dd><p>If set to 1, list the names of the available voices and exit
14771 immediately. Default value is 0.
14772 </p>
14773 </dd>
14774 <dt> &lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
14775 <dd><p>Set the maximum number of samples per frame. Default value is 512.
14776 </p>
14777 </dd>
14778 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
14779 <dd><p>Set the filename containing the text to speak.
14780 </p>
14781 </dd>
14782 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
14783 <dd><p>Set the text to speak.
14784 </p>
14785 </dd>
14786 <dt> &lsquo;<samp>voice, v</samp>&rsquo;</dt>
14787 <dd><p>Set the voice to use for the speech synthesis. Default value is
14788 <code>kal</code>. See also the <var>list_voices</var> option.
14789 </p></dd>
14790 </dl>
14791
14792 <a name="Examples-13"></a>
14793 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-13">35.4.1 Examples</a></h3>
14794
14795 <ul>
14796 <li>
14797 Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthetize the text using the
14798 standard flite voice:
14799 <table><tr><td>&nbsp;</td><td><pre class="example">flite=textfile=speech.txt
14800 </pre></td></tr></table>
14801
14802 </li><li>
14803 Read the specified text selecting the <code>slt</code> voice:
14804 <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
14805 </pre></td></tr></table>
14806
14807 </li><li>
14808 Input text to ffmpeg:
14809 <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
14810 </pre></td></tr></table>
14811
14812 </li><li>
14813 Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
14814 the <code>lavfi</code> device:
14815 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
14816 </pre></td></tr></table>
14817 </li></ul>
14818
14819 <p>For more information about libflite, check:
14820 <a href="http://www.speech.cs.cmu.edu/flite/">http://www.speech.cs.cmu.edu/flite/</a>
14821 </p>
14822 <a name="sine"></a>
14823 <h2 class="section"><a href="ffmpeg-all.html#toc-sine">35.5 sine</a></h2>
14824
14825 <p>Generate an audio signal made of a sine wave with amplitude 1/8.
14826 </p>
14827 <p>The audio signal is bit-exact.
14828 </p>
14829 <p>The filter accepts the following options:
14830 </p>
14831 <dl compact="compact">
14832 <dt> &lsquo;<samp>frequency, f</samp>&rsquo;</dt>
14833 <dd><p>Set the carrier frequency. Default is 440 Hz.
14834 </p>
14835 </dd>
14836 <dt> &lsquo;<samp>beep_factor, b</samp>&rsquo;</dt>
14837 <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
14838 the carrier frequency. Default is 0, meaning the beep is disabled.
14839 </p>
14840 </dd>
14841 <dt> &lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
14842 <dd><p>Specify the sample rate, default is 44100.
14843 </p>
14844 </dd>
14845 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
14846 <dd><p>Specify the duration of the generated audio stream.
14847 </p>
14848 </dd>
14849 <dt> &lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
14850 <dd><p>Set the number of samples per output frame, default is 1024.
14851 </p></dd>
14852 </dl>
14853
14854 <a name="Examples-50"></a>
14855 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-50">35.5.1 Examples</a></h3>
14856
14857 <ul>
14858 <li>
14859 Generate a simple 440 Hz sine wave:
14860 <table><tr><td>&nbsp;</td><td><pre class="example">sine
14861 </pre></td></tr></table>
14862
14863 </li><li>
14864 Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
14865 <table><tr><td>&nbsp;</td><td><pre class="example">sine=220:4:d=5
14866 sine=f=220:b=4:d=5
14867 sine=frequency=220:beep_factor=4:duration=5
14868 </pre></td></tr></table>
14869
14870 </li></ul>
14871
14872
14873 <a name="Audio-Sinks"></a>
14874 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sinks">36. Audio Sinks</a></h1>
14875
14876 <p>Below is a description of the currently available audio sinks.
14877 </p>
14878 <a name="abuffersink"></a>
14879 <h2 class="section"><a href="ffmpeg-all.html#toc-abuffersink">36.1 abuffersink</a></h2>
14880
14881 <p>Buffer audio frames, and make them available to the end of filter chain.
14882 </p>
14883 <p>This sink is mainly intended for programmatic use, in particular
14884 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
14885 or the options system.
14886 </p>
14887 <p>It accepts a pointer to an AVABufferSinkContext structure, which
14888 defines the incoming buffers&rsquo; formats, to be passed as the opaque
14889 parameter to <code>avfilter_init_filter</code> for initialization.
14890 </p>
14891 <a name="anullsink"></a>
14892 <h2 class="section"><a href="ffmpeg-all.html#toc-anullsink">36.2 anullsink</a></h2>
14893
14894 <p>Null audio sink, do absolutely nothing with the input audio. It is
14895 mainly useful as a template and to be employed in analysis / debugging
14896 tools.
14897 </p>
14898
14899 <a name="Video-Filters"></a>
14900 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Filters">37. Video Filters</a></h1>
14901
14902 <p>When you configure your FFmpeg build, you can disable any of the
14903 existing filters using <code>--disable-filters</code>.
14904 The configure output will show the video filters included in your
14905 build.
14906 </p>
14907 <p>Below is a description of the currently available video filters.
14908 </p>
14909 <a name="alphaextract"></a>
14910 <h2 class="section"><a href="ffmpeg-all.html#toc-alphaextract">37.1 alphaextract</a></h2>
14911
14912 <p>Extract the alpha component from the input as a grayscale video. This
14913 is especially useful with the <var>alphamerge</var> filter.
14914 </p>
14915 <a name="alphamerge"></a>
14916 <h2 class="section"><a href="ffmpeg-all.html#toc-alphamerge">37.2 alphamerge</a></h2>
14917
14918 <p>Add or replace the alpha component of the primary input with the
14919 grayscale value of a second input. This is intended for use with
14920 <var>alphaextract</var> to allow the transmission or storage of frame
14921 sequences that have alpha in a format that doesn&rsquo;t support an alpha
14922 channel.
14923 </p>
14924 <p>For example, to reconstruct full frames from a normal YUV-encoded video
14925 and a separate video created with <var>alphaextract</var>, you might use:
14926 </p><table><tr><td>&nbsp;</td><td><pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
14927 </pre></td></tr></table>
14928
14929 <p>Since this filter is designed for reconstruction, it operates on frame
14930 sequences without considering timestamps, and terminates when either
14931 input reaches end of stream. This will cause problems if your encoding
14932 pipeline drops frames. If you&rsquo;re trying to apply an image as an
14933 overlay to a video stream, consider the <var>overlay</var> filter instead.
14934 </p>
14935 <a name="ass"></a>
14936 <h2 class="section"><a href="ffmpeg-all.html#toc-ass">37.3 ass</a></h2>
14937
14938 <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
14939 and libavformat to work. On the other hand, it is limited to ASS (Advanced
14940 Substation Alpha) subtitles files.
14941 </p>
14942 <a name="bbox"></a>
14943 <h2 class="section"><a href="ffmpeg-all.html#toc-bbox">37.4 bbox</a></h2>
14944
14945 <p>Compute the bounding box for the non-black pixels in the input frame
14946 luminance plane.
14947 </p>
14948 <p>This filter computes the bounding box containing all the pixels with a
14949 luminance value greater than the minimum allowed value.
14950 The parameters describing the bounding box are printed on the filter
14951 log.
14952 </p>
14953 <p>The filter accepts the following option:
14954 </p>
14955 <dl compact="compact">
14956 <dt> &lsquo;<samp>min_val</samp>&rsquo;</dt>
14957 <dd><p>Set the minimal luminance value. Default is <code>16</code>.
14958 </p></dd>
14959 </dl>
14960
14961 <a name="blackdetect"></a>
14962 <h2 class="section"><a href="ffmpeg-all.html#toc-blackdetect">37.5 blackdetect</a></h2>
14963
14964 <p>Detect video intervals that are (almost) completely black. Can be
14965 useful to detect chapter transitions, commercials, or invalid
14966 recordings. Output lines contains the time for the start, end and
14967 duration of the detected black interval expressed in seconds.
14968 </p>
14969 <p>In order to display the output lines, you need to set the loglevel at
14970 least to the AV_LOG_INFO value.
14971 </p>
14972 <p>The filter accepts the following options:
14973 </p>
14974 <dl compact="compact">
14975 <dt> &lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
14976 <dd><p>Set the minimum detected black duration expressed in seconds. It must
14977 be a non-negative floating point number.
14978 </p>
14979 <p>Default value is 2.0.
14980 </p>
14981 </dd>
14982 <dt> &lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
14983 <dd><p>Set the threshold for considering a picture &quot;black&quot;.
14984 Express the minimum value for the ratio:
14985 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
14986 </pre></td></tr></table>
14987
14988 <p>for which a picture is considered black.
14989 Default value is 0.98.
14990 </p>
14991 </dd>
14992 <dt> &lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
14993 <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
14994 </p>
14995 <p>The threshold expresses the maximum pixel luminance value for which a
14996 pixel is considered &quot;black&quot;. The provided value is scaled according to
14997 the following equation:
14998 </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>
14999 </pre></td></tr></table>
15000
15001 <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
15002 the input video format, the range is [0-255] for YUV full-range
15003 formats and [16-235] for YUV non full-range formats.
15004 </p>
15005 <p>Default value is 0.10.
15006 </p></dd>
15007 </dl>
15008
15009 <p>The following example sets the maximum pixel threshold to the minimum
15010 value, and detects only black intervals of 2 or more seconds:
15011 </p><table><tr><td>&nbsp;</td><td><pre class="example">blackdetect=d=2:pix_th=0.00
15012 </pre></td></tr></table>
15013
15014 <a name="blackframe"></a>
15015 <h2 class="section"><a href="ffmpeg-all.html#toc-blackframe">37.6 blackframe</a></h2>
15016
15017 <p>Detect frames that are (almost) completely black. Can be useful to
15018 detect chapter transitions or commercials. Output lines consist of
15019 the frame number of the detected frame, the percentage of blackness,
15020 the position in the file if known or -1 and the timestamp in seconds.
15021 </p>
15022 <p>In order to display the output lines, you need to set the loglevel at
15023 least to the AV_LOG_INFO value.
15024 </p>
15025 <p>The filter accepts the following options:
15026 </p>
15027 <dl compact="compact">
15028 <dt> &lsquo;<samp>amount</samp>&rsquo;</dt>
15029 <dd><p>Set the percentage of the pixels that have to be below the threshold, defaults
15030 to <code>98</code>.
15031 </p>
15032 </dd>
15033 <dt> &lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
15034 <dd><p>Set the threshold below which a pixel value is considered black, defaults to
15035 <code>32</code>.
15036 </p>
15037 </dd>
15038 </dl>
15039
15040 <a name="blend"></a>
15041 <h2 class="section"><a href="ffmpeg-all.html#toc-blend">37.7 blend</a></h2>
15042
15043 <p>Blend two video frames into each other.
15044 </p>
15045 <p>It takes two input streams and outputs one stream, the first input is the
15046 &quot;top&quot; layer and second input is &quot;bottom&quot; layer.
15047 Output terminates when shortest input terminates.
15048 </p>
15049 <p>A description of the accepted options follows.
15050 </p>
15051 <dl compact="compact">
15052 <dt> &lsquo;<samp>c0_mode</samp>&rsquo;</dt>
15053 <dt> &lsquo;<samp>c1_mode</samp>&rsquo;</dt>
15054 <dt> &lsquo;<samp>c2_mode</samp>&rsquo;</dt>
15055 <dt> &lsquo;<samp>c3_mode</samp>&rsquo;</dt>
15056 <dt> &lsquo;<samp>all_mode</samp>&rsquo;</dt>
15057 <dd><p>Set blend mode for specific pixel component or all pixel components in case
15058 of <var>all_mode</var>. Default value is <code>normal</code>.
15059 </p>
15060 <p>Available values for component modes are:
15061 </p><dl compact="compact">
15062 <dt> &lsquo;<samp>addition</samp>&rsquo;</dt>
15063 <dt> &lsquo;<samp>and</samp>&rsquo;</dt>
15064 <dt> &lsquo;<samp>average</samp>&rsquo;</dt>
15065 <dt> &lsquo;<samp>burn</samp>&rsquo;</dt>
15066 <dt> &lsquo;<samp>darken</samp>&rsquo;</dt>
15067 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
15068 <dt> &lsquo;<samp>divide</samp>&rsquo;</dt>
15069 <dt> &lsquo;<samp>dodge</samp>&rsquo;</dt>
15070 <dt> &lsquo;<samp>exclusion</samp>&rsquo;</dt>
15071 <dt> &lsquo;<samp>hardlight</samp>&rsquo;</dt>
15072 <dt> &lsquo;<samp>lighten</samp>&rsquo;</dt>
15073 <dt> &lsquo;<samp>multiply</samp>&rsquo;</dt>
15074 <dt> &lsquo;<samp>negation</samp>&rsquo;</dt>
15075 <dt> &lsquo;<samp>normal</samp>&rsquo;</dt>
15076 <dt> &lsquo;<samp>or</samp>&rsquo;</dt>
15077 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
15078 <dt> &lsquo;<samp>phoenix</samp>&rsquo;</dt>
15079 <dt> &lsquo;<samp>pinlight</samp>&rsquo;</dt>
15080 <dt> &lsquo;<samp>reflect</samp>&rsquo;</dt>
15081 <dt> &lsquo;<samp>screen</samp>&rsquo;</dt>
15082 <dt> &lsquo;<samp>softlight</samp>&rsquo;</dt>
15083 <dt> &lsquo;<samp>subtract</samp>&rsquo;</dt>
15084 <dt> &lsquo;<samp>vividlight</samp>&rsquo;</dt>
15085 <dt> &lsquo;<samp>xor</samp>&rsquo;</dt>
15086 </dl>
15087
15088 </dd>
15089 <dt> &lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
15090 <dt> &lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
15091 <dt> &lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
15092 <dt> &lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
15093 <dt> &lsquo;<samp>all_opacity</samp>&rsquo;</dt>
15094 <dd><p>Set blend opacity for specific pixel component or all pixel components in case
15095 of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
15096 </p>
15097 </dd>
15098 <dt> &lsquo;<samp>c0_expr</samp>&rsquo;</dt>
15099 <dt> &lsquo;<samp>c1_expr</samp>&rsquo;</dt>
15100 <dt> &lsquo;<samp>c2_expr</samp>&rsquo;</dt>
15101 <dt> &lsquo;<samp>c3_expr</samp>&rsquo;</dt>
15102 <dt> &lsquo;<samp>all_expr</samp>&rsquo;</dt>
15103 <dd><p>Set blend expression for specific pixel component or all pixel components in case
15104 of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
15105 </p>
15106 <p>The expressions can use the following variables:
15107 </p>
15108 <dl compact="compact">
15109 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
15110 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
15111 </p>
15112 </dd>
15113 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
15114 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
15115 <dd><p>the coordinates of the current sample
15116 </p>
15117 </dd>
15118 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
15119 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
15120 <dd><p>the width and height of currently filtered plane
15121 </p>
15122 </dd>
15123 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
15124 <dt> &lsquo;<samp>SH</samp>&rsquo;</dt>
15125 <dd><p>Width and height scale depending on the currently filtered plane. It is the
15126 ratio between the corresponding luma plane number of pixels and the current
15127 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
15128 <code>0.5,0.5</code> for chroma planes.
15129 </p>
15130 </dd>
15131 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
15132 <dd><p>Time of the current frame, expressed in seconds.
15133 </p>
15134 </dd>
15135 <dt> &lsquo;<samp>TOP, A</samp>&rsquo;</dt>
15136 <dd><p>Value of pixel component at current location for first video frame (top layer).
15137 </p>
15138 </dd>
15139 <dt> &lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
15140 <dd><p>Value of pixel component at current location for second video frame (bottom layer).
15141 </p></dd>
15142 </dl>
15143
15144 </dd>
15145 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
15146 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
15147 </p></dd>
15148 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
15149 <dd><p>Continue applying the last bottom frame after the end of the stream. A value of
15150 <code>0</code> disable the filter after the last frame of the bottom layer is reached.
15151 Default is <code>1</code>.
15152 </p></dd>
15153 </dl>
15154
15155 <a name="Examples-25"></a>
15156 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-25">37.7.1 Examples</a></h3>
15157
15158 <ul>
15159 <li>
15160 Apply transition from bottom layer to top layer in first 10 seconds:
15161 <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)))'
15162 </pre></td></tr></table>
15163
15164 </li><li>
15165 Apply 1x1 checkerboard effect:
15166 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
15167 </pre></td></tr></table>
15168
15169 </li><li>
15170 Apply uncover left effect:
15171 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
15172 </pre></td></tr></table>
15173
15174 </li><li>
15175 Apply uncover down effect:
15176 <table><tr><td>&nbsp;</td><td><pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
15177 </pre></td></tr></table>
15178
15179 </li><li>
15180 Apply uncover up-left effect:
15181 <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)'
15182 </pre></td></tr></table>
15183 </li></ul>
15184
15185 <a name="boxblur"></a>
15186 <h2 class="section"><a href="ffmpeg-all.html#toc-boxblur">37.8 boxblur</a></h2>
15187
15188 <p>Apply boxblur algorithm to the input video.
15189 </p>
15190 <p>The filter accepts the following options:
15191 </p>
15192 <dl compact="compact">
15193 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
15194 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
15195 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
15196 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
15197 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
15198 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
15199 </dl>
15200
15201 <p>A description of the accepted options follows.
15202 </p>
15203 <dl compact="compact">
15204 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
15205 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
15206 <dt> &lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
15207 <dd><p>Set an expression for the box radius in pixels used for blurring the
15208 corresponding input plane.
15209 </p>
15210 <p>The radius value must be a non-negative number, and must not be
15211 greater than the value of the expression <code>min(w,h)/2</code> for the
15212 luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
15213 planes.
15214 </p>
15215 <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
15216 &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
15217 corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
15218 </p>
15219 <p>The expressions can contain the following constants:
15220 </p><dl compact="compact">
15221 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
15222 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
15223 <dd><p>the input width and height in pixels
15224 </p>
15225 </dd>
15226 <dt> &lsquo;<samp>cw</samp>&rsquo;</dt>
15227 <dt> &lsquo;<samp>ch</samp>&rsquo;</dt>
15228 <dd><p>the input chroma image width and height in pixels
15229 </p>
15230 </dd>
15231 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
15232 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
15233 <dd><p>horizontal and vertical chroma subsample values. For example for the
15234 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15235 </p></dd>
15236 </dl>
15237
15238 </dd>
15239 <dt> &lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
15240 <dt> &lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
15241 <dt> &lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
15242 <dd><p>Specify how many times the boxblur filter is applied to the
15243 corresponding plane.
15244 </p>
15245 <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
15246 &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
15247 corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
15248 </p>
15249 <p>A value of 0 will disable the effect.
15250 </p></dd>
15251 </dl>
15252
15253 <a name="Examples-83"></a>
15254 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-83">37.8.1 Examples</a></h3>
15255
15256 <ul>
15257 <li>
15258 Apply a boxblur filter with luma, chroma, and alpha radius
15259 set to 2:
15260 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=luma_radius=2:luma_power=1
15261 boxblur=2:1
15262 </pre></td></tr></table>
15263
15264 </li><li>
15265 Set luma radius to 2, alpha and chroma radius to 0:
15266 <table><tr><td>&nbsp;</td><td><pre class="example">boxblur=2:1:cr=0:ar=0
15267 </pre></td></tr></table>
15268
15269 </li><li>
15270 Set luma and chroma radius to a fraction of the video dimension:
15271 <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
15272 </pre></td></tr></table>
15273 </li></ul>
15274
15275 <a name="colorbalance"></a>
15276 <h2 class="section"><a href="ffmpeg-all.html#toc-colorbalance">37.9 colorbalance</a></h2>
15277 <p>Modify intensity of primary colors (red, green and blue) of input frames.
15278 </p>
15279 <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
15280 regions for the red-cyan, green-magenta or blue-yellow balance.
15281 </p>
15282 <p>A positive adjustment value shifts the balance towards the primary color, a negative
15283 value towards the complementary color.
15284 </p>
15285 <p>The filter accepts the following options:
15286 </p>
15287 <dl compact="compact">
15288 <dt> &lsquo;<samp>rs</samp>&rsquo;</dt>
15289 <dt> &lsquo;<samp>gs</samp>&rsquo;</dt>
15290 <dt> &lsquo;<samp>bs</samp>&rsquo;</dt>
15291 <dd><p>Adjust red, green and blue shadows (darkest pixels).
15292 </p>
15293 </dd>
15294 <dt> &lsquo;<samp>rm</samp>&rsquo;</dt>
15295 <dt> &lsquo;<samp>gm</samp>&rsquo;</dt>
15296 <dt> &lsquo;<samp>bm</samp>&rsquo;</dt>
15297 <dd><p>Adjust red, green and blue midtones (medium pixels).
15298 </p>
15299 </dd>
15300 <dt> &lsquo;<samp>rh</samp>&rsquo;</dt>
15301 <dt> &lsquo;<samp>gh</samp>&rsquo;</dt>
15302 <dt> &lsquo;<samp>bh</samp>&rsquo;</dt>
15303 <dd><p>Adjust red, green and blue highlights (brightest pixels).
15304 </p>
15305 <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
15306 </p></dd>
15307 </dl>
15308
15309 <a name="Examples-57"></a>
15310 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-57">37.9.1 Examples</a></h3>
15311
15312 <ul>
15313 <li>
15314 Add red color cast to shadows:
15315 <table><tr><td>&nbsp;</td><td><pre class="example">colorbalance=rs=.3
15316 </pre></td></tr></table>
15317 </li></ul>
15318
15319 <a name="colorchannelmixer"></a>
15320 <h2 class="section"><a href="ffmpeg-all.html#toc-colorchannelmixer">37.10 colorchannelmixer</a></h2>
15321
15322 <p>Adjust video input frames by re-mixing color channels.
15323 </p>
15324 <p>This filter modifies a color channel by adding the values associated to
15325 the other channels of the same pixels. For example if the value to
15326 modify is red, the output value will be:
15327 </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>
15328 </pre></td></tr></table>
15329
15330 <p>The filter accepts the following options:
15331 </p>
15332 <dl compact="compact">
15333 <dt> &lsquo;<samp>rr</samp>&rsquo;</dt>
15334 <dt> &lsquo;<samp>rg</samp>&rsquo;</dt>
15335 <dt> &lsquo;<samp>rb</samp>&rsquo;</dt>
15336 <dt> &lsquo;<samp>ra</samp>&rsquo;</dt>
15337 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
15338 Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
15339 </p>
15340 </dd>
15341 <dt> &lsquo;<samp>gr</samp>&rsquo;</dt>
15342 <dt> &lsquo;<samp>gg</samp>&rsquo;</dt>
15343 <dt> &lsquo;<samp>gb</samp>&rsquo;</dt>
15344 <dt> &lsquo;<samp>ga</samp>&rsquo;</dt>
15345 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
15346 Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
15347 </p>
15348 </dd>
15349 <dt> &lsquo;<samp>br</samp>&rsquo;</dt>
15350 <dt> &lsquo;<samp>bg</samp>&rsquo;</dt>
15351 <dt> &lsquo;<samp>bb</samp>&rsquo;</dt>
15352 <dt> &lsquo;<samp>ba</samp>&rsquo;</dt>
15353 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
15354 Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
15355 </p>
15356 </dd>
15357 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
15358 <dt> &lsquo;<samp>ag</samp>&rsquo;</dt>
15359 <dt> &lsquo;<samp>ab</samp>&rsquo;</dt>
15360 <dt> &lsquo;<samp>aa</samp>&rsquo;</dt>
15361 <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
15362 Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
15363 </p>
15364 <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
15365 </p></dd>
15366 </dl>
15367
15368 <a name="Examples-34"></a>
15369 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-34">37.10.1 Examples</a></h3>
15370
15371 <ul>
15372 <li>
15373 Convert source to grayscale:
15374 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
15375 </pre></td></tr></table>
15376 </li><li>
15377 Simulate sepia tones:
15378 <table><tr><td>&nbsp;</td><td><pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
15379 </pre></td></tr></table>
15380 </li></ul>
15381
15382 <a name="colormatrix"></a>
15383 <h2 class="section"><a href="ffmpeg-all.html#toc-colormatrix">37.11 colormatrix</a></h2>
15384
15385 <p>Convert color matrix.
15386 </p>
15387 <p>The filter accepts the following options:
15388 </p>
15389 <dl compact="compact">
15390 <dt> &lsquo;<samp>src</samp>&rsquo;</dt>
15391 <dt> &lsquo;<samp>dst</samp>&rsquo;</dt>
15392 <dd><p>Specify the source and destination color matrix. Both values must be
15393 specified.
15394 </p>
15395 <p>The accepted values are:
15396 </p><dl compact="compact">
15397 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
15398 <dd><p>BT.709
15399 </p>
15400 </dd>
15401 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
15402 <dd><p>BT.601
15403 </p>
15404 </dd>
15405 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
15406 <dd><p>SMPTE-240M
15407 </p>
15408 </dd>
15409 <dt> &lsquo;<samp>fcc</samp>&rsquo;</dt>
15410 <dd><p>FCC
15411 </p></dd>
15412 </dl>
15413 </dd>
15414 </dl>
15415
15416 <p>For example to convert from BT.601 to SMPTE-240M, use the command:
15417 </p><table><tr><td>&nbsp;</td><td><pre class="example">colormatrix=bt601:smpte240m
15418 </pre></td></tr></table>
15419
15420 <a name="copy"></a>
15421 <h2 class="section"><a href="ffmpeg-all.html#toc-copy">37.12 copy</a></h2>
15422
15423 <p>Copy the input source unchanged to the output. Mainly useful for
15424 testing purposes.
15425 </p>
15426 <a name="crop"></a>
15427 <h2 class="section"><a href="ffmpeg-all.html#toc-crop">37.13 crop</a></h2>
15428
15429 <p>Crop the input video to given dimensions.
15430 </p>
15431 <p>The filter accepts the following options:
15432 </p>
15433 <dl compact="compact">
15434 <dt> &lsquo;<samp>w, out_w</samp>&rsquo;</dt>
15435 <dd><p>Width of the output video. It defaults to <code>iw</code>.
15436 This expression is evaluated only once during the filter
15437 configuration.
15438 </p>
15439 </dd>
15440 <dt> &lsquo;<samp>h, out_h</samp>&rsquo;</dt>
15441 <dd><p>Height of the output video. It defaults to <code>ih</code>.
15442 This expression is evaluated only once during the filter
15443 configuration.
15444 </p>
15445 </dd>
15446 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15447 <dd><p>Horizontal position, in the input video, of the left edge of the output video.
15448 It defaults to <code>(in_w-out_w)/2</code>.
15449 This expression is evaluated per-frame.
15450 </p>
15451 </dd>
15452 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15453 <dd><p>Vertical position, in the input video, of the top edge of the output video.
15454 It defaults to <code>(in_h-out_h)/2</code>.
15455 This expression is evaluated per-frame.
15456 </p>
15457 </dd>
15458 <dt> &lsquo;<samp>keep_aspect</samp>&rsquo;</dt>
15459 <dd><p>If set to 1 will force the output display aspect ratio
15460 to be the same of the input, by changing the output sample aspect
15461 ratio. It defaults to 0.
15462 </p></dd>
15463 </dl>
15464
15465 <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
15466 expressions containing the following constants:
15467 </p>
15468 <dl compact="compact">
15469 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15470 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15471 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
15472 each new frame.
15473 </p>
15474 </dd>
15475 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
15476 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
15477 <dd><p>the input width and height
15478 </p>
15479 </dd>
15480 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
15481 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
15482 <dd><p>same as <var>in_w</var> and <var>in_h</var>
15483 </p>
15484 </dd>
15485 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
15486 <dt> &lsquo;<samp>out_h</samp>&rsquo;</dt>
15487 <dd><p>the output (cropped) width and height
15488 </p>
15489 </dd>
15490 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
15491 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
15492 <dd><p>same as <var>out_w</var> and <var>out_h</var>
15493 </p>
15494 </dd>
15495 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
15496 <dd><p>same as <var>iw</var> / <var>ih</var>
15497 </p>
15498 </dd>
15499 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
15500 <dd><p>input sample aspect ratio
15501 </p>
15502 </dd>
15503 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
15504 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
15505 </p>
15506 </dd>
15507 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
15508 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
15509 <dd><p>horizontal and vertical chroma subsample values. For example for the
15510 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
15511 </p>
15512 </dd>
15513 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
15514 <dd><p>the number of input frame, starting from 0
15515 </p>
15516 </dd>
15517 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
15518 <dd><p>the position in the file of the input frame, NAN if unknown
15519 </p>
15520 </dd>
15521 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
15522 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
15523 </p>
15524 </dd>
15525 </dl>
15526
15527 <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
15528 and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
15529 cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
15530 evaluated after <var>out_w</var> and <var>out_h</var>.
15531 </p>
15532 <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
15533 position of the top-left corner of the output (non-cropped) area. They
15534 are evaluated for each frame. If the evaluated value is not valid, it
15535 is approximated to the nearest valid value.
15536 </p>
15537 <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
15538 for <var>y</var> may depend on <var>x</var>.
15539 </p>
15540 <a name="Examples-8"></a>
15541 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-8">37.13.1 Examples</a></h3>
15542
15543 <ul>
15544 <li>
15545 Crop area with size 100x100 at position (12,34).
15546 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100:12:34
15547 </pre></td></tr></table>
15548
15549 <p>Using named options, the example above becomes:
15550 </p><table><tr><td>&nbsp;</td><td><pre class="example">crop=w=100:h=100:x=12:y=34
15551 </pre></td></tr></table>
15552
15553 </li><li>
15554 Crop the central input area with size 100x100:
15555 <table><tr><td>&nbsp;</td><td><pre class="example">crop=100:100
15556 </pre></td></tr></table>
15557
15558 </li><li>
15559 Crop the central input area with size 2/3 of the input video:
15560 <table><tr><td>&nbsp;</td><td><pre class="example">crop=2/3*in_w:2/3*in_h
15561 </pre></td></tr></table>
15562
15563 </li><li>
15564 Crop the input video central square:
15565 <table><tr><td>&nbsp;</td><td><pre class="example">crop=out_w=in_h
15566 crop=in_h
15567 </pre></td></tr></table>
15568
15569 </li><li>
15570 Delimit the rectangle with the top-left corner placed at position
15571 100:100 and the right-bottom corner corresponding to the right-bottom
15572 corner of the input image:
15573 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w-100:in_h-100:100:100
15574 </pre></td></tr></table>
15575
15576 </li><li>
15577 Crop 10 pixels from the left and right borders, and 20 pixels from
15578 the top and bottom borders
15579 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w-2*10:in_h-2*20
15580 </pre></td></tr></table>
15581
15582 </li><li>
15583 Keep only the bottom right quarter of the input image:
15584 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
15585 </pre></td></tr></table>
15586
15587 </li><li>
15588 Crop height for getting Greek harmony:
15589 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w:1/PHI*in_w
15590 </pre></td></tr></table>
15591
15592 </li><li>
15593 Appply trembling effect:
15594 <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)
15595 </pre></td></tr></table>
15596
15597 </li><li>
15598 Apply erratic camera effect depending on timestamp:
15599 <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;
15600 </pre></td></tr></table>
15601
15602 </li><li>
15603 Set x depending on the value of y:
15604 <table><tr><td>&nbsp;</td><td><pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
15605 </pre></td></tr></table>
15606 </li></ul>
15607
15608 <a name="cropdetect"></a>
15609 <h2 class="section"><a href="ffmpeg-all.html#toc-cropdetect">37.14 cropdetect</a></h2>
15610
15611 <p>Auto-detect crop size.
15612 </p>
15613 <p>Calculate necessary cropping parameters and prints the recommended
15614 parameters through the logging system. The detected dimensions
15615 correspond to the non-black area of the input video.
15616 </p>
15617 <p>The filter accepts the following options:
15618 </p>
15619 <dl compact="compact">
15620 <dt> &lsquo;<samp>limit</samp>&rsquo;</dt>
15621 <dd><p>Set higher black value threshold, which can be optionally specified
15622 from nothing (0) to everything (255). An intensity value greater
15623 to the set value is considered non-black. Default value is 24.
15624 </p>
15625 </dd>
15626 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
15627 <dd><p>Set the value for which the width/height should be divisible by. The
15628 offset is automatically adjusted to center the video. Use 2 to get
15629 only even dimensions (needed for 4:2:2 video). 16 is best when
15630 encoding to most video codecs. Default value is 16.
15631 </p>
15632 </dd>
15633 <dt> &lsquo;<samp>reset_count, reset</samp>&rsquo;</dt>
15634 <dd><p>Set the counter that determines after how many frames cropdetect will
15635 reset the previously detected largest video area and start over to
15636 detect the current optimal crop area. Default value is 0.
15637 </p>
15638 <p>This can be useful when channel logos distort the video area. 0
15639 indicates never reset and return the largest area encountered during
15640 playback.
15641 </p></dd>
15642 </dl>
15643
15644 <p><a name="curves"></a>
15645 </p><a name="curves-1"></a>
15646 <h2 class="section"><a href="ffmpeg-all.html#toc-curves-1">37.15 curves</a></h2>
15647
15648 <p>Apply color adjustments using curves.
15649 </p>
15650 <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
15651 component (red, green and blue) has its values defined by <var>N</var> key points
15652 tied from each other using a smooth curve. The x-axis represents the pixel
15653 values from the input frame, and the y-axis the new pixel values to be set for
15654 the output frame.
15655 </p>
15656 <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
15657 <var>(1;1)</var>. This creates a straight line where each original pixel value is
15658 &quot;adjusted&quot; to its own value, which means no change to the image.
15659 </p>
15660 <p>The filter allows you to redefine these two points and add some more. A new
15661 curve (using a natural cubic spline interpolation) will be define to pass
15662 smoothly through all these new coordinates. The new defined points needs to be
15663 strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
15664 be in the <var>[0;1]</var> interval.  If the computed curves happened to go outside
15665 the vector spaces, the values will be clipped accordingly.
15666 </p>
15667 <p>If there is no key point defined in <code>x=0</code>, the filter will automatically
15668 insert a <var>(0;0)</var> point. In the same way, if there is no key point defined
15669 in <code>x=1</code>, the filter will automatically insert a <var>(1;1)</var> point.
15670 </p>
15671 <p>The filter accepts the following options:
15672 </p>
15673 <dl compact="compact">
15674 <dt> &lsquo;<samp>preset</samp>&rsquo;</dt>
15675 <dd><p>Select one of the available color presets. This option can be used in addition
15676 to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; parameters; in this case, the later
15677 options takes priority on the preset values.
15678 Available presets are:
15679 </p><dl compact="compact">
15680 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
15681 <dt> &lsquo;<samp>color_negative</samp>&rsquo;</dt>
15682 <dt> &lsquo;<samp>cross_process</samp>&rsquo;</dt>
15683 <dt> &lsquo;<samp>darker</samp>&rsquo;</dt>
15684 <dt> &lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
15685 <dt> &lsquo;<samp>lighter</samp>&rsquo;</dt>
15686 <dt> &lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
15687 <dt> &lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
15688 <dt> &lsquo;<samp>negative</samp>&rsquo;</dt>
15689 <dt> &lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
15690 <dt> &lsquo;<samp>vintage</samp>&rsquo;</dt>
15691 </dl>
15692 <p>Default is <code>none</code>.
15693 </p></dd>
15694 <dt> &lsquo;<samp>master, m</samp>&rsquo;</dt>
15695 <dd><p>Set the master key points. These points will define a second pass mapping. It
15696 is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
15697 &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
15698 post-processing LUT.
15699 </p></dd>
15700 <dt> &lsquo;<samp>red, r</samp>&rsquo;</dt>
15701 <dd><p>Set the key points for the red component.
15702 </p></dd>
15703 <dt> &lsquo;<samp>green, g</samp>&rsquo;</dt>
15704 <dd><p>Set the key points for the green component.
15705 </p></dd>
15706 <dt> &lsquo;<samp>blue, b</samp>&rsquo;</dt>
15707 <dd><p>Set the key points for the blue component.
15708 </p></dd>
15709 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
15710 <dd><p>Set the key points for all components (not including master).
15711 Can be used in addition to the other key points component
15712 options. In this case, the unset component(s) will fallback on this
15713 &lsquo;<samp>all</samp>&rsquo; setting.
15714 </p></dd>
15715 <dt> &lsquo;<samp>psfile</samp>&rsquo;</dt>
15716 <dd><p>Specify a Photoshop curves file (<code>.asv</code>) to import the settings from.
15717 </p></dd>
15718 </dl>
15719
15720 <p>To avoid some filtergraph syntax conflicts, each key points list need to be
15721 defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
15722 </p>
15723 <a name="Examples-16"></a>
15724 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-16">37.15.1 Examples</a></h3>
15725
15726 <ul>
15727 <li>
15728 Increase slightly the middle level of blue:
15729 <table><tr><td>&nbsp;</td><td><pre class="example">curves=blue='0.5/0.58'
15730 </pre></td></tr></table>
15731
15732 </li><li>
15733 Vintage effect:
15734 <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'
15735 </pre></td></tr></table>
15736 <p>Here we obtain the following coordinates for each components:
15737 </p><dl compact="compact">
15738 <dt> <var>red</var></dt>
15739 <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
15740 </p></dd>
15741 <dt> <var>green</var></dt>
15742 <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
15743 </p></dd>
15744 <dt> <var>blue</var></dt>
15745 <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
15746 </p></dd>
15747 </dl>
15748
15749 </li><li>
15750 The previous example can also be achieved with the associated built-in preset:
15751 <table><tr><td>&nbsp;</td><td><pre class="example">curves=preset=vintage
15752 </pre></td></tr></table>
15753
15754 </li><li>
15755 Or simply:
15756 <table><tr><td>&nbsp;</td><td><pre class="example">curves=vintage
15757 </pre></td></tr></table>
15758
15759 </li><li>
15760 Use a Photoshop preset and redefine the points of the green component:
15761 <table><tr><td>&nbsp;</td><td><pre class="example">curves=psfile='MyCurvesPresets/purple.asv':green='0.45/0.53'
15762 </pre></td></tr></table>
15763 </li></ul>
15764
15765 <a name="dctdnoiz"></a>
15766 <h2 class="section"><a href="ffmpeg-all.html#toc-dctdnoiz">37.16 dctdnoiz</a></h2>
15767
15768 <p>Denoise frames using 2D DCT (frequency domain filtering).
15769 </p>
15770 <p>This filter is not designed for real time and can be extremely slow.
15771 </p>
15772 <p>The filter accepts the following options:
15773 </p>
15774 <dl compact="compact">
15775 <dt> &lsquo;<samp>sigma, s</samp>&rsquo;</dt>
15776 <dd><p>Set the noise sigma constant.
15777 </p>
15778 <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
15779 coefficient (absolute value) below this threshold with be dropped.
15780 </p>
15781 <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
15782 </p>
15783 <p>Default is <code>0</code>.
15784 </p>
15785 </dd>
15786 <dt> &lsquo;<samp>overlap</samp>&rsquo;</dt>
15787 <dd><p>Set number overlapping pixels for each block. Each block is of size
15788 <code>16x16</code>. Since the filter can be slow, you may want to reduce this value,
15789 at the cost of a less effective filter and the risk of various artefacts.
15790 </p>
15791 <p>If the overlapping value doesn&rsquo;t allow to process the whole input width or
15792 height, a warning will be displayed and according borders won&rsquo;t be denoised.
15793 </p>
15794 <p>Default value is <code>15</code>.
15795 </p>
15796 </dd>
15797 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
15798 <dd><p>Set the coefficient factor expression.
15799 </p>
15800 <p>For each coefficient of a DCT block, this expression will be evaluated as a
15801 multiplier value for the coefficient.
15802 </p>
15803 <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
15804 </p>
15805 <p>The absolute value of the coefficient can be accessed through the <var>c</var>
15806 variable.
15807 </p></dd>
15808 </dl>
15809
15810 <a name="Examples-3"></a>
15811 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-3">37.16.1 Examples</a></h3>
15812
15813 <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
15814 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=4.5
15815 </pre></td></tr></table>
15816
15817 <p>The same operation can be achieved using the expression system:
15818 </p><table><tr><td>&nbsp;</td><td><pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
15819 </pre></td></tr></table>
15820
15821 <p><a name="decimate"></a>
15822 </p><a name="decimate-1"></a>
15823 <h2 class="section"><a href="ffmpeg-all.html#toc-decimate-1">37.17 decimate</a></h2>
15824
15825 <p>Drop duplicated frames at regular intervals.
15826 </p>
15827 <p>The filter accepts the following options:
15828 </p>
15829 <dl compact="compact">
15830 <dt> &lsquo;<samp>cycle</samp>&rsquo;</dt>
15831 <dd><p>Set the number of frames from which one will be dropped. Setting this to
15832 <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
15833 Default is <code>5</code>.
15834 </p>
15835 </dd>
15836 <dt> &lsquo;<samp>dupthresh</samp>&rsquo;</dt>
15837 <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
15838 is less than or equal to this value, then it is declared as duplicate. Default
15839 is <code>1.1</code>
15840 </p>
15841 </dd>
15842 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</dt>
15843 <dd><p>Set scene change threshold. Default is <code>15</code>.
15844 </p>
15845 </dd>
15846 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
15847 <dt> &lsquo;<samp>blocky</samp>&rsquo;</dt>
15848 <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
15849 Larger blocks give better noise suppression, but also give worse detection of
15850 small movements. Must be a power of two. Default is <code>32</code>.
15851 </p>
15852 </dd>
15853 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</dt>
15854 <dd><p>Mark main input as a pre-processed input and activate clean source input
15855 stream. This allows the input to be pre-processed with various filters to help
15856 the metrics calculation while keeping the frame selection lossless. When set to
15857 <code>1</code>, the first stream is for the pre-processed input, and the second
15858 stream is the clean source from where the kept frames are chosen. Default is
15859 <code>0</code>.
15860 </p>
15861 </dd>
15862 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
15863 <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
15864 <code>1</code>.
15865 </p></dd>
15866 </dl>
15867
15868 <a name="delogo"></a>
15869 <h2 class="section"><a href="ffmpeg-all.html#toc-delogo">37.18 delogo</a></h2>
15870
15871 <p>Suppress a TV station logo by a simple interpolation of the surrounding
15872 pixels. Just set a rectangle covering the logo and watch it disappear
15873 (and sometimes something even uglier appear - your mileage may vary).
15874 </p>
15875 <p>This filter accepts the following options:
15876 </p><dl compact="compact">
15877 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15878 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15879 <dd><p>Specify the top left corner coordinates of the logo. They must be
15880 specified.
15881 </p>
15882 </dd>
15883 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
15884 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
15885 <dd><p>Specify the width and height of the logo to clear. They must be
15886 specified.
15887 </p>
15888 </dd>
15889 <dt> &lsquo;<samp>band, t</samp>&rsquo;</dt>
15890 <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
15891 <var>w</var> and <var>h</var>). The default value is 4.
15892 </p>
15893 </dd>
15894 <dt> &lsquo;<samp>show</samp>&rsquo;</dt>
15895 <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
15896 finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
15897 The default value is 0.
15898 </p>
15899 <p>The rectangle is drawn on the outermost pixels which will be (partly)
15900 replaced with interpolated values. The values of the next pixels
15901 immediately outside this rectangle in each direction will be used to
15902 compute the interpolated pixel values inside the rectangle.
15903 </p>
15904 </dd>
15905 </dl>
15906
15907 <a name="Examples-67"></a>
15908 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-67">37.18.1 Examples</a></h3>
15909
15910 <ul>
15911 <li>
15912 Set a rectangle covering the area with top left corner coordinates 0,0
15913 and size 100x77, setting a band of size 10:
15914 <table><tr><td>&nbsp;</td><td><pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
15915 </pre></td></tr></table>
15916
15917 </li></ul>
15918
15919 <a name="deshake"></a>
15920 <h2 class="section"><a href="ffmpeg-all.html#toc-deshake">37.19 deshake</a></h2>
15921
15922 <p>Attempt to fix small changes in horizontal and/or vertical shift. This
15923 filter helps remove camera shake from hand-holding a camera, bumping a
15924 tripod, moving on a vehicle, etc.
15925 </p>
15926 <p>The filter accepts the following options:
15927 </p>
15928 <dl compact="compact">
15929 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
15930 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
15931 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
15932 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
15933 <dd><p>Specify a rectangular area where to limit the search for motion
15934 vectors.
15935 If desired the search for motion vectors can be limited to a
15936 rectangular area of the frame defined by its top left corner, width
15937 and height. These parameters have the same meaning as the drawbox
15938 filter which can be used to visualise the position of the bounding
15939 box.
15940 </p>
15941 <p>This is useful when simultaneous movement of subjects within the frame
15942 might be confused for camera motion by the motion vector search.
15943 </p>
15944 <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
15945 then the full frame is used. This allows later options to be set
15946 without specifying the bounding box for the motion vector search.
15947 </p>
15948 <p>Default - search the whole frame.
15949 </p>
15950 </dd>
15951 <dt> &lsquo;<samp>rx</samp>&rsquo;</dt>
15952 <dt> &lsquo;<samp>ry</samp>&rsquo;</dt>
15953 <dd><p>Specify the maximum extent of movement in x and y directions in the
15954 range 0-64 pixels. Default 16.
15955 </p>
15956 </dd>
15957 <dt> &lsquo;<samp>edge</samp>&rsquo;</dt>
15958 <dd><p>Specify how to generate pixels to fill blanks at the edge of the
15959 frame. Available values are:
15960 </p><dl compact="compact">
15961 <dt> &lsquo;<samp>blank, 0</samp>&rsquo;</dt>
15962 <dd><p>Fill zeroes at blank locations
15963 </p></dd>
15964 <dt> &lsquo;<samp>original, 1</samp>&rsquo;</dt>
15965 <dd><p>Original image at blank locations
15966 </p></dd>
15967 <dt> &lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
15968 <dd><p>Extruded edge value at blank locations
15969 </p></dd>
15970 <dt> &lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
15971 <dd><p>Mirrored edge at blank locations
15972 </p></dd>
15973 </dl>
15974 <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
15975 </p>
15976 </dd>
15977 <dt> &lsquo;<samp>blocksize</samp>&rsquo;</dt>
15978 <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
15979 default 8.
15980 </p>
15981 </dd>
15982 <dt> &lsquo;<samp>contrast</samp>&rsquo;</dt>
15983 <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
15984 the specified contrast (difference between darkest and lightest
15985 pixels) will be considered. Range 1-255, default 125.
15986 </p>
15987 </dd>
15988 <dt> &lsquo;<samp>search</samp>&rsquo;</dt>
15989 <dd><p>Specify the search strategy. Available values are:
15990 </p><dl compact="compact">
15991 <dt> &lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
15992 <dd><p>Set exhaustive search
15993 </p></dd>
15994 <dt> &lsquo;<samp>less, 1</samp>&rsquo;</dt>
15995 <dd><p>Set less exhaustive search.
15996 </p></dd>
15997 </dl>
15998 <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
15999 </p>
16000 </dd>
16001 <dt> &lsquo;<samp>filename</samp>&rsquo;</dt>
16002 <dd><p>If set then a detailed log of the motion search is written to the
16003 specified file.
16004 </p>
16005 </dd>
16006 <dt> &lsquo;<samp>opencl</samp>&rsquo;</dt>
16007 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
16008 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
16009 </p>
16010 </dd>
16011 </dl>
16012
16013 <a name="drawbox"></a>
16014 <h2 class="section"><a href="ffmpeg-all.html#toc-drawbox">37.20 drawbox</a></h2>
16015
16016 <p>Draw a colored box on the input image.
16017 </p>
16018 <p>This filter accepts the following options:
16019 </p>
16020 <dl compact="compact">
16021 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16022 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16023 <dd><p>The expressions which specify the top left corner coordinates of the box. Default to 0.
16024 </p>
16025 </dd>
16026 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
16027 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
16028 <dd><p>The expressions which specify the width and height of the box, if 0 they are interpreted as
16029 the input width and height. Default to 0.
16030 </p>
16031 </dd>
16032 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
16033 <dd><p>Specify the color of the box to write. For the general syntax of this option,
16034 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
16035 value <code>invert</code> is used, the box edge color is the same as the
16036 video with inverted luma.
16037 </p>
16038 </dd>
16039 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
16040 <dd><p>The expression which sets the thickness of the box edge. Default value is <code>3</code>.
16041 </p>
16042 <p>See below for the list of accepted constants.
16043 </p></dd>
16044 </dl>
16045
16046 <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
16047 following constants:
16048 </p>
16049 <dl compact="compact">
16050 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
16051 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
16052 </p>
16053 </dd>
16054 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
16055 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
16056 <dd><p>horizontal and vertical chroma subsample values. For example for the
16057 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
16058 </p>
16059 </dd>
16060 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
16061 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
16062 <dd><p>The input width and height.
16063 </p>
16064 </dd>
16065 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
16066 <dd><p>The input sample aspect ratio.
16067 </p>
16068 </dd>
16069 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16070 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16071 <dd><p>The x and y offset coordinates where the box is drawn.
16072 </p>
16073 </dd>
16074 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
16075 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16076 <dd><p>The width and height of the drawn box.
16077 </p>
16078 </dd>
16079 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
16080 <dd><p>The thickness of the drawn box.
16081 </p>
16082 <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
16083 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
16084 </p>
16085 </dd>
16086 </dl>
16087
16088 <a name="Examples-42"></a>
16089 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-42">37.20.1 Examples</a></h3>
16090
16091 <ul>
16092 <li>
16093 Draw a black box around the edge of the input image:
16094 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox
16095 </pre></td></tr></table>
16096
16097 </li><li>
16098 Draw a box with color red and an opacity of 50%:
16099 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=10:20:200:60:red@0.5
16100 </pre></td></tr></table>
16101
16102 <p>The previous example can be specified as:
16103 </p><table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
16104 </pre></td></tr></table>
16105
16106 </li><li>
16107 Fill the box with pink color:
16108 <table><tr><td>&nbsp;</td><td><pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=max
16109 </pre></td></tr></table>
16110
16111 </li><li>
16112 Draw a 2-pixel red 2.40:1 mask:
16113 <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
16114 </pre></td></tr></table>
16115 </li></ul>
16116
16117 <a name="drawgrid"></a>
16118 <h2 class="section"><a href="ffmpeg-all.html#toc-drawgrid">37.21 drawgrid</a></h2>
16119
16120 <p>Draw a grid on the input image.
16121 </p>
16122 <p>This filter accepts the following options:
16123 </p>
16124 <dl compact="compact">
16125 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16126 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16127 <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
16128 </p>
16129 </dd>
16130 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
16131 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
16132 <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
16133 input width and height, respectively, minus <code>thickness</code>, so image gets
16134 framed. Default to 0.
16135 </p>
16136 </dd>
16137 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
16138 <dd><p>Specify the color of the grid. For the general syntax of this option,
16139 check the &quot;Color&quot; section in the ffmpeg-utils manual. If the special
16140 value <code>invert</code> is used, the grid color is the same as the
16141 video with inverted luma.
16142 </p>
16143 </dd>
16144 <dt> &lsquo;<samp>thickness, t</samp>&rsquo;</dt>
16145 <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
16146 </p>
16147 <p>See below for the list of accepted constants.
16148 </p></dd>
16149 </dl>
16150
16151 <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
16152 following constants:
16153 </p>
16154 <dl compact="compact">
16155 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
16156 <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
16157 </p>
16158 </dd>
16159 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
16160 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
16161 <dd><p>horizontal and vertical chroma subsample values. For example for the
16162 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
16163 </p>
16164 </dd>
16165 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
16166 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
16167 <dd><p>The input grid cell width and height.
16168 </p>
16169 </dd>
16170 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
16171 <dd><p>The input sample aspect ratio.
16172 </p>
16173 </dd>
16174 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16175 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16176 <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
16177 </p>
16178 </dd>
16179 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
16180 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
16181 <dd><p>The width and height of the drawn cell.
16182 </p>
16183 </dd>
16184 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
16185 <dd><p>The thickness of the drawn cell.
16186 </p>
16187 <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
16188 each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
16189 </p>
16190 </dd>
16191 </dl>
16192
16193 <a name="Examples-54"></a>
16194 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-54">37.21.1 Examples</a></h3>
16195
16196 <ul>
16197 <li>
16198 Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
16199 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
16200 </pre></td></tr></table>
16201
16202 </li><li>
16203 Draw a white 3x3 grid with an opacity of 50%:
16204 <table><tr><td>&nbsp;</td><td><pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
16205 </pre></td></tr></table>
16206 </li></ul>
16207
16208 <p><a name="drawtext"></a>
16209 </p><a name="drawtext-1"></a>
16210 <h2 class="section"><a href="ffmpeg-all.html#toc-drawtext-1">37.22 drawtext</a></h2>
16211
16212 <p>Draw text string or text from specified file on top of video using the
16213 libfreetype library.
16214 </p>
16215 <p>To enable compilation of this filter you need to configure FFmpeg with
16216 <code>--enable-libfreetype</code>.
16217 </p>
16218 <a name="Syntax"></a>
16219 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax">37.22.1 Syntax</a></h3>
16220
16221 <p>The description of the accepted parameters follows.
16222 </p>
16223 <dl compact="compact">
16224 <dt> &lsquo;<samp>box</samp>&rsquo;</dt>
16225 <dd><p>Used to draw a box around text using background color.
16226 Value should be either 1 (enable) or 0 (disable).
16227 The default value of <var>box</var> is 0.
16228 </p>
16229 </dd>
16230 <dt> &lsquo;<samp>boxcolor</samp>&rsquo;</dt>
16231 <dd><p>The color to be used for drawing box around text. For the syntax of this
16232 option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
16233 </p>
16234 <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
16235 </p>
16236 </dd>
16237 <dt> &lsquo;<samp>expansion</samp>&rsquo;</dt>
16238 <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
16239 <code>strftime</code> (deprecated) or
16240 <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
16241 below for details.
16242 </p>
16243 </dd>
16244 <dt> &lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
16245 <dd><p>If true, check and fix text coords to avoid clipping.
16246 </p>
16247 </dd>
16248 <dt> &lsquo;<samp>fontcolor</samp>&rsquo;</dt>
16249 <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
16250 the &quot;Color&quot; section in the ffmpeg-utils manual.
16251 </p>
16252 <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
16253 </p>
16254 </dd>
16255 <dt> &lsquo;<samp>fontfile</samp>&rsquo;</dt>
16256 <dd><p>The font file to be used for drawing text. Path must be included.
16257 This parameter is mandatory.
16258 </p>
16259 </dd>
16260 <dt> &lsquo;<samp>fontsize</samp>&rsquo;</dt>
16261 <dd><p>The font size to be used for drawing text.
16262 The default value of <var>fontsize</var> is 16.
16263 </p>
16264 </dd>
16265 <dt> &lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
16266 <dd><p>Flags to be used for loading the fonts.
16267 </p>
16268 <p>The flags map the corresponding flags supported by libfreetype, and are
16269 a combination of the following values:
16270 </p><dl compact="compact">
16271 <dt> <var>default</var></dt>
16272 <dt> <var>no_scale</var></dt>
16273 <dt> <var>no_hinting</var></dt>
16274 <dt> <var>render</var></dt>
16275 <dt> <var>no_bitmap</var></dt>
16276 <dt> <var>vertical_layout</var></dt>
16277 <dt> <var>force_autohint</var></dt>
16278 <dt> <var>crop_bitmap</var></dt>
16279 <dt> <var>pedantic</var></dt>
16280 <dt> <var>ignore_global_advance_width</var></dt>
16281 <dt> <var>no_recurse</var></dt>
16282 <dt> <var>ignore_transform</var></dt>
16283 <dt> <var>monochrome</var></dt>
16284 <dt> <var>linear_design</var></dt>
16285 <dt> <var>no_autohint</var></dt>
16286 </dl>
16287
16288 <p>Default value is &quot;render&quot;.
16289 </p>
16290 <p>For more information consult the documentation for the FT_LOAD_*
16291 libfreetype flags.
16292 </p>
16293 </dd>
16294 <dt> &lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
16295 <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
16296 syntax of this option, check the &quot;Color&quot; section in the ffmpeg-utils manual.
16297 </p>
16298 <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
16299 </p>
16300 </dd>
16301 <dt> &lsquo;<samp>shadowx</samp>&rsquo;</dt>
16302 <dt> &lsquo;<samp>shadowy</samp>&rsquo;</dt>
16303 <dd><p>The x and y offsets for the text shadow position with respect to the
16304 position of the text. They can be either positive or negative
16305 values. Default value for both is &quot;0&quot;.
16306 </p>
16307 </dd>
16308 <dt> &lsquo;<samp>start_number</samp>&rsquo;</dt>
16309 <dd><p>The starting frame number for the n/frame_num variable. The default value
16310 is &quot;0&quot;.
16311 </p>
16312 </dd>
16313 <dt> &lsquo;<samp>tabsize</samp>&rsquo;</dt>
16314 <dd><p>The size in number of spaces to use for rendering the tab.
16315 Default value is 4.
16316 </p>
16317 </dd>
16318 <dt> &lsquo;<samp>timecode</samp>&rsquo;</dt>
16319 <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
16320 format. It can be used with or without text parameter. <var>timecode_rate</var>
16321 option must be specified.
16322 </p>
16323 </dd>
16324 <dt> &lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
16325 <dd><p>Set the timecode frame rate (timecode only).
16326 </p>
16327 </dd>
16328 <dt> &lsquo;<samp>text</samp>&rsquo;</dt>
16329 <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
16330 encoded characters.
16331 This parameter is mandatory if no file is specified with the parameter
16332 <var>textfile</var>.
16333 </p>
16334 </dd>
16335 <dt> &lsquo;<samp>textfile</samp>&rsquo;</dt>
16336 <dd><p>A text file containing text to be drawn. The text must be a sequence
16337 of UTF-8 encoded characters.
16338 </p>
16339 <p>This parameter is mandatory if no text string is specified with the
16340 parameter <var>text</var>.
16341 </p>
16342 <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
16343 </p>
16344 </dd>
16345 <dt> &lsquo;<samp>reload</samp>&rsquo;</dt>
16346 <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
16347 Be sure to update it atomically, or it may be read partially, or even fail.
16348 </p>
16349 </dd>
16350 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16351 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16352 <dd><p>The expressions which specify the offsets where text will be drawn
16353 within the video frame. They are relative to the top/left border of the
16354 output image.
16355 </p>
16356 <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
16357 </p>
16358 <p>See below for the list of accepted constants and functions.
16359 </p></dd>
16360 </dl>
16361
16362 <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
16363 following constants and functions:
16364 </p>
16365 <dl compact="compact">
16366 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
16367 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
16368 </p>
16369 </dd>
16370 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
16371 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
16372 <dd><p>horizontal and vertical chroma subsample values. For example for the
16373 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
16374 </p>
16375 </dd>
16376 <dt> &lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
16377 <dd><p>the height of each text line
16378 </p>
16379 </dd>
16380 <dt> &lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
16381 <dd><p>the input height
16382 </p>
16383 </dd>
16384 <dt> &lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
16385 <dd><p>the input width
16386 </p>
16387 </dd>
16388 <dt> &lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</dt>
16389 <dd><p>the maximum distance from the baseline to the highest/upper grid
16390 coordinate used to place a glyph outline point, for all the rendered
16391 glyphs.
16392 It is a positive value, due to the grid&rsquo;s orientation with the Y axis
16393 upwards.
16394 </p>
16395 </dd>
16396 <dt> &lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</dt>
16397 <dd><p>the maximum distance from the baseline to the lowest grid coordinate
16398 used to place a glyph outline point, for all the rendered glyphs.
16399 This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
16400 upwards.
16401 </p>
16402 </dd>
16403 <dt> &lsquo;<samp>max_glyph_h</samp>&rsquo;</dt>
16404 <dd><p>maximum glyph height, that is the maximum height for all the glyphs
16405 contained in the rendered text, it is equivalent to <var>ascent</var> -
16406 <var>descent</var>.
16407 </p>
16408 </dd>
16409 <dt> &lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
16410 <dd><p>maximum glyph width, that is the maximum width for all the glyphs
16411 contained in the rendered text
16412 </p>
16413 </dd>
16414 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
16415 <dd><p>the number of input frame, starting from 0
16416 </p>
16417 </dd>
16418 <dt> &lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
16419 <dd><p>return a random number included between <var>min</var> and <var>max</var>
16420 </p>
16421 </dd>
16422 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
16423 <dd><p>input sample aspect ratio
16424 </p>
16425 </dd>
16426 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
16427 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
16428 </p>
16429 </dd>
16430 <dt> &lsquo;<samp>text_h, th</samp>&rsquo;</dt>
16431 <dd><p>the height of the rendered text
16432 </p>
16433 </dd>
16434 <dt> &lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
16435 <dd><p>the width of the rendered text
16436 </p>
16437 </dd>
16438 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
16439 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16440 <dd><p>the x and y offset coordinates where the text is drawn.
16441 </p>
16442 <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
16443 each other, so you can for example specify <code>y=x/dar</code>.
16444 </p></dd>
16445 </dl>
16446
16447 <p>If libavfilter was built with <code>--enable-fontconfig</code>, then
16448 &lsquo;<samp>fontfile</samp>&rsquo; can be a fontconfig pattern or omitted.
16449 </p>
16450 <p><a name="drawtext_005fexpansion"></a>
16451 </p><a name="Text-expansion"></a>
16452 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Text-expansion">37.22.2 Text expansion</a></h3>
16453
16454 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>strftime</code>,
16455 the filter recognizes strftime() sequences in the provided text and
16456 expands them accordingly. Check the documentation of strftime(). This
16457 feature is deprecated.
16458 </p>
16459 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
16460 </p>
16461 <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
16462 the following expansion mechanism is used.
16463 </p>
16464 <p>The backslash character &rsquo;\&rsquo;, followed by any character, always expands to
16465 the second character.
16466 </p>
16467 <p>Sequence of the form <code>%{...}</code> are expanded. The text between the
16468 braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
16469 If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
16470 they should be escaped.
16471 </p>
16472 <p>Note that they probably must also be escaped as the value for the
16473 &lsquo;<samp>text</samp>&rsquo; option in the filter argument string and as the filter
16474 argument in the filtergraph description, and possibly also for the shell,
16475 that makes up to four levels of escaping; using a text file avoids these
16476 problems.
16477 </p>
16478 <p>The following functions are available:
16479 </p>
16480 <dl compact="compact">
16481 <dt> <code>expr, e</code></dt>
16482 <dd><p>The expression evaluation result.
16483 </p>
16484 <p>It must take one argument specifying the expression to be evaluated,
16485 which accepts the same constants and functions as the <var>x</var> and
16486 <var>y</var> values. Note that not all constants should be used, for
16487 example the text size is not known when evaluating the expression, so
16488 the constants <var>text_w</var> and <var>text_h</var> will have an undefined
16489 value.
16490 </p>
16491 </dd>
16492 <dt> <code>gmtime</code></dt>
16493 <dd><p>The time at which the filter is running, expressed in UTC.
16494 It can accept an argument: a strftime() format string.
16495 </p>
16496 </dd>
16497 <dt> <code>localtime</code></dt>
16498 <dd><p>The time at which the filter is running, expressed in the local time zone.
16499 It can accept an argument: a strftime() format string.
16500 </p>
16501 </dd>
16502 <dt> <code>metadata</code></dt>
16503 <dd><p>Frame metadata. It must take one argument specifying metadata key.
16504 </p>
16505 </dd>
16506 <dt> <code>n, frame_num</code></dt>
16507 <dd><p>The frame number, starting from 0.
16508 </p>
16509 </dd>
16510 <dt> <code>pict_type</code></dt>
16511 <dd><p>A 1 character description of the current picture type.
16512 </p>
16513 </dd>
16514 <dt> <code>pts</code></dt>
16515 <dd><p>The timestamp of the current frame, in seconds, with microsecond accuracy.
16516 </p>
16517 </dd>
16518 </dl>
16519
16520 <a name="Examples-30"></a>
16521 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-30">37.22.3 Examples</a></h3>
16522
16523 <ul>
16524 <li>
16525 Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
16526 optional parameters.
16527
16528 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
16529 </pre></td></tr></table>
16530
16531 </li><li>
16532 Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
16533 and y=50 (counting from the top-left corner of the screen), text is
16534 yellow with a red box around it. Both the text and the box have an
16535 opacity of 20%.
16536
16537 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
16538           x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
16539 </pre></td></tr></table>
16540
16541 <p>Note that the double quotes are not necessary if spaces are not used
16542 within the parameter list.
16543 </p>
16544 </li><li>
16545 Show the text at the center of the video frame:
16546 <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;
16547 </pre></td></tr></table>
16548
16549 </li><li>
16550 Show a text line sliding from right to left in the last row of the video
16551 frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
16552 with no newlines.
16553 <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;
16554 </pre></td></tr></table>
16555
16556 </li><li>
16557 Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
16558 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
16559 </pre></td></tr></table>
16560
16561 </li><li>
16562 Draw a single green letter &quot;g&quot;, at the center of the input video.
16563 The glyph baseline is placed at half screen height.
16564 <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;
16565 </pre></td></tr></table>
16566
16567 </li><li>
16568 Show text for 1 second every 3 seconds:
16569 <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;
16570 </pre></td></tr></table>
16571
16572 </li><li>
16573 Use fontconfig to set the font. Note that the colons need to be escaped.
16574 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
16575 </pre></td></tr></table>
16576
16577 </li><li>
16578 Print the date of a real-time encoding (see strftime(3)):
16579 <table><tr><td>&nbsp;</td><td><pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime:%a %b %d %Y}'
16580 </pre></td></tr></table>
16581
16582 </li></ul>
16583
16584 <p>For more information about libfreetype, check:
16585 <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
16586 </p>
16587 <p>For more information about fontconfig, check:
16588 <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
16589 </p>
16590 <a name="edgedetect"></a>
16591 <h2 class="section"><a href="ffmpeg-all.html#toc-edgedetect">37.23 edgedetect</a></h2>
16592
16593 <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
16594 </p>
16595 <p>The filter accepts the following options:
16596 </p>
16597 <dl compact="compact">
16598 <dt> &lsquo;<samp>low</samp>&rsquo;</dt>
16599 <dt> &lsquo;<samp>high</samp>&rsquo;</dt>
16600 <dd><p>Set low and high threshold values used by the Canny thresholding
16601 algorithm.
16602 </p>
16603 <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
16604 connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
16605 by the low threshold.
16606 </p>
16607 <p><var>low</var> and <var>high</var> threshold values must be choosen in the range
16608 [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
16609 </p>
16610 <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
16611 is <code>50/255</code>.
16612 </p></dd>
16613 </dl>
16614
16615 <p>Example:
16616 </p><table><tr><td>&nbsp;</td><td><pre class="example">edgedetect=low=0.1:high=0.4
16617 </pre></td></tr></table>
16618
16619 <a name="extractplanes"></a>
16620 <h2 class="section"><a href="ffmpeg-all.html#toc-extractplanes">37.24 extractplanes</a></h2>
16621
16622 <p>Extract color channel components from input video stream into
16623 separate grayscale video streams.
16624 </p>
16625 <p>The filter accepts the following option:
16626 </p>
16627 <dl compact="compact">
16628 <dt> &lsquo;<samp>planes</samp>&rsquo;</dt>
16629 <dd><p>Set plane(s) to extract.
16630 </p>
16631 <p>Available values for planes are:
16632 </p><dl compact="compact">
16633 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
16634 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
16635 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
16636 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
16637 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
16638 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
16639 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
16640 </dl>
16641
16642 <p>Choosing planes not available in the input will result in an error.
16643 That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
16644 with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
16645 </p></dd>
16646 </dl>
16647
16648 <a name="Examples-11"></a>
16649 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-11">37.24.1 Examples</a></h3>
16650
16651 <ul>
16652 <li>
16653 Extract luma, u and v color channel component from input video frame
16654 into 3 grayscale outputs:
16655 <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
16656 </pre></td></tr></table>
16657 </li></ul>
16658
16659 <a name="elbg"></a>
16660 <h2 class="section"><a href="ffmpeg-all.html#toc-elbg">37.25 elbg</a></h2>
16661
16662 <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
16663 </p>
16664 <p>For each input image, the filter will compute the optimal mapping from
16665 the input to the output given the codebook length, that is the number
16666 of distinct output colors.
16667 </p>
16668 <p>This filter accepts the following options.
16669 </p>
16670 <dl compact="compact">
16671 <dt> &lsquo;<samp>codebook_length, l</samp>&rsquo;</dt>
16672 <dd><p>Set codebook length. The value must be a positive integer, and
16673 represents the number of distinct output colors. Default value is 256.
16674 </p>
16675 </dd>
16676 <dt> &lsquo;<samp>nb_steps, n</samp>&rsquo;</dt>
16677 <dd><p>Set the maximum number of iterations to apply for computing the optimal
16678 mapping. The higher the value the better the result and the higher the
16679 computation time. Default value is 1.
16680 </p>
16681 </dd>
16682 <dt> &lsquo;<samp>seed, s</samp>&rsquo;</dt>
16683 <dd><p>Set a random seed, must be an integer included between 0 and
16684 UINT32_MAX. If not specified, or if explicitly set to -1, the filter
16685 will try to use a good random seed on a best effort basis.
16686 </p></dd>
16687 </dl>
16688
16689 <a name="fade"></a>
16690 <h2 class="section"><a href="ffmpeg-all.html#toc-fade">37.26 fade</a></h2>
16691
16692 <p>Apply fade-in/out effect to input video.
16693 </p>
16694 <p>This filter accepts the following options:
16695 </p>
16696 <dl compact="compact">
16697 <dt> &lsquo;<samp>type, t</samp>&rsquo;</dt>
16698 <dd><p>The effect type &ndash; can be either &quot;in&quot; for fade-in, or &quot;out&quot; for a fade-out
16699 effect.
16700 Default is <code>in</code>.
16701 </p>
16702 </dd>
16703 <dt> &lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
16704 <dd><p>Specify the number of the start frame for starting to apply the fade
16705 effect. Default is 0.
16706 </p>
16707 </dd>
16708 <dt> &lsquo;<samp>nb_frames, n</samp>&rsquo;</dt>
16709 <dd><p>The number of frames for which the fade effect has to last. At the end of the
16710 fade-in effect the output video will have the same intensity as the input video,
16711 at the end of the fade-out transition the output video will be filled with the
16712 selected &lsquo;<samp>color</samp>&rsquo;.
16713 Default is 25.
16714 </p>
16715 </dd>
16716 <dt> &lsquo;<samp>alpha</samp>&rsquo;</dt>
16717 <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
16718 Default value is 0.
16719 </p>
16720 </dd>
16721 <dt> &lsquo;<samp>start_time, st</samp>&rsquo;</dt>
16722 <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
16723 effect. If both start_frame and start_time are specified, the fade will start at
16724 whichever comes last.  Default is 0.
16725 </p>
16726 </dd>
16727 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
16728 <dd><p>The number of seconds for which the fade effect has to last. At the end of the
16729 fade-in effect the output video will have the same intensity as the input video,
16730 at the end of the fade-out transition the output video will be filled with the
16731 selected &lsquo;<samp>color</samp>&rsquo;.
16732 If both duration and nb_frames are specified, duration is used. Default is 0.
16733 </p>
16734 </dd>
16735 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
16736 <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
16737 </p></dd>
16738 </dl>
16739
16740 <a name="Examples-14"></a>
16741 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-14">37.26.1 Examples</a></h3>
16742
16743 <ul>
16744 <li>
16745 Fade in first 30 frames of video:
16746 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:30
16747 </pre></td></tr></table>
16748
16749 <p>The command above is equivalent to:
16750 </p><table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:s=0:n=30
16751 </pre></td></tr></table>
16752
16753 </li><li>
16754 Fade out last 45 frames of a 200-frame video:
16755 <table><tr><td>&nbsp;</td><td><pre class="example">fade=out:155:45
16756 fade=type=out:start_frame=155:nb_frames=45
16757 </pre></td></tr></table>
16758
16759 </li><li>
16760 Fade in first 25 frames and fade out last 25 frames of a 1000-frame video:
16761 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25, fade=out:975:25
16762 </pre></td></tr></table>
16763
16764 </li><li>
16765 Make first 5 frames yellow, then fade in from frame 5-24:
16766 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:5:20:color=yellow
16767 </pre></td></tr></table>
16768
16769 </li><li>
16770 Fade in alpha over first 25 frames of video:
16771 <table><tr><td>&nbsp;</td><td><pre class="example">fade=in:0:25:alpha=1
16772 </pre></td></tr></table>
16773
16774 </li><li>
16775 Make first 5.5 seconds black, then fade in for 0.5 seconds:
16776 <table><tr><td>&nbsp;</td><td><pre class="example">fade=t=in:st=5.5:d=0.5
16777 </pre></td></tr></table>
16778
16779 </li></ul>
16780
16781 <a name="field"></a>
16782 <h2 class="section"><a href="ffmpeg-all.html#toc-field">37.27 field</a></h2>
16783
16784 <p>Extract a single field from an interlaced image using stride
16785 arithmetic to avoid wasting CPU time. The output frames are marked as
16786 non-interlaced.
16787 </p>
16788 <p>The filter accepts the following options:
16789 </p>
16790 <dl compact="compact">
16791 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
16792 <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
16793 <code>top</code>) or the bottom field (if the value is <code>1</code> or
16794 <code>bottom</code>).
16795 </p></dd>
16796 </dl>
16797
16798 <a name="fieldmatch"></a>
16799 <h2 class="section"><a href="ffmpeg-all.html#toc-fieldmatch">37.28 fieldmatch</a></h2>
16800
16801 <p>Field matching filter for inverse telecine. It is meant to reconstruct the
16802 progressive frames from a telecined stream. The filter does not drop duplicated
16803 frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
16804 followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
16805 </p>
16806 <p>The separation of the field matching and the decimation is notably motivated by
16807 the possibility of inserting a de-interlacing filter fallback between the two.
16808 If the source has mixed telecined and real interlaced content,
16809 <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
16810 But these remaining combed frames will be marked as interlaced, and thus can be
16811 de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
16812 </p>
16813 <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
16814 optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; option. If
16815 enabled, the frames reconstruction will be based on the fields and frames from
16816 this second stream. This allows the first input to be pre-processed in order to
16817 help the various algorithms of the filter, while keeping the output lossless
16818 (assuming the fields are matched properly). Typically, a field-aware denoiser,
16819 or brightness/contrast adjustments can help.
16820 </p>
16821 <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
16822 and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
16823 which <code>fieldmatch</code> is based on. While the semantic and usage are very
16824 close, some behaviour and options names can differ.
16825 </p>
16826 <p>The filter accepts the following options:
16827 </p>
16828 <dl compact="compact">
16829 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
16830 <dd><p>Specify the assumed field order of the input stream. Available values are:
16831 </p>
16832 <dl compact="compact">
16833 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
16834 <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
16835 </p></dd>
16836 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
16837 <dd><p>Assume bottom field first.
16838 </p></dd>
16839 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
16840 <dd><p>Assume top field first.
16841 </p></dd>
16842 </dl>
16843
16844 <p>Note that it is sometimes recommended not to trust the parity announced by the
16845 stream.
16846 </p>
16847 <p>Default value is <var>auto</var>.
16848 </p>
16849 </dd>
16850 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
16851 <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
16852 sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
16853 possible, but if there are bad edits or blended fields it will end up
16854 outputting combed frames when a good match might actually exist. On the other
16855 hand, &lsquo;<samp>pcn_ub</samp>&rsquo; mode is the most risky in terms of creating jerkiness,
16856 but will almost always find a good frame if there is one. The other values are
16857 all somewhere in between &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; in terms of risking
16858 jerkiness and creating duplicate frames versus finding good matches in sections
16859 with bad edits, orphaned fields, blended fields, etc.
16860 </p>
16861 <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.
16862 </p>
16863 <p>Available values are:
16864 </p>
16865 <dl compact="compact">
16866 <dt> &lsquo;<samp>pc</samp>&rsquo;</dt>
16867 <dd><p>2-way matching (p/c)
16868 </p></dd>
16869 <dt> &lsquo;<samp>pc_n</samp>&rsquo;</dt>
16870 <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
16871 </p></dd>
16872 <dt> &lsquo;<samp>pc_u</samp>&rsquo;</dt>
16873 <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
16874 </p></dd>
16875 <dt> &lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
16876 <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
16877 still combed (p/c + n + u/b)
16878 </p></dd>
16879 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
16880 <dd><p>3-way matching (p/c/n)
16881 </p></dd>
16882 <dt> &lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
16883 <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
16884 detected as combed (p/c/n + u/b)
16885 </p></dd>
16886 </dl>
16887
16888 <p>The parenthesis at the end indicate the matches that would be used for that
16889 mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
16890 <var>top</var>).
16891 </p>
16892 <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
16893 the slowest.
16894 </p>
16895 <p>Default value is <var>pc_n</var>.
16896 </p>
16897 </dd>
16898 <dt> &lsquo;<samp>ppsrc</samp>&rsquo;</dt>
16899 <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
16900 input stream as the clean source to pick the fields from. See the filter
16901 introduction for more details. It is similar to the &lsquo;<samp>clip2</samp>&rsquo; feature from
16902 VFM/TFM.
16903 </p>
16904 <p>Default value is <code>0</code> (disabled).
16905 </p>
16906 </dd>
16907 <dt> &lsquo;<samp>field</samp>&rsquo;</dt>
16908 <dd><p>Set the field to match from. It is recommended to set this to the same value as
16909 &lsquo;<samp>order</samp>&rsquo; unless you experience matching failures with that setting. In
16910 certain circumstances changing the field that is used to match from can have a
16911 large impact on matching performance. Available values are:
16912 </p>
16913 <dl compact="compact">
16914 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
16915 <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
16916 </p></dd>
16917 <dt> &lsquo;<samp>bottom</samp>&rsquo;</dt>
16918 <dd><p>Match from the bottom field.
16919 </p></dd>
16920 <dt> &lsquo;<samp>top</samp>&rsquo;</dt>
16921 <dd><p>Match from the top field.
16922 </p></dd>
16923 </dl>
16924
16925 <p>Default value is <var>auto</var>.
16926 </p>
16927 </dd>
16928 <dt> &lsquo;<samp>mchroma</samp>&rsquo;</dt>
16929 <dd><p>Set whether or not chroma is included during the match comparisons. In most
16930 cases it is recommended to leave this enabled. You should set this to <code>0</code>
16931 only if your clip has bad chroma problems such as heavy rainbowing or other
16932 artifacts. Setting this to <code>0</code> could also be used to speed things up at
16933 the cost of some accuracy.
16934 </p>
16935 <p>Default value is <code>1</code>.
16936 </p>
16937 </dd>
16938 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
16939 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
16940 <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
16941 &lsquo;<samp>y1</samp>&rsquo; from being included in the field matching decision. An exclusion
16942 band can be used to ignore subtitles, a logo, or other things that may
16943 interfere with the matching. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
16944 &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
16945 &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
16946 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
16947 &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
16948 </p>
16949 </dd>
16950 <dt> &lsquo;<samp>scthresh</samp>&rsquo;</dt>
16951 <dd><p>Set the scene change detection threshold as a percentage of maximum change on
16952 the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
16953 detection is only relevant in case &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>.  The range for
16954 &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
16955 </p>
16956 <p>Default value is <code>12.0</code>.
16957 </p>
16958 </dd>
16959 <dt> &lsquo;<samp>combmatch</samp>&rsquo;</dt>
16960 <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; is not <var>none</var>, <code>fieldmatch</code> will take into
16961 account the combed scores of matches when deciding what match to use as the
16962 final match. Available values are:
16963 </p>
16964 <dl compact="compact">
16965 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
16966 <dd><p>No final matching based on combed scores.
16967 </p></dd>
16968 <dt> &lsquo;<samp>sc</samp>&rsquo;</dt>
16969 <dd><p>Combed scores are only used when a scene change is detected.
16970 </p></dd>
16971 <dt> &lsquo;<samp>full</samp>&rsquo;</dt>
16972 <dd><p>Use combed scores all the time.
16973 </p></dd>
16974 </dl>
16975
16976 <p>Default is <var>sc</var>.
16977 </p>
16978 </dd>
16979 <dt> &lsquo;<samp>combdbg</samp>&rsquo;</dt>
16980 <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
16981 print them. This setting is known as &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
16982 Available values are:
16983 </p>
16984 <dl compact="compact">
16985 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
16986 <dd><p>No forced calculation.
16987 </p></dd>
16988 <dt> &lsquo;<samp>pcn</samp>&rsquo;</dt>
16989 <dd><p>Force p/c/n calculations.
16990 </p></dd>
16991 <dt> &lsquo;<samp>pcnub</samp>&rsquo;</dt>
16992 <dd><p>Force p/c/n/u/b calculations.
16993 </p></dd>
16994 </dl>
16995
16996 <p>Default value is <var>none</var>.
16997 </p>
16998 </dd>
16999 <dt> &lsquo;<samp>cthresh</samp>&rsquo;</dt>
17000 <dd><p>This is the area combing threshold used for combed frame detection. This
17001 essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
17002 Larger values mean combing must be more visible and smaller values mean combing
17003 can be less visible or strong and still be detected. Valid settings are from
17004 <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
17005 be detected as combed). This is basically a pixel difference value. A good
17006 range is <code>[8, 12]</code>.
17007 </p>
17008 <p>Default value is <code>9</code>.
17009 </p>
17010 </dd>
17011 <dt> &lsquo;<samp>chroma</samp>&rsquo;</dt>
17012 <dd><p>Sets whether or not chroma is considered in the combed frame decision.  Only
17013 disable this if your source has chroma problems (rainbowing, etc.) that are
17014 causing problems for the combed frame detection with chroma enabled. Actually,
17015 using &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
17016 where there is chroma only combing in the source.
17017 </p>
17018 <p>Default value is <code>0</code>.
17019 </p>
17020 </dd>
17021 <dt> &lsquo;<samp>blockx</samp>&rsquo;</dt>
17022 <dt> &lsquo;<samp>blocky</samp>&rsquo;</dt>
17023 <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
17024 frame detection. This has to do with the size of the area in which
17025 &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
17026 declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
17027 Possible values are any number that is a power of 2 starting at 4 and going up
17028 to 512.
17029 </p>
17030 <p>Default value is <code>16</code>.
17031 </p>
17032 </dd>
17033 <dt> &lsquo;<samp>combpel</samp>&rsquo;</dt>
17034 <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
17035 &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
17036 combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
17037 setting controls &quot;how much&quot; combing there must be in any localized area (a
17038 window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; settings) on the
17039 frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
17040 which point no frames will ever be detected as combed). This setting is known
17041 as &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
17042 </p>
17043 <p>Default value is <code>80</code>.
17044 </p></dd>
17045 </dl>
17046
17047 <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
17048 </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
17049 <h3 class="subsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">37.28.1 p/c/n/u/b meaning</a></h3>
17050
17051 <a name="p_002fc_002fn"></a>
17052 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn">37.28.1.1 p/c/n</a></h4>
17053
17054 <p>We assume the following telecined stream:
17055 </p>
17056 <table><tr><td>&nbsp;</td><td><pre class="example">Top fields:     1 2 2 3 4
17057 Bottom fields:  1 2 3 4 4
17058 </pre></td></tr></table>
17059
17060 <p>The numbers correspond to the progressive frame the fields relate to. Here, the
17061 first two frames are progressive, the 3rd and 4th are combed, and so on.
17062 </p>
17063 <p>When <code>fieldmatch</code> is configured to run a matching from bottom
17064 (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
17065 </p>
17066 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
17067                 T     1 2 2 3 4
17068                 B     1 2 3 4 4   &lt;-- matching reference
17069
17070 Matches:              c c n n c
17071
17072 Output stream:
17073                 T     1 2 3 4 4
17074                 B     1 2 3 4 4
17075 </pre></td></tr></table>
17076
17077 <p>As a result of the field matching, we can see that some frames get duplicated.
17078 To perform a complete inverse telecine, you need to rely on a decimation filter
17079 after this operation. See for instance the <a href="#decimate">decimate</a> filter.
17080 </p>
17081 <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
17082 looks like this:
17083 </p>
17084 <table><tr><td>&nbsp;</td><td><pre class="example">Input stream:
17085                 T     1 2 2 3 4   &lt;-- matching reference
17086                 B     1 2 3 4 4
17087
17088 Matches:              c c p p c
17089
17090 Output stream:
17091                 T     1 2 2 3 4
17092                 B     1 2 2 3 4
17093 </pre></td></tr></table>
17094
17095 <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
17096 basically, they refer to the frame and field of the opposite parity:
17097 </p>
17098 <ul>
17099 <li> <var>p</var> matches the field of the opposite parity in the previous frame
17100 </li><li> <var>c</var> matches the field of the opposite parity in the current frame
17101 </li><li> <var>n</var> matches the field of the opposite parity in the next frame
17102 </li></ul>
17103
17104 <a name="u_002fb"></a>
17105 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-u_002fb">37.28.1.2 u/b</a></h4>
17106
17107 <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
17108 from the opposite parity flag. In the following examples, we assume that we are
17109 currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
17110 &rsquo;x&rsquo; is placed above and below each matched fields.
17111 </p>
17112 <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
17113 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
17114
17115                  x       x               x        x          x
17116   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
17117   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
17118                  x         x           x        x              x
17119
17120 Output frames:
17121                  2          1          2          2          2
17122                  2          2          2          1          3
17123 </pre></td></tr></table>
17124
17125 <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
17126 </p><table><tr><td>&nbsp;</td><td><pre class="example">Match:           c         p           n          b          u
17127
17128                  x         x           x        x              x
17129   Top          1 2 2     1 2 2       1 2 2      1 2 2      1 2 2
17130   Bottom       1 2 3     1 2 3       1 2 3      1 2 3      1 2 3
17131                  x       x               x        x          x
17132
17133 Output frames:
17134                  2          2          2          1          2
17135                  2          1          3          2          2
17136 </pre></td></tr></table>
17137
17138 <a name="Examples-35"></a>
17139 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-35">37.28.2 Examples</a></h3>
17140
17141 <p>Simple IVTC of a top field first telecined stream:
17142 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=none, decimate
17143 </pre></td></tr></table>
17144
17145 <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
17146 </p><table><tr><td>&nbsp;</td><td><pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
17147 </pre></td></tr></table>
17148
17149 <a name="fieldorder"></a>
17150 <h2 class="section"><a href="ffmpeg-all.html#toc-fieldorder">37.29 fieldorder</a></h2>
17151
17152 <p>Transform the field order of the input video.
17153 </p>
17154 <p>This filter accepts the following options:
17155 </p>
17156 <dl compact="compact">
17157 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
17158 <dd><p>Output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
17159 for bottom field first.
17160 </p></dd>
17161 </dl>
17162
17163 <p>Default value is &lsquo;<samp>tff</samp>&rsquo;.
17164 </p>
17165 <p>Transformation is achieved by shifting the picture content up or down
17166 by one line, and filling the remaining line with appropriate picture content.
17167 This method is consistent with most broadcast field order converters.
17168 </p>
17169 <p>If the input video is not flagged as being interlaced, or it is already
17170 flagged as being of the required output field order then this filter does
17171 not alter the incoming video.
17172 </p>
17173 <p>This filter is very useful when converting to or from PAL DV material,
17174 which is bottom field first.
17175 </p>
17176 <p>For example:
17177 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
17178 </pre></td></tr></table>
17179
17180 <a name="fifo"></a>
17181 <h2 class="section"><a href="ffmpeg-all.html#toc-fifo">37.30 fifo</a></h2>
17182
17183 <p>Buffer input images and send them when they are requested.
17184 </p>
17185 <p>This filter is mainly useful when auto-inserted by the libavfilter
17186 framework.
17187 </p>
17188 <p>The filter does not take parameters.
17189 </p>
17190 <p><a name="format"></a>
17191 </p><a name="format-1"></a>
17192 <h2 class="section"><a href="ffmpeg-all.html#toc-format-1">37.31 format</a></h2>
17193
17194 <p>Convert the input video to one of the specified pixel formats.
17195 Libavfilter will try to pick one that is supported for the input to
17196 the next filter.
17197 </p>
17198 <p>This filter accepts the following parameters:
17199 </p><dl compact="compact">
17200 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
17201 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
17202 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
17203 </p>
17204 </dd>
17205 </dl>
17206
17207 <a name="Examples-81"></a>
17208 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-81">37.31.1 Examples</a></h3>
17209
17210 <ul>
17211 <li>
17212 Convert the input video to the format <var>yuv420p</var>
17213 <table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p
17214 </pre></td></tr></table>
17215
17216 <p>Convert the input video to any of the formats in the list
17217 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
17218 </pre></td></tr></table>
17219 </li></ul>
17220
17221 <p><a name="fps"></a>
17222 </p><a name="fps-1"></a>
17223 <h2 class="section"><a href="ffmpeg-all.html#toc-fps-1">37.32 fps</a></h2>
17224
17225 <p>Convert the video to specified constant frame rate by duplicating or dropping
17226 frames as necessary.
17227 </p>
17228 <p>This filter accepts the following named parameters:
17229 </p><dl compact="compact">
17230 <dt> &lsquo;<samp>fps</samp>&rsquo;</dt>
17231 <dd><p>Desired output frame rate. The default is <code>25</code>.
17232 </p>
17233 </dd>
17234 <dt> &lsquo;<samp>round</samp>&rsquo;</dt>
17235 <dd><p>Rounding method.
17236 </p>
17237 <p>Possible values are:
17238 </p><dl compact="compact">
17239 <dt> &lsquo;<samp>zero</samp>&rsquo;</dt>
17240 <dd><p>zero round towards 0
17241 </p></dd>
17242 <dt> &lsquo;<samp>inf</samp>&rsquo;</dt>
17243 <dd><p>round away from 0
17244 </p></dd>
17245 <dt> &lsquo;<samp>down</samp>&rsquo;</dt>
17246 <dd><p>round towards -infinity
17247 </p></dd>
17248 <dt> &lsquo;<samp>up</samp>&rsquo;</dt>
17249 <dd><p>round towards +infinity
17250 </p></dd>
17251 <dt> &lsquo;<samp>near</samp>&rsquo;</dt>
17252 <dd><p>round to nearest
17253 </p></dd>
17254 </dl>
17255 <p>The default is <code>near</code>.
17256 </p>
17257 </dd>
17258 <dt> &lsquo;<samp>start_time</samp>&rsquo;</dt>
17259 <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
17260 padding/trimming at the start of stream. By default, no assumption is made
17261 about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
17262 For example, this could be set to 0 to pad the beginning with duplicates of
17263 the first frame if a video stream starts after the audio stream or to trim any
17264 frames with a negative PTS.
17265 </p>
17266 </dd>
17267 </dl>
17268
17269 <p>Alternatively, the options can be specified as a flat string:
17270 <var>fps</var>[:<var>round</var>].
17271 </p>
17272 <p>See also the <a href="#setpts">setpts</a> filter.
17273 </p>
17274 <a name="Examples-6"></a>
17275 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-6">37.32.1 Examples</a></h3>
17276
17277 <ul>
17278 <li>
17279 A typical usage in order to set the fps to 25:
17280 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=25
17281 </pre></td></tr></table>
17282
17283 </li><li>
17284 Sets the fps to 24, using abbreviation and rounding method to round to nearest:
17285 <table><tr><td>&nbsp;</td><td><pre class="example">fps=fps=film:round=near
17286 </pre></td></tr></table>
17287 </li></ul>
17288
17289 <a name="framestep"></a>
17290 <h2 class="section"><a href="ffmpeg-all.html#toc-framestep">37.33 framestep</a></h2>
17291
17292 <p>Select one frame every N-th frame.
17293 </p>
17294 <p>This filter accepts the following option:
17295 </p><dl compact="compact">
17296 <dt> &lsquo;<samp>step</samp>&rsquo;</dt>
17297 <dd><p>Select frame after every <code>step</code> frames.
17298 Allowed values are positive integers higher than 0. Default value is <code>1</code>.
17299 </p></dd>
17300 </dl>
17301
17302 <p><a name="frei0r"></a>
17303 </p><a name="frei0r-1"></a>
17304 <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r-1">37.34 frei0r</a></h2>
17305
17306 <p>Apply a frei0r effect to the input video.
17307 </p>
17308 <p>To enable compilation of this filter you need to install the frei0r
17309 header and configure FFmpeg with <code>--enable-frei0r</code>.
17310 </p>
17311 <p>This filter accepts the following options:
17312 </p>
17313 <dl compact="compact">
17314 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
17315 <dd><p>The name to the frei0r effect to load. If the environment variable
17316 <code>FREI0R_PATH</code> is defined, the frei0r effect is searched in each one of the
17317 directories specified by the colon separated list in <code>FREIOR_PATH</code>,
17318 otherwise in the standard frei0r paths, which are in this order:
17319 &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
17320 &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
17321 </p>
17322 </dd>
17323 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
17324 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
17325 </p>
17326 </dd>
17327 </dl>
17328
17329 <p>A frei0r effect parameter can be a boolean (whose values are specified
17330 with &quot;y&quot; and &quot;n&quot;), a double, a color (specified by the syntax
17331 <var>R</var>/<var>G</var>/<var>B</var>, (<var>R</var>, <var>G</var>, and <var>B</var> being float
17332 numbers from 0.0 to 1.0) or by a color description specified in the &quot;Color&quot;
17333 section in the ffmpeg-utils manual), a position (specified by the syntax <var>X</var>/<var>Y</var>,
17334 <var>X</var> and <var>Y</var> being float numbers) and a string.
17335 </p>
17336 <p>The number and kind of parameters depend on the loaded effect. If an
17337 effect parameter is not specified the default value is set.
17338 </p>
17339 <a name="Examples-73"></a>
17340 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-73">37.34.1 Examples</a></h3>
17341
17342 <ul>
17343 <li>
17344 Apply the distort0r effect, set the first two double parameters:
17345 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
17346 </pre></td></tr></table>
17347
17348 </li><li>
17349 Apply the colordistance effect, take a color as first parameter:
17350 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=colordistance:0.2/0.3/0.4
17351 frei0r=colordistance:violet
17352 frei0r=colordistance:0x112233
17353 </pre></td></tr></table>
17354
17355 </li><li>
17356 Apply the perspective effect, specify the top left and top right image
17357 positions:
17358 <table><tr><td>&nbsp;</td><td><pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
17359 </pre></td></tr></table>
17360 </li></ul>
17361
17362 <p>For more information see:
17363 <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
17364 </p>
17365 <a name="geq"></a>
17366 <h2 class="section"><a href="ffmpeg-all.html#toc-geq">37.35 geq</a></h2>
17367
17368 <p>The filter accepts the following options:
17369 </p>
17370 <dl compact="compact">
17371 <dt> &lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
17372 <dd><p>Set the luminance expression.
17373 </p></dd>
17374 <dt> &lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
17375 <dd><p>Set the chrominance blue expression.
17376 </p></dd>
17377 <dt> &lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
17378 <dd><p>Set the chrominance red expression.
17379 </p></dd>
17380 <dt> &lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
17381 <dd><p>Set the alpha expression.
17382 </p></dd>
17383 <dt> &lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
17384 <dd><p>Set the red expression.
17385 </p></dd>
17386 <dt> &lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
17387 <dd><p>Set the green expression.
17388 </p></dd>
17389 <dt> &lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
17390 <dd><p>Set the blue expression.
17391 </p></dd>
17392 </dl>
17393
17394 <p>The colorspace is selected according to the specified options. If one
17395 of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
17396 options is specified, the filter will automatically select a YCbCr
17397 colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
17398 &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
17399 colorspace.
17400 </p>
17401 <p>If one of the chrominance expression is not defined, it falls back on the other
17402 one. If no alpha expression is specified it will evaluate to opaque value.
17403 If none of chrominance expressions are specified, they will evaluate
17404 to the luminance expression.
17405 </p>
17406 <p>The expressions can use the following variables and functions:
17407 </p>
17408 <dl compact="compact">
17409 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
17410 <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
17411 </p>
17412 </dd>
17413 <dt> &lsquo;<samp>X</samp>&rsquo;</dt>
17414 <dt> &lsquo;<samp>Y</samp>&rsquo;</dt>
17415 <dd><p>The coordinates of the current sample.
17416 </p>
17417 </dd>
17418 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
17419 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
17420 <dd><p>The width and height of the image.
17421 </p>
17422 </dd>
17423 <dt> &lsquo;<samp>SW</samp>&rsquo;</dt>
17424 <dt> &lsquo;<samp>SH</samp>&rsquo;</dt>
17425 <dd><p>Width and height scale depending on the currently filtered plane. It is the
17426 ratio between the corresponding luma plane number of pixels and the current
17427 plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
17428 <code>0.5,0.5</code> for chroma planes.
17429 </p>
17430 </dd>
17431 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
17432 <dd><p>Time of the current frame, expressed in seconds.
17433 </p>
17434 </dd>
17435 <dt> &lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
17436 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
17437 plane.
17438 </p>
17439 </dd>
17440 <dt> &lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
17441 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
17442 plane.
17443 </p>
17444 </dd>
17445 <dt> &lsquo;<samp>cb(x, y)</samp>&rsquo;</dt>
17446 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
17447 blue-difference chroma plane. Return 0 if there is no such plane.
17448 </p>
17449 </dd>
17450 <dt> &lsquo;<samp>cr(x, y)</samp>&rsquo;</dt>
17451 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
17452 red-difference chroma plane. Return 0 if there is no such plane.
17453 </p>
17454 </dd>
17455 <dt> &lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
17456 <dt> &lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
17457 <dt> &lsquo;<samp>b(x, y)</samp>&rsquo;</dt>
17458 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
17459 red/green/blue component. Return 0 if there is no such component.
17460 </p>
17461 </dd>
17462 <dt> &lsquo;<samp>alpha(x, y)</samp>&rsquo;</dt>
17463 <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
17464 plane. Return 0 if there is no such plane.
17465 </p></dd>
17466 </dl>
17467
17468 <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
17469 automatically clipped to the closer edge.
17470 </p>
17471 <a name="Examples-15"></a>
17472 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-15">37.35.1 Examples</a></h3>
17473
17474 <ul>
17475 <li>
17476 Flip the image horizontally:
17477 <table><tr><td>&nbsp;</td><td><pre class="example">geq=p(W-X\,Y)
17478 </pre></td></tr></table>
17479
17480 </li><li>
17481 Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
17482 wavelength of 100 pixels:
17483 <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
17484 </pre></td></tr></table>
17485
17486 </li><li>
17487 Generate a fancy enigmatic moving light:
17488 <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
17489 </pre></td></tr></table>
17490
17491 </li><li>
17492 Generate a quick emboss effect:
17493 <table><tr><td>&nbsp;</td><td><pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
17494 </pre></td></tr></table>
17495
17496 </li><li>
17497 Modify RGB components depending on pixel position:
17498 <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)'
17499 </pre></td></tr></table>
17500 </li></ul>
17501
17502 <a name="gradfun"></a>
17503 <h2 class="section"><a href="ffmpeg-all.html#toc-gradfun">37.36 gradfun</a></h2>
17504
17505 <p>Fix the banding artifacts that are sometimes introduced into nearly flat
17506 regions by truncation to 8bit color depth.
17507 Interpolate the gradients that should go where the bands are, and
17508 dither them.
17509 </p>
17510 <p>This filter is designed for playback only.  Do not use it prior to
17511 lossy compression, because compression tends to lose the dither and
17512 bring back the bands.
17513 </p>
17514 <p>This filter accepts the following options:
17515 </p>
17516 <dl compact="compact">
17517 <dt> &lsquo;<samp>strength</samp>&rsquo;</dt>
17518 <dd><p>The maximum amount by which the filter will change any one pixel. Also the
17519 threshold for detecting nearly flat regions. Acceptable values range from .51 to
17520 64, default value is 1.2, out-of-range values will be clipped to the valid
17521 range.
17522 </p>
17523 </dd>
17524 <dt> &lsquo;<samp>radius</samp>&rsquo;</dt>
17525 <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
17526 gradients, but also prevents the filter from modifying the pixels near detailed
17527 regions. Acceptable values are 8-32, default value is 16, out-of-range values
17528 will be clipped to the valid range.
17529 </p>
17530 </dd>
17531 </dl>
17532
17533 <p>Alternatively, the options can be specified as a flat string:
17534 <var>strength</var>[:<var>radius</var>]
17535 </p>
17536 <a name="Examples-80"></a>
17537 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-80">37.36.1 Examples</a></h3>
17538
17539 <ul>
17540 <li>
17541 Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
17542 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=3.5:8
17543 </pre></td></tr></table>
17544
17545 </li><li>
17546 Specify radius, omitting the strength (which will fall-back to the default
17547 value):
17548 <table><tr><td>&nbsp;</td><td><pre class="example">gradfun=radius=8
17549 </pre></td></tr></table>
17550
17551 </li></ul>
17552
17553 <p><a name="haldclut"></a>
17554 </p><a name="haldclut-1"></a>
17555 <h2 class="section"><a href="ffmpeg-all.html#toc-haldclut-1">37.37 haldclut</a></h2>
17556
17557 <p>Apply a Hald CLUT to a video stream.
17558 </p>
17559 <p>First input is the video stream to process, and second one is the Hald CLUT.
17560 The Hald CLUT input can be a simple picture or a complete video stream.
17561 </p>
17562 <p>The filter accepts the following options:
17563 </p>
17564 <dl compact="compact">
17565 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
17566 <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
17567 </p></dd>
17568 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
17569 <dd><p>Continue applying the last CLUT after the end of the stream. A value of
17570 <code>0</code> disable the filter after the last frame of the CLUT is reached.
17571 Default is <code>1</code>.
17572 </p></dd>
17573 </dl>
17574
17575 <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
17576 filters share the same internals).
17577 </p>
17578 <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
17579 (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
17580 </p>
17581 <a name="Workflow-examples"></a>
17582 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Workflow-examples">37.37.1 Workflow examples</a></h3>
17583
17584 <a name="Hald-CLUT-video-stream"></a>
17585 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-video-stream">37.37.1.1 Hald CLUT video stream</a></h4>
17586
17587 <p>Generate an identity Hald CLUT stream altered with various effects:
17588 </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
17589 </pre></td></tr></table>
17590
17591 <p>Note: make sure you use a lossless codec.
17592 </p>
17593 <p>Then use it with <code>haldclut</code> to apply it on some random stream:
17594 </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
17595 </pre></td></tr></table>
17596
17597 <p>The Hald CLUT will be applied to the 10 first seconds (duration of
17598 &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
17599 to the remaining frames of the <code>mandelbrot</code> stream.
17600 </p>
17601 <a name="Hald-CLUT-with-preview"></a>
17602 <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-with-preview">37.37.1.2 Hald CLUT with preview</a></h4>
17603
17604 <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
17605 <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
17606 biggest possible square starting at the top left of the picture. The remaining
17607 padding pixels (bottom or right) will be ignored. This area can be used to add
17608 a preview of the Hald CLUT.
17609 </p>
17610 <p>Typically, the following generated Hald CLUT will be supported by the
17611 <code>haldclut</code> filter:
17612 </p>
17613 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
17614    pad=iw+320 [padded_clut];
17615    smptebars=s=320x256, split [a][b];
17616    [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
17617    [main][b] overlay=W-320&quot; -frames:v 1 clut.png
17618 </pre></td></tr></table>
17619
17620 <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
17621 bars are displayed on the right-top, and below the same color bars processed by
17622 the color changes.
17623 </p>
17624 <p>Then, the effect of this Hald CLUT can be visualized with:
17625 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
17626 </pre></td></tr></table>
17627
17628 <a name="hflip"></a>
17629 <h2 class="section"><a href="ffmpeg-all.html#toc-hflip">37.38 hflip</a></h2>
17630
17631 <p>Flip the input video horizontally.
17632 </p>
17633 <p>For example to horizontally flip the input video with <code>ffmpeg</code>:
17634 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
17635 </pre></td></tr></table>
17636
17637 <a name="histeq"></a>
17638 <h2 class="section"><a href="ffmpeg-all.html#toc-histeq">37.39 histeq</a></h2>
17639 <p>This filter applies a global color histogram equalization on a
17640 per-frame basis.
17641 </p>
17642 <p>It can be used to correct video that has a compressed range of pixel
17643 intensities.  The filter redistributes the pixel intensities to
17644 equalize their distribution across the intensity range. It may be
17645 viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
17646 useful only for correcting degraded or poorly captured source
17647 video.
17648 </p>
17649 <p>The filter accepts the following options:
17650 </p>
17651 <dl compact="compact">
17652 <dt> &lsquo;<samp>strength</samp>&rsquo;</dt>
17653 <dd><p>Determine the amount of equalization to be applied.  As the strength
17654 is reduced, the distribution of pixel intensities more-and-more
17655 approaches that of the input frame. The value must be a float number
17656 in the range [0,1] and defaults to 0.200.
17657 </p>
17658 </dd>
17659 <dt> &lsquo;<samp>intensity</samp>&rsquo;</dt>
17660 <dd><p>Set the maximum intensity that can generated and scale the output
17661 values appropriately.  The strength should be set as desired and then
17662 the intensity can be limited if needed to avoid washing-out. The value
17663 must be a float number in the range [0,1] and defaults to 0.210.
17664 </p>
17665 </dd>
17666 <dt> &lsquo;<samp>antibanding</samp>&rsquo;</dt>
17667 <dd><p>Set the antibanding level. If enabled the filter will randomly vary
17668 the luminance of output pixels by a small amount to avoid banding of
17669 the histogram. Possible values are <code>none</code>, <code>weak</code> or
17670 <code>strong</code>. It defaults to <code>none</code>.
17671 </p></dd>
17672 </dl>
17673
17674 <a name="histogram"></a>
17675 <h2 class="section"><a href="ffmpeg-all.html#toc-histogram">37.40 histogram</a></h2>
17676
17677 <p>Compute and draw a color distribution histogram for the input video.
17678 </p>
17679 <p>The computed histogram is a representation of distribution of color components
17680 in an image.
17681 </p>
17682 <p>The filter accepts the following options:
17683 </p>
17684 <dl compact="compact">
17685 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
17686 <dd><p>Set histogram mode.
17687 </p>
17688 <p>It accepts the following values:
17689 </p><dl compact="compact">
17690 <dt> &lsquo;<samp>levels</samp>&rsquo;</dt>
17691 <dd><p>standard histogram that display color components distribution in an image.
17692 Displays color graph for each color component. Shows distribution
17693 of the Y, U, V, A or R, G, B components, depending on input format,
17694 in current frame. Bellow each graph is color component scale meter.
17695 </p>
17696 </dd>
17697 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
17698 <dd><p>chroma values in vectorscope, if brighter more such chroma values are
17699 distributed in an image.
17700 Displays chroma values (U/V color placement) in two dimensional graph
17701 (which is called a vectorscope). It can be used to read of the hue and
17702 saturation of the current frame. At a same time it is a histogram.
17703 The whiter a pixel in the vectorscope, the more pixels of the input frame
17704 correspond to that pixel (that is the more pixels have this chroma value).
17705 The V component is displayed on the horizontal (X) axis, with the leftmost
17706 side being V = 0 and the rightmost side being V = 255.
17707 The U component is displayed on the vertical (Y) axis, with the top
17708 representing U = 0 and the bottom representing U = 255.
17709 </p>
17710 <p>The position of a white pixel in the graph corresponds to the chroma value
17711 of a pixel of the input clip. So the graph can be used to read of the
17712 hue (color flavor) and the saturation (the dominance of the hue in the color).
17713 As the hue of a color changes, it moves around the square. At the center of
17714 the square, the saturation is zero, which means that the corresponding pixel
17715 has no color. If you increase the amount of a specific color, while leaving
17716 the other colors unchanged, the saturation increases, and you move towards
17717 the edge of the square.
17718 </p>
17719 </dd>
17720 <dt> &lsquo;<samp>color2</samp>&rsquo;</dt>
17721 <dd><p>chroma values in vectorscope, similar as <code>color</code> but actual chroma values
17722 are displayed.
17723 </p>
17724 </dd>
17725 <dt> &lsquo;<samp>waveform</samp>&rsquo;</dt>
17726 <dd><p>per row/column color component graph. In row mode graph in the left side represents
17727 color component value 0 and right side represents value = 255. In column mode top
17728 side represents color component value = 0 and bottom side represents value = 255.
17729 </p></dd>
17730 </dl>
17731 <p>Default value is <code>levels</code>.
17732 </p>
17733 </dd>
17734 <dt> &lsquo;<samp>level_height</samp>&rsquo;</dt>
17735 <dd><p>Set height of level in <code>levels</code>. Default value is <code>200</code>.
17736 Allowed range is [50, 2048].
17737 </p>
17738 </dd>
17739 <dt> &lsquo;<samp>scale_height</samp>&rsquo;</dt>
17740 <dd><p>Set height of color scale in <code>levels</code>. Default value is <code>12</code>.
17741 Allowed range is [0, 40].
17742 </p>
17743 </dd>
17744 <dt> &lsquo;<samp>step</samp>&rsquo;</dt>
17745 <dd><p>Set step for <code>waveform</code> mode. Smaller values are useful to find out how much
17746 of same luminance values across input rows/columns are distributed.
17747 Default value is <code>10</code>. Allowed range is [1, 255].
17748 </p>
17749 </dd>
17750 <dt> &lsquo;<samp>waveform_mode</samp>&rsquo;</dt>
17751 <dd><p>Set mode for <code>waveform</code>. Can be either <code>row</code>, or <code>column</code>.
17752 Default is <code>row</code>.
17753 </p>
17754 </dd>
17755 <dt> &lsquo;<samp>waveform_mirror</samp>&rsquo;</dt>
17756 <dd><p>Set mirroring mode for <code>waveform</code>. <code>0</code> means unmirrored, <code>1</code>
17757 means mirrored. In mirrored mode, higher values will be represented on the left
17758 side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
17759 <code>0</code> (unmirrored).
17760 </p>
17761 </dd>
17762 <dt> &lsquo;<samp>display_mode</samp>&rsquo;</dt>
17763 <dd><p>Set display mode for <code>waveform</code> and <code>levels</code>.
17764 It accepts the following values:
17765 </p><dl compact="compact">
17766 <dt> &lsquo;<samp>parade</samp>&rsquo;</dt>
17767 <dd><p>Display separate graph for the color components side by side in
17768 <code>row</code> waveform mode or one below other in <code>column</code> waveform mode
17769 for <code>waveform</code> histogram mode. For <code>levels</code> histogram mode
17770 per color component graphs are placed one bellow other.
17771 </p>
17772 <p>This display mode in <code>waveform</code> histogram mode makes it easy to spot
17773 color casts in the highlights and shadows of an image, by comparing the
17774 contours of the top and the bottom of each waveform.
17775 Since whites, grays, and blacks are characterized by
17776 exactly equal amounts of red, green, and blue, neutral areas of the
17777 picture should display three waveforms of roughly equal width/height.
17778 If not, the correction is easy to make by making adjustments to level the
17779 three waveforms.
17780 </p>
17781 </dd>
17782 <dt> &lsquo;<samp>overlay</samp>&rsquo;</dt>
17783 <dd><p>Presents information that&rsquo;s identical to that in the <code>parade</code>, except
17784 that the graphs representing color components are superimposed directly
17785 over one another.
17786 </p>
17787 <p>This display mode in <code>waveform</code> histogram mode can make it easier to spot
17788 the relative differences or similarities in overlapping areas of the color
17789 components that are supposed to be identical, such as neutral whites, grays,
17790 or blacks.
17791 </p></dd>
17792 </dl>
17793 <p>Default is <code>parade</code>.
17794 </p>
17795 </dd>
17796 <dt> &lsquo;<samp>levels_mode</samp>&rsquo;</dt>
17797 <dd><p>Set mode for <code>levels</code>. Can be either <code>linear</code>, or <code>logarithmic</code>.
17798 Default is <code>linear</code>.
17799 </p></dd>
17800 </dl>
17801
17802 <a name="Examples-55"></a>
17803 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-55">37.40.1 Examples</a></h3>
17804
17805 <ul>
17806 <li>
17807 Calculate and draw histogram:
17808 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -i input -vf histogram
17809 </pre></td></tr></table>
17810
17811 </li></ul>
17812
17813 <p><a name="hqdn3d"></a>
17814 </p><a name="hqdn3d-1"></a>
17815 <h2 class="section"><a href="ffmpeg-all.html#toc-hqdn3d-1">37.41 hqdn3d</a></h2>
17816
17817 <p>High precision/quality 3d denoise filter. This filter aims to reduce
17818 image noise producing smooth images and making still images really
17819 still. It should enhance compressibility.
17820 </p>
17821 <p>It accepts the following optional parameters:
17822 </p>
17823 <dl compact="compact">
17824 <dt> &lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
17825 <dd><p>a non-negative float number which specifies spatial luma strength,
17826 defaults to 4.0
17827 </p>
17828 </dd>
17829 <dt> &lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
17830 <dd><p>a non-negative float number which specifies spatial chroma strength,
17831 defaults to 3.0*<var>luma_spatial</var>/4.0
17832 </p>
17833 </dd>
17834 <dt> &lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
17835 <dd><p>a float number which specifies luma temporal strength, defaults to
17836 6.0*<var>luma_spatial</var>/4.0
17837 </p>
17838 </dd>
17839 <dt> &lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
17840 <dd><p>a float number which specifies chroma temporal strength, defaults to
17841 <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>
17842 </p></dd>
17843 </dl>
17844
17845 <a name="hue"></a>
17846 <h2 class="section"><a href="ffmpeg-all.html#toc-hue">37.42 hue</a></h2>
17847
17848 <p>Modify the hue and/or the saturation of the input.
17849 </p>
17850 <p>This filter accepts the following options:
17851 </p>
17852 <dl compact="compact">
17853 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
17854 <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
17855 and defaults to &quot;0&quot;.
17856 </p>
17857 </dd>
17858 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
17859 <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
17860 defaults to &quot;1&quot;.
17861 </p>
17862 </dd>
17863 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
17864 <dd><p>Specify the hue angle as a number of radians. It accepts an
17865 expression, and defaults to &quot;0&quot;.
17866 </p>
17867 </dd>
17868 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
17869 <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
17870 defaults to &quot;0&quot;.
17871 </p></dd>
17872 </dl>
17873
17874 <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
17875 specified at the same time.
17876 </p>
17877 <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
17878 expressions containing the following constants:
17879 </p>
17880 <dl compact="compact">
17881 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
17882 <dd><p>frame count of the input frame starting from 0
17883 </p>
17884 </dd>
17885 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
17886 <dd><p>presentation timestamp of the input frame expressed in time base units
17887 </p>
17888 </dd>
17889 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
17890 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
17891 </p>
17892 </dd>
17893 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
17894 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
17895 </p>
17896 </dd>
17897 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
17898 <dd><p>time base of the input video
17899 </p></dd>
17900 </dl>
17901
17902 <a name="Examples-66"></a>
17903 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-66">37.42.1 Examples</a></h3>
17904
17905 <ul>
17906 <li>
17907 Set the hue to 90 degrees and the saturation to 1.0:
17908 <table><tr><td>&nbsp;</td><td><pre class="example">hue=h=90:s=1
17909 </pre></td></tr></table>
17910
17911 </li><li>
17912 Same command but expressing the hue in radians:
17913 <table><tr><td>&nbsp;</td><td><pre class="example">hue=H=PI/2:s=1
17914 </pre></td></tr></table>
17915
17916 </li><li>
17917 Rotate hue and make the saturation swing between 0
17918 and 2 over a period of 1 second:
17919 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
17920 </pre></td></tr></table>
17921
17922 </li><li>
17923 Apply a 3 seconds saturation fade-in effect starting at 0:
17924 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(t/3\,1)&quot;
17925 </pre></td></tr></table>
17926
17927 <p>The general fade-in expression can be written as:
17928 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
17929 </pre></td></tr></table>
17930
17931 </li><li>
17932 Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
17933 <table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
17934 </pre></td></tr></table>
17935
17936 <p>The general fade-out expression can be written as:
17937 </p><table><tr><td>&nbsp;</td><td><pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
17938 </pre></td></tr></table>
17939
17940 </li></ul>
17941
17942 <a name="Commands"></a>
17943 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands">37.42.2 Commands</a></h3>
17944
17945 <p>This filter supports the following commands:
17946 </p><dl compact="compact">
17947 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
17948 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
17949 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
17950 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
17951 <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
17952 The command accepts the same syntax of the corresponding option.
17953 </p>
17954 <p>If the specified expression is not valid, it is kept at its current
17955 value.
17956 </p></dd>
17957 </dl>
17958
17959 <a name="idet"></a>
17960 <h2 class="section"><a href="ffmpeg-all.html#toc-idet">37.43 idet</a></h2>
17961
17962 <p>Detect video interlacing type.
17963 </p>
17964 <p>This filter tries to detect if the input is interlaced or progressive,
17965 top or bottom field first.
17966 </p>
17967 <p>The filter accepts the following options:
17968 </p>
17969 <dl compact="compact">
17970 <dt> &lsquo;<samp>intl_thres</samp>&rsquo;</dt>
17971 <dd><p>Set interlacing threshold.
17972 </p></dd>
17973 <dt> &lsquo;<samp>prog_thres</samp>&rsquo;</dt>
17974 <dd><p>Set progressive threshold.
17975 </p></dd>
17976 </dl>
17977
17978 <a name="il"></a>
17979 <h2 class="section"><a href="ffmpeg-all.html#toc-il">37.44 il</a></h2>
17980
17981 <p>Deinterleave or interleave fields.
17982 </p>
17983 <p>This filter allows to process interlaced images fields without
17984 deinterlacing them. Deinterleaving splits the input frame into 2
17985 fields (so called half pictures). Odd lines are moved to the top
17986 half of the output image, even lines to the bottom half.
17987 You can process (filter) them independently and then re-interleave them.
17988 </p>
17989 <p>The filter accepts the following options:
17990 </p>
17991 <dl compact="compact">
17992 <dt> &lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
17993 <dt> &lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
17994 <dt> &lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
17995 <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
17996 <var>alpha_mode</var> are:
17997 </p>
17998 <dl compact="compact">
17999 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
18000 <dd><p>Do nothing.
18001 </p>
18002 </dd>
18003 <dt> &lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
18004 <dd><p>Deinterleave fields, placing one above the other.
18005 </p>
18006 </dd>
18007 <dt> &lsquo;<samp>interleave, i</samp>&rsquo;</dt>
18008 <dd><p>Interleave fields. Reverse the effect of deinterleaving.
18009 </p></dd>
18010 </dl>
18011 <p>Default value is <code>none</code>.
18012 </p>
18013 </dd>
18014 <dt> &lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
18015 <dt> &lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
18016 <dt> &lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
18017 <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
18018 </p></dd>
18019 </dl>
18020
18021 <a name="interlace"></a>
18022 <h2 class="section"><a href="ffmpeg-all.html#toc-interlace">37.45 interlace</a></h2>
18023
18024 <p>Simple interlacing filter from progressive contents. This interleaves upper (or
18025 lower) lines from odd frames with lower (or upper) lines from even frames,
18026 halving the frame rate and preserving image height.
18027 </p>
18028 <table><tr><td>&nbsp;</td><td><pre class="example">   Original        Original             New Frame
18029    Frame 'j'      Frame 'j+1'             (tff)
18030   ==========      ===========       ==================
18031     Line 0  --------------------&gt;    Frame 'j' Line 0
18032     Line 1          Line 1  ----&gt;   Frame 'j+1' Line 1
18033     Line 2 ---------------------&gt;    Frame 'j' Line 2
18034     Line 3          Line 3  ----&gt;   Frame 'j+1' Line 3
18035      ...             ...                   ...
18036 New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
18037 </pre></td></tr></table>
18038
18039 <p>It accepts the following optional parameters:
18040 </p>
18041 <dl compact="compact">
18042 <dt> &lsquo;<samp>scan</samp>&rsquo;</dt>
18043 <dd><p>determines whether the interlaced frame is taken from the even (tff - default)
18044 or odd (bff) lines of the progressive frame.
18045 </p>
18046 </dd>
18047 <dt> &lsquo;<samp>lowpass</samp>&rsquo;</dt>
18048 <dd><p>Enable (default) or disable the vertical lowpass filter to avoid twitter
18049 interlacing and reduce moire patterns.
18050 </p></dd>
18051 </dl>
18052
18053 <a name="kerndeint"></a>
18054 <h2 class="section"><a href="ffmpeg-all.html#toc-kerndeint">37.46 kerndeint</a></h2>
18055
18056 <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
18057 deinterling. Work on interlaced parts of a video to produce
18058 progressive frames.
18059 </p>
18060 <p>The description of the accepted parameters follows.
18061 </p>
18062 <dl compact="compact">
18063 <dt> &lsquo;<samp>thresh</samp>&rsquo;</dt>
18064 <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
18065 determining if a pixel line must be processed. It must be an integer
18066 in the range [0,255] and defaults to 10. A value of 0 will result in
18067 applying the process on every pixels.
18068 </p>
18069 </dd>
18070 <dt> &lsquo;<samp>map</samp>&rsquo;</dt>
18071 <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
18072 Default is 0.
18073 </p>
18074 </dd>
18075 <dt> &lsquo;<samp>order</samp>&rsquo;</dt>
18076 <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
18077 0. Default is 0.
18078 </p>
18079 </dd>
18080 <dt> &lsquo;<samp>sharp</samp>&rsquo;</dt>
18081 <dd><p>Enable additional sharpening if set to 1. Default is 0.
18082 </p>
18083 </dd>
18084 <dt> &lsquo;<samp>twoway</samp>&rsquo;</dt>
18085 <dd><p>Enable twoway sharpening if set to 1. Default is 0.
18086 </p></dd>
18087 </dl>
18088
18089 <a name="Examples-48"></a>
18090 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-48">37.46.1 Examples</a></h3>
18091
18092 <ul>
18093 <li>
18094 Apply default values:
18095 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
18096 </pre></td></tr></table>
18097
18098 </li><li>
18099 Enable additional sharpening:
18100 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=sharp=1
18101 </pre></td></tr></table>
18102
18103 </li><li>
18104 Paint processed pixels in white:
18105 <table><tr><td>&nbsp;</td><td><pre class="example">kerndeint=map=1
18106 </pre></td></tr></table>
18107 </li></ul>
18108
18109 <p><a name="lut3d"></a>
18110 </p><a name="lut3d-1"></a>
18111 <h2 class="section"><a href="ffmpeg-all.html#toc-lut3d-1">37.47 lut3d</a></h2>
18112
18113 <p>Apply a 3D LUT to an input video.
18114 </p>
18115 <p>The filter accepts the following options:
18116 </p>
18117 <dl compact="compact">
18118 <dt> &lsquo;<samp>file</samp>&rsquo;</dt>
18119 <dd><p>Set the 3D LUT file name.
18120 </p>
18121 <p>Currently supported formats:
18122 </p><dl compact="compact">
18123 <dt> &lsquo;<samp>3dl</samp>&rsquo;</dt>
18124 <dd><p>AfterEffects
18125 </p></dd>
18126 <dt> &lsquo;<samp>cube</samp>&rsquo;</dt>
18127 <dd><p>Iridas
18128 </p></dd>
18129 <dt> &lsquo;<samp>dat</samp>&rsquo;</dt>
18130 <dd><p>DaVinci
18131 </p></dd>
18132 <dt> &lsquo;<samp>m3d</samp>&rsquo;</dt>
18133 <dd><p>Pandora
18134 </p></dd>
18135 </dl>
18136 </dd>
18137 <dt> &lsquo;<samp>interp</samp>&rsquo;</dt>
18138 <dd><p>Select interpolation mode.
18139 </p>
18140 <p>Available values are:
18141 </p>
18142 <dl compact="compact">
18143 <dt> &lsquo;<samp>nearest</samp>&rsquo;</dt>
18144 <dd><p>Use values from the nearest defined point.
18145 </p></dd>
18146 <dt> &lsquo;<samp>trilinear</samp>&rsquo;</dt>
18147 <dd><p>Interpolate values using the 8 points defining a cube.
18148 </p></dd>
18149 <dt> &lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
18150 <dd><p>Interpolate values using a tetrahedron.
18151 </p></dd>
18152 </dl>
18153 </dd>
18154 </dl>
18155
18156 <a name="lut_002c-lutrgb_002c-lutyuv"></a>
18157 <h2 class="section"><a href="ffmpeg-all.html#toc-lut_002c-lutrgb_002c-lutyuv">37.48 lut, lutrgb, lutyuv</a></h2>
18158
18159 <p>Compute a look-up table for binding each pixel component input value
18160 to an output value, and apply it to input video.
18161 </p>
18162 <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
18163 to an RGB input video.
18164 </p>
18165 <p>These filters accept the following options:
18166 </p><dl compact="compact">
18167 <dt> &lsquo;<samp>c0</samp>&rsquo;</dt>
18168 <dd><p>set first pixel component expression
18169 </p></dd>
18170 <dt> &lsquo;<samp>c1</samp>&rsquo;</dt>
18171 <dd><p>set second pixel component expression
18172 </p></dd>
18173 <dt> &lsquo;<samp>c2</samp>&rsquo;</dt>
18174 <dd><p>set third pixel component expression
18175 </p></dd>
18176 <dt> &lsquo;<samp>c3</samp>&rsquo;</dt>
18177 <dd><p>set fourth pixel component expression, corresponds to the alpha component
18178 </p>
18179 </dd>
18180 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
18181 <dd><p>set red component expression
18182 </p></dd>
18183 <dt> &lsquo;<samp>g</samp>&rsquo;</dt>
18184 <dd><p>set green component expression
18185 </p></dd>
18186 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
18187 <dd><p>set blue component expression
18188 </p></dd>
18189 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
18190 <dd><p>alpha component expression
18191 </p>
18192 </dd>
18193 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
18194 <dd><p>set Y/luminance component expression
18195 </p></dd>
18196 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
18197 <dd><p>set U/Cb component expression
18198 </p></dd>
18199 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
18200 <dd><p>set V/Cr component expression
18201 </p></dd>
18202 </dl>
18203
18204 <p>Each of them specifies the expression to use for computing the lookup table for
18205 the corresponding pixel component values.
18206 </p>
18207 <p>The exact component associated to each of the <var>c*</var> options depends on the
18208 format in input.
18209 </p>
18210 <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
18211 <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
18212 </p>
18213 <p>The expressions can contain the following constants and functions:
18214 </p>
18215 <dl compact="compact">
18216 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
18217 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
18218 <dd><p>the input width and height
18219 </p>
18220 </dd>
18221 <dt> &lsquo;<samp>val</samp>&rsquo;</dt>
18222 <dd><p>input value for the pixel component
18223 </p>
18224 </dd>
18225 <dt> &lsquo;<samp>clipval</samp>&rsquo;</dt>
18226 <dd><p>the input value clipped in the <var>minval</var>-<var>maxval</var> range
18227 </p>
18228 </dd>
18229 <dt> &lsquo;<samp>maxval</samp>&rsquo;</dt>
18230 <dd><p>maximum value for the pixel component
18231 </p>
18232 </dd>
18233 <dt> &lsquo;<samp>minval</samp>&rsquo;</dt>
18234 <dd><p>minimum value for the pixel component
18235 </p>
18236 </dd>
18237 <dt> &lsquo;<samp>negval</samp>&rsquo;</dt>
18238 <dd><p>the negated value for the pixel component value clipped in the
18239 <var>minval</var>-<var>maxval</var> range , it corresponds to the expression
18240 &quot;maxval-clipval+minval&quot;
18241 </p>
18242 </dd>
18243 <dt> &lsquo;<samp>clip(val)</samp>&rsquo;</dt>
18244 <dd><p>the computed value in <var>val</var> clipped in the
18245 <var>minval</var>-<var>maxval</var> range
18246 </p>
18247 </dd>
18248 <dt> &lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
18249 <dd><p>the computed gamma correction value of the pixel component value
18250 clipped in the <var>minval</var>-<var>maxval</var> range, corresponds to the
18251 expression
18252 &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
18253 </p>
18254 </dd>
18255 </dl>
18256
18257 <p>All expressions default to &quot;val&quot;.
18258 </p>
18259 <a name="Examples-10"></a>
18260 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-10">37.48.1 Examples</a></h3>
18261
18262 <ul>
18263 <li>
18264 Negate input video:
18265 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
18266 lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
18267 </pre></td></tr></table>
18268
18269 <p>The above is the same as:
18270 </p><table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
18271 lutyuv=&quot;y=negval:u=negval:v=negval&quot;
18272 </pre></td></tr></table>
18273
18274 </li><li>
18275 Negate luminance:
18276 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=negval
18277 </pre></td></tr></table>
18278
18279 </li><li>
18280 Remove chroma components, turns the video into a graytone image:
18281 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;u=128:v=128&quot;
18282 </pre></td></tr></table>
18283
18284 </li><li>
18285 Apply a luma burning effect:
18286 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=&quot;y=2*val&quot;
18287 </pre></td></tr></table>
18288
18289 </li><li>
18290 Remove green and blue components:
18291 <table><tr><td>&nbsp;</td><td><pre class="example">lutrgb=&quot;g=0:b=0&quot;
18292 </pre></td></tr></table>
18293
18294 </li><li>
18295 Set a constant alpha channel value on input:
18296 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
18297 </pre></td></tr></table>
18298
18299 </li><li>
18300 Correct luminance gamma by a 0.5 factor:
18301 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y=gammaval(0.5)
18302 </pre></td></tr></table>
18303
18304 </li><li>
18305 Discard least significant bits of luma:
18306 <table><tr><td>&nbsp;</td><td><pre class="example">lutyuv=y='bitand(val, 128+64+32)'
18307 </pre></td></tr></table>
18308 </li></ul>
18309
18310 <a name="mergeplanes"></a>
18311 <h2 class="section"><a href="ffmpeg-all.html#toc-mergeplanes">37.49 mergeplanes</a></h2>
18312
18313 <p>Merge color channel components from several video streams.
18314 </p>
18315 <p>The filter accepts up to 4 input streams, and merge selected input
18316 planes to the output video.
18317 </p>
18318 <p>This filter accepts the following options:
18319 </p><dl compact="compact">
18320 <dt> &lsquo;<samp>mapping</samp>&rsquo;</dt>
18321 <dd><p>Set input to output plane mapping. Default is <code>0</code>.
18322 </p>
18323 <p>The mappings is specified as a bitmap. It should be specified as a
18324 hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
18325 mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
18326 the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
18327 corresponding input to use (from 0 to 3). The rest of the mappings is
18328 similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
18329 plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
18330 &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
18331 </p>
18332 </dd>
18333 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
18334 <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
18335 </p></dd>
18336 </dl>
18337
18338 <a name="Examples-71"></a>
18339 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-71">37.49.1 Examples</a></h3>
18340
18341 <ul>
18342 <li>
18343 Merge three gray video streams of same width and height into single video stream:
18344 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
18345 </pre></td></tr></table>
18346
18347 </li><li>
18348 Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
18349 <table><tr><td>&nbsp;</td><td><pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
18350 </pre></td></tr></table>
18351
18352 </li><li>
18353 Swap Y and A plane in yuva444p stream:
18354 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
18355 </pre></td></tr></table>
18356
18357 </li><li>
18358 Swap U and V plane in yuv420p stream:
18359 <table><tr><td>&nbsp;</td><td><pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
18360 </pre></td></tr></table>
18361
18362 </li><li>
18363 Cast a rgb24 clip to yuv444p:
18364 <table><tr><td>&nbsp;</td><td><pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
18365 </pre></td></tr></table>
18366 </li></ul>
18367
18368 <a name="mcdeint"></a>
18369 <h2 class="section"><a href="ffmpeg-all.html#toc-mcdeint">37.50 mcdeint</a></h2>
18370
18371 <p>Apply motion-compensation deinterlacing.
18372 </p>
18373 <p>It needs one field per frame as input and must thus be used together
18374 with yadif=1/3 or equivalent.
18375 </p>
18376 <p>This filter accepts the following options:
18377 </p><dl compact="compact">
18378 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
18379 <dd><p>Set the deinterlacing mode.
18380 </p>
18381 <p>It accepts one of the following values:
18382 </p><dl compact="compact">
18383 <dt> &lsquo;<samp>fast</samp>&rsquo;</dt>
18384 <dt> &lsquo;<samp>medium</samp>&rsquo;</dt>
18385 <dt> &lsquo;<samp>slow</samp>&rsquo;</dt>
18386 <dd><p>use iterative motion estimation
18387 </p></dd>
18388 <dt> &lsquo;<samp>extra_slow</samp>&rsquo;</dt>
18389 <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
18390 </p></dd>
18391 </dl>
18392 <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
18393 </p>
18394 </dd>
18395 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
18396 <dd><p>Set the picture field parity assumed for the input video. It must be
18397 one of the following values:
18398 </p>
18399 <dl compact="compact">
18400 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
18401 <dd><p>assume top field first
18402 </p></dd>
18403 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
18404 <dd><p>assume bottom field first
18405 </p></dd>
18406 </dl>
18407
18408 <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
18409 </p>
18410 </dd>
18411 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
18412 <dd><p>Set per-block quantization parameter (QP) used by the internal
18413 encoder.
18414 </p>
18415 <p>Higher values should result in a smoother motion vector field but less
18416 optimal individual vectors. Default value is 1.
18417 </p></dd>
18418 </dl>
18419
18420 <a name="mp"></a>
18421 <h2 class="section"><a href="ffmpeg-all.html#toc-mp">37.51 mp</a></h2>
18422
18423 <p>Apply an MPlayer filter to the input video.
18424 </p>
18425 <p>This filter provides a wrapper around some of the filters of
18426 MPlayer/MEncoder.
18427 </p>
18428 <p>This wrapper is considered experimental. Some of the wrapped filters
18429 may not work properly and we may drop support for them, as they will
18430 be implemented natively into FFmpeg. Thus you should avoid
18431 depending on them when writing portable scripts.
18432 </p>
18433 <p>The filter accepts the parameters:
18434 <var>filter_name</var>[:=]<var>filter_params</var>
18435 </p>
18436 <p><var>filter_name</var> is the name of a supported MPlayer filter,
18437 <var>filter_params</var> is a string containing the parameters accepted by
18438 the named filter.
18439 </p>
18440 <p>The list of the currently supported filters follows:
18441 </p><dl compact="compact">
18442 <dt> <var>eq2</var></dt>
18443 <dt> <var>eq</var></dt>
18444 <dt> <var>fspp</var></dt>
18445 <dt> <var>ilpack</var></dt>
18446 <dt> <var>pp7</var></dt>
18447 <dt> <var>softpulldown</var></dt>
18448 <dt> <var>uspp</var></dt>
18449 </dl>
18450
18451 <p>The parameter syntax and behavior for the listed filters are the same
18452 of the corresponding MPlayer filters. For detailed instructions check
18453 the &quot;VIDEO FILTERS&quot; section in the MPlayer manual.
18454 </p>
18455 <a name="Examples-68"></a>
18456 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-68">37.51.1 Examples</a></h3>
18457
18458 <ul>
18459 <li>
18460 Adjust gamma, brightness, contrast:
18461 <table><tr><td>&nbsp;</td><td><pre class="example">mp=eq2=1.0:2:0.5
18462 </pre></td></tr></table>
18463 </li></ul>
18464
18465 <p>See also mplayer(1), <a href="http://www.mplayerhq.hu/">http://www.mplayerhq.hu/</a>.
18466 </p>
18467 <a name="mpdecimate"></a>
18468 <h2 class="section"><a href="ffmpeg-all.html#toc-mpdecimate">37.52 mpdecimate</a></h2>
18469
18470 <p>Drop frames that do not differ greatly from the previous frame in
18471 order to reduce frame rate.
18472 </p>
18473 <p>The main use of this filter is for very-low-bitrate encoding
18474 (e.g. streaming over dialup modem), but it could in theory be used for
18475 fixing movies that were inverse-telecined incorrectly.
18476 </p>
18477 <p>A description of the accepted options follows.
18478 </p>
18479 <dl compact="compact">
18480 <dt> &lsquo;<samp>max</samp>&rsquo;</dt>
18481 <dd><p>Set the maximum number of consecutive frames which can be dropped (if
18482 positive), or the minimum interval between dropped frames (if
18483 negative). If the value is 0, the frame is dropped unregarding the
18484 number of previous sequentially dropped frames.
18485 </p>
18486 <p>Default value is 0.
18487 </p>
18488 </dd>
18489 <dt> &lsquo;<samp>hi</samp>&rsquo;</dt>
18490 <dt> &lsquo;<samp>lo</samp>&rsquo;</dt>
18491 <dt> &lsquo;<samp>frac</samp>&rsquo;</dt>
18492 <dd><p>Set the dropping threshold values.
18493 </p>
18494 <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; are for 8x8 pixel blocks and
18495 represent actual pixel value differences, so a threshold of 64
18496 corresponds to 1 unit of difference for each pixel, or the same spread
18497 out differently over the block.
18498 </p>
18499 <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
18500 than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
18501 meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
18502 </p>
18503 <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
18504 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
18505 </p></dd>
18506 </dl>
18507
18508
18509 <a name="negate"></a>
18510 <h2 class="section"><a href="ffmpeg-all.html#toc-negate">37.53 negate</a></h2>
18511
18512 <p>Negate input video.
18513 </p>
18514 <p>This filter accepts an integer in input, if non-zero it negates the
18515 alpha component (if available). The default value in input is 0.
18516 </p>
18517 <a name="noformat"></a>
18518 <h2 class="section"><a href="ffmpeg-all.html#toc-noformat">37.54 noformat</a></h2>
18519
18520 <p>Force libavfilter not to use any of the specified pixel formats for the
18521 input to the next filter.
18522 </p>
18523 <p>This filter accepts the following parameters:
18524 </p><dl compact="compact">
18525 <dt> &lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
18526 <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, for example
18527 &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
18528 </p>
18529 </dd>
18530 </dl>
18531
18532 <a name="Examples-9"></a>
18533 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-9">37.54.1 Examples</a></h3>
18534
18535 <ul>
18536 <li>
18537 Force libavfilter to use a format different from <var>yuv420p</var> for the
18538 input to the vflip filter:
18539 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=pix_fmts=yuv420p,vflip
18540 </pre></td></tr></table>
18541
18542 </li><li>
18543 Convert the input video to any of the formats not contained in the list:
18544 <table><tr><td>&nbsp;</td><td><pre class="example">noformat=yuv420p|yuv444p|yuv410p
18545 </pre></td></tr></table>
18546 </li></ul>
18547
18548 <a name="noise"></a>
18549 <h2 class="section"><a href="ffmpeg-all.html#toc-noise">37.55 noise</a></h2>
18550
18551 <p>Add noise on video input frame.
18552 </p>
18553 <p>The filter accepts the following options:
18554 </p>
18555 <dl compact="compact">
18556 <dt> &lsquo;<samp>all_seed</samp>&rsquo;</dt>
18557 <dt> &lsquo;<samp>c0_seed</samp>&rsquo;</dt>
18558 <dt> &lsquo;<samp>c1_seed</samp>&rsquo;</dt>
18559 <dt> &lsquo;<samp>c2_seed</samp>&rsquo;</dt>
18560 <dt> &lsquo;<samp>c3_seed</samp>&rsquo;</dt>
18561 <dd><p>Set noise seed for specific pixel component or all pixel components in case
18562 of <var>all_seed</var>. Default value is <code>123457</code>.
18563 </p>
18564 </dd>
18565 <dt> &lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
18566 <dt> &lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
18567 <dt> &lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
18568 <dt> &lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
18569 <dt> &lsquo;<samp>c3_strength, c3s</samp>&rsquo;</dt>
18570 <dd><p>Set noise strength for specific pixel component or all pixel components in case
18571 <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
18572 </p>
18573 </dd>
18574 <dt> &lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
18575 <dt> &lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
18576 <dt> &lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
18577 <dt> &lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
18578 <dt> &lsquo;<samp>c3_flags, c3f</samp>&rsquo;</dt>
18579 <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
18580 Available values for component flags are:
18581 </p><dl compact="compact">
18582 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
18583 <dd><p>averaged temporal noise (smoother)
18584 </p></dd>
18585 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
18586 <dd><p>mix random noise with a (semi)regular pattern
18587 </p></dd>
18588 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
18589 <dd><p>temporal noise (noise pattern changes between frames)
18590 </p></dd>
18591 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
18592 <dd><p>uniform noise (gaussian otherwise)
18593 </p></dd>
18594 </dl>
18595 </dd>
18596 </dl>
18597
18598 <a name="Examples-86"></a>
18599 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-86">37.55.1 Examples</a></h3>
18600
18601 <p>Add temporal and uniform noise to input video:
18602 </p><table><tr><td>&nbsp;</td><td><pre class="example">noise=alls=20:allf=t+u
18603 </pre></td></tr></table>
18604
18605 <a name="null"></a>
18606 <h2 class="section"><a href="ffmpeg-all.html#toc-null">37.56 null</a></h2>
18607
18608 <p>Pass the video source unchanged to the output.
18609 </p>
18610 <a name="ocv"></a>
18611 <h2 class="section"><a href="ffmpeg-all.html#toc-ocv">37.57 ocv</a></h2>
18612
18613 <p>Apply video transform using libopencv.
18614 </p>
18615 <p>To enable this filter install libopencv library and headers and
18616 configure FFmpeg with <code>--enable-libopencv</code>.
18617 </p>
18618 <p>This filter accepts the following parameters:
18619 </p>
18620 <dl compact="compact">
18621 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
18622 <dd><p>The name of the libopencv filter to apply.
18623 </p>
18624 </dd>
18625 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
18626 <dd><p>The parameters to pass to the libopencv filter. If not specified the default
18627 values are assumed.
18628 </p>
18629 </dd>
18630 </dl>
18631
18632 <p>Refer to the official libopencv documentation for more precise
18633 information:
18634 <a href="http://opencv.willowgarage.com/documentation/c/image_filtering.html">http://opencv.willowgarage.com/documentation/c/image_filtering.html</a>
18635 </p>
18636 <p>Follows the list of supported libopencv filters.
18637 </p>
18638 <p><a name="dilate"></a>
18639 </p><a name="dilate-1"></a>
18640 <h3 class="subsection"><a href="ffmpeg-all.html#toc-dilate-1">37.57.1 dilate</a></h3>
18641
18642 <p>Dilate an image by using a specific structuring element.
18643 This filter corresponds to the libopencv function <code>cvDilate</code>.
18644 </p>
18645 <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
18646 </p>
18647 <p><var>struct_el</var> represents a structuring element, and has the syntax:
18648 <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
18649 </p>
18650 <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
18651 the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
18652 point, and <var>shape</var> the shape for the structuring element, and
18653 can be one of the values &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, &quot;custom&quot;.
18654 </p>
18655 <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
18656 string of the form &quot;=<var>filename</var>&quot;. The file with name
18657 <var>filename</var> is assumed to represent a binary image, with each
18658 printable character corresponding to a bright pixel. When a custom
18659 <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
18660 or columns and rows of the read file are assumed instead.
18661 </p>
18662 <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
18663 </p>
18664 <p><var>nb_iterations</var> specifies the number of times the transform is
18665 applied to the image, and defaults to 1.
18666 </p>
18667 <p>Follow some example:
18668 </p><table><tr><td>&nbsp;</td><td><pre class="example"># use the default values
18669 ocv=dilate
18670
18671 # dilate using a structuring element with a 5x5 cross, iterate two times
18672 ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
18673
18674 # read the shape from the file diamond.shape, iterate two times
18675 # the file diamond.shape may contain a pattern of characters like this:
18676 #   *
18677 #  ***
18678 # *****
18679 #  ***
18680 #   *
18681 # the specified cols and rows are ignored (but not the anchor point coordinates)
18682 ocv=dilate:0x0+2x2/custom=diamond.shape|2
18683 </pre></td></tr></table>
18684
18685 <a name="erode"></a>
18686 <h3 class="subsection"><a href="ffmpeg-all.html#toc-erode">37.57.2 erode</a></h3>
18687
18688 <p>Erode an image by using a specific structuring element.
18689 This filter corresponds to the libopencv function <code>cvErode</code>.
18690 </p>
18691 <p>The filter accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
18692 with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
18693 </p>
18694 <a name="smooth"></a>
18695 <h3 class="subsection"><a href="ffmpeg-all.html#toc-smooth">37.57.3 smooth</a></h3>
18696
18697 <p>Smooth the input video.
18698 </p>
18699 <p>The filter takes the following parameters:
18700 <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
18701 </p>
18702 <p><var>type</var> is the type of smooth filter to apply, and can be one of
18703 the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
18704 &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
18705 </p>
18706 <p><var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var> are
18707 parameters whose meanings depend on smooth type. <var>param1</var> and
18708 <var>param2</var> accept integer positive values or 0, <var>param3</var> and
18709 <var>param4</var> accept float values.
18710 </p>
18711 <p>The default value for <var>param1</var> is 3, the default value for the
18712 other parameters is 0.
18713 </p>
18714 <p>These parameters correspond to the parameters assigned to the
18715 libopencv function <code>cvSmooth</code>.
18716 </p>
18717 <p><a name="overlay"></a>
18718 </p><a name="overlay-1"></a>
18719 <h2 class="section"><a href="ffmpeg-all.html#toc-overlay-1">37.58 overlay</a></h2>
18720
18721 <p>Overlay one video on top of another.
18722 </p>
18723 <p>It takes two inputs and one output, the first input is the &quot;main&quot;
18724 video on which the second input is overlayed.
18725 </p>
18726 <p>This filter accepts the following parameters:
18727 </p>
18728 <p>A description of the accepted options follows.
18729 </p>
18730 <dl compact="compact">
18731 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
18732 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
18733 <dd><p>Set the expression for the x and y coordinates of the overlayed video
18734 on the main video. Default value is &quot;0&quot; for both expressions. In case
18735 the expression is invalid, it is set to a huge value (meaning that the
18736 overlay will not be displayed within the output visible area).
18737 </p>
18738 </dd>
18739 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
18740 <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
18741 </p>
18742 <p>It accepts the following values:
18743 </p><dl compact="compact">
18744 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
18745 <dd><p>only evaluate expressions once during the filter initialization or
18746 when a command is processed
18747 </p>
18748 </dd>
18749 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
18750 <dd><p>evaluate expressions for each incoming frame
18751 </p></dd>
18752 </dl>
18753
18754 <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
18755 </p>
18756 </dd>
18757 <dt> &lsquo;<samp>shortest</samp>&rsquo;</dt>
18758 <dd><p>If set to 1, force the output to terminate when the shortest input
18759 terminates. Default value is 0.
18760 </p>
18761 </dd>
18762 <dt> &lsquo;<samp>format</samp>&rsquo;</dt>
18763 <dd><p>Set the format for the output video.
18764 </p>
18765 <p>It accepts the following values:
18766 </p><dl compact="compact">
18767 <dt> &lsquo;<samp>yuv420</samp>&rsquo;</dt>
18768 <dd><p>force YUV420 output
18769 </p>
18770 </dd>
18771 <dt> &lsquo;<samp>yuv444</samp>&rsquo;</dt>
18772 <dd><p>force YUV444 output
18773 </p>
18774 </dd>
18775 <dt> &lsquo;<samp>rgb</samp>&rsquo;</dt>
18776 <dd><p>force RGB output
18777 </p></dd>
18778 </dl>
18779
18780 <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
18781 </p>
18782 </dd>
18783 <dt> &lsquo;<samp>rgb <em>(deprecated)</em></samp>&rsquo;</dt>
18784 <dd><p>If set to 1, force the filter to accept inputs in the RGB
18785 color space. Default value is 0. This option is deprecated, use
18786 &lsquo;<samp>format</samp>&rsquo; instead.
18787 </p>
18788 </dd>
18789 <dt> &lsquo;<samp>repeatlast</samp>&rsquo;</dt>
18790 <dd><p>If set to 1, force the filter to draw the last overlay frame over the
18791 main input until the end of the stream. A value of 0 disables this
18792 behavior. Default value is 1.
18793 </p></dd>
18794 </dl>
18795
18796 <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
18797 parameters.
18798 </p>
18799 <dl compact="compact">
18800 <dt> &lsquo;<samp>main_w, W</samp>&rsquo;</dt>
18801 <dt> &lsquo;<samp>main_h, H</samp>&rsquo;</dt>
18802 <dd><p>main input width and height
18803 </p>
18804 </dd>
18805 <dt> &lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
18806 <dt> &lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
18807 <dd><p>overlay input width and height
18808 </p>
18809 </dd>
18810 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
18811 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
18812 <dd><p>the computed values for <var>x</var> and <var>y</var>. They are evaluated for
18813 each new frame.
18814 </p>
18815 </dd>
18816 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
18817 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
18818 <dd><p>horizontal and vertical chroma subsample values of the output
18819 format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
18820 <var>vsub</var> is 1.
18821 </p>
18822 </dd>
18823 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
18824 <dd><p>the number of input frame, starting from 0
18825 </p>
18826 </dd>
18827 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
18828 <dd><p>the position in the file of the input frame, NAN if unknown
18829 </p>
18830 </dd>
18831 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
18832 <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
18833 </p></dd>
18834 </dl>
18835
18836 <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
18837 when evaluation is done <em>per frame</em>, and will evaluate to NAN
18838 when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
18839 </p>
18840 <p>Be aware that frames are taken from each input video in timestamp
18841 order, hence, if their initial timestamps differ, it is a good idea
18842 to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
18843 have them begin in the same zero timestamp, as it does the example for
18844 the <var>movie</var> filter.
18845 </p>
18846 <p>You can chain together more overlays but you should test the
18847 efficiency of such approach.
18848 </p>
18849 <a name="Commands-2"></a>
18850 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-2">37.58.1 Commands</a></h3>
18851
18852 <p>This filter supports the following commands:
18853 </p><dl compact="compact">
18854 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
18855 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
18856 <dd><p>Modify the x and y of the overlay input.
18857 The command accepts the same syntax of the corresponding option.
18858 </p>
18859 <p>If the specified expression is not valid, it is kept at its current
18860 value.
18861 </p></dd>
18862 </dl>
18863
18864 <a name="Examples-82"></a>
18865 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-82">37.58.2 Examples</a></h3>
18866
18867 <ul>
18868 <li>
18869 Draw the overlay at 10 pixels from the bottom right corner of the main
18870 video:
18871 <table><tr><td>&nbsp;</td><td><pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
18872 </pre></td></tr></table>
18873
18874 <p>Using named options the example above becomes:
18875 </p><table><tr><td>&nbsp;</td><td><pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
18876 </pre></td></tr></table>
18877
18878 </li><li>
18879 Insert a transparent PNG logo in the bottom left corner of the input,
18880 using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
18881 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
18882 </pre></td></tr></table>
18883
18884 </li><li>
18885 Insert 2 different transparent PNG logos (second logo on bottom
18886 right corner) using the <code>ffmpeg</code> tool:
18887 <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
18888 </pre></td></tr></table>
18889
18890 </li><li>
18891 Add a transparent color layer on top of the main video, <code>WxH</code>
18892 must specify the size of the main input to the overlay filter:
18893 <table><tr><td>&nbsp;</td><td><pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
18894 </pre></td></tr></table>
18895
18896 </li><li>
18897 Play an original video and a filtered version (here with the deshake
18898 filter) side by side using the <code>ffplay</code> tool:
18899 <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'
18900 </pre></td></tr></table>
18901
18902 <p>The above command is the same as:
18903 </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'
18904 </pre></td></tr></table>
18905
18906 </li><li>
18907 Make a sliding overlay appearing from the left to the right top part of the
18908 screen starting since time 2:
18909 <table><tr><td>&nbsp;</td><td><pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
18910 </pre></td></tr></table>
18911
18912 </li><li>
18913 Compose output by putting two input videos side to side:
18914 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
18915 nullsrc=size=200x100 [background];
18916 [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
18917 [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
18918 [background][left]       overlay=shortest=1       [background+left];
18919 [background+left][right] overlay=shortest=1:x=100 [left+right]
18920 &quot;
18921 </pre></td></tr></table>
18922
18923 </li><li>
18924 Chain several overlays in cascade:
18925 <table><tr><td>&nbsp;</td><td><pre class="example">nullsrc=s=200x200 [bg];
18926 testsrc=s=100x100, split=4 [in0][in1][in2][in3];
18927 [in0] lutrgb=r=0, [bg]   overlay=0:0     [mid0];
18928 [in1] lutrgb=g=0, [mid0] overlay=100:0   [mid1];
18929 [in2] lutrgb=b=0, [mid1] overlay=0:100   [mid2];
18930 [in3] null,       [mid2] overlay=100:100 [out0]
18931 </pre></td></tr></table>
18932
18933 </li></ul>
18934
18935 <a name="owdenoise"></a>
18936 <h2 class="section"><a href="ffmpeg-all.html#toc-owdenoise">37.59 owdenoise</a></h2>
18937
18938 <p>Apply Overcomplete Wavelet denoiser.
18939 </p>
18940 <p>The filter accepts the following options:
18941 </p>
18942 <dl compact="compact">
18943 <dt> &lsquo;<samp>depth</samp>&rsquo;</dt>
18944 <dd><p>Set depth.
18945 </p>
18946 <p>Larger depth values will denoise lower frequency components more, but
18947 slow down filtering.
18948 </p>
18949 <p>Must be an int in the range 8-16, default is <code>8</code>.
18950 </p>
18951 </dd>
18952 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
18953 <dd><p>Set luma strength.
18954 </p>
18955 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
18956 </p>
18957 </dd>
18958 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
18959 <dd><p>Set chroma strength.
18960 </p>
18961 <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
18962 </p></dd>
18963 </dl>
18964
18965 <a name="pad"></a>
18966 <h2 class="section"><a href="ffmpeg-all.html#toc-pad">37.60 pad</a></h2>
18967
18968 <p>Add paddings to the input image, and place the original input at the
18969 given coordinates <var>x</var>, <var>y</var>.
18970 </p>
18971 <p>This filter accepts the following parameters:
18972 </p>
18973 <dl compact="compact">
18974 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
18975 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
18976 <dd><p>Specify an expression for the size of the output image with the
18977 paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
18978 corresponding input size is used for the output.
18979 </p>
18980 <p>The <var>width</var> expression can reference the value set by the
18981 <var>height</var> expression, and vice versa.
18982 </p>
18983 <p>The default value of <var>width</var> and <var>height</var> is 0.
18984 </p>
18985 </dd>
18986 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
18987 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
18988 <dd><p>Specify an expression for the offsets where to place the input image
18989 in the padded area with respect to the top/left border of the output
18990 image.
18991 </p>
18992 <p>The <var>x</var> expression can reference the value set by the <var>y</var>
18993 expression, and vice versa.
18994 </p>
18995 <p>The default value of <var>x</var> and <var>y</var> is 0.
18996 </p>
18997 </dd>
18998 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
18999 <dd><p>Specify the color of the padded area. For the syntax of this option,
19000 check the &quot;Color&quot; section in the ffmpeg-utils manual.
19001 </p>
19002 <p>The default value of <var>color</var> is &quot;black&quot;.
19003 </p></dd>
19004 </dl>
19005
19006 <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
19007 options are expressions containing the following constants:
19008 </p>
19009 <dl compact="compact">
19010 <dt> &lsquo;<samp>in_w</samp>&rsquo;</dt>
19011 <dt> &lsquo;<samp>in_h</samp>&rsquo;</dt>
19012 <dd><p>the input video width and height
19013 </p>
19014 </dd>
19015 <dt> &lsquo;<samp>iw</samp>&rsquo;</dt>
19016 <dt> &lsquo;<samp>ih</samp>&rsquo;</dt>
19017 <dd><p>same as <var>in_w</var> and <var>in_h</var>
19018 </p>
19019 </dd>
19020 <dt> &lsquo;<samp>out_w</samp>&rsquo;</dt>
19021 <dt> &lsquo;<samp>out_h</samp>&rsquo;</dt>
19022 <dd><p>the output width and height, that is the size of the padded area as
19023 specified by the <var>width</var> and <var>height</var> expressions
19024 </p>
19025 </dd>
19026 <dt> &lsquo;<samp>ow</samp>&rsquo;</dt>
19027 <dt> &lsquo;<samp>oh</samp>&rsquo;</dt>
19028 <dd><p>same as <var>out_w</var> and <var>out_h</var>
19029 </p>
19030 </dd>
19031 <dt> &lsquo;<samp>x</samp>&rsquo;</dt>
19032 <dt> &lsquo;<samp>y</samp>&rsquo;</dt>
19033 <dd><p>x and y offsets as specified by the <var>x</var> and <var>y</var>
19034 expressions, or NAN if not yet specified
19035 </p>
19036 </dd>
19037 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
19038 <dd><p>same as <var>iw</var> / <var>ih</var>
19039 </p>
19040 </dd>
19041 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
19042 <dd><p>input sample aspect ratio
19043 </p>
19044 </dd>
19045 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
19046 <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
19047 </p>
19048 </dd>
19049 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
19050 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
19051 <dd><p>horizontal and vertical chroma subsample values. For example for the
19052 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
19053 </p></dd>
19054 </dl>
19055
19056 <a name="Examples-87"></a>
19057 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-87">37.60.1 Examples</a></h3>
19058
19059 <ul>
19060 <li>
19061 Add paddings with color &quot;violet&quot; to the input video. Output video
19062 size is 640x480, the top-left corner of the input video is placed at
19063 column 0, row 40:
19064 <table><tr><td>&nbsp;</td><td><pre class="example">pad=640:480:0:40:violet
19065 </pre></td></tr></table>
19066
19067 <p>The example above is equivalent to the following command:
19068 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
19069 </pre></td></tr></table>
19070
19071 </li><li>
19072 Pad the input to get an output with dimensions increased by 3/2,
19073 and put the input video at the center of the padded area:
19074 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
19075 </pre></td></tr></table>
19076
19077 </li><li>
19078 Pad the input to get a squared output with size equal to the maximum
19079 value between the input width and height, and put the input video at
19080 the center of the padded area:
19081 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
19082 </pre></td></tr></table>
19083
19084 </li><li>
19085 Pad the input to get a final w/h ratio of 16:9:
19086 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
19087 </pre></td></tr></table>
19088
19089 </li><li>
19090 In case of anamorphic video, in order to set the output display aspect
19091 correctly, it is necessary to use <var>sar</var> in the expression,
19092 according to the relation:
19093 <table><tr><td>&nbsp;</td><td><pre class="example">(ih * X / ih) * sar = output_dar
19094 X = output_dar / sar
19095 </pre></td></tr></table>
19096
19097 <p>Thus the previous example needs to be modified to:
19098 </p><table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
19099 </pre></td></tr></table>
19100
19101 </li><li>
19102 Double output size and put the input video in the bottom-right
19103 corner of the output padded area:
19104 <table><tr><td>&nbsp;</td><td><pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
19105 </pre></td></tr></table>
19106 </li></ul>
19107
19108 <a name="perspective"></a>
19109 <h2 class="section"><a href="ffmpeg-all.html#toc-perspective">37.61 perspective</a></h2>
19110
19111 <p>Correct perspective of video not recorded perpendicular to the screen.
19112 </p>
19113 <p>A description of the accepted parameters follows.
19114 </p>
19115 <dl compact="compact">
19116 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
19117 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
19118 <dt> &lsquo;<samp>x1</samp>&rsquo;</dt>
19119 <dt> &lsquo;<samp>y1</samp>&rsquo;</dt>
19120 <dt> &lsquo;<samp>x2</samp>&rsquo;</dt>
19121 <dt> &lsquo;<samp>y2</samp>&rsquo;</dt>
19122 <dt> &lsquo;<samp>x3</samp>&rsquo;</dt>
19123 <dt> &lsquo;<samp>y3</samp>&rsquo;</dt>
19124 <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
19125 Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
19126 </p>
19127 <p>The expressions can use the following variables:
19128 </p>
19129 <dl compact="compact">
19130 <dt> &lsquo;<samp>W</samp>&rsquo;</dt>
19131 <dt> &lsquo;<samp>H</samp>&rsquo;</dt>
19132 <dd><p>the width and height of video frame.
19133 </p></dd>
19134 </dl>
19135
19136 </dd>
19137 <dt> &lsquo;<samp>interpolation</samp>&rsquo;</dt>
19138 <dd><p>Set interpolation for perspective correction.
19139 </p>
19140 <p>It accepts the following values:
19141 </p><dl compact="compact">
19142 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
19143 <dt> &lsquo;<samp>cubic</samp>&rsquo;</dt>
19144 </dl>
19145
19146 <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
19147 </p></dd>
19148 </dl>
19149
19150 <a name="phase"></a>
19151 <h2 class="section"><a href="ffmpeg-all.html#toc-phase">37.62 phase</a></h2>
19152
19153 <p>Delay interlaced video by one field time so that the field order changes.
19154 </p>
19155 <p>The intended use is to fix PAL movies that have been captured with the
19156 opposite field order to the film-to-video transfer.
19157 </p>
19158 <p>A description of the accepted parameters follows.
19159 </p>
19160 <dl compact="compact">
19161 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
19162 <dd><p>Set phase mode.
19163 </p>
19164 <p>It accepts the following values:
19165 </p><dl compact="compact">
19166 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
19167 <dd><p>Capture field order top-first, transfer bottom-first.
19168 Filter will delay the bottom field.
19169 </p>
19170 </dd>
19171 <dt> &lsquo;<samp>b</samp>&rsquo;</dt>
19172 <dd><p>Capture field order bottom-first, transfer top-first.
19173 Filter will delay the top field.
19174 </p>
19175 </dd>
19176 <dt> &lsquo;<samp>p</samp>&rsquo;</dt>
19177 <dd><p>Capture and transfer with the same field order. This mode only exists
19178 for the documentation of the other options to refer to, but if you
19179 actually select it, the filter will faithfully do nothing.
19180 </p>
19181 </dd>
19182 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
19183 <dd><p>Capture field order determined automatically by field flags, transfer
19184 opposite.
19185 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
19186 basis using field flags. If no field information is available,
19187 then this works just like &lsquo;<samp>u</samp>&rsquo;.
19188 </p>
19189 </dd>
19190 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
19191 <dd><p>Capture unknown or varying, transfer opposite.
19192 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
19193 analyzing the images and selecting the alternative that produces best
19194 match between the fields.
19195 </p>
19196 </dd>
19197 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
19198 <dd><p>Capture top-first, transfer unknown or varying.
19199 Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
19200 </p>
19201 </dd>
19202 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
19203 <dd><p>Capture bottom-first, transfer unknown or varying.
19204 Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
19205 </p>
19206 </dd>
19207 <dt> &lsquo;<samp>A</samp>&rsquo;</dt>
19208 <dd><p>Capture determined by field flags, transfer unknown or varying.
19209 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
19210 image analysis. If no field information is available, then this works just
19211 like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
19212 </p>
19213 </dd>
19214 <dt> &lsquo;<samp>U</samp>&rsquo;</dt>
19215 <dd><p>Both capture and transfer unknown or varying.
19216 Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
19217 </p></dd>
19218 </dl>
19219 </dd>
19220 </dl>
19221
19222 <a name="pixdesctest"></a>
19223 <h2 class="section"><a href="ffmpeg-all.html#toc-pixdesctest">37.63 pixdesctest</a></h2>
19224
19225 <p>Pixel format descriptor test filter, mainly useful for internal
19226 testing. The output video should be equal to the input video.
19227 </p>
19228 <p>For example:
19229 </p><table><tr><td>&nbsp;</td><td><pre class="example">format=monow, pixdesctest
19230 </pre></td></tr></table>
19231
19232 <p>can be used to test the monowhite pixel format descriptor definition.
19233 </p>
19234 <a name="pp"></a>
19235 <h2 class="section"><a href="ffmpeg-all.html#toc-pp">37.64 pp</a></h2>
19236
19237 <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
19238 library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
19239 Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
19240 Each subfilter and some options have a short and a long name that can be used
19241 interchangeably, i.e. dr/dering are the same.
19242 </p>
19243 <p>The filters accept the following options:
19244 </p>
19245 <dl compact="compact">
19246 <dt> &lsquo;<samp>subfilters</samp>&rsquo;</dt>
19247 <dd><p>Set postprocessing subfilters string.
19248 </p></dd>
19249 </dl>
19250
19251 <p>All subfilters share common options to determine their scope:
19252 </p>
19253 <dl compact="compact">
19254 <dt> &lsquo;<samp>a/autoq</samp>&rsquo;</dt>
19255 <dd><p>Honor the quality commands for this subfilter.
19256 </p>
19257 </dd>
19258 <dt> &lsquo;<samp>c/chrom</samp>&rsquo;</dt>
19259 <dd><p>Do chrominance filtering, too (default).
19260 </p>
19261 </dd>
19262 <dt> &lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
19263 <dd><p>Do luminance filtering only (no chrominance).
19264 </p>
19265 </dd>
19266 <dt> &lsquo;<samp>n/noluma</samp>&rsquo;</dt>
19267 <dd><p>Do chrominance filtering only (no luminance).
19268 </p></dd>
19269 </dl>
19270
19271 <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
19272 </p>
19273 <p>Available subfilters are:
19274 </p>
19275 <dl compact="compact">
19276 <dt> &lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
19277 <dd><p>Horizontal deblocking filter
19278 </p><dl compact="compact">
19279 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
19280 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
19281 </p></dd>
19282 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
19283 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
19284 </p></dd>
19285 </dl>
19286
19287 </dd>
19288 <dt> &lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
19289 <dd><p>Vertical deblocking filter
19290 </p><dl compact="compact">
19291 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
19292 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
19293 </p></dd>
19294 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
19295 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
19296 </p></dd>
19297 </dl>
19298
19299 </dd>
19300 <dt> &lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
19301 <dd><p>Accurate horizontal deblocking filter
19302 </p><dl compact="compact">
19303 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
19304 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
19305 </p></dd>
19306 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
19307 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
19308 </p></dd>
19309 </dl>
19310
19311 </dd>
19312 <dt> &lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
19313 <dd><p>Accurate vertical deblocking filter
19314 </p><dl compact="compact">
19315 <dt> &lsquo;<samp>difference</samp>&rsquo;</dt>
19316 <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
19317 </p></dd>
19318 <dt> &lsquo;<samp>flatness</samp>&rsquo;</dt>
19319 <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
19320 </p></dd>
19321 </dl>
19322 </dd>
19323 </dl>
19324
19325 <p>The horizontal and vertical deblocking filters share the difference and
19326 flatness values so you cannot set different horizontal and vertical
19327 thresholds.
19328 </p>
19329 <dl compact="compact">
19330 <dt> &lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
19331 <dd><p>Experimental horizontal deblocking filter
19332 </p>
19333 </dd>
19334 <dt> &lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
19335 <dd><p>Experimental vertical deblocking filter
19336 </p>
19337 </dd>
19338 <dt> &lsquo;<samp>dr/dering</samp>&rsquo;</dt>
19339 <dd><p>Deringing filter
19340 </p>
19341 </dd>
19342 <dt> &lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
19343 <dd><dl compact="compact">
19344 <dt> &lsquo;<samp>threshold1</samp>&rsquo;</dt>
19345 <dd><p>larger -&gt; stronger filtering
19346 </p></dd>
19347 <dt> &lsquo;<samp>threshold2</samp>&rsquo;</dt>
19348 <dd><p>larger -&gt; stronger filtering
19349 </p></dd>
19350 <dt> &lsquo;<samp>threshold3</samp>&rsquo;</dt>
19351 <dd><p>larger -&gt; stronger filtering
19352 </p></dd>
19353 </dl>
19354
19355 </dd>
19356 <dt> &lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
19357 <dd><dl compact="compact">
19358 <dt> &lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
19359 <dd><p>Stretch luminance to <code>0-255</code>.
19360 </p></dd>
19361 </dl>
19362
19363 </dd>
19364 <dt> &lsquo;<samp>lb/linblenddeint</samp>&rsquo;</dt>
19365 <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
19366 filtering all lines with a <code>(1 2 1)</code> filter.
19367 </p>
19368 </dd>
19369 <dt> &lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
19370 <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
19371 linearly interpolating every second line.
19372 </p>
19373 </dd>
19374 <dt> &lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
19375 <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
19376 cubically interpolating every second line.
19377 </p>
19378 </dd>
19379 <dt> &lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
19380 <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
19381 median filter to every second line.
19382 </p>
19383 </dd>
19384 <dt> &lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</dt>
19385 <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
19386 second line with a <code>(-1 4 2 4 -1)</code> filter.
19387 </p>
19388 </dd>
19389 <dt> &lsquo;<samp>l5/lowpass5</samp>&rsquo;</dt>
19390 <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
19391 block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
19392 </p>
19393 </dd>
19394 <dt> &lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
19395 <dd><p>Overrides the quantizer table from the input with the constant quantizer you
19396 specify.
19397 </p><dl compact="compact">
19398 <dt> &lsquo;<samp>quantizer</samp>&rsquo;</dt>
19399 <dd><p>Quantizer to use
19400 </p></dd>
19401 </dl>
19402
19403 </dd>
19404 <dt> &lsquo;<samp>de/default</samp>&rsquo;</dt>
19405 <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
19406 </p>
19407 </dd>
19408 <dt> &lsquo;<samp>fa/fast</samp>&rsquo;</dt>
19409 <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
19410 </p>
19411 </dd>
19412 <dt> &lsquo;<samp>ac</samp>&rsquo;</dt>
19413 <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
19414 </p></dd>
19415 </dl>
19416
19417 <a name="Examples-7"></a>
19418 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-7">37.64.1 Examples</a></h3>
19419
19420 <ul>
19421 <li>
19422 Apply horizontal and vertical deblocking, deringing and automatic
19423 brightness/contrast:
19424 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb/vb/dr/al
19425 </pre></td></tr></table>
19426
19427 </li><li>
19428 Apply default filters without brightness/contrast correction:
19429 <table><tr><td>&nbsp;</td><td><pre class="example">pp=de/-al
19430 </pre></td></tr></table>
19431
19432 </li><li>
19433 Apply default filters and temporal denoiser:
19434 <table><tr><td>&nbsp;</td><td><pre class="example">pp=default/tmpnoise|1|2|3
19435 </pre></td></tr></table>
19436
19437 </li><li>
19438 Apply deblocking on luminance only, and switch vertical deblocking on or off
19439 automatically depending on available CPU time:
19440 <table><tr><td>&nbsp;</td><td><pre class="example">pp=hb|y/vb|a
19441 </pre></td></tr></table>
19442 </li></ul>
19443
19444 <a name="psnr"></a>
19445 <h2 class="section"><a href="ffmpeg-all.html#toc-psnr">37.65 psnr</a></h2>
19446
19447 <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
19448 Ratio) between two input videos.
19449 </p>
19450 <p>This filter takes in input two input videos, the first input is
19451 considered the &quot;main&quot; source and is passed unchanged to the
19452 output. The second input is used as a &quot;reference&quot; video for computing
19453 the PSNR.
19454 </p>
19455 <p>Both video inputs must have the same resolution and pixel format for
19456 this filter to work correctly. Also it assumes that both inputs
19457 have the same number of frames, which are compared one by one.
19458 </p>
19459 <p>The obtained average PSNR is printed through the logging system.
19460 </p>
19461 <p>The filter stores the accumulated MSE (mean squared error) of each
19462 frame, and at the end of the processing it is averaged across all frames
19463 equally, and the following formula is applied to obtain the PSNR:
19464 </p>
19465 <table><tr><td>&nbsp;</td><td><pre class="example">PSNR = 10*log10(MAX^2/MSE)
19466 </pre></td></tr></table>
19467
19468 <p>Where MAX is the average of the maximum values of each component of the
19469 image.
19470 </p>
19471 <p>The description of the accepted parameters follows.
19472 </p>
19473 <dl compact="compact">
19474 <dt> &lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
19475 <dd><p>If specified the filter will use the named file to save the PSNR of
19476 each individual frame.
19477 </p></dd>
19478 </dl>
19479
19480 <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
19481 key/value pairs of the form <var>key</var>:<var>value</var> for each compared
19482 couple of frames.
19483 </p>
19484 <p>A description of each shown parameter follows:
19485 </p>
19486 <dl compact="compact">
19487 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
19488 <dd><p>sequential number of the input frame, starting from 1
19489 </p>
19490 </dd>
19491 <dt> &lsquo;<samp>mse_avg</samp>&rsquo;</dt>
19492 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
19493 frames, averaged over all the image components.
19494 </p>
19495 </dd>
19496 <dt> &lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_g, mse_a</samp>&rsquo;</dt>
19497 <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
19498 frames for the component specified by the suffix.
19499 </p>
19500 </dd>
19501 <dt> &lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
19502 <dd><p>Peak Signal to Noise ratio of the compared frames for the component
19503 specified by the suffix.
19504 </p></dd>
19505 </dl>
19506
19507 <p>For example:
19508 </p><table><tr><td>&nbsp;</td><td><pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
19509 [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
19510 </pre></td></tr></table>
19511
19512 <p>On this example the input file being processed is compared with the
19513 reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
19514 is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
19515 </p>
19516 <a name="pullup"></a>
19517 <h2 class="section"><a href="ffmpeg-all.html#toc-pullup">37.66 pullup</a></h2>
19518
19519 <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
19520 hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
19521 content.
19522 </p>
19523 <p>The pullup filter is designed to take advantage of future context in making
19524 its decisions. This filter is stateless in the sense that it does not lock
19525 onto a pattern to follow, but it instead looks forward to the following
19526 fields in order to identify matches and rebuild progressive frames.
19527 </p>
19528 <p>To produce content with an even framerate, insert the fps filter after
19529 pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
19530 <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
19531 </p>
19532 <p>The filter accepts the following options:
19533 </p>
19534 <dl compact="compact">
19535 <dt> &lsquo;<samp>jl</samp>&rsquo;</dt>
19536 <dt> &lsquo;<samp>jr</samp>&rsquo;</dt>
19537 <dt> &lsquo;<samp>jt</samp>&rsquo;</dt>
19538 <dt> &lsquo;<samp>jb</samp>&rsquo;</dt>
19539 <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
19540 bottom of the image, respectively. Left and right are in units of 8 pixels,
19541 while top and bottom are in units of 2 lines.
19542 The default is 8 pixels on each side.
19543 </p>
19544 </dd>
19545 <dt> &lsquo;<samp>sb</samp>&rsquo;</dt>
19546 <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
19547 filter generating an occasional mismatched frame, but it may also cause an
19548 excessive number of frames to be dropped during high motion sequences.
19549 Conversely, setting it to -1 will make filter match fields more easily.
19550 This may help processing of video where there is slight blurring between
19551 the fields, but may also cause there to be interlaced frames in the output.
19552 Default value is <code>0</code>.
19553 </p>
19554 </dd>
19555 <dt> &lsquo;<samp>mp</samp>&rsquo;</dt>
19556 <dd><p>Set the metric plane to use. It accepts the following values:
19557 </p><dl compact="compact">
19558 <dt> &lsquo;<samp>l</samp>&rsquo;</dt>
19559 <dd><p>Use luma plane.
19560 </p>
19561 </dd>
19562 <dt> &lsquo;<samp>u</samp>&rsquo;</dt>
19563 <dd><p>Use chroma blue plane.
19564 </p>
19565 </dd>
19566 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
19567 <dd><p>Use chroma red plane.
19568 </p></dd>
19569 </dl>
19570
19571 <p>This option may be set to use chroma plane instead of the default luma plane
19572 for doing filter&rsquo;s computations. This may improve accuracy on very clean
19573 source material, but more likely will decrease accuracy, especially if there
19574 is chroma noise (rainbow effect) or any grayscale video.
19575 The main purpose of setting &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
19576 load and make pullup usable in realtime on slow machines.
19577 </p></dd>
19578 </dl>
19579
19580 <p>For best results (without duplicated frames in the output file) it is
19581 necessary to change the output frame rate. For example, to inverse
19582 telecine NTSC input:
19583 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
19584 </pre></td></tr></table>
19585
19586 <a name="removelogo"></a>
19587 <h2 class="section"><a href="ffmpeg-all.html#toc-removelogo">37.67 removelogo</a></h2>
19588
19589 <p>Suppress a TV station logo, using an image file to determine which
19590 pixels comprise the logo. It works by filling in the pixels that
19591 comprise the logo with neighboring pixels.
19592 </p>
19593 <p>The filter accepts the following options:
19594 </p>
19595 <dl compact="compact">
19596 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
19597 <dd><p>Set the filter bitmap file, which can be any image format supported by
19598 libavformat. The width and height of the image file must match those of the
19599 video stream being processed.
19600 </p></dd>
19601 </dl>
19602
19603 <p>Pixels in the provided bitmap image with a value of zero are not
19604 considered part of the logo, non-zero pixels are considered part of
19605 the logo. If you use white (255) for the logo and black (0) for the
19606 rest, you will be safe. For making the filter bitmap, it is
19607 recommended to take a screen capture of a black frame with the logo
19608 visible, and then using a threshold filter followed by the erode
19609 filter once or twice.
19610 </p>
19611 <p>If needed, little splotches can be fixed manually. Remember that if
19612 logo pixels are not covered, the filter quality will be much
19613 reduced. Marking too many pixels as part of the logo does not hurt as
19614 much, but it will increase the amount of blurring needed to cover over
19615 the image and will destroy more information than necessary, and extra
19616 pixels will slow things down on a large logo.
19617 </p>
19618 <a name="rotate"></a>
19619 <h2 class="section"><a href="ffmpeg-all.html#toc-rotate">37.68 rotate</a></h2>
19620
19621 <p>Rotate video by an arbitrary angle expressed in radians.
19622 </p>
19623 <p>The filter accepts the following options:
19624 </p>
19625 <p>A description of the optional parameters follows.
19626 </p><dl compact="compact">
19627 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</dt>
19628 <dd><p>Set an expression for the angle by which to rotate the input video
19629 clockwise, expressed as a number of radians. A negative value will
19630 result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
19631 </p>
19632 <p>This expression is evaluated for each frame.
19633 </p>
19634 </dd>
19635 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
19636 <dd><p>Set the output width expression, default value is &quot;iw&quot;.
19637 This expression is evaluated just once during configuration.
19638 </p>
19639 </dd>
19640 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
19641 <dd><p>Set the output height expression, default value is &quot;ih&quot;.
19642 This expression is evaluated just once during configuration.
19643 </p>
19644 </dd>
19645 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
19646 <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
19647 it. Default value is 1.
19648 </p>
19649 </dd>
19650 <dt> &lsquo;<samp>fillcolor, c</samp>&rsquo;</dt>
19651 <dd><p>Set the color used to fill the output area not covered by the rotated
19652 image. For the generalsyntax of this option, check the &quot;Color&quot; section in the
19653 ffmpeg-utils manual. If the special value &quot;none&quot; is selected then no
19654 background is printed (useful for example if the background is never shown).
19655 </p>
19656 <p>Default value is &quot;black&quot;.
19657 </p></dd>
19658 </dl>
19659
19660 <p>The expressions for the angle and the output size can contain the
19661 following constants and functions:
19662 </p>
19663 <dl compact="compact">
19664 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
19665 <dd><p>sequential number of the input frame, starting from 0. It is always NAN
19666 before the first frame is filtered.
19667 </p>
19668 </dd>
19669 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
19670 <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
19671 configured. It is always NAN before the first frame is filtered.
19672 </p>
19673 </dd>
19674 <dt> &lsquo;<samp>hsub</samp>&rsquo;</dt>
19675 <dt> &lsquo;<samp>vsub</samp>&rsquo;</dt>
19676 <dd><p>horizontal and vertical chroma subsample values. For example for the
19677 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
19678 </p>
19679 </dd>
19680 <dt> &lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
19681 <dt> &lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
19682 <dd><p>the input video width and heigth
19683 </p>
19684 </dd>
19685 <dt> &lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
19686 <dt> &lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
19687 <dd><p>the output width and heigth, that is the size of the padded area as
19688 specified by the <var>width</var> and <var>height</var> expressions
19689 </p>
19690 </dd>
19691 <dt> &lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
19692 <dt> &lsquo;<samp>roth(a)</samp>&rsquo;</dt>
19693 <dd><p>the minimal width/height required for completely containing the input
19694 video rotated by <var>a</var> radians.
19695 </p>
19696 <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
19697 &lsquo;<samp>out_h</samp>&rsquo; expressions.
19698 </p></dd>
19699 </dl>
19700
19701 <a name="Examples-78"></a>
19702 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-78">37.68.1 Examples</a></h3>
19703
19704 <ul>
19705 <li>
19706 Rotate the input by PI/6 radians clockwise:
19707 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/6
19708 </pre></td></tr></table>
19709
19710 </li><li>
19711 Rotate the input by PI/6 radians counter-clockwise:
19712 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=-PI/6
19713 </pre></td></tr></table>
19714
19715 </li><li>
19716 Apply a constant rotation with period T, starting from an angle of PI/3:
19717 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=PI/3+2*PI*t/T
19718 </pre></td></tr></table>
19719
19720 </li><li>
19721 Make the input video rotation oscillating with a period of T
19722 seconds and an amplitude of A radians:
19723 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=A*sin(2*PI/T*t)
19724 </pre></td></tr></table>
19725
19726 </li><li>
19727 Rotate the video, output size is choosen so that the whole rotating
19728 input video is always completely contained in the output:
19729 <table><tr><td>&nbsp;</td><td><pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
19730 </pre></td></tr></table>
19731
19732 </li><li>
19733 Rotate the video, reduce the output size so that no background is ever
19734 shown:
19735 <table><tr><td>&nbsp;</td><td><pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
19736 </pre></td></tr></table>
19737 </li></ul>
19738
19739 <a name="Commands-3"></a>
19740 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-3">37.68.2 Commands</a></h3>
19741
19742 <p>The filter supports the following commands:
19743 </p>
19744 <dl compact="compact">
19745 <dt> &lsquo;<samp>a, angle</samp>&rsquo;</dt>
19746 <dd><p>Set the angle expression.
19747 The command accepts the same syntax of the corresponding option.
19748 </p>
19749 <p>If the specified expression is not valid, it is kept at its current
19750 value.
19751 </p></dd>
19752 </dl>
19753
19754 <a name="sab"></a>
19755 <h2 class="section"><a href="ffmpeg-all.html#toc-sab">37.69 sab</a></h2>
19756
19757 <p>Apply Shape Adaptive Blur.
19758 </p>
19759 <p>The filter accepts the following options:
19760 </p>
19761 <dl compact="compact">
19762 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
19763 <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
19764 value is 1.0. A greater value will result in a more blurred image, and
19765 in slower processing.
19766 </p>
19767 </dd>
19768 <dt> &lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
19769 <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
19770 value is 1.0.
19771 </p>
19772 </dd>
19773 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
19774 <dd><p>Set luma maximum difference between pixels to still be considered, must
19775 be a value in the 0.1-100.0 range, default value is 1.0.
19776 </p>
19777 </dd>
19778 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
19779 <dd><p>Set chroma blur filter strength, must be a value in range 0.1-4.0. A
19780 greater value will result in a more blurred image, and in slower
19781 processing.
19782 </p>
19783 </dd>
19784 <dt> &lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
19785 <dd><p>Set chroma pre-filter radius, must be a value in the 0.1-2.0 range.
19786 </p>
19787 </dd>
19788 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
19789 <dd><p>Set chroma maximum difference between pixels to still be considered,
19790 must be a value in the 0.1-100.0 range.
19791 </p></dd>
19792 </dl>
19793
19794 <p>Each chroma option value, if not explicitly specified, is set to the
19795 corresponding luma option value.
19796 </p>
19797 <p><a name="scale"></a>
19798 </p><a name="scale-1"></a>
19799 <h2 class="section"><a href="ffmpeg-all.html#toc-scale-1">37.70 scale</a></h2>
19800
19801 <p>Scale (resize) the input video, using the libswscale library.
19802 </p>
19803 <p>The scale filter forces the output display aspect ratio to be the same
19804 of the input, by changing the output sample aspect ratio.
19805 </p>
19806 <p>If the input image format is different from the format requested by
19807 the next filter, the scale filter will convert the input to the
19808 requested format.
19809 </p>
19810 <a name="Options"></a>
19811 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options">37.70.1 Options</a></h3>
19812 <p>The filter accepts the following options, or any of the options
19813 supported by the libswscale scaler.
19814 </p>
19815 <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)scaler_options</a> for
19816 the complete list of scaler options.
19817 </p>
19818 <dl compact="compact">
19819 <dt> &lsquo;<samp>width, w</samp>&rsquo;</dt>
19820 <dt> &lsquo;<samp>height, h</samp>&rsquo;</dt>
19821 <dd><p>Set the output video dimension expression. Default value is the input
19822 dimension.
19823 </p>
19824 <p>If the value is 0, the input width is used for the output.
19825 </p>
19826 <p>If one of the values is -1, the scale filter will use a value that
19827 maintains the aspect ratio of the input image, calculated from the
19828 other specified dimension. If both of them are -1, the input size is
19829 used
19830 </p>
19831 <p>See below for the list of accepted constants for use in the dimension
19832 expression.
19833 </p>
19834 </dd>
19835 <dt> &lsquo;<samp>interl</samp>&rsquo;</dt>
19836 <dd><p>Set the interlacing mode. It accepts the following values:
19837 </p>
19838 <dl compact="compact">
19839 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
19840 <dd><p>Force interlaced aware scaling.
19841 </p>
19842 </dd>
19843 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
19844 <dd><p>Do not apply interlaced scaling.
19845 </p>
19846 </dd>
19847 <dt> &lsquo;<samp>-1</samp>&rsquo;</dt>
19848 <dd><p>Select interlaced aware scaling depending on whether the source frames
19849 are flagged as interlaced or not.
19850 </p></dd>
19851 </dl>
19852
19853 <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
19854 </p>
19855 </dd>
19856 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
19857 <dd><p>Set libswscale scaling flags. See
19858 <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)sws_flags</a> for the
19859 complete list of values. If not explictly specified the filter applies
19860 the default flags.
19861 </p>
19862 </dd>
19863 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
19864 <dd><p>Set the video size. For the syntax of this option, check the &quot;Video size&quot;
19865 section in the ffmpeg-utils manual.
19866 </p>
19867 </dd>
19868 <dt> &lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
19869 <dt> &lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
19870 <dd><p>Set in/output YCbCr color space type.
19871 </p>
19872 <p>This allows the autodetected value to be overridden as well as allows forcing
19873 a specific value used for the output and encoder.
19874 </p>
19875 <p>If not specified, the color space type depends on the pixel format.
19876 </p>
19877 <p>Possible values:
19878 </p>
19879 <dl compact="compact">
19880 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
19881 <dd><p>Choose automatically.
19882 </p>
19883 </dd>
19884 <dt> &lsquo;<samp>bt709</samp>&rsquo;</dt>
19885 <dd><p>Format conforming to International Telecommunication Union (ITU)
19886 Recommendation BT.709.
19887 </p>
19888 </dd>
19889 <dt> &lsquo;<samp>fcc</samp>&rsquo;</dt>
19890 <dd><p>Set color space conforming to the United States Federal Communications
19891 Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
19892 </p>
19893 </dd>
19894 <dt> &lsquo;<samp>bt601</samp>&rsquo;</dt>
19895 <dd><p>Set color space conforming to:
19896 </p>
19897 <ul>
19898 <li>
19899 ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
19900
19901 </li><li>
19902 ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
19903
19904 </li><li>
19905 Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
19906
19907 </li></ul>
19908
19909 </dd>
19910 <dt> &lsquo;<samp>smpte240m</samp>&rsquo;</dt>
19911 <dd><p>Set color space conforming to SMPTE ST 240:1999.
19912 </p></dd>
19913 </dl>
19914
19915 </dd>
19916 <dt> &lsquo;<samp>in_range</samp>&rsquo;</dt>
19917 <dt> &lsquo;<samp>out_range</samp>&rsquo;</dt>
19918 <dd><p>Set in/output YCbCr sample range.
19919 </p>
19920 <p>This allows the autodetected value to be overridden as well as allows forcing
19921 a specific value used for the output and encoder. If not specified, the
19922 range depends on the pixel format. Possible values:
19923 </p>
19924 <dl compact="compact">
19925 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
19926 <dd><p>Choose automatically.
19927 </p>
19928 </dd>
19929 <dt> &lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
19930 <dd><p>Set full range (0-255 in case of 8-bit luma).
19931 </p>
19932 </dd>
19933 <dt> &lsquo;<samp>mpeg/tv</samp>&rsquo;</dt>
19934 <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
19935 </p></dd>
19936 </dl>
19937
19938 </dd>
19939 <dt> &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
19940 <dd><p>Enable decreasing or increasing output video width or height if necessary to
19941 keep the original aspect ratio. Possible values:
19942 </p>
19943 <dl compact="compact">
19944 <dt> &lsquo;<samp>disable</samp>&rsquo;</dt>
19945 <dd><p>Scale the video as specified and disable this feature.
19946 </p>
19947 </dd>
19948 <dt> &lsquo;<samp>decrease</samp>&rsquo;</dt>
19949 <dd><p>The output video dimensions will automatically be decreased if needed.
19950 </p>
19951 </dd>
19952 <dt> &lsquo;<samp>increase</samp>&rsquo;</dt>
19953 <dd><p>The output video dimensions will automatically be increased if needed.
19954 </p>
19955 </dd>
19956 </dl>
19957
19958 <p>One useful instance of this option is that when you know a specific device&rsquo;s
19959 maximum allowed resolution, you can use this to limit the output video to
19960 that, while retaining the aspect ratio. For example, device A allows
19961 1280x720 playback, and your video is 1920x800. Using this option (set it to
19962 decrease) and specifying 1280x720 to the command line makes the output
19963 1280x533.
19964 </p>
19965 <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
19966 or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
19967 to work.
19968 </p>
19969 </dd>
19970 </dl>
19971
19972 <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
19973 containing the following constants:
19974 </p>
19975 <dl compact="compact">
19976 <dt> <var>in_w</var></dt>
19977 <dt> <var>in_h</var></dt>
19978 <dd><p>the input width and height
19979 </p>
19980 </dd>
19981 <dt> <var>iw</var></dt>
19982 <dt> <var>ih</var></dt>
19983 <dd><p>same as <var>in_w</var> and <var>in_h</var>
19984 </p>
19985 </dd>
19986 <dt> <var>out_w</var></dt>
19987 <dt> <var>out_h</var></dt>
19988 <dd><p>the output (scaled) width and height
19989 </p>
19990 </dd>
19991 <dt> <var>ow</var></dt>
19992 <dt> <var>oh</var></dt>
19993 <dd><p>same as <var>out_w</var> and <var>out_h</var>
19994 </p>
19995 </dd>
19996 <dt> <var>a</var></dt>
19997 <dd><p>same as <var>iw</var> / <var>ih</var>
19998 </p>
19999 </dd>
20000 <dt> <var>sar</var></dt>
20001 <dd><p>input sample aspect ratio
20002 </p>
20003 </dd>
20004 <dt> <var>dar</var></dt>
20005 <dd><p>input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
20006 </p>
20007 </dd>
20008 <dt> <var>hsub</var></dt>
20009 <dt> <var>vsub</var></dt>
20010 <dd><p>horizontal and vertical input chroma subsample values. For example for the
20011 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
20012 </p>
20013 </dd>
20014 <dt> <var>ohsub</var></dt>
20015 <dt> <var>ovsub</var></dt>
20016 <dd><p>horizontal and vertical output chroma subsample values. For example for the
20017 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
20018 </p></dd>
20019 </dl>
20020
20021 <a name="Examples-23"></a>
20022 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-23">37.70.2 Examples</a></h3>
20023
20024 <ul>
20025 <li>
20026 Scale the input video to a size of 200x100:
20027 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=200:h=100
20028 </pre></td></tr></table>
20029
20030 <p>This is equivalent to:
20031 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200:100
20032 </pre></td></tr></table>
20033
20034 <p>or:
20035 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=200x100
20036 </pre></td></tr></table>
20037
20038 </li><li>
20039 Specify a size abbreviation for the output size:
20040 <table><tr><td>&nbsp;</td><td><pre class="example">scale=qcif
20041 </pre></td></tr></table>
20042
20043 <p>which can also be written as:
20044 </p><table><tr><td>&nbsp;</td><td><pre class="example">scale=size=qcif
20045 </pre></td></tr></table>
20046
20047 </li><li>
20048 Scale the input to 2x:
20049 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=2*iw:h=2*ih
20050 </pre></td></tr></table>
20051
20052 </li><li>
20053 The above is the same as:
20054 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*in_w:2*in_h
20055 </pre></td></tr></table>
20056
20057 </li><li>
20058 Scale the input to 2x with forced interlaced scaling:
20059 <table><tr><td>&nbsp;</td><td><pre class="example">scale=2*iw:2*ih:interl=1
20060 </pre></td></tr></table>
20061
20062 </li><li>
20063 Scale the input to half size:
20064 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=iw/2:h=ih/2
20065 </pre></td></tr></table>
20066
20067 </li><li>
20068 Increase the width, and set the height to the same size:
20069 <table><tr><td>&nbsp;</td><td><pre class="example">scale=3/2*iw:ow
20070 </pre></td></tr></table>
20071
20072 </li><li>
20073 Seek for Greek harmony:
20074 <table><tr><td>&nbsp;</td><td><pre class="example">scale=iw:1/PHI*iw
20075 scale=ih*PHI:ih
20076 </pre></td></tr></table>
20077
20078 </li><li>
20079 Increase the height, and set the width to 3/2 of the height:
20080 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w=3/2*oh:h=3/5*ih
20081 </pre></td></tr></table>
20082
20083 </li><li>
20084 Increase the size, but make the size a multiple of the chroma
20085 subsample values:
20086 <table><tr><td>&nbsp;</td><td><pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
20087 </pre></td></tr></table>
20088
20089 </li><li>
20090 Increase the width to a maximum of 500 pixels, keep the same input
20091 aspect ratio:
20092 <table><tr><td>&nbsp;</td><td><pre class="example">scale=w='min(500\, iw*3/2):h=-1'
20093 </pre></td></tr></table>
20094 </li></ul>
20095
20096 <a name="separatefields"></a>
20097 <h2 class="section"><a href="ffmpeg-all.html#toc-separatefields">37.71 separatefields</a></h2>
20098
20099 <p>The <code>separatefields</code> takes a frame-based video input and splits
20100 each frame into its components fields, producing a new half height clip
20101 with twice the frame rate and twice the frame count.
20102 </p>
20103 <p>This filter use field-dominance information in frame to decide which
20104 of each pair of fields to place first in the output.
20105 If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
20106 </p>
20107 <a name="setdar_002c-setsar"></a>
20108 <h2 class="section"><a href="ffmpeg-all.html#toc-setdar_002c-setsar">37.72 setdar, setsar</a></h2>
20109
20110 <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
20111 output video.
20112 </p>
20113 <p>This is done by changing the specified Sample (aka Pixel) Aspect
20114 Ratio, according to the following equation:
20115 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
20116 </pre></td></tr></table>
20117
20118 <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
20119 dimensions of the video frame. Also the display aspect ratio set by
20120 this filter may be changed by later filters in the filterchain,
20121 e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
20122 applied.
20123 </p>
20124 <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
20125 the filter output video.
20126 </p>
20127 <p>Note that as a consequence of the application of this filter, the
20128 output display aspect ratio will change according to the equation
20129 above.
20130 </p>
20131 <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
20132 filter may be changed by later filters in the filterchain, e.g. if
20133 another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
20134 </p>
20135 <p>The filters accept the following options:
20136 </p>
20137 <dl compact="compact">
20138 <dt> &lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
20139 <dd><p>Set the aspect ratio used by the filter.
20140 </p>
20141 <p>The parameter can be a floating point number string, an expression, or
20142 a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
20143 <var>den</var> are the numerator and denominator of the aspect ratio. If
20144 the parameter is not specified, it is assumed the value &quot;0&quot;.
20145 In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
20146 should be escaped.
20147 </p>
20148 </dd>
20149 <dt> &lsquo;<samp>max</samp>&rsquo;</dt>
20150 <dd><p>Set the maximum integer value to use for expressing numerator and
20151 denominator when reducing the expressed aspect ratio to a rational.
20152 Default value is <code>100</code>.
20153 </p>
20154 </dd>
20155 </dl>
20156
20157 <p>The parameter <var>sar</var> is an expression containing
20158 the following constants:
20159 </p>
20160 <dl compact="compact">
20161 <dt> &lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
20162 <dd><p>the corresponding mathematical approximated values for e
20163 (euler number), pi (greek PI), phi (golden ratio)
20164 </p>
20165 </dd>
20166 <dt> &lsquo;<samp>w, h</samp>&rsquo;</dt>
20167 <dd><p>the input width and height
20168 </p>
20169 </dd>
20170 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
20171 <dd><p>same as <var>w</var> / <var>h</var>
20172 </p>
20173 </dd>
20174 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
20175 <dd><p>input sample aspect ratio
20176 </p>
20177 </dd>
20178 <dt> &lsquo;<samp>dar</samp>&rsquo;</dt>
20179 <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
20180 </p>
20181 </dd>
20182 <dt> &lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
20183 <dd><p>horizontal and vertical chroma subsample values. For example for the
20184 pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
20185 </p></dd>
20186 </dl>
20187
20188 <a name="Examples-45"></a>
20189 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-45">37.72.1 Examples</a></h3>
20190
20191 <ul>
20192 <li>
20193 To change the display aspect ratio to 16:9, specify one of the following:
20194 <table><tr><td>&nbsp;</td><td><pre class="example">setdar=dar=1.77777
20195 setdar=dar=16/9
20196 setdar=dar=1.77777
20197 </pre></td></tr></table>
20198
20199 </li><li>
20200 To change the sample aspect ratio to 10:11, specify:
20201 <table><tr><td>&nbsp;</td><td><pre class="example">setsar=sar=10/11
20202 </pre></td></tr></table>
20203
20204 </li><li>
20205 To set a display aspect ratio of 16:9, and specify a maximum integer value of
20206 1000 in the aspect ratio reduction, use the command:
20207 <table><tr><td>&nbsp;</td><td><pre class="example">setdar=ratio=16/9:max=1000
20208 </pre></td></tr></table>
20209
20210 </li></ul>
20211
20212 <p><a name="setfield"></a>
20213 </p><a name="setfield-1"></a>
20214 <h2 class="section"><a href="ffmpeg-all.html#toc-setfield-1">37.73 setfield</a></h2>
20215
20216 <p>Force field for the output video frame.
20217 </p>
20218 <p>The <code>setfield</code> filter marks the interlace type field for the
20219 output frames. It does not change the input frame, but only sets the
20220 corresponding property, which affects how the frame is treated by
20221 following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
20222 </p>
20223 <p>The filter accepts the following options:
20224 </p>
20225 <dl compact="compact">
20226 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
20227 <dd><p>Available values are:
20228 </p>
20229 <dl compact="compact">
20230 <dt> &lsquo;<samp>auto</samp>&rsquo;</dt>
20231 <dd><p>Keep the same field property.
20232 </p>
20233 </dd>
20234 <dt> &lsquo;<samp>bff</samp>&rsquo;</dt>
20235 <dd><p>Mark the frame as bottom-field-first.
20236 </p>
20237 </dd>
20238 <dt> &lsquo;<samp>tff</samp>&rsquo;</dt>
20239 <dd><p>Mark the frame as top-field-first.
20240 </p>
20241 </dd>
20242 <dt> &lsquo;<samp>prog</samp>&rsquo;</dt>
20243 <dd><p>Mark the frame as progressive.
20244 </p></dd>
20245 </dl>
20246 </dd>
20247 </dl>
20248
20249 <a name="showinfo"></a>
20250 <h2 class="section"><a href="ffmpeg-all.html#toc-showinfo">37.74 showinfo</a></h2>
20251
20252 <p>Show a line containing various information for each input video frame.
20253 The input video is not modified.
20254 </p>
20255 <p>The shown line contains a sequence of key/value pairs of the form
20256 <var>key</var>:<var>value</var>.
20257 </p>
20258 <p>A description of each shown parameter follows:
20259 </p>
20260 <dl compact="compact">
20261 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
20262 <dd><p>sequential number of the input frame, starting from 0
20263 </p>
20264 </dd>
20265 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
20266 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
20267 time base units. The time base unit depends on the filter input pad.
20268 </p>
20269 </dd>
20270 <dt> &lsquo;<samp>pts_time</samp>&rsquo;</dt>
20271 <dd><p>Presentation TimeStamp of the input frame, expressed as a number of
20272 seconds
20273 </p>
20274 </dd>
20275 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
20276 <dd><p>position of the frame in the input stream, -1 if this information in
20277 unavailable and/or meaningless (for example in case of synthetic video)
20278 </p>
20279 </dd>
20280 <dt> &lsquo;<samp>fmt</samp>&rsquo;</dt>
20281 <dd><p>pixel format name
20282 </p>
20283 </dd>
20284 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
20285 <dd><p>sample aspect ratio of the input frame, expressed in the form
20286 <var>num</var>/<var>den</var>
20287 </p>
20288 </dd>
20289 <dt> &lsquo;<samp>s</samp>&rsquo;</dt>
20290 <dd><p>size of the input frame. For the syntax of this option, check the &quot;Video size&quot;
20291 section in the ffmpeg-utils manual.
20292 </p>
20293 </dd>
20294 <dt> &lsquo;<samp>i</samp>&rsquo;</dt>
20295 <dd><p>interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
20296 for bottom field first)
20297 </p>
20298 </dd>
20299 <dt> &lsquo;<samp>iskey</samp>&rsquo;</dt>
20300 <dd><p>1 if the frame is a key frame, 0 otherwise
20301 </p>
20302 </dd>
20303 <dt> &lsquo;<samp>type</samp>&rsquo;</dt>
20304 <dd><p>picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
20305 P-frame, &quot;B&quot; for a B-frame, &quot;?&quot; for unknown type).
20306 Check also the documentation of the <code>AVPictureType</code> enum and of
20307 the <code>av_get_picture_type_char</code> function defined in
20308 &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
20309 </p>
20310 </dd>
20311 <dt> &lsquo;<samp>checksum</samp>&rsquo;</dt>
20312 <dd><p>Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame
20313 </p>
20314 </dd>
20315 <dt> &lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
20316 <dd><p>Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
20317 expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;
20318 </p></dd>
20319 </dl>
20320
20321 <p><a name="smartblur"></a>
20322 </p><a name="smartblur-1"></a>
20323 <h2 class="section"><a href="ffmpeg-all.html#toc-smartblur-1">37.75 smartblur</a></h2>
20324
20325 <p>Blur the input video without impacting the outlines.
20326 </p>
20327 <p>The filter accepts the following options:
20328 </p>
20329 <dl compact="compact">
20330 <dt> &lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
20331 <dd><p>Set the luma radius. The option value must be a float number in
20332 the range [0.1,5.0] that specifies the variance of the gaussian filter
20333 used to blur the image (slower if larger). Default value is 1.0.
20334 </p>
20335 </dd>
20336 <dt> &lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
20337 <dd><p>Set the luma strength. The option value must be a float number
20338 in the range [-1.0,1.0] that configures the blurring. A value included
20339 in [0.0,1.0] will blur the image whereas a value included in
20340 [-1.0,0.0] will sharpen the image. Default value is 1.0.
20341 </p>
20342 </dd>
20343 <dt> &lsquo;<samp>luma_threshold, lt</samp>&rsquo;</dt>
20344 <dd><p>Set the luma threshold used as a coefficient to determine
20345 whether a pixel should be blurred or not. The option value must be an
20346 integer in the range [-30,30]. A value of 0 will filter all the image,
20347 a value included in [0,30] will filter flat areas and a value included
20348 in [-30,0] will filter edges. Default value is 0.
20349 </p>
20350 </dd>
20351 <dt> &lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
20352 <dd><p>Set the chroma radius. The option value must be a float number in
20353 the range [0.1,5.0] that specifies the variance of the gaussian filter
20354 used to blur the image (slower if larger). Default value is 1.0.
20355 </p>
20356 </dd>
20357 <dt> &lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
20358 <dd><p>Set the chroma strength. The option value must be a float number
20359 in the range [-1.0,1.0] that configures the blurring. A value included
20360 in [0.0,1.0] will blur the image whereas a value included in
20361 [-1.0,0.0] will sharpen the image. Default value is 1.0.
20362 </p>
20363 </dd>
20364 <dt> &lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</dt>
20365 <dd><p>Set the chroma threshold used as a coefficient to determine
20366 whether a pixel should be blurred or not. The option value must be an
20367 integer in the range [-30,30]. A value of 0 will filter all the image,
20368 a value included in [0,30] will filter flat areas and a value included
20369 in [-30,0] will filter edges. Default value is 0.
20370 </p></dd>
20371 </dl>
20372
20373 <p>If a chroma option is not explicitly set, the corresponding luma value
20374 is set.
20375 </p>
20376 <a name="stereo3d"></a>
20377 <h2 class="section"><a href="ffmpeg-all.html#toc-stereo3d">37.76 stereo3d</a></h2>
20378
20379 <p>Convert between different stereoscopic image formats.
20380 </p>
20381 <p>The filters accept the following options:
20382 </p>
20383 <dl compact="compact">
20384 <dt> &lsquo;<samp>in</samp>&rsquo;</dt>
20385 <dd><p>Set stereoscopic image format of input.
20386 </p>
20387 <p>Available values for input image formats are:
20388 </p><dl compact="compact">
20389 <dt> &lsquo;<samp>sbsl</samp>&rsquo;</dt>
20390 <dd><p>side by side parallel (left eye left, right eye right)
20391 </p>
20392 </dd>
20393 <dt> &lsquo;<samp>sbsr</samp>&rsquo;</dt>
20394 <dd><p>side by side crosseye (right eye left, left eye right)
20395 </p>
20396 </dd>
20397 <dt> &lsquo;<samp>sbs2l</samp>&rsquo;</dt>
20398 <dd><p>side by side parallel with half width resolution
20399 (left eye left, right eye right)
20400 </p>
20401 </dd>
20402 <dt> &lsquo;<samp>sbs2r</samp>&rsquo;</dt>
20403 <dd><p>side by side crosseye with half width resolution
20404 (right eye left, left eye right)
20405 </p>
20406 </dd>
20407 <dt> &lsquo;<samp>abl</samp>&rsquo;</dt>
20408 <dd><p>above-below (left eye above, right eye below)
20409 </p>
20410 </dd>
20411 <dt> &lsquo;<samp>abr</samp>&rsquo;</dt>
20412 <dd><p>above-below (right eye above, left eye below)
20413 </p>
20414 </dd>
20415 <dt> &lsquo;<samp>ab2l</samp>&rsquo;</dt>
20416 <dd><p>above-below with half height resolution
20417 (left eye above, right eye below)
20418 </p>
20419 </dd>
20420 <dt> &lsquo;<samp>ab2r</samp>&rsquo;</dt>
20421 <dd><p>above-below with half height resolution
20422 (right eye above, left eye below)
20423 </p>
20424 </dd>
20425 <dt> &lsquo;<samp>al</samp>&rsquo;</dt>
20426 <dd><p>alternating frames (left eye first, right eye second)
20427 </p>
20428 </dd>
20429 <dt> &lsquo;<samp>ar</samp>&rsquo;</dt>
20430 <dd><p>alternating frames (right eye first, left eye second)
20431 </p>
20432 <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
20433 </p></dd>
20434 </dl>
20435
20436 </dd>
20437 <dt> &lsquo;<samp>out</samp>&rsquo;</dt>
20438 <dd><p>Set stereoscopic image format of output.
20439 </p>
20440 <p>Available values for output image formats are all the input formats as well as:
20441 </p><dl compact="compact">
20442 <dt> &lsquo;<samp>arbg</samp>&rsquo;</dt>
20443 <dd><p>anaglyph red/blue gray
20444 (red filter on left eye, blue filter on right eye)
20445 </p>
20446 </dd>
20447 <dt> &lsquo;<samp>argg</samp>&rsquo;</dt>
20448 <dd><p>anaglyph red/green gray
20449 (red filter on left eye, green filter on right eye)
20450 </p>
20451 </dd>
20452 <dt> &lsquo;<samp>arcg</samp>&rsquo;</dt>
20453 <dd><p>anaglyph red/cyan gray
20454 (red filter on left eye, cyan filter on right eye)
20455 </p>
20456 </dd>
20457 <dt> &lsquo;<samp>arch</samp>&rsquo;</dt>
20458 <dd><p>anaglyph red/cyan half colored
20459 (red filter on left eye, cyan filter on right eye)
20460 </p>
20461 </dd>
20462 <dt> &lsquo;<samp>arcc</samp>&rsquo;</dt>
20463 <dd><p>anaglyph red/cyan color
20464 (red filter on left eye, cyan filter on right eye)
20465 </p>
20466 </dd>
20467 <dt> &lsquo;<samp>arcd</samp>&rsquo;</dt>
20468 <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
20469 (red filter on left eye, cyan filter on right eye)
20470 </p>
20471 </dd>
20472 <dt> &lsquo;<samp>agmg</samp>&rsquo;</dt>
20473 <dd><p>anaglyph green/magenta gray
20474 (green filter on left eye, magenta filter on right eye)
20475 </p>
20476 </dd>
20477 <dt> &lsquo;<samp>agmh</samp>&rsquo;</dt>
20478 <dd><p>anaglyph green/magenta half colored
20479 (green filter on left eye, magenta filter on right eye)
20480 </p>
20481 </dd>
20482 <dt> &lsquo;<samp>agmc</samp>&rsquo;</dt>
20483 <dd><p>anaglyph green/magenta colored
20484 (green filter on left eye, magenta filter on right eye)
20485 </p>
20486 </dd>
20487 <dt> &lsquo;<samp>agmd</samp>&rsquo;</dt>
20488 <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
20489 (green filter on left eye, magenta filter on right eye)
20490 </p>
20491 </dd>
20492 <dt> &lsquo;<samp>aybg</samp>&rsquo;</dt>
20493 <dd><p>anaglyph yellow/blue gray
20494 (yellow filter on left eye, blue filter on right eye)
20495 </p>
20496 </dd>
20497 <dt> &lsquo;<samp>aybh</samp>&rsquo;</dt>
20498 <dd><p>anaglyph yellow/blue half colored
20499 (yellow filter on left eye, blue filter on right eye)
20500 </p>
20501 </dd>
20502 <dt> &lsquo;<samp>aybc</samp>&rsquo;</dt>
20503 <dd><p>anaglyph yellow/blue colored
20504 (yellow filter on left eye, blue filter on right eye)
20505 </p>
20506 </dd>
20507 <dt> &lsquo;<samp>aybd</samp>&rsquo;</dt>
20508 <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
20509 (yellow filter on left eye, blue filter on right eye)
20510 </p>
20511 </dd>
20512 <dt> &lsquo;<samp>irl</samp>&rsquo;</dt>
20513 <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
20514 </p>
20515 </dd>
20516 <dt> &lsquo;<samp>irr</samp>&rsquo;</dt>
20517 <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
20518 </p>
20519 </dd>
20520 <dt> &lsquo;<samp>ml</samp>&rsquo;</dt>
20521 <dd><p>mono output (left eye only)
20522 </p>
20523 </dd>
20524 <dt> &lsquo;<samp>mr</samp>&rsquo;</dt>
20525 <dd><p>mono output (right eye only)
20526 </p></dd>
20527 </dl>
20528
20529 <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
20530 </p></dd>
20531 </dl>
20532
20533 <a name="Examples"></a>
20534 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples">37.76.1 Examples</a></h3>
20535
20536 <ul>
20537 <li>
20538 Convert input video from side by side parallel to anaglyph yellow/blue dubois:
20539 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=sbsl:aybd
20540 </pre></td></tr></table>
20541
20542 </li><li>
20543 Convert input video from above bellow (left eye above, right eye below) to side by side crosseye.
20544 <table><tr><td>&nbsp;</td><td><pre class="example">stereo3d=abl:sbsr
20545 </pre></td></tr></table>
20546 </li></ul>
20547
20548 <a name="spp"></a>
20549 <h2 class="section"><a href="ffmpeg-all.html#toc-spp">37.77 spp</a></h2>
20550
20551 <p>Apply a simple postprocessing filter that compresses and decompresses the image
20552 at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
20553 and average the results.
20554 </p>
20555 <p>The filter accepts the following options:
20556 </p>
20557 <dl compact="compact">
20558 <dt> &lsquo;<samp>quality</samp>&rsquo;</dt>
20559 <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
20560 an integer in the range 0-6. If set to <code>0</code>, the filter will have no
20561 effect. A value of <code>6</code> means the higher quality. For each increment of
20562 that value the speed drops by a factor of approximately 2.  Default value is
20563 <code>3</code>.
20564 </p>
20565 </dd>
20566 <dt> &lsquo;<samp>qp</samp>&rsquo;</dt>
20567 <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
20568 from the video stream (if available).
20569 </p>
20570 </dd>
20571 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
20572 <dd><p>Set thresholding mode. Available modes are:
20573 </p>
20574 <dl compact="compact">
20575 <dt> &lsquo;<samp>hard</samp>&rsquo;</dt>
20576 <dd><p>Set hard thresholding (default).
20577 </p></dd>
20578 <dt> &lsquo;<samp>soft</samp>&rsquo;</dt>
20579 <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
20580 </p></dd>
20581 </dl>
20582
20583 </dd>
20584 <dt> &lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
20585 <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
20586 option may cause flicker since the B-Frames have often larger QP. Default is
20587 <code>0</code> (not enabled).
20588 </p></dd>
20589 </dl>
20590
20591 <p><a name="subtitles"></a>
20592 </p><a name="subtitles-1"></a>
20593 <h2 class="section"><a href="ffmpeg-all.html#toc-subtitles-1">37.78 subtitles</a></h2>
20594
20595 <p>Draw subtitles on top of input video using the libass library.
20596 </p>
20597 <p>To enable compilation of this filter you need to configure FFmpeg with
20598 <code>--enable-libass</code>. This filter also requires a build with libavcodec and
20599 libavformat to convert the passed subtitles file to ASS (Advanced Substation
20600 Alpha) subtitles format.
20601 </p>
20602 <p>The filter accepts the following options:
20603 </p>
20604 <dl compact="compact">
20605 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
20606 <dd><p>Set the filename of the subtitle file to read. It must be specified.
20607 </p>
20608 </dd>
20609 <dt> &lsquo;<samp>original_size</samp>&rsquo;</dt>
20610 <dd><p>Specify the size of the original video, the video for which the ASS file
20611 was composed. For the syntax of this option, check the &quot;Video size&quot; section in
20612 the ffmpeg-utils manual. Due to a misdesign in ASS aspect ratio arithmetic,
20613 this is necessary to correctly scale the fonts if the aspect ratio has been
20614 changed.
20615 </p>
20616 </dd>
20617 <dt> &lsquo;<samp>charenc</samp>&rsquo;</dt>
20618 <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
20619 useful if not UTF-8.
20620 </p></dd>
20621 </dl>
20622
20623 <p>If the first key is not specified, it is assumed that the first value
20624 specifies the &lsquo;<samp>filename</samp>&rsquo;.
20625 </p>
20626 <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
20627 video, use the command:
20628 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=sub.srt
20629 </pre></td></tr></table>
20630
20631 <p>which is equivalent to:
20632 </p><table><tr><td>&nbsp;</td><td><pre class="example">subtitles=filename=sub.srt
20633 </pre></td></tr></table>
20634
20635 <a name="super2xsai"></a>
20636 <h2 class="section"><a href="ffmpeg-all.html#toc-super2xsai">37.79 super2xsai</a></h2>
20637
20638 <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
20639 Interpolate) pixel art scaling algorithm.
20640 </p>
20641 <p>Useful for enlarging pixel art images without reducing sharpness.
20642 </p>
20643 <a name="swapuv"></a>
20644 <h2 class="section"><a href="ffmpeg-all.html#toc-swapuv">37.80 swapuv</a></h2>
20645 <p>Swap U &amp; V plane.
20646 </p>
20647 <a name="telecine"></a>
20648 <h2 class="section"><a href="ffmpeg-all.html#toc-telecine">37.81 telecine</a></h2>
20649
20650 <p>Apply telecine process to the video.
20651 </p>
20652 <p>This filter accepts the following options:
20653 </p>
20654 <dl compact="compact">
20655 <dt> &lsquo;<samp>first_field</samp>&rsquo;</dt>
20656 <dd><dl compact="compact">
20657 <dt> &lsquo;<samp>top, t</samp>&rsquo;</dt>
20658 <dd><p>top field first
20659 </p></dd>
20660 <dt> &lsquo;<samp>bottom, b</samp>&rsquo;</dt>
20661 <dd><p>bottom field first
20662 The default value is <code>top</code>.
20663 </p></dd>
20664 </dl>
20665
20666 </dd>
20667 <dt> &lsquo;<samp>pattern</samp>&rsquo;</dt>
20668 <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
20669 The default value is <code>23</code>.
20670 </p></dd>
20671 </dl>
20672
20673 <table><tr><td>&nbsp;</td><td><pre class="example">Some typical patterns:
20674
20675 NTSC output (30i):
20676 27.5p: 32222
20677 24p: 23 (classic)
20678 24p: 2332 (preferred)
20679 20p: 33
20680 18p: 334
20681 16p: 3444
20682
20683 PAL output (25i):
20684 27.5p: 12222
20685 24p: 222222222223 (&quot;Euro pulldown&quot;)
20686 16.67p: 33
20687 16p: 33333334
20688 </pre></td></tr></table>
20689
20690 <a name="thumbnail"></a>
20691 <h2 class="section"><a href="ffmpeg-all.html#toc-thumbnail">37.82 thumbnail</a></h2>
20692 <p>Select the most representative frame in a given sequence of consecutive frames.
20693 </p>
20694 <p>The filter accepts the following options:
20695 </p>
20696 <dl compact="compact">
20697 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
20698 <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
20699 will pick one of them, and then handle the next batch of <var>n</var> frames until
20700 the end. Default is <code>100</code>.
20701 </p></dd>
20702 </dl>
20703
20704 <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
20705 value will result in a higher memory usage, so a high value is not recommended.
20706 </p>
20707 <a name="Examples-17"></a>
20708 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-17">37.82.1 Examples</a></h3>
20709
20710 <ul>
20711 <li>
20712 Extract one picture each 50 frames:
20713 <table><tr><td>&nbsp;</td><td><pre class="example">thumbnail=50
20714 </pre></td></tr></table>
20715
20716 </li><li>
20717 Complete example of a thumbnail creation with <code>ffmpeg</code>:
20718 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
20719 </pre></td></tr></table>
20720 </li></ul>
20721
20722 <a name="tile"></a>
20723 <h2 class="section"><a href="ffmpeg-all.html#toc-tile">37.83 tile</a></h2>
20724
20725 <p>Tile several successive frames together.
20726 </p>
20727 <p>The filter accepts the following options:
20728 </p>
20729 <dl compact="compact">
20730 <dt> &lsquo;<samp>layout</samp>&rsquo;</dt>
20731 <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
20732 this option, check the &quot;Video size&quot; section in the ffmpeg-utils manual.
20733 </p>
20734 </dd>
20735 <dt> &lsquo;<samp>nb_frames</samp>&rsquo;</dt>
20736 <dd><p>Set the maximum number of frames to render in the given area. It must be less
20737 than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
20738 the area will be used.
20739 </p>
20740 </dd>
20741 <dt> &lsquo;<samp>margin</samp>&rsquo;</dt>
20742 <dd><p>Set the outer border margin in pixels.
20743 </p>
20744 </dd>
20745 <dt> &lsquo;<samp>padding</samp>&rsquo;</dt>
20746 <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
20747 more advanced padding options (such as having different values for the edges),
20748 refer to the pad video filter.
20749 </p>
20750 </dd>
20751 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
20752 <dd><p>Specify the color of the unused areaFor the syntax of this option, check the
20753 &quot;Color&quot; section in the ffmpeg-utils manual. The default value of <var>color</var>
20754 is &quot;black&quot;.
20755 </p></dd>
20756 </dl>
20757
20758 <a name="Examples-33"></a>
20759 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-33">37.83.1 Examples</a></h3>
20760
20761 <ul>
20762 <li>
20763 Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
20764 <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
20765 </pre></td></tr></table>
20766 <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
20767 duplicating each output frame to accomodate the originally detected frame
20768 rate.
20769 </p>
20770 </li><li>
20771 Display <code>5</code> pictures in an area of <code>3x2</code> frames,
20772 with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
20773 mixed flat and named options:
20774 <table><tr><td>&nbsp;</td><td><pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
20775 </pre></td></tr></table>
20776 </li></ul>
20777
20778 <a name="tinterlace"></a>
20779 <h2 class="section"><a href="ffmpeg-all.html#toc-tinterlace">37.84 tinterlace</a></h2>
20780
20781 <p>Perform various types of temporal field interlacing.
20782 </p>
20783 <p>Frames are counted starting from 1, so the first input frame is
20784 considered odd.
20785 </p>
20786 <p>The filter accepts the following options:
20787 </p>
20788 <dl compact="compact">
20789 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
20790 <dd><p>Specify the mode of the interlacing. This option can also be specified
20791 as a value alone. See below for a list of values for this option.
20792 </p>
20793 <p>Available values are:
20794 </p>
20795 <dl compact="compact">
20796 <dt> &lsquo;<samp>merge, 0</samp>&rsquo;</dt>
20797 <dd><p>Move odd frames into the upper field, even into the lower field,
20798 generating a double height frame at half frame rate.
20799 </p>
20800 </dd>
20801 <dt> &lsquo;<samp>drop_odd, 1</samp>&rsquo;</dt>
20802 <dd><p>Only output even frames, odd frames are dropped, generating a frame with
20803 unchanged height at half frame rate.
20804 </p>
20805 </dd>
20806 <dt> &lsquo;<samp>drop_even, 2</samp>&rsquo;</dt>
20807 <dd><p>Only output odd frames, even frames are dropped, generating a frame with
20808 unchanged height at half frame rate.
20809 </p>
20810 </dd>
20811 <dt> &lsquo;<samp>pad, 3</samp>&rsquo;</dt>
20812 <dd><p>Expand each frame to full height, but pad alternate lines with black,
20813 generating a frame with double height at the same input frame rate.
20814 </p>
20815 </dd>
20816 <dt> &lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
20817 <dd><p>Interleave the upper field from odd frames with the lower field from
20818 even frames, generating a frame with unchanged height at half frame rate.
20819 </p>
20820 </dd>
20821 <dt> &lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
20822 <dd><p>Interleave the lower field from odd frames with the upper field from
20823 even frames, generating a frame with unchanged height at half frame rate.
20824 </p>
20825 </dd>
20826 <dt> &lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
20827 <dd><p>Double frame rate with unchanged height. Frames are inserted each
20828 containing the second temporal field from the previous input frame and
20829 the first temporal field from the next input frame. This mode relies on
20830 the top_field_first flag. Useful for interlaced video displays with no
20831 field synchronisation.
20832 </p></dd>
20833 </dl>
20834
20835 <p>Numeric values are deprecated but are accepted for backward
20836 compatibility reasons.
20837 </p>
20838 <p>Default mode is <code>merge</code>.
20839 </p>
20840 </dd>
20841 <dt> &lsquo;<samp>flags</samp>&rsquo;</dt>
20842 <dd><p>Specify flags influencing the filter process.
20843 </p>
20844 <p>Available value for <var>flags</var> is:
20845 </p>
20846 <dl compact="compact">
20847 <dt> &lsquo;<samp>low_pass_filter, vlfp</samp>&rsquo;</dt>
20848 <dd><p>Enable vertical low-pass filtering in the filter.
20849 Vertical low-pass filtering is required when creating an interlaced
20850 destination from a progressive source which contains high-frequency
20851 vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
20852 patterning.
20853 </p>
20854 <p>Vertical low-pass filtering can only be enabled for &lsquo;<samp>mode</samp>&rsquo;
20855 <var>interleave_top</var> and <var>interleave_bottom</var>.
20856 </p>
20857 </dd>
20858 </dl>
20859 </dd>
20860 </dl>
20861
20862 <a name="transpose"></a>
20863 <h2 class="section"><a href="ffmpeg-all.html#toc-transpose">37.85 transpose</a></h2>
20864
20865 <p>Transpose rows with columns in the input video and optionally flip it.
20866 </p>
20867 <p>This filter accepts the following options:
20868 </p>
20869 <dl compact="compact">
20870 <dt> &lsquo;<samp>dir</samp>&rsquo;</dt>
20871 <dd><p>Specify the transposition direction.
20872 </p>
20873 <p>Can assume the following values:
20874 </p><dl compact="compact">
20875 <dt> &lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
20876 <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
20877 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     L.l
20878 . . -&gt;  . .
20879 l.r     R.r
20880 </pre></td></tr></table>
20881
20882 </dd>
20883 <dt> &lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
20884 <dd><p>Rotate by 90 degrees clockwise, that is:
20885 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     l.L
20886 . . -&gt;  . .
20887 l.r     r.R
20888 </pre></td></tr></table>
20889
20890 </dd>
20891 <dt> &lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
20892 <dd><p>Rotate by 90 degrees counterclockwise, that is:
20893 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     R.r
20894 . . -&gt;  . .
20895 l.r     L.l
20896 </pre></td></tr></table>
20897
20898 </dd>
20899 <dt> &lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
20900 <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
20901 </p><table><tr><td>&nbsp;</td><td><pre class="example">L.R     r.R
20902 . . -&gt;  . .
20903 l.r     l.L
20904 </pre></td></tr></table>
20905 </dd>
20906 </dl>
20907
20908 <p>For values between 4-7, the transposition is only done if the input
20909 video geometry is portrait and not landscape. These values are
20910 deprecated, the <code>passthrough</code> option should be used instead.
20911 </p>
20912 <p>Numerical values are deprecated, and should be dropped in favor of
20913 symbolic constants.
20914 </p>
20915 </dd>
20916 <dt> &lsquo;<samp>passthrough</samp>&rsquo;</dt>
20917 <dd><p>Do not apply the transposition if the input geometry matches the one
20918 specified by the specified value. It accepts the following values:
20919 </p><dl compact="compact">
20920 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
20921 <dd><p>Always apply transposition.
20922 </p></dd>
20923 <dt> &lsquo;<samp>portrait</samp>&rsquo;</dt>
20924 <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
20925 </p></dd>
20926 <dt> &lsquo;<samp>landscape</samp>&rsquo;</dt>
20927 <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
20928 </p></dd>
20929 </dl>
20930
20931 <p>Default value is <code>none</code>.
20932 </p></dd>
20933 </dl>
20934
20935 <p>For example to rotate by 90 degrees clockwise and preserve portrait
20936 layout:
20937 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=dir=1:passthrough=portrait
20938 </pre></td></tr></table>
20939
20940 <p>The command above can also be specified as:
20941 </p><table><tr><td>&nbsp;</td><td><pre class="example">transpose=1:portrait
20942 </pre></td></tr></table>
20943
20944 <a name="trim"></a>
20945 <h2 class="section"><a href="ffmpeg-all.html#toc-trim">37.86 trim</a></h2>
20946 <p>Trim the input so that the output contains one continuous subpart of the input.
20947 </p>
20948 <p>This filter accepts the following options:
20949 </p><dl compact="compact">
20950 <dt> &lsquo;<samp>start</samp>&rsquo;</dt>
20951 <dd><p>Specify time of the start of the kept section, i.e. the frame with the
20952 timestamp <var>start</var> will be the first frame in the output.
20953 </p>
20954 </dd>
20955 <dt> &lsquo;<samp>end</samp>&rsquo;</dt>
20956 <dd><p>Specify time of the first frame that will be dropped, i.e. the frame
20957 immediately preceding the one with the timestamp <var>end</var> will be the last
20958 frame in the output.
20959 </p>
20960 </dd>
20961 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
20962 <dd><p>Same as <var>start</var>, except this option sets the start timestamp in timebase
20963 units instead of seconds.
20964 </p>
20965 </dd>
20966 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
20967 <dd><p>Same as <var>end</var>, except this option sets the end timestamp in timebase units
20968 instead of seconds.
20969 </p>
20970 </dd>
20971 <dt> &lsquo;<samp>duration</samp>&rsquo;</dt>
20972 <dd><p>Specify maximum duration of the output.
20973 </p>
20974 </dd>
20975 <dt> &lsquo;<samp>start_frame</samp>&rsquo;</dt>
20976 <dd><p>Number of the first frame that should be passed to output.
20977 </p>
20978 </dd>
20979 <dt> &lsquo;<samp>end_frame</samp>&rsquo;</dt>
20980 <dd><p>Number of the first frame that should be dropped.
20981 </p></dd>
20982 </dl>
20983
20984 <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, &lsquo;<samp>duration</samp>&rsquo; are expressed as time
20985 duration specifications, check the &quot;Time duration&quot; section in the
20986 ffmpeg-utils manual.
20987 </p>
20988 <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
20989 option look at the frame timestamp, while the _frame variants simply count the
20990 frames that pass through the filter. Also note that this filter does not modify
20991 the timestamps. If you wish that the output timestamps start at zero, insert a
20992 setpts filter after the trim filter.
20993 </p>
20994 <p>If multiple start or end options are set, this filter tries to be greedy and
20995 keep all the frames that match at least one of the specified constraints. To keep
20996 only the part that matches all the constraints at once, chain multiple trim
20997 filters.
20998 </p>
20999 <p>The defaults are such that all the input is kept. So it is possible to set e.g.
21000 just the end values to keep everything before the specified time.
21001 </p>
21002 <p>Examples:
21003 </p><ul>
21004 <li>
21005 drop everything except the second minute of input
21006 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=60:120
21007 </pre></td></tr></table>
21008
21009 </li><li>
21010 keep only the first second
21011 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -vf trim=duration=1
21012 </pre></td></tr></table>
21013
21014 </li></ul>
21015
21016
21017 <a name="unsharp"></a>
21018 <h2 class="section"><a href="ffmpeg-all.html#toc-unsharp">37.87 unsharp</a></h2>
21019
21020 <p>Sharpen or blur the input video.
21021 </p>
21022 <p>It accepts the following parameters:
21023 </p>
21024 <dl compact="compact">
21025 <dt> &lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
21026 <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
21027 3 and 63, default value is 5.
21028 </p>
21029 </dd>
21030 <dt> &lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
21031 <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
21032 and 63, default value is 5.
21033 </p>
21034 </dd>
21035 <dt> &lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
21036 <dd><p>Set the luma effect strength. It can be a float number, reasonable
21037 values lay between -1.5 and 1.5.
21038 </p>
21039 <p>Negative values will blur the input video, while positive values will
21040 sharpen it, a value of zero will disable the effect.
21041 </p>
21042 <p>Default value is 1.0.
21043 </p>
21044 </dd>
21045 <dt> &lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
21046 <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
21047 between 3 and 63, default value is 5.
21048 </p>
21049 </dd>
21050 <dt> &lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
21051 <dd><p>Set the chroma matrix vertical size. It must be an odd integer
21052 between 3 and 63, default value is 5.
21053 </p>
21054 </dd>
21055 <dt> &lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
21056 <dd><p>Set the chroma effect strength. It can be a float number, reasonable
21057 values lay between -1.5 and 1.5.
21058 </p>
21059 <p>Negative values will blur the input video, while positive values will
21060 sharpen it, a value of zero will disable the effect.
21061 </p>
21062 <p>Default value is 0.0.
21063 </p>
21064 </dd>
21065 <dt> &lsquo;<samp>opencl</samp>&rsquo;</dt>
21066 <dd><p>If set to 1, specify using OpenCL capabilities, only available if
21067 FFmpeg was configured with <code>--enable-opencl</code>. Default value is 0.
21068 </p>
21069 </dd>
21070 </dl>
21071
21072 <p>All parameters are optional and default to the equivalent of the
21073 string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
21074 </p>
21075 <a name="Examples-63"></a>
21076 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-63">37.87.1 Examples</a></h3>
21077
21078 <ul>
21079 <li>
21080 Apply strong luma sharpen effect:
21081 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
21082 </pre></td></tr></table>
21083
21084 </li><li>
21085 Apply strong blur of both luma and chroma parameters:
21086 <table><tr><td>&nbsp;</td><td><pre class="example">unsharp=7:7:-2:7:7:-2
21087 </pre></td></tr></table>
21088 </li></ul>
21089
21090 <p><a name="vidstabdetect"></a>
21091 </p><a name="vidstabdetect-1"></a>
21092 <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabdetect-1">37.88 vidstabdetect</a></h2>
21093
21094 <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
21095 <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
21096 </p>
21097 <p>This filter generates a file with relative translation and rotation
21098 transform information about subsequent frames, which is then used by
21099 the <a href="#vidstabtransform">vidstabtransform</a> filter.
21100 </p>
21101 <p>To enable compilation of this filter you need to configure FFmpeg with
21102 <code>--enable-libvidstab</code>.
21103 </p>
21104 <p>This filter accepts the following options:
21105 </p>
21106 <dl compact="compact">
21107 <dt> &lsquo;<samp>result</samp>&rsquo;</dt>
21108 <dd><p>Set the path to the file used to write the transforms information.
21109 Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
21110 </p>
21111 </dd>
21112 <dt> &lsquo;<samp>shakiness</samp>&rsquo;</dt>
21113 <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
21114 integer in the range 1-10, a value of 1 means little shakiness, a
21115 value of 10 means strong shakiness. Default value is 5.
21116 </p>
21117 </dd>
21118 <dt> &lsquo;<samp>accuracy</samp>&rsquo;</dt>
21119 <dd><p>Set the accuracy of the detection process. It must be a value in the
21120 range 1-15. A value of 1 means low accuracy, a value of 15 means high
21121 accuracy. Default value is 9.
21122 </p>
21123 </dd>
21124 <dt> &lsquo;<samp>stepsize</samp>&rsquo;</dt>
21125 <dd><p>Set stepsize of the search process. The region around minimum is
21126 scanned with 1 pixel resolution. Default value is 6.
21127 </p>
21128 </dd>
21129 <dt> &lsquo;<samp>mincontrast</samp>&rsquo;</dt>
21130 <dd><p>Set minimum contrast. Below this value a local measurement field is
21131 discarded. Must be a floating point value in the range 0-1. Default
21132 value is 0.3.
21133 </p>
21134 </dd>
21135 <dt> &lsquo;<samp>tripod</samp>&rsquo;</dt>
21136 <dd><p>Set reference frame number for tripod mode.
21137 </p>
21138 <p>If enabled, the motion of the frames is compared to a reference frame
21139 in the filtered stream, identified by the specified number. The idea
21140 is to compensate all movements in a more-or-less static scene and keep
21141 the camera view absolutely still.
21142 </p>
21143 <p>If set to 0, it is disabled. The frames are counted starting from 1.
21144 </p>
21145 </dd>
21146 <dt> &lsquo;<samp>show</samp>&rsquo;</dt>
21147 <dd><p>Show fields and transforms in the resulting frames. It accepts an
21148 integer in the range 0-2. Default value is 0, which disables any
21149 visualization.
21150 </p></dd>
21151 </dl>
21152
21153 <a name="Examples-58"></a>
21154 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-58">37.88.1 Examples</a></h3>
21155
21156 <ul>
21157 <li>
21158 Use default values:
21159 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect
21160 </pre></td></tr></table>
21161
21162 </li><li>
21163 Analyze strongly shaky movie and put the results in file
21164 &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
21165 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
21166 </pre></td></tr></table>
21167
21168 </li><li>
21169 Visualize the result of internal transformations in the resulting
21170 video:
21171 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabdetect=show=1
21172 </pre></td></tr></table>
21173
21174 </li><li>
21175 Analyze a video with medium shakiness using <code>ffmpeg</code>:
21176 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
21177 </pre></td></tr></table>
21178 </li></ul>
21179
21180 <p><a name="vidstabtransform"></a>
21181 </p><a name="vidstabtransform-1"></a>
21182 <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabtransform-1">37.89 vidstabtransform</a></h2>
21183
21184 <p>Video stabilization/deshaking: pass 2 of 2,
21185 see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
21186 </p>
21187 <p>Read a file with transform information for each frame and
21188 apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
21189 filter this can be used to deshake videos. See also
21190 <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
21191 the unsharp filter, see below.
21192 </p>
21193 <p>To enable compilation of this filter you need to configure FFmpeg with
21194 <code>--enable-libvidstab</code>.
21195 </p>
21196 <p>This filter accepts the following options:
21197 </p>
21198 <dl compact="compact">
21199 <dt> &lsquo;<samp>input</samp>&rsquo;</dt>
21200 <dd><p>path to the file used to read the transforms (default: &lsquo;<tt>transforms.trf</tt>&rsquo;)
21201 </p>
21202 </dd>
21203 <dt> &lsquo;<samp>smoothing</samp>&rsquo;</dt>
21204 <dd><p>number of frames (value*2 + 1) used for lowpass filtering the camera movements
21205 (default: 10). For example a number of 10 means that 21 frames are used
21206 (10 in the past and 10 in the future) to smoothen the motion in the
21207 video. A larger values leads to a smoother video, but limits the
21208 acceleration of the camera (pan/tilt movements).
21209 </p>
21210 </dd>
21211 <dt> &lsquo;<samp>maxshift</samp>&rsquo;</dt>
21212 <dd><p>maximal number of pixels to translate frames (default: -1 no limit)
21213 </p>
21214 </dd>
21215 <dt> &lsquo;<samp>maxangle</samp>&rsquo;</dt>
21216 <dd><p>maximal angle in radians (degree*PI/180) to rotate frames (default: -1
21217 no limit)
21218 </p>
21219 </dd>
21220 <dt> &lsquo;<samp>crop</samp>&rsquo;</dt>
21221 <dd><p>How to deal with borders that may be visible due to movement
21222 compensation. Available values are:
21223 </p>
21224 <dl compact="compact">
21225 <dt> &lsquo;<samp>keep</samp>&rsquo;</dt>
21226 <dd><p>keep image information from previous frame (default)
21227 </p></dd>
21228 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
21229 <dd><p>fill the border black
21230 </p></dd>
21231 </dl>
21232
21233 </dd>
21234 <dt> &lsquo;<samp>invert</samp>&rsquo;</dt>
21235 <dd><dl compact="compact">
21236 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
21237 <dd><p>keep transforms normal (default)
21238 </p></dd>
21239 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
21240 <dd><p>invert transforms
21241 </p></dd>
21242 </dl>
21243
21244 </dd>
21245 <dt> &lsquo;<samp>relative</samp>&rsquo;</dt>
21246 <dd><p>consider transforms as
21247 </p><dl compact="compact">
21248 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
21249 <dd><p>absolute
21250 </p></dd>
21251 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
21252 <dd><p>relative to previous frame (default)
21253 </p></dd>
21254 </dl>
21255
21256 </dd>
21257 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
21258 <dd><p>percentage to zoom (default: 0)
21259 </p><dl compact="compact">
21260 <dt> &lsquo;<samp>&gt;0</samp>&rsquo;</dt>
21261 <dd><p>zoom in
21262 </p></dd>
21263 <dt> &lsquo;<samp>&lt;0</samp>&rsquo;</dt>
21264 <dd><p>zoom out
21265 </p></dd>
21266 </dl>
21267
21268 </dd>
21269 <dt> &lsquo;<samp>optzoom</samp>&rsquo;</dt>
21270 <dd><p>set optimal zooming to avoid borders
21271 </p><dl compact="compact">
21272 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
21273 <dd><p>disabled
21274 </p></dd>
21275 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
21276 <dd><p>optimal static zoom value is determined (only very strong movements will lead to visible borders) (default)
21277 </p></dd>
21278 <dt> &lsquo;<samp>2</samp>&rsquo;</dt>
21279 <dd><p>optimal adaptive zoom value is determined (no borders will be visible)
21280 </p></dd>
21281 </dl>
21282 <p>Note that the value given at zoom is added to the one calculated
21283 here.
21284 </p>
21285 </dd>
21286 <dt> &lsquo;<samp>interpol</samp>&rsquo;</dt>
21287 <dd><p>type of interpolation
21288 </p>
21289 <p>Available values are:
21290 </p><dl compact="compact">
21291 <dt> &lsquo;<samp>no</samp>&rsquo;</dt>
21292 <dd><p>no interpolation
21293 </p></dd>
21294 <dt> &lsquo;<samp>linear</samp>&rsquo;</dt>
21295 <dd><p>linear only horizontal
21296 </p></dd>
21297 <dt> &lsquo;<samp>bilinear</samp>&rsquo;</dt>
21298 <dd><p>linear in both directions (default)
21299 </p></dd>
21300 <dt> &lsquo;<samp>bicubic</samp>&rsquo;</dt>
21301 <dd><p>cubic in both directions (slow)
21302 </p></dd>
21303 </dl>
21304
21305 </dd>
21306 <dt> &lsquo;<samp>tripod</samp>&rsquo;</dt>
21307 <dd><p>virtual tripod mode means that the video is stabilized such that the
21308 camera stays stationary. Use also <code>tripod</code> option of
21309 <a href="#vidstabdetect">vidstabdetect</a>.
21310 </p><dl compact="compact">
21311 <dt> &lsquo;<samp>0</samp>&rsquo;</dt>
21312 <dd><p>off (default)
21313 </p></dd>
21314 <dt> &lsquo;<samp>1</samp>&rsquo;</dt>
21315 <dd><p>virtual tripod mode: equivalent to <code>relative=0:smoothing=0</code>
21316 </p></dd>
21317 </dl>
21318
21319 </dd>
21320 </dl>
21321
21322 <a name="Examples-4"></a>
21323 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-4">37.89.1 Examples</a></h3>
21324
21325 <ul>
21326 <li>
21327 typical call with default default values:
21328  (note the unsharp filter which is always recommended)
21329 <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
21330 </pre></td></tr></table>
21331
21332 </li><li>
21333 zoom in a bit more and load transform data from a given file
21334 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
21335 </pre></td></tr></table>
21336
21337 </li><li>
21338 smoothen the video even more
21339 <table><tr><td>&nbsp;</td><td><pre class="example">vidstabtransform=smoothing=30
21340 </pre></td></tr></table>
21341
21342 </li></ul>
21343
21344 <a name="vflip"></a>
21345 <h2 class="section"><a href="ffmpeg-all.html#toc-vflip">37.90 vflip</a></h2>
21346
21347 <p>Flip the input video vertically.
21348 </p>
21349 <p>For example, to vertically flip a video with <code>ffmpeg</code>:
21350 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
21351 </pre></td></tr></table>
21352
21353 <a name="vignette"></a>
21354 <h2 class="section"><a href="ffmpeg-all.html#toc-vignette">37.91 vignette</a></h2>
21355
21356 <p>Make or reverse a natural vignetting effect.
21357 </p>
21358 <p>The filter accepts the following options:
21359 </p>
21360 <dl compact="compact">
21361 <dt> &lsquo;<samp>angle, a</samp>&rsquo;</dt>
21362 <dd><p>Set lens angle expression as a number of radians.
21363 </p>
21364 <p>The value is clipped in the <code>[0,PI/2]</code> range.
21365 </p>
21366 <p>Default value: <code>&quot;PI/5&quot;</code>
21367 </p>
21368 </dd>
21369 <dt> &lsquo;<samp>x0</samp>&rsquo;</dt>
21370 <dt> &lsquo;<samp>y0</samp>&rsquo;</dt>
21371 <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
21372 by default.
21373 </p>
21374 </dd>
21375 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
21376 <dd><p>Set forward/backward mode.
21377 </p>
21378 <p>Available modes are:
21379 </p><dl compact="compact">
21380 <dt> &lsquo;<samp>forward</samp>&rsquo;</dt>
21381 <dd><p>The larger the distance from the central point, the darker the image becomes.
21382 </p>
21383 </dd>
21384 <dt> &lsquo;<samp>backward</samp>&rsquo;</dt>
21385 <dd><p>The larger the distance from the central point, the brighter the image becomes.
21386 This can be used to reverse a vignette effect, though there is no automatic
21387 detection to extract the lens &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
21388 also be used to create a burning effect.
21389 </p></dd>
21390 </dl>
21391
21392 <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
21393 </p>
21394 </dd>
21395 <dt> &lsquo;<samp>eval</samp>&rsquo;</dt>
21396 <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
21397 </p>
21398 <p>It accepts the following values:
21399 </p><dl compact="compact">
21400 <dt> &lsquo;<samp>init</samp>&rsquo;</dt>
21401 <dd><p>Evaluate expressions only once during the filter initialization.
21402 </p>
21403 </dd>
21404 <dt> &lsquo;<samp>frame</samp>&rsquo;</dt>
21405 <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
21406 &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
21407 allows advanced dynamic expressions.
21408 </p></dd>
21409 </dl>
21410
21411 <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
21412 </p>
21413 </dd>
21414 <dt> &lsquo;<samp>dither</samp>&rsquo;</dt>
21415 <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
21416 (enabled).
21417 </p>
21418 </dd>
21419 <dt> &lsquo;<samp>aspect</samp>&rsquo;</dt>
21420 <dd><p>Set vignette aspect. This setting allows to adjust the shape of the vignette.
21421 Setting this value to the SAR of the input will make a rectangular vignetting
21422 following the dimensions of the video.
21423 </p>
21424 <p>Default is <code>1/1</code>.
21425 </p></dd>
21426 </dl>
21427
21428 <a name="Expressions"></a>
21429 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Expressions">37.91.1 Expressions</a></h3>
21430
21431 <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
21432 following parameters.
21433 </p>
21434 <dl compact="compact">
21435 <dt> &lsquo;<samp>w</samp>&rsquo;</dt>
21436 <dt> &lsquo;<samp>h</samp>&rsquo;</dt>
21437 <dd><p>input width and height
21438 </p>
21439 </dd>
21440 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
21441 <dd><p>the number of input frame, starting from 0
21442 </p>
21443 </dd>
21444 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
21445 <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
21446 <var>TB</var> units, NAN if undefined
21447 </p>
21448 </dd>
21449 <dt> &lsquo;<samp>r</samp>&rsquo;</dt>
21450 <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
21451 </p>
21452 </dd>
21453 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
21454 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
21455 expressed in seconds, NAN if undefined
21456 </p>
21457 </dd>
21458 <dt> &lsquo;<samp>tb</samp>&rsquo;</dt>
21459 <dd><p>time base of the input video
21460 </p></dd>
21461 </dl>
21462
21463
21464 <a name="Examples-37"></a>
21465 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-37">37.91.2 Examples</a></h3>
21466
21467 <ul>
21468 <li>
21469 Apply simple strong vignetting effect:
21470 <table><tr><td>&nbsp;</td><td><pre class="example">vignette=PI/4
21471 </pre></td></tr></table>
21472
21473 </li><li>
21474 Make a flickering vignetting:
21475 <table><tr><td>&nbsp;</td><td><pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
21476 </pre></td></tr></table>
21477
21478 </li></ul>
21479
21480 <a name="w3fdif"></a>
21481 <h2 class="section"><a href="ffmpeg-all.html#toc-w3fdif">37.92 w3fdif</a></h2>
21482
21483 <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
21484 Deinterlacing Filter&quot;).
21485 </p>
21486 <p>Based on the process described by Martin Weston for BBC R&amp;D, and
21487 implemented based on the de-interlace algorithm written by Jim
21488 Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
21489 uses filter coefficients calculated by BBC R&amp;D.
21490 </p>
21491 <p>There are two sets of filter coefficients, so called &quot;simple&quot;:
21492 and &quot;complex&quot;. Which set of filter coefficients is used can
21493 be set by passing an optional parameter:
21494 </p>
21495 <dl compact="compact">
21496 <dt> &lsquo;<samp>filter</samp>&rsquo;</dt>
21497 <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
21498 </p>
21499 <dl compact="compact">
21500 <dt> &lsquo;<samp>simple</samp>&rsquo;</dt>
21501 <dd><p>Simple filter coefficient set.
21502 </p></dd>
21503 <dt> &lsquo;<samp>complex</samp>&rsquo;</dt>
21504 <dd><p>More-complex filter coefficient set.
21505 </p></dd>
21506 </dl>
21507 <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
21508 </p>
21509 </dd>
21510 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
21511 <dd><p>Specify which frames to deinterlace. Accept one of the following values:
21512 </p>
21513 <dl compact="compact">
21514 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
21515 <dd><p>Deinterlace all frames,
21516 </p></dd>
21517 <dt> &lsquo;<samp>interlaced</samp>&rsquo;</dt>
21518 <dd><p>Only deinterlace frames marked as interlaced.
21519 </p></dd>
21520 </dl>
21521
21522 <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
21523 </p></dd>
21524 </dl>
21525
21526 <p><a name="yadif"></a>
21527 </p><a name="yadif-1"></a>
21528 <h2 class="section"><a href="ffmpeg-all.html#toc-yadif-1">37.93 yadif</a></h2>
21529
21530 <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
21531 filter&quot;).
21532 </p>
21533 <p>This filter accepts the following options:
21534 </p>
21535
21536 <dl compact="compact">
21537 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
21538 <dd><p>The interlacing mode to adopt, accepts one of the following values:
21539 </p>
21540 <dl compact="compact">
21541 <dt> &lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
21542 <dd><p>output 1 frame for each frame
21543 </p></dd>
21544 <dt> &lsquo;<samp>1, send_field</samp>&rsquo;</dt>
21545 <dd><p>output 1 frame for each field
21546 </p></dd>
21547 <dt> &lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
21548 <dd><p>like <code>send_frame</code> but skip spatial interlacing check
21549 </p></dd>
21550 <dt> &lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
21551 <dd><p>like <code>send_field</code> but skip spatial interlacing check
21552 </p></dd>
21553 </dl>
21554
21555 <p>Default value is <code>send_frame</code>.
21556 </p>
21557 </dd>
21558 <dt> &lsquo;<samp>parity</samp>&rsquo;</dt>
21559 <dd><p>The picture field parity assumed for the input interlaced video, accepts one of
21560 the following values:
21561 </p>
21562 <dl compact="compact">
21563 <dt> &lsquo;<samp>0, tff</samp>&rsquo;</dt>
21564 <dd><p>assume top field first
21565 </p></dd>
21566 <dt> &lsquo;<samp>1, bff</samp>&rsquo;</dt>
21567 <dd><p>assume bottom field first
21568 </p></dd>
21569 <dt> &lsquo;<samp>-1, auto</samp>&rsquo;</dt>
21570 <dd><p>enable automatic detection
21571 </p></dd>
21572 </dl>
21573
21574 <p>Default value is <code>auto</code>.
21575 If interlacing is unknown or decoder does not export this information,
21576 top field first will be assumed.
21577 </p>
21578 </dd>
21579 <dt> &lsquo;<samp>deint</samp>&rsquo;</dt>
21580 <dd><p>Specify which frames to deinterlace. Accept one of the following
21581 values:
21582 </p>
21583 <dl compact="compact">
21584 <dt> &lsquo;<samp>0, all</samp>&rsquo;</dt>
21585 <dd><p>deinterlace all frames
21586 </p></dd>
21587 <dt> &lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
21588 <dd><p>only deinterlace frames marked as interlaced
21589 </p></dd>
21590 </dl>
21591
21592 <p>Default value is <code>all</code>.
21593 </p></dd>
21594 </dl>
21595
21596
21597 <a name="Video-Sources"></a>
21598 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sources">38. Video Sources</a></h1>
21599
21600 <p>Below is a description of the currently available video sources.
21601 </p>
21602 <a name="buffer"></a>
21603 <h2 class="section"><a href="ffmpeg-all.html#toc-buffer">38.1 buffer</a></h2>
21604
21605 <p>Buffer video frames, and make them available to the filter chain.
21606 </p>
21607 <p>This source is mainly intended for a programmatic use, in particular
21608 through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
21609 </p>
21610 <p>This source accepts the following options:
21611 </p>
21612 <dl compact="compact">
21613 <dt> &lsquo;<samp>video_size</samp>&rsquo;</dt>
21614 <dd><p>Specify the size (width and height) of the buffered video frames. For the
21615 syntax of this option, check the &quot;Video size&quot; section in the ffmpeg-utils
21616 manual.
21617 </p>
21618 </dd>
21619 <dt> &lsquo;<samp>width</samp>&rsquo;</dt>
21620 <dd><p>Input video width.
21621 </p>
21622 </dd>
21623 <dt> &lsquo;<samp>height</samp>&rsquo;</dt>
21624 <dd><p>Input video height.
21625 </p>
21626 </dd>
21627 <dt> &lsquo;<samp>pix_fmt</samp>&rsquo;</dt>
21628 <dd><p>A string representing the pixel format of the buffered video frames.
21629 It may be a number corresponding to a pixel format, or a pixel format
21630 name.
21631 </p>
21632 </dd>
21633 <dt> &lsquo;<samp>time_base</samp>&rsquo;</dt>
21634 <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
21635 </p>
21636 </dd>
21637 <dt> &lsquo;<samp>frame_rate</samp>&rsquo;</dt>
21638 <dd><p>Specify the frame rate expected for the video stream.
21639 </p>
21640 </dd>
21641 <dt> &lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
21642 <dd><p>Specify the sample aspect ratio assumed by the video frames.
21643 </p>
21644 </dd>
21645 <dt> &lsquo;<samp>sws_param</samp>&rsquo;</dt>
21646 <dd><p>Specify the optional parameters to be used for the scale filter which
21647 is automatically inserted when an input change is detected in the
21648 input size or format.
21649 </p></dd>
21650 </dl>
21651
21652 <p>For example:
21653 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
21654 </pre></td></tr></table>
21655
21656 <p>will instruct the source to accept video frames with size 320x240 and
21657 with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
21658 square pixels (1:1 sample aspect ratio).
21659 Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
21660 (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
21661 this example corresponds to:
21662 </p><table><tr><td>&nbsp;</td><td><pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
21663 </pre></td></tr></table>
21664
21665 <p>Alternatively, the options can be specified as a flat string, but this
21666 syntax is deprecated:
21667 </p>
21668 <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>]
21669 </p>
21670 <a name="cellauto"></a>
21671 <h2 class="section"><a href="ffmpeg-all.html#toc-cellauto">38.2 cellauto</a></h2>
21672
21673 <p>Create a pattern generated by an elementary cellular automaton.
21674 </p>
21675 <p>The initial state of the cellular automaton can be defined through the
21676 &lsquo;<samp>filename</samp>&rsquo;, and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
21677 not specified an initial state is created randomly.
21678 </p>
21679 <p>At each new frame a new row in the video is filled with the result of
21680 the cellular automaton next generation. The behavior when the whole
21681 frame is filled is defined by the &lsquo;<samp>scroll</samp>&rsquo; option.
21682 </p>
21683 <p>This source accepts the following options:
21684 </p>
21685 <dl compact="compact">
21686 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
21687 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
21688 the specified file.
21689 In the file, each non-whitespace character is considered an alive
21690 cell, a newline will terminate the row, and further characters in the
21691 file will be ignored.
21692 </p>
21693 </dd>
21694 <dt> &lsquo;<samp>pattern, p</samp>&rsquo;</dt>
21695 <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
21696 the specified string.
21697 </p>
21698 <p>Each non-whitespace character in the string is considered an alive
21699 cell, a newline will terminate the row, and further characters in the
21700 string will be ignored.
21701 </p>
21702 </dd>
21703 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
21704 <dd><p>Set the video rate, that is the number of frames generated per second.
21705 Default is 25.
21706 </p>
21707 </dd>
21708 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
21709 <dd><p>Set the random fill ratio for the initial cellular automaton row. It
21710 is a floating point number value ranging from 0 to 1, defaults to
21711 1/PHI.
21712 </p>
21713 <p>This option is ignored when a file or a pattern is specified.
21714 </p>
21715 </dd>
21716 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
21717 <dd><p>Set the seed for filling randomly the initial row, must be an integer
21718 included between 0 and UINT32_MAX. If not specified, or if explicitly
21719 set to -1, the filter will try to use a good random seed on a best
21720 effort basis.
21721 </p>
21722 </dd>
21723 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
21724 <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
21725 Default value is 110.
21726 </p>
21727 </dd>
21728 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
21729 <dd><p>Set the size of the output video. For the syntax of this option, check
21730 the &quot;Video size&quot; section in the ffmpeg-utils manual.
21731 </p>
21732 <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; is specified, the size is set
21733 by default to the width of the specified initial state row, and the
21734 height is set to <var>width</var> * PHI.
21735 </p>
21736 <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
21737 pattern string, and the specified pattern will be centered in the
21738 larger row.
21739 </p>
21740 <p>If a filename or a pattern string is not specified, the size value
21741 defaults to &quot;320x518&quot; (used for a randomly generated initial state).
21742 </p>
21743 </dd>
21744 <dt> &lsquo;<samp>scroll</samp>&rsquo;</dt>
21745 <dd><p>If set to 1, scroll the output upward when all the rows in the output
21746 have been already filled. If set to 0, the new generated row will be
21747 written over the top row just after the bottom row is filled.
21748 Defaults to 1.
21749 </p>
21750 </dd>
21751 <dt> &lsquo;<samp>start_full, full</samp>&rsquo;</dt>
21752 <dd><p>If set to 1, completely fill the output with generated rows before
21753 outputting the first frame.
21754 This is the default behavior, for disabling set the value to 0.
21755 </p>
21756 </dd>
21757 <dt> &lsquo;<samp>stitch</samp>&rsquo;</dt>
21758 <dd><p>If set to 1, stitch the left and right row edges together.
21759 This is the default behavior, for disabling set the value to 0.
21760 </p></dd>
21761 </dl>
21762
21763 <a name="Examples-77"></a>
21764 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-77">38.2.1 Examples</a></h3>
21765
21766 <ul>
21767 <li>
21768 Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
21769 size 200x400.
21770 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=f=pattern:s=200x400
21771 </pre></td></tr></table>
21772
21773 </li><li>
21774 Generate a random initial row with a width of 200 cells, with a fill
21775 ratio of 2/3:
21776 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=ratio=2/3:s=200x200
21777 </pre></td></tr></table>
21778
21779 </li><li>
21780 Create a pattern generated by rule 18 starting by a single alive cell
21781 centered on an initial row with width 100:
21782 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
21783 </pre></td></tr></table>
21784
21785 </li><li>
21786 Specify a more elaborated initial pattern:
21787 <table><tr><td>&nbsp;</td><td><pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
21788 </pre></td></tr></table>
21789
21790 </li></ul>
21791
21792 <a name="mandelbrot"></a>
21793 <h2 class="section"><a href="ffmpeg-all.html#toc-mandelbrot">38.3 mandelbrot</a></h2>
21794
21795 <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
21796 point specified with <var>start_x</var> and <var>start_y</var>.
21797 </p>
21798 <p>This source accepts the following options:
21799 </p>
21800 <dl compact="compact">
21801 <dt> &lsquo;<samp>end_pts</samp>&rsquo;</dt>
21802 <dd><p>Set the terminal pts value. Default value is 400.
21803 </p>
21804 </dd>
21805 <dt> &lsquo;<samp>end_scale</samp>&rsquo;</dt>
21806 <dd><p>Set the terminal scale value.
21807 Must be a floating point value. Default value is 0.3.
21808 </p>
21809 </dd>
21810 <dt> &lsquo;<samp>inner</samp>&rsquo;</dt>
21811 <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
21812 Mandelbrot fractal internal region.
21813 </p>
21814 <p>It shall assume one of the following values:
21815 </p><dl compact="compact">
21816 <dt> &lsquo;<samp>black</samp>&rsquo;</dt>
21817 <dd><p>Set black mode.
21818 </p></dd>
21819 <dt> &lsquo;<samp>convergence</samp>&rsquo;</dt>
21820 <dd><p>Show time until convergence.
21821 </p></dd>
21822 <dt> &lsquo;<samp>mincol</samp>&rsquo;</dt>
21823 <dd><p>Set color based on point closest to the origin of the iterations.
21824 </p></dd>
21825 <dt> &lsquo;<samp>period</samp>&rsquo;</dt>
21826 <dd><p>Set period mode.
21827 </p></dd>
21828 </dl>
21829
21830 <p>Default value is <var>mincol</var>.
21831 </p>
21832 </dd>
21833 <dt> &lsquo;<samp>bailout</samp>&rsquo;</dt>
21834 <dd><p>Set the bailout value. Default value is 10.0.
21835 </p>
21836 </dd>
21837 <dt> &lsquo;<samp>maxiter</samp>&rsquo;</dt>
21838 <dd><p>Set the maximum of iterations performed by the rendering
21839 algorithm. Default value is 7189.
21840 </p>
21841 </dd>
21842 <dt> &lsquo;<samp>outer</samp>&rsquo;</dt>
21843 <dd><p>Set outer coloring mode.
21844 It shall assume one of following values:
21845 </p><dl compact="compact">
21846 <dt> &lsquo;<samp>iteration_count</samp>&rsquo;</dt>
21847 <dd><p>Set iteration cound mode.
21848 </p></dd>
21849 <dt> &lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
21850 <dd><p>set normalized iteration count mode.
21851 </p></dd>
21852 </dl>
21853 <p>Default value is <var>normalized_iteration_count</var>.
21854 </p>
21855 </dd>
21856 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
21857 <dd><p>Set frame rate, expressed as number of frames per second. Default
21858 value is &quot;25&quot;.
21859 </p>
21860 </dd>
21861 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
21862 <dd><p>Set frame size. For the syntax of this option, check the &quot;Video
21863 size&quot; section in the ffmpeg-utils manual. Default value is &quot;640x480&quot;.
21864 </p>
21865 </dd>
21866 <dt> &lsquo;<samp>start_scale</samp>&rsquo;</dt>
21867 <dd><p>Set the initial scale value. Default value is 3.0.
21868 </p>
21869 </dd>
21870 <dt> &lsquo;<samp>start_x</samp>&rsquo;</dt>
21871 <dd><p>Set the initial x position. Must be a floating point value between
21872 -100 and 100. Default value is -0.743643887037158704752191506114774.
21873 </p>
21874 </dd>
21875 <dt> &lsquo;<samp>start_y</samp>&rsquo;</dt>
21876 <dd><p>Set the initial y position. Must be a floating point value between
21877 -100 and 100. Default value is -0.131825904205311970493132056385139.
21878 </p></dd>
21879 </dl>
21880
21881 <a name="mptestsrc"></a>
21882 <h2 class="section"><a href="ffmpeg-all.html#toc-mptestsrc">38.4 mptestsrc</a></h2>
21883
21884 <p>Generate various test patterns, as generated by the MPlayer test filter.
21885 </p>
21886 <p>The size of the generated video is fixed, and is 256x256.
21887 This source is useful in particular for testing encoding features.
21888 </p>
21889 <p>This source accepts the following options:
21890 </p>
21891 <dl compact="compact">
21892 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
21893 <dd><p>Specify the frame rate of the sourced video, as the number of frames
21894 generated per second. It has to be a string in the format
21895 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
21896 number or a valid video frame rate abbreviation. The default value is
21897 &quot;25&quot;.
21898 </p>
21899 </dd>
21900 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
21901 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
21902 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH:MM:SS[.m...]
21903 [-]S+[.m...]
21904 </pre></td></tr></table>
21905 <p>See also the function <code>av_parse_time()</code>.
21906 </p>
21907 <p>If not specified, or the expressed duration is negative, the video is
21908 supposed to be generated forever.
21909 </p>
21910 </dd>
21911 <dt> &lsquo;<samp>test, t</samp>&rsquo;</dt>
21912 <dd>
21913 <p>Set the number or the name of the test to perform. Supported tests are:
21914 </p><dl compact="compact">
21915 <dt> &lsquo;<samp>dc_luma</samp>&rsquo;</dt>
21916 <dt> &lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
21917 <dt> &lsquo;<samp>freq_luma</samp>&rsquo;</dt>
21918 <dt> &lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
21919 <dt> &lsquo;<samp>amp_luma</samp>&rsquo;</dt>
21920 <dt> &lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
21921 <dt> &lsquo;<samp>cbp</samp>&rsquo;</dt>
21922 <dt> &lsquo;<samp>mv</samp>&rsquo;</dt>
21923 <dt> &lsquo;<samp>ring1</samp>&rsquo;</dt>
21924 <dt> &lsquo;<samp>ring2</samp>&rsquo;</dt>
21925 <dt> &lsquo;<samp>all</samp>&rsquo;</dt>
21926 </dl>
21927
21928 <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
21929 </p></dd>
21930 </dl>
21931
21932 <p>For example the following:
21933 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=t=dc_luma
21934 </pre></td></tr></table>
21935
21936 <p>will generate a &quot;dc_luma&quot; test pattern.
21937 </p>
21938 <a name="frei0r_005fsrc"></a>
21939 <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r_005fsrc">38.5 frei0r_src</a></h2>
21940
21941 <p>Provide a frei0r source.
21942 </p>
21943 <p>To enable compilation of this filter you need to install the frei0r
21944 header and configure FFmpeg with <code>--enable-frei0r</code>.
21945 </p>
21946 <p>This source accepts the following options:
21947 </p>
21948 <dl compact="compact">
21949 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
21950 <dd><p>The size of the video to generate. For the syntax of this option, check the
21951 &quot;Video size&quot; section in the ffmpeg-utils manual.
21952 </p>
21953 </dd>
21954 <dt> &lsquo;<samp>framerate</samp>&rsquo;</dt>
21955 <dd><p>Framerate of the generated video, may be a string of the form
21956 <var>num</var>/<var>den</var> or a frame rate abbreviation.
21957 </p>
21958 </dd>
21959 <dt> &lsquo;<samp>filter_name</samp>&rsquo;</dt>
21960 <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
21961 how to set the parameters read the section <a href="#frei0r">frei0r</a> in the description of
21962 the video filters.
21963 </p>
21964 </dd>
21965 <dt> &lsquo;<samp>filter_params</samp>&rsquo;</dt>
21966 <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
21967 </p>
21968 </dd>
21969 </dl>
21970
21971 <p>For example, to generate a frei0r partik0l source with size 200x200
21972 and frame rate 10 which is overlayed on the overlay filter main input:
21973 </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
21974 </pre></td></tr></table>
21975
21976 <a name="life"></a>
21977 <h2 class="section"><a href="ffmpeg-all.html#toc-life">38.6 life</a></h2>
21978
21979 <p>Generate a life pattern.
21980 </p>
21981 <p>This source is based on a generalization of John Conway&rsquo;s life game.
21982 </p>
21983 <p>The sourced input represents a life grid, each pixel represents a cell
21984 which can be in one of two possible states, alive or dead. Every cell
21985 interacts with its eight neighbours, which are the cells that are
21986 horizontally, vertically, or diagonally adjacent.
21987 </p>
21988 <p>At each interaction the grid evolves according to the adopted rule,
21989 which specifies the number of neighbor alive cells which will make a
21990 cell stay alive or born. The &lsquo;<samp>rule</samp>&rsquo; option allows to specify
21991 the rule to adopt.
21992 </p>
21993 <p>This source accepts the following options:
21994 </p>
21995 <dl compact="compact">
21996 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
21997 <dd><p>Set the file from which to read the initial grid state. In the file,
21998 each non-whitespace character is considered an alive cell, and newline
21999 is used to delimit the end of each row.
22000 </p>
22001 <p>If this option is not specified, the initial grid is generated
22002 randomly.
22003 </p>
22004 </dd>
22005 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
22006 <dd><p>Set the video rate, that is the number of frames generated per second.
22007 Default is 25.
22008 </p>
22009 </dd>
22010 <dt> &lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
22011 <dd><p>Set the random fill ratio for the initial random grid. It is a
22012 floating point number value ranging from 0 to 1, defaults to 1/PHI.
22013 It is ignored when a file is specified.
22014 </p>
22015 </dd>
22016 <dt> &lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
22017 <dd><p>Set the seed for filling the initial random grid, must be an integer
22018 included between 0 and UINT32_MAX. If not specified, or if explicitly
22019 set to -1, the filter will try to use a good random seed on a best
22020 effort basis.
22021 </p>
22022 </dd>
22023 <dt> &lsquo;<samp>rule</samp>&rsquo;</dt>
22024 <dd><p>Set the life rule.
22025 </p>
22026 <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
22027 where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
22028 <var>NS</var> specifies the number of alive neighbor cells which make a
22029 live cell stay alive, and <var>NB</var> the number of alive neighbor cells
22030 which make a dead cell to become alive (i.e. to &quot;born&quot;).
22031 &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
22032 </p>
22033 <p>Alternatively a rule can be specified by an 18-bits integer. The 9
22034 high order bits are used to encode the next cell state if it is alive
22035 for each number of neighbor alive cells, the low order bits specify
22036 the rule for &quot;borning&quot; new cells. Higher order bits encode for an
22037 higher number of neighbor cells.
22038 For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
22039 rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
22040 </p>
22041 <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
22042 rule, and will keep a cell alive if it has 2 or 3 neighbor alive
22043 cells, and will born a new cell if there are three alive cells around
22044 a dead cell.
22045 </p>
22046 </dd>
22047 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
22048 <dd><p>Set the size of the output video. For the syntax of this option, check the
22049 &quot;Video size&quot; section in the ffmpeg-utils manual.
22050 </p>
22051 <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
22052 same size of the input file. If &lsquo;<samp>size</samp>&rsquo; is set, it must contain
22053 the size specified in the input file, and the initial grid defined in
22054 that file is centered in the larger resulting area.
22055 </p>
22056 <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
22057 (used for a randomly generated initial grid).
22058 </p>
22059 </dd>
22060 <dt> &lsquo;<samp>stitch</samp>&rsquo;</dt>
22061 <dd><p>If set to 1, stitch the left and right grid edges together, and the
22062 top and bottom edges also. Defaults to 1.
22063 </p>
22064 </dd>
22065 <dt> &lsquo;<samp>mold</samp>&rsquo;</dt>
22066 <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
22067 &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
22068 value from 0 to 255.
22069 </p>
22070 </dd>
22071 <dt> &lsquo;<samp>life_color</samp>&rsquo;</dt>
22072 <dd><p>Set the color of living (or new born) cells.
22073 </p>
22074 </dd>
22075 <dt> &lsquo;<samp>death_color</samp>&rsquo;</dt>
22076 <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
22077 used to represent a dead cell.
22078 </p>
22079 </dd>
22080 <dt> &lsquo;<samp>mold_color</samp>&rsquo;</dt>
22081 <dd><p>Set mold color, for definitely dead and moldy cells.
22082 </p>
22083 <p>For the syntax of these 3 color options, check the &quot;Color&quot; section in the
22084 ffmpeg-utils manual.
22085 </p></dd>
22086 </dl>
22087
22088 <a name="Examples-2"></a>
22089 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-2">38.6.1 Examples</a></h3>
22090
22091 <ul>
22092 <li>
22093 Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
22094 300x300 pixels:
22095 <table><tr><td>&nbsp;</td><td><pre class="example">life=f=pattern:s=300x300
22096 </pre></td></tr></table>
22097
22098 </li><li>
22099 Generate a random grid of size 200x200, with a fill ratio of 2/3:
22100 <table><tr><td>&nbsp;</td><td><pre class="example">life=ratio=2/3:s=200x200
22101 </pre></td></tr></table>
22102
22103 </li><li>
22104 Specify a custom rule for evolving a randomly generated grid:
22105 <table><tr><td>&nbsp;</td><td><pre class="example">life=rule=S14/B34
22106 </pre></td></tr></table>
22107
22108 </li><li>
22109 Full example with slow death effect (mold) using <code>ffplay</code>:
22110 <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
22111 </pre></td></tr></table>
22112 </li></ul>
22113
22114 <p><a name="color"></a>
22115 <a name="haldclutsrc"></a>
22116 <a name="nullsrc"></a>
22117 <a name="rgbtestsrc"></a>
22118 <a name="smptebars"></a>
22119 <a name="smptehdbars"></a>
22120 <a name="testsrc"></a>
22121 </p><a name="color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc"></a>
22122 <h2 class="section"><a href="ffmpeg-all.html#toc-color_002c-haldclutsrc_002c-nullsrc_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc">38.7 color, haldclutsrc, nullsrc, rgbtestsrc, smptebars, smptehdbars, testsrc</a></h2>
22123
22124 <p>The <code>color</code> source provides an uniformly colored input.
22125 </p>
22126 <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
22127 <a href="#haldclut">haldclut</a> filter.
22128 </p>
22129 <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
22130 mainly useful to be employed in analysis / debugging tools, or as the
22131 source for filters which ignore the input data.
22132 </p>
22133 <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
22134 detecting RGB vs BGR issues. You should see a red, green and blue
22135 stripe from top to bottom.
22136 </p>
22137 <p>The <code>smptebars</code> source generates a color bars pattern, based on
22138 the SMPTE Engineering Guideline EG 1-1990.
22139 </p>
22140 <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
22141 the SMPTE RP 219-2002.
22142 </p>
22143 <p>The <code>testsrc</code> source generates a test video pattern, showing a
22144 color pattern, a scrolling gradient and a timestamp. This is mainly
22145 intended for testing purposes.
22146 </p>
22147 <p>The sources accept the following options:
22148 </p>
22149 <dl compact="compact">
22150 <dt> &lsquo;<samp>color, c</samp>&rsquo;</dt>
22151 <dd><p>Specify the color of the source, only available in the <code>color</code>
22152 source. For the syntax of this option, check the &quot;Color&quot; section in the
22153 ffmpeg-utils manual.
22154 </p>
22155 </dd>
22156 <dt> &lsquo;<samp>level</samp>&rsquo;</dt>
22157 <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
22158 source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
22159 pixels to be used as identity matrix for 3D lookup tables. Each component is
22160 coded on a <code>1/(N*N)</code> scale.
22161 </p>
22162 </dd>
22163 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
22164 <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
22165 &quot;Video size&quot; section in the ffmpeg-utils manual. The default value is
22166 &quot;320x240&quot;.
22167 </p>
22168 <p>This option is not available with the <code>haldclutsrc</code> filter.
22169 </p>
22170 </dd>
22171 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
22172 <dd><p>Specify the frame rate of the sourced video, as the number of frames
22173 generated per second. It has to be a string in the format
22174 <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
22175 number or a valid video frame rate abbreviation. The default value is
22176 &quot;25&quot;.
22177 </p>
22178 </dd>
22179 <dt> &lsquo;<samp>sar</samp>&rsquo;</dt>
22180 <dd><p>Set the sample aspect ratio of the sourced video.
22181 </p>
22182 </dd>
22183 <dt> &lsquo;<samp>duration, d</samp>&rsquo;</dt>
22184 <dd><p>Set the video duration of the sourced video. The accepted syntax is:
22185 </p><table><tr><td>&nbsp;</td><td><pre class="example">[-]HH[:MM[:SS[.m...]]]
22186 [-]S+[.m...]
22187 </pre></td></tr></table>
22188 <p>See also the function <code>av_parse_time()</code>.
22189 </p>
22190 <p>If not specified, or the expressed duration is negative, the video is
22191 supposed to be generated forever.
22192 </p>
22193 </dd>
22194 <dt> &lsquo;<samp>decimals, n</samp>&rsquo;</dt>
22195 <dd><p>Set the number of decimals to show in the timestamp, only available in the
22196 <code>testsrc</code> source.
22197 </p>
22198 <p>The displayed timestamp value will correspond to the original
22199 timestamp value multiplied by the power of 10 of the specified
22200 value. Default value is 0.
22201 </p></dd>
22202 </dl>
22203
22204 <p>For example the following:
22205 </p><table><tr><td>&nbsp;</td><td><pre class="example">testsrc=duration=5.3:size=qcif:rate=10
22206 </pre></td></tr></table>
22207
22208 <p>will generate a video with a duration of 5.3 seconds, with size
22209 176x144 and a frame rate of 10 frames per second.
22210 </p>
22211 <p>The following graph description will generate a red source
22212 with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
22213 frames per second.
22214 </p><table><tr><td>&nbsp;</td><td><pre class="example">color=c=red@0.2:s=qcif:r=10
22215 </pre></td></tr></table>
22216
22217 <p>If the input content is to be ignored, <code>nullsrc</code> can be used. The
22218 following command generates noise in the luminance plane by employing
22219 the <code>geq</code> filter:
22220 </p><table><tr><td>&nbsp;</td><td><pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
22221 </pre></td></tr></table>
22222
22223 <a name="Commands-4"></a>
22224 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-4">38.7.1 Commands</a></h3>
22225
22226 <p>The <code>color</code> source supports the following commands:
22227 </p>
22228 <dl compact="compact">
22229 <dt> &lsquo;<samp>c, color</samp>&rsquo;</dt>
22230 <dd><p>Set the color of the created image. Accepts the same syntax of the
22231 corresponding &lsquo;<samp>color</samp>&rsquo; option.
22232 </p></dd>
22233 </dl>
22234
22235
22236 <a name="Video-Sinks"></a>
22237 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sinks">39. Video Sinks</a></h1>
22238
22239 <p>Below is a description of the currently available video sinks.
22240 </p>
22241 <a name="buffersink"></a>
22242 <h2 class="section"><a href="ffmpeg-all.html#toc-buffersink">39.1 buffersink</a></h2>
22243
22244 <p>Buffer video frames, and make them available to the end of the filter
22245 graph.
22246 </p>
22247 <p>This sink is mainly intended for a programmatic use, in particular
22248 through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
22249 or the options system.
22250 </p>
22251 <p>It accepts a pointer to an AVBufferSinkContext structure, which
22252 defines the incoming buffers&rsquo; formats, to be passed as the opaque
22253 parameter to <code>avfilter_init_filter</code> for initialization.
22254 </p>
22255 <a name="nullsink"></a>
22256 <h2 class="section"><a href="ffmpeg-all.html#toc-nullsink">39.2 nullsink</a></h2>
22257
22258 <p>Null video sink, do absolutely nothing with the input video. It is
22259 mainly useful as a template and to be employed in analysis / debugging
22260 tools.
22261 </p>
22262
22263 <a name="Multimedia-Filters"></a>
22264 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Filters">40. Multimedia Filters</a></h1>
22265
22266 <p>Below is a description of the currently available multimedia filters.
22267 </p>
22268 <a name="avectorscope"></a>
22269 <h2 class="section"><a href="ffmpeg-all.html#toc-avectorscope">40.1 avectorscope</a></h2>
22270
22271 <p>Convert input audio to a video output, representing the audio vector
22272 scope.
22273 </p>
22274 <p>The filter is used to measure the difference between channels of stereo
22275 audio stream. A monoaural signal, consisting of identical left and right
22276 signal, results in straight vertical line. Any stereo separation is visible
22277 as a deviation from this line, creating a Lissajous figure.
22278 If the straight (or deviation from it) but horizontal line appears this
22279 indicates that the left and right channels are out of phase.
22280 </p>
22281 <p>The filter accepts the following options:
22282 </p>
22283 <dl compact="compact">
22284 <dt> &lsquo;<samp>mode, m</samp>&rsquo;</dt>
22285 <dd><p>Set the vectorscope mode.
22286 </p>
22287 <p>Available values are:
22288 </p><dl compact="compact">
22289 <dt> &lsquo;<samp>lissajous</samp>&rsquo;</dt>
22290 <dd><p>Lissajous rotated by 45 degrees.
22291 </p>
22292 </dd>
22293 <dt> &lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
22294 <dd><p>Same as above but not rotated.
22295 </p></dd>
22296 </dl>
22297
22298 <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
22299 </p>
22300 </dd>
22301 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
22302 <dd><p>Set the video size for the output. For the syntax of this option, check the &quot;Video size&quot;
22303 section in the ffmpeg-utils manual. Default value is <code>400x400</code>.
22304 </p>
22305 </dd>
22306 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
22307 <dd><p>Set the output frame rate. Default value is <code>25</code>.
22308 </p>
22309 </dd>
22310 <dt> &lsquo;<samp>rc</samp>&rsquo;</dt>
22311 <dt> &lsquo;<samp>gc</samp>&rsquo;</dt>
22312 <dt> &lsquo;<samp>bc</samp>&rsquo;</dt>
22313 <dd><p>Specify the red, green and blue contrast. Default values are <code>40</code>, <code>160</code> and <code>80</code>.
22314 Allowed range is <code>[0, 255]</code>.
22315 </p>
22316 </dd>
22317 <dt> &lsquo;<samp>rf</samp>&rsquo;</dt>
22318 <dt> &lsquo;<samp>gf</samp>&rsquo;</dt>
22319 <dt> &lsquo;<samp>bf</samp>&rsquo;</dt>
22320 <dd><p>Specify the red, green and blue fade. Default values are <code>15</code>, <code>10</code> and <code>5</code>.
22321 Allowed range is <code>[0, 255]</code>.
22322 </p>
22323 </dd>
22324 <dt> &lsquo;<samp>zoom</samp>&rsquo;</dt>
22325 <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[1, 10]</code>.
22326 </p></dd>
22327 </dl>
22328
22329 <a name="Examples-72"></a>
22330 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-72">40.1.1 Examples</a></h3>
22331
22332 <ul>
22333 <li>
22334 Complete example using <code>ffplay</code>:
22335 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
22336              [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
22337 </pre></td></tr></table>
22338 </li></ul>
22339
22340 <a name="concat-1"></a>
22341 <h2 class="section"><a href="ffmpeg-all.html#toc-concat-1">40.2 concat</a></h2>
22342
22343 <p>Concatenate audio and video streams, joining them together one after the
22344 other.
22345 </p>
22346 <p>The filter works on segments of synchronized video and audio streams. All
22347 segments must have the same number of streams of each type, and that will
22348 also be the number of streams at output.
22349 </p>
22350 <p>The filter accepts the following options:
22351 </p>
22352 <dl compact="compact">
22353 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
22354 <dd><p>Set the number of segments. Default is 2.
22355 </p>
22356 </dd>
22357 <dt> &lsquo;<samp>v</samp>&rsquo;</dt>
22358 <dd><p>Set the number of output video streams, that is also the number of video
22359 streams in each segment. Default is 1.
22360 </p>
22361 </dd>
22362 <dt> &lsquo;<samp>a</samp>&rsquo;</dt>
22363 <dd><p>Set the number of output audio streams, that is also the number of video
22364 streams in each segment. Default is 0.
22365 </p>
22366 </dd>
22367 <dt> &lsquo;<samp>unsafe</samp>&rsquo;</dt>
22368 <dd><p>Activate unsafe mode: do not fail if segments have a different format.
22369 </p>
22370 </dd>
22371 </dl>
22372
22373 <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
22374 <var>a</var> audio outputs.
22375 </p>
22376 <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
22377 segment, in the same order as the outputs, then the inputs for the second
22378 segment, etc.
22379 </p>
22380 <p>Related streams do not always have exactly the same duration, for various
22381 reasons including codec frame size or sloppy authoring. For that reason,
22382 related synchronized streams (e.g. a video and its audio track) should be
22383 concatenated at once. The concat filter will use the duration of the longest
22384 stream in each segment (except the last one), and if necessary pad shorter
22385 audio streams with silence.
22386 </p>
22387 <p>For this filter to work correctly, all segments must start at timestamp 0.
22388 </p>
22389 <p>All corresponding streams must have the same parameters in all segments; the
22390 filtering system will automatically select a common pixel format for video
22391 streams, and a common sample format, sample rate and channel layout for
22392 audio streams, but other settings, such as resolution, must be converted
22393 explicitly by the user.
22394 </p>
22395 <p>Different frame rates are acceptable but will result in variable frame rate
22396 at output; be sure to configure the output file to handle it.
22397 </p>
22398 <a name="Examples-29"></a>
22399 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-29">40.2.1 Examples</a></h3>
22400
22401 <ul>
22402 <li>
22403 Concatenate an opening, an episode and an ending, all in bilingual version
22404 (video in stream 0, audio in streams 1 and 2):
22405 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
22406   '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
22407    concat=n=3:v=1:a=2 [v] [a1] [a2]' \
22408   -map '[v]' -map '[a1]' -map '[a2]' output.mkv
22409 </pre></td></tr></table>
22410
22411 </li><li>
22412 Concatenate two parts, handling audio and video separately, using the
22413 (a)movie sources, and adjusting the resolution:
22414 <table><tr><td>&nbsp;</td><td><pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
22415 movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
22416 [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
22417 </pre></td></tr></table>
22418 <p>Note that a desync will happen at the stitch if the audio and video streams
22419 do not have exactly the same duration in the first file.
22420 </p>
22421 </li></ul>
22422
22423 <a name="ebur128"></a>
22424 <h2 class="section"><a href="ffmpeg-all.html#toc-ebur128">40.3 ebur128</a></h2>
22425
22426 <p>EBU R128 scanner filter. This filter takes an audio stream as input and outputs
22427 it unchanged. By default, it logs a message at a frequency of 10Hz with the
22428 Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
22429 Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
22430 </p>
22431 <p>The filter also has a video output (see the <var>video</var> option) with a real
22432 time graph to observe the loudness evolution. The graphic contains the logged
22433 message mentioned above, so it is not printed anymore when this option is set,
22434 unless the verbose logging is set. The main graphing area contains the
22435 short-term loudness (3 seconds of analysis), and the gauge on the right is for
22436 the momentary loudness (400 milliseconds).
22437 </p>
22438 <p>More information about the Loudness Recommendation EBU R128 on
22439 <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
22440 </p>
22441 <p>The filter accepts the following options:
22442 </p>
22443 <dl compact="compact">
22444 <dt> &lsquo;<samp>video</samp>&rsquo;</dt>
22445 <dd><p>Activate the video output. The audio stream is passed unchanged whether this
22446 option is set or no. The video stream will be the first output stream if
22447 activated. Default is <code>0</code>.
22448 </p>
22449 </dd>
22450 <dt> &lsquo;<samp>size</samp>&rsquo;</dt>
22451 <dd><p>Set the video size. This option is for video only. For the syntax of this
22452 option, check the &quot;Video size&quot; section in the ffmpeg-utils manual. Default
22453 and minimum resolution is <code>640x480</code>.
22454 </p>
22455 </dd>
22456 <dt> &lsquo;<samp>meter</samp>&rsquo;</dt>
22457 <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
22458 <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
22459 other integer value between this range is allowed.
22460 </p>
22461 </dd>
22462 <dt> &lsquo;<samp>metadata</samp>&rsquo;</dt>
22463 <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
22464 into 100ms output frames, each of them containing various loudness information
22465 in metadata.  All the metadata keys are prefixed with <code>lavfi.r128.</code>.
22466 </p>
22467 <p>Default is <code>0</code>.
22468 </p>
22469 </dd>
22470 <dt> &lsquo;<samp>framelog</samp>&rsquo;</dt>
22471 <dd><p>Force the frame logging level.
22472 </p>
22473 <p>Available values are:
22474 </p><dl compact="compact">
22475 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
22476 <dd><p>information logging level
22477 </p></dd>
22478 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
22479 <dd><p>verbose logging level
22480 </p></dd>
22481 </dl>
22482
22483 <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
22484 the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
22485 </p></dd>
22486 </dl>
22487
22488 <a name="Examples-92"></a>
22489 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-92">40.3.1 Examples</a></h3>
22490
22491 <ul>
22492 <li>
22493 Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
22494 <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;
22495 </pre></td></tr></table>
22496
22497 </li><li>
22498 Run an analysis with <code>ffmpeg</code>:
22499 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
22500 </pre></td></tr></table>
22501 </li></ul>
22502
22503 <a name="interleave_002c-ainterleave"></a>
22504 <h2 class="section"><a href="ffmpeg-all.html#toc-interleave_002c-ainterleave">40.4 interleave, ainterleave</a></h2>
22505
22506 <p>Temporally interleave frames from several inputs.
22507 </p>
22508 <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
22509 </p>
22510 <p>These filters read frames from several inputs and send the oldest
22511 queued frame to the output.
22512 </p>
22513 <p>Input streams must have a well defined, monotonically increasing frame
22514 timestamp values.
22515 </p>
22516 <p>In order to submit one frame to output, these filters need to enqueue
22517 at least one frame for each input, so they cannot work in case one
22518 input is not yet terminated and will not receive incoming frames.
22519 </p>
22520 <p>For example consider the case when one input is a <code>select</code> filter
22521 which always drop input frames. The <code>interleave</code> filter will keep
22522 reading from that input, but it will never be able to send new frames
22523 to output until the input will send an end-of-stream signal.
22524 </p>
22525 <p>Also, depending on inputs synchronization, the filters will drop
22526 frames in case one input receives more frames than the other ones, and
22527 the queue is already filled.
22528 </p>
22529 <p>These filters accept the following options:
22530 </p>
22531 <dl compact="compact">
22532 <dt> &lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
22533 <dd><p>Set the number of different inputs, it is 2 by default.
22534 </p></dd>
22535 </dl>
22536
22537 <a name="Examples-21"></a>
22538 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-21">40.4.1 Examples</a></h3>
22539
22540 <ul>
22541 <li>
22542 Interleave frames belonging to different streams using <code>ffmpeg</code>:
22543 <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
22544 </pre></td></tr></table>
22545
22546 </li><li>
22547 Add flickering blur effect:
22548 <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
22549 </pre></td></tr></table>
22550 </li></ul>
22551
22552 <a name="perms_002c-aperms"></a>
22553 <h2 class="section"><a href="ffmpeg-all.html#toc-perms_002c-aperms">40.5 perms, aperms</a></h2>
22554
22555 <p>Set read/write permissions for the output frames.
22556 </p>
22557 <p>These filters are mainly aimed at developers to test direct path in the
22558 following filter in the filtergraph.
22559 </p>
22560 <p>The filters accept the following options:
22561 </p>
22562 <dl compact="compact">
22563 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
22564 <dd><p>Select the permissions mode.
22565 </p>
22566 <p>It accepts the following values:
22567 </p><dl compact="compact">
22568 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
22569 <dd><p>Do nothing. This is the default.
22570 </p></dd>
22571 <dt> &lsquo;<samp>ro</samp>&rsquo;</dt>
22572 <dd><p>Set all the output frames read-only.
22573 </p></dd>
22574 <dt> &lsquo;<samp>rw</samp>&rsquo;</dt>
22575 <dd><p>Set all the output frames directly writable.
22576 </p></dd>
22577 <dt> &lsquo;<samp>toggle</samp>&rsquo;</dt>
22578 <dd><p>Make the frame read-only if writable, and writable if read-only.
22579 </p></dd>
22580 <dt> &lsquo;<samp>random</samp>&rsquo;</dt>
22581 <dd><p>Set each output frame read-only or writable randomly.
22582 </p></dd>
22583 </dl>
22584
22585 </dd>
22586 <dt> &lsquo;<samp>seed</samp>&rsquo;</dt>
22587 <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
22588 <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
22589 <code>-1</code>, the filter will try to use a good random seed on a best effort
22590 basis.
22591 </p></dd>
22592 </dl>
22593
22594 <p>Note: in case of auto-inserted filter between the permission filter and the
22595 following one, the permission might not be received as expected in that
22596 following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
22597 perms/aperms filter can avoid this problem.
22598 </p>
22599 <a name="select_002c-aselect"></a>
22600 <h2 class="section"><a href="ffmpeg-all.html#toc-select_002c-aselect">40.6 select, aselect</a></h2>
22601
22602 <p>Select frames to pass in output.
22603 </p>
22604 <p>This filter accepts the following options:
22605 </p>
22606 <dl compact="compact">
22607 <dt> &lsquo;<samp>expr, e</samp>&rsquo;</dt>
22608 <dd><p>Set expression, which is evaluated for each input frame.
22609 </p>
22610 <p>If the expression is evaluated to zero, the frame is discarded.
22611 </p>
22612 <p>If the evaluation result is negative or NaN, the frame is sent to the
22613 first output; otherwise it is sent to the output with index
22614 <code>ceil(val)-1</code>, assuming that the input index starts from 0.
22615 </p>
22616 <p>For example a value of <code>1.2</code> corresponds to the output with index
22617 <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
22618 </p>
22619 </dd>
22620 <dt> &lsquo;<samp>outputs, n</samp>&rsquo;</dt>
22621 <dd><p>Set the number of outputs. The output to which to send the selected
22622 frame is based on the result of the evaluation. Default value is 1.
22623 </p></dd>
22624 </dl>
22625
22626 <p>The expression can contain the following constants:
22627 </p>
22628 <dl compact="compact">
22629 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
22630 <dd><p>the sequential number of the filtered frame, starting from 0
22631 </p>
22632 </dd>
22633 <dt> &lsquo;<samp>selected_n</samp>&rsquo;</dt>
22634 <dd><p>the sequential number of the selected frame, starting from 0
22635 </p>
22636 </dd>
22637 <dt> &lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
22638 <dd><p>the sequential number of the last selected frame, NAN if undefined
22639 </p>
22640 </dd>
22641 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
22642 <dd><p>timebase of the input timestamps
22643 </p>
22644 </dd>
22645 <dt> &lsquo;<samp>pts</samp>&rsquo;</dt>
22646 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
22647 expressed in <var>TB</var> units, NAN if undefined
22648 </p>
22649 </dd>
22650 <dt> &lsquo;<samp>t</samp>&rsquo;</dt>
22651 <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
22652 expressed in seconds, NAN if undefined
22653 </p>
22654 </dd>
22655 <dt> &lsquo;<samp>prev_pts</samp>&rsquo;</dt>
22656 <dd><p>the PTS of the previously filtered video frame, NAN if undefined
22657 </p>
22658 </dd>
22659 <dt> &lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
22660 <dd><p>the PTS of the last previously filtered video frame, NAN if undefined
22661 </p>
22662 </dd>
22663 <dt> &lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
22664 <dd><p>the PTS of the last previously selected video frame, NAN if undefined
22665 </p>
22666 </dd>
22667 <dt> &lsquo;<samp>start_pts</samp>&rsquo;</dt>
22668 <dd><p>the PTS of the first video frame in the video, NAN if undefined
22669 </p>
22670 </dd>
22671 <dt> &lsquo;<samp>start_t</samp>&rsquo;</dt>
22672 <dd><p>the time of the first video frame in the video, NAN if undefined
22673 </p>
22674 </dd>
22675 <dt> &lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
22676 <dd><p>the type of the filtered frame, can assume one of the following
22677 values:
22678 </p><dl compact="compact">
22679 <dt> &lsquo;<samp>I</samp>&rsquo;</dt>
22680 <dt> &lsquo;<samp>P</samp>&rsquo;</dt>
22681 <dt> &lsquo;<samp>B</samp>&rsquo;</dt>
22682 <dt> &lsquo;<samp>S</samp>&rsquo;</dt>
22683 <dt> &lsquo;<samp>SI</samp>&rsquo;</dt>
22684 <dt> &lsquo;<samp>SP</samp>&rsquo;</dt>
22685 <dt> &lsquo;<samp>BI</samp>&rsquo;</dt>
22686 </dl>
22687
22688 </dd>
22689 <dt> &lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
22690 <dd><p>the frame interlace type, can assume one of the following values:
22691 </p><dl compact="compact">
22692 <dt> &lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
22693 <dd><p>the frame is progressive (not interlaced)
22694 </p></dd>
22695 <dt> &lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
22696 <dd><p>the frame is top-field-first
22697 </p></dd>
22698 <dt> &lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
22699 <dd><p>the frame is bottom-field-first
22700 </p></dd>
22701 </dl>
22702
22703 </dd>
22704 <dt> &lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
22705 <dd><p>the number of selected samples before the current frame
22706 </p>
22707 </dd>
22708 <dt> &lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
22709 <dd><p>the number of samples in the current frame
22710 </p>
22711 </dd>
22712 <dt> &lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
22713 <dd><p>the input sample rate
22714 </p>
22715 </dd>
22716 <dt> &lsquo;<samp>key</samp>&rsquo;</dt>
22717 <dd><p>1 if the filtered frame is a key-frame, 0 otherwise
22718 </p>
22719 </dd>
22720 <dt> &lsquo;<samp>pos</samp>&rsquo;</dt>
22721 <dd><p>the position in the file of the filtered frame, -1 if the information
22722 is not available (e.g. for synthetic video)
22723 </p>
22724 </dd>
22725 <dt> &lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</dt>
22726 <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
22727 probability for the current frame to introduce a new scene, while a higher
22728 value means the current frame is more likely to be one (see the example below)
22729 </p>
22730 </dd>
22731 </dl>
22732
22733 <p>The default value of the select expression is &quot;1&quot;.
22734 </p>
22735 <a name="Examples-19"></a>
22736 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-19">40.6.1 Examples</a></h3>
22737
22738 <ul>
22739 <li>
22740 Select all frames in input:
22741 <table><tr><td>&nbsp;</td><td><pre class="example">select
22742 </pre></td></tr></table>
22743
22744 <p>The example above is the same as:
22745 </p><table><tr><td>&nbsp;</td><td><pre class="example">select=1
22746 </pre></td></tr></table>
22747
22748 </li><li>
22749 Skip all frames:
22750 <table><tr><td>&nbsp;</td><td><pre class="example">select=0
22751 </pre></td></tr></table>
22752
22753 </li><li>
22754 Select only I-frames:
22755 <table><tr><td>&nbsp;</td><td><pre class="example">select='eq(pict_type\,I)'
22756 </pre></td></tr></table>
22757
22758 </li><li>
22759 Select one frame every 100:
22760 <table><tr><td>&nbsp;</td><td><pre class="example">select='not(mod(n\,100))'
22761 </pre></td></tr></table>
22762
22763 </li><li>
22764 Select only frames contained in the 10-20 time interval:
22765 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)
22766 </pre></td></tr></table>
22767
22768 </li><li>
22769 Select only I frames contained in the 10-20 time interval:
22770 <table><tr><td>&nbsp;</td><td><pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
22771 </pre></td></tr></table>
22772
22773 </li><li>
22774 Select frames with a minimum distance of 10 seconds:
22775 <table><tr><td>&nbsp;</td><td><pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
22776 </pre></td></tr></table>
22777
22778 </li><li>
22779 Use aselect to select only audio frames with samples number &gt; 100:
22780 <table><tr><td>&nbsp;</td><td><pre class="example">aselect='gt(samples_n\,100)'
22781 </pre></td></tr></table>
22782
22783 </li><li>
22784 Create a mosaic of the first scenes:
22785 <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
22786 </pre></td></tr></table>
22787
22788 <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
22789 choice.
22790 </p>
22791 </li><li>
22792 Send even and odd frames to separate outputs, and compose them:
22793 <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
22794 </pre></td></tr></table>
22795 </li></ul>
22796
22797 <a name="sendcmd_002c-asendcmd"></a>
22798 <h2 class="section"><a href="ffmpeg-all.html#toc-sendcmd_002c-asendcmd">40.7 sendcmd, asendcmd</a></h2>
22799
22800 <p>Send commands to filters in the filtergraph.
22801 </p>
22802 <p>These filters read commands to be sent to other filters in the
22803 filtergraph.
22804 </p>
22805 <p><code>sendcmd</code> must be inserted between two video filters,
22806 <code>asendcmd</code> must be inserted between two audio filters, but apart
22807 from that they act the same way.
22808 </p>
22809 <p>The specification of commands can be provided in the filter arguments
22810 with the <var>commands</var> option, or in a file specified by the
22811 <var>filename</var> option.
22812 </p>
22813 <p>These filters accept the following options:
22814 </p><dl compact="compact">
22815 <dt> &lsquo;<samp>commands, c</samp>&rsquo;</dt>
22816 <dd><p>Set the commands to be read and sent to the other filters.
22817 </p></dd>
22818 <dt> &lsquo;<samp>filename, f</samp>&rsquo;</dt>
22819 <dd><p>Set the filename of the commands to be read and sent to the other
22820 filters.
22821 </p></dd>
22822 </dl>
22823
22824 <a name="Commands-syntax"></a>
22825 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-syntax">40.7.1 Commands syntax</a></h3>
22826
22827 <p>A commands description consists of a sequence of interval
22828 specifications, comprising a list of commands to be executed when a
22829 particular event related to that interval occurs. The occurring event
22830 is typically the current frame time entering or leaving a given time
22831 interval.
22832 </p>
22833 <p>An interval is specified by the following syntax:
22834 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
22835 </pre></td></tr></table>
22836
22837 <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
22838 <var>END</var> is optional and defaults to the maximum time.
22839 </p>
22840 <p>The current frame time is considered within the specified interval if
22841 it is included in the interval [<var>START</var>, <var>END</var>), that is when
22842 the time is greater or equal to <var>START</var> and is lesser than
22843 <var>END</var>.
22844 </p>
22845 <p><var>COMMANDS</var> consists of a sequence of one or more command
22846 specifications, separated by &quot;,&quot;, relating to that interval.  The
22847 syntax of a command specification is given by:
22848 </p><table><tr><td>&nbsp;</td><td><pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
22849 </pre></td></tr></table>
22850
22851 <p><var>FLAGS</var> is optional and specifies the type of events relating to
22852 the time interval which enable sending the specified command, and must
22853 be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
22854 enclosed between &quot;[&quot; and &quot;]&quot;.
22855 </p>
22856 <p>The following flags are recognized:
22857 </p><dl compact="compact">
22858 <dt> &lsquo;<samp>enter</samp>&rsquo;</dt>
22859 <dd><p>The command is sent when the current frame timestamp enters the
22860 specified interval. In other words, the command is sent when the
22861 previous frame timestamp was not in the given interval, and the
22862 current is.
22863 </p>
22864 </dd>
22865 <dt> &lsquo;<samp>leave</samp>&rsquo;</dt>
22866 <dd><p>The command is sent when the current frame timestamp leaves the
22867 specified interval. In other words, the command is sent when the
22868 previous frame timestamp was in the given interval, and the
22869 current is not.
22870 </p></dd>
22871 </dl>
22872
22873 <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
22874 assumed.
22875 </p>
22876 <p><var>TARGET</var> specifies the target of the command, usually the name of
22877 the filter class or a specific filter instance name.
22878 </p>
22879 <p><var>COMMAND</var> specifies the name of the command for the target filter.
22880 </p>
22881 <p><var>ARG</var> is optional and specifies the optional list of argument for
22882 the given <var>COMMAND</var>.
22883 </p>
22884 <p>Between one interval specification and another, whitespaces, or
22885 sequences of characters starting with <code>#</code> until the end of line,
22886 are ignored and can be used to annotate comments.
22887 </p>
22888 <p>A simplified BNF description of the commands specification syntax
22889 follows:
22890 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>COMMAND_FLAG</var>  ::= &quot;enter&quot; | &quot;leave&quot;
22891 <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
22892 <var>COMMAND</var>       ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
22893 <var>COMMANDS</var>      ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
22894 <var>INTERVAL</var>      ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
22895 <var>INTERVALS</var>     ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
22896 </pre></td></tr></table>
22897
22898 <a name="Examples-59"></a>
22899 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-59">40.7.2 Examples</a></h3>
22900
22901 <ul>
22902 <li>
22903 Specify audio tempo change at second 4:
22904 <table><tr><td>&nbsp;</td><td><pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
22905 </pre></td></tr></table>
22906
22907 </li><li>
22908 Specify a list of drawtext and hue commands in a file.
22909 <table><tr><td>&nbsp;</td><td><pre class="example"># show text in the interval 5-10
22910 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
22911          [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
22912
22913 # desaturate the image in the interval 15-20
22914 15.0-20.0 [enter] hue s 0,
22915           [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
22916           [leave] hue s 1,
22917           [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
22918
22919 # apply an exponential saturation fade-out effect, starting from time 25
22920 25 [enter] hue s exp(25-t)
22921 </pre></td></tr></table>
22922
22923 <p>A filtergraph allowing to read and process the above command list
22924 stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
22925 </p><table><tr><td>&nbsp;</td><td><pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
22926 </pre></td></tr></table>
22927 </li></ul>
22928
22929 <p><a name="setpts"></a>
22930 </p><a name="setpts_002c-asetpts"></a>
22931 <h2 class="section"><a href="ffmpeg-all.html#toc-setpts_002c-asetpts">40.8 setpts, asetpts</a></h2>
22932
22933 <p>Change the PTS (presentation timestamp) of the input frames.
22934 </p>
22935 <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
22936 </p>
22937 <p>This filter accepts the following options:
22938 </p>
22939 <dl compact="compact">
22940 <dt> &lsquo;<samp>expr</samp>&rsquo;</dt>
22941 <dd><p>The expression which is evaluated for each frame to construct its timestamp.
22942 </p>
22943 </dd>
22944 </dl>
22945
22946 <p>The expression is evaluated through the eval API and can contain the following
22947 constants:
22948 </p>
22949 <dl compact="compact">
22950 <dt> &lsquo;<samp>FRAME_RATE</samp>&rsquo;</dt>
22951 <dd><p>frame rate, only defined for constant frame-rate video
22952 </p>
22953 </dd>
22954 <dt> &lsquo;<samp>PTS</samp>&rsquo;</dt>
22955 <dd><p>the presentation timestamp in input
22956 </p>
22957 </dd>
22958 <dt> &lsquo;<samp>N</samp>&rsquo;</dt>
22959 <dd><p>the count of the input frame for video or the number of consumed samples,
22960 not including the current frame for audio, starting from 0.
22961 </p>
22962 </dd>
22963 <dt> &lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
22964 <dd><p>the number of consumed samples, not including the current frame (only
22965 audio)
22966 </p>
22967 </dd>
22968 <dt> &lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
22969 <dd><p>the number of samples in the current frame (only audio)
22970 </p>
22971 </dd>
22972 <dt> &lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
22973 <dd><p>audio sample rate
22974 </p>
22975 </dd>
22976 <dt> &lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
22977 <dd><p>the PTS of the first frame
22978 </p>
22979 </dd>
22980 <dt> &lsquo;<samp>STARTT</samp>&rsquo;</dt>
22981 <dd><p>the time in seconds of the first frame
22982 </p>
22983 </dd>
22984 <dt> &lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
22985 <dd><p>tell if the current frame is interlaced
22986 </p>
22987 </dd>
22988 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
22989 <dd><p>the time in seconds of the current frame
22990 </p>
22991 </dd>
22992 <dt> &lsquo;<samp>POS</samp>&rsquo;</dt>
22993 <dd><p>original position in the file of the frame, or undefined if undefined
22994 for the current frame
22995 </p>
22996 </dd>
22997 <dt> &lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
22998 <dd><p>previous input PTS
22999 </p>
23000 </dd>
23001 <dt> &lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
23002 <dd><p>previous input time in seconds
23003 </p>
23004 </dd>
23005 <dt> &lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
23006 <dd><p>previous output PTS
23007 </p>
23008 </dd>
23009 <dt> &lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
23010 <dd><p>previous output time in seconds
23011 </p>
23012 </dd>
23013 <dt> &lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
23014 <dd><p>wallclock (RTC) time in microseconds. This is deprecated, use time(0)
23015 instead.
23016 </p>
23017 </dd>
23018 <dt> &lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
23019 <dd><p>wallclock (RTC) time at the start of the movie in microseconds
23020 </p>
23021 </dd>
23022 <dt> &lsquo;<samp>TB</samp>&rsquo;</dt>
23023 <dd><p>timebase of the input timestamps
23024 </p>
23025 </dd>
23026 </dl>
23027
23028 <a name="Examples-47"></a>
23029 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-47">40.8.1 Examples</a></h3>
23030
23031 <ul>
23032 <li>
23033 Start counting PTS from zero
23034 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS-STARTPTS
23035 </pre></td></tr></table>
23036
23037 </li><li>
23038 Apply fast motion effect:
23039 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=0.5*PTS
23040 </pre></td></tr></table>
23041
23042 </li><li>
23043 Apply slow motion effect:
23044 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=2.0*PTS
23045 </pre></td></tr></table>
23046
23047 </li><li>
23048 Set fixed rate of 25 frames per second:
23049 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=N/(25*TB)
23050 </pre></td></tr></table>
23051
23052 </li><li>
23053 Set fixed rate 25 fps with some jitter:
23054 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
23055 </pre></td></tr></table>
23056
23057 </li><li>
23058 Apply an offset of 10 seconds to the input PTS:
23059 <table><tr><td>&nbsp;</td><td><pre class="example">setpts=PTS+10/TB
23060 </pre></td></tr></table>
23061
23062 </li><li>
23063 Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
23064 <table><tr><td>&nbsp;</td><td><pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
23065 </pre></td></tr></table>
23066
23067 </li><li>
23068 Generate timestamps by counting samples:
23069 <table><tr><td>&nbsp;</td><td><pre class="example">asetpts=N/SR/TB
23070 </pre></td></tr></table>
23071
23072 </li></ul>
23073
23074 <a name="settb_002c-asettb"></a>
23075 <h2 class="section"><a href="ffmpeg-all.html#toc-settb_002c-asettb">40.9 settb, asettb</a></h2>
23076
23077 <p>Set the timebase to use for the output frames timestamps.
23078 It is mainly useful for testing timebase configuration.
23079 </p>
23080 <p>This filter accepts the following options:
23081 </p>
23082 <dl compact="compact">
23083 <dt> &lsquo;<samp>expr, tb</samp>&rsquo;</dt>
23084 <dd><p>The expression which is evaluated into the output timebase.
23085 </p>
23086 </dd>
23087 </dl>
23088
23089 <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
23090 rational. The expression can contain the constants &quot;AVTB&quot; (the default
23091 timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
23092 audio only). Default value is &quot;intb&quot;.
23093 </p>
23094 <a name="Examples-65"></a>
23095 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-65">40.9.1 Examples</a></h3>
23096
23097 <ul>
23098 <li>
23099 Set the timebase to 1/25:
23100 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=1/25
23101 </pre></td></tr></table>
23102
23103 </li><li>
23104 Set the timebase to 1/10:
23105 <table><tr><td>&nbsp;</td><td><pre class="example">settb=expr=0.1
23106 </pre></td></tr></table>
23107
23108 </li><li>
23109 Set the timebase to 1001/1000:
23110 <table><tr><td>&nbsp;</td><td><pre class="example">settb=1+0.001
23111 </pre></td></tr></table>
23112
23113 </li><li>
23114 Set the timebase to 2*intb:
23115 <table><tr><td>&nbsp;</td><td><pre class="example">settb=2*intb
23116 </pre></td></tr></table>
23117
23118 </li><li>
23119 Set the default timebase value:
23120 <table><tr><td>&nbsp;</td><td><pre class="example">settb=AVTB
23121 </pre></td></tr></table>
23122 </li></ul>
23123
23124 <a name="showspectrum"></a>
23125 <h2 class="section"><a href="ffmpeg-all.html#toc-showspectrum">40.10 showspectrum</a></h2>
23126
23127 <p>Convert input audio to a video output, representing the audio frequency
23128 spectrum.
23129 </p>
23130 <p>The filter accepts the following options:
23131 </p>
23132 <dl compact="compact">
23133 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
23134 <dd><p>Specify the video size for the output. For the syntax of this option, check
23135 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value is
23136 <code>640x512</code>.
23137 </p>
23138 </dd>
23139 <dt> &lsquo;<samp>slide</samp>&rsquo;</dt>
23140 <dd><p>Specify if the spectrum should slide along the window. Default value is
23141 <code>0</code>.
23142 </p>
23143 </dd>
23144 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
23145 <dd><p>Specify display mode.
23146 </p>
23147 <p>It accepts the following values:
23148 </p><dl compact="compact">
23149 <dt> &lsquo;<samp>combined</samp>&rsquo;</dt>
23150 <dd><p>all channels are displayed in the same row
23151 </p></dd>
23152 <dt> &lsquo;<samp>separate</samp>&rsquo;</dt>
23153 <dd><p>all channels are displayed in separate rows
23154 </p></dd>
23155 </dl>
23156
23157 <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
23158 </p>
23159 </dd>
23160 <dt> &lsquo;<samp>color</samp>&rsquo;</dt>
23161 <dd><p>Specify display color mode.
23162 </p>
23163 <p>It accepts the following values:
23164 </p><dl compact="compact">
23165 <dt> &lsquo;<samp>channel</samp>&rsquo;</dt>
23166 <dd><p>each channel is displayed in a separate color
23167 </p></dd>
23168 <dt> &lsquo;<samp>intensity</samp>&rsquo;</dt>
23169 <dd><p>each channel is is displayed using the same color scheme
23170 </p></dd>
23171 </dl>
23172
23173 <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
23174 </p>
23175 </dd>
23176 <dt> &lsquo;<samp>scale</samp>&rsquo;</dt>
23177 <dd><p>Specify scale used for calculating intensity color values.
23178 </p>
23179 <p>It accepts the following values:
23180 </p><dl compact="compact">
23181 <dt> &lsquo;<samp>lin</samp>&rsquo;</dt>
23182 <dd><p>linear
23183 </p></dd>
23184 <dt> &lsquo;<samp>sqrt</samp>&rsquo;</dt>
23185 <dd><p>square root, default
23186 </p></dd>
23187 <dt> &lsquo;<samp>cbrt</samp>&rsquo;</dt>
23188 <dd><p>cubic root
23189 </p></dd>
23190 <dt> &lsquo;<samp>log</samp>&rsquo;</dt>
23191 <dd><p>logarithmic
23192 </p></dd>
23193 </dl>
23194
23195 <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
23196 </p>
23197 </dd>
23198 <dt> &lsquo;<samp>saturation</samp>&rsquo;</dt>
23199 <dd><p>Set saturation modifier for displayed colors. Negative values provide
23200 alternative color scheme. <code>0</code> is no saturation at all.
23201 Saturation must be in [-10.0, 10.0] range.
23202 Default value is <code>1</code>.
23203 </p>
23204 </dd>
23205 <dt> &lsquo;<samp>win_func</samp>&rsquo;</dt>
23206 <dd><p>Set window function.
23207 </p>
23208 <p>It accepts the following values:
23209 </p><dl compact="compact">
23210 <dt> &lsquo;<samp>none</samp>&rsquo;</dt>
23211 <dd><p>No samples pre-processing (do not expect this to be faster)
23212 </p></dd>
23213 <dt> &lsquo;<samp>hann</samp>&rsquo;</dt>
23214 <dd><p>Hann window
23215 </p></dd>
23216 <dt> &lsquo;<samp>hamming</samp>&rsquo;</dt>
23217 <dd><p>Hamming window
23218 </p></dd>
23219 <dt> &lsquo;<samp>blackman</samp>&rsquo;</dt>
23220 <dd><p>Blackman window
23221 </p></dd>
23222 </dl>
23223
23224 <p>Default value is <code>hann</code>.
23225 </p></dd>
23226 </dl>
23227
23228 <p>The usage is very similar to the showwaves filter; see the examples in that
23229 section.
23230 </p>
23231 <a name="Examples-88"></a>
23232 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-88">40.10.1 Examples</a></h3>
23233
23234 <ul>
23235 <li>
23236 Large window with logarithmic color scaling:
23237 <table><tr><td>&nbsp;</td><td><pre class="example">showspectrum=s=1280x480:scale=log
23238 </pre></td></tr></table>
23239
23240 </li><li>
23241 Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
23242 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
23243              [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
23244 </pre></td></tr></table>
23245 </li></ul>
23246
23247 <a name="showwaves"></a>
23248 <h2 class="section"><a href="ffmpeg-all.html#toc-showwaves">40.11 showwaves</a></h2>
23249
23250 <p>Convert input audio to a video output, representing the samples waves.
23251 </p>
23252 <p>The filter accepts the following options:
23253 </p>
23254 <dl compact="compact">
23255 <dt> &lsquo;<samp>size, s</samp>&rsquo;</dt>
23256 <dd><p>Specify the video size for the output. For the syntax of this option, check
23257 the &quot;Video size&quot; section in the ffmpeg-utils manual. Default value
23258 is &quot;600x240&quot;.
23259 </p>
23260 </dd>
23261 <dt> &lsquo;<samp>mode</samp>&rsquo;</dt>
23262 <dd><p>Set display mode.
23263 </p>
23264 <p>Available values are:
23265 </p><dl compact="compact">
23266 <dt> &lsquo;<samp>point</samp>&rsquo;</dt>
23267 <dd><p>Draw a point for each sample.
23268 </p>
23269 </dd>
23270 <dt> &lsquo;<samp>line</samp>&rsquo;</dt>
23271 <dd><p>Draw a vertical line for each sample.
23272 </p></dd>
23273 </dl>
23274
23275 <p>Default value is <code>point</code>.
23276 </p>
23277 </dd>
23278 <dt> &lsquo;<samp>n</samp>&rsquo;</dt>
23279 <dd><p>Set the number of samples which are printed on the same column. A
23280 larger value will decrease the frame rate. Must be a positive
23281 integer. This option can be set only if the value for <var>rate</var>
23282 is not explicitly specified.
23283 </p>
23284 </dd>
23285 <dt> &lsquo;<samp>rate, r</samp>&rsquo;</dt>
23286 <dd><p>Set the (approximate) output frame rate. This is done by setting the
23287 option <var>n</var>. Default value is &quot;25&quot;.
23288 </p>
23289 </dd>
23290 </dl>
23291
23292 <a name="Examples-36"></a>
23293 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-36">40.11.1 Examples</a></h3>
23294
23295 <ul>
23296 <li>
23297 Output the input file audio and the corresponding video representation
23298 at the same time:
23299 <table><tr><td>&nbsp;</td><td><pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
23300 </pre></td></tr></table>
23301
23302 </li><li>
23303 Create a synthetic signal and show it with showwaves, forcing a
23304 frame rate of 30 frames per second:
23305 <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]
23306 </pre></td></tr></table>
23307 </li></ul>
23308
23309 <a name="split_002c-asplit"></a>
23310 <h2 class="section"><a href="ffmpeg-all.html#toc-split_002c-asplit">40.12 split, asplit</a></h2>
23311
23312 <p>Split input into several identical outputs.
23313 </p>
23314 <p><code>asplit</code> works with audio input, <code>split</code> with video.
23315 </p>
23316 <p>The filter accepts a single parameter which specifies the number of outputs. If
23317 unspecified, it defaults to 2.
23318 </p>
23319 <a name="Examples-1"></a>
23320 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-1">40.12.1 Examples</a></h3>
23321
23322 <ul>
23323 <li>
23324 Create two separate outputs from the same input:
23325 <table><tr><td>&nbsp;</td><td><pre class="example">[in] split [out0][out1]
23326 </pre></td></tr></table>
23327
23328 </li><li>
23329 To create 3 or more outputs, you need to specify the number of
23330 outputs, like in:
23331 <table><tr><td>&nbsp;</td><td><pre class="example">[in] asplit=3 [out0][out1][out2]
23332 </pre></td></tr></table>
23333
23334 </li><li>
23335 Create two separate outputs from the same input, one cropped and
23336 one padded:
23337 <table><tr><td>&nbsp;</td><td><pre class="example">[in] split [splitout1][splitout2];
23338 [splitout1] crop=100:100:0:0    [cropout];
23339 [splitout2] pad=200:200:100:100 [padout];
23340 </pre></td></tr></table>
23341
23342 </li><li>
23343 Create 5 copies of the input audio with <code>ffmpeg</code>:
23344 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
23345 </pre></td></tr></table>
23346 </li></ul>
23347
23348 <a name="zmq_002c-azmq"></a>
23349 <h2 class="section"><a href="ffmpeg-all.html#toc-zmq_002c-azmq">40.13 zmq, azmq</a></h2>
23350
23351 <p>Receive commands sent through a libzmq client, and forward them to
23352 filters in the filtergraph.
23353 </p>
23354 <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
23355 must be inserted between two video filters, <code>azmq</code> between two
23356 audio filters.
23357 </p>
23358 <p>To enable these filters you need to install the libzmq library and
23359 headers and configure FFmpeg with <code>--enable-libzmq</code>.
23360 </p>
23361 <p>For more information about libzmq see:
23362 <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
23363 </p>
23364 <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
23365 receives messages sent through a network interface defined by the
23366 &lsquo;<samp>bind_address</samp>&rsquo; option.
23367 </p>
23368 <p>The received message must be in the form:
23369 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
23370 </pre></td></tr></table>
23371
23372 <p><var>TARGET</var> specifies the target of the command, usually the name of
23373 the filter class or a specific filter instance name.
23374 </p>
23375 <p><var>COMMAND</var> specifies the name of the command for the target filter.
23376 </p>
23377 <p><var>ARG</var> is optional and specifies the optional argument list for the
23378 given <var>COMMAND</var>.
23379 </p>
23380 <p>Upon reception, the message is processed and the corresponding command
23381 is injected into the filtergraph. Depending on the result, the filter
23382 will send a reply to the client, adopting the format:
23383 </p><table><tr><td>&nbsp;</td><td><pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
23384 <var>MESSAGE</var>
23385 </pre></td></tr></table>
23386
23387 <p><var>MESSAGE</var> is optional.
23388 </p>
23389 <a name="Examples-64"></a>
23390 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-64">40.13.1 Examples</a></h3>
23391
23392 <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
23393 be used to send commands processed by these filters.
23394 </p>
23395 <p>Consider the following filtergraph generated by <code>ffplay</code>
23396 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
23397 color=s=100x100:c=red  [l];
23398 color=s=100x100:c=blue [r];
23399 nullsrc=s=200x100, zmq [bg];
23400 [bg][l]   overlay      [bg+l];
23401 [bg+l][r] overlay=x=100 &quot;
23402 </pre></td></tr></table>
23403
23404 <p>To change the color of the left side of the video, the following
23405 command can be used:
23406 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
23407 </pre></td></tr></table>
23408
23409 <p>To change the right side:
23410 </p><table><tr><td>&nbsp;</td><td><pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
23411 </pre></td></tr></table>
23412
23413
23414 <a name="Multimedia-Sources"></a>
23415 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Sources">41. Multimedia Sources</a></h1>
23416
23417 <p>Below is a description of the currently available multimedia sources.
23418 </p>
23419 <a name="amovie"></a>
23420 <h2 class="section"><a href="ffmpeg-all.html#toc-amovie">41.1 amovie</a></h2>
23421
23422 <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
23423 stream by default.
23424 </p>
23425 <p><a name="movie"></a>
23426 </p><a name="movie-1"></a>
23427 <h2 class="section"><a href="ffmpeg-all.html#toc-movie-1">41.2 movie</a></h2>
23428
23429 <p>Read audio and/or video stream(s) from a movie container.
23430 </p>
23431 <p>This filter accepts the following options:
23432 </p>
23433 <dl compact="compact">
23434 <dt> &lsquo;<samp>filename</samp>&rsquo;</dt>
23435 <dd><p>The name of the resource to read (not necessarily a file but also a device or a
23436 stream accessed through some protocol).
23437 </p>
23438 </dd>
23439 <dt> &lsquo;<samp>format_name, f</samp>&rsquo;</dt>
23440 <dd><p>Specifies the format assumed for the movie to read, and can be either
23441 the name of a container or an input device. If not specified the
23442 format is guessed from <var>movie_name</var> or by probing.
23443 </p>
23444 </dd>
23445 <dt> &lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
23446 <dd><p>Specifies the seek point in seconds, the frames will be output
23447 starting from this seek point, the parameter is evaluated with
23448 <code>av_strtod</code> so the numerical value may be suffixed by an IS
23449 postfix. Default value is &quot;0&quot;.
23450 </p>
23451 </dd>
23452 <dt> &lsquo;<samp>streams, s</samp>&rsquo;</dt>
23453 <dd><p>Specifies the streams to read. Several streams can be specified,
23454 separated by &quot;+&quot;. The source will then have as many outputs, in the
23455 same order. The syntax is explained in the &ldquo;Stream specifiers&rdquo;
23456 section in the ffmpeg manual. Two special names, &quot;dv&quot; and &quot;da&quot; specify
23457 respectively the default (best suited) video and audio stream. Default
23458 is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
23459 </p>
23460 </dd>
23461 <dt> &lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
23462 <dd><p>Specifies the index of the video stream to read. If the value is -1,
23463 the best suited video stream will be automatically selected. Default
23464 value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
23465 audio instead of video.
23466 </p>
23467 </dd>
23468 <dt> &lsquo;<samp>loop</samp>&rsquo;</dt>
23469 <dd><p>Specifies how many times to read the stream in sequence.
23470 If the value is less than 1, the stream will be read again and again.
23471 Default value is &quot;1&quot;.
23472 </p>
23473 <p>Note that when the movie is looped the source timestamps are not
23474 changed, so it will generate non monotonically increasing timestamps.
23475 </p></dd>
23476 </dl>
23477
23478 <p>This filter allows to overlay a second video on top of main input of
23479 a filtergraph as shown in this graph:
23480 </p><table><tr><td>&nbsp;</td><td><pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
23481                                     ^
23482                                     |
23483 movie --&gt; scale--&gt; deltapts1 -------+
23484 </pre></td></tr></table>
23485
23486 <a name="Examples-60"></a>
23487 <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-60">41.2.1 Examples</a></h3>
23488
23489 <ul>
23490 <li>
23491 Skip 3.2 seconds from the start of the avi file in.avi, and overlay it
23492 on top of the input labelled as &quot;in&quot;:
23493 <table><tr><td>&nbsp;</td><td><pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
23494 [in] setpts=PTS-STARTPTS [main];
23495 [main][over] overlay=16:16 [out]
23496 </pre></td></tr></table>
23497
23498 </li><li>
23499 Read from a video4linux2 device, and overlay it on top of the input
23500 labelled as &quot;in&quot;:
23501 <table><tr><td>&nbsp;</td><td><pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
23502 [in] setpts=PTS-STARTPTS [main];
23503 [main][over] overlay=16:16 [out]
23504 </pre></td></tr></table>
23505
23506 </li><li>
23507 Read the first video stream and the audio stream with id 0x81 from
23508 dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
23509 connected to the pad named &quot;audio&quot;:
23510 <table><tr><td>&nbsp;</td><td><pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
23511 </pre></td></tr></table>
23512 </li></ul>
23513
23514
23515 <a name="See-Also"></a>
23516 <h1 class="chapter"><a href="ffmpeg-all.html#toc-See-Also">42. See Also</a></h1>
23517
23518 <p><a href="ffmpeg.html">ffmpeg</a>
23519 <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
23520 <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
23521 <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
23522 <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
23523 <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
23524 <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
23525 <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
23526 <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
23527 <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
23528 <a href="ffmpeg-filters.html">ffmpeg-filters</a>
23529 </p>
23530
23531 <a name="Authors"></a>
23532 <h1 class="chapter"><a href="ffmpeg-all.html#toc-Authors">43. Authors</a></h1>
23533
23534 <p>The FFmpeg developers.
23535 </p>
23536 <p>For details about the authorship, see the Git history of the project
23537 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
23538 <code>git log</code> in the FFmpeg source directory, or browsing the
23539 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
23540 </p>
23541 <p>Maintainers for the specific components are listed in the file
23542 &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
23543 </p>
23544
23545 <footer class="footer pagination-right">
23546 <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>