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.

209 lines
6.1KB

  1. @chapter 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 them using the configure option
  7. "--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 "-formats" of the ff* tools will display the list of
  13. supported input devices (amongst the demuxers).
  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 to capture 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 @file{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 audio_beos
  39. BeOS audio input device.
  40. @section bktr
  41. BSD video input device.
  42. @section dv1394
  43. Linux DV 1394 input device.
  44. @section jack
  45. Jack input device.
  46. To enable this input device during configuration you need libjack
  47. installed on your system.
  48. A jack input device creates one or more jack writable clients, one for
  49. each audio channel, with name @var{client_name}:input_@var{N}, where
  50. @var{client_name} is the name provided by the application, and @var{N}
  51. is a number which identifies the channel.
  52. Each writable client will send the acquired data to the FFmpeg input
  53. device.
  54. Once you have created one or more jack readable clients, you need to
  55. connect them to one or more jack writable clients.
  56. To connect or disconnect jack clients you can use the
  57. @file{jack_connect} and @file{jack_disconnect} programs, or do it
  58. through a graphical interface, for example with @file{qjackctl}.
  59. To list the jack clients and their properties you can invoke the command
  60. @file{jack_lsp}.
  61. Follows an example which shows how to capture a jack readable client
  62. with @file{ffmpeg}.
  63. @example
  64. # create a jack writable client with name "ffmpeg"
  65. $ ffmpeg -f jack -i ffmpeg -y out.wav
  66. # start the sample jack_metro readable client
  67. $ jack_metro -b 120 -d 0.2 -f 4000
  68. # list the current jack clients
  69. $ jack_lsp -c
  70. system:capture_1
  71. system:capture_2
  72. system:playback_1
  73. system:playback_2
  74. ffmpeg:input_1
  75. metro:120_bpm
  76. # connect metro to the ffmpeg writable client
  77. $ jack_connect metro:120_bpm ffmpeg:input_1
  78. @end example
  79. For more information read:
  80. @url{http://jackaudio.org/}
  81. @section libdc1394
  82. IIDC1394 input device, based on libdc1394 and libraw1394.
  83. @section oss
  84. Open Sound System input device.
  85. The filename to provide to the input device is the device node
  86. representing the OSS input device, and is usually set to
  87. @file{/dev/dsp/}.
  88. For example to grab from @file{/dev/dsp/} using @file{ffmpeg} use the
  89. command:
  90. @example
  91. ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  92. @end example
  93. For more information about OSS see:
  94. @url{http://manuals.opensound.com/usersguide/dsp.html}
  95. @section video4linux and video4linux2
  96. Video4Linux and Video4Linux2 input video devices.
  97. The name of the device to grab is a file device node, usually Linux
  98. systems tend to automatically create such nodes when the device
  99. (e.g. an USB webcam) is plugged to the system, and has a name of the
  100. kind @file{/dev/video@var{N}}, where @var{N} is a number associated to
  101. the device.
  102. Video4Linux and Video4Linux2 devices only support a limited set of
  103. @var{width}x@var{height} sizes and framerates. You can check which are
  104. supported for example using the command @file{dov4l} for Video4Linux
  105. devices, and the command @file{v4l-info} for Video4Linux2 devices.
  106. If the size for the device is set to 0x0, the input device will
  107. try to autodetect the size to use.
  108. Video4Linux support is deprecated since Linux 2.6.30, and will be
  109. dropped in later versions.
  110. Follow some usage examples of the video4linux devices with the ff*
  111. tools.
  112. @example
  113. # grab and show the input of a video4linux device
  114. ffplay -s 320x240 -f video4linux /dev/video0
  115. # grab and show the input of a video4linux2 device, autoadjust size
  116. ffplay -f video4linux2 /dev/video0
  117. # grab and record the input of a video4linux2 device, autoadjust size
  118. ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
  119. @end example
  120. @section vfwcap
  121. VFW (Video For Window) catpure input device.
  122. @section x11grab
  123. X11 video input device.
  124. This device allows to capture a region of an X11 display.
  125. The filename passed in input has the syntax:
  126. @example
  127. [@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}]
  128. @end example
  129. @var{hostname}:@var{display_number}.@var{screen_number} specifies the
  130. X11 display name of the screen to grab from. @var{hostname} can be not
  131. specified, and defaults to "localhost". The environment variable
  132. @env{DISPLAY} contains the default display name.
  133. @var{x_offset} and @var{y_offset} specify the offsets of the grabbed
  134. area with respect to the top/left border of the X11 screen image. They
  135. default to 0.
  136. Check the X11 documentation (e.g. man X) for more detailed information.
  137. Use the @file{dpyinfo} program for getting basic information about the
  138. properties of your X11 display screen (e.g. grep for "name" or
  139. "dimensions").
  140. For example to grab from @file{:0.0} using @file{ffmpeg}:
  141. @example
  142. ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
  143. # grab at position 10,20
  144. ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
  145. @end example
  146. @c man end INPUT DEVICES