2 @c man begin INPUT DEVICES
4 Input devices are configured elements in FFmpeg which allow to access
5 the data coming from a multimedia device attached to your system.
7 When you configure your FFmpeg build, all the supported input devices
8 are enabled by default. You can list all available ones using the
9 configure option "--list-indevs".
11 You can disable all the input devices using the configure option
12 "--disable-indevs", and selectively enable an input device using the
13 option "--enable-indev=@var{INDEV}", or you can disable a particular
14 input device using the option "--disable-indev=@var{INDEV}".
16 The option "-formats" of the ff* tools will display the list of
17 supported input devices (amongst the demuxers).
19 A description of the currently available input devices follows.
23 ALSA (Advanced Linux Sound Architecture) input device.
25 To enable this input device during configuration you need libasound
26 installed on your system.
28 This device allows capturing from an ALSA device. The name of the
29 device to capture has to be an ALSA card identifier.
31 An ALSA identifier has the syntax:
33 hw:@var{CARD}[,@var{DEV}[,@var{SUBDEV}]]
36 where the @var{DEV} and @var{SUBDEV} components are optional.
38 The three arguments (in order: @var{CARD},@var{DEV},@var{SUBDEV})
39 specify card number or identifier, device number and subdevice number
42 To see the list of cards currently recognized by your system check the
43 files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
45 For example to capture with @file{ffmpeg} from an ALSA device with
46 card id 0, you may run the command:
48 ffmpeg -f alsa -i hw:0 alsaout.wav
51 For more information see:
52 @url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
56 BSD video input device.
60 Linux DV 1394 input device.
64 Linux framebuffer input device.
66 The Linux framebuffer is a graphic hardware-independent abstraction
67 layer to show graphics on a computer monitor, typically on the
68 console. It is accessed through a file device node, usually
71 For more detailed information read the file
72 Documentation/fb/framebuffer.txt included in the Linux source tree.
74 To record from the framebuffer device @file{/dev/fb0} with
77 ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
80 You can take a single screenshot image with the command:
82 ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
85 See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
91 To enable this input device during configuration you need libjack
92 installed on your system.
94 A JACK input device creates one or more JACK writable clients, one for
95 each audio channel, with name @var{client_name}:input_@var{N}, where
96 @var{client_name} is the name provided by the application, and @var{N}
97 is a number which identifies the channel.
98 Each writable client will send the acquired data to the FFmpeg input
101 Once you have created one or more JACK readable clients, you need to
102 connect them to one or more JACK writable clients.
104 To connect or disconnect JACK clients you can use the
105 @file{jack_connect} and @file{jack_disconnect} programs, or do it
106 through a graphical interface, for example with @file{qjackctl}.
108 To list the JACK clients and their properties you can invoke the command
111 Follows an example which shows how to capture a JACK readable client
114 # Create a JACK writable client with name "ffmpeg".
115 $ ffmpeg -f jack -i ffmpeg -y out.wav
117 # Start the sample jack_metro readable client.
118 $ jack_metro -b 120 -d 0.2 -f 4000
120 # List the current JACK clients.
129 # Connect metro to the ffmpeg writable client.
130 $ jack_connect metro:120_bpm ffmpeg:input_1
133 For more information read:
134 @url{http://jackaudio.org/}
138 IIDC1394 input device, based on libdc1394 and libraw1394.
142 The OpenAL input device provides audio capture on all systems with a
143 working OpenAL 1.1 implementation.
145 To enable this input device during configuration, you need OpenAL
146 headers and libraries installed on your system, and need to configure
147 FFmpeg with @code{--enable-openal}.
149 OpenAL headers and libraries should be provided as part of your OpenAL
150 implementation, or as an additional download (an SDK). Depending on your
151 installation you may need to specify additional flags via the
152 @code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
153 system to locate the OpenAL headers and libraries.
155 An incomplete list of OpenAL implementations follows:
159 The official Windows implementation, providing hardware acceleration
160 with supported devices and software fallback.
161 See @url{http://openal.org/}.
163 Portable, open source (LGPL) software implementation. Includes
164 backends for the most common sound APIs on the Windows, Linux,
165 Solaris, and BSD operating systems.
166 See @url{http://kcat.strangesoft.net/openal.html}.
168 OpenAL is part of Core Audio, the official Mac OS X Audio interface.
169 See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
172 This device allows to capture from an audio input device handled
175 You need to specify the name of the device to capture in the provided
176 filename. If the empty string is provided, the device will
177 automatically select the default device. You can get the list of the
178 supported devices by using the option @var{list_devices}.
185 Set the number of channels in the captured audio. Only the values
186 @option{1} (monaural) and @option{2} (stereo) are currently supported.
187 Defaults to @option{2}.
190 Set the sample size (in bits) of the captured audio. Only the values
191 @option{8} and @option{16} are currently supported. Defaults to
195 Set the sample rate (in Hz) of the captured audio.
196 Defaults to @option{44.1k}.
199 If set to @option{true}, print a list of devices and exit.
200 Defaults to @option{false}.
206 Print the list of OpenAL supported devices and exit:
208 $ ffmpeg -list_devices true -f openal -i dummy out.ogg
211 Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
213 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
216 Capture from the default device (note the empty string '' as filename):
218 $ ffmpeg -f openal -i '' out.ogg
221 Capture from two devices simultaneously, writing to two different files,
222 within the same @file{ffmpeg} command:
224 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
226 Note: not all OpenAL implementations support multiple simultaneous capture -
227 try the latest OpenAL Soft if the above does not work.
231 Open Sound System input device.
233 The filename to provide to the input device is the device node
234 representing the OSS input device, and is usually set to
237 For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the
240 ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
243 For more information about OSS see:
244 @url{http://manuals.opensound.com/usersguide/dsp.html}
250 To enable this input device during configuration you need libsndio
251 installed on your system.
253 The filename to provide to the input device is the device node
254 representing the sndio input device, and is usually set to
257 For example to grab from @file{/dev/audio0} using @file{ffmpeg} use the
260 ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
263 @section video4linux and video4linux2
265 Video4Linux and Video4Linux2 input video devices.
267 The name of the device to grab is a file device node, usually Linux
268 systems tend to automatically create such nodes when the device
269 (e.g. an USB webcam) is plugged into the system, and has a name of the
270 kind @file{/dev/video@var{N}}, where @var{N} is a number associated to
273 Video4Linux and Video4Linux2 devices only support a limited set of
274 @var{width}x@var{height} sizes and framerates. You can check which are
275 supported for example with the command @file{dov4l} for Video4Linux
276 devices and the command @file{v4l-info} for Video4Linux2 devices.
278 If the size for the device is set to 0x0, the input device will
279 try to autodetect the size to use.
280 Only for the video4linux2 device, if the frame rate is set to 0/0 the
281 input device will use the frame rate value already set in the driver.
283 Video4Linux support is deprecated since Linux 2.6.30, and will be
284 dropped in later versions.
286 Follow some usage examples of the video4linux devices with the ff*
289 # Grab and show the input of a video4linux device, frame rate is set
290 # to the default of 25/1.
291 ffplay -s 320x240 -f video4linux /dev/video0
293 # Grab and show the input of a video4linux2 device, autoadjust size.
294 ffplay -f video4linux2 /dev/video0
296 # Grab and record the input of a video4linux2 device, autoadjust size,
297 # frame rate value defaults to 0/0 so it is read from the video4linux2
299 ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
304 VfW (Video for Windows) capture input device.
306 The filename passed as input is the capture driver number, ranging from
307 0 to 9. You may use "list" as filename to print a list of drivers. Any
308 other filename will be interpreted as device number 0.
312 X11 video input device.
314 This device allows to capture a region of an X11 display.
316 The filename passed as input has the syntax:
318 [@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}]
321 @var{hostname}:@var{display_number}.@var{screen_number} specifies the
322 X11 display name of the screen to grab from. @var{hostname} can be
323 ommitted, and defaults to "localhost". The environment variable
324 @env{DISPLAY} contains the default display name.
326 @var{x_offset} and @var{y_offset} specify the offsets of the grabbed
327 area with respect to the top-left border of the X11 screen. They
330 Check the X11 documentation (e.g. man X) for more detailed information.
332 Use the @file{dpyinfo} program for getting basic information about the
333 properties of your X11 display (e.g. grep for "name" or "dimensions").
335 For example to grab from @file{:0.0} using @file{ffmpeg}:
337 ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
339 # Grab at position 10,20.
340 ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
343 @c man end INPUT DEVICES