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.

2580 lines
110KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Devices Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg Devices Documentation
  17. </h1>
  18. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <div class="Contents_element" id="SEC_Contents">
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  26. <li><a id="toc-Device-Options" href="#Device-Options">2 Device Options</a></li>
  27. <li><a id="toc-Input-Devices" href="#Input-Devices">3 Input Devices</a>
  28. <ul class="no-bullet">
  29. <li><a id="toc-alsa" href="#alsa">3.1 alsa</a>
  30. <ul class="no-bullet">
  31. <li><a id="toc-Options" href="#Options">3.1.1 Options</a></li>
  32. </ul></li>
  33. <li><a id="toc-android_005fcamera" href="#android_005fcamera">3.2 android_camera</a>
  34. <ul class="no-bullet">
  35. <li><a id="toc-Options-1" href="#Options-1">3.2.1 Options</a></li>
  36. </ul></li>
  37. <li><a id="toc-avfoundation" href="#avfoundation">3.3 avfoundation</a>
  38. <ul class="no-bullet">
  39. <li><a id="toc-Options-2" href="#Options-2">3.3.1 Options</a></li>
  40. <li><a id="toc-Examples" href="#Examples">3.3.2 Examples</a></li>
  41. </ul></li>
  42. <li><a id="toc-bktr" href="#bktr">3.4 bktr</a>
  43. <ul class="no-bullet">
  44. <li><a id="toc-Options-3" href="#Options-3">3.4.1 Options</a></li>
  45. </ul></li>
  46. <li><a id="toc-decklink" href="#decklink">3.5 decklink</a>
  47. <ul class="no-bullet">
  48. <li><a id="toc-Options-4" href="#Options-4">3.5.1 Options</a></li>
  49. <li><a id="toc-Examples-1" href="#Examples-1">3.5.2 Examples</a></li>
  50. </ul></li>
  51. <li><a id="toc-dshow" href="#dshow">3.6 dshow</a>
  52. <ul class="no-bullet">
  53. <li><a id="toc-Options-5" href="#Options-5">3.6.1 Options</a></li>
  54. <li><a id="toc-Examples-2" href="#Examples-2">3.6.2 Examples</a></li>
  55. </ul></li>
  56. <li><a id="toc-fbdev" href="#fbdev">3.7 fbdev</a>
  57. <ul class="no-bullet">
  58. <li><a id="toc-Options-6" href="#Options-6">3.7.1 Options</a></li>
  59. </ul></li>
  60. <li><a id="toc-gdigrab" href="#gdigrab">3.8 gdigrab</a>
  61. <ul class="no-bullet">
  62. <li><a id="toc-Options-7" href="#Options-7">3.8.1 Options</a></li>
  63. </ul></li>
  64. <li><a id="toc-iec61883" href="#iec61883">3.9 iec61883</a>
  65. <ul class="no-bullet">
  66. <li><a id="toc-Options-8" href="#Options-8">3.9.1 Options</a></li>
  67. <li><a id="toc-Examples-3" href="#Examples-3">3.9.2 Examples</a></li>
  68. </ul></li>
  69. <li><a id="toc-jack" href="#jack">3.10 jack</a>
  70. <ul class="no-bullet">
  71. <li><a id="toc-Options-9" href="#Options-9">3.10.1 Options</a></li>
  72. </ul></li>
  73. <li><a id="toc-kmsgrab" href="#kmsgrab">3.11 kmsgrab</a>
  74. <ul class="no-bullet">
  75. <li><a id="toc-Options-10" href="#Options-10">3.11.1 Options</a></li>
  76. <li><a id="toc-Examples-4" href="#Examples-4">3.11.2 Examples</a></li>
  77. </ul></li>
  78. <li><a id="toc-lavfi" href="#lavfi">3.12 lavfi</a>
  79. <ul class="no-bullet">
  80. <li><a id="toc-Options-11" href="#Options-11">3.12.1 Options</a></li>
  81. <li><a id="toc-Examples-5" href="#Examples-5">3.12.2 Examples</a></li>
  82. </ul></li>
  83. <li><a id="toc-libcdio" href="#libcdio">3.13 libcdio</a>
  84. <ul class="no-bullet">
  85. <li><a id="toc-Options-12" href="#Options-12">3.13.1 Options</a></li>
  86. </ul></li>
  87. <li><a id="toc-libdc1394" href="#libdc1394">3.14 libdc1394</a>
  88. <ul class="no-bullet">
  89. <li><a id="toc-Options-13" href="#Options-13">3.14.1 Options</a></li>
  90. </ul></li>
  91. <li><a id="toc-openal" href="#openal">3.15 openal</a>
  92. <ul class="no-bullet">
  93. <li><a id="toc-Options-14" href="#Options-14">3.15.1 Options</a></li>
  94. <li><a id="toc-Examples-6" href="#Examples-6">3.15.2 Examples</a></li>
  95. </ul></li>
  96. <li><a id="toc-oss" href="#oss">3.16 oss</a>
  97. <ul class="no-bullet">
  98. <li><a id="toc-Options-15" href="#Options-15">3.16.1 Options</a></li>
  99. </ul></li>
  100. <li><a id="toc-pulse" href="#pulse">3.17 pulse</a>
  101. <ul class="no-bullet">
  102. <li><a id="toc-Options-16" href="#Options-16">3.17.1 Options</a></li>
  103. <li><a id="toc-Examples-7" href="#Examples-7">3.17.2 Examples</a></li>
  104. </ul></li>
  105. <li><a id="toc-sndio" href="#sndio">3.18 sndio</a>
  106. <ul class="no-bullet">
  107. <li><a id="toc-Options-17" href="#Options-17">3.18.1 Options</a></li>
  108. </ul></li>
  109. <li><a id="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">3.19 video4linux2, v4l2</a>
  110. <ul class="no-bullet">
  111. <li><a id="toc-Options-18" href="#Options-18">3.19.1 Options</a></li>
  112. </ul></li>
  113. <li><a id="toc-vfwcap" href="#vfwcap">3.20 vfwcap</a>
  114. <ul class="no-bullet">
  115. <li><a id="toc-Options-19" href="#Options-19">3.20.1 Options</a></li>
  116. </ul></li>
  117. <li><a id="toc-x11grab" href="#x11grab">3.21 x11grab</a>
  118. <ul class="no-bullet">
  119. <li><a id="toc-Options-20" href="#Options-20">3.21.1 Options</a></li>
  120. </ul></li>
  121. </ul></li>
  122. <li><a id="toc-Output-Devices" href="#Output-Devices">4 Output Devices</a>
  123. <ul class="no-bullet">
  124. <li><a id="toc-alsa-1" href="#alsa-1">4.1 alsa</a>
  125. <ul class="no-bullet">
  126. <li><a id="toc-Examples-8" href="#Examples-8">4.1.1 Examples</a></li>
  127. </ul></li>
  128. <li><a id="toc-AudioToolbox" href="#AudioToolbox">4.2 AudioToolbox</a>
  129. <ul class="no-bullet">
  130. <li><a id="toc-Options-21" href="#Options-21">4.2.1 Options</a></li>
  131. <li><a id="toc-Examples-9" href="#Examples-9">4.2.2 Examples</a></li>
  132. </ul></li>
  133. <li><a id="toc-caca" href="#caca">4.3 caca</a>
  134. <ul class="no-bullet">
  135. <li><a id="toc-Options-22" href="#Options-22">4.3.1 Options</a></li>
  136. <li><a id="toc-Examples-10" href="#Examples-10">4.3.2 Examples</a></li>
  137. </ul></li>
  138. <li><a id="toc-decklink-1" href="#decklink-1">4.4 decklink</a>
  139. <ul class="no-bullet">
  140. <li><a id="toc-Options-23" href="#Options-23">4.4.1 Options</a></li>
  141. <li><a id="toc-Examples-11" href="#Examples-11">4.4.2 Examples</a></li>
  142. </ul></li>
  143. <li><a id="toc-fbdev-1" href="#fbdev-1">4.5 fbdev</a>
  144. <ul class="no-bullet">
  145. <li><a id="toc-Options-24" href="#Options-24">4.5.1 Options</a></li>
  146. <li><a id="toc-Examples-12" href="#Examples-12">4.5.2 Examples</a></li>
  147. </ul></li>
  148. <li><a id="toc-opengl" href="#opengl">4.6 opengl</a>
  149. <ul class="no-bullet">
  150. <li><a id="toc-Options-25" href="#Options-25">4.6.1 Options</a></li>
  151. <li><a id="toc-Examples-13" href="#Examples-13">4.6.2 Examples</a></li>
  152. </ul></li>
  153. <li><a id="toc-oss-1" href="#oss-1">4.7 oss</a></li>
  154. <li><a id="toc-pulse-1" href="#pulse-1">4.8 pulse</a>
  155. <ul class="no-bullet">
  156. <li><a id="toc-Options-26" href="#Options-26">4.8.1 Options</a></li>
  157. <li><a id="toc-Examples-14" href="#Examples-14">4.8.2 Examples</a></li>
  158. </ul></li>
  159. <li><a id="toc-sdl" href="#sdl">4.9 sdl</a>
  160. <ul class="no-bullet">
  161. <li><a id="toc-Options-27" href="#Options-27">4.9.1 Options</a></li>
  162. <li><a id="toc-Interactive-commands" href="#Interactive-commands">4.9.2 Interactive commands</a></li>
  163. <li><a id="toc-Examples-15" href="#Examples-15">4.9.3 Examples</a></li>
  164. </ul></li>
  165. <li><a id="toc-sndio-1" href="#sndio-1">4.10 sndio</a></li>
  166. <li><a id="toc-v4l2" href="#v4l2">4.11 v4l2</a></li>
  167. <li><a id="toc-xv" href="#xv">4.12 xv</a>
  168. <ul class="no-bullet">
  169. <li><a id="toc-Options-28" href="#Options-28">4.12.1 Options</a></li>
  170. <li><a id="toc-Examples-16" href="#Examples-16">4.12.2 Examples</a></li>
  171. </ul></li>
  172. </ul></li>
  173. <li><a id="toc-See-Also" href="#See-Also">5 See Also</a></li>
  174. <li><a id="toc-Authors" href="#Authors">6 Authors</a></li>
  175. </ul>
  176. </div>
  177. </div>
  178. <a name="Description"></a>
  179. <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  180. <p>This document describes the input and output devices provided by the
  181. libavdevice library.
  182. </p>
  183. <a name="Device-Options"></a>
  184. <h2 class="chapter">2 Device Options<span class="pull-right"><a class="anchor hidden-xs" href="#Device-Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Device-Options" aria-hidden="true">TOC</a></span></h2>
  185. <p>The libavdevice library provides the same interface as
  186. libavformat. Namely, an input device is considered like a demuxer, and
  187. an output device like a muxer, and the interface and generic device
  188. options are the same provided by libavformat (see the ffmpeg-formats
  189. manual).
  190. </p>
  191. <p>In addition each input or output device may support so-called private
  192. options, which are specific for that component.
  193. </p>
  194. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  195. FFmpeg tools, or by setting the value explicitly in the device
  196. <code>AVFormatContext</code> options or using the <samp>libavutil/opt.h</samp> API
  197. for programmatic use.
  198. </p>
  199. <a name="Input-Devices"></a>
  200. <h2 class="chapter">3 Input Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Input-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Input-Devices" aria-hidden="true">TOC</a></span></h2>
  201. <p>Input devices are configured elements in FFmpeg which enable accessing
  202. the data coming from a multimedia device attached to your system.
  203. </p>
  204. <p>When you configure your FFmpeg build, all the supported input devices
  205. are enabled by default. You can list all available ones using the
  206. configure option &quot;&ndash;list-indevs&quot;.
  207. </p>
  208. <p>You can disable all the input devices using the configure option
  209. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  210. option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
  211. input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
  212. </p>
  213. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  214. supported input devices.
  215. </p>
  216. <p>A description of the currently available input devices follows.
  217. </p>
  218. <a name="alsa"></a>
  219. <h3 class="section">3.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa" aria-hidden="true">TOC</a></span></h3>
  220. <p>ALSA (Advanced Linux Sound Architecture) input device.
  221. </p>
  222. <p>To enable this input device during configuration you need libasound
  223. installed on your system.
  224. </p>
  225. <p>This device allows capturing from an ALSA device. The name of the
  226. device to capture has to be an ALSA card identifier.
  227. </p>
  228. <p>An ALSA identifier has the syntax:
  229. </p><div class="example">
  230. <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
  231. </pre></div>
  232. <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
  233. </p>
  234. <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
  235. specify card number or identifier, device number and subdevice number
  236. (-1 means any).
  237. </p>
  238. <p>To see the list of cards currently recognized by your system check the
  239. files <samp>/proc/asound/cards</samp> and <samp>/proc/asound/devices</samp>.
  240. </p>
  241. <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
  242. card id 0, you may run the command:
  243. </p><div class="example">
  244. <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
  245. </pre></div>
  246. <p>For more information see:
  247. <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
  248. </p>
  249. <a name="Options"></a>
  250. <h4 class="subsection">3.1.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h4>
  251. <dl compact="compact">
  252. <dt><span><samp>sample_rate</samp></span></dt>
  253. <dd><p>Set the sample rate in Hz. Default is 48000.
  254. </p>
  255. </dd>
  256. <dt><span><samp>channels</samp></span></dt>
  257. <dd><p>Set the number of channels. Default is 2.
  258. </p>
  259. </dd>
  260. </dl>
  261. <a name="android_005fcamera"></a>
  262. <h3 class="section">3.2 android_camera<span class="pull-right"><a class="anchor hidden-xs" href="#android_005fcamera" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-android_005fcamera" aria-hidden="true">TOC</a></span></h3>
  263. <p>Android camera input device.
  264. </p>
  265. <p>This input devices uses the Android Camera2 NDK API which is
  266. available on devices with API level 24+. The availability of
  267. android_camera is autodetected during configuration.
  268. </p>
  269. <p>This device allows capturing from all cameras on an Android device,
  270. which are integrated into the Camera2 NDK API.
  271. </p>
  272. <p>The available cameras are enumerated internally and can be selected
  273. with the <var>camera_index</var> parameter. The input file string is
  274. discarded.
  275. </p>
  276. <p>Generally the back facing camera has index 0 while the front facing
  277. camera has index 1.
  278. </p>
  279. <a name="Options-1"></a>
  280. <h4 class="subsection">3.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  281. <dl compact="compact">
  282. <dt><span><samp>video_size</samp></span></dt>
  283. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  284. Falls back to the first available configuration reported by
  285. Android if requested video size is not available or by default.
  286. </p>
  287. </dd>
  288. <dt><span><samp>framerate</samp></span></dt>
  289. <dd><p>Set the video framerate.
  290. Falls back to the first available configuration reported by
  291. Android if requested framerate is not available or by default (-1).
  292. </p>
  293. </dd>
  294. <dt><span><samp>camera_index</samp></span></dt>
  295. <dd><p>Set the index of the camera to use. Default is 0.
  296. </p>
  297. </dd>
  298. <dt><span><samp>input_queue_size</samp></span></dt>
  299. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  300. </p>
  301. </dd>
  302. </dl>
  303. <a name="avfoundation"></a>
  304. <h3 class="section">3.3 avfoundation<span class="pull-right"><a class="anchor hidden-xs" href="#avfoundation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avfoundation" aria-hidden="true">TOC</a></span></h3>
  305. <p>AVFoundation input device.
  306. </p>
  307. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  308. </p>
  309. <p>The input filename has to be given in the following syntax:
  310. </p><div class="example">
  311. <pre class="example">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  312. </pre></div>
  313. <p>The first entry selects the video input while the latter selects the audio input.
  314. The stream has to be specified by the device name or the device index as shown by the device list.
  315. Alternatively, the video and/or audio input device can be chosen by index using the
  316. <samp>
  317. -video_device_index &lt;INDEX&gt;
  318. </samp>
  319. and/or
  320. <samp>
  321. -audio_device_index &lt;INDEX&gt;
  322. </samp>
  323. , overriding any
  324. device name or index given in the input filename.
  325. </p>
  326. <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
  327. all device names and corresponding indices.
  328. </p>
  329. <p>There are two device name aliases:
  330. </p><dl compact="compact">
  331. <dt><span><code>default</code></span></dt>
  332. <dd><p>Select the AVFoundation default device of the corresponding type.
  333. </p>
  334. </dd>
  335. <dt><span><code>none</code></span></dt>
  336. <dd><p>Do not record the corresponding media type.
  337. This is equivalent to specifying an empty device name or index.
  338. </p>
  339. </dd>
  340. </dl>
  341. <a name="Options-2"></a>
  342. <h4 class="subsection">3.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  343. <p>AVFoundation supports the following options:
  344. </p>
  345. <dl compact="compact">
  346. <dt><span><samp>-list_devices &lt;TRUE|FALSE&gt;</samp></span></dt>
  347. <dd><p>If set to true, a list of all available input devices is given showing all
  348. device names and indices.
  349. </p>
  350. </dd>
  351. <dt><span><samp>-video_device_index &lt;INDEX&gt;</samp></span></dt>
  352. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  353. </p>
  354. </dd>
  355. <dt><span><samp>-audio_device_index &lt;INDEX&gt;</samp></span></dt>
  356. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  357. </p>
  358. </dd>
  359. <dt><span><samp>-pixel_format &lt;FORMAT&gt;</samp></span></dt>
  360. <dd><p>Request the video device to use a specific pixel format.
  361. If the specified format is not supported, a list of available formats is given
  362. and the first one in this list is used instead. Available pixel formats are:
  363. <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  364. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  365. yuv420p, nv12, yuyv422, gray</code>
  366. </p>
  367. </dd>
  368. <dt><span><samp>-framerate</samp></span></dt>
  369. <dd><p>Set the grabbing frame rate. Default is <code>ntsc</code>, corresponding to a
  370. frame rate of <code>30000/1001</code>.
  371. </p>
  372. </dd>
  373. <dt><span><samp>-video_size</samp></span></dt>
  374. <dd><p>Set the video frame size.
  375. </p>
  376. </dd>
  377. <dt><span><samp>-capture_cursor</samp></span></dt>
  378. <dd><p>Capture the mouse pointer. Default is 0.
  379. </p>
  380. </dd>
  381. <dt><span><samp>-capture_mouse_clicks</samp></span></dt>
  382. <dd><p>Capture the screen mouse clicks. Default is 0.
  383. </p>
  384. </dd>
  385. <dt><span><samp>-capture_raw_data</samp></span></dt>
  386. <dd><p>Capture the raw device data. Default is 0.
  387. Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched.
  388. </p></dd>
  389. </dl>
  390. <a name="Examples"></a>
  391. <h4 class="subsection">3.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
  392. <ul>
  393. <li> Print the list of AVFoundation supported devices and exit:
  394. <div class="example">
  395. <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  396. </pre></div>
  397. </li><li> Record video from video device 0 and audio from audio device 0 into out.avi:
  398. <div class="example">
  399. <pre class="example">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  400. </pre></div>
  401. </li><li> Record video from video device 2 and audio from audio device 1 into out.avi:
  402. <div class="example">
  403. <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  404. </pre></div>
  405. </li><li> Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  406. <div class="example">
  407. <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  408. </pre></div>
  409. </li><li> Record raw DV data from a suitable input device and write the output into out.dv:
  410. <div class="example">
  411. <pre class="example">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  412. </pre></div>
  413. </li></ul>
  414. <a name="bktr"></a>
  415. <h3 class="section">3.4 bktr<span class="pull-right"><a class="anchor hidden-xs" href="#bktr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bktr" aria-hidden="true">TOC</a></span></h3>
  416. <p>BSD video input device.
  417. </p>
  418. <a name="Options-3"></a>
  419. <h4 class="subsection">3.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  420. <dl compact="compact">
  421. <dt><span><samp>framerate</samp></span></dt>
  422. <dd><p>Set the frame rate.
  423. </p>
  424. </dd>
  425. <dt><span><samp>video_size</samp></span></dt>
  426. <dd><p>Set the video frame size. Default is <code>vga</code>.
  427. </p>
  428. </dd>
  429. <dt><span><samp>standard</samp></span></dt>
  430. <dd>
  431. <p>Available values are:
  432. </p><dl compact="compact">
  433. <dt><span>&lsquo;<samp>pal</samp>&rsquo;</span></dt>
  434. <dt><span>&lsquo;<samp>ntsc</samp>&rsquo;</span></dt>
  435. <dt><span>&lsquo;<samp>secam</samp>&rsquo;</span></dt>
  436. <dt><span>&lsquo;<samp>paln</samp>&rsquo;</span></dt>
  437. <dt><span>&lsquo;<samp>palm</samp>&rsquo;</span></dt>
  438. <dt><span>&lsquo;<samp>ntscj</samp>&rsquo;</span></dt>
  439. </dl>
  440. </dd>
  441. </dl>
  442. <a name="decklink"></a>
  443. <h3 class="section">3.5 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink" aria-hidden="true">TOC</a></span></h3>
  444. <p>The decklink input device provides capture capabilities for Blackmagic
  445. DeckLink devices.
  446. </p>
  447. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  448. need to configure with the appropriate <code>--extra-cflags</code>
  449. and <code>--extra-ldflags</code>.
  450. On Windows, you need to run the IDL files through <code>widl</code>.
  451. </p>
  452. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  453. input can be set with <samp>raw_format</samp>.
  454. Framerate and video size must be determined for your device with
  455. <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  456. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  457. audio track.
  458. </p>
  459. <a name="Options-4"></a>
  460. <h4 class="subsection">3.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  461. <dl compact="compact">
  462. <dt><span><samp>list_devices</samp></span></dt>
  463. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  464. Defaults to <samp>false</samp>. This option is deprecated, please use the
  465. <code>-sources</code> option of ffmpeg to list the available input devices.
  466. </p>
  467. </dd>
  468. <dt><span><samp>list_formats</samp></span></dt>
  469. <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
  470. Defaults to <samp>false</samp>.
  471. </p>
  472. </dd>
  473. <dt><span><samp>format_code &lt;FourCC&gt;</samp></span></dt>
  474. <dd><p>This sets the input video format to the format given by the FourCC. To see
  475. the supported values of your device(s) use <samp>list_formats</samp>.
  476. Note that there is a FourCC <samp>'pal '</samp> that can also be used
  477. as <samp>pal</samp> (3 letters).
  478. Default behavior is autodetection of the input video format, if the hardware
  479. supports it.
  480. </p>
  481. </dd>
  482. <dt><span><samp>raw_format</samp></span></dt>
  483. <dd><p>Set the pixel format of the captured video.
  484. Available values are:
  485. </p><dl compact="compact">
  486. <dt><span>&lsquo;<samp>auto</samp>&rsquo;</span></dt>
  487. <dd>
  488. <p>This is the default which means 8-bit YUV 422 or 8-bit ARGB if format
  489. autodetection is used, 8-bit YUV 422 otherwise.
  490. </p>
  491. </dd>
  492. <dt><span>&lsquo;<samp>uyvy422</samp>&rsquo;</span></dt>
  493. <dd>
  494. <p>8-bit YUV 422.
  495. </p>
  496. </dd>
  497. <dt><span>&lsquo;<samp>yuv422p10</samp>&rsquo;</span></dt>
  498. <dd>
  499. <p>10-bit YUV 422.
  500. </p>
  501. </dd>
  502. <dt><span>&lsquo;<samp>argb</samp>&rsquo;</span></dt>
  503. <dd>
  504. <p>8-bit RGB.
  505. </p>
  506. </dd>
  507. <dt><span>&lsquo;<samp>bgra</samp>&rsquo;</span></dt>
  508. <dd>
  509. <p>8-bit RGB.
  510. </p>
  511. </dd>
  512. <dt><span>&lsquo;<samp>rgb10</samp>&rsquo;</span></dt>
  513. <dd>
  514. <p>10-bit RGB.
  515. </p>
  516. </dd>
  517. </dl>
  518. </dd>
  519. <dt><span><samp>teletext_lines</samp></span></dt>
  520. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  521. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  522. sources are supported. In case of HD sources, OP47 packets are decoded.
  523. </p>
  524. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  525. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  526. which do not contain teletext information will be ignored. You can use the
  527. special <samp>all</samp> constant to select all possible lines, or
  528. <samp>standard</samp> to skip lines 6, 318 and 319, which are not compatible with
  529. all receivers.
  530. </p>
  531. <p>For SD sources, ffmpeg needs to be compiled with <code>--enable-libzvbi</code>. For
  532. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  533. bit mode.
  534. </p>
  535. </dd>
  536. <dt><span><samp>channels</samp></span></dt>
  537. <dd><p>Defines number of audio channels to capture. Must be &lsquo;<samp>2</samp>&rsquo;, &lsquo;<samp>8</samp>&rsquo; or &lsquo;<samp>16</samp>&rsquo;.
  538. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  539. </p>
  540. </dd>
  541. <dt><span><samp>duplex_mode</samp></span></dt>
  542. <dd><p>Sets the decklink device duplex/profile mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo;, &lsquo;<samp>full</samp>&rsquo;,
  543. &lsquo;<samp>one_sub_device_full</samp>&rsquo;, &lsquo;<samp>one_sub_device_half</samp>&rsquo;, &lsquo;<samp>two_sub_device_full</samp>&rsquo;,
  544. &lsquo;<samp>four_sub_device_half</samp>&rsquo;
  545. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  546. </p>
  547. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  548. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  549. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  550. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  551. </p>
  552. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  553. &lsquo;<samp>one_sub_device_full</samp>&rsquo;, &lsquo;<samp>one_sub_device_half</samp>&rsquo;, &lsquo;<samp>two_sub_device_full</samp>&rsquo;,
  554. &lsquo;<samp>four_sub_device_half</samp>&rsquo;
  555. </p>
  556. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  557. &lsquo;<samp>half</samp>&rsquo;, &lsquo;<samp>full</samp>&rsquo;
  558. </p>
  559. </dd>
  560. <dt><span><samp>timecode_format</samp></span></dt>
  561. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  562. &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>rp188vitc</samp>&rsquo;, &lsquo;<samp>rp188vitc2</samp>&rsquo;, &lsquo;<samp>rp188ltc</samp>&rsquo;,
  563. &lsquo;<samp>rp188hfr</samp>&rsquo;, &lsquo;<samp>rp188any</samp>&rsquo;, &lsquo;<samp>vitc</samp>&rsquo;, &lsquo;<samp>vitc2</samp>&rsquo;, or &lsquo;<samp>serial</samp>&rsquo;.
  564. Defaults to &lsquo;<samp>none</samp>&rsquo; (not included).
  565. </p>
  566. <p>In order to properly support 50/60 fps timecodes, the ordering of the queried
  567. timecode types for &lsquo;<samp>rp188any</samp>&rsquo; is HFR, VITC1, VITC2 and LTC for &gt;30 fps
  568. content. Note that this is slightly different to the ordering used by the
  569. DeckLink API, which is HFR, VITC1, LTC, VITC2.
  570. </p>
  571. </dd>
  572. <dt><span><samp>video_input</samp></span></dt>
  573. <dd><p>Sets the video input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>sdi</samp>&rsquo;, &lsquo;<samp>hdmi</samp>&rsquo;,
  574. &lsquo;<samp>optical_sdi</samp>&rsquo;, &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>composite</samp>&rsquo; or &lsquo;<samp>s_video</samp>&rsquo;.
  575. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  576. </p>
  577. </dd>
  578. <dt><span><samp>audio_input</samp></span></dt>
  579. <dd><p>Sets the audio input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>embedded</samp>&rsquo;,
  580. &lsquo;<samp>aes_ebu</samp>&rsquo;, &lsquo;<samp>analog</samp>&rsquo;, &lsquo;<samp>analog_xlr</samp>&rsquo;, &lsquo;<samp>analog_rca</samp>&rsquo; or
  581. &lsquo;<samp>microphone</samp>&rsquo;. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  582. </p>
  583. </dd>
  584. <dt><span><samp>video_pts</samp></span></dt>
  585. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  586. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  587. Defaults to &lsquo;<samp>video</samp>&rsquo;.
  588. </p>
  589. </dd>
  590. <dt><span><samp>audio_pts</samp></span></dt>
  591. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  592. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  593. Defaults to &lsquo;<samp>audio</samp>&rsquo;.
  594. </p>
  595. </dd>
  596. <dt><span><samp>draw_bars</samp></span></dt>
  597. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  598. Defaults to &lsquo;<samp>true</samp>&rsquo;.
  599. </p>
  600. </dd>
  601. <dt><span><samp>queue_size</samp></span></dt>
  602. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  603. incoming frames will be dropped.
  604. Defaults to &lsquo;<samp>1073741824</samp>&rsquo;.
  605. </p>
  606. </dd>
  607. <dt><span><samp>audio_depth</samp></span></dt>
  608. <dd><p>Sets the audio sample bit depth. Must be &lsquo;<samp>16</samp>&rsquo; or &lsquo;<samp>32</samp>&rsquo;.
  609. Defaults to &lsquo;<samp>16</samp>&rsquo;.
  610. </p>
  611. </dd>
  612. <dt><span><samp>decklink_copyts</samp></span></dt>
  613. <dd><p>If set to <samp>true</samp>, timestamps are forwarded as they are without removing
  614. the initial offset.
  615. Defaults to <samp>false</samp>.
  616. </p>
  617. </dd>
  618. <dt><span><samp>timestamp_align</samp></span></dt>
  619. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  620. dropped till the system timestamp aligns with configured value.
  621. Alignment difference of up to one frame duration is tolerated.
  622. This is useful for maintaining input synchronization across N different
  623. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  624. hardware devices should be synchronized with protocols such as NTP or PTP,
  625. before using this option.
  626. Note that this method is not foolproof. In some border cases input
  627. synchronization may not happen due to thread scheduling jitters in the OS.
  628. Either sync could go wrong by 1 frame or in a rarer case
  629. <samp>timestamp_align</samp> seconds.
  630. Defaults to &lsquo;<samp>0</samp>&rsquo;.
  631. </p>
  632. </dd>
  633. <dt><span><samp>wait_for_tc (<em>bool</em>)</samp></span></dt>
  634. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  635. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  636. timecode will be inaccurate. If this option is set to <samp>true</samp>, input frames
  637. are dropped till a frame with timecode is received.
  638. Option <var>timecode_format</var> must be specified.
  639. Defaults to <samp>false</samp>.
  640. </p>
  641. </dd>
  642. <dt><span><samp>enable_klv(<em>bool</em>)</samp></span></dt>
  643. <dd><p>If set to <samp>true</samp>, extracts KLV data from VANC and outputs KLV packets.
  644. KLV VANC packets are joined based on MID and PSC fields and aggregated into
  645. one KLV packet.
  646. Defaults to <samp>false</samp>.
  647. </p>
  648. </dd>
  649. </dl>
  650. <a name="Examples-1"></a>
  651. <h4 class="subsection">3.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
  652. <ul>
  653. <li> List input devices:
  654. <div class="example">
  655. <pre class="example">ffmpeg -sources decklink
  656. </pre></div>
  657. </li><li> List supported formats:
  658. <div class="example">
  659. <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  660. </pre></div>
  661. </li><li> Capture video clip at 1080i50:
  662. <div class="example">
  663. <pre class="example">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  664. </pre></div>
  665. </li><li> Capture video clip at 1080i50 10 bit:
  666. <div class="example">
  667. <pre class="example">ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  668. </pre></div>
  669. </li><li> Capture video clip at 1080i50 with 16 audio channels:
  670. <div class="example">
  671. <pre class="example">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  672. </pre></div>
  673. </li></ul>
  674. <a name="dshow"></a>
  675. <h3 class="section">3.6 dshow<span class="pull-right"><a class="anchor hidden-xs" href="#dshow" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dshow" aria-hidden="true">TOC</a></span></h3>
  676. <p>Windows DirectShow input device.
  677. </p>
  678. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  679. Currently only audio and video devices are supported.
  680. </p>
  681. <p>Multiple devices may be opened as separate inputs, but they may also be
  682. opened on the same input, which should improve synchronism between them.
  683. </p>
  684. <p>The input name should be in the format:
  685. </p>
  686. <div class="example">
  687. <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
  688. </pre></div>
  689. <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
  690. and <var>NAME</var> is the device&rsquo;s name or alternative name..
  691. </p>
  692. <a name="Options-5"></a>
  693. <h4 class="subsection">3.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  694. <p>If no options are specified, the device&rsquo;s defaults are used.
  695. If the device does not support the requested options, it will
  696. fail to open.
  697. </p>
  698. <dl compact="compact">
  699. <dt><span><samp>video_size</samp></span></dt>
  700. <dd><p>Set the video size in the captured video.
  701. </p>
  702. </dd>
  703. <dt><span><samp>framerate</samp></span></dt>
  704. <dd><p>Set the frame rate in the captured video.
  705. </p>
  706. </dd>
  707. <dt><span><samp>sample_rate</samp></span></dt>
  708. <dd><p>Set the sample rate (in Hz) of the captured audio.
  709. </p>
  710. </dd>
  711. <dt><span><samp>sample_size</samp></span></dt>
  712. <dd><p>Set the sample size (in bits) of the captured audio.
  713. </p>
  714. </dd>
  715. <dt><span><samp>channels</samp></span></dt>
  716. <dd><p>Set the number of channels in the captured audio.
  717. </p>
  718. </dd>
  719. <dt><span><samp>list_devices</samp></span></dt>
  720. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  721. </p>
  722. </dd>
  723. <dt><span><samp>list_options</samp></span></dt>
  724. <dd><p>If set to <samp>true</samp>, print a list of selected device&rsquo;s options
  725. and exit.
  726. </p>
  727. </dd>
  728. <dt><span><samp>video_device_number</samp></span></dt>
  729. <dd><p>Set video device number for devices with the same name (starts at 0,
  730. defaults to 0).
  731. </p>
  732. </dd>
  733. <dt><span><samp>audio_device_number</samp></span></dt>
  734. <dd><p>Set audio device number for devices with the same name (starts at 0,
  735. defaults to 0).
  736. </p>
  737. </dd>
  738. <dt><span><samp>pixel_format</samp></span></dt>
  739. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  740. the video codec is not set or set to rawvideo.
  741. </p>
  742. </dd>
  743. <dt><span><samp>audio_buffer_size</samp></span></dt>
  744. <dd><p>Set audio device buffer size in milliseconds (which can directly
  745. impact latency, depending on the device).
  746. Defaults to using the audio device&rsquo;s
  747. default buffer size (typically some multiple of 500ms).
  748. Setting this value too low can degrade performance.
  749. See also
  750. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx</a>
  751. </p>
  752. </dd>
  753. <dt><span><samp>video_pin_name</samp></span></dt>
  754. <dd><p>Select video capture pin to use by name or alternative name.
  755. </p>
  756. </dd>
  757. <dt><span><samp>audio_pin_name</samp></span></dt>
  758. <dd><p>Select audio capture pin to use by name or alternative name.
  759. </p>
  760. </dd>
  761. <dt><span><samp>crossbar_video_input_pin_number</samp></span></dt>
  762. <dd><p>Select video input pin number for crossbar device. This will be
  763. routed to the crossbar device&rsquo;s Video Decoder output pin.
  764. Note that changing this value can affect future invocations
  765. (sets a new default) until system reboot occurs.
  766. </p>
  767. </dd>
  768. <dt><span><samp>crossbar_audio_input_pin_number</samp></span></dt>
  769. <dd><p>Select audio input pin number for crossbar device. This will be
  770. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  771. Note that changing this value can affect future invocations
  772. (sets a new default) until system reboot occurs.
  773. </p>
  774. </dd>
  775. <dt><span><samp>show_video_device_dialog</samp></span></dt>
  776. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
  777. to the end user, allowing them to change video filter properties
  778. and configurations manually.
  779. Note that for crossbar devices, adjusting values in this dialog
  780. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  781. input frame rates, sizes, interlacing, etc. Changing these values can
  782. enable different scan rates/frame rates and avoiding green bars at
  783. the bottom, flickering scan lines, etc.
  784. Note that with some devices, changing these properties can also affect future
  785. invocations (sets new defaults) until system reboot occurs.
  786. </p>
  787. </dd>
  788. <dt><span><samp>show_audio_device_dialog</samp></span></dt>
  789. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display dialog
  790. to the end user, allowing them to change audio filter properties
  791. and configurations manually.
  792. </p>
  793. </dd>
  794. <dt><span><samp>show_video_crossbar_connection_dialog</samp></span></dt>
  795. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  796. dialog to the end user, allowing them to manually
  797. modify crossbar pin routings, when it opens a video device.
  798. </p>
  799. </dd>
  800. <dt><span><samp>show_audio_crossbar_connection_dialog</samp></span></dt>
  801. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  802. dialog to the end user, allowing them to manually
  803. modify crossbar pin routings, when it opens an audio device.
  804. </p>
  805. </dd>
  806. <dt><span><samp>show_analog_tv_tuner_dialog</samp></span></dt>
  807. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  808. dialog to the end user, allowing them to manually
  809. modify TV channels and frequencies.
  810. </p>
  811. </dd>
  812. <dt><span><samp>show_analog_tv_tuner_audio_dialog</samp></span></dt>
  813. <dd><p>If set to <samp>true</samp>, before capture starts, popup a display
  814. dialog to the end user, allowing them to manually
  815. modify TV audio (like mono vs. stereo, Language A,B or C).
  816. </p>
  817. </dd>
  818. <dt><span><samp>audio_device_load</samp></span></dt>
  819. <dd><p>Load an audio capture filter device from file instead of searching
  820. it by name. It may load additional parameters too, if the filter
  821. supports the serialization of its properties to.
  822. To use this an audio capture source has to be specified, but it can
  823. be anything even fake one.
  824. </p>
  825. </dd>
  826. <dt><span><samp>audio_device_save</samp></span></dt>
  827. <dd><p>Save the currently used audio capture filter device and its
  828. parameters (if the filter supports it) to a file.
  829. If a file with the same name exists it will be overwritten.
  830. </p>
  831. </dd>
  832. <dt><span><samp>video_device_load</samp></span></dt>
  833. <dd><p>Load a video capture filter device from file instead of searching
  834. it by name. It may load additional parameters too, if the filter
  835. supports the serialization of its properties to.
  836. To use this a video capture source has to be specified, but it can
  837. be anything even fake one.
  838. </p>
  839. </dd>
  840. <dt><span><samp>video_device_save</samp></span></dt>
  841. <dd><p>Save the currently used video capture filter device and its
  842. parameters (if the filter supports it) to a file.
  843. If a file with the same name exists it will be overwritten.
  844. </p>
  845. </dd>
  846. <dt><span><samp>use_video_device_timestamps</samp></span></dt>
  847. <dd><p>If set to <samp>false</samp>, the timestamp for video frames will be
  848. derived from the wallclock instead of the timestamp provided by
  849. the capture device. This allows working around devices that
  850. provide unreliable timestamps.
  851. </p>
  852. </dd>
  853. </dl>
  854. <a name="Examples-2"></a>
  855. <h4 class="subsection">3.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  856. <ul>
  857. <li> Print the list of DirectShow supported devices and exit:
  858. <div class="example">
  859. <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
  860. </pre></div>
  861. </li><li> Open video device <var>Camera</var>:
  862. <div class="example">
  863. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  864. </pre></div>
  865. </li><li> Open second video device with name <var>Camera</var>:
  866. <div class="example">
  867. <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  868. </pre></div>
  869. </li><li> Open video device <var>Camera</var> and audio device <var>Microphone</var>:
  870. <div class="example">
  871. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  872. </pre></div>
  873. </li><li> Print the list of supported options in selected device and exit:
  874. <div class="example">
  875. <pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  876. </pre></div>
  877. </li><li> Specify pin names to capture by name or alternative name, specify alternative device name:
  878. <div class="example">
  879. <pre class="example">$ ffmpeg -f dshow -audio_pin_name &quot;Audio Out&quot; -video_pin_name 2 -i video=video=&quot;@device_pnp_\\?\pci#ven_1a0a&amp;dev_6200&amp;subsys_62021461&amp;rev_01#4&amp;e2c7dd6&amp;0&amp;00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}&quot;:audio=&quot;Microphone&quot;
  880. </pre></div>
  881. </li><li> Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  882. <div class="example">
  883. <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  884. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  885. </pre></div>
  886. </li></ul>
  887. <a name="fbdev"></a>
  888. <h3 class="section">3.7 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev" aria-hidden="true">TOC</a></span></h3>
  889. <p>Linux framebuffer input device.
  890. </p>
  891. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  892. layer to show graphics on a computer monitor, typically on the
  893. console. It is accessed through a file device node, usually
  894. <samp>/dev/fb0</samp>.
  895. </p>
  896. <p>For more detailed information read the file
  897. Documentation/fb/framebuffer.txt included in the Linux source tree.
  898. </p>
  899. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  900. </p>
  901. <p>To record from the framebuffer device <samp>/dev/fb0</samp> with
  902. <code>ffmpeg</code>:
  903. </p><div class="example">
  904. <pre class="example">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  905. </pre></div>
  906. <p>You can take a single screenshot image with the command:
  907. </p><div class="example">
  908. <pre class="example">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  909. </pre></div>
  910. <a name="Options-6"></a>
  911. <h4 class="subsection">3.7.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  912. <dl compact="compact">
  913. <dt><span><samp>framerate</samp></span></dt>
  914. <dd><p>Set the frame rate. Default is 25.
  915. </p>
  916. </dd>
  917. </dl>
  918. <a name="gdigrab"></a>
  919. <h3 class="section">3.8 gdigrab<span class="pull-right"><a class="anchor hidden-xs" href="#gdigrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gdigrab" aria-hidden="true">TOC</a></span></h3>
  920. <p>Win32 GDI-based screen capture device.
  921. </p>
  922. <p>This device allows you to capture a region of the display on Windows.
  923. </p>
  924. <p>There are two options for the input filename:
  925. </p><div class="example">
  926. <pre class="example">desktop
  927. </pre></div>
  928. <p>or
  929. </p><div class="example">
  930. <pre class="example">title=<var>window_title</var>
  931. </pre></div>
  932. <p>The first option will capture the entire desktop, or a fixed region of the
  933. desktop. The second option will instead capture the contents of a single
  934. window, regardless of its position on the screen.
  935. </p>
  936. <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
  937. </p><div class="example">
  938. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  939. </pre></div>
  940. <p>Grab a 640x480 region at position <code>10,20</code>:
  941. </p><div class="example">
  942. <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  943. </pre></div>
  944. <p>Grab the contents of the window named &quot;Calculator&quot;
  945. </p><div class="example">
  946. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  947. </pre></div>
  948. <a name="Options-7"></a>
  949. <h4 class="subsection">3.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-7" aria-hidden="true">TOC</a></span></h4>
  950. <dl compact="compact">
  951. <dt><span><samp>draw_mouse</samp></span></dt>
  952. <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
  953. not draw the pointer. Default value is <code>1</code>.
  954. </p>
  955. </dd>
  956. <dt><span><samp>framerate</samp></span></dt>
  957. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  958. corresponding to a frame rate of <code>30000/1001</code>.
  959. </p>
  960. </dd>
  961. <dt><span><samp>show_region</samp></span></dt>
  962. <dd><p>Show grabbed region on screen.
  963. </p>
  964. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  965. region will be indicated on screen. With this option, it is easy to
  966. know what is being grabbed if only a portion of the screen is grabbed.
  967. </p>
  968. <p>Note that <var>show_region</var> is incompatible with grabbing the contents
  969. of a single window.
  970. </p>
  971. <p>For example:
  972. </p><div class="example">
  973. <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
  974. </pre></div>
  975. </dd>
  976. <dt><span><samp>video_size</samp></span></dt>
  977. <dd><p>Set the video frame size. The default is to capture the full screen if <samp>desktop</samp> is selected, or the full window size if <samp>title=<var>window_title</var></samp> is selected.
  978. </p>
  979. </dd>
  980. <dt><span><samp>offset_x</samp></span></dt>
  981. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
  982. </p>
  983. <p>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</var> value to move the region to that monitor.
  984. </p>
  985. </dd>
  986. <dt><span><samp>offset_y</samp></span></dt>
  987. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
  988. </p>
  989. <p>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</var> value to move the region to that monitor.
  990. </p>
  991. </dd>
  992. </dl>
  993. <a name="iec61883"></a>
  994. <h3 class="section">3.9 iec61883<span class="pull-right"><a class="anchor hidden-xs" href="#iec61883" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iec61883" aria-hidden="true">TOC</a></span></h3>
  995. <p>FireWire DV/HDV input device using libiec61883.
  996. </p>
  997. <p>To enable this input device, you need libiec61883, libraw1394 and
  998. libavc1394 installed on your system. Use the configure option
  999. <code>--enable-libiec61883</code> to compile with the device enabled.
  1000. </p>
  1001. <p>The iec61883 capture device supports capturing from a video device
  1002. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  1003. FireWire stack (juju). This is the default DV/HDV input method in Linux
  1004. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  1005. </p>
  1006. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  1007. to choose the first port connected.
  1008. </p>
  1009. <a name="Options-8"></a>
  1010. <h4 class="subsection">3.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-8" aria-hidden="true">TOC</a></span></h4>
  1011. <dl compact="compact">
  1012. <dt><span><samp>dvtype</samp></span></dt>
  1013. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  1014. detection does not work, or if usage of a different device type
  1015. should be prohibited. Treating a DV device as HDV (or vice versa) will
  1016. not work and result in undefined behavior.
  1017. The values <samp>auto</samp>, <samp>dv</samp> and <samp>hdv</samp> are supported.
  1018. </p>
  1019. </dd>
  1020. <dt><span><samp>dvbuffer</samp></span></dt>
  1021. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  1022. is an exact value. For HDV, it is not frame exact, since HDV does
  1023. not have a fixed frame size.
  1024. </p>
  1025. </dd>
  1026. <dt><span><samp>dvguid</samp></span></dt>
  1027. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  1028. be performed from the specified device and fails if no device with the
  1029. given GUID is found. This is useful to select the input if multiple
  1030. devices are connected at the same time.
  1031. Look at /sys/bus/firewire/devices to find out the GUIDs.
  1032. </p>
  1033. </dd>
  1034. </dl>
  1035. <a name="Examples-3"></a>
  1036. <h4 class="subsection">3.9.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  1037. <ul>
  1038. <li> Grab and show the input of a FireWire DV/HDV device.
  1039. <div class="example">
  1040. <pre class="example">ffplay -f iec61883 -i auto
  1041. </pre></div>
  1042. </li><li> Grab and record the input of a FireWire DV/HDV device,
  1043. using a packet buffer of 100000 packets if the source is HDV.
  1044. <div class="example">
  1045. <pre class="example">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  1046. </pre></div>
  1047. </li></ul>
  1048. <a name="jack"></a>
  1049. <h3 class="section">3.10 jack<span class="pull-right"><a class="anchor hidden-xs" href="#jack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-jack" aria-hidden="true">TOC</a></span></h3>
  1050. <p>JACK input device.
  1051. </p>
  1052. <p>To enable this input device during configuration you need libjack
  1053. installed on your system.
  1054. </p>
  1055. <p>A JACK input device creates one or more JACK writable clients, one for
  1056. each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
  1057. <var>client_name</var> is the name provided by the application, and <var>N</var>
  1058. is a number which identifies the channel.
  1059. Each writable client will send the acquired data to the FFmpeg input
  1060. device.
  1061. </p>
  1062. <p>Once you have created one or more JACK readable clients, you need to
  1063. connect them to one or more JACK writable clients.
  1064. </p>
  1065. <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
  1066. and <code>jack_disconnect</code> programs, or do it through a graphical interface,
  1067. for example with <code>qjackctl</code>.
  1068. </p>
  1069. <p>To list the JACK clients and their properties you can invoke the command
  1070. <code>jack_lsp</code>.
  1071. </p>
  1072. <p>Follows an example which shows how to capture a JACK readable client
  1073. with <code>ffmpeg</code>.
  1074. </p><div class="example">
  1075. <pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  1076. $ ffmpeg -f jack -i ffmpeg -y out.wav
  1077. # Start the sample jack_metro readable client.
  1078. $ jack_metro -b 120 -d 0.2 -f 4000
  1079. # List the current JACK clients.
  1080. $ jack_lsp -c
  1081. system:capture_1
  1082. system:capture_2
  1083. system:playback_1
  1084. system:playback_2
  1085. ffmpeg:input_1
  1086. metro:120_bpm
  1087. # Connect metro to the ffmpeg writable client.
  1088. $ jack_connect metro:120_bpm ffmpeg:input_1
  1089. </pre></div>
  1090. <p>For more information read:
  1091. <a href="http://jackaudio.org/">http://jackaudio.org/</a>
  1092. </p>
  1093. <a name="Options-9"></a>
  1094. <h4 class="subsection">3.10.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-9" aria-hidden="true">TOC</a></span></h4>
  1095. <dl compact="compact">
  1096. <dt><span><samp>channels</samp></span></dt>
  1097. <dd><p>Set the number of channels. Default is 2.
  1098. </p>
  1099. </dd>
  1100. </dl>
  1101. <a name="kmsgrab"></a>
  1102. <h3 class="section">3.11 kmsgrab<span class="pull-right"><a class="anchor hidden-xs" href="#kmsgrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kmsgrab" aria-hidden="true">TOC</a></span></h3>
  1103. <p>KMS video input device.
  1104. </p>
  1105. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  1106. DRM object that can be passed to other hardware functions.
  1107. </p>
  1108. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  1109. </p>
  1110. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  1111. <samp>x11grab</samp> instead.
  1112. </p>
  1113. <a name="Options-10"></a>
  1114. <h4 class="subsection">3.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-10" aria-hidden="true">TOC</a></span></h4>
  1115. <dl compact="compact">
  1116. <dt><span><samp>device</samp></span></dt>
  1117. <dd><p>DRM device to capture on. Defaults to <samp>/dev/dri/card0</samp>.
  1118. </p>
  1119. </dd>
  1120. <dt><span><samp>format</samp></span></dt>
  1121. <dd><p>Pixel format of the framebuffer. This can be autodetected if you are running Linux 5.7
  1122. or later, but needs to be provided for earlier versions. Defaults to <samp>bgr0</samp>,
  1123. which is the most common format used by the Linux console and Xorg X server.
  1124. </p>
  1125. </dd>
  1126. <dt><span><samp>format_modifier</samp></span></dt>
  1127. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  1128. some APIs. It can be autodetected if you are running Linux 5.7 or later, but will need
  1129. to be provided explicitly when needed in earlier versions. See the libdrm documentation
  1130. for possible values.
  1131. </p>
  1132. </dd>
  1133. <dt><span><samp>crtc_id</samp></span></dt>
  1134. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  1135. will be used.
  1136. </p>
  1137. </dd>
  1138. <dt><span><samp>plane_id</samp></span></dt>
  1139. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  1140. neither <samp>crtc_id</samp> nor <samp>plane_id</samp> are specified.
  1141. </p>
  1142. </dd>
  1143. <dt><span><samp>framerate</samp></span></dt>
  1144. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  1145. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  1146. faster than the framebuffer update rate will generate independent frames with the same
  1147. content. Defaults to <code>30</code>.
  1148. </p>
  1149. </dd>
  1150. </dl>
  1151. <a name="Examples-4"></a>
  1152. <h4 class="subsection">3.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  1153. <ul>
  1154. <li> Capture from the first active plane, download the result to normal frames and encode.
  1155. This will only work if the framebuffer is both linear and mappable - if not, the result
  1156. may be scrambled or fail to download.
  1157. <div class="example">
  1158. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  1159. </pre></div>
  1160. </li><li> Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  1161. <div class="example">
  1162. <pre class="example">ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
  1163. </pre></div>
  1164. </li><li> To capture only part of a plane the output can be cropped - this can be used to capture
  1165. a single window, as long as it has a known absolute position and size. For example, to
  1166. capture and encode the middle quarter of a 1920x1080 plane:
  1167. <div class="example">
  1168. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
  1169. </pre></div>
  1170. </li></ul>
  1171. <a name="lavfi"></a>
  1172. <h3 class="section">3.12 lavfi<span class="pull-right"><a class="anchor hidden-xs" href="#lavfi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lavfi" aria-hidden="true">TOC</a></span></h3>
  1173. <p>Libavfilter input virtual device.
  1174. </p>
  1175. <p>This input device reads data from the open output pads of a libavfilter
  1176. filtergraph.
  1177. </p>
  1178. <p>For each filtergraph open output, the input device will create a
  1179. corresponding stream which is mapped to the generated output. Currently
  1180. only video data is supported. The filtergraph is specified through the
  1181. option <samp>graph</samp>.
  1182. </p>
  1183. <a name="Options-11"></a>
  1184. <h4 class="subsection">3.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-11" aria-hidden="true">TOC</a></span></h4>
  1185. <dl compact="compact">
  1186. <dt><span><samp>graph</samp></span></dt>
  1187. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  1188. labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
  1189. number starting from 0 corresponding to the mapped input stream
  1190. generated by the device.
  1191. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  1192. label, but all the others need to be specified explicitly.
  1193. </p>
  1194. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  1195. stream with the closed captions packets attached to that output
  1196. (experimental; only for EIA-608 / CEA-708 for now).
  1197. The subcc streams are created after all the normal streams, in the order of
  1198. the corresponding stream.
  1199. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  1200. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  1201. </p>
  1202. <p>If not specified defaults to the filename specified for the input
  1203. device.
  1204. </p>
  1205. </dd>
  1206. <dt><span><samp>graph_file</samp></span></dt>
  1207. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  1208. filters. Syntax of the filtergraph is the same as the one specified by
  1209. the option <var>graph</var>.
  1210. </p>
  1211. </dd>
  1212. <dt><span><samp>dumpgraph</samp></span></dt>
  1213. <dd><p>Dump graph to stderr.
  1214. </p>
  1215. </dd>
  1216. </dl>
  1217. <a name="Examples-5"></a>
  1218. <h4 class="subsection">3.12.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  1219. <ul>
  1220. <li> Create a color video stream and play it back with <code>ffplay</code>:
  1221. <div class="example">
  1222. <pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  1223. </pre></div>
  1224. </li><li> As the previous example, but use filename for specifying the graph
  1225. description, and omit the &quot;out0&quot; label:
  1226. <div class="example">
  1227. <pre class="example">ffplay -f lavfi color=c=pink
  1228. </pre></div>
  1229. </li><li> Create three different video test filtered sources and play them:
  1230. <div class="example">
  1231. <pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  1232. </pre></div>
  1233. </li><li> Read an audio stream from a file using the amovie source and play it
  1234. back with <code>ffplay</code>:
  1235. <div class="example">
  1236. <pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
  1237. </pre></div>
  1238. </li><li> Read an audio stream and a video stream and play it back with
  1239. <code>ffplay</code>:
  1240. <div class="example">
  1241. <pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  1242. </pre></div>
  1243. </li><li> Dump decoded frames to images and closed captions to a file (experimental):
  1244. <div class="example">
  1245. <pre class="example">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
  1246. </pre></div>
  1247. </li></ul>
  1248. <a name="libcdio"></a>
  1249. <h3 class="section">3.13 libcdio<span class="pull-right"><a class="anchor hidden-xs" href="#libcdio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libcdio" aria-hidden="true">TOC</a></span></h3>
  1250. <p>Audio-CD input device based on libcdio.
  1251. </p>
  1252. <p>To enable this input device during configuration you need libcdio
  1253. installed on your system. It requires the configure option
  1254. <code>--enable-libcdio</code>.
  1255. </p>
  1256. <p>This device allows playing and grabbing from an Audio-CD.
  1257. </p>
  1258. <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in <samp>/dev/sr0</samp>,
  1259. you may run the command:
  1260. </p><div class="example">
  1261. <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  1262. </pre></div>
  1263. <a name="Options-12"></a>
  1264. <h4 class="subsection">3.13.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-12" aria-hidden="true">TOC</a></span></h4>
  1265. <dl compact="compact">
  1266. <dt><span><samp>speed</samp></span></dt>
  1267. <dd><p>Set drive reading speed. Default value is 0.
  1268. </p>
  1269. <p>The speed is specified CD-ROM speed units. The speed is set through
  1270. the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
  1271. drives, specifying a value too large will result in using the fastest
  1272. speed.
  1273. </p>
  1274. </dd>
  1275. <dt><span><samp>paranoia_mode</samp></span></dt>
  1276. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  1277. </p>
  1278. <dl compact="compact">
  1279. <dt><span>&lsquo;<samp>disable</samp>&rsquo;</span></dt>
  1280. <dt><span>&lsquo;<samp>verify</samp>&rsquo;</span></dt>
  1281. <dt><span>&lsquo;<samp>overlap</samp>&rsquo;</span></dt>
  1282. <dt><span>&lsquo;<samp>neverskip</samp>&rsquo;</span></dt>
  1283. <dt><span>&lsquo;<samp>full</samp>&rsquo;</span></dt>
  1284. </dl>
  1285. <p>Default value is &lsquo;<samp>disable</samp>&rsquo;.
  1286. </p>
  1287. <p>For more information about the available recovery modes, consult the
  1288. paranoia project documentation.
  1289. </p></dd>
  1290. </dl>
  1291. <a name="libdc1394"></a>
  1292. <h3 class="section">3.14 libdc1394<span class="pull-right"><a class="anchor hidden-xs" href="#libdc1394" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libdc1394" aria-hidden="true">TOC</a></span></h3>
  1293. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  1294. </p>
  1295. <p>Requires the configure option <code>--enable-libdc1394</code>.
  1296. </p>
  1297. <a name="Options-13"></a>
  1298. <h4 class="subsection">3.14.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-13" aria-hidden="true">TOC</a></span></h4>
  1299. <dl compact="compact">
  1300. <dt><span><samp>framerate</samp></span></dt>
  1301. <dd><p>Set the frame rate. Default is <code>ntsc</code>, corresponding to a frame
  1302. rate of <code>30000/1001</code>.
  1303. </p>
  1304. </dd>
  1305. <dt><span><samp>pixel_format</samp></span></dt>
  1306. <dd><p>Select the pixel format. Default is <code>uyvy422</code>.
  1307. </p>
  1308. </dd>
  1309. <dt><span><samp>video_size</samp></span></dt>
  1310. <dd><p>Set the video size given as a string such as <code>640x480</code> or <code>hd720</code>.
  1311. Default is <code>qvga</code>.
  1312. </p></dd>
  1313. </dl>
  1314. <a name="openal"></a>
  1315. <h3 class="section">3.15 openal<span class="pull-right"><a class="anchor hidden-xs" href="#openal" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openal" aria-hidden="true">TOC</a></span></h3>
  1316. <p>The OpenAL input device provides audio capture on all systems with a
  1317. working OpenAL 1.1 implementation.
  1318. </p>
  1319. <p>To enable this input device during configuration, you need OpenAL
  1320. headers and libraries installed on your system, and need to configure
  1321. FFmpeg with <code>--enable-openal</code>.
  1322. </p>
  1323. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  1324. implementation, or as an additional download (an SDK). Depending on your
  1325. installation you may need to specify additional flags via the
  1326. <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
  1327. system to locate the OpenAL headers and libraries.
  1328. </p>
  1329. <p>An incomplete list of OpenAL implementations follows:
  1330. </p>
  1331. <dl compact="compact">
  1332. <dt><span><strong>Creative</strong></span></dt>
  1333. <dd><p>The official Windows implementation, providing hardware acceleration
  1334. with supported devices and software fallback.
  1335. See <a href="http://openal.org/">http://openal.org/</a>.
  1336. </p></dd>
  1337. <dt><span><strong>OpenAL Soft</strong></span></dt>
  1338. <dd><p>Portable, open source (LGPL) software implementation. Includes
  1339. backends for the most common sound APIs on the Windows, Linux,
  1340. Solaris, and BSD operating systems.
  1341. See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  1342. </p></dd>
  1343. <dt><span><strong>Apple</strong></span></dt>
  1344. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  1345. See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
  1346. </p></dd>
  1347. </dl>
  1348. <p>This device allows one to capture from an audio input device handled
  1349. through OpenAL.
  1350. </p>
  1351. <p>You need to specify the name of the device to capture in the provided
  1352. filename. If the empty string is provided, the device will
  1353. automatically select the default device. You can get the list of the
  1354. supported devices by using the option <var>list_devices</var>.
  1355. </p>
  1356. <a name="Options-14"></a>
  1357. <h4 class="subsection">3.15.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-14" aria-hidden="true">TOC</a></span></h4>
  1358. <dl compact="compact">
  1359. <dt><span><samp>channels</samp></span></dt>
  1360. <dd><p>Set the number of channels in the captured audio. Only the values
  1361. <samp>1</samp> (monaural) and <samp>2</samp> (stereo) are currently supported.
  1362. Defaults to <samp>2</samp>.
  1363. </p>
  1364. </dd>
  1365. <dt><span><samp>sample_size</samp></span></dt>
  1366. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  1367. <samp>8</samp> and <samp>16</samp> are currently supported. Defaults to
  1368. <samp>16</samp>.
  1369. </p>
  1370. </dd>
  1371. <dt><span><samp>sample_rate</samp></span></dt>
  1372. <dd><p>Set the sample rate (in Hz) of the captured audio.
  1373. Defaults to <samp>44.1k</samp>.
  1374. </p>
  1375. </dd>
  1376. <dt><span><samp>list_devices</samp></span></dt>
  1377. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  1378. Defaults to <samp>false</samp>.
  1379. </p>
  1380. </dd>
  1381. </dl>
  1382. <a name="Examples-6"></a>
  1383. <h4 class="subsection">3.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  1384. <p>Print the list of OpenAL supported devices and exit:
  1385. </p><div class="example">
  1386. <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  1387. </pre></div>
  1388. <p>Capture from the OpenAL device <samp>DR-BT101 via PulseAudio</samp>:
  1389. </p><div class="example">
  1390. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  1391. </pre></div>
  1392. <p>Capture from the default device (note the empty string &rdquo; as filename):
  1393. </p><div class="example">
  1394. <pre class="example">$ ffmpeg -f openal -i '' out.ogg
  1395. </pre></div>
  1396. <p>Capture from two devices simultaneously, writing to two different files,
  1397. within the same <code>ffmpeg</code> command:
  1398. </p><div class="example">
  1399. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  1400. </pre></div>
  1401. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  1402. try the latest OpenAL Soft if the above does not work.
  1403. </p>
  1404. <a name="oss"></a>
  1405. <h3 class="section">3.16 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss" aria-hidden="true">TOC</a></span></h3>
  1406. <p>Open Sound System input device.
  1407. </p>
  1408. <p>The filename to provide to the input device is the device node
  1409. representing the OSS input device, and is usually set to
  1410. <samp>/dev/dsp</samp>.
  1411. </p>
  1412. <p>For example to grab from <samp>/dev/dsp</samp> using <code>ffmpeg</code> use the
  1413. command:
  1414. </p><div class="example">
  1415. <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  1416. </pre></div>
  1417. <p>For more information about OSS see:
  1418. <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  1419. </p>
  1420. <a name="Options-15"></a>
  1421. <h4 class="subsection">3.16.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-15" aria-hidden="true">TOC</a></span></h4>
  1422. <dl compact="compact">
  1423. <dt><span><samp>sample_rate</samp></span></dt>
  1424. <dd><p>Set the sample rate in Hz. Default is 48000.
  1425. </p>
  1426. </dd>
  1427. <dt><span><samp>channels</samp></span></dt>
  1428. <dd><p>Set the number of channels. Default is 2.
  1429. </p>
  1430. </dd>
  1431. </dl>
  1432. <a name="pulse"></a>
  1433. <h3 class="section">3.17 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse" aria-hidden="true">TOC</a></span></h3>
  1434. <p>PulseAudio input device.
  1435. </p>
  1436. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  1437. </p>
  1438. <p>The filename to provide to the input device is a source device or the
  1439. string &quot;default&quot;
  1440. </p>
  1441. <p>To list the PulseAudio source devices and their properties you can invoke
  1442. the command <code>pactl list sources</code>.
  1443. </p>
  1444. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  1445. </p>
  1446. <a name="Options-16"></a>
  1447. <h4 class="subsection">3.17.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-16" aria-hidden="true">TOC</a></span></h4>
  1448. <dl compact="compact">
  1449. <dt><span><samp>server</samp></span></dt>
  1450. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  1451. Default server is used when not provided.
  1452. </p>
  1453. </dd>
  1454. <dt><span><samp>name</samp></span></dt>
  1455. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  1456. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  1457. </p>
  1458. </dd>
  1459. <dt><span><samp>stream_name</samp></span></dt>
  1460. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  1461. by default it is &quot;record&quot;.
  1462. </p>
  1463. </dd>
  1464. <dt><span><samp>sample_rate</samp></span></dt>
  1465. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  1466. </p>
  1467. </dd>
  1468. <dt><span><samp>channels</samp></span></dt>
  1469. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  1470. </p>
  1471. </dd>
  1472. <dt><span><samp>frame_size</samp></span></dt>
  1473. <dd><p>This option does nothing and is deprecated.
  1474. </p>
  1475. </dd>
  1476. <dt><span><samp>fragment_size</samp></span></dt>
  1477. <dd><p>Specify the size in bytes of the minimal buffering fragment in PulseAudio, it
  1478. will affect the audio latency. By default it is set to 50 ms amount of data.
  1479. </p>
  1480. </dd>
  1481. <dt><span><samp>wallclock</samp></span></dt>
  1482. <dd><p>Set the initial PTS using the current time. Default is 1.
  1483. </p>
  1484. </dd>
  1485. </dl>
  1486. <a name="Examples-7"></a>
  1487. <h4 class="subsection">3.17.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  1488. <p>Record a stream from default device:
  1489. </p><div class="example">
  1490. <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
  1491. </pre></div>
  1492. <a name="sndio"></a>
  1493. <h3 class="section">3.18 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio" aria-hidden="true">TOC</a></span></h3>
  1494. <p>sndio input device.
  1495. </p>
  1496. <p>To enable this input device during configuration you need libsndio
  1497. installed on your system.
  1498. </p>
  1499. <p>The filename to provide to the input device is the device node
  1500. representing the sndio input device, and is usually set to
  1501. <samp>/dev/audio0</samp>.
  1502. </p>
  1503. <p>For example to grab from <samp>/dev/audio0</samp> using <code>ffmpeg</code> use the
  1504. command:
  1505. </p><div class="example">
  1506. <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  1507. </pre></div>
  1508. <a name="Options-17"></a>
  1509. <h4 class="subsection">3.18.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-17" aria-hidden="true">TOC</a></span></h4>
  1510. <dl compact="compact">
  1511. <dt><span><samp>sample_rate</samp></span></dt>
  1512. <dd><p>Set the sample rate in Hz. Default is 48000.
  1513. </p>
  1514. </dd>
  1515. <dt><span><samp>channels</samp></span></dt>
  1516. <dd><p>Set the number of channels. Default is 2.
  1517. </p>
  1518. </dd>
  1519. </dl>
  1520. <a name="video4linux2_002c-v4l2"></a>
  1521. <h3 class="section">3.19 video4linux2, v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#video4linux2_002c-v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-video4linux2_002c-v4l2" aria-hidden="true">TOC</a></span></h3>
  1522. <p>Video4Linux2 input video device.
  1523. </p>
  1524. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  1525. </p>
  1526. <p>If FFmpeg is built with v4l-utils support (by using the
  1527. <code>--enable-libv4l2</code> configure option), it is possible to use it with the
  1528. <code>-use_libv4l2</code> input device option.
  1529. </p>
  1530. <p>The name of the device to grab is a file device node, usually Linux
  1531. systems tend to automatically create such nodes when the device
  1532. (e.g. an USB webcam) is plugged into the system, and has a name of the
  1533. kind <samp>/dev/video<var>N</var></samp>, where <var>N</var> is a number associated to
  1534. the device.
  1535. </p>
  1536. <p>Video4Linux2 devices usually support a limited set of
  1537. <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
  1538. supported using <code>-list_formats all</code> for Video4Linux2 devices.
  1539. Some devices, like TV cards, support one or more standards. It is possible
  1540. to list all the supported standards using <code>-list_standards all</code>.
  1541. </p>
  1542. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  1543. version and configuration, the timestamps may be derived from the real time
  1544. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  1545. boot time, unaffected by NTP or manual changes to the clock). The
  1546. <samp>-timestamps abs</samp> or <samp>-ts abs</samp> option can be used to force
  1547. conversion into the real time clock.
  1548. </p>
  1549. <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
  1550. and <code>ffplay</code>:
  1551. </p><ul>
  1552. <li> List supported formats for a video4linux2 device:
  1553. <div class="example">
  1554. <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
  1555. </pre></div>
  1556. </li><li> Grab and show the input of a video4linux2 device:
  1557. <div class="example">
  1558. <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  1559. </pre></div>
  1560. </li><li> Grab and record the input of a video4linux2 device, leave the
  1561. frame rate and size as previously set:
  1562. <div class="example">
  1563. <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  1564. </pre></div>
  1565. </li></ul>
  1566. <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
  1567. </p>
  1568. <a name="Options-18"></a>
  1569. <h4 class="subsection">3.19.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-18" aria-hidden="true">TOC</a></span></h4>
  1570. <dl compact="compact">
  1571. <dt><span><samp>standard</samp></span></dt>
  1572. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  1573. list of the supported standards, use the <samp>list_standards</samp>
  1574. option.
  1575. </p>
  1576. </dd>
  1577. <dt><span><samp>channel</samp></span></dt>
  1578. <dd><p>Set the input channel number. Default to -1, which means using the
  1579. previously selected channel.
  1580. </p>
  1581. </dd>
  1582. <dt><span><samp>video_size</samp></span></dt>
  1583. <dd><p>Set the video frame size. The argument must be a string in the form
  1584. <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
  1585. </p>
  1586. </dd>
  1587. <dt><span><samp>pixel_format</samp></span></dt>
  1588. <dd><p>Select the pixel format (only valid for raw video input).
  1589. </p>
  1590. </dd>
  1591. <dt><span><samp>input_format</samp></span></dt>
  1592. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  1593. This option allows one to select the input format, when several are
  1594. available.
  1595. </p>
  1596. </dd>
  1597. <dt><span><samp>framerate</samp></span></dt>
  1598. <dd><p>Set the preferred video frame rate.
  1599. </p>
  1600. </dd>
  1601. <dt><span><samp>list_formats</samp></span></dt>
  1602. <dd><p>List available formats (supported pixel formats, codecs, and frame
  1603. sizes) and exit.
  1604. </p>
  1605. <p>Available values are:
  1606. </p><dl compact="compact">
  1607. <dt><span>&lsquo;<samp>all</samp>&rsquo;</span></dt>
  1608. <dd><p>Show all available (compressed and non-compressed) formats.
  1609. </p>
  1610. </dd>
  1611. <dt><span>&lsquo;<samp>raw</samp>&rsquo;</span></dt>
  1612. <dd><p>Show only raw video (non-compressed) formats.
  1613. </p>
  1614. </dd>
  1615. <dt><span>&lsquo;<samp>compressed</samp>&rsquo;</span></dt>
  1616. <dd><p>Show only compressed formats.
  1617. </p></dd>
  1618. </dl>
  1619. </dd>
  1620. <dt><span><samp>list_standards</samp></span></dt>
  1621. <dd><p>List supported standards and exit.
  1622. </p>
  1623. <p>Available values are:
  1624. </p><dl compact="compact">
  1625. <dt><span>&lsquo;<samp>all</samp>&rsquo;</span></dt>
  1626. <dd><p>Show all supported standards.
  1627. </p></dd>
  1628. </dl>
  1629. </dd>
  1630. <dt><span><samp>timestamps, ts</samp></span></dt>
  1631. <dd><p>Set type of timestamps for grabbed frames.
  1632. </p>
  1633. <p>Available values are:
  1634. </p><dl compact="compact">
  1635. <dt><span>&lsquo;<samp>default</samp>&rsquo;</span></dt>
  1636. <dd><p>Use timestamps from the kernel.
  1637. </p>
  1638. </dd>
  1639. <dt><span>&lsquo;<samp>abs</samp>&rsquo;</span></dt>
  1640. <dd><p>Use absolute timestamps (wall clock).
  1641. </p>
  1642. </dd>
  1643. <dt><span>&lsquo;<samp>mono2abs</samp>&rsquo;</span></dt>
  1644. <dd><p>Force conversion from monotonic to absolute timestamps.
  1645. </p></dd>
  1646. </dl>
  1647. <p>Default value is <code>default</code>.
  1648. </p>
  1649. </dd>
  1650. <dt><span><samp>use_libv4l2</samp></span></dt>
  1651. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  1652. </p>
  1653. </dd>
  1654. </dl>
  1655. <a name="vfwcap"></a>
  1656. <h3 class="section">3.20 vfwcap<span class="pull-right"><a class="anchor hidden-xs" href="#vfwcap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfwcap" aria-hidden="true">TOC</a></span></h3>
  1657. <p>VfW (Video for Windows) capture input device.
  1658. </p>
  1659. <p>The filename passed as input is the capture driver number, ranging from
  1660. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  1661. other filename will be interpreted as device number 0.
  1662. </p>
  1663. <a name="Options-19"></a>
  1664. <h4 class="subsection">3.20.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-19" aria-hidden="true">TOC</a></span></h4>
  1665. <dl compact="compact">
  1666. <dt><span><samp>video_size</samp></span></dt>
  1667. <dd><p>Set the video frame size.
  1668. </p>
  1669. </dd>
  1670. <dt><span><samp>framerate</samp></span></dt>
  1671. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  1672. corresponding to a frame rate of <code>30000/1001</code>.
  1673. </p>
  1674. </dd>
  1675. </dl>
  1676. <a name="x11grab"></a>
  1677. <h3 class="section">3.21 x11grab<span class="pull-right"><a class="anchor hidden-xs" href="#x11grab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-x11grab" aria-hidden="true">TOC</a></span></h3>
  1678. <p>X11 video input device.
  1679. </p>
  1680. <p>To enable this input device during configuration you need libxcb
  1681. installed on your system. It will be automatically detected during
  1682. configuration.
  1683. </p>
  1684. <p>This device allows one to capture a region of an X11 display.
  1685. </p>
  1686. <p>The filename passed as input has the syntax:
  1687. </p><div class="example">
  1688. <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
  1689. </pre></div>
  1690. <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
  1691. X11 display name of the screen to grab from. <var>hostname</var> can be
  1692. omitted, and defaults to &quot;localhost&quot;. The environment variable
  1693. <code>DISPLAY</code> contains the default display name.
  1694. </p>
  1695. <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
  1696. area with respect to the top-left border of the X11 screen. They
  1697. default to 0.
  1698. </p>
  1699. <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
  1700. information.
  1701. </p>
  1702. <p>Use the <code>xdpyinfo</code> program for getting basic information about
  1703. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  1704. &quot;dimensions&quot;).
  1705. </p>
  1706. <p>For example to grab from <samp>:0.0</samp> using <code>ffmpeg</code>:
  1707. </p><div class="example">
  1708. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  1709. </pre></div>
  1710. <p>Grab at position <code>10,20</code>:
  1711. </p><div class="example">
  1712. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  1713. </pre></div>
  1714. <a name="Options-20"></a>
  1715. <h4 class="subsection">3.21.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-20" aria-hidden="true">TOC</a></span></h4>
  1716. <dl compact="compact">
  1717. <dt><span><samp>select_region</samp></span></dt>
  1718. <dd><p>Specify whether to select the grabbing area graphically using the pointer.
  1719. A value of <code>1</code> prompts the user to select the grabbing area graphically
  1720. by clicking and dragging. A single click with no dragging will select the
  1721. whole screen. A region with zero width or height will also select the whole
  1722. screen. This option overwrites the <var>video_size</var>, <var>grab_x</var>, and
  1723. <var>grab_y</var> options. Default value is <code>0</code>.
  1724. </p>
  1725. </dd>
  1726. <dt><span><samp>draw_mouse</samp></span></dt>
  1727. <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specifies
  1728. not to draw the pointer. Default value is <code>1</code>.
  1729. </p>
  1730. </dd>
  1731. <dt><span><samp>follow_mouse</samp></span></dt>
  1732. <dd><p>Make the grabbed area follow the mouse. The argument can be
  1733. <code>centered</code> or a number of pixels <var>PIXELS</var>.
  1734. </p>
  1735. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  1736. pointer and keeps the pointer at the center of region; otherwise, the region
  1737. follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
  1738. zero) to the edge of region.
  1739. </p>
  1740. <p>For example:
  1741. </p><div class="example">
  1742. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  1743. </pre></div>
  1744. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  1745. </p><div class="example">
  1746. <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  1747. </pre></div>
  1748. </dd>
  1749. <dt><span><samp>framerate</samp></span></dt>
  1750. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  1751. corresponding to a frame rate of <code>30000/1001</code>.
  1752. </p>
  1753. </dd>
  1754. <dt><span><samp>show_region</samp></span></dt>
  1755. <dd><p>Show grabbed region on screen.
  1756. </p>
  1757. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  1758. region will be indicated on screen. With this option, it is easy to
  1759. know what is being grabbed if only a portion of the screen is grabbed.
  1760. </p>
  1761. </dd>
  1762. <dt><span><samp>region_border</samp></span></dt>
  1763. <dd><p>Set the region border thickness if <samp>-show_region 1</samp> is used.
  1764. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  1765. </p>
  1766. <p>For example:
  1767. </p><div class="example">
  1768. <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  1769. </pre></div>
  1770. <p>With <var>follow_mouse</var>:
  1771. </p><div class="example">
  1772. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  1773. </pre></div>
  1774. </dd>
  1775. <dt><span><samp>window_id</samp></span></dt>
  1776. <dd><p>Grab this window, instead of the whole screen. Default value is 0, which maps to
  1777. the whole screen (root window).
  1778. </p>
  1779. <p>The id of a window can be found using the <code>xwininfo</code> program, possibly with options -tree and
  1780. -root.
  1781. </p>
  1782. <p>If the window is later enlarged, the new area is not recorded. Video ends when
  1783. the window is closed, unmapped (i.e., iconified) or shrunk beyond the video
  1784. size (which defaults to the initial window size).
  1785. </p>
  1786. <p>This option disables options <samp>follow_mouse</samp> and <samp>select_region</samp>.
  1787. </p>
  1788. </dd>
  1789. <dt><span><samp>video_size</samp></span></dt>
  1790. <dd><p>Set the video frame size. Default is the full desktop or window.
  1791. </p>
  1792. </dd>
  1793. <dt><span><samp>grab_x</samp></span></dt>
  1794. <dt><span><samp>grab_y</samp></span></dt>
  1795. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  1796. the top left corner of the X11 window and correspond to the
  1797. <var>x_offset</var> and <var>y_offset</var> parameters in the device name. The
  1798. default value for both options is 0.
  1799. </p></dd>
  1800. </dl>
  1801. <a name="Output-Devices"></a>
  1802. <h2 class="chapter">4 Output Devices<span class="pull-right"><a class="anchor hidden-xs" href="#Output-Devices" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-Devices" aria-hidden="true">TOC</a></span></h2>
  1803. <p>Output devices are configured elements in FFmpeg that can write
  1804. multimedia data to an output device attached to your system.
  1805. </p>
  1806. <p>When you configure your FFmpeg build, all the supported output devices
  1807. are enabled by default. You can list all available ones using the
  1808. configure option &quot;&ndash;list-outdevs&quot;.
  1809. </p>
  1810. <p>You can disable all the output devices using the configure option
  1811. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  1812. option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
  1813. input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
  1814. </p>
  1815. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  1816. enabled output devices.
  1817. </p>
  1818. <p>A description of the currently available output devices follows.
  1819. </p>
  1820. <a name="alsa-1"></a>
  1821. <h3 class="section">4.1 alsa<span class="pull-right"><a class="anchor hidden-xs" href="#alsa-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alsa-1" aria-hidden="true">TOC</a></span></h3>
  1822. <p>ALSA (Advanced Linux Sound Architecture) output device.
  1823. </p>
  1824. <a name="Examples-8"></a>
  1825. <h4 class="subsection">4.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  1826. <ul>
  1827. <li> Play a file on default ALSA device:
  1828. <div class="example">
  1829. <pre class="example">ffmpeg -i INPUT -f alsa default
  1830. </pre></div>
  1831. </li><li> Play a file on soundcard 1, audio device 7:
  1832. <div class="example">
  1833. <pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
  1834. </pre></div>
  1835. </li></ul>
  1836. <a name="AudioToolbox"></a>
  1837. <h3 class="section">4.2 AudioToolbox<span class="pull-right"><a class="anchor hidden-xs" href="#AudioToolbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AudioToolbox" aria-hidden="true">TOC</a></span></h3>
  1838. <p>AudioToolbox output device.
  1839. </p>
  1840. <p>Allows native output to CoreAudio devices on OSX.
  1841. </p>
  1842. <p>The output filename can be empty (or <code>-</code>) to refer to the default system output device or a number that refers to the device index as shown using: <code>-list_devices true</code>.
  1843. </p>
  1844. <p>Alternatively, the audio input device can be chosen by index using the
  1845. <samp>
  1846. -audio_device_index &lt;INDEX&gt;
  1847. </samp>
  1848. , overriding any device name or index given in the input filename.
  1849. </p>
  1850. <p>All available devices can be enumerated by using <samp>-list_devices true</samp>, listing
  1851. all device names, UIDs and corresponding indices.
  1852. </p>
  1853. <a name="Options-21"></a>
  1854. <h4 class="subsection">4.2.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-21" aria-hidden="true">TOC</a></span></h4>
  1855. <p>AudioToolbox supports the following options:
  1856. </p>
  1857. <dl compact="compact">
  1858. <dt><span><samp>-audio_device_index &lt;INDEX&gt;</samp></span></dt>
  1859. <dd><p>Specify the audio device by its index. Overrides anything given in the output filename.
  1860. </p>
  1861. </dd>
  1862. </dl>
  1863. <a name="Examples-9"></a>
  1864. <h4 class="subsection">4.2.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  1865. <ul>
  1866. <li> Print the list of supported devices and output a sine wave to the default device:
  1867. <div class="example">
  1868. <pre class="example">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
  1869. </pre></div>
  1870. </li><li> Output a sine wave to the device with the index 2, overriding any output filename:
  1871. <div class="example">
  1872. <pre class="example">$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
  1873. </pre></div>
  1874. </li></ul>
  1875. <a name="caca"></a>
  1876. <h3 class="section">4.3 caca<span class="pull-right"><a class="anchor hidden-xs" href="#caca" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-caca" aria-hidden="true">TOC</a></span></h3>
  1877. <p>CACA output device.
  1878. </p>
  1879. <p>This output device allows one to show a video stream in CACA window.
  1880. Only one CACA window is allowed per application, so you can
  1881. have only one instance of this output device in an application.
  1882. </p>
  1883. <p>To enable this output device you need to configure FFmpeg with
  1884. <code>--enable-libcaca</code>.
  1885. libcaca is a graphics library that outputs text instead of pixels.
  1886. </p>
  1887. <p>For more information about libcaca, check:
  1888. <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  1889. </p>
  1890. <a name="Options-22"></a>
  1891. <h4 class="subsection">4.3.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-22" aria-hidden="true">TOC</a></span></h4>
  1892. <dl compact="compact">
  1893. <dt><span><samp>window_title</samp></span></dt>
  1894. <dd><p>Set the CACA window title, if not specified default to the filename
  1895. specified for the output device.
  1896. </p>
  1897. </dd>
  1898. <dt><span><samp>window_size</samp></span></dt>
  1899. <dd><p>Set the CACA window size, can be a string of the form
  1900. <var>width</var>x<var>height</var> or a video size abbreviation.
  1901. If not specified it defaults to the size of the input video.
  1902. </p>
  1903. </dd>
  1904. <dt><span><samp>driver</samp></span></dt>
  1905. <dd><p>Set display driver.
  1906. </p>
  1907. </dd>
  1908. <dt><span><samp>algorithm</samp></span></dt>
  1909. <dd><p>Set dithering algorithm. Dithering is necessary
  1910. because the picture being rendered has usually far more colours than
  1911. the available palette.
  1912. The accepted values are listed with <code>-list_dither algorithms</code>.
  1913. </p>
  1914. </dd>
  1915. <dt><span><samp>antialias</samp></span></dt>
  1916. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  1917. image and avoids the commonly seen staircase effect.
  1918. The accepted values are listed with <code>-list_dither antialiases</code>.
  1919. </p>
  1920. </dd>
  1921. <dt><span><samp>charset</samp></span></dt>
  1922. <dd><p>Set which characters are going to be used when rendering text.
  1923. The accepted values are listed with <code>-list_dither charsets</code>.
  1924. </p>
  1925. </dd>
  1926. <dt><span><samp>color</samp></span></dt>
  1927. <dd><p>Set color to be used when rendering text.
  1928. The accepted values are listed with <code>-list_dither colors</code>.
  1929. </p>
  1930. </dd>
  1931. <dt><span><samp>list_drivers</samp></span></dt>
  1932. <dd><p>If set to <samp>true</samp>, print a list of available drivers and exit.
  1933. </p>
  1934. </dd>
  1935. <dt><span><samp>list_dither</samp></span></dt>
  1936. <dd><p>List available dither options related to the argument.
  1937. The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
  1938. <code>charsets</code>, <code>colors</code>.
  1939. </p></dd>
  1940. </dl>
  1941. <a name="Examples-10"></a>
  1942. <h4 class="subsection">4.3.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  1943. <ul>
  1944. <li> The following command shows the <code>ffmpeg</code> output is an
  1945. CACA window, forcing its size to 80x25:
  1946. <div class="example">
  1947. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  1948. </pre></div>
  1949. </li><li> Show the list of available drivers and exit:
  1950. <div class="example">
  1951. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  1952. </pre></div>
  1953. </li><li> Show the list of available dither colors and exit:
  1954. <div class="example">
  1955. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  1956. </pre></div>
  1957. </li></ul>
  1958. <a name="decklink-1"></a>
  1959. <h3 class="section">4.4 decklink<span class="pull-right"><a class="anchor hidden-xs" href="#decklink-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decklink-1" aria-hidden="true">TOC</a></span></h3>
  1960. <p>The decklink output device provides playback capabilities for Blackmagic
  1961. DeckLink devices.
  1962. </p>
  1963. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  1964. need to configure with the appropriate <code>--extra-cflags</code>
  1965. and <code>--extra-ldflags</code>.
  1966. On Windows, you need to run the IDL files through <code>widl</code>.
  1967. </p>
  1968. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  1969. uyvy422, framerate, field order and video size must be determined for your
  1970. device with <code>-list_formats 1</code>. Audio sample rate is always 48 kHz.
  1971. </p>
  1972. <a name="Options-23"></a>
  1973. <h4 class="subsection">4.4.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-23" aria-hidden="true">TOC</a></span></h4>
  1974. <dl compact="compact">
  1975. <dt><span><samp>list_devices</samp></span></dt>
  1976. <dd><p>If set to <samp>true</samp>, print a list of devices and exit.
  1977. Defaults to <samp>false</samp>. This option is deprecated, please use the
  1978. <code>-sinks</code> option of ffmpeg to list the available output devices.
  1979. </p>
  1980. </dd>
  1981. <dt><span><samp>list_formats</samp></span></dt>
  1982. <dd><p>If set to <samp>true</samp>, print a list of supported formats and exit.
  1983. Defaults to <samp>false</samp>.
  1984. </p>
  1985. </dd>
  1986. <dt><span><samp>preroll</samp></span></dt>
  1987. <dd><p>Amount of time to preroll video in seconds.
  1988. Defaults to <samp>0.5</samp>.
  1989. </p>
  1990. </dd>
  1991. <dt><span><samp>duplex_mode</samp></span></dt>
  1992. <dd><p>Sets the decklink device duplex/profile mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo;, &lsquo;<samp>full</samp>&rsquo;,
  1993. &lsquo;<samp>one_sub_device_full</samp>&rsquo;, &lsquo;<samp>one_sub_device_half</samp>&rsquo;, &lsquo;<samp>two_sub_device_full</samp>&rsquo;,
  1994. &lsquo;<samp>four_sub_device_half</samp>&rsquo;
  1995. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  1996. </p>
  1997. <p>Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
  1998. For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
  1999. sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
  2000. is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
  2001. </p>
  2002. <p>Valid profile modes for DeckLink 8K Pro(with DeckLink SDK &gt;= 11.0):
  2003. &lsquo;<samp>one_sub_device_full</samp>&rsquo;, &lsquo;<samp>one_sub_device_half</samp>&rsquo;, &lsquo;<samp>two_sub_device_full</samp>&rsquo;,
  2004. &lsquo;<samp>four_sub_device_half</samp>&rsquo;
  2005. </p>
  2006. <p>Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
  2007. &lsquo;<samp>half</samp>&rsquo;, &lsquo;<samp>full</samp>&rsquo;
  2008. </p>
  2009. </dd>
  2010. <dt><span><samp>timing_offset</samp></span></dt>
  2011. <dd><p>Sets the genlock timing pixel offset on the used output.
  2012. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  2013. </p>
  2014. </dd>
  2015. <dt><span><samp>link</samp></span></dt>
  2016. <dd><p>Sets the SDI video link configuration on the used output. Must be
  2017. &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>single</samp>&rsquo; link SDI, &lsquo;<samp>dual</samp>&rsquo; link SDI or &lsquo;<samp>quad</samp>&rsquo; link
  2018. SDI.
  2019. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  2020. </p>
  2021. </dd>
  2022. <dt><span><samp>sqd</samp></span></dt>
  2023. <dd><p>Enable Square Division Quad Split mode for Quad-link SDI output.
  2024. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>true</samp>&rsquo; or &lsquo;<samp>false</samp>&rsquo;.
  2025. Defaults to <samp>unset</samp>.
  2026. </p>
  2027. </dd>
  2028. <dt><span><samp>level_a</samp></span></dt>
  2029. <dd><p>Enable SMPTE Level A mode on the used output.
  2030. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>true</samp>&rsquo; or &lsquo;<samp>false</samp>&rsquo;.
  2031. Defaults to <samp>unset</samp>.
  2032. </p>
  2033. </dd>
  2034. </dl>
  2035. <a name="Examples-11"></a>
  2036. <h4 class="subsection">4.4.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  2037. <ul>
  2038. <li> List output devices:
  2039. <div class="example">
  2040. <pre class="example">ffmpeg -sinks decklink
  2041. </pre></div>
  2042. </li><li> List supported formats:
  2043. <div class="example">
  2044. <pre class="example">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  2045. </pre></div>
  2046. </li><li> Play video clip:
  2047. <div class="example">
  2048. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  2049. </pre></div>
  2050. </li><li> Play video clip with non-standard framerate or video size:
  2051. <div class="example">
  2052. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  2053. </pre></div>
  2054. </li></ul>
  2055. <a name="fbdev-1"></a>
  2056. <h3 class="section">4.5 fbdev<span class="pull-right"><a class="anchor hidden-xs" href="#fbdev-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fbdev-1" aria-hidden="true">TOC</a></span></h3>
  2057. <p>Linux framebuffer output device.
  2058. </p>
  2059. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  2060. layer to show graphics on a computer monitor, typically on the
  2061. console. It is accessed through a file device node, usually
  2062. <samp>/dev/fb0</samp>.
  2063. </p>
  2064. <p>For more detailed information read the file
  2065. <samp>Documentation/fb/framebuffer.txt</samp> included in the Linux source tree.
  2066. </p>
  2067. <a name="Options-24"></a>
  2068. <h4 class="subsection">4.5.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-24" aria-hidden="true">TOC</a></span></h4>
  2069. <dl compact="compact">
  2070. <dt><span><samp>xoffset</samp></span></dt>
  2071. <dt><span><samp>yoffset</samp></span></dt>
  2072. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  2073. </p></dd>
  2074. </dl>
  2075. <a name="Examples-12"></a>
  2076. <h4 class="subsection">4.5.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  2077. <p>Play a file on framebuffer device <samp>/dev/fb0</samp>.
  2078. Required pixel format depends on current framebuffer settings.
  2079. </p><div class="example">
  2080. <pre class="example">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  2081. </pre></div>
  2082. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  2083. </p>
  2084. <a name="opengl"></a>
  2085. <h3 class="section">4.6 opengl<span class="pull-right"><a class="anchor hidden-xs" href="#opengl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-opengl" aria-hidden="true">TOC</a></span></h3>
  2086. <p>OpenGL output device.
  2087. </p>
  2088. <p>To enable this output device you need to configure FFmpeg with <code>--enable-opengl</code>.
  2089. </p>
  2090. <p>This output device allows one to render to OpenGL context.
  2091. Context may be provided by application or default SDL window is created.
  2092. </p>
  2093. <p>When device renders to external context, application must implement handlers for following messages:
  2094. <code>AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
  2095. <code>AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
  2096. <code>AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
  2097. <code>AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
  2098. Application is also required to inform a device about current resolution by sending <code>AV_APP_TO_DEV_WINDOW_SIZE</code> message.
  2099. </p>
  2100. <a name="Options-25"></a>
  2101. <h4 class="subsection">4.6.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-25" aria-hidden="true">TOC</a></span></h4>
  2102. <dl compact="compact">
  2103. <dt><span><samp>background</samp></span></dt>
  2104. <dd><p>Set background color. Black is a default.
  2105. </p></dd>
  2106. <dt><span><samp>no_window</samp></span></dt>
  2107. <dd><p>Disables default SDL window when set to non-zero value.
  2108. Application must provide OpenGL context and both <code>window_size_cb</code> and <code>window_swap_buffers_cb</code> callbacks when set.
  2109. </p></dd>
  2110. <dt><span><samp>window_title</samp></span></dt>
  2111. <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
  2112. Ignored when <samp>no_window</samp> is set.
  2113. </p></dd>
  2114. <dt><span><samp>window_size</samp></span></dt>
  2115. <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  2116. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  2117. Mostly usable when <samp>no_window</samp> is not set.
  2118. </p>
  2119. </dd>
  2120. </dl>
  2121. <a name="Examples-13"></a>
  2122. <h4 class="subsection">4.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
  2123. <p>Play a file on SDL window using OpenGL rendering:
  2124. </p><div class="example">
  2125. <pre class="example">ffmpeg -i INPUT -f opengl &quot;window title&quot;
  2126. </pre></div>
  2127. <a name="oss-1"></a>
  2128. <h3 class="section">4.7 oss<span class="pull-right"><a class="anchor hidden-xs" href="#oss-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oss-1" aria-hidden="true">TOC</a></span></h3>
  2129. <p>OSS (Open Sound System) output device.
  2130. </p>
  2131. <a name="pulse-1"></a>
  2132. <h3 class="section">4.8 pulse<span class="pull-right"><a class="anchor hidden-xs" href="#pulse-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pulse-1" aria-hidden="true">TOC</a></span></h3>
  2133. <p>PulseAudio output device.
  2134. </p>
  2135. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  2136. </p>
  2137. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  2138. </p>
  2139. <a name="Options-26"></a>
  2140. <h4 class="subsection">4.8.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-26" aria-hidden="true">TOC</a></span></h4>
  2141. <dl compact="compact">
  2142. <dt><span><samp>server</samp></span></dt>
  2143. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  2144. Default server is used when not provided.
  2145. </p>
  2146. </dd>
  2147. <dt><span><samp>name</samp></span></dt>
  2148. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  2149. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  2150. </p>
  2151. </dd>
  2152. <dt><span><samp>stream_name</samp></span></dt>
  2153. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  2154. by default it is set to the specified output name.
  2155. </p>
  2156. </dd>
  2157. <dt><span><samp>device</samp></span></dt>
  2158. <dd><p>Specify the device to use. Default device is used when not provided.
  2159. List of output devices can be obtained with command <code>pactl list sinks</code>.
  2160. </p>
  2161. </dd>
  2162. <dt><span><samp>buffer_size</samp></span></dt>
  2163. <dt><span><samp>buffer_duration</samp></span></dt>
  2164. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  2165. gives more control, but requires more frequent updates.
  2166. </p>
  2167. <p><samp>buffer_size</samp> specifies size in bytes while
  2168. <samp>buffer_duration</samp> specifies duration in milliseconds.
  2169. </p>
  2170. <p>When both options are provided then the highest value is used
  2171. (duration is recalculated to bytes using stream parameters). If they
  2172. are set to 0 (which is default), the device will use the default
  2173. PulseAudio duration value. By default PulseAudio set buffer duration
  2174. to around 2 seconds.
  2175. </p>
  2176. </dd>
  2177. <dt><span><samp>prebuf</samp></span></dt>
  2178. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  2179. playback before at least <samp>prebuf</samp> bytes are available in the
  2180. buffer. By default this option is initialized to the same value as
  2181. <samp>buffer_size</samp> or <samp>buffer_duration</samp> (whichever is bigger).
  2182. </p>
  2183. </dd>
  2184. <dt><span><samp>minreq</samp></span></dt>
  2185. <dd><p>Specify minimum request size in bytes. The server does not request less
  2186. than <samp>minreq</samp> bytes from the client, instead waits until the buffer
  2187. is free enough to request more bytes at once. It is recommended to not set
  2188. this option, which will initialize this to a value that is deemed sensible
  2189. by the server.
  2190. </p>
  2191. </dd>
  2192. </dl>
  2193. <a name="Examples-14"></a>
  2194. <h4 class="subsection">4.8.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
  2195. <p>Play a file on default device on default server:
  2196. </p><div class="example">
  2197. <pre class="example">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  2198. </pre></div>
  2199. <a name="sdl"></a>
  2200. <h3 class="section">4.9 sdl<span class="pull-right"><a class="anchor hidden-xs" href="#sdl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sdl" aria-hidden="true">TOC</a></span></h3>
  2201. <p>SDL (Simple DirectMedia Layer) output device.
  2202. </p>
  2203. <p>&quot;sdl2&quot; can be used as alias for &quot;sdl&quot;.
  2204. </p>
  2205. <p>This output device allows one to show a video stream in an SDL
  2206. window. Only one SDL window is allowed per application, so you can
  2207. have only one instance of this output device in an application.
  2208. </p>
  2209. <p>To enable this output device you need libsdl installed on your system
  2210. when configuring your build.
  2211. </p>
  2212. <p>For more information about SDL, check:
  2213. <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
  2214. </p>
  2215. <a name="Options-27"></a>
  2216. <h4 class="subsection">4.9.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-27" aria-hidden="true">TOC</a></span></h4>
  2217. <dl compact="compact">
  2218. <dt><span><samp>window_title</samp></span></dt>
  2219. <dd><p>Set the SDL window title, if not specified default to the filename
  2220. specified for the output device.
  2221. </p>
  2222. </dd>
  2223. <dt><span><samp>icon_title</samp></span></dt>
  2224. <dd><p>Set the name of the iconified SDL window, if not specified it is set
  2225. to the same value of <var>window_title</var>.
  2226. </p>
  2227. </dd>
  2228. <dt><span><samp>window_size</samp></span></dt>
  2229. <dd><p>Set the SDL window size, can be a string of the form
  2230. <var>width</var>x<var>height</var> or a video size abbreviation.
  2231. If not specified it defaults to the size of the input video,
  2232. downscaled according to the aspect ratio.
  2233. </p>
  2234. </dd>
  2235. <dt><span><samp>window_x</samp></span></dt>
  2236. <dt><span><samp>window_y</samp></span></dt>
  2237. <dd><p>Set the position of the window on the screen.
  2238. </p>
  2239. </dd>
  2240. <dt><span><samp>window_fullscreen</samp></span></dt>
  2241. <dd><p>Set fullscreen mode when non-zero value is provided.
  2242. Default value is zero.
  2243. </p>
  2244. </dd>
  2245. <dt><span><samp>window_enable_quit</samp></span></dt>
  2246. <dd><p>Enable quit action (using window button or keyboard key)
  2247. when non-zero value is provided.
  2248. Default value is 1 (enable quit action)
  2249. </p></dd>
  2250. </dl>
  2251. <a name="Interactive-commands"></a>
  2252. <h4 class="subsection">4.9.2 Interactive commands<span class="pull-right"><a class="anchor hidden-xs" href="#Interactive-commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Interactive-commands" aria-hidden="true">TOC</a></span></h4>
  2253. <p>The window created by the device can be controlled through the
  2254. following interactive commands.
  2255. </p>
  2256. <dl compact="compact">
  2257. <dt><span><tt class="key">q, ESC</tt></span></dt>
  2258. <dd><p>Quit the device immediately.
  2259. </p></dd>
  2260. </dl>
  2261. <a name="Examples-15"></a>
  2262. <h4 class="subsection">4.9.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
  2263. <p>The following command shows the <code>ffmpeg</code> output is an
  2264. SDL window, forcing its size to the qcif format:
  2265. </p><div class="example">
  2266. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
  2267. </pre></div>
  2268. <a name="sndio-1"></a>
  2269. <h3 class="section">4.10 sndio<span class="pull-right"><a class="anchor hidden-xs" href="#sndio-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sndio-1" aria-hidden="true">TOC</a></span></h3>
  2270. <p>sndio audio output device.
  2271. </p>
  2272. <a name="v4l2"></a>
  2273. <h3 class="section">4.11 v4l2<span class="pull-right"><a class="anchor hidden-xs" href="#v4l2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v4l2" aria-hidden="true">TOC</a></span></h3>
  2274. <p>Video4Linux2 output device.
  2275. </p>
  2276. <a name="xv"></a>
  2277. <h3 class="section">4.12 xv<span class="pull-right"><a class="anchor hidden-xs" href="#xv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xv" aria-hidden="true">TOC</a></span></h3>
  2278. <p>XV (XVideo) output device.
  2279. </p>
  2280. <p>This output device allows one to show a video stream in a X Window System
  2281. window.
  2282. </p>
  2283. <a name="Options-28"></a>
  2284. <h4 class="subsection">4.12.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-28" aria-hidden="true">TOC</a></span></h4>
  2285. <dl compact="compact">
  2286. <dt><span><samp>display_name</samp></span></dt>
  2287. <dd><p>Specify the hardware display name, which determines the display and
  2288. communications domain to be used.
  2289. </p>
  2290. <p>The display name or DISPLAY environment variable can be a string in
  2291. the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
  2292. </p>
  2293. <p><var>hostname</var> specifies the name of the host machine on which the
  2294. display is physically attached. <var>number</var> specifies the number of
  2295. the display server on that host machine. <var>screen_number</var> specifies
  2296. the screen to be used on that server.
  2297. </p>
  2298. <p>If unspecified, it defaults to the value of the DISPLAY environment
  2299. variable.
  2300. </p>
  2301. <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
  2302. 0 on the machine named &ldquo;dual-headed&rdquo;.
  2303. </p>
  2304. <p>Check the X11 specification for more detailed information about the
  2305. display name format.
  2306. </p>
  2307. </dd>
  2308. <dt><span><samp>window_id</samp></span></dt>
  2309. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  2310. but uses existing one with provided <var>window_id</var>. By default
  2311. this options is set to zero and device creates its own window.
  2312. </p>
  2313. </dd>
  2314. <dt><span><samp>window_size</samp></span></dt>
  2315. <dd><p>Set the created window size, can be a string of the form
  2316. <var>width</var>x<var>height</var> or a video size abbreviation. If not
  2317. specified it defaults to the size of the input video.
  2318. Ignored when <var>window_id</var> is set.
  2319. </p>
  2320. </dd>
  2321. <dt><span><samp>window_x</samp></span></dt>
  2322. <dt><span><samp>window_y</samp></span></dt>
  2323. <dd><p>Set the X and Y window offsets for the created window. They are both
  2324. set to 0 by default. The values may be ignored by the window manager.
  2325. Ignored when <var>window_id</var> is set.
  2326. </p>
  2327. </dd>
  2328. <dt><span><samp>window_title</samp></span></dt>
  2329. <dd><p>Set the window title, if not specified default to the filename
  2330. specified for the output device. Ignored when <var>window_id</var> is set.
  2331. </p></dd>
  2332. </dl>
  2333. <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
  2334. </p>
  2335. <a name="Examples-16"></a>
  2336. <h4 class="subsection">4.12.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
  2337. <ul>
  2338. <li> Decode, display and encode video input with <code>ffmpeg</code> at the
  2339. same time:
  2340. <div class="example">
  2341. <pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
  2342. </pre></div>
  2343. </li><li> Decode and display the input video to multiple X11 windows:
  2344. <div class="example">
  2345. <pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  2346. </pre></div>
  2347. </li></ul>
  2348. <a name="See-Also"></a>
  2349. <h2 class="chapter">5 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  2350. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  2351. <a href="libavdevice.html">libavdevice</a>
  2352. </p>
  2353. <a name="Authors"></a>
  2354. <h2 class="chapter">6 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  2355. <p>The FFmpeg developers.
  2356. </p>
  2357. <p>For details about the authorship, see the Git history of the project
  2358. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  2359. <code>git log</code> in the FFmpeg source directory, or browsing the
  2360. online repository at <a href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  2361. </p>
  2362. <p>Maintainers for the specific components are listed in the file
  2363. <samp>MAINTAINERS</samp> in the source code tree.
  2364. </p>
  2365. <p style="font-size: small;">
  2366. This document was generated using <a href="https://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  2367. </p>
  2368. </div>
  2369. </body>
  2370. </html>