1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
7 FFmpeg Devices Documentation
9 <meta name="viewport" content="width=device-width,initial-scale=1.0">
10 <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
11 <link rel="stylesheet" type="text/css" href="style.min.css">
14 <div style="width: 95%; margin: auto">
16 FFmpeg Devices Documentation
22 <a name="SEC_Top"></a>
24 <a name="SEC_Contents"></a>
25 <h2 class="contents-heading">Table of Contents</h2>
27 <div class="contents">
29 <ul class="no-bullet">
30 <li><a name="toc-Description" href="#Description">1 Description</a></li>
31 <li><a name="toc-Device-Options" href="#Device-Options">2 Device Options</a></li>
32 <li><a name="toc-Input-Devices" href="#Input-Devices">3 Input Devices</a>
33 <ul class="no-bullet">
34 <li><a name="toc-alsa" href="#alsa">3.1 alsa</a></li>
35 <li><a name="toc-avfoundation" href="#avfoundation">3.2 avfoundation</a>
36 <ul class="no-bullet">
37 <li><a name="toc-Options" href="#Options">3.2.1 Options</a></li>
38 <li><a name="toc-Examples" href="#Examples">3.2.2 Examples</a></li>
40 <li><a name="toc-bktr" href="#bktr">3.3 bktr</a></li>
41 <li><a name="toc-decklink" href="#decklink">3.4 decklink</a>
42 <ul class="no-bullet">
43 <li><a name="toc-Options-1" href="#Options-1">3.4.1 Options</a></li>
44 <li><a name="toc-Examples-1" href="#Examples-1">3.4.2 Examples</a></li>
46 <li><a name="toc-dshow" href="#dshow">3.5 dshow</a>
47 <ul class="no-bullet">
48 <li><a name="toc-Options-2" href="#Options-2">3.5.1 Options</a></li>
49 <li><a name="toc-Examples-2" href="#Examples-2">3.5.2 Examples</a></li>
51 <li><a name="toc-dv1394" href="#dv1394">3.6 dv1394</a></li>
52 <li><a name="toc-fbdev" href="#fbdev">3.7 fbdev</a></li>
53 <li><a name="toc-gdigrab" href="#gdigrab">3.8 gdigrab</a>
54 <ul class="no-bullet">
55 <li><a name="toc-Options-3" href="#Options-3">3.8.1 Options</a></li>
57 <li><a name="toc-iec61883" href="#iec61883">3.9 iec61883</a>
58 <ul class="no-bullet">
59 <li><a name="toc-Options-4" href="#Options-4">3.9.1 Options</a></li>
60 <li><a name="toc-Examples-3" href="#Examples-3">3.9.2 Examples</a></li>
62 <li><a name="toc-jack" href="#jack">3.10 jack</a></li>
63 <li><a name="toc-lavfi" href="#lavfi">3.11 lavfi</a>
64 <ul class="no-bullet">
65 <li><a name="toc-Options-5" href="#Options-5">3.11.1 Options</a></li>
66 <li><a name="toc-Examples-4" href="#Examples-4">3.11.2 Examples</a></li>
68 <li><a name="toc-libcdio" href="#libcdio">3.12 libcdio</a>
69 <ul class="no-bullet">
70 <li><a name="toc-Options-6" href="#Options-6">3.12.1 Options</a></li>
72 <li><a name="toc-libdc1394" href="#libdc1394">3.13 libdc1394</a></li>
73 <li><a name="toc-openal" href="#openal">3.14 openal</a>
74 <ul class="no-bullet">
75 <li><a name="toc-Options-7" href="#Options-7">3.14.1 Options</a></li>
76 <li><a name="toc-Examples-5" href="#Examples-5">3.14.2 Examples</a></li>
78 <li><a name="toc-oss" href="#oss">3.15 oss</a></li>
79 <li><a name="toc-pulse" href="#pulse">3.16 pulse</a>
80 <ul class="no-bullet">
81 <li><a name="toc-Options-8" href="#Options-8">3.16.1 Options</a></li>
82 <li><a name="toc-Examples-6" href="#Examples-6">3.16.2 Examples</a></li>
84 <li><a name="toc-qtkit" href="#qtkit">3.17 qtkit</a></li>
85 <li><a name="toc-sndio" href="#sndio">3.18 sndio</a></li>
86 <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">3.19 video4linux2, v4l2</a>
87 <ul class="no-bullet">
88 <li><a name="toc-Options-9" href="#Options-9">3.19.1 Options</a></li>
90 <li><a name="toc-vfwcap" href="#vfwcap">3.20 vfwcap</a></li>
91 <li><a name="toc-x11grab" href="#x11grab">3.21 x11grab</a>
92 <ul class="no-bullet">
93 <li><a name="toc-Options-10" href="#Options-10">3.21.1 Options</a></li>
94 <li><a name="toc-grab_005fx-grab_005fy-AVOption" href="#grab_005fx-grab_005fy-AVOption">3.21.2 <var>grab_x</var> <var>grab_y</var> AVOption</a></li>
97 <li><a name="toc-Output-Devices" href="#Output-Devices">4 Output Devices</a>
98 <ul class="no-bullet">
99 <li><a name="toc-alsa-1" href="#alsa-1">4.1 alsa</a>
100 <ul class="no-bullet">
101 <li><a name="toc-Examples-7" href="#Examples-7">4.1.1 Examples</a></li>
103 <li><a name="toc-caca" href="#caca">4.2 caca</a>
104 <ul class="no-bullet">
105 <li><a name="toc-Options-11" href="#Options-11">4.2.1 Options</a></li>
106 <li><a name="toc-Examples-8" href="#Examples-8">4.2.2 Examples</a></li>
108 <li><a name="toc-decklink-1" href="#decklink-1">4.3 decklink</a>
109 <ul class="no-bullet">
110 <li><a name="toc-Options-12" href="#Options-12">4.3.1 Options</a></li>
111 <li><a name="toc-Examples-9" href="#Examples-9">4.3.2 Examples</a></li>
113 <li><a name="toc-fbdev-1" href="#fbdev-1">4.4 fbdev</a>
114 <ul class="no-bullet">
115 <li><a name="toc-Options-13" href="#Options-13">4.4.1 Options</a></li>
116 <li><a name="toc-Examples-10" href="#Examples-10">4.4.2 Examples</a></li>
118 <li><a name="toc-opengl" href="#opengl">4.5 opengl</a>
119 <ul class="no-bullet">
120 <li><a name="toc-Options-14" href="#Options-14">4.5.1 Options</a></li>
121 <li><a name="toc-Examples-11" href="#Examples-11">4.5.2 Examples</a></li>
123 <li><a name="toc-oss-1" href="#oss-1">4.6 oss</a></li>
124 <li><a name="toc-pulse-1" href="#pulse-1">4.7 pulse</a>
125 <ul class="no-bullet">
126 <li><a name="toc-Options-15" href="#Options-15">4.7.1 Options</a></li>
127 <li><a name="toc-Examples-12" href="#Examples-12">4.7.2 Examples</a></li>
129 <li><a name="toc-sdl" href="#sdl">4.8 sdl</a>
130 <ul class="no-bullet">
131 <li><a name="toc-Options-16" href="#Options-16">4.8.1 Options</a></li>
132 <li><a name="toc-Interactive-commands" href="#Interactive-commands">4.8.2 Interactive commands</a></li>
133 <li><a name="toc-Examples-13" href="#Examples-13">4.8.3 Examples</a></li>
135 <li><a name="toc-sndio-1" href="#sndio-1">4.9 sndio</a></li>
136 <li><a name="toc-xv" href="#xv">4.10 xv</a>
137 <ul class="no-bullet">
138 <li><a name="toc-Options-17" href="#Options-17">4.10.1 Options</a></li>
139 <li><a name="toc-Examples-14" href="#Examples-14">4.10.2 Examples</a></li>
142 <li><a name="toc-See-Also" href="#See-Also">5 See Also</a></li>
143 <li><a name="toc-Authors" href="#Authors">6 Authors</a></li>
148 <a name="Description"></a>
149 <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
151 <p>This document describes the input and output devices provided by the
155 <a name="Device-Options"></a>
156 <h2 class="chapter">2 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
158 <p>The libavdevice library provides the same interface as
159 libavformat. Namely, an input device is considered like a demuxer, and
160 an output device like a muxer, and the interface and generic device
161 options are the same provided by libavformat (see the ffmpeg-formats
164 <p>In addition each input or output device may support so-called private
165 options, which are specific for that component.
167 <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
168 FFmpeg tools, or by setting the value explicitly in the device
169 <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
170 for programmatic use.
173 <a name="Input-Devices"></a>
174 <h2 class="chapter">3 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
176 <p>Input devices are configured elements in FFmpeg which enable accessing
177 the data coming from a multimedia device attached to your system.
179 <p>When you configure your FFmpeg build, all the supported input devices
180 are enabled by default. You can list all available ones using the
181 configure option "–list-indevs".
183 <p>You can disable all the input devices using the configure option
184 "–disable-indevs", and selectively enable an input device using the
185 option "–enable-indev=<var>INDEV</var>", or you can disable a particular
186 input device using the option "–disable-indev=<var>INDEV</var>".
188 <p>The option "-devices" of the ff* tools will display the list of
189 supported input devices.
191 <p>A description of the currently available input devices follows.
194 <h3 class="section">3.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
196 <p>ALSA (Advanced Linux Sound Architecture) input device.
198 <p>To enable this input device during configuration you need libasound
199 installed on your system.
201 <p>This device allows capturing from an ALSA device. The name of the
202 device to capture has to be an ALSA card identifier.
204 <p>An ALSA identifier has the syntax:
205 </p><div class="example">
206 <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
209 <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
211 <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
212 specify card number or identifier, device number and subdevice number
215 <p>To see the list of cards currently recognized by your system check the
216 files <samp>/proc/asound/cards</samp> and <samp>/proc/asound/devices</samp>.
218 <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
219 card id 0, you may run the command:
220 </p><div class="example">
221 <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
224 <p>For more information see:
225 <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>
227 <a name="avfoundation"></a>
228 <h3 class="section">3.2 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
230 <p>AVFoundation input device.
232 <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS.
233 The older QTKit framework has been marked deprecated since OSX version 10.7.
235 <p>The input filename has to be given in the following syntax:
236 </p><div class="example">
237 <pre class="example">-i "[[VIDEO]:[AUDIO]]"
239 <p>The first entry selects the video input while the latter selects the audio input.
240 The stream has to be specified by the device name or the device index as shown by the device list.
241 Alternatively, the video and/or audio input device can be chosen by index using the
243 -video_device_index <INDEX>
247 -audio_device_index <INDEX>
250 device name or index given in the input filename.
252 <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
253 all device names and corresponding indices.
255 <p>There are two device name aliases:
256 </p><dl compact="compact">
257 <dt><code>default</code></dt>
258 <dd><p>Select the AVFoundation default device of the corresponding type.
261 <dt><code>none</code></dt>
262 <dd><p>Do not record the corresponding media type.
263 This is equivalent to specifying an empty device name or index.
268 <a name="Options"></a>
269 <h4 class="subsection">3.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h4>
271 <p>AVFoundation supports the following options:
273 <dl compact="compact">
274 <dt><samp>-list_devices <TRUE|FALSE></samp></dt>
275 <dd><p>If set to true, a list of all available input devices is given showing all
276 device names and indices.
279 <dt><samp>-video_device_index <INDEX></samp></dt>
280 <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
283 <dt><samp>-audio_device_index <INDEX></samp></dt>
284 <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
287 <dt><samp>-pixel_format <FORMAT></samp></dt>
288 <dd><p>Request the video device to use a specific pixel format.
289 If the specified format is not supported, a list of available formats is given
290 und the first one in this list is used instead. Available pixel formats are:
291 <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
292 bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
293 yuv420p, nv12, yuyv422, gray</code>
298 <a name="Examples"></a>
299 <h4 class="subsection">3.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
302 <li> Print the list of AVFoundation supported devices and exit:
303 <div class="example">
304 <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i ""
307 </li><li> Record video from video device 0 and audio from audio device 0 into out.avi:
308 <div class="example">
309 <pre class="example">$ ffmpeg -f avfoundation -i "0:0" out.avi
312 </li><li> Record video from video device 2 and audio from audio device 1 into out.avi:
313 <div class="example">
314 <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
317 </li><li> Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
318 <div class="example">
319 <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
325 <h3 class="section">3.3 bktr<span class="pull-right"><a class="anchor hidden-xs" href="#bktr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bktr" aria-hidden="true">TOC</a></span></h3>
327 <p>BSD video input device.
329 <a name="decklink"></a>
330 <h3 class="section">3.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
332 <p>The decklink input device provides capture capabilities for Blackmagic
335 <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
336 need to configure with the appropriate <code>--extra-cflags</code>
337 and <code>--extra-ldflags</code>.
338 On Windows, you need to run the IDL files through <code>widl</code>.
340 <p>DeckLink is very picky about the formats it supports. Pixel format is
341 uyvy422 or v210, framerate and video size must be determined for your device with
342 <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
343 of channels can be 2, 8 or 16.
345 <a name="Options-1"></a>
346 <h4 class="subsection">3.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
348 <dl compact="compact">
349 <dt><samp>list_devices</samp></dt>
350 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
351 Defaults to <samp>false</samp>.
354 <dt><samp>list_formats</samp></dt>
355 <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
356 Defaults to <samp>false</samp>.
359 <dt><samp>bm_v210</samp></dt>
360 <dd><p>If set to ‘<samp>1</samp>’, video is captured in 10 bit v210 instead
361 of uyvy422. Not all Blackmagic devices support this option.
366 <a name="Examples-1"></a>
367 <h4 class="subsection">3.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
370 <li> List input devices:
371 <div class="example">
372 <pre class="example">ffmpeg -f decklink -list_devices 1 -i dummy
375 </li><li> List supported formats:
376 <div class="example">
377 <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
380 </li><li> Capture video clip at 1080i50 (format 11):
381 <div class="example">
382 <pre class="example">ffmpeg -f decklink -i 'Intensity Pro@11' -acodec copy -vcodec copy output.avi
385 </li><li> Capture video clip at 1080i50 10 bit:
386 <div class="example">
387 <pre class="example">ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@11' -acodec copy -vcodec copy output.avi
390 </li><li> Capture video clip at 720p50 with 32bit audio:
391 <div class="example">
392 <pre class="example">ffmpeg -bm_audiodepth 32 -f decklink -i 'UltraStudio Mini Recorder@14' -acodec copy -vcodec copy output.avi
395 </li><li> Capture video clip at 576i50 with 8 audio channels:
396 <div class="example">
397 <pre class="example">ffmpeg -bm_channels 8 -f decklink -i 'UltraStudio Mini Recorder@3' -acodec copy -vcodec copy output.avi
403 <h3 class="section">3.5 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
405 <p>Windows DirectShow input device.
407 <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
408 Currently only audio and video devices are supported.
410 <p>Multiple devices may be opened as separate inputs, but they may also be
411 opened on the same input, which should improve synchronism between them.
413 <p>The input name should be in the format:
415 <div class="example">
416 <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
419 <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
420 and <var>NAME</var> is the device’s name or alternative name..
422 <a name="Options-2"></a>
423 <h4 class="subsection">3.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
425 <p>If no options are specified, the device’s defaults are used.
426 If the device does not support the requested options, it will
429 <dl compact="compact">
430 <dt><samp>video_size</samp></dt>
431 <dd><p>Set the video size in the captured video.
434 <dt><samp>framerate</samp></dt>
435 <dd><p>Set the frame rate in the captured video.
438 <dt><samp>sample_rate</samp></dt>
439 <dd><p>Set the sample rate (in Hz) of the captured audio.
442 <dt><samp>sample_size</samp></dt>
443 <dd><p>Set the sample size (in bits) of the captured audio.
446 <dt><samp>channels</samp></dt>
447 <dd><p>Set the number of channels in the captured audio.
450 <dt><samp>list_devices</samp></dt>
451 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
454 <dt><samp>list_options</samp></dt>
455 <dd><p>If set to <samp>true</samp>, print a list of selected device’s options
459 <dt><samp>video_device_number</samp></dt>
460 <dd><p>Set video device number for devices with same name (starts at 0,
464 <dt><samp>audio_device_number</samp></dt>
465 <dd><p>Set audio device number for devices with same name (starts at 0,
469 <dt><samp>pixel_format</samp></dt>
470 <dd><p>Select pixel format to be used by DirectShow. This may only be set when
471 the video codec is not set or set to rawvideo.
474 <dt><samp>audio_buffer_size</samp></dt>
475 <dd><p>Set audio device buffer size in milliseconds (which can directly
476 impact latency, depending on the device).
477 Defaults to using the audio device’s
478 default buffer size (typically some multiple of 500ms).
479 Setting this value too low can degrade performance.
481 <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx</a>
484 <dt><samp>video_pin_name</samp></dt>
485 <dd><p>Select video capture pin to use by name or alternative name.
488 <dt><samp>audio_pin_name</samp></dt>
489 <dd><p>Select audio capture pin to use by name or alternative name.
492 <dt><samp>crossbar_video_input_pin_number</samp></dt>
493 <dd><p>Select video input pin number for crossbar device. This will be
494 routed to the crossbar device’s Video Decoder output pin.
495 Note that changing this value can affect future invocations
496 (sets a new default) until system reboot occurs.
499 <dt><samp>crossbar_audio_input_pin_number</samp></dt>
500 <dd><p>Select audio input pin number for crossbar device. This will be
501 routed to the crossbar device’s Audio Decoder output pin.
502 Note that changing this value can affect future invocations
503 (sets a new default) until system reboot occurs.
506 <dt><samp>show_video_device_dialog</samp></dt>
507 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
508 to the end user, allowing them to change video filter properties
509 and configurations manually.
510 Note that for crossbar devices, adjusting values in this dialog
511 may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
512 input frame rates, sizes, interlacing, etc. Changing these values can
513 enable different scan rates/frame rates and avoiding green bars at
514 the bottom, flickering scan lines, etc.
515 Note that with some devices, changing these properties can also affect future
516 invocations (sets new defaults) until system reboot occurs.
519 <dt><samp>show_audio_device_dialog</samp></dt>
520 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
521 to the end user, allowing them to change audio filter properties
522 and configurations manually.
525 <dt><samp>show_video_crossbar_connection_dialog</samp></dt>
526 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
527 dialog to the end user, allowing them to manually
528 modify crossbar pin routings, when it opens a video device.
531 <dt><samp>show_audio_crossbar_connection_dialog</samp></dt>
532 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
533 dialog to the end user, allowing them to manually
534 modify crossbar pin routings, when it opens an audio device.
537 <dt><samp>show_analog_tv_tuner_dialog</samp></dt>
538 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
539 dialog to the end user, allowing them to manually
540 modify TV channels and frequencies.
543 <dt><samp>show_analog_tv_tuner_audio_dialog</samp></dt>
544 <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
545 dialog to the end user, allowing them to manually
546 modify TV audio (like mono vs. stereo, Language A,B or C).
549 <dt><samp>audio_device_load</samp></dt>
550 <dd><p>Load an audio capture filter device from file instead of searching
551 it by name. It may load additional parameters too, if the filter
552 supports the serialization of its properties to.
553 To use this an audio capture source has to be specified, but it can
554 be anything even fake one.
557 <dt><samp>audio_device_save</samp></dt>
558 <dd><p>Save the currently used audio capture filter device and its
559 parameters (if the filter supports it) to a file.
560 If a file with the same name exists it will be overwritten.
563 <dt><samp>video_device_load</samp></dt>
564 <dd><p>Load a video capture filter device from file instead of searching
565 it by name. It may load additional parameters too, if the filter
566 supports the serialization of its properties to.
567 To use this a video capture source has to be specified, but it can
568 be anything even fake one.
571 <dt><samp>video_device_save</samp></dt>
572 <dd><p>Save the currently used video capture filter device and its
573 parameters (if the filter supports it) to a file.
574 If a file with the same name exists it will be overwritten.
579 <a name="Examples-2"></a>
580 <h4 class="subsection">3.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
583 <li> Print the list of DirectShow supported devices and exit:
584 <div class="example">
585 <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
588 </li><li> Open video device <var>Camera</var>:
589 <div class="example">
590 <pre class="example">$ ffmpeg -f dshow -i video="Camera"
593 </li><li> Open second video device with name <var>Camera</var>:
594 <div class="example">
595 <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
598 </li><li> Open video device <var>Camera</var> and audio device <var>Microphone</var>:
599 <div class="example">
600 <pre class="example">$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
603 </li><li> Print the list of supported options in selected device and exit:
604 <div class="example">
605 <pre class="example">$ ffmpeg -list_options true -f dshow -i video="Camera"
608 </li><li> Specify pin names to capture by name or alternative name, specify alternative device name:
609 <div class="example">
610 <pre class="example">$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
613 </li><li> Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
614 <div class="example">
615 <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
616 -crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
621 <a name="dv1394"></a>
622 <h3 class="section">3.6 dv1394<span class="pull-right"><a class="anchor hidden-xs" href="#dv1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dv1394" aria-hidden="true">TOC</a></span></h3>
624 <p>Linux DV 1394 input device.
627 <h3 class="section">3.7 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
629 <p>Linux framebuffer input device.
631 <p>The Linux framebuffer is a graphic hardware-independent abstraction
632 layer to show graphics on a computer monitor, typically on the
633 console. It is accessed through a file device node, usually
634 <samp>/dev/fb0</samp>.
636 <p>For more detailed information read the file
637 Documentation/fb/framebuffer.txt included in the Linux source tree.
639 <p>To record from the framebuffer device <samp>/dev/fb0</samp> with
641 </p><div class="example">
642 <pre class="example">ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
645 <p>You can take a single screenshot image with the command:
646 </p><div class="example">
647 <pre class="example">ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
650 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
652 <a name="gdigrab"></a>
653 <h3 class="section">3.8 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
655 <p>Win32 GDI-based screen capture device.
657 <p>This device allows you to capture a region of the display on Windows.
659 <p>There are two options for the input filename:
660 </p><div class="example">
661 <pre class="example">desktop
664 </p><div class="example">
665 <pre class="example">title=<var>window_title</var>
668 <p>The first option will capture the entire desktop, or a fixed region of the
669 desktop. The second option will instead capture the contents of a single
670 window, regardless of its position on the screen.
672 <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
673 </p><div class="example">
674 <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
677 <p>Grab a 640x480 region at position <code>10,20</code>:
678 </p><div class="example">
679 <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
682 <p>Grab the contents of the window named "Calculator"
683 </p><div class="example">
684 <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
687 <a name="Options-3"></a>
688 <h4 class="subsection">3.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
690 <dl compact="compact">
691 <dt><samp>draw_mouse</samp></dt>
692 <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
693 not draw the pointer. Default value is <code>1</code>.
696 <dt><samp>framerate</samp></dt>
697 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
698 corresponding to a frame rate of <code>30000/1001</code>.
701 <dt><samp>show_region</samp></dt>
702 <dd><p>Show grabbed region on screen.
704 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
705 region will be indicated on screen. With this option, it is easy to
706 know what is being grabbed if only a portion of the screen is grabbed.
708 <p>Note that <var>show_region</var> is incompatible with grabbing the contents
712 </p><div class="example">
713 <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
717 <dt><samp>video_size</samp></dt>
718 <dd><p>Set the video frame size. The default is to capture the full screen if <samp>desktop</samp> is selected, or the full window size if <samp>title=<var>window_title</var></samp> is selected.
721 <dt><samp>offset_x</samp></dt>
722 <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
724 <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative <var>offset_x</var> value to move the region to that monitor.
727 <dt><samp>offset_y</samp></dt>
728 <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
730 <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative <var>offset_y</var> value to move the region to that monitor.
735 <a name="iec61883"></a>
736 <h3 class="section">3.9 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
738 <p>FireWire DV/HDV input device using libiec61883.
740 <p>To enable this input device, you need libiec61883, libraw1394 and
741 libavc1394 installed on your system. Use the configure option
742 <code>--enable-libiec61883</code> to compile with the device enabled.
744 <p>The iec61883 capture device supports capturing from a video device
745 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
746 FireWire stack (juju). This is the default DV/HDV input method in Linux
747 Kernel 2.6.37 and later, since the old FireWire stack was removed.
749 <p>Specify the FireWire port to be used as input file, or "auto"
750 to choose the first port connected.
752 <a name="Options-4"></a>
753 <h4 class="subsection">3.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
755 <dl compact="compact">
756 <dt><samp>dvtype</samp></dt>
757 <dd><p>Override autodetection of DV/HDV. This should only be used if auto
758 detection does not work, or if usage of a different device type
759 should be prohibited. Treating a DV device as HDV (or vice versa) will
760 not work and result in undefined behavior.
761 The values <samp>auto</samp>, <samp>dv</samp> and <samp>hdv</samp> are supported.
764 <dt><samp>dvbuffer</samp></dt>
765 <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
766 is an exact value. For HDV, it is not frame exact, since HDV does
767 not have a fixed frame size.
770 <dt><samp>dvguid</samp></dt>
771 <dd><p>Select the capture device by specifying it’s GUID. Capturing will only
772 be performed from the specified device and fails if no device with the
773 given GUID is found. This is useful to select the input if multiple
774 devices are connected at the same time.
775 Look at /sys/bus/firewire/devices to find out the GUIDs.
780 <a name="Examples-3"></a>
781 <h4 class="subsection">3.9.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
784 <li> Grab and show the input of a FireWire DV/HDV device.
785 <div class="example">
786 <pre class="example">ffplay -f iec61883 -i auto
789 </li><li> Grab and record the input of a FireWire DV/HDV device,
790 using a packet buffer of 100000 packets if the source is HDV.
791 <div class="example">
792 <pre class="example">ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
798 <h3 class="section">3.10 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
800 <p>JACK input device.
802 <p>To enable this input device during configuration you need libjack
803 installed on your system.
805 <p>A JACK input device creates one or more JACK writable clients, one for
806 each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
807 <var>client_name</var> is the name provided by the application, and <var>N</var>
808 is a number which identifies the channel.
809 Each writable client will send the acquired data to the FFmpeg input
812 <p>Once you have created one or more JACK readable clients, you need to
813 connect them to one or more JACK writable clients.
815 <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
816 and <code>jack_disconnect</code> programs, or do it through a graphical interface,
817 for example with <code>qjackctl</code>.
819 <p>To list the JACK clients and their properties you can invoke the command
820 <code>jack_lsp</code>.
822 <p>Follows an example which shows how to capture a JACK readable client
823 with <code>ffmpeg</code>.
824 </p><div class="example">
825 <pre class="example"># Create a JACK writable client with name "ffmpeg".
826 $ ffmpeg -f jack -i ffmpeg -y out.wav
828 # Start the sample jack_metro readable client.
829 $ jack_metro -b 120 -d 0.2 -f 4000
831 # List the current JACK clients.
840 # Connect metro to the ffmpeg writable client.
841 $ jack_connect metro:120_bpm ffmpeg:input_1
844 <p>For more information read:
845 <a href="http://jackaudio.org/">http://jackaudio.org/</a>
848 <h3 class="section">3.11 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
850 <p>Libavfilter input virtual device.
852 <p>This input device reads data from the open output pads of a libavfilter
855 <p>For each filtergraph open output, the input device will create a
856 corresponding stream which is mapped to the generated output. Currently
857 only video data is supported. The filtergraph is specified through the
858 option <samp>graph</samp>.
860 <a name="Options-5"></a>
861 <h4 class="subsection">3.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
863 <dl compact="compact">
864 <dt><samp>graph</samp></dt>
865 <dd><p>Specify the filtergraph to use as input. Each video open output must be
866 labelled by a unique string of the form "out<var>N</var>", where <var>N</var> is a
867 number starting from 0 corresponding to the mapped input stream
868 generated by the device.
869 The first unlabelled output is automatically assigned to the "out0"
870 label, but all the others need to be specified explicitly.
872 <p>The suffix "+subcc" can be appended to the output label to create an extra
873 stream with the closed captions packets attached to that output
874 (experimental; only for EIA-608 / CEA-708 for now).
875 The subcc streams are created after all the normal streams, in the order of
876 the corresponding stream.
877 For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the
878 stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
880 <p>If not specified defaults to the filename specified for the input
884 <dt><samp>graph_file</samp></dt>
885 <dd><p>Set the filename of the filtergraph to be read and sent to the other
886 filters. Syntax of the filtergraph is the same as the one specified by
887 the option <var>graph</var>.
892 <a name="Examples-4"></a>
893 <h4 class="subsection">3.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
896 <li> Create a color video stream and play it back with <code>ffplay</code>:
897 <div class="example">
898 <pre class="example">ffplay -f lavfi -graph "color=c=pink [out0]" dummy
901 </li><li> As the previous example, but use filename for specifying the graph
902 description, and omit the "out0" label:
903 <div class="example">
904 <pre class="example">ffplay -f lavfi color=c=pink
907 </li><li> Create three different video test filtered sources and play them:
908 <div class="example">
909 <pre class="example">ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
912 </li><li> Read an audio stream from a file using the amovie source and play it
913 back with <code>ffplay</code>:
914 <div class="example">
915 <pre class="example">ffplay -f lavfi "amovie=test.wav"
918 </li><li> Read an audio stream and a video stream and play it back with
920 <div class="example">
921 <pre class="example">ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
924 </li><li> Dump decoded frames to images and closed captions to a file (experimental):
925 <div class="example">
926 <pre class="example">ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
931 <a name="libcdio"></a>
932 <h3 class="section">3.12 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
934 <p>Audio-CD input device based on libcdio.
936 <p>To enable this input device during configuration you need libcdio
937 installed on your system. It requires the configure option
938 <code>--enable-libcdio</code>.
940 <p>This device allows playing and grabbing from an Audio-CD.
942 <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in <samp>/dev/sr0</samp>,
943 you may run the command:
944 </p><div class="example">
945 <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
948 <a name="Options-6"></a>
949 <h4 class="subsection">3.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
950 <dl compact="compact">
951 <dt><samp>speed</samp></dt>
952 <dd><p>Set drive reading speed. Default value is 0.
954 <p>The speed is specified CD-ROM speed units. The speed is set through
955 the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
956 drives, specifying a value too large will result in using the fastest
960 <dt><samp>paranoia_mode</samp></dt>
961 <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
963 <dl compact="compact">
964 <dt>‘<samp>disable</samp>’</dt>
965 <dt>‘<samp>verify</samp>’</dt>
966 <dt>‘<samp>overlap</samp>’</dt>
967 <dt>‘<samp>neverskip</samp>’</dt>
968 <dt>‘<samp>full</samp>’</dt>
971 <p>Default value is ‘<samp>disable</samp>’.
973 <p>For more information about the available recovery modes, consult the
974 paranoia project documentation.
978 <a name="libdc1394"></a>
979 <h3 class="section">3.13 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
981 <p>IIDC1394 input device, based on libdc1394 and libraw1394.
983 <p>Requires the configure option <code>--enable-libdc1394</code>.
985 <a name="openal"></a>
986 <h3 class="section">3.14 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
988 <p>The OpenAL input device provides audio capture on all systems with a
989 working OpenAL 1.1 implementation.
991 <p>To enable this input device during configuration, you need OpenAL
992 headers and libraries installed on your system, and need to configure
993 FFmpeg with <code>--enable-openal</code>.
995 <p>OpenAL headers and libraries should be provided as part of your OpenAL
996 implementation, or as an additional download (an SDK). Depending on your
997 installation you may need to specify additional flags via the
998 <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
999 system to locate the OpenAL headers and libraries.
1001 <p>An incomplete list of OpenAL implementations follows:
1003 <dl compact="compact">
1004 <dt><strong>Creative</strong></dt>
1005 <dd><p>The official Windows implementation, providing hardware acceleration
1006 with supported devices and software fallback.
1007 See <a href="http://openal.org/">http://openal.org/</a>.
1009 <dt><strong>OpenAL Soft</strong></dt>
1010 <dd><p>Portable, open source (LGPL) software implementation. Includes
1011 backends for the most common sound APIs on the Windows, Linux,
1012 Solaris, and BSD operating systems.
1013 See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
1015 <dt><strong>Apple</strong></dt>
1016 <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
1017 See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
1021 <p>This device allows one to capture from an audio input device handled
1024 <p>You need to specify the name of the device to capture in the provided
1025 filename. If the empty string is provided, the device will
1026 automatically select the default device. You can get the list of the
1027 supported devices by using the option <var>list_devices</var>.
1029 <a name="Options-7"></a>
1030 <h4 class="subsection">3.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
1032 <dl compact="compact">
1033 <dt><samp>channels</samp></dt>
1034 <dd><p>Set the number of channels in the captured audio. Only the values
1035 <samp>1</samp> (monaural) and <samp>2</samp> (stereo) are currently supported.
1036 Defaults to <samp>2</samp>.
1039 <dt><samp>sample_size</samp></dt>
1040 <dd><p>Set the sample size (in bits) of the captured audio. Only the values
1041 <samp>8</samp> and <samp>16</samp> are currently supported. Defaults to
1045 <dt><samp>sample_rate</samp></dt>
1046 <dd><p>Set the sample rate (in Hz) of the captured audio.
1047 Defaults to <samp>44.1k</samp>.
1050 <dt><samp>list_devices</samp></dt>
1051 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
1052 Defaults to <samp>false</samp>.
1057 <a name="Examples-5"></a>
1058 <h4 class="subsection">3.14.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
1060 <p>Print the list of OpenAL supported devices and exit:
1061 </p><div class="example">
1062 <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
1065 <p>Capture from the OpenAL device <samp>DR-BT101 via PulseAudio</samp>:
1066 </p><div class="example">
1067 <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
1070 <p>Capture from the default device (note the empty string ” as filename):
1071 </p><div class="example">
1072 <pre class="example">$ ffmpeg -f openal -i '' out.ogg
1075 <p>Capture from two devices simultaneously, writing to two different files,
1076 within the same <code>ffmpeg</code> command:
1077 </p><div class="example">
1078 <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
1080 <p>Note: not all OpenAL implementations support multiple simultaneous capture -
1081 try the latest OpenAL Soft if the above does not work.
1084 <h3 class="section">3.15 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
1086 <p>Open Sound System input device.
1088 <p>The filename to provide to the input device is the device node
1089 representing the OSS input device, and is usually set to
1090 <samp>/dev/dsp</samp>.
1092 <p>For example to grab from <samp>/dev/dsp</samp> using <code>ffmpeg</code> use the
1094 </p><div class="example">
1095 <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
1098 <p>For more information about OSS see:
1099 <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
1101 <a name="pulse"></a>
1102 <h3 class="section">3.16 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
1104 <p>PulseAudio input device.
1106 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
1108 <p>The filename to provide to the input device is a source device or the
1109 string "default"
1111 <p>To list the PulseAudio source devices and their properties you can invoke
1112 the command <code>pactl list sources</code>.
1114 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
1116 <a name="Options-8"></a>
1117 <h4 class="subsection">3.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
1118 <dl compact="compact">
1119 <dt><samp>server</samp></dt>
1120 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
1121 Default server is used when not provided.
1124 <dt><samp>name</samp></dt>
1125 <dd><p>Specify the application name PulseAudio will use when showing active clients,
1126 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
1129 <dt><samp>stream_name</samp></dt>
1130 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
1131 by default it is "record".
1134 <dt><samp>sample_rate</samp></dt>
1135 <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
1138 <dt><samp>channels</samp></dt>
1139 <dd><p>Specify the channels in use, by default 2 (stereo) is set.
1142 <dt><samp>frame_size</samp></dt>
1143 <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
1146 <dt><samp>fragment_size</samp></dt>
1147 <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
1148 audio latency. By default it is unset.
1152 <a name="Examples-6"></a>
1153 <h4 class="subsection">3.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
1154 <p>Record a stream from default device:
1155 </p><div class="example">
1156 <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
1159 <a name="qtkit"></a>
1160 <h3 class="section">3.17 qtkit<span class="pull-right"><a class="anchor hidden-xs" href="#qtkit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qtkit" aria-hidden="true">TOC</a></span></h3>
1162 <p>QTKit input device.
1164 <p>The filename passed as input is parsed to contain either a device name or index.
1165 The device index can also be given by using -video_device_index.
1166 A given device index will override any given device name.
1167 If the desired device consists of numbers only, use -video_device_index to identify it.
1168 The default device will be chosen if an empty string or the device name "default" is given.
1169 The available devices can be enumerated by using -list_devices.
1171 <div class="example">
1172 <pre class="example">ffmpeg -f qtkit -i "0" out.mpg
1175 <div class="example">
1176 <pre class="example">ffmpeg -f qtkit -video_device_index 0 -i "" out.mpg
1179 <div class="example">
1180 <pre class="example">ffmpeg -f qtkit -i "default" out.mpg
1183 <div class="example">
1184 <pre class="example">ffmpeg -f qtkit -list_devices true -i ""
1187 <a name="sndio"></a>
1188 <h3 class="section">3.18 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
1190 <p>sndio input device.
1192 <p>To enable this input device during configuration you need libsndio
1193 installed on your system.
1195 <p>The filename to provide to the input device is the device node
1196 representing the sndio input device, and is usually set to
1197 <samp>/dev/audio0</samp>.
1199 <p>For example to grab from <samp>/dev/audio0</samp> using <code>ffmpeg</code> use the
1201 </p><div class="example">
1202 <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
1205 <a name="video4linux2_002c-v4l2"></a>
1206 <h3 class="section">3.19 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
1208 <p>Video4Linux2 input video device.
1210 <p>"v4l2" can be used as alias for "video4linux2".
1212 <p>If FFmpeg is built with v4l-utils support (by using the
1213 <code>--enable-libv4l2</code> configure option), it is possible to use it with the
1214 <code>-use_libv4l2</code> input device option.
1216 <p>The name of the device to grab is a file device node, usually Linux
1217 systems tend to automatically create such nodes when the device
1218 (e.g. an USB webcam) is plugged into the system, and has a name of the
1219 kind <samp>/dev/video<var>N</var></samp>, where <var>N</var> is a number associated to
1222 <p>Video4Linux2 devices usually support a limited set of
1223 <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
1224 supported using <code>-list_formats all</code> for Video4Linux2 devices.
1225 Some devices, like TV cards, support one or more standards. It is possible
1226 to list all the supported standards using <code>-list_standards all</code>.
1228 <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
1229 version and configuration, the timestamps may be derived from the real time
1230 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
1231 boot time, unaffected by NTP or manual changes to the clock). The
1232 <samp>-timestamps abs</samp> or <samp>-ts abs</samp> option can be used to force
1233 conversion into the real time clock.
1235 <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
1236 and <code>ffplay</code>:
1238 <li> List supported formats for a video4linux2 device:
1239 <div class="example">
1240 <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
1243 </li><li> Grab and show the input of a video4linux2 device:
1244 <div class="example">
1245 <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
1248 </li><li> Grab and record the input of a video4linux2 device, leave the
1249 frame rate and size as previously set:
1250 <div class="example">
1251 <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
1255 <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
1257 <a name="Options-9"></a>
1258 <h4 class="subsection">3.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
1260 <dl compact="compact">
1261 <dt><samp>standard</samp></dt>
1262 <dd><p>Set the standard. Must be the name of a supported standard. To get a
1263 list of the supported standards, use the <samp>list_standards</samp>
1267 <dt><samp>channel</samp></dt>
1268 <dd><p>Set the input channel number. Default to -1, which means using the
1269 previously selected channel.
1272 <dt><samp>video_size</samp></dt>
1273 <dd><p>Set the video frame size. The argument must be a string in the form
1274 <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
1277 <dt><samp>pixel_format</samp></dt>
1278 <dd><p>Select the pixel format (only valid for raw video input).
1281 <dt><samp>input_format</samp></dt>
1282 <dd><p>Set the preferred pixel format (for raw video) or a codec name.
1283 This option allows one to select the input format, when several are
1287 <dt><samp>framerate</samp></dt>
1288 <dd><p>Set the preferred video frame rate.
1291 <dt><samp>list_formats</samp></dt>
1292 <dd><p>List available formats (supported pixel formats, codecs, and frame
1295 <p>Available values are:
1296 </p><dl compact="compact">
1297 <dt>‘<samp>all</samp>’</dt>
1298 <dd><p>Show all available (compressed and non-compressed) formats.
1301 <dt>‘<samp>raw</samp>’</dt>
1302 <dd><p>Show only raw video (non-compressed) formats.
1305 <dt>‘<samp>compressed</samp>’</dt>
1306 <dd><p>Show only compressed formats.
1311 <dt><samp>list_standards</samp></dt>
1312 <dd><p>List supported standards and exit.
1314 <p>Available values are:
1315 </p><dl compact="compact">
1316 <dt>‘<samp>all</samp>’</dt>
1317 <dd><p>Show all supported standards.
1322 <dt><samp>timestamps, ts</samp></dt>
1323 <dd><p>Set type of timestamps for grabbed frames.
1325 <p>Available values are:
1326 </p><dl compact="compact">
1327 <dt>‘<samp>default</samp>’</dt>
1328 <dd><p>Use timestamps from the kernel.
1331 <dt>‘<samp>abs</samp>’</dt>
1332 <dd><p>Use absolute timestamps (wall clock).
1335 <dt>‘<samp>mono2abs</samp>’</dt>
1336 <dd><p>Force conversion from monotonic to absolute timestamps.
1340 <p>Default value is <code>default</code>.
1344 <a name="vfwcap"></a>
1345 <h3 class="section">3.20 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
1347 <p>VfW (Video for Windows) capture input device.
1349 <p>The filename passed as input is the capture driver number, ranging from
1350 0 to 9. You may use "list" as filename to print a list of drivers. Any
1351 other filename will be interpreted as device number 0.
1353 <a name="x11grab"></a>
1354 <h3 class="section">3.21 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
1356 <p>X11 video input device.
1358 <p>To enable this input device during configuration you need libxcb
1359 installed on your system. It will be automatically detected during
1362 <p>Alternatively, the configure option <samp>--enable-x11grab</samp> exists
1363 for legacy Xlib users.
1365 <p>This device allows one to capture a region of an X11 display.
1367 <p>The filename passed as input has the syntax:
1368 </p><div class="example">
1369 <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
1372 <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
1373 X11 display name of the screen to grab from. <var>hostname</var> can be
1374 omitted, and defaults to "localhost". The environment variable
1375 <code>DISPLAY</code> contains the default display name.
1377 <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
1378 area with respect to the top-left border of the X11 screen. They
1381 <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
1384 <p>Use the <code>xdpyinfo</code> program for getting basic information about
1385 the properties of your X11 display (e.g. grep for "name" or
1386 "dimensions").
1388 <p>For example to grab from <samp>:0.0</samp> using <code>ffmpeg</code>:
1389 </p><div class="example">
1390 <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
1393 <p>Grab at position <code>10,20</code>:
1394 </p><div class="example">
1395 <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
1398 <a name="Options-10"></a>
1399 <h4 class="subsection">3.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
1401 <dl compact="compact">
1402 <dt><samp>draw_mouse</samp></dt>
1403 <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specify
1404 not to draw the pointer. Default value is <code>1</code>.
1407 <dt><samp>follow_mouse</samp></dt>
1408 <dd><p>Make the grabbed area follow the mouse. The argument can be
1409 <code>centered</code> or a number of pixels <var>PIXELS</var>.
1411 <p>When it is specified with "centered", the grabbing region follows the mouse
1412 pointer and keeps the pointer at the center of region; otherwise, the region
1413 follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
1414 zero) to the edge of region.
1417 </p><div class="example">
1418 <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
1421 <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
1422 </p><div class="example">
1423 <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
1427 <dt><samp>framerate</samp></dt>
1428 <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
1429 corresponding to a frame rate of <code>30000/1001</code>.
1432 <dt><samp>show_region</samp></dt>
1433 <dd><p>Show grabbed region on screen.
1435 <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
1436 region will be indicated on screen. With this option, it is easy to
1437 know what is being grabbed if only a portion of the screen is grabbed.
1440 <dt><samp>region_border</samp></dt>
1441 <dd><p>Set the region border thickness if <samp>-show_region 1</samp> is used.
1442 Range is 1 to 128 and default is 3 (XCB-based x11grab only).
1445 </p><div class="example">
1446 <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
1449 <p>With <var>follow_mouse</var>:
1450 </p><div class="example">
1451 <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
1455 <dt><samp>video_size</samp></dt>
1456 <dd><p>Set the video frame size. Default value is <code>vga</code>.
1459 <dt><samp>use_shm</samp></dt>
1460 <dd><p>Use the MIT-SHM extension for shared memory. Default value is <code>1</code>.
1461 It may be necessary to disable it for remote displays (legacy x11grab
1466 <a name="grab_005fx-grab_005fy-AVOption"></a>
1467 <h4 class="subsection">3.21.2 <var>grab_x</var> <var>grab_y</var> AVOption<span class="pull-right"><a class="anchor hidden-xs" href="#grab_005fx-grab_005fy-AVOption" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-grab_005fx-grab_005fy-AVOption" aria-hidden="true">TOC</a></span></h4>
1470 </p><div class="example">
1471 <pre class="example">-grab_x <var>x_offset</var> -grab_y <var>y_offset</var>
1474 <p>Set the grabbing region coordinates. They are expressed as offset from the top left
1475 corner of the X11 window. The default value is 0.
1478 <a name="Output-Devices"></a>
1479 <h2 class="chapter">4 Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Output-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-Devices" aria-hidden="true">TOC</a></span></h2>
1481 <p>Output devices are configured elements in FFmpeg that can write
1482 multimedia data to an output device attached to your system.
1484 <p>When you configure your FFmpeg build, all the supported output devices
1485 are enabled by default. You can list all available ones using the
1486 configure option "–list-outdevs".
1488 <p>You can disable all the output devices using the configure option
1489 "–disable-outdevs", and selectively enable an output device using the
1490 option "–enable-outdev=<var>OUTDEV</var>", or you can disable a particular
1491 input device using the option "–disable-outdev=<var>OUTDEV</var>".
1493 <p>The option "-devices" of the ff* tools will display the list of
1494 enabled output devices.
1496 <p>A description of the currently available output devices follows.
1498 <a name="alsa-1"></a>
1499 <h3 class="section">4.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa-1" aria-hidden="true">TOC</a></span></h3>
1501 <p>ALSA (Advanced Linux Sound Architecture) output device.
1503 <a name="Examples-7"></a>
1504 <h4 class="subsection">4.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
1507 <li> Play a file on default ALSA device:
1508 <div class="example">
1509 <pre class="example">ffmpeg -i INPUT -f alsa default
1512 </li><li> Play a file on soundcard 1, audio device 7:
1513 <div class="example">
1514 <pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
1519 <h3 class="section">4.2 caca<span class="pull-right"><a class="anchor hidden-xs" href="#caca" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-caca" aria-hidden="true">TOC</a></span></h3>
1521 <p>CACA output device.
1523 <p>This output device allows one to show a video stream in CACA window.
1524 Only one CACA window is allowed per application, so you can
1525 have only one instance of this output device in an application.
1527 <p>To enable this output device you need to configure FFmpeg with
1528 <code>--enable-libcaca</code>.
1529 libcaca is a graphics library that outputs text instead of pixels.
1531 <p>For more information about libcaca, check:
1532 <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
1534 <a name="Options-11"></a>
1535 <h4 class="subsection">4.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
1537 <dl compact="compact">
1538 <dt><samp>window_title</samp></dt>
1539 <dd><p>Set the CACA window title, if not specified default to the filename
1540 specified for the output device.
1543 <dt><samp>window_size</samp></dt>
1544 <dd><p>Set the CACA window size, can be a string of the form
1545 <var>width</var>x<var>height</var> or a video size abbreviation.
1546 If not specified it defaults to the size of the input video.
1549 <dt><samp>driver</samp></dt>
1550 <dd><p>Set display driver.
1553 <dt><samp>algorithm</samp></dt>
1554 <dd><p>Set dithering algorithm. Dithering is necessary
1555 because the picture being rendered has usually far more colours than
1556 the available palette.
1557 The accepted values are listed with <code>-list_dither algorithms</code>.
1560 <dt><samp>antialias</samp></dt>
1561 <dd><p>Set antialias method. Antialiasing smoothens the rendered
1562 image and avoids the commonly seen staircase effect.
1563 The accepted values are listed with <code>-list_dither antialiases</code>.
1566 <dt><samp>charset</samp></dt>
1567 <dd><p>Set which characters are going to be used when rendering text.
1568 The accepted values are listed with <code>-list_dither charsets</code>.
1571 <dt><samp>color</samp></dt>
1572 <dd><p>Set color to be used when rendering text.
1573 The accepted values are listed with <code>-list_dither colors</code>.
1576 <dt><samp>list_drivers</samp></dt>
1577 <dd><p>If set to <samp>true</samp>, print a list of available drivers and exit.
1580 <dt><samp>list_dither</samp></dt>
1581 <dd><p>List available dither options related to the argument.
1582 The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
1583 <code>charsets</code>, <code>colors</code>.
1587 <a name="Examples-8"></a>
1588 <h4 class="subsection">4.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
1591 <li> The following command shows the <code>ffmpeg</code> output is an
1592 CACA window, forcing its size to 80x25:
1593 <div class="example">
1594 <pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
1597 </li><li> Show the list of available drivers and exit:
1598 <div class="example">
1599 <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
1602 </li><li> Show the list of available dither colors and exit:
1603 <div class="example">
1604 <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
1608 <a name="decklink-1"></a>
1609 <h3 class="section">4.3 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink-1" aria-hidden="true">TOC</a></span></h3>
1611 <p>The decklink output device provides playback capabilities for Blackmagic
1614 <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
1615 need to configure with the appropriate <code>--extra-cflags</code>
1616 and <code>--extra-ldflags</code>.
1617 On Windows, you need to run the IDL files through <code>widl</code>.
1619 <p>DeckLink is very picky about the formats it supports. Pixel format is always
1620 uyvy422, framerate and video size must be determined for your device with
1621 <code>-list_formats 1</code>. Audio sample rate is always 48 kHz.
1623 <a name="Options-12"></a>
1624 <h4 class="subsection">4.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
1626 <dl compact="compact">
1627 <dt><samp>list_devices</samp></dt>
1628 <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
1629 Defaults to <samp>false</samp>.
1632 <dt><samp>list_formats</samp></dt>
1633 <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
1634 Defaults to <samp>false</samp>.
1637 <dt><samp>preroll</samp></dt>
1638 <dd><p>Amount of time to preroll video in seconds.
1639 Defaults to <samp>0.5</samp>.
1644 <a name="Examples-9"></a>
1645 <h4 class="subsection">4.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
1648 <li> List output devices:
1649 <div class="example">
1650 <pre class="example">ffmpeg -i test.avi -f decklink -list_devices 1 dummy
1653 </li><li> List supported formats:
1654 <div class="example">
1655 <pre class="example">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
1658 </li><li> Play video clip:
1659 <div class="example">
1660 <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
1663 </li><li> Play video clip with non-standard framerate or video size:
1664 <div class="example">
1665 <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
1670 <a name="fbdev-1"></a>
1671 <h3 class="section">4.4 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev-1" aria-hidden="true">TOC</a></span></h3>
1673 <p>Linux framebuffer output device.
1675 <p>The Linux framebuffer is a graphic hardware-independent abstraction
1676 layer to show graphics on a computer monitor, typically on the
1677 console. It is accessed through a file device node, usually
1678 <samp>/dev/fb0</samp>.
1680 <p>For more detailed information read the file
1681 <samp>Documentation/fb/framebuffer.txt</samp> included in the Linux source tree.
1683 <a name="Options-13"></a>
1684 <h4 class="subsection">4.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
1685 <dl compact="compact">
1686 <dt><samp>xoffset</samp></dt>
1687 <dt><samp>yoffset</samp></dt>
1688 <dd><p>Set x/y coordinate of top left corner. Default is 0.
1692 <a name="Examples-10"></a>
1693 <h4 class="subsection">4.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
1694 <p>Play a file on framebuffer device <samp>/dev/fb0</samp>.
1695 Required pixel format depends on current framebuffer settings.
1696 </p><div class="example">
1697 <pre class="example">ffmpeg -re -i INPUT -vcodec rawvideo -pix_fmt bgra -f fbdev /dev/fb0
1700 <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
1702 <a name="opengl"></a>
1703 <h3 class="section">4.5 opengl<span class="pull-right"><a class="anchor hidden-xs" href="#opengl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-opengl" aria-hidden="true">TOC</a></span></h3>
1704 <p>OpenGL output device.
1706 <p>To enable this output device you need to configure FFmpeg with <code>--enable-opengl</code>.
1708 <p>This output device allows one to render to OpenGL context.
1709 Context may be provided by application or default SDL window is created.
1711 <p>When device renders to external context, application must implement handlers for following messages:
1712 <code>AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
1713 <code>AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
1714 <code>AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
1715 <code>AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
1716 Application is also required to inform a device about current resolution by sending <code>AV_APP_TO_DEV_WINDOW_SIZE</code> message.
1718 <a name="Options-14"></a>
1719 <h4 class="subsection">4.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
1720 <dl compact="compact">
1721 <dt><samp>background</samp></dt>
1722 <dd><p>Set background color. Black is a default.
1724 <dt><samp>no_window</samp></dt>
1725 <dd><p>Disables default SDL window when set to non-zero value.
1726 Application must provide OpenGL context and both <code>window_size_cb</code> and <code>window_swap_buffers_cb</code> callbacks when set.
1728 <dt><samp>window_title</samp></dt>
1729 <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
1730 Ignored when <samp>no_window</samp> is set.
1732 <dt><samp>window_size</samp></dt>
1733 <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
1734 If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
1735 Mostly usable when <samp>no_window</samp> is not set.
1740 <a name="Examples-11"></a>
1741 <h4 class="subsection">4.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
1742 <p>Play a file on SDL window using OpenGL rendering:
1743 </p><div class="example">
1744 <pre class="example">ffmpeg -i INPUT -f opengl "window title"
1747 <a name="oss-1"></a>
1748 <h3 class="section">4.6 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss-1" aria-hidden="true">TOC</a></span></h3>
1750 <p>OSS (Open Sound System) output device.
1752 <a name="pulse-1"></a>
1753 <h3 class="section">4.7 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse-1" aria-hidden="true">TOC</a></span></h3>
1755 <p>PulseAudio output device.
1757 <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
1759 <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
1761 <a name="Options-15"></a>
1762 <h4 class="subsection">4.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
1763 <dl compact="compact">
1764 <dt><samp>server</samp></dt>
1765 <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
1766 Default server is used when not provided.
1769 <dt><samp>name</samp></dt>
1770 <dd><p>Specify the application name PulseAudio will use when showing active clients,
1771 by default it is the <code>LIBAVFORMAT_IDENT</code> string.
1774 <dt><samp>stream_name</samp></dt>
1775 <dd><p>Specify the stream name PulseAudio will use when showing active streams,
1776 by default it is set to the specified output name.
1779 <dt><samp>device</samp></dt>
1780 <dd><p>Specify the device to use. Default device is used when not provided.
1781 List of output devices can be obtained with command <code>pactl list sinks</code>.
1784 <dt><samp>buffer_size</samp></dt>
1785 <dt><samp>buffer_duration</samp></dt>
1786 <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
1787 gives more control, but requires more frequent updates.
1789 <p><samp>buffer_size</samp> specifies size in bytes while
1790 <samp>buffer_duration</samp> specifies duration in milliseconds.
1792 <p>When both options are provided then the highest value is used
1793 (duration is recalculated to bytes using stream parameters). If they
1794 are set to 0 (which is default), the device will use the default
1795 PulseAudio duration value. By default PulseAudio set buffer duration
1796 to around 2 seconds.
1799 <dt><samp>prebuf</samp></dt>
1800 <dd><p>Specify pre-buffering size in bytes. The server does not start with
1801 playback before at least <samp>prebuf</samp> bytes are available in the
1802 buffer. By default this option is initialized to the same value as
1803 <samp>buffer_size</samp> or <samp>buffer_duration</samp> (whichever is bigger).
1806 <dt><samp>minreq</samp></dt>
1807 <dd><p>Specify minimum request size in bytes. The server does not request less
1808 than <samp>minreq</samp> bytes from the client, instead waits until the buffer
1809 is free enough to request more bytes at once. It is recommended to not set
1810 this option, which will initialize this to a value that is deemed sensible
1816 <a name="Examples-12"></a>
1817 <h4 class="subsection">4.7.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
1818 <p>Play a file on default device on default server:
1819 </p><div class="example">
1820 <pre class="example">ffmpeg -i INPUT -f pulse "stream name"
1824 <h3 class="section">4.8 sdl<span class="pull-right"><a class="anchor hidden-xs" href="#sdl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sdl" aria-hidden="true">TOC</a></span></h3>
1826 <p>SDL (Simple DirectMedia Layer) output device.
1828 <p>This output device allows one to show a video stream in an SDL
1829 window. Only one SDL window is allowed per application, so you can
1830 have only one instance of this output device in an application.
1832 <p>To enable this output device you need libsdl installed on your system
1833 when configuring your build.
1835 <p>For more information about SDL, check:
1836 <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
1838 <a name="Options-16"></a>
1839 <h4 class="subsection">4.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
1841 <dl compact="compact">
1842 <dt><samp>window_title</samp></dt>
1843 <dd><p>Set the SDL window title, if not specified default to the filename
1844 specified for the output device.
1847 <dt><samp>icon_title</samp></dt>
1848 <dd><p>Set the name of the iconified SDL window, if not specified it is set
1849 to the same value of <var>window_title</var>.
1852 <dt><samp>window_size</samp></dt>
1853 <dd><p>Set the SDL window size, can be a string of the form
1854 <var>width</var>x<var>height</var> or a video size abbreviation.
1855 If not specified it defaults to the size of the input video,
1856 downscaled according to the aspect ratio.
1859 <dt><samp>window_fullscreen</samp></dt>
1860 <dd><p>Set fullscreen mode when non-zero value is provided.
1861 Default value is zero.
1865 <a name="Interactive-commands"></a>
1866 <h4 class="subsection">4.8.2 Interactive commands<span class="pull-right"><a class="anchor hidden-xs" href="#Interactive-commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Interactive-commands" aria-hidden="true">TOC</a></span></h4>
1868 <p>The window created by the device can be controlled through the
1869 following interactive commands.
1871 <dl compact="compact">
1872 <dt><tt class="key">q, ESC</tt></dt>
1873 <dd><p>Quit the device immediately.
1877 <a name="Examples-13"></a>
1878 <h4 class="subsection">4.8.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
1880 <p>The following command shows the <code>ffmpeg</code> output is an
1881 SDL window, forcing its size to the qcif format:
1882 </p><div class="example">
1883 <pre class="example">ffmpeg -i INPUT -vcodec rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
1886 <a name="sndio-1"></a>
1887 <h3 class="section">4.9 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio-1" aria-hidden="true">TOC</a></span></h3>
1889 <p>sndio audio output device.
1892 <h3 class="section">4.10 xv<span class="pull-right"><a class="anchor hidden-xs" href="#xv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xv" aria-hidden="true">TOC</a></span></h3>
1894 <p>XV (XVideo) output device.
1896 <p>This output device allows one to show a video stream in a X Window System
1899 <a name="Options-17"></a>
1900 <h4 class="subsection">4.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
1902 <dl compact="compact">
1903 <dt><samp>display_name</samp></dt>
1904 <dd><p>Specify the hardware display name, which determines the display and
1905 communications domain to be used.
1907 <p>The display name or DISPLAY environment variable can be a string in
1908 the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
1910 <p><var>hostname</var> specifies the name of the host machine on which the
1911 display is physically attached. <var>number</var> specifies the number of
1912 the display server on that host machine. <var>screen_number</var> specifies
1913 the screen to be used on that server.
1915 <p>If unspecified, it defaults to the value of the DISPLAY environment
1918 <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
1919 0 on the machine named “dual-headed”.
1921 <p>Check the X11 specification for more detailed information about the
1922 display name format.
1925 <dt><samp>window_id</samp></dt>
1926 <dd><p>When set to non-zero value then device doesn’t create new window,
1927 but uses existing one with provided <var>window_id</var>. By default
1928 this options is set to zero and device creates its own window.
1931 <dt><samp>window_size</samp></dt>
1932 <dd><p>Set the created window size, can be a string of the form
1933 <var>width</var>x<var>height</var> or a video size abbreviation. If not
1934 specified it defaults to the size of the input video.
1935 Ignored when <var>window_id</var> is set.
1938 <dt><samp>window_x</samp></dt>
1939 <dt><samp>window_y</samp></dt>
1940 <dd><p>Set the X and Y window offsets for the created window. They are both
1941 set to 0 by default. The values may be ignored by the window manager.
1942 Ignored when <var>window_id</var> is set.
1945 <dt><samp>window_title</samp></dt>
1946 <dd><p>Set the window title, if not specified default to the filename
1947 specified for the output device. Ignored when <var>window_id</var> is set.
1951 <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
1953 <a name="Examples-14"></a>
1954 <h4 class="subsection">4.10.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
1957 <li> Decode, display and encode video input with <code>ffmpeg</code> at the
1959 <div class="example">
1960 <pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
1963 </li><li> Decode and display the input video to multiple X11 windows:
1964 <div class="example">
1965 <pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
1970 <a name="See-Also"></a>
1971 <h2 class="chapter">5 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
1973 <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>, <a href="ffserver.html">ffserver</a>,
1974 <a href="libavdevice.html">libavdevice</a>
1977 <a name="Authors"></a>
1978 <h2 class="chapter">6 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
1980 <p>The FFmpeg developers.
1982 <p>For details about the authorship, see the Git history of the project
1983 (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
1984 <code>git log</code> in the FFmpeg source directory, or browsing the
1985 online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
1987 <p>Maintainers for the specific components are listed in the file
1988 <samp>MAINTAINERS</samp> in the source code tree.
1992 <p style="font-size: small;">
1993 This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.