ffmpeg.html 177 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702
  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 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 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-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  24. <li><a id="toc-Description" href="#Description">2 Description</a></li>
  25. <li><a id="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  26. <ul class="toc-numbered-mark">
  27. <li><a id="toc-Filtering" href="#Filtering">3.1 Filtering</a>
  28. <ul class="toc-numbered-mark">
  29. <li><a id="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
  30. <li><a id="toc-Complex-filtergraphs" href="#Complex-filtergraphs">3.1.2 Complex filtergraphs</a></li>
  31. </ul></li>
  32. <li><a id="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
  33. <li><a id="toc-Loopback-decoders" href="#Loopback-decoders">3.3 Loopback decoders</a></li>
  34. </ul></li>
  35. <li><a id="toc-Stream-selection" href="#Stream-selection">4 Stream selection</a>
  36. <ul class="toc-numbered-mark">
  37. <li><a id="toc-Description-1" href="#Description-1">4.1 Description</a>
  38. <ul class="toc-numbered-mark">
  39. <li><a id="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  40. <li><a id="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  41. <li><a id="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">4.1.3 Complex filtergraphs</a></li>
  42. <li><a id="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  43. </ul></li>
  44. <li><a id="toc-Examples" href="#Examples">4.2 Examples</a></li>
  45. </ul></li>
  46. <li><a id="toc-Options" href="#Options">5 Options</a>
  47. <ul class="toc-numbered-mark">
  48. <li><a id="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  49. <li><a id="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  50. <li><a id="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  51. <li><a id="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  52. <li><a id="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  53. <li><a id="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  54. <li><a id="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  55. <li><a id="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  56. <li><a id="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  57. <li><a id="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  58. <li><a id="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  59. <li><a id="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  60. <ul class="toc-numbered-mark">
  61. <li><a id="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  62. <li><a id="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  63. </ul></li>
  64. <li><a id="toc-vstats-file-format" href="#vstats-file-format">5.13 vstats file format</a></li>
  65. </ul></li>
  66. <li><a id="toc-Examples-1" href="#Examples-1">6 Examples</a>
  67. <ul class="toc-numbered-mark">
  68. <li><a id="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></li>
  69. <li><a id="toc-X11-grabbing" href="#X11-grabbing">6.2 X11 grabbing</a></li>
  70. <li><a id="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></li>
  71. </ul></li>
  72. <li><a id="toc-See-Also" href="#See-Also">7 See Also</a></li>
  73. <li><a id="toc-Authors" href="#Authors">8 Authors</a></li>
  74. </ul>
  75. </div>
  76. </div>
  77. <ul class="mini-toc">
  78. <li><a href="#Synopsis" accesskey="1">Synopsis</a></li>
  79. <li><a href="#Description" accesskey="2">Description</a></li>
  80. <li><a href="#Detailed-description" accesskey="3">Detailed description</a></li>
  81. <li><a href="#Stream-selection" accesskey="4">Stream selection</a></li>
  82. <li><a href="#Options" accesskey="5">Options</a></li>
  83. <li><a href="#Examples-1" accesskey="6">Examples</a></li>
  84. <li><a href="#See-Also" accesskey="7">See Also</a></li>
  85. <li><a href="#Authors" accesskey="8">Authors</a></li>
  86. </ul>
  87. <div class="chapter-level-extent" id="Synopsis">
  88. <h2 class="chapter"><span>1 Synopsis<a class="copiable-link" href="#Synopsis"> &para;</a></span></h2>
  89. <p>ffmpeg [<var class="var">global_options</var>] {[<var class="var">input_file_options</var>] -i <samp class="file">input_url</samp>} ... {[<var class="var">output_file_options</var>] <samp class="file">output_url</samp>} ...
  90. </p>
  91. </div>
  92. <div class="chapter-level-extent" id="Description">
  93. <h2 class="chapter"><span>2 Description<a class="copiable-link" href="#Description"> &para;</a></span></h2>
  94. <p><code class="command">ffmpeg</code> is a universal media converter. It can read a wide variety of
  95. inputs - including live grabbing/recording devices - filter, and transcode them
  96. into a plethora of output formats.
  97. </p>
  98. <p><code class="command">ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
  99. files, pipes, network streams, grabbing devices, etc.), specified by the
  100. <code class="code">-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
  101. specified by a plain output url. Anything found on the command line which
  102. cannot be interpreted as an option is considered to be an output url.
  103. </p>
  104. <p>Each input or output url can, in principle, contain any number of streams of
  105. different types (video/audio/subtitle/attachment/data). The allowed number and/or
  106. types of streams may be limited by the container format. Selecting which
  107. streams from which inputs will go into which output is either done automatically
  108. or with the <code class="code">-map</code> option (see the Stream selection chapter).
  109. </p>
  110. <p>To refer to input files in options, you must use their indices (0-based). E.g.
  111. the first input file is <code class="code">0</code>, the second is <code class="code">1</code>, etc. Similarly, streams
  112. within a file are referred to by their indices. E.g. <code class="code">2:3</code> refers to the
  113. fourth stream in the third input file. Also see the Stream specifiers chapter.
  114. </p>
  115. <p>As a general rule, options are applied to the next specified
  116. file. Therefore, order is important, and you can have the same
  117. option on the command line multiple times. Each occurrence is
  118. then applied to the next input or output file.
  119. Exceptions from this rule are the global options (e.g. verbosity level),
  120. which should be specified first.
  121. </p>
  122. <p>Do not mix input and output files &ndash; first specify all input files, then all
  123. output files. Also do not mix options which belong to different files. All
  124. options apply ONLY to the next input or output file and are reset between files.
  125. </p>
  126. <p>Some simple examples follow.
  127. </p>
  128. <ul class="itemize mark-bullet">
  129. <li>Convert an input media file to a different format, by re-encoding media streams:
  130. <div class="example">
  131. <pre class="example-preformatted">ffmpeg -i input.avi output.mp4
  132. </pre></div>
  133. </li><li>Set the video bitrate of the output file to 64 kbit/s:
  134. <div class="example">
  135. <pre class="example-preformatted">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.mp4
  136. </pre></div>
  137. </li><li>Force the frame rate of the output file to 24 fps:
  138. <div class="example">
  139. <pre class="example-preformatted">ffmpeg -i input.avi -r 24 output.mp4
  140. </pre></div>
  141. </li><li>Force the frame rate of the input file (valid for raw formats only) to 1 fps and
  142. the frame rate of the output file to 24 fps:
  143. <div class="example">
  144. <pre class="example-preformatted">ffmpeg -r 1 -i input.m2v -r 24 output.mp4
  145. </pre></div>
  146. </li></ul>
  147. <p>The format option may be needed for raw input files.
  148. </p>
  149. </div>
  150. <div class="chapter-level-extent" id="Detailed-description">
  151. <h2 class="chapter"><span>3 Detailed description<a class="copiable-link" href="#Detailed-description"> &para;</a></span></h2>
  152. <p>The transcoding process in <code class="command">ffmpeg</code> for each output can be described by
  153. the following diagram:
  154. </p>
  155. <pre class="verbatim"> _______ ______________
  156. | | | |
  157. | input | demuxer | encoded data | decoder
  158. | file | ---------&gt; | packets | -----+
  159. |_______| |______________| |
  160. v
  161. _________
  162. | |
  163. | decoded |
  164. | frames |
  165. |_________|
  166. ________ ______________ |
  167. | | | | |
  168. | output | &lt;-------- | encoded data | &lt;----+
  169. | file | muxer | packets | encoder
  170. |________| |______________|
  171. </pre>
  172. <p><code class="command">ffmpeg</code> calls the libavformat library (containing demuxers) to read
  173. input files and get packets containing encoded data from them. When there are
  174. multiple input files, <code class="command">ffmpeg</code> tries to keep them synchronized by
  175. tracking lowest timestamp on any active input stream.
  176. </p>
  177. <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
  178. for the stream, see further for a description). The decoder produces
  179. uncompressed frames (raw video/PCM audio/...) which can be processed further by
  180. filtering (see next section). After filtering, the frames are passed to the
  181. encoder, which encodes them and outputs encoded packets. Finally, those are
  182. passed to the muxer, which writes the encoded packets to the output file.
  183. </p>
  184. <ul class="mini-toc">
  185. <li><a href="#Filtering" accesskey="1">Filtering</a></li>
  186. <li><a href="#Stream-copy" accesskey="2">Stream copy</a></li>
  187. <li><a href="#Loopback-decoders" accesskey="3">Loopback decoders</a></li>
  188. </ul>
  189. <div class="section-level-extent" id="Filtering">
  190. <h3 class="section"><span>3.1 Filtering<a class="copiable-link" href="#Filtering"> &para;</a></span></h3>
  191. <p>Before encoding, <code class="command">ffmpeg</code> can process raw audio and video frames using
  192. filters from the libavfilter library. Several chained filters form a filter
  193. graph. <code class="command">ffmpeg</code> distinguishes between two types of filtergraphs:
  194. simple and complex.
  195. </p>
  196. <ul class="mini-toc">
  197. <li><a href="#Simple-filtergraphs" accesskey="1">Simple filtergraphs</a></li>
  198. <li><a href="#Complex-filtergraphs" accesskey="2">Complex filtergraphs</a></li>
  199. </ul>
  200. <div class="subsection-level-extent" id="Simple-filtergraphs">
  201. <h4 class="subsection"><span>3.1.1 Simple filtergraphs<a class="copiable-link" href="#Simple-filtergraphs"> &para;</a></span></h4>
  202. <p>Simple filtergraphs are those that have exactly one input and output, both of
  203. the same type. In the above diagram they can be represented by simply inserting
  204. an additional step between decoding and encoding:
  205. </p>
  206. <pre class="verbatim"> _________ ______________
  207. | | | |
  208. | decoded | | encoded data |
  209. | frames |\ _ | packets |
  210. |_________| \ /||______________|
  211. \ __________ /
  212. simple _\|| | / encoder
  213. filtergraph | filtered |/
  214. | frames |
  215. |__________|
  216. </pre>
  217. <p>Simple filtergraphs are configured with the per-stream <samp class="option">-filter</samp> option
  218. (with <samp class="option">-vf</samp> and <samp class="option">-af</samp> aliases for video and audio respectively).
  219. A simple filtergraph for video can look for example like this:
  220. </p>
  221. <pre class="verbatim"> _______ _____________ _______ ________
  222. | | | | | | | |
  223. | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | output |
  224. |_______| |_____________| |_______| |________|
  225. </pre>
  226. <p>Note that some filters change frame properties but not frame contents. E.g. the
  227. <code class="code">fps</code> filter in the example above changes number of frames, but does not
  228. touch the frame contents. Another example is the <code class="code">setpts</code> filter, which
  229. only sets timestamps and otherwise passes the frames unchanged.
  230. </p>
  231. </div>
  232. <div class="subsection-level-extent" id="Complex-filtergraphs">
  233. <h4 class="subsection"><span>3.1.2 Complex filtergraphs<a class="copiable-link" href="#Complex-filtergraphs"> &para;</a></span></h4>
  234. <p>Complex filtergraphs are those which cannot be described as simply a linear
  235. processing chain applied to one stream. This is the case, for example, when the graph has
  236. more than one input and/or output, or when output stream type is different from
  237. input. They can be represented with the following diagram:
  238. </p>
  239. <pre class="verbatim"> _________
  240. | |
  241. | input 0 |\ __________
  242. |_________| \ | |
  243. \ _________ /| output 0 |
  244. \ | | / |__________|
  245. _________ \| complex | /
  246. | | | |/
  247. | input 1 |----&gt;| filter |\
  248. |_________| | | \ __________
  249. /| graph | \ | |
  250. / | | \| output 1 |
  251. _________ / |_________| |__________|
  252. | | /
  253. | input 2 |/
  254. |_________|
  255. </pre>
  256. <p>Complex filtergraphs are configured with the <samp class="option">-filter_complex</samp> option.
  257. Note that this option is global, since a complex filtergraph, by its nature,
  258. cannot be unambiguously associated with a single stream or file.
  259. </p>
  260. <p>The <samp class="option">-lavfi</samp> option is equivalent to <samp class="option">-filter_complex</samp>.
  261. </p>
  262. <p>A trivial example of a complex filtergraph is the <code class="code">overlay</code> filter, which
  263. has two video inputs and one video output, containing one video overlaid on top
  264. of the other. Its audio counterpart is the <code class="code">amix</code> filter.
  265. </p>
  266. </div>
  267. </div>
  268. <div class="section-level-extent" id="Stream-copy">
  269. <h3 class="section"><span>3.2 Stream copy<a class="copiable-link" href="#Stream-copy"> &para;</a></span></h3>
  270. <p>Stream copy is a mode selected by supplying the <code class="code">copy</code> parameter to the
  271. <samp class="option">-codec</samp> option. It makes <code class="command">ffmpeg</code> omit the decoding and encoding
  272. step for the specified stream, so it does only demuxing and muxing. It is useful
  273. for changing the container format or modifying container-level metadata. The
  274. diagram above will, in this case, simplify to this:
  275. </p>
  276. <pre class="verbatim"> _______ ______________ ________
  277. | | | | | |
  278. | input | demuxer | encoded data | muxer | output |
  279. | file | ---------&gt; | packets | -------&gt; | file |
  280. |_______| |______________| |________|
  281. </pre>
  282. <p>Since there is no decoding or encoding, it is very fast and there is no quality
  283. loss. However, it might not work in some cases because of many factors. Applying
  284. filters is obviously also impossible, since filters work on uncompressed data.
  285. </p>
  286. </div>
  287. <div class="section-level-extent" id="Loopback-decoders">
  288. <h3 class="section"><span>3.3 Loopback decoders<a class="copiable-link" href="#Loopback-decoders"> &para;</a></span></h3>
  289. <p>While decoders are normally associated with demuxer streams, it is also possible
  290. to create &quot;loopback&quot; decoders that decode the output from some encoder and allow
  291. it to be fed back to complex filtergraphs. This is done with the <code class="code">-dec</code>
  292. directive, which takes as a parameter the index of the output stream that should
  293. be decoded. Every such directive creates a new loopback decoder, indexed with
  294. successive integers starting at zero. These indices should then be used to refer
  295. to loopback decoders in complex filtergraph link labels, as described in the
  296. documentation for <samp class="option">-filter_complex</samp>.
  297. </p>
  298. <p>E.g. the following example:
  299. </p>
  300. <div class="example">
  301. <pre class="example-preformatted">ffmpeg -i INPUT \
  302. -map 0:v:0 -c:v libx264 -crf 45 -f null - \
  303. -dec 0:0 -filter_complex '[0:v][dec:0]hstack[stack]' \
  304. -map '[stack]' -c:v ffv1 OUTPUT
  305. </pre></div>
  306. <p>reads an input video and
  307. </p><ul class="itemize mark-bullet">
  308. <li>(line 2) encodes it with <code class="code">libx264</code> at low quality;
  309. </li><li>(line 3) decodes this encoded stream and places it side by side with the
  310. original input video;
  311. </li><li>(line 4) combined video is then losslessly encoded and written into
  312. <samp class="file">OUTPUT</samp>.
  313. </li></ul>
  314. </div>
  315. </div>
  316. <div class="chapter-level-extent" id="Stream-selection">
  317. <h2 class="chapter"><span>4 Stream selection<a class="copiable-link" href="#Stream-selection"> &para;</a></span></h2>
  318. <p><code class="command">ffmpeg</code> provides the <code class="code">-map</code> option for manual control of stream selection in each
  319. output file. Users can skip <code class="code">-map</code> and let ffmpeg perform automatic stream selection as
  320. described below. The <code class="code">-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  321. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  322. selected, except for those streams which are outputs of complex filtergraphs.
  323. </p>
  324. <ul class="mini-toc">
  325. <li><a href="#Description-1" accesskey="1">Description</a></li>
  326. <li><a href="#Examples" accesskey="2">Examples</a></li>
  327. </ul>
  328. <div class="section-level-extent" id="Description-1">
  329. <h3 class="section"><span>4.1 Description<a class="copiable-link" href="#Description-1"> &para;</a></span></h3>
  330. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  331. The examples that follow next show how these rules are applied in practice.
  332. </p>
  333. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  334. continuous development and the code may have changed since the time of this writing.
  335. </p>
  336. <ul class="mini-toc">
  337. <li><a href="#Automatic-stream-selection" accesskey="1">Automatic stream selection</a></li>
  338. <li><a href="#Manual-stream-selection" accesskey="2">Manual stream selection</a></li>
  339. <li><a href="#Complex-filtergraphs-1" accesskey="3">Complex filtergraphs</a></li>
  340. <li><a href="#Stream-handling" accesskey="4">Stream handling</a></li>
  341. </ul>
  342. <div class="subsection-level-extent" id="Automatic-stream-selection">
  343. <h4 class="subsection"><span>4.1.1 Automatic stream selection<a class="copiable-link" href="#Automatic-stream-selection"> &para;</a></span></h4>
  344. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  345. format to check which type of streams can be included in it, viz. video, audio and/or
  346. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  347. from among all the inputs.
  348. </p>
  349. <p>It will select that stream based upon the following criteria:
  350. </p><ul class="itemize mark-bullet">
  351. <li>for video, it is the stream with the highest resolution,
  352. </li><li>for audio, it is the stream with the most channels,
  353. </li><li>for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  354. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  355. and only a subtitle stream of the same type will be chosen.
  356. </li></ul>
  357. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  358. index is chosen.
  359. </p>
  360. <p>Data or attachment streams are not automatically selected and can only be included
  361. using <code class="code">-map</code>.
  362. </p></div>
  363. <div class="subsection-level-extent" id="Manual-stream-selection">
  364. <h4 class="subsection"><span>4.1.2 Manual stream selection<a class="copiable-link" href="#Manual-stream-selection"> &para;</a></span></h4>
  365. <p>When <code class="code">-map</code> is used, only user-mapped streams are included in that output file,
  366. with one possible exception for filtergraph outputs described below.
  367. </p>
  368. </div>
  369. <div class="subsection-level-extent" id="Complex-filtergraphs-1">
  370. <h4 class="subsection"><span>4.1.3 Complex filtergraphs<a class="copiable-link" href="#Complex-filtergraphs-1"> &para;</a></span></h4>
  371. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  372. to the first output file. This will lead to a fatal error if the stream type is not supported
  373. by the output format. In the absence of the map option, the inclusion of these streams leads
  374. to the automatic stream selection of their types being skipped. If map options are present,
  375. these filtergraph streams are included in addition to the mapped streams.
  376. </p>
  377. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  378. </p>
  379. </div>
  380. <div class="subsection-level-extent" id="Stream-handling">
  381. <h4 class="subsection"><span>4.1.4 Stream handling<a class="copiable-link" href="#Stream-handling"> &para;</a></span></h4>
  382. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  383. below. Stream handling is set via the <code class="code">-codec</code> option addressed to streams within a
  384. specific <em class="emph">output</em> file. In particular, codec options are applied by ffmpeg after the
  385. stream selection process and thus do not influence the latter. If no <code class="code">-codec</code> option is
  386. specified for a stream type, ffmpeg will select the default encoder registered by the output
  387. file muxer.
  388. </p>
  389. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  390. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  391. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  392. within the output format. This applies generally as well: when the user sets an encoder manually,
  393. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  394. If it cannot, ffmpeg will abort and <em class="emph">all</em> output files will fail to be processed.
  395. </p>
  396. </div>
  397. </div>
  398. <div class="section-level-extent" id="Examples">
  399. <h3 class="section"><span>4.2 Examples<a class="copiable-link" href="#Examples"> &para;</a></span></h3>
  400. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  401. selection methods.
  402. </p>
  403. <p>They assume the following three input files.
  404. </p>
  405. <pre class="verbatim">
  406. input file 'A.avi'
  407. stream 0: video 640x360
  408. stream 1: audio 2 channels
  409. input file 'B.mp4'
  410. stream 0: video 1920x1080
  411. stream 1: audio 2 channels
  412. stream 2: subtitles (text)
  413. stream 3: audio 5.1 channels
  414. stream 4: subtitles (text)
  415. input file 'C.mkv'
  416. stream 0: video 1280x720
  417. stream 1: audio 2 channels
  418. stream 2: subtitles (image)
  419. </pre>
  420. <h4 class="subsubheading" id="Example_003a-automatic-stream-selection"><span>Example: automatic stream selection<a class="copiable-link" href="#Example_003a-automatic-stream-selection"> &para;</a></span></h4>
  421. <div class="example">
  422. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  423. </pre></div>
  424. <p>There are three output files specified, and for the first two, no <code class="code">-map</code> options
  425. are set, so ffmpeg will select streams for these two files automatically.
  426. </p>
  427. <p><samp class="file">out1.mkv</samp> is a Matroska container file and accepts video, audio and subtitle streams,
  428. so ffmpeg will try to select one of each type.<br>
  429. For video, it will select <code class="code">stream 0</code> from <samp class="file">B.mp4</samp>, which has the highest
  430. resolution among all the input video streams.<br>
  431. For audio, it will select <code class="code">stream 3</code> from <samp class="file">B.mp4</samp>, since it has the greatest
  432. number of channels.<br>
  433. For subtitles, it will select <code class="code">stream 2</code> from <samp class="file">B.mp4</samp>, which is the first subtitle
  434. stream from among <samp class="file">A.avi</samp> and <samp class="file">B.mp4</samp>.
  435. </p>
  436. <p><samp class="file">out2.wav</samp> accepts only audio streams, so only <code class="code">stream 3</code> from <samp class="file">B.mp4</samp> is
  437. selected.
  438. </p>
  439. <p>For <samp class="file">out3.mov</samp>, since a <code class="code">-map</code> option is set, no automatic stream selection will
  440. occur. The <code class="code">-map 1:a</code> option will select all audio streams from the second input
  441. <samp class="file">B.mp4</samp>. No other streams will be included in this output file.
  442. </p>
  443. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  444. be the default ones registered by each output format, which may not match the codec of the
  445. selected input streams.
  446. </p>
  447. <p>For the third output, codec option for audio streams has been set
  448. to <code class="code">copy</code>, so no decoding-filtering-encoding operations will occur, or <em class="emph">can</em> occur.
  449. Packets of selected streams shall be conveyed from the input file and muxed within the output
  450. file.
  451. </p>
  452. <h4 class="subsubheading" id="Example_003a-automatic-subtitles-selection"><span>Example: automatic subtitles selection<a class="copiable-link" href="#Example_003a-automatic-subtitles-selection"> &para;</a></span></h4>
  453. <div class="example">
  454. <pre class="example-preformatted">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  455. </pre></div>
  456. <p>Although <samp class="file">out1.mkv</samp> is a Matroska container file which accepts subtitle streams, only a
  457. video and audio stream shall be selected. The subtitle stream of <samp class="file">C.mkv</samp> is image-based
  458. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  459. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  460. <samp class="file">out2.mkv</samp>, a subtitle encoder is specified in the command and so, the subtitle stream is
  461. selected, in addition to the video stream. The presence of <code class="code">-an</code> disables audio stream
  462. selection for <samp class="file">out2.mkv</samp>.
  463. </p>
  464. <h4 class="subsubheading" id="Example_003a-unlabeled-filtergraph-outputs"><span>Example: unlabeled filtergraph outputs<a class="copiable-link" href="#Example_003a-unlabeled-filtergraph-outputs"> &para;</a></span></h4>
  465. <div class="example">
  466. <pre class="example-preformatted">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  467. </pre></div>
  468. <p>A filtergraph is setup here using the <code class="code">-filter_complex</code> option and consists of a single
  469. video filter. The <code class="code">overlay</code> filter requires exactly two video inputs, but none are
  470. specified, so the first two available video streams are used, those of <samp class="file">A.avi</samp> and
  471. <samp class="file">C.mkv</samp>. The output pad of the filter has no label and so is sent to the first output file
  472. <samp class="file">out1.mp4</samp>. Due to this, automatic selection of the video stream is skipped, which would
  473. have selected the stream in <samp class="file">B.mp4</samp>. The audio stream with most channels viz. <code class="code">stream 3</code>
  474. in <samp class="file">B.mp4</samp>, is chosen automatically. No subtitle stream is chosen however, since the MP4
  475. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  476. </p>
  477. <p>The 2nd output file, <samp class="file">out2.srt</samp>, only accepts text-based subtitle streams. So, even though
  478. the first subtitle stream available belongs to <samp class="file">C.mkv</samp>, it is image-based and hence skipped.
  479. The selected stream, <code class="code">stream 2</code> in <samp class="file">B.mp4</samp>, is the first text-based subtitle stream.
  480. </p>
  481. <h4 class="subsubheading" id="Example_003a-labeled-filtergraph-outputs"><span>Example: labeled filtergraph outputs<a class="copiable-link" href="#Example_003a-labeled-filtergraph-outputs"> &para;</a></span></h4>
  482. <div class="example">
  483. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  484. -map '[outv]' -an out1.mp4 \
  485. out2.mkv \
  486. -map '[outv]' -map 1:a:0 out3.mkv
  487. </pre></div>
  488. <p>The above command will fail, as the output pad labelled <code class="code">[outv]</code> has been mapped twice.
  489. None of the output files shall be processed.
  490. </p>
  491. <div class="example">
  492. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  493. -an out1.mp4 \
  494. out2.mkv \
  495. -map 1:a:0 out3.mkv
  496. </pre></div>
  497. <p>This command above will also fail as the hue filter output has a label, <code class="code">[outv]</code>,
  498. and hasn&rsquo;t been mapped anywhere.
  499. </p>
  500. <p>The command should be modified as follows,
  501. </p><div class="example">
  502. <pre class="example-preformatted">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample&quot; \
  503. -map '[outv1]' -an out1.mp4 \
  504. out2.mkv \
  505. -map '[outv2]' -map 1:a:0 out3.mkv
  506. </pre></div>
  507. <p>The video stream from <samp class="file">B.mp4</samp> is sent to the hue filter, whose output is cloned once using
  508. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  509. output files.
  510. </p>
  511. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  512. are the streams from <samp class="file">A.avi</samp> and <samp class="file">C.mkv</samp>. The overlay output isn&rsquo;t labelled, so it is
  513. sent to the first output file <samp class="file">out1.mp4</samp>, regardless of the presence of the <code class="code">-map</code> option.
  514. </p>
  515. <p>The aresample filter is sent the first unused audio stream, that of <samp class="file">A.avi</samp>. Since this filter
  516. output is also unlabelled, it too is mapped to the first output file. The presence of <code class="code">-an</code>
  517. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  518. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in <samp class="file">out1.mp4</samp>.
  519. </p>
  520. <p>The video, audio and subtitle streams mapped to <code class="code">out2.mkv</code> are entirely determined by
  521. automatic stream selection.
  522. </p>
  523. <p><samp class="file">out3.mkv</samp> consists of the cloned video output from the hue filter and the first audio
  524. stream from <samp class="file">B.mp4</samp>.
  525. <br>
  526. </p>
  527. </div>
  528. </div>
  529. <div class="chapter-level-extent" id="Options">
  530. <h2 class="chapter"><span>5 Options<a class="copiable-link" href="#Options"> &para;</a></span></h2>
  531. <p>All the numerical options, if not specified otherwise, accept a string
  532. representing a number as input, which may be followed by one of the SI
  533. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  534. </p>
  535. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  536. interpreted as a unit prefix for binary multiples, which are based on
  537. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  538. prefix multiplies the value by 8. This allows using, for example:
  539. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  540. </p>
  541. <p>Options which do not take arguments are boolean options, and set the
  542. corresponding value to true. They can be set to false by prefixing
  543. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  544. will set the boolean option with name &quot;foo&quot; to false.
  545. </p>
  546. <p>Options that take arguments support a special syntax where the argument given on
  547. the command line is interpreted as a path to the file from which the actual
  548. argument value is loaded. To use this feature, add a forward slash &rsquo;/&rsquo;
  549. immediately before the option name (after the leading dash). E.g.
  550. </p><div class="example">
  551. <pre class="example-preformatted">ffmpeg -i INPUT -/filter:v filter.script OUTPUT
  552. </pre></div>
  553. <p>will load a filtergraph description from the file named <samp class="file">filter.script</samp>.
  554. </p>
  555. <a class="anchor" id="Stream-specifiers"></a><ul class="mini-toc">
  556. <li><a href="#Stream-specifiers-1" accesskey="1">Stream specifiers</a></li>
  557. <li><a href="#Generic-options" accesskey="2">Generic options</a></li>
  558. <li><a href="#AVOptions" accesskey="3">AVOptions</a></li>
  559. <li><a href="#Main-options" accesskey="4">Main options</a></li>
  560. <li><a href="#Video-Options" accesskey="5">Video Options</a></li>
  561. <li><a href="#Advanced-Video-options" accesskey="6">Advanced Video options</a></li>
  562. <li><a href="#Audio-Options" accesskey="7">Audio Options</a></li>
  563. <li><a href="#Advanced-Audio-options" accesskey="8">Advanced Audio options</a></li>
  564. <li><a href="#Subtitle-options" accesskey="9">Subtitle options</a></li>
  565. <li><a href="#Advanced-Subtitle-options">Advanced Subtitle options</a></li>
  566. <li><a href="#Advanced-options">Advanced options</a></li>
  567. <li><a href="#Preset-files">Preset files</a></li>
  568. <li><a href="#vstats-file-format">vstats file format</a></li>
  569. </ul>
  570. <div class="section-level-extent" id="Stream-specifiers-1">
  571. <h3 class="section"><span>5.1 Stream specifiers<a class="copiable-link" href="#Stream-specifiers-1"> &para;</a></span></h3>
  572. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  573. are used to precisely specify which stream(s) a given option belongs to.
  574. </p>
  575. <p>A stream specifier is a string generally appended to the option name and
  576. separated from it by a colon. E.g. <code class="code">-codec:a:1 ac3</code> contains the
  577. <code class="code">a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  578. would select the ac3 codec for the second audio stream.
  579. </p>
  580. <p>A stream specifier can match several streams, so that the option is applied to all
  581. of them. E.g. the stream specifier in <code class="code">-b:a 128k</code> matches all audio
  582. streams.
  583. </p>
  584. <p>An empty stream specifier matches all streams. For example, <code class="code">-codec copy</code>
  585. or <code class="code">-codec: copy</code> would copy all the streams without reencoding.
  586. </p>
  587. <p>Possible forms of stream specifiers are:
  588. </p><dl class="table">
  589. <dt><samp class="option"><var class="var">stream_index</var></samp></dt>
  590. <dd><p>Matches the stream with this index. E.g. <code class="code">-threads:1 4</code> would set the
  591. thread count for the second stream to 4. If <var class="var">stream_index</var> is used as an
  592. additional stream specifier (see below), then it selects stream number
  593. <var class="var">stream_index</var> from the matching streams. Stream numbering is based on the
  594. order of the streams as detected by libavformat except when a stream group
  595. specifier or program ID is also specified. In this case it is based on the
  596. ordering of the streams in the group or program.
  597. </p></dd>
  598. <dt><samp class="option"><var class="var">stream_type</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  599. <dd><p><var class="var">stream_type</var> is one of following: &rsquo;v&rsquo; or &rsquo;V&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo;
  600. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  601. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  602. thumbnails or cover arts. If <var class="var">additional_stream_specifier</var> is used, then
  603. it matches streams which both have this type and match the
  604. <var class="var">additional_stream_specifier</var>. Otherwise, it matches all streams of the
  605. specified type.
  606. </p></dd>
  607. <dt><samp class="option">g:<var class="var">group_specifier</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  608. <dd><p>Matches streams which are in the group with the specifier <var class="var">group_specifier</var>.
  609. if <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  610. are part of the group and match the <var class="var">additional_stream_specifier</var>.
  611. <var class="var">group_specifier</var> may be one of the following:
  612. </p><dl class="table">
  613. <dt><samp class="option"><var class="var">group_index</var></samp></dt>
  614. <dd><p>Match the stream with this group index.
  615. </p></dd>
  616. <dt><samp class="option">#<var class="var">group_id</var> or i:<var class="var">group_id</var></samp></dt>
  617. <dd><p>Match the stream with this group id.
  618. </p></dd>
  619. </dl>
  620. </dd>
  621. <dt><samp class="option">p:<var class="var">program_id</var>[:<var class="var">additional_stream_specifier</var>]</samp></dt>
  622. <dd><p>Matches streams which are in the program with the id <var class="var">program_id</var>. If
  623. <var class="var">additional_stream_specifier</var> is used, then it matches streams which both
  624. are part of the program and match the <var class="var">additional_stream_specifier</var>.
  625. </p>
  626. </dd>
  627. <dt><samp class="option">#<var class="var">stream_id</var> or i:<var class="var">stream_id</var></samp></dt>
  628. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  629. </p></dd>
  630. <dt><samp class="option">m:<var class="var">key</var>[:<var class="var">value</var>]</samp></dt>
  631. <dd><p>Matches streams with the metadata tag <var class="var">key</var> having the specified value. If
  632. <var class="var">value</var> is not given, matches streams that contain the given tag with any
  633. value.
  634. </p></dd>
  635. <dt><samp class="option">u</samp></dt>
  636. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  637. essential information such as video dimension or audio sample rate must be present.
  638. </p>
  639. <p>Note that in <code class="command">ffmpeg</code>, matching by metadata will only work properly for
  640. input files.
  641. </p></dd>
  642. </dl>
  643. </div>
  644. <div class="section-level-extent" id="Generic-options">
  645. <h3 class="section"><span>5.2 Generic options<a class="copiable-link" href="#Generic-options"> &para;</a></span></h3>
  646. <p>These options are shared amongst the ff* tools.
  647. </p>
  648. <dl class="table">
  649. <dt><samp class="option">-L</samp></dt>
  650. <dd><p>Show license.
  651. </p>
  652. </dd>
  653. <dt><samp class="option">-h, -?, -help, --help [<var class="var">arg</var>]</samp></dt>
  654. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  655. item. If no argument is specified, only basic (non advanced) tool
  656. options are shown.
  657. </p>
  658. <p>Possible values of <var class="var">arg</var> are:
  659. </p><dl class="table">
  660. <dt><samp class="option">long</samp></dt>
  661. <dd><p>Print advanced tool options in addition to the basic tool options.
  662. </p>
  663. </dd>
  664. <dt><samp class="option">full</samp></dt>
  665. <dd><p>Print complete list of options, including shared and private options
  666. for encoders, decoders, demuxers, muxers, filters, etc.
  667. </p>
  668. </dd>
  669. <dt><samp class="option">decoder=<var class="var">decoder_name</var></samp></dt>
  670. <dd><p>Print detailed information about the decoder named <var class="var">decoder_name</var>. Use the
  671. <samp class="option">-decoders</samp> option to get a list of all decoders.
  672. </p>
  673. </dd>
  674. <dt><samp class="option">encoder=<var class="var">encoder_name</var></samp></dt>
  675. <dd><p>Print detailed information about the encoder named <var class="var">encoder_name</var>. Use the
  676. <samp class="option">-encoders</samp> option to get a list of all encoders.
  677. </p>
  678. </dd>
  679. <dt><samp class="option">demuxer=<var class="var">demuxer_name</var></samp></dt>
  680. <dd><p>Print detailed information about the demuxer named <var class="var">demuxer_name</var>. Use the
  681. <samp class="option">-formats</samp> option to get a list of all demuxers and muxers.
  682. </p>
  683. </dd>
  684. <dt><samp class="option">muxer=<var class="var">muxer_name</var></samp></dt>
  685. <dd><p>Print detailed information about the muxer named <var class="var">muxer_name</var>. Use the
  686. <samp class="option">-formats</samp> option to get a list of all muxers and demuxers.
  687. </p>
  688. </dd>
  689. <dt><samp class="option">filter=<var class="var">filter_name</var></samp></dt>
  690. <dd><p>Print detailed information about the filter named <var class="var">filter_name</var>. Use the
  691. <samp class="option">-filters</samp> option to get a list of all filters.
  692. </p>
  693. </dd>
  694. <dt><samp class="option">bsf=<var class="var">bitstream_filter_name</var></samp></dt>
  695. <dd><p>Print detailed information about the bitstream filter named <var class="var">bitstream_filter_name</var>.
  696. Use the <samp class="option">-bsfs</samp> option to get a list of all bitstream filters.
  697. </p>
  698. </dd>
  699. <dt><samp class="option">protocol=<var class="var">protocol_name</var></samp></dt>
  700. <dd><p>Print detailed information about the protocol named <var class="var">protocol_name</var>.
  701. Use the <samp class="option">-protocols</samp> option to get a list of all protocols.
  702. </p></dd>
  703. </dl>
  704. </dd>
  705. <dt><samp class="option">-version</samp></dt>
  706. <dd><p>Show version.
  707. </p>
  708. </dd>
  709. <dt><samp class="option">-buildconf</samp></dt>
  710. <dd><p>Show the build configuration, one option per line.
  711. </p>
  712. </dd>
  713. <dt><samp class="option">-formats</samp></dt>
  714. <dd><p>Show available formats (including devices).
  715. </p>
  716. </dd>
  717. <dt><samp class="option">-demuxers</samp></dt>
  718. <dd><p>Show available demuxers.
  719. </p>
  720. </dd>
  721. <dt><samp class="option">-muxers</samp></dt>
  722. <dd><p>Show available muxers.
  723. </p>
  724. </dd>
  725. <dt><samp class="option">-devices</samp></dt>
  726. <dd><p>Show available devices.
  727. </p>
  728. </dd>
  729. <dt><samp class="option">-codecs</samp></dt>
  730. <dd><p>Show all codecs known to libavcodec.
  731. </p>
  732. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  733. for what is more correctly called a media bitstream format.
  734. </p>
  735. </dd>
  736. <dt><samp class="option">-decoders</samp></dt>
  737. <dd><p>Show available decoders.
  738. </p>
  739. </dd>
  740. <dt><samp class="option">-encoders</samp></dt>
  741. <dd><p>Show all available encoders.
  742. </p>
  743. </dd>
  744. <dt><samp class="option">-bsfs</samp></dt>
  745. <dd><p>Show available bitstream filters.
  746. </p>
  747. </dd>
  748. <dt><samp class="option">-protocols</samp></dt>
  749. <dd><p>Show available protocols.
  750. </p>
  751. </dd>
  752. <dt><samp class="option">-filters</samp></dt>
  753. <dd><p>Show available libavfilter filters.
  754. </p>
  755. </dd>
  756. <dt><samp class="option">-pix_fmts</samp></dt>
  757. <dd><p>Show available pixel formats.
  758. </p>
  759. </dd>
  760. <dt><samp class="option">-sample_fmts</samp></dt>
  761. <dd><p>Show available sample formats.
  762. </p>
  763. </dd>
  764. <dt><samp class="option">-layouts</samp></dt>
  765. <dd><p>Show channel names and standard channel layouts.
  766. </p>
  767. </dd>
  768. <dt><samp class="option">-dispositions</samp></dt>
  769. <dd><p>Show stream dispositions.
  770. </p>
  771. </dd>
  772. <dt><samp class="option">-colors</samp></dt>
  773. <dd><p>Show recognized color names.
  774. </p>
  775. </dd>
  776. <dt><samp class="option">-sources <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
  777. <dd><p>Show autodetected sources of the input device.
  778. Some devices may provide system-dependent source names that cannot be autodetected.
  779. The returned list cannot be assumed to be always complete.
  780. </p><div class="example">
  781. <pre class="example-preformatted">ffmpeg -sources pulse,server=192.168.0.4
  782. </pre></div>
  783. </dd>
  784. <dt><samp class="option">-sinks <var class="var">device</var>[,<var class="var">opt1</var>=<var class="var">val1</var>[,<var class="var">opt2</var>=<var class="var">val2</var>]...]</samp></dt>
  785. <dd><p>Show autodetected sinks of the output device.
  786. Some devices may provide system-dependent sink names that cannot be autodetected.
  787. The returned list cannot be assumed to be always complete.
  788. </p><div class="example">
  789. <pre class="example-preformatted">ffmpeg -sinks pulse,server=192.168.0.4
  790. </pre></div>
  791. </dd>
  792. <dt><samp class="option">-loglevel [<var class="var">flags</var>+]<var class="var">loglevel</var> | -v [<var class="var">flags</var>+]<var class="var">loglevel</var></samp></dt>
  793. <dd><p>Set logging level and flags used by the library.
  794. </p>
  795. <p>The optional <var class="var">flags</var> prefix can consist of the following values:
  796. </p><dl class="table">
  797. <dt>&lsquo;<samp class="samp">repeat</samp>&rsquo;</dt>
  798. <dd><p>Indicates that repeated log output should not be compressed to the first line
  799. and the &quot;Last message repeated n times&quot; line will be omitted.
  800. </p></dd>
  801. <dt>&lsquo;<samp class="samp">level</samp>&rsquo;</dt>
  802. <dd><p>Indicates that log output should add a <code class="code">[level]</code> prefix to each message
  803. line. This can be used as an alternative to log coloring, e.g. when dumping the
  804. log to file.
  805. </p></dd>
  806. </dl>
  807. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  808. flag without affecting other <var class="var">flags</var> or changing <var class="var">loglevel</var>. When
  809. setting both <var class="var">flags</var> and <var class="var">loglevel</var>, a &rsquo;+&rsquo; separator is expected
  810. between the last <var class="var">flags</var> value and before <var class="var">loglevel</var>.
  811. </p>
  812. <p><var class="var">loglevel</var> is a string or a number containing one of the following values:
  813. </p><dl class="table">
  814. <dt>&lsquo;<samp class="samp">quiet, -8</samp>&rsquo;</dt>
  815. <dd><p>Show nothing at all; be silent.
  816. </p></dd>
  817. <dt>&lsquo;<samp class="samp">panic, 0</samp>&rsquo;</dt>
  818. <dd><p>Only show fatal errors which could lead the process to crash, such as
  819. an assertion failure. This is not currently used for anything.
  820. </p></dd>
  821. <dt>&lsquo;<samp class="samp">fatal, 8</samp>&rsquo;</dt>
  822. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  823. cannot continue.
  824. </p></dd>
  825. <dt>&lsquo;<samp class="samp">error, 16</samp>&rsquo;</dt>
  826. <dd><p>Show all errors, including ones which can be recovered from.
  827. </p></dd>
  828. <dt>&lsquo;<samp class="samp">warning, 24</samp>&rsquo;</dt>
  829. <dd><p>Show all warnings and errors. Any message related to possibly
  830. incorrect or unexpected events will be shown.
  831. </p></dd>
  832. <dt>&lsquo;<samp class="samp">info, 32</samp>&rsquo;</dt>
  833. <dd><p>Show informative messages during processing. This is in addition to
  834. warnings and errors. This is the default value.
  835. </p></dd>
  836. <dt>&lsquo;<samp class="samp">verbose, 40</samp>&rsquo;</dt>
  837. <dd><p>Same as <code class="code">info</code>, except more verbose.
  838. </p></dd>
  839. <dt>&lsquo;<samp class="samp">debug, 48</samp>&rsquo;</dt>
  840. <dd><p>Show everything, including debugging information.
  841. </p></dd>
  842. <dt>&lsquo;<samp class="samp">trace, 56</samp>&rsquo;</dt>
  843. </dl>
  844. <p>For example to enable repeated log output, add the <code class="code">level</code> prefix, and set
  845. <var class="var">loglevel</var> to <code class="code">verbose</code>:
  846. </p><div class="example">
  847. <pre class="example-preformatted">ffmpeg -loglevel repeat+level+verbose -i input output
  848. </pre></div>
  849. <p>Another example that enables repeated log output without affecting current
  850. state of <code class="code">level</code> prefix flag or <var class="var">loglevel</var>:
  851. </p><div class="example">
  852. <pre class="example-preformatted">ffmpeg [...] -loglevel +repeat
  853. </pre></div>
  854. <p>By default the program logs to stderr. If coloring is supported by the
  855. terminal, colors are used to mark errors and warnings. Log coloring
  856. can be disabled setting the environment variable
  857. <code class="env">AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  858. the environment variable <code class="env">AV_LOG_FORCE_COLOR</code>.
  859. </p>
  860. </dd>
  861. <dt><samp class="option">-report</samp></dt>
  862. <dd><p>Dump full command line and log output to a file named
  863. <code class="code"><var class="var">program</var>-<var class="var">YYYYMMDD</var>-<var class="var">HHMMSS</var>.log</code> in the current
  864. directory.
  865. This file can be useful for bug reports.
  866. It also implies <code class="code">-loglevel debug</code>.
  867. </p>
  868. <p>Setting the environment variable <code class="env">FFREPORT</code> to any value has the
  869. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  870. options will affect the report; option values must be escaped if they
  871. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  872. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  873. </p>
  874. <p>The following options are recognized:
  875. </p><dl class="table">
  876. <dt><samp class="option">file</samp></dt>
  877. <dd><p>set the file name to use for the report; <code class="code">%p</code> is expanded to the name
  878. of the program, <code class="code">%t</code> is expanded to a timestamp, <code class="code">%%</code> is expanded
  879. to a plain <code class="code">%</code>
  880. </p></dd>
  881. <dt><samp class="option">level</samp></dt>
  882. <dd><p>set the log verbosity level using a numerical value (see <code class="code">-loglevel</code>).
  883. </p></dd>
  884. </dl>
  885. <p>For example, to output a report to a file named <samp class="file">ffreport.log</samp>
  886. using a log level of <code class="code">32</code> (alias for log level <code class="code">info</code>):
  887. </p>
  888. <div class="example">
  889. <pre class="example-preformatted">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  890. </pre></div>
  891. <p>Errors in parsing the environment variable are not fatal, and will not
  892. appear in the report.
  893. </p>
  894. </dd>
  895. <dt><samp class="option">-hide_banner</samp></dt>
  896. <dd><p>Suppress printing banner.
  897. </p>
  898. <p>All FFmpeg tools will normally show a copyright notice, build options
  899. and library versions. This option can be used to suppress printing
  900. this information.
  901. </p>
  902. </dd>
  903. <dt><samp class="option">-cpuflags flags (<em class="emph">global</em>)</samp></dt>
  904. <dd><p>Allows setting and clearing cpu flags. This option is intended
  905. for testing. Do not use it unless you know what you&rsquo;re doing.
  906. </p><div class="example">
  907. <pre class="example-preformatted">ffmpeg -cpuflags -sse+mmx ...
  908. ffmpeg -cpuflags mmx ...
  909. ffmpeg -cpuflags 0 ...
  910. </pre></div>
  911. <p>Possible flags for this option are:
  912. </p><dl class="table">
  913. <dt>&lsquo;<samp class="samp">x86</samp>&rsquo;</dt>
  914. <dd><dl class="table">
  915. <dt>&lsquo;<samp class="samp">mmx</samp>&rsquo;</dt>
  916. <dt>&lsquo;<samp class="samp">mmxext</samp>&rsquo;</dt>
  917. <dt>&lsquo;<samp class="samp">sse</samp>&rsquo;</dt>
  918. <dt>&lsquo;<samp class="samp">sse2</samp>&rsquo;</dt>
  919. <dt>&lsquo;<samp class="samp">sse2slow</samp>&rsquo;</dt>
  920. <dt>&lsquo;<samp class="samp">sse3</samp>&rsquo;</dt>
  921. <dt>&lsquo;<samp class="samp">sse3slow</samp>&rsquo;</dt>
  922. <dt>&lsquo;<samp class="samp">ssse3</samp>&rsquo;</dt>
  923. <dt>&lsquo;<samp class="samp">atom</samp>&rsquo;</dt>
  924. <dt>&lsquo;<samp class="samp">sse4.1</samp>&rsquo;</dt>
  925. <dt>&lsquo;<samp class="samp">sse4.2</samp>&rsquo;</dt>
  926. <dt>&lsquo;<samp class="samp">avx</samp>&rsquo;</dt>
  927. <dt>&lsquo;<samp class="samp">avx2</samp>&rsquo;</dt>
  928. <dt>&lsquo;<samp class="samp">xop</samp>&rsquo;</dt>
  929. <dt>&lsquo;<samp class="samp">fma3</samp>&rsquo;</dt>
  930. <dt>&lsquo;<samp class="samp">fma4</samp>&rsquo;</dt>
  931. <dt>&lsquo;<samp class="samp">3dnow</samp>&rsquo;</dt>
  932. <dt>&lsquo;<samp class="samp">3dnowext</samp>&rsquo;</dt>
  933. <dt>&lsquo;<samp class="samp">bmi1</samp>&rsquo;</dt>
  934. <dt>&lsquo;<samp class="samp">bmi2</samp>&rsquo;</dt>
  935. <dt>&lsquo;<samp class="samp">cmov</samp>&rsquo;</dt>
  936. </dl>
  937. </dd>
  938. <dt>&lsquo;<samp class="samp">ARM</samp>&rsquo;</dt>
  939. <dd><dl class="table">
  940. <dt>&lsquo;<samp class="samp">armv5te</samp>&rsquo;</dt>
  941. <dt>&lsquo;<samp class="samp">armv6</samp>&rsquo;</dt>
  942. <dt>&lsquo;<samp class="samp">armv6t2</samp>&rsquo;</dt>
  943. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  944. <dt>&lsquo;<samp class="samp">vfpv3</samp>&rsquo;</dt>
  945. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  946. <dt>&lsquo;<samp class="samp">setend</samp>&rsquo;</dt>
  947. </dl>
  948. </dd>
  949. <dt>&lsquo;<samp class="samp">AArch64</samp>&rsquo;</dt>
  950. <dd><dl class="table">
  951. <dt>&lsquo;<samp class="samp">armv8</samp>&rsquo;</dt>
  952. <dt>&lsquo;<samp class="samp">vfp</samp>&rsquo;</dt>
  953. <dt>&lsquo;<samp class="samp">neon</samp>&rsquo;</dt>
  954. </dl>
  955. </dd>
  956. <dt>&lsquo;<samp class="samp">PowerPC</samp>&rsquo;</dt>
  957. <dd><dl class="table">
  958. <dt>&lsquo;<samp class="samp">altivec</samp>&rsquo;</dt>
  959. </dl>
  960. </dd>
  961. <dt>&lsquo;<samp class="samp">Specific Processors</samp>&rsquo;</dt>
  962. <dd><dl class="table">
  963. <dt>&lsquo;<samp class="samp">pentium2</samp>&rsquo;</dt>
  964. <dt>&lsquo;<samp class="samp">pentium3</samp>&rsquo;</dt>
  965. <dt>&lsquo;<samp class="samp">pentium4</samp>&rsquo;</dt>
  966. <dt>&lsquo;<samp class="samp">k6</samp>&rsquo;</dt>
  967. <dt>&lsquo;<samp class="samp">k62</samp>&rsquo;</dt>
  968. <dt>&lsquo;<samp class="samp">athlon</samp>&rsquo;</dt>
  969. <dt>&lsquo;<samp class="samp">athlonxp</samp>&rsquo;</dt>
  970. <dt>&lsquo;<samp class="samp">k8</samp>&rsquo;</dt>
  971. </dl>
  972. </dd>
  973. </dl>
  974. </dd>
  975. <dt><samp class="option">-cpucount <var class="var">count</var> (<em class="emph">global</em>)</samp></dt>
  976. <dd><p>Override detection of CPU count. This option is intended
  977. for testing. Do not use it unless you know what you&rsquo;re doing.
  978. </p><div class="example">
  979. <pre class="example-preformatted">ffmpeg -cpucount 2
  980. </pre></div>
  981. </dd>
  982. <dt><samp class="option">-max_alloc <var class="var">bytes</var></samp></dt>
  983. <dd><p>Set the maximum size limit for allocating a block on the heap by ffmpeg&rsquo;s
  984. family of malloc functions. Exercise <strong class="strong">extreme caution</strong> when using
  985. this option. Don&rsquo;t use if you do not understand the full consequence of doing so.
  986. Default is INT_MAX.
  987. </p></dd>
  988. </dl>
  989. </div>
  990. <div class="section-level-extent" id="AVOptions">
  991. <h3 class="section"><span>5.3 AVOptions<a class="copiable-link" href="#AVOptions"> &para;</a></span></h3>
  992. <p>These options are provided directly by the libavformat, libavdevice and
  993. libavcodec libraries. To see the list of available AVOptions, use the
  994. <samp class="option">-help</samp> option. They are separated into two categories:
  995. </p><dl class="table">
  996. <dt><samp class="option">generic</samp></dt>
  997. <dd><p>These options can be set for any container, codec or device. Generic options
  998. are listed under AVFormatContext options for containers/devices and under
  999. AVCodecContext options for codecs.
  1000. </p></dd>
  1001. <dt><samp class="option">private</samp></dt>
  1002. <dd><p>These options are specific to the given container, device or codec. Private
  1003. options are listed under their corresponding containers/devices/codecs.
  1004. </p></dd>
  1005. </dl>
  1006. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  1007. an MP3 file, use the <samp class="option">id3v2_version</samp> private option of the MP3
  1008. muxer:
  1009. </p><div class="example">
  1010. <pre class="example-preformatted">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  1011. </pre></div>
  1012. <p>All codec AVOptions are per-stream, and thus a stream specifier
  1013. should be attached to them:
  1014. </p><div class="example">
  1015. <pre class="example-preformatted">ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
  1016. </pre></div>
  1017. <p>In the above example, a multichannel audio stream is mapped twice for output.
  1018. The first instance is encoded with codec ac3 and bitrate 640k.
  1019. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  1020. absolute index of the output stream.
  1021. </p>
  1022. <p>Note: the <samp class="option">-nooption</samp> syntax cannot be used for boolean
  1023. AVOptions, use <samp class="option">-option 0</samp>/<samp class="option">-option 1</samp>.
  1024. </p>
  1025. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  1026. prepending v/a/s to the options name is now obsolete and will be
  1027. removed soon.
  1028. </p>
  1029. </div>
  1030. <div class="section-level-extent" id="Main-options">
  1031. <h3 class="section"><span>5.4 Main options<a class="copiable-link" href="#Main-options"> &para;</a></span></h3>
  1032. <dl class="table">
  1033. <dt><samp class="option">-f <var class="var">fmt</var> (<em class="emph">input/output</em>)</samp></dt>
  1034. <dd><p>Force input or output file format. The format is normally auto detected for input
  1035. files and guessed from the file extension for output files, so this option is not
  1036. needed in most cases.
  1037. </p>
  1038. </dd>
  1039. <dt><samp class="option">-i <var class="var">url</var> (<em class="emph">input</em>)</samp></dt>
  1040. <dd><p>input file url
  1041. </p>
  1042. </dd>
  1043. <dt><samp class="option">-y (<em class="emph">global</em>)</samp></dt>
  1044. <dd><p>Overwrite output files without asking.
  1045. </p>
  1046. </dd>
  1047. <dt><samp class="option">-n (<em class="emph">global</em>)</samp></dt>
  1048. <dd><p>Do not overwrite output files, and exit immediately if a specified
  1049. output file already exists.
  1050. </p>
  1051. </dd>
  1052. <dt><samp class="option">-stream_loop <var class="var">number</var> (<em class="emph">input</em>)</samp></dt>
  1053. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  1054. loop -1 means infinite loop.
  1055. </p>
  1056. </dd>
  1057. <dt><samp class="option">-recast_media (<em class="emph">global</em>)</samp></dt>
  1058. <dd><p>Allow forcing a decoder of a different media type than the one
  1059. detected or designated by the demuxer. Useful for decoding media
  1060. data muxed as data streams.
  1061. </p>
  1062. </dd>
  1063. <dt><samp class="option">-c[:<var class="var">stream_specifier</var>] <var class="var">codec</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  1064. <dt><samp class="option">-codec[:<var class="var">stream_specifier</var>] <var class="var">codec</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  1065. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  1066. before an input file) for one or more streams. <var class="var">codec</var> is the name of a
  1067. decoder/encoder or a special value <code class="code">copy</code> (output only) to indicate that
  1068. the stream is not to be re-encoded.
  1069. </p>
  1070. <p>For example
  1071. </p><div class="example">
  1072. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  1073. </pre></div>
  1074. <p>encodes all video streams with libx264 and copies all audio streams.
  1075. </p>
  1076. <p>For each stream, the last matching <code class="code">c</code> option is applied, so
  1077. </p><div class="example">
  1078. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  1079. </pre></div>
  1080. <p>will copy all the streams except the second video, which will be encoded with
  1081. libx264, and the 138th audio, which will be encoded with libvorbis.
  1082. </p>
  1083. </dd>
  1084. <dt><samp class="option">-t <var class="var">duration</var> (<em class="emph">input/output</em>)</samp></dt>
  1085. <dd><p>When used as an input option (before <code class="code">-i</code>), limit the <var class="var">duration</var> of
  1086. data read from the input file.
  1087. </p>
  1088. <p>When used as an output option (before an output url), stop writing the
  1089. output after its duration reaches <var class="var">duration</var>.
  1090. </p>
  1091. <p><var class="var">duration</var> must be a time duration specification,
  1092. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  1093. </p>
  1094. <p>-to and -t are mutually exclusive and -t has priority.
  1095. </p>
  1096. </dd>
  1097. <dt><samp class="option">-to <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  1098. <dd><p>Stop writing the output or reading the input at <var class="var">position</var>.
  1099. <var class="var">position</var> must be a time duration specification,
  1100. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  1101. </p>
  1102. <p>-to and -t are mutually exclusive and -t has priority.
  1103. </p>
  1104. </dd>
  1105. <dt><samp class="option">-fs <var class="var">limit_size</var> (<em class="emph">output</em>)</samp></dt>
  1106. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  1107. after the limit is exceeded. The size of the output file is slightly more than the
  1108. requested file size.
  1109. </p>
  1110. </dd>
  1111. <dt><samp class="option">-ss <var class="var">position</var> (<em class="emph">input/output</em>)</samp></dt>
  1112. <dd><p>When used as an input option (before <code class="code">-i</code>), seeks in this input file to
  1113. <var class="var">position</var>. Note that in most formats it is not possible to seek exactly,
  1114. so <code class="command">ffmpeg</code> will seek to the closest seek point before <var class="var">position</var>.
  1115. When transcoding and <samp class="option">-accurate_seek</samp> is enabled (the default), this
  1116. extra segment between the seek point and <var class="var">position</var> will be decoded and
  1117. discarded. When doing stream copy or when <samp class="option">-noaccurate_seek</samp> is used, it
  1118. will be preserved.
  1119. </p>
  1120. <p>When used as an output option (before an output url), decodes but discards
  1121. input until the timestamps reach <var class="var">position</var>.
  1122. </p>
  1123. <p><var class="var">position</var> must be a time duration specification,
  1124. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  1125. </p>
  1126. </dd>
  1127. <dt><samp class="option">-sseof <var class="var">position</var> (<em class="emph">input</em>)</samp></dt>
  1128. <dd>
  1129. <p>Like the <code class="code">-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  1130. values are earlier in the file, 0 is at EOF.
  1131. </p>
  1132. </dd>
  1133. <dt><samp class="option">-isync <var class="var">input_index</var> (<em class="emph">input</em>)</samp></dt>
  1134. <dd><p>Assign an input as a sync source.
  1135. </p>
  1136. <p>This will take the difference between the start times of the target and reference inputs and
  1137. offset the timestamps of the target file by that difference. The source timestamps of the two
  1138. inputs should derive from the same clock source for expected results. If <code class="code">copyts</code> is set
  1139. then <code class="code">start_at_zero</code> must also be set. If either of the inputs has no starting timestamp
  1140. then no sync adjustment is made.
  1141. </p>
  1142. <p>Acceptable values are those that refer to a valid ffmpeg input index. If the sync reference is
  1143. the target index itself or <var class="var">-1</var>, then no adjustment is made to target timestamps. A sync
  1144. reference may not itself be synced to any other input.
  1145. </p>
  1146. <p>Default value is <var class="var">-1</var>.
  1147. </p>
  1148. </dd>
  1149. <dt><samp class="option">-itsoffset <var class="var">offset</var> (<em class="emph">input</em>)</samp></dt>
  1150. <dd><p>Set the input time offset.
  1151. </p>
  1152. <p><var class="var">offset</var> must be a time duration specification,
  1153. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  1154. </p>
  1155. <p>The offset is added to the timestamps of the input files. Specifying
  1156. a positive offset means that the corresponding streams are delayed by
  1157. the time duration specified in <var class="var">offset</var>.
  1158. </p>
  1159. </dd>
  1160. <dt><samp class="option">-itsscale <var class="var">scale</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  1161. <dd><p>Rescale input timestamps. <var class="var">scale</var> should be a floating point number.
  1162. </p>
  1163. </dd>
  1164. <dt><samp class="option">-timestamp <var class="var">date</var> (<em class="emph">output</em>)</samp></dt>
  1165. <dd><p>Set the recording timestamp in the container.
  1166. </p>
  1167. <p><var class="var">date</var> must be a date specification,
  1168. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#date-syntax">the Date section in the ffmpeg-utils(1) manual</a>.
  1169. </p>
  1170. </dd>
  1171. <dt><samp class="option">-metadata[:metadata_specifier] <var class="var">key</var>=<var class="var">value</var> (<em class="emph">output,per-metadata</em>)</samp></dt>
  1172. <dd><p>Set a metadata key/value pair.
  1173. </p>
  1174. <p>An optional <var class="var">metadata_specifier</var> may be given to set metadata
  1175. on streams, chapters or programs. See <code class="code">-map_metadata</code>
  1176. documentation for details.
  1177. </p>
  1178. <p>This option overrides metadata set with <code class="code">-map_metadata</code>. It is
  1179. also possible to delete metadata by using an empty value.
  1180. </p>
  1181. <p>For example, for setting the title in the output file:
  1182. </p><div class="example">
  1183. <pre class="example-preformatted">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  1184. </pre></div>
  1185. <p>To set the language of the first audio stream:
  1186. </p><div class="example">
  1187. <pre class="example-preformatted">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  1188. </pre></div>
  1189. </dd>
  1190. <dt><samp class="option">-disposition[:stream_specifier] <var class="var">value</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1191. <dd><p>Sets the disposition for a stream.
  1192. </p>
  1193. <p>By default, the disposition is copied from the input stream, unless the output
  1194. stream this option applies to is fed by a complex filtergraph - in that case the
  1195. disposition is unset by default.
  1196. </p>
  1197. <p><var class="var">value</var> is a sequence of items separated by &rsquo;+&rsquo; or &rsquo;-&rsquo;. The first item may
  1198. also be prefixed with &rsquo;+&rsquo; or &rsquo;-&rsquo;, in which case this option modifies the default
  1199. value. Otherwise (the first item is not prefixed) this options overrides the
  1200. default value. A &rsquo;+&rsquo; prefix adds the given disposition, &rsquo;-&rsquo; removes it. It is
  1201. also possible to clear the disposition by setting it to 0.
  1202. </p>
  1203. <p>If no <code class="code">-disposition</code> options were specified for an output file, ffmpeg will
  1204. automatically set the &rsquo;default&rsquo; disposition on the first stream of each type,
  1205. when there are multiple streams of this type in the output file and no stream of
  1206. that type is already marked as default.
  1207. </p>
  1208. <p>The <code class="code">-dispositions</code> option lists the known dispositions.
  1209. </p>
  1210. <p>For example, to make the second audio stream the default stream:
  1211. </p><div class="example">
  1212. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  1213. </pre></div>
  1214. <p>To make the second subtitle stream the default stream and remove the default
  1215. disposition from the first subtitle stream:
  1216. </p><div class="example">
  1217. <pre class="example-preformatted">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  1218. </pre></div>
  1219. <p>To add an embedded cover/thumbnail:
  1220. </p><div class="example">
  1221. <pre class="example-preformatted">ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
  1222. </pre></div>
  1223. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  1224. </p>
  1225. </dd>
  1226. <dt><samp class="option">-program [title=<var class="var">title</var>:][program_num=<var class="var">program_num</var>:]st=<var class="var">stream</var>[:st=<var class="var">stream</var>...] (<em class="emph">output</em>)</samp></dt>
  1227. <dd>
  1228. <p>Creates a program with the specified <var class="var">title</var>, <var class="var">program_num</var> and adds the specified
  1229. <var class="var">stream</var>(s) to it.
  1230. </p>
  1231. </dd>
  1232. <dt><samp class="option">-stream_group type=<var class="var">type</var>:st=<var class="var">stream</var>[:st=<var class="var">stream</var>][:stg=<var class="var">stream_group</var>][:id=<var class="var">stream_group_id</var>...] (<em class="emph">output</em>)</samp></dt>
  1233. <dd>
  1234. <p>Creates a stream group of the specified <var class="var">type</var>, <var class="var">stream_group_id</var> and adds the specified
  1235. <var class="var">stream</var>(s) and/or previously defined <var class="var">stream_group</var>(s) to it.
  1236. </p>
  1237. <p><var class="var">type</var> can be one of the following:
  1238. </p><dl class="table">
  1239. <dt><samp class="option">iamf_audio_element</samp></dt>
  1240. <dd><p>Groups <var class="var">stream</var>s that belong to the same IAMF Audio Element
  1241. </p>
  1242. <p>For this group <var class="var">type</var>, the following options are available
  1243. </p><dl class="table">
  1244. <dt><samp class="option">audio_element_type</samp></dt>
  1245. <dd><p>The Audio Element type. The following values are supported:
  1246. </p>
  1247. <dl class="table">
  1248. <dt><samp class="option">channel</samp></dt>
  1249. <dd><p>Scalable channel audio representation
  1250. </p></dd>
  1251. <dt><samp class="option">scene</samp></dt>
  1252. <dd><p>Ambisonics representation
  1253. </p></dd>
  1254. </dl>
  1255. </dd>
  1256. <dt><samp class="option">demixing</samp></dt>
  1257. <dd><p>Demixing information used to reconstruct a scalable channel audio representation.
  1258. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  1259. key=value options
  1260. </p>
  1261. <dl class="table">
  1262. <dt><samp class="option">parameter_id</samp></dt>
  1263. <dd><p>An identifier parameters blocks in frames may refer to
  1264. </p></dd>
  1265. <dt><samp class="option">dmixp_mode</samp></dt>
  1266. <dd><p>A pre-defined combination of demixing parameters
  1267. </p></dd>
  1268. </dl>
  1269. </dd>
  1270. <dt><samp class="option">recon_gain</samp></dt>
  1271. <dd><p>Recon gain information used to reconstruct a scalable channel audio representation.
  1272. This option must be separated from the rest with a &rsquo;,&rsquo;, and takes the following
  1273. key=value options
  1274. </p>
  1275. <dl class="table">
  1276. <dt><samp class="option">parameter_id</samp></dt>
  1277. <dd><p>An identifier parameters blocks in frames may refer to
  1278. </p></dd>
  1279. </dl>
  1280. </dd>
  1281. <dt><samp class="option">layer</samp></dt>
  1282. <dd><p>A layer defining a Channel Layout in the Audio Element.
  1283. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  1284. can be defined, and at least one must be set.
  1285. </p>
  1286. <p>It takes the following &quot;:&quot;-separated key=value options
  1287. </p>
  1288. <dl class="table">
  1289. <dt><samp class="option">ch_layout</samp></dt>
  1290. <dd><p>The layer&rsquo;s channel layout
  1291. </p></dd>
  1292. <dt><samp class="option">flags</samp></dt>
  1293. <dd><p>The following flags are available:
  1294. </p>
  1295. <dl class="table">
  1296. <dt><samp class="option">recon_gain</samp></dt>
  1297. <dd><p>Wether to signal if recon_gain is present as metadata in parameter blocks within frames
  1298. </p></dd>
  1299. </dl>
  1300. </dd>
  1301. <dt><samp class="option">output_gain</samp></dt>
  1302. <dt><samp class="option">output_gain_flags</samp></dt>
  1303. <dd><p>Which channels output_gain applies to. The following flags are available:
  1304. </p>
  1305. <dl class="table">
  1306. <dt><samp class="option">FL</samp></dt>
  1307. <dt><samp class="option">FR</samp></dt>
  1308. <dt><samp class="option">BL</samp></dt>
  1309. <dt><samp class="option">BR</samp></dt>
  1310. <dt><samp class="option">TFL</samp></dt>
  1311. <dt><samp class="option">TFR</samp></dt>
  1312. </dl>
  1313. </dd>
  1314. <dt><samp class="option">ambisonics_mode</samp></dt>
  1315. <dd><p>The ambisonics mode. This has no effect if audio_element_type is set to channel.
  1316. </p>
  1317. <p>The following values are supported:
  1318. </p>
  1319. <dl class="table">
  1320. <dt><samp class="option">mono</samp></dt>
  1321. <dd><p>Each ambisonics channel is coded as an individual mono stream in the group
  1322. </p></dd>
  1323. </dl>
  1324. </dd>
  1325. </dl>
  1326. </dd>
  1327. <dt><samp class="option">default_w</samp></dt>
  1328. <dd><p>Default weight value
  1329. </p>
  1330. </dd>
  1331. </dl>
  1332. </dd>
  1333. <dt><samp class="option">iamf_mix_presentation</samp></dt>
  1334. <dd><p>Groups <var class="var">stream</var>s that belong to all IAMF Audio Element the same
  1335. IAMF Mix Presentation references
  1336. </p>
  1337. <p>For this group <var class="var">type</var>, the following options are available
  1338. </p>
  1339. <dl class="table">
  1340. <dt><samp class="option">submix</samp></dt>
  1341. <dd><p>A sub-mix within the Mix Presentation.
  1342. This option must be separated from the rest with a &rsquo;,&rsquo;. Several &rsquo;,&rsquo; separated entries
  1343. can be defined, and at least one must be set.
  1344. </p>
  1345. <p>It takes the following &quot;:&quot;-separated key=value options
  1346. </p>
  1347. <dl class="table">
  1348. <dt><samp class="option">parameter_id</samp></dt>
  1349. <dd><p>An identifier parameters blocks in frames may refer to, for post-processing the mixed
  1350. audio signal to generate the audio signal for playback
  1351. </p></dd>
  1352. <dt><samp class="option">parameter_rate</samp></dt>
  1353. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  1354. <var class="var">parameter_id</var> are expressed as
  1355. </p></dd>
  1356. <dt><samp class="option">default_mix_gain</samp></dt>
  1357. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  1358. <var class="var">parameter_id</var> for a given frame
  1359. </p>
  1360. </dd>
  1361. <dt><samp class="option">element</samp></dt>
  1362. <dd><p>References an Audio Element used in this Mix Presentation to generate the final output
  1363. audio signal for playback.
  1364. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  1365. can be defined, and at least one must be set.
  1366. </p>
  1367. <p>It takes the following &quot;:&quot;-separated key=value options:
  1368. </p>
  1369. <dl class="table">
  1370. <dt><samp class="option">stg</samp></dt>
  1371. <dd><p>The <var class="var">stream_group_id</var> for an Audio Element which this sub-mix refers to
  1372. </p></dd>
  1373. <dt><samp class="option">parameter_id</samp></dt>
  1374. <dd><p>An identifier parameters blocks in frames may refer to, for applying any processing to
  1375. the referenced and rendered Audio Element before being summed with other processed Audio
  1376. Elements
  1377. </p></dd>
  1378. <dt><samp class="option">parameter_rate</samp></dt>
  1379. <dd><p>The sample rate duration fields in parameters blocks in frames that refer to this
  1380. <var class="var">parameter_id</var> are expressed as
  1381. </p></dd>
  1382. <dt><samp class="option">default_mix_gain</samp></dt>
  1383. <dd><p>Default mix gain value to apply when there are no parameter blocks sharing the same
  1384. <var class="var">parameter_id</var> for a given frame
  1385. </p></dd>
  1386. <dt><samp class="option">annotations</samp></dt>
  1387. <dd><p>A key=value string describing the sub-mix element where &quot;key&quot; is a string conforming to
  1388. BCP-47 that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the
  1389. one in the mix&rsquo;s <var class="var">annotations</var>
  1390. </p></dd>
  1391. <dt><samp class="option">headphones_rendering_mode</samp></dt>
  1392. <dd><p>Indicates whether the input channel-based Audio Element is rendered to stereo loudspeakers
  1393. or spatialized with a binaural renderer when played back on headphones.
  1394. This has no effect if the referenced Audio Element&rsquo;s <var class="var">audio_element_type</var> is set to
  1395. channel.
  1396. </p>
  1397. <p>The following values are supported:
  1398. </p>
  1399. <dl class="table">
  1400. <dt><samp class="option">stereo</samp></dt>
  1401. <dt><samp class="option">binaural</samp></dt>
  1402. </dl>
  1403. </dd>
  1404. </dl>
  1405. </dd>
  1406. <dt><samp class="option">layout</samp></dt>
  1407. <dd><p>Specifies the layouts for this sub-mix on which the loudness information was measured.
  1408. This option must be separated from the rest with a &rsquo;|&rsquo;. Several &rsquo;|&rsquo; separated entries
  1409. can be defined, and at least one must be set.
  1410. </p>
  1411. <p>It takes the following &quot;:&quot;-separated key=value options:
  1412. </p>
  1413. <dl class="table">
  1414. <dt><samp class="option">layout_type</samp></dt>
  1415. <dd>
  1416. <dl class="table">
  1417. <dt><samp class="option">loudspeakers</samp></dt>
  1418. <dd><p>The layout follows the loudspeaker sound system convention of ITU-2051-3.
  1419. </p></dd>
  1420. <dt><samp class="option">binaural</samp></dt>
  1421. <dd><p>The layout is binaural.
  1422. </p></dd>
  1423. </dl>
  1424. </dd>
  1425. <dt><samp class="option">sound_system</samp></dt>
  1426. <dd><p>Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus 7.1.2 and 3.1.2
  1427. This has no effect if <var class="var">layout_type</var> is set to binaural.
  1428. </p></dd>
  1429. <dt><samp class="option">integrated_loudness</samp></dt>
  1430. <dd><p>The program integrated loudness information, as defined in ITU-1770-4.
  1431. </p></dd>
  1432. <dt><samp class="option">digital_peak</samp></dt>
  1433. <dd><p>The digital (sampled) peak value of the audio signal, as defined in ITU-1770-4.
  1434. </p></dd>
  1435. <dt><samp class="option">true_peak</samp></dt>
  1436. <dd><p>The true peak of the audio signal, as defined in ITU-1770-4.
  1437. </p></dd>
  1438. <dt><samp class="option">dialog_anchored_loudness</samp></dt>
  1439. <dd><p>The Dialogue loudness information, as defined in ITU-1770-4.
  1440. </p></dd>
  1441. <dt><samp class="option">album_anchored_loudness</samp></dt>
  1442. <dd><p>The Album loudness information, as defined in ITU-1770-4.
  1443. </p></dd>
  1444. </dl>
  1445. </dd>
  1446. </dl>
  1447. </dd>
  1448. <dt><samp class="option">annotations</samp></dt>
  1449. <dd><p>A key=value string string describing the mix where &quot;key&quot; is a string conforming to BCP-47
  1450. that specifies the language for the &quot;value&quot; string. &quot;key&quot; must be the same as the ones in
  1451. all sub-mix element&rsquo;s <var class="var">annotations</var>s
  1452. </p></dd>
  1453. </dl>
  1454. </dd>
  1455. </dl>
  1456. </dd>
  1457. <dt><samp class="option">-target <var class="var">type</var> (<em class="emph">output</em>)</samp></dt>
  1458. <dd><p>Specify target file type (<code class="code">vcd</code>, <code class="code">svcd</code>, <code class="code">dvd</code>, <code class="code">dv</code>,
  1459. <code class="code">dv50</code>). <var class="var">type</var> may be prefixed with <code class="code">pal-</code>, <code class="code">ntsc-</code> or
  1460. <code class="code">film-</code> to use the corresponding standard. All the format options
  1461. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  1462. </p>
  1463. <div class="example">
  1464. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  1465. </pre></div>
  1466. <p>Nevertheless you can specify additional options as long as you know
  1467. they do not conflict with the standard, as in:
  1468. </p>
  1469. <div class="example">
  1470. <pre class="example-preformatted">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  1471. </pre></div>
  1472. <p>The parameters set for each target are as follows.
  1473. </p>
  1474. <p><strong class="strong">VCD</strong>
  1475. </p><div class="example">
  1476. <pre class="example-preformatted"><var class="var">pal</var>:
  1477. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  1478. -s 352x288 -r 25
  1479. -codec:v mpeg1video -g 15 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  1480. -ar 44100 -ac 2
  1481. -codec:a mp2 -b:a 224k
  1482. <var class="var">ntsc</var>:
  1483. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  1484. -s 352x240 -r 30000/1001
  1485. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  1486. -ar 44100 -ac 2
  1487. -codec:a mp2 -b:a 224k
  1488. <var class="var">film</var>:
  1489. -f vcd -muxrate 1411200 -muxpreload 0.44 -packetsize 2324
  1490. -s 352x240 -r 24000/1001
  1491. -codec:v mpeg1video -g 18 -b:v 1150k -maxrate:v 1150k -minrate:v 1150k -bufsize:v 327680
  1492. -ar 44100 -ac 2
  1493. -codec:a mp2 -b:a 224k
  1494. </pre></div>
  1495. <p><strong class="strong">SVCD</strong>
  1496. </p><div class="example">
  1497. <pre class="example-preformatted"><var class="var">pal</var>:
  1498. -f svcd -packetsize 2324
  1499. -s 480x576 -pix_fmt yuv420p -r 25
  1500. -codec:v mpeg2video -g 15 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  1501. -ar 44100
  1502. -codec:a mp2 -b:a 224k
  1503. <var class="var">ntsc</var>:
  1504. -f svcd -packetsize 2324
  1505. -s 480x480 -pix_fmt yuv420p -r 30000/1001
  1506. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  1507. -ar 44100
  1508. -codec:a mp2 -b:a 224k
  1509. <var class="var">film</var>:
  1510. -f svcd -packetsize 2324
  1511. -s 480x480 -pix_fmt yuv420p -r 24000/1001
  1512. -codec:v mpeg2video -g 18 -b:v 2040k -maxrate:v 2516k -minrate:v 0 -bufsize:v 1835008 -scan_offset 1
  1513. -ar 44100
  1514. -codec:a mp2 -b:a 224k
  1515. </pre></div>
  1516. <p><strong class="strong">DVD</strong>
  1517. </p><div class="example">
  1518. <pre class="example-preformatted"><var class="var">pal</var>:
  1519. -f dvd -muxrate 10080k -packetsize 2048
  1520. -s 720x576 -pix_fmt yuv420p -r 25
  1521. -codec:v mpeg2video -g 15 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  1522. -ar 48000
  1523. -codec:a ac3 -b:a 448k
  1524. <var class="var">ntsc</var>:
  1525. -f dvd -muxrate 10080k -packetsize 2048
  1526. -s 720x480 -pix_fmt yuv420p -r 30000/1001
  1527. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  1528. -ar 48000
  1529. -codec:a ac3 -b:a 448k
  1530. <var class="var">film</var>:
  1531. -f dvd -muxrate 10080k -packetsize 2048
  1532. -s 720x480 -pix_fmt yuv420p -r 24000/1001
  1533. -codec:v mpeg2video -g 18 -b:v 6000k -maxrate:v 9000k -minrate:v 0 -bufsize:v 1835008
  1534. -ar 48000
  1535. -codec:a ac3 -b:a 448k
  1536. </pre></div>
  1537. <p><strong class="strong">DV</strong>
  1538. </p><div class="example">
  1539. <pre class="example-preformatted"><var class="var">pal</var>:
  1540. -f dv
  1541. -s 720x576 -pix_fmt yuv420p -r 25
  1542. -ar 48000 -ac 2
  1543. <var class="var">ntsc</var>:
  1544. -f dv
  1545. -s 720x480 -pix_fmt yuv411p -r 30000/1001
  1546. -ar 48000 -ac 2
  1547. <var class="var">film</var>:
  1548. -f dv
  1549. -s 720x480 -pix_fmt yuv411p -r 24000/1001
  1550. -ar 48000 -ac 2
  1551. </pre></div>
  1552. <p>The <code class="code">dv50</code> target is identical to the <code class="code">dv</code> target except that the pixel format set is <code class="code">yuv422p</code> for all three standards.
  1553. </p>
  1554. <p>Any user-set value for a parameter above will override the target preset value. In that case, the output may
  1555. not comply with the target standard.
  1556. </p>
  1557. </dd>
  1558. <dt><samp class="option">-dn (<em class="emph">input/output</em>)</samp></dt>
  1559. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  1560. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  1561. option to disable streams individually.
  1562. </p>
  1563. <p>As an output option, disables data recording i.e. automatic selection or
  1564. mapping of any data stream. For full manual control see the <code class="code">-map</code>
  1565. option.
  1566. </p>
  1567. </dd>
  1568. <dt><samp class="option">-dframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  1569. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  1570. <code class="code">-frames:d</code>, which you should use instead.
  1571. </p>
  1572. </dd>
  1573. <dt><samp class="option">-frames[:<var class="var">stream_specifier</var>] <var class="var">framecount</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1574. <dd><p>Stop writing to the stream after <var class="var">framecount</var> frames.
  1575. </p>
  1576. </dd>
  1577. <dt><samp class="option">-q[:<var class="var">stream_specifier</var>] <var class="var">q</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1578. <dt><samp class="option">-qscale[:<var class="var">stream_specifier</var>] <var class="var">q</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1579. <dd><p>Use fixed quality scale (VBR). The meaning of <var class="var">q</var>/<var class="var">qscale</var> is
  1580. codec-dependent.
  1581. If <var class="var">qscale</var> is used without a <var class="var">stream_specifier</var> then it applies only
  1582. to the video stream, this is to maintain compatibility with previous behavior
  1583. and as specifying the same codec specific value to 2 different codecs that is
  1584. audio and video generally is not what is intended when no stream_specifier is
  1585. used.
  1586. </p>
  1587. <a class="anchor" id="filter_005foption"></a></dd>
  1588. <dt><samp class="option">-filter[:<var class="var">stream_specifier</var>] <var class="var">filtergraph</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1589. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  1590. filter the stream.
  1591. </p>
  1592. <p><var class="var">filtergraph</var> is a description of the filtergraph to apply to
  1593. the stream, and must have a single input and a single output of the
  1594. same type of the stream. In the filtergraph, the input is associated
  1595. to the label <code class="code">in</code>, and the output to the label <code class="code">out</code>. See
  1596. the ffmpeg-filters manual for more information about the filtergraph
  1597. syntax.
  1598. </p>
  1599. <p>See the <a class="ref" href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  1600. want to create filtergraphs with multiple inputs and/or outputs.
  1601. </p>
  1602. </dd>
  1603. <dt><samp class="option">-reinit_filter[:<var class="var">stream_specifier</var>] <var class="var">integer</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  1604. <dd><p>This boolean option determines if the filtergraph(s) to which this stream is fed gets
  1605. reinitialized when input frame parameters change mid-stream. This option is enabled by
  1606. default as most video and all audio filters cannot handle deviation in input frame properties.
  1607. Upon reinitialization, existing filter state is lost, like e.g. the frame count <code class="code">n</code>
  1608. reference available in some filters. Any frames buffered at time of reinitialization are lost.
  1609. The properties where a change triggers reinitialization are,
  1610. for video, frame resolution or pixel format;
  1611. for audio, sample format, sample rate, channel count or channel layout.
  1612. </p>
  1613. </dd>
  1614. <dt><samp class="option">-filter_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  1615. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  1616. will produce a thread pool with this many threads available for parallel processing.
  1617. The default is the number of available CPUs.
  1618. </p>
  1619. </dd>
  1620. <dt><samp class="option">-pre[:<var class="var">stream_specifier</var>] <var class="var">preset_name</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1621. <dd><p>Specify the preset for matching stream(s).
  1622. </p>
  1623. </dd>
  1624. <dt><samp class="option">-stats (<em class="emph">global</em>)</samp></dt>
  1625. <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
  1626. disable it you need to specify <code class="code">-nostats</code>.
  1627. </p>
  1628. </dd>
  1629. <dt><samp class="option">-stats_period <var class="var">time</var> (<em class="emph">global</em>)</samp></dt>
  1630. <dd><p>Set period at which encoding progress/statistics are updated. Default is 0.5 seconds.
  1631. </p>
  1632. </dd>
  1633. <dt><samp class="option">-progress <var class="var">url</var> (<em class="emph">global</em>)</samp></dt>
  1634. <dd><p>Send program-friendly progress information to <var class="var">url</var>.
  1635. </p>
  1636. <p>Progress information is written periodically and at the end of
  1637. the encoding process. It is made of &quot;<var class="var">key</var>=<var class="var">value</var>&quot; lines. <var class="var">key</var>
  1638. consists of only alphanumeric characters. The last key of a sequence of
  1639. progress information is always &quot;progress&quot;.
  1640. </p>
  1641. <p>The update period is set using <code class="code">-stats_period</code>.
  1642. </p>
  1643. <a class="anchor" id="stdin-option"></a></dd>
  1644. <dt><samp class="option">-stdin</samp></dt>
  1645. <dd><p>Enable interaction on standard input. On by default unless standard input is
  1646. used as an input. To explicitly disable interaction you need to specify
  1647. <code class="code">-nostdin</code>.
  1648. </p>
  1649. <p>Disabling interaction on standard input is useful, for example, if
  1650. ffmpeg is in the background process group. Roughly the same result can
  1651. be achieved with <code class="code">ffmpeg ... &lt; /dev/null</code> but it requires a
  1652. shell.
  1653. </p>
  1654. </dd>
  1655. <dt><samp class="option">-debug_ts (<em class="emph">global</em>)</samp></dt>
  1656. <dd><p>Print timestamp/latency information. It is off by default. This option is
  1657. mostly useful for testing and debugging purposes, and the output
  1658. format may change from one version to another, so it should not be
  1659. employed by portable scripts.
  1660. </p>
  1661. <p>See also the option <code class="code">-fdebug ts</code>.
  1662. </p>
  1663. </dd>
  1664. <dt><samp class="option">-attach <var class="var">filename</var> (<em class="emph">output</em>)</samp></dt>
  1665. <dd><p>Add an attachment to the output file. This is supported by a few formats
  1666. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  1667. are implemented as a specific type of stream, so this option will add
  1668. a new stream to the file. It is then possible to use per-stream options
  1669. on this stream in the usual way. Attachment streams created with this
  1670. option will be created after all the other streams (i.e. those created
  1671. with <code class="code">-map</code> or automatic mappings).
  1672. </p>
  1673. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  1674. </p><div class="example">
  1675. <pre class="example-preformatted">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  1676. </pre></div>
  1677. <p>(assuming that the attachment stream will be third in the output file).
  1678. </p>
  1679. </dd>
  1680. <dt><samp class="option">-dump_attachment[:<var class="var">stream_specifier</var>] <var class="var">filename</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  1681. <dd><p>Extract the matching attachment stream into a file named <var class="var">filename</var>. If
  1682. <var class="var">filename</var> is empty, then the value of the <code class="code">filename</code> metadata tag
  1683. will be used.
  1684. </p>
  1685. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  1686. </p><div class="example">
  1687. <pre class="example-preformatted">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  1688. </pre></div>
  1689. <p>To extract all attachments to files determined by the <code class="code">filename</code> tag:
  1690. </p><div class="example">
  1691. <pre class="example-preformatted">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  1692. </pre></div>
  1693. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  1694. option can actually be used to extract extradata from any stream, not just
  1695. attachments.
  1696. </p></dd>
  1697. </dl>
  1698. </div>
  1699. <div class="section-level-extent" id="Video-Options">
  1700. <h3 class="section"><span>5.5 Video Options<a class="copiable-link" href="#Video-Options"> &para;</a></span></h3>
  1701. <dl class="table">
  1702. <dt><samp class="option">-vframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  1703. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  1704. <code class="code">-frames:v</code>, which you should use instead.
  1705. </p></dd>
  1706. <dt><samp class="option">-r[:<var class="var">stream_specifier</var>] <var class="var">fps</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  1707. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  1708. </p>
  1709. <p>As an input option, ignore any timestamps stored in the file and instead
  1710. generate timestamps assuming constant frame rate <var class="var">fps</var>.
  1711. This is not the same as the <samp class="option">-framerate</samp> option used for some input formats
  1712. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  1713. If in doubt use <samp class="option">-framerate</samp> instead of the input option <samp class="option">-r</samp>.
  1714. </p>
  1715. <p>As an output option:
  1716. </p><dl class="table">
  1717. <dt><samp class="option">video encoding</samp></dt>
  1718. <dd><p>Duplicate or drop frames right before encoding them to achieve constant output
  1719. frame rate <var class="var">fps</var>.
  1720. </p>
  1721. </dd>
  1722. <dt><samp class="option">video streamcopy</samp></dt>
  1723. <dd><p>Indicate to the muxer that <var class="var">fps</var> is the stream frame rate. No data is
  1724. dropped or duplicated in this case. This may produce invalid files if <var class="var">fps</var>
  1725. does not match the actual stream frame rate as determined by packet timestamps.
  1726. See also the <code class="code">setts</code> bitstream filter.
  1727. </p>
  1728. </dd>
  1729. </dl>
  1730. </dd>
  1731. <dt><samp class="option">-fpsmax[:<var class="var">stream_specifier</var>] <var class="var">fps</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1732. <dd><p>Set maximum frame rate (Hz value, fraction or abbreviation).
  1733. </p>
  1734. <p>Clamps output frame rate when output framerate is auto-set and is higher than this value.
  1735. Useful in batch processing or when input framerate is wrongly detected as very high.
  1736. It cannot be set together with <code class="code">-r</code>. It is ignored during streamcopy.
  1737. </p>
  1738. </dd>
  1739. <dt><samp class="option">-s[:<var class="var">stream_specifier</var>] <var class="var">size</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  1740. <dd><p>Set frame size.
  1741. </p>
  1742. <p>As an input option, this is a shortcut for the <samp class="option">video_size</samp> private
  1743. option, recognized by some demuxers for which the frame size is either not
  1744. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  1745. </p>
  1746. <p>As an output option, this inserts the <code class="code">scale</code> video filter to the
  1747. <em class="emph">end</em> of the corresponding filtergraph. Please use the <code class="code">scale</code> filter
  1748. directly to insert it at the beginning or some other place.
  1749. </p>
  1750. <p>The format is &lsquo;<samp class="samp">wxh</samp>&rsquo; (default - same as source).
  1751. </p>
  1752. </dd>
  1753. <dt><samp class="option">-aspect[:<var class="var">stream_specifier</var>] <var class="var">aspect</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1754. <dd><p>Set the video display aspect ratio specified by <var class="var">aspect</var>.
  1755. </p>
  1756. <p><var class="var">aspect</var> can be a floating point number string, or a string of the
  1757. form <var class="var">num</var>:<var class="var">den</var>, where <var class="var">num</var> and <var class="var">den</var> are the
  1758. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  1759. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  1760. </p>
  1761. <p>If used together with <samp class="option">-vcodec copy</samp>, it will affect the aspect ratio
  1762. stored at container level, but not the aspect ratio stored in encoded
  1763. frames, if it exists.
  1764. </p>
  1765. </dd>
  1766. <dt><samp class="option">-display_rotation[:<var class="var">stream_specifier</var>] <var class="var">rotation</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  1767. <dd><p>Set video rotation metadata.
  1768. </p>
  1769. <p><var class="var">rotation</var> is a decimal number specifying the amount in degree by
  1770. which the video should be rotated counter-clockwise before being
  1771. displayed.
  1772. </p>
  1773. <p>This option overrides the rotation/display transform metadata stored in
  1774. the file, if any. When the video is being transcoded (rather than
  1775. copied) and <code class="code">-autorotate</code> is enabled, the video will be rotated at
  1776. the filtering stage. Otherwise, the metadata will be written into the
  1777. output file if the muxer supports it.
  1778. </p>
  1779. <p>If the <code class="code">-display_hflip</code> and/or <code class="code">-display_vflip</code> options are
  1780. given, they are applied after the rotation specified by this option.
  1781. </p>
  1782. </dd>
  1783. <dt><samp class="option">-display_hflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  1784. <dd><p>Set whether on display the image should be horizontally flipped.
  1785. </p>
  1786. <p>See the <code class="code">-display_rotation</code> option for more details.
  1787. </p>
  1788. </dd>
  1789. <dt><samp class="option">-display_vflip[:<var class="var">stream_specifier</var>] (<em class="emph">input,per-stream</em>)</samp></dt>
  1790. <dd><p>Set whether on display the image should be vertically flipped.
  1791. </p>
  1792. <p>See the <code class="code">-display_rotation</code> option for more details.
  1793. </p>
  1794. </dd>
  1795. <dt><samp class="option">-vn (<em class="emph">input/output</em>)</samp></dt>
  1796. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  1797. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  1798. option to disable streams individually.
  1799. </p>
  1800. <p>As an output option, disables video recording i.e. automatic selection or
  1801. mapping of any video stream. For full manual control see the <code class="code">-map</code>
  1802. option.
  1803. </p>
  1804. </dd>
  1805. <dt><samp class="option">-vcodec <var class="var">codec</var> (<em class="emph">output</em>)</samp></dt>
  1806. <dd><p>Set the video codec. This is an alias for <code class="code">-codec:v</code>.
  1807. </p>
  1808. </dd>
  1809. <dt><samp class="option">-pass[:<var class="var">stream_specifier</var>] <var class="var">n</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1810. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  1811. video encoding. The statistics of the video are recorded in the first
  1812. pass into a log file (see also the option -passlogfile),
  1813. and in the second pass that log file is used to generate the video
  1814. at the exact requested bitrate.
  1815. On pass 1, you may just deactivate audio and set output to null,
  1816. examples for Windows and Unix:
  1817. </p><div class="example">
  1818. <pre class="example-preformatted">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  1819. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  1820. </pre></div>
  1821. </dd>
  1822. <dt><samp class="option">-passlogfile[:<var class="var">stream_specifier</var>] <var class="var">prefix</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1823. <dd><p>Set two-pass log file name prefix to <var class="var">prefix</var>, the default file name
  1824. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  1825. <samp class="file">PREFIX-N.log</samp>, where N is a number specific to the output
  1826. stream
  1827. </p>
  1828. </dd>
  1829. <dt><samp class="option">-vf <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  1830. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  1831. filter the stream.
  1832. </p>
  1833. <p>This is an alias for <code class="code">-filter:v</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  1834. </p>
  1835. </dd>
  1836. <dt><samp class="option">-autorotate</samp></dt>
  1837. <dd><p>Automatically rotate the video according to file metadata. Enabled by
  1838. default, use <samp class="option">-noautorotate</samp> to disable it.
  1839. </p>
  1840. </dd>
  1841. <dt><samp class="option">-autoscale</samp></dt>
  1842. <dd><p>Automatically scale the video according to the resolution of first frame.
  1843. Enabled by default, use <samp class="option">-noautoscale</samp> to disable it. When autoscale is
  1844. disabled, all output frames of filter graph might not be in the same resolution
  1845. and may be inadequate for some encoder/muxer. Therefore, it is not recommended
  1846. to disable it unless you really know what you are doing.
  1847. Disable autoscale at your own risk.
  1848. </p></dd>
  1849. </dl>
  1850. </div>
  1851. <div class="section-level-extent" id="Advanced-Video-options">
  1852. <h3 class="section"><span>5.6 Advanced Video options<a class="copiable-link" href="#Advanced-Video-options"> &para;</a></span></h3>
  1853. <dl class="table">
  1854. <dt><samp class="option">-pix_fmt[:<var class="var">stream_specifier</var>] <var class="var">format</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  1855. <dd><p>Set pixel format. Use <code class="code">-pix_fmts</code> to show all the supported
  1856. pixel formats.
  1857. If the selected pixel format can not be selected, ffmpeg will print a
  1858. warning and select the best pixel format supported by the encoder.
  1859. If <var class="var">pix_fmt</var> is prefixed by a <code class="code">+</code>, ffmpeg will exit with an error
  1860. if the requested pixel format can not be selected, and automatic conversions
  1861. inside filtergraphs are disabled.
  1862. If <var class="var">pix_fmt</var> is a single <code class="code">+</code>, ffmpeg selects the same pixel format
  1863. as the input (or graph output) and automatic conversions are disabled.
  1864. </p>
  1865. </dd>
  1866. <dt><samp class="option">-sws_flags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  1867. <dd><p>Set default flags for the libswscale library. These flags are used by
  1868. automatically inserted <code class="code">scale</code> filters and those within simple
  1869. filtergraphs, if not overridden within the filtergraph definition.
  1870. </p>
  1871. <p>See the <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">ffmpeg-scaler manual</a> for a list
  1872. of scaler options.
  1873. </p>
  1874. </dd>
  1875. <dt><samp class="option">-rc_override[:<var class="var">stream_specifier</var>] <var class="var">override</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1876. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  1877. list separated with slashes. Two first values are the beginning and
  1878. end frame numbers, last one is quantizer to use if positive, or quality
  1879. factor if negative.
  1880. </p>
  1881. </dd>
  1882. <dt><samp class="option">-vstats</samp></dt>
  1883. <dd><p>Dump video coding statistics to <samp class="file">vstats_HHMMSS.log</samp>. See the
  1884. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  1885. </p>
  1886. </dd>
  1887. <dt><samp class="option">-vstats_file <var class="var">file</var></samp></dt>
  1888. <dd><p>Dump video coding statistics to <var class="var">file</var>. See the
  1889. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  1890. </p>
  1891. </dd>
  1892. <dt><samp class="option">-vstats_version <var class="var">file</var></samp></dt>
  1893. <dd><p>Specify which version of the vstats format to use. Default is <code class="code">2</code>. See the
  1894. <a class="ref" href="#vstats_005ffile_005fformat">vstats file format</a> section for the format description.
  1895. </p>
  1896. </dd>
  1897. <dt><samp class="option">-vtag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  1898. <dd><p>Force video tag/fourcc. This is an alias for <code class="code">-tag:v</code>.
  1899. </p>
  1900. </dd>
  1901. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] <var class="var">time</var>[,<var class="var">time</var>...] (<em class="emph">output,per-stream</em>)</samp></dt>
  1902. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] expr:<var class="var">expr</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  1903. <dt><samp class="option">-force_key_frames[:<var class="var">stream_specifier</var>] source (<em class="emph">output,per-stream</em>)</samp></dt>
  1904. <dd>
  1905. <p><var class="var">force_key_frames</var> can take arguments of the following form:
  1906. </p>
  1907. <dl class="table">
  1908. <dt><samp class="option"><var class="var">time</var>[,<var class="var">time</var>...]</samp></dt>
  1909. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  1910. output timestamp as per the encoder time base and force a keyframe at the first frame having
  1911. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  1912. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  1913. The default encoder time base is the inverse of the output framerate but may be set otherwise
  1914. via <code class="code">-enc_time_base</code>.
  1915. </p>
  1916. <p>If one of the times is &quot;<code class="code">chapters</code>[<var class="var">delta</var>]&quot;, it is expanded into
  1917. the time of the beginning of all chapters in the file, shifted by
  1918. <var class="var">delta</var>, expressed as a time in seconds.
  1919. This option can be useful to ensure that a seek point is present at a
  1920. chapter mark or any other designated place in the output file.
  1921. </p>
  1922. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  1923. before the beginning of every chapter:
  1924. </p><div class="example">
  1925. <pre class="example-preformatted">-force_key_frames 0:05:00,chapters-0.1
  1926. </pre></div>
  1927. </dd>
  1928. <dt><samp class="option">expr:<var class="var">expr</var></samp></dt>
  1929. <dd><p>If the argument is prefixed with <code class="code">expr:</code>, the string <var class="var">expr</var>
  1930. is interpreted like an expression and is evaluated for each frame. A
  1931. key frame is forced in case the evaluation is non-zero.
  1932. </p>
  1933. <p>The expression in <var class="var">expr</var> can contain the following constants:
  1934. </p><dl class="table">
  1935. <dt><samp class="option">n</samp></dt>
  1936. <dd><p>the number of current processed frame, starting from 0
  1937. </p></dd>
  1938. <dt><samp class="option">n_forced</samp></dt>
  1939. <dd><p>the number of forced frames
  1940. </p></dd>
  1941. <dt><samp class="option">prev_forced_n</samp></dt>
  1942. <dd><p>the number of the previous forced frame, it is <code class="code">NAN</code> when no
  1943. keyframe was forced yet
  1944. </p></dd>
  1945. <dt><samp class="option">prev_forced_t</samp></dt>
  1946. <dd><p>the time of the previous forced frame, it is <code class="code">NAN</code> when no
  1947. keyframe was forced yet
  1948. </p></dd>
  1949. <dt><samp class="option">t</samp></dt>
  1950. <dd><p>the time of the current processed frame
  1951. </p></dd>
  1952. </dl>
  1953. <p>For example to force a key frame every 5 seconds, you can specify:
  1954. </p><div class="example">
  1955. <pre class="example-preformatted">-force_key_frames expr:gte(t,n_forced*5)
  1956. </pre></div>
  1957. <p>To force a key frame 5 seconds after the time of the last forced one,
  1958. starting from second 13:
  1959. </p><div class="example">
  1960. <pre class="example-preformatted">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  1961. </pre></div>
  1962. </dd>
  1963. <dt><samp class="option">source</samp></dt>
  1964. <dd><p>If the argument is <code class="code">source</code>, ffmpeg will force a key frame if
  1965. the current frame being encoded is marked as a key frame in its source.
  1966. In cases where this particular source frame has to be dropped,
  1967. enforce the next available frame to become a key frame instead.
  1968. </p>
  1969. </dd>
  1970. </dl>
  1971. <p>Note that forcing too many keyframes is very harmful for the lookahead
  1972. algorithms of certain encoders: using fixed-GOP options or similar
  1973. would be more efficient.
  1974. </p>
  1975. </dd>
  1976. <dt><samp class="option">-copyinkf[:<var class="var">stream_specifier</var>] (<em class="emph">output,per-stream</em>)</samp></dt>
  1977. <dd><p>When doing stream copy, copy also non-key frames found at the
  1978. beginning.
  1979. </p>
  1980. </dd>
  1981. <dt><samp class="option">-init_hw_device <var class="var">type</var>[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  1982. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>, using the
  1983. given device parameters.
  1984. If no name is specified it will receive a default name of the form &quot;<var class="var">type</var>%d&quot;.
  1985. </p>
  1986. <p>The meaning of <var class="var">device</var> and the following arguments depends on the
  1987. device type:
  1988. </p><dl class="table">
  1989. <dt><samp class="option">cuda</samp></dt>
  1990. <dd><p><var class="var">device</var> is the number of the CUDA device.
  1991. </p>
  1992. <p>The following options are recognized:
  1993. </p><dl class="table">
  1994. <dt><samp class="option">primary_ctx</samp></dt>
  1995. <dd><p>If set to 1, uses the primary device context instead of creating a new one.
  1996. </p></dd>
  1997. </dl>
  1998. <p>Examples:
  1999. </p><dl class="table">
  2000. <dt><em class="emph">-init_hw_device cuda:1</em></dt>
  2001. <dd><p>Choose the second device on the system.
  2002. </p>
  2003. </dd>
  2004. <dt><em class="emph">-init_hw_device cuda:0,primary_ctx=1</em></dt>
  2005. <dd><p>Choose the first device and use the primary device context.
  2006. </p></dd>
  2007. </dl>
  2008. </dd>
  2009. <dt><samp class="option">dxva2</samp></dt>
  2010. <dd><p><var class="var">device</var> is the number of the Direct3D 9 display adapter.
  2011. </p>
  2012. </dd>
  2013. <dt><samp class="option">d3d11va</samp></dt>
  2014. <dd><p><var class="var">device</var> is the number of the Direct3D 11 display adapter.
  2015. If not specified, it will attempt to use the default Direct3D 11 display adapter
  2016. or the first Direct3D 11 display adapter whose hardware VendorId is specified
  2017. by &lsquo;<samp class="samp">vendor_id</samp>&rsquo;.
  2018. </p>
  2019. <p>Examples:
  2020. </p><dl class="table">
  2021. <dt><em class="emph">-init_hw_device d3d11va</em></dt>
  2022. <dd><p>Create a d3d11va device on the default Direct3D 11 display adapter.
  2023. </p>
  2024. </dd>
  2025. <dt><em class="emph">-init_hw_device d3d11va:1</em></dt>
  2026. <dd><p>Create a d3d11va device on the Direct3D 11 display adapter specified by index 1.
  2027. </p>
  2028. </dd>
  2029. <dt><em class="emph">-init_hw_device d3d11va:,vendor_id=0x8086</em></dt>
  2030. <dd><p>Create a d3d11va device on the first Direct3D 11 display adapter whose hardware VendorId is 0x8086.
  2031. </p></dd>
  2032. </dl>
  2033. </dd>
  2034. <dt><samp class="option">vaapi</samp></dt>
  2035. <dd><p><var class="var">device</var> is either an X11 display name, a DRM render node or a DirectX adapter index.
  2036. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>)
  2037. and then the first DRM render node (<em class="emph">/dev/dri/renderD128</em>), or the default
  2038. DirectX adapter on Windows.
  2039. </p>
  2040. <p>The following options are recognized:
  2041. </p><dl class="table">
  2042. <dt><samp class="option">kernel_driver</samp></dt>
  2043. <dd><p>When <var class="var">device</var> is not specified, use this option to specify the name of the kernel
  2044. driver associated with the desired device. This option is available only when
  2045. the hardware acceleration method <em class="emph">drm</em> and <em class="emph">vaapi</em> are enabled.
  2046. </p></dd>
  2047. </dl>
  2048. <p>Examples:
  2049. </p><dl class="table">
  2050. <dt><em class="emph">-init_hw_device vaapi</em></dt>
  2051. <dd><p>Create a vaapi device on the default device.
  2052. </p>
  2053. </dd>
  2054. <dt><em class="emph">-init_hw_device vaapi:/dev/dri/renderD129</em></dt>
  2055. <dd><p>Create a vaapi device on DRM render node <samp class="file">/dev/dri/renderD129</samp>.
  2056. </p>
  2057. </dd>
  2058. <dt><em class="emph">-init_hw_device vaapi:1</em></dt>
  2059. <dd><p>Create a vaapi device on DirectX adapter 1.
  2060. </p>
  2061. </dd>
  2062. <dt><em class="emph">-init_hw_device vaapi:,kernel_driver=i915</em></dt>
  2063. <dd><p>Create a vaapi device on a device associated with kernel driver &lsquo;<samp class="samp">i915</samp>&rsquo;.
  2064. </p></dd>
  2065. </dl>
  2066. </dd>
  2067. <dt><samp class="option">vdpau</samp></dt>
  2068. <dd><p><var class="var">device</var> is an X11 display name.
  2069. If not specified, it will attempt to open the default X11 display (<em class="emph">$DISPLAY</em>).
  2070. </p>
  2071. </dd>
  2072. <dt><samp class="option">qsv</samp></dt>
  2073. <dd><p><var class="var">device</var> selects a value in &lsquo;<samp class="samp">MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  2074. </p><dl class="table">
  2075. <dt><samp class="option">auto</samp></dt>
  2076. <dt><samp class="option">sw</samp></dt>
  2077. <dt><samp class="option">hw</samp></dt>
  2078. <dt><samp class="option">auto_any</samp></dt>
  2079. <dt><samp class="option">hw_any</samp></dt>
  2080. <dt><samp class="option">hw2</samp></dt>
  2081. <dt><samp class="option">hw3</samp></dt>
  2082. <dt><samp class="option">hw4</samp></dt>
  2083. </dl>
  2084. <p>If not specified, &lsquo;<samp class="samp">auto_any</samp>&rsquo; is used.
  2085. (Note that it may be easier to achieve the desired result for QSV by creating the
  2086. platform-appropriate subdevice (&lsquo;<samp class="samp">dxva2</samp>&rsquo; or &lsquo;<samp class="samp">d3d11va</samp>&rsquo; or &lsquo;<samp class="samp">vaapi</samp>&rsquo;) and then deriving a
  2087. QSV device from that.)
  2088. </p>
  2089. <p>The following options are recognized:
  2090. </p><dl class="table">
  2091. <dt><samp class="option">child_device</samp></dt>
  2092. <dd><p>Specify a DRM render node on Linux or DirectX adapter on Windows.
  2093. </p></dd>
  2094. <dt><samp class="option">child_device_type</samp></dt>
  2095. <dd><p>Choose platform-appropriate subdevice type. On Windows &lsquo;<samp class="samp">d3d11va</samp>&rsquo; is used
  2096. as default subdevice type when <code class="code">--enable-libvpl</code> is specified at configuration time,
  2097. &lsquo;<samp class="samp">dxva2</samp>&rsquo; is used as default subdevice type when <code class="code">--enable-libmfx</code> is specified at
  2098. configuration time. On Linux user can use &lsquo;<samp class="samp">vaapi</samp>&rsquo; only as subdevice type.
  2099. </p></dd>
  2100. </dl>
  2101. <p>Examples:
  2102. </p><dl class="table">
  2103. <dt><em class="emph">-init_hw_device qsv:hw,child_device=/dev/dri/renderD129</em></dt>
  2104. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DRM render node <samp class="file">/dev/dri/renderD129</samp>.
  2105. </p>
  2106. </dd>
  2107. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1</em></dt>
  2108. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DirectX adapter 1.
  2109. </p>
  2110. </dd>
  2111. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=d3d11va</em></dt>
  2112. <dd><p>Choose the GPU subdevice with type &lsquo;<samp class="samp">d3d11va</samp>&rsquo; and create QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo;.
  2113. </p>
  2114. </dd>
  2115. <dt><em class="emph">-init_hw_device qsv:hw,child_device_type=dxva2</em></dt>
  2116. <dd><p>Choose the GPU subdevice with type &lsquo;<samp class="samp">dxva2</samp>&rsquo; and create QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo;.
  2117. </p>
  2118. </dd>
  2119. <dt><em class="emph">-init_hw_device qsv:hw,child_device=1,child_device_type=d3d11va</em></dt>
  2120. <dd><p>Create a QSV device with &lsquo;<samp class="samp">MFX_IMPL_HARDWARE</samp>&rsquo; on DirectX adapter 1 with subdevice type &lsquo;<samp class="samp">d3d11va</samp>&rsquo;.
  2121. </p>
  2122. </dd>
  2123. <dt><em class="emph">-init_hw_device vaapi=va:/dev/dri/renderD129 -init_hw_device qsv=hw1@<var class="var">va</var></em></dt>
  2124. <dd><p>Create a VAAPI device called &lsquo;<samp class="samp">va</samp>&rsquo; on <samp class="file">/dev/dri/renderD129</samp>, then derive a QSV device called &lsquo;<samp class="samp">hw1</samp>&rsquo;
  2125. from device &lsquo;<samp class="samp">va</samp>&rsquo;.
  2126. </p>
  2127. </dd>
  2128. </dl>
  2129. </dd>
  2130. <dt><samp class="option">opencl</samp></dt>
  2131. <dd><p><var class="var">device</var> selects the platform and device as <em class="emph">platform_index.device_index</em>.
  2132. </p>
  2133. <p>The set of devices can also be filtered using the key-value pairs to find only
  2134. devices matching particular platform or device strings.
  2135. </p>
  2136. <p>The strings usable as filters are:
  2137. </p><dl class="table">
  2138. <dt><samp class="option">platform_profile</samp></dt>
  2139. <dt><samp class="option">platform_version</samp></dt>
  2140. <dt><samp class="option">platform_name</samp></dt>
  2141. <dt><samp class="option">platform_vendor</samp></dt>
  2142. <dt><samp class="option">platform_extensions</samp></dt>
  2143. <dt><samp class="option">device_name</samp></dt>
  2144. <dt><samp class="option">device_vendor</samp></dt>
  2145. <dt><samp class="option">driver_version</samp></dt>
  2146. <dt><samp class="option">device_version</samp></dt>
  2147. <dt><samp class="option">device_profile</samp></dt>
  2148. <dt><samp class="option">device_extensions</samp></dt>
  2149. <dt><samp class="option">device_type</samp></dt>
  2150. </dl>
  2151. <p>The indices and filters must together uniquely select a device.
  2152. </p>
  2153. <p>Examples:
  2154. </p><dl class="table">
  2155. <dt><em class="emph">-init_hw_device opencl:0.1</em></dt>
  2156. <dd><p>Choose the second device on the first platform.
  2157. </p>
  2158. </dd>
  2159. <dt><em class="emph">-init_hw_device opencl:,device_name=Foo9000</em></dt>
  2160. <dd><p>Choose the device with a name containing the string <em class="emph">Foo9000</em>.
  2161. </p>
  2162. </dd>
  2163. <dt><em class="emph">-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  2164. <dd><p>Choose the GPU device on the second platform supporting the <em class="emph">cl_khr_fp16</em>
  2165. extension.
  2166. </p></dd>
  2167. </dl>
  2168. </dd>
  2169. <dt><samp class="option">vulkan</samp></dt>
  2170. <dd><p>If <var class="var">device</var> is an integer, it selects the device by its index in a
  2171. system-dependent list of devices. If <var class="var">device</var> is any other string, it
  2172. selects the first device with a name containing that string as a substring.
  2173. </p>
  2174. <p>The following options are recognized:
  2175. </p><dl class="table">
  2176. <dt><samp class="option">debug</samp></dt>
  2177. <dd><p>If set to 1, enables the validation layer, if installed.
  2178. </p></dd>
  2179. <dt><samp class="option">linear_images</samp></dt>
  2180. <dd><p>If set to 1, images allocated by the hwcontext will be linear and locally mappable.
  2181. </p></dd>
  2182. <dt><samp class="option">instance_extensions</samp></dt>
  2183. <dd><p>A plus separated list of additional instance extensions to enable.
  2184. </p></dd>
  2185. <dt><samp class="option">device_extensions</samp></dt>
  2186. <dd><p>A plus separated list of additional device extensions to enable.
  2187. </p></dd>
  2188. </dl>
  2189. <p>Examples:
  2190. </p><dl class="table">
  2191. <dt><em class="emph">-init_hw_device vulkan:1</em></dt>
  2192. <dd><p>Choose the second device on the system.
  2193. </p>
  2194. </dd>
  2195. <dt><em class="emph">-init_hw_device vulkan:RADV</em></dt>
  2196. <dd><p>Choose the first device with a name containing the string <em class="emph">RADV</em>.
  2197. </p>
  2198. </dd>
  2199. <dt><em class="emph">-init_hw_device vulkan:0,instance_extensions=VK_KHR_wayland_surface+VK_KHR_xcb_surface</em></dt>
  2200. <dd><p>Choose the first device and enable the Wayland and XCB instance extensions.
  2201. </p></dd>
  2202. </dl>
  2203. </dd>
  2204. </dl>
  2205. </dd>
  2206. <dt><samp class="option">-init_hw_device <var class="var">type</var>[=<var class="var">name</var>]@<var class="var">source</var></samp></dt>
  2207. <dd><p>Initialise a new hardware device of type <var class="var">type</var> called <var class="var">name</var>,
  2208. deriving it from the existing device with the name <var class="var">source</var>.
  2209. </p>
  2210. </dd>
  2211. <dt><samp class="option">-init_hw_device list</samp></dt>
  2212. <dd><p>List all hardware device types supported in this build of ffmpeg.
  2213. </p>
  2214. </dd>
  2215. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  2216. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  2217. This can be used to set the device to upload to with the <code class="code">hwupload</code> filter,
  2218. or the device to map to with the <code class="code">hwmap</code> filter. Other filters may also
  2219. make use of this parameter when they require a hardware device. Note that this
  2220. is typically only required when the input is not already in hardware frames -
  2221. when it is, filters will derive the device they require from the context of the
  2222. frames they receive as input.
  2223. </p>
  2224. <p>This is a global setting, so all filters will receive the same device.
  2225. </p>
  2226. </dd>
  2227. <dt><samp class="option">-hwaccel[:<var class="var">stream_specifier</var>] <var class="var">hwaccel</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  2228. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  2229. of <var class="var">hwaccel</var> are:
  2230. </p><dl class="table">
  2231. <dt><samp class="option">none</samp></dt>
  2232. <dd><p>Do not use any hardware acceleration (the default).
  2233. </p>
  2234. </dd>
  2235. <dt><samp class="option">auto</samp></dt>
  2236. <dd><p>Automatically select the hardware acceleration method.
  2237. </p>
  2238. </dd>
  2239. <dt><samp class="option">vdpau</samp></dt>
  2240. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  2241. </p>
  2242. </dd>
  2243. <dt><samp class="option">dxva2</samp></dt>
  2244. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  2245. </p>
  2246. </dd>
  2247. <dt><samp class="option">d3d11va</samp></dt>
  2248. <dd><p>Use D3D11VA (DirectX Video Acceleration) hardware acceleration.
  2249. </p>
  2250. </dd>
  2251. <dt><samp class="option">vaapi</samp></dt>
  2252. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  2253. </p>
  2254. </dd>
  2255. <dt><samp class="option">qsv</samp></dt>
  2256. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  2257. </p>
  2258. <p>Unlike most other values, this option does not enable accelerated decoding (that
  2259. is used automatically whenever a qsv decoder is selected), but accelerated
  2260. transcoding, without copying the frames into the system memory.
  2261. </p>
  2262. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  2263. and no filters must be used.
  2264. </p></dd>
  2265. </dl>
  2266. <p>This option has no effect if the selected hwaccel is not available or not
  2267. supported by the chosen decoder.
  2268. </p>
  2269. <p>Note that most acceleration methods are intended for playback and will not be
  2270. faster than software decoding on modern CPUs. Additionally, <code class="command">ffmpeg</code>
  2271. will usually need to copy the decoded frames from the GPU memory into the system
  2272. memory, resulting in further performance loss. This option is thus mainly
  2273. useful for testing.
  2274. </p>
  2275. </dd>
  2276. <dt><samp class="option">-hwaccel_device[:<var class="var">stream_specifier</var>] <var class="var">hwaccel_device</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  2277. <dd><p>Select a device to use for hardware acceleration.
  2278. </p>
  2279. <p>This option only makes sense when the <samp class="option">-hwaccel</samp> option is also specified.
  2280. It can either refer to an existing device created with <samp class="option">-init_hw_device</samp>
  2281. by name, or it can create a new device as if
  2282. &lsquo;<samp class="samp">-init_hw_device</samp>&rsquo; <var class="var">type</var>:<var class="var">hwaccel_device</var>
  2283. were called immediately before.
  2284. </p>
  2285. </dd>
  2286. <dt><samp class="option">-hwaccels</samp></dt>
  2287. <dd><p>List all hardware acceleration components enabled in this build of ffmpeg.
  2288. Actual runtime availability depends on the hardware and its suitable driver
  2289. being installed.
  2290. </p>
  2291. </dd>
  2292. <dt><samp class="option">-fix_sub_duration_heartbeat[:<var class="var">stream_specifier</var>]</samp></dt>
  2293. <dd><p>Set a specific output video stream as the heartbeat stream according to which
  2294. to split and push through currently in-progress subtitle upon receipt of a
  2295. random access packet.
  2296. </p>
  2297. <p>This lowers the latency of subtitles for which the end packet or the following
  2298. subtitle has not yet been received. As a drawback, this will most likely lead
  2299. to duplication of subtitle events in order to cover the full duration, so
  2300. when dealing with use cases where latency of when the subtitle event is passed
  2301. on to output is not relevant this option should not be utilized.
  2302. </p>
  2303. <p>Requires <samp class="option">-fix_sub_duration</samp> to be set for the relevant input subtitle
  2304. stream for this to have any effect, as well as for the input subtitle stream
  2305. having to be directly mapped to the same output in which the heartbeat stream
  2306. resides.
  2307. </p>
  2308. </dd>
  2309. </dl>
  2310. </div>
  2311. <div class="section-level-extent" id="Audio-Options">
  2312. <h3 class="section"><span>5.7 Audio Options<a class="copiable-link" href="#Audio-Options"> &para;</a></span></h3>
  2313. <dl class="table">
  2314. <dt><samp class="option">-aframes <var class="var">number</var> (<em class="emph">output</em>)</samp></dt>
  2315. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  2316. <code class="code">-frames:a</code>, which you should use instead.
  2317. </p></dd>
  2318. <dt><samp class="option">-ar[:<var class="var">stream_specifier</var>] <var class="var">freq</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  2319. <dd><p>Set the audio sampling frequency. For output streams it is set by
  2320. default to the frequency of the corresponding input stream. For input
  2321. streams this option only makes sense for audio grabbing devices and raw
  2322. demuxers and is mapped to the corresponding demuxer options.
  2323. </p></dd>
  2324. <dt><samp class="option">-aq <var class="var">q</var> (<em class="emph">output</em>)</samp></dt>
  2325. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  2326. </p></dd>
  2327. <dt><samp class="option">-ac[:<var class="var">stream_specifier</var>] <var class="var">channels</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  2328. <dd><p>Set the number of audio channels. For output streams it is set by
  2329. default to the number of input audio channels. For input streams
  2330. this option only makes sense for audio grabbing devices and raw demuxers
  2331. and is mapped to the corresponding demuxer options.
  2332. </p></dd>
  2333. <dt><samp class="option">-an (<em class="emph">input/output</em>)</samp></dt>
  2334. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  2335. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  2336. option to disable streams individually.
  2337. </p>
  2338. <p>As an output option, disables audio recording i.e. automatic selection or
  2339. mapping of any audio stream. For full manual control see the <code class="code">-map</code>
  2340. option.
  2341. </p></dd>
  2342. <dt><samp class="option">-acodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  2343. <dd><p>Set the audio codec. This is an alias for <code class="code">-codec:a</code>.
  2344. </p></dd>
  2345. <dt><samp class="option">-sample_fmt[:<var class="var">stream_specifier</var>] <var class="var">sample_fmt</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  2346. <dd><p>Set the audio sample format. Use <code class="code">-sample_fmts</code> to get a list
  2347. of supported sample formats.
  2348. </p>
  2349. </dd>
  2350. <dt><samp class="option">-af <var class="var">filtergraph</var> (<em class="emph">output</em>)</samp></dt>
  2351. <dd><p>Create the filtergraph specified by <var class="var">filtergraph</var> and use it to
  2352. filter the stream.
  2353. </p>
  2354. <p>This is an alias for <code class="code">-filter:a</code>, see the <a class="ref" href="#filter_005foption">-filter option</a>.
  2355. </p></dd>
  2356. </dl>
  2357. </div>
  2358. <div class="section-level-extent" id="Advanced-Audio-options">
  2359. <h3 class="section"><span>5.8 Advanced Audio options<a class="copiable-link" href="#Advanced-Audio-options"> &para;</a></span></h3>
  2360. <dl class="table">
  2361. <dt><samp class="option">-atag <var class="var">fourcc/tag</var> (<em class="emph">output</em>)</samp></dt>
  2362. <dd><p>Force audio tag/fourcc. This is an alias for <code class="code">-tag:a</code>.
  2363. </p></dd>
  2364. <dt><samp class="option">-guess_layout_max <var class="var">channels</var> (<em class="emph">input,per-stream</em>)</samp></dt>
  2365. <dd><p>If some input channel layout is not known, try to guess only if it
  2366. corresponds to at most the specified number of channels. For example, 2
  2367. tells to <code class="command">ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  2368. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  2369. 0 to disable all guessing.
  2370. </p></dd>
  2371. </dl>
  2372. </div>
  2373. <div class="section-level-extent" id="Subtitle-options">
  2374. <h3 class="section"><span>5.9 Subtitle options<a class="copiable-link" href="#Subtitle-options"> &para;</a></span></h3>
  2375. <dl class="table">
  2376. <dt><samp class="option">-scodec <var class="var">codec</var> (<em class="emph">input/output</em>)</samp></dt>
  2377. <dd><p>Set the subtitle codec. This is an alias for <code class="code">-codec:s</code>.
  2378. </p></dd>
  2379. <dt><samp class="option">-sn (<em class="emph">input/output</em>)</samp></dt>
  2380. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  2381. being automatically selected or mapped for any output. See <code class="code">-discard</code>
  2382. option to disable streams individually.
  2383. </p>
  2384. <p>As an output option, disables subtitle recording i.e. automatic selection or
  2385. mapping of any subtitle stream. For full manual control see the <code class="code">-map</code>
  2386. option.
  2387. </p></dd>
  2388. </dl>
  2389. </div>
  2390. <div class="section-level-extent" id="Advanced-Subtitle-options">
  2391. <h3 class="section"><span>5.10 Advanced Subtitle options<a class="copiable-link" href="#Advanced-Subtitle-options"> &para;</a></span></h3>
  2392. <dl class="table">
  2393. <dt><samp class="option">-fix_sub_duration</samp></dt>
  2394. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  2395. same stream and adjust the duration of the first to avoid overlap. This is
  2396. necessary with some subtitles codecs, especially DVB subtitles, because the
  2397. duration in the original packet is only a rough estimate and the end is
  2398. actually marked by an empty subtitle frame. Failing to use this option when
  2399. necessary can result in exaggerated durations or muxing failures due to
  2400. non-monotonic timestamps.
  2401. </p>
  2402. <p>Note that this option will delay the output of all data until the next
  2403. subtitle packet is decoded: it may increase memory consumption and latency a
  2404. lot.
  2405. </p>
  2406. </dd>
  2407. <dt><samp class="option">-canvas_size <var class="var">size</var></samp></dt>
  2408. <dd><p>Set the size of the canvas used to render subtitles.
  2409. </p>
  2410. </dd>
  2411. </dl>
  2412. </div>
  2413. <div class="section-level-extent" id="Advanced-options">
  2414. <h3 class="section"><span>5.11 Advanced options<a class="copiable-link" href="#Advanced-options"> &para;</a></span></h3>
  2415. <dl class="table">
  2416. <dt><samp class="option">-map [-]<var class="var">input_file_id</var>[:<var class="var">stream_specifier</var>][?] | <var class="var">[linklabel]</var> (<em class="emph">output</em>)</samp></dt>
  2417. <dd>
  2418. <p>Create one or more streams in the output file. This option has two forms for
  2419. specifying the data source(s): the first selects one or more streams from some
  2420. input file (specified with <code class="code">-i</code>), the second takes an output from some
  2421. complex filtergraph (specified with <code class="code">-filter_complex</code>).
  2422. </p>
  2423. <p>In the first form, an output stream is created for every stream from the input
  2424. file with the index <var class="var">input_file_id</var>. If <var class="var">stream_specifier</var> is given,
  2425. only those streams that match the specifier are used (see the
  2426. <a class="ref" href="#Stream-specifiers">Stream specifiers</a> section for the <var class="var">stream_specifier</var> syntax).
  2427. </p>
  2428. <p>A <code class="code">-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  2429. It disables matching streams from already created mappings.
  2430. </p>
  2431. <p>A trailing <code class="code">?</code> after the stream index will allow the map to be
  2432. optional: if the map matches no streams the map will be ignored instead
  2433. of failing. Note the map will still fail if an invalid input file index
  2434. is used; such as if the map refers to a non-existent input.
  2435. </p>
  2436. <p>An alternative <var class="var">[linklabel]</var> form will map outputs from complex filter
  2437. graphs (see the <samp class="option">-filter_complex</samp> option) to the output file.
  2438. <var class="var">linklabel</var> must correspond to a defined output link label in the graph.
  2439. </p>
  2440. <p>This option may be specified multiple times, each adding more streams to the
  2441. output file. Any given input stream may also be mapped any number of times as a
  2442. source for different output streams, e.g. in order to use different encoding
  2443. options and/or filters. The streams are created in the output in the same order
  2444. in which the <code class="code">-map</code> options are given on the commandline.
  2445. </p>
  2446. <p>Using this option disables the default mappings for this output file.
  2447. </p>
  2448. <p>Examples:
  2449. </p>
  2450. <dl class="table">
  2451. <dt><em class="emph">map everything</em></dt>
  2452. <dd><p>To map ALL streams from the first input file to output
  2453. </p><div class="example">
  2454. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 output
  2455. </pre></div>
  2456. </dd>
  2457. <dt><em class="emph">select specific stream</em></dt>
  2458. <dd><p>If you have two audio streams in the first input file, these streams are
  2459. identified by <var class="var">0:0</var> and <var class="var">0:1</var>. You can use <code class="code">-map</code> to select which
  2460. streams to place in an output file. For example:
  2461. </p><div class="example">
  2462. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:1 out.wav
  2463. </pre></div>
  2464. <p>will map the second input stream in <samp class="file">INPUT</samp> to the (single) output stream
  2465. in <samp class="file">out.wav</samp>.
  2466. </p>
  2467. </dd>
  2468. <dt><em class="emph">create multiple streams</em></dt>
  2469. <dd><p>To select the stream with index 2 from input file <samp class="file">a.mov</samp> (specified by the
  2470. identifier <var class="var">0:2</var>), and stream with index 6 from input <samp class="file">b.mov</samp>
  2471. (specified by the identifier <var class="var">1:6</var>), and copy them to the output file
  2472. <samp class="file">out.mov</samp>:
  2473. </p><div class="example">
  2474. <pre class="example-preformatted">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  2475. </pre></div>
  2476. </dd>
  2477. <dt><em class="emph">create multiple streams 2</em></dt>
  2478. <dd><p>To select all video and the third audio stream from an input file:
  2479. </p><div class="example">
  2480. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  2481. </pre></div>
  2482. </dd>
  2483. <dt><em class="emph">negative map</em></dt>
  2484. <dd><p>To map all the streams except the second audio, use negative mappings
  2485. </p><div class="example">
  2486. <pre class="example-preformatted">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  2487. </pre></div>
  2488. </dd>
  2489. <dt><em class="emph">optional map</em></dt>
  2490. <dd><p>To map the video and audio streams from the first input, and using the
  2491. trailing <code class="code">?</code>, ignore the audio mapping if no audio streams exist in
  2492. the first input:
  2493. </p><div class="example">
  2494. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  2495. </pre></div>
  2496. </dd>
  2497. <dt><em class="emph">map by language</em></dt>
  2498. <dd><p>To pick the English audio stream:
  2499. </p><div class="example">
  2500. <pre class="example-preformatted">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  2501. </pre></div>
  2502. </dd>
  2503. </dl>
  2504. </dd>
  2505. <dt><samp class="option">-ignore_unknown</samp></dt>
  2506. <dd><p>Ignore input streams with unknown type instead of failing if copying
  2507. such streams is attempted.
  2508. </p>
  2509. </dd>
  2510. <dt><samp class="option">-copy_unknown</samp></dt>
  2511. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  2512. such streams is attempted.
  2513. </p>
  2514. </dd>
  2515. <dt><samp class="option">-map_metadata[:<var class="var">metadata_spec_out</var>] <var class="var">infile</var>[:<var class="var">metadata_spec_in</var>] (<em class="emph">output,per-metadata</em>)</samp></dt>
  2516. <dd><p>Set metadata information of the next output file from <var class="var">infile</var>. Note that
  2517. those are file indices (zero-based), not filenames.
  2518. Optional <var class="var">metadata_spec_in/out</var> parameters specify, which metadata to copy.
  2519. A metadata specifier can have the following forms:
  2520. </p><dl class="table">
  2521. <dt><samp class="option"><var class="var">g</var></samp></dt>
  2522. <dd><p>global metadata, i.e. metadata that applies to the whole file
  2523. </p>
  2524. </dd>
  2525. <dt><samp class="option"><var class="var">s</var>[:<var class="var">stream_spec</var>]</samp></dt>
  2526. <dd><p>per-stream metadata. <var class="var">stream_spec</var> is a stream specifier as described
  2527. in the <a class="ref" href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  2528. matching stream is copied from. In an output metadata specifier, all matching
  2529. streams are copied to.
  2530. </p>
  2531. </dd>
  2532. <dt><samp class="option"><var class="var">c</var>:<var class="var">chapter_index</var></samp></dt>
  2533. <dd><p>per-chapter metadata. <var class="var">chapter_index</var> is the zero-based chapter index.
  2534. </p>
  2535. </dd>
  2536. <dt><samp class="option"><var class="var">p</var>:<var class="var">program_index</var></samp></dt>
  2537. <dd><p>per-program metadata. <var class="var">program_index</var> is the zero-based program index.
  2538. </p></dd>
  2539. </dl>
  2540. <p>If metadata specifier is omitted, it defaults to global.
  2541. </p>
  2542. <p>By default, global metadata is copied from the first input file,
  2543. per-stream and per-chapter metadata is copied along with streams/chapters. These
  2544. default mappings are disabled by creating any mapping of the relevant type. A negative
  2545. file index can be used to create a dummy mapping that just disables automatic copying.
  2546. </p>
  2547. <p>For example to copy metadata from the first stream of the input file to global metadata
  2548. of the output file:
  2549. </p><div class="example">
  2550. <pre class="example-preformatted">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  2551. </pre></div>
  2552. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  2553. </p><div class="example">
  2554. <pre class="example-preformatted">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  2555. </pre></div>
  2556. <p>Note that simple <code class="code">0</code> would work as well in this example, since global
  2557. metadata is assumed by default.
  2558. </p>
  2559. </dd>
  2560. <dt><samp class="option">-map_chapters <var class="var">input_file_index</var> (<em class="emph">output</em>)</samp></dt>
  2561. <dd><p>Copy chapters from input file with index <var class="var">input_file_index</var> to the next
  2562. output file. If no chapter mapping is specified, then chapters are copied from
  2563. the first input file with at least one chapter. Use a negative file index to
  2564. disable any chapter copying.
  2565. </p>
  2566. </dd>
  2567. <dt><samp class="option">-benchmark (<em class="emph">global</em>)</samp></dt>
  2568. <dd><p>Show benchmarking information at the end of an encode.
  2569. Shows real, system and user time used and maximum memory consumption.
  2570. Maximum memory consumption is not supported on all systems,
  2571. it will usually display as 0 if not supported.
  2572. </p></dd>
  2573. <dt><samp class="option">-benchmark_all (<em class="emph">global</em>)</samp></dt>
  2574. <dd><p>Show benchmarking information during the encode.
  2575. Shows real, system and user time used in various steps (audio/video encode/decode).
  2576. </p></dd>
  2577. <dt><samp class="option">-timelimit <var class="var">duration</var> (<em class="emph">global</em>)</samp></dt>
  2578. <dd><p>Exit after ffmpeg has been running for <var class="var">duration</var> seconds in CPU user time.
  2579. </p></dd>
  2580. <dt><samp class="option">-dump (<em class="emph">global</em>)</samp></dt>
  2581. <dd><p>Dump each input packet to stderr.
  2582. </p></dd>
  2583. <dt><samp class="option">-hex (<em class="emph">global</em>)</samp></dt>
  2584. <dd><p>When dumping packets, also dump the payload.
  2585. </p></dd>
  2586. <dt><samp class="option">-readrate <var class="var">speed</var> (<em class="emph">input</em>)</samp></dt>
  2587. <dd><p>Limit input read speed.
  2588. </p>
  2589. <p>Its value is a floating-point positive number which represents the maximum duration of
  2590. media, in seconds, that should be ingested in one second of wallclock time.
  2591. Default value is zero and represents no imposed limitation on speed of ingestion.
  2592. Value <code class="code">1</code> represents real-time speed and is equivalent to <code class="code">-re</code>.
  2593. </p>
  2594. <p>Mainly used to simulate a capture device or live input stream (e.g. when reading from a file).
  2595. Should not be used with a low value when input is an actual capture device or live stream as
  2596. it may cause packet loss.
  2597. </p>
  2598. <p>It is useful for when flow speed of output packets is important, such as live streaming.
  2599. </p></dd>
  2600. <dt><samp class="option">-re (<em class="emph">input</em>)</samp></dt>
  2601. <dd><p>Read input at native frame rate. This is equivalent to setting <code class="code">-readrate 1</code>.
  2602. </p></dd>
  2603. <dt><samp class="option">-readrate_initial_burst <var class="var">seconds</var></samp></dt>
  2604. <dd><p>Set an initial read burst time, in seconds, after which <samp class="option">-re/-readrate</samp>
  2605. will be enforced.
  2606. </p></dd>
  2607. <dt><samp class="option">-vsync <var class="var">parameter</var> (<em class="emph">global</em>)</samp></dt>
  2608. <dt><samp class="option">-fps_mode[:<var class="var">stream_specifier</var>] <var class="var">parameter</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  2609. <dd><p>Set video sync method / framerate mode. vsync is applied to all output video streams
  2610. but can be overridden for a stream by setting fps_mode. vsync is deprecated and will be
  2611. removed in the future.
  2612. </p>
  2613. <p>For compatibility reasons some of the values for vsync can be specified as numbers (shown
  2614. in parentheses in the following table).
  2615. </p>
  2616. <dl class="table">
  2617. <dt><samp class="option">passthrough (0)</samp></dt>
  2618. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  2619. </p></dd>
  2620. <dt><samp class="option">cfr (1)</samp></dt>
  2621. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  2622. constant frame rate.
  2623. </p></dd>
  2624. <dt><samp class="option">vfr (2)</samp></dt>
  2625. <dd><p>Frames are passed through with their timestamp or dropped so as to
  2626. prevent 2 frames from having the same timestamp.
  2627. </p></dd>
  2628. <dt><samp class="option">auto (-1)</samp></dt>
  2629. <dd><p>Chooses between cfr and vfr depending on muxer capabilities. This is the
  2630. default method.
  2631. </p></dd>
  2632. </dl>
  2633. <p>Note that the timestamps may be further modified by the muxer, after this.
  2634. For example, in the case that the format option <samp class="option">avoid_negative_ts</samp>
  2635. is enabled.
  2636. </p>
  2637. <p>With -map you can select from which stream the timestamps should be
  2638. taken. You can leave either video or audio unchanged and sync the
  2639. remaining stream(s) to the unchanged one.
  2640. </p>
  2641. </dd>
  2642. <dt><samp class="option">-frame_drop_threshold <var class="var">parameter</var></samp></dt>
  2643. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  2644. be before they are dropped. In frame rate units, so 1.0 is one frame.
  2645. The default is -1.1. One possible usecase is to avoid framedrops in case
  2646. of noisy timestamps or to increase frame drop precision in case of exact
  2647. timestamps.
  2648. </p>
  2649. </dd>
  2650. <dt><samp class="option">-apad <var class="var">parameters</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  2651. <dd><p>Pad the output audio stream(s). This is the same as applying <code class="code">-af apad</code>.
  2652. Argument is a string of filter parameters composed the same as with the <code class="code">apad</code> filter.
  2653. <code class="code">-shortest</code> must be set for this output for the option to take effect.
  2654. </p>
  2655. </dd>
  2656. <dt><samp class="option">-copyts</samp></dt>
  2657. <dd><p>Do not process input timestamps, but keep their values without trying
  2658. to sanitize them. In particular, do not remove the initial start time
  2659. offset value.
  2660. </p>
  2661. <p>Note that, depending on the <samp class="option">vsync</samp> option or on specific muxer
  2662. processing (e.g. in case the format option <samp class="option">avoid_negative_ts</samp>
  2663. is enabled) the output timestamps may mismatch with the input
  2664. timestamps even when this option is selected.
  2665. </p>
  2666. </dd>
  2667. <dt><samp class="option">-start_at_zero</samp></dt>
  2668. <dd><p>When used with <samp class="option">copyts</samp>, shift input timestamps so they start at zero.
  2669. </p>
  2670. <p>This means that using e.g. <code class="code">-ss 50</code> will make output timestamps start at
  2671. 50 seconds, regardless of what timestamp the input file started at.
  2672. </p>
  2673. </dd>
  2674. <dt><samp class="option">-copytb <var class="var">mode</var></samp></dt>
  2675. <dd><p>Specify how to set the encoder timebase when stream copying. <var class="var">mode</var> is an
  2676. integer numeric value, and can assume one of the following values:
  2677. </p>
  2678. <dl class="table">
  2679. <dt><samp class="option">1</samp></dt>
  2680. <dd><p>Use the demuxer timebase.
  2681. </p>
  2682. <p>The time base is copied to the output encoder from the corresponding input
  2683. demuxer. This is sometimes required to avoid non monotonically increasing
  2684. timestamps when copying video streams with variable frame rate.
  2685. </p>
  2686. </dd>
  2687. <dt><samp class="option">0</samp></dt>
  2688. <dd><p>Use the decoder timebase.
  2689. </p>
  2690. <p>The time base is copied to the output encoder from the corresponding input
  2691. decoder.
  2692. </p>
  2693. </dd>
  2694. <dt><samp class="option">-1</samp></dt>
  2695. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  2696. </p></dd>
  2697. </dl>
  2698. <p>Default value is -1.
  2699. </p>
  2700. </dd>
  2701. <dt><samp class="option">-enc_time_base[:<var class="var">stream_specifier</var>] <var class="var">timebase</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  2702. <dd><p>Set the encoder timebase. <var class="var">timebase</var> can assume one of the following values:
  2703. </p>
  2704. <dl class="table">
  2705. <dt><samp class="option">0</samp></dt>
  2706. <dd><p>Assign a default value according to the media type.
  2707. </p>
  2708. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  2709. </p>
  2710. </dd>
  2711. <dt><samp class="option">demux</samp></dt>
  2712. <dd><p>Use the timebase from the demuxer.
  2713. </p>
  2714. </dd>
  2715. <dt><samp class="option">filter</samp></dt>
  2716. <dd><p>Use the timebase from the filtergraph.
  2717. </p>
  2718. </dd>
  2719. <dt><samp class="option">a positive number</samp></dt>
  2720. <dd><p>Use the provided number as the timebase.
  2721. </p>
  2722. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  2723. or as a decimal number (e.g. 0.04166, 2.0833e-5)
  2724. </p></dd>
  2725. </dl>
  2726. <p>Default value is 0.
  2727. </p>
  2728. </dd>
  2729. <dt><samp class="option">-bitexact (<em class="emph">input/output</em>)</samp></dt>
  2730. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  2731. </p></dd>
  2732. <dt><samp class="option">-shortest (<em class="emph">output</em>)</samp></dt>
  2733. <dd><p>Finish encoding when the shortest output stream ends.
  2734. </p>
  2735. <p>Note that this option may require buffering frames, which introduces extra
  2736. latency. The maximum amount of this latency may be controlled with the
  2737. <code class="code">-shortest_buf_duration</code> option.
  2738. </p>
  2739. </dd>
  2740. <dt><samp class="option">-shortest_buf_duration <var class="var">duration</var> (<em class="emph">output</em>)</samp></dt>
  2741. <dd><p>The <code class="code">-shortest</code> option may require buffering potentially large amounts
  2742. of data when at least one of the streams is &quot;sparse&quot; (i.e. has large gaps
  2743. between frames – this is typically the case for subtitles).
  2744. </p>
  2745. <p>This option controls the maximum duration of buffered frames in seconds.
  2746. Larger values may allow the <code class="code">-shortest</code> option to produce more accurate
  2747. results, but increase memory use and latency.
  2748. </p>
  2749. <p>The default value is 10 seconds.
  2750. </p>
  2751. </dd>
  2752. <dt><samp class="option">-dts_delta_threshold <var class="var">threshold</var></samp></dt>
  2753. <dd><p>Timestamp discontinuity delta threshold, expressed as a decimal number
  2754. of seconds.
  2755. </p>
  2756. <p>The timestamp discontinuity correction enabled by this option is only
  2757. applied to input formats accepting timestamp discontinuity (for which
  2758. the <code class="code">AVFMT_TS_DISCONT</code> flag is enabled), e.g. MPEG-TS and HLS, and
  2759. is automatically disabled when employing the <code class="code">-copyts</code> option
  2760. (unless wrapping is detected).
  2761. </p>
  2762. <p>If a timestamp discontinuity is detected whose absolute value is
  2763. greater than <var class="var">threshold</var>, ffmpeg will remove the discontinuity by
  2764. decreasing/increasing the current DTS and PTS by the corresponding
  2765. delta value.
  2766. </p>
  2767. <p>The default value is 10.
  2768. </p>
  2769. </dd>
  2770. <dt><samp class="option">-dts_error_threshold <var class="var">threshold</var></samp></dt>
  2771. <dd><p>Timestamp error delta threshold, expressed as a decimal number of
  2772. seconds.
  2773. </p>
  2774. <p>The timestamp correction enabled by this option is only applied to
  2775. input formats not accepting timestamp discontinuity (for which the
  2776. <code class="code">AVFMT_TS_DISCONT</code> flag is not enabled).
  2777. </p>
  2778. <p>If a timestamp discontinuity is detected whose absolute value is
  2779. greater than <var class="var">threshold</var>, ffmpeg will drop the PTS/DTS timestamp
  2780. value.
  2781. </p>
  2782. <p>The default value is <code class="code">3600*30</code> (30 hours), which is arbitrarily
  2783. picked and quite conservative.
  2784. </p>
  2785. </dd>
  2786. <dt><samp class="option">-muxdelay <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  2787. <dd><p>Set the maximum demux-decode delay.
  2788. </p></dd>
  2789. <dt><samp class="option">-muxpreload <var class="var">seconds</var> (<em class="emph">output</em>)</samp></dt>
  2790. <dd><p>Set the initial demux-decode delay.
  2791. </p></dd>
  2792. <dt><samp class="option">-streamid <var class="var">output-stream-index</var>:<var class="var">new-value</var> (<em class="emph">output</em>)</samp></dt>
  2793. <dd><p>Assign a new stream-id value to an output stream. This option should be
  2794. specified prior to the output filename to which it applies.
  2795. For the situation where multiple output files exist, a streamid
  2796. may be reassigned to a different value.
  2797. </p>
  2798. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  2799. an output mpegts file:
  2800. </p><div class="example">
  2801. <pre class="example-preformatted">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  2802. </pre></div>
  2803. </dd>
  2804. <dt><samp class="option">-bsf[:<var class="var">stream_specifier</var>] <var class="var">bitstream_filters</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  2805. <dd><p>Apply bitstream filters to matching streams. The filters are applied to each
  2806. packet as it is received from the demuxer (when used as an input option) or
  2807. before it is sent to the muxer (when used as an output option).
  2808. </p>
  2809. <p><var class="var">bitstream_filters</var> is a comma-separated list of bitstream filter
  2810. specifications, each of the form
  2811. </p><div class="example">
  2812. <pre class="example-preformatted"><var class="var">filter</var>[=<var class="var">optname0</var>=<var class="var">optval0</var>:<var class="var">optname1</var>=<var class="var">optval1</var>:...]
  2813. </pre></div>
  2814. <p>Any of the &rsquo;,=:&rsquo; characters that are to be a part of an option value need to be
  2815. escaped with a backslash.
  2816. </p>
  2817. <p>Use the <code class="code">-bsfs</code> option to get the list of bitstream filters.
  2818. </p>
  2819. <p>E.g.
  2820. </p><div class="example">
  2821. <pre class="example-preformatted">ffmpeg -bsf:v h264_mp4toannexb -i h264.mp4 -c:v copy -an out.h264
  2822. </pre></div>
  2823. <p>applies the <code class="code">h264_mp4toannexb</code> bitstream filter (which converts
  2824. MP4-encapsulated H.264 stream to Annex B) to the <em class="emph">input</em> video stream.
  2825. </p>
  2826. <p>On the other hand,
  2827. </p><div class="example">
  2828. <pre class="example-preformatted">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  2829. </pre></div>
  2830. <p>applies the <code class="code">mov2textsub</code> bitstream filter (which extracts text from MOV
  2831. subtitles) to the <em class="emph">output</em> subtitle stream. Note, however, that since both
  2832. examples use <code class="code">-c copy</code>, it matters little whether the filters are applied
  2833. on input or output - that would change if transcoding was happening.
  2834. </p>
  2835. </dd>
  2836. <dt><samp class="option">-tag[:<var class="var">stream_specifier</var>] <var class="var">codec_tag</var> (<em class="emph">input/output,per-stream</em>)</samp></dt>
  2837. <dd><p>Force a tag/fourcc for matching streams.
  2838. </p>
  2839. </dd>
  2840. <dt><samp class="option">-timecode <var class="var">hh</var>:<var class="var">mm</var>:<var class="var">ss</var>SEP<var class="var">ff</var></samp></dt>
  2841. <dd><p>Specify Timecode for writing. <var class="var">SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  2842. (or &rsquo;.&rsquo;) for drop.
  2843. </p><div class="example">
  2844. <pre class="example-preformatted">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  2845. </pre></div>
  2846. <a class="anchor" id="filter_005fcomplex_005foption"></a></dd>
  2847. <dt><samp class="option">-filter_complex <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  2848. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  2849. outputs. For simple graphs &ndash; those with one input and one output of the same
  2850. type &ndash; see the <samp class="option">-filter</samp> options. <var class="var">filtergraph</var> is a description of
  2851. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  2852. ffmpeg-filters manual.
  2853. </p>
  2854. <p>Input link labels must refer to either input streams or loopback decoders. For
  2855. input streams, use the <code class="code">[file_index:stream_specifier]</code> syntax (i.e. the
  2856. same as <samp class="option">-map</samp> uses). If <var class="var">stream_specifier</var> matches multiple streams,
  2857. the first one will be used.
  2858. </p>
  2859. <p>For decoders, the link label must be [dec:<var class="var">dec_idx</var>], where <var class="var">dec_idx</var> is
  2860. the index of the loopback decoder to be connected to given input.
  2861. </p>
  2862. <p>An unlabeled input will be connected to the first unused input stream of the
  2863. matching type.
  2864. </p>
  2865. <p>Output link labels are referred to with <samp class="option">-map</samp>. Unlabeled outputs are
  2866. added to the first output file.
  2867. </p>
  2868. <p>Note that with this option it is possible to use only lavfi sources without
  2869. normal input files.
  2870. </p>
  2871. <p>For example, to overlay an image over video
  2872. </p><div class="example">
  2873. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  2874. '[out]' out.mkv
  2875. </pre></div>
  2876. <p>Here <code class="code">[0:v]</code> refers to the first video stream in the first input file,
  2877. which is linked to the first (main) input of the overlay filter. Similarly the
  2878. first video stream in the second input is linked to the second (overlay) input
  2879. of overlay.
  2880. </p>
  2881. <p>Assuming there is only one video stream in each input file, we can omit input
  2882. labels, so the above is equivalent to
  2883. </p><div class="example">
  2884. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  2885. '[out]' out.mkv
  2886. </pre></div>
  2887. <p>Furthermore we can omit the output label and the single output from the filter
  2888. graph will be added to the output file automatically, so we can simply write
  2889. </p><div class="example">
  2890. <pre class="example-preformatted">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  2891. </pre></div>
  2892. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  2893. will be converted into a video with the same size as the largest video in
  2894. the file, or 720x576 if no video is present. Note that this is an
  2895. experimental and temporary solution. It will be removed once libavfilter has
  2896. proper support for subtitles.
  2897. </p>
  2898. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  2899. MPEG-TS format, delaying the subtitles by 1 second:
  2900. </p><div class="example">
  2901. <pre class="example-preformatted">ffmpeg -i input.ts -filter_complex \
  2902. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  2903. -sn -map '#0x2dc' output.mkv
  2904. </pre></div>
  2905. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  2906. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  2907. </p>
  2908. <p>To generate 5 seconds of pure red video using lavfi <code class="code">color</code> source:
  2909. </p><div class="example">
  2910. <pre class="example-preformatted">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  2911. </pre></div>
  2912. </dd>
  2913. <dt><samp class="option">-filter_complex_threads <var class="var">nb_threads</var> (<em class="emph">global</em>)</samp></dt>
  2914. <dd><p>Defines how many threads are used to process a filter_complex graph.
  2915. Similar to filter_threads but used for <code class="code">-filter_complex</code> graphs only.
  2916. The default is the number of available CPUs.
  2917. </p>
  2918. </dd>
  2919. <dt><samp class="option">-lavfi <var class="var">filtergraph</var> (<em class="emph">global</em>)</samp></dt>
  2920. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  2921. outputs. Equivalent to <samp class="option">-filter_complex</samp>.
  2922. </p>
  2923. </dd>
  2924. <dt><samp class="option">-accurate_seek (<em class="emph">input</em>)</samp></dt>
  2925. <dd><p>This option enables or disables accurate seeking in input files with the
  2926. <samp class="option">-ss</samp> option. It is enabled by default, so seeking is accurate when
  2927. transcoding. Use <samp class="option">-noaccurate_seek</samp> to disable it, which may be useful
  2928. e.g. when copying some streams and transcoding the others.
  2929. </p>
  2930. </dd>
  2931. <dt><samp class="option">-seek_timestamp (<em class="emph">input</em>)</samp></dt>
  2932. <dd><p>This option enables or disables seeking by timestamp in input files with the
  2933. <samp class="option">-ss</samp> option. It is disabled by default. If enabled, the argument
  2934. to the <samp class="option">-ss</samp> option is considered an actual timestamp, and is not
  2935. offset by the start time of the file. This matters only for files which do
  2936. not start from timestamp 0, such as transport streams.
  2937. </p>
  2938. </dd>
  2939. <dt><samp class="option">-thread_queue_size <var class="var">size</var> (<em class="emph">input/output</em>)</samp></dt>
  2940. <dd><p>For input, this option sets the maximum number of queued packets when reading
  2941. from the file or device. With low latency / high rate live streams, packets may
  2942. be discarded if they are not read in a timely manner; setting this value can
  2943. force ffmpeg to use a separate input thread and read packets as soon as they
  2944. arrive. By default ffmpeg only does this if multiple inputs are specified.
  2945. </p>
  2946. <p>For output, this option specified the maximum number of packets that may be
  2947. queued to each muxing thread.
  2948. </p>
  2949. </dd>
  2950. <dt><samp class="option">-sdp_file <var class="var">file</var> (<em class="emph">global</em>)</samp></dt>
  2951. <dd><p>Print sdp information for an output stream to <var class="var">file</var>.
  2952. This allows dumping sdp information when at least one output isn&rsquo;t an
  2953. rtp stream. (Requires at least one of the output formats to be rtp).
  2954. </p>
  2955. </dd>
  2956. <dt><samp class="option">-discard (<em class="emph">input</em>)</samp></dt>
  2957. <dd><p>Allows discarding specific streams or frames from streams.
  2958. Any input stream can be fully discarded, using value <code class="code">all</code> whereas
  2959. selective discarding of frames from a stream occurs at the demuxer
  2960. and is not supported by all demuxers.
  2961. </p>
  2962. <dl class="table">
  2963. <dt><samp class="option">none</samp></dt>
  2964. <dd><p>Discard no frame.
  2965. </p>
  2966. </dd>
  2967. <dt><samp class="option">default</samp></dt>
  2968. <dd><p>Default, which discards no frames.
  2969. </p>
  2970. </dd>
  2971. <dt><samp class="option">noref</samp></dt>
  2972. <dd><p>Discard all non-reference frames.
  2973. </p>
  2974. </dd>
  2975. <dt><samp class="option">bidir</samp></dt>
  2976. <dd><p>Discard all bidirectional frames.
  2977. </p>
  2978. </dd>
  2979. <dt><samp class="option">nokey</samp></dt>
  2980. <dd><p>Discard all frames excepts keyframes.
  2981. </p>
  2982. </dd>
  2983. <dt><samp class="option">all</samp></dt>
  2984. <dd><p>Discard all frames.
  2985. </p></dd>
  2986. </dl>
  2987. </dd>
  2988. <dt><samp class="option">-abort_on <var class="var">flags</var> (<em class="emph">global</em>)</samp></dt>
  2989. <dd><p>Stop and abort on various conditions. The following flags are available:
  2990. </p>
  2991. <dl class="table">
  2992. <dt><samp class="option">empty_output</samp></dt>
  2993. <dd><p>No packets were passed to the muxer, the output is empty.
  2994. </p></dd>
  2995. <dt><samp class="option">empty_output_stream</samp></dt>
  2996. <dd><p>No packets were passed to the muxer in some of the output streams.
  2997. </p></dd>
  2998. </dl>
  2999. </dd>
  3000. <dt><samp class="option">-max_error_rate (<em class="emph">global</em>)</samp></dt>
  3001. <dd><p>Set fraction of decoding frame failures across all inputs which when crossed
  3002. ffmpeg will return exit code 69. Crossing this threshold does not terminate
  3003. processing. Range is a floating-point number between 0 to 1. Default is 2/3.
  3004. </p>
  3005. </dd>
  3006. <dt><samp class="option">-xerror (<em class="emph">global</em>)</samp></dt>
  3007. <dd><p>Stop and exit on error
  3008. </p>
  3009. </dd>
  3010. <dt><samp class="option">-max_muxing_queue_size <var class="var">packets</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3011. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  3012. the output until it has one packet for each such stream. While waiting for that
  3013. to happen, packets for other streams are buffered. This option sets the size of
  3014. this buffer, in packets, for the matching output stream.
  3015. </p>
  3016. <p>The default value of this option should be high enough for most uses, so only
  3017. touch this option if you are sure that you need it.
  3018. </p>
  3019. </dd>
  3020. <dt><samp class="option">-muxing_queue_data_threshold <var class="var">bytes</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3021. <dd><p>This is a minimum threshold until which the muxing queue size is not taken into
  3022. account. Defaults to 50 megabytes per stream, and is based on the overall size
  3023. of packets passed to the muxer.
  3024. </p>
  3025. </dd>
  3026. <dt><samp class="option">-auto_conversion_filters (<em class="emph">global</em>)</samp></dt>
  3027. <dd><p>Enable automatically inserting format conversion filters in all filter
  3028. graphs, including those defined by <samp class="option">-vf</samp>, <samp class="option">-af</samp>,
  3029. <samp class="option">-filter_complex</samp> and <samp class="option">-lavfi</samp>. If filter format negotiation
  3030. requires a conversion, the initialization of the filters will fail.
  3031. Conversions can still be performed by inserting the relevant conversion
  3032. filter (scale, aresample) in the graph.
  3033. On by default, to explicitly disable it you need to specify
  3034. <code class="code">-noauto_conversion_filters</code>.
  3035. </p>
  3036. </dd>
  3037. <dt><samp class="option">-bits_per_raw_sample[:<var class="var">stream_specifier</var>] <var class="var">value</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3038. <dd><p>Declare the number of bits per raw sample in the given output stream to be
  3039. <var class="var">value</var>. Note that this option sets the information provided to the
  3040. encoder/muxer, it does not change the stream to conform to this value. Setting
  3041. values that do not match the stream properties may result in encoding failures
  3042. or invalid output files.
  3043. </p>
  3044. <a class="anchor" id="stats_005fenc_005foptions"></a></dd>
  3045. <dt><samp class="option">-stats_enc_pre[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3046. <dt><samp class="option">-stats_enc_post[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3047. <dt><samp class="option">-stats_mux_pre[:<var class="var">stream_specifier</var>] <var class="var">path</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3048. <dd><p>Write per-frame encoding information about the matching streams into the file
  3049. given by <var class="var">path</var>.
  3050. </p>
  3051. <p><samp class="option">-stats_enc_pre</samp> writes information about raw video or audio frames right
  3052. before they are sent for encoding, while <samp class="option">-stats_enc_post</samp> writes
  3053. information about encoded packets as they are received from the encoder.
  3054. <samp class="option">-stats_mux_pre</samp> writes information about packets just as they are about to
  3055. be sent to the muxer. Every frame or packet produces one line in the specified
  3056. file. The format of this line is controlled by <samp class="option">-stats_enc_pre_fmt</samp> /
  3057. <samp class="option">-stats_enc_post_fmt</samp> / <samp class="option">-stats_mux_pre_fmt</samp>.
  3058. </p>
  3059. <p>When stats for multiple streams are written into a single file, the lines
  3060. corresponding to different streams will be interleaved. The precise order of
  3061. this interleaving is not specified and not guaranteed to remain stable between
  3062. different invocations of the program, even with the same options.
  3063. </p>
  3064. </dd>
  3065. <dt><samp class="option">-stats_enc_pre_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3066. <dt><samp class="option">-stats_enc_post_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3067. <dt><samp class="option">-stats_mux_pre_fmt[:<var class="var">stream_specifier</var>] <var class="var">format_spec</var> (<em class="emph">output,per-stream</em>)</samp></dt>
  3068. <dd><p>Specify the format for the lines written with <samp class="option">-stats_enc_pre</samp> /
  3069. <samp class="option">-stats_enc_post</samp> / <samp class="option">-stats_mux_pre</samp>.
  3070. </p>
  3071. <p><var class="var">format_spec</var> is a string that may contain directives of the form
  3072. <var class="var">{fmt}</var>. <var class="var">format_spec</var> is backslash-escaped &mdash; use \{, \}, and \\
  3073. to write a literal {, }, or \, respectively, into the output.
  3074. </p>
  3075. <p>The directives given with <var class="var">fmt</var> may be one of the following:
  3076. </p><dl class="table">
  3077. <dt><samp class="option">fidx</samp></dt>
  3078. <dd><p>Index of the output file.
  3079. </p>
  3080. </dd>
  3081. <dt><samp class="option">sidx</samp></dt>
  3082. <dd><p>Index of the output stream in the file.
  3083. </p>
  3084. </dd>
  3085. <dt><samp class="option">n</samp></dt>
  3086. <dd><p>Frame number. Pre-encoding: number of frames sent to the encoder so far.
  3087. Post-encoding: number of packets received from the encoder so far.
  3088. Muxing: number of packets submitted to the muxer for this stream so far.
  3089. </p>
  3090. </dd>
  3091. <dt><samp class="option">ni</samp></dt>
  3092. <dd><p>Input frame number. Index of the input frame (i.e. output by a decoder) that
  3093. corresponds to this output frame or packet. -1 if unavailable.
  3094. </p>
  3095. </dd>
  3096. <dt><samp class="option">tb</samp></dt>
  3097. <dd><p>Timebase in which this frame/packet&rsquo;s timestamps are expressed, as a rational
  3098. number <var class="var">num/den</var>. Note that encoder and muxer may use different timebases.
  3099. </p>
  3100. </dd>
  3101. <dt><samp class="option">tbi</samp></dt>
  3102. <dd><p>Timebase for <var class="var">ptsi</var>, as a rational number <var class="var">num/den</var>. Available when
  3103. <var class="var">ptsi</var> is available, <var class="var">0/1</var> otherwise.
  3104. </p>
  3105. </dd>
  3106. <dt><samp class="option">pts</samp></dt>
  3107. <dd><p>Presentation timestamp of the frame or packet, as an integer. Should be
  3108. multiplied by the timebase to compute presentation time.
  3109. </p>
  3110. </dd>
  3111. <dt><samp class="option">ptsi</samp></dt>
  3112. <dd><p>Presentation timestamp of the input frame (see <var class="var">ni</var>), as an integer. Should
  3113. be multiplied by <var class="var">tbi</var> to compute presentation time. Printed as
  3114. (2^63 - 1 = 9223372036854775807) when not available.
  3115. </p>
  3116. </dd>
  3117. <dt><samp class="option">t</samp></dt>
  3118. <dd><p>Presentation time of the frame or packet, as a decimal number. Equal to
  3119. <var class="var">pts</var> multiplied by <var class="var">tb</var>.
  3120. </p>
  3121. </dd>
  3122. <dt><samp class="option">ti</samp></dt>
  3123. <dd><p>Presentation time of the input frame (see <var class="var">ni</var>), as a decimal number. Equal
  3124. to <var class="var">ptsi</var> multiplied by <var class="var">tbi</var>. Printed as inf when not available.
  3125. </p>
  3126. </dd>
  3127. <dt><samp class="option">dts (<em class="emph">packet</em>)</samp></dt>
  3128. <dd><p>Decoding timestamp of the packet, as an integer. Should be multiplied by the
  3129. timebase to compute presentation time.
  3130. </p>
  3131. </dd>
  3132. <dt><samp class="option">dt (<em class="emph">packet</em>)</samp></dt>
  3133. <dd><p>Decoding time of the frame or packet, as a decimal number. Equal to
  3134. <var class="var">dts</var> multiplied by <var class="var">tb</var>.
  3135. </p>
  3136. </dd>
  3137. <dt><samp class="option">sn (<em class="emph">frame,audio</em>)</samp></dt>
  3138. <dd><p>Number of audio samples sent to the encoder so far.
  3139. </p>
  3140. </dd>
  3141. <dt><samp class="option">samp (<em class="emph">frame,audio</em>)</samp></dt>
  3142. <dd><p>Number of audio samples in the frame.
  3143. </p>
  3144. </dd>
  3145. <dt><samp class="option">size (<em class="emph">packet</em>)</samp></dt>
  3146. <dd><p>Size of the encoded packet in bytes.
  3147. </p>
  3148. </dd>
  3149. <dt><samp class="option">br (<em class="emph">packet</em>)</samp></dt>
  3150. <dd><p>Current bitrate in bits per second.
  3151. </p>
  3152. </dd>
  3153. <dt><samp class="option">abr (<em class="emph">packet</em>)</samp></dt>
  3154. <dd><p>Average bitrate for the whole stream so far, in bits per second, -1 if it cannot
  3155. be determined at this point.
  3156. </p>
  3157. </dd>
  3158. <dt><samp class="option">key (<em class="emph">packet</em>)</samp></dt>
  3159. <dd><p>Character &rsquo;K&rsquo; if the packet contains a keyframe, character &rsquo;N&rsquo; otherwise.
  3160. </p></dd>
  3161. </dl>
  3162. <p>Directives tagged with <em class="emph">packet</em> may only be used with
  3163. <samp class="option">-stats_enc_post_fmt</samp> and <samp class="option">-stats_mux_pre_fmt</samp>.
  3164. </p>
  3165. <p>Directives tagged with <em class="emph">frame</em> may only be used with
  3166. <samp class="option">-stats_enc_pre_fmt</samp>.
  3167. </p>
  3168. <p>Directives tagged with <em class="emph">audio</em> may only be used with audio streams.
  3169. </p>
  3170. <p>The default format strings are:
  3171. </p><dl class="table">
  3172. <dt><samp class="option">pre-encoding</samp></dt>
  3173. <dd><p>{fidx} {sidx} {n} {t}
  3174. </p></dd>
  3175. <dt><samp class="option">post-encoding</samp></dt>
  3176. <dd><p>{fidx} {sidx} {n} {t}
  3177. </p></dd>
  3178. </dl>
  3179. <p>In the future, new items may be added to the end of the default formatting
  3180. strings. Users who depend on the format staying exactly the same, should
  3181. prescribe it manually.
  3182. </p>
  3183. <p>Note that stats for different streams written into the same file may have
  3184. different formats.
  3185. </p>
  3186. </dd>
  3187. </dl>
  3188. </div>
  3189. <div class="section-level-extent" id="Preset-files">
  3190. <h3 class="section"><span>5.12 Preset files<a class="copiable-link" href="#Preset-files"> &para;</a></span></h3>
  3191. <p>A preset file contains a sequence of <var class="var">option</var>=<var class="var">value</var> pairs,
  3192. one for each line, specifying a sequence of options which would be
  3193. awkward to specify on the command line. Lines starting with the hash
  3194. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  3195. the <samp class="file">presets</samp> directory in the FFmpeg source tree for examples.
  3196. </p>
  3197. <p>There are two types of preset files: ffpreset and avpreset files.
  3198. </p>
  3199. <ul class="mini-toc">
  3200. <li><a href="#ffpreset-files" accesskey="1">ffpreset files</a></li>
  3201. <li><a href="#avpreset-files" accesskey="2">avpreset files</a></li>
  3202. </ul>
  3203. <div class="subsection-level-extent" id="ffpreset-files">
  3204. <h4 class="subsection"><span>5.12.1 ffpreset files<a class="copiable-link" href="#ffpreset-files"> &para;</a></span></h4>
  3205. <p>ffpreset files are specified with the <code class="code">vpre</code>, <code class="code">apre</code>,
  3206. <code class="code">spre</code>, and <code class="code">fpre</code> options. The <code class="code">fpre</code> option takes the
  3207. filename of the preset instead of a preset name as input and can be
  3208. used for any kind of codec. For the <code class="code">vpre</code>, <code class="code">apre</code>, and
  3209. <code class="code">spre</code> options, the options specified in a preset file are
  3210. applied to the currently selected codec of the same type as the preset
  3211. option.
  3212. </p>
  3213. <p>The argument passed to the <code class="code">vpre</code>, <code class="code">apre</code>, and <code class="code">spre</code>
  3214. preset options identifies the preset file to use according to the
  3215. following rules:
  3216. </p>
  3217. <p>First ffmpeg searches for a file named <var class="var">arg</var>.ffpreset in the
  3218. directories <samp class="file">$FFMPEG_DATADIR</samp> (if set), and <samp class="file">$HOME/.ffmpeg</samp>, and in
  3219. the datadir defined at configuration time (usually <samp class="file">PREFIX/share/ffmpeg</samp>)
  3220. or in a <samp class="file">ffpresets</samp> folder along the executable on win32,
  3221. in that order. For example, if the argument is <code class="code">libvpx-1080p</code>, it will
  3222. search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  3223. </p>
  3224. <p>If no such file is found, then ffmpeg will search for a file named
  3225. <var class="var">codec_name</var>-<var class="var">arg</var>.ffpreset in the above-mentioned
  3226. directories, where <var class="var">codec_name</var> is the name of the codec to which
  3227. the preset file options will be applied. For example, if you select
  3228. the video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-vpre 1080p</code>,
  3229. then it will search for the file <samp class="file">libvpx-1080p.ffpreset</samp>.
  3230. </p>
  3231. </div>
  3232. <div class="subsection-level-extent" id="avpreset-files">
  3233. <h4 class="subsection"><span>5.12.2 avpreset files<a class="copiable-link" href="#avpreset-files"> &para;</a></span></h4>
  3234. <p>avpreset files are specified with the <code class="code">pre</code> option. They work similar to
  3235. ffpreset files, but they only allow encoder- specific options. Therefore, an
  3236. <var class="var">option</var>=<var class="var">value</var> pair specifying an encoder cannot be used.
  3237. </p>
  3238. <p>When the <code class="code">pre</code> option is specified, ffmpeg will look for files with the
  3239. suffix .avpreset in the directories <samp class="file">$AVCONV_DATADIR</samp> (if set), and
  3240. <samp class="file">$HOME/.avconv</samp>, and in the datadir defined at configuration time (usually
  3241. <samp class="file">PREFIX/share/ffmpeg</samp>), in that order.
  3242. </p>
  3243. <p>First ffmpeg searches for a file named <var class="var">codec_name</var>-<var class="var">arg</var>.avpreset in
  3244. the above-mentioned directories, where <var class="var">codec_name</var> is the name of the codec
  3245. to which the preset file options will be applied. For example, if you select the
  3246. video codec with <code class="code">-vcodec libvpx</code> and use <code class="code">-pre 1080p</code>, then it will
  3247. search for the file <samp class="file">libvpx-1080p.avpreset</samp>.
  3248. </p>
  3249. <p>If no such file is found, then ffmpeg will search for a file named
  3250. <var class="var">arg</var>.avpreset in the same directories.
  3251. </p>
  3252. <a class="anchor" id="vstats_005ffile_005fformat"></a></div>
  3253. </div>
  3254. <div class="section-level-extent" id="vstats-file-format">
  3255. <h3 class="section"><span>5.13 vstats file format<a class="copiable-link" href="#vstats-file-format"> &para;</a></span></h3>
  3256. <p>The <code class="code">-vstats</code> and <code class="code">-vstats_file</code> options enable generation of a file
  3257. containing statistics about the generated video outputs.
  3258. </p>
  3259. <p>The <code class="code">-vstats_version</code> option controls the format version of the generated
  3260. file.
  3261. </p>
  3262. <p>With version <code class="code">1</code> the format is:
  3263. </p><div class="example">
  3264. <pre class="example-preformatted">frame= <var class="var">FRAME</var> q= <var class="var">FRAME_QUALITY</var> PSNR= <var class="var">PSNR</var> f_size= <var class="var">FRAME_SIZE</var> s_size= <var class="var">STREAM_SIZE</var>kB time= <var class="var">TIMESTAMP</var> br= <var class="var">BITRATE</var>kbits/s avg_br= <var class="var">AVERAGE_BITRATE</var>kbits/s
  3265. </pre></div>
  3266. <p>With version <code class="code">2</code> the format is:
  3267. </p><div class="example">
  3268. <pre class="example-preformatted">out= <var class="var">OUT_FILE_INDEX</var> st= <var class="var">OUT_FILE_STREAM_INDEX</var> frame= <var class="var">FRAME_NUMBER</var> q= <var class="var">FRAME_QUALITY</var>f PSNR= <var class="var">PSNR</var> f_size= <var class="var">FRAME_SIZE</var> s_size= <var class="var">STREAM_SIZE</var>kB time= <var class="var">TIMESTAMP</var> br= <var class="var">BITRATE</var>kbits/s avg_br= <var class="var">AVERAGE_BITRATE</var>kbits/s
  3269. </pre></div>
  3270. <p>The value corresponding to each key is described below:
  3271. </p><dl class="table">
  3272. <dt><samp class="option">avg_br</samp></dt>
  3273. <dd><p>average bitrate expressed in Kbits/s
  3274. </p>
  3275. </dd>
  3276. <dt><samp class="option">br</samp></dt>
  3277. <dd><p>bitrate expressed in Kbits/s
  3278. </p>
  3279. </dd>
  3280. <dt><samp class="option">frame</samp></dt>
  3281. <dd><p>number of encoded frame
  3282. </p>
  3283. </dd>
  3284. <dt><samp class="option">out</samp></dt>
  3285. <dd><p>out file index
  3286. </p>
  3287. </dd>
  3288. <dt><samp class="option">PSNR</samp></dt>
  3289. <dd><p>Peak Signal to Noise Ratio
  3290. </p>
  3291. </dd>
  3292. <dt><samp class="option">q</samp></dt>
  3293. <dd><p>quality of the frame
  3294. </p>
  3295. </dd>
  3296. <dt><samp class="option">f_size</samp></dt>
  3297. <dd><p>encoded packet size expressed as number of bytes
  3298. </p>
  3299. </dd>
  3300. <dt><samp class="option">s_size</samp></dt>
  3301. <dd><p>stream size expressed in KiB
  3302. </p>
  3303. </dd>
  3304. <dt><samp class="option">st</samp></dt>
  3305. <dd><p>out file stream index
  3306. </p>
  3307. </dd>
  3308. <dt><samp class="option">time</samp></dt>
  3309. <dd><p>time of the packet
  3310. </p>
  3311. </dd>
  3312. <dt><samp class="option">type</samp></dt>
  3313. <dd><p>picture type
  3314. </p></dd>
  3315. </dl>
  3316. <p>See also the <a class="ref" href="#stats_005fenc_005foptions">-stats_enc options</a> for an alternative way
  3317. to show encoding statistics.
  3318. </p>
  3319. </div>
  3320. </div>
  3321. <div class="chapter-level-extent" id="Examples-1">
  3322. <h2 class="chapter"><span>6 Examples<a class="copiable-link" href="#Examples-1"> &para;</a></span></h2>
  3323. <ul class="mini-toc">
  3324. <li><a href="#Video-and-Audio-grabbing" accesskey="1">Video and Audio grabbing</a></li>
  3325. <li><a href="#X11-grabbing" accesskey="2">X11 grabbing</a></li>
  3326. <li><a href="#Video-and-Audio-file-format-conversion" accesskey="3">Video and Audio file format conversion</a></li>
  3327. </ul>
  3328. <div class="section-level-extent" id="Video-and-Audio-grabbing">
  3329. <h3 class="section"><span>6.1 Video and Audio grabbing<a class="copiable-link" href="#Video-and-Audio-grabbing"> &para;</a></span></h3>
  3330. <p>If you specify the input format and device then ffmpeg can grab video
  3331. and audio directly.
  3332. </p>
  3333. <div class="example">
  3334. <pre class="example-preformatted">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  3335. </pre></div>
  3336. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  3337. </p><div class="example">
  3338. <pre class="example-preformatted">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  3339. </pre></div>
  3340. <p>Note that you must activate the right video source and channel before
  3341. launching ffmpeg with any TV viewer such as
  3342. <a class="uref" href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  3343. have to set the audio recording levels correctly with a
  3344. standard mixer.
  3345. </p>
  3346. </div>
  3347. <div class="section-level-extent" id="X11-grabbing">
  3348. <h3 class="section"><span>6.2 X11 grabbing<a class="copiable-link" href="#X11-grabbing"> &para;</a></span></h3>
  3349. <p>Grab the X11 display with ffmpeg via
  3350. </p>
  3351. <div class="example">
  3352. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  3353. </pre></div>
  3354. <p>0.0 is display.screen number of your X11 server, same as
  3355. the DISPLAY environment variable.
  3356. </p>
  3357. <div class="example">
  3358. <pre class="example-preformatted">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  3359. </pre></div>
  3360. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  3361. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  3362. </p>
  3363. </div>
  3364. <div class="section-level-extent" id="Video-and-Audio-file-format-conversion">
  3365. <h3 class="section"><span>6.3 Video and Audio file format conversion<a class="copiable-link" href="#Video-and-Audio-file-format-conversion"> &para;</a></span></h3>
  3366. <p>Any supported file format and protocol can serve as input to ffmpeg:
  3367. </p>
  3368. <p>Examples:
  3369. </p><ul class="itemize mark-bullet">
  3370. <li>You can use YUV files as input:
  3371. <div class="example">
  3372. <pre class="example-preformatted">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  3373. </pre></div>
  3374. <p>It will use the files:
  3375. </p><div class="example">
  3376. <pre class="example-preformatted">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  3377. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  3378. </pre></div>
  3379. <p>The Y files use twice the resolution of the U and V files. They are
  3380. raw files, without header. They can be generated by all decent video
  3381. decoders. You must specify the size of the image with the <samp class="option">-s</samp> option
  3382. if ffmpeg cannot guess it.
  3383. </p>
  3384. </li><li>You can input from a raw YUV420P file:
  3385. <div class="example">
  3386. <pre class="example-preformatted">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  3387. </pre></div>
  3388. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  3389. of the Y plane followed by the U and V planes at half vertical and
  3390. horizontal resolution.
  3391. </p>
  3392. </li><li>You can output to a raw YUV420P file:
  3393. <div class="example">
  3394. <pre class="example-preformatted">ffmpeg -i mydivx.avi hugefile.yuv
  3395. </pre></div>
  3396. </li><li>You can set several input files and output files:
  3397. <div class="example">
  3398. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  3399. </pre></div>
  3400. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  3401. to MPEG file a.mpg.
  3402. </p>
  3403. </li><li>You can also do audio and video conversions at the same time:
  3404. <div class="example">
  3405. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  3406. </pre></div>
  3407. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  3408. </p>
  3409. </li><li>You can encode to several formats at the same time and define a
  3410. mapping from input stream to output streams:
  3411. <div class="example">
  3412. <pre class="example-preformatted">ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
  3413. </pre></div>
  3414. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  3415. file:index&rsquo; specifies which input stream is used for each output
  3416. stream, in the order of the definition of output streams.
  3417. </p>
  3418. </li><li>You can transcode decrypted VOBs:
  3419. <div class="example">
  3420. <pre class="example-preformatted">ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
  3421. </pre></div>
  3422. <p>This is a typical DVD ripping example; the input is a VOB file, the
  3423. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  3424. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  3425. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  3426. input video. Furthermore, the audio stream is MP3-encoded so you need
  3427. to enable LAME support by passing <code class="code">--enable-libmp3lame</code> to configure.
  3428. The mapping is particularly useful for DVD transcoding
  3429. to get the desired audio language.
  3430. </p>
  3431. <p>NOTE: To see the supported input formats, use <code class="code">ffmpeg -demuxers</code>.
  3432. </p>
  3433. </li><li>You can extract images from a video, or create a video from many images:
  3434. <p>For extracting images from a video:
  3435. </p><div class="example">
  3436. <pre class="example-preformatted">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  3437. </pre></div>
  3438. <p>This will extract one video frame per second from the video and will
  3439. output them in files named <samp class="file">foo-001.jpeg</samp>, <samp class="file">foo-002.jpeg</samp>,
  3440. etc. Images will be rescaled to fit the new WxH values.
  3441. </p>
  3442. <p>If you want to extract just a limited number of frames, you can use the
  3443. above command in combination with the <code class="code">-frames:v</code> or <code class="code">-t</code> option,
  3444. or in combination with -ss to start extracting from a certain point in time.
  3445. </p>
  3446. <p>For creating a video from many images:
  3447. </p><div class="example">
  3448. <pre class="example-preformatted">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  3449. </pre></div>
  3450. <p>The syntax <code class="code">foo-%03d.jpeg</code> specifies to use a decimal number
  3451. composed of three digits padded with zeroes to express the sequence
  3452. number. It is the same syntax supported by the C printf function, but
  3453. only formats accepting a normal integer are suitable.
  3454. </p>
  3455. <p>When importing an image sequence, -i also supports expanding
  3456. shell-like wildcard patterns (globbing) internally, by selecting the
  3457. image2-specific <code class="code">-pattern_type glob</code> option.
  3458. </p>
  3459. <p>For example, for creating a video from filenames matching the glob pattern
  3460. <code class="code">foo-*.jpeg</code>:
  3461. </p><div class="example">
  3462. <pre class="example-preformatted">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  3463. </pre></div>
  3464. </li><li>You can put many streams of the same type in the output:
  3465. <div class="example">
  3466. <pre class="example-preformatted">ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
  3467. </pre></div>
  3468. <p>The resulting output file <samp class="file">test12.nut</samp> will contain the first four streams
  3469. from the input files in reverse order.
  3470. </p>
  3471. </li><li>To force CBR video output:
  3472. <div class="example">
  3473. <pre class="example-preformatted">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  3474. </pre></div>
  3475. </li><li>The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  3476. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  3477. <div class="example">
  3478. <pre class="example-preformatted">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  3479. </pre></div>
  3480. </li></ul>
  3481. </div>
  3482. </div>
  3483. <div class="chapter-level-extent" id="See-Also">
  3484. <h2 class="chapter"><span>7 See Also<a class="copiable-link" href="#See-Also"> &para;</a></span></h2>
  3485. <p><a class="url" href="ffmpeg-all.html">ffmpeg-all</a>,
  3486. <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  3487. <a class="url" href="ffmpeg-utils.html">ffmpeg-utils</a>,
  3488. <a class="url" href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  3489. <a class="url" href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  3490. <a class="url" href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  3491. <a class="url" href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  3492. <a class="url" href="ffmpeg-formats.html">ffmpeg-formats</a>,
  3493. <a class="url" href="ffmpeg-devices.html">ffmpeg-devices</a>,
  3494. <a class="url" href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  3495. <a class="url" href="ffmpeg-filters.html">ffmpeg-filters</a>
  3496. </p>
  3497. </div>
  3498. <div class="chapter-level-extent" id="Authors">
  3499. <h2 class="chapter"><span>8 Authors<a class="copiable-link" href="#Authors"> &para;</a></span></h2>
  3500. <p>The FFmpeg developers.
  3501. </p>
  3502. <p>For details about the authorship, see the Git history of the project
  3503. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  3504. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  3505. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  3506. </p>
  3507. <p>Maintainers for the specific components are listed in the file
  3508. <samp class="file">MAINTAINERS</samp> in the source code tree.
  3509. </p>
  3510. </div>
  3511. </div>
  3512. <p style="font-size: small;">
  3513. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  3514. </p>
  3515. </div>
  3516. </body>
  3517. </html>