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