You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

982 lines
28KB

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