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