ffmpeg-devices.html 116 KB

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