]> git.sesse.net Git - ffmpeg/blob - doc/indevs.texi
avcodec/fft-test: fix memory alloc checks
[ffmpeg] / doc / indevs.texi
1 @chapter Input Devices
2 @c man begin INPUT DEVICES
3
4 Input devices are configured elements in FFmpeg which allow to access
5 the data coming from a multimedia device attached to your system.
6
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".
10
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}".
15
16 The option "-devices" of the ff* tools will display the list of
17 supported input devices.
18
19 A description of the currently available input devices follows.
20
21 @section alsa
22
23 ALSA (Advanced Linux Sound Architecture) input device.
24
25 To enable this input device during configuration you need libasound
26 installed on your system.
27
28 This device allows capturing from an ALSA device. The name of the
29 device to capture has to be an ALSA card identifier.
30
31 An ALSA identifier has the syntax:
32 @example
33 hw:@var{CARD}[,@var{DEV}[,@var{SUBDEV}]]
34 @end example
35
36 where the @var{DEV} and @var{SUBDEV} components are optional.
37
38 The three arguments (in order: @var{CARD},@var{DEV},@var{SUBDEV})
39 specify card number or identifier, device number and subdevice number
40 (-1 means any).
41
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}.
44
45 For example to capture with @command{ffmpeg} from an ALSA device with
46 card id 0, you may run the command:
47 @example
48 ffmpeg -f alsa -i hw:0 alsaout.wav
49 @end example
50
51 For more information see:
52 @url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
53
54 @section avfoundation
55
56 AVFoundation input device.
57
58 AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX >= 10.7 as well as on iOS.
59 The older QTKit framework has been marked deprecated since OSX version 10.7.
60
61 The filename passed as input is parsed to contain either a device name or index.
62 The device index can also be given by using -video_device_index.
63 A given device index will override any given device name.
64 If the desired device consists of numbers only, use -video_device_index to identify it.
65 The default device will be chosen if an empty string  or the device name "default" is given.
66 The available devices can be enumerated by using -list_devices.
67 The pixel format can be set using -pixel_format.
68 Available formats:
69  monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
70  bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
71  yuv420p, nv12, yuyv422, gray
72
73 @example
74 ffmpeg -f avfoundation -i "0" out.mpg
75 @end example
76
77 @example
78 ffmpeg -f avfoundation -video_device_index 0 -i "" out.mpg
79 @end example
80
81 @example
82 ffmpeg -f avfoundation -pixel_format bgr0 -i "default" out.mpg
83 @end example
84
85 @example
86 ffmpeg -f avfoundation -list_devices true -i ""
87 @end example
88
89 @section bktr
90
91 BSD video input device.
92
93 @section dshow
94
95 Windows DirectShow input device.
96
97 DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
98 Currently only audio and video devices are supported.
99
100 Multiple devices may be opened as separate inputs, but they may also be
101 opened on the same input, which should improve synchronism between them.
102
103 The input name should be in the format:
104
105 @example
106 @var{TYPE}=@var{NAME}[:@var{TYPE}=@var{NAME}]
107 @end example
108
109 where @var{TYPE} can be either @var{audio} or @var{video},
110 and @var{NAME} is the device's name.
111
112 @subsection Options
113
114 If no options are specified, the device's defaults are used.
115 If the device does not support the requested options, it will
116 fail to open.
117
118 @table @option
119
120 @item video_size
121 Set the video size in the captured video.
122
123 @item framerate
124 Set the frame rate in the captured video.
125
126 @item sample_rate
127 Set the sample rate (in Hz) of the captured audio.
128
129 @item sample_size
130 Set the sample size (in bits) of the captured audio.
131
132 @item channels
133 Set the number of channels in the captured audio.
134
135 @item list_devices
136 If set to @option{true}, print a list of devices and exit.
137
138 @item list_options
139 If set to @option{true}, print a list of selected device's options
140 and exit.
141
142 @item video_device_number
143 Set video device number for devices with same name (starts at 0,
144 defaults to 0).
145
146 @item audio_device_number
147 Set audio device number for devices with same name (starts at 0,
148 defaults to 0).
149
150 @item pixel_format
151 Select pixel format to be used by DirectShow. This may only be set when
152 the video codec is not set or set to rawvideo.
153
154 @item audio_buffer_size
155 Set audio device buffer size in milliseconds (which can directly
156 impact latency, depending on the device).
157 Defaults to using the audio device's
158 default buffer size (typically some multiple of 500ms).
159 Setting this value too low can degrade performance.
160 See also
161 @url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx}
162
163 @end table
164
165 @subsection Examples
166
167 @itemize
168
169 @item
170 Print the list of DirectShow supported devices and exit:
171 @example
172 $ ffmpeg -list_devices true -f dshow -i dummy
173 @end example
174
175 @item
176 Open video device @var{Camera}:
177 @example
178 $ ffmpeg -f dshow -i video="Camera"
179 @end example
180
181 @item
182 Open second video device with name @var{Camera}:
183 @example
184 $ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
185 @end example
186
187 @item
188 Open video device @var{Camera} and audio device @var{Microphone}:
189 @example
190 $ ffmpeg -f dshow -i video="Camera":audio="Microphone"
191 @end example
192
193 @item
194 Print the list of supported options in selected device and exit:
195 @example
196 $ ffmpeg -list_options true -f dshow -i video="Camera"
197 @end example
198
199 @end itemize
200
201 @section dv1394
202
203 Linux DV 1394 input device.
204
205 @section fbdev
206
207 Linux framebuffer input device.
208
209 The Linux framebuffer is a graphic hardware-independent abstraction
210 layer to show graphics on a computer monitor, typically on the
211 console. It is accessed through a file device node, usually
212 @file{/dev/fb0}.
213
214 For more detailed information read the file
215 Documentation/fb/framebuffer.txt included in the Linux source tree.
216
217 To record from the framebuffer device @file{/dev/fb0} with
218 @command{ffmpeg}:
219 @example
220 ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
221 @end example
222
223 You can take a single screenshot image with the command:
224 @example
225 ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
226 @end example
227
228 See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
229
230 @section gdigrab
231
232 Win32 GDI-based screen capture device.
233
234 This device allows you to capture a region of the display on Windows.
235
236 There are two options for the input filename:
237 @example
238 desktop
239 @end example
240 or
241 @example
242 title=@var{window_title}
243 @end example
244
245 The first option will capture the entire desktop, or a fixed region of the
246 desktop. The second option will instead capture the contents of a single
247 window, regardless of its position on the screen.
248
249 For example, to grab the entire desktop using @command{ffmpeg}:
250 @example
251 ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
252 @end example
253
254 Grab a 640x480 region at position @code{10,20}:
255 @example
256 ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
257 @end example
258
259 Grab the contents of the window named "Calculator"
260 @example
261 ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
262 @end example
263
264 @subsection Options
265
266 @table @option
267 @item draw_mouse
268 Specify whether to draw the mouse pointer. Use the value @code{0} to
269 not draw the pointer. Default value is @code{1}.
270
271 @item framerate
272 Set the grabbing frame rate. Default value is @code{ntsc},
273 corresponding to a frame rate of @code{30000/1001}.
274
275 @item show_region
276 Show grabbed region on screen.
277
278 If @var{show_region} is specified with @code{1}, then the grabbing
279 region will be indicated on screen. With this option, it is easy to
280 know what is being grabbed if only a portion of the screen is grabbed.
281
282 Note that @var{show_region} is incompatible with grabbing the contents
283 of a single window.
284
285 For example:
286 @example
287 ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
288 @end example
289
290 @item video_size
291 Set the video frame size. The default is to capture the full screen if @file{desktop} is selected, or the full window size if @file{title=@var{window_title}} is selected.
292
293 @item offset_x
294 When capturing a region with @var{video_size}, set the distance from the left edge of the screen or desktop.
295
296 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} value to move the region to that monitor.
297
298 @item offset_y
299 When capturing a region with @var{video_size}, set the distance from the top edge of the screen or desktop.
300
301 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} value to move the region to that monitor.
302
303 @end table
304
305 @section iec61883
306
307 FireWire DV/HDV input device using libiec61883.
308
309 To enable this input device, you need libiec61883, libraw1394 and
310 libavc1394 installed on your system. Use the configure option
311 @code{--enable-libiec61883} to compile with the device enabled.
312
313 The iec61883 capture device supports capturing from a video device
314 connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
315 FireWire stack (juju). This is the default DV/HDV input method in Linux
316 Kernel 2.6.37 and later, since the old FireWire stack was removed.
317
318 Specify the FireWire port to be used as input file, or "auto"
319 to choose the first port connected.
320
321 @subsection Options
322
323 @table @option
324
325 @item dvtype
326 Override autodetection of DV/HDV. This should only be used if auto
327 detection does not work, or if usage of a different device type
328 should be prohibited. Treating a DV device as HDV (or vice versa) will
329 not work and result in undefined behavior.
330 The values @option{auto}, @option{dv} and @option{hdv} are supported.
331
332 @item dvbuffer
333 Set maxiumum size of buffer for incoming data, in frames. For DV, this
334 is an exact value. For HDV, it is not frame exact, since HDV does
335 not have a fixed frame size.
336
337 @item dvguid
338 Select the capture device by specifying it's GUID. Capturing will only
339 be performed from the specified device and fails if no device with the
340 given GUID is found. This is useful to select the input if multiple
341 devices are connected at the same time.
342 Look at /sys/bus/firewire/devices to find out the GUIDs.
343
344 @end table
345
346 @subsection Examples
347
348 @itemize
349
350 @item
351 Grab and show the input of a FireWire DV/HDV device.
352 @example
353 ffplay -f iec61883 -i auto
354 @end example
355
356 @item
357 Grab and record the input of a FireWire DV/HDV device,
358 using a packet buffer of 100000 packets if the source is HDV.
359 @example
360 ffmpeg -f iec61883 -i auto -hdvbuffer 100000 out.mpg
361 @end example
362
363 @end itemize
364
365 @section jack
366
367 JACK input device.
368
369 To enable this input device during configuration you need libjack
370 installed on your system.
371
372 A JACK input device creates one or more JACK writable clients, one for
373 each audio channel, with name @var{client_name}:input_@var{N}, where
374 @var{client_name} is the name provided by the application, and @var{N}
375 is a number which identifies the channel.
376 Each writable client will send the acquired data to the FFmpeg input
377 device.
378
379 Once you have created one or more JACK readable clients, you need to
380 connect them to one or more JACK writable clients.
381
382 To connect or disconnect JACK clients you can use the @command{jack_connect}
383 and @command{jack_disconnect} programs, or do it through a graphical interface,
384 for example with @command{qjackctl}.
385
386 To list the JACK clients and their properties you can invoke the command
387 @command{jack_lsp}.
388
389 Follows an example which shows how to capture a JACK readable client
390 with @command{ffmpeg}.
391 @example
392 # Create a JACK writable client with name "ffmpeg".
393 $ ffmpeg -f jack -i ffmpeg -y out.wav
394
395 # Start the sample jack_metro readable client.
396 $ jack_metro -b 120 -d 0.2 -f 4000
397
398 # List the current JACK clients.
399 $ jack_lsp -c
400 system:capture_1
401 system:capture_2
402 system:playback_1
403 system:playback_2
404 ffmpeg:input_1
405 metro:120_bpm
406
407 # Connect metro to the ffmpeg writable client.
408 $ jack_connect metro:120_bpm ffmpeg:input_1
409 @end example
410
411 For more information read:
412 @url{http://jackaudio.org/}
413
414 @section lavfi
415
416 Libavfilter input virtual device.
417
418 This input device reads data from the open output pads of a libavfilter
419 filtergraph.
420
421 For each filtergraph open output, the input device will create a
422 corresponding stream which is mapped to the generated output. Currently
423 only video data is supported. The filtergraph is specified through the
424 option @option{graph}.
425
426 @subsection Options
427
428 @table @option
429
430 @item graph
431 Specify the filtergraph to use as input. Each video open output must be
432 labelled by a unique string of the form "out@var{N}", where @var{N} is a
433 number starting from 0 corresponding to the mapped input stream
434 generated by the device.
435 The first unlabelled output is automatically assigned to the "out0"
436 label, but all the others need to be specified explicitly.
437
438 If not specified defaults to the filename specified for the input
439 device.
440
441 @item graph_file
442 Set the filename of the filtergraph to be read and sent to the other
443 filters. Syntax of the filtergraph is the same as the one specified by
444 the option @var{graph}.
445
446 @end table
447
448 @subsection Examples
449
450 @itemize
451 @item
452 Create a color video stream and play it back with @command{ffplay}:
453 @example
454 ffplay -f lavfi -graph "color=c=pink [out0]" dummy
455 @end example
456
457 @item
458 As the previous example, but use filename for specifying the graph
459 description, and omit the "out0" label:
460 @example
461 ffplay -f lavfi color=c=pink
462 @end example
463
464 @item
465 Create three different video test filtered sources and play them:
466 @example
467 ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
468 @end example
469
470 @item
471 Read an audio stream from a file using the amovie source and play it
472 back with @command{ffplay}:
473 @example
474 ffplay -f lavfi "amovie=test.wav"
475 @end example
476
477 @item
478 Read an audio stream and a video stream and play it back with
479 @command{ffplay}:
480 @example
481 ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
482 @end example
483
484 @end itemize
485
486 @section libdc1394
487
488 IIDC1394 input device, based on libdc1394 and libraw1394.
489
490 @section openal
491
492 The OpenAL input device provides audio capture on all systems with a
493 working OpenAL 1.1 implementation.
494
495 To enable this input device during configuration, you need OpenAL
496 headers and libraries installed on your system, and need to configure
497 FFmpeg with @code{--enable-openal}.
498
499 OpenAL headers and libraries should be provided as part of your OpenAL
500 implementation, or as an additional download (an SDK). Depending on your
501 installation you may need to specify additional flags via the
502 @code{--extra-cflags} and @code{--extra-ldflags} for allowing the build
503 system to locate the OpenAL headers and libraries.
504
505 An incomplete list of OpenAL implementations follows:
506
507 @table @strong
508 @item Creative
509 The official Windows implementation, providing hardware acceleration
510 with supported devices and software fallback.
511 See @url{http://openal.org/}.
512 @item OpenAL Soft
513 Portable, open source (LGPL) software implementation. Includes
514 backends for the most common sound APIs on the Windows, Linux,
515 Solaris, and BSD operating systems.
516 See @url{http://kcat.strangesoft.net/openal.html}.
517 @item Apple
518 OpenAL is part of Core Audio, the official Mac OS X Audio interface.
519 See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
520 @end table
521
522 This device allows one to capture from an audio input device handled
523 through OpenAL.
524
525 You need to specify the name of the device to capture in the provided
526 filename. If the empty string is provided, the device will
527 automatically select the default device. You can get the list of the
528 supported devices by using the option @var{list_devices}.
529
530 @subsection Options
531
532 @table @option
533
534 @item channels
535 Set the number of channels in the captured audio. Only the values
536 @option{1} (monaural) and @option{2} (stereo) are currently supported.
537 Defaults to @option{2}.
538
539 @item sample_size
540 Set the sample size (in bits) of the captured audio. Only the values
541 @option{8} and @option{16} are currently supported. Defaults to
542 @option{16}.
543
544 @item sample_rate
545 Set the sample rate (in Hz) of the captured audio.
546 Defaults to @option{44.1k}.
547
548 @item list_devices
549 If set to @option{true}, print a list of devices and exit.
550 Defaults to @option{false}.
551
552 @end table
553
554 @subsection Examples
555
556 Print the list of OpenAL supported devices and exit:
557 @example
558 $ ffmpeg -list_devices true -f openal -i dummy out.ogg
559 @end example
560
561 Capture from the OpenAL device @file{DR-BT101 via PulseAudio}:
562 @example
563 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
564 @end example
565
566 Capture from the default device (note the empty string '' as filename):
567 @example
568 $ ffmpeg -f openal -i '' out.ogg
569 @end example
570
571 Capture from two devices simultaneously, writing to two different files,
572 within the same @command{ffmpeg} command:
573 @example
574 $ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
575 @end example
576 Note: not all OpenAL implementations support multiple simultaneous capture -
577 try the latest OpenAL Soft if the above does not work.
578
579 @section oss
580
581 Open Sound System input device.
582
583 The filename to provide to the input device is the device node
584 representing the OSS input device, and is usually set to
585 @file{/dev/dsp}.
586
587 For example to grab from @file{/dev/dsp} using @command{ffmpeg} use the
588 command:
589 @example
590 ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
591 @end example
592
593 For more information about OSS see:
594 @url{http://manuals.opensound.com/usersguide/dsp.html}
595
596 @section pulse
597
598 PulseAudio input device.
599
600 To enable this output device you need to configure FFmpeg with @code{--enable-libpulse}.
601
602 The filename to provide to the input device is a source device or the
603 string "default"
604
605 To list the PulseAudio source devices and their properties you can invoke
606 the command @command{pactl list sources}.
607
608 More information about PulseAudio can be found on @url{http://www.pulseaudio.org}.
609
610 @subsection Options
611 @table @option
612 @item server
613 Connect to a specific PulseAudio server, specified by an IP address.
614 Default server is used when not provided.
615
616 @item name
617 Specify the application name PulseAudio will use when showing active clients,
618 by default it is the @code{LIBAVFORMAT_IDENT} string.
619
620 @item stream_name
621 Specify the stream name PulseAudio will use when showing active streams,
622 by default it is "record".
623
624 @item sample_rate
625 Specify the samplerate in Hz, by default 48kHz is used.
626
627 @item channels
628 Specify the channels in use, by default 2 (stereo) is set.
629
630 @item frame_size
631 Specify the number of bytes per frame, by default it is set to 1024.
632
633 @item fragment_size
634 Specify the minimal buffering fragment in PulseAudio, it will affect the
635 audio latency. By default it is unset.
636 @end table
637
638 @subsection Examples
639 Record a stream from default device:
640 @example
641 ffmpeg -f pulse -i default /tmp/pulse.wav
642 @end example
643
644 @section qtkit
645
646 QTKit input device.
647
648 The filename passed as input is parsed to contain either a device name or index.
649 The device index can also be given by using -video_device_index.
650 A given device index will override any given device name.
651 If the desired device consists of numbers only, use -video_device_index to identify it.
652 The default device will be chosen if an empty string  or the device name "default" is given.
653 The available devices can be enumerated by using -list_devices.
654
655 @example
656 ffmpeg -f qtkit -i "0" out.mpg
657 @end example
658
659 @example
660 ffmpeg -f qtkit -video_device_index 0 -i "" out.mpg
661 @end example
662
663 @example
664 ffmpeg -f qtkit -i "default" out.mpg
665 @end example
666
667 @example
668 ffmpeg -f qtkit -list_devices true -i ""
669 @end example
670
671 @section sndio
672
673 sndio input device.
674
675 To enable this input device during configuration you need libsndio
676 installed on your system.
677
678 The filename to provide to the input device is the device node
679 representing the sndio input device, and is usually set to
680 @file{/dev/audio0}.
681
682 For example to grab from @file{/dev/audio0} using @command{ffmpeg} use the
683 command:
684 @example
685 ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
686 @end example
687
688 @section video4linux2, v4l2
689
690 Video4Linux2 input video device.
691
692 "v4l2" can be used as alias for "video4linux2".
693
694 If FFmpeg is built with v4l-utils support (by using the
695 @code{--enable-libv4l2} configure option), it is possible to use it with the
696 @code{-use_libv4l2} input device option.
697
698 The name of the device to grab is a file device node, usually Linux
699 systems tend to automatically create such nodes when the device
700 (e.g. an USB webcam) is plugged into the system, and has a name of the
701 kind @file{/dev/video@var{N}}, where @var{N} is a number associated to
702 the device.
703
704 Video4Linux2 devices usually support a limited set of
705 @var{width}x@var{height} sizes and frame rates. You can check which are
706 supported using @command{-list_formats all} for Video4Linux2 devices.
707 Some devices, like TV cards, support one or more standards. It is possible
708 to list all the supported standards using @command{-list_standards all}.
709
710 The time base for the timestamps is 1 microsecond. Depending on the kernel
711 version and configuration, the timestamps may be derived from the real time
712 clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
713 boot time, unaffected by NTP or manual changes to the clock). The
714 @option{-timestamps abs} or @option{-ts abs} option can be used to force
715 conversion into the real time clock.
716
717 Some usage examples of the video4linux2 device with @command{ffmpeg}
718 and @command{ffplay}:
719 @itemize
720 @item
721 Grab and show the input of a video4linux2 device:
722 @example
723 ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
724 @end example
725
726 @item
727 Grab and record the input of a video4linux2 device, leave the
728 frame rate and size as previously set:
729 @example
730 ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
731 @end example
732 @end itemize
733
734 For more information about Video4Linux, check @url{http://linuxtv.org/}.
735
736 @subsection Options
737
738 @table @option
739 @item standard
740 Set the standard. Must be the name of a supported standard. To get a
741 list of the supported standards, use the @option{list_standards}
742 option.
743
744 @item channel
745 Set the input channel number. Default to -1, which means using the
746 previously selected channel.
747
748 @item video_size
749 Set the video frame size. The argument must be a string in the form
750 @var{WIDTH}x@var{HEIGHT} or a valid size abbreviation.
751
752 @item pixel_format
753 Select the pixel format (only valid for raw video input).
754
755 @item input_format
756 Set the preferred pixel format (for raw video) or a codec name.
757 This option allows one to select the input format, when several are
758 available.
759
760 @item framerate
761 Set the preferred video frame rate.
762
763 @item list_formats
764 List available formats (supported pixel formats, codecs, and frame
765 sizes) and exit.
766
767 Available values are:
768 @table @samp
769 @item all
770 Show all available (compressed and non-compressed) formats.
771
772 @item raw
773 Show only raw video (non-compressed) formats.
774
775 @item compressed
776 Show only compressed formats.
777 @end table
778
779 @item list_standards
780 List supported standards and exit.
781
782 Available values are:
783 @table @samp
784 @item all
785 Show all supported standards.
786 @end table
787
788 @item timestamps, ts
789 Set type of timestamps for grabbed frames.
790
791 Available values are:
792 @table @samp
793 @item default
794 Use timestamps from the kernel.
795
796 @item abs
797 Use absolute timestamps (wall clock).
798
799 @item mono2abs
800 Force conversion from monotonic to absolute timestamps.
801 @end table
802
803 Default value is @code{default}.
804 @end table
805
806 @section vfwcap
807
808 VfW (Video for Windows) capture input device.
809
810 The filename passed as input is the capture driver number, ranging from
811 0 to 9. You may use "list" as filename to print a list of drivers. Any
812 other filename will be interpreted as device number 0.
813
814 @section x11grab
815
816 X11 video input device.
817
818 This device allows one to capture a region of an X11 display.
819
820 The filename passed as input has the syntax:
821 @example
822 [@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}]
823 @end example
824
825 @var{hostname}:@var{display_number}.@var{screen_number} specifies the
826 X11 display name of the screen to grab from. @var{hostname} can be
827 omitted, and defaults to "localhost". The environment variable
828 @env{DISPLAY} contains the default display name.
829
830 @var{x_offset} and @var{y_offset} specify the offsets of the grabbed
831 area with respect to the top-left border of the X11 screen. They
832 default to 0.
833
834 Check the X11 documentation (e.g. man X) for more detailed information.
835
836 Use the @command{dpyinfo} program for getting basic information about the
837 properties of your X11 display (e.g. grep for "name" or "dimensions").
838
839 For example to grab from @file{:0.0} using @command{ffmpeg}:
840 @example
841 ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
842 @end example
843
844 Grab at position @code{10,20}:
845 @example
846 ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
847 @end example
848
849 @subsection Options
850
851 @table @option
852 @item draw_mouse
853 Specify whether to draw the mouse pointer. A value of @code{0} specify
854 not to draw the pointer. Default value is @code{1}.
855
856 @item follow_mouse
857 Make the grabbed area follow the mouse. The argument can be
858 @code{centered} or a number of pixels @var{PIXELS}.
859
860 When it is specified with "centered", the grabbing region follows the mouse
861 pointer and keeps the pointer at the center of region; otherwise, the region
862 follows only when the mouse pointer reaches within @var{PIXELS} (greater than
863 zero) to the edge of region.
864
865 For example:
866 @example
867 ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
868 @end example
869
870 To follow only when the mouse pointer reaches within 100 pixels to edge:
871 @example
872 ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
873 @end example
874
875 @item framerate
876 Set the grabbing frame rate. Default value is @code{ntsc},
877 corresponding to a frame rate of @code{30000/1001}.
878
879 @item show_region
880 Show grabbed region on screen.
881
882 If @var{show_region} is specified with @code{1}, then the grabbing
883 region will be indicated on screen. With this option, it is easy to
884 know what is being grabbed if only a portion of the screen is grabbed.
885
886 For example:
887 @example
888 ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
889 @end example
890
891 With @var{follow_mouse}:
892 @example
893 ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
894 @end example
895
896 @item video_size
897 Set the video frame size. Default value is @code{vga}.
898
899 @item use_shm
900 Use the MIT-SHM extension for shared memory. Default value is @code{1}.
901 It may be necessary to disable it for remote displays.
902 @end table
903
904 @c man end INPUT DEVICES