ffmpeg-formats.html 227 KB

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