ffmpeg-formats.html 233 KB

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