星火微课系统客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ffmpeg-devices.html 93KB

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