]> git.sesse.net Git - casparcg/blob - ffmpeg 0.7/doc/ffprobe.html
Added ffmpeg 0.7 RC
[casparcg] / ffmpeg 0.7 / doc / ffprobe.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Created on May 18, 2011 by texi2html 1.82
4 texi2html was written by: 
5             Lionel Cons <Lionel.Cons@cern.ch> (original author)
6             Karl Berry  <karl@freefriends.org>
7             Olaf Bachmann <obachman@mathematik.uni-kl.de>
8             and many others.
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
11 -->
12 <head>
13 <title>ffprobe Documentation</title>
14
15 <meta name="description" content="ffprobe Documentation">
16 <meta name="keywords" content="ffprobe Documentation">
17 <meta name="resource-type" content="document">
18 <meta name="distribution" content="global">
19 <meta name="Generator" content="texi2html 1.82">
20 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
21 <style type="text/css">
22 <!--
23 a.summary-letter {text-decoration: none}
24 blockquote.smallquotation {font-size: smaller}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
36 -->
37 </style>
38
39
40 </head>
41
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
44 <a name="SEC_Top"></a>
45 <h1 class="settitle">ffprobe Documentation</h1>
46
47 <a name="SEC_Contents"></a>
48 <h1>Table of Contents</h1>
49 <div class="contents">
50
51 <ul class="toc">
52   <li><a name="toc-Synopsis" href="#Synopsis">1. Synopsis</a></li>
53   <li><a name="toc-Description" href="#Description">2. Description</a></li>
54   <li><a name="toc-Options" href="#Options">3. Options</a>
55   <ul class="toc">
56     <li><a name="toc-Generic-options" href="#Generic-options">3.1 Generic options</a></li>
57     <li><a name="toc-Main-options" href="#Main-options">3.2 Main options</a></li>
58   </ul></li>
59   <li><a name="toc-Demuxers" href="#Demuxers">4. Demuxers</a>
60   <ul class="toc">
61     <li><a name="toc-image2" href="#image2">4.1 image2</a></li>
62     <li><a name="toc-applehttp-1" href="#applehttp-1">4.2 applehttp</a></li>
63   </ul></li>
64   <li><a name="toc-Muxers" href="#Muxers">5. Muxers</a>
65   <ul class="toc">
66     <li><a name="toc-crc-1" href="#crc-1">5.1 crc</a></li>
67     <li><a name="toc-framecrc-1" href="#framecrc-1">5.2 framecrc</a></li>
68     <li><a name="toc-image2-1" href="#image2-1">5.3 image2</a></li>
69     <li><a name="toc-mpegts" href="#mpegts">5.4 mpegts</a></li>
70     <li><a name="toc-null" href="#null">5.5 null</a></li>
71   </ul></li>
72   <li><a name="toc-Protocols" href="#Protocols">6. Protocols</a>
73   <ul class="toc">
74     <li><a name="toc-applehttp" href="#applehttp">6.1 applehttp</a></li>
75     <li><a name="toc-concat" href="#concat">6.2 concat</a></li>
76     <li><a name="toc-file" href="#file">6.3 file</a></li>
77     <li><a name="toc-gopher" href="#gopher">6.4 gopher</a></li>
78     <li><a name="toc-http" href="#http">6.5 http</a></li>
79     <li><a name="toc-mmst" href="#mmst">6.6 mmst</a></li>
80     <li><a name="toc-mmsh" href="#mmsh">6.7 mmsh</a></li>
81     <li><a name="toc-md5" href="#md5">6.8 md5</a></li>
82     <li><a name="toc-pipe" href="#pipe">6.9 pipe</a></li>
83     <li><a name="toc-rtmp" href="#rtmp">6.10 rtmp</a></li>
84     <li><a name="toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">6.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
85     <li><a name="toc-rtp" href="#rtp">6.12 rtp</a></li>
86     <li><a name="toc-rtsp" href="#rtsp">6.13 rtsp</a></li>
87     <li><a name="toc-sap" href="#sap">6.14 sap</a>
88     <ul class="toc">
89       <li><a name="toc-Muxer" href="#Muxer">6.14.1 Muxer</a></li>
90       <li><a name="toc-Demuxer" href="#Demuxer">6.14.2 Demuxer</a></li>
91     </ul></li>
92     <li><a name="toc-tcp" href="#tcp">6.15 tcp</a></li>
93     <li><a name="toc-udp" href="#udp">6.16 udp</a></li>
94   </ul></li>
95   <li><a name="toc-Input-Devices" href="#Input-Devices">7. Input Devices</a>
96   <ul class="toc">
97     <li><a name="toc-alsa" href="#alsa">7.1 alsa</a></li>
98     <li><a name="toc-bktr" href="#bktr">7.2 bktr</a></li>
99     <li><a name="toc-dv1394" href="#dv1394">7.3 dv1394</a></li>
100     <li><a name="toc-fbdev" href="#fbdev">7.4 fbdev</a></li>
101     <li><a name="toc-jack" href="#jack">7.5 jack</a></li>
102     <li><a name="toc-libdc1394" href="#libdc1394">7.6 libdc1394</a></li>
103     <li><a name="toc-oss" href="#oss">7.7 oss</a></li>
104     <li><a name="toc-sndio" href="#sndio">7.8 sndio</a></li>
105     <li><a name="toc-video4linux-and-video4linux2" href="#video4linux-and-video4linux2">7.9 video4linux and video4linux2</a></li>
106     <li><a name="toc-vfwcap" href="#vfwcap">7.10 vfwcap</a></li>
107     <li><a name="toc-x11grab" href="#x11grab">7.11 x11grab</a></li>
108   </ul>
109 </li>
110 </ul>
111 </div>
112
113 <hr size="1">
114 <a name="Synopsis"></a>
115 <h1 class="chapter"><a href="ffprobe.html#toc-Synopsis">1. Synopsis</a></h1>
116
117 <p>The generic syntax is:
118 </p>
119 <table><tr><td>&nbsp;</td><td><pre class="example">ffprobe [options] [&lsquo;<tt>input_file</tt>&rsquo;]
120 </pre></td></tr></table>
121
122 <a name="Description"></a>
123 <h1 class="chapter"><a href="ffprobe.html#toc-Description">2. Description</a></h1>
124
125 <p>ffprobe gathers information from multimedia streams and prints it in
126 human- and machine-readable fashion.
127 </p>
128 <p>For example it can be used to check the format of the container used
129 by a multimedia stream and the format and type of each media stream
130 contained in it.
131 </p>
132 <p>If a filename is specified in input, ffprobe will try to open and
133 probe the file content. If the file cannot be opened or recognized as
134 a multimedia file, a positive exit code is returned.
135 </p>
136 <p>ffprobe may be employed both as a standalone application or in
137 combination with a textual filter, which may perform more
138 sophisticated processing, e.g. statistical processing or plotting.
139 </p>
140 <p>Options are used to list some of the formats supported by ffprobe or
141 for specifying which information to display, and for setting how
142 ffprobe will show it.
143 </p>
144 <p>ffprobe output is designed to be easily parsable by a textual filter,
145 and consists of one or more sections of the form:
146 </p><table><tr><td>&nbsp;</td><td><pre class="example">[SECTION]
147 key1=val1
148 ...
149 keyN=valN
150 [/SECTION]
151 </pre></td></tr></table>
152
153 <p>Metadata tags stored in the container or in the streams are recognized
154 and printed in the corresponding &quot;FORMAT&quot; or &quot;STREAM&quot; section, and
155 are prefixed by the string &quot;TAG:&quot;.
156 </p>
157
158 <a name="Options"></a>
159 <h1 class="chapter"><a href="ffprobe.html#toc-Options">3. Options</a></h1>
160
161 <p>All the numerical options, if not specified otherwise, accept in input
162 a string representing a number, which may contain one of the
163 International System number postfixes, for example &rsquo;K&rsquo;, &rsquo;M&rsquo;, &rsquo;G&rsquo;.
164 If &rsquo;i&rsquo; is appended after the postfix, powers of 2 are used instead of
165 powers of 10. The &rsquo;B&rsquo; postfix multiplies the value for 8, and can be
166 appended after another postfix or used alone. This allows using for
167 example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as postfix.
168 </p>
169 <p>Options which do not take arguments are boolean options, and set the
170 corresponding value to true. They can be set to false by prefixing
171 with &quot;no&quot; the option name, for example using &quot;-nofoo&quot; in the
172 commandline will set to false the boolean option with name &quot;foo&quot;.
173 </p>
174 <a name="Generic-options"></a>
175 <h2 class="section"><a href="ffprobe.html#toc-Generic-options">3.1 Generic options</a></h2>
176
177 <p>These options are shared amongst the ff* tools.
178 </p>
179 <dl compact="compact">
180 <dt> &lsquo;<samp>-L</samp>&rsquo;</dt>
181 <dd><p>Show license.
182 </p>
183 </dd>
184 <dt> &lsquo;<samp>-h, -?, -help, --help</samp>&rsquo;</dt>
185 <dd><p>Show help.
186 </p>
187 </dd>
188 <dt> &lsquo;<samp>-version</samp>&rsquo;</dt>
189 <dd><p>Show version.
190 </p>
191 </dd>
192 <dt> &lsquo;<samp>-formats</samp>&rsquo;</dt>
193 <dd><p>Show available formats.
194 </p>
195 <p>The fields preceding the format names have the following meanings:
196 </p><dl compact="compact">
197 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
198 <dd><p>Decoding available
199 </p></dd>
200 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
201 <dd><p>Encoding available
202 </p></dd>
203 </dl>
204
205 </dd>
206 <dt> &lsquo;<samp>-codecs</samp>&rsquo;</dt>
207 <dd><p>Show available codecs.
208 </p>
209 <p>The fields preceding the codec names have the following meanings:
210 </p><dl compact="compact">
211 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
212 <dd><p>Decoding available
213 </p></dd>
214 <dt> &lsquo;<samp>E</samp>&rsquo;</dt>
215 <dd><p>Encoding available
216 </p></dd>
217 <dt> &lsquo;<samp>V/A/S</samp>&rsquo;</dt>
218 <dd><p>Video/audio/subtitle codec
219 </p></dd>
220 <dt> &lsquo;<samp>S</samp>&rsquo;</dt>
221 <dd><p>Codec supports slices
222 </p></dd>
223 <dt> &lsquo;<samp>D</samp>&rsquo;</dt>
224 <dd><p>Codec supports direct rendering
225 </p></dd>
226 <dt> &lsquo;<samp>T</samp>&rsquo;</dt>
227 <dd><p>Codec can handle input truncated at random locations instead of only at frame boundaries
228 </p></dd>
229 </dl>
230
231 </dd>
232 <dt> &lsquo;<samp>-bsfs</samp>&rsquo;</dt>
233 <dd><p>Show available bitstream filters.
234 </p>
235 </dd>
236 <dt> &lsquo;<samp>-protocols</samp>&rsquo;</dt>
237 <dd><p>Show available protocols.
238 </p>
239 </dd>
240 <dt> &lsquo;<samp>-filters</samp>&rsquo;</dt>
241 <dd><p>Show available libavfilter filters.
242 </p>
243 </dd>
244 <dt> &lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
245 <dd><p>Show available pixel formats.
246 </p>
247 </dd>
248 <dt> &lsquo;<samp>-loglevel <var>loglevel</var></samp>&rsquo;</dt>
249 <dd><p>Set the logging level used by the library.
250 <var>loglevel</var> is a number or a string containing one of the following values:
251 </p><dl compact="compact">
252 <dt> &lsquo;<samp>quiet</samp>&rsquo;</dt>
253 <dt> &lsquo;<samp>panic</samp>&rsquo;</dt>
254 <dt> &lsquo;<samp>fatal</samp>&rsquo;</dt>
255 <dt> &lsquo;<samp>error</samp>&rsquo;</dt>
256 <dt> &lsquo;<samp>warning</samp>&rsquo;</dt>
257 <dt> &lsquo;<samp>info</samp>&rsquo;</dt>
258 <dt> &lsquo;<samp>verbose</samp>&rsquo;</dt>
259 <dt> &lsquo;<samp>debug</samp>&rsquo;</dt>
260 </dl>
261
262 <p>By default the program logs to stderr, if coloring is supported by the
263 terminal, colors are used to mark errors and warnings. Log coloring
264 can be disabled setting the environment variable
265 <code>FFMPEG_FORCE_NOCOLOR</code> or <code>NO_COLOR</code>, or can be forced setting
266 the environment variable <code>FFMPEG_FORCE_COLOR</code>.
267 The use of the environment variable <code>NO_COLOR</code> is deprecated and
268 will be dropped in a following FFmpeg version.
269 </p>
270 </dd>
271 </dl>
272
273 <a name="Main-options"></a>
274 <h2 class="section"><a href="ffprobe.html#toc-Main-options">3.2 Main options</a></h2>
275
276 <dl compact="compact">
277 <dt> &lsquo;<samp>-f <var>format</var></samp>&rsquo;</dt>
278 <dd><p>Force format to use.
279 </p>
280 </dd>
281 <dt> &lsquo;<samp>-unit</samp>&rsquo;</dt>
282 <dd><p>Show the unit of the displayed values.
283 </p>
284 </dd>
285 <dt> &lsquo;<samp>-prefix</samp>&rsquo;</dt>
286 <dd><p>Use SI prefixes for the displayed values.
287 Unless the &quot;-byte_binary_prefix&quot; option is used all the prefixes
288 are decimal.
289 </p>
290 </dd>
291 <dt> &lsquo;<samp>-byte_binary_prefix</samp>&rsquo;</dt>
292 <dd><p>Force the use of binary prefixes for byte values.
293 </p>
294 </dd>
295 <dt> &lsquo;<samp>-sexagesimal</samp>&rsquo;</dt>
296 <dd><p>Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
297 </p>
298 </dd>
299 <dt> &lsquo;<samp>-pretty</samp>&rsquo;</dt>
300 <dd><p>Prettify the format of the displayed values, it corresponds to the
301 options &quot;-unit -prefix -byte_binary_prefix -sexagesimal&quot;.
302 </p>
303 </dd>
304 <dt> &lsquo;<samp>-show_format</samp>&rsquo;</dt>
305 <dd><p>Show information about the container format of the input multimedia
306 stream.
307 </p>
308 <p>All the container format information is printed within a section with
309 name &quot;FORMAT&quot;.
310 </p>
311 </dd>
312 <dt> &lsquo;<samp>-show_packets</samp>&rsquo;</dt>
313 <dd><p>Show information about each packet contained in the input multimedia
314 stream.
315 </p>
316 <p>The information for each single packet is printed within a dedicated
317 section with name &quot;PACKET&quot;.
318 </p>
319 </dd>
320 <dt> &lsquo;<samp>-show_streams</samp>&rsquo;</dt>
321 <dd><p>Show information about each media stream contained in the input
322 multimedia stream.
323 </p>
324 <p>Each media stream information is printed within a dedicated section
325 with name &quot;STREAM&quot;.
326 </p>
327 </dd>
328 </dl>
329
330 <a name="Demuxers"></a>
331 <h1 class="chapter"><a href="ffprobe.html#toc-Demuxers">4. Demuxers</a></h1>
332
333 <p>Demuxers are configured elements in FFmpeg which allow to read the
334 multimedia streams from a particular type of file.
335 </p>
336 <p>When you configure your FFmpeg build, all the supported demuxers
337 are enabled by default. You can list all available ones using the
338 configure option &quot;&ndash;list-demuxers&quot;.
339 </p>
340 <p>You can disable all the demuxers using the configure option
341 &quot;&ndash;disable-demuxers&quot;, and selectively enable a single demuxer with
342 the option &quot;&ndash;enable-demuxer=<var>DEMUXER</var>&quot;, or disable it
343 with the option &quot;&ndash;disable-demuxer=<var>DEMUXER</var>&quot;.
344 </p>
345 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
346 enabled demuxers.
347 </p>
348 <p>The description of some of the currently available demuxers follows.
349 </p>
350 <a name="image2"></a>
351 <h2 class="section"><a href="ffprobe.html#toc-image2">4.1 image2</a></h2>
352
353 <p>Image file demuxer.
354 </p>
355 <p>This demuxer reads from a list of image files specified by a pattern.
356 </p>
357 <p>The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
358 specifies the position of the characters representing a sequential
359 number in each filename matched by the pattern. If the form
360 &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
361 filename is 0-padded and <var>N</var> is the total number of 0-padded
362 digits representing the number. The literal character &rsquo;%&rsquo; can be
363 specified in the pattern with the string &quot;%%&quot;.
364 </p>
365 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
366 the file list specified by the pattern must contain a number
367 inclusively contained between 0 and 4, all the following numbers must
368 be sequential. This limitation may be hopefully fixed.
369 </p>
370 <p>The pattern may contain a suffix which is used to automatically
371 determine the format of the images contained in the files.
372 </p>
373 <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
374 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
375 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
376 sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
377 &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
378 </p>
379 <p>The size, the pixel format, and the format of each image must be the
380 same for all the files in the sequence.
381 </p>
382 <p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
383 video from the images in the file sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;,
384 &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an input framerate of 10 frames per
385 second:
386 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
387 </pre></td></tr></table>
388
389 <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
390 &quot;%0<var>N</var>d&quot;, for example to convert a single image file
391 &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
392 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f image2 -i img.jpeg img.png
393 </pre></td></tr></table>
394
395 <a name="applehttp-1"></a>
396 <h2 class="section"><a href="ffprobe.html#toc-applehttp-1">4.2 applehttp</a></h2>
397
398 <p>Apple HTTP Live Streaming demuxer.
399 </p>
400 <p>This demuxer presents all AVStreams from all variant streams.
401 The id field is set to the bitrate variant index number. By setting
402 the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
403 the caller can decide which variant streams to actually receive.
404 The total bitrate of the variant that the stream belongs to is
405 available in a metadata key named &quot;variant_bitrate&quot;.
406 </p>
407 <a name="Muxers"></a>
408 <h1 class="chapter"><a href="ffprobe.html#toc-Muxers">5. Muxers</a></h1>
409
410 <p>Muxers are configured elements in FFmpeg which allow writing
411 multimedia streams to a particular type of file.
412 </p>
413 <p>When you configure your FFmpeg build, all the supported muxers
414 are enabled by default. You can list all available muxers using the
415 configure option <code>--list-muxers</code>.
416 </p>
417 <p>You can disable all the muxers with the configure option
418 <code>--disable-muxers</code> and selectively enable / disable single muxers
419 with the options <code>--enable-muxer=<var>MUXER</var></code> /
420 <code>--disable-muxer=<var>MUXER</var></code>.
421 </p>
422 <p>The option <code>-formats</code> of the ff* tools will display the list of
423 enabled muxers.
424 </p>
425 <p>A description of some of the currently available muxers follows.
426 </p>
427 <p><a name="crc"></a>
428 </p><a name="crc-1"></a>
429 <h2 class="section"><a href="ffprobe.html#toc-crc-1">5.1 crc</a></h2>
430
431 <p>CRC (Cyclic Redundancy Check) testing format.
432 </p>
433 <p>This muxer computes and prints the Adler-32 CRC of all the input audio
434 and video frames. By default audio frames are converted to signed
435 16-bit raw audio and video frames to raw video before computing the
436 CRC.
437 </p>
438 <p>The output of the muxer consists of a single line of the form:
439 CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
440 8 digits containing the CRC for all the decoded input frames.
441 </p>
442 <p>For example to compute the CRC of the input, and store it in the file
443 &lsquo;<tt>out.crc</tt>&rsquo;:
444 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc out.crc
445 </pre></td></tr></table>
446
447 <p>You can print the CRC to stdout with the command:
448 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f crc -
449 </pre></td></tr></table>
450
451 <p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
452 specifying the audio and video codec and format. For example to
453 compute the CRC of the input audio converted to PCM unsigned 8-bit
454 and the input video converted to MPEG-2 video, use the command:
455 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
456 </pre></td></tr></table>
457
458 <p>See also the <code>framecrc</code> muxer (see <a href="#framecrc">framecrc</a>).
459 </p>
460 <p><a name="framecrc"></a>
461 </p><a name="framecrc-1"></a>
462 <h2 class="section"><a href="ffprobe.html#toc-framecrc-1">5.2 framecrc</a></h2>
463
464 <p>Per-frame CRC (Cyclic Redundancy Check) testing format.
465 </p>
466 <p>This muxer computes and prints the Adler-32 CRC for each decoded audio
467 and video frame. By default audio frames are converted to signed
468 16-bit raw audio and video frames to raw video before computing the
469 CRC.
470 </p>
471 <p>The output of the muxer consists of a line for each audio and video
472 frame of the form: <var>stream_index</var>, <var>frame_dts</var>,
473 <var>frame_size</var>, 0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal
474 number 0-padded to 8 digits containing the CRC of the decoded frame.
475 </p>
476 <p>For example to compute the CRC of each decoded frame in the input, and
477 store it in the file &lsquo;<tt>out.crc</tt>&rsquo;:
478 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc out.crc
479 </pre></td></tr></table>
480
481 <p>You can print the CRC of each decoded frame to stdout with the command:
482 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -f framecrc -
483 </pre></td></tr></table>
484
485 <p>You can select the output format of each frame with &lsquo;<tt>ffmpeg</tt>&rsquo; by
486 specifying the audio and video codec and format. For example, to
487 compute the CRC of each decoded input audio frame converted to PCM
488 unsigned 8-bit and of each decoded input video frame converted to
489 MPEG-2 video, use the command:
490 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
491 </pre></td></tr></table>
492
493 <p>See also the <code>crc</code> muxer (see <a href="#crc">crc</a>).
494 </p>
495 <a name="image2-1"></a>
496 <h2 class="section"><a href="ffprobe.html#toc-image2-1">5.3 image2</a></h2>
497
498 <p>Image file muxer.
499 </p>
500 <p>The image file muxer writes video frames to image files.
501 </p>
502 <p>The output filenames are specified by a pattern, which can be used to
503 produce sequentially numbered series of files.
504 The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
505 specifies the position of the characters representing a numbering in
506 the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
507 representing the number in each filename is 0-padded to <var>N</var>
508 digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
509 the string &quot;%%&quot;.
510 </p>
511 <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
512 the file list specified will contain the number 1, all the following
513 numbers will be sequential.
514 </p>
515 <p>The pattern may contain a suffix which is used to automatically
516 determine the format of the image files to write.
517 </p>
518 <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
519 filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
520 &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
521 The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
522 form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
523 etc.
524 </p>
525 <p>The following example shows how to use &lsquo;<tt>ffmpeg</tt>&rsquo; for creating a
526 sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
527 taking one image every second from the input video:
528 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
529 </pre></td></tr></table>
530
531 <p>Note that with &lsquo;<tt>ffmpeg</tt>&rsquo;, if the format is not specified with the
532 <code>-f</code> option and the output filename specifies an image file
533 format, the image2 muxer is automatically selected, so the previous
534 command can be written as:
535 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
536 </pre></td></tr></table>
537
538 <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
539 &quot;%0<var>N</var>d&quot;, for example to create a single image file
540 &lsquo;<tt>img.jpeg</tt>&rsquo; from the input video you can employ the command:
541 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
542 </pre></td></tr></table>
543
544 <p>The image muxer supports the .Y.U.V image file format. This format is
545 special in that that each image frame consists of three files, for
546 each of the YUV420P components. To read or write this image file format,
547 specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
548 &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
549 </p>
550 <a name="mpegts"></a>
551 <h2 class="section"><a href="ffprobe.html#toc-mpegts">5.4 mpegts</a></h2>
552
553 <p>MPEG transport stream muxer.
554 </p>
555 <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
556 </p>
557 <p>The muxer options are:
558 </p>
559 <dl compact="compact">
560 <dt> &lsquo;<samp>-mpegts_original_network_id <var>number</var></samp>&rsquo;</dt>
561 <dd><p>Set the original_network_id (default 0x0001). This is unique identifier
562 of a network in DVB. Its main use is in the unique identification of a
563 service through the path Original_Network_ID, Transport_Stream_ID.
564 </p></dd>
565 <dt> &lsquo;<samp>-mpegts_transport_stream_id <var>number</var></samp>&rsquo;</dt>
566 <dd><p>Set the transport_stream_id (default 0x0001). This identifies a
567 transponder in DVB.
568 </p></dd>
569 <dt> &lsquo;<samp>-mpegts_service_id <var>number</var></samp>&rsquo;</dt>
570 <dd><p>Set the service_id (default 0x0001) also known as program in DVB.
571 </p></dd>
572 <dt> &lsquo;<samp>-mpegts_pmt_start_pid <var>number</var></samp>&rsquo;</dt>
573 <dd><p>Set the first PID for PMT (default 0x1000, max 0x1f00).
574 </p></dd>
575 <dt> &lsquo;<samp>-mpegts_start_pid <var>number</var></samp>&rsquo;</dt>
576 <dd><p>Set the first PID for data packets (default 0x0100, max 0x0f00).
577 </p></dd>
578 </dl>
579
580 <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
581 and <code>service_name</code>. If they are not set the default for
582 <code>service_provider</code> is &quot;FFmpeg&quot; and the default for
583 <code>service_name</code> is &quot;Service01&quot;.
584 </p>
585 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file.mpg -acodec copy -vcodec copy \
586      -mpegts_original_network_id 0x1122 \
587      -mpegts_transport_stream_id 0x3344 \
588      -mpegts_service_id 0x5566 \
589      -mpegts_pmt_start_pid 0x1500 \
590      -mpegts_start_pid 0x150 \
591      -metadata service_provider=&quot;Some provider&quot; \
592      -metadata service_name=&quot;Some Channel&quot; \
593      -y out.ts
594 </pre></td></tr></table>
595
596 <a name="null"></a>
597 <h2 class="section"><a href="ffprobe.html#toc-null">5.5 null</a></h2>
598
599 <p>Null muxer.
600 </p>
601 <p>This muxer does not generate any output file, it is mainly useful for
602 testing or benchmarking purposes.
603 </p>
604 <p>For example to benchmark decoding with &lsquo;<tt>ffmpeg</tt>&rsquo; you can use the
605 command:
606 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
607 </pre></td></tr></table>
608
609 <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
610 file, but specifying the output file is required by the &lsquo;<tt>ffmpeg</tt>&rsquo;
611 syntax.
612 </p>
613 <p>Alternatively you can write the command as:
614 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -benchmark -i INPUT -f null -
615 </pre></td></tr></table>
616
617 <a name="Protocols"></a>
618 <h1 class="chapter"><a href="ffprobe.html#toc-Protocols">6. Protocols</a></h1>
619
620 <p>Protocols are configured elements in FFmpeg which allow to access
621 resources which require the use of a particular protocol.
622 </p>
623 <p>When you configure your FFmpeg build, all the supported protocols are
624 enabled by default. You can list all available ones using the
625 configure option &quot;&ndash;list-protocols&quot;.
626 </p>
627 <p>You can disable all the protocols using the configure option
628 &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
629 option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
630 particular protocol using the option
631 &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
632 </p>
633 <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
634 supported protocols.
635 </p>
636 <p>A description of the currently available protocols follows.
637 </p>
638 <a name="applehttp"></a>
639 <h2 class="section"><a href="ffprobe.html#toc-applehttp">6.1 applehttp</a></h2>
640
641 <p>Read Apple HTTP Live Streaming compliant segmented stream as
642 a uniform one. The M3U8 playlists describing the segments can be
643 remote HTTP resources or local files, accessed using the standard
644 file protocol.
645 HTTP is default, specific protocol can be declared by specifying
646 &quot;+<var>proto</var>&quot; after the applehttp URI scheme name, where <var>proto</var>
647 is either &quot;file&quot; or &quot;http&quot;.
648 </p>
649 <table><tr><td>&nbsp;</td><td><pre class="example">applehttp://host/path/to/remote/resource.m3u8
650 applehttp+http://host/path/to/remote/resource.m3u8
651 applehttp+file://path/to/local/resource.m3u8
652 </pre></td></tr></table>
653
654 <a name="concat"></a>
655 <h2 class="section"><a href="ffprobe.html#toc-concat">6.2 concat</a></h2>
656
657 <p>Physical concatenation protocol.
658 </p>
659 <p>Allow to read and seek from many resource in sequence as if they were
660 a unique resource.
661 </p>
662 <p>A URL accepted by this protocol has the syntax:
663 </p><table><tr><td>&nbsp;</td><td><pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
664 </pre></td></tr></table>
665
666 <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
667 resource to be concatenated, each one possibly specifying a distinct
668 protocol.
669 </p>
670 <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
671 &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with &lsquo;<tt>ffplay</tt>&rsquo; use the
672 command:
673 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
674 </pre></td></tr></table>
675
676 <p>Note that you may need to escape the character &quot;|&quot; which is special for
677 many shells.
678 </p>
679 <a name="file"></a>
680 <h2 class="section"><a href="ffprobe.html#toc-file">6.3 file</a></h2>
681
682 <p>File access protocol.
683 </p>
684 <p>Allow to read from or read to a file.
685 </p>
686 <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with &lsquo;<tt>ffmpeg</tt>&rsquo;
687 use the command:
688 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i file:input.mpeg output.mpeg
689 </pre></td></tr></table>
690
691 <p>The ff* tools default to the file protocol, that is a resource
692 specified with the name &quot;FILE.mpeg&quot; is interpreted as the URL
693 &quot;file:FILE.mpeg&quot;.
694 </p>
695 <a name="gopher"></a>
696 <h2 class="section"><a href="ffprobe.html#toc-gopher">6.4 gopher</a></h2>
697
698 <p>Gopher protocol.
699 </p>
700 <a name="http"></a>
701 <h2 class="section"><a href="ffprobe.html#toc-http">6.5 http</a></h2>
702
703 <p>HTTP (Hyper Text Transfer Protocol).
704 </p>
705 <a name="mmst"></a>
706 <h2 class="section"><a href="ffprobe.html#toc-mmst">6.6 mmst</a></h2>
707
708 <p>MMS (Microsoft Media Server) protocol over TCP.
709 </p>
710 <a name="mmsh"></a>
711 <h2 class="section"><a href="ffprobe.html#toc-mmsh">6.7 mmsh</a></h2>
712
713 <p>MMS (Microsoft Media Server) protocol over HTTP.
714 </p>
715 <p>The required syntax is:
716 </p><table><tr><td>&nbsp;</td><td><pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
717 </pre></td></tr></table>
718
719 <a name="md5"></a>
720 <h2 class="section"><a href="ffprobe.html#toc-md5">6.8 md5</a></h2>
721
722 <p>MD5 output protocol.
723 </p>
724 <p>Computes the MD5 hash of the data to be written, and on close writes
725 this to the designated output or stdout if none is specified. It can
726 be used to test muxers without writing an actual file.
727 </p>
728 <p>Some examples follow.
729 </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.
730 ffmpeg -i input.flv -f avi -y md5:output.avi.md5
731
732 # Write the MD5 hash of the encoded AVI file to stdout.
733 ffmpeg -i input.flv -f avi -y md5:
734 </pre></td></tr></table>
735
736 <p>Note that some formats (typically MOV) require the output protocol to
737 be seekable, so they will fail with the MD5 output protocol.
738 </p>
739 <a name="pipe"></a>
740 <h2 class="section"><a href="ffprobe.html#toc-pipe">6.9 pipe</a></h2>
741
742 <p>UNIX pipe access protocol.
743 </p>
744 <p>Allow to read and write from UNIX pipes.
745 </p>
746 <p>The accepted syntax is:
747 </p><table><tr><td>&nbsp;</td><td><pre class="example">pipe:[<var>number</var>]
748 </pre></td></tr></table>
749
750 <p><var>number</var> is the number corresponding to the file descriptor of the
751 pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).  If <var>number</var>
752 is not specified, by default the stdout file descriptor will be used
753 for writing, stdin for reading.
754 </p>
755 <p>For example to read from stdin with &lsquo;<tt>ffmpeg</tt>&rsquo;:
756 </p><table><tr><td>&nbsp;</td><td><pre class="example">cat test.wav | ffmpeg -i pipe:0
757 # ...this is the same as...
758 cat test.wav | ffmpeg -i pipe:
759 </pre></td></tr></table>
760
761 <p>For writing to stdout with &lsquo;<tt>ffmpeg</tt>&rsquo;:
762 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
763 # ...this is the same as...
764 ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
765 </pre></td></tr></table>
766
767 <p>Note that some formats (typically MOV), require the output protocol to
768 be seekable, so they will fail with the pipe output protocol.
769 </p>
770 <a name="rtmp"></a>
771 <h2 class="section"><a href="ffprobe.html#toc-rtmp">6.10 rtmp</a></h2>
772
773 <p>Real-Time Messaging Protocol.
774 </p>
775 <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐
776 dia content across a TCP/IP network.
777 </p>
778 <p>The required syntax is:
779 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtmp://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
780 </pre></td></tr></table>
781
782 <p>The accepted parameters are:
783 </p><dl compact="compact">
784 <dt> &lsquo;<samp>server</samp>&rsquo;</dt>
785 <dd><p>The address of the RTMP server.
786 </p>
787 </dd>
788 <dt> &lsquo;<samp>port</samp>&rsquo;</dt>
789 <dd><p>The number of the TCP port to use (by default is 1935).
790 </p>
791 </dd>
792 <dt> &lsquo;<samp>app</samp>&rsquo;</dt>
793 <dd><p>It is the name of the application to access. It usually corresponds to
794 the path where the application is installed on the RTMP server
795 (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.).
796 </p>
797 </dd>
798 <dt> &lsquo;<samp>playpath</samp>&rsquo;</dt>
799 <dd><p>It is the path or name of the resource to play with reference to the
800 application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;.
801 </p>
802 </dd>
803 </dl>
804
805 <p>For example to read with &lsquo;<tt>ffplay</tt>&rsquo; a multimedia resource named
806 &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
807 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtmp://myserver/vod/sample
808 </pre></td></tr></table>
809
810 <a name="rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
811 <h2 class="section"><a href="ffprobe.html#toc-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">6.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
812
813 <p>Real-Time Messaging Protocol and its variants supported through
814 librtmp.
815 </p>
816 <p>Requires the presence of the librtmp headers and library during
817 configuration. You need to explicitely configure the build with
818 &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
819 protocol.
820 </p>
821 <p>This protocol provides most client functions and a few server
822 functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
823 encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
824 variants of these encrypted types (RTMPTE, RTMPTS).
825 </p>
826 <p>The required syntax is:
827 </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>
828 </pre></td></tr></table>
829
830 <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
831 &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
832 <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
833 meaning as specified for the RTMP native protocol.
834 <var>options</var> contains a list of space-separated options of the form
835 <var>key</var>=<var>val</var>.
836 </p>
837 <p>See the librtmp manual page (man 3 librtmp) for more information.
838 </p>
839 <p>For example, to stream a file in real-time to an RTMP server using
840 &lsquo;<tt>ffmpeg</tt>&rsquo;:
841 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
842 </pre></td></tr></table>
843
844 <p>To play the same stream using &lsquo;<tt>ffplay</tt>&rsquo;:
845 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
846 </pre></td></tr></table>
847
848 <a name="rtp"></a>
849 <h2 class="section"><a href="ffprobe.html#toc-rtp">6.12 rtp</a></h2>
850
851 <p>Real-Time Protocol.
852 </p>
853 <a name="rtsp"></a>
854 <h2 class="section"><a href="ffprobe.html#toc-rtsp">6.13 rtsp</a></h2>
855
856 <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
857 and muxer. The demuxer supports both normal RTSP (with data transferred
858 over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
859 data transferred over RDT).
860 </p>
861 <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
862 supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
863 RTSP server, <a href="http://github.com/revmischa/rtsp-server">http://github.com/revmischa/rtsp-server</a>).
864 </p>
865 <p>The required syntax for a RTSP url is:
866 </p><table><tr><td>&nbsp;</td><td><pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>[?<var>options</var>]
867 </pre></td></tr></table>
868
869 <p><var>options</var> is a <code>&amp;</code>-separated list. The following options
870 are supported:
871 </p>
872 <dl compact="compact">
873 <dt> &lsquo;<samp>udp</samp>&rsquo;</dt>
874 <dd><p>Use UDP as lower transport protocol.
875 </p>
876 </dd>
877 <dt> &lsquo;<samp>tcp</samp>&rsquo;</dt>
878 <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
879 transport protocol.
880 </p>
881 </dd>
882 <dt> &lsquo;<samp>multicast</samp>&rsquo;</dt>
883 <dd><p>Use UDP multicast as lower transport protocol.
884 </p>
885 </dd>
886 <dt> &lsquo;<samp>http</samp>&rsquo;</dt>
887 <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
888 passing proxies.
889 </p>
890 </dd>
891 <dt> &lsquo;<samp>filter_src</samp>&rsquo;</dt>
892 <dd><p>Accept packets only from negotiated peer address and port.
893 </p></dd>
894 </dl>
895
896 <p>Multiple lower transport protocols may be specified, in that case they are
897 tried one at a time (if the setup of one fails, the next one is tried).
898 For the muxer, only the <code>tcp</code> and <code>udp</code> options are supported.
899 </p>
900 <p>When receiving data over UDP, the demuxer tries to reorder received packets
901 (since they may arrive out of order, or packets may get lost totally). In
902 order for this to be enabled, a maximum delay must be specified in the
903 <code>max_delay</code> field of AVFormatContext.
904 </p>
905 <p>When watching multi-bitrate Real-RTSP streams with &lsquo;<tt>ffplay</tt>&rsquo;, the
906 streams to display can be chosen with <code>-vst</code> <var>n</var> and
907 <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
908 on the fly by pressing <code>v</code> and <code>a</code>.
909 </p>
910 <p>Example command lines:
911 </p>
912 <p>To watch a stream over UDP, with a max reordering delay of 0.5 seconds:
913 </p>
914 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay -max_delay 500000 rtsp://server/video.mp4?udp
915 </pre></td></tr></table>
916
917 <p>To watch a stream tunneled over HTTP:
918 </p>
919 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay rtsp://server/video.mp4?http
920 </pre></td></tr></table>
921
922 <p>To send a stream in realtime to a RTSP server, for others to watch:
923 </p>
924 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
925 </pre></td></tr></table>
926
927 <a name="sap"></a>
928 <h2 class="section"><a href="ffprobe.html#toc-sap">6.14 sap</a></h2>
929
930 <p>Session Announcement Protocol (RFC 2974). This is not technically a
931 protocol handler in libavformat, it is a muxer and demuxer.
932 It is used for signalling of RTP streams, by announcing the SDP for the
933 streams regularly on a separate port.
934 </p>
935 <a name="Muxer"></a>
936 <h3 class="subsection"><a href="ffprobe.html#toc-Muxer">6.14.1 Muxer</a></h3>
937
938 <p>The syntax for a SAP url given to the muxer is:
939 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
940 </pre></td></tr></table>
941
942 <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
943 or to port 5004 if no port is specified.
944 <var>options</var> is a <code>&amp;</code>-separated list. The following options
945 are supported:
946 </p>
947 <dl compact="compact">
948 <dt> &lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
949 <dd><p>Specify the destination IP address for sending the announcements to.
950 If omitted, the announcements are sent to the commonly used SAP
951 announcement multicast address 224.2.127.254 (sap.mcast.net), or
952 ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
953 </p>
954 </dd>
955 <dt> &lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
956 <dd><p>Specify the port to send the announcements on, defaults to
957 9875 if not specified.
958 </p>
959 </dd>
960 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
961 <dd><p>Specify the time to live value for the announcements and RTP packets,
962 defaults to 255.
963 </p>
964 </dd>
965 <dt> &lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
966 <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
967 default), all streams are sent on unique ports, with each stream on a
968 port 2 numbers higher than the previous.
969 VLC/Live555 requires this to be set to 1, to be able to receive the stream.
970 The RTP stack in libavformat for receiving requires all streams to be sent
971 on unique ports.
972 </p></dd>
973 </dl>
974
975 <p>Example command lines follow.
976 </p>
977 <p>To broadcast a stream on the local subnet, for watching in VLC:
978 </p>
979 <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
980 </pre></td></tr></table>
981
982 <p>Similarly, for watching in ffplay:
983 </p>
984 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
985 </pre></td></tr></table>
986
987 <p>And for watching in ffplay, over IPv6:
988 </p>
989 <table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
990 </pre></td></tr></table>
991
992 <a name="Demuxer"></a>
993 <h3 class="subsection"><a href="ffprobe.html#toc-Demuxer">6.14.2 Demuxer</a></h3>
994
995 <p>The syntax for a SAP url given to the demuxer is:
996 </p><table><tr><td>&nbsp;</td><td><pre class="example">sap://[<var>address</var>][:<var>port</var>]
997 </pre></td></tr></table>
998
999 <p><var>address</var> is the multicast address to listen for announcements on,
1000 if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
1001 is the port that is listened on, 9875 if omitted.
1002 </p>
1003 <p>The demuxers listens for announcements on the given address and port.
1004 Once an announcement is received, it tries to receive that particular stream.
1005 </p>
1006 <p>Example command lines follow.
1007 </p>
1008 <p>To play back the first stream announced on the normal SAP multicast address:
1009 </p>
1010 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://
1011 </pre></td></tr></table>
1012
1013 <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
1014 </p>
1015 <table><tr><td>&nbsp;</td><td><pre class="example">ffplay sap://[ff0e::2:7ffe]
1016 </pre></td></tr></table>
1017
1018 <a name="tcp"></a>
1019 <h2 class="section"><a href="ffprobe.html#toc-tcp">6.15 tcp</a></h2>
1020
1021 <p>Trasmission Control Protocol.
1022 </p>
1023 <p>The required syntax for a TCP url is:
1024 </p><table><tr><td>&nbsp;</td><td><pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1025 </pre></td></tr></table>
1026
1027 <dl compact="compact">
1028 <dt> &lsquo;<samp>listen</samp>&rsquo;</dt>
1029 <dd><p>Listen for an incoming connection
1030 </p>
1031 <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
1032 ffplay tcp://<var>hostname</var>:<var>port</var>
1033 </pre></td></tr></table>
1034
1035 </dd>
1036 </dl>
1037
1038 <a name="udp"></a>
1039 <h2 class="section"><a href="ffprobe.html#toc-udp">6.16 udp</a></h2>
1040
1041 <p>User Datagram Protocol.
1042 </p>
1043 <p>The required syntax for a UDP url is:
1044 </p><table><tr><td>&nbsp;</td><td><pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
1045 </pre></td></tr></table>
1046
1047 <p><var>options</var> contains a list of &amp;-seperated options of the form <var>key</var>=<var>val</var>.
1048 Follow the list of supported options.
1049 </p>
1050 <dl compact="compact">
1051 <dt> &lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
1052 <dd><p>set the UDP buffer size in bytes
1053 </p>
1054 </dd>
1055 <dt> &lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
1056 <dd><p>override the local UDP port to bind with
1057 </p>
1058 </dd>
1059 <dt> &lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
1060 <dd><p>set the size in bytes of UDP packets
1061 </p>
1062 </dd>
1063 <dt> &lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
1064 <dd><p>explicitly allow or disallow reusing UDP sockets
1065 </p>
1066 </dd>
1067 <dt> &lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
1068 <dd><p>set the time to live value (for multicast only)
1069 </p>
1070 </dd>
1071 <dt> &lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
1072 <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
1073 destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
1074 If the destination address isn&rsquo;t known at the start, this option can
1075 be specified in ff_udp_set_remote_url, too.
1076 This allows finding out the source address for the packets with getsockname,
1077 and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
1078 unreachable&quot; is received.
1079 For receiving, this gives the benefit of only receiving packets from
1080 the specified peer address/port.
1081 </p></dd>
1082 </dl>
1083
1084 <p>Some usage examples of the udp protocol with &lsquo;<tt>ffmpeg</tt>&rsquo; follow.
1085 </p>
1086 <p>To stream over UDP to a remote endpoint:
1087 </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>
1088 </pre></td></tr></table>
1089
1090 <p>To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer:
1091 </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
1092 </pre></td></tr></table>
1093
1094 <p>To receive over UDP from a remote endpoint:
1095 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var>
1096 </pre></td></tr></table>
1097
1098 <a name="Input-Devices"></a>
1099 <h1 class="chapter"><a href="ffprobe.html#toc-Input-Devices">7. Input Devices</a></h1>
1100
1101 <p>Input devices are configured elements in FFmpeg which allow to access
1102 the data coming from a multimedia device attached to your system.
1103 </p>
1104 <p>When you configure your FFmpeg build, all the supported input devices
1105 are enabled by default. You can list all available ones using the
1106 configure option &quot;&ndash;list-indevs&quot;.
1107 </p>
1108 <p>You can disable all the input devices using the configure option
1109 &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
1110 option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
1111 input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
1112 </p>
1113 <p>The option &quot;-formats&quot; of the ff* tools will display the list of
1114 supported input devices (amongst the demuxers).
1115 </p>
1116 <p>A description of the currently available input devices follows.
1117 </p>
1118 <a name="alsa"></a>
1119 <h2 class="section"><a href="ffprobe.html#toc-alsa">7.1 alsa</a></h2>
1120
1121 <p>ALSA (Advanced Linux Sound Architecture) input device.
1122 </p>
1123 <p>To enable this input device during configuration you need libasound
1124 installed on your system.
1125 </p>
1126 <p>This device allows capturing from an ALSA device. The name of the
1127 device to capture has to be an ALSA card identifier.
1128 </p>
1129 <p>An ALSA identifier has the syntax:
1130 </p><table><tr><td>&nbsp;</td><td><pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
1131 </pre></td></tr></table>
1132
1133 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
1134 </p>
1135 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
1136 specify card number or identifier, device number and subdevice number
1137 (-1 means any).
1138 </p>
1139 <p>To see the list of cards currently recognized by your system check the
1140 files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
1141 </p>
1142 <p>For example to capture with &lsquo;<tt>ffmpeg</tt>&rsquo; from an ALSA device with
1143 card id 0, you may run the command:
1144 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
1145 </pre></td></tr></table>
1146
1147 <p>For more information see:
1148 <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>
1149 </p>
1150 <a name="bktr"></a>
1151 <h2 class="section"><a href="ffprobe.html#toc-bktr">7.2 bktr</a></h2>
1152
1153 <p>BSD video input device.
1154 </p>
1155 <a name="dv1394"></a>
1156 <h2 class="section"><a href="ffprobe.html#toc-dv1394">7.3 dv1394</a></h2>
1157
1158 <p>Linux DV 1394 input device.
1159 </p>
1160 <a name="fbdev"></a>
1161 <h2 class="section"><a href="ffprobe.html#toc-fbdev">7.4 fbdev</a></h2>
1162
1163 <p>Linux framebuffer input device.
1164 </p>
1165 <p>The Linux framebuffer is a graphic hardware-independent abstraction
1166 layer to show graphics on a computer monitor, typically on the
1167 console. It is accessed through a file device node, usually
1168 &lsquo;<tt>/dev/fb0</tt>&rsquo;.
1169 </p>
1170 <p>For more detailed information read the file
1171 Documentation/fb/framebuffer.txt included in the Linux source tree.
1172 </p>
1173 <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
1174 &lsquo;<tt>ffmpeg</tt>&rsquo;:
1175 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
1176 </pre></td></tr></table>
1177
1178 <p>You can take a single screenshot image with the command:
1179 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
1180 </pre></td></tr></table>
1181
1182 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
1183 </p>
1184 <a name="jack"></a>
1185 <h2 class="section"><a href="ffprobe.html#toc-jack">7.5 jack</a></h2>
1186
1187 <p>JACK input device.
1188 </p>
1189 <p>To enable this input device during configuration you need libjack
1190 installed on your system.
1191 </p>
1192 <p>A JACK input device creates one or more JACK writable clients, one for
1193 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
1194 <var>client_name</var> is the name provided by the application, and <var>N</var>
1195 is a number which identifies the channel.
1196 Each writable client will send the acquired data to the FFmpeg input
1197 device.
1198 </p>
1199 <p>Once you have created one or more JACK readable clients, you need to
1200 connect them to one or more JACK writable clients.
1201 </p>
1202 <p>To connect or disconnect JACK clients you can use the
1203 &lsquo;<tt>jack_connect</tt>&rsquo; and &lsquo;<tt>jack_disconnect</tt>&rsquo; programs, or do it
1204 through a graphical interface, for example with &lsquo;<tt>qjackctl</tt>&rsquo;.
1205 </p>
1206 <p>To list the JACK clients and their properties you can invoke the command
1207 &lsquo;<tt>jack_lsp</tt>&rsquo;.
1208 </p>
1209 <p>Follows an example which shows how to capture a JACK readable client
1210 with &lsquo;<tt>ffmpeg</tt>&rsquo;.
1211 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
1212 $ ffmpeg -f jack -i ffmpeg -y out.wav
1213
1214 # Start the sample jack_metro readable client.
1215 $ jack_metro -b 120 -d 0.2 -f 4000
1216
1217 # List the current JACK clients.
1218 $ jack_lsp -c
1219 system:capture_1
1220 system:capture_2
1221 system:playback_1
1222 system:playback_2
1223 ffmpeg:input_1
1224 metro:120_bpm
1225
1226 # Connect metro to the ffmpeg writable client.
1227 $ jack_connect metro:120_bpm ffmpeg:input_1
1228 </pre></td></tr></table>
1229
1230 <p>For more information read:
1231 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
1232 </p>
1233 <a name="libdc1394"></a>
1234 <h2 class="section"><a href="ffprobe.html#toc-libdc1394">7.6 libdc1394</a></h2>
1235
1236 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
1237 </p>
1238 <a name="oss"></a>
1239 <h2 class="section"><a href="ffprobe.html#toc-oss">7.7 oss</a></h2>
1240
1241 <p>Open Sound System input device.
1242 </p>
1243 <p>The filename to provide to the input device is the device node
1244 representing the OSS input device, and is usually set to
1245 &lsquo;<tt>/dev/dsp</tt>&rsquo;.
1246 </p>
1247 <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
1248 command:
1249 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
1250 </pre></td></tr></table>
1251
1252 <p>For more information about OSS see:
1253 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
1254 </p>
1255 <a name="sndio"></a>
1256 <h2 class="section"><a href="ffprobe.html#toc-sndio">7.8 sndio</a></h2>
1257
1258 <p>sndio input device.
1259 </p>
1260 <p>To enable this input device during configuration you need libsndio
1261 installed on your system.
1262 </p>
1263 <p>The filename to provide to the input device is the device node
1264 representing the sndio input device, and is usually set to
1265 &lsquo;<tt>/dev/audio0</tt>&rsquo;.
1266 </p>
1267 <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo; use the
1268 command:
1269 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
1270 </pre></td></tr></table>
1271
1272 <a name="video4linux-and-video4linux2"></a>
1273 <h2 class="section"><a href="ffprobe.html#toc-video4linux-and-video4linux2">7.9 video4linux and video4linux2</a></h2>
1274
1275 <p>Video4Linux and Video4Linux2 input video devices.
1276 </p>
1277 <p>The name of the device to grab is a file device node, usually Linux
1278 systems tend to automatically create such nodes when the device
1279 (e.g. an USB webcam) is plugged into the system, and has a name of the
1280 kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
1281 the device.
1282 </p>
1283 <p>Video4Linux and Video4Linux2 devices only support a limited set of
1284 <var>width</var>x<var>height</var> sizes and framerates. You can check which are
1285 supported for example with the command &lsquo;<tt>dov4l</tt>&rsquo; for Video4Linux
1286 devices and the command &lsquo;<tt>v4l-info</tt>&rsquo; for Video4Linux2 devices.
1287 </p>
1288 <p>If the size for the device is set to 0x0, the input device will
1289 try to autodetect the size to use.
1290 Only for the video4linux2 device, if the frame rate is set to 0/0 the
1291 input device will use the frame rate value already set in the driver.
1292 </p>
1293 <p>Video4Linux support is deprecated since Linux 2.6.30, and will be
1294 dropped in later versions.
1295 </p>
1296 <p>Follow some usage examples of the video4linux devices with the ff*
1297 tools.
1298 </p><table><tr><td>&nbsp;</td><td><pre class="example"># Grab and show the input of a video4linux device, frame rate is set
1299 # to the default of 25/1.
1300 ffplay -s 320x240 -f video4linux /dev/video0
1301
1302 # Grab and show the input of a video4linux2 device, autoadjust size.
1303 ffplay -f video4linux2 /dev/video0
1304
1305 # Grab and record the input of a video4linux2 device, autoadjust size,
1306 # frame rate value defaults to 0/0 so it is read from the video4linux2
1307 # driver.
1308 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
1309 </pre></td></tr></table>
1310
1311 <a name="vfwcap"></a>
1312 <h2 class="section"><a href="ffprobe.html#toc-vfwcap">7.10 vfwcap</a></h2>
1313
1314 <p>VfW (Video for Windows) capture input device.
1315 </p>
1316 <p>The filename passed as input is the capture driver number, ranging from
1317 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
1318 other filename will be interpreted as device number 0.
1319 </p>
1320 <a name="x11grab"></a>
1321 <h2 class="section"><a href="ffprobe.html#toc-x11grab">7.11 x11grab</a></h2>
1322
1323 <p>X11 video input device.
1324 </p>
1325 <p>This device allows to capture a region of an X11 display.
1326 </p>
1327 <p>The filename passed as input has the syntax:
1328 </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>]
1329 </pre></td></tr></table>
1330
1331 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
1332 X11 display name of the screen to grab from. <var>hostname</var> can be
1333 ommitted, and defaults to &quot;localhost&quot;. The environment variable
1334 <code>DISPLAY</code> contains the default display name.
1335 </p>
1336 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
1337 area with respect to the top-left border of the X11 screen. They
1338 default to 0.
1339 </p>
1340 <p>Check the X11 documentation (e.g. man X) for more detailed information.
1341 </p>
1342 <p>Use the &lsquo;<tt>dpyinfo</tt>&rsquo; program for getting basic information about the
1343 properties of your X11 display (e.g. grep for &quot;name&quot; or &quot;dimensions&quot;).
1344 </p>
1345 <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using &lsquo;<tt>ffmpeg</tt>&rsquo;:
1346 </p><table><tr><td>&nbsp;</td><td><pre class="example">ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
1347
1348 # Grab at position 10,20.
1349 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
1350 </pre></td></tr></table>
1351
1352
1353
1354 <hr size="1">
1355 <p>
1356  <font size="-1">
1357   This document was generated by <em>Kyle Schwarz</em> on <em>May 18, 2011</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.
1358  </font>
1359  <br>
1360
1361 </p>
1362 </body>
1363 </html>