星火微课系统客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

ffmpeg-formats.html 184KB

pirms 4 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <title>FFmpeg documentation</title>
  7. <link rel="stylesheet" href="bootstrap.min.css" />
  8. <link rel="stylesheet" href="style.min.css" />
  9. <meta name="description" content="FFmpeg Formats Documentation: ">
  10. <meta name="keywords" content="FFmpeg documentation : FFmpeg Formats ">
  11. <meta name="Generator" content="texi2html 5.0">
  12. <!-- Created on March 9, 2020 by texi2html 5.0 -->
  13. <!--
  14. texi2html was written by:
  15. Lionel Cons <Lionel.Cons@cern.ch> (original author)
  16. Karl Berry <karl@freefriends.org>
  17. Olaf Bachmann <obachman@mathematik.uni-kl.de>
  18. and many others.
  19. Maintained by: Many creative people.
  20. Send bugs and suggestions to <texi2html-bug@nongnu.org>
  21. -->
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  23. </head>
  24. <body>
  25. <div class="container">
  26. <h1 class="titlefont">FFmpeg Formats Documentation</h1>
  27. <hr>
  28. <a name="SEC_Top"></a>
  29. <a name="SEC_Contents"></a>
  30. <h1>Table of Contents</h1>
  31. <div class="contents">
  32. <ul class="no-bullet">
  33. <li><a name="toc-Description" href="#Description">1 Description</a></li>
  34. <li><a name="toc-Format-Options" href="#Format-Options">2 Format Options</a>
  35. <ul class="no-bullet">
  36. <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">2.1 Format stream specifiers</a></li>
  37. </ul></li>
  38. <li><a name="toc-Demuxers" href="#Demuxers">3 Demuxers</a>
  39. <ul class="no-bullet">
  40. <li><a name="toc-aa" href="#aa">3.1 aa</a></li>
  41. <li><a name="toc-apng" href="#apng">3.2 apng</a></li>
  42. <li><a name="toc-asf-2" href="#asf-2">3.3 asf</a></li>
  43. <li><a name="toc-concat-1" href="#concat-1">3.4 concat</a>
  44. <ul class="no-bullet">
  45. <li><a name="toc-Syntax" href="#Syntax">3.4.1 Syntax</a></li>
  46. <li><a name="toc-Options-3" href="#Options-3">3.4.2 Options</a></li>
  47. <li><a name="toc-Examples-8" href="#Examples-8">3.4.3 Examples</a></li>
  48. </ul></li>
  49. <li><a name="toc-dash-2" href="#dash-2">3.5 dash</a></li>
  50. <li><a name="toc-flv_002c-live_005fflv" href="#flv_002c-live_005fflv">3.6 flv, live_flv</a></li>
  51. <li><a name="toc-gif-1" href="#gif-1">3.7 gif</a></li>
  52. <li><a name="toc-hls-1" href="#hls-1">3.8 hls</a></li>
  53. <li><a name="toc-image2-1" href="#image2-1">3.9 image2</a>
  54. <ul class="no-bullet">
  55. <li><a name="toc-Examples-6" href="#Examples-6">3.9.1 Examples</a></li>
  56. </ul></li>
  57. <li><a name="toc-libgme" href="#libgme">3.10 libgme</a></li>
  58. <li><a name="toc-libmodplug" href="#libmodplug">3.11 libmodplug</a></li>
  59. <li><a name="toc-libopenmpt" href="#libopenmpt">3.12 libopenmpt</a></li>
  60. <li><a name="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">3.13 mov/mp4/3gp</a>
  61. <ul class="no-bullet">
  62. <li><a name="toc-Options" href="#Options">3.13.1 Options</a></li>
  63. <li><a name="toc-Audible-AAX" href="#Audible-AAX">3.13.2 Audible AAX</a></li>
  64. </ul></li>
  65. <li><a name="toc-mpegts-1" href="#mpegts-1">3.14 mpegts</a></li>
  66. <li><a name="toc-mpjpeg" href="#mpjpeg">3.15 mpjpeg</a></li>
  67. <li><a name="toc-rawvideo" href="#rawvideo">3.16 rawvideo</a></li>
  68. <li><a name="toc-sbg" href="#sbg">3.17 sbg</a></li>
  69. <li><a name="toc-tedcaptions" href="#tedcaptions">3.18 tedcaptions</a></li>
  70. <li><a name="toc-vapoursynth" href="#vapoursynth">3.19 vapoursynth</a></li>
  71. </ul></li>
  72. <li><a name="toc-Muxers" href="#Muxers">4 Muxers</a>
  73. <ul class="no-bullet">
  74. <li><a name="toc-aiff-1" href="#aiff-1">4.1 aiff</a>
  75. <ul class="no-bullet">
  76. <li><a name="toc-Options-14" href="#Options-14">4.1.1 Options</a></li>
  77. </ul></li>
  78. <li><a name="toc-asf-1" href="#asf-1">4.2 asf</a>
  79. <ul class="no-bullet">
  80. <li><a name="toc-Options-13" href="#Options-13">4.2.1 Options</a></li>
  81. </ul></li>
  82. <li><a name="toc-avi-1" href="#avi-1">4.3 avi</a>
  83. <ul class="no-bullet">
  84. <li><a name="toc-Options-6" href="#Options-6">4.3.1 Options</a></li>
  85. </ul></li>
  86. <li><a name="toc-chromaprint-1" href="#chromaprint-1">4.4 chromaprint</a>
  87. <ul class="no-bullet">
  88. <li><a name="toc-Options-9" href="#Options-9">4.4.1 Options</a></li>
  89. </ul></li>
  90. <li><a name="toc-crc-1" href="#crc-1">4.5 crc</a>
  91. <ul class="no-bullet">
  92. <li><a name="toc-Examples-1" href="#Examples-1">4.5.1 Examples</a></li>
  93. </ul></li>
  94. <li><a name="toc-flv" href="#flv">4.6 flv</a></li>
  95. <li><a name="toc-dash-1" href="#dash-1">4.7 dash</a></li>
  96. <li><a name="toc-framecrc-1" href="#framecrc-1">4.8 framecrc</a>
  97. <ul class="no-bullet">
  98. <li><a name="toc-Examples-10" href="#Examples-10">4.8.1 Examples</a></li>
  99. </ul></li>
  100. <li><a name="toc-framehash-1" href="#framehash-1">4.9 framehash</a>
  101. <ul class="no-bullet">
  102. <li><a name="toc-Examples-11" href="#Examples-11">4.9.1 Examples</a></li>
  103. </ul></li>
  104. <li><a name="toc-framemd5-1" href="#framemd5-1">4.10 framemd5</a>
  105. <ul class="no-bullet">
  106. <li><a name="toc-Examples-5" href="#Examples-5">4.10.1 Examples</a></li>
  107. </ul></li>
  108. <li><a name="toc-gif-2" href="#gif-2">4.11 gif</a></li>
  109. <li><a name="toc-hash-1" href="#hash-1">4.12 hash</a>
  110. <ul class="no-bullet">
  111. <li><a name="toc-Examples-7" href="#Examples-7">4.12.1 Examples</a></li>
  112. </ul></li>
  113. <li><a name="toc-hls-2" href="#hls-2">4.13 hls</a>
  114. <ul class="no-bullet">
  115. <li><a name="toc-Options-8" href="#Options-8">4.13.1 Options</a></li>
  116. </ul></li>
  117. <li><a name="toc-ico-1" href="#ico-1">4.14 ico</a></li>
  118. <li><a name="toc-image2-2" href="#image2-2">4.15 image2</a>
  119. <ul class="no-bullet">
  120. <li><a name="toc-Options-15" href="#Options-15">4.15.1 Options</a></li>
  121. <li><a name="toc-Examples-9" href="#Examples-9">4.15.2 Examples</a></li>
  122. </ul></li>
  123. <li><a name="toc-matroska" href="#matroska">4.16 matroska</a>
  124. <ul class="no-bullet">
  125. <li><a name="toc-Metadata" href="#Metadata">4.16.1 Metadata</a></li>
  126. <li><a name="toc-Options-12" href="#Options-12">4.16.2 Options</a></li>
  127. </ul></li>
  128. <li><a name="toc-md5-1" href="#md5-1">4.17 md5</a>
  129. <ul class="no-bullet">
  130. <li><a name="toc-Examples-2" href="#Examples-2">4.17.1 Examples</a></li>
  131. </ul></li>
  132. <li><a name="toc-mov_002c-mp4_002c-ismv" href="#mov_002c-mp4_002c-ismv">4.18 mov, mp4, ismv</a>
  133. <ul class="no-bullet">
  134. <li><a name="toc-Options-11" href="#Options-11">4.18.1 Options</a></li>
  135. <li><a name="toc-Example-1" href="#Example-1">4.18.2 Example</a></li>
  136. </ul></li>
  137. <li><a name="toc-mp3" href="#mp3">4.19 mp3</a></li>
  138. <li><a name="toc-mpegts" href="#mpegts">4.20 mpegts</a>
  139. <ul class="no-bullet">
  140. <li><a name="toc-Options-4" href="#Options-4">4.20.1 Options</a></li>
  141. <li><a name="toc-Example-2" href="#Example-2">4.20.2 Example</a></li>
  142. </ul></li>
  143. <li><a name="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">4.21 mxf, mxf_d10, mxf_opatom</a>
  144. <ul class="no-bullet">
  145. <li><a name="toc-Options-1" href="#Options-1">4.21.1 Options</a></li>
  146. </ul></li>
  147. <li><a name="toc-null" href="#null">4.22 null</a></li>
  148. <li><a name="toc-nut" href="#nut">4.23 nut</a></li>
  149. <li><a name="toc-ogg" href="#ogg">4.24 ogg</a></li>
  150. <li><a name="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">4.25 segment, stream_segment, ssegment</a>
  151. <ul class="no-bullet">
  152. <li><a name="toc-Options-2" href="#Options-2">4.25.1 Options</a></li>
  153. <li><a name="toc-Examples-12" href="#Examples-12">4.25.2 Examples</a></li>
  154. </ul></li>
  155. <li><a name="toc-smoothstreaming" href="#smoothstreaming">4.26 smoothstreaming</a></li>
  156. <li><a name="toc-streamhash-1" href="#streamhash-1">4.27 streamhash</a>
  157. <ul class="no-bullet">
  158. <li><a name="toc-Examples" href="#Examples">4.27.1 Examples</a></li>
  159. </ul></li>
  160. <li><a name="toc-fifo-1" href="#fifo-1">4.28 fifo</a>
  161. <ul class="no-bullet">
  162. <li><a name="toc-Examples-4" href="#Examples-4">4.28.1 Examples</a></li>
  163. </ul></li>
  164. <li><a name="toc-tee-1" href="#tee-1">4.29 tee</a>
  165. <ul class="no-bullet">
  166. <li><a name="toc-Options-7" href="#Options-7">4.29.1 Options</a></li>
  167. <li><a name="toc-Examples-3" href="#Examples-3">4.29.2 Examples</a></li>
  168. </ul></li>
  169. <li><a name="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">4.30 webm_dash_manifest</a>
  170. <ul class="no-bullet">
  171. <li><a name="toc-Options-5" href="#Options-5">4.30.1 Options</a></li>
  172. <li><a name="toc-Example-3" href="#Example-3">4.30.2 Example</a></li>
  173. </ul></li>
  174. <li><a name="toc-webm_005fchunk" href="#webm_005fchunk">4.31 webm_chunk</a>
  175. <ul class="no-bullet">
  176. <li><a name="toc-Options-10" href="#Options-10">4.31.1 Options</a></li>
  177. <li><a name="toc-Example" href="#Example">4.31.2 Example</a></li>
  178. </ul>
  179. </li>
  180. </ul></li>
  181. <li><a name="toc-Metadata-1" href="#Metadata-1">5 Metadata</a></li>
  182. <li><a name="toc-See-Also" href="#See-Also">6 See Also</a></li>
  183. <li><a name="toc-Authors" href="#Authors">7 Authors</a></li>
  184. </ul>
  185. </div>
  186. <hr size="6">
  187. <a name="Description"></a>
  188. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Description">1 Description</a></h1>
  189. <p>This document describes the supported formats (muxers and demuxers)
  190. provided by the libavformat library.
  191. </p>
  192. <a name="Format-Options"></a>
  193. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Format-Options">2 Format Options</a></h1>
  194. <p>The libavformat library provides some generic global options, which
  195. can be set on all the muxers and demuxers. In addition each muxer or
  196. demuxer may support so-called private options, which are specific for
  197. that component.
  198. </p>
  199. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  200. FFmpeg tools, or by setting the value explicitly in the
  201. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  202. for programmatic use.
  203. </p>
  204. <p>The list of supported options follows:
  205. </p>
  206. <dl compact="compact">
  207. <dt>&lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  208. <dd><p>Possible values:
  209. </p><dl compact="compact">
  210. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  211. <dd><p>Reduce buffering.
  212. </p></dd>
  213. </dl>
  214. </dd>
  215. <dt>&lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  216. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  217. stream information. A higher value will enable detecting more
  218. information in case it is dispersed into the stream, but will increase
  219. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  220. </p>
  221. </dd>
  222. <dt>&lsquo;<samp>max_probe_packets <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  223. <dd><p>Set the maximum number of buffered packets when probing a codec.
  224. Default is 2500 packets.
  225. </p>
  226. </dd>
  227. <dt>&lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  228. <dd><p>Set packet size.
  229. </p>
  230. </dd>
  231. <dt>&lsquo;<samp>fflags <var>flags</var></samp>&rsquo;</dt>
  232. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  233. </p>
  234. <p>Possible values for input files:
  235. </p><dl compact="compact">
  236. <dt>&lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
  237. <dd><p>Discard corrupted packets.
  238. </p></dd>
  239. <dt>&lsquo;<samp>fastseek</samp>&rsquo;</dt>
  240. <dd><p>Enable fast, but inaccurate seeks for some formats.
  241. </p></dd>
  242. <dt>&lsquo;<samp>genpts</samp>&rsquo;</dt>
  243. <dd><p>Generate missing PTS if DTS is present.
  244. </p></dd>
  245. <dt>&lsquo;<samp>igndts</samp>&rsquo;</dt>
  246. <dd><p>Ignore DTS if PTS is set. Inert when nofillin is set.
  247. </p></dd>
  248. <dt>&lsquo;<samp>ignidx</samp>&rsquo;</dt>
  249. <dd><p>Ignore index.
  250. </p></dd>
  251. <dt>&lsquo;<samp>keepside (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  252. <dt>&lsquo;<samp>nobuffer</samp>&rsquo;</dt>
  253. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  254. </p></dd>
  255. <dt>&lsquo;<samp>nofillin</samp>&rsquo;</dt>
  256. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  257. </p></dd>
  258. <dt>&lsquo;<samp>noparse</samp>&rsquo;</dt>
  259. <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
  260. </p></dd>
  261. <dt>&lsquo;<samp>sortdts</samp>&rsquo;</dt>
  262. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  263. </p></dd>
  264. </dl>
  265. <p>Possible values for output files:
  266. </p><dl compact="compact">
  267. <dt>&lsquo;<samp>autobsf</samp>&rsquo;</dt>
  268. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  269. </p></dd>
  270. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  271. <dd><p>Only write platform-, build- and time-independent data.
  272. This ensures that file and data checksums are reproducible and match between
  273. platforms. Its primary use is for regression testing.
  274. </p></dd>
  275. <dt>&lsquo;<samp>flush_packets</samp>&rsquo;</dt>
  276. <dd><p>Write out packets immediately.
  277. </p></dd>
  278. <dt>&lsquo;<samp>latm (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  279. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  280. <dd><p>Stop muxing at the end of the shortest stream.
  281. It may be needed to increase max_interleave_delta to avoid flushing the longer
  282. streams before EOF.
  283. </p></dd>
  284. </dl>
  285. </dd>
  286. <dt>&lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  287. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  288. Default is 0.
  289. </p>
  290. </dd>
  291. <dt>&lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  292. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  293. higher value will enable detecting more accurate information, but will
  294. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  295. </p>
  296. </dd>
  297. <dt>&lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
  298. <dd><p>Set decryption key.
  299. </p>
  300. </dd>
  301. <dt>&lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  302. <dd><p>Set max memory used for timestamp index (per stream).
  303. </p>
  304. </dd>
  305. <dt>&lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  306. <dd><p>Set max memory used for buffering real-time frames.
  307. </p>
  308. </dd>
  309. <dt>&lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  310. <dd><p>Print specific debug info.
  311. </p>
  312. <p>Possible values:
  313. </p><dl compact="compact">
  314. <dt>&lsquo;<samp>ts</samp>&rsquo;</dt>
  315. </dl>
  316. </dd>
  317. <dt>&lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  318. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  319. </p>
  320. </dd>
  321. <dt>&lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  322. <dd><p>Set number of frames used to probe fps.
  323. </p>
  324. </dd>
  325. <dt>&lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  326. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  327. </p>
  328. </dd>
  329. <dt>&lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  330. <dd><p>Set microseconds for each chunk.
  331. </p>
  332. </dd>
  333. <dt>&lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  334. <dd><p>Set size in bytes for each chunk.
  335. </p>
  336. </dd>
  337. <dt>&lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</dt>
  338. <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
  339. should be used only via the <code>ffmpeg</code> tool.
  340. </p>
  341. <p>Possible values:
  342. </p><dl compact="compact">
  343. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  344. <dd><p>Verify embedded CRCs.
  345. </p></dd>
  346. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  347. <dd><p>Detect bitstream specification deviations.
  348. </p></dd>
  349. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  350. <dd><p>Detect improper bitstream length.
  351. </p></dd>
  352. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  353. <dd><p>Abort decoding on minor error detection.
  354. </p></dd>
  355. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  356. <dd><p>Consider things that violate the spec and have not been seen in the
  357. wild as errors.
  358. </p></dd>
  359. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  360. <dd><p>Consider all spec non compliancies as errors.
  361. </p></dd>
  362. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  363. <dd><p>Consider things that a sane encoder should not do as an error.
  364. </p></dd>
  365. </dl>
  366. </dd>
  367. <dt>&lsquo;<samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  368. <dd><p>Set maximum buffering duration for interleaving. The duration is
  369. expressed in microseconds, and defaults to 10000000 (10 seconds).
  370. </p>
  371. <p>To ensure all the streams are interleaved correctly, libavformat will
  372. wait until it has at least one packet for each stream before actually
  373. writing any packets to the output file. When some streams are
  374. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  375. can result in excessive buffering.
  376. </p>
  377. <p>This field specifies the maximum difference between the timestamps of the
  378. first and the last packet in the muxing queue, above which libavformat
  379. will output a packet regardless of whether it has queued a packet for all
  380. the streams.
  381. </p>
  382. <p>If set to 0, libavformat will continue buffering packets until it has
  383. a packet for each stream, regardless of the maximum timestamp
  384. difference between the buffered packets.
  385. </p>
  386. </dd>
  387. <dt>&lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  388. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  389. </p>
  390. </dd>
  391. <dt>&lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  392. <dd>
  393. <p>Possible values:
  394. </p><dl compact="compact">
  395. <dt>&lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
  396. <dd><p>Shift timestamps to make them non-negative.
  397. Also note that this affects only leading negative timestamps, and not
  398. non-monotonic negative timestamps.
  399. </p></dd>
  400. <dt>&lsquo;<samp>make_zero</samp>&rsquo;</dt>
  401. <dd><p>Shift timestamps so that the first timestamp is 0.
  402. </p></dd>
  403. <dt>&lsquo;<samp>auto (default)</samp>&rsquo;</dt>
  404. <dd><p>Enables shifting when required by the target format.
  405. </p></dd>
  406. <dt>&lsquo;<samp>disabled</samp>&rsquo;</dt>
  407. <dd><p>Disables shifting of timestamp.
  408. </p></dd>
  409. </dl>
  410. <p>When shifting is enabled, all output timestamps are shifted by the
  411. same amount. Audio, video, and subtitles desynching and relative
  412. timestamp differences are preserved compared to how they would have
  413. been without shifting.
  414. </p>
  415. </dd>
  416. <dt>&lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  417. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  418. Default is 0.
  419. </p>
  420. </dd>
  421. <dt>&lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  422. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  423. </p>
  424. </dd>
  425. <dt>&lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  426. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  427. means that the underlying protocol will decide, 1 enables it, and has the
  428. effect of reducing the latency, 0 disables it and may increase IO throughput in
  429. some cases.
  430. </p>
  431. </dd>
  432. <dt>&lsquo;<samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp>&rsquo;</dt>
  433. <dd><p>Set the output time offset.
  434. </p>
  435. <p><var>offset</var> must be a time duration specification,
  436. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  437. </p>
  438. <p>The offset is added by the muxer to the output timestamps.
  439. </p>
  440. <p>Specifying a positive offset means that the corresponding streams are
  441. delayed bt the time duration specified in <var>offset</var>. Default value
  442. is <code>0</code> (meaning that no offset is applied).
  443. </p>
  444. </dd>
  445. <dt>&lsquo;<samp>format_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  446. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  447. </p>
  448. </dd>
  449. <dt>&lsquo;<samp>dump_separator <var>string</var> (<em>input</em>)</samp>&rsquo;</dt>
  450. <dd><p>Separator used to separate the fields printed on the command line about the
  451. Stream parameters.
  452. For example, to separate the fields with newlines and indentation:
  453. </p><div class="example">
  454. <pre class="example">ffprobe -dump_separator &quot;
  455. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  456. </pre></div>
  457. </dd>
  458. <dt>&lsquo;<samp>max_streams <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  459. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  460. would require too many resources due to a large number of streams.
  461. </p>
  462. </dd>
  463. <dt>&lsquo;<samp>skip_estimate_duration_from_pts <var>bool</var> (<em>input</em>)</samp>&rsquo;</dt>
  464. <dd><p>Skip estimation of input duration when calculated using PTS.
  465. At present, applicable for MPEG-PS and MPEG-TS.
  466. </p>
  467. </dd>
  468. <dt>&lsquo;<samp>strict, f_strict <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  469. <dd><p>Specify how strictly to follow the standards. <code>f_strict</code> is deprecated and
  470. should be used only via the <code>ffmpeg</code> tool.
  471. </p>
  472. <p>Possible values:
  473. </p><dl compact="compact">
  474. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  475. <dd><p>strictly conform to an older more strict version of the spec or reference software
  476. </p></dd>
  477. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  478. <dd><p>strictly conform to all the things in the spec no matter what consequences
  479. </p></dd>
  480. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  481. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  482. <dd><p>allow unofficial extensions
  483. </p></dd>
  484. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  485. <dd><p>allow non standardized experimental things, experimental
  486. (unfinished/work in progress/not well tested) decoders and encoders.
  487. Note: experimental decoders can pose a security risk, do not use this for
  488. decoding untrusted input.
  489. </p></dd>
  490. </dl>
  491. </dd>
  492. </dl>
  493. <p><a name="Format-stream-specifiers"></a>
  494. </p><a name="Format-stream-specifiers-1"></a>
  495. <h2 class="section"><a href="ffmpeg-formats.html#toc-Format-stream-specifiers-1">2.1 Format stream specifiers</a></h2>
  496. <p>Format stream specifiers allow selection of one or more streams that
  497. match specific properties.
  498. </p>
  499. <p>The exact semantics of stream specifiers is defined by the
  500. <code>avformat_match_stream_specifier()</code> function declared in the
  501. &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header and documented in the
  502. <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)Stream specifiers section in the ffmpeg(1) manual</a>.
  503. </p>
  504. <a name="Demuxers"></a>
  505. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Demuxers">3 Demuxers</a></h1>
  506. <p>Demuxers are configured elements in FFmpeg that can read the
  507. multimedia streams from a particular type of file.
  508. </p>
  509. <p>When you configure your FFmpeg build, all the supported demuxers
  510. are enabled by default. You can list all available ones using the
  511. configure option <code>--list-demuxers</code>.
  512. </p>
  513. <p>You can disable all the demuxers using the configure option
  514. <code>--disable-demuxers</code>, and selectively enable a single demuxer with
  515. the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
  516. with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
  517. </p>
  518. <p>The option <code>-demuxers</code> of the ff* tools will display the list of
  519. enabled demuxers. Use <code>-formats</code> to view a combined list of
  520. enabled demuxers and muxers.
  521. </p>
  522. <p>The description of some of the currently available demuxers follows.
  523. </p>
  524. <a name="aa"></a>
  525. <h2 class="section"><a href="ffmpeg-formats.html#toc-aa">3.1 aa</a></h2>
  526. <p>Audible Format 2, 3, and 4 demuxer.
  527. </p>
  528. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  529. </p>
  530. <a name="apng"></a>
  531. <h2 class="section"><a href="ffmpeg-formats.html#toc-apng">3.2 apng</a></h2>
  532. <p>Animated Portable Network Graphics demuxer.
  533. </p>
  534. <p>This demuxer is used to demux APNG files.
  535. All headers, but the PNG signature, up to (but not including) the first
  536. fcTL chunk are transmitted as extradata.
  537. Frames are then split as being all the chunks between two fcTL ones, or
  538. between the last fcTL and IEND chunks.
  539. </p>
  540. <dl compact="compact">
  541. <dt>&lsquo;<samp>-ignore_loop <var>bool</var></samp>&rsquo;</dt>
  542. <dd><p>Ignore the loop variable in the file if set.
  543. </p></dd>
  544. <dt>&lsquo;<samp>-max_fps <var>int</var></samp>&rsquo;</dt>
  545. <dd><p>Maximum framerate in frames per second (0 for no limit).
  546. </p></dd>
  547. <dt>&lsquo;<samp>-default_fps <var>int</var></samp>&rsquo;</dt>
  548. <dd><p>Default framerate in frames per second when none is specified in the file
  549. (0 meaning as fast as possible).
  550. </p></dd>
  551. </dl>
  552. <a name="asf-2"></a>
  553. <h2 class="section"><a href="ffmpeg-formats.html#toc-asf-2">3.3 asf</a></h2>
  554. <p>Advanced Systems Format demuxer.
  555. </p>
  556. <p>This demuxer is used to demux ASF files and MMS network streams.
  557. </p>
  558. <dl compact="compact">
  559. <dt>&lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
  560. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  561. </p></dd>
  562. </dl>
  563. <p><a name="concat"></a>
  564. </p><a name="concat-1"></a>
  565. <h2 class="section"><a href="ffmpeg-formats.html#toc-concat-1">3.4 concat</a></h2>
  566. <p>Virtual concatenation script demuxer.
  567. </p>
  568. <p>This demuxer reads a list of files and other directives from a text file and
  569. demuxes them one after the other, as if all their packets had been muxed
  570. together.
  571. </p>
  572. <p>The timestamps in the files are adjusted so that the first file starts at 0
  573. and each next file starts where the previous one finishes. Note that it is
  574. done globally and may cause gaps if all streams do not have exactly the same
  575. length.
  576. </p>
  577. <p>All files must have the same streams (same codecs, same time base, etc.).
  578. </p>
  579. <p>The duration of each file is used to adjust the timestamps of the next file:
  580. if the duration is incorrect (because it was computed using the bit-rate or
  581. because the file is truncated, for example), it can cause artifacts. The
  582. <code>duration</code> directive can be used to override the duration stored in
  583. each file.
  584. </p>
  585. <a name="Syntax"></a>
  586. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Syntax">3.4.1 Syntax</a></h3>
  587. <p>The script is a text file in extended-ASCII, with one directive per line.
  588. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  589. following directive is recognized:
  590. </p>
  591. <dl compact="compact">
  592. <dt>&lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
  593. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  594. backslash or single quotes.
  595. </p>
  596. <p>All subsequent file-related directives apply to that file.
  597. </p>
  598. </dd>
  599. <dt>&lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
  600. <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
  601. to 1 if it was -1.
  602. </p>
  603. <p>To make FFmpeg recognize the format automatically, this directive must
  604. appear exactly as is (no extra space or byte-order-mark) on the very first
  605. line of the script.
  606. </p>
  607. </dd>
  608. <dt>&lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</dt>
  609. <dd><p>Duration of the file. This information can be specified from the file;
  610. specifying it here may be more efficient or help if the information from the
  611. file is not available or accurate.
  612. </p>
  613. <p>If the duration is set for all files, then it is possible to seek in the
  614. whole concatenated video.
  615. </p>
  616. </dd>
  617. <dt>&lsquo;<samp><code>inpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  618. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  619. specified timestamp. Seeking is done so that all streams can be presented
  620. successfully at In point.
  621. </p>
  622. <p>This directive works best with intra frame codecs, because for non-intra frame
  623. ones you will usually get extra packets before the actual In point and the
  624. decoded content will most likely contain frames before In point too.
  625. </p>
  626. <p>For each file, packets before the file In point will have timestamps less than
  627. the calculated start timestamp of the file (negative in case of the first
  628. file), and the duration of the files (if not specified by the <code>duration</code>
  629. directive) will be reduced based on their specified In point.
  630. </p>
  631. <p>Because of potential packets before the specified In point, packet timestamps
  632. may overlap between two concatenated files.
  633. </p>
  634. </dd>
  635. <dt>&lsquo;<samp><code>outpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  636. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  637. timestamp in any of the streams, it handles it as an end of file condition and
  638. skips the current and all the remaining packets from all streams.
  639. </p>
  640. <p>Out point is exclusive, which means that the demuxer will not output packets
  641. with a decoding timestamp greater or equal to Out point.
  642. </p>
  643. <p>This directive works best with intra frame codecs and formats where all streams
  644. are tightly interleaved. For non-intra frame codecs you will usually get
  645. additional packets with presentation timestamp after Out point therefore the
  646. decoded content will most likely contain frames after Out point too. If your
  647. streams are not tightly interleaved you may not get all the packets from all
  648. streams before Out point and you may only will be able to decode the earliest
  649. stream until Out point.
  650. </p>
  651. <p>The duration of the files (if not specified by the <code>duration</code>
  652. directive) will be reduced based on their specified Out point.
  653. </p>
  654. </dd>
  655. <dt>&lsquo;<samp><code>file_packet_metadata <var>key=value</var></code></samp>&rsquo;</dt>
  656. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  657. each file packet. You can specify this directive multiple times to add multiple
  658. metadata entries.
  659. </p>
  660. </dd>
  661. <dt>&lsquo;<samp><code>stream</code></samp>&rsquo;</dt>
  662. <dd><p>Introduce a stream in the virtual file.
  663. All subsequent stream-related directives apply to the last introduced
  664. stream.
  665. Some streams properties must be set in order to allow identifying the
  666. matching streams in the subfiles.
  667. If no streams are defined in the script, the streams from the first file are
  668. copied.
  669. </p>
  670. </dd>
  671. <dt>&lsquo;<samp><code>exact_stream_id <var>id</var></code></samp>&rsquo;</dt>
  672. <dd><p>Set the id of the stream.
  673. If this directive is given, the string with the corresponding id in the
  674. subfiles will be used.
  675. This is especially useful for MPEG-PS (VOB) files, where the order of the
  676. streams is not reliable.
  677. </p>
  678. </dd>
  679. </dl>
  680. <a name="Options-3"></a>
  681. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-3">3.4.2 Options</a></h3>
  682. <p>This demuxer accepts the following option:
  683. </p>
  684. <dl compact="compact">
  685. <dt>&lsquo;<samp>safe</samp>&rsquo;</dt>
  686. <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
  687. does not contain a protocol specification and is relative and all components
  688. only contain characters from the portable character set (letters, digits,
  689. period, underscore and hyphen) and have no period at the beginning of a
  690. component.
  691. </p>
  692. <p>If set to 0, any file name is accepted.
  693. </p>
  694. <p>The default is 1.
  695. </p>
  696. <p>-1 is equivalent to 1 if the format was automatically
  697. probed and 0 otherwise.
  698. </p>
  699. </dd>
  700. <dt>&lsquo;<samp>auto_convert</samp>&rsquo;</dt>
  701. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  702. streams concatenable.
  703. The default is 1.
  704. </p>
  705. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  706. filter to H.264 streams in MP4 format. This is necessary in particular if
  707. there are resolution changes.
  708. </p>
  709. </dd>
  710. <dt>&lsquo;<samp>segment_time_metadata</samp>&rsquo;</dt>
  711. <dd><p>If set to 1, every packet will contain the <var>lavf.concat.start_time</var> and the
  712. <var>lavf.concat.duration</var> packet metadata values which are the start_time and
  713. the duration of the respective file segments in the concatenated output
  714. expressed in microseconds. The duration metadata is only set if it is known
  715. based on the concat file.
  716. The default is 0.
  717. </p>
  718. </dd>
  719. </dl>
  720. <a name="Examples-8"></a>
  721. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-8">3.4.3 Examples</a></h3>
  722. <ul>
  723. <li>
  724. Use absolute filenames and include some comments:
  725. <div class="example">
  726. <pre class="example"># my first filename
  727. file /mnt/share/file-1.wav
  728. # my second filename including whitespace
  729. file '/mnt/share/file 2.wav'
  730. # my third filename including whitespace plus single quote
  731. file '/mnt/share/file 3'\''.wav'
  732. </pre></div>
  733. </li><li>
  734. Allow for input format auto-probing, use safe filenames and set the duration of
  735. the first file:
  736. <div class="example">
  737. <pre class="example">ffconcat version 1.0
  738. file file-1.wav
  739. duration 20.0
  740. file subdir/file-2.wav
  741. </pre></div>
  742. </li></ul>
  743. <a name="dash-2"></a>
  744. <h2 class="section"><a href="ffmpeg-formats.html#toc-dash-2">3.5 dash</a></h2>
  745. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  746. </p>
  747. <p>This demuxer presents all AVStreams found in the manifest.
  748. By setting the discard flags on AVStreams the caller can decide
  749. which streams to actually receive.
  750. Each stream mirrors the <code>id</code> and <code>bandwidth</code> properties from the
  751. <code>&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  752. </p>
  753. <a name="flv_002c-live_005fflv"></a>
  754. <h2 class="section"><a href="ffmpeg-formats.html#toc-flv_002c-live_005fflv">3.6 flv, live_flv</a></h2>
  755. <p>Adobe Flash Video Format demuxer.
  756. </p>
  757. <p>This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities.
  758. </p>
  759. <div class="example">
  760. <pre class="example">ffmpeg -f flv -i myfile.flv ...
  761. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  762. </pre></div>
  763. <dl compact="compact">
  764. <dt>&lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
  765. <dd><p>Allocate the streams according to the onMetaData array content.
  766. </p>
  767. </dd>
  768. <dt>&lsquo;<samp>-flv_ignore_prevtag <var>bool</var></samp>&rsquo;</dt>
  769. <dd><p>Ignore the size of previous tag value.
  770. </p>
  771. </dd>
  772. <dt>&lsquo;<samp>-flv_full_metadata <var>bool</var></samp>&rsquo;</dt>
  773. <dd><p>Output all context of the onMetadata.
  774. </p></dd>
  775. </dl>
  776. <a name="gif-1"></a>
  777. <h2 class="section"><a href="ffmpeg-formats.html#toc-gif-1">3.7 gif</a></h2>
  778. <p>Animated GIF demuxer.
  779. </p>
  780. <p>It accepts the following options:
  781. </p>
  782. <dl compact="compact">
  783. <dt>&lsquo;<samp>min_delay</samp>&rsquo;</dt>
  784. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  785. Range is 0 to 6000. Default value is 2.
  786. </p>
  787. </dd>
  788. <dt>&lsquo;<samp>max_gif_delay</samp>&rsquo;</dt>
  789. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  790. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  791. the maximum value allowed by the specification.
  792. </p>
  793. </dd>
  794. <dt>&lsquo;<samp>default_delay</samp>&rsquo;</dt>
  795. <dd><p>Set the default delay between frames in hundredths of seconds.
  796. Range is 0 to 6000. Default value is 10.
  797. </p>
  798. </dd>
  799. <dt>&lsquo;<samp>ignore_loop</samp>&rsquo;</dt>
  800. <dd><p>GIF files can contain information to loop a certain number of times (or
  801. infinitely). If &lsquo;<samp>ignore_loop</samp>&rsquo; is set to 1, then the loop setting
  802. from the input will be ignored and looping will not occur. If set to 0,
  803. then looping will occur and will cycle the number of times according to
  804. the GIF. Default value is 1.
  805. </p></dd>
  806. </dl>
  807. <p>For example, with the overlay filter, place an infinitely looping GIF
  808. over another video:
  809. </p><div class="example">
  810. <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  811. </pre></div>
  812. <p>Note that in the above example the shortest option for overlay filter is
  813. used to end the output video at the length of the shortest input file,
  814. which in this case is &lsquo;<tt>input.mp4</tt>&rsquo; as the GIF in this example loops
  815. infinitely.
  816. </p>
  817. <a name="hls-1"></a>
  818. <h2 class="section"><a href="ffmpeg-formats.html#toc-hls-1">3.8 hls</a></h2>
  819. <p>HLS demuxer
  820. </p>
  821. <p>Apple HTTP Live Streaming demuxer.
  822. </p>
  823. <p>This demuxer presents all AVStreams from all variant streams.
  824. The id field is set to the bitrate variant index number. By setting
  825. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  826. the caller can decide which variant streams to actually receive.
  827. The total bitrate of the variant that the stream belongs to is
  828. available in a metadata key named &quot;variant_bitrate&quot;.
  829. </p>
  830. <p>It accepts the following options:
  831. </p>
  832. <dl compact="compact">
  833. <dt>&lsquo;<samp>live_start_index</samp>&rsquo;</dt>
  834. <dd><p>segment index to start live streams at (negative values are from the end).
  835. </p>
  836. </dd>
  837. <dt>&lsquo;<samp>allowed_extensions</samp>&rsquo;</dt>
  838. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  839. </p>
  840. </dd>
  841. <dt>&lsquo;<samp>max_reload</samp>&rsquo;</dt>
  842. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  843. Default value is 1000.
  844. </p>
  845. </dd>
  846. <dt>&lsquo;<samp>m3u8_hold_counters</samp>&rsquo;</dt>
  847. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  848. Default value is 1000.
  849. </p>
  850. </dd>
  851. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  852. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  853. Enabled by default.
  854. </p>
  855. </dd>
  856. <dt>&lsquo;<samp>http_multiple</samp>&rsquo;</dt>
  857. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  858. Enabled by default for HTTP/1.1 servers.
  859. </p>
  860. </dd>
  861. <dt>&lsquo;<samp>http_seekable</samp>&rsquo;</dt>
  862. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  863. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  864. </p></dd>
  865. </dl>
  866. <a name="image2-1"></a>
  867. <h2 class="section"><a href="ffmpeg-formats.html#toc-image2-1">3.9 image2</a></h2>
  868. <p>Image file demuxer.
  869. </p>
  870. <p>This demuxer reads from a list of image files specified by a pattern.
  871. The syntax and meaning of the pattern is specified by the
  872. option <var>pattern_type</var>.
  873. </p>
  874. <p>The pattern may contain a suffix which is used to automatically
  875. determine the format of the images contained in the files.
  876. </p>
  877. <p>The size, the pixel format, and the format of each image must be the
  878. same for all the files in the sequence.
  879. </p>
  880. <p>This demuxer accepts the following options:
  881. </p><dl compact="compact">
  882. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  883. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  884. </p></dd>
  885. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  886. <dd><p>If set to 1, loop over the input. Default value is 0.
  887. </p></dd>
  888. <dt>&lsquo;<samp>pattern_type</samp>&rsquo;</dt>
  889. <dd><p>Select the pattern type used to interpret the provided filename.
  890. </p>
  891. <p><var>pattern_type</var> accepts one of the following values.
  892. </p><dl compact="compact">
  893. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  894. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  895. image. You should use this option if you do not want to create sequences from
  896. multiple images and your filenames may contain special pattern characters.
  897. </p></dd>
  898. <dt>&lsquo;<samp>sequence</samp>&rsquo;</dt>
  899. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  900. indexed by sequential numbers.
  901. </p>
  902. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
  903. specifies the position of the characters representing a sequential
  904. number in each filename matched by the pattern. If the form
  905. &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
  906. filename is 0-padded and <var>N</var> is the total number of 0-padded
  907. digits representing the number. The literal character &rsquo;%&rsquo; can be
  908. specified in the pattern with the string &quot;%%&quot;.
  909. </p>
  910. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  911. the file list specified by the pattern must contain a number
  912. inclusively contained between <var>start_number</var> and
  913. <var>start_number</var>+<var>start_number_range</var>-1, and all the following
  914. numbers must be sequential.
  915. </p>
  916. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  917. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  918. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  919. sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
  920. &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
  921. </p>
  922. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  923. &quot;%0<var>N</var>d&quot;, for example to convert a single image file
  924. &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
  925. </p><div class="example">
  926. <pre class="example">ffmpeg -i img.jpeg img.png
  927. </pre></div>
  928. </dd>
  929. <dt>&lsquo;<samp>glob</samp>&rsquo;</dt>
  930. <dd><p>Select a glob wildcard pattern type.
  931. </p>
  932. <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
  933. selectable if libavformat was compiled with globbing support.
  934. </p>
  935. </dd>
  936. <dt>&lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
  937. <dd><p>Select a mixed glob wildcard/sequence pattern.
  938. </p>
  939. <p>If your version of libavformat was compiled with globbing support, and
  940. the provided pattern contains at least one glob meta character among
  941. <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  942. interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
  943. like a sequence pattern.
  944. </p>
  945. <p>All glob special characters <code>%*?[]{}</code> must be prefixed
  946. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  947. </p>
  948. <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
  949. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  950. <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  951. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  952. with &quot;.jpeg&quot;.
  953. </p>
  954. <p>This pattern type is deprecated in favor of <var>glob</var> and
  955. <var>sequence</var>.
  956. </p></dd>
  957. </dl>
  958. <p>Default value is <var>glob_sequence</var>.
  959. </p></dd>
  960. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  961. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  962. format is guessed from the first image file in the sequence.
  963. </p></dd>
  964. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  965. <dd><p>Set the index of the file matched by the image file pattern to start
  966. to read from. Default value is 0.
  967. </p></dd>
  968. <dt>&lsquo;<samp>start_number_range</samp>&rsquo;</dt>
  969. <dd><p>Set the index interval range to check when looking for the first image
  970. file in the sequence, starting from <var>start_number</var>. Default value
  971. is 5.
  972. </p></dd>
  973. <dt>&lsquo;<samp>ts_from_file</samp>&rsquo;</dt>
  974. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  975. that monotonity of timestamps is not provided: images go in the same order as
  976. without this option. Default value is 0.
  977. If set to 2, will set frame timestamp to the modification time of the image file in
  978. nanosecond precision.
  979. </p></dd>
  980. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  981. <dd><p>Set the video size of the images to read. If not specified the video
  982. size is guessed from the first image file in the sequence.
  983. </p></dd>
  984. <dt>&lsquo;<samp>export_path_metadata</samp>&rsquo;</dt>
  985. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  986. also available for other filters (see <var>drawtext</var> filter for examples). Default
  987. value is 0. The extra fields are described below:
  988. </p><dl compact="compact">
  989. <dt>&lsquo;<samp>lavf.image2dec.source_path</samp>&rsquo;</dt>
  990. <dd><p>Corresponds to the full path to the input file being read.
  991. </p></dd>
  992. <dt>&lsquo;<samp>lavf.image2dec.source_basename</samp>&rsquo;</dt>
  993. <dd><p>Corresponds to the name of the file being read.
  994. </p></dd>
  995. </dl>
  996. </dd>
  997. </dl>
  998. <a name="Examples-6"></a>
  999. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-6">3.9.1 Examples</a></h3>
  1000. <ul>
  1001. <li>
  1002. Use <code>ffmpeg</code> for creating a video from the images in the file
  1003. sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
  1004. input frame rate of 10 frames per second:
  1005. <div class="example">
  1006. <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  1007. </pre></div>
  1008. </li><li>
  1009. As above, but start by reading from a file with index 100 in the sequence:
  1010. <div class="example">
  1011. <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  1012. </pre></div>
  1013. </li><li>
  1014. Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  1015. terminating with the &quot;.png&quot; suffix:
  1016. <div class="example">
  1017. <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  1018. </pre></div>
  1019. </li></ul>
  1020. <a name="libgme"></a>
  1021. <h2 class="section"><a href="ffmpeg-formats.html#toc-libgme">3.10 libgme</a></h2>
  1022. <p>The Game Music Emu library is a collection of video game music file emulators.
  1023. </p>
  1024. <p>See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  1025. </p>
  1026. <p>It accepts the following options:
  1027. </p>
  1028. <dl compact="compact">
  1029. <dt>&lsquo;<samp>track_index</samp>&rsquo;</dt>
  1030. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  1031. Track indexes start at 0. Default is to pick the first track. Number of tracks
  1032. is exported as <var>tracks</var> metadata entry.
  1033. </p>
  1034. </dd>
  1035. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  1036. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  1037. </p>
  1038. </dd>
  1039. <dt>&lsquo;<samp>max_size <em>(bytes)</em></samp>&rsquo;</dt>
  1040. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1041. which in turn, acts as a ceiling for the size of files that can be read.
  1042. Default is 50 MiB.
  1043. </p>
  1044. </dd>
  1045. </dl>
  1046. <a name="libmodplug"></a>
  1047. <h2 class="section"><a href="ffmpeg-formats.html#toc-libmodplug">3.11 libmodplug</a></h2>
  1048. <p>ModPlug based module demuxer
  1049. </p>
  1050. <p>See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  1051. </p>
  1052. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  1053. Optionally, a <code>pal8</code> 16-color video stream can be exported with or without printed metadata.
  1054. </p>
  1055. <p>It accepts the following options:
  1056. </p>
  1057. <dl compact="compact">
  1058. <dt>&lsquo;<samp>noise_reduction</samp>&rsquo;</dt>
  1059. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  1060. </p>
  1061. </dd>
  1062. <dt>&lsquo;<samp>reverb_depth</samp>&rsquo;</dt>
  1063. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  1064. </p>
  1065. </dd>
  1066. <dt>&lsquo;<samp>reverb_delay</samp>&rsquo;</dt>
  1067. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  1068. </p>
  1069. </dd>
  1070. <dt>&lsquo;<samp>bass_amount</samp>&rsquo;</dt>
  1071. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  1072. </p>
  1073. </dd>
  1074. <dt>&lsquo;<samp>bass_range</samp>&rsquo;</dt>
  1075. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  1076. </p>
  1077. </dd>
  1078. <dt>&lsquo;<samp>surround_depth</samp>&rsquo;</dt>
  1079. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  1080. </p>
  1081. </dd>
  1082. <dt>&lsquo;<samp>surround_delay</samp>&rsquo;</dt>
  1083. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  1084. </p>
  1085. </dd>
  1086. <dt>&lsquo;<samp>max_size</samp>&rsquo;</dt>
  1087. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1088. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  1089. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  1090. </p>
  1091. </dd>
  1092. <dt>&lsquo;<samp>video_stream_expr</samp>&rsquo;</dt>
  1093. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  1094. Variables which can be used are <code>x</code>, <code>y</code>, <code>w</code>, <code>h</code>, <code>t</code>, <code>speed</code>,
  1095. <code>tempo</code>, <code>order</code>, <code>pattern</code> and <code>row</code>.
  1096. </p>
  1097. </dd>
  1098. <dt>&lsquo;<samp>video_stream</samp>&rsquo;</dt>
  1099. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  1100. </p>
  1101. </dd>
  1102. <dt>&lsquo;<samp>video_stream_w</samp>&rsquo;</dt>
  1103. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1104. </p>
  1105. </dd>
  1106. <dt>&lsquo;<samp>video_stream_h</samp>&rsquo;</dt>
  1107. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1108. </p>
  1109. </dd>
  1110. <dt>&lsquo;<samp>video_stream_ptxt</samp>&rsquo;</dt>
  1111. <dd><p>Print metadata on video stream. Includes <code>speed</code>, <code>tempo</code>, <code>order</code>, <code>pattern</code>,
  1112. <code>row</code> and <code>ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  1113. </p>
  1114. </dd>
  1115. </dl>
  1116. <a name="libopenmpt"></a>
  1117. <h2 class="section"><a href="ffmpeg-formats.html#toc-libopenmpt">3.12 libopenmpt</a></h2>
  1118. <p>libopenmpt based module demuxer
  1119. </p>
  1120. <p>See <a href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  1121. </p>
  1122. <p>Some files have multiple subsongs (tracks) this can be set with the &lsquo;<samp>subsong</samp>&rsquo;
  1123. option.
  1124. </p>
  1125. <p>It accepts the following options:
  1126. </p>
  1127. <dl compact="compact">
  1128. <dt>&lsquo;<samp>subsong</samp>&rsquo;</dt>
  1129. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  1130. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  1131. </p>
  1132. <p>The default value is to let libopenmpt choose.
  1133. </p>
  1134. </dd>
  1135. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  1136. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  1137. The default value is STEREO.
  1138. </p>
  1139. </dd>
  1140. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  1141. <dd><p>Set the sample rate for libopenmpt to output.
  1142. Range is from 1000 to INT_MAX. The value default is 48000.
  1143. </p></dd>
  1144. </dl>
  1145. <a name="mov_002fmp4_002f3gp"></a>
  1146. <h2 class="section"><a href="ffmpeg-formats.html#toc-mov_002fmp4_002f3gp">3.13 mov/mp4/3gp</a></h2>
  1147. <p>Demuxer for Quicktime File Format &amp; ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
  1148. </p>
  1149. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  1150. </p>
  1151. <a name="Options"></a>
  1152. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options">3.13.1 Options</a></h3>
  1153. <p>This demuxer accepts the following options:
  1154. </p><dl compact="compact">
  1155. <dt>&lsquo;<samp>enable_drefs</samp>&rsquo;</dt>
  1156. <dd><p>Enable loading of external tracks, disabled by default.
  1157. Enabling this can theoretically leak information in some use cases.
  1158. </p>
  1159. </dd>
  1160. <dt>&lsquo;<samp>use_absolute_path</samp>&rsquo;</dt>
  1161. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  1162. Enabling this poses a security risk. It should only be enabled if the source
  1163. is known to be non-malicious.
  1164. </p>
  1165. </dd>
  1166. <dt>&lsquo;<samp>seek_streams_individually</samp>&rsquo;</dt>
  1167. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  1168. that stream from identified point. This can lead to a different sequence of packets compared
  1169. to demuxing linearly from the beginning. Default is true.
  1170. </p>
  1171. </dd>
  1172. <dt>&lsquo;<samp>ignore_editlist</samp>&rsquo;</dt>
  1173. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  1174. timeline described by the edit list. Default is false.
  1175. </p>
  1176. </dd>
  1177. <dt>&lsquo;<samp>advanced_editlist</samp>&rsquo;</dt>
  1178. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code>ignore_editlist</code>
  1179. must be set to false for this option to be effective.
  1180. If both <code>ignore_editlist</code> and this option are set to false, then only the
  1181. start of the stream index is modified to reflect initial dwell time or starting timestamp
  1182. described by the edit list. Default is true.
  1183. </p>
  1184. </dd>
  1185. <dt>&lsquo;<samp>ignore_chapters</samp>&rsquo;</dt>
  1186. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  1187. only parsed when input is seekable. Default is false.
  1188. </p>
  1189. </dd>
  1190. <dt>&lsquo;<samp>use_mfra_for</samp>&rsquo;</dt>
  1191. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  1192. </p>
  1193. <p>Following options are available:
  1194. </p><dl compact="compact">
  1195. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  1196. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em>(default)</em>
  1197. </p>
  1198. </dd>
  1199. <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
  1200. <dd><p>Set mfra timestamps as DTS
  1201. </p>
  1202. </dd>
  1203. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  1204. <dd><p>Set mfra timestamps as PTS
  1205. </p>
  1206. </dd>
  1207. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  1208. <dd><p>Don&rsquo;t use mfra box to set timestamps
  1209. </p></dd>
  1210. </dl>
  1211. </dd>
  1212. <dt>&lsquo;<samp>export_all</samp>&rsquo;</dt>
  1213. <dd><p>Export unrecognized boxes within the <var>udta</var> box as metadata entries. The first four
  1214. characters of the box type are set as the key. Default is false.
  1215. </p>
  1216. </dd>
  1217. <dt>&lsquo;<samp>export_xmp</samp>&rsquo;</dt>
  1218. <dd><p>Export entire contents of <var>XMP_</var> box and <var>uuid</var> box as a string with key <code>xmp</code>. Note that
  1219. if <code>export_all</code> is set and this option isn&rsquo;t, the contents of <var>XMP_</var> box are still exported
  1220. but with key <code>XMP_</code>. Default is false.
  1221. </p>
  1222. </dd>
  1223. <dt>&lsquo;<samp>activation_bytes</samp>&rsquo;</dt>
  1224. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  1225. </p>
  1226. </dd>
  1227. <dt>&lsquo;<samp>audible_fixed_key</samp>&rsquo;</dt>
  1228. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  1229. specify.
  1230. </p>
  1231. </dd>
  1232. <dt>&lsquo;<samp>decryption_key</samp>&rsquo;</dt>
  1233. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  1234. </p></dd>
  1235. </dl>
  1236. <a name="Audible-AAX"></a>
  1237. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Audible-AAX">3.13.2 Audible AAX</a></h3>
  1238. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  1239. </p><div class="example">
  1240. <pre class="example">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  1241. </pre></div>
  1242. <a name="mpegts-1"></a>
  1243. <h2 class="section"><a href="ffmpeg-formats.html#toc-mpegts-1">3.14 mpegts</a></h2>
  1244. <p>MPEG-2 transport stream demuxer.
  1245. </p>
  1246. <p>This demuxer accepts the following options:
  1247. </p><dl compact="compact">
  1248. <dt>&lsquo;<samp>resync_size</samp>&rsquo;</dt>
  1249. <dd><p>Set size limit for looking up a new synchronization. Default value is
  1250. 65536.
  1251. </p>
  1252. </dd>
  1253. <dt>&lsquo;<samp>skip_unknown_pmt</samp>&rsquo;</dt>
  1254. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  1255. </p>
  1256. </dd>
  1257. <dt>&lsquo;<samp>fix_teletext_pts</samp>&rsquo;</dt>
  1258. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  1259. from the PCR of the first program which the teletext stream is part of and is
  1260. not discarded. Default value is 1, set this option to 0 if you want your
  1261. teletext packet PTS and DTS values untouched.
  1262. </p>
  1263. </dd>
  1264. <dt>&lsquo;<samp>ts_packetsize</samp>&rsquo;</dt>
  1265. <dd><p>Output option carrying the raw packet size in bytes.
  1266. Show the detected raw packet size, cannot be set by the user.
  1267. </p>
  1268. </dd>
  1269. <dt>&lsquo;<samp>scan_all_pmts</samp>&rsquo;</dt>
  1270. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  1271. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  1272. disabled). Default value is -1.
  1273. </p>
  1274. </dd>
  1275. <dt>&lsquo;<samp>merge_pmt_versions</samp>&rsquo;</dt>
  1276. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  1277. streams move to different PIDs. Default value is 0.
  1278. </p></dd>
  1279. </dl>
  1280. <a name="mpjpeg"></a>
  1281. <h2 class="section"><a href="ffmpeg-formats.html#toc-mpjpeg">3.15 mpjpeg</a></h2>
  1282. <p>MJPEG encapsulated in multi-part MIME demuxer.
  1283. </p>
  1284. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  1285. multipart/x-mixed-replace stream.
  1286. </p><dl compact="compact">
  1287. <dt>&lsquo;<samp>strict_mime_boundary</samp>&rsquo;</dt>
  1288. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  1289. to prevent regression with numerous existing endpoints not generating a proper MIME
  1290. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  1291. of the boundary value.
  1292. </p></dd>
  1293. </dl>
  1294. <a name="rawvideo"></a>
  1295. <h2 class="section"><a href="ffmpeg-formats.html#toc-rawvideo">3.16 rawvideo</a></h2>
  1296. <p>Raw video demuxer.
  1297. </p>
  1298. <p>This demuxer allows one to read raw video data. Since there is no header
  1299. specifying the assumed video parameters, the user must specify them
  1300. in order to be able to decode the data correctly.
  1301. </p>
  1302. <p>This demuxer accepts the following options:
  1303. </p><dl compact="compact">
  1304. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  1305. <dd><p>Set input video frame rate. Default value is 25.
  1306. </p>
  1307. </dd>
  1308. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  1309. <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
  1310. </p>
  1311. </dd>
  1312. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  1313. <dd><p>Set the input video size. This value must be specified explicitly.
  1314. </p></dd>
  1315. </dl>
  1316. <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; with
  1317. <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
  1318. size of <code>320x240</code>, and a frame rate of 10 images per second, use
  1319. the command:
  1320. </p><div class="example">
  1321. <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  1322. </pre></div>
  1323. <a name="sbg"></a>
  1324. <h2 class="section"><a href="ffmpeg-formats.html#toc-sbg">3.17 sbg</a></h2>
  1325. <p>SBaGen script demuxer.
  1326. </p>
  1327. <p>This demuxer reads the script language used by SBaGen
  1328. <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  1329. script looks like that:
  1330. </p><div class="example">
  1331. <pre class="example">-SE
  1332. a: 300-2.5/3 440+4.5/0
  1333. b: 300-2.5/0 440+4.5/3
  1334. off: -
  1335. NOW == a
  1336. +0:07:00 == b
  1337. +0:14:00 == a
  1338. +0:21:00 == b
  1339. +0:30:00 off
  1340. </pre></div>
  1341. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  1342. either only absolute timestamps (including the script start time) or only
  1343. relative ones, then its layout is fixed, and the conversion is
  1344. straightforward. On the other hand, if the script mixes both kind of
  1345. timestamps, then the <var>NOW</var> reference for relative timestamps will be
  1346. taken from the current time of day at the time the script is read, and the
  1347. script layout will be frozen according to that reference. That means that if
  1348. the script is directly played, the actual times will match the absolute
  1349. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  1350. somehow pauses the playback or seeks, all times will be shifted accordingly.
  1351. </p>
  1352. <a name="tedcaptions"></a>
  1353. <h2 class="section"><a href="ffmpeg-formats.html#toc-tedcaptions">3.18 tedcaptions</a></h2>
  1354. <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
  1355. </p>
  1356. <p>TED does not provide links to the captions, but they can be guessed from the
  1357. page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
  1358. contains a bookmarklet to expose them.
  1359. </p>
  1360. <p>This demuxer accepts the following option:
  1361. </p><dl compact="compact">
  1362. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  1363. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  1364. (15s). It is used to sync the captions with the downloadable videos, because
  1365. they include a 15s intro.
  1366. </p></dd>
  1367. </dl>
  1368. <p>Example: convert the captions to a format most players understand:
  1369. </p><div class="example">
  1370. <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  1371. </pre></div>
  1372. <a name="vapoursynth"></a>
  1373. <h2 class="section"><a href="ffmpeg-formats.html#toc-vapoursynth">3.19 vapoursynth</a></h2>
  1374. <p>Vapoursynth wrapper.
  1375. </p>
  1376. <p>Due to security concerns, Vapoursynth scripts will not
  1377. be autodetected so the input format has to be forced. For ff* CLI tools,
  1378. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  1379. </p>
  1380. <p>This demuxer accepts the following option:
  1381. </p><dl compact="compact">
  1382. <dt>&lsquo;<samp>max_script_size</samp>&rsquo;</dt>
  1383. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  1384. which in turn, acts as a ceiling for the size of scripts that can be read.
  1385. Default is 1 MiB.
  1386. </p></dd>
  1387. </dl>
  1388. <a name="Muxers"></a>
  1389. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Muxers">4 Muxers</a></h1>
  1390. <p>Muxers are configured elements in FFmpeg which allow writing
  1391. multimedia streams to a particular type of file.
  1392. </p>
  1393. <p>When you configure your FFmpeg build, all the supported muxers
  1394. are enabled by default. You can list all available muxers using the
  1395. configure option <code>--list-muxers</code>.
  1396. </p>
  1397. <p>You can disable all the muxers with the configure option
  1398. <code>--disable-muxers</code> and selectively enable / disable single muxers
  1399. with the options <code>--enable-muxer=<var>MUXER</var></code> /
  1400. <code>--disable-muxer=<var>MUXER</var></code>.
  1401. </p>
  1402. <p>The option <code>-muxers</code> of the ff* tools will display the list of
  1403. enabled muxers. Use <code>-formats</code> to view a combined list of
  1404. enabled demuxers and muxers.
  1405. </p>
  1406. <p>A description of some of the currently available muxers follows.
  1407. </p>
  1408. <p><a name="aiff"></a>
  1409. </p><a name="aiff-1"></a>
  1410. <h2 class="section"><a href="ffmpeg-formats.html#toc-aiff-1">4.1 aiff</a></h2>
  1411. <p>Audio Interchange File Format muxer.
  1412. </p>
  1413. <a name="Options-14"></a>
  1414. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-14">4.1.1 Options</a></h3>
  1415. <p>It accepts the following options:
  1416. </p>
  1417. <dl compact="compact">
  1418. <dt>&lsquo;<samp>write_id3v2</samp>&rsquo;</dt>
  1419. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  1420. </p>
  1421. </dd>
  1422. <dt>&lsquo;<samp>id3v2_version</samp>&rsquo;</dt>
  1423. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  1424. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  1425. </p>
  1426. </dd>
  1427. </dl>
  1428. <p><a name="asf"></a>
  1429. </p><a name="asf-1"></a>
  1430. <h2 class="section"><a href="ffmpeg-formats.html#toc-asf-1">4.2 asf</a></h2>
  1431. <p>Advanced Systems Format muxer.
  1432. </p>
  1433. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  1434. muxer too.
  1435. </p>
  1436. <a name="Options-13"></a>
  1437. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-13">4.2.1 Options</a></h3>
  1438. <p>It accepts the following options:
  1439. </p>
  1440. <dl compact="compact">
  1441. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  1442. <dd><p>Set the muxer packet size. By tuning this setting you may reduce data
  1443. fragmentation or muxer overhead depending on your source. Default value is
  1444. 3200, minimum is 100, maximum is 64k.
  1445. </p>
  1446. </dd>
  1447. </dl>
  1448. <p><a name="avi"></a>
  1449. </p><a name="avi-1"></a>
  1450. <h2 class="section"><a href="ffmpeg-formats.html#toc-avi-1">4.3 avi</a></h2>
  1451. <p>Audio Video Interleaved muxer.
  1452. </p>
  1453. <a name="Options-6"></a>
  1454. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-6">4.3.1 Options</a></h3>
  1455. <p>It accepts the following options:
  1456. </p>
  1457. <dl compact="compact">
  1458. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  1459. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  1460. stream within the file header. By default additional master indexes are
  1461. embedded within the data packets if there is no space left in the first master
  1462. index and are linked together as a chain of indexes. This index structure can
  1463. cause problems for some use cases, e.g. third-party software strictly relying
  1464. on the OpenDML index specification or when file seeking is slow. Reserving
  1465. enough index space in the file header avoids these problems.
  1466. </p>
  1467. <p>The required index space depends on the output file size and should be about 16
  1468. bytes per gigabyte. When this option is omitted or set to zero the necessary
  1469. index space is guessed.
  1470. </p>
  1471. </dd>
  1472. <dt>&lsquo;<samp>write_channel_mask</samp>&rsquo;</dt>
  1473. <dd><p>Write the channel layout mask into the audio stream header.
  1474. </p>
  1475. <p>This option is enabled by default. Disabling the channel mask can be useful in
  1476. specific scenarios, e.g. when merging multiple audio streams into one for
  1477. compatibility with software that only supports a single audio stream in AVI
  1478. (see <a href="ffmpeg-filters.html#amerge">(ffmpeg-filters)the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  1479. </p>
  1480. </dd>
  1481. </dl>
  1482. <p><a name="chromaprint"></a>
  1483. </p><a name="chromaprint-1"></a>
  1484. <h2 class="section"><a href="ffmpeg-formats.html#toc-chromaprint-1">4.4 chromaprint</a></h2>
  1485. <p>Chromaprint fingerprinter.
  1486. </p>
  1487. <p>This muxer feeds audio data to the Chromaprint library,
  1488. which generates a fingerprint for the provided audio data. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  1489. </p>
  1490. <p>It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels.
  1491. </p>
  1492. <a name="Options-9"></a>
  1493. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-9">4.4.1 Options</a></h3>
  1494. <dl compact="compact">
  1495. <dt>&lsquo;<samp>silence_threshold</samp>&rsquo;</dt>
  1496. <dd><p>Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
  1497. silence detection. Silence detection can only be used with version 3 of the
  1498. algorithm.
  1499. Silence detection must be disabled for use with the AcoustID service. Default is -1.
  1500. </p>
  1501. </dd>
  1502. <dt>&lsquo;<samp>algorithm</samp>&rsquo;</dt>
  1503. <dd><p>Version of algorithm to fingerprint with. Range is 0 to 4.
  1504. Version 3 enables silence detection. Default is 1.
  1505. </p>
  1506. </dd>
  1507. <dt>&lsquo;<samp>fp_format</samp>&rsquo;</dt>
  1508. <dd><p>Format to output the fingerprint as. Accepts the following options:
  1509. </p><dl compact="compact">
  1510. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  1511. <dd><p>Binary raw fingerprint
  1512. </p>
  1513. </dd>
  1514. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  1515. <dd><p>Binary compressed fingerprint
  1516. </p>
  1517. </dd>
  1518. <dt>&lsquo;<samp>base64</samp>&rsquo;</dt>
  1519. <dd><p>Base64 compressed fingerprint <em>(default)</em>
  1520. </p>
  1521. </dd>
  1522. </dl>
  1523. </dd>
  1524. </dl>
  1525. <p><a name="crc"></a>
  1526. </p><a name="crc-1"></a>
  1527. <h2 class="section"><a href="ffmpeg-formats.html#toc-crc-1">4.5 crc</a></h2>
  1528. <p>CRC (Cyclic Redundancy Check) testing format.
  1529. </p>
  1530. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  1531. and video frames. By default audio frames are converted to signed
  1532. 16-bit raw audio and video frames to raw video before computing the
  1533. CRC.
  1534. </p>
  1535. <p>The output of the muxer consists of a single line of the form:
  1536. CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
  1537. 8 digits containing the CRC for all the decoded input frames.
  1538. </p>
  1539. <p>See also the <a href="#framecrc">framecrc</a> muxer.
  1540. </p>
  1541. <a name="Examples-1"></a>
  1542. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-1">4.5.1 Examples</a></h3>
  1543. <p>For example to compute the CRC of the input, and store it in the file
  1544. &lsquo;<tt>out.crc</tt>&rsquo;:
  1545. </p><div class="example">
  1546. <pre class="example">ffmpeg -i INPUT -f crc out.crc
  1547. </pre></div>
  1548. <p>You can print the CRC to stdout with the command:
  1549. </p><div class="example">
  1550. <pre class="example">ffmpeg -i INPUT -f crc -
  1551. </pre></div>
  1552. <p>You can select the output format of each frame with <code>ffmpeg</code> by
  1553. specifying the audio and video codec and format. For example to
  1554. compute the CRC of the input audio converted to PCM unsigned 8-bit
  1555. and the input video converted to MPEG-2 video, use the command:
  1556. </p><div class="example">
  1557. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  1558. </pre></div>
  1559. <a name="flv"></a>
  1560. <h2 class="section"><a href="ffmpeg-formats.html#toc-flv">4.6 flv</a></h2>
  1561. <p>Adobe Flash Video Format muxer.
  1562. </p>
  1563. <p>This muxer accepts the following options:
  1564. </p>
  1565. <dl compact="compact">
  1566. <dt>&lsquo;<samp>flvflags <var>flags</var></samp>&rsquo;</dt>
  1567. <dd><p>Possible values:
  1568. </p>
  1569. <dl compact="compact">
  1570. <dt>&lsquo;<samp>aac_seq_header_detect</samp>&rsquo;</dt>
  1571. <dd><p>Place AAC sequence header based on audio stream data.
  1572. </p>
  1573. </dd>
  1574. <dt>&lsquo;<samp>no_sequence_end</samp>&rsquo;</dt>
  1575. <dd><p>Disable sequence end tag.
  1576. </p>
  1577. </dd>
  1578. <dt>&lsquo;<samp>no_metadata</samp>&rsquo;</dt>
  1579. <dd><p>Disable metadata tag.
  1580. </p>
  1581. </dd>
  1582. <dt>&lsquo;<samp>no_duration_filesize</samp>&rsquo;</dt>
  1583. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  1584. at the end of stream. (Be used to non-seekable living stream).
  1585. </p>
  1586. </dd>
  1587. <dt>&lsquo;<samp>add_keyframe_index</samp>&rsquo;</dt>
  1588. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  1589. </p></dd>
  1590. </dl>
  1591. </dd>
  1592. </dl>
  1593. <p><a name="dash"></a>
  1594. </p><a name="dash-1"></a>
  1595. <h2 class="section"><a href="ffmpeg-formats.html#toc-dash-1">4.7 dash</a></h2>
  1596. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  1597. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  1598. </p>
  1599. <p>For more information see:
  1600. </p>
  1601. <ul>
  1602. <li>
  1603. ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  1604. </li><li>
  1605. WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  1606. </li></ul>
  1607. <p>It creates a MPD manifest file and segment files for each stream.
  1608. </p>
  1609. <p>The segment filename might contain pre-defined identifiers used with SegmentTemplate
  1610. as defined in section 5.3.9.4.4 of the standard. Available identifiers are &quot;$RepresentationID$&quot;,
  1611. &quot;$Number$&quot;, &quot;$Bandwidth$&quot; and &quot;$Time$&quot;.
  1612. In addition to the standard identifiers, an ffmpeg-specific &quot;$ext$&quot; identifier is also supported.
  1613. When specified ffmpeg will replace $ext$ in the file name with muxing format&rsquo;s extensions such as mp4, webm etc.,
  1614. </p>
  1615. <div class="example">
  1616. <pre class="example">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  1617. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
  1618. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
  1619. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
  1620. -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  1621. -f dash /path/to/out.mpd
  1622. </pre></div>
  1623. <dl compact="compact">
  1624. <dt>&lsquo;<samp>min_seg_duration <var>microseconds</var></samp>&rsquo;</dt>
  1625. <dd><p>This is a deprecated option to set the segment length in microseconds, use <var>seg_duration</var> instead.
  1626. </p></dd>
  1627. <dt>&lsquo;<samp>seg_duration <var>duration</var></samp>&rsquo;</dt>
  1628. <dd><p>Set the segment length in seconds (fractional value can be set). The value is
  1629. treated as average segment duration when <var>use_template</var> is enabled and
  1630. </p></dd>
  1631. <dt>&lsquo;<samp>frag_duration <var>duration</var></samp>&rsquo;</dt>
  1632. <dd><p>Set the length in seconds of fragments within segments (fractional value can be set).
  1633. </p></dd>
  1634. <dt>&lsquo;<samp>frag_type <var>type</var></samp>&rsquo;</dt>
  1635. <dd><p>Set the type of interval for fragmentation.
  1636. </p></dd>
  1637. <dt>&lsquo;<samp>window_size <var>size</var></samp>&rsquo;</dt>
  1638. <dd><p>Set the maximum number of segments kept in the manifest.
  1639. </p></dd>
  1640. <dt>&lsquo;<samp>extra_window_size <var>size</var></samp>&rsquo;</dt>
  1641. <dd><p>Set the maximum number of segments kept outside of the manifest before removing from disk.
  1642. </p></dd>
  1643. <dt>&lsquo;<samp>remove_at_exit <var>remove</var></samp>&rsquo;</dt>
  1644. <dd><p>Enable (1) or disable (0) removal of all segments when finished.
  1645. </p></dd>
  1646. <dt>&lsquo;<samp>use_template <var>template</var></samp>&rsquo;</dt>
  1647. <dd><p>Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  1648. </p></dd>
  1649. <dt>&lsquo;<samp>use_timeline <var>timeline</var></samp>&rsquo;</dt>
  1650. <dd><p>Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  1651. </p></dd>
  1652. <dt>&lsquo;<samp>single_file <var>single_file</var></samp>&rsquo;</dt>
  1653. <dd><p>Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  1654. </p></dd>
  1655. <dt>&lsquo;<samp>single_file_name <var>file_name</var></samp>&rsquo;</dt>
  1656. <dd><p>DASH-templated name to be used for baseURL. Implies <var>single_file</var> set to &quot;1&quot;. In the template, &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1657. </p></dd>
  1658. <dt>&lsquo;<samp>init_seg_name <var>init_name</var></samp>&rsquo;</dt>
  1659. <dd><p>DASH-templated name to used for the initialization segment. Default is &quot;init-stream$RepresentationID$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1660. </p></dd>
  1661. <dt>&lsquo;<samp>media_seg_name <var>segment_name</var></samp>&rsquo;</dt>
  1662. <dd><p>DASH-templated name to used for the media segments. Default is &quot;chunk-stream$RepresentationID$-$Number%05d$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  1663. </p></dd>
  1664. <dt>&lsquo;<samp>utc_timing_url <var>utc_url</var></samp>&rsquo;</dt>
  1665. <dd><p>URL of the page that will return the UTC timestamp in ISO format. Example: &quot;https://time.akamai.com/?iso&quot;
  1666. </p></dd>
  1667. <dt>&lsquo;<samp>method <var>method</var></samp>&rsquo;</dt>
  1668. <dd><p>Use the given HTTP method to create output files. Generally set to PUT or POST.
  1669. </p></dd>
  1670. <dt>&lsquo;<samp>http_user_agent <var>user_agent</var></samp>&rsquo;</dt>
  1671. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  1672. </p></dd>
  1673. <dt>&lsquo;<samp>http_persistent <var>http_persistent</var></samp>&rsquo;</dt>
  1674. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  1675. </p></dd>
  1676. <dt>&lsquo;<samp>hls_playlist <var>hls_playlist</var></samp>&rsquo;</dt>
  1677. <dd><p>Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8.
  1678. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
  1679. </p></dd>
  1680. <dt>&lsquo;<samp>streaming <var>streaming</var></samp>&rsquo;</dt>
  1681. <dd><p>Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
  1682. mode, each frame will be a moof fragment which forms a chunk.
  1683. </p></dd>
  1684. <dt>&lsquo;<samp>adaptation_sets <var>adaptation_sets</var></samp>&rsquo;</dt>
  1685. <dd><p>Assign streams to AdaptationSets. Syntax is &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; with x and y being the IDs
  1686. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  1687. </p>
  1688. <p>To map all video (or audio) streams to an AdaptationSet, &quot;v&quot; (or &quot;a&quot;) can be used as stream identifier instead of IDs.
  1689. </p>
  1690. <p>When no assignment is defined, this defaults to an AdaptationSet for each stream.
  1691. </p>
  1692. <p>Optional syntax is &quot;id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e&quot; and so on,
  1693. descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  1694. For example, -adaptation_sets &quot;id=0,descriptor=&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;,streams=v&quot;.
  1695. Please note that descriptor string should be a self-closing xml tag.
  1696. seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
  1697. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a&quot;
  1698. type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
  1699. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1&quot;
  1700. </p></dd>
  1701. <dt>&lsquo;<samp>timeout <var>timeout</var></samp>&rsquo;</dt>
  1702. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  1703. </p></dd>
  1704. <dt>&lsquo;<samp>index_correction <var>index_correction</var></samp>&rsquo;</dt>
  1705. <dd><p>Enable (1) or Disable (0) segment index correction logic. Applicable only when
  1706. <var>use_template</var> is enabled and <var>use_timeline</var> is disabled.
  1707. </p>
  1708. <p>When enabled, the logic monitors the flow of segment indexes. If a streams&rsquo;s
  1709. segment index value is not at the expected real time position, then the logic
  1710. corrects that index value.
  1711. </p>
  1712. <p>Typically this logic is needed in live streaming use cases. The network bandwidth
  1713. fluctuations are common during long run streaming. Each fluctuation can cause
  1714. the segment indexes fall behind the expected real time position.
  1715. </p></dd>
  1716. <dt>&lsquo;<samp>format_options <var>options_list</var></samp>&rsquo;</dt>
  1717. <dd><p>Set container format (mp4/webm) options using a <code>:</code> separated list of
  1718. key=value parameters. Values containing <code>:</code> special characters must be
  1719. escaped.
  1720. </p>
  1721. </dd>
  1722. <dt>&lsquo;<samp>global_sidx <var>global_sidx</var></samp>&rsquo;</dt>
  1723. <dd><p>Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
  1724. </p>
  1725. </dd>
  1726. <dt>&lsquo;<samp>dash_segment_type <var>dash_segment_type</var></samp>&rsquo;</dt>
  1727. <dd><p>Possible values:
  1728. </p><dl compact="compact">
  1729. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  1730. <dd><p>If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.
  1731. </p>
  1732. </dd>
  1733. <dt>&lsquo;<samp>mp4</samp>&rsquo;</dt>
  1734. <dd><p>If this flag is set, the dash segment files will be in in ISOBMFF format.
  1735. </p>
  1736. </dd>
  1737. <dt>&lsquo;<samp>webm</samp>&rsquo;</dt>
  1738. <dd><p>If this flag is set, the dash segment files will be in in WebM format.
  1739. </p></dd>
  1740. </dl>
  1741. </dd>
  1742. <dt>&lsquo;<samp>ignore_io_errors <var>ignore_io_errors</var></samp>&rsquo;</dt>
  1743. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs with network output.
  1744. </p>
  1745. </dd>
  1746. <dt>&lsquo;<samp>lhls <var>lhls</var></samp>&rsquo;</dt>
  1747. <dd><p>Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment&rsquo;s URI.
  1748. Apple doesn&rsquo;t have an official spec for LHLS. Meanwhile hls.js player folks are
  1749. trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
  1750. This option will also try to comply with the above open spec, till Apple&rsquo;s spec officially supports it.
  1751. Applicable only when <var>streaming</var> and <var>hls_playlist</var> options are enabled.
  1752. This is an experimental feature.
  1753. </p>
  1754. </dd>
  1755. <dt>&lsquo;<samp>ldash <var>ldash</var></samp>&rsquo;</dt>
  1756. <dd><p>Enable Low-latency Dash by constraining the presence and values of some elements.
  1757. </p>
  1758. </dd>
  1759. <dt>&lsquo;<samp>master_m3u8_publish_rate <var>master_m3u8_publish_rate</var></samp>&rsquo;</dt>
  1760. <dd><p>Publish master playlist repeatedly every after specified number of segment intervals.
  1761. </p>
  1762. </dd>
  1763. <dt>&lsquo;<samp>-write_prft <var>write_prft</var></samp>&rsquo;</dt>
  1764. <dd><p>Write Producer Reference Time elements on supported streams. This also enables writing
  1765. prft boxes in the underlying muxer. Applicable only when the <var>utc_url</var> option is enabled.
  1766. It&rsquo;s set to auto by default, in which case the muxer will attempt to enable it only in modes
  1767. that require it.
  1768. </p>
  1769. </dd>
  1770. <dt>&lsquo;<samp>-mpd_profile <var>mpd_profile</var></samp>&rsquo;</dt>
  1771. <dd><p>Set one or more manifest profiles.
  1772. </p>
  1773. </dd>
  1774. <dt>&lsquo;<samp>-http_opts <var>http_opts</var></samp>&rsquo;</dt>
  1775. <dd><p>A :-separated list of key=value options to pass to the underlying HTTP
  1776. protocol. Applicable only for HTTP output.
  1777. </p>
  1778. </dd>
  1779. <dt>&lsquo;<samp>-target_latency <var>target_latency</var></samp>&rsquo;</dt>
  1780. <dd><p>Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when <var>streaming</var> and <var>write_prft</var> options are enabled.
  1781. This is an informative fields clients can use to measure the latency of the service.
  1782. </p>
  1783. </dd>
  1784. </dl>
  1785. <p><a name="framecrc"></a>
  1786. </p><a name="framecrc-1"></a>
  1787. <h2 class="section"><a href="ffmpeg-formats.html#toc-framecrc-1">4.8 framecrc</a></h2>
  1788. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  1789. </p>
  1790. <p>This muxer computes and prints the Adler-32 CRC for each audio
  1791. and video packet. By default audio frames are converted to signed
  1792. 16-bit raw audio and video frames to raw video before computing the
  1793. CRC.
  1794. </p>
  1795. <p>The output of the muxer consists of a line for each audio and video
  1796. packet of the form:
  1797. </p><div class="example">
  1798. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, 0x<var>CRC</var>
  1799. </pre></div>
  1800. <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  1801. CRC of the packet.
  1802. </p>
  1803. <a name="Examples-10"></a>
  1804. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-10">4.8.1 Examples</a></h3>
  1805. <p>For example to compute the CRC of the audio and video frames in
  1806. &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
  1807. in the file &lsquo;<tt>out.crc</tt>&rsquo;:
  1808. </p><div class="example">
  1809. <pre class="example">ffmpeg -i INPUT -f framecrc out.crc
  1810. </pre></div>
  1811. <p>To print the information to stdout, use the command:
  1812. </p><div class="example">
  1813. <pre class="example">ffmpeg -i INPUT -f framecrc -
  1814. </pre></div>
  1815. <p>With <code>ffmpeg</code>, you can select the output format to which the
  1816. audio and video frames are encoded before computing the CRC for each
  1817. packet by specifying the audio and video codec. For example, to
  1818. compute the CRC of each decoded input audio frame converted to PCM
  1819. unsigned 8-bit and of each decoded input video frame converted to
  1820. MPEG-2 video, use the command:
  1821. </p><div class="example">
  1822. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  1823. </pre></div>
  1824. <p>See also the <a href="#crc">crc</a> muxer.
  1825. </p>
  1826. <p><a name="framehash"></a>
  1827. </p><a name="framehash-1"></a>
  1828. <h2 class="section"><a href="ffmpeg-formats.html#toc-framehash-1">4.9 framehash</a></h2>
  1829. <p>Per-packet hash testing format.
  1830. </p>
  1831. <p>This muxer computes and prints a cryptographic hash for each audio
  1832. and video packet. This can be used for packet-by-packet equality
  1833. checks without having to individually do a binary comparison on each.
  1834. </p>
  1835. <p>By default audio frames are converted to signed 16-bit raw audio and
  1836. video frames to raw video before computing the hash, but the output
  1837. of explicit conversions to other codecs can also be used. It uses the
  1838. SHA-256 cryptographic hash function by default, but supports several
  1839. other algorithms.
  1840. </p>
  1841. <p>The output of the muxer consists of a line for each audio and video
  1842. packet of the form:
  1843. </p><div class="example">
  1844. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, <var>hash</var>
  1845. </pre></div>
  1846. <p><var>hash</var> is a hexadecimal number representing the computed hash
  1847. for the packet.
  1848. </p>
  1849. <dl compact="compact">
  1850. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  1851. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  1852. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  1853. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  1854. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  1855. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  1856. </p>
  1857. </dd>
  1858. </dl>
  1859. <a name="Examples-11"></a>
  1860. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-11">4.9.1 Examples</a></h3>
  1861. <p>To compute the SHA-256 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  1862. converted to raw audio and video packets, and store it in the file
  1863. &lsquo;<tt>out.sha256</tt>&rsquo;:
  1864. </p><div class="example">
  1865. <pre class="example">ffmpeg -i INPUT -f framehash out.sha256
  1866. </pre></div>
  1867. <p>To print the information to stdout, using the MD5 hash function, use
  1868. the command:
  1869. </p><div class="example">
  1870. <pre class="example">ffmpeg -i INPUT -f framehash -hash md5 -
  1871. </pre></div>
  1872. <p>See also the <a href="#hash">hash</a> muxer.
  1873. </p>
  1874. <p><a name="framemd5"></a>
  1875. </p><a name="framemd5-1"></a>
  1876. <h2 class="section"><a href="ffmpeg-formats.html#toc-framemd5-1">4.10 framemd5</a></h2>
  1877. <p>Per-packet MD5 testing format.
  1878. </p>
  1879. <p>This is a variant of the <a href="#framehash">framehash</a> muxer. Unlike that muxer,
  1880. it defaults to using the MD5 hash function.
  1881. </p>
  1882. <a name="Examples-5"></a>
  1883. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-5">4.10.1 Examples</a></h3>
  1884. <p>To compute the MD5 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  1885. converted to raw audio and video packets, and store it in the file
  1886. &lsquo;<tt>out.md5</tt>&rsquo;:
  1887. </p><div class="example">
  1888. <pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
  1889. </pre></div>
  1890. <p>To print the information to stdout, use the command:
  1891. </p><div class="example">
  1892. <pre class="example">ffmpeg -i INPUT -f framemd5 -
  1893. </pre></div>
  1894. <p>See also the <a href="#framehash">framehash</a> and <a href="#md5">md5</a> muxers.
  1895. </p>
  1896. <p><a name="gif"></a>
  1897. </p><a name="gif-2"></a>
  1898. <h2 class="section"><a href="ffmpeg-formats.html#toc-gif-2">4.11 gif</a></h2>
  1899. <p>Animated GIF muxer.
  1900. </p>
  1901. <p>It accepts the following options:
  1902. </p>
  1903. <dl compact="compact">
  1904. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  1905. <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
  1906. for looping indefinitely (default).
  1907. </p>
  1908. </dd>
  1909. <dt>&lsquo;<samp>final_delay</samp>&rsquo;</dt>
  1910. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  1911. ends with a delay until the next frame. The default is <code>-1</code>, which is a
  1912. special value to tell the muxer to re-use the previous delay. In case of a
  1913. loop, you might want to customize this value to mark a pause for instance.
  1914. </p></dd>
  1915. </dl>
  1916. <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
  1917. the loops:
  1918. </p><div class="example">
  1919. <pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  1920. </pre></div>
  1921. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  1922. force the <a href="#image2">image2</a> muxer:
  1923. </p><div class="example">
  1924. <pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  1925. </pre></div>
  1926. <p>Note 2: the GIF format has a very large time base: the delay between two frames
  1927. can therefore not be smaller than one centi second.
  1928. </p>
  1929. <p><a name="hash"></a>
  1930. </p><a name="hash-1"></a>
  1931. <h2 class="section"><a href="ffmpeg-formats.html#toc-hash-1">4.12 hash</a></h2>
  1932. <p>Hash testing format.
  1933. </p>
  1934. <p>This muxer computes and prints a cryptographic hash of all the input
  1935. audio and video frames. This can be used for equality checks without
  1936. having to do a complete binary comparison.
  1937. </p>
  1938. <p>By default audio frames are converted to signed 16-bit raw audio and
  1939. video frames to raw video before computing the hash, but the output
  1940. of explicit conversions to other codecs can also be used. Timestamps
  1941. are ignored. It uses the SHA-256 cryptographic hash function by default,
  1942. but supports several other algorithms.
  1943. </p>
  1944. <p>The output of the muxer consists of a single line of the form:
  1945. <var>algo</var>=<var>hash</var>, where <var>algo</var> is a short string representing
  1946. the hash function used, and <var>hash</var> is a hexadecimal number
  1947. representing the computed hash.
  1948. </p>
  1949. <dl compact="compact">
  1950. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  1951. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  1952. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  1953. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  1954. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  1955. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  1956. </p>
  1957. </dd>
  1958. </dl>
  1959. <a name="Examples-7"></a>
  1960. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-7">4.12.1 Examples</a></h3>
  1961. <p>To compute the SHA-256 hash of the input converted to raw audio and
  1962. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  1963. </p><div class="example">
  1964. <pre class="example">ffmpeg -i INPUT -f hash out.sha256
  1965. </pre></div>
  1966. <p>To print an MD5 hash to stdout use the command:
  1967. </p><div class="example">
  1968. <pre class="example">ffmpeg -i INPUT -f hash -hash md5 -
  1969. </pre></div>
  1970. <p>See also the <a href="#framehash">framehash</a> muxer.
  1971. </p>
  1972. <p><a name="hls"></a>
  1973. </p><a name="hls-2"></a>
  1974. <h2 class="section"><a href="ffmpeg-formats.html#toc-hls-2">4.13 hls</a></h2>
  1975. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  1976. the HTTP Live Streaming (HLS) specification.
  1977. </p>
  1978. <p>It creates a playlist file, and one or more segment files. The output filename
  1979. specifies the playlist filename.
  1980. </p>
  1981. <p>By default, the muxer creates a file for each segment produced. These files
  1982. have the same name as the playlist, followed by a sequential number and a
  1983. .ts extension.
  1984. </p>
  1985. <p>Make sure to require a closed GOP when encoding and to set the GOP
  1986. size to fit your segment time constraint.
  1987. </p>
  1988. <p>For example, to convert an input file with <code>ffmpeg</code>:
  1989. </p><div class="example">
  1990. <pre class="example">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  1991. </pre></div>
  1992. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  1993. &lsquo;<tt>out0.ts</tt>&rsquo;, &lsquo;<tt>out1.ts</tt>&rsquo;, &lsquo;<tt>out2.ts</tt>&rsquo;, etc.
  1994. </p>
  1995. <p>See also the <a href="#segment">segment</a> muxer, which provides a more generic and
  1996. flexible implementation of a segmenter, and can be used to perform HLS
  1997. segmentation.
  1998. </p>
  1999. <a name="Options-8"></a>
  2000. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-8">4.13.1 Options</a></h3>
  2001. <p>This muxer supports the following options:
  2002. </p>
  2003. <dl compact="compact">
  2004. <dt>&lsquo;<samp>hls_init_time <var>seconds</var></samp>&rsquo;</dt>
  2005. <dd><p>Set the initial target segment length in seconds. Default value is <var>0</var>.
  2006. Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  2007. After the initial playlist is filled <code>ffmpeg</code> will cut segments
  2008. at duration equal to <code>hls_time</code>
  2009. </p>
  2010. </dd>
  2011. <dt>&lsquo;<samp>hls_time <var>seconds</var></samp>&rsquo;</dt>
  2012. <dd><p>Set the target segment length in seconds. Default value is 2.
  2013. Segment will be cut on the next key frame after this time has passed.
  2014. </p>
  2015. </dd>
  2016. <dt>&lsquo;<samp>hls_list_size <var>size</var></samp>&rsquo;</dt>
  2017. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  2018. will contain all the segments. Default value is 5.
  2019. </p>
  2020. </dd>
  2021. <dt>&lsquo;<samp>hls_delete_threshold <var>size</var></samp>&rsquo;</dt>
  2022. <dd><p>Set the number of unreferenced segments to keep on disk before <code>hls_flags delete_segments</code>
  2023. deletes them. Increase this to allow continue clients to download segments which
  2024. were recently referenced in the playlist. Default value is 1, meaning segments older than
  2025. <code>hls_list_size+1</code> will be deleted.
  2026. </p>
  2027. </dd>
  2028. <dt>&lsquo;<samp>hls_ts_options <var>options_list</var></samp>&rsquo;</dt>
  2029. <dd><p>Set output format options using a :-separated list of key=value
  2030. parameters. Values containing <code>:</code> special characters must be
  2031. escaped.
  2032. </p>
  2033. </dd>
  2034. <dt>&lsquo;<samp>hls_wrap <var>wrap</var></samp>&rsquo;</dt>
  2035. <dd><p>This is a deprecated option, you can use <code>hls_list_size</code>
  2036. and <code>hls_flags delete_segments</code> instead it
  2037. </p>
  2038. <p>This option is useful to avoid to fill the disk with many segment
  2039. files, and limits the maximum number of segment files written to disk
  2040. to <var>wrap</var>.
  2041. </p>
  2042. </dd>
  2043. <dt>&lsquo;<samp>hls_start_number_source</samp>&rsquo;</dt>
  2044. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  2045. Unless <code>hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  2046. segment and subtitle filenames. In any case, if <code>hls_flags append_list</code>
  2047. is set and read playlist sequence number is greater than the specified start sequence number,
  2048. then that value will be used as start value.
  2049. </p>
  2050. <p>It accepts the following values:
  2051. </p>
  2052. <dl compact="compact">
  2053. <dt>&lsquo;<samp>generic (default)</samp>&rsquo;</dt>
  2054. <dd><p>Set the starting sequence numbers according to <var>start_number</var> option value.
  2055. </p>
  2056. </dd>
  2057. <dt>&lsquo;<samp>epoch</samp>&rsquo;</dt>
  2058. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  2059. </p>
  2060. </dd>
  2061. <dt>&lsquo;<samp>datetime</samp>&rsquo;</dt>
  2062. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  2063. </p>
  2064. </dd>
  2065. </dl>
  2066. </dd>
  2067. <dt>&lsquo;<samp>start_number <var>number</var></samp>&rsquo;</dt>
  2068. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var>number</var>
  2069. when <var>hls_start_number_source</var> value is <var>generic</var>. (This is the default case.)
  2070. Unless <code>hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  2071. Default value is 0.
  2072. </p>
  2073. </dd>
  2074. <dt>&lsquo;<samp>hls_allow_cache <var>allowcache</var></samp>&rsquo;</dt>
  2075. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  2076. </p>
  2077. </dd>
  2078. <dt>&lsquo;<samp>hls_base_url <var>baseurl</var></samp>&rsquo;</dt>
  2079. <dd><p>Append <var>baseurl</var> to every entry in the playlist.
  2080. Useful to generate playlists with absolute paths.
  2081. </p>
  2082. <p>Note that the playlist sequence number must be unique for each segment
  2083. and it is not to be confused with the segment filename sequence number
  2084. which can be cyclic, for example if the &lsquo;<samp>wrap</samp>&rsquo; option is
  2085. specified.
  2086. </p>
  2087. </dd>
  2088. <dt>&lsquo;<samp>hls_segment_filename <var>filename</var></samp>&rsquo;</dt>
  2089. <dd><p>Set the segment filename. Unless <code>hls_flags single_file</code> is set,
  2090. <var>filename</var> is used as a string format with the segment number:
  2091. </p><div class="example">
  2092. <pre class="example">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  2093. </pre></div>
  2094. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  2095. &lsquo;<tt>file000.ts</tt>&rsquo;, &lsquo;<tt>file001.ts</tt>&rsquo;, &lsquo;<tt>file002.ts</tt>&rsquo;, etc.
  2096. </p>
  2097. <p><var>filename</var> may contain full path or relative path specification,
  2098. but only the file name part without any path info will be contained in the m3u8 segment list.
  2099. Should a relative path be specified, the path of the created segment
  2100. files will be relative to the current working directory.
  2101. When strftime_mkdir is set, the whole expanded value of <var>filename</var> will be written into the m3u8 segment list.
  2102. </p>
  2103. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  2104. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  2105. the position of variant stream index in the generated segment file names.
  2106. </p><div class="example">
  2107. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2108. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2109. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  2110. </pre></div>
  2111. <p>This example will produce the playlists segment file sets:
  2112. &lsquo;<tt>file_0_000.ts</tt>&rsquo;, &lsquo;<tt>file_0_001.ts</tt>&rsquo;, &lsquo;<tt>file_0_002.ts</tt>&rsquo;, etc. and
  2113. &lsquo;<tt>file_1_000.ts</tt>&rsquo;, &lsquo;<tt>file_1_001.ts</tt>&rsquo;, &lsquo;<tt>file_1_002.ts</tt>&rsquo;, etc.
  2114. </p>
  2115. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  2116. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  2117. sub-directory or filename.) If the string %v is present in the directory name, then
  2118. sub-directories are created after expanding the directory name pattern. This
  2119. enables creation of segments corresponding to different variant streams in
  2120. subdirectories.
  2121. </p><div class="example">
  2122. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2123. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2124. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  2125. </pre></div>
  2126. <p>This example will produce the playlists segment file sets:
  2127. &lsquo;<tt>vs0/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_002.ts</tt>&rsquo;, etc. and
  2128. &lsquo;<tt>vs1/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_002.ts</tt>&rsquo;, etc.
  2129. </p>
  2130. </dd>
  2131. <dt>&lsquo;<samp>use_localtime</samp>&rsquo;</dt>
  2132. <dd><p>Same as strftime option, will be deprecated.
  2133. </p>
  2134. </dd>
  2135. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  2136. <dd><p>Use strftime() on <var>filename</var> to expand the segment filename with localtime.
  2137. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  2138. hls_flag and %%d will be the specifier.
  2139. </p><div class="example">
  2140. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  2141. </pre></div>
  2142. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  2143. &lsquo;<tt>file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-1455569024.ts</tt>&rsquo;, etc.
  2144. Note: On some systems/environments, the <code>%s</code> specifier is not available. See
  2145. <code>strftime()</code> documentation.
  2146. </p><div class="example">
  2147. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
  2148. </pre></div>
  2149. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  2150. &lsquo;<tt>file-20160215-0001.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-0002.ts</tt>&rsquo;, etc.
  2151. </p>
  2152. </dd>
  2153. <dt>&lsquo;<samp>use_localtime_mkdir</samp>&rsquo;</dt>
  2154. <dd><p>Same as strftime_mkdir option, will be deprecated .
  2155. </p>
  2156. </dd>
  2157. <dt>&lsquo;<samp>strftime_mkdir</samp>&rsquo;</dt>
  2158. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  2159. is expanded in <var>filename</var>.
  2160. </p><div class="example">
  2161. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
  2162. </pre></div>
  2163. <p>This example will create a directory 201560215 (if it does not exist), and then
  2164. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  2165. &lsquo;<tt>20160215/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>20160215/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  2166. </p>
  2167. <div class="example">
  2168. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
  2169. </pre></div>
  2170. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  2171. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  2172. &lsquo;<tt>2016/02/15/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>2016/02/15/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  2173. </p>
  2174. </dd>
  2175. <dt>&lsquo;<samp>hls_key_info_file <var>key_info_file</var></samp>&rsquo;</dt>
  2176. <dd><p>Use the information in <var>key_info_file</var> for segment encryption. The first
  2177. line of <var>key_info_file</var> specifies the key URI written to the playlist. The
  2178. key URL is used to access the encryption key during playback. The second line
  2179. specifies the path to the key file used to obtain the key during the encryption
  2180. process. The key file is read as a single packed array of 16 octets in binary
  2181. format. The optional third line specifies the initialization vector (IV) as a
  2182. hexadecimal string to be used instead of the segment sequence number (default)
  2183. for encryption. Changes to <var>key_info_file</var> will result in segment
  2184. encryption with the new key/IV and an entry in the playlist for the new key
  2185. URI/IV if <code>hls_flags periodic_rekey</code> is enabled.
  2186. </p>
  2187. <p>Key info file format:
  2188. </p><div class="example">
  2189. <pre class="example"><var>key URI</var>
  2190. <var>key file path</var>
  2191. <var>IV</var> (optional)
  2192. </pre></div>
  2193. <p>Example key URIs:
  2194. </p><div class="example">
  2195. <pre class="example">http://server/file.key
  2196. /path/to/file.key
  2197. file.key
  2198. </pre></div>
  2199. <p>Example key file paths:
  2200. </p><div class="example">
  2201. <pre class="example">file.key
  2202. /path/to/file.key
  2203. </pre></div>
  2204. <p>Example IV:
  2205. </p><div class="example">
  2206. <pre class="example">0123456789ABCDEF0123456789ABCDEF
  2207. </pre></div>
  2208. <p>Key info file example:
  2209. </p><div class="example">
  2210. <pre class="example">http://server/file.key
  2211. /path/to/file.key
  2212. 0123456789ABCDEF0123456789ABCDEF
  2213. </pre></div>
  2214. <p>Example shell script:
  2215. </p><div class="example">
  2216. <pre class="example">#!/bin/sh
  2217. BASE_URL=${1:-'.'}
  2218. openssl rand 16 &gt; file.key
  2219. echo $BASE_URL/file.key &gt; file.keyinfo
  2220. echo file.key &gt;&gt; file.keyinfo
  2221. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  2222. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  2223. -hls_key_info_file file.keyinfo out.m3u8
  2224. </pre></div>
  2225. </dd>
  2226. <dt>&lsquo;<samp>-hls_enc <var>enc</var></samp>&rsquo;</dt>
  2227. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  2228. When enabled every segment generated is encrypted and the encryption key
  2229. is saved as <var>playlist name</var>.key.
  2230. </p>
  2231. </dd>
  2232. <dt>&lsquo;<samp>-hls_enc_key <var>key</var></samp>&rsquo;</dt>
  2233. <dd><p>Hex-coded 16byte key to encrypt the segments, by default it
  2234. is randomly generated.
  2235. </p>
  2236. </dd>
  2237. <dt>&lsquo;<samp>-hls_enc_key_url <var>keyurl</var></samp>&rsquo;</dt>
  2238. <dd><p>If set, <var>keyurl</var> is prepended instead of <var>baseurl</var> to the key filename
  2239. in the playlist.
  2240. </p>
  2241. </dd>
  2242. <dt>&lsquo;<samp>-hls_enc_iv <var>iv</var></samp>&rsquo;</dt>
  2243. <dd><p>Hex-coded 16byte initialization vector for every segment instead
  2244. of the autogenerated ones.
  2245. </p>
  2246. </dd>
  2247. <dt>&lsquo;<samp>hls_segment_type <var>flags</var></samp>&rsquo;</dt>
  2248. <dd><p>Possible values:
  2249. </p>
  2250. <dl compact="compact">
  2251. <dt>&lsquo;<samp>mpegts</samp>&rsquo;</dt>
  2252. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  2253. compatible with all HLS versions.
  2254. </p>
  2255. </dd>
  2256. <dt>&lsquo;<samp>fmp4</samp>&rsquo;</dt>
  2257. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  2258. fmp4 files may be used in HLS version 7 and above.
  2259. </p>
  2260. </dd>
  2261. </dl>
  2262. </dd>
  2263. <dt>&lsquo;<samp>hls_fmp4_init_filename <var>filename</var></samp>&rsquo;</dt>
  2264. <dd><p>Set filename to the fragment files header file, default filename is &lsquo;<tt>init.mp4</tt>&rsquo;.
  2265. </p>
  2266. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  2267. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  2268. the position of variant stream index in the generated init file names.
  2269. The string &quot;%v&quot; may be present in the filename or in the last directory name
  2270. containing the file. If the string is present in the directory name, then
  2271. sub-directories are created after expanding the directory name pattern. This
  2272. enables creation of init files corresponding to different variant streams in
  2273. subdirectories.
  2274. </p>
  2275. </dd>
  2276. <dt>&lsquo;<samp>hls_flags <var>flags</var></samp>&rsquo;</dt>
  2277. <dd><p>Possible values:
  2278. </p>
  2279. <dl compact="compact">
  2280. <dt>&lsquo;<samp>single_file</samp>&rsquo;</dt>
  2281. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  2282. file, and will use byte ranges in the playlist. HLS playlists generated with
  2283. this way will have the version number 4.
  2284. For example:
  2285. </p><div class="example">
  2286. <pre class="example">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  2287. </pre></div>
  2288. <p>Will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and a single segment file,
  2289. &lsquo;<tt>out.ts</tt>&rsquo;.
  2290. </p>
  2291. </dd>
  2292. <dt>&lsquo;<samp>delete_segments</samp>&rsquo;</dt>
  2293. <dd><p>Segment files removed from the playlist are deleted after a period of time
  2294. equal to the duration of the segment plus the duration of the playlist.
  2295. </p>
  2296. </dd>
  2297. <dt>&lsquo;<samp>append_list</samp>&rsquo;</dt>
  2298. <dd><p>Append new segments into the end of old segment list,
  2299. and remove the <code>#EXT-X-ENDLIST</code> from the old segment list.
  2300. </p>
  2301. </dd>
  2302. <dt>&lsquo;<samp>round_durations</samp>&rsquo;</dt>
  2303. <dd><p>Round the duration info in the playlist file segment info to integer
  2304. values, instead of using floating point.
  2305. </p>
  2306. </dd>
  2307. <dt>&lsquo;<samp>discont_start</samp>&rsquo;</dt>
  2308. <dd><p>Add the <code>#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  2309. first segment&rsquo;s information.
  2310. </p>
  2311. </dd>
  2312. <dt>&lsquo;<samp>omit_endlist</samp>&rsquo;</dt>
  2313. <dd><p>Do not append the <code>EXT-X-ENDLIST</code> tag at the end of the playlist.
  2314. </p>
  2315. </dd>
  2316. <dt>&lsquo;<samp>periodic_rekey</samp>&rsquo;</dt>
  2317. <dd><p>The file specified by <code>hls_key_info_file</code> will be checked periodically and
  2318. detect updates to the encryption info. Be sure to replace this file atomically,
  2319. including the file containing the AES encryption key.
  2320. </p>
  2321. </dd>
  2322. <dt>&lsquo;<samp>independent_segments</samp>&rsquo;</dt>
  2323. <dd><p>Add the <code>#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  2324. and when all the segments of that playlist are guaranteed to start with a Key frame.
  2325. </p>
  2326. </dd>
  2327. <dt>&lsquo;<samp>iframes_only</samp>&rsquo;</dt>
  2328. <dd><p>Add the <code>#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  2329. and can play only I-frames in the <code>#EXT-X-BYTERANGE</code> mode.
  2330. </p>
  2331. </dd>
  2332. <dt>&lsquo;<samp>split_by_time</samp>&rsquo;</dt>
  2333. <dd><p>Allow segments to start on frames other than keyframes. This improves
  2334. behavior on some players when the time between keyframes is inconsistent,
  2335. but may make things worse on others, and can cause some oddities during
  2336. seeking. This flag should be used with the <code>hls_time</code> option.
  2337. </p>
  2338. </dd>
  2339. <dt>&lsquo;<samp>program_date_time</samp>&rsquo;</dt>
  2340. <dd><p>Generate <code>EXT-X-PROGRAM-DATE-TIME</code> tags.
  2341. </p>
  2342. </dd>
  2343. <dt>&lsquo;<samp>second_level_segment_index</samp>&rsquo;</dt>
  2344. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  2345. besides date/time values when strftime is on.
  2346. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  2347. </p>
  2348. </dd>
  2349. <dt>&lsquo;<samp>second_level_segment_size</samp>&rsquo;</dt>
  2350. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  2351. expression besides date/time values when strftime is on.
  2352. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  2353. </p>
  2354. </dd>
  2355. <dt>&lsquo;<samp>second_level_segment_duration</samp>&rsquo;</dt>
  2356. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  2357. expression besides date/time values when strftime is on.
  2358. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  2359. </p>
  2360. <div class="example">
  2361. <pre class="example">ffmpeg -i sample.mpeg \
  2362. -f hls -hls_time 3 -hls_list_size 5 \
  2363. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  2364. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  2365. </pre></div>
  2366. <p>This will produce segments like this:
  2367. &lsquo;<tt>segment_20170102194334_0003_00122200_0000003000000.ts</tt>&rsquo;, &lsquo;<tt>segment_20170102194334_0004_00120072_0000003000000.ts</tt>&rsquo; etc.
  2368. </p>
  2369. </dd>
  2370. <dt>&lsquo;<samp>temp_file</samp>&rsquo;</dt>
  2371. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  2372. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  2373. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  2374. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  2375. But playlists with <code>file</code> protocol and with type (<code>hls_playlist_type</code>) other than <code>vod</code>
  2376. are always written into temporary file regardless of this flag. Master playlist files (<code>master_pl_name</code>), if any, with <code>file</code> protocol,
  2377. are always written into temporary file regardless of this flag if <code>master_pl_publish_rate</code> value is other than zero.
  2378. </p>
  2379. </dd>
  2380. </dl>
  2381. </dd>
  2382. <dt>&lsquo;<samp>hls_playlist_type event</samp>&rsquo;</dt>
  2383. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  2384. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist can only be appended to.
  2385. </p>
  2386. </dd>
  2387. <dt>&lsquo;<samp>hls_playlist_type vod</samp>&rsquo;</dt>
  2388. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  2389. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist must not change.
  2390. </p>
  2391. </dd>
  2392. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  2393. <dd><p>Use the given HTTP method to create the hls files.
  2394. </p><div class="example">
  2395. <pre class="example">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  2396. </pre></div>
  2397. <p>This example will upload all the mpegts segment files to the HTTP
  2398. server using the HTTP PUT method, and update the m3u8 files every
  2399. <code>refresh</code> times using the same method.
  2400. Note that the HTTP server must support the given method for uploading
  2401. files.
  2402. </p>
  2403. </dd>
  2404. <dt>&lsquo;<samp>http_user_agent</samp>&rsquo;</dt>
  2405. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  2406. </p>
  2407. </dd>
  2408. <dt>&lsquo;<samp>var_stream_map</samp>&rsquo;</dt>
  2409. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  2410. into different variant streams. The variant stream groups are separated
  2411. by space.
  2412. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  2413. the keys to specify audio, video and subtitle streams respectively.
  2414. Allowed values are 0 to 9 (limited just based on practical usage).
  2415. </p>
  2416. <p>When there are two or more variant streams, the output filename pattern must
  2417. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  2418. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  2419. the filename or in the last directory name containing the file. If the string is
  2420. present in the directory name, then sub-directories are created after expanding
  2421. the directory name pattern. This enables creation of variant streams in
  2422. subdirectories.
  2423. </p>
  2424. <div class="example">
  2425. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2426. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2427. http://example.com/live/out_%v.m3u8
  2428. </pre></div>
  2429. <p>This example creates two hls variant streams. The first variant stream will
  2430. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  2431. second variant stream will contain video stream of bitrate 256k and audio
  2432. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  2433. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  2434. in result names, you may specify names for each or some of the variants
  2435. as in the following example.
  2436. </p>
  2437. <div class="example">
  2438. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2439. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0,name:my_hd v:1,a:1,name:my_sd&quot; \
  2440. http://example.com/live/out_%v.m3u8
  2441. </pre></div>
  2442. <p>This example creates two hls variant streams as in the previous one.
  2443. But here, the two media playlist with file names out_my_hd.m3u8 and
  2444. out_my_sd.m3u8 will be created.
  2445. </p>
  2446. <div class="example">
  2447. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  2448. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  2449. http://example.com/live/out_%v.m3u8
  2450. </pre></div>
  2451. <p>This example creates three hls variant streams. The first variant stream will
  2452. be a video only stream with video bitrate 1000k, the second variant stream will
  2453. be an audio only stream with bitrate 64k and the third variant stream will be a
  2454. video only stream with bitrate 256k. Here, three media playlist with file names
  2455. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  2456. </p><div class="example">
  2457. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2458. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  2459. http://example.com/live/vs_%v/out.m3u8
  2460. </pre></div>
  2461. <p>This example creates the variant streams in subdirectories. Here, the first
  2462. media playlist is created at &lsquo;<tt>http://example.com/live/vs_0/out.m3u8</tt>&rsquo; and
  2463. the second one at &lsquo;<tt>http://example.com/live/vs_1/out.m3u8</tt>&rsquo;.
  2464. </p><div class="example">
  2465. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  2466. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  2467. -var_stream_map &quot;a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high&quot; \
  2468. -master_pl_name master.m3u8 \
  2469. http://example.com/live/out_%v.m3u8
  2470. </pre></div>
  2471. <p>This example creates two audio only and two video only variant streams. In
  2472. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2473. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2474. and they are mapped to the two video only variant streams with audio group names
  2475. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  2476. </p>
  2477. <p>By default, a single hls variant containing all the encoded streams is created.
  2478. </p>
  2479. <div class="example">
  2480. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  2481. -map 0:a -map 0:a -map 0:v -f hls \
  2482. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  2483. -master_pl_name master.m3u8 \
  2484. http://example.com/live/out_%v.m3u8
  2485. </pre></div>
  2486. <p>This example creates two audio only and one video only variant streams. In
  2487. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2488. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2489. and they are mapped to the one video only variant streams with audio group name
  2490. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  2491. </p>
  2492. <p>By default, a single hls variant containing all the encoded streams is created.
  2493. </p>
  2494. <div class="example">
  2495. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  2496. -map 0:a -map 0:a -map 0:v -f hls \
  2497. -var_stream_map &quot;a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low&quot; \
  2498. -master_pl_name master.m3u8 \
  2499. http://example.com/live/out_%v.m3u8
  2500. </pre></div>
  2501. <p>This example creates two audio only and one video only variant streams. In
  2502. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  2503. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  2504. and they are mapped to the one video only variant streams with audio group name
  2505. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  2506. have and language is named ENG, the other audio language is named CHN.
  2507. </p>
  2508. <p>By default, a single hls variant containing all the encoded streams is created.
  2509. </p>
  2510. </dd>
  2511. <dt>&lsquo;<samp>cc_stream_map</samp>&rsquo;</dt>
  2512. <dd><p>Map string which specifies different closed captions groups and their
  2513. attributes. The closed captions stream groups are separated by space.
  2514. Expected string format is like this
  2515. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  2516. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  2517. attribute.
  2518. The closed captions groups configured using this option are mapped to different
  2519. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  2520. <code>var_stream_map</code> string. If <code>var_stream_map</code> is not set, then the
  2521. first available ccgroup in <code>cc_stream_map</code> is mapped to the output variant
  2522. stream. The examples for these two use cases are given below.
  2523. </p>
  2524. <div class="example">
  2525. <pre class="example">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  2526. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  2527. -master_pl_name master.m3u8 \
  2528. http://example.com/live/out.m3u8
  2529. </pre></div>
  2530. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=CLOSED-CAPTIONS</code> in
  2531. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  2532. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code>CLOSED-CAPTIONS</code> attribute with group
  2533. name &rsquo;cc&rsquo; for the output variant stream.
  2534. </p><div class="example">
  2535. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  2536. -a53cc:0 1 -a53cc:1 1\
  2537. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  2538. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  2539. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  2540. -master_pl_name master.m3u8 \
  2541. http://example.com/live/out_%v.m3u8
  2542. </pre></div>
  2543. <p>This example adds two <code>#EXT-X-MEDIA</code> tags with <code>TYPE=CLOSED-CAPTIONS</code> in
  2544. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  2545. <code>CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  2546. streams.
  2547. </p>
  2548. </dd>
  2549. <dt>&lsquo;<samp>master_pl_name</samp>&rsquo;</dt>
  2550. <dd><p>Create HLS master playlist with the given name.
  2551. </p>
  2552. <div class="example">
  2553. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  2554. </pre></div>
  2555. <p>This example creates HLS master playlist with name master.m3u8 and it is
  2556. published at http://example.com/live/
  2557. </p>
  2558. </dd>
  2559. <dt>&lsquo;<samp>master_pl_publish_rate</samp>&rsquo;</dt>
  2560. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  2561. </p>
  2562. <div class="example">
  2563. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  2564. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  2565. </pre></div>
  2566. <p>This example creates HLS master playlist with name master.m3u8 and keep
  2567. publishing it repeatedly every after 30 segments i.e. every after 60s.
  2568. </p>
  2569. </dd>
  2570. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  2571. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  2572. </p>
  2573. </dd>
  2574. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  2575. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  2576. </p>
  2577. </dd>
  2578. <dt>&lsquo;<samp>-ignore_io_errors</samp>&rsquo;</dt>
  2579. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  2580. </p>
  2581. </dd>
  2582. <dt>&lsquo;<samp>headers</samp>&rsquo;</dt>
  2583. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  2584. </p>
  2585. </dd>
  2586. </dl>
  2587. <p><a name="ico"></a>
  2588. </p><a name="ico-1"></a>
  2589. <h2 class="section"><a href="ffmpeg-formats.html#toc-ico-1">4.14 ico</a></h2>
  2590. <p>ICO file muxer.
  2591. </p>
  2592. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  2593. </p>
  2594. <ul>
  2595. <li>
  2596. Size cannot exceed 256 pixels in any dimension
  2597. </li><li>
  2598. Only BMP and PNG images can be stored
  2599. </li><li>
  2600. If a BMP image is used, it must be one of the following pixel formats:
  2601. <div class="example">
  2602. <pre class="example">BMP Bit Depth FFmpeg Pixel Format
  2603. 1bit pal8
  2604. 4bit pal8
  2605. 8bit pal8
  2606. 16bit rgb555le
  2607. 24bit bgr24
  2608. 32bit bgra
  2609. </pre></div>
  2610. </li><li>
  2611. If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  2612. </li><li>
  2613. If a PNG image is used, it must use the rgba pixel format
  2614. </li></ul>
  2615. <p><a name="image2"></a>
  2616. </p><a name="image2-2"></a>
  2617. <h2 class="section"><a href="ffmpeg-formats.html#toc-image2-2">4.15 image2</a></h2>
  2618. <p>Image file muxer.
  2619. </p>
  2620. <p>The image file muxer writes video frames to image files.
  2621. </p>
  2622. <p>The output filenames are specified by a pattern, which can be used to
  2623. produce sequentially numbered series of files.
  2624. The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
  2625. specifies the position of the characters representing a numbering in
  2626. the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
  2627. representing the number in each filename is 0-padded to <var>N</var>
  2628. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  2629. the string &quot;%%&quot;.
  2630. </p>
  2631. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  2632. the file list specified will contain the number 1, all the following
  2633. numbers will be sequential.
  2634. </p>
  2635. <p>The pattern may contain a suffix which is used to automatically
  2636. determine the format of the image files to write.
  2637. </p>
  2638. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  2639. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  2640. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
  2641. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  2642. form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
  2643. etc.
  2644. </p>
  2645. <p>The image muxer supports the .Y.U.V image file format. This format is
  2646. special in that that each image frame consists of three files, for
  2647. each of the YUV420P components. To read or write this image file format,
  2648. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  2649. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  2650. </p>
  2651. <a name="Options-15"></a>
  2652. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-15">4.15.1 Options</a></h3>
  2653. <dl compact="compact">
  2654. <dt>&lsquo;<samp>frame_pts</samp>&rsquo;</dt>
  2655. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  2656. Default value is 0.
  2657. </p>
  2658. </dd>
  2659. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  2660. <dd><p>Start the sequence from the specified number. Default value is 1.
  2661. </p>
  2662. </dd>
  2663. <dt>&lsquo;<samp>update</samp>&rsquo;</dt>
  2664. <dd><p>If set to 1, the filename will always be interpreted as just a
  2665. filename, not a pattern, and the corresponding file will be continuously
  2666. overwritten with new images. Default value is 0.
  2667. </p>
  2668. </dd>
  2669. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  2670. <dd><p>If set to 1, expand the filename with date and time information from
  2671. <code>strftime()</code>. Default value is 0.
  2672. </p>
  2673. </dd>
  2674. <dt>&lsquo;<samp>protocol_opts <var>options_list</var></samp>&rsquo;</dt>
  2675. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  2676. containing the <code>:</code> special character must be escaped.
  2677. </p>
  2678. </dd>
  2679. </dl>
  2680. <a name="Examples-9"></a>
  2681. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-9">4.15.2 Examples</a></h3>
  2682. <p>The following example shows how to use <code>ffmpeg</code> for creating a
  2683. sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
  2684. taking one image every second from the input video:
  2685. </p><div class="example">
  2686. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  2687. </pre></div>
  2688. <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
  2689. <code>-f</code> option and the output filename specifies an image file
  2690. format, the image2 muxer is automatically selected, so the previous
  2691. command can be written as:
  2692. </p><div class="example">
  2693. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  2694. </pre></div>
  2695. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  2696. &quot;%0<var>N</var>d&quot;, for example to create a single image file
  2697. &lsquo;<tt>img.jpeg</tt>&rsquo; from the start of the input video you can employ the command:
  2698. </p><div class="example">
  2699. <pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  2700. </pre></div>
  2701. <p>The &lsquo;<samp>strftime</samp>&rsquo; option allows you to expand the filename with
  2702. date and time information. Check the documentation of
  2703. the <code>strftime()</code> function for the syntax.
  2704. </p>
  2705. <p>For example to generate image files from the <code>strftime()</code>
  2706. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code>ffmpeg</code> command
  2707. can be used:
  2708. </p><div class="example">
  2709. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  2710. </pre></div>
  2711. <p>You can set the file name with current frame&rsquo;s PTS:
  2712. </p><div class="example">
  2713. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg&quot;
  2714. </pre></div>
  2715. <p>A more complex example is to publish contents of your desktop directly to a
  2716. WebDAV server every second:
  2717. </p><div class="example">
  2718. <pre class="example">ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
  2719. </pre></div>
  2720. <a name="matroska"></a>
  2721. <h2 class="section"><a href="ffmpeg-formats.html#toc-matroska">4.16 matroska</a></h2>
  2722. <p>Matroska container muxer.
  2723. </p>
  2724. <p>This muxer implements the matroska and webm container specs.
  2725. </p>
  2726. <a name="Metadata"></a>
  2727. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Metadata">4.16.1 Metadata</a></h3>
  2728. <p>The recognized metadata settings in this muxer are:
  2729. </p>
  2730. <dl compact="compact">
  2731. <dt>&lsquo;<samp>title</samp>&rsquo;</dt>
  2732. <dd><p>Set title name provided to a single track.
  2733. </p>
  2734. </dd>
  2735. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  2736. <dd><p>Specify the language of the track in the Matroska languages form.
  2737. </p>
  2738. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  2739. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  2740. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  2741. French).
  2742. </p>
  2743. </dd>
  2744. <dt>&lsquo;<samp>stereo_mode</samp>&rsquo;</dt>
  2745. <dd><p>Set stereo 3D video layout of two views in a single video track.
  2746. </p>
  2747. <p>The following values are recognized:
  2748. </p><dl compact="compact">
  2749. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  2750. <dd><p>video is not stereo
  2751. </p></dd>
  2752. <dt>&lsquo;<samp>left_right</samp>&rsquo;</dt>
  2753. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  2754. </p></dd>
  2755. <dt>&lsquo;<samp>bottom_top</samp>&rsquo;</dt>
  2756. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  2757. </p></dd>
  2758. <dt>&lsquo;<samp>top_bottom</samp>&rsquo;</dt>
  2759. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  2760. </p></dd>
  2761. <dt>&lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
  2762. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  2763. </p></dd>
  2764. <dt>&lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
  2765. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  2766. </p></dd>
  2767. <dt>&lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
  2768. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  2769. </p></dd>
  2770. <dt>&lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
  2771. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  2772. </p></dd>
  2773. <dt>&lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
  2774. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  2775. </p></dd>
  2776. <dt>&lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
  2777. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  2778. </p></dd>
  2779. <dt>&lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
  2780. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  2781. </p></dd>
  2782. <dt>&lsquo;<samp>right_left</samp>&rsquo;</dt>
  2783. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  2784. </p></dd>
  2785. <dt>&lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
  2786. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  2787. </p></dd>
  2788. <dt>&lsquo;<samp>block_lr</samp>&rsquo;</dt>
  2789. <dd><p>Both eyes laced in one Block, Left-eye view is first
  2790. </p></dd>
  2791. <dt>&lsquo;<samp>block_rl</samp>&rsquo;</dt>
  2792. <dd><p>Both eyes laced in one Block, Right-eye view is first
  2793. </p></dd>
  2794. </dl>
  2795. </dd>
  2796. </dl>
  2797. <p>For example a 3D WebM clip can be created using the following command line:
  2798. </p><div class="example">
  2799. <pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  2800. </pre></div>
  2801. <a name="Options-12"></a>
  2802. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-12">4.16.2 Options</a></h3>
  2803. <p>This muxer supports the following options:
  2804. </p>
  2805. <dl compact="compact">
  2806. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  2807. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  2808. terms) at the end of the file, because it cannot know in advance how much space
  2809. to leave for the index at the beginning of the file. However for some use cases
  2810. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  2811. index at the beginning of the file.
  2812. </p>
  2813. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  2814. of space in the file header and then try to write the cues there when the muxing
  2815. finishes. If the available space does not suffice, muxing will fail. A safe size
  2816. for most use cases should be about 50kB per hour of video.
  2817. </p>
  2818. <p>Note that cues are only written if the output is seekable and this option will
  2819. have no effect if it is not.
  2820. </p></dd>
  2821. </dl>
  2822. <p><a name="md5"></a>
  2823. </p><a name="md5-1"></a>
  2824. <h2 class="section"><a href="ffmpeg-formats.html#toc-md5-1">4.17 md5</a></h2>
  2825. <p>MD5 testing format.
  2826. </p>
  2827. <p>This is a variant of the <a href="#hash">hash</a> muxer. Unlike that muxer, it
  2828. defaults to using the MD5 hash function.
  2829. </p>
  2830. <a name="Examples-2"></a>
  2831. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-2">4.17.1 Examples</a></h3>
  2832. <p>To compute the MD5 hash of the input converted to raw
  2833. audio and video, and store it in the file &lsquo;<tt>out.md5</tt>&rsquo;:
  2834. </p><div class="example">
  2835. <pre class="example">ffmpeg -i INPUT -f md5 out.md5
  2836. </pre></div>
  2837. <p>You can print the MD5 to stdout with the command:
  2838. </p><div class="example">
  2839. <pre class="example">ffmpeg -i INPUT -f md5 -
  2840. </pre></div>
  2841. <p>See also the <a href="#hash">hash</a> and <a href="#framemd5">framemd5</a> muxers.
  2842. </p>
  2843. <a name="mov_002c-mp4_002c-ismv"></a>
  2844. <h2 class="section"><a href="ffmpeg-formats.html#toc-mov_002c-mp4_002c-ismv">4.18 mov, mp4, ismv</a></h2>
  2845. <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
  2846. </p>
  2847. <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  2848. file has all the metadata about all packets stored in one location
  2849. (written at the end of the file, it can be moved to the start for
  2850. better playback by adding <var>faststart</var> to the <var>movflags</var>, or
  2851. using the <code>qt-faststart</code> tool). A fragmented
  2852. file consists of a number of fragments, where packets and metadata
  2853. about these packets are stored together. Writing a fragmented
  2854. file has the advantage that the file is decodable even if the
  2855. writing is interrupted (while a normal MOV/MP4 is undecodable if
  2856. it is not properly finished), and it requires less memory when writing
  2857. very long files (since writing normal MOV/MP4 files stores info about
  2858. every single packet in memory until the file is closed). The downside
  2859. is that it is less compatible with other applications.
  2860. </p>
  2861. <a name="Options-11"></a>
  2862. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-11">4.18.1 Options</a></h3>
  2863. <p>Fragmentation is enabled by setting one of the AVOptions that define
  2864. how to cut the file into fragments:
  2865. </p>
  2866. <dl compact="compact">
  2867. <dt>&lsquo;<samp>-moov_size <var>bytes</var></samp>&rsquo;</dt>
  2868. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  2869. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  2870. </p></dd>
  2871. <dt>&lsquo;<samp>-movflags frag_keyframe</samp>&rsquo;</dt>
  2872. <dd><p>Start a new fragment at each video keyframe.
  2873. </p></dd>
  2874. <dt>&lsquo;<samp>-frag_duration <var>duration</var></samp>&rsquo;</dt>
  2875. <dd><p>Create fragments that are <var>duration</var> microseconds long.
  2876. </p></dd>
  2877. <dt>&lsquo;<samp>-frag_size <var>size</var></samp>&rsquo;</dt>
  2878. <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
  2879. </p></dd>
  2880. <dt>&lsquo;<samp>-movflags frag_custom</samp>&rsquo;</dt>
  2881. <dd><p>Allow the caller to manually choose when to cut fragments, by
  2882. calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
  2883. the packets written so far. (This is only useful with other
  2884. applications integrating libavformat, not from <code>ffmpeg</code>.)
  2885. </p></dd>
  2886. <dt>&lsquo;<samp>-min_frag_duration <var>duration</var></samp>&rsquo;</dt>
  2887. <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
  2888. </p></dd>
  2889. </dl>
  2890. <p>If more than one condition is specified, fragments are cut when
  2891. one of the specified conditions is fulfilled. The exception to this is
  2892. <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
  2893. conditions to apply.
  2894. </p>
  2895. <p>Additionally, the way the output file is written can be adjusted
  2896. through a few other options:
  2897. </p>
  2898. <dl compact="compact">
  2899. <dt>&lsquo;<samp>-movflags empty_moov</samp>&rsquo;</dt>
  2900. <dd><p>Write an initial moov atom directly at the start of the file, without
  2901. describing any samples in it. Generally, an mdat/moov pair is written
  2902. at the start of the file, as a normal MOV/MP4 file, containing only
  2903. a short portion of the file. With this option set, there is no initial
  2904. mdat atom, and the moov atom only describes the tracks but has
  2905. a zero duration.
  2906. </p>
  2907. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  2908. </p></dd>
  2909. <dt>&lsquo;<samp>-movflags separate_moof</samp>&rsquo;</dt>
  2910. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  2911. packets for all tracks are written in a moof atom (which is slightly
  2912. more efficient), but with this option set, the muxer writes one moof/mdat
  2913. pair for each track, making it easier to separate tracks.
  2914. </p>
  2915. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  2916. </p></dd>
  2917. <dt>&lsquo;<samp>-movflags skip_sidx</samp>&rsquo;</dt>
  2918. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is high,
  2919. this option could be used for cases where sidx atom is not mandatory.
  2920. When global_sidx flag is enabled, this option will be ignored.
  2921. </p></dd>
  2922. <dt>&lsquo;<samp>-movflags faststart</samp>&rsquo;</dt>
  2923. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
  2924. This operation can take a while, and will not work in various situations such
  2925. as fragmented output, thus it is not enabled by default.
  2926. </p></dd>
  2927. <dt>&lsquo;<samp>-movflags rtphint</samp>&rsquo;</dt>
  2928. <dd><p>Add RTP hinting tracks to the output file.
  2929. </p></dd>
  2930. <dt>&lsquo;<samp>-movflags disable_chpl</samp>&rsquo;</dt>
  2931. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  2932. and a QuickTime chapter track are written to the file. With this option
  2933. set, only the QuickTime chapter track will be written. Nero chapters can
  2934. cause failures when the file is reprocessed with certain tagging programs, like
  2935. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  2936. </p></dd>
  2937. <dt>&lsquo;<samp>-movflags omit_tfhd_offset</samp>&rsquo;</dt>
  2938. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  2939. tying fragments to absolute byte positions in the file/streams.
  2940. </p></dd>
  2941. <dt>&lsquo;<samp>-movflags default_base_moof</samp>&rsquo;</dt>
  2942. <dd><p>Similarly to the omit_tfhd_offset, this flag avoids writing the
  2943. absolute base_data_offset field in tfhd atoms, but does so by using
  2944. the new default-base-is-moof flag instead. This flag is new from
  2945. 14496-12:2012. This may make the fragments easier to parse in certain
  2946. circumstances (avoiding basing track fragment location calculations
  2947. on the implicit end of the previous track fragment).
  2948. </p></dd>
  2949. <dt>&lsquo;<samp>-write_tmcd</samp>&rsquo;</dt>
  2950. <dd><p>Specify <code>on</code> to force writing a timecode track, <code>off</code> to disable it
  2951. and <code>auto</code> to write a timecode track only for mov and mp4 output (default).
  2952. </p></dd>
  2953. <dt>&lsquo;<samp>-movflags negative_cts_offsets</samp>&rsquo;</dt>
  2954. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  2955. be negative. This enables the initial sample to have DTS/CTS of zero, and
  2956. reduces the need for edit lists for some cases such as video tracks with
  2957. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  2958. guidelines.
  2959. </p>
  2960. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  2961. </p></dd>
  2962. <dt>&lsquo;<samp>-write_prft</samp>&rsquo;</dt>
  2963. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  2964. NTP field in the PRFT box. Set value as &lsquo;<samp>wallclock</samp>&rsquo; to specify timesource
  2965. as wallclock time and &lsquo;<samp>pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  2966. values.
  2967. </p>
  2968. <p>Setting value to &lsquo;<samp>pts</samp>&rsquo; is applicable only for a live encoding use case,
  2969. where PTS values are set as as wallclock time at the source. For example, an
  2970. encoding use case with decklink capture source where &lsquo;<samp>video_pts</samp>&rsquo; and
  2971. &lsquo;<samp>audio_pts</samp>&rsquo; are set to &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  2972. </p></dd>
  2973. </dl>
  2974. <a name="Example-1"></a>
  2975. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Example-1">4.18.2 Example</a></h3>
  2976. <p>Smooth Streaming content can be pushed in real time to a publishing
  2977. point on IIS with this muxer. Example:
  2978. </p><div class="example">
  2979. <pre class="example">ffmpeg -re <var>&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  2980. </pre></div>
  2981. <a name="mp3"></a>
  2982. <h2 class="section"><a href="ffmpeg-formats.html#toc-mp3">4.19 mp3</a></h2>
  2983. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  2984. </p><ul>
  2985. <li>
  2986. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  2987. 2.4 are supported, the <code>id3v2_version</code> private option controls which one is
  2988. used (3 or 4). Setting <code>id3v2_version</code> to 0 disables the ID3v2 header
  2989. completely.
  2990. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  2991. The pictures are supplied to the muxer in form of a video stream with a single
  2992. packet. There can be any number of those streams, each will correspond to a
  2993. single APIC frame. The stream metadata tags <var>title</var> and <var>comment</var> map
  2994. to APIC <var>description</var> and <var>picture type</var> respectively. See
  2995. <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  2996. </p>
  2997. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  2998. buffer the audio frames until it gets all the pictures. It is therefore advised
  2999. to provide the pictures as soon as possible to avoid excessive buffering.
  3000. </p>
  3001. </li><li>
  3002. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  3003. default, but will be written only if the output is seekable. The
  3004. <code>write_xing</code> private option can be used to disable it. The frame contains
  3005. various information that may be useful to the decoder, like the audio duration
  3006. or encoder delay.
  3007. </li><li>
  3008. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  3009. enabled with the <code>write_id3v1</code> private option, but as its capabilities are
  3010. very limited, its usage is not recommended.
  3011. </li></ul>
  3012. <p>Examples:
  3013. </p>
  3014. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  3015. </p><div class="example">
  3016. <pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  3017. </pre></div>
  3018. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  3019. with <code>map</code>:
  3020. </p><div class="example">
  3021. <pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  3022. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  3023. </pre></div>
  3024. <p>Write a &quot;clean&quot; MP3 without any extra features:
  3025. </p><div class="example">
  3026. <pre class="example">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  3027. </pre></div>
  3028. <a name="mpegts"></a>
  3029. <h2 class="section"><a href="ffmpeg-formats.html#toc-mpegts">4.20 mpegts</a></h2>
  3030. <p>MPEG transport stream muxer.
  3031. </p>
  3032. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  3033. </p>
  3034. <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
  3035. and <code>service_name</code>. If they are not set the default for
  3036. <code>service_provider</code> is &lsquo;<samp>FFmpeg</samp>&rsquo; and the default for
  3037. <code>service_name</code> is &lsquo;<samp>Service01</samp>&rsquo;.
  3038. </p>
  3039. <a name="Options-4"></a>
  3040. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-4">4.20.1 Options</a></h3>
  3041. <p>The muxer options are:
  3042. </p>
  3043. <dl compact="compact">
  3044. <dt>&lsquo;<samp>mpegts_transport_stream_id <var>integer</var></samp>&rsquo;</dt>
  3045. <dd><p>Set the &lsquo;<samp>transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  3046. Default is <code>0x0001</code>.
  3047. </p>
  3048. </dd>
  3049. <dt>&lsquo;<samp>mpegts_original_network_id <var>integer</var></samp>&rsquo;</dt>
  3050. <dd><p>Set the &lsquo;<samp>original_network_id</samp>&rsquo;. This is unique identifier of a
  3051. network in DVB. Its main use is in the unique identification of a service
  3052. through the path &lsquo;<samp>Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  3053. is <code>0x0001</code>.
  3054. </p>
  3055. </dd>
  3056. <dt>&lsquo;<samp>mpegts_service_id <var>integer</var></samp>&rsquo;</dt>
  3057. <dd><p>Set the &lsquo;<samp>service_id</samp>&rsquo;, also known as program in DVB. Default is
  3058. <code>0x0001</code>.
  3059. </p>
  3060. </dd>
  3061. <dt>&lsquo;<samp>mpegts_service_type <var>integer</var></samp>&rsquo;</dt>
  3062. <dd><p>Set the program &lsquo;<samp>service_type</samp>&rsquo;. Default is <code>digital_tv</code>.
  3063. Accepts the following options:
  3064. </p><dl compact="compact">
  3065. <dt>&lsquo;<samp>hex_value</samp>&rsquo;</dt>
  3066. <dd><p>Any hexadecimal value between <code>0x01</code> and <code>0xff</code> as defined in
  3067. ETSI 300 468.
  3068. </p></dd>
  3069. <dt>&lsquo;<samp>digital_tv</samp>&rsquo;</dt>
  3070. <dd><p>Digital TV service.
  3071. </p></dd>
  3072. <dt>&lsquo;<samp>digital_radio</samp>&rsquo;</dt>
  3073. <dd><p>Digital Radio service.
  3074. </p></dd>
  3075. <dt>&lsquo;<samp>teletext</samp>&rsquo;</dt>
  3076. <dd><p>Teletext service.
  3077. </p></dd>
  3078. <dt>&lsquo;<samp>advanced_codec_digital_radio</samp>&rsquo;</dt>
  3079. <dd><p>Advanced Codec Digital Radio service.
  3080. </p></dd>
  3081. <dt>&lsquo;<samp>mpeg2_digital_hdtv</samp>&rsquo;</dt>
  3082. <dd><p>MPEG2 Digital HDTV service.
  3083. </p></dd>
  3084. <dt>&lsquo;<samp>advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  3085. <dd><p>Advanced Codec Digital SDTV service.
  3086. </p></dd>
  3087. <dt>&lsquo;<samp>advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  3088. <dd><p>Advanced Codec Digital HDTV service.
  3089. </p></dd>
  3090. </dl>
  3091. </dd>
  3092. <dt>&lsquo;<samp>mpegts_pmt_start_pid <var>integer</var></samp>&rsquo;</dt>
  3093. <dd><p>Set the first PID for PMTs. Default is <code>0x1000</code>, minimum is <code>0x0020</code>,
  3094. maximum is <code>0x1ffa</code>.
  3095. </p>
  3096. </dd>
  3097. <dt>&lsquo;<samp>mpegts_start_pid <var>integer</var></samp>&rsquo;</dt>
  3098. <dd><p>Set the first PID for elementary streams. Default is <code>0x0100</code>, minimum is
  3099. <code>0x0020</code>, maximum is <code>0x1ffa</code>.
  3100. </p>
  3101. </dd>
  3102. <dt>&lsquo;<samp>mpegts_m2ts_mode <var>boolean</var></samp>&rsquo;</dt>
  3103. <dd><p>Enable m2ts mode if set to <code>1</code>. Default value is <code>-1</code> which
  3104. disables m2ts mode.
  3105. </p>
  3106. </dd>
  3107. <dt>&lsquo;<samp>muxrate <var>integer</var></samp>&rsquo;</dt>
  3108. <dd><p>Set a constant muxrate. Default is VBR.
  3109. </p>
  3110. </dd>
  3111. <dt>&lsquo;<samp>pes_payload_size <var>integer</var></samp>&rsquo;</dt>
  3112. <dd><p>Set minimum PES packet payload in bytes. Default is <code>2930</code>.
  3113. </p>
  3114. </dd>
  3115. <dt>&lsquo;<samp>mpegts_flags <var>flags</var></samp>&rsquo;</dt>
  3116. <dd><p>Set mpegts flags. Accepts the following options:
  3117. </p><dl compact="compact">
  3118. <dt>&lsquo;<samp>resend_headers</samp>&rsquo;</dt>
  3119. <dd><p>Reemit PAT/PMT before writing the next packet.
  3120. </p></dd>
  3121. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  3122. <dd><p>Use LATM packetization for AAC.
  3123. </p></dd>
  3124. <dt>&lsquo;<samp>pat_pmt_at_frames</samp>&rsquo;</dt>
  3125. <dd><p>Reemit PAT and PMT at each video frame.
  3126. </p></dd>
  3127. <dt>&lsquo;<samp>system_b</samp>&rsquo;</dt>
  3128. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  3129. </p></dd>
  3130. <dt>&lsquo;<samp>initial_discontinuity</samp>&rsquo;</dt>
  3131. <dd><p>Mark the initial packet of each stream as discontinuity.
  3132. </p></dd>
  3133. </dl>
  3134. </dd>
  3135. <dt>&lsquo;<samp>mpegts_copyts <var>boolean</var></samp>&rsquo;</dt>
  3136. <dd><p>Preserve original timestamps, if value is set to <code>1</code>. Default value
  3137. is <code>-1</code>, which results in shifting timestamps so that they start from 0.
  3138. </p>
  3139. </dd>
  3140. <dt>&lsquo;<samp>omit_video_pes_length <var>boolean</var></samp>&rsquo;</dt>
  3141. <dd><p>Omit the PES packet length for video packets. Default is <code>1</code> (true).
  3142. </p>
  3143. </dd>
  3144. <dt>&lsquo;<samp>pcr_period <var>integer</var></samp>&rsquo;</dt>
  3145. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  3146. <code>-1</code> which means that the PCR interval will be determined automatically:
  3147. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  3148. is less than 100 ms is used for VBR streams.
  3149. </p>
  3150. </dd>
  3151. <dt>&lsquo;<samp>pat_period <var>duration</var></samp>&rsquo;</dt>
  3152. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code>0.1</code>.
  3153. </p>
  3154. </dd>
  3155. <dt>&lsquo;<samp>sdt_period <var>duration</var></samp>&rsquo;</dt>
  3156. <dd><p>Maximum time in seconds between SDT tables. Default is <code>0.5</code>.
  3157. </p>
  3158. </dd>
  3159. <dt>&lsquo;<samp>tables_version <var>integer</var></samp>&rsquo;</dt>
  3160. <dd><p>Set PAT, PMT and SDT version (default <code>0</code>, valid values are from 0 to 31, inclusively).
  3161. This option allows updating stream structure so that standard consumer may
  3162. detect the change. To do so, reopen output <code>AVFormatContext</code> (in case of API
  3163. usage) or restart <code>ffmpeg</code> instance, cyclically changing
  3164. &lsquo;<samp>tables_version</samp>&rsquo; value:
  3165. </p>
  3166. <div class="example">
  3167. <pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  3168. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  3169. ...
  3170. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  3171. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  3172. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  3173. ...
  3174. </pre></div>
  3175. </dd>
  3176. </dl>
  3177. <a name="Example-2"></a>
  3178. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Example-2">4.20.2 Example</a></h3>
  3179. <div class="example">
  3180. <pre class="example">ffmpeg -i file.mpg -c copy \
  3181. -mpegts_original_network_id 0x1122 \
  3182. -mpegts_transport_stream_id 0x3344 \
  3183. -mpegts_service_id 0x5566 \
  3184. -mpegts_pmt_start_pid 0x1500 \
  3185. -mpegts_start_pid 0x150 \
  3186. -metadata service_provider=&quot;Some provider&quot; \
  3187. -metadata service_name=&quot;Some Channel&quot; \
  3188. out.ts
  3189. </pre></div>
  3190. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  3191. <h2 class="section"><a href="ffmpeg-formats.html#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom">4.21 mxf, mxf_d10, mxf_opatom</a></h2>
  3192. <p>MXF muxer.
  3193. </p>
  3194. <a name="Options-1"></a>
  3195. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-1">4.21.1 Options</a></h3>
  3196. <p>The muxer options are:
  3197. </p>
  3198. <dl compact="compact">
  3199. <dt>&lsquo;<samp>store_user_comments <var>bool</var></samp>&rsquo;</dt>
  3200. <dd><p>Set if user comments should be stored if available or never.
  3201. IRT D-10 does not allow user comments. The default is thus to write them for
  3202. mxf and mxf_opatom but not for mxf_d10
  3203. </p></dd>
  3204. </dl>
  3205. <a name="null"></a>
  3206. <h2 class="section"><a href="ffmpeg-formats.html#toc-null">4.22 null</a></h2>
  3207. <p>Null muxer.
  3208. </p>
  3209. <p>This muxer does not generate any output file, it is mainly useful for
  3210. testing or benchmarking purposes.
  3211. </p>
  3212. <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
  3213. command:
  3214. </p><div class="example">
  3215. <pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
  3216. </pre></div>
  3217. <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
  3218. file, but specifying the output file is required by the <code>ffmpeg</code>
  3219. syntax.
  3220. </p>
  3221. <p>Alternatively you can write the command as:
  3222. </p><div class="example">
  3223. <pre class="example">ffmpeg -benchmark -i INPUT -f null -
  3224. </pre></div>
  3225. <a name="nut"></a>
  3226. <h2 class="section"><a href="ffmpeg-formats.html#toc-nut">4.23 nut</a></h2>
  3227. <dl compact="compact">
  3228. <dt>&lsquo;<samp>-syncpoints <var>flags</var></samp>&rsquo;</dt>
  3229. <dd><p>Change the syncpoint usage in nut:
  3230. </p><dl compact="compact">
  3231. <dt>&lsquo;<samp><var>default</var> use the normal low-overhead seeking aids.</samp>&rsquo;</dt>
  3232. <dt>&lsquo;<samp><var>none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp>&rsquo;</dt>
  3233. <dd><p> Use of this option is not recommended, as the resulting files are very damage
  3234. sensitive and seeking is not possible. Also in general the overhead from
  3235. syncpoints is negligible. Note, -<code>write_index</code> 0 can be used to disable
  3236. all growing data tables, allowing to mux endless streams with limited memory
  3237. and without these disadvantages.
  3238. </p></dd>
  3239. <dt>&lsquo;<samp><var>timestamped</var> extend the syncpoint with a wallclock field.</samp>&rsquo;</dt>
  3240. </dl>
  3241. <p>The <var>none</var> and <var>timestamped</var> flags are experimental.
  3242. </p></dd>
  3243. <dt>&lsquo;<samp>-write_index <var>bool</var></samp>&rsquo;</dt>
  3244. <dd><p>Write index at the end, the default is to write an index.
  3245. </p></dd>
  3246. </dl>
  3247. <div class="example">
  3248. <pre class="example">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  3249. </pre></div>
  3250. <a name="ogg"></a>
  3251. <h2 class="section"><a href="ffmpeg-formats.html#toc-ogg">4.24 ogg</a></h2>
  3252. <p>Ogg container muxer.
  3253. </p>
  3254. <dl compact="compact">
  3255. <dt>&lsquo;<samp>-page_duration <var>duration</var></samp>&rsquo;</dt>
  3256. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  3257. pages that are approximately <var>duration</var> microseconds long. This allows the
  3258. user to compromise between seek granularity and container overhead. The default
  3259. is 1 second. A value of 0 will fill all segments, making pages as large as
  3260. possible. A value of 1 will effectively use 1 packet-per-page in most
  3261. situations, giving a small seek granularity at the cost of additional container
  3262. overhead.
  3263. </p></dd>
  3264. <dt>&lsquo;<samp>-serial_offset <var>value</var></samp>&rsquo;</dt>
  3265. <dd><p>Serial value from which to set the streams serial number.
  3266. Setting it to different and sufficiently large values ensures that the produced
  3267. ogg files can be safely chained.
  3268. </p>
  3269. </dd>
  3270. </dl>
  3271. <p><a name="segment"></a>
  3272. </p><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  3273. <h2 class="section"><a href="ffmpeg-formats.html#toc-segment_002c-stream_005fsegment_002c-ssegment">4.25 segment, stream_segment, ssegment</a></h2>
  3274. <p>Basic stream segmenter.
  3275. </p>
  3276. <p>This muxer outputs streams to a number of separate files of nearly
  3277. fixed duration. Output filename pattern can be set in a fashion
  3278. similar to <a href="#image2">image2</a>, or by using a <code>strftime</code> template if
  3279. the &lsquo;<samp>strftime</samp>&rsquo; option is enabled.
  3280. </p>
  3281. <p><code>stream_segment</code> is a variant of the muxer used to write to
  3282. streaming output formats, i.e. which do not require global headers,
  3283. and is recommended for outputting e.g. to MPEG transport stream segments.
  3284. <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
  3285. </p>
  3286. <p>Every segment starts with a keyframe of the selected reference stream,
  3287. which is set through the &lsquo;<samp>reference_stream</samp>&rsquo; option.
  3288. </p>
  3289. <p>Note that if you want accurate splitting for a video file, you need to
  3290. make the input key frames correspond to the exact splitting times
  3291. expected by the segmenter, or the segment muxer will start the new
  3292. segment with the key frame found next after the specified start
  3293. time.
  3294. </p>
  3295. <p>The segment muxer works best with a single constant frame rate video.
  3296. </p>
  3297. <p>Optionally it can generate a list of the created segments, by setting
  3298. the option <var>segment_list</var>. The list type is specified by the
  3299. <var>segment_list_type</var> option. The entry filenames in the segment
  3300. list are set by default to the basename of the corresponding segment
  3301. files.
  3302. </p>
  3303. <p>See also the <a href="#hls">hls</a> muxer, which provides a more specific
  3304. implementation for HLS segmentation.
  3305. </p>
  3306. <a name="Options-2"></a>
  3307. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-2">4.25.1 Options</a></h3>
  3308. <p>The segment muxer supports the following options:
  3309. </p>
  3310. <dl compact="compact">
  3311. <dt>&lsquo;<samp>increment_tc <var>1|0</var></samp>&rsquo;</dt>
  3312. <dd><p>if set to <code>1</code>, increment timecode between each segment
  3313. If this is selected, the input need to have
  3314. a timecode in the first video stream. Default value is
  3315. <code>0</code>.
  3316. </p>
  3317. </dd>
  3318. <dt>&lsquo;<samp>reference_stream <var>specifier</var></samp>&rsquo;</dt>
  3319. <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
  3320. If <var>specifier</var> is set to <code>auto</code>, the reference is chosen
  3321. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  3322. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  3323. reference stream. The default value is <code>auto</code>.
  3324. </p>
  3325. </dd>
  3326. <dt>&lsquo;<samp>segment_format <var>format</var></samp>&rsquo;</dt>
  3327. <dd><p>Override the inner container format, by default it is guessed by the filename
  3328. extension.
  3329. </p>
  3330. </dd>
  3331. <dt>&lsquo;<samp>segment_format_options <var>options_list</var></samp>&rsquo;</dt>
  3332. <dd><p>Set output format options using a :-separated list of key=value
  3333. parameters. Values containing the <code>:</code> special character must be
  3334. escaped.
  3335. </p>
  3336. </dd>
  3337. <dt>&lsquo;<samp>segment_list <var>name</var></samp>&rsquo;</dt>
  3338. <dd><p>Generate also a listfile named <var>name</var>. If not specified no
  3339. listfile is generated.
  3340. </p>
  3341. </dd>
  3342. <dt>&lsquo;<samp>segment_list_flags <var>flags</var></samp>&rsquo;</dt>
  3343. <dd><p>Set flags affecting the segment list generation.
  3344. </p>
  3345. <p>It currently supports the following flags:
  3346. </p><dl compact="compact">
  3347. <dt>&lsquo;<samp>cache</samp>&rsquo;</dt>
  3348. <dd><p>Allow caching (only affects M3U8 list files).
  3349. </p>
  3350. </dd>
  3351. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  3352. <dd><p>Allow live-friendly file generation.
  3353. </p></dd>
  3354. </dl>
  3355. </dd>
  3356. <dt>&lsquo;<samp>segment_list_size <var>size</var></samp>&rsquo;</dt>
  3357. <dd><p>Update the list file so that it contains at most <var>size</var>
  3358. segments. If 0 the list file will contain all the segments. Default
  3359. value is 0.
  3360. </p>
  3361. </dd>
  3362. <dt>&lsquo;<samp>segment_list_entry_prefix <var>prefix</var></samp>&rsquo;</dt>
  3363. <dd><p>Prepend <var>prefix</var> to each entry. Useful to generate absolute paths.
  3364. By default no prefix is applied.
  3365. </p>
  3366. </dd>
  3367. <dt>&lsquo;<samp>segment_list_type <var>type</var></samp>&rsquo;</dt>
  3368. <dd><p>Select the listing format.
  3369. </p>
  3370. <p>The following values are recognized:
  3371. </p><dl compact="compact">
  3372. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  3373. <dd><p>Generate a flat list for the created segments, one segment per line.
  3374. </p>
  3375. </dd>
  3376. <dt>&lsquo;<samp>csv, ext</samp>&rsquo;</dt>
  3377. <dd><p>Generate a list for the created segments, one segment per line,
  3378. each line matching the format (comma-separated values):
  3379. </p><div class="example">
  3380. <pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
  3381. </pre></div>
  3382. <p><var>segment_filename</var> is the name of the output file generated by the
  3383. muxer according to the provided pattern. CSV escaping (according to
  3384. RFC4180) is applied if required.
  3385. </p>
  3386. <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
  3387. the segment start and end time expressed in seconds.
  3388. </p>
  3389. <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
  3390. auto-select this format.
  3391. </p>
  3392. <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
  3393. </p>
  3394. </dd>
  3395. <dt>&lsquo;<samp>ffconcat</samp>&rsquo;</dt>
  3396. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  3397. can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
  3398. </p>
  3399. <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
  3400. auto-select this format.
  3401. </p>
  3402. </dd>
  3403. <dt>&lsquo;<samp>m3u8</samp>&rsquo;</dt>
  3404. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  3405. <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  3406. </p>
  3407. <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
  3408. </p></dd>
  3409. </dl>
  3410. <p>If not specified the type is guessed from the list file name suffix.
  3411. </p>
  3412. </dd>
  3413. <dt>&lsquo;<samp>segment_time <var>time</var></samp>&rsquo;</dt>
  3414. <dd><p>Set segment duration to <var>time</var>, the value must be a duration
  3415. specification. Default value is &quot;2&quot;. See also the
  3416. &lsquo;<samp>segment_times</samp>&rsquo; option.
  3417. </p>
  3418. <p>Note that splitting may not be accurate, unless you force the
  3419. reference stream key-frames at the given time. See the introductory
  3420. notice and the examples below.
  3421. </p>
  3422. </dd>
  3423. <dt>&lsquo;<samp>segment_atclocktime <var>1|0</var></samp>&rsquo;</dt>
  3424. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  3425. o&rsquo;clock. The <var>time</var> value specified in &lsquo;<samp>segment_time</samp>&rsquo; is
  3426. used for setting the length of the splitting interval.
  3427. </p>
  3428. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; this makes it possible
  3429. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  3430. </p>
  3431. <p>Default value is &quot;0&quot;.
  3432. </p>
  3433. </dd>
  3434. <dt>&lsquo;<samp>segment_clocktime_offset <var>duration</var></samp>&rsquo;</dt>
  3435. <dd><p>Delay the segment splitting times with the specified duration when using
  3436. &lsquo;<samp>segment_atclocktime</samp>&rsquo;.
  3437. </p>
  3438. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; and
  3439. &lsquo;<samp>segment_clocktime_offset</samp>&rsquo; set to &quot;300&quot; this makes it possible to
  3440. create files at 12:05, 12:20, 12:35, etc.
  3441. </p>
  3442. <p>Default value is &quot;0&quot;.
  3443. </p>
  3444. </dd>
  3445. <dt>&lsquo;<samp>segment_clocktime_wrap_duration <var>duration</var></samp>&rsquo;</dt>
  3446. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  3447. within the specified duration after the segmenting clock time. This way you
  3448. can make the segmenter more resilient to backward local time jumps, such as
  3449. leap seconds or transition to standard time from daylight savings time.
  3450. </p>
  3451. <p>Default is the maximum possible duration which means starting a new segment
  3452. regardless of the elapsed time since the last clock time.
  3453. </p>
  3454. </dd>
  3455. <dt>&lsquo;<samp>segment_time_delta <var>delta</var></samp>&rsquo;</dt>
  3456. <dd><p>Specify the accuracy time when selecting the start time for a
  3457. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  3458. </p>
  3459. <p>When delta is specified a key-frame will start a new segment if its
  3460. PTS satisfies the relation:
  3461. </p><div class="example">
  3462. <pre class="example">PTS &gt;= start_time - time_delta
  3463. </pre></div>
  3464. <p>This option is useful when splitting video content, which is always
  3465. split at GOP boundaries, in case a key frame is found just before the
  3466. specified split time.
  3467. </p>
  3468. <p>In particular may be used in combination with the &lsquo;<tt>ffmpeg</tt>&rsquo; option
  3469. <var>force_key_frames</var>. The key frame times specified by
  3470. <var>force_key_frames</var> may not be set accurately because of rounding
  3471. issues, with the consequence that a key frame time may result set just
  3472. before the specified time. For constant frame rate videos a value of
  3473. 1/(2*<var>frame_rate</var>) should address the worst case mismatch between
  3474. the specified time and the time set by <var>force_key_frames</var>.
  3475. </p>
  3476. </dd>
  3477. <dt>&lsquo;<samp>segment_times <var>times</var></samp>&rsquo;</dt>
  3478. <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
  3479. separated duration specifications, in increasing order. See also
  3480. the &lsquo;<samp>segment_time</samp>&rsquo; option.
  3481. </p>
  3482. </dd>
  3483. <dt>&lsquo;<samp>segment_frames <var>frames</var></samp>&rsquo;</dt>
  3484. <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
  3485. list of comma separated integer numbers, in increasing order.
  3486. </p>
  3487. <p>This option specifies to start a new segment whenever a reference
  3488. stream key frame is found and the sequential number (starting from 0)
  3489. of the frame is greater or equal to the next value in the list.
  3490. </p>
  3491. </dd>
  3492. <dt>&lsquo;<samp>segment_wrap <var>limit</var></samp>&rsquo;</dt>
  3493. <dd><p>Wrap around segment index once it reaches <var>limit</var>.
  3494. </p>
  3495. </dd>
  3496. <dt>&lsquo;<samp>segment_start_number <var>number</var></samp>&rsquo;</dt>
  3497. <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
  3498. </p>
  3499. </dd>
  3500. <dt>&lsquo;<samp>strftime <var>1|0</var></samp>&rsquo;</dt>
  3501. <dd><p>Use the <code>strftime</code> function to define the name of the new
  3502. segments to write. If this is selected, the output segment name must
  3503. contain a <code>strftime</code> function template. Default value is
  3504. <code>0</code>.
  3505. </p>
  3506. </dd>
  3507. <dt>&lsquo;<samp>break_non_keyframes <var>1|0</var></samp>&rsquo;</dt>
  3508. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  3509. improves behavior on some players when the time between keyframes is
  3510. inconsistent, but may make things worse on others, and can cause some oddities
  3511. during seeking. Defaults to <code>0</code>.
  3512. </p>
  3513. </dd>
  3514. <dt>&lsquo;<samp>reset_timestamps <var>1|0</var></samp>&rsquo;</dt>
  3515. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  3516. will start with near-zero timestamps. It is meant to ease the playback
  3517. of the generated segments. May not work with some combinations of
  3518. muxers/codecs. It is set to <code>0</code> by default.
  3519. </p>
  3520. </dd>
  3521. <dt>&lsquo;<samp>initial_offset <var>offset</var></samp>&rsquo;</dt>
  3522. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  3523. argument must be a time duration specification, and defaults to 0.
  3524. </p>
  3525. </dd>
  3526. <dt>&lsquo;<samp>write_empty_segments <var>1|0</var></samp>&rsquo;</dt>
  3527. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  3528. segment would usually span. Otherwise, the segment will be filled with the next
  3529. packet written. Defaults to <code>0</code>.
  3530. </p></dd>
  3531. </dl>
  3532. <p>Make sure to require a closed GOP when encoding and to set the GOP
  3533. size to fit your segment time constraint.
  3534. </p>
  3535. <a name="Examples-12"></a>
  3536. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-12">4.25.2 Examples</a></h3>
  3537. <ul>
  3538. <li>
  3539. Remux the content of file &lsquo;<tt>in.mkv</tt>&rsquo; to a list of segments
  3540. &lsquo;<tt>out-000.nut</tt>&rsquo;, &lsquo;<tt>out-001.nut</tt>&rsquo;, etc., and write the list of
  3541. generated segments to &lsquo;<tt>out.list</tt>&rsquo;:
  3542. <div class="example">
  3543. <pre class="example">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  3544. </pre></div>
  3545. </li><li>
  3546. Segment input and set output format options for the output segments:
  3547. <div class="example">
  3548. <pre class="example">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  3549. </pre></div>
  3550. </li><li>
  3551. Segment the input file according to the split points specified by the
  3552. <var>segment_times</var> option:
  3553. <div class="example">
  3554. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
  3555. </pre></div>
  3556. </li><li>
  3557. Use the <code>ffmpeg</code> &lsquo;<samp>force_key_frames</samp>&rsquo;
  3558. option to force key frames in the input at the specified location, together
  3559. with the segment option &lsquo;<samp>segment_time_delta</samp>&rsquo; to account for
  3560. possible roundings operated when setting key frame times.
  3561. <div class="example">
  3562. <pre class="example">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  3563. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  3564. </pre></div>
  3565. <p>In order to force key frames on the input file, transcoding is
  3566. required.
  3567. </p>
  3568. </li><li>
  3569. Segment the input file by splitting the input file according to the
  3570. frame numbers sequence specified with the &lsquo;<samp>segment_frames</samp>&rsquo; option:
  3571. <div class="example">
  3572. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  3573. </pre></div>
  3574. </li><li>
  3575. Convert the &lsquo;<tt>in.mkv</tt>&rsquo; to TS segments using the <code>libx264</code>
  3576. and <code>aac</code> encoders:
  3577. <div class="example">
  3578. <pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  3579. </pre></div>
  3580. </li><li>
  3581. Segment the input file, and create an M3U8 live playlist (can be used
  3582. as live HLS source):
  3583. <div class="example">
  3584. <pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  3585. -segment_list_flags +live -segment_time 10 out%03d.mkv
  3586. </pre></div>
  3587. </li></ul>
  3588. <a name="smoothstreaming"></a>
  3589. <h2 class="section"><a href="ffmpeg-formats.html#toc-smoothstreaming">4.26 smoothstreaming</a></h2>
  3590. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  3591. </p>
  3592. <dl compact="compact">
  3593. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  3594. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  3595. </p>
  3596. </dd>
  3597. <dt>&lsquo;<samp>extra_window_size</samp>&rsquo;</dt>
  3598. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  3599. </p>
  3600. </dd>
  3601. <dt>&lsquo;<samp>lookahead_count</samp>&rsquo;</dt>
  3602. <dd><p>Specify the number of lookahead fragments. Default 2.
  3603. </p>
  3604. </dd>
  3605. <dt>&lsquo;<samp>min_frag_duration</samp>&rsquo;</dt>
  3606. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  3607. </p>
  3608. </dd>
  3609. <dt>&lsquo;<samp>remove_at_exit</samp>&rsquo;</dt>
  3610. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  3611. </p>
  3612. </dd>
  3613. </dl>
  3614. <p><a name="streamhash"></a>
  3615. </p><a name="streamhash-1"></a>
  3616. <h2 class="section"><a href="ffmpeg-formats.html#toc-streamhash-1">4.27 streamhash</a></h2>
  3617. <p>Per stream hash testing format.
  3618. </p>
  3619. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  3620. on a per-stream basis. This can be used for equality checks without having
  3621. to do a complete binary comparison.
  3622. </p>
  3623. <p>By default audio frames are converted to signed 16-bit raw audio and
  3624. video frames to raw video before computing the hash, but the output
  3625. of explicit conversions to other codecs can also be used. Timestamps
  3626. are ignored. It uses the SHA-256 cryptographic hash function by default,
  3627. but supports several other algorithms.
  3628. </p>
  3629. <p>The output of the muxer consists of one line per stream of the form:
  3630. <var>streamindex</var>,<var>streamtype</var>,<var>algo</var>=<var>hash</var>, where
  3631. <var>streamindex</var> is the index of the mapped stream, <var>streamtype</var> is a
  3632. single character indicating the type of stream, <var>algo</var> is a short string
  3633. representing the hash function used, and <var>hash</var> is a hexadecimal number
  3634. representing the computed hash.
  3635. </p>
  3636. <dl compact="compact">
  3637. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  3638. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  3639. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  3640. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  3641. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  3642. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  3643. </p>
  3644. </dd>
  3645. </dl>
  3646. <a name="Examples"></a>
  3647. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples">4.27.1 Examples</a></h3>
  3648. <p>To compute the SHA-256 hash of the input converted to raw audio and
  3649. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  3650. </p><div class="example">
  3651. <pre class="example">ffmpeg -i INPUT -f streamhash out.sha256
  3652. </pre></div>
  3653. <p>To print an MD5 hash to stdout use the command:
  3654. </p><div class="example">
  3655. <pre class="example">ffmpeg -i INPUT -f streamhash -hash md5 -
  3656. </pre></div>
  3657. <p>See also the <a href="#hash">hash</a> and <a href="#framehash">framehash</a> muxers.
  3658. </p>
  3659. <p><a name="fifo"></a>
  3660. </p><a name="fifo-1"></a>
  3661. <h2 class="section"><a href="ffmpeg-formats.html#toc-fifo-1">4.28 fifo</a></h2>
  3662. <p>The fifo pseudo-muxer allows the separation of encoding and muxing by using
  3663. first-in-first-out queue and running the actual muxer in a separate thread. This
  3664. is especially useful in combination with the <a href="#tee">tee</a> muxer and can be used to
  3665. send data to several destinations with different reliability/writing speed/latency.
  3666. </p>
  3667. <p>API users should be aware that callback functions (interrupt_callback,
  3668. io_open and io_close) used within its AVFormatContext must be thread-safe.
  3669. </p>
  3670. <p>The behavior of the fifo muxer if the queue fills up or if the output fails is
  3671. selectable,
  3672. </p>
  3673. <ul>
  3674. <li>
  3675. output can be transparently restarted with configurable delay between retries
  3676. based on real time or time of the processed stream.
  3677. </li><li>
  3678. encoding can be blocked during temporary failure, or continue transparently
  3679. dropping packets in case fifo queue fills up.
  3680. </li></ul>
  3681. <dl compact="compact">
  3682. <dt>&lsquo;<samp>fifo_format</samp>&rsquo;</dt>
  3683. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  3684. output name suffix.
  3685. </p>
  3686. </dd>
  3687. <dt>&lsquo;<samp>queue_size</samp>&rsquo;</dt>
  3688. <dd><p>Specify size of the queue (number of packets). Default value is 60.
  3689. </p>
  3690. </dd>
  3691. <dt>&lsquo;<samp>format_opts</samp>&rsquo;</dt>
  3692. <dd><p>Specify format options for the underlying muxer. Muxer options can be specified
  3693. as a list of <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;.
  3694. </p>
  3695. </dd>
  3696. <dt>&lsquo;<samp>drop_pkts_on_overflow <var>bool</var></samp>&rsquo;</dt>
  3697. <dd><p>If set to 1 (true), in case the fifo queue fills up, packets will be dropped
  3698. rather than blocking the encoder. This makes it possible to continue streaming without
  3699. delaying the input, at the cost of omitting part of the stream. By default
  3700. this option is set to 0 (false), so in such cases the encoder will be blocked
  3701. until the muxer processes some of the packets and none of them is lost.
  3702. </p>
  3703. </dd>
  3704. <dt>&lsquo;<samp>attempt_recovery <var>bool</var></samp>&rsquo;</dt>
  3705. <dd><p>If failure occurs, attempt to recover the output. This is especially useful
  3706. when used with network output, since it makes it possible to restart streaming transparently.
  3707. By default this option is set to 0 (false).
  3708. </p>
  3709. </dd>
  3710. <dt>&lsquo;<samp>max_recovery_attempts</samp>&rsquo;</dt>
  3711. <dd><p>Sets maximum number of successive unsuccessful recovery attempts after which
  3712. the output fails permanently. By default this option is set to 0 (unlimited).
  3713. </p>
  3714. </dd>
  3715. <dt>&lsquo;<samp>recovery_wait_time <var>duration</var></samp>&rsquo;</dt>
  3716. <dd><p>Waiting time before the next recovery attempt after previous unsuccessful
  3717. recovery attempt. Default value is 5 seconds.
  3718. </p>
  3719. </dd>
  3720. <dt>&lsquo;<samp>recovery_wait_streamtime <var>bool</var></samp>&rsquo;</dt>
  3721. <dd><p>If set to 0 (false), the real time is used when waiting for the recovery
  3722. attempt (i.e. the recovery will be attempted after at least
  3723. recovery_wait_time seconds).
  3724. If set to 1 (true), the time of the processed stream is taken into account
  3725. instead (i.e. the recovery will be attempted after at least <var>recovery_wait_time</var>
  3726. seconds of the stream is omitted).
  3727. By default, this option is set to 0 (false).
  3728. </p>
  3729. </dd>
  3730. <dt>&lsquo;<samp>recover_any_error <var>bool</var></samp>&rsquo;</dt>
  3731. <dd><p>If set to 1 (true), recovery will be attempted regardless of type of the error
  3732. causing the failure. By default this option is set to 0 (false) and in case of
  3733. certain (usually permanent) errors the recovery is not attempted even when
  3734. <var>attempt_recovery</var> is set to 1.
  3735. </p>
  3736. </dd>
  3737. <dt>&lsquo;<samp>restart_with_keyframe <var>bool</var></samp>&rsquo;</dt>
  3738. <dd><p>Specify whether to wait for the keyframe after recovering from
  3739. queue overflow or failure. This option is set to 0 (false) by default.
  3740. </p>
  3741. </dd>
  3742. </dl>
  3743. <a name="Examples-4"></a>
  3744. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-4">4.28.1 Examples</a></h3>
  3745. <ul>
  3746. <li>
  3747. Stream something to rtmp server, continue processing the stream at real-time
  3748. rate even in case of temporary failure (network outage) and attempt to recover
  3749. streaming every second indefinitely.
  3750. <div class="example">
  3751. <pre class="example">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
  3752. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
  3753. </pre></div>
  3754. </li></ul>
  3755. <p><a name="tee"></a>
  3756. </p><a name="tee-1"></a>
  3757. <h2 class="section"><a href="ffmpeg-formats.html#toc-tee-1">4.29 tee</a></h2>
  3758. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  3759. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  3760. </p>
  3761. <p>It is different from specifying several outputs to the <code>ffmpeg</code>
  3762. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  3763. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  3764. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  3765. directly because it is then possible to feed the same packets to several muxers directly.
  3766. </p>
  3767. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  3768. output streams. So all streams intended for output must be specified using <code>-map</code>. See
  3769. the examples below.
  3770. </p>
  3771. <p>Some encoders may need different options depending on the output format;
  3772. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  3773. The main example is the &lsquo;<samp>global_header</samp>&rsquo; flag.
  3774. </p>
  3775. <p>The slave outputs are specified in the file name given to the muxer,
  3776. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  3777. leading or trailing spaces or any special character, those must be
  3778. escaped (see <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a>).
  3779. </p>
  3780. <a name="Options-7"></a>
  3781. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-7">4.29.1 Options</a></h3>
  3782. <dl compact="compact">
  3783. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  3784. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a href="#fifo">fifo</a>
  3785. muxer. This allows to compensate for different speed/latency/reliability of
  3786. outputs and setup transparent recovery. By default this feature is turned off.
  3787. </p>
  3788. </dd>
  3789. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  3790. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a href="#fifo">fifo</a>.
  3791. </p>
  3792. </dd>
  3793. </dl>
  3794. <p>Muxer options can be specified for each slave by prepending them as a list of
  3795. <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  3796. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  3797. must be escaped; note that this is a second level escaping.
  3798. </p>
  3799. <p>The following special options are also recognized:
  3800. </p><dl compact="compact">
  3801. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  3802. <dd><p>Specify the format name. Required if it cannot be guessed from the
  3803. output URL.
  3804. </p>
  3805. </dd>
  3806. <dt>&lsquo;<samp>bsfs[/<var>spec</var>]</samp>&rsquo;</dt>
  3807. <dd><p>Specify a list of bitstream filters to apply to the specified
  3808. output.
  3809. </p>
  3810. <p>It is possible to specify to which streams a given bitstream filter
  3811. applies, by appending a stream specifier to the option separated by
  3812. <code>/</code>. <var>spec</var> must be a stream specifier (see <a href="#Format-stream-specifiers">Format stream specifiers</a>).
  3813. </p>
  3814. <p>If the stream specifier is not specified, the bitstream filters will be
  3815. applied to all streams in the output. This will cause that output operation
  3816. to fail if the output contains streams to which the bitstream filter cannot
  3817. be applied e.g. <code>h264_mp4toannexb</code> being applied to an output containing an audio stream.
  3818. </p>
  3819. <p>Options for a bitstream filter must be specified in the form of <code>opt=value</code>.
  3820. </p>
  3821. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  3822. </p>
  3823. </dd>
  3824. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  3825. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  3826. </p>
  3827. </dd>
  3828. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  3829. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  3830. See <a href="#fifo">fifo</a>.
  3831. </p>
  3832. </dd>
  3833. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  3834. <dd><p>Select the streams that should be mapped to the slave output,
  3835. specified by a stream specifier. If not specified, this defaults to
  3836. all the mapped streams. This will cause that output operation to fail
  3837. if the output format does not accept all mapped streams.
  3838. </p>
  3839. <p>You may use multiple stream specifiers separated by commas (<code>,</code>) e.g.: <code>a:0,v</code>
  3840. </p>
  3841. </dd>
  3842. <dt>&lsquo;<samp>onfail</samp>&rsquo;</dt>
  3843. <dd><p>Specify behaviour on output failure. This can be set to either <code>abort</code> (which is
  3844. default) or <code>ignore</code>. <code>abort</code> will cause whole process to fail in case of failure
  3845. on this slave output. <code>ignore</code> will ignore failure on this output, so other outputs
  3846. will continue without being affected.
  3847. </p></dd>
  3848. </dl>
  3849. <a name="Examples-3"></a>
  3850. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Examples-3">4.29.2 Examples</a></h3>
  3851. <ul>
  3852. <li>
  3853. Encode something and both archive it in a WebM file and stream it
  3854. as MPEG-TS over UDP:
  3855. <div class="example">
  3856. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  3857. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  3858. </pre></div>
  3859. </li><li>
  3860. As above, but continue streaming even if output to local file fails
  3861. (for example local drive fills up):
  3862. <div class="example">
  3863. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  3864. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  3865. </pre></div>
  3866. </li><li>
  3867. Use <code>ffmpeg</code> to encode the input, and send the output
  3868. to three different destinations. The <code>dump_extra</code> bitstream
  3869. filter is used to add extradata information to all the output video
  3870. keyframes packets, as requested by the MPEG-TS format. The select
  3871. option is applied to &lsquo;<tt>out.aac</tt>&rsquo; in order to make it contain only
  3872. audio packets.
  3873. <div class="example">
  3874. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  3875. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  3876. </pre></div>
  3877. </li><li>
  3878. As above, but select only stream <code>a:1</code> for the audio output. Note
  3879. that a second level escaping must be performed, as &quot;:&quot; is a special
  3880. character used to separate options.
  3881. <div class="example">
  3882. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  3883. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  3884. </pre></div>
  3885. </li></ul>
  3886. <a name="webm_005fdash_005fmanifest"></a>
  3887. <h2 class="section"><a href="ffmpeg-formats.html#toc-webm_005fdash_005fmanifest">4.30 webm_dash_manifest</a></h2>
  3888. <p>WebM DASH Manifest muxer.
  3889. </p>
  3890. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  3891. manifest XML. It also supports manifest generation for DASH live streams.
  3892. </p>
  3893. <p>For more information see:
  3894. </p>
  3895. <ul>
  3896. <li>
  3897. WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  3898. </li><li>
  3899. ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  3900. </li></ul>
  3901. <a name="Options-5"></a>
  3902. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-5">4.30.1 Options</a></h3>
  3903. <p>This muxer supports the following options:
  3904. </p>
  3905. <dl compact="compact">
  3906. <dt>&lsquo;<samp>adaptation_sets</samp>&rsquo;</dt>
  3907. <dd><p>This option has the following syntax: &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; where x and y are the
  3908. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  3909. audio and video streams. Any number of adaptation sets can be added using this option.
  3910. </p>
  3911. </dd>
  3912. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  3913. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  3914. </p>
  3915. </dd>
  3916. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  3917. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp>startNumber</samp>&rsquo; attribute
  3918. of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  3919. </p>
  3920. </dd>
  3921. <dt>&lsquo;<samp>chunk_duration_ms</samp>&rsquo;</dt>
  3922. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp>duration</samp>&rsquo;
  3923. attribute of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  3924. </p>
  3925. </dd>
  3926. <dt>&lsquo;<samp>utc_timing_url</samp>&rsquo;</dt>
  3927. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  3928. in the &lsquo;<samp>value</samp>&rsquo; attribute of the &lsquo;<samp>UTCTiming</samp>&rsquo; element in the manifest.
  3929. Default: None.
  3930. </p>
  3931. </dd>
  3932. <dt>&lsquo;<samp>time_shift_buffer_depth</samp>&rsquo;</dt>
  3933. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  3934. guaranteed to be available. This will go in the &lsquo;<samp>timeShiftBufferDepth</samp>&rsquo;
  3935. attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 60.
  3936. </p>
  3937. </dd>
  3938. <dt>&lsquo;<samp>minimum_update_period</samp>&rsquo;</dt>
  3939. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  3940. &lsquo;<samp>minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 0.
  3941. </p>
  3942. </dd>
  3943. </dl>
  3944. <a name="Example-3"></a>
  3945. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Example-3">4.30.2 Example</a></h3>
  3946. <div class="example">
  3947. <pre class="example">ffmpeg -f webm_dash_manifest -i video1.webm \
  3948. -f webm_dash_manifest -i video2.webm \
  3949. -f webm_dash_manifest -i audio1.webm \
  3950. -f webm_dash_manifest -i audio2.webm \
  3951. -map 0 -map 1 -map 2 -map 3 \
  3952. -c copy \
  3953. -f webm_dash_manifest \
  3954. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  3955. manifest.xml
  3956. </pre></div>
  3957. <a name="webm_005fchunk"></a>
  3958. <h2 class="section"><a href="ffmpeg-formats.html#toc-webm_005fchunk">4.31 webm_chunk</a></h2>
  3959. <p>WebM Live Chunk Muxer.
  3960. </p>
  3961. <p>This muxer writes out WebM headers and chunks as separate files which can be
  3962. consumed by clients that support WebM Live streams via DASH.
  3963. </p>
  3964. <a name="Options-10"></a>
  3965. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Options-10">4.31.1 Options</a></h3>
  3966. <p>This muxer supports the following options:
  3967. </p>
  3968. <dl compact="compact">
  3969. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  3970. <dd><p>Index of the first chunk (defaults to 0).
  3971. </p>
  3972. </dd>
  3973. <dt>&lsquo;<samp>header</samp>&rsquo;</dt>
  3974. <dd><p>Filename of the header where the initialization data will be written.
  3975. </p>
  3976. </dd>
  3977. <dt>&lsquo;<samp>audio_chunk_duration</samp>&rsquo;</dt>
  3978. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  3979. </p></dd>
  3980. </dl>
  3981. <a name="Example"></a>
  3982. <h3 class="subsection"><a href="ffmpeg-formats.html#toc-Example">4.31.2 Example</a></h3>
  3983. <div class="example">
  3984. <pre class="example">ffmpeg -f v4l2 -i /dev/video0 \
  3985. -f alsa -i hw:0 \
  3986. -map 0:0 \
  3987. -c:v libvpx-vp9 \
  3988. -s 640x360 -keyint_min 30 -g 30 \
  3989. -f webm_chunk \
  3990. -header webm_live_video_360.hdr \
  3991. -chunk_start_index 1 \
  3992. webm_live_video_360_%d.chk \
  3993. -map 1:0 \
  3994. -c:a libvorbis \
  3995. -b:a 128k \
  3996. -f webm_chunk \
  3997. -header webm_live_audio_128.hdr \
  3998. -chunk_start_index 1 \
  3999. -audio_chunk_duration 1000 \
  4000. webm_live_audio_128_%d.chk
  4001. </pre></div>
  4002. <a name="Metadata-1"></a>
  4003. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Metadata-1">5 Metadata</a></h1>
  4004. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  4005. INI-like text file and then load it back using the metadata muxer/demuxer.
  4006. </p>
  4007. <p>The file format is as follows:
  4008. </p><ol>
  4009. <li>
  4010. A file consists of a header and a number of metadata tags divided into sections,
  4011. each on its own line.
  4012. </li><li>
  4013. The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  4014. </li><li>
  4015. Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
  4016. </li><li>
  4017. Immediately after header follows global metadata
  4018. </li><li>
  4019. After global metadata there may be sections with per-stream/per-chapter
  4020. metadata.
  4021. </li><li>
  4022. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  4023. brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
  4024. </li><li>
  4025. At the beginning of a chapter section there may be an optional timebase to be
  4026. used for start/end values. It must be in form
  4027. &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
  4028. integers. If the timebase is missing then start/end times are assumed to
  4029. be in nanoseconds.
  4030. <p>Next a chapter section must contain chapter start and end times in form
  4031. &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
  4032. integer.
  4033. </p>
  4034. </li><li>
  4035. Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
  4036. </li><li>
  4037. Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
  4038. &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
  4039. </li><li>
  4040. Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
  4041. a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
  4042. &lsquo;<samp> bar</samp>&rsquo;).
  4043. </li></ol>
  4044. <p>A ffmetadata file might look like this:
  4045. </p><div class="example">
  4046. <pre class="example">;FFMETADATA1
  4047. title=bike\\shed
  4048. ;this is a comment
  4049. artist=FFmpeg troll team
  4050. [CHAPTER]
  4051. TIMEBASE=1/1000
  4052. START=0
  4053. #chapter ends at 0:01:00
  4054. END=60000
  4055. title=chapter \#1
  4056. [STREAM]
  4057. title=multi\
  4058. line
  4059. </pre></div>
  4060. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  4061. metadata from an input file to an ffmetadata file, and then transcode
  4062. the file into an output file with the edited ffmetadata file.
  4063. </p>
  4064. <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
  4065. </p><div class="example">
  4066. <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  4067. </pre></div>
  4068. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  4069. be done as:
  4070. </p><div class="example">
  4071. <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  4072. </pre></div>
  4073. <a name="See-Also"></a>
  4074. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-See-Also">6 See Also</a></h1>
  4075. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  4076. <a href="libavformat.html">libavformat</a>
  4077. </p>
  4078. <a name="Authors"></a>
  4079. <h1 class="chapter"><a href="ffmpeg-formats.html#toc-Authors">7 Authors</a></h1>
  4080. <p>The FFmpeg developers.
  4081. </p>
  4082. <p>For details about the authorship, see the Git history of the project
  4083. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  4084. <code>git log</code> in the FFmpeg source directory, or browsing the
  4085. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  4086. </p>
  4087. <p>Maintainers for the specific components are listed in the file
  4088. &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
  4089. </p>
  4090. </div>
  4091. </body>
  4092. </html>