ffmpeg-devices.html 101 KB

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