42
42
To see the list of cards currently recognized by your system check the
43
43
files @file{/proc/asound/cards} and @file{/proc/asound/devices}.
45
For example to capture with @file{ffmpeg} from an ALSA device with
45
For example to capture with @command{avconv} from an ALSA device with
46
46
card id 0, you may run the command:
48
ffmpeg -f alsa -i hw:0 alsaout.wav
48
avconv -f alsa -i hw:0 alsaout.wav
51
51
For more information see:
72
72
Documentation/fb/framebuffer.txt included in the Linux source tree.
74
74
To record from the framebuffer device @file{/dev/fb0} with
77
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
77
avconv -f fbdev -r 10 -i /dev/fb0 out.avi
80
80
You can take a single screenshot image with the command:
82
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
82
avconv -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
85
85
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
111
111
Follows an example which shows how to capture a JACK readable client
112
with @command{avconv}.
114
# Create a JACK writable client with name "ffmpeg".
115
$ ffmpeg -f jack -i ffmpeg -y out.wav
114
# Create a JACK writable client with name "libav".
115
$ avconv -f jack -i libav -y out.wav
117
117
# Start the sample jack_metro readable client.
118
118
$ jack_metro -b 120 -d 0.2 -f 4000
124
124
system:playback_1
125
125
system:playback_2
129
# Connect metro to the ffmpeg writable client.
130
$ jack_connect metro:120_bpm ffmpeg:input_1
129
# Connect metro to the avconv writable client.
130
$ jack_connect metro:120_bpm libav:input_1
133
133
For more information read:
145
145
representing the OSS input device, and is usually set to
148
For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the
148
For example to grab from @file{/dev/dsp} using @command{avconv} use the
151
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
151
avconv -f oss -i /dev/dsp /tmp/oss.wav
154
154
For more information about OSS see:
155
155
@url{http://manuals.opensound.com/usersguide/dsp.html}
159
pulseaudio input device.
161
To enable this input device during configuration you need libpulse-simple
162
installed in your system.
164
The filename to provide to the input device is a source device or the
167
To list the pulse source devices and their properties you can invoke
168
the command @file{pactl list sources}.
171
avconv -f pulse -i default /tmp/pulse.wav
174
@subsection @var{server} AVOption
178
-server @var{server name}
181
Connects to a specific server.
183
@subsection @var{name} AVOption
187
-name @var{application name}
190
Specify the application name pulse will use when showing active clients,
191
by default it is "libav"
193
@subsection @var{stream_name} AVOption
197
-stream_name @var{stream name}
200
Specify the stream name pulse will use when showing active streams,
201
by default it is "record"
203
@subsection @var{sample_rate} AVOption
207
-sample_rate @var{samplerate}
210
Specify the samplerate in Hz, by default 48kHz is used.
212
@subsection @var{channels} AVOption
219
Specify the channels in use, by default 2 (stereo) is set.
221
@subsection @var{frame_size} AVOption
225
-frame_size @var{bytes}
228
Specify the number of byte per frame, by default it is set to 1024.
230
@subsection @var{fragment_size} AVOption
234
-fragment_size @var{bytes}
237
Specify the minimal buffering fragment in pulseaudio, it will affect the
238
audio latency. By default it is unset.
159
242
sndio input device.
165
248
representing the sndio input device, and is usually set to
166
249
@file{/dev/audio0}.
168
For example to grab from @file{/dev/audio0} using @file{ffmpeg} use the
251
For example to grab from @file{/dev/audio0} using @command{avconv} use the
171
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
254
avconv -f sndio -i /dev/audio0 /tmp/oss.wav
174
257
@section video4linux and video4linux2
184
267
Video4Linux and Video4Linux2 devices only support a limited set of
185
268
@var{width}x@var{height} sizes and framerates. You can check which are
186
269
supported for example with the command @file{dov4l} for Video4Linux
187
devices and the command @file{v4l-info} for Video4Linux2 devices.
270
devices and using @command{-list_formats all} for Video4Linux2 devices.
189
272
If the size for the device is set to 0x0, the input device will
190
273
try to autodetect the size to use.
200
283
# Grab and show the input of a video4linux device, frame rate is set
201
284
# to the default of 25/1.
202
ffplay -s 320x240 -f video4linux /dev/video0
285
avplay -s 320x240 -f video4linux /dev/video0
204
287
# Grab and show the input of a video4linux2 device, autoadjust size.
205
ffplay -f video4linux2 /dev/video0
288
avplay -f video4linux2 /dev/video0
207
290
# Grab and record the input of a video4linux2 device, autoadjust size,
208
291
# frame rate value defaults to 0/0 so it is read from the video4linux2
210
ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
293
avconv -f video4linux2 -i /dev/video0 out.mpeg
243
326
Use the @file{dpyinfo} program for getting basic information about the
244
327
properties of your X11 display (e.g. grep for "name" or "dimensions").
246
For example to grab from @file{:0.0} using @file{ffmpeg}:
329
For example to grab from @file{:0.0} using @command{avconv}:
248
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
331
avconv -f x11grab -r 25 -s cif -i :0.0 out.mpg
250
333
# Grab at position 10,20.
251
ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
334
avconv -f x11grab -r 25 -s cif -i :0.0+10,20 out.mpg
337
@subsection @var{follow_mouse} AVOption
341
-follow_mouse centered|@var{PIXELS}
344
When it is specified with "centered", the grabbing region follows the mouse
345
pointer and keeps the pointer at the center of region; otherwise, the region
346
follows only when the mouse pointer reaches within @var{PIXELS} (greater than
347
zero) to the edge of region.
351
avconv -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 out.mpg
353
# Follows only when the mouse pointer reaches within 100 pixels to edge
354
avconv -f x11grab -follow_mouse 100 -r 25 -s cif -i :0.0 out.mpg
357
@subsection @var{show_region} AVOption
364
If @var{show_region} AVOption is specified with @var{1}, then the grabbing
365
region will be indicated on screen. With this option, it's easy to know what is
366
being grabbed if only a portion of the screen is grabbed.
370
avconv -f x11grab -show_region 1 -r 25 -s cif -i :0.0+10,20 out.mpg
373
avconv -f x11grab -follow_mouse centered -show_region 1 -r 25 -s cif -i :0.0 out.mpg
254
376
@c man end INPUT DEVICES