ffmpeg-formats.html 290 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564
  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-dvdvideo" href="#dvdvideo">3.7 dvdvideo</a>
  45. <ul class="toc-numbered-mark">
  46. <li><a id="toc-Background" href="#Background">3.7.1 Background</a></li>
  47. <li><a id="toc-Options-2" href="#Options-2">3.7.2 Options</a></li>
  48. <li><a id="toc-Examples-1" href="#Examples-1">3.7.3 Examples</a></li>
  49. </ul></li>
  50. <li><a id="toc-ea" href="#ea">3.8 ea</a>
  51. <ul class="toc-numbered-mark">
  52. <li><a id="toc-Options-3" href="#Options-3">3.8.1 Options</a></li>
  53. </ul></li>
  54. <li><a id="toc-imf" href="#imf">3.9 imf</a></li>
  55. <li><a id="toc-flv_002c-live_005fflv_002c-kux" href="#flv_002c-live_005fflv_002c-kux">3.10 flv, live_flv, kux</a></li>
  56. <li><a id="toc-gif-1" href="#gif-1">3.11 gif</a></li>
  57. <li><a id="toc-hls-1" href="#hls-1">3.12 hls</a></li>
  58. <li><a id="toc-image2-1" href="#image2-1">3.13 image2</a>
  59. <ul class="toc-numbered-mark">
  60. <li><a id="toc-Examples-2" href="#Examples-2">3.13.1 Examples</a></li>
  61. </ul></li>
  62. <li><a id="toc-libgme" href="#libgme">3.14 libgme</a></li>
  63. <li><a id="toc-libmodplug" href="#libmodplug">3.15 libmodplug</a></li>
  64. <li><a id="toc-libopenmpt" href="#libopenmpt">3.16 libopenmpt</a></li>
  65. <li><a id="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">3.17 mov/mp4/3gp</a>
  66. <ul class="toc-numbered-mark">
  67. <li><a id="toc-Options-4" href="#Options-4">3.17.1 Options</a></li>
  68. <li><a id="toc-Audible-AAX" href="#Audible-AAX">3.17.2 Audible AAX</a></li>
  69. </ul></li>
  70. <li><a id="toc-mpegts" href="#mpegts">3.18 mpegts</a></li>
  71. <li><a id="toc-mpjpeg" href="#mpjpeg">3.19 mpjpeg</a></li>
  72. <li><a id="toc-rawvideo" href="#rawvideo">3.20 rawvideo</a></li>
  73. <li><a id="toc-sbg" href="#sbg">3.21 sbg</a></li>
  74. <li><a id="toc-tedcaptions" href="#tedcaptions">3.22 tedcaptions</a></li>
  75. <li><a id="toc-vapoursynth" href="#vapoursynth">3.23 vapoursynth</a></li>
  76. <li><a id="toc-w64" href="#w64">3.24 w64</a></li>
  77. <li><a id="toc-wav-1" href="#wav-1">3.25 wav</a></li>
  78. </ul></li>
  79. <li><a id="toc-Muxers" href="#Muxers">4 Muxers</a>
  80. <ul class="toc-numbered-mark">
  81. <li><a id="toc-Raw-muxers" href="#Raw-muxers">4.1 Raw muxers</a>
  82. <ul class="toc-numbered-mark">
  83. <li><a id="toc-Examples-3" href="#Examples-3">4.1.1 Examples</a></li>
  84. </ul></li>
  85. <li><a id="toc-Raw-PCM-muxers" href="#Raw-PCM-muxers">4.2 Raw PCM muxers</a></li>
  86. <li><a id="toc-MPEG_002d1_002fMPEG_002d2-program-stream-muxers" href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers">4.3 MPEG-1/MPEG-2 program stream muxers</a>
  87. <ul class="toc-numbered-mark">
  88. <li><a id="toc-Options-5" href="#Options-5">4.3.1 Options</a></li>
  89. </ul></li>
  90. <li><a id="toc-MOV_002fMPEG_002d4_002fISOMBFF-muxers" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers">4.4 MOV/MPEG-4/ISOMBFF muxers</a>
  91. <ul class="toc-numbered-mark">
  92. <li><a id="toc-Fragmentation" href="#Fragmentation">4.4.1 Fragmentation</a></li>
  93. <li><a id="toc-Options-6" href="#Options-6">4.4.2 Options</a></li>
  94. <li><a id="toc-Examples-4" href="#Examples-4">4.4.3 Examples</a></li>
  95. </ul></li>
  96. <li><a id="toc-a64-1" href="#a64-1">4.5 a64</a></li>
  97. <li><a id="toc-ac4" href="#ac4">4.6 ac4</a>
  98. <ul class="toc-numbered-mark">
  99. <li><a id="toc-Options-7" href="#Options-7">4.6.1 Options</a></li>
  100. </ul></li>
  101. <li><a id="toc-adts-1" href="#adts-1">4.7 adts</a>
  102. <ul class="toc-numbered-mark">
  103. <li><a id="toc-Options-8" href="#Options-8">4.7.1 Options</a></li>
  104. </ul></li>
  105. <li><a id="toc-aea-1" href="#aea-1">4.8 aea</a></li>
  106. <li><a id="toc-aiff-1" href="#aiff-1">4.9 aiff</a>
  107. <ul class="toc-numbered-mark">
  108. <li><a id="toc-Options-9" href="#Options-9">4.9.1 Options</a></li>
  109. </ul></li>
  110. <li><a id="toc-alp-1" href="#alp-1">4.10 alp</a>
  111. <ul class="toc-numbered-mark">
  112. <li><a id="toc-Options-10" href="#Options-10">4.10.1 Options</a></li>
  113. </ul></li>
  114. <li><a id="toc-amr" href="#amr">4.11 amr</a></li>
  115. <li><a id="toc-amv" href="#amv">4.12 amv</a></li>
  116. <li><a id="toc-apm" href="#apm">4.13 apm</a></li>
  117. <li><a id="toc-apng-1" href="#apng-1">4.14 apng</a>
  118. <ul class="toc-numbered-mark">
  119. <li><a id="toc-Options-11" href="#Options-11">4.14.1 Options</a></li>
  120. <li><a id="toc-Examples-5" href="#Examples-5">4.14.2 Examples</a></li>
  121. </ul></li>
  122. <li><a id="toc-argo_005fasf" href="#argo_005fasf">4.15 argo_asf</a>
  123. <ul class="toc-numbered-mark">
  124. <li><a id="toc-Options-12" href="#Options-12">4.15.1 Options</a></li>
  125. </ul></li>
  126. <li><a id="toc-argo_005fcvg" href="#argo_005fcvg">4.16 argo_cvg</a>
  127. <ul class="toc-numbered-mark">
  128. <li><a id="toc-Options-13" href="#Options-13">4.16.1 Options</a></li>
  129. </ul></li>
  130. <li><a id="toc-asf_002c-asf_005fstream" href="#asf_002c-asf_005fstream">4.17 asf, asf_stream</a>
  131. <ul class="toc-numbered-mark">
  132. <li><a id="toc-Options-14" href="#Options-14">4.17.1 Options</a></li>
  133. </ul></li>
  134. <li><a id="toc-ass" href="#ass">4.18 ass</a>
  135. <ul class="toc-numbered-mark">
  136. <li><a id="toc-Options-15" href="#Options-15">4.18.1 Options</a></li>
  137. </ul></li>
  138. <li><a id="toc-ast" href="#ast">4.19 ast</a>
  139. <ul class="toc-numbered-mark">
  140. <li><a id="toc-Options-16" href="#Options-16">4.19.1 Options</a></li>
  141. </ul></li>
  142. <li><a id="toc-au" href="#au">4.20 au</a></li>
  143. <li><a id="toc-avi-1" href="#avi-1">4.21 avi</a>
  144. <ul class="toc-numbered-mark">
  145. <li><a id="toc-Options-17" href="#Options-17">4.21.1 Options</a></li>
  146. </ul></li>
  147. <li><a id="toc-avif" href="#avif">4.22 avif</a>
  148. <ul class="toc-numbered-mark">
  149. <li><a id="toc-Options-18" href="#Options-18">4.22.1 Options</a></li>
  150. </ul></li>
  151. <li><a id="toc-avm2" href="#avm2">4.23 avm2</a></li>
  152. <li><a id="toc-bit" href="#bit">4.24 bit</a></li>
  153. <li><a id="toc-caf" href="#caf">4.25 caf</a></li>
  154. <li><a id="toc-codec2" href="#codec2">4.26 codec2</a></li>
  155. <li><a id="toc-chromaprint-1" href="#chromaprint-1">4.27 chromaprint</a>
  156. <ul class="toc-numbered-mark">
  157. <li><a id="toc-Options-19" href="#Options-19">4.27.1 Options</a></li>
  158. </ul></li>
  159. <li><a id="toc-crc-1" href="#crc-1">4.28 crc</a>
  160. <ul class="toc-numbered-mark">
  161. <li><a id="toc-Examples-6" href="#Examples-6">4.28.1 Examples</a></li>
  162. </ul></li>
  163. <li><a id="toc-dash-2" href="#dash-2">4.29 dash</a>
  164. <ul class="toc-numbered-mark">
  165. <li><a id="toc-Options-20" href="#Options-20">4.29.1 Options</a></li>
  166. <li><a id="toc-Example" href="#Example">4.29.2 Example</a></li>
  167. </ul></li>
  168. <li><a id="toc-daud" href="#daud">4.30 daud</a>
  169. <ul class="toc-numbered-mark">
  170. <li><a id="toc-Example-1" href="#Example-1">4.30.1 Example</a></li>
  171. </ul></li>
  172. <li><a id="toc-dv" href="#dv">4.31 dv</a>
  173. <ul class="toc-numbered-mark">
  174. <li><a id="toc-Example-2" href="#Example-2">4.31.1 Example</a></li>
  175. </ul></li>
  176. <li><a id="toc-ffmetadata" href="#ffmetadata">4.32 ffmetadata</a>
  177. <ul class="toc-numbered-mark">
  178. <li><a id="toc-Example-3" href="#Example-3">4.32.1 Example</a></li>
  179. </ul></li>
  180. <li><a id="toc-fifo-1" href="#fifo-1">4.33 fifo</a>
  181. <ul class="toc-numbered-mark">
  182. <li><a id="toc-Options-21" href="#Options-21">4.33.1 Options</a></li>
  183. <li><a id="toc-Example-4" href="#Example-4">4.33.2 Example</a></li>
  184. </ul></li>
  185. <li><a id="toc-film_005fcpk" href="#film_005fcpk">4.34 film_cpk</a></li>
  186. <li><a id="toc-filmstrip" href="#filmstrip">4.35 filmstrip</a></li>
  187. <li><a id="toc-fits" href="#fits">4.36 fits</a></li>
  188. <li><a id="toc-flac" href="#flac">4.37 flac</a>
  189. <ul class="toc-numbered-mark">
  190. <li><a id="toc-Options-22" href="#Options-22">4.37.1 Options</a></li>
  191. <li><a id="toc-Example-5" href="#Example-5">4.37.2 Example</a></li>
  192. </ul></li>
  193. <li><a id="toc-flv" href="#flv">4.38 flv</a>
  194. <ul class="toc-numbered-mark">
  195. <li><a id="toc-Options-23" href="#Options-23">4.38.1 Options</a></li>
  196. </ul></li>
  197. <li><a id="toc-framecrc-1" href="#framecrc-1">4.39 framecrc</a>
  198. <ul class="toc-numbered-mark">
  199. <li><a id="toc-Examples-7" href="#Examples-7">4.39.1 Examples</a></li>
  200. </ul></li>
  201. <li><a id="toc-framehash-1" href="#framehash-1">4.40 framehash</a>
  202. <ul class="toc-numbered-mark">
  203. <li><a id="toc-Examples-8" href="#Examples-8">4.40.1 Examples</a></li>
  204. </ul></li>
  205. <li><a id="toc-framemd5-1" href="#framemd5-1">4.41 framemd5</a>
  206. <ul class="toc-numbered-mark">
  207. <li><a id="toc-Examples-9" href="#Examples-9">4.41.1 Examples</a></li>
  208. </ul></li>
  209. <li><a id="toc-gif-2" href="#gif-2">4.42 gif</a>
  210. <ul class="toc-numbered-mark">
  211. <li><a id="toc-Options-24" href="#Options-24">4.42.1 Options</a></li>
  212. <li><a id="toc-Example-6" href="#Example-6">4.42.2 Example</a></li>
  213. </ul></li>
  214. <li><a id="toc-gxf" href="#gxf">4.43 gxf</a></li>
  215. <li><a id="toc-hash-1" href="#hash-1">4.44 hash</a>
  216. <ul class="toc-numbered-mark">
  217. <li><a id="toc-Examples-10" href="#Examples-10">4.44.1 Examples</a></li>
  218. </ul></li>
  219. <li><a id="toc-hds-1" href="#hds-1">4.45 hds</a>
  220. <ul class="toc-numbered-mark">
  221. <li><a id="toc-Options-25" href="#Options-25">4.45.1 Options</a></li>
  222. <li><a id="toc-Example-7" href="#Example-7">4.45.2 Example</a></li>
  223. </ul></li>
  224. <li><a id="toc-hls-2" href="#hls-2">4.46 hls</a>
  225. <ul class="toc-numbered-mark">
  226. <li><a id="toc-Options-26" href="#Options-26">4.46.1 Options</a></li>
  227. </ul></li>
  228. <li><a id="toc-ico-1" href="#ico-1">4.47 ico</a></li>
  229. <li><a id="toc-image2-2" href="#image2-2">4.48 image2</a>
  230. <ul class="toc-numbered-mark">
  231. <li><a id="toc-Options-27" href="#Options-27">4.48.1 Options</a></li>
  232. <li><a id="toc-Examples-11" href="#Examples-11">4.48.2 Examples</a></li>
  233. </ul></li>
  234. <li><a id="toc-matroska" href="#matroska">4.49 matroska</a>
  235. <ul class="toc-numbered-mark">
  236. <li><a id="toc-Metadata" href="#Metadata">4.49.1 Metadata</a></li>
  237. <li><a id="toc-Options-28" href="#Options-28">4.49.2 Options</a></li>
  238. </ul></li>
  239. <li><a id="toc-md5-1" href="#md5-1">4.50 md5</a>
  240. <ul class="toc-numbered-mark">
  241. <li><a id="toc-Examples-12" href="#Examples-12">4.50.1 Examples</a></li>
  242. </ul></li>
  243. <li><a id="toc-mp3" href="#mp3">4.51 mp3</a></li>
  244. <li><a id="toc-mpegts-1" href="#mpegts-1">4.52 mpegts</a>
  245. <ul class="toc-numbered-mark">
  246. <li><a id="toc-Options-29" href="#Options-29">4.52.1 Options</a></li>
  247. <li><a id="toc-Example-8" href="#Example-8">4.52.2 Example</a></li>
  248. </ul></li>
  249. <li><a id="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">4.53 mxf, mxf_d10, mxf_opatom</a>
  250. <ul class="toc-numbered-mark">
  251. <li><a id="toc-Options-30" href="#Options-30">4.53.1 Options</a></li>
  252. </ul></li>
  253. <li><a id="toc-null" href="#null">4.54 null</a></li>
  254. <li><a id="toc-nut" href="#nut">4.55 nut</a></li>
  255. <li><a id="toc-ogg" href="#ogg">4.56 ogg</a></li>
  256. <li><a id="toc-rcwt-1" href="#rcwt-1">4.57 rcwt</a></li>
  257. <li><a id="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">4.58 segment, stream_segment, ssegment</a>
  258. <ul class="toc-numbered-mark">
  259. <li><a id="toc-Options-31" href="#Options-31">4.58.1 Options</a></li>
  260. <li><a id="toc-Examples-13" href="#Examples-13">4.58.2 Examples</a></li>
  261. </ul></li>
  262. <li><a id="toc-smoothstreaming" href="#smoothstreaming">4.59 smoothstreaming</a></li>
  263. <li><a id="toc-streamhash-1" href="#streamhash-1">4.60 streamhash</a>
  264. <ul class="toc-numbered-mark">
  265. <li><a id="toc-Examples-14" href="#Examples-14">4.60.1 Examples</a></li>
  266. </ul></li>
  267. <li><a id="toc-tee-1" href="#tee-1">4.61 tee</a>
  268. <ul class="toc-numbered-mark">
  269. <li><a id="toc-Options-32" href="#Options-32">4.61.1 Options</a></li>
  270. <li><a id="toc-Examples-15" href="#Examples-15">4.61.2 Examples</a></li>
  271. </ul></li>
  272. <li><a id="toc-webm_005fchunk" href="#webm_005fchunk">4.62 webm_chunk</a>
  273. <ul class="toc-numbered-mark">
  274. <li><a id="toc-Options-33" href="#Options-33">4.62.1 Options</a></li>
  275. <li><a id="toc-Example-9" href="#Example-9">4.62.2 Example</a></li>
  276. </ul></li>
  277. <li><a id="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">4.63 webm_dash_manifest</a>
  278. <ul class="toc-numbered-mark">
  279. <li><a id="toc-Options-34" href="#Options-34">4.63.1 Options</a></li>
  280. <li><a id="toc-Example-10" href="#Example-10">4.63.2 Example</a></li>
  281. </ul></li>
  282. </ul></li>
  283. <li><a id="toc-Metadata-1" href="#Metadata-1">5 Metadata</a></li>
  284. <li><a id="toc-See-Also" href="#See-Also">6 See Also</a></li>
  285. <li><a id="toc-Authors" href="#Authors">7 Authors</a></li>
  286. </ul>
  287. </div>
  288. </div>
  289. <ul class="mini-toc">
  290. <li><a href="#Description" accesskey="1">Description</a></li>
  291. <li><a href="#Format-Options" accesskey="2">Format Options</a></li>
  292. <li><a href="#Demuxers" accesskey="3">Demuxers</a></li>
  293. <li><a href="#Muxers" accesskey="4">Muxers</a></li>
  294. <li><a href="#Metadata-1" accesskey="5">Metadata</a></li>
  295. <li><a href="#See-Also" accesskey="6">See Also</a></li>
  296. <li><a href="#Authors" accesskey="7">Authors</a></li>
  297. </ul>
  298. <div class="chapter-level-extent" id="Description">
  299. <h2 class="chapter"><span>1 Description<a class="copiable-link" href="#Description"> &para;</a></span></h2>
  300. <p>This document describes the supported formats (muxers and demuxers)
  301. provided by the libavformat library.
  302. </p>
  303. </div>
  304. <div class="chapter-level-extent" id="Format-Options">
  305. <h2 class="chapter"><span>2 Format Options<a class="copiable-link" href="#Format-Options"> &para;</a></span></h2>
  306. <p>The libavformat library provides some generic global options, which
  307. can be set on all the muxers and demuxers. In addition each muxer or
  308. demuxer may support so-called private options, which are specific for
  309. that component.
  310. </p>
  311. <p>Options may be set by specifying -<var class="var">option</var> <var class="var">value</var> in the
  312. FFmpeg tools, or by setting the value explicitly in the
  313. <code class="code">AVFormatContext</code> options or using the <samp class="file">libavutil/opt.h</samp> API
  314. for programmatic use.
  315. </p>
  316. <p>The list of supported options follows:
  317. </p>
  318. <dl class="table">
  319. <dt><samp class="option">avioflags <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  320. <dd><p>Possible values:
  321. </p><dl class="table">
  322. <dt>&lsquo;<samp class="samp">direct</samp>&rsquo;</dt>
  323. <dd><p>Reduce buffering.
  324. </p></dd>
  325. </dl>
  326. </dd>
  327. <dt><samp class="option">probesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  328. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  329. stream information. A higher value will enable detecting more
  330. information in case it is dispersed into the stream, but will increase
  331. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  332. </p>
  333. </dd>
  334. <dt><samp class="option">max_probe_packets <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  335. <dd><p>Set the maximum number of buffered packets when probing a codec.
  336. Default is 2500 packets.
  337. </p>
  338. </dd>
  339. <dt><samp class="option">packetsize <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  340. <dd><p>Set packet size.
  341. </p>
  342. </dd>
  343. <dt><samp class="option">fflags <var class="var">flags</var></samp></dt>
  344. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  345. </p>
  346. <p>Possible values for input files:
  347. </p><dl class="table">
  348. <dt>&lsquo;<samp class="samp">discardcorrupt</samp>&rsquo;</dt>
  349. <dd><p>Discard corrupted packets.
  350. </p></dd>
  351. <dt>&lsquo;<samp class="samp">fastseek</samp>&rsquo;</dt>
  352. <dd><p>Enable fast, but inaccurate seeks for some formats.
  353. </p></dd>
  354. <dt>&lsquo;<samp class="samp">genpts</samp>&rsquo;</dt>
  355. <dd><p>Generate missing PTS if DTS is present.
  356. </p></dd>
  357. <dt>&lsquo;<samp class="samp">igndts</samp>&rsquo;</dt>
  358. <dd><p>Ignore DTS if PTS is also set. In case the PTS is set, the DTS value
  359. is set to NOPTS. This is ignored when the <code class="code">nofillin</code> flag is set.
  360. </p></dd>
  361. <dt>&lsquo;<samp class="samp">ignidx</samp>&rsquo;</dt>
  362. <dd><p>Ignore index.
  363. </p></dd>
  364. <dt>&lsquo;<samp class="samp">nobuffer</samp>&rsquo;</dt>
  365. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  366. </p></dd>
  367. <dt>&lsquo;<samp class="samp">nofillin</samp>&rsquo;</dt>
  368. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  369. </p></dd>
  370. <dt>&lsquo;<samp class="samp">noparse</samp>&rsquo;</dt>
  371. <dd><p>Disable AVParsers, this needs <code class="code">+nofillin</code> too.
  372. </p></dd>
  373. <dt>&lsquo;<samp class="samp">sortdts</samp>&rsquo;</dt>
  374. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  375. </p></dd>
  376. </dl>
  377. <p>Possible values for output files:
  378. </p><dl class="table">
  379. <dt>&lsquo;<samp class="samp">autobsf</samp>&rsquo;</dt>
  380. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  381. </p></dd>
  382. <dt>&lsquo;<samp class="samp">bitexact</samp>&rsquo;</dt>
  383. <dd><p>Only write platform-, build- and time-independent data.
  384. This ensures that file and data checksums are reproducible and match between
  385. platforms. Its primary use is for regression testing.
  386. </p></dd>
  387. <dt>&lsquo;<samp class="samp">flush_packets</samp>&rsquo;</dt>
  388. <dd><p>Write out packets immediately.
  389. </p></dd>
  390. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  391. <dd><p>Stop muxing at the end of the shortest stream.
  392. It may be needed to increase max_interleave_delta to avoid flushing the longer
  393. streams before EOF.
  394. </p></dd>
  395. </dl>
  396. </dd>
  397. <dt><samp class="option">seek2any <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  398. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  399. Default is 0.
  400. </p>
  401. </dd>
  402. <dt><samp class="option">analyzeduration <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  403. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  404. higher value will enable detecting more accurate information, but will
  405. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  406. </p>
  407. </dd>
  408. <dt><samp class="option">cryptokey <var class="var">hexadecimal string</var> (<em class="emph">input</em>)</samp></dt>
  409. <dd><p>Set decryption key.
  410. </p>
  411. </dd>
  412. <dt><samp class="option">indexmem <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  413. <dd><p>Set max memory used for timestamp index (per stream).
  414. </p>
  415. </dd>
  416. <dt><samp class="option">rtbufsize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  417. <dd><p>Set max memory used for buffering real-time frames.
  418. </p>
  419. </dd>
  420. <dt><samp class="option">fdebug <var class="var">flags</var> (<em class="emph">input/output</em>)</samp></dt>
  421. <dd><p>Print specific debug info.
  422. </p>
  423. <p>Possible values:
  424. </p><dl class="table">
  425. <dt>&lsquo;<samp class="samp">ts</samp>&rsquo;</dt>
  426. </dl>
  427. </dd>
  428. <dt><samp class="option">max_delay <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  429. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  430. </p>
  431. </dd>
  432. <dt><samp class="option">fpsprobesize <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  433. <dd><p>Set number of frames used to probe fps.
  434. </p>
  435. </dd>
  436. <dt><samp class="option">audio_preload <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  437. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  438. </p>
  439. </dd>
  440. <dt><samp class="option">chunk_duration <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  441. <dd><p>Set microseconds for each chunk.
  442. </p>
  443. </dd>
  444. <dt><samp class="option">chunk_size <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  445. <dd><p>Set size in bytes for each chunk.
  446. </p>
  447. </dd>
  448. <dt><samp class="option">err_detect, f_err_detect <var class="var">flags</var> (<em class="emph">input</em>)</samp></dt>
  449. <dd><p>Set error detection flags. <code class="code">f_err_detect</code> is deprecated and
  450. should be used only via the <code class="command">ffmpeg</code> tool.
  451. </p>
  452. <p>Possible values:
  453. </p><dl class="table">
  454. <dt>&lsquo;<samp class="samp">crccheck</samp>&rsquo;</dt>
  455. <dd><p>Verify embedded CRCs.
  456. </p></dd>
  457. <dt>&lsquo;<samp class="samp">bitstream</samp>&rsquo;</dt>
  458. <dd><p>Detect bitstream specification deviations.
  459. </p></dd>
  460. <dt>&lsquo;<samp class="samp">buffer</samp>&rsquo;</dt>
  461. <dd><p>Detect improper bitstream length.
  462. </p></dd>
  463. <dt>&lsquo;<samp class="samp">explode</samp>&rsquo;</dt>
  464. <dd><p>Abort decoding on minor error detection.
  465. </p></dd>
  466. <dt>&lsquo;<samp class="samp">careful</samp>&rsquo;</dt>
  467. <dd><p>Consider things that violate the spec and have not been seen in the
  468. wild as errors.
  469. </p></dd>
  470. <dt>&lsquo;<samp class="samp">compliant</samp>&rsquo;</dt>
  471. <dd><p>Consider all spec non compliancies as errors.
  472. </p></dd>
  473. <dt>&lsquo;<samp class="samp">aggressive</samp>&rsquo;</dt>
  474. <dd><p>Consider things that a sane encoder should not do as an error.
  475. </p></dd>
  476. </dl>
  477. </dd>
  478. <dt><samp class="option">max_interleave_delta <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  479. <dd><p>Set maximum buffering duration for interleaving. The duration is
  480. expressed in microseconds, and defaults to 10000000 (10 seconds).
  481. </p>
  482. <p>To ensure all the streams are interleaved correctly, libavformat will
  483. wait until it has at least one packet for each stream before actually
  484. writing any packets to the output file. When some streams are
  485. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  486. can result in excessive buffering.
  487. </p>
  488. <p>This field specifies the maximum difference between the timestamps of the
  489. first and the last packet in the muxing queue, above which libavformat
  490. will output a packet regardless of whether it has queued a packet for all
  491. the streams.
  492. </p>
  493. <p>If set to 0, libavformat will continue buffering packets until it has
  494. a packet for each stream, regardless of the maximum timestamp
  495. difference between the buffered packets.
  496. </p>
  497. </dd>
  498. <dt><samp class="option">use_wallclock_as_timestamps <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  499. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  500. </p>
  501. </dd>
  502. <dt><samp class="option">avoid_negative_ts <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  503. <dd>
  504. <p>Possible values:
  505. </p><dl class="table">
  506. <dt>&lsquo;<samp class="samp">make_non_negative</samp>&rsquo;</dt>
  507. <dd><p>Shift timestamps to make them non-negative.
  508. Also note that this affects only leading negative timestamps, and not
  509. non-monotonic negative timestamps.
  510. </p></dd>
  511. <dt>&lsquo;<samp class="samp">make_zero</samp>&rsquo;</dt>
  512. <dd><p>Shift timestamps so that the first timestamp is 0.
  513. </p></dd>
  514. <dt>&lsquo;<samp class="samp">auto (default)</samp>&rsquo;</dt>
  515. <dd><p>Enables shifting when required by the target format.
  516. </p></dd>
  517. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  518. <dd><p>Disables shifting of timestamp.
  519. </p></dd>
  520. </dl>
  521. <p>When shifting is enabled, all output timestamps are shifted by the
  522. same amount. Audio, video, and subtitles desynching and relative
  523. timestamp differences are preserved compared to how they would have
  524. been without shifting.
  525. </p>
  526. </dd>
  527. <dt><samp class="option">skip_initial_bytes <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  528. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  529. Default is 0.
  530. </p>
  531. </dd>
  532. <dt><samp class="option">correct_ts_overflow <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  533. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  534. </p>
  535. </dd>
  536. <dt><samp class="option">flush_packets <var class="var">integer</var> (<em class="emph">output</em>)</samp></dt>
  537. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  538. means that the underlying protocol will decide, 1 enables it, and has the
  539. effect of reducing the latency, 0 disables it and may increase IO throughput in
  540. some cases.
  541. </p>
  542. </dd>
  543. <dt><samp class="option">output_ts_offset <var class="var">offset</var> (<em class="emph">output</em>)</samp></dt>
  544. <dd><p>Set the output time offset.
  545. </p>
  546. <p><var class="var">offset</var> must be a time duration specification,
  547. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  548. </p>
  549. <p>The offset is added by the muxer to the output timestamps.
  550. </p>
  551. <p>Specifying a positive offset means that the corresponding streams are
  552. delayed bt the time duration specified in <var class="var">offset</var>. Default value
  553. is <code class="code">0</code> (meaning that no offset is applied).
  554. </p>
  555. </dd>
  556. <dt><samp class="option">format_whitelist <var class="var">list</var> (<em class="emph">input</em>)</samp></dt>
  557. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  558. </p>
  559. </dd>
  560. <dt><samp class="option">dump_separator <var class="var">string</var> (<em class="emph">input</em>)</samp></dt>
  561. <dd><p>Separator used to separate the fields printed on the command line about the
  562. Stream parameters.
  563. For example, to separate the fields with newlines and indentation:
  564. </p><div class="example">
  565. <pre class="example-preformatted">ffprobe -dump_separator &quot;
  566. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  567. </pre></div>
  568. </dd>
  569. <dt><samp class="option">max_streams <var class="var">integer</var> (<em class="emph">input</em>)</samp></dt>
  570. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  571. would require too many resources due to a large number of streams.
  572. </p>
  573. </dd>
  574. <dt><samp class="option">skip_estimate_duration_from_pts <var class="var">bool</var> (<em class="emph">input</em>)</samp></dt>
  575. <dd><p>Skip estimation of input duration when calculated using PTS.
  576. At present, applicable for MPEG-PS and MPEG-TS.
  577. </p>
  578. </dd>
  579. <dt><samp class="option">strict, f_strict <var class="var">integer</var> (<em class="emph">input/output</em>)</samp></dt>
  580. <dd><p>Specify how strictly to follow the standards. <code class="code">f_strict</code> is deprecated and
  581. should be used only via the <code class="command">ffmpeg</code> tool.
  582. </p>
  583. <p>Possible values:
  584. </p><dl class="table">
  585. <dt>&lsquo;<samp class="samp">very</samp>&rsquo;</dt>
  586. <dd><p>strictly conform to an older more strict version of the spec or reference software
  587. </p></dd>
  588. <dt>&lsquo;<samp class="samp">strict</samp>&rsquo;</dt>
  589. <dd><p>strictly conform to all the things in the spec no matter what consequences
  590. </p></dd>
  591. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  592. <dt>&lsquo;<samp class="samp">unofficial</samp>&rsquo;</dt>
  593. <dd><p>allow unofficial extensions
  594. </p></dd>
  595. <dt>&lsquo;<samp class="samp">experimental</samp>&rsquo;</dt>
  596. <dd><p>allow non standardized experimental things, experimental
  597. (unfinished/work in progress/not well tested) decoders and encoders.
  598. Note: experimental decoders can pose a security risk, do not use this for
  599. decoding untrusted input.
  600. </p></dd>
  601. </dl>
  602. </dd>
  603. </dl>
  604. <a class="anchor" id="Format-stream-specifiers"></a><ul class="mini-toc">
  605. <li><a href="#Format-stream-specifiers-1" accesskey="1">Format stream specifiers</a></li>
  606. </ul>
  607. <div class="section-level-extent" id="Format-stream-specifiers-1">
  608. <h3 class="section"><span>2.1 Format stream specifiers<a class="copiable-link" href="#Format-stream-specifiers-1"> &para;</a></span></h3>
  609. <p>Format stream specifiers allow selection of one or more streams that
  610. match specific properties.
  611. </p>
  612. <p>The exact semantics of stream specifiers is defined by the
  613. <code class="code">avformat_match_stream_specifier()</code> function declared in the
  614. <samp class="file">libavformat/avformat.h</samp> header and documented in the
  615. <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">Stream specifiers section in the ffmpeg(1) manual</a>.
  616. </p>
  617. </div>
  618. </div>
  619. <div class="chapter-level-extent" id="Demuxers">
  620. <h2 class="chapter"><span>3 Demuxers<a class="copiable-link" href="#Demuxers"> &para;</a></span></h2>
  621. <p>Demuxers are configured elements in FFmpeg that can read the
  622. multimedia streams from a particular type of file.
  623. </p>
  624. <p>When you configure your FFmpeg build, all the supported demuxers
  625. are enabled by default. You can list all available ones using the
  626. configure option <code class="code">--list-demuxers</code>.
  627. </p>
  628. <p>You can disable all the demuxers using the configure option
  629. <code class="code">--disable-demuxers</code>, and selectively enable a single demuxer with
  630. the option <code class="code">--enable-demuxer=<var class="var">DEMUXER</var></code>, or disable it
  631. with the option <code class="code">--disable-demuxer=<var class="var">DEMUXER</var></code>.
  632. </p>
  633. <p>The option <code class="code">-demuxers</code> of the ff* tools will display the list of
  634. enabled demuxers. Use <code class="code">-formats</code> to view a combined list of
  635. enabled demuxers and muxers.
  636. </p>
  637. <p>The description of some of the currently available demuxers follows.
  638. </p>
  639. <ul class="mini-toc">
  640. <li><a href="#aa" accesskey="1">aa</a></li>
  641. <li><a href="#aac" accesskey="2">aac</a></li>
  642. <li><a href="#apng" accesskey="3">apng</a></li>
  643. <li><a href="#asf-1" accesskey="4">asf</a></li>
  644. <li><a href="#concat-1" accesskey="5">concat</a></li>
  645. <li><a href="#dash-1" accesskey="6">dash</a></li>
  646. <li><a href="#dvdvideo" accesskey="7">dvdvideo</a></li>
  647. <li><a href="#ea" accesskey="8">ea</a></li>
  648. <li><a href="#imf" accesskey="9">imf</a></li>
  649. <li><a href="#flv_002c-live_005fflv_002c-kux">flv, live_flv, kux</a></li>
  650. <li><a href="#gif-1">gif</a></li>
  651. <li><a href="#hls-1">hls</a></li>
  652. <li><a href="#image2-1">image2</a></li>
  653. <li><a href="#libgme">libgme</a></li>
  654. <li><a href="#libmodplug">libmodplug</a></li>
  655. <li><a href="#libopenmpt">libopenmpt</a></li>
  656. <li><a href="#mov_002fmp4_002f3gp">mov/mp4/3gp</a></li>
  657. <li><a href="#mpegts">mpegts</a></li>
  658. <li><a href="#mpjpeg">mpjpeg</a></li>
  659. <li><a href="#rawvideo">rawvideo</a></li>
  660. <li><a href="#sbg">sbg</a></li>
  661. <li><a href="#tedcaptions">tedcaptions</a></li>
  662. <li><a href="#vapoursynth">vapoursynth</a></li>
  663. <li><a href="#w64">w64</a></li>
  664. <li><a href="#wav-1">wav</a></li>
  665. </ul>
  666. <div class="section-level-extent" id="aa">
  667. <h3 class="section"><span>3.1 aa<a class="copiable-link" href="#aa"> &para;</a></span></h3>
  668. <p>Audible Format 2, 3, and 4 demuxer.
  669. </p>
  670. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  671. </p>
  672. </div>
  673. <div class="section-level-extent" id="aac">
  674. <h3 class="section"><span>3.2 aac<a class="copiable-link" href="#aac"> &para;</a></span></h3>
  675. <p>Raw Audio Data Transport Stream AAC demuxer.
  676. </p>
  677. <p>This demuxer is used to demux an ADTS input containing a single AAC stream
  678. alongwith any ID3v1/2 or APE tags in it.
  679. </p>
  680. </div>
  681. <div class="section-level-extent" id="apng">
  682. <h3 class="section"><span>3.3 apng<a class="copiable-link" href="#apng"> &para;</a></span></h3>
  683. <p>Animated Portable Network Graphics demuxer.
  684. </p>
  685. <p>This demuxer is used to demux APNG files.
  686. All headers, but the PNG signature, up to (but not including) the first
  687. fcTL chunk are transmitted as extradata.
  688. Frames are then split as being all the chunks between two fcTL ones, or
  689. between the last fcTL and IEND chunks.
  690. </p>
  691. <dl class="table">
  692. <dt><samp class="option">-ignore_loop <var class="var">bool</var></samp></dt>
  693. <dd><p>Ignore the loop variable in the file if set. Default is enabled.
  694. </p>
  695. </dd>
  696. <dt><samp class="option">-max_fps <var class="var">int</var></samp></dt>
  697. <dd><p>Maximum framerate in frames per second. Default of 0 imposes no limit.
  698. </p>
  699. </dd>
  700. <dt><samp class="option">-default_fps <var class="var">int</var></samp></dt>
  701. <dd><p>Default framerate in frames per second when none is specified in the file
  702. (0 meaning as fast as possible). Default is 15.
  703. </p>
  704. </dd>
  705. </dl>
  706. </div>
  707. <div class="section-level-extent" id="asf-1">
  708. <h3 class="section"><span>3.4 asf<a class="copiable-link" href="#asf-1"> &para;</a></span></h3>
  709. <p>Advanced Systems Format demuxer.
  710. </p>
  711. <p>This demuxer is used to demux ASF files and MMS network streams.
  712. </p>
  713. <dl class="table">
  714. <dt><samp class="option">-no_resync_search <var class="var">bool</var></samp></dt>
  715. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  716. </p></dd>
  717. </dl>
  718. <a class="anchor" id="concat"></a></div>
  719. <div class="section-level-extent" id="concat-1">
  720. <h3 class="section"><span>3.5 concat<a class="copiable-link" href="#concat-1"> &para;</a></span></h3>
  721. <p>Virtual concatenation script demuxer.
  722. </p>
  723. <p>This demuxer reads a list of files and other directives from a text file and
  724. demuxes them one after the other, as if all their packets had been muxed
  725. together.
  726. </p>
  727. <p>The timestamps in the files are adjusted so that the first file starts at 0
  728. and each next file starts where the previous one finishes. Note that it is
  729. done globally and may cause gaps if all streams do not have exactly the same
  730. length.
  731. </p>
  732. <p>All files must have the same streams (same codecs, same time base, etc.).
  733. </p>
  734. <p>The duration of each file is used to adjust the timestamps of the next file:
  735. if the duration is incorrect (because it was computed using the bit-rate or
  736. because the file is truncated, for example), it can cause artifacts. The
  737. <code class="code">duration</code> directive can be used to override the duration stored in
  738. each file.
  739. </p>
  740. <ul class="mini-toc">
  741. <li><a href="#Syntax" accesskey="1">Syntax</a></li>
  742. <li><a href="#Options" accesskey="2">Options</a></li>
  743. <li><a href="#Examples" accesskey="3">Examples</a></li>
  744. </ul>
  745. <div class="subsection-level-extent" id="Syntax">
  746. <h4 class="subsection"><span>3.5.1 Syntax<a class="copiable-link" href="#Syntax"> &para;</a></span></h4>
  747. <p>The script is a text file in extended-ASCII, with one directive per line.
  748. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  749. following directive is recognized:
  750. </p>
  751. <dl class="table">
  752. <dt><samp class="option"><code class="code">file <var class="var">path</var></code></samp></dt>
  753. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  754. backslash or single quotes.
  755. </p>
  756. <p>All subsequent file-related directives apply to that file.
  757. </p>
  758. </dd>
  759. <dt><samp class="option"><code class="code">ffconcat version 1.0</code></samp></dt>
  760. <dd><p>Identify the script type and version.
  761. </p>
  762. <p>To make FFmpeg recognize the format automatically, this directive must
  763. appear exactly as is (no extra space or byte-order-mark) on the very first
  764. line of the script.
  765. </p>
  766. </dd>
  767. <dt><samp class="option"><code class="code">duration <var class="var">dur</var></code></samp></dt>
  768. <dd><p>Duration of the file. This information can be specified from the file;
  769. specifying it here may be more efficient or help if the information from the
  770. file is not available or accurate.
  771. </p>
  772. <p>If the duration is set for all files, then it is possible to seek in the
  773. whole concatenated video.
  774. </p>
  775. </dd>
  776. <dt><samp class="option"><code class="code">inpoint <var class="var">timestamp</var></code></samp></dt>
  777. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  778. specified timestamp. Seeking is done so that all streams can be presented
  779. successfully at In point.
  780. </p>
  781. <p>This directive works best with intra frame codecs, because for non-intra frame
  782. ones you will usually get extra packets before the actual In point and the
  783. decoded content will most likely contain frames before In point too.
  784. </p>
  785. <p>For each file, packets before the file In point will have timestamps less than
  786. the calculated start timestamp of the file (negative in case of the first
  787. file), and the duration of the files (if not specified by the <code class="code">duration</code>
  788. directive) will be reduced based on their specified In point.
  789. </p>
  790. <p>Because of potential packets before the specified In point, packet timestamps
  791. may overlap between two concatenated files.
  792. </p>
  793. </dd>
  794. <dt><samp class="option"><code class="code">outpoint <var class="var">timestamp</var></code></samp></dt>
  795. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  796. timestamp in any of the streams, it handles it as an end of file condition and
  797. skips the current and all the remaining packets from all streams.
  798. </p>
  799. <p>Out point is exclusive, which means that the demuxer will not output packets
  800. with a decoding timestamp greater or equal to Out point.
  801. </p>
  802. <p>This directive works best with intra frame codecs and formats where all streams
  803. are tightly interleaved. For non-intra frame codecs you will usually get
  804. additional packets with presentation timestamp after Out point therefore the
  805. decoded content will most likely contain frames after Out point too. If your
  806. streams are not tightly interleaved you may not get all the packets from all
  807. streams before Out point and you may only will be able to decode the earliest
  808. stream until Out point.
  809. </p>
  810. <p>The duration of the files (if not specified by the <code class="code">duration</code>
  811. directive) will be reduced based on their specified Out point.
  812. </p>
  813. </dd>
  814. <dt><samp class="option"><code class="code">file_packet_metadata <var class="var">key=value</var></code></samp></dt>
  815. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  816. each file packet. You can specify this directive multiple times to add multiple
  817. metadata entries.
  818. This directive is deprecated, use <code class="code">file_packet_meta</code> instead.
  819. </p>
  820. </dd>
  821. <dt><samp class="option"><code class="code">file_packet_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  822. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  823. each file packet. You can specify this directive multiple times to add multiple
  824. metadata entries.
  825. </p>
  826. </dd>
  827. <dt><samp class="option"><code class="code">option <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  828. <dd><p>Option to access, open and probe the file.
  829. Can be present multiple times.
  830. </p>
  831. </dd>
  832. <dt><samp class="option"><code class="code">stream</code></samp></dt>
  833. <dd><p>Introduce a stream in the virtual file.
  834. All subsequent stream-related directives apply to the last introduced
  835. stream.
  836. Some streams properties must be set in order to allow identifying the
  837. matching streams in the subfiles.
  838. If no streams are defined in the script, the streams from the first file are
  839. copied.
  840. </p>
  841. </dd>
  842. <dt><samp class="option"><code class="code">exact_stream_id <var class="var">id</var></code></samp></dt>
  843. <dd><p>Set the id of the stream.
  844. If this directive is given, the string with the corresponding id in the
  845. subfiles will be used.
  846. This is especially useful for MPEG-PS (VOB) files, where the order of the
  847. streams is not reliable.
  848. </p>
  849. </dd>
  850. <dt><samp class="option"><code class="code">stream_meta <var class="var">key</var> <var class="var">value</var></code></samp></dt>
  851. <dd><p>Metadata for the stream.
  852. Can be present multiple times.
  853. </p>
  854. </dd>
  855. <dt><samp class="option"><code class="code">stream_codec <var class="var">value</var></code></samp></dt>
  856. <dd><p>Codec for the stream.
  857. </p>
  858. </dd>
  859. <dt><samp class="option"><code class="code">stream_extradata <var class="var">hex_string</var></code></samp></dt>
  860. <dd><p>Extradata for the string, encoded in hexadecimal.
  861. </p>
  862. </dd>
  863. <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>
  864. <dd><p>Add a chapter. <var class="var">id</var> is an unique identifier, possibly small and
  865. consecutive.
  866. </p>
  867. </dd>
  868. </dl>
  869. </div>
  870. <div class="subsection-level-extent" id="Options">
  871. <h4 class="subsection"><span>3.5.2 Options<a class="copiable-link" href="#Options"> &para;</a></span></h4>
  872. <p>This demuxer accepts the following option:
  873. </p>
  874. <dl class="table">
  875. <dt><samp class="option">safe</samp></dt>
  876. <dd><p>If set to 1, reject unsafe file paths and directives.
  877. A file path is considered safe if it
  878. does not contain a protocol specification and is relative and all components
  879. only contain characters from the portable character set (letters, digits,
  880. period, underscore and hyphen) and have no period at the beginning of a
  881. component.
  882. </p>
  883. <p>If set to 0, any file name is accepted.
  884. </p>
  885. <p>The default is 1.
  886. </p>
  887. </dd>
  888. <dt><samp class="option">auto_convert</samp></dt>
  889. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  890. streams concatenable.
  891. The default is 1.
  892. </p>
  893. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  894. filter to H.264 streams in MP4 format. This is necessary in particular if
  895. there are resolution changes.
  896. </p>
  897. </dd>
  898. <dt><samp class="option">segment_time_metadata</samp></dt>
  899. <dd><p>If set to 1, every packet will contain the <var class="var">lavf.concat.start_time</var> and the
  900. <var class="var">lavf.concat.duration</var> packet metadata values which are the start_time and
  901. the duration of the respective file segments in the concatenated output
  902. expressed in microseconds. The duration metadata is only set if it is known
  903. based on the concat file.
  904. The default is 0.
  905. </p>
  906. </dd>
  907. </dl>
  908. </div>
  909. <div class="subsection-level-extent" id="Examples">
  910. <h4 class="subsection"><span>3.5.3 Examples<a class="copiable-link" href="#Examples"> &para;</a></span></h4>
  911. <ul class="itemize mark-bullet">
  912. <li>Use absolute filenames and include some comments:
  913. <div class="example">
  914. <pre class="example-preformatted"># my first filename
  915. file /mnt/share/file-1.wav
  916. # my second filename including whitespace
  917. file '/mnt/share/file 2.wav'
  918. # my third filename including whitespace plus single quote
  919. file '/mnt/share/file 3'\''.wav'
  920. </pre></div>
  921. </li><li>Allow for input format auto-probing, use safe filenames and set the duration of
  922. the first file:
  923. <div class="example">
  924. <pre class="example-preformatted">ffconcat version 1.0
  925. file file-1.wav
  926. duration 20.0
  927. file subdir/file-2.wav
  928. </pre></div>
  929. </li></ul>
  930. </div>
  931. </div>
  932. <div class="section-level-extent" id="dash-1">
  933. <h3 class="section"><span>3.6 dash<a class="copiable-link" href="#dash-1"> &para;</a></span></h3>
  934. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  935. </p>
  936. <p>This demuxer presents all AVStreams found in the manifest.
  937. By setting the discard flags on AVStreams the caller can decide
  938. which streams to actually receive.
  939. Each stream mirrors the <code class="code">id</code> and <code class="code">bandwidth</code> properties from the
  940. <code class="code">&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  941. </p>
  942. <ul class="mini-toc">
  943. <li><a href="#Options-1" accesskey="1">Options</a></li>
  944. </ul>
  945. <div class="subsection-level-extent" id="Options-1">
  946. <h4 class="subsection"><span>3.6.1 Options<a class="copiable-link" href="#Options-1"> &para;</a></span></h4>
  947. <p>This demuxer accepts the following option:
  948. </p>
  949. <dl class="table">
  950. <dt><samp class="option">cenc_decryption_key</samp></dt>
  951. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  952. </p>
  953. </dd>
  954. </dl>
  955. </div>
  956. </div>
  957. <div class="section-level-extent" id="dvdvideo">
  958. <h3 class="section"><span>3.7 dvdvideo<a class="copiable-link" href="#dvdvideo"> &para;</a></span></h3>
  959. <p>DVD-Video demuxer, powered by libdvdnav and libdvdread.
  960. </p>
  961. <p>Can directly ingest DVD titles, specifically sequential PGCs, into
  962. a conversion pipeline. Menu assets, such as background video or audio,
  963. can also be demuxed given the menu&rsquo;s coordinates (at best effort).
  964. Seeking is not supported at this time.
  965. </p>
  966. <p>Block devices (DVD drives), ISO files, and directory structures are accepted.
  967. Activate with <code class="code">-f dvdvideo</code> in front of one of these inputs.
  968. </p>
  969. <p>This demuxer does NOT have decryption code of any kind. You are on your own
  970. working with encrypted DVDs, and should not expect support on the matter.
  971. </p>
  972. <p>Underlying playback is handled by libdvdnav, and structure parsing by libdvdread.
  973. FFmpeg must be built with GPL library support available as well as the
  974. configure switches <code class="code">--enable-libdvdnav</code> and <code class="code">--enable-libdvdread</code>.
  975. </p>
  976. <p>You will need to provide either the desired &quot;title number&quot; or exact PGC/PG coordinates.
  977. Many open-source DVD players and tools can aid in providing this information.
  978. If not specified, the demuxer will default to title 1 which works for many discs.
  979. However, due to the flexibility of the format, it is recommended to check manually.
  980. There are many discs that are authored strangely or with invalid headers.
  981. </p>
  982. <p>If the input is a real DVD drive, please note that there are some drives which may
  983. silently fail on reading bad sectors from the disc, returning random bits instead
  984. which is effectively corrupt data. This is especially prominent on aging or rotting discs.
  985. A second pass and integrity checks would be needed to detect the corruption.
  986. This is not an FFmpeg issue.
  987. </p>
  988. <ul class="mini-toc">
  989. <li><a href="#Background" accesskey="1">Background</a></li>
  990. <li><a href="#Options-2" accesskey="2">Options</a></li>
  991. <li><a href="#Examples-1" accesskey="3">Examples</a></li>
  992. </ul>
  993. <div class="subsection-level-extent" id="Background">
  994. <h4 class="subsection"><span>3.7.1 Background<a class="copiable-link" href="#Background"> &para;</a></span></h4>
  995. <p>DVD-Video is not a directly accessible, linear container format in the
  996. traditional sense. Instead, it allows for complex and programmatic playback of
  997. carefully muxed MPEG-PS streams that are stored in headerless VOB files.
  998. To the end-user, these streams are known simply as &quot;titles&quot;, but the actual
  999. logical playback sequence is defined by one or more &quot;PGCs&quot;, or Program Group Chains,
  1000. within the title. The PGC is in turn comprised of multiple &quot;PGs&quot;, or Programs&quot;,
  1001. which are the actual video segments (and for a typical video feature, sequentially
  1002. ordered). The PGC structure, along with stream layout and metadata, are stored in
  1003. IFO files that need to be parsed. PGCs can be thought of as playlists in easier terms.
  1004. </p>
  1005. <p>An actual DVD player relies on user GUI interaction via menus and an internal VM
  1006. to drive the direction of demuxing. Generally, the user would either navigate (via menus)
  1007. or automatically be redirected to the PGC of their choice. During this process and
  1008. the subsequent playback, the DVD player&rsquo;s internal VM also maintains a state and
  1009. executes instructions that can create jumps to different sectors during playback.
  1010. This is why libdvdnav is involved, as a linear read of the MPEG-PS blobs on the
  1011. disc (VOBs) is not enough to produce the right sequence in many cases.
  1012. </p>
  1013. <p>There are many other DVD structures (a long subject) that will not be discussed here.
  1014. NAV packets, in particular, are handled by this demuxer to build accurate timing
  1015. but not emitted as a stream. For a good high-level understanding, refer to:
  1016. <a class="url" href="https://code.videolan.org/videolan/libdvdnav/-/blob/master/doc/dvd_structures">https://code.videolan.org/videolan/libdvdnav/-/blob/master/doc/dvd_structures</a>
  1017. </p>
  1018. </div>
  1019. <div class="subsection-level-extent" id="Options-2">
  1020. <h4 class="subsection"><span>3.7.2 Options<a class="copiable-link" href="#Options-2"> &para;</a></span></h4>
  1021. <p>This demuxer accepts the following options:
  1022. </p>
  1023. <dl class="table">
  1024. <dt><samp class="option">title <var class="var">int</var></samp></dt>
  1025. <dd><p>The title number to play. Must be set if <samp class="option">pgc</samp> and <samp class="option">pg</samp> are not set.
  1026. Not applicable to menus.
  1027. Default is 0 (auto), which currently only selects the first available title (title 1)
  1028. and notifies the user about the implications.
  1029. </p>
  1030. </dd>
  1031. <dt><samp class="option">chapter_start <var class="var">int</var></samp></dt>
  1032. <dd><p>The chapter, or PTT (part-of-title), number to start at. Not applicable to menus.
  1033. Default is 1.
  1034. </p>
  1035. </dd>
  1036. <dt><samp class="option">chapter_end <var class="var">int</var></samp></dt>
  1037. <dd><p>The chapter, or PTT (part-of-title), number to end at. Not applicable to menus.
  1038. Default is 0, which is a special value to signal end at the last possible chapter.
  1039. </p>
  1040. </dd>
  1041. <dt><samp class="option">angle <var class="var">int</var></samp></dt>
  1042. <dd><p>The video angle number, referring to what is essentially an additional
  1043. video stream that is composed from alternate frames interleaved in the VOBs.
  1044. Not applicable to menus.
  1045. Default is 1.
  1046. </p>
  1047. </dd>
  1048. <dt><samp class="option">region <var class="var">int</var></samp></dt>
  1049. <dd><p>The region code to use for playback. Some discs may use this to default playback
  1050. at a particular angle in different regions. This option will not affect the region code
  1051. of a real DVD drive, if used as an input. Not applicable to menus.
  1052. Default is 0, &quot;world&quot;.
  1053. </p>
  1054. </dd>
  1055. <dt><samp class="option">menu <var class="var">bool</var></samp></dt>
  1056. <dd><p>Demux menu assets instead of navigating a title. Requires exact coordinates
  1057. of the menu (<samp class="option">menu_lu</samp>, <samp class="option">menu_vts</samp>, <samp class="option">pgc</samp>, <samp class="option">pg</samp>).
  1058. Default is false.
  1059. </p>
  1060. </dd>
  1061. <dt><samp class="option">menu_lu <var class="var">int</var></samp></dt>
  1062. <dd><p>The menu language to demux. In DVD, menus are grouped by language.
  1063. Default is 0, the first language unit.
  1064. </p>
  1065. </dd>
  1066. <dt><samp class="option">menu_vts <var class="var">int</var></samp></dt>
  1067. <dd><p>The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
  1068. Default is 0, VMG menu.
  1069. </p>
  1070. </dd>
  1071. <dt><samp class="option">pgc <var class="var">int</var></samp></dt>
  1072. <dd><p>The entry PGC to start playback, in conjunction with <samp class="option">pg</samp>.
  1073. Alternative to setting <samp class="option">title</samp>.
  1074. Chapter markers are not supported at this time.
  1075. Must be explicitly set for menus.
  1076. Default is 0, automatically resolve from value of <samp class="option">title</samp>.
  1077. </p>
  1078. </dd>
  1079. <dt><samp class="option">pg <var class="var">int</var></samp></dt>
  1080. <dd><p>The entry PG to start playback, in conjunction with <samp class="option">pgc</samp>.
  1081. Alternative to setting <samp class="option">title</samp>.
  1082. Chapter markers are not supported at this time.
  1083. Default is 0, automatically resolve from value of <samp class="option">title</samp>, or
  1084. start from the beginning (PG 1) of the menu.
  1085. </p>
  1086. </dd>
  1087. <dt><samp class="option">preindex <var class="var">bool</var></samp></dt>
  1088. <dd><p>Enable this to have accurate chapter (PTT) markers and duration measurement,
  1089. which requires a slow second pass read in order to index the chapter marker
  1090. timestamps from NAV packets. This is non-ideal extra work for real optical drives.
  1091. It is recommended and faster to use this option with a backup of the DVD structure
  1092. stored on a hard drive. Not compatible with <samp class="option">pgc</samp> and <samp class="option">pg</samp>.
  1093. Not applicable to menus.
  1094. Default is 0, false.
  1095. </p>
  1096. </dd>
  1097. <dt><samp class="option">trim <var class="var">bool</var></samp></dt>
  1098. <dd><p>Skip padding cells (i.e. cells shorter than 1 second) from the beginning.
  1099. There exist many discs with filler segments at the beginning of the PGC,
  1100. often with junk data intended for controlling a real DVD player&rsquo;s
  1101. buffering speed and with no other material data value.
  1102. Not applicable to menus.
  1103. Default is 1, true.
  1104. </p>
  1105. </dd>
  1106. </dl>
  1107. </div>
  1108. <div class="subsection-level-extent" id="Examples-1">
  1109. <h4 class="subsection"><span>3.7.3 Examples<a class="copiable-link" href="#Examples-1"> &para;</a></span></h4>
  1110. <ul class="itemize mark-bullet">
  1111. <li>Open title 3 from a given DVD structure:
  1112. <div class="example">
  1113. <pre class="example-preformatted">ffmpeg -f dvdvideo -title 3 -i &lt;path to DVD&gt; ...
  1114. </pre></div>
  1115. </li><li>Open chapters 3-6 from title 1 from a given DVD structure:
  1116. <div class="example">
  1117. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 3 -chapter_end 6 -title 1 -i &lt;path to DVD&gt; ...
  1118. </pre></div>
  1119. </li><li>Open only chapter 5 from title 1 from a given DVD structure:
  1120. <div class="example">
  1121. <pre class="example-preformatted">ffmpeg -f dvdvideo -chapter_start 5 -chapter_end 5 -title 1 -i &lt;path to DVD&gt; ...
  1122. </pre></div>
  1123. </li><li>Demux menu with language 1 from VTS 1, PGC 1, starting at PG 1:
  1124. <div class="example">
  1125. <pre class="example-preformatted">ffmpeg -f dvdvideo -menu 1 -menu_lu 1 -menu_vts 1 -pgc 1 -pg 1 -i &lt;path to DVD&gt; ...
  1126. </pre></div>
  1127. </li></ul>
  1128. </div>
  1129. </div>
  1130. <div class="section-level-extent" id="ea">
  1131. <h3 class="section"><span>3.8 ea<a class="copiable-link" href="#ea"> &para;</a></span></h3>
  1132. <p>Electronic Arts Multimedia format demuxer.
  1133. </p>
  1134. <p>This format is used by various Electronic Arts games.
  1135. </p>
  1136. <ul class="mini-toc">
  1137. <li><a href="#Options-3" accesskey="1">Options</a></li>
  1138. </ul>
  1139. <div class="subsection-level-extent" id="Options-3">
  1140. <h4 class="subsection"><span>3.8.1 Options<a class="copiable-link" href="#Options-3"> &para;</a></span></h4>
  1141. <dl class="table">
  1142. <dt><samp class="option">merge_alpha <var class="var">bool</var></samp></dt>
  1143. <dd>
  1144. <p>Normally the VP6 alpha channel (if exists) is returned as a secondary video
  1145. stream, by setting this option you can make the demuxer return a single video
  1146. stream which contains the alpha channel in addition to the ordinary video.
  1147. </p>
  1148. </dd>
  1149. </dl>
  1150. </div>
  1151. </div>
  1152. <div class="section-level-extent" id="imf">
  1153. <h3 class="section"><span>3.9 imf<a class="copiable-link" href="#imf"> &para;</a></span></h3>
  1154. <p>Interoperable Master Format demuxer.
  1155. </p>
  1156. <p>This demuxer presents audio and video streams found in an IMF Composition, as
  1157. specified in <a class="url" href="https://doi.org/10.5594/SMPTE.ST2067-2.2020">SMPTE ST 2067-2</a>.
  1158. </p>
  1159. <div class="example">
  1160. <pre class="example-preformatted">ffmpeg [-assetmaps &lt;path of ASSETMAP1&gt;,&lt;path of ASSETMAP2&gt;,...] -i &lt;path of CPL&gt; ...
  1161. </pre></div>
  1162. <p>If <code class="code">-assetmaps</code> is not specified, the demuxer looks for a file called
  1163. <samp class="file">ASSETMAP.xml</samp> in the same directory as the CPL.
  1164. </p>
  1165. </div>
  1166. <div class="section-level-extent" id="flv_002c-live_005fflv_002c-kux">
  1167. <h3 class="section"><span>3.10 flv, live_flv, kux<a class="copiable-link" href="#flv_002c-live_005fflv_002c-kux"> &para;</a></span></h3>
  1168. <p>Adobe Flash Video Format demuxer.
  1169. </p>
  1170. <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.
  1171. KUX is a flv variant used on the Youku platform.
  1172. </p>
  1173. <div class="example">
  1174. <pre class="example-preformatted">ffmpeg -f flv -i myfile.flv ...
  1175. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  1176. </pre></div>
  1177. <dl class="table">
  1178. <dt><samp class="option">-flv_metadata <var class="var">bool</var></samp></dt>
  1179. <dd><p>Allocate the streams according to the onMetaData array content.
  1180. </p>
  1181. </dd>
  1182. <dt><samp class="option">-flv_ignore_prevtag <var class="var">bool</var></samp></dt>
  1183. <dd><p>Ignore the size of previous tag value.
  1184. </p>
  1185. </dd>
  1186. <dt><samp class="option">-flv_full_metadata <var class="var">bool</var></samp></dt>
  1187. <dd><p>Output all context of the onMetadata.
  1188. </p></dd>
  1189. </dl>
  1190. </div>
  1191. <div class="section-level-extent" id="gif-1">
  1192. <h3 class="section"><span>3.11 gif<a class="copiable-link" href="#gif-1"> &para;</a></span></h3>
  1193. <p>Animated GIF demuxer.
  1194. </p>
  1195. <p>It accepts the following options:
  1196. </p>
  1197. <dl class="table">
  1198. <dt><samp class="option">min_delay</samp></dt>
  1199. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  1200. Range is 0 to 6000. Default value is 2.
  1201. </p>
  1202. </dd>
  1203. <dt><samp class="option">max_gif_delay</samp></dt>
  1204. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  1205. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  1206. the maximum value allowed by the specification.
  1207. </p>
  1208. </dd>
  1209. <dt><samp class="option">default_delay</samp></dt>
  1210. <dd><p>Set the default delay between frames in hundredths of seconds.
  1211. Range is 0 to 6000. Default value is 10.
  1212. </p>
  1213. </dd>
  1214. <dt><samp class="option">ignore_loop</samp></dt>
  1215. <dd><p>GIF files can contain information to loop a certain number of times (or
  1216. infinitely). If <samp class="option">ignore_loop</samp> is set to 1, then the loop setting
  1217. from the input will be ignored and looping will not occur. If set to 0,
  1218. then looping will occur and will cycle the number of times according to
  1219. the GIF. Default value is 1.
  1220. </p></dd>
  1221. </dl>
  1222. <p>For example, with the overlay filter, place an infinitely looping GIF
  1223. over another video:
  1224. </p><div class="example">
  1225. <pre class="example-preformatted">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  1226. </pre></div>
  1227. <p>Note that in the above example the shortest option for overlay filter is
  1228. used to end the output video at the length of the shortest input file,
  1229. which in this case is <samp class="file">input.mp4</samp> as the GIF in this example loops
  1230. infinitely.
  1231. </p>
  1232. </div>
  1233. <div class="section-level-extent" id="hls-1">
  1234. <h3 class="section"><span>3.12 hls<a class="copiable-link" href="#hls-1"> &para;</a></span></h3>
  1235. <p>HLS demuxer
  1236. </p>
  1237. <p>Apple HTTP Live Streaming demuxer.
  1238. </p>
  1239. <p>This demuxer presents all AVStreams from all variant streams.
  1240. The id field is set to the bitrate variant index number. By setting
  1241. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  1242. the caller can decide which variant streams to actually receive.
  1243. The total bitrate of the variant that the stream belongs to is
  1244. available in a metadata key named &quot;variant_bitrate&quot;.
  1245. </p>
  1246. <p>It accepts the following options:
  1247. </p>
  1248. <dl class="table">
  1249. <dt><samp class="option">live_start_index</samp></dt>
  1250. <dd><p>segment index to start live streams at (negative values are from the end).
  1251. </p>
  1252. </dd>
  1253. <dt><samp class="option">prefer_x_start</samp></dt>
  1254. <dd><p>prefer to use #EXT-X-START if it&rsquo;s in playlist instead of live_start_index.
  1255. </p>
  1256. </dd>
  1257. <dt><samp class="option">allowed_extensions</samp></dt>
  1258. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  1259. </p>
  1260. </dd>
  1261. <dt><samp class="option">max_reload</samp></dt>
  1262. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  1263. Default value is 1000.
  1264. </p>
  1265. </dd>
  1266. <dt><samp class="option">m3u8_hold_counters</samp></dt>
  1267. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  1268. Default value is 1000.
  1269. </p>
  1270. </dd>
  1271. <dt><samp class="option">http_persistent</samp></dt>
  1272. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  1273. Enabled by default.
  1274. </p>
  1275. </dd>
  1276. <dt><samp class="option">http_multiple</samp></dt>
  1277. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  1278. Enabled by default for HTTP/1.1 servers.
  1279. </p>
  1280. </dd>
  1281. <dt><samp class="option">http_seekable</samp></dt>
  1282. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  1283. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  1284. </p>
  1285. </dd>
  1286. <dt><samp class="option">seg_format_options</samp></dt>
  1287. <dd><p>Set options for the demuxer of media segments using a list of key=value pairs separated by <code class="code">:</code>.
  1288. </p>
  1289. </dd>
  1290. <dt><samp class="option">seg_max_retry</samp></dt>
  1291. <dd><p>Maximum number of times to reload a segment on error, useful when segment skip on network error is not desired.
  1292. Default value is 0.
  1293. </p></dd>
  1294. </dl>
  1295. </div>
  1296. <div class="section-level-extent" id="image2-1">
  1297. <h3 class="section"><span>3.13 image2<a class="copiable-link" href="#image2-1"> &para;</a></span></h3>
  1298. <p>Image file demuxer.
  1299. </p>
  1300. <p>This demuxer reads from a list of image files specified by a pattern.
  1301. The syntax and meaning of the pattern is specified by the
  1302. option <var class="var">pattern_type</var>.
  1303. </p>
  1304. <p>The pattern may contain a suffix which is used to automatically
  1305. determine the format of the images contained in the files.
  1306. </p>
  1307. <p>The size, the pixel format, and the format of each image must be the
  1308. same for all the files in the sequence.
  1309. </p>
  1310. <p>This demuxer accepts the following options:
  1311. </p><dl class="table">
  1312. <dt><samp class="option">framerate</samp></dt>
  1313. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  1314. </p></dd>
  1315. <dt><samp class="option">loop</samp></dt>
  1316. <dd><p>If set to 1, loop over the input. Default value is 0.
  1317. </p></dd>
  1318. <dt><samp class="option">pattern_type</samp></dt>
  1319. <dd><p>Select the pattern type used to interpret the provided filename.
  1320. </p>
  1321. <p><var class="var">pattern_type</var> accepts one of the following values.
  1322. </p><dl class="table">
  1323. <dt><samp class="option">none</samp></dt>
  1324. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  1325. image. You should use this option if you do not want to create sequences from
  1326. multiple images and your filenames may contain special pattern characters.
  1327. </p></dd>
  1328. <dt><samp class="option">sequence</samp></dt>
  1329. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  1330. indexed by sequential numbers.
  1331. </p>
  1332. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, which
  1333. specifies the position of the characters representing a sequential
  1334. number in each filename matched by the pattern. If the form
  1335. &quot;%d0<var class="var">N</var>d&quot; is used, the string representing the number in each
  1336. filename is 0-padded and <var class="var">N</var> is the total number of 0-padded
  1337. digits representing the number. The literal character &rsquo;%&rsquo; can be
  1338. specified in the pattern with the string &quot;%%&quot;.
  1339. </p>
  1340. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  1341. the file list specified by the pattern must contain a number
  1342. inclusively contained between <var class="var">start_number</var> and
  1343. <var class="var">start_number</var>+<var class="var">start_number_range</var>-1, and all the following
  1344. numbers must be sequential.
  1345. </p>
  1346. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  1347. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  1348. <samp class="file">img-010.bmp</samp>, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  1349. sequence of filenames of the form <samp class="file">i%m%g-1.jpg</samp>,
  1350. <samp class="file">i%m%g-2.jpg</samp>, ..., <samp class="file">i%m%g-10.jpg</samp>, etc.
  1351. </p>
  1352. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  1353. &quot;%0<var class="var">N</var>d&quot;, for example to convert a single image file
  1354. <samp class="file">img.jpeg</samp> you can employ the command:
  1355. </p><div class="example">
  1356. <pre class="example-preformatted">ffmpeg -i img.jpeg img.png
  1357. </pre></div>
  1358. </dd>
  1359. <dt><samp class="option">glob</samp></dt>
  1360. <dd><p>Select a glob wildcard pattern type.
  1361. </p>
  1362. <p>The pattern is interpreted like a <code class="code">glob()</code> pattern. This is only
  1363. selectable if libavformat was compiled with globbing support.
  1364. </p>
  1365. </dd>
  1366. <dt><samp class="option">glob_sequence <em class="emph">(deprecated, will be removed)</em></samp></dt>
  1367. <dd><p>Select a mixed glob wildcard/sequence pattern.
  1368. </p>
  1369. <p>If your version of libavformat was compiled with globbing support, and
  1370. the provided pattern contains at least one glob meta character among
  1371. <code class="code">%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  1372. interpreted like a <code class="code">glob()</code> pattern, otherwise it is interpreted
  1373. like a sequence pattern.
  1374. </p>
  1375. <p>All glob special characters <code class="code">%*?[]{}</code> must be prefixed
  1376. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  1377. </p>
  1378. <p>For example the pattern <code class="code">foo-%*.jpeg</code> will match all the
  1379. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  1380. <code class="code">foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  1381. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  1382. with &quot;.jpeg&quot;.
  1383. </p>
  1384. <p>This pattern type is deprecated in favor of <var class="var">glob</var> and
  1385. <var class="var">sequence</var>.
  1386. </p></dd>
  1387. </dl>
  1388. <p>Default value is <var class="var">glob_sequence</var>.
  1389. </p></dd>
  1390. <dt><samp class="option">pixel_format</samp></dt>
  1391. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  1392. format is guessed from the first image file in the sequence.
  1393. </p></dd>
  1394. <dt><samp class="option">start_number</samp></dt>
  1395. <dd><p>Set the index of the file matched by the image file pattern to start
  1396. to read from. Default value is 0.
  1397. </p></dd>
  1398. <dt><samp class="option">start_number_range</samp></dt>
  1399. <dd><p>Set the index interval range to check when looking for the first image
  1400. file in the sequence, starting from <var class="var">start_number</var>. Default value
  1401. is 5.
  1402. </p></dd>
  1403. <dt><samp class="option">ts_from_file</samp></dt>
  1404. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  1405. that monotonity of timestamps is not provided: images go in the same order as
  1406. without this option. Default value is 0.
  1407. If set to 2, will set frame timestamp to the modification time of the image file in
  1408. nanosecond precision.
  1409. </p></dd>
  1410. <dt><samp class="option">video_size</samp></dt>
  1411. <dd><p>Set the video size of the images to read. If not specified the video
  1412. size is guessed from the first image file in the sequence.
  1413. </p></dd>
  1414. <dt><samp class="option">export_path_metadata</samp></dt>
  1415. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  1416. also available for other filters (see <var class="var">drawtext</var> filter for examples). Default
  1417. value is 0. The extra fields are described below:
  1418. </p><dl class="table">
  1419. <dt><samp class="option">lavf.image2dec.source_path</samp></dt>
  1420. <dd><p>Corresponds to the full path to the input file being read.
  1421. </p></dd>
  1422. <dt><samp class="option">lavf.image2dec.source_basename</samp></dt>
  1423. <dd><p>Corresponds to the name of the file being read.
  1424. </p></dd>
  1425. </dl>
  1426. </dd>
  1427. </dl>
  1428. <ul class="mini-toc">
  1429. <li><a href="#Examples-2" accesskey="1">Examples</a></li>
  1430. </ul>
  1431. <div class="subsection-level-extent" id="Examples-2">
  1432. <h4 class="subsection"><span>3.13.1 Examples<a class="copiable-link" href="#Examples-2"> &para;</a></span></h4>
  1433. <ul class="itemize mark-bullet">
  1434. <li>Use <code class="command">ffmpeg</code> for creating a video from the images in the file
  1435. sequence <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ..., assuming an
  1436. input frame rate of 10 frames per second:
  1437. <div class="example">
  1438. <pre class="example-preformatted">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  1439. </pre></div>
  1440. </li><li>As above, but start by reading from a file with index 100 in the sequence:
  1441. <div class="example">
  1442. <pre class="example-preformatted">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  1443. </pre></div>
  1444. </li><li>Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  1445. terminating with the &quot;.png&quot; suffix:
  1446. <div class="example">
  1447. <pre class="example-preformatted">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  1448. </pre></div>
  1449. </li></ul>
  1450. </div>
  1451. </div>
  1452. <div class="section-level-extent" id="libgme">
  1453. <h3 class="section"><span>3.14 libgme<a class="copiable-link" href="#libgme"> &para;</a></span></h3>
  1454. <p>The Game Music Emu library is a collection of video game music file emulators.
  1455. </p>
  1456. <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.
  1457. </p>
  1458. <p>It accepts the following options:
  1459. </p>
  1460. <dl class="table">
  1461. <dt><samp class="option">track_index</samp></dt>
  1462. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  1463. Track indexes start at 0. Default is to pick the first track. Number of tracks
  1464. is exported as <var class="var">tracks</var> metadata entry.
  1465. </p>
  1466. </dd>
  1467. <dt><samp class="option">sample_rate</samp></dt>
  1468. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  1469. </p>
  1470. </dd>
  1471. <dt><samp class="option">max_size <em class="emph">(bytes)</em></samp></dt>
  1472. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1473. which in turn, acts as a ceiling for the size of files that can be read.
  1474. Default is 50 MiB.
  1475. </p>
  1476. </dd>
  1477. </dl>
  1478. </div>
  1479. <div class="section-level-extent" id="libmodplug">
  1480. <h3 class="section"><span>3.15 libmodplug<a class="copiable-link" href="#libmodplug"> &para;</a></span></h3>
  1481. <p>ModPlug based module demuxer
  1482. </p>
  1483. <p>See <a class="url" href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  1484. </p>
  1485. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  1486. Optionally, a <code class="code">pal8</code> 16-color video stream can be exported with or without printed metadata.
  1487. </p>
  1488. <p>It accepts the following options:
  1489. </p>
  1490. <dl class="table">
  1491. <dt><samp class="option">noise_reduction</samp></dt>
  1492. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  1493. </p>
  1494. </dd>
  1495. <dt><samp class="option">reverb_depth</samp></dt>
  1496. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  1497. </p>
  1498. </dd>
  1499. <dt><samp class="option">reverb_delay</samp></dt>
  1500. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  1501. </p>
  1502. </dd>
  1503. <dt><samp class="option">bass_amount</samp></dt>
  1504. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  1505. </p>
  1506. </dd>
  1507. <dt><samp class="option">bass_range</samp></dt>
  1508. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  1509. </p>
  1510. </dd>
  1511. <dt><samp class="option">surround_depth</samp></dt>
  1512. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  1513. </p>
  1514. </dd>
  1515. <dt><samp class="option">surround_delay</samp></dt>
  1516. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  1517. </p>
  1518. </dd>
  1519. <dt><samp class="option">max_size</samp></dt>
  1520. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  1521. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  1522. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  1523. </p>
  1524. </dd>
  1525. <dt><samp class="option">video_stream_expr</samp></dt>
  1526. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  1527. 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>,
  1528. <code class="code">tempo</code>, <code class="code">order</code>, <code class="code">pattern</code> and <code class="code">row</code>.
  1529. </p>
  1530. </dd>
  1531. <dt><samp class="option">video_stream</samp></dt>
  1532. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  1533. </p>
  1534. </dd>
  1535. <dt><samp class="option">video_stream_w</samp></dt>
  1536. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1537. </p>
  1538. </dd>
  1539. <dt><samp class="option">video_stream_h</samp></dt>
  1540. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  1541. </p>
  1542. </dd>
  1543. <dt><samp class="option">video_stream_ptxt</samp></dt>
  1544. <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>,
  1545. <code class="code">row</code> and <code class="code">ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  1546. </p>
  1547. </dd>
  1548. </dl>
  1549. </div>
  1550. <div class="section-level-extent" id="libopenmpt">
  1551. <h3 class="section"><span>3.16 libopenmpt<a class="copiable-link" href="#libopenmpt"> &para;</a></span></h3>
  1552. <p>libopenmpt based module demuxer
  1553. </p>
  1554. <p>See <a class="url" href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  1555. </p>
  1556. <p>Some files have multiple subsongs (tracks) this can be set with the <samp class="option">subsong</samp>
  1557. option.
  1558. </p>
  1559. <p>It accepts the following options:
  1560. </p>
  1561. <dl class="table">
  1562. <dt><samp class="option">subsong</samp></dt>
  1563. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  1564. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  1565. </p>
  1566. <p>The default value is to let libopenmpt choose.
  1567. </p>
  1568. </dd>
  1569. <dt><samp class="option">layout</samp></dt>
  1570. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  1571. The default value is STEREO.
  1572. </p>
  1573. </dd>
  1574. <dt><samp class="option">sample_rate</samp></dt>
  1575. <dd><p>Set the sample rate for libopenmpt to output.
  1576. Range is from 1000 to INT_MAX. The value default is 48000.
  1577. </p></dd>
  1578. </dl>
  1579. </div>
  1580. <div class="section-level-extent" id="mov_002fmp4_002f3gp">
  1581. <h3 class="section"><span>3.17 mov/mp4/3gp<a class="copiable-link" href="#mov_002fmp4_002f3gp"> &para;</a></span></h3>
  1582. <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).
  1583. </p>
  1584. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  1585. </p>
  1586. <ul class="mini-toc">
  1587. <li><a href="#Options-4" accesskey="1">Options</a></li>
  1588. <li><a href="#Audible-AAX" accesskey="2">Audible AAX</a></li>
  1589. </ul>
  1590. <div class="subsection-level-extent" id="Options-4">
  1591. <h4 class="subsection"><span>3.17.1 Options<a class="copiable-link" href="#Options-4"> &para;</a></span></h4>
  1592. <p>This demuxer accepts the following options:
  1593. </p><dl class="table">
  1594. <dt><samp class="option">enable_drefs</samp></dt>
  1595. <dd><p>Enable loading of external tracks, disabled by default.
  1596. Enabling this can theoretically leak information in some use cases.
  1597. </p>
  1598. </dd>
  1599. <dt><samp class="option">use_absolute_path</samp></dt>
  1600. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  1601. Enabling this poses a security risk. It should only be enabled if the source
  1602. is known to be non-malicious.
  1603. </p>
  1604. </dd>
  1605. <dt><samp class="option">seek_streams_individually</samp></dt>
  1606. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  1607. that stream from identified point. This can lead to a different sequence of packets compared
  1608. to demuxing linearly from the beginning. Default is true.
  1609. </p>
  1610. </dd>
  1611. <dt><samp class="option">ignore_editlist</samp></dt>
  1612. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  1613. timeline described by the edit list. Default is false.
  1614. </p>
  1615. </dd>
  1616. <dt><samp class="option">advanced_editlist</samp></dt>
  1617. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code class="code">ignore_editlist</code>
  1618. must be set to false for this option to be effective.
  1619. If both <code class="code">ignore_editlist</code> and this option are set to false, then only the
  1620. start of the stream index is modified to reflect initial dwell time or starting timestamp
  1621. described by the edit list. Default is true.
  1622. </p>
  1623. </dd>
  1624. <dt><samp class="option">ignore_chapters</samp></dt>
  1625. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  1626. only parsed when input is seekable. Default is false.
  1627. </p>
  1628. </dd>
  1629. <dt><samp class="option">use_mfra_for</samp></dt>
  1630. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  1631. </p>
  1632. <p>Following options are available:
  1633. </p><dl class="table">
  1634. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  1635. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em class="emph">(default)</em>
  1636. </p>
  1637. </dd>
  1638. <dt>&lsquo;<samp class="samp">dts</samp>&rsquo;</dt>
  1639. <dd><p>Set mfra timestamps as DTS
  1640. </p>
  1641. </dd>
  1642. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  1643. <dd><p>Set mfra timestamps as PTS
  1644. </p>
  1645. </dd>
  1646. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  1647. <dd><p>Don&rsquo;t use mfra box to set timestamps
  1648. </p></dd>
  1649. </dl>
  1650. </dd>
  1651. <dt><samp class="option">use_tfdt</samp></dt>
  1652. <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.
  1653. 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.
  1654. 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
  1655. set to pts or dts.
  1656. </p>
  1657. </dd>
  1658. <dt><samp class="option">export_all</samp></dt>
  1659. <dd><p>Export unrecognized boxes within the <var class="var">udta</var> box as metadata entries. The first four
  1660. characters of the box type are set as the key. Default is false.
  1661. </p>
  1662. </dd>
  1663. <dt><samp class="option">export_xmp</samp></dt>
  1664. <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
  1665. 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
  1666. but with key <code class="code">XMP_</code>. Default is false.
  1667. </p>
  1668. </dd>
  1669. <dt><samp class="option">activation_bytes</samp></dt>
  1670. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  1671. </p>
  1672. </dd>
  1673. <dt><samp class="option">audible_fixed_key</samp></dt>
  1674. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  1675. specify.
  1676. </p>
  1677. </dd>
  1678. <dt><samp class="option">decryption_key</samp></dt>
  1679. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  1680. </p>
  1681. </dd>
  1682. <dt><samp class="option">max_stts_delta</samp></dt>
  1683. <dd><p>Very high sample deltas written in a trak&rsquo;s stts box may occasionally be intended but usually they are written in
  1684. error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets
  1685. the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when
  1686. cast to int32 are used to adjust onward dts.
  1687. </p>
  1688. <p>Unit is the track time scale. Range is 0 to UINT_MAX. Default is <code class="code">UINT_MAX - 48000*10</code> which allows up to
  1689. a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of <code class="code">uint32</code> range.
  1690. </p>
  1691. </dd>
  1692. <dt><samp class="option">interleaved_read</samp></dt>
  1693. <dd><p>Interleave packets from multiple tracks at demuxer level. For badly interleaved files, this prevents playback issues
  1694. caused by large gaps between packets in different tracks, as MOV/MP4 do not have packet placement requirements.
  1695. However, this can cause excessive seeking on very badly interleaved files, due to seeking between tracks, so disabling
  1696. it may prevent I/O issues, at the expense of playback.
  1697. </p>
  1698. </dd>
  1699. </dl>
  1700. </div>
  1701. <div class="subsection-level-extent" id="Audible-AAX">
  1702. <h4 class="subsection"><span>3.17.2 Audible AAX<a class="copiable-link" href="#Audible-AAX"> &para;</a></span></h4>
  1703. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  1704. </p><div class="example">
  1705. <pre class="example-preformatted">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  1706. </pre></div>
  1707. </div>
  1708. </div>
  1709. <div class="section-level-extent" id="mpegts">
  1710. <h3 class="section"><span>3.18 mpegts<a class="copiable-link" href="#mpegts"> &para;</a></span></h3>
  1711. <p>MPEG-2 transport stream demuxer.
  1712. </p>
  1713. <p>This demuxer accepts the following options:
  1714. </p><dl class="table">
  1715. <dt><samp class="option">resync_size</samp></dt>
  1716. <dd><p>Set size limit for looking up a new synchronization. Default value is
  1717. 65536.
  1718. </p>
  1719. </dd>
  1720. <dt><samp class="option">skip_unknown_pmt</samp></dt>
  1721. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  1722. </p>
  1723. </dd>
  1724. <dt><samp class="option">fix_teletext_pts</samp></dt>
  1725. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  1726. from the PCR of the first program which the teletext stream is part of and is
  1727. not discarded. Default value is 1, set this option to 0 if you want your
  1728. teletext packet PTS and DTS values untouched.
  1729. </p>
  1730. </dd>
  1731. <dt><samp class="option">ts_packetsize</samp></dt>
  1732. <dd><p>Output option carrying the raw packet size in bytes.
  1733. Show the detected raw packet size, cannot be set by the user.
  1734. </p>
  1735. </dd>
  1736. <dt><samp class="option">scan_all_pmts</samp></dt>
  1737. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  1738. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  1739. disabled). Default value is -1.
  1740. </p>
  1741. </dd>
  1742. <dt><samp class="option">merge_pmt_versions</samp></dt>
  1743. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  1744. streams move to different PIDs. Default value is 0.
  1745. </p>
  1746. </dd>
  1747. <dt><samp class="option">max_packet_size</samp></dt>
  1748. <dd><p>Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size
  1749. are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes.
  1750. </p></dd>
  1751. </dl>
  1752. </div>
  1753. <div class="section-level-extent" id="mpjpeg">
  1754. <h3 class="section"><span>3.19 mpjpeg<a class="copiable-link" href="#mpjpeg"> &para;</a></span></h3>
  1755. <p>MJPEG encapsulated in multi-part MIME demuxer.
  1756. </p>
  1757. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  1758. multipart/x-mixed-replace stream.
  1759. </p><dl class="table">
  1760. <dt><samp class="option">strict_mime_boundary</samp></dt>
  1761. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  1762. to prevent regression with numerous existing endpoints not generating a proper MIME
  1763. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  1764. of the boundary value.
  1765. </p></dd>
  1766. </dl>
  1767. </div>
  1768. <div class="section-level-extent" id="rawvideo">
  1769. <h3 class="section"><span>3.20 rawvideo<a class="copiable-link" href="#rawvideo"> &para;</a></span></h3>
  1770. <p>Raw video demuxer.
  1771. </p>
  1772. <p>This demuxer allows one to read raw video data. Since there is no header
  1773. specifying the assumed video parameters, the user must specify them
  1774. in order to be able to decode the data correctly.
  1775. </p>
  1776. <p>This demuxer accepts the following options:
  1777. </p><dl class="table">
  1778. <dt><samp class="option">framerate</samp></dt>
  1779. <dd><p>Set input video frame rate. Default value is 25.
  1780. </p>
  1781. </dd>
  1782. <dt><samp class="option">pixel_format</samp></dt>
  1783. <dd><p>Set the input video pixel format. Default value is <code class="code">yuv420p</code>.
  1784. </p>
  1785. </dd>
  1786. <dt><samp class="option">video_size</samp></dt>
  1787. <dd><p>Set the input video size. This value must be specified explicitly.
  1788. </p></dd>
  1789. </dl>
  1790. <p>For example to read a rawvideo file <samp class="file">input.raw</samp> with
  1791. <code class="command">ffplay</code>, assuming a pixel format of <code class="code">rgb24</code>, a video
  1792. size of <code class="code">320x240</code>, and a frame rate of 10 images per second, use
  1793. the command:
  1794. </p><div class="example">
  1795. <pre class="example-preformatted">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  1796. </pre></div>
  1797. </div>
  1798. <div class="section-level-extent" id="sbg">
  1799. <h3 class="section"><span>3.21 sbg<a class="copiable-link" href="#sbg"> &para;</a></span></h3>
  1800. <p>SBaGen script demuxer.
  1801. </p>
  1802. <p>This demuxer reads the script language used by SBaGen
  1803. <a class="url" href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  1804. script looks like that:
  1805. </p><div class="example">
  1806. <pre class="example-preformatted">-SE
  1807. a: 300-2.5/3 440+4.5/0
  1808. b: 300-2.5/0 440+4.5/3
  1809. off: -
  1810. NOW == a
  1811. +0:07:00 == b
  1812. +0:14:00 == a
  1813. +0:21:00 == b
  1814. +0:30:00 off
  1815. </pre></div>
  1816. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  1817. either only absolute timestamps (including the script start time) or only
  1818. relative ones, then its layout is fixed, and the conversion is
  1819. straightforward. On the other hand, if the script mixes both kind of
  1820. timestamps, then the <var class="var">NOW</var> reference for relative timestamps will be
  1821. taken from the current time of day at the time the script is read, and the
  1822. script layout will be frozen according to that reference. That means that if
  1823. the script is directly played, the actual times will match the absolute
  1824. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  1825. somehow pauses the playback or seeks, all times will be shifted accordingly.
  1826. </p>
  1827. </div>
  1828. <div class="section-level-extent" id="tedcaptions">
  1829. <h3 class="section"><span>3.22 tedcaptions<a class="copiable-link" href="#tedcaptions"> &para;</a></span></h3>
  1830. <p>JSON captions used for <a class="url" href="http://www.ted.com/">TED Talks</a>.
  1831. </p>
  1832. <p>TED does not provide links to the captions, but they can be guessed from the
  1833. page. The file <samp class="file">tools/bookmarklets.html</samp> from the FFmpeg source tree
  1834. contains a bookmarklet to expose them.
  1835. </p>
  1836. <p>This demuxer accepts the following option:
  1837. </p><dl class="table">
  1838. <dt><samp class="option">start_time</samp></dt>
  1839. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  1840. (15s). It is used to sync the captions with the downloadable videos, because
  1841. they include a 15s intro.
  1842. </p></dd>
  1843. </dl>
  1844. <p>Example: convert the captions to a format most players understand:
  1845. </p><div class="example">
  1846. <pre class="example-preformatted">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  1847. </pre></div>
  1848. </div>
  1849. <div class="section-level-extent" id="vapoursynth">
  1850. <h3 class="section"><span>3.23 vapoursynth<a class="copiable-link" href="#vapoursynth"> &para;</a></span></h3>
  1851. <p>Vapoursynth wrapper.
  1852. </p>
  1853. <p>Due to security concerns, Vapoursynth scripts will not
  1854. be autodetected so the input format has to be forced. For ff* CLI tools,
  1855. add <code class="code">-f vapoursynth</code> before the input <code class="code">-i yourscript.vpy</code>.
  1856. </p>
  1857. <p>This demuxer accepts the following option:
  1858. </p><dl class="table">
  1859. <dt><samp class="option">max_script_size</samp></dt>
  1860. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  1861. which in turn, acts as a ceiling for the size of scripts that can be read.
  1862. Default is 1 MiB.
  1863. </p></dd>
  1864. </dl>
  1865. </div>
  1866. <div class="section-level-extent" id="w64">
  1867. <h3 class="section"><span>3.24 w64<a class="copiable-link" href="#w64"> &para;</a></span></h3>
  1868. <p>Sony Wave64 Audio demuxer.
  1869. </p>
  1870. <p>This demuxer accepts the following options:
  1871. </p><dl class="table">
  1872. <dt><samp class="option">max_size</samp></dt>
  1873. <dd><p>See the same option for the <a class="ref" href="#wav">wav</a> demuxer.
  1874. </p></dd>
  1875. </dl>
  1876. <a class="anchor" id="wav"></a></div>
  1877. <div class="section-level-extent" id="wav-1">
  1878. <h3 class="section"><span>3.25 wav<a class="copiable-link" href="#wav-1"> &para;</a></span></h3>
  1879. <p>RIFF Wave Audio demuxer.
  1880. </p>
  1881. <p>This demuxer accepts the following options:
  1882. </p><dl class="table">
  1883. <dt><samp class="option">max_size</samp></dt>
  1884. <dd><p>Specify the maximum packet size in bytes for the demuxed packets. By default
  1885. this is set to 0, which means that a sensible value is chosen based on the
  1886. input format.
  1887. </p></dd>
  1888. </dl>
  1889. </div>
  1890. </div>
  1891. <div class="chapter-level-extent" id="Muxers">
  1892. <h2 class="chapter"><span>4 Muxers<a class="copiable-link" href="#Muxers"> &para;</a></span></h2>
  1893. <p>Muxers are configured elements in FFmpeg which allow writing
  1894. multimedia streams to a particular type of file.
  1895. </p>
  1896. <p>When you configure your FFmpeg build, all the supported muxers
  1897. are enabled by default. You can list all available muxers using the
  1898. configure option <code class="code">--list-muxers</code>.
  1899. </p>
  1900. <p>You can disable all the muxers with the configure option
  1901. <code class="code">--disable-muxers</code> and selectively enable / disable single muxers
  1902. with the options <code class="code">--enable-muxer=<var class="var">MUXER</var></code> /
  1903. <code class="code">--disable-muxer=<var class="var">MUXER</var></code>.
  1904. </p>
  1905. <p>The option <code class="code">-muxers</code> of the ff* tools will display the list of
  1906. enabled muxers. Use <code class="code">-formats</code> to view a combined list of
  1907. enabled demuxers and muxers.
  1908. </p>
  1909. <p>A description of some of the currently available muxers follows.
  1910. </p>
  1911. <a class="anchor" id="raw-muxers"></a><ul class="mini-toc">
  1912. <li><a href="#Raw-muxers" accesskey="1">Raw muxers</a></li>
  1913. <li><a href="#Raw-PCM-muxers" accesskey="2">Raw PCM muxers</a></li>
  1914. <li><a href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers" accesskey="3">MPEG-1/MPEG-2 program stream muxers</a></li>
  1915. <li><a href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers" accesskey="4">MOV/MPEG-4/ISOMBFF muxers</a></li>
  1916. <li><a href="#a64-1" accesskey="5">a64</a></li>
  1917. <li><a href="#ac4" accesskey="6">ac4</a></li>
  1918. <li><a href="#adts-1" accesskey="7">adts</a></li>
  1919. <li><a href="#aea-1" accesskey="8">aea</a></li>
  1920. <li><a href="#aiff-1" accesskey="9">aiff</a></li>
  1921. <li><a href="#alp-1">alp</a></li>
  1922. <li><a href="#amr">amr</a></li>
  1923. <li><a href="#amv">amv</a></li>
  1924. <li><a href="#apm">apm</a></li>
  1925. <li><a href="#apng-1">apng</a></li>
  1926. <li><a href="#argo_005fasf">argo_asf</a></li>
  1927. <li><a href="#argo_005fcvg">argo_cvg</a></li>
  1928. <li><a href="#asf_002c-asf_005fstream">asf, asf_stream</a></li>
  1929. <li><a href="#ass">ass</a></li>
  1930. <li><a href="#ast">ast</a></li>
  1931. <li><a href="#au">au</a></li>
  1932. <li><a href="#avi-1">avi</a></li>
  1933. <li><a href="#avif">avif</a></li>
  1934. <li><a href="#avm2">avm2</a></li>
  1935. <li><a href="#bit">bit</a></li>
  1936. <li><a href="#caf">caf</a></li>
  1937. <li><a href="#codec2">codec2</a></li>
  1938. <li><a href="#chromaprint-1">chromaprint</a></li>
  1939. <li><a href="#crc-1">crc</a></li>
  1940. <li><a href="#dash-2">dash</a></li>
  1941. <li><a href="#daud">daud</a></li>
  1942. <li><a href="#dv">dv</a></li>
  1943. <li><a href="#ffmetadata">ffmetadata</a></li>
  1944. <li><a href="#fifo-1">fifo</a></li>
  1945. <li><a href="#film_005fcpk">film_cpk</a></li>
  1946. <li><a href="#filmstrip">filmstrip</a></li>
  1947. <li><a href="#fits">fits</a></li>
  1948. <li><a href="#flac">flac</a></li>
  1949. <li><a href="#flv">flv</a></li>
  1950. <li><a href="#framecrc-1">framecrc</a></li>
  1951. <li><a href="#framehash-1">framehash</a></li>
  1952. <li><a href="#framemd5-1">framemd5</a></li>
  1953. <li><a href="#gif-2">gif</a></li>
  1954. <li><a href="#gxf">gxf</a></li>
  1955. <li><a href="#hash-1">hash</a></li>
  1956. <li><a href="#hds-1">hds</a></li>
  1957. <li><a href="#hls-2">hls</a></li>
  1958. <li><a href="#ico-1">ico</a></li>
  1959. <li><a href="#image2-2">image2</a></li>
  1960. <li><a href="#matroska">matroska</a></li>
  1961. <li><a href="#md5-1">md5</a></li>
  1962. <li><a href="#mp3">mp3</a></li>
  1963. <li><a href="#mpegts-1">mpegts</a></li>
  1964. <li><a href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">mxf, mxf_d10, mxf_opatom</a></li>
  1965. <li><a href="#null">null</a></li>
  1966. <li><a href="#nut">nut</a></li>
  1967. <li><a href="#ogg">ogg</a></li>
  1968. <li><a href="#rcwt-1">rcwt</a></li>
  1969. <li><a href="#segment_002c-stream_005fsegment_002c-ssegment">segment, stream_segment, ssegment</a></li>
  1970. <li><a href="#smoothstreaming">smoothstreaming</a></li>
  1971. <li><a href="#streamhash-1">streamhash</a></li>
  1972. <li><a href="#tee-1">tee</a></li>
  1973. <li><a href="#webm_005fchunk">webm_chunk</a></li>
  1974. <li><a href="#webm_005fdash_005fmanifest">webm_dash_manifest</a></li>
  1975. </ul>
  1976. <div class="section-level-extent" id="Raw-muxers">
  1977. <h3 class="section"><span>4.1 Raw muxers<a class="copiable-link" href="#Raw-muxers"> &para;</a></span></h3>
  1978. <p>This section covers raw muxers. They accept a single stream matching
  1979. the designated codec. They do not store timestamps or metadata. The
  1980. recognized extension is the same as the muxer name unless indicated
  1981. otherwise.
  1982. </p>
  1983. <p>It comprises the following muxers. The media type and the eventual
  1984. extensions used to automatically selects the muxer from the output
  1985. extensions are also shown.
  1986. </p>
  1987. <dl class="table">
  1988. <dt>&lsquo;<samp class="samp">ac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  1989. <dd><p>Dolby Digital, also known as AC-3.
  1990. </p>
  1991. </dd>
  1992. <dt>&lsquo;<samp class="samp">adx <em class="emph">audio</em></samp>&rsquo;</dt>
  1993. <dd><p>CRI Middleware ADX audio.
  1994. </p>
  1995. <p>This muxer will write out the total sample count near the start of the
  1996. first packet when the output is seekable and the count can be stored
  1997. in 32 bits.
  1998. </p>
  1999. </dd>
  2000. <dt>&lsquo;<samp class="samp">aptx <em class="emph">audio</em></samp>&rsquo;</dt>
  2001. <dd><p>aptX (Audio Processing Technology for Bluetooth)
  2002. </p>
  2003. </dd>
  2004. <dt>&lsquo;<samp class="samp">aptx_hd <em class="emph">audio</em> (aptxdh)</samp>&rsquo;</dt>
  2005. <dd><p>aptX HD (Audio Processing Technology for Bluetooth) audio
  2006. </p>
  2007. </dd>
  2008. <dt>&lsquo;<samp class="samp">avs2 <em class="emph">video</em> (avs, avs2)</samp>&rsquo;</dt>
  2009. <dd><p>AVS2-P2 (Audio Video Standard - Second generation - Part 2) /
  2010. IEEE 1857.4 video
  2011. </p>
  2012. </dd>
  2013. <dt>&lsquo;<samp class="samp">avs3 <em class="emph">video</em> (avs3)</samp>&rsquo;</dt>
  2014. <dd><p>AVS3-P2 (Audio Video Standard - Third generation - Part 2) /
  2015. IEEE 1857.10 video
  2016. </p>
  2017. </dd>
  2018. <dt>&lsquo;<samp class="samp">cavsvideo <em class="emph">video</em> (cavs)</samp>&rsquo;</dt>
  2019. <dd><p>Chinese AVS (Audio Video Standard - First generation)
  2020. </p>
  2021. </dd>
  2022. <dt>&lsquo;<samp class="samp">codec2raw <em class="emph">audio</em></samp>&rsquo;</dt>
  2023. <dd><p>Codec 2 audio.
  2024. </p>
  2025. <p>No extension is registered so format name has to be supplied e.g. with
  2026. the ffmpeg CLI tool <code class="code">-f codec2raw</code>.
  2027. </p>
  2028. </dd>
  2029. <dt>&lsquo;<samp class="samp">data <em class="emph">any</em></samp>&rsquo;</dt>
  2030. <dd><p>Generic data muxer.
  2031. </p>
  2032. <p>This muxer accepts a single stream with any codec of any type. The
  2033. input stream has to be selected using the <code class="code">-map</code> option with the
  2034. <code class="command">ffmpeg</code> CLI tool.
  2035. </p>
  2036. <p>No extension is registered so format name has to be supplied e.g. with
  2037. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f data</code>.
  2038. </p>
  2039. </dd>
  2040. <dt>&lsquo;<samp class="samp">dfpwm <em class="emph">audio</em> (dfpwm)</samp>&rsquo;</dt>
  2041. <dd><p>Raw DFPWM1a (Dynamic Filter Pulse With Modulation) audio muxer.
  2042. </p>
  2043. </dd>
  2044. <dt>&lsquo;<samp class="samp">dirac <em class="emph">video</em> (drc, vc2)</samp>&rsquo;</dt>
  2045. <dd><p>BBC Dirac video.
  2046. </p>
  2047. <p>The Dirac Pro codec is a subset and is standardized as SMPTE VC-2.
  2048. </p>
  2049. </dd>
  2050. <dt>&lsquo;<samp class="samp">dnxhd <em class="emph">video</em> (dnxhd, dnxhr)</samp>&rsquo;</dt>
  2051. <dd><p>Avid DNxHD video.
  2052. </p>
  2053. <p>It is standardized as SMPTE VC-3. Accepts DNxHR streams.
  2054. </p>
  2055. </dd>
  2056. <dt>&lsquo;<samp class="samp">dts <em class="emph">audio</em></samp>&rsquo;</dt>
  2057. <dd><p>DTS Coherent Acoustics (DCA) audio
  2058. </p>
  2059. </dd>
  2060. <dt>&lsquo;<samp class="samp">eac3 <em class="emph">audio</em></samp>&rsquo;</dt>
  2061. <dd><p>Dolby Digital Plus, also known as Enhanced AC-3
  2062. </p>
  2063. </dd>
  2064. <dt>&lsquo;<samp class="samp">evc <em class="emph">video</em> (evc)</samp>&rsquo;</dt>
  2065. <dd><p>MPEG-5 Essential Video Coding (EVC) / EVC / MPEG-5 Part 1 EVC video
  2066. </p>
  2067. </dd>
  2068. <dt>&lsquo;<samp class="samp">g722 <em class="emph">audio</em></samp>&rsquo;</dt>
  2069. <dd><p>ITU-T G.722 audio
  2070. </p>
  2071. </dd>
  2072. <dt>&lsquo;<samp class="samp">g723_1 <em class="emph">audio</em> (tco, rco)</samp>&rsquo;</dt>
  2073. <dd><p>ITU-T G.723.1 audio
  2074. </p>
  2075. </dd>
  2076. <dt>&lsquo;<samp class="samp">g726 <em class="emph">audio</em></samp>&rsquo;</dt>
  2077. <dd><p>ITU-T G.726 big-endian (&quot;left-justified&quot;) audio.
  2078. </p>
  2079. <p>No extension is registered so format name has to be supplied e.g. with
  2080. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726</code>.
  2081. </p>
  2082. </dd>
  2083. <dt>&lsquo;<samp class="samp">g726le <em class="emph">audio</em></samp>&rsquo;</dt>
  2084. <dd><p>ITU-T G.726 little-endian (&quot;right-justified&quot;) audio.
  2085. </p>
  2086. <p>No extension is registered so format name has to be supplied e.g. with
  2087. the <code class="command">ffmpeg</code> CLI tool <code class="code">-f g726le</code>.
  2088. </p>
  2089. </dd>
  2090. <dt>&lsquo;<samp class="samp">gsm <em class="emph">audio</em></samp>&rsquo;</dt>
  2091. <dd><p>Global System for Mobile Communications audio
  2092. </p>
  2093. </dd>
  2094. <dt>&lsquo;<samp class="samp">h261 <em class="emph">video</em></samp>&rsquo;</dt>
  2095. <dd><p>ITU-T H.261 video
  2096. </p>
  2097. </dd>
  2098. <dt>&lsquo;<samp class="samp">h263 <em class="emph">video</em></samp>&rsquo;</dt>
  2099. <dd><p>ITU-T H.263 / H.263-1996, H.263+ / H.263-1998 / H.263 version 2 video
  2100. </p>
  2101. </dd>
  2102. <dt>&lsquo;<samp class="samp">h264 <em class="emph">video</em> (h264, 264)</samp>&rsquo;</dt>
  2103. <dd><p>ITU-T H.264 / MPEG-4 Part 10 AVC video. Bitstream shall be converted
  2104. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  2105. </p>
  2106. </dd>
  2107. <dt>&lsquo;<samp class="samp">hevc <em class="emph">video</em> (hevc, h265, 265)</samp>&rsquo;</dt>
  2108. <dd><p>ITU-T H.265 / MPEG-H Part 2 HEVC video. Bitstream shall be converted
  2109. to Annex B syntax if it&rsquo;s in length-prefixed mode.
  2110. </p>
  2111. </dd>
  2112. <dt>&lsquo;<samp class="samp">m4v <em class="emph">video</em></samp>&rsquo;</dt>
  2113. <dd><p>MPEG-4 Part 2 video
  2114. </p>
  2115. </dd>
  2116. <dt>&lsquo;<samp class="samp">mjpeg <em class="emph">video</em> (mjpg, mjpeg)</samp>&rsquo;</dt>
  2117. <dd><p>Motion JPEG video
  2118. </p>
  2119. </dd>
  2120. <dt>&lsquo;<samp class="samp">mlp <em class="emph">audio</em></samp>&rsquo;</dt>
  2121. <dd><p>Meridian Lossless Packing, also known as Packed PCM
  2122. </p>
  2123. </dd>
  2124. <dt>&lsquo;<samp class="samp">mp2 <em class="emph">audio</em> (mp2, m2a, mpa)</samp>&rsquo;</dt>
  2125. <dd><p>MPEG-1 Audio Layer II audio
  2126. </p>
  2127. </dd>
  2128. <dt>&lsquo;<samp class="samp">mpeg1video <em class="emph">video</em> (mpg, mpeg, m1v)</samp>&rsquo;</dt>
  2129. <dd><p>MPEG-1 Part 2 video.
  2130. </p>
  2131. </dd>
  2132. <dt>&lsquo;<samp class="samp">mpeg2video <em class="emph">video</em> (m2v)</samp>&rsquo;</dt>
  2133. <dd><p>ITU-T H.262 / MPEG-2 Part 2 video
  2134. </p>
  2135. </dd>
  2136. <dt>&lsquo;<samp class="samp">obu <em class="emph">video</em></samp>&rsquo;</dt>
  2137. <dd><p>AV1 low overhead Open Bitstream Units muxer.
  2138. </p>
  2139. <p>Temporal delimiter OBUs will be inserted in all temporal units of the
  2140. stream.
  2141. </p>
  2142. </dd>
  2143. <dt>&lsquo;<samp class="samp">rawvideo <em class="emph">video</em> (yuv, rgb)</samp>&rsquo;</dt>
  2144. <dd><p>Raw uncompressed video.
  2145. </p>
  2146. </dd>
  2147. <dt>&lsquo;<samp class="samp">sbc <em class="emph">audio</em> (sbc, msbc)</samp>&rsquo;</dt>
  2148. <dd><p>Bluetooth SIG low-complexity subband codec audio
  2149. </p>
  2150. </dd>
  2151. <dt>&lsquo;<samp class="samp">truehd <em class="emph">audio</em> (thd)</samp>&rsquo;</dt>
  2152. <dd><p>Dolby TrueHD audio
  2153. </p>
  2154. </dd>
  2155. <dt>&lsquo;<samp class="samp">vc1 <em class="emph">video</em></samp>&rsquo;</dt>
  2156. <dd><p>SMPTE 421M / VC-1 video
  2157. </p></dd>
  2158. </dl>
  2159. <ul class="mini-toc">
  2160. <li><a href="#Examples-3" accesskey="1">Examples</a></li>
  2161. </ul>
  2162. <div class="subsection-level-extent" id="Examples-3">
  2163. <h4 class="subsection"><span>4.1.1 Examples<a class="copiable-link" href="#Examples-3"> &para;</a></span></h4>
  2164. <ul class="itemize mark-bullet">
  2165. <li>Store raw video frames with the &lsquo;<samp class="samp">rawvideo</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  2166. <div class="example">
  2167. <pre class="example-preformatted">ffmpeg -f lavfi -i testsrc -t 10 -s hd1080p testsrc.yuv
  2168. </pre></div>
  2169. <p>Since the rawvideo muxer do not store the information related to size
  2170. and format, this information must be provided when demuxing the file:
  2171. </p><div class="example">
  2172. <pre class="example-preformatted">ffplay -video_size 1920x1080 -pixel_format rgb24 -f rawvideo testsrc.rgb
  2173. </pre></div>
  2174. </li></ul>
  2175. </div>
  2176. </div>
  2177. <div class="section-level-extent" id="Raw-PCM-muxers">
  2178. <h3 class="section"><span>4.2 Raw PCM muxers<a class="copiable-link" href="#Raw-PCM-muxers"> &para;</a></span></h3>
  2179. <p>This section covers raw PCM (Pulse-Code Modulation) audio muxers.
  2180. </p>
  2181. <p>They accept a single stream matching the designated codec. They do not
  2182. store timestamps or metadata. The recognized extension is the same as
  2183. the muxer name.
  2184. </p>
  2185. <p>It comprises the following muxers. The optional additional extension
  2186. used to automatically select the muxer from the output extension is
  2187. also shown in parentheses.
  2188. </p>
  2189. <dl class="table">
  2190. <dt>&lsquo;<samp class="samp">alaw (al)</samp>&rsquo;</dt>
  2191. <dd><p>PCM A-law
  2192. </p>
  2193. </dd>
  2194. <dt>&lsquo;<samp class="samp">f32be</samp>&rsquo;</dt>
  2195. <dd><p>PCM 32-bit floating-point big-endian
  2196. </p>
  2197. </dd>
  2198. <dt>&lsquo;<samp class="samp">f32le</samp>&rsquo;</dt>
  2199. <dd><p>PCM 32-bit floating-point little-endian
  2200. </p>
  2201. </dd>
  2202. <dt>&lsquo;<samp class="samp">f64be</samp>&rsquo;</dt>
  2203. <dd><p>PCM 64-bit floating-point big-endian
  2204. </p>
  2205. </dd>
  2206. <dt>&lsquo;<samp class="samp">f64le</samp>&rsquo;</dt>
  2207. <dd><p>PCM 64-bit floating-point little-endian
  2208. </p>
  2209. </dd>
  2210. <dt>&lsquo;<samp class="samp">mulaw (ul)</samp>&rsquo;</dt>
  2211. <dd><p>PCM mu-law
  2212. </p>
  2213. </dd>
  2214. <dt>&lsquo;<samp class="samp">s16be</samp>&rsquo;</dt>
  2215. <dd><p>PCM signed 16-bit big-endian
  2216. </p>
  2217. </dd>
  2218. <dt>&lsquo;<samp class="samp">s16le</samp>&rsquo;</dt>
  2219. <dd><p>PCM signed 16-bit little-endian
  2220. </p>
  2221. </dd>
  2222. <dt>&lsquo;<samp class="samp">s24be</samp>&rsquo;</dt>
  2223. <dd><p>PCM signed 24-bit big-endian
  2224. </p>
  2225. </dd>
  2226. <dt>&lsquo;<samp class="samp">s24le</samp>&rsquo;</dt>
  2227. <dd><p>PCM signed 24-bit little-endian
  2228. </p>
  2229. </dd>
  2230. <dt>&lsquo;<samp class="samp">s32be</samp>&rsquo;</dt>
  2231. <dd><p>PCM signed 32-bit big-endian
  2232. </p>
  2233. </dd>
  2234. <dt>&lsquo;<samp class="samp">s32le</samp>&rsquo;</dt>
  2235. <dd><p>PCM signed 32-bit little-endian
  2236. </p>
  2237. </dd>
  2238. <dt>&lsquo;<samp class="samp">s8 (sb)</samp>&rsquo;</dt>
  2239. <dd><p>PCM signed 8-bit
  2240. </p>
  2241. </dd>
  2242. <dt>&lsquo;<samp class="samp">u16be</samp>&rsquo;</dt>
  2243. <dd><p>PCM unsigned 16-bit big-endian
  2244. </p>
  2245. </dd>
  2246. <dt>&lsquo;<samp class="samp">u16le</samp>&rsquo;</dt>
  2247. <dd><p>PCM unsigned 16-bit little-endian
  2248. </p>
  2249. </dd>
  2250. <dt>&lsquo;<samp class="samp">u24be</samp>&rsquo;</dt>
  2251. <dd><p>PCM unsigned 24-bit big-endian
  2252. </p>
  2253. </dd>
  2254. <dt>&lsquo;<samp class="samp">u24le</samp>&rsquo;</dt>
  2255. <dd><p>PCM unsigned 24-bit little-endian
  2256. </p>
  2257. </dd>
  2258. <dt>&lsquo;<samp class="samp">u32be</samp>&rsquo;</dt>
  2259. <dd><p>PCM unsigned 32-bit big-endian
  2260. </p>
  2261. </dd>
  2262. <dt>&lsquo;<samp class="samp">u32le</samp>&rsquo;</dt>
  2263. <dd><p>PCM unsigned 32-bit little-endian
  2264. </p>
  2265. </dd>
  2266. <dt>&lsquo;<samp class="samp">u8 (ub)</samp>&rsquo;</dt>
  2267. <dd><p>PCM unsigned 8-bit
  2268. </p>
  2269. </dd>
  2270. <dt>&lsquo;<samp class="samp">vidc</samp>&rsquo;</dt>
  2271. <dd><p>PCM Archimedes VIDC
  2272. </p></dd>
  2273. </dl>
  2274. </div>
  2275. <div class="section-level-extent" id="MPEG_002d1_002fMPEG_002d2-program-stream-muxers">
  2276. <h3 class="section"><span>4.3 MPEG-1/MPEG-2 program stream muxers<a class="copiable-link" href="#MPEG_002d1_002fMPEG_002d2-program-stream-muxers"> &para;</a></span></h3>
  2277. <p>This section covers formats belonging to the MPEG-1 and MPEG-2 Systems
  2278. family.
  2279. </p>
  2280. <p>The MPEG-1 Systems format (also known as ISO/IEEC 11172-1 or MPEG-1
  2281. program stream) has been adopted for the format of media track stored
  2282. in VCD (Video Compact Disc).
  2283. </p>
  2284. <p>The MPEG-2 Systems standard (also known as ISO/IEEC 13818-1) covers
  2285. two containers formats, one known as transport stream and one known as
  2286. program stream; only the latter is covered here.
  2287. </p>
  2288. <p>The MPEG-2 program stream format (also known as VOB due to the
  2289. corresponding file extension) is an extension of MPEG-1 program
  2290. stream: in addition to support different codecs for the audio and
  2291. video streams, it also stores subtitles and navigation metadata.
  2292. MPEG-2 program stream has been adopted for storing media streams in
  2293. SVCD and DVD storage devices.
  2294. </p>
  2295. <p>This section comprises the following muxers.
  2296. </p>
  2297. <dl class="table">
  2298. <dt>&lsquo;<samp class="samp">mpeg (mpg,mpeg)</samp>&rsquo;</dt>
  2299. <dd><p>MPEG-1 Systems / MPEG-1 program stream muxer.
  2300. </p>
  2301. </dd>
  2302. <dt>&lsquo;<samp class="samp">vcd</samp>&rsquo;</dt>
  2303. <dd><p>MPEG-1 Systems / MPEG-1 program stream (VCD) muxer.
  2304. </p>
  2305. <p>This muxer can be used to generate tracks in the format accepted by
  2306. the VCD (Video Compact Disc) storage devices.
  2307. </p>
  2308. <p>It is the same as the &lsquo;<samp class="samp">mpeg</samp>&rsquo; muxer with a few differences.
  2309. </p>
  2310. </dd>
  2311. <dt>&lsquo;<samp class="samp">vob</samp>&rsquo;</dt>
  2312. <dd><p>MPEG-2 program stream (VOB) muxer.
  2313. </p>
  2314. </dd>
  2315. <dt>&lsquo;<samp class="samp">dvd</samp>&rsquo;</dt>
  2316. <dd><p>MPEG-2 program stream (DVD VOB) muxer.
  2317. </p>
  2318. <p>This muxer can be used to generate tracks in the format accepted by
  2319. the DVD (Digital Versatile Disc) storage devices.
  2320. </p>
  2321. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  2322. </p>
  2323. </dd>
  2324. <dt>&lsquo;<samp class="samp">svcd (vob)</samp>&rsquo;</dt>
  2325. <dd><p>MPEG-2 program stream (SVCD VOB) muxer.
  2326. </p>
  2327. <p>This muxer can be used to generate tracks in the format accepted by
  2328. the SVCD (Super Video Compact Disc) storage devices.
  2329. </p>
  2330. <p>This is the same as the &lsquo;<samp class="samp">vob</samp>&rsquo; muxer with a few differences.
  2331. </p></dd>
  2332. </dl>
  2333. <ul class="mini-toc">
  2334. <li><a href="#Options-5" accesskey="1">Options</a></li>
  2335. </ul>
  2336. <div class="subsection-level-extent" id="Options-5">
  2337. <h4 class="subsection"><span>4.3.1 Options<a class="copiable-link" href="#Options-5"> &para;</a></span></h4>
  2338. <dl class="table">
  2339. <dt><samp class="option">muxrate <var class="var">rate</var></samp></dt>
  2340. <dd><p>Set user-defined mux rate expressed as a number of bits/s. If not
  2341. specied the automatically computed mux rate is employed. Default value
  2342. is <code class="code">0</code>.
  2343. </p>
  2344. </dd>
  2345. <dt><samp class="option">preload <var class="var">delay</var></samp></dt>
  2346. <dd><p>Set initial demux-decode delay in microseconds. Default value is
  2347. <code class="code">500000</code>.
  2348. </p></dd>
  2349. </dl>
  2350. </div>
  2351. </div>
  2352. <div class="section-level-extent" id="MOV_002fMPEG_002d4_002fISOMBFF-muxers">
  2353. <h3 class="section"><span>4.4 MOV/MPEG-4/ISOMBFF muxers<a class="copiable-link" href="#MOV_002fMPEG_002d4_002fISOMBFF-muxers"> &para;</a></span></h3>
  2354. <p>This section covers formats belonging to the QuickTime / MOV family,
  2355. including the MPEG-4 Part 14 format and ISO base media file format
  2356. (ISOBMFF). These formats share a common structure based on the ISO
  2357. base media file format (ISOBMFF).
  2358. </p>
  2359. <p>The MOV format was originally developed for use with Apple QuickTime.
  2360. It was later used as the basis for the MPEG-4 Part 1 (later Part 14)
  2361. format, also known as ISO/IEC 14496-1. That format was then
  2362. generalized into ISOBMFF, also named MPEG-4 Part 12 format, ISO/IEC
  2363. 14496-12, or ISO/IEC 15444-12.
  2364. </p>
  2365. <p>It comprises the following muxers.
  2366. </p>
  2367. <dl class="table">
  2368. <dt>&lsquo;<samp class="samp">3gp</samp>&rsquo;</dt>
  2369. <dd><p>Third Generation Partnership Project (3GPP) format for 3G UMTS
  2370. multimedia services
  2371. </p>
  2372. </dd>
  2373. <dt>&lsquo;<samp class="samp">3g2</samp>&rsquo;</dt>
  2374. <dd><p>Third Generation Partnership Project 2 (3GP2 or 3GPP2) format for 3G
  2375. CDMA2000 multimedia services, similar to &lsquo;<samp class="samp">3gp</samp>&rsquo; with extensions
  2376. and limitations
  2377. </p>
  2378. </dd>
  2379. <dt>&lsquo;<samp class="samp">f4v</samp>&rsquo;</dt>
  2380. <dd><p>Adobe Flash Video format
  2381. </p>
  2382. </dd>
  2383. <dt>&lsquo;<samp class="samp">ipod</samp>&rsquo;</dt>
  2384. <dd><p>MPEG-4 audio file format, as MOV/MP4 but limited to contain only audio
  2385. streams, typically played with the Apple ipod device
  2386. </p>
  2387. </dd>
  2388. <dt>&lsquo;<samp class="samp">ismv</samp>&rsquo;</dt>
  2389. <dd><p>Microsoft IIS (Internet Information Services) Smooth Streaming
  2390. Audio/Video (ISMV or ISMA) format. This is based on MPEG-4 Part 14
  2391. format with a few incompatible variants, used to stream media files
  2392. for the Microsoft IIS server.
  2393. </p>
  2394. </dd>
  2395. <dt>&lsquo;<samp class="samp">mov</samp>&rsquo;</dt>
  2396. <dd><p>QuickTime player format identified by the <code class="code">.mov</code> extension
  2397. </p>
  2398. </dd>
  2399. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  2400. <dd><p>MP4 or MPEG-4 Part 14 format
  2401. </p>
  2402. </dd>
  2403. <dt>&lsquo;<samp class="samp">psp</samp>&rsquo;</dt>
  2404. <dd><p>PlayStation Portable MP4/MPEG-4 Part 14 format variant. This is based
  2405. on MPEG-4 Part 14 format with a few incompatible variants, used to
  2406. play files on PlayStation devices.
  2407. </p></dd>
  2408. </dl>
  2409. <ul class="mini-toc">
  2410. <li><a href="#Fragmentation" accesskey="1">Fragmentation</a></li>
  2411. <li><a href="#Options-6" accesskey="2">Options</a></li>
  2412. <li><a href="#Examples-4" accesskey="3">Examples</a></li>
  2413. </ul>
  2414. <div class="subsection-level-extent" id="Fragmentation">
  2415. <h4 class="subsection"><span>4.4.1 Fragmentation<a class="copiable-link" href="#Fragmentation"> &para;</a></span></h4>
  2416. <p>The &lsquo;<samp class="samp">mov</samp>&rsquo;, &lsquo;<samp class="samp">mp4</samp>&rsquo;, and &lsquo;<samp class="samp">ismv</samp>&rsquo; muxers support
  2417. fragmentation. Normally, a MOV/MP4 file has all the metadata about all
  2418. packets stored in one location.
  2419. </p>
  2420. <p>This data is usually written at the end of the file, but it can be
  2421. moved to the start for better playback by adding <code class="code">+faststart</code> to
  2422. the <code class="code">-movflags</code>, or using the <code class="command">qt-faststart</code> tool).
  2423. </p>
  2424. <p>A fragmented file consists of a number of fragments, where packets and
  2425. metadata about these packets are stored together. Writing a fragmented
  2426. file has the advantage that the file is decodable even if the writing
  2427. is interrupted (while a normal MOV/MP4 is undecodable if it is not
  2428. properly finished), and it requires less memory when writing very long
  2429. files (since writing normal MOV/MP4 files stores info about every
  2430. single packet in memory until the file is closed). The downside is
  2431. that it is less compatible with other applications.
  2432. </p>
  2433. <p>Fragmentation is enabled by setting one of the options that define
  2434. how to cut the file into fragments:
  2435. </p><dl class="table">
  2436. <dt><samp class="option">frag_duration</samp></dt>
  2437. <dt><samp class="option">frag_size</samp></dt>
  2438. <dt><samp class="option">min_frag_duration</samp></dt>
  2439. <dt><samp class="option">movflags +frag_keyframe</samp></dt>
  2440. <dt><samp class="option">movflags +frag_custom</samp></dt>
  2441. </dl>
  2442. <p>If more than one condition is specified, fragments are cut when one of
  2443. the specified conditions is fulfilled. The exception to this is the
  2444. option <samp class="option">min_frag_duration</samp>, which has to be fulfilled for any
  2445. of the other conditions to apply.
  2446. </p>
  2447. </div>
  2448. <div class="subsection-level-extent" id="Options-6">
  2449. <h4 class="subsection"><span>4.4.2 Options<a class="copiable-link" href="#Options-6"> &para;</a></span></h4>
  2450. <dl class="table">
  2451. <dt><samp class="option">brand <var class="var">brand_string</var></samp></dt>
  2452. <dd><p>Override major brand.
  2453. </p>
  2454. </dd>
  2455. <dt><samp class="option">empty_hdlr_name <var class="var">bool</var></samp></dt>
  2456. <dd><p>Enable to skip writing the name inside a <code class="code">hdlr</code> box.
  2457. Default is <code class="code">false</code>.
  2458. </p>
  2459. </dd>
  2460. <dt><samp class="option">encryption_key <var class="var">key</var></samp></dt>
  2461. <dd><p>set the media encryption key in hexadecimal format
  2462. </p>
  2463. </dd>
  2464. <dt><samp class="option">encryption_kid <var class="var">kid</var></samp></dt>
  2465. <dd><p>set the media encryption key identifier in hexadecimal format
  2466. </p>
  2467. </dd>
  2468. <dt><samp class="option">encryption_scheme <var class="var">scheme</var></samp></dt>
  2469. <dd><p>configure the encryption scheme, allowed values are &lsquo;<samp class="samp">none</samp>&rsquo;, and
  2470. &lsquo;<samp class="samp">cenc-aes-ctr</samp>&rsquo;
  2471. </p>
  2472. </dd>
  2473. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  2474. <dd><p>Create fragments that are <var class="var">duration</var> microseconds long.
  2475. </p>
  2476. </dd>
  2477. <dt><samp class="option">frag_interleave <var class="var">number</var></samp></dt>
  2478. <dd><p>Interleave samples within fragments (max number of consecutive
  2479. samples, lower is tighter interleaving, but with more overhead. It is
  2480. set to <code class="code">0</code> by default.
  2481. </p>
  2482. </dd>
  2483. <dt><samp class="option">frag_size <var class="var">size</var></samp></dt>
  2484. <dd><p>create fragments that contain up to <var class="var">size</var> bytes of payload data
  2485. </p>
  2486. </dd>
  2487. <dt><samp class="option">iods_audio_profile <var class="var">profile</var></samp></dt>
  2488. <dd><p>specify iods number for the audio profile atom (from -1 to 255),
  2489. default is <code class="code">-1</code>
  2490. </p>
  2491. </dd>
  2492. <dt><samp class="option">iods_video_profile <var class="var">profile</var></samp></dt>
  2493. <dd><p>specify iods number for the video profile atom (from -1 to 255),
  2494. default is <code class="code">-1</code>
  2495. </p>
  2496. </dd>
  2497. <dt><samp class="option">ism_lookahead <var class="var">num_entries</var></samp></dt>
  2498. <dd><p>specify number of lookahead entries for ISM files (from 0 to 255),
  2499. default is <code class="code">0</code>
  2500. </p>
  2501. </dd>
  2502. <dt><samp class="option">min_frag_duration <var class="var">duration</var></samp></dt>
  2503. <dd><p>do not create fragments that are shorter than <var class="var">duration</var> microseconds long
  2504. </p>
  2505. </dd>
  2506. <dt><samp class="option">moov_size <var class="var">bytes</var></samp></dt>
  2507. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  2508. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  2509. </p>
  2510. </dd>
  2511. <dt><samp class="option">mov_gamma <var class="var">gamma</var></samp></dt>
  2512. <dd><p>specify gamma value for gama atom (as a decimal number from 0 to 10),
  2513. default is <code class="code">0.0</code>, must be set together with <code class="code">+ movflags</code>
  2514. </p>
  2515. </dd>
  2516. <dt><samp class="option">movflags <var class="var">flags</var></samp></dt>
  2517. <dd><p>Set various muxing switches. The following flags can be used:
  2518. </p><dl class="table">
  2519. <dt>&lsquo;<samp class="samp">cmaf</samp>&rsquo;</dt>
  2520. <dd><p>write CMAF (Common Media Application Format) compatible fragmented
  2521. MP4 output
  2522. </p>
  2523. </dd>
  2524. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  2525. <dd><p>write DASH (Dynamic Adaptive Streaming over HTTP) compatible fragmented
  2526. MP4 output
  2527. </p>
  2528. </dd>
  2529. <dt>&lsquo;<samp class="samp">default_base_moof</samp>&rsquo;</dt>
  2530. <dd><p>Similarly to the &lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo; flag, this flag avoids
  2531. writing the absolute base_data_offset field in tfhd atoms, but does so
  2532. by using the new default-base-is-moof flag instead. This flag is new
  2533. from 14496-12:2012. This may make the fragments easier to parse in
  2534. certain circumstances (avoiding basing track fragment location
  2535. calculations on the implicit end of the previous track fragment).
  2536. </p>
  2537. </dd>
  2538. <dt>&lsquo;<samp class="samp">delay_moov</samp>&rsquo;</dt>
  2539. <dd><p>delay writing the initial moov until the first fragment is cut, or
  2540. until the first fragment flush
  2541. </p>
  2542. </dd>
  2543. <dt>&lsquo;<samp class="samp">disable_chpl</samp>&rsquo;</dt>
  2544. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  2545. and a QuickTime chapter track are written to the file. With this
  2546. option set, only the QuickTime chapter track will be written. Nero
  2547. chapters can cause failures when the file is reprocessed with certain
  2548. tagging programs, like mp3Tag 2.61a and iTunes 11.3, most likely other
  2549. versions are affected as well.
  2550. </p>
  2551. </dd>
  2552. <dt>&lsquo;<samp class="samp">faststart</samp>&rsquo;</dt>
  2553. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the
  2554. file. This operation can take a while, and will not work in various
  2555. situations such as fragmented output, thus it is not enabled by
  2556. default.
  2557. </p>
  2558. </dd>
  2559. <dt>&lsquo;<samp class="samp">frag_custom</samp>&rsquo;</dt>
  2560. <dd><p>Allow the caller to manually choose when to cut fragments, by calling
  2561. <code class="code">av_write_frame(ctx, NULL)</code> to write a fragment with the packets
  2562. written so far. (This is only useful with other applications
  2563. integrating libavformat, not from <code class="command">ffmpeg</code>.)
  2564. </p>
  2565. </dd>
  2566. <dt>&lsquo;<samp class="samp">frag_discont</samp>&rsquo;</dt>
  2567. <dd><p>signal that the next fragment is discontinuous from earlier ones
  2568. </p>
  2569. </dd>
  2570. <dt>&lsquo;<samp class="samp">frag_every_frame</samp>&rsquo;</dt>
  2571. <dd><p>fragment at every frame
  2572. </p>
  2573. </dd>
  2574. <dt>&lsquo;<samp class="samp">frag_keyframe</samp>&rsquo;</dt>
  2575. <dd><p>start a new fragment at each video keyframe
  2576. </p>
  2577. </dd>
  2578. <dt>&lsquo;<samp class="samp">global_sidx</samp>&rsquo;</dt>
  2579. <dd><p>write a global sidx index at the start of the file
  2580. </p>
  2581. </dd>
  2582. <dt>&lsquo;<samp class="samp">isml</samp>&rsquo;</dt>
  2583. <dd><p>create a live smooth streaming feed (for pushing to a publishing point)
  2584. </p>
  2585. </dd>
  2586. <dt>&lsquo;<samp class="samp">negative_cts_offsets</samp>&rsquo;</dt>
  2587. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  2588. be negative. This enables the initial sample to have DTS/CTS of zero, and
  2589. reduces the need for edit lists for some cases such as video tracks with
  2590. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  2591. guidelines.
  2592. </p>
  2593. <p>This option is implicitly set when writing &lsquo;<samp class="samp">ismv</samp>&rsquo; (Smooth
  2594. Streaming) files.
  2595. </p>
  2596. </dd>
  2597. <dt>&lsquo;<samp class="samp">omit_tfhd_offset</samp>&rsquo;</dt>
  2598. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  2599. tying fragments to absolute byte positions in the file/streams.
  2600. </p>
  2601. </dd>
  2602. <dt>&lsquo;<samp class="samp">prefer_icc</samp>&rsquo;</dt>
  2603. <dd><p>If writing colr atom prioritise usage of ICC profile if it exists in
  2604. stream packet side data.
  2605. </p>
  2606. </dd>
  2607. <dt>&lsquo;<samp class="samp">rtphint</samp>&rsquo;</dt>
  2608. <dd><p>add RTP hinting tracks to the output file
  2609. </p>
  2610. </dd>
  2611. <dt>&lsquo;<samp class="samp">separate_moof</samp>&rsquo;</dt>
  2612. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  2613. packets for all tracks are written in a moof atom (which is slightly
  2614. more efficient), but with this option set, the muxer writes one
  2615. moof/mdat pair for each track, making it easier to separate tracks.
  2616. </p>
  2617. </dd>
  2618. <dt>&lsquo;<samp class="samp">skip_sidx</samp>&rsquo;</dt>
  2619. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is
  2620. high, this option could be used for cases where sidx atom is not
  2621. mandatory. When the &lsquo;<samp class="samp">global_sidx</samp>&rsquo; flag is enabled, this option
  2622. is ignored.
  2623. </p>
  2624. </dd>
  2625. <dt>&lsquo;<samp class="samp">skip_trailer</samp>&rsquo;</dt>
  2626. <dd><p>skip writing the mfra/tfra/mfro trailer for fragmented files
  2627. </p>
  2628. </dd>
  2629. <dt>&lsquo;<samp class="samp">use_metadata_tags</samp>&rsquo;</dt>
  2630. <dd><p>use mdta atom for metadata
  2631. </p>
  2632. </dd>
  2633. <dt>&lsquo;<samp class="samp">write_colr</samp>&rsquo;</dt>
  2634. <dd><p>write colr atom even if the color info is unspecified. This flag is
  2635. experimental, may be renamed or changed, do not use from scripts.
  2636. </p>
  2637. </dd>
  2638. <dt>&lsquo;<samp class="samp">write_gama</samp>&rsquo;</dt>
  2639. <dd><p>write deprecated gama atom
  2640. </p></dd>
  2641. </dl>
  2642. </dd>
  2643. <dt><samp class="option">movie_timescale <var class="var">scale</var></samp></dt>
  2644. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  2645. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  2646. </p>
  2647. </dd>
  2648. <dt><samp class="option">rtpflags <var class="var">flags</var></samp></dt>
  2649. <dd><p>Add RTP hinting tracks to the output file.
  2650. </p>
  2651. <p>The following flags can be used:
  2652. </p><dl class="table">
  2653. <dt>&lsquo;<samp class="samp">h264_mode0</samp>&rsquo;</dt>
  2654. <dd><p>use mode 0 for H.264 in RTP
  2655. </p>
  2656. </dd>
  2657. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  2658. <dd><p>use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC
  2659. </p>
  2660. </dd>
  2661. <dt>&lsquo;<samp class="samp">rfc2190</samp>&rsquo;</dt>
  2662. <dd><p>use RFC 2190 packetization instead of RFC 4629 for H.263
  2663. </p>
  2664. </dd>
  2665. <dt>&lsquo;<samp class="samp">send_bye</samp>&rsquo;</dt>
  2666. <dd><p>send RTCP BYE packets when finishing
  2667. </p>
  2668. </dd>
  2669. <dt>&lsquo;<samp class="samp">skip_rtcp</samp>&rsquo;</dt>
  2670. <dd><p>do not send RTCP sender reports
  2671. </p></dd>
  2672. </dl>
  2673. </dd>
  2674. <dt><samp class="option">skip_iods <var class="var">bool</var></samp></dt>
  2675. <dd><p>skip writing iods atom (default value is <code class="code">true</code>)
  2676. </p>
  2677. </dd>
  2678. <dt><samp class="option">use_editlist <var class="var">bool</var></samp></dt>
  2679. <dd><p>use edit list (default value is <code class="code">auto</code>)
  2680. </p>
  2681. </dd>
  2682. <dt><samp class="option">use_stream_ids_as_track_ids <var class="var">bool</var></samp></dt>
  2683. <dd><p>use stream ids as track ids (default value is <code class="code">false</code>)
  2684. </p>
  2685. </dd>
  2686. <dt><samp class="option">video_track_timescale <var class="var">scale</var></samp></dt>
  2687. <dd><p>Set the timescale used for video tracks. Range is <code class="code">0</code> to INT_MAX. If
  2688. set to <code class="code">0</code>, the timescale is automatically set based on the
  2689. native stream time base. Default is <code class="code">0</code>.
  2690. </p>
  2691. </dd>
  2692. <dt><samp class="option">write_btrt <var class="var">bool</var></samp></dt>
  2693. <dd><p>Force or disable writing bitrate box inside stsd box of a track. The
  2694. box contains decoding buffer size (in bytes), maximum bitrate and
  2695. average bitrate for the track. The box will be skipped if none of
  2696. these values can be computed. Default is <code class="code">-1</code> or <code class="code">auto</code>,
  2697. which will write the box only in MP4 mode.
  2698. </p>
  2699. </dd>
  2700. <dt><samp class="option">write_prft <var class="var">option</var></samp></dt>
  2701. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  2702. NTP field in the PRFT box. Set value as &lsquo;<samp class="samp">wallclock</samp>&rsquo; to specify timesource
  2703. as wallclock time and &lsquo;<samp class="samp">pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  2704. values.
  2705. </p>
  2706. </dd>
  2707. <dt><samp class="option">write_tmcd <var class="var">bool</var></samp></dt>
  2708. <dd><p>Specify <code class="code">on</code> to force writing a timecode track, <code class="code">off</code> to disable it
  2709. and <code class="code">auto</code> to write a timecode track only for mov and mp4 output (default).
  2710. </p>
  2711. <p>Setting value to &lsquo;<samp class="samp">pts</samp>&rsquo; is applicable only for a live encoding use case,
  2712. where PTS values are set as as wallclock time at the source. For example, an
  2713. encoding use case with decklink capture source where <samp class="option">video_pts</samp> and
  2714. <samp class="option">audio_pts</samp> are set to &lsquo;<samp class="samp">abs_wallclock</samp>&rsquo;.
  2715. </p></dd>
  2716. </dl>
  2717. </div>
  2718. <div class="subsection-level-extent" id="Examples-4">
  2719. <h4 class="subsection"><span>4.4.3 Examples<a class="copiable-link" href="#Examples-4"> &para;</a></span></h4>
  2720. <ul class="itemize mark-bullet">
  2721. <li>Push Smooth Streaming content in real time to a publishing point on
  2722. IIS with the &lsquo;<samp class="samp">ismv</samp>&rsquo; muxer using <code class="command">ffmpeg</code>:
  2723. <div class="example">
  2724. <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)
  2725. </pre></div>
  2726. </li></ul>
  2727. <a class="anchor" id="a64"></a></div>
  2728. </div>
  2729. <div class="section-level-extent" id="a64-1">
  2730. <h3 class="section"><span>4.5 a64<a class="copiable-link" href="#a64-1"> &para;</a></span></h3>
  2731. <p>A64 Commodore 64 video muxer.
  2732. </p>
  2733. <p>This muxer accepts a single <code class="code">a64_multi</code> or <code class="code">a64_multi5</code>
  2734. codec video stream.
  2735. </p>
  2736. </div>
  2737. <div class="section-level-extent" id="ac4">
  2738. <h3 class="section"><span>4.6 ac4<a class="copiable-link" href="#ac4"> &para;</a></span></h3>
  2739. <p>Raw AC-4 audio muxer.
  2740. </p>
  2741. <p>This muxer accepts a single <code class="code">ac4</code> audio stream.
  2742. </p>
  2743. <ul class="mini-toc">
  2744. <li><a href="#Options-7" accesskey="1">Options</a></li>
  2745. </ul>
  2746. <div class="subsection-level-extent" id="Options-7">
  2747. <h4 class="subsection"><span>4.6.1 Options<a class="copiable-link" href="#Options-7"> &para;</a></span></h4>
  2748. <dl class="table">
  2749. <dt><samp class="option">write_crc <var class="var">bool</var></samp></dt>
  2750. <dd><p>when enabled, write a CRC checksum for each packet to the output,
  2751. default is <code class="code">false</code>
  2752. </p></dd>
  2753. </dl>
  2754. <a class="anchor" id="adts"></a></div>
  2755. </div>
  2756. <div class="section-level-extent" id="adts-1">
  2757. <h3 class="section"><span>4.7 adts<a class="copiable-link" href="#adts-1"> &para;</a></span></h3>
  2758. <p>Audio Data Transport Stream muxer.
  2759. </p>
  2760. <p>It accepts a single AAC stream.
  2761. </p>
  2762. <ul class="mini-toc">
  2763. <li><a href="#Options-8" accesskey="1">Options</a></li>
  2764. </ul>
  2765. <div class="subsection-level-extent" id="Options-8">
  2766. <h4 class="subsection"><span>4.7.1 Options<a class="copiable-link" href="#Options-8"> &para;</a></span></h4>
  2767. <dl class="table">
  2768. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  2769. <dd><p>Enable to write ID3v2.4 tags at the start of the stream. Default is
  2770. disabled.
  2771. </p>
  2772. </dd>
  2773. <dt><samp class="option">write_apetag <var class="var">bool</var></samp></dt>
  2774. <dd><p>Enable to write APE tags at the end of the stream. Default is
  2775. disabled.
  2776. </p>
  2777. </dd>
  2778. <dt><samp class="option">write_mpeg2 <var class="var">bool</var></samp></dt>
  2779. <dd><p>Enable to set MPEG version bit in the ADTS frame header to 1 which
  2780. indicates MPEG-2. Default is 0, which indicates MPEG-4.
  2781. </p></dd>
  2782. </dl>
  2783. <a class="anchor" id="aea"></a></div>
  2784. </div>
  2785. <div class="section-level-extent" id="aea-1">
  2786. <h3 class="section"><span>4.8 aea<a class="copiable-link" href="#aea-1"> &para;</a></span></h3>
  2787. <p>MD STUDIO audio muxer.
  2788. </p>
  2789. <p>This muxer accepts a single ATRAC1 audio stream with either one or two channels
  2790. and a sample rate of 44100Hz.
  2791. </p>
  2792. <p>As AEA supports storing the track title, this muxer will also write
  2793. the title from stream&rsquo;s metadata to the container.
  2794. </p>
  2795. <a class="anchor" id="aiff"></a></div>
  2796. <div class="section-level-extent" id="aiff-1">
  2797. <h3 class="section"><span>4.9 aiff<a class="copiable-link" href="#aiff-1"> &para;</a></span></h3>
  2798. <p>Audio Interchange File Format muxer.
  2799. </p>
  2800. <ul class="mini-toc">
  2801. <li><a href="#Options-9" accesskey="1">Options</a></li>
  2802. </ul>
  2803. <div class="subsection-level-extent" id="Options-9">
  2804. <h4 class="subsection"><span>4.9.1 Options<a class="copiable-link" href="#Options-9"> &para;</a></span></h4>
  2805. <dl class="table">
  2806. <dt><samp class="option">write_id3v2 <var class="var">bool</var></samp></dt>
  2807. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  2808. </p>
  2809. </dd>
  2810. <dt><samp class="option">id3v2_version <var class="var">bool</var></samp></dt>
  2811. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  2812. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  2813. </p></dd>
  2814. </dl>
  2815. <a class="anchor" id="alp"></a></div>
  2816. </div>
  2817. <div class="section-level-extent" id="alp-1">
  2818. <h3 class="section"><span>4.10 alp<a class="copiable-link" href="#alp-1"> &para;</a></span></h3>
  2819. <p>High Voltage Software&rsquo;s Lego Racers game audio muxer.
  2820. </p>
  2821. <p>It accepts a single ADPCM_IMA_ALP stream with no more than 2 channels
  2822. and a sample rate not greater than 44100 Hz.
  2823. </p>
  2824. <p>Extensions: <code class="code">tun</code>, <code class="code">pcm</code>
  2825. </p>
  2826. <ul class="mini-toc">
  2827. <li><a href="#Options-10" accesskey="1">Options</a></li>
  2828. </ul>
  2829. <div class="subsection-level-extent" id="Options-10">
  2830. <h4 class="subsection"><span>4.10.1 Options<a class="copiable-link" href="#Options-10"> &para;</a></span></h4>
  2831. <dl class="table">
  2832. <dt><samp class="option">type <var class="var">type</var></samp></dt>
  2833. <dd><p>Set file type.
  2834. </p>
  2835. <p><var class="var">type</var> accepts the following values:
  2836. </p><dl class="table">
  2837. <dt>&lsquo;<samp class="samp">tun</samp>&rsquo;</dt>
  2838. <dd><p>Set file type as music. Must have a sample rate of 22050 Hz.
  2839. </p>
  2840. </dd>
  2841. <dt>&lsquo;<samp class="samp">pcm</samp>&rsquo;</dt>
  2842. <dd><p>Set file type as sfx.
  2843. </p>
  2844. </dd>
  2845. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  2846. <dd><p>Set file type as per output file extension. <code class="code">.pcm</code> results in
  2847. type <code class="code">pcm</code> else type <code class="code">tun</code> is set. <var class="var">(default)</var>
  2848. </p></dd>
  2849. </dl>
  2850. </dd>
  2851. </dl>
  2852. </div>
  2853. </div>
  2854. <div class="section-level-extent" id="amr">
  2855. <h3 class="section"><span>4.11 amr<a class="copiable-link" href="#amr"> &para;</a></span></h3>
  2856. <p>3GPP AMR (Adaptive Multi-Rate) audio muxer.
  2857. </p>
  2858. <p>It accepts a single audio stream containing an AMR NB stream.
  2859. </p>
  2860. </div>
  2861. <div class="section-level-extent" id="amv">
  2862. <h3 class="section"><span>4.12 amv<a class="copiable-link" href="#amv"> &para;</a></span></h3>
  2863. <p>AMV (Actions Media Video) format muxer.
  2864. </p>
  2865. </div>
  2866. <div class="section-level-extent" id="apm">
  2867. <h3 class="section"><span>4.13 apm<a class="copiable-link" href="#apm"> &para;</a></span></h3>
  2868. <p>Ubisoft Rayman 2 APM audio muxer.
  2869. </p>
  2870. <p>It accepts a single ADPCM IMA APM audio stream.
  2871. </p>
  2872. </div>
  2873. <div class="section-level-extent" id="apng-1">
  2874. <h3 class="section"><span>4.14 apng<a class="copiable-link" href="#apng-1"> &para;</a></span></h3>
  2875. <p>Animated Portable Network Graphics muxer.
  2876. </p>
  2877. <p>It accepts a single APNG video stream.
  2878. </p>
  2879. <ul class="mini-toc">
  2880. <li><a href="#Options-11" accesskey="1">Options</a></li>
  2881. <li><a href="#Examples-5" accesskey="2">Examples</a></li>
  2882. </ul>
  2883. <div class="subsection-level-extent" id="Options-11">
  2884. <h4 class="subsection"><span>4.14.1 Options<a class="copiable-link" href="#Options-11"> &para;</a></span></h4>
  2885. <dl class="table">
  2886. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  2887. <dd><p>Force a delay expressed in seconds after the last frame of each
  2888. repetition. Default value is <code class="code">0.0</code>.
  2889. </p>
  2890. </dd>
  2891. <dt><samp class="option">plays <var class="var">repetitions</var></samp></dt>
  2892. <dd><p>specify how many times to play the content, <code class="code">0</code> causes an infinte
  2893. loop, with <code class="code">1</code> there is no loop
  2894. </p></dd>
  2895. </dl>
  2896. </div>
  2897. <div class="subsection-level-extent" id="Examples-5">
  2898. <h4 class="subsection"><span>4.14.2 Examples<a class="copiable-link" href="#Examples-5"> &para;</a></span></h4>
  2899. <ul class="itemize mark-bullet">
  2900. <li>Use <code class="command">ffmpeg</code> to generate an APNG output with 2 repetitions,
  2901. and with a delay of half a second after the first repetition:
  2902. <div class="example">
  2903. <pre class="example-preformatted">ffmpeg -i INPUT -final_delay 0.5 -plays 2 out.apng
  2904. </pre></div>
  2905. </li></ul>
  2906. </div>
  2907. </div>
  2908. <div class="section-level-extent" id="argo_005fasf">
  2909. <h3 class="section"><span>4.15 argo_asf<a class="copiable-link" href="#argo_005fasf"> &para;</a></span></h3>
  2910. <p>Argonaut Games ASF audio muxer.
  2911. </p>
  2912. <p>It accepts a single ADPCM audio stream.
  2913. </p>
  2914. <ul class="mini-toc">
  2915. <li><a href="#Options-12" accesskey="1">Options</a></li>
  2916. </ul>
  2917. <div class="subsection-level-extent" id="Options-12">
  2918. <h4 class="subsection"><span>4.15.1 Options<a class="copiable-link" href="#Options-12"> &para;</a></span></h4>
  2919. <dl class="table">
  2920. <dt><samp class="option">version_major <var class="var">version</var></samp></dt>
  2921. <dd><p>override file major version, specified as an integer, default value is
  2922. <code class="code">2</code>
  2923. </p>
  2924. </dd>
  2925. <dt><samp class="option">version_minor <var class="var">version</var></samp></dt>
  2926. <dd><p>override file minor version, specified as an integer, default value is
  2927. <code class="code">1</code>
  2928. </p>
  2929. </dd>
  2930. <dt><samp class="option">name <var class="var">name</var></samp></dt>
  2931. <dd><p>Embed file name into file, if not specified use the output file
  2932. name. The name is truncated to 8 characters.
  2933. </p></dd>
  2934. </dl>
  2935. </div>
  2936. </div>
  2937. <div class="section-level-extent" id="argo_005fcvg">
  2938. <h3 class="section"><span>4.16 argo_cvg<a class="copiable-link" href="#argo_005fcvg"> &para;</a></span></h3>
  2939. <p>Argonaut Games CVG audio muxer.
  2940. </p>
  2941. <p>It accepts a single one-channel ADPCM 22050Hz audio stream.
  2942. </p>
  2943. <p>The <samp class="option">loop</samp> and <samp class="option">reverb</samp> options set the corresponding
  2944. flags in the header which can be later retrieved to process the audio
  2945. stream accordingly.
  2946. </p>
  2947. <ul class="mini-toc">
  2948. <li><a href="#Options-13" accesskey="1">Options</a></li>
  2949. </ul>
  2950. <div class="subsection-level-extent" id="Options-13">
  2951. <h4 class="subsection"><span>4.16.1 Options<a class="copiable-link" href="#Options-13"> &para;</a></span></h4>
  2952. <dl class="table">
  2953. <dt><samp class="option">skip_rate_check <var class="var">bool</var></samp></dt>
  2954. <dd><p>skip sample rate check (default is <code class="code">false</code>)
  2955. </p>
  2956. </dd>
  2957. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  2958. <dd><p>set loop flag (default is <code class="code">false</code>)
  2959. </p>
  2960. </dd>
  2961. <dt><samp class="option">reverb <var class="var">boolean</var></samp></dt>
  2962. <dd><p>set reverb flag (default is <code class="code">true</code>)
  2963. </p></dd>
  2964. </dl>
  2965. <a class="anchor" id="asf"></a></div>
  2966. </div>
  2967. <div class="section-level-extent" id="asf_002c-asf_005fstream">
  2968. <h3 class="section"><span>4.17 asf, asf_stream<a class="copiable-link" href="#asf_002c-asf_005fstream"> &para;</a></span></h3>
  2969. <p>Advanced / Active Systems (or Streaming) Format audio muxer.
  2970. </p>
  2971. <p>The &lsquo;<samp class="samp">asf_stream</samp>&rsquo; variant should be selected for streaming.
  2972. </p>
  2973. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  2974. muxer too.
  2975. </p>
  2976. <ul class="mini-toc">
  2977. <li><a href="#Options-14" accesskey="1">Options</a></li>
  2978. </ul>
  2979. <div class="subsection-level-extent" id="Options-14">
  2980. <h4 class="subsection"><span>4.17.1 Options<a class="copiable-link" href="#Options-14"> &para;</a></span></h4>
  2981. <dl class="table">
  2982. <dt><samp class="option">packet_size <var class="var">size</var></samp></dt>
  2983. <dd><p>Set the muxer packet size as a number of bytes. By tuning this setting
  2984. you may reduce data fragmentation or muxer overhead depending on your
  2985. source. Default value is <code class="code">3200</code>, minimum is <code class="code">100</code>, maximum
  2986. is <code class="code">64Ki</code>.
  2987. </p></dd>
  2988. </dl>
  2989. </div>
  2990. </div>
  2991. <div class="section-level-extent" id="ass">
  2992. <h3 class="section"><span>4.18 ass<a class="copiable-link" href="#ass"> &para;</a></span></h3>
  2993. <p>ASS/SSA (SubStation Alpha) subtitles muxer.
  2994. </p>
  2995. <p>It accepts a single ASS subtitles stream.
  2996. </p>
  2997. <ul class="mini-toc">
  2998. <li><a href="#Options-15" accesskey="1">Options</a></li>
  2999. </ul>
  3000. <div class="subsection-level-extent" id="Options-15">
  3001. <h4 class="subsection"><span>4.18.1 Options<a class="copiable-link" href="#Options-15"> &para;</a></span></h4>
  3002. <dl class="table">
  3003. <dt><samp class="option">ignore_readorder <var class="var">bool</var></samp></dt>
  3004. <dd><p>Write dialogue events immediately, even if they are out-of-order,
  3005. default is <code class="code">false</code>, otherwise they are cached until the expected
  3006. time event is found.
  3007. </p></dd>
  3008. </dl>
  3009. </div>
  3010. </div>
  3011. <div class="section-level-extent" id="ast">
  3012. <h3 class="section"><span>4.19 ast<a class="copiable-link" href="#ast"> &para;</a></span></h3>
  3013. <p>AST (Audio Stream) muxer.
  3014. </p>
  3015. <p>This format is used to play audio on some Nintendo Wii games.
  3016. </p>
  3017. <p>It accepts a single audio stream.
  3018. </p>
  3019. <p>The <samp class="option">loopstart</samp> and <samp class="option">loopend</samp> options can be used to
  3020. define a section of the file to loop for players honoring such
  3021. options.
  3022. </p>
  3023. <ul class="mini-toc">
  3024. <li><a href="#Options-16" accesskey="1">Options</a></li>
  3025. </ul>
  3026. <div class="subsection-level-extent" id="Options-16">
  3027. <h4 class="subsection"><span>4.19.1 Options<a class="copiable-link" href="#Options-16"> &para;</a></span></h4>
  3028. <dl class="table">
  3029. <dt><samp class="option">loopstart <var class="var">start</var></samp></dt>
  3030. <dd><p>Specify loop start position expressesd in milliseconds, from <code class="code">-1</code>
  3031. to <code class="code">INT_MAX</code>, in case <code class="code">-1</code> is set then no loop is specified
  3032. (default -1) and the <samp class="option">loopend</samp> value is ignored.
  3033. </p>
  3034. </dd>
  3035. <dt><samp class="option">loopend <var class="var">end</var></samp></dt>
  3036. <dd><p>Specify loop end position expressed in milliseconds, from <code class="code">0</code> to
  3037. <code class="code">INT_MAX</code>, default is <code class="code">0</code>, in case <code class="code">0</code> is set it
  3038. assumes the total stream duration.
  3039. </p></dd>
  3040. </dl>
  3041. </div>
  3042. </div>
  3043. <div class="section-level-extent" id="au">
  3044. <h3 class="section"><span>4.20 au<a class="copiable-link" href="#au"> &para;</a></span></h3>
  3045. <p>SUN AU audio muxer.
  3046. </p>
  3047. <p>It accepts a single audio stream.
  3048. </p>
  3049. <a class="anchor" id="avi"></a></div>
  3050. <div class="section-level-extent" id="avi-1">
  3051. <h3 class="section"><span>4.21 avi<a class="copiable-link" href="#avi-1"> &para;</a></span></h3>
  3052. <p>Audio Video Interleaved muxer.
  3053. </p>
  3054. <p>AVI is a proprietary format developed by Microsoft, and later formally specified
  3055. through the Open DML specification.
  3056. </p>
  3057. <p>Because of differences in players implementations, it might be required to set
  3058. some options to make sure that the generated output can be correctly played by
  3059. the target player.
  3060. </p>
  3061. <ul class="mini-toc">
  3062. <li><a href="#Options-17" accesskey="1">Options</a></li>
  3063. </ul>
  3064. <div class="subsection-level-extent" id="Options-17">
  3065. <h4 class="subsection"><span>4.21.1 Options<a class="copiable-link" href="#Options-17"> &para;</a></span></h4>
  3066. <dl class="table">
  3067. <dt><samp class="option">flipped_raw_rgb <var class="var">bool</var></samp></dt>
  3068. <dd><p>If set to <code class="code">true</code>, store positive height for raw RGB bitmaps, which
  3069. indicates bitmap is stored bottom-up. Note that this option does not flip the
  3070. bitmap which has to be done manually beforehand, e.g. by using the &lsquo;<samp class="samp">vflip</samp>&rsquo;
  3071. filter. Default is <code class="code">false</code> and indicates bitmap is stored top down.
  3072. </p>
  3073. </dd>
  3074. <dt><samp class="option">reserve_index_space <var class="var">size</var></samp></dt>
  3075. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  3076. stream within the file header. By default additional master indexes are
  3077. embedded within the data packets if there is no space left in the first master
  3078. index and are linked together as a chain of indexes. This index structure can
  3079. cause problems for some use cases, e.g. third-party software strictly relying
  3080. on the OpenDML index specification or when file seeking is slow. Reserving
  3081. enough index space in the file header avoids these problems.
  3082. </p>
  3083. <p>The required index space depends on the output file size and should be about 16
  3084. bytes per gigabyte. When this option is omitted or set to zero the necessary
  3085. index space is guessed.
  3086. </p>
  3087. <p>Default value is <code class="code">0</code>.
  3088. </p>
  3089. </dd>
  3090. <dt><samp class="option">write_channel_mask <var class="var">bool</var></samp></dt>
  3091. <dd><p>Write the channel layout mask into the audio stream header.
  3092. </p>
  3093. <p>This option is enabled by default. Disabling the channel mask can be useful in
  3094. specific scenarios, e.g. when merging multiple audio streams into one for
  3095. compatibility with software that only supports a single audio stream in AVI
  3096. (see <a data-manual="ffmpeg-filters" href="ffmpeg-filters.html#amerge">the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  3097. </p></dd>
  3098. </dl>
  3099. </div>
  3100. </div>
  3101. <div class="section-level-extent" id="avif">
  3102. <h3 class="section"><span>4.22 avif<a class="copiable-link" href="#avif"> &para;</a></span></h3>
  3103. <p>AV1 (Alliance for Open Media Video codec 1) image format muxer.
  3104. </p>
  3105. <p>This muxers stores images encoded using the AV1 codec.
  3106. </p>
  3107. <p>It accepts one or two video streams. In case two video streams are
  3108. provided, the second one shall contain a single plane storing the
  3109. alpha mask.
  3110. </p>
  3111. <p>In case more than one image is provided, the generated output is
  3112. considered an animated AVIF and the number of loops can be specified
  3113. with the <samp class="option">loop</samp> option.
  3114. </p>
  3115. <p>This is based on the specification by Alliance for Open Media at url
  3116. <a class="url" href="https://aomediacodec.github.io/av1-avif">https://aomediacodec.github.io/av1-avif</a>.
  3117. </p>
  3118. <ul class="mini-toc">
  3119. <li><a href="#Options-18" accesskey="1">Options</a></li>
  3120. </ul>
  3121. <div class="subsection-level-extent" id="Options-18">
  3122. <h4 class="subsection"><span>4.22.1 Options<a class="copiable-link" href="#Options-18"> &para;</a></span></h4>
  3123. <dl class="table">
  3124. <dt><samp class="option">loop <var class="var">count</var></samp></dt>
  3125. <dd><p>number of times to loop an animated AVIF, <code class="code">0</code> specify an infinite
  3126. loop, default is <code class="code">0</code>
  3127. </p>
  3128. </dd>
  3129. <dt><samp class="option">movie_timescale <var class="var">timescale</var></samp></dt>
  3130. <dd><p>Set the timescale written in the movie header box (<code class="code">mvhd</code>).
  3131. Range is 1 to INT_MAX. Default is <code class="code">1000</code>.
  3132. </p></dd>
  3133. </dl>
  3134. </div>
  3135. </div>
  3136. <div class="section-level-extent" id="avm2">
  3137. <h3 class="section"><span>4.23 avm2<a class="copiable-link" href="#avm2"> &para;</a></span></h3>
  3138. <p>ShockWave Flash (SWF) / ActionScript Virtual Machine 2 (AVM2) format muxer.
  3139. </p>
  3140. <p>It accepts one audio stream, one video stream, or both.
  3141. </p>
  3142. </div>
  3143. <div class="section-level-extent" id="bit">
  3144. <h3 class="section"><span>4.24 bit<a class="copiable-link" href="#bit"> &para;</a></span></h3>
  3145. <p>G.729 (.bit) file format muxer.
  3146. </p>
  3147. <p>It accepts a single G.729 audio stream.
  3148. </p>
  3149. </div>
  3150. <div class="section-level-extent" id="caf">
  3151. <h3 class="section"><span>4.25 caf<a class="copiable-link" href="#caf"> &para;</a></span></h3>
  3152. <p>Apple CAF (Core Audio Format) muxer.
  3153. </p>
  3154. <p>It accepts a single audio stream.
  3155. </p>
  3156. </div>
  3157. <div class="section-level-extent" id="codec2">
  3158. <h3 class="section"><span>4.26 codec2<a class="copiable-link" href="#codec2"> &para;</a></span></h3>
  3159. <p>Codec2 audio audio muxer.
  3160. </p>
  3161. <p>It accepts a single codec2 audio stream.
  3162. </p>
  3163. <a class="anchor" id="chromaprint"></a></div>
  3164. <div class="section-level-extent" id="chromaprint-1">
  3165. <h3 class="section"><span>4.27 chromaprint<a class="copiable-link" href="#chromaprint-1"> &para;</a></span></h3>
  3166. <p>Chromaprint fingerprinter muxers.
  3167. </p>
  3168. <p>To enable compilation of this filter you need to configure FFmpeg with
  3169. <code class="code">--enable-chromaprint</code>.
  3170. </p>
  3171. <p>This muxer feeds audio data to the Chromaprint library, which
  3172. generates a fingerprint for the provided audio data. See:
  3173. <a class="url" href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  3174. </p>
  3175. <p>It takes a single signed native-endian 16-bit raw audio stream of at
  3176. most 2 channels.
  3177. </p>
  3178. <ul class="mini-toc">
  3179. <li><a href="#Options-19" accesskey="1">Options</a></li>
  3180. </ul>
  3181. <div class="subsection-level-extent" id="Options-19">
  3182. <h4 class="subsection"><span>4.27.1 Options<a class="copiable-link" href="#Options-19"> &para;</a></span></h4>
  3183. <dl class="table">
  3184. <dt><samp class="option">algorithm <var class="var">version</var></samp></dt>
  3185. <dd><p>Select version of algorithm to fingerprint with. Range is <code class="code">0</code> to
  3186. <code class="code">4</code>. Version <code class="code">3</code> enables silence detection. Default is <code class="code">1</code>.
  3187. </p>
  3188. </dd>
  3189. <dt><samp class="option">fp_format <var class="var">format</var></samp></dt>
  3190. <dd><p>Format to output the fingerprint as. Accepts the following options:
  3191. </p><dl class="table">
  3192. <dt>&lsquo;<samp class="samp">base64</samp>&rsquo;</dt>
  3193. <dd><p>Base64 compressed fingerprint <em class="emph">(default)</em>
  3194. </p>
  3195. </dd>
  3196. <dt>&lsquo;<samp class="samp">compressed</samp>&rsquo;</dt>
  3197. <dd><p>Binary compressed fingerprint
  3198. </p>
  3199. </dd>
  3200. <dt>&lsquo;<samp class="samp">raw</samp>&rsquo;</dt>
  3201. <dd><p>Binary raw fingerprint
  3202. </p></dd>
  3203. </dl>
  3204. </dd>
  3205. <dt><samp class="option">silence_threshold <var class="var">threshold</var></samp></dt>
  3206. <dd><p>Threshold for detecting silence. Range is from <code class="code">-1</code> to
  3207. <code class="code">32767</code>, where <code class="code">-1</code> disables silence detection. Silence
  3208. detection can only be used with version <code class="code">3</code> of the algorithm.
  3209. </p>
  3210. <p>Silence detection must be disabled for use with the AcoustID
  3211. service. Default is <code class="code">-1</code>.
  3212. </p></dd>
  3213. </dl>
  3214. <a class="anchor" id="crc"></a></div>
  3215. </div>
  3216. <div class="section-level-extent" id="crc-1">
  3217. <h3 class="section"><span>4.28 crc<a class="copiable-link" href="#crc-1"> &para;</a></span></h3>
  3218. <p>CRC (Cyclic Redundancy Check) muxer.
  3219. </p>
  3220. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  3221. and video frames. By default audio frames are converted to signed
  3222. 16-bit raw audio and video frames to raw video before computing the
  3223. CRC.
  3224. </p>
  3225. <p>The output of the muxer consists of a single line of the form:
  3226. CRC=0x<var class="var">CRC</var>, where <var class="var">CRC</var> is a hexadecimal number 0-padded to
  3227. 8 digits containing the CRC for all the decoded input frames.
  3228. </p>
  3229. <p>See also the <a class="ref" href="#framecrc">framecrc</a> muxer.
  3230. </p>
  3231. <ul class="mini-toc">
  3232. <li><a href="#Examples-6" accesskey="1">Examples</a></li>
  3233. </ul>
  3234. <div class="subsection-level-extent" id="Examples-6">
  3235. <h4 class="subsection"><span>4.28.1 Examples<a class="copiable-link" href="#Examples-6"> &para;</a></span></h4>
  3236. <ul class="itemize mark-bullet">
  3237. <li>Use <code class="command">ffmpeg</code> to compute the CRC of the input, and store it in
  3238. the file <samp class="file">out.crc</samp>:
  3239. <div class="example">
  3240. <pre class="example-preformatted">ffmpeg -i INPUT -f crc out.crc
  3241. </pre></div>
  3242. </li><li>Use <code class="command">ffmpeg</code> to print the CRC to stdout with the command:
  3243. <div class="example">
  3244. <pre class="example-preformatted">ffmpeg -i INPUT -f crc -
  3245. </pre></div>
  3246. </li><li>You can select the output format of each frame with <code class="command">ffmpeg</code> by
  3247. specifying the audio and video codec and format. For example, to
  3248. compute the CRC of the input audio converted to PCM unsigned 8-bit
  3249. and the input video converted to MPEG-2 video, use the command:
  3250. <div class="example">
  3251. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  3252. </pre></div>
  3253. </li></ul>
  3254. <a class="anchor" id="dash"></a></div>
  3255. </div>
  3256. <div class="section-level-extent" id="dash-2">
  3257. <h3 class="section"><span>4.29 dash<a class="copiable-link" href="#dash-2"> &para;</a></span></h3>
  3258. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer.
  3259. </p>
  3260. <p>This muxer creates segments and manifest files according to the
  3261. MPEG-DASH standard ISO/IEC 23009-1:2014 and following standard
  3262. updates.
  3263. </p>
  3264. <p>For more information see:
  3265. </p><ul class="itemize mark-bullet">
  3266. <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>
  3267. </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>
  3268. </li></ul>
  3269. <p>This muxer creates an MPD (Media Presentation Description) manifest
  3270. file and segment files for each stream. Segment files are placed in
  3271. the same directory of the MPD manifest file.
  3272. </p>
  3273. <p>The segment filename might contain pre-defined identifiers used in the
  3274. manifest <code class="code">SegmentTemplate</code> section as defined in section
  3275. 5.3.9.4.4 of the standard.
  3276. </p>
  3277. <p>Available identifiers are <code class="code">$RepresentationID$</code>, <code class="code">$Number$</code>,
  3278. <code class="code">$Bandwidth$</code>, and <code class="code">$Time$</code>. In addition to the standard
  3279. identifiers, an ffmpeg-specific <code class="code">$ext$</code> identifier is also
  3280. supported. When specified, <code class="command">ffmpeg</code> will replace <code class="code">$ext$</code>
  3281. in the file name with muxing format&rsquo;s extensions such as <code class="code">mp4</code>,
  3282. <code class="code">webm</code> etc.
  3283. </p>
  3284. <ul class="mini-toc">
  3285. <li><a href="#Options-20" accesskey="1">Options</a></li>
  3286. <li><a href="#Example" accesskey="2">Example</a></li>
  3287. </ul>
  3288. <div class="subsection-level-extent" id="Options-20">
  3289. <h4 class="subsection"><span>4.29.1 Options<a class="copiable-link" href="#Options-20"> &para;</a></span></h4>
  3290. <dl class="table">
  3291. <dt><samp class="option">adaptation_sets <var class="var">adaptation_sets</var></samp></dt>
  3292. <dd><p>Assign streams to adaptation sets, specified in the MPD manifest
  3293. <code class="code">AdaptationSets</code> section.
  3294. </p>
  3295. <p>An adaptation set contains a set of one or more streams accessed as a
  3296. single subset, e.g. corresponding streams encoded at different size
  3297. selectable by the user depending on the available bandwidth, or to
  3298. different audio streams with a different language.
  3299. </p>
  3300. <p>Each adaptation set is specified with the syntax:
  3301. </p><div class="example">
  3302. <pre class="example-preformatted">id=<var class="var">index</var>,streams=<var class="var">streams</var>
  3303. </pre></div>
  3304. <p>where <var class="var">index</var> must be a numerical index, and <var class="var">streams</var> is a
  3305. sequence of <code class="code">,</code>-separated stream indices. Multiple adaptation
  3306. sets can be specified, separated by spaces.
  3307. </p>
  3308. <p>To map all video (or audio) streams to an adaptation set, <code class="code">v</code> (or
  3309. <code class="code">a</code>) can be used as stream identifier instead of IDs.
  3310. </p>
  3311. <p>When no assignment is defined, this defaults to an adaptation set for
  3312. each stream.
  3313. </p>
  3314. <p>The following optional fields can also be specified:
  3315. </p>
  3316. <dl class="table">
  3317. <dt><samp class="option">descriptor</samp></dt>
  3318. <dd><p>Define the descriptor as defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  3319. </p>
  3320. <p>For example:
  3321. </p><div class="example">
  3322. <pre class="example-preformatted">&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;
  3323. </pre></div>
  3324. <p>The descriptor string should be a self-closing XML tag.
  3325. </p>
  3326. </dd>
  3327. <dt><samp class="option">frag_duration</samp></dt>
  3328. <dd><p>Override the global fragment duration specified with the
  3329. <samp class="option">frag_duration</samp> option.
  3330. </p>
  3331. </dd>
  3332. <dt><samp class="option">frag_type</samp></dt>
  3333. <dd><p>Override the global fragment type specified with the
  3334. <samp class="option">frag_type</samp> option.
  3335. </p>
  3336. </dd>
  3337. <dt><samp class="option">seg_duration</samp></dt>
  3338. <dd><p>Override the global segment duration specified with the
  3339. <samp class="option">seg_duration</samp> option.
  3340. </p>
  3341. </dd>
  3342. <dt><samp class="option">trick_id</samp></dt>
  3343. <dd><p>Mark an adaptation set as containing streams meant to be used for
  3344. Trick Mode for the referenced adaptation set.
  3345. </p></dd>
  3346. </dl>
  3347. <p>A few examples of possible values for the <samp class="option">adaptation_sets</samp>
  3348. option follow:
  3349. </p><div class="example">
  3350. <pre class="example-preformatted">id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a
  3351. </pre></div>
  3352. <div class="example">
  3353. <pre class="example-preformatted">id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1
  3354. </pre></div>
  3355. </dd>
  3356. <dt><samp class="option">dash_segment_type <var class="var">type</var></samp></dt>
  3357. <dd><p>Set DASH segment files type.
  3358. </p>
  3359. <p>Possible values:
  3360. </p><dl class="table">
  3361. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  3362. <dd><p>The dash segment files format will be selected based on the stream
  3363. codec. This is the default mode.
  3364. </p></dd>
  3365. <dt>&lsquo;<samp class="samp">mp4</samp>&rsquo;</dt>
  3366. <dd><p>the dash segment files will be in ISOBMFF/MP4 format
  3367. </p></dd>
  3368. <dt>&lsquo;<samp class="samp">webm</samp>&rsquo;</dt>
  3369. <dd><p>the dash segment files will be in WebM format
  3370. </p></dd>
  3371. </dl>
  3372. </dd>
  3373. <dt><samp class="option">extra_window_size <var class="var">size</var></samp></dt>
  3374. <dd><p>Set the maximum number of segments kept outside of the manifest before
  3375. removing from disk.
  3376. </p>
  3377. </dd>
  3378. <dt><samp class="option">format_options <var class="var">options_list</var></samp></dt>
  3379. <dd><p>Set container format (mp4/webm) options using a <code class="code">:</code>-separated list of
  3380. key=value parameters. Values containing <code class="code">:</code> special characters must be
  3381. escaped.
  3382. </p>
  3383. </dd>
  3384. <dt><samp class="option">frag_duration <var class="var">duration</var></samp></dt>
  3385. <dd><p>Set the length in seconds of fragments within segments, fractional
  3386. value can also be set.
  3387. </p>
  3388. </dd>
  3389. <dt><samp class="option">frag_type <var class="var">type</var></samp></dt>
  3390. <dd><p>Set the type of interval for fragmentation.
  3391. </p>
  3392. <p>Possible values:
  3393. </p><dl class="table">
  3394. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  3395. <dd><p>set one fragment per segment
  3396. </p>
  3397. </dd>
  3398. <dt>&lsquo;<samp class="samp">every_frame</samp>&rsquo;</dt>
  3399. <dd><p>fragment at every frame
  3400. </p>
  3401. </dd>
  3402. <dt>&lsquo;<samp class="samp">duration</samp>&rsquo;</dt>
  3403. <dd><p>fragment at specific time intervals
  3404. </p>
  3405. </dd>
  3406. <dt>&lsquo;<samp class="samp">pframes</samp>&rsquo;</dt>
  3407. <dd><p>fragment at keyframes and following P-Frame reordering (Video only,
  3408. experimental)
  3409. </p></dd>
  3410. </dl>
  3411. </dd>
  3412. <dt><samp class="option">global_sidx <var class="var">bool</var></samp></dt>
  3413. <dd><p>Write global <code class="code">SIDX</code> atom. Applicable only for single file, mp4
  3414. output, non-streaming mode.
  3415. </p>
  3416. </dd>
  3417. <dt><samp class="option">hls_master_name <var class="var">file_name</var></samp></dt>
  3418. <dd><p>HLS master playlist name. Default is <samp class="file">master.m3u8</samp>.
  3419. </p>
  3420. </dd>
  3421. <dt><samp class="option">hls_playlist <var class="var">bool</var></samp></dt>
  3422. <dd><p>Generate HLS playlist files. The master playlist is generated with
  3423. filename specified by the <samp class="option">hls_master_name</samp> option. One media
  3424. playlist file is generated for each stream with filenames
  3425. <samp class="file">media_0.m3u8</samp>, <samp class="file">media_1.m3u8</samp>, etc.
  3426. </p>
  3427. </dd>
  3428. <dt><samp class="option">http_opts <var class="var">http_opts</var></samp></dt>
  3429. <dd><p>Specify a list of <code class="code">:</code>-separated key=value options to pass to the
  3430. underlying HTTP protocol. Applicable only for HTTP output.
  3431. </p>
  3432. </dd>
  3433. <dt><samp class="option">http_persistent <var class="var">bool</var></samp></dt>
  3434. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  3435. </p>
  3436. </dd>
  3437. <dt><samp class="option">http_user_agent <var class="var">user_agent</var></samp></dt>
  3438. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP
  3439. output.
  3440. </p>
  3441. </dd>
  3442. <dt><samp class="option">ignore_io_errors <var class="var">bool</var></samp></dt>
  3443. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs
  3444. with network output. This is disabled by default.
  3445. </p>
  3446. </dd>
  3447. <dt><samp class="option">index_correction <var class="var">bool</var></samp></dt>
  3448. <dd><p>Enable or disable segment index correction logic. Applicable only when
  3449. <samp class="option">use_template</samp> is enabled and <samp class="option">use_timeline</samp> is
  3450. disabled. This is disabled by default.
  3451. </p>
  3452. <p>When enabled, the logic monitors the flow of segment indexes. If a
  3453. streams&rsquo;s segment index value is not at the expected real time
  3454. position, then the logic corrects that index value.
  3455. </p>
  3456. <p>Typically this logic is needed in live streaming use cases. The
  3457. network bandwidth fluctuations are common during long run
  3458. streaming. Each fluctuation can cause the segment indexes fall behind
  3459. the expected real time position.
  3460. </p>
  3461. </dd>
  3462. <dt><samp class="option">init_seg_name <var class="var">init_name</var></samp></dt>
  3463. <dd><p>DASH-templated name to use for the initialization segment. Default is
  3464. <code class="code">init-stream$RepresentationID$.$ext$</code>. <code class="code">$ext$</code> is replaced
  3465. with the file name extension specific for the segment format.
  3466. </p>
  3467. </dd>
  3468. <dt><samp class="option">ldash <var class="var">bool</var></samp></dt>
  3469. <dd><p>Enable Low-latency Dash by constraining the presence and values of
  3470. some elements. This is disabled by default.
  3471. </p>
  3472. </dd>
  3473. <dt><samp class="option">lhls <var class="var">bool</var></samp></dt>
  3474. <dd><p>Enable Low-latency HLS (LHLS). Add <code class="code">#EXT-X-PREFETCH</code> tag with
  3475. current segment&rsquo;s URI. hls.js player folks are trying to standardize
  3476. an open LHLS spec. The draft spec is available at
  3477. <a class="url" href="https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md">https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md</a>.
  3478. </p>
  3479. <p>This option tries to comply with the above open spec. It enables
  3480. <samp class="option">streaming</samp> and <samp class="option">hls_playlist</samp> options automatically.
  3481. This is an experimental feature.
  3482. </p>
  3483. <p>Note: This is not Apple&rsquo;s version LHLS. See
  3484. <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>
  3485. </p>
  3486. </dd>
  3487. <dt><samp class="option">master_m3u8_publish_rate <var class="var">segment_intervals_count</var></samp></dt>
  3488. <dd><p>Publish master playlist repeatedly every after specified number of
  3489. segment intervals.
  3490. </p>
  3491. </dd>
  3492. <dt><samp class="option">max_playback_rate <var class="var">rate</var></samp></dt>
  3493. <dd><p>Set the maximum playback rate indicated as appropriate for the
  3494. purposes of automatically adjusting playback latency and buffer
  3495. occupancy during normal playback by clients.
  3496. </p>
  3497. </dd>
  3498. <dt><samp class="option">media_seg_name <var class="var">segment_name</var></samp></dt>
  3499. <dd><p>DASH-templated name to use for the media segments. Default is
  3500. <code class="code">chunk-stream$RepresentationID$-$Number%05d$.$ext$</code>. <code class="code">$ext$</code>
  3501. is replaced with the file name extension specific for the segment
  3502. format.
  3503. </p>
  3504. </dd>
  3505. <dt><samp class="option">method <var class="var">method</var></samp></dt>
  3506. <dd><p>Use the given HTTP method to create output files. Generally set to <code class="code">PUT</code>
  3507. or <code class="code">POST</code>.
  3508. </p>
  3509. </dd>
  3510. <dt><samp class="option">min_playback_rate <var class="var">rate</var></samp></dt>
  3511. <dd><p>Set the minimum playback rate indicated as appropriate for the
  3512. purposes of automatically adjusting playback latency and buffer
  3513. occupancy during normal playback by clients.
  3514. </p>
  3515. </dd>
  3516. <dt><samp class="option">mpd_profile <var class="var">flags</var></samp></dt>
  3517. <dd><p>Set one or more MPD manifest profiles.
  3518. </p>
  3519. <p>Possible values:
  3520. </p><dl class="table">
  3521. <dt>&lsquo;<samp class="samp">dash</samp>&rsquo;</dt>
  3522. <dd><p>MPEG-DASH ISO Base media file format live profile
  3523. </p></dd>
  3524. <dt>&lsquo;<samp class="samp">dvb_dash</samp>&rsquo;</dt>
  3525. <dd><p>DVB-DASH profile
  3526. </p></dd>
  3527. </dl>
  3528. <p>Default value is <code class="code">dash</code>.
  3529. </p>
  3530. </dd>
  3531. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  3532. <dd><p>Enable or disable removal of all segments when finished. This is
  3533. disabled by default.
  3534. </p>
  3535. </dd>
  3536. <dt><samp class="option">seg_duration <var class="var">duration</var></samp></dt>
  3537. <dd><p>Set the segment length in seconds (fractional value can be set). The
  3538. value is treated as average segment duration when the
  3539. <samp class="option">use_template</samp> option is enabled and the <samp class="option">use_timeline</samp>
  3540. option is disabled and as minimum segment duration for all the other
  3541. use cases.
  3542. </p>
  3543. <p>Default value is <code class="code">5</code>.
  3544. </p>
  3545. </dd>
  3546. <dt><samp class="option">single_file <var class="var">bool</var></samp></dt>
  3547. <dd><p>Enable or disable storing all segments in one file, accessed using
  3548. byte ranges. This is disabled by default.
  3549. </p>
  3550. <p>The name of the single file can be specified with the
  3551. <samp class="option">single_file_name</samp> option, if not specified assume the basename
  3552. of the manifest file with the output format extension.
  3553. </p>
  3554. </dd>
  3555. <dt><samp class="option">single_file_name <var class="var">file_name</var></samp></dt>
  3556. <dd><p>DASH-templated name to use for the manifest <code class="code">baseURL</code>
  3557. element. Imply that the <samp class="option">single_file</samp> option is set to
  3558. <var class="var">true</var>. In the template, <code class="code">$ext$</code> is replaced with the file
  3559. name extension specific for the segment format.
  3560. </p>
  3561. </dd>
  3562. <dt><samp class="option">streaming <var class="var">bool</var></samp></dt>
  3563. <dd><p>Enable or disable chunk streaming mode of output. In chunk streaming
  3564. mode, each frame will be a <code class="code">moof</code> fragment which forms a
  3565. chunk. This is disabled by default.
  3566. </p>
  3567. </dd>
  3568. <dt><samp class="option">target_latency <var class="var">target_latency</var></samp></dt>
  3569. <dd><p>Set an intended target latency in seconds for serving (fractional
  3570. value can be set). Applicable only when the <samp class="option">streaming</samp> and
  3571. <samp class="option">write_prft</samp> options are enabled. This is an informative fields
  3572. clients can use to measure the latency of the service.
  3573. </p>
  3574. </dd>
  3575. <dt><samp class="option">timeout <var class="var">timeout</var></samp></dt>
  3576. <dd><p>Set timeout for socket I/O operations expressed in seconds (fractional
  3577. value can be set). Applicable only for HTTP output.
  3578. </p>
  3579. </dd>
  3580. <dt><samp class="option">update_period <var class="var">period</var></samp></dt>
  3581. <dd><p>Set the MPD update period, for dynamic content. The unit is
  3582. second. If set to <code class="code">0</code>, the period is automatically computed.
  3583. </p>
  3584. <p>Default value is <code class="code">0</code>.
  3585. </p>
  3586. </dd>
  3587. <dt><samp class="option">use_template <var class="var">bool</var></samp></dt>
  3588. <dd><p>Enable or disable use of <code class="code">SegmentTemplate</code> instead of
  3589. <code class="code">SegmentList</code> in the manifest. This is enabled by default.
  3590. </p>
  3591. </dd>
  3592. <dt><samp class="option">use_timeline <var class="var">bool</var></samp></dt>
  3593. <dd><p>Enable or disable use of <code class="code">SegmentTimeline</code> within the
  3594. <code class="code">SegmentTemplate</code> manifest section. This is enabled by default.
  3595. </p>
  3596. </dd>
  3597. <dt><samp class="option">utc_timing_url <var class="var">url</var></samp></dt>
  3598. <dd><p>URL of the page that will return the UTC timestamp in ISO
  3599. format, for example <code class="code">https://time.akamai.com/?iso</code>
  3600. </p>
  3601. </dd>
  3602. <dt><samp class="option">window_size <var class="var">size</var></samp></dt>
  3603. <dd><p>Set the maximum number of segments kept in the manifest, discard the
  3604. oldest one. This is useful for live streaming.
  3605. </p>
  3606. <p>If the value is <code class="code">0</code>, all segments are kept in the
  3607. manifest. Default value is <code class="code">0</code>.
  3608. </p>
  3609. </dd>
  3610. <dt><samp class="option">write_prft <var class="var">write_prft</var></samp></dt>
  3611. <dd><p>Write Producer Reference Time elements on supported streams. This also
  3612. enables writing prft boxes in the underlying muxer. Applicable only
  3613. when the <var class="var">utc_url</var> option is enabled. It is set to <var class="var">auto</var> by
  3614. default, in which case the muxer will attempt to enable it only in
  3615. modes that require it.
  3616. </p></dd>
  3617. </dl>
  3618. </div>
  3619. <div class="subsection-level-extent" id="Example">
  3620. <h4 class="subsection"><span>4.29.2 Example<a class="copiable-link" href="#Example"> &para;</a></span></h4>
  3621. <p>Generate a DASH output reading from an input source in realtime using
  3622. <code class="command">ffmpeg</code>.
  3623. </p>
  3624. <p>Two multimedia streams are generated from the input file, both
  3625. containing a video stream encoded through &lsquo;<samp class="samp">libx264</samp>&rsquo;, and an audio
  3626. stream encoded with &lsquo;<samp class="samp">libfdk_aac</samp>&rsquo;. The first multimedia stream
  3627. contains video with a bitrate of 800k and audio at the default rate,
  3628. the second with video scaled to 320x170 pixels at 300k and audio
  3629. resampled at 22005 Hz.
  3630. </p>
  3631. <p>The <samp class="option">window_size</samp> option keeps only the latest 5 segments with
  3632. the default duration of 5 seconds.
  3633. </p>
  3634. <div class="example">
  3635. <pre class="example-preformatted">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  3636. -b:v:0 800k -profile:v:0 main \
  3637. -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -ar:a:1 22050 \
  3638. -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 \
  3639. -use_timeline 1 -use_template 1 -window_size 5 \
  3640. -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  3641. -f dash /path/to/out.mpd
  3642. </pre></div>
  3643. </div>
  3644. </div>
  3645. <div class="section-level-extent" id="daud">
  3646. <h3 class="section"><span>4.30 daud<a class="copiable-link" href="#daud"> &para;</a></span></h3>
  3647. <p>D-Cinema audio muxer.
  3648. </p>
  3649. <p>It accepts a single 6-channels audio stream resampled at 96000 Hz
  3650. encoded with the &lsquo;<samp class="samp">pcm_24daud</samp>&rsquo; codec.
  3651. </p>
  3652. <ul class="mini-toc">
  3653. <li><a href="#Example-1" accesskey="1">Example</a></li>
  3654. </ul>
  3655. <div class="subsection-level-extent" id="Example-1">
  3656. <h4 class="subsection"><span>4.30.1 Example<a class="copiable-link" href="#Example-1"> &para;</a></span></h4>
  3657. <p>Use <code class="command">ffmpeg</code> to mux input audio to a &lsquo;<samp class="samp">5.1</samp>&rsquo; channel layout
  3658. resampled at 96000Hz:
  3659. </p><div class="example">
  3660. <pre class="example-preformatted">ffmpeg -i INPUT -af aresample=96000,pan=5.1 slow.302
  3661. </pre></div>
  3662. <p>For ffmpeg versions before 7.0 you might have to use the &lsquo;<samp class="samp">asetnsamples</samp>&rsquo;
  3663. filter to limit the muxed packet size, because this format does not support
  3664. muxing packets larger than 65535 bytes (3640 samples). For newer ffmpeg
  3665. versions audio is automatically packetized to 36000 byte (2000 sample) packets.
  3666. </p>
  3667. </div>
  3668. </div>
  3669. <div class="section-level-extent" id="dv">
  3670. <h3 class="section"><span>4.31 dv<a class="copiable-link" href="#dv"> &para;</a></span></h3>
  3671. <p>DV (Digital Video) muxer.
  3672. </p>
  3673. <p>It accepts exactly one &lsquo;<samp class="samp">dvvideo</samp>&rsquo; video stream and at most two
  3674. &lsquo;<samp class="samp">pcm_s16</samp>&rsquo; audio streams. More constraints are defined by the
  3675. property of the video, which must correspond to a DV video supported
  3676. profile, and on the framerate.
  3677. </p>
  3678. <ul class="mini-toc">
  3679. <li><a href="#Example-2" accesskey="1">Example</a></li>
  3680. </ul>
  3681. <div class="subsection-level-extent" id="Example-2">
  3682. <h4 class="subsection"><span>4.31.1 Example<a class="copiable-link" href="#Example-2"> &para;</a></span></h4>
  3683. <p>Use <code class="command">ffmpeg</code> to convert the input:
  3684. </p><div class="example">
  3685. <pre class="example-preformatted">ffmpeg -i INPUT -s:v 720x480 -pix_fmt yuv411p -r 29.97 -ac 2 -ar 48000 -y out.dv
  3686. </pre></div>
  3687. </div>
  3688. </div>
  3689. <div class="section-level-extent" id="ffmetadata">
  3690. <h3 class="section"><span>4.32 ffmetadata<a class="copiable-link" href="#ffmetadata"> &para;</a></span></h3>
  3691. <p>FFmpeg metadata muxer.
  3692. </p>
  3693. <p>This muxer writes the streams metadata in the &lsquo;<samp class="samp">ffmetadata</samp>&rsquo;
  3694. format.
  3695. </p>
  3696. <p>See <a data-manual="ffmpeg-formats" href="ffmpeg-formats.html#metadata">the Metadata chapter</a> for
  3697. information about the format.
  3698. </p>
  3699. <ul class="mini-toc">
  3700. <li><a href="#Example-3" accesskey="1">Example</a></li>
  3701. </ul>
  3702. <div class="subsection-level-extent" id="Example-3">
  3703. <h4 class="subsection"><span>4.32.1 Example<a class="copiable-link" href="#Example-3"> &para;</a></span></h4>
  3704. <p>Use <code class="command">ffmpeg</code> to extract metadata from an input file to a <samp class="file">metadata.ffmeta</samp>
  3705. file in &lsquo;<samp class="samp">ffmetadata</samp>&rsquo; format:
  3706. </p><div class="example">
  3707. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata metadata.ffmeta
  3708. </pre></div>
  3709. <a class="anchor" id="fifo"></a></div>
  3710. </div>
  3711. <div class="section-level-extent" id="fifo-1">
  3712. <h3 class="section"><span>4.33 fifo<a class="copiable-link" href="#fifo-1"> &para;</a></span></h3>
  3713. <p>FIFO (First-In First-Out) muxer.
  3714. </p>
  3715. <p>The &lsquo;<samp class="samp">fifo</samp>&rsquo; pseudo-muxer allows the separation of encoding and
  3716. muxing by using a first-in-first-out queue and running the actual muxer
  3717. in a separate thread.
  3718. </p>
  3719. <p>This is especially useful in combination with
  3720. the <a class="ref" href="#tee">tee</a> muxer and can be used to send data to several
  3721. destinations with different reliability/writing speed/latency.
  3722. </p>
  3723. <p>The target muxer is either selected from the output name or specified
  3724. through the <samp class="option">fifo_format</samp> option.
  3725. </p>
  3726. <p>The behavior of the &lsquo;<samp class="samp">fifo</samp>&rsquo; muxer if the queue fills up or if the
  3727. output fails (e.g. if a packet cannot be written to the output) is
  3728. selectable:
  3729. </p><ul class="itemize mark-bullet">
  3730. <li>Output can be transparently restarted with configurable delay between
  3731. retries based on real time or time of the processed stream.
  3732. </li><li>Encoding can be blocked during temporary failure, or continue transparently
  3733. dropping packets in case the FIFO queue fills up.
  3734. </li></ul>
  3735. <p>API users should be aware that callback functions
  3736. (<code class="code">interrupt_callback</code>, <code class="code">io_open</code> and <code class="code">io_close</code>) used
  3737. within its <code class="code">AVFormatContext</code> must be thread-safe.
  3738. </p>
  3739. <ul class="mini-toc">
  3740. <li><a href="#Options-21" accesskey="1">Options</a></li>
  3741. <li><a href="#Example-4" accesskey="2">Example</a></li>
  3742. </ul>
  3743. <div class="subsection-level-extent" id="Options-21">
  3744. <h4 class="subsection"><span>4.33.1 Options<a class="copiable-link" href="#Options-21"> &para;</a></span></h4>
  3745. <dl class="table">
  3746. <dt><samp class="option">attempt_recovery <var class="var">bool</var></samp></dt>
  3747. <dd><p>If failure occurs, attempt to recover the output. This is especially
  3748. useful when used with network output, since it makes it possible to
  3749. restart streaming transparently. By default this option is set to
  3750. <code class="code">false</code>.
  3751. </p>
  3752. </dd>
  3753. <dt><samp class="option">drop_pkts_on_overflow <var class="var">bool</var></samp></dt>
  3754. <dd><p>If set to <code class="code">true</code>, in case the fifo queue fills up, packets will
  3755. be dropped rather than blocking the encoder. This makes it possible to
  3756. continue streaming without delaying the input, at the cost of omitting
  3757. part of the stream. By default this option is set to <code class="code">false</code>, so in
  3758. such cases the encoder will be blocked until the muxer processes some
  3759. of the packets and none of them is lost.
  3760. </p>
  3761. </dd>
  3762. <dt><samp class="option">fifo_format <var class="var">format_name</var></samp></dt>
  3763. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  3764. output name suffix.
  3765. </p>
  3766. </dd>
  3767. <dt><samp class="option">format_opts <var class="var">options</var></samp></dt>
  3768. <dd><p>Specify format options for the underlying muxer. Muxer options can be
  3769. specified as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;.
  3770. </p>
  3771. </dd>
  3772. <dt><samp class="option">max_recovery_attempts <var class="var">count</var></samp></dt>
  3773. <dd><p>Set maximum number of successive unsuccessful recovery attempts after
  3774. which the output fails permanently. By default this option is set to
  3775. <code class="code">0</code> (unlimited).
  3776. </p>
  3777. </dd>
  3778. <dt><samp class="option">queue_size <var class="var">size</var></samp></dt>
  3779. <dd><p>Specify size of the queue as a number of packets. Default value is
  3780. <code class="code">60</code>.
  3781. </p>
  3782. </dd>
  3783. <dt><samp class="option">recover_any_error <var class="var">bool</var></samp></dt>
  3784. <dd><p>If set to <code class="code">true</code>, recovery will be attempted regardless of type
  3785. of the error causing the failure. By default this option is set to
  3786. <code class="code">false</code> and in case of certain (usually permanent) errors the
  3787. recovery is not attempted even when the <samp class="option">attempt_recovery</samp>
  3788. option is set to <code class="code">true</code>.
  3789. </p>
  3790. </dd>
  3791. <dt><samp class="option">recovery_wait_streamtime <var class="var">bool</var></samp></dt>
  3792. <dd><p>If set to <code class="code">false</code>, the real time is used when waiting for the
  3793. recovery attempt (i.e. the recovery will be attempted after the time
  3794. specified by the <samp class="option">recovery_wait_time</samp> option).
  3795. </p>
  3796. <p>If set to <code class="code">true</code>, the time of the processed stream is taken into
  3797. account instead (i.e. the recovery will be attempted after discarding
  3798. the packets corresponding to the <samp class="option">recovery_wait_time</samp> option).
  3799. </p>
  3800. <p>By default this option is set to <code class="code">false</code>.
  3801. </p>
  3802. </dd>
  3803. <dt><samp class="option">recovery_wait_time <var class="var">duration</var></samp></dt>
  3804. <dd><p>Specify waiting time in seconds before the next recovery attempt after
  3805. previous unsuccessful recovery attempt. Default value is <code class="code">5</code>.
  3806. </p>
  3807. </dd>
  3808. <dt><samp class="option">restart_with_keyframe <var class="var">bool</var></samp></dt>
  3809. <dd><p>Specify whether to wait for the keyframe after recovering from
  3810. queue overflow or failure. This option is set to <code class="code">false</code> by default.
  3811. </p>
  3812. </dd>
  3813. <dt><samp class="option">timeshift <var class="var">duration</var></samp></dt>
  3814. <dd><p>Buffer the specified amount of packets and delay writing the
  3815. output. Note that the value of the <samp class="option">queue_size</samp> option must be
  3816. big enough to store the packets for timeshift. At the end of the input
  3817. the fifo buffer is flushed at realtime speed.
  3818. </p></dd>
  3819. </dl>
  3820. </div>
  3821. <div class="subsection-level-extent" id="Example-4">
  3822. <h4 class="subsection"><span>4.33.2 Example<a class="copiable-link" href="#Example-4"> &para;</a></span></h4>
  3823. <p>Use <code class="command">ffmpeg</code> to stream to an RTMP server, continue processing
  3824. the stream at real-time rate even in case of temporary failure
  3825. (network outage) and attempt to recover streaming every second
  3826. indefinitely:
  3827. </p><div class="example">
  3828. <pre class="example-preformatted">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv \
  3829. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 \
  3830. -map 0:v -map 0:a rtmp://example.com/live/stream_name
  3831. </pre></div>
  3832. </div>
  3833. </div>
  3834. <div class="section-level-extent" id="film_005fcpk">
  3835. <h3 class="section"><span>4.34 film_cpk<a class="copiable-link" href="#film_005fcpk"> &para;</a></span></h3>
  3836. <p>Sega film (.cpk) muxer.
  3837. </p>
  3838. <p>This format was used as internal format for several Sega games.
  3839. </p>
  3840. <p>For more information regarding the Sega film file format, visit
  3841. <a class="url" href="http://wiki.multimedia.cx/index.php?title=Sega_FILM">http://wiki.multimedia.cx/index.php?title=Sega_FILM</a>.
  3842. </p>
  3843. <p>It accepts at maximum one &lsquo;<samp class="samp">cinepak</samp>&rsquo; or raw video stream, and at
  3844. maximum one audio stream.
  3845. </p>
  3846. </div>
  3847. <div class="section-level-extent" id="filmstrip">
  3848. <h3 class="section"><span>4.35 filmstrip<a class="copiable-link" href="#filmstrip"> &para;</a></span></h3>
  3849. <p>Adobe Filmstrip muxer.
  3850. </p>
  3851. <p>This format is used by several Adobe tools to store a generated filmstrip export. It
  3852. accepts a single raw video stream.
  3853. </p>
  3854. </div>
  3855. <div class="section-level-extent" id="fits">
  3856. <h3 class="section"><span>4.36 fits<a class="copiable-link" href="#fits"> &para;</a></span></h3>
  3857. <p>Flexible Image Transport System (FITS) muxer.
  3858. </p>
  3859. <p>This image format is used to store astronomical data.
  3860. </p>
  3861. <p>For more information regarding the format, visit
  3862. <a class="url" href="https://fits.gsfc.nasa.gov">https://fits.gsfc.nasa.gov</a>.
  3863. </p>
  3864. </div>
  3865. <div class="section-level-extent" id="flac">
  3866. <h3 class="section"><span>4.37 flac<a class="copiable-link" href="#flac"> &para;</a></span></h3>
  3867. <p>Raw FLAC audio muxer.
  3868. </p>
  3869. <p>This muxer accepts exactly one FLAC audio stream. Additionally, it is possible to add
  3870. images with disposition &lsquo;<samp class="samp">attached_pic</samp>&rsquo;.
  3871. </p>
  3872. <ul class="mini-toc">
  3873. <li><a href="#Options-22" accesskey="1">Options</a></li>
  3874. <li><a href="#Example-5" accesskey="2">Example</a></li>
  3875. </ul>
  3876. <div class="subsection-level-extent" id="Options-22">
  3877. <h4 class="subsection"><span>4.37.1 Options<a class="copiable-link" href="#Options-22"> &para;</a></span></h4>
  3878. <dl class="table">
  3879. <dt><samp class="option">write_header <var class="var">bool</var></samp></dt>
  3880. <dd><p>write the file header if set to <code class="code">true</code>, default is <code class="code">true</code>
  3881. </p></dd>
  3882. </dl>
  3883. </div>
  3884. <div class="subsection-level-extent" id="Example-5">
  3885. <h4 class="subsection"><span>4.37.2 Example<a class="copiable-link" href="#Example-5"> &para;</a></span></h4>
  3886. <p>Use <code class="command">ffmpeg</code> to store the audio stream from an input file,
  3887. together with several pictures used with &lsquo;<samp class="samp">attached_pic</samp>&rsquo;
  3888. disposition:
  3889. </p><div class="example">
  3890. <pre class="example-preformatted">ffmpeg -i INPUT -i pic1.png -i pic2.jpg -map 0:a -map 1 -map 2 -disposition:v attached_pic OUTPUT
  3891. </pre></div>
  3892. </div>
  3893. </div>
  3894. <div class="section-level-extent" id="flv">
  3895. <h3 class="section"><span>4.38 flv<a class="copiable-link" href="#flv"> &para;</a></span></h3>
  3896. <p>Adobe Flash Video Format muxer.
  3897. </p>
  3898. <ul class="mini-toc">
  3899. <li><a href="#Options-23" accesskey="1">Options</a></li>
  3900. </ul>
  3901. <div class="subsection-level-extent" id="Options-23">
  3902. <h4 class="subsection"><span>4.38.1 Options<a class="copiable-link" href="#Options-23"> &para;</a></span></h4>
  3903. <dl class="table">
  3904. <dt><samp class="option">flvflags <var class="var">flags</var></samp></dt>
  3905. <dd><p>Possible values:
  3906. </p>
  3907. <dl class="table">
  3908. <dt>&lsquo;<samp class="samp">aac_seq_header_detect</samp>&rsquo;</dt>
  3909. <dd><p>Place AAC sequence header based on audio stream data.
  3910. </p>
  3911. </dd>
  3912. <dt>&lsquo;<samp class="samp">no_sequence_end</samp>&rsquo;</dt>
  3913. <dd><p>Disable sequence end tag.
  3914. </p>
  3915. </dd>
  3916. <dt>&lsquo;<samp class="samp">no_metadata</samp>&rsquo;</dt>
  3917. <dd><p>Disable metadata tag.
  3918. </p>
  3919. </dd>
  3920. <dt>&lsquo;<samp class="samp">no_duration_filesize</samp>&rsquo;</dt>
  3921. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  3922. at the end of stream. (Be used to non-seekable living stream).
  3923. </p>
  3924. </dd>
  3925. <dt>&lsquo;<samp class="samp">add_keyframe_index</samp>&rsquo;</dt>
  3926. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  3927. </p></dd>
  3928. </dl>
  3929. </dd>
  3930. </dl>
  3931. <a class="anchor" id="framecrc"></a></div>
  3932. </div>
  3933. <div class="section-level-extent" id="framecrc-1">
  3934. <h3 class="section"><span>4.39 framecrc<a class="copiable-link" href="#framecrc-1"> &para;</a></span></h3>
  3935. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  3936. </p>
  3937. <p>This muxer computes and prints the Adler-32 CRC for each audio
  3938. and video packet. By default audio frames are converted to signed
  3939. 16-bit raw audio and video frames to raw video before computing the
  3940. CRC.
  3941. </p>
  3942. <p>The output of the muxer consists of a line for each audio and video
  3943. packet of the form:
  3944. </p><div class="example">
  3945. <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>
  3946. </pre></div>
  3947. <p><var class="var">CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  3948. CRC of the packet.
  3949. </p>
  3950. <ul class="mini-toc">
  3951. <li><a href="#Examples-7" accesskey="1">Examples</a></li>
  3952. </ul>
  3953. <div class="subsection-level-extent" id="Examples-7">
  3954. <h4 class="subsection"><span>4.39.1 Examples<a class="copiable-link" href="#Examples-7"> &para;</a></span></h4>
  3955. <p>For example to compute the CRC of the audio and video frames in
  3956. <samp class="file">INPUT</samp>, converted to raw audio and video packets, and store it
  3957. in the file <samp class="file">out.crc</samp>:
  3958. </p><div class="example">
  3959. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc out.crc
  3960. </pre></div>
  3961. <p>To print the information to stdout, use the command:
  3962. </p><div class="example">
  3963. <pre class="example-preformatted">ffmpeg -i INPUT -f framecrc -
  3964. </pre></div>
  3965. <p>With <code class="command">ffmpeg</code>, you can select the output format to which the
  3966. audio and video frames are encoded before computing the CRC for each
  3967. packet by specifying the audio and video codec. For example, to
  3968. compute the CRC of each decoded input audio frame converted to PCM
  3969. unsigned 8-bit and of each decoded input video frame converted to
  3970. MPEG-2 video, use the command:
  3971. </p><div class="example">
  3972. <pre class="example-preformatted">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  3973. </pre></div>
  3974. <p>See also the <a class="ref" href="#crc">crc</a> muxer.
  3975. </p>
  3976. <a class="anchor" id="framehash"></a></div>
  3977. </div>
  3978. <div class="section-level-extent" id="framehash-1">
  3979. <h3 class="section"><span>4.40 framehash<a class="copiable-link" href="#framehash-1"> &para;</a></span></h3>
  3980. <p>Per-packet hash testing format.
  3981. </p>
  3982. <p>This muxer computes and prints a cryptographic hash for each audio
  3983. and video packet. This can be used for packet-by-packet equality
  3984. checks without having to individually do a binary comparison on each.
  3985. </p>
  3986. <p>By default audio frames are converted to signed 16-bit raw audio and
  3987. video frames to raw video before computing the hash, but the output
  3988. of explicit conversions to other codecs can also be used. It uses the
  3989. SHA-256 cryptographic hash function by default, but supports several
  3990. other algorithms.
  3991. </p>
  3992. <p>The output of the muxer consists of a line for each audio and video
  3993. packet of the form:
  3994. </p><div class="example">
  3995. <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>
  3996. </pre></div>
  3997. <p><var class="var">hash</var> is a hexadecimal number representing the computed hash
  3998. for the packet.
  3999. </p>
  4000. <dl class="table">
  4001. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  4002. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  4003. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  4004. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  4005. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  4006. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  4007. </p>
  4008. </dd>
  4009. </dl>
  4010. <ul class="mini-toc">
  4011. <li><a href="#Examples-8" accesskey="1">Examples</a></li>
  4012. </ul>
  4013. <div class="subsection-level-extent" id="Examples-8">
  4014. <h4 class="subsection"><span>4.40.1 Examples<a class="copiable-link" href="#Examples-8"> &para;</a></span></h4>
  4015. <p>To compute the SHA-256 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  4016. converted to raw audio and video packets, and store it in the file
  4017. <samp class="file">out.sha256</samp>:
  4018. </p><div class="example">
  4019. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash out.sha256
  4020. </pre></div>
  4021. <p>To print the information to stdout, using the MD5 hash function, use
  4022. the command:
  4023. </p><div class="example">
  4024. <pre class="example-preformatted">ffmpeg -i INPUT -f framehash -hash md5 -
  4025. </pre></div>
  4026. <p>See also the <a class="ref" href="#hash">hash</a> muxer.
  4027. </p>
  4028. <a class="anchor" id="framemd5"></a></div>
  4029. </div>
  4030. <div class="section-level-extent" id="framemd5-1">
  4031. <h3 class="section"><span>4.41 framemd5<a class="copiable-link" href="#framemd5-1"> &para;</a></span></h3>
  4032. <p>Per-packet MD5 testing format.
  4033. </p>
  4034. <p>This is a variant of the <a class="ref" href="#framehash">framehash</a> muxer. Unlike that muxer,
  4035. it defaults to using the MD5 hash function.
  4036. </p>
  4037. <ul class="mini-toc">
  4038. <li><a href="#Examples-9" accesskey="1">Examples</a></li>
  4039. </ul>
  4040. <div class="subsection-level-extent" id="Examples-9">
  4041. <h4 class="subsection"><span>4.41.1 Examples<a class="copiable-link" href="#Examples-9"> &para;</a></span></h4>
  4042. <p>To compute the MD5 hash of the audio and video frames in <samp class="file">INPUT</samp>,
  4043. converted to raw audio and video packets, and store it in the file
  4044. <samp class="file">out.md5</samp>:
  4045. </p><div class="example">
  4046. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 out.md5
  4047. </pre></div>
  4048. <p>To print the information to stdout, use the command:
  4049. </p><div class="example">
  4050. <pre class="example-preformatted">ffmpeg -i INPUT -f framemd5 -
  4051. </pre></div>
  4052. <p>See also the <a class="ref" href="#framehash">framehash</a> and <a class="ref" href="#md5">md5</a> muxers.
  4053. </p>
  4054. <a class="anchor" id="gif"></a></div>
  4055. </div>
  4056. <div class="section-level-extent" id="gif-2">
  4057. <h3 class="section"><span>4.42 gif<a class="copiable-link" href="#gif-2"> &para;</a></span></h3>
  4058. <p>Animated GIF muxer.
  4059. </p>
  4060. <p>Note that the GIF format has a very large time base: the delay between two frames can
  4061. therefore not be smaller than one centi second.
  4062. </p>
  4063. <ul class="mini-toc">
  4064. <li><a href="#Options-24" accesskey="1">Options</a></li>
  4065. <li><a href="#Example-6" accesskey="2">Example</a></li>
  4066. </ul>
  4067. <div class="subsection-level-extent" id="Options-24">
  4068. <h4 class="subsection"><span>4.42.1 Options<a class="copiable-link" href="#Options-24"> &para;</a></span></h4>
  4069. <dl class="table">
  4070. <dt><samp class="option">loop <var class="var">bool</var></samp></dt>
  4071. <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>
  4072. for looping indefinitely (default).
  4073. </p>
  4074. </dd>
  4075. <dt><samp class="option">final_delay <var class="var">delay</var></samp></dt>
  4076. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  4077. ends with a delay until the next frame. The default is <code class="code">-1</code>, which is a
  4078. special value to tell the muxer to re-use the previous delay. In case of a
  4079. loop, you might want to customize this value to mark a pause for instance.
  4080. </p></dd>
  4081. </dl>
  4082. </div>
  4083. <div class="subsection-level-extent" id="Example-6">
  4084. <h4 class="subsection"><span>4.42.2 Example<a class="copiable-link" href="#Example-6"> &para;</a></span></h4>
  4085. <p>Encode a gif looping 10 times, with a 5 seconds delay between
  4086. the loops:
  4087. </p><div class="example">
  4088. <pre class="example-preformatted">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  4089. </pre></div>
  4090. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  4091. force the <a class="ref" href="#image2">image2</a> muxer:
  4092. </p><div class="example">
  4093. <pre class="example-preformatted">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  4094. </pre></div>
  4095. </div>
  4096. </div>
  4097. <div class="section-level-extent" id="gxf">
  4098. <h3 class="section"><span>4.43 gxf<a class="copiable-link" href="#gxf"> &para;</a></span></h3>
  4099. <p>General eXchange Format (GXF) muxer.
  4100. </p>
  4101. <p>GXF was developed by Grass Valley Group, then standardized by SMPTE as SMPTE
  4102. 360M and was extended in SMPTE RDD 14-2007 to include high-definition video
  4103. resolutions.
  4104. </p>
  4105. <p>It accepts at most one video stream with codec &lsquo;<samp class="samp">mjpeg</samp>&rsquo;, or
  4106. &lsquo;<samp class="samp">mpeg1video</samp>&rsquo;, or &lsquo;<samp class="samp">mpeg2video</samp>&rsquo;, or &lsquo;<samp class="samp">dvvideo</samp>&rsquo; with resolution
  4107. &lsquo;<samp class="samp">512x480</samp>&rsquo; or &lsquo;<samp class="samp">608x576</samp>&rsquo;, and several audio streams with rate 48000Hz
  4108. and codec &lsquo;<samp class="samp">pcm16_le</samp>&rsquo;.
  4109. </p>
  4110. <a class="anchor" id="hash"></a></div>
  4111. <div class="section-level-extent" id="hash-1">
  4112. <h3 class="section"><span>4.44 hash<a class="copiable-link" href="#hash-1"> &para;</a></span></h3>
  4113. <p>Hash testing format.
  4114. </p>
  4115. <p>This muxer computes and prints a cryptographic hash of all the input
  4116. audio and video frames. This can be used for equality checks without
  4117. having to do a complete binary comparison.
  4118. </p>
  4119. <p>By default audio frames are converted to signed 16-bit raw audio and
  4120. video frames to raw video before computing the hash, but the output
  4121. of explicit conversions to other codecs can also be used. Timestamps
  4122. are ignored. It uses the SHA-256 cryptographic hash function by default,
  4123. but supports several other algorithms.
  4124. </p>
  4125. <p>The output of the muxer consists of a single line of the form:
  4126. <var class="var">algo</var>=<var class="var">hash</var>, where <var class="var">algo</var> is a short string representing
  4127. the hash function used, and <var class="var">hash</var> is a hexadecimal number
  4128. representing the computed hash.
  4129. </p>
  4130. <dl class="table">
  4131. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  4132. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  4133. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  4134. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  4135. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  4136. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  4137. </p>
  4138. </dd>
  4139. </dl>
  4140. <ul class="mini-toc">
  4141. <li><a href="#Examples-10" accesskey="1">Examples</a></li>
  4142. </ul>
  4143. <div class="subsection-level-extent" id="Examples-10">
  4144. <h4 class="subsection"><span>4.44.1 Examples<a class="copiable-link" href="#Examples-10"> &para;</a></span></h4>
  4145. <p>To compute the SHA-256 hash of the input converted to raw audio and
  4146. video, and store it in the file <samp class="file">out.sha256</samp>:
  4147. </p><div class="example">
  4148. <pre class="example-preformatted">ffmpeg -i INPUT -f hash out.sha256
  4149. </pre></div>
  4150. <p>To print an MD5 hash to stdout use the command:
  4151. </p><div class="example">
  4152. <pre class="example-preformatted">ffmpeg -i INPUT -f hash -hash md5 -
  4153. </pre></div>
  4154. <p>See also the <a class="ref" href="#framehash">framehash</a> muxer.
  4155. </p>
  4156. <a class="anchor" id="hds"></a></div>
  4157. </div>
  4158. <div class="section-level-extent" id="hds-1">
  4159. <h3 class="section"><span>4.45 hds<a class="copiable-link" href="#hds-1"> &para;</a></span></h3>
  4160. <p>HTTP Dynamic Streaming (HDS) muxer.
  4161. </p>
  4162. <p>HTTP dynamic streaming, or HDS, is an adaptive bitrate streaming method
  4163. developed by Adobe. HDS delivers MP4 video content over HTTP connections. HDS
  4164. can be used for on-demand streaming or live streaming.
  4165. </p>
  4166. <p>This muxer creates an .f4m (Adobe Flash Media Manifest File) manifest, an .abst
  4167. (Adobe Bootstrap File) for each stream, and segment files in a directory
  4168. specified as the output.
  4169. </p>
  4170. <p>These needs to be accessed by an HDS player throuhg HTTPS for it to be able to
  4171. perform playback on the generated stream.
  4172. </p>
  4173. <ul class="mini-toc">
  4174. <li><a href="#Options-25" accesskey="1">Options</a></li>
  4175. <li><a href="#Example-7" accesskey="2">Example</a></li>
  4176. </ul>
  4177. <div class="subsection-level-extent" id="Options-25">
  4178. <h4 class="subsection"><span>4.45.1 Options<a class="copiable-link" href="#Options-25"> &para;</a></span></h4>
  4179. <dl class="table">
  4180. <dt><samp class="option">extra_window_size <var class="var">int</var></samp></dt>
  4181. <dd><p>number of fragments kept outside of the manifest before removing from disk
  4182. </p>
  4183. </dd>
  4184. <dt><samp class="option">min_frag_duration <var class="var">microseconds</var></samp></dt>
  4185. <dd><p>minimum fragment duration (in microseconds), default value is 1 second
  4186. (<code class="code">10000000</code>)
  4187. </p>
  4188. </dd>
  4189. <dt><samp class="option">remove_at_exit <var class="var">bool</var></samp></dt>
  4190. <dd><p>remove all fragments when finished when set to <code class="code">true</code>
  4191. </p>
  4192. </dd>
  4193. <dt><samp class="option">window_size <var class="var">int</var></samp></dt>
  4194. <dd><p>number of fragments kept in the manifest, if set to a value different from
  4195. <code class="code">0</code>. By default all segments are kept in the output directory.
  4196. </p></dd>
  4197. </dl>
  4198. </div>
  4199. <div class="subsection-level-extent" id="Example-7">
  4200. <h4 class="subsection"><span>4.45.2 Example<a class="copiable-link" href="#Example-7"> &para;</a></span></h4>
  4201. <p>Use <code class="command">ffmpeg</code> to generate HDS files to the <samp class="file">output.hds</samp> directory in
  4202. real-time rate:
  4203. </p><div class="example">
  4204. <pre class="example-preformatted">ffmpeg -re -i INPUT -f hds -b:v 200k output.hds
  4205. </pre></div>
  4206. <a class="anchor" id="hls"></a></div>
  4207. </div>
  4208. <div class="section-level-extent" id="hls-2">
  4209. <h3 class="section"><span>4.46 hls<a class="copiable-link" href="#hls-2"> &para;</a></span></h3>
  4210. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  4211. the HTTP Live Streaming (HLS) specification.
  4212. </p>
  4213. <p>It creates a playlist file, and one or more segment files. The output filename
  4214. specifies the playlist filename.
  4215. </p>
  4216. <p>By default, the muxer creates a file for each segment produced. These files
  4217. have the same name as the playlist, followed by a sequential number and a
  4218. .ts extension.
  4219. </p>
  4220. <p>Make sure to require a closed GOP when encoding and to set the GOP
  4221. size to fit your segment time constraint.
  4222. </p>
  4223. <p>For example, to convert an input file with <code class="command">ffmpeg</code>:
  4224. </p><div class="example">
  4225. <pre class="example-preformatted">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  4226. </pre></div>
  4227. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4228. <samp class="file">out0.ts</samp>, <samp class="file">out1.ts</samp>, <samp class="file">out2.ts</samp>, etc.
  4229. </p>
  4230. <p>See also the <a class="ref" href="#segment">segment</a> muxer, which provides a more generic and
  4231. flexible implementation of a segmenter, and can be used to perform HLS
  4232. segmentation.
  4233. </p>
  4234. <ul class="mini-toc">
  4235. <li><a href="#Options-26" accesskey="1">Options</a></li>
  4236. </ul>
  4237. <div class="subsection-level-extent" id="Options-26">
  4238. <h4 class="subsection"><span>4.46.1 Options<a class="copiable-link" href="#Options-26"> &para;</a></span></h4>
  4239. <p>This muxer supports the following options:
  4240. </p>
  4241. <dl class="table">
  4242. <dt><samp class="option">hls_init_time <var class="var">duration</var></samp></dt>
  4243. <dd><p>Set the initial target segment length. Default value is <var class="var">0</var>.
  4244. </p>
  4245. <p><var class="var">duration</var> must be a time duration specification,
  4246. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  4247. </p>
  4248. <p>Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  4249. After the initial playlist is filled <code class="command">ffmpeg</code> will cut segments
  4250. at duration equal to <code class="code">hls_time</code>
  4251. </p>
  4252. </dd>
  4253. <dt><samp class="option">hls_time <var class="var">duration</var></samp></dt>
  4254. <dd><p>Set the target segment length. Default value is 2.
  4255. </p>
  4256. <p><var class="var">duration</var> must be a time duration specification,
  4257. see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  4258. Segment will be cut on the next key frame after this time has passed.
  4259. </p>
  4260. </dd>
  4261. <dt><samp class="option">hls_list_size <var class="var">size</var></samp></dt>
  4262. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  4263. will contain all the segments. Default value is 5.
  4264. </p>
  4265. </dd>
  4266. <dt><samp class="option">hls_delete_threshold <var class="var">size</var></samp></dt>
  4267. <dd><p>Set the number of unreferenced segments to keep on disk before <code class="code">hls_flags delete_segments</code>
  4268. deletes them. Increase this to allow continue clients to download segments which
  4269. were recently referenced in the playlist. Default value is 1, meaning segments older than
  4270. <code class="code">hls_list_size+1</code> will be deleted.
  4271. </p>
  4272. </dd>
  4273. <dt><samp class="option">hls_start_number_source</samp></dt>
  4274. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  4275. Unless <code class="code">hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  4276. segment and subtitle filenames. In any case, if <code class="code">hls_flags append_list</code>
  4277. is set and read playlist sequence number is greater than the specified start sequence number,
  4278. then that value will be used as start value.
  4279. </p>
  4280. <p>It accepts the following values:
  4281. </p>
  4282. <dl class="table">
  4283. <dt><samp class="option">generic (default)</samp></dt>
  4284. <dd><p>Set the starting sequence numbers according to <var class="var">start_number</var> option value.
  4285. </p>
  4286. </dd>
  4287. <dt><samp class="option">epoch</samp></dt>
  4288. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  4289. </p>
  4290. </dd>
  4291. <dt><samp class="option">epoch_us</samp></dt>
  4292. <dd><p>The start number will be the microseconds since epoch (1970-01-01 00:00:00)
  4293. </p>
  4294. </dd>
  4295. <dt><samp class="option">datetime</samp></dt>
  4296. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  4297. </p>
  4298. </dd>
  4299. </dl>
  4300. </dd>
  4301. <dt><samp class="option">start_number <var class="var">number</var></samp></dt>
  4302. <dd><p>Start the playlist sequence number (<code class="code">#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var class="var">number</var>
  4303. when <var class="var">hls_start_number_source</var> value is <var class="var">generic</var>. (This is the default case.)
  4304. Unless <code class="code">hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  4305. Default value is 0.
  4306. </p>
  4307. </dd>
  4308. <dt><samp class="option">hls_allow_cache <var class="var">allowcache</var></samp></dt>
  4309. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  4310. </p>
  4311. </dd>
  4312. <dt><samp class="option">hls_base_url <var class="var">baseurl</var></samp></dt>
  4313. <dd><p>Append <var class="var">baseurl</var> to every entry in the playlist.
  4314. Useful to generate playlists with absolute paths.
  4315. </p>
  4316. <p>Note that the playlist sequence number must be unique for each segment
  4317. and it is not to be confused with the segment filename sequence number
  4318. which can be cyclic, for example if the <samp class="option">wrap</samp> option is
  4319. specified.
  4320. </p>
  4321. </dd>
  4322. <dt><samp class="option">hls_segment_filename <var class="var">filename</var></samp></dt>
  4323. <dd><p>Set the segment filename. Unless <code class="code">hls_flags single_file</code> is set,
  4324. <var class="var">filename</var> is used as a string format with the segment number:
  4325. </p><div class="example">
  4326. <pre class="example-preformatted">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  4327. </pre></div>
  4328. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4329. <samp class="file">file000.ts</samp>, <samp class="file">file001.ts</samp>, <samp class="file">file002.ts</samp>, etc.
  4330. </p>
  4331. <p><var class="var">filename</var> may contain full path or relative path specification,
  4332. but only the file name part without any path info will be contained in the m3u8 segment list.
  4333. Should a relative path be specified, the path of the created segment
  4334. files will be relative to the current working directory.
  4335. When strftime_mkdir is set, the whole expanded value of <var class="var">filename</var> will be written into the m3u8 segment list.
  4336. </p>
  4337. <p>When <code class="code">var_stream_map</code> is set with two or more variant streams, the
  4338. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  4339. the position of variant stream index in the generated segment file names.
  4340. </p><div class="example">
  4341. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  4342. -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; \
  4343. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  4344. </pre></div>
  4345. <p>This example will produce the playlists segment file sets:
  4346. <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
  4347. <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.
  4348. </p>
  4349. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  4350. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  4351. sub-directory or filename.) If the string %v is present in the directory name, then
  4352. sub-directories are created after expanding the directory name pattern. This
  4353. enables creation of segments corresponding to different variant streams in
  4354. subdirectories.
  4355. </p><div class="example">
  4356. <pre class="example-preformatted">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  4357. -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; \
  4358. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  4359. </pre></div>
  4360. <p>This example will produce the playlists segment file sets:
  4361. <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
  4362. <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.
  4363. </p>
  4364. </dd>
  4365. <dt><samp class="option">strftime</samp></dt>
  4366. <dd><p>Use strftime() on <var class="var">filename</var> to expand the segment filename with localtime.
  4367. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  4368. hls_flag and %%d will be the specifier.
  4369. </p><div class="example">
  4370. <pre class="example-preformatted">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  4371. </pre></div>
  4372. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4373. <samp class="file">file-20160215-1455569023.ts</samp>, <samp class="file">file-20160215-1455569024.ts</samp>, etc.
  4374. Note: On some systems/environments, the <code class="code">%s</code> specifier is not available. See
  4375. <code class="code">strftime()</code> documentation.
  4376. </p><div class="example">
  4377. <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
  4378. </pre></div>
  4379. <p>This example will produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4380. <samp class="file">file-20160215-0001.ts</samp>, <samp class="file">file-20160215-0002.ts</samp>, etc.
  4381. </p>
  4382. </dd>
  4383. <dt><samp class="option">strftime_mkdir</samp></dt>
  4384. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  4385. is expanded in <var class="var">filename</var>.
  4386. </p><div class="example">
  4387. <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
  4388. </pre></div>
  4389. <p>This example will create a directory 201560215 (if it does not exist), and then
  4390. produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4391. <samp class="file">20160215/file-20160215-1455569023.ts</samp>, <samp class="file">20160215/file-20160215-1455569024.ts</samp>, etc.
  4392. </p>
  4393. <div class="example">
  4394. <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
  4395. </pre></div>
  4396. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  4397. produce the playlist, <samp class="file">out.m3u8</samp>, and segment files:
  4398. <samp class="file">2016/02/15/file-20160215-1455569023.ts</samp>, <samp class="file">2016/02/15/file-20160215-1455569024.ts</samp>, etc.
  4399. </p>
  4400. </dd>
  4401. <dt><samp class="option">hls_segment_options <var class="var">options_list</var></samp></dt>
  4402. <dd><p>Set output format options using a :-separated list of key=value
  4403. parameters. Values containing <code class="code">:</code> special characters must be
  4404. escaped.
  4405. </p>
  4406. </dd>
  4407. <dt><samp class="option">hls_key_info_file <var class="var">key_info_file</var></samp></dt>
  4408. <dd><p>Use the information in <var class="var">key_info_file</var> for segment encryption. The first
  4409. line of <var class="var">key_info_file</var> specifies the key URI written to the playlist. The
  4410. key URL is used to access the encryption key during playback. The second line
  4411. specifies the path to the key file used to obtain the key during the encryption
  4412. process. The key file is read as a single packed array of 16 octets in binary
  4413. format. The optional third line specifies the initialization vector (IV) as a
  4414. hexadecimal string to be used instead of the segment sequence number (default)
  4415. for encryption. Changes to <var class="var">key_info_file</var> will result in segment
  4416. encryption with the new key/IV and an entry in the playlist for the new key
  4417. URI/IV if <code class="code">hls_flags periodic_rekey</code> is enabled.
  4418. </p>
  4419. <p>Key info file format:
  4420. </p><div class="example">
  4421. <pre class="example-preformatted"><var class="var">key URI</var>
  4422. <var class="var">key file path</var>
  4423. <var class="var">IV</var> (optional)
  4424. </pre></div>
  4425. <p>Example key URIs:
  4426. </p><div class="example">
  4427. <pre class="example-preformatted">http://server/file.key
  4428. /path/to/file.key
  4429. file.key
  4430. </pre></div>
  4431. <p>Example key file paths:
  4432. </p><div class="example">
  4433. <pre class="example-preformatted">file.key
  4434. /path/to/file.key
  4435. </pre></div>
  4436. <p>Example IV:
  4437. </p><div class="example">
  4438. <pre class="example-preformatted">0123456789ABCDEF0123456789ABCDEF
  4439. </pre></div>
  4440. <p>Key info file example:
  4441. </p><div class="example">
  4442. <pre class="example-preformatted">http://server/file.key
  4443. /path/to/file.key
  4444. 0123456789ABCDEF0123456789ABCDEF
  4445. </pre></div>
  4446. <p>Example shell script:
  4447. </p><div class="example">
  4448. <pre class="example-preformatted">#!/bin/sh
  4449. BASE_URL=${1:-'.'}
  4450. openssl rand 16 &gt; file.key
  4451. echo $BASE_URL/file.key &gt; file.keyinfo
  4452. echo file.key &gt;&gt; file.keyinfo
  4453. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  4454. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  4455. -hls_key_info_file file.keyinfo out.m3u8
  4456. </pre></div>
  4457. </dd>
  4458. <dt><samp class="option">-hls_enc <var class="var">enc</var></samp></dt>
  4459. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  4460. When enabled every segment generated is encrypted and the encryption key
  4461. is saved as <var class="var">playlist name</var>.key.
  4462. </p>
  4463. </dd>
  4464. <dt><samp class="option">-hls_enc_key <var class="var">key</var></samp></dt>
  4465. <dd><p>16-octet key to encrypt the segments, by default it
  4466. is randomly generated.
  4467. </p>
  4468. </dd>
  4469. <dt><samp class="option">-hls_enc_key_url <var class="var">keyurl</var></samp></dt>
  4470. <dd><p>If set, <var class="var">keyurl</var> is prepended instead of <var class="var">baseurl</var> to the key filename
  4471. in the playlist.
  4472. </p>
  4473. </dd>
  4474. <dt><samp class="option">-hls_enc_iv <var class="var">iv</var></samp></dt>
  4475. <dd><p>16-octet initialization vector for every segment instead
  4476. of the autogenerated ones.
  4477. </p>
  4478. </dd>
  4479. <dt><samp class="option">hls_segment_type <var class="var">flags</var></samp></dt>
  4480. <dd><p>Possible values:
  4481. </p>
  4482. <dl class="table">
  4483. <dt>&lsquo;<samp class="samp">mpegts</samp>&rsquo;</dt>
  4484. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  4485. compatible with all HLS versions.
  4486. </p>
  4487. </dd>
  4488. <dt>&lsquo;<samp class="samp">fmp4</samp>&rsquo;</dt>
  4489. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  4490. fmp4 files may be used in HLS version 7 and above.
  4491. </p>
  4492. </dd>
  4493. </dl>
  4494. </dd>
  4495. <dt><samp class="option">hls_fmp4_init_filename <var class="var">filename</var></samp></dt>
  4496. <dd><p>Set filename to the fragment files header file, default filename is <samp class="file">init.mp4</samp>.
  4497. </p>
  4498. <p>Use <code class="code">-strftime 1</code> on <var class="var">filename</var> to expand the segment filename with localtime.
  4499. </p><div class="example">
  4500. <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
  4501. </pre></div>
  4502. <p>This will produce init like this
  4503. <samp class="file">1602678741_init.mp4</samp>
  4504. </p>
  4505. </dd>
  4506. <dt><samp class="option">hls_fmp4_init_resend</samp></dt>
  4507. <dd><p>Resend init file after m3u8 file refresh every time, default is <var class="var">0</var>.
  4508. </p>
  4509. <p>When <code class="code">var_stream_map</code> is set with two or more variant streams, the
  4510. <var class="var">filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  4511. the position of variant stream index in the generated init file names.
  4512. The string &quot;%v&quot; may be present in the filename or in the last directory name
  4513. containing the file. If the string is present in the directory name, then
  4514. sub-directories are created after expanding the directory name pattern. This
  4515. enables creation of init files corresponding to different variant streams in
  4516. subdirectories.
  4517. </p>
  4518. </dd>
  4519. <dt><samp class="option">hls_flags <var class="var">flags</var></samp></dt>
  4520. <dd><p>Possible values:
  4521. </p>
  4522. <dl class="table">
  4523. <dt>&lsquo;<samp class="samp">single_file</samp>&rsquo;</dt>
  4524. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  4525. file, and will use byte ranges in the playlist. HLS playlists generated with
  4526. this way will have the version number 4.
  4527. For example:
  4528. </p><div class="example">
  4529. <pre class="example-preformatted">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  4530. </pre></div>
  4531. <p>Will produce the playlist, <samp class="file">out.m3u8</samp>, and a single segment file,
  4532. <samp class="file">out.ts</samp>.
  4533. </p>
  4534. </dd>
  4535. <dt>&lsquo;<samp class="samp">delete_segments</samp>&rsquo;</dt>
  4536. <dd><p>Segment files removed from the playlist are deleted after a period of time
  4537. equal to the duration of the segment plus the duration of the playlist.
  4538. </p>
  4539. </dd>
  4540. <dt>&lsquo;<samp class="samp">append_list</samp>&rsquo;</dt>
  4541. <dd><p>Append new segments into the end of old segment list,
  4542. and remove the <code class="code">#EXT-X-ENDLIST</code> from the old segment list.
  4543. </p>
  4544. </dd>
  4545. <dt>&lsquo;<samp class="samp">round_durations</samp>&rsquo;</dt>
  4546. <dd><p>Round the duration info in the playlist file segment info to integer
  4547. values, instead of using floating point.
  4548. If there are no other features requiring higher HLS versions be used,
  4549. then this will allow ffmpeg to output a HLS version 2 m3u8.
  4550. </p>
  4551. </dd>
  4552. <dt>&lsquo;<samp class="samp">discont_start</samp>&rsquo;</dt>
  4553. <dd><p>Add the <code class="code">#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  4554. first segment&rsquo;s information.
  4555. </p>
  4556. </dd>
  4557. <dt>&lsquo;<samp class="samp">omit_endlist</samp>&rsquo;</dt>
  4558. <dd><p>Do not append the <code class="code">EXT-X-ENDLIST</code> tag at the end of the playlist.
  4559. </p>
  4560. </dd>
  4561. <dt>&lsquo;<samp class="samp">periodic_rekey</samp>&rsquo;</dt>
  4562. <dd><p>The file specified by <code class="code">hls_key_info_file</code> will be checked periodically and
  4563. detect updates to the encryption info. Be sure to replace this file atomically,
  4564. including the file containing the AES encryption key.
  4565. </p>
  4566. </dd>
  4567. <dt>&lsquo;<samp class="samp">independent_segments</samp>&rsquo;</dt>
  4568. <dd><p>Add the <code class="code">#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  4569. and when all the segments of that playlist are guaranteed to start with a Key frame.
  4570. </p>
  4571. </dd>
  4572. <dt>&lsquo;<samp class="samp">iframes_only</samp>&rsquo;</dt>
  4573. <dd><p>Add the <code class="code">#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  4574. and can play only I-frames in the <code class="code">#EXT-X-BYTERANGE</code> mode.
  4575. </p>
  4576. </dd>
  4577. <dt>&lsquo;<samp class="samp">split_by_time</samp>&rsquo;</dt>
  4578. <dd><p>Allow segments to start on frames other than keyframes. This improves
  4579. behavior on some players when the time between keyframes is inconsistent,
  4580. but may make things worse on others, and can cause some oddities during
  4581. seeking. This flag should be used with the <code class="code">hls_time</code> option.
  4582. </p>
  4583. </dd>
  4584. <dt>&lsquo;<samp class="samp">program_date_time</samp>&rsquo;</dt>
  4585. <dd><p>Generate <code class="code">EXT-X-PROGRAM-DATE-TIME</code> tags.
  4586. </p>
  4587. </dd>
  4588. <dt>&lsquo;<samp class="samp">second_level_segment_index</samp>&rsquo;</dt>
  4589. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  4590. besides date/time values when strftime is on.
  4591. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  4592. </p>
  4593. </dd>
  4594. <dt>&lsquo;<samp class="samp">second_level_segment_size</samp>&rsquo;</dt>
  4595. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  4596. expression besides date/time values when strftime is on.
  4597. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  4598. </p>
  4599. </dd>
  4600. <dt>&lsquo;<samp class="samp">second_level_segment_duration</samp>&rsquo;</dt>
  4601. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  4602. expression besides date/time values when strftime is on.
  4603. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  4604. </p>
  4605. <div class="example">
  4606. <pre class="example-preformatted">ffmpeg -i sample.mpeg \
  4607. -f hls -hls_time 3 -hls_list_size 5 \
  4608. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  4609. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  4610. </pre></div>
  4611. <p>This will produce segments like this:
  4612. <samp class="file">segment_20170102194334_0003_00122200_0000003000000.ts</samp>, <samp class="file">segment_20170102194334_0004_00120072_0000003000000.ts</samp> etc.
  4613. </p>
  4614. </dd>
  4615. <dt>&lsquo;<samp class="samp">temp_file</samp>&rsquo;</dt>
  4616. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  4617. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  4618. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  4619. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  4620. 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>
  4621. 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,
  4622. are always written into temporary file regardless of this flag if <code class="code">master_pl_publish_rate</code> value is other than zero.
  4623. </p>
  4624. </dd>
  4625. </dl>
  4626. </dd>
  4627. <dt><samp class="option">hls_playlist_type event</samp></dt>
  4628. <dd><p>Emit <code class="code">#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  4629. <samp class="option">hls_list_size</samp> to 0; the playlist can only be appended to.
  4630. </p>
  4631. </dd>
  4632. <dt><samp class="option">hls_playlist_type vod</samp></dt>
  4633. <dd><p>Emit <code class="code">#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  4634. <samp class="option">hls_list_size</samp> to 0; the playlist must not change.
  4635. </p>
  4636. </dd>
  4637. <dt><samp class="option">method</samp></dt>
  4638. <dd><p>Use the given HTTP method to create the hls files.
  4639. </p><div class="example">
  4640. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  4641. </pre></div>
  4642. <p>This example will upload all the mpegts segment files to the HTTP
  4643. server using the HTTP PUT method, and update the m3u8 files every
  4644. <code class="code">refresh</code> times using the same method.
  4645. Note that the HTTP server must support the given method for uploading
  4646. files.
  4647. </p>
  4648. </dd>
  4649. <dt><samp class="option">http_user_agent</samp></dt>
  4650. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  4651. </p>
  4652. </dd>
  4653. <dt><samp class="option">var_stream_map</samp></dt>
  4654. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  4655. into different variant streams. The variant stream groups are separated
  4656. by space.
  4657. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  4658. the keys to specify audio, video and subtitle streams respectively.
  4659. Allowed values are 0 to 9 (limited just based on practical usage).
  4660. </p>
  4661. <p>When there are two or more variant streams, the output filename pattern must
  4662. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  4663. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  4664. the filename or in the last directory name containing the file. If the string is
  4665. present in the directory name, then sub-directories are created after expanding
  4666. the directory name pattern. This enables creation of variant streams in
  4667. subdirectories.
  4668. </p>
  4669. <div class="example">
  4670. <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 \
  4671. -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; \
  4672. http://example.com/live/out_%v.m3u8
  4673. </pre></div>
  4674. <p>This example creates two hls variant streams. The first variant stream will
  4675. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  4676. second variant stream will contain video stream of bitrate 256k and audio
  4677. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  4678. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  4679. in result names, you may specify names for each or some of the variants
  4680. as in the following example.
  4681. </p>
  4682. <div class="example">
  4683. <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 \
  4684. -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; \
  4685. http://example.com/live/out_%v.m3u8
  4686. </pre></div>
  4687. <p>This example creates two hls variant streams as in the previous one.
  4688. But here, the two media playlist with file names out_my_hd.m3u8 and
  4689. out_my_sd.m3u8 will be created.
  4690. </p>
  4691. <div class="example">
  4692. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  4693. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  4694. http://example.com/live/out_%v.m3u8
  4695. </pre></div>
  4696. <p>This example creates three hls variant streams. The first variant stream will
  4697. be a video only stream with video bitrate 1000k, the second variant stream will
  4698. be an audio only stream with bitrate 64k and the third variant stream will be a
  4699. video only stream with bitrate 256k. Here, three media playlist with file names
  4700. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  4701. </p><div class="example">
  4702. <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 \
  4703. -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; \
  4704. http://example.com/live/vs_%v/out.m3u8
  4705. </pre></div>
  4706. <p>This example creates the variant streams in subdirectories. Here, the first
  4707. media playlist is created at <samp class="file">http://example.com/live/vs_0/out.m3u8</samp> and
  4708. the second one at <samp class="file">http://example.com/live/vs_1/out.m3u8</samp>.
  4709. </p><div class="example">
  4710. <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 \
  4711. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  4712. -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; \
  4713. -master_pl_name master.m3u8 \
  4714. http://example.com/live/out_%v.m3u8
  4715. </pre></div>
  4716. <p>This example creates two audio only and two video only variant streams. In
  4717. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  4718. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  4719. and they are mapped to the two video only variant streams with audio group names
  4720. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  4721. </p>
  4722. <p>By default, a single hls variant containing all the encoded streams is created.
  4723. </p>
  4724. <div class="example">
  4725. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  4726. -map 0:a -map 0:a -map 0:v -f hls \
  4727. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  4728. -master_pl_name master.m3u8 \
  4729. http://example.com/live/out_%v.m3u8
  4730. </pre></div>
  4731. <p>This example creates two audio only and one video only variant streams. In
  4732. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  4733. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  4734. and they are mapped to the one video only variant streams with audio group name
  4735. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  4736. </p>
  4737. <p>By default, a single hls variant containing all the encoded streams is created.
  4738. </p>
  4739. <div class="example">
  4740. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  4741. -map 0:a -map 0:a -map 0:v -f hls \
  4742. -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; \
  4743. -master_pl_name master.m3u8 \
  4744. http://example.com/live/out_%v.m3u8
  4745. </pre></div>
  4746. <p>This example creates two audio only and one video only variant streams. In
  4747. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  4748. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  4749. and they are mapped to the one video only variant streams with audio group name
  4750. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  4751. have and language is named ENG, the other audio language is named CHN.
  4752. </p>
  4753. <p>By default, a single hls variant containing all the encoded streams is created.
  4754. </p>
  4755. <div class="example">
  4756. <pre class="example-preformatted">ffmpeg -y -i input_with_subtitle.mkv \
  4757. -b:v:0 5250k -c:v h264 -pix_fmt yuv420p -profile:v main -level 4.1 \
  4758. -b:a:0 256k \
  4759. -c:s webvtt -c:a mp2 -ar 48000 -ac 2 -map 0:v -map 0:a:0 -map 0:s:0 \
  4760. -f hls -var_stream_map &quot;v:0,a:0,s:0,sgroup:subtitle&quot; \
  4761. -master_pl_name master.m3u8 -t 300 -hls_time 10 -hls_init_time 4 -hls_list_size \
  4762. 10 -master_pl_publish_rate 10 -hls_flags \
  4763. delete_segments+discont_start+split_by_time ./tmp/video.m3u8
  4764. </pre></div>
  4765. <p>This example adds <code class="code">#EXT-X-MEDIA</code> tag with <code class="code">TYPE=SUBTITLES</code> in
  4766. the master playlist with webvtt subtitle group name &rsquo;subtitle&rsquo;. Please make sure
  4767. the input file has one text subtitle stream at least.
  4768. </p>
  4769. </dd>
  4770. <dt><samp class="option">cc_stream_map</samp></dt>
  4771. <dd><p>Map string which specifies different closed captions groups and their
  4772. attributes. The closed captions stream groups are separated by space.
  4773. Expected string format is like this
  4774. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  4775. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  4776. attribute.
  4777. The closed captions groups configured using this option are mapped to different
  4778. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  4779. <code class="code">var_stream_map</code> string. If <code class="code">var_stream_map</code> is not set, then the
  4780. first available ccgroup in <code class="code">cc_stream_map</code> is mapped to the output variant
  4781. stream. The examples for these two use cases are given below.
  4782. </p>
  4783. <div class="example">
  4784. <pre class="example-preformatted">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  4785. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  4786. -master_pl_name master.m3u8 \
  4787. http://example.com/live/out.m3u8
  4788. </pre></div>
  4789. <p>This example adds <code class="code">#EXT-X-MEDIA</code> tag with <code class="code">TYPE=CLOSED-CAPTIONS</code> in
  4790. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  4791. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code class="code">CLOSED-CAPTIONS</code> attribute with group
  4792. name &rsquo;cc&rsquo; for the output variant stream.
  4793. </p><div class="example">
  4794. <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 \
  4795. -a53cc:0 1 -a53cc:1 1\
  4796. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  4797. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  4798. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  4799. -master_pl_name master.m3u8 \
  4800. http://example.com/live/out_%v.m3u8
  4801. </pre></div>
  4802. <p>This example adds two <code class="code">#EXT-X-MEDIA</code> tags with <code class="code">TYPE=CLOSED-CAPTIONS</code> in
  4803. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  4804. <code class="code">CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  4805. streams.
  4806. </p>
  4807. </dd>
  4808. <dt><samp class="option">master_pl_name</samp></dt>
  4809. <dd><p>Create HLS master playlist with the given name.
  4810. </p>
  4811. <div class="example">
  4812. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  4813. </pre></div>
  4814. <p>This example creates HLS master playlist with name master.m3u8 and it is
  4815. published at http://example.com/live/
  4816. </p>
  4817. </dd>
  4818. <dt><samp class="option">master_pl_publish_rate</samp></dt>
  4819. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  4820. </p>
  4821. <div class="example">
  4822. <pre class="example-preformatted">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  4823. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  4824. </pre></div>
  4825. <p>This example creates HLS master playlist with name master.m3u8 and keep
  4826. publishing it repeatedly every after 30 segments i.e. every after 60s.
  4827. </p>
  4828. </dd>
  4829. <dt><samp class="option">http_persistent</samp></dt>
  4830. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  4831. </p>
  4832. </dd>
  4833. <dt><samp class="option">timeout</samp></dt>
  4834. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  4835. </p>
  4836. </dd>
  4837. <dt><samp class="option">ignore_io_errors</samp></dt>
  4838. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  4839. </p>
  4840. </dd>
  4841. <dt><samp class="option">headers</samp></dt>
  4842. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  4843. </p>
  4844. </dd>
  4845. </dl>
  4846. <a class="anchor" id="ico"></a></div>
  4847. </div>
  4848. <div class="section-level-extent" id="ico-1">
  4849. <h3 class="section"><span>4.47 ico<a class="copiable-link" href="#ico-1"> &para;</a></span></h3>
  4850. <p>ICO file muxer.
  4851. </p>
  4852. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  4853. </p>
  4854. <ul class="itemize mark-bullet">
  4855. <li>Size cannot exceed 256 pixels in any dimension
  4856. </li><li>Only BMP and PNG images can be stored
  4857. </li><li>If a BMP image is used, it must be one of the following pixel formats:
  4858. <div class="example">
  4859. <pre class="example-preformatted">BMP Bit Depth FFmpeg Pixel Format
  4860. 1bit pal8
  4861. 4bit pal8
  4862. 8bit pal8
  4863. 16bit rgb555le
  4864. 24bit bgr24
  4865. 32bit bgra
  4866. </pre></div>
  4867. </li><li>If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  4868. </li><li>If a PNG image is used, it must use the rgba pixel format
  4869. </li></ul>
  4870. <a class="anchor" id="image2"></a></div>
  4871. <div class="section-level-extent" id="image2-2">
  4872. <h3 class="section"><span>4.48 image2<a class="copiable-link" href="#image2-2"> &para;</a></span></h3>
  4873. <p>Image file muxer.
  4874. </p>
  4875. <p>The image file muxer writes video frames to image files.
  4876. </p>
  4877. <p>The output filenames are specified by a pattern, which can be used to
  4878. produce sequentially numbered series of files.
  4879. The pattern may contain the string &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, this string
  4880. specifies the position of the characters representing a numbering in
  4881. the filenames. If the form &quot;%0<var class="var">N</var>d&quot; is used, the string
  4882. representing the number in each filename is 0-padded to <var class="var">N</var>
  4883. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  4884. the string &quot;%%&quot;.
  4885. </p>
  4886. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var class="var">N</var>d&quot;, the first filename of
  4887. the file list specified will contain the number 1, all the following
  4888. numbers will be sequential.
  4889. </p>
  4890. <p>The pattern may contain a suffix which is used to automatically
  4891. determine the format of the image files to write.
  4892. </p>
  4893. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  4894. filenames of the form <samp class="file">img-001.bmp</samp>, <samp class="file">img-002.bmp</samp>, ...,
  4895. <samp class="file">img-010.bmp</samp>, etc.
  4896. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  4897. form <samp class="file">img%-1.jpg</samp>, <samp class="file">img%-2.jpg</samp>, ..., <samp class="file">img%-10.jpg</samp>,
  4898. etc.
  4899. </p>
  4900. <p>The image muxer supports the .Y.U.V image file format. This format is
  4901. special in that each image frame consists of three files, for
  4902. each of the YUV420P components. To read or write this image file format,
  4903. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  4904. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  4905. </p>
  4906. <ul class="mini-toc">
  4907. <li><a href="#Options-27" accesskey="1">Options</a></li>
  4908. <li><a href="#Examples-11" accesskey="2">Examples</a></li>
  4909. </ul>
  4910. <div class="subsection-level-extent" id="Options-27">
  4911. <h4 class="subsection"><span>4.48.1 Options<a class="copiable-link" href="#Options-27"> &para;</a></span></h4>
  4912. <dl class="table">
  4913. <dt><samp class="option">frame_pts</samp></dt>
  4914. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  4915. Default value is 0.
  4916. </p>
  4917. </dd>
  4918. <dt><samp class="option">start_number</samp></dt>
  4919. <dd><p>Start the sequence from the specified number. Default value is 1.
  4920. </p>
  4921. </dd>
  4922. <dt><samp class="option">update</samp></dt>
  4923. <dd><p>If set to 1, the filename will always be interpreted as just a
  4924. filename, not a pattern, and the corresponding file will be continuously
  4925. overwritten with new images. Default value is 0.
  4926. </p>
  4927. </dd>
  4928. <dt><samp class="option">strftime</samp></dt>
  4929. <dd><p>If set to 1, expand the filename with date and time information from
  4930. <code class="code">strftime()</code>. Default value is 0.
  4931. </p>
  4932. </dd>
  4933. <dt><samp class="option">atomic_writing</samp></dt>
  4934. <dd><p>Write output to a temporary file, which is renamed to target filename once
  4935. writing is completed. Default is disabled.
  4936. </p>
  4937. </dd>
  4938. <dt><samp class="option">protocol_opts <var class="var">options_list</var></samp></dt>
  4939. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  4940. containing the <code class="code">:</code> special character must be escaped.
  4941. </p>
  4942. </dd>
  4943. </dl>
  4944. </div>
  4945. <div class="subsection-level-extent" id="Examples-11">
  4946. <h4 class="subsection"><span>4.48.2 Examples<a class="copiable-link" href="#Examples-11"> &para;</a></span></h4>
  4947. <p>The following example shows how to use <code class="command">ffmpeg</code> for creating a
  4948. sequence of files <samp class="file">img-001.jpeg</samp>, <samp class="file">img-002.jpeg</samp>, ...,
  4949. taking one image every second from the input video:
  4950. </p><div class="example">
  4951. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  4952. </pre></div>
  4953. <p>Note that with <code class="command">ffmpeg</code>, if the format is not specified with the
  4954. <code class="code">-f</code> option and the output filename specifies an image file
  4955. format, the image2 muxer is automatically selected, so the previous
  4956. command can be written as:
  4957. </p><div class="example">
  4958. <pre class="example-preformatted">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  4959. </pre></div>
  4960. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  4961. &quot;%0<var class="var">N</var>d&quot;, for example to create a single image file
  4962. <samp class="file">img.jpeg</samp> from the start of the input video you can employ the command:
  4963. </p><div class="example">
  4964. <pre class="example-preformatted">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  4965. </pre></div>
  4966. <p>The <samp class="option">strftime</samp> option allows you to expand the filename with
  4967. date and time information. Check the documentation of
  4968. the <code class="code">strftime()</code> function for the syntax.
  4969. </p>
  4970. <p>For example to generate image files from the <code class="code">strftime()</code>
  4971. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code class="command">ffmpeg</code> command
  4972. can be used:
  4973. </p><div class="example">
  4974. <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;
  4975. </pre></div>
  4976. <p>You can set the file name with current frame&rsquo;s PTS:
  4977. </p><div class="example">
  4978. <pre class="example-preformatted">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg
  4979. </pre></div>
  4980. <p>A more complex example is to publish contents of your desktop directly to a
  4981. WebDAV server every second:
  4982. </p><div class="example">
  4983. <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
  4984. </pre></div>
  4985. </div>
  4986. </div>
  4987. <div class="section-level-extent" id="matroska">
  4988. <h3 class="section"><span>4.49 matroska<a class="copiable-link" href="#matroska"> &para;</a></span></h3>
  4989. <p>Matroska container muxer.
  4990. </p>
  4991. <p>This muxer implements the matroska and webm container specs.
  4992. </p>
  4993. <ul class="mini-toc">
  4994. <li><a href="#Metadata" accesskey="1">Metadata</a></li>
  4995. <li><a href="#Options-28" accesskey="2">Options</a></li>
  4996. </ul>
  4997. <div class="subsection-level-extent" id="Metadata">
  4998. <h4 class="subsection"><span>4.49.1 Metadata<a class="copiable-link" href="#Metadata"> &para;</a></span></h4>
  4999. <p>The recognized metadata settings in this muxer are:
  5000. </p>
  5001. <dl class="table">
  5002. <dt><samp class="option">title</samp></dt>
  5003. <dd><p>Set title name provided to a single track. This gets mapped to
  5004. the FileDescription element for a stream written as attachment.
  5005. </p>
  5006. </dd>
  5007. <dt><samp class="option">language</samp></dt>
  5008. <dd><p>Specify the language of the track in the Matroska languages form.
  5009. </p>
  5010. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  5011. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  5012. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  5013. French).
  5014. </p>
  5015. </dd>
  5016. <dt><samp class="option">stereo_mode</samp></dt>
  5017. <dd><p>Set stereo 3D video layout of two views in a single video track.
  5018. </p>
  5019. <p>The following values are recognized:
  5020. </p><dl class="table">
  5021. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  5022. <dd><p>video is not stereo
  5023. </p></dd>
  5024. <dt>&lsquo;<samp class="samp">left_right</samp>&rsquo;</dt>
  5025. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  5026. </p></dd>
  5027. <dt>&lsquo;<samp class="samp">bottom_top</samp>&rsquo;</dt>
  5028. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  5029. </p></dd>
  5030. <dt>&lsquo;<samp class="samp">top_bottom</samp>&rsquo;</dt>
  5031. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  5032. </p></dd>
  5033. <dt>&lsquo;<samp class="samp">checkerboard_rl</samp>&rsquo;</dt>
  5034. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  5035. </p></dd>
  5036. <dt>&lsquo;<samp class="samp">checkerboard_lr</samp>&rsquo;</dt>
  5037. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  5038. </p></dd>
  5039. <dt>&lsquo;<samp class="samp">row_interleaved_rl</samp>&rsquo;</dt>
  5040. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  5041. </p></dd>
  5042. <dt>&lsquo;<samp class="samp">row_interleaved_lr</samp>&rsquo;</dt>
  5043. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  5044. </p></dd>
  5045. <dt>&lsquo;<samp class="samp">col_interleaved_rl</samp>&rsquo;</dt>
  5046. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  5047. </p></dd>
  5048. <dt>&lsquo;<samp class="samp">col_interleaved_lr</samp>&rsquo;</dt>
  5049. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  5050. </p></dd>
  5051. <dt>&lsquo;<samp class="samp">anaglyph_cyan_red</samp>&rsquo;</dt>
  5052. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  5053. </p></dd>
  5054. <dt>&lsquo;<samp class="samp">right_left</samp>&rsquo;</dt>
  5055. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  5056. </p></dd>
  5057. <dt>&lsquo;<samp class="samp">anaglyph_green_magenta</samp>&rsquo;</dt>
  5058. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  5059. </p></dd>
  5060. <dt>&lsquo;<samp class="samp">block_lr</samp>&rsquo;</dt>
  5061. <dd><p>Both eyes laced in one Block, Left-eye view is first
  5062. </p></dd>
  5063. <dt>&lsquo;<samp class="samp">block_rl</samp>&rsquo;</dt>
  5064. <dd><p>Both eyes laced in one Block, Right-eye view is first
  5065. </p></dd>
  5066. </dl>
  5067. </dd>
  5068. </dl>
  5069. <p>For example a 3D WebM clip can be created using the following command line:
  5070. </p><div class="example">
  5071. <pre class="example-preformatted">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  5072. </pre></div>
  5073. </div>
  5074. <div class="subsection-level-extent" id="Options-28">
  5075. <h4 class="subsection"><span>4.49.2 Options<a class="copiable-link" href="#Options-28"> &para;</a></span></h4>
  5076. <p>This muxer supports the following options:
  5077. </p>
  5078. <dl class="table">
  5079. <dt><samp class="option">reserve_index_space</samp></dt>
  5080. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  5081. terms) at the end of the file, because it cannot know in advance how much space
  5082. to leave for the index at the beginning of the file. However for some use cases
  5083. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  5084. index at the beginning of the file.
  5085. </p>
  5086. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  5087. of space in the file header and then try to write the cues there when the muxing
  5088. finishes. If the reserved space does not suffice, no Cues will be written, the
  5089. file will be finalized and writing the trailer will return an error.
  5090. A safe size for most use cases should be about 50kB per hour of video.
  5091. </p>
  5092. <p>Note that cues are only written if the output is seekable and this option will
  5093. have no effect if it is not.
  5094. </p>
  5095. </dd>
  5096. <dt><samp class="option">cues_to_front</samp></dt>
  5097. <dd><p>If set, the muxer will write the index at the beginning of the file
  5098. by shifting the main data if necessary. This can be combined with
  5099. reserve_index_space in which case the data is only shifted if
  5100. the initially reserved space turns out to be insufficient.
  5101. </p>
  5102. <p>This option is ignored if the output is unseekable.
  5103. </p>
  5104. </dd>
  5105. <dt><samp class="option">default_mode</samp></dt>
  5106. <dd><p>This option controls how the FlagDefault of the output tracks will be set.
  5107. It influences which tracks players should play by default. The default mode
  5108. is &lsquo;<samp class="samp">passthrough</samp>&rsquo;.
  5109. </p><dl class="table">
  5110. <dt>&lsquo;<samp class="samp">infer</samp>&rsquo;</dt>
  5111. <dd><p>Every track with disposition default will have the FlagDefault set.
  5112. Additionally, for each type of track (audio, video or subtitle), if no track
  5113. with disposition default of this type exists, then the first track of this type
  5114. will be marked as default (if existing). This ensures that the default flag
  5115. is set in a sensible way even if the input originated from containers that
  5116. lack the concept of default tracks.
  5117. </p></dd>
  5118. <dt>&lsquo;<samp class="samp">infer_no_subs</samp>&rsquo;</dt>
  5119. <dd><p>This mode is the same as infer except that if no subtitle track with
  5120. disposition default exists, no subtitle track will be marked as default.
  5121. </p></dd>
  5122. <dt>&lsquo;<samp class="samp">passthrough</samp>&rsquo;</dt>
  5123. <dd><p>In this mode the FlagDefault is set if and only if the AV_DISPOSITION_DEFAULT
  5124. flag is set in the disposition of the corresponding stream.
  5125. </p></dd>
  5126. </dl>
  5127. </dd>
  5128. <dt><samp class="option">flipped_raw_rgb</samp></dt>
  5129. <dd><p>If set to true, store positive height for raw RGB bitmaps, which indicates
  5130. bitmap is stored bottom-up. Note that this option does not flip the bitmap
  5131. which has to be done manually beforehand, e.g. by using the vflip filter.
  5132. Default is <var class="var">false</var> and indicates bitmap is stored top down.
  5133. </p>
  5134. </dd>
  5135. </dl>
  5136. <a class="anchor" id="md5"></a></div>
  5137. </div>
  5138. <div class="section-level-extent" id="md5-1">
  5139. <h3 class="section"><span>4.50 md5<a class="copiable-link" href="#md5-1"> &para;</a></span></h3>
  5140. <p>MD5 testing format.
  5141. </p>
  5142. <p>This is a variant of the <a class="ref" href="#hash">hash</a> muxer. Unlike that muxer, it
  5143. defaults to using the MD5 hash function.
  5144. </p>
  5145. <ul class="mini-toc">
  5146. <li><a href="#Examples-12" accesskey="1">Examples</a></li>
  5147. </ul>
  5148. <div class="subsection-level-extent" id="Examples-12">
  5149. <h4 class="subsection"><span>4.50.1 Examples<a class="copiable-link" href="#Examples-12"> &para;</a></span></h4>
  5150. <p>To compute the MD5 hash of the input converted to raw
  5151. audio and video, and store it in the file <samp class="file">out.md5</samp>:
  5152. </p><div class="example">
  5153. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 out.md5
  5154. </pre></div>
  5155. <p>You can print the MD5 to stdout with the command:
  5156. </p><div class="example">
  5157. <pre class="example-preformatted">ffmpeg -i INPUT -f md5 -
  5158. </pre></div>
  5159. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framemd5">framemd5</a> muxers.
  5160. </p>
  5161. </div>
  5162. </div>
  5163. <div class="section-level-extent" id="mp3">
  5164. <h3 class="section"><span>4.51 mp3<a class="copiable-link" href="#mp3"> &para;</a></span></h3>
  5165. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  5166. </p><ul class="itemize mark-bullet">
  5167. <li>An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  5168. 2.4 are supported, the <code class="code">id3v2_version</code> private option controls which one is
  5169. used (3 or 4). Setting <code class="code">id3v2_version</code> to 0 disables the ID3v2 header
  5170. completely.
  5171. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  5172. The pictures are supplied to the muxer in form of a video stream with a single
  5173. packet. There can be any number of those streams, each will correspond to a
  5174. single APIC frame. The stream metadata tags <var class="var">title</var> and <var class="var">comment</var> map
  5175. to APIC <var class="var">description</var> and <var class="var">picture type</var> respectively. See
  5176. <a class="url" href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  5177. </p>
  5178. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  5179. buffer the audio frames until it gets all the pictures. It is therefore advised
  5180. to provide the pictures as soon as possible to avoid excessive buffering.
  5181. </p>
  5182. </li><li>A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  5183. default, but will be written only if the output is seekable. The
  5184. <code class="code">write_xing</code> private option can be used to disable it. The frame contains
  5185. various information that may be useful to the decoder, like the audio duration
  5186. or encoder delay.
  5187. </li><li>A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  5188. enabled with the <code class="code">write_id3v1</code> private option, but as its capabilities are
  5189. very limited, its usage is not recommended.
  5190. </li></ul>
  5191. <p>Examples:
  5192. </p>
  5193. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  5194. </p><div class="example">
  5195. <pre class="example-preformatted">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  5196. </pre></div>
  5197. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  5198. with <code class="code">map</code>:
  5199. </p><div class="example">
  5200. <pre class="example-preformatted">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  5201. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  5202. </pre></div>
  5203. <p>Write a &quot;clean&quot; MP3 without any extra features:
  5204. </p><div class="example">
  5205. <pre class="example-preformatted">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  5206. </pre></div>
  5207. </div>
  5208. <div class="section-level-extent" id="mpegts-1">
  5209. <h3 class="section"><span>4.52 mpegts<a class="copiable-link" href="#mpegts-1"> &para;</a></span></h3>
  5210. <p>MPEG transport stream muxer.
  5211. </p>
  5212. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  5213. </p>
  5214. <p>The recognized metadata settings in mpegts muxer are <code class="code">service_provider</code>
  5215. and <code class="code">service_name</code>. If they are not set the default for
  5216. <code class="code">service_provider</code> is &lsquo;<samp class="samp">FFmpeg</samp>&rsquo; and the default for
  5217. <code class="code">service_name</code> is &lsquo;<samp class="samp">Service01</samp>&rsquo;.
  5218. </p>
  5219. <ul class="mini-toc">
  5220. <li><a href="#Options-29" accesskey="1">Options</a></li>
  5221. <li><a href="#Example-8" accesskey="2">Example</a></li>
  5222. </ul>
  5223. <div class="subsection-level-extent" id="Options-29">
  5224. <h4 class="subsection"><span>4.52.1 Options<a class="copiable-link" href="#Options-29"> &para;</a></span></h4>
  5225. <p>The muxer options are:
  5226. </p>
  5227. <dl class="table">
  5228. <dt><samp class="option">mpegts_transport_stream_id <var class="var">integer</var></samp></dt>
  5229. <dd><p>Set the &lsquo;<samp class="samp">transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  5230. Default is <code class="code">0x0001</code>.
  5231. </p>
  5232. </dd>
  5233. <dt><samp class="option">mpegts_original_network_id <var class="var">integer</var></samp></dt>
  5234. <dd><p>Set the &lsquo;<samp class="samp">original_network_id</samp>&rsquo;. This is unique identifier of a
  5235. network in DVB. Its main use is in the unique identification of a service
  5236. through the path &lsquo;<samp class="samp">Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  5237. is <code class="code">0x0001</code>.
  5238. </p>
  5239. </dd>
  5240. <dt><samp class="option">mpegts_service_id <var class="var">integer</var></samp></dt>
  5241. <dd><p>Set the &lsquo;<samp class="samp">service_id</samp>&rsquo;, also known as program in DVB. Default is
  5242. <code class="code">0x0001</code>.
  5243. </p>
  5244. </dd>
  5245. <dt><samp class="option">mpegts_service_type <var class="var">integer</var></samp></dt>
  5246. <dd><p>Set the program &lsquo;<samp class="samp">service_type</samp>&rsquo;. Default is <code class="code">digital_tv</code>.
  5247. Accepts the following options:
  5248. </p><dl class="table">
  5249. <dt>&lsquo;<samp class="samp">hex_value</samp>&rsquo;</dt>
  5250. <dd><p>Any hexadecimal value between <code class="code">0x01</code> and <code class="code">0xff</code> as defined in
  5251. ETSI 300 468.
  5252. </p></dd>
  5253. <dt>&lsquo;<samp class="samp">digital_tv</samp>&rsquo;</dt>
  5254. <dd><p>Digital TV service.
  5255. </p></dd>
  5256. <dt>&lsquo;<samp class="samp">digital_radio</samp>&rsquo;</dt>
  5257. <dd><p>Digital Radio service.
  5258. </p></dd>
  5259. <dt>&lsquo;<samp class="samp">teletext</samp>&rsquo;</dt>
  5260. <dd><p>Teletext service.
  5261. </p></dd>
  5262. <dt>&lsquo;<samp class="samp">advanced_codec_digital_radio</samp>&rsquo;</dt>
  5263. <dd><p>Advanced Codec Digital Radio service.
  5264. </p></dd>
  5265. <dt>&lsquo;<samp class="samp">mpeg2_digital_hdtv</samp>&rsquo;</dt>
  5266. <dd><p>MPEG2 Digital HDTV service.
  5267. </p></dd>
  5268. <dt>&lsquo;<samp class="samp">advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  5269. <dd><p>Advanced Codec Digital SDTV service.
  5270. </p></dd>
  5271. <dt>&lsquo;<samp class="samp">advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  5272. <dd><p>Advanced Codec Digital HDTV service.
  5273. </p></dd>
  5274. </dl>
  5275. </dd>
  5276. <dt><samp class="option">mpegts_pmt_start_pid <var class="var">integer</var></samp></dt>
  5277. <dd><p>Set the first PID for PMTs. Default is <code class="code">0x1000</code>, minimum is <code class="code">0x0020</code>,
  5278. maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode where the PMT
  5279. PID is fixed <code class="code">0x0100</code>.
  5280. </p>
  5281. </dd>
  5282. <dt><samp class="option">mpegts_start_pid <var class="var">integer</var></samp></dt>
  5283. <dd><p>Set the first PID for elementary streams. Default is <code class="code">0x0100</code>, minimum is
  5284. <code class="code">0x0020</code>, maximum is <code class="code">0x1ffa</code>. This option has no effect in m2ts mode
  5285. where the elementary stream PIDs are fixed.
  5286. </p>
  5287. </dd>
  5288. <dt><samp class="option">mpegts_m2ts_mode <var class="var">boolean</var></samp></dt>
  5289. <dd><p>Enable m2ts mode if set to <code class="code">1</code>. Default value is <code class="code">-1</code> which
  5290. disables m2ts mode.
  5291. </p>
  5292. </dd>
  5293. <dt><samp class="option">muxrate <var class="var">integer</var></samp></dt>
  5294. <dd><p>Set a constant muxrate. Default is VBR.
  5295. </p>
  5296. </dd>
  5297. <dt><samp class="option">pes_payload_size <var class="var">integer</var></samp></dt>
  5298. <dd><p>Set minimum PES packet payload in bytes. Default is <code class="code">2930</code>.
  5299. </p>
  5300. </dd>
  5301. <dt><samp class="option">mpegts_flags <var class="var">flags</var></samp></dt>
  5302. <dd><p>Set mpegts flags. Accepts the following options:
  5303. </p><dl class="table">
  5304. <dt>&lsquo;<samp class="samp">resend_headers</samp>&rsquo;</dt>
  5305. <dd><p>Reemit PAT/PMT before writing the next packet.
  5306. </p></dd>
  5307. <dt>&lsquo;<samp class="samp">latm</samp>&rsquo;</dt>
  5308. <dd><p>Use LATM packetization for AAC.
  5309. </p></dd>
  5310. <dt>&lsquo;<samp class="samp">pat_pmt_at_frames</samp>&rsquo;</dt>
  5311. <dd><p>Reemit PAT and PMT at each video frame.
  5312. </p></dd>
  5313. <dt>&lsquo;<samp class="samp">system_b</samp>&rsquo;</dt>
  5314. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  5315. </p></dd>
  5316. <dt>&lsquo;<samp class="samp">initial_discontinuity</samp>&rsquo;</dt>
  5317. <dd><p>Mark the initial packet of each stream as discontinuity.
  5318. </p></dd>
  5319. <dt>&lsquo;<samp class="samp">nit</samp>&rsquo;</dt>
  5320. <dd><p>Emit NIT table.
  5321. </p></dd>
  5322. <dt>&lsquo;<samp class="samp">omit_rai</samp>&rsquo;</dt>
  5323. <dd><p>Disable writing of random access indicator.
  5324. </p></dd>
  5325. </dl>
  5326. </dd>
  5327. <dt><samp class="option">mpegts_copyts <var class="var">boolean</var></samp></dt>
  5328. <dd><p>Preserve original timestamps, if value is set to <code class="code">1</code>. Default value
  5329. is <code class="code">-1</code>, which results in shifting timestamps so that they start from 0.
  5330. </p>
  5331. </dd>
  5332. <dt><samp class="option">omit_video_pes_length <var class="var">boolean</var></samp></dt>
  5333. <dd><p>Omit the PES packet length for video packets. Default is <code class="code">1</code> (true).
  5334. </p>
  5335. </dd>
  5336. <dt><samp class="option">pcr_period <var class="var">integer</var></samp></dt>
  5337. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  5338. <code class="code">-1</code> which means that the PCR interval will be determined automatically:
  5339. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  5340. is less than 100 ms is used for VBR streams.
  5341. </p>
  5342. </dd>
  5343. <dt><samp class="option">pat_period <var class="var">duration</var></samp></dt>
  5344. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code class="code">0.1</code>.
  5345. </p>
  5346. </dd>
  5347. <dt><samp class="option">sdt_period <var class="var">duration</var></samp></dt>
  5348. <dd><p>Maximum time in seconds between SDT tables. Default is <code class="code">0.5</code>.
  5349. </p>
  5350. </dd>
  5351. <dt><samp class="option">nit_period <var class="var">duration</var></samp></dt>
  5352. <dd><p>Maximum time in seconds between NIT tables. Default is <code class="code">0.5</code>.
  5353. </p>
  5354. </dd>
  5355. <dt><samp class="option">tables_version <var class="var">integer</var></samp></dt>
  5356. <dd><p>Set PAT, PMT, SDT and NIT version (default <code class="code">0</code>, valid values are from 0 to 31, inclusively).
  5357. This option allows updating stream structure so that standard consumer may
  5358. detect the change. To do so, reopen output <code class="code">AVFormatContext</code> (in case of API
  5359. usage) or restart <code class="command">ffmpeg</code> instance, cyclically changing
  5360. <samp class="option">tables_version</samp> value:
  5361. </p>
  5362. <div class="example">
  5363. <pre class="example-preformatted">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  5364. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  5365. ...
  5366. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  5367. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  5368. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  5369. ...
  5370. </pre></div>
  5371. </dd>
  5372. </dl>
  5373. </div>
  5374. <div class="subsection-level-extent" id="Example-8">
  5375. <h4 class="subsection"><span>4.52.2 Example<a class="copiable-link" href="#Example-8"> &para;</a></span></h4>
  5376. <div class="example">
  5377. <pre class="example-preformatted">ffmpeg -i file.mpg -c copy \
  5378. -mpegts_original_network_id 0x1122 \
  5379. -mpegts_transport_stream_id 0x3344 \
  5380. -mpegts_service_id 0x5566 \
  5381. -mpegts_pmt_start_pid 0x1500 \
  5382. -mpegts_start_pid 0x150 \
  5383. -metadata service_provider=&quot;Some provider&quot; \
  5384. -metadata service_name=&quot;Some Channel&quot; \
  5385. out.ts
  5386. </pre></div>
  5387. </div>
  5388. </div>
  5389. <div class="section-level-extent" id="mxf_002c-mxf_005fd10_002c-mxf_005fopatom">
  5390. <h3 class="section"><span>4.53 mxf, mxf_d10, mxf_opatom<a class="copiable-link" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom"> &para;</a></span></h3>
  5391. <p>MXF muxer.
  5392. </p>
  5393. <ul class="mini-toc">
  5394. <li><a href="#Options-30" accesskey="1">Options</a></li>
  5395. </ul>
  5396. <div class="subsection-level-extent" id="Options-30">
  5397. <h4 class="subsection"><span>4.53.1 Options<a class="copiable-link" href="#Options-30"> &para;</a></span></h4>
  5398. <p>The muxer options are:
  5399. </p>
  5400. <dl class="table">
  5401. <dt><samp class="option">store_user_comments <var class="var">bool</var></samp></dt>
  5402. <dd><p>Set if user comments should be stored if available or never.
  5403. IRT D-10 does not allow user comments. The default is thus to write them for
  5404. mxf and mxf_opatom but not for mxf_d10
  5405. </p></dd>
  5406. </dl>
  5407. </div>
  5408. </div>
  5409. <div class="section-level-extent" id="null">
  5410. <h3 class="section"><span>4.54 null<a class="copiable-link" href="#null"> &para;</a></span></h3>
  5411. <p>Null muxer.
  5412. </p>
  5413. <p>This muxer does not generate any output file, it is mainly useful for
  5414. testing or benchmarking purposes.
  5415. </p>
  5416. <p>For example to benchmark decoding with <code class="command">ffmpeg</code> you can use the
  5417. command:
  5418. </p><div class="example">
  5419. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null out.null
  5420. </pre></div>
  5421. <p>Note that the above command does not read or write the <samp class="file">out.null</samp>
  5422. file, but specifying the output file is required by the <code class="command">ffmpeg</code>
  5423. syntax.
  5424. </p>
  5425. <p>Alternatively you can write the command as:
  5426. </p><div class="example">
  5427. <pre class="example-preformatted">ffmpeg -benchmark -i INPUT -f null -
  5428. </pre></div>
  5429. </div>
  5430. <div class="section-level-extent" id="nut">
  5431. <h3 class="section"><span>4.55 nut<a class="copiable-link" href="#nut"> &para;</a></span></h3>
  5432. <dl class="table">
  5433. <dt><samp class="option">-syncpoints <var class="var">flags</var></samp></dt>
  5434. <dd><p>Change the syncpoint usage in nut:
  5435. </p><dl class="table">
  5436. <dt><samp class="option"><var class="var">default</var> use the normal low-overhead seeking aids.</samp></dt>
  5437. <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>
  5438. <dd><p>Use of this option is not recommended, as the resulting files are very damage
  5439. sensitive and seeking is not possible. Also in general the overhead from
  5440. syncpoints is negligible. Note, -<code class="code">write_index</code> 0 can be used to disable
  5441. all growing data tables, allowing to mux endless streams with limited memory
  5442. and without these disadvantages.
  5443. </p></dd>
  5444. <dt><samp class="option"><var class="var">timestamped</var> extend the syncpoint with a wallclock field.</samp></dt>
  5445. </dl>
  5446. <p>The <var class="var">none</var> and <var class="var">timestamped</var> flags are experimental.
  5447. </p></dd>
  5448. <dt><samp class="option">-write_index <var class="var">bool</var></samp></dt>
  5449. <dd><p>Write index at the end, the default is to write an index.
  5450. </p></dd>
  5451. </dl>
  5452. <div class="example">
  5453. <pre class="example-preformatted">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  5454. </pre></div>
  5455. </div>
  5456. <div class="section-level-extent" id="ogg">
  5457. <h3 class="section"><span>4.56 ogg<a class="copiable-link" href="#ogg"> &para;</a></span></h3>
  5458. <p>Ogg container muxer.
  5459. </p>
  5460. <dl class="table">
  5461. <dt><samp class="option">-page_duration <var class="var">duration</var></samp></dt>
  5462. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  5463. pages that are approximately <var class="var">duration</var> microseconds long. This allows the
  5464. user to compromise between seek granularity and container overhead. The default
  5465. is 1 second. A value of 0 will fill all segments, making pages as large as
  5466. possible. A value of 1 will effectively use 1 packet-per-page in most
  5467. situations, giving a small seek granularity at the cost of additional container
  5468. overhead.
  5469. </p></dd>
  5470. <dt><samp class="option">-serial_offset <var class="var">value</var></samp></dt>
  5471. <dd><p>Serial value from which to set the streams serial number.
  5472. Setting it to different and sufficiently large values ensures that the produced
  5473. ogg files can be safely chained.
  5474. </p>
  5475. </dd>
  5476. </dl>
  5477. <a class="anchor" id="rcwt"></a></div>
  5478. <div class="section-level-extent" id="rcwt-1">
  5479. <h3 class="section"><span>4.57 rcwt<a class="copiable-link" href="#rcwt-1"> &para;</a></span></h3>
  5480. <p>Raw Captions With Time (RCWT) is a format native to ccextractor, a commonly
  5481. used open source tool for processing 608/708 closed caption (CC) sources.
  5482. It can be used to archive the original, raw CC bitstream and to produce
  5483. a source file for later CC processing or conversion. As a result,
  5484. it also allows for interopability with ccextractor for processing CC data
  5485. extracted via ffmpeg. The format is simple to parse and can be used
  5486. to retain all lines and variants of CC.
  5487. </p>
  5488. <p>This muxer implements the specification as of 2024-01-05, which has
  5489. been stable and unchanged for 10 years as of this writing.
  5490. </p>
  5491. <p>This muxer will have some nuances from the way that ccextractor muxes RCWT.
  5492. No compatibility issues when processing the output with ccextractor
  5493. have been observed as a result of this so far, but mileage may vary
  5494. and outputs will not be a bit-exact match.
  5495. </p>
  5496. <p>A free specification of RCWT can be found here:
  5497. <a class="url" href="https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT">https://github.com/CCExtractor/ccextractor/blob/master/docs/BINARY_FILE_FORMAT.TXT</a>
  5498. </p>
  5499. <a class="anchor" id="segment"></a></div>
  5500. <div class="section-level-extent" id="segment_002c-stream_005fsegment_002c-ssegment">
  5501. <h3 class="section"><span>4.58 segment, stream_segment, ssegment<a class="copiable-link" href="#segment_002c-stream_005fsegment_002c-ssegment"> &para;</a></span></h3>
  5502. <p>Basic stream segmenter.
  5503. </p>
  5504. <p>This muxer outputs streams to a number of separate files of nearly
  5505. fixed duration. Output filename pattern can be set in a fashion
  5506. similar to <a class="ref" href="#image2">image2</a>, or by using a <code class="code">strftime</code> template if
  5507. the <samp class="option">strftime</samp> option is enabled.
  5508. </p>
  5509. <p><code class="code">stream_segment</code> is a variant of the muxer used to write to
  5510. streaming output formats, i.e. which do not require global headers,
  5511. and is recommended for outputting e.g. to MPEG transport stream segments.
  5512. <code class="code">ssegment</code> is a shorter alias for <code class="code">stream_segment</code>.
  5513. </p>
  5514. <p>Every segment starts with a keyframe of the selected reference stream,
  5515. which is set through the <samp class="option">reference_stream</samp> option.
  5516. </p>
  5517. <p>Note that if you want accurate splitting for a video file, you need to
  5518. make the input key frames correspond to the exact splitting times
  5519. expected by the segmenter, or the segment muxer will start the new
  5520. segment with the key frame found next after the specified start
  5521. time.
  5522. </p>
  5523. <p>The segment muxer works best with a single constant frame rate video.
  5524. </p>
  5525. <p>Optionally it can generate a list of the created segments, by setting
  5526. the option <var class="var">segment_list</var>. The list type is specified by the
  5527. <var class="var">segment_list_type</var> option. The entry filenames in the segment
  5528. list are set by default to the basename of the corresponding segment
  5529. files.
  5530. </p>
  5531. <p>See also the <a class="ref" href="#hls">hls</a> muxer, which provides a more specific
  5532. implementation for HLS segmentation.
  5533. </p>
  5534. <ul class="mini-toc">
  5535. <li><a href="#Options-31" accesskey="1">Options</a></li>
  5536. <li><a href="#Examples-13" accesskey="2">Examples</a></li>
  5537. </ul>
  5538. <div class="subsection-level-extent" id="Options-31">
  5539. <h4 class="subsection"><span>4.58.1 Options<a class="copiable-link" href="#Options-31"> &para;</a></span></h4>
  5540. <p>The segment muxer supports the following options:
  5541. </p>
  5542. <dl class="table">
  5543. <dt><samp class="option">increment_tc <var class="var">1|0</var></samp></dt>
  5544. <dd><p>if set to <code class="code">1</code>, increment timecode between each segment
  5545. If this is selected, the input need to have
  5546. a timecode in the first video stream. Default value is
  5547. <code class="code">0</code>.
  5548. </p>
  5549. </dd>
  5550. <dt><samp class="option">reference_stream <var class="var">specifier</var></samp></dt>
  5551. <dd><p>Set the reference stream, as specified by the string <var class="var">specifier</var>.
  5552. If <var class="var">specifier</var> is set to <code class="code">auto</code>, the reference is chosen
  5553. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  5554. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  5555. reference stream. The default value is <code class="code">auto</code>.
  5556. </p>
  5557. </dd>
  5558. <dt><samp class="option">segment_format <var class="var">format</var></samp></dt>
  5559. <dd><p>Override the inner container format, by default it is guessed by the filename
  5560. extension.
  5561. </p>
  5562. </dd>
  5563. <dt><samp class="option">segment_format_options <var class="var">options_list</var></samp></dt>
  5564. <dd><p>Set output format options using a :-separated list of key=value
  5565. parameters. Values containing the <code class="code">:</code> special character must be
  5566. escaped.
  5567. </p>
  5568. </dd>
  5569. <dt><samp class="option">segment_list <var class="var">name</var></samp></dt>
  5570. <dd><p>Generate also a listfile named <var class="var">name</var>. If not specified no
  5571. listfile is generated.
  5572. </p>
  5573. </dd>
  5574. <dt><samp class="option">segment_list_flags <var class="var">flags</var></samp></dt>
  5575. <dd><p>Set flags affecting the segment list generation.
  5576. </p>
  5577. <p>It currently supports the following flags:
  5578. </p><dl class="table">
  5579. <dt>&lsquo;<samp class="samp">cache</samp>&rsquo;</dt>
  5580. <dd><p>Allow caching (only affects M3U8 list files).
  5581. </p>
  5582. </dd>
  5583. <dt>&lsquo;<samp class="samp">live</samp>&rsquo;</dt>
  5584. <dd><p>Allow live-friendly file generation.
  5585. </p></dd>
  5586. </dl>
  5587. </dd>
  5588. <dt><samp class="option">segment_list_size <var class="var">size</var></samp></dt>
  5589. <dd><p>Update the list file so that it contains at most <var class="var">size</var>
  5590. segments. If 0 the list file will contain all the segments. Default
  5591. value is 0.
  5592. </p>
  5593. </dd>
  5594. <dt><samp class="option">segment_list_entry_prefix <var class="var">prefix</var></samp></dt>
  5595. <dd><p>Prepend <var class="var">prefix</var> to each entry. Useful to generate absolute paths.
  5596. By default no prefix is applied.
  5597. </p>
  5598. </dd>
  5599. <dt><samp class="option">segment_list_type <var class="var">type</var></samp></dt>
  5600. <dd><p>Select the listing format.
  5601. </p>
  5602. <p>The following values are recognized:
  5603. </p><dl class="table">
  5604. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  5605. <dd><p>Generate a flat list for the created segments, one segment per line.
  5606. </p>
  5607. </dd>
  5608. <dt>&lsquo;<samp class="samp">csv, ext</samp>&rsquo;</dt>
  5609. <dd><p>Generate a list for the created segments, one segment per line,
  5610. each line matching the format (comma-separated values):
  5611. </p><div class="example">
  5612. <pre class="example-preformatted"><var class="var">segment_filename</var>,<var class="var">segment_start_time</var>,<var class="var">segment_end_time</var>
  5613. </pre></div>
  5614. <p><var class="var">segment_filename</var> is the name of the output file generated by the
  5615. muxer according to the provided pattern. CSV escaping (according to
  5616. RFC4180) is applied if required.
  5617. </p>
  5618. <p><var class="var">segment_start_time</var> and <var class="var">segment_end_time</var> specify
  5619. the segment start and end time expressed in seconds.
  5620. </p>
  5621. <p>A list file with the suffix <code class="code">&quot;.csv&quot;</code> or <code class="code">&quot;.ext&quot;</code> will
  5622. auto-select this format.
  5623. </p>
  5624. <p>&lsquo;<samp class="samp">ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp class="samp">csv</samp>&rsquo;.
  5625. </p>
  5626. </dd>
  5627. <dt>&lsquo;<samp class="samp">ffconcat</samp>&rsquo;</dt>
  5628. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  5629. can be read using the FFmpeg <a class="ref" href="#concat">concat</a> demuxer.
  5630. </p>
  5631. <p>A list file with the suffix <code class="code">&quot;.ffcat&quot;</code> or <code class="code">&quot;.ffconcat&quot;</code> will
  5632. auto-select this format.
  5633. </p>
  5634. </dd>
  5635. <dt>&lsquo;<samp class="samp">m3u8</samp>&rsquo;</dt>
  5636. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  5637. <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>.
  5638. </p>
  5639. <p>A list file with the suffix <code class="code">&quot;.m3u8&quot;</code> will auto-select this format.
  5640. </p></dd>
  5641. </dl>
  5642. <p>If not specified the type is guessed from the list file name suffix.
  5643. </p>
  5644. </dd>
  5645. <dt><samp class="option">segment_time <var class="var">time</var></samp></dt>
  5646. <dd><p>Set segment duration to <var class="var">time</var>, the value must be a duration
  5647. specification. Default value is &quot;2&quot;. See also the
  5648. <samp class="option">segment_times</samp> option.
  5649. </p>
  5650. <p>Note that splitting may not be accurate, unless you force the
  5651. reference stream key-frames at the given time. See the introductory
  5652. notice and the examples below.
  5653. </p>
  5654. </dd>
  5655. <dt><samp class="option">min_seg_duration <var class="var">time</var></samp></dt>
  5656. <dd><p>Set minimum segment duration to <var class="var">time</var>, the value must be a duration
  5657. specification. This prevents the muxer ending segments at a duration below
  5658. this value. Only effective with <code class="code">segment_time</code>. Default value is &quot;0&quot;.
  5659. </p>
  5660. </dd>
  5661. <dt><samp class="option">segment_atclocktime <var class="var">1|0</var></samp></dt>
  5662. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  5663. o&rsquo;clock. The <var class="var">time</var> value specified in <samp class="option">segment_time</samp> is
  5664. used for setting the length of the splitting interval.
  5665. </p>
  5666. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; this makes it possible
  5667. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  5668. </p>
  5669. <p>Default value is &quot;0&quot;.
  5670. </p>
  5671. </dd>
  5672. <dt><samp class="option">segment_clocktime_offset <var class="var">duration</var></samp></dt>
  5673. <dd><p>Delay the segment splitting times with the specified duration when using
  5674. <samp class="option">segment_atclocktime</samp>.
  5675. </p>
  5676. <p>For example with <samp class="option">segment_time</samp> set to &quot;900&quot; and
  5677. <samp class="option">segment_clocktime_offset</samp> set to &quot;300&quot; this makes it possible to
  5678. create files at 12:05, 12:20, 12:35, etc.
  5679. </p>
  5680. <p>Default value is &quot;0&quot;.
  5681. </p>
  5682. </dd>
  5683. <dt><samp class="option">segment_clocktime_wrap_duration <var class="var">duration</var></samp></dt>
  5684. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  5685. within the specified duration after the segmenting clock time. This way you
  5686. can make the segmenter more resilient to backward local time jumps, such as
  5687. leap seconds or transition to standard time from daylight savings time.
  5688. </p>
  5689. <p>Default is the maximum possible duration which means starting a new segment
  5690. regardless of the elapsed time since the last clock time.
  5691. </p>
  5692. </dd>
  5693. <dt><samp class="option">segment_time_delta <var class="var">delta</var></samp></dt>
  5694. <dd><p>Specify the accuracy time when selecting the start time for a
  5695. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  5696. </p>
  5697. <p>When delta is specified a key-frame will start a new segment if its
  5698. PTS satisfies the relation:
  5699. </p><div class="example">
  5700. <pre class="example-preformatted">PTS &gt;= start_time - time_delta
  5701. </pre></div>
  5702. <p>This option is useful when splitting video content, which is always
  5703. split at GOP boundaries, in case a key frame is found just before the
  5704. specified split time.
  5705. </p>
  5706. <p>In particular may be used in combination with the <samp class="file">ffmpeg</samp> option
  5707. <var class="var">force_key_frames</var>. The key frame times specified by
  5708. <var class="var">force_key_frames</var> may not be set accurately because of rounding
  5709. issues, with the consequence that a key frame time may result set just
  5710. before the specified time. For constant frame rate videos a value of
  5711. 1/(2*<var class="var">frame_rate</var>) should address the worst case mismatch between
  5712. the specified time and the time set by <var class="var">force_key_frames</var>.
  5713. </p>
  5714. </dd>
  5715. <dt><samp class="option">segment_times <var class="var">times</var></samp></dt>
  5716. <dd><p>Specify a list of split points. <var class="var">times</var> contains a list of comma
  5717. separated duration specifications, in increasing order. See also
  5718. the <samp class="option">segment_time</samp> option.
  5719. </p>
  5720. </dd>
  5721. <dt><samp class="option">segment_frames <var class="var">frames</var></samp></dt>
  5722. <dd><p>Specify a list of split video frame numbers. <var class="var">frames</var> contains a
  5723. list of comma separated integer numbers, in increasing order.
  5724. </p>
  5725. <p>This option specifies to start a new segment whenever a reference
  5726. stream key frame is found and the sequential number (starting from 0)
  5727. of the frame is greater or equal to the next value in the list.
  5728. </p>
  5729. </dd>
  5730. <dt><samp class="option">segment_wrap <var class="var">limit</var></samp></dt>
  5731. <dd><p>Wrap around segment index once it reaches <var class="var">limit</var>.
  5732. </p>
  5733. </dd>
  5734. <dt><samp class="option">segment_start_number <var class="var">number</var></samp></dt>
  5735. <dd><p>Set the sequence number of the first segment. Defaults to <code class="code">0</code>.
  5736. </p>
  5737. </dd>
  5738. <dt><samp class="option">strftime <var class="var">1|0</var></samp></dt>
  5739. <dd><p>Use the <code class="code">strftime</code> function to define the name of the new
  5740. segments to write. If this is selected, the output segment name must
  5741. contain a <code class="code">strftime</code> function template. Default value is
  5742. <code class="code">0</code>.
  5743. </p>
  5744. </dd>
  5745. <dt><samp class="option">break_non_keyframes <var class="var">1|0</var></samp></dt>
  5746. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  5747. improves behavior on some players when the time between keyframes is
  5748. inconsistent, but may make things worse on others, and can cause some oddities
  5749. during seeking. Defaults to <code class="code">0</code>.
  5750. </p>
  5751. </dd>
  5752. <dt><samp class="option">reset_timestamps <var class="var">1|0</var></samp></dt>
  5753. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  5754. will start with near-zero timestamps. It is meant to ease the playback
  5755. of the generated segments. May not work with some combinations of
  5756. muxers/codecs. It is set to <code class="code">0</code> by default.
  5757. </p>
  5758. </dd>
  5759. <dt><samp class="option">initial_offset <var class="var">offset</var></samp></dt>
  5760. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  5761. argument must be a time duration specification, and defaults to 0.
  5762. </p>
  5763. </dd>
  5764. <dt><samp class="option">write_empty_segments <var class="var">1|0</var></samp></dt>
  5765. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  5766. segment would usually span. Otherwise, the segment will be filled with the next
  5767. packet written. Defaults to <code class="code">0</code>.
  5768. </p></dd>
  5769. </dl>
  5770. <p>Make sure to require a closed GOP when encoding and to set the GOP
  5771. size to fit your segment time constraint.
  5772. </p>
  5773. </div>
  5774. <div class="subsection-level-extent" id="Examples-13">
  5775. <h4 class="subsection"><span>4.58.2 Examples<a class="copiable-link" href="#Examples-13"> &para;</a></span></h4>
  5776. <ul class="itemize mark-bullet">
  5777. <li>Remux the content of file <samp class="file">in.mkv</samp> to a list of segments
  5778. <samp class="file">out-000.nut</samp>, <samp class="file">out-001.nut</samp>, etc., and write the list of
  5779. generated segments to <samp class="file">out.list</samp>:
  5780. <div class="example">
  5781. <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
  5782. </pre></div>
  5783. </li><li>Segment input and set output format options for the output segments:
  5784. <div class="example">
  5785. <pre class="example-preformatted">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  5786. </pre></div>
  5787. </li><li>Segment the input file according to the split points specified by the
  5788. <var class="var">segment_times</var> option:
  5789. <div class="example">
  5790. <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
  5791. </pre></div>
  5792. </li><li>Use the <code class="command">ffmpeg</code> <samp class="option">force_key_frames</samp>
  5793. option to force key frames in the input at the specified location, together
  5794. with the segment option <samp class="option">segment_time_delta</samp> to account for
  5795. possible roundings operated when setting key frame times.
  5796. <div class="example">
  5797. <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 \
  5798. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  5799. </pre></div>
  5800. <p>In order to force key frames on the input file, transcoding is
  5801. required.
  5802. </p>
  5803. </li><li>Segment the input file by splitting the input file according to the
  5804. frame numbers sequence specified with the <samp class="option">segment_frames</samp> option:
  5805. <div class="example">
  5806. <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
  5807. </pre></div>
  5808. </li><li>Convert the <samp class="file">in.mkv</samp> to TS segments using the <code class="code">libx264</code>
  5809. and <code class="code">aac</code> encoders:
  5810. <div class="example">
  5811. <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
  5812. </pre></div>
  5813. </li><li>Segment the input file, and create an M3U8 live playlist (can be used
  5814. as live HLS source):
  5815. <div class="example">
  5816. <pre class="example-preformatted">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  5817. -segment_list_flags +live -segment_time 10 out%03d.mkv
  5818. </pre></div>
  5819. </li></ul>
  5820. </div>
  5821. </div>
  5822. <div class="section-level-extent" id="smoothstreaming">
  5823. <h3 class="section"><span>4.59 smoothstreaming<a class="copiable-link" href="#smoothstreaming"> &para;</a></span></h3>
  5824. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  5825. </p>
  5826. <dl class="table">
  5827. <dt><samp class="option">window_size</samp></dt>
  5828. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  5829. </p>
  5830. </dd>
  5831. <dt><samp class="option">extra_window_size</samp></dt>
  5832. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  5833. </p>
  5834. </dd>
  5835. <dt><samp class="option">lookahead_count</samp></dt>
  5836. <dd><p>Specify the number of lookahead fragments. Default 2.
  5837. </p>
  5838. </dd>
  5839. <dt><samp class="option">min_frag_duration</samp></dt>
  5840. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  5841. </p>
  5842. </dd>
  5843. <dt><samp class="option">remove_at_exit</samp></dt>
  5844. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  5845. </p>
  5846. </dd>
  5847. </dl>
  5848. <a class="anchor" id="streamhash"></a></div>
  5849. <div class="section-level-extent" id="streamhash-1">
  5850. <h3 class="section"><span>4.60 streamhash<a class="copiable-link" href="#streamhash-1"> &para;</a></span></h3>
  5851. <p>Per stream hash testing format.
  5852. </p>
  5853. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  5854. on a per-stream basis. This can be used for equality checks without having
  5855. to do a complete binary comparison.
  5856. </p>
  5857. <p>By default audio frames are converted to signed 16-bit raw audio and
  5858. video frames to raw video before computing the hash, but the output
  5859. of explicit conversions to other codecs can also be used. Timestamps
  5860. are ignored. It uses the SHA-256 cryptographic hash function by default,
  5861. but supports several other algorithms.
  5862. </p>
  5863. <p>The output of the muxer consists of one line per stream of the form:
  5864. <var class="var">streamindex</var>,<var class="var">streamtype</var>,<var class="var">algo</var>=<var class="var">hash</var>, where
  5865. <var class="var">streamindex</var> is the index of the mapped stream, <var class="var">streamtype</var> is a
  5866. single character indicating the type of stream, <var class="var">algo</var> is a short string
  5867. representing the hash function used, and <var class="var">hash</var> is a hexadecimal number
  5868. representing the computed hash.
  5869. </p>
  5870. <dl class="table">
  5871. <dt><samp class="option">hash <var class="var">algorithm</var></samp></dt>
  5872. <dd><p>Use the cryptographic hash function specified by the string <var class="var">algorithm</var>.
  5873. Supported values include <code class="code">MD5</code>, <code class="code">murmur3</code>, <code class="code">RIPEMD128</code>,
  5874. <code class="code">RIPEMD160</code>, <code class="code">RIPEMD256</code>, <code class="code">RIPEMD320</code>, <code class="code">SHA160</code>,
  5875. <code class="code">SHA224</code>, <code class="code">SHA256</code> (default), <code class="code">SHA512/224</code>, <code class="code">SHA512/256</code>,
  5876. <code class="code">SHA384</code>, <code class="code">SHA512</code>, <code class="code">CRC32</code> and <code class="code">adler32</code>.
  5877. </p>
  5878. </dd>
  5879. </dl>
  5880. <ul class="mini-toc">
  5881. <li><a href="#Examples-14" accesskey="1">Examples</a></li>
  5882. </ul>
  5883. <div class="subsection-level-extent" id="Examples-14">
  5884. <h4 class="subsection"><span>4.60.1 Examples<a class="copiable-link" href="#Examples-14"> &para;</a></span></h4>
  5885. <p>To compute the SHA-256 hash of the input converted to raw audio and
  5886. video, and store it in the file <samp class="file">out.sha256</samp>:
  5887. </p><div class="example">
  5888. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash out.sha256
  5889. </pre></div>
  5890. <p>To print an MD5 hash to stdout use the command:
  5891. </p><div class="example">
  5892. <pre class="example-preformatted">ffmpeg -i INPUT -f streamhash -hash md5 -
  5893. </pre></div>
  5894. <p>See also the <a class="ref" href="#hash">hash</a> and <a class="ref" href="#framehash">framehash</a> muxers.
  5895. </p>
  5896. <a class="anchor" id="tee"></a></div>
  5897. </div>
  5898. <div class="section-level-extent" id="tee-1">
  5899. <h3 class="section"><span>4.61 tee<a class="copiable-link" href="#tee-1"> &para;</a></span></h3>
  5900. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  5901. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  5902. </p>
  5903. <p>It is different from specifying several outputs to the <code class="command">ffmpeg</code>
  5904. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  5905. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  5906. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  5907. directly because it is then possible to feed the same packets to several muxers directly.
  5908. </p>
  5909. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  5910. output streams. So all streams intended for output must be specified using <code class="code">-map</code>. See
  5911. the examples below.
  5912. </p>
  5913. <p>Some encoders may need different options depending on the output format;
  5914. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  5915. The main example is the <samp class="option">global_header</samp> flag.
  5916. </p>
  5917. <p>The slave outputs are specified in the file name given to the muxer,
  5918. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  5919. leading or trailing spaces or any special character, those must be
  5920. escaped (see <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  5921. section in the ffmpeg-utils(1) manual</a>).
  5922. </p>
  5923. <ul class="mini-toc">
  5924. <li><a href="#Options-32" accesskey="1">Options</a></li>
  5925. <li><a href="#Examples-15" accesskey="2">Examples</a></li>
  5926. </ul>
  5927. <div class="subsection-level-extent" id="Options-32">
  5928. <h4 class="subsection"><span>4.61.1 Options<a class="copiable-link" href="#Options-32"> &para;</a></span></h4>
  5929. <dl class="table">
  5930. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  5931. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a class="ref" href="#fifo">fifo</a>
  5932. muxer. This allows to compensate for different speed/latency/reliability of
  5933. outputs and setup transparent recovery. By default this feature is turned off.
  5934. </p>
  5935. </dd>
  5936. <dt><samp class="option">fifo_options</samp></dt>
  5937. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a class="ref" href="#fifo">fifo</a>.
  5938. </p>
  5939. </dd>
  5940. </dl>
  5941. <p>Muxer options can be specified for each slave by prepending them as a list of
  5942. <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  5943. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  5944. must be escaped; note that this is a second level escaping.
  5945. </p>
  5946. <p>The following special options are also recognized:
  5947. </p><dl class="table">
  5948. <dt><samp class="option">f</samp></dt>
  5949. <dd><p>Specify the format name. Required if it cannot be guessed from the
  5950. output URL.
  5951. </p>
  5952. </dd>
  5953. <dt><samp class="option">bsfs[/<var class="var">spec</var>]</samp></dt>
  5954. <dd><p>Specify a list of bitstream filters to apply to the specified
  5955. output.
  5956. </p>
  5957. <p>It is possible to specify to which streams a given bitstream filter
  5958. applies, by appending a stream specifier to the option separated by
  5959. <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>).
  5960. </p>
  5961. <p>If the stream specifier is not specified, the bitstream filters will be
  5962. applied to all streams in the output. This will cause that output operation
  5963. to fail if the output contains streams to which the bitstream filter cannot
  5964. be applied e.g. <code class="code">h264_mp4toannexb</code> being applied to an output containing an audio stream.
  5965. </p>
  5966. <p>Options for a bitstream filter must be specified in the form of <code class="code">opt=value</code>.
  5967. </p>
  5968. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  5969. </p>
  5970. </dd>
  5971. <dt><samp class="option">use_fifo <var class="var">bool</var></samp></dt>
  5972. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  5973. </p>
  5974. </dd>
  5975. <dt><samp class="option">fifo_options</samp></dt>
  5976. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  5977. See <a class="ref" href="#fifo">fifo</a>.
  5978. </p>
  5979. </dd>
  5980. <dt><samp class="option">select</samp></dt>
  5981. <dd><p>Select the streams that should be mapped to the slave output,
  5982. specified by a stream specifier. If not specified, this defaults to
  5983. all the mapped streams. This will cause that output operation to fail
  5984. if the output format does not accept all mapped streams.
  5985. </p>
  5986. <p>You may use multiple stream specifiers separated by commas (<code class="code">,</code>) e.g.: <code class="code">a:0,v</code>
  5987. </p>
  5988. </dd>
  5989. <dt><samp class="option">onfail</samp></dt>
  5990. <dd><p>Specify behaviour on output failure. This can be set to either <code class="code">abort</code> (which is
  5991. default) or <code class="code">ignore</code>. <code class="code">abort</code> will cause whole process to fail in case of failure
  5992. on this slave output. <code class="code">ignore</code> will ignore failure on this output, so other outputs
  5993. will continue without being affected.
  5994. </p></dd>
  5995. </dl>
  5996. </div>
  5997. <div class="subsection-level-extent" id="Examples-15">
  5998. <h4 class="subsection"><span>4.61.2 Examples<a class="copiable-link" href="#Examples-15"> &para;</a></span></h4>
  5999. <ul class="itemize mark-bullet">
  6000. <li>Encode something and both archive it in a WebM file and stream it
  6001. as MPEG-TS over UDP:
  6002. <div class="example">
  6003. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  6004. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  6005. </pre></div>
  6006. </li><li>As above, but continue streaming even if output to local file fails
  6007. (for example local drive fills up):
  6008. <div class="example">
  6009. <pre class="example-preformatted">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  6010. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  6011. </pre></div>
  6012. </li><li>Use <code class="command">ffmpeg</code> to encode the input, and send the output
  6013. to three different destinations. The <code class="code">dump_extra</code> bitstream
  6014. filter is used to add extradata information to all the output video
  6015. keyframes packets, as requested by the MPEG-TS format. The select
  6016. option is applied to <samp class="file">out.aac</samp> in order to make it contain only
  6017. audio packets.
  6018. <div class="example">
  6019. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  6020. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  6021. </pre></div>
  6022. </li><li>As above, but select only stream <code class="code">a:1</code> for the audio output. Note
  6023. that a second level escaping must be performed, as &quot;:&quot; is a special
  6024. character used to separate options.
  6025. <div class="example">
  6026. <pre class="example-preformatted">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  6027. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  6028. </pre></div>
  6029. </li></ul>
  6030. </div>
  6031. </div>
  6032. <div class="section-level-extent" id="webm_005fchunk">
  6033. <h3 class="section"><span>4.62 webm_chunk<a class="copiable-link" href="#webm_005fchunk"> &para;</a></span></h3>
  6034. <p>WebM Live Chunk Muxer.
  6035. </p>
  6036. <p>This muxer writes out WebM headers and chunks as separate files which can be
  6037. consumed by clients that support WebM Live streams via DASH.
  6038. </p>
  6039. <ul class="mini-toc">
  6040. <li><a href="#Options-33" accesskey="1">Options</a></li>
  6041. <li><a href="#Example-9" accesskey="2">Example</a></li>
  6042. </ul>
  6043. <div class="subsection-level-extent" id="Options-33">
  6044. <h4 class="subsection"><span>4.62.1 Options<a class="copiable-link" href="#Options-33"> &para;</a></span></h4>
  6045. <p>This muxer supports the following options:
  6046. </p>
  6047. <dl class="table">
  6048. <dt><samp class="option">chunk_start_index</samp></dt>
  6049. <dd><p>Index of the first chunk (defaults to 0).
  6050. </p>
  6051. </dd>
  6052. <dt><samp class="option">header</samp></dt>
  6053. <dd><p>Filename of the header where the initialization data will be written.
  6054. </p>
  6055. </dd>
  6056. <dt><samp class="option">audio_chunk_duration</samp></dt>
  6057. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  6058. </p></dd>
  6059. </dl>
  6060. </div>
  6061. <div class="subsection-level-extent" id="Example-9">
  6062. <h4 class="subsection"><span>4.62.2 Example<a class="copiable-link" href="#Example-9"> &para;</a></span></h4>
  6063. <div class="example">
  6064. <pre class="example-preformatted">ffmpeg -f v4l2 -i /dev/video0 \
  6065. -f alsa -i hw:0 \
  6066. -map 0:0 \
  6067. -c:v libvpx-vp9 \
  6068. -s 640x360 -keyint_min 30 -g 30 \
  6069. -f webm_chunk \
  6070. -header webm_live_video_360.hdr \
  6071. -chunk_start_index 1 \
  6072. webm_live_video_360_%d.chk \
  6073. -map 1:0 \
  6074. -c:a libvorbis \
  6075. -b:a 128k \
  6076. -f webm_chunk \
  6077. -header webm_live_audio_128.hdr \
  6078. -chunk_start_index 1 \
  6079. -audio_chunk_duration 1000 \
  6080. webm_live_audio_128_%d.chk
  6081. </pre></div>
  6082. </div>
  6083. </div>
  6084. <div class="section-level-extent" id="webm_005fdash_005fmanifest">
  6085. <h3 class="section"><span>4.63 webm_dash_manifest<a class="copiable-link" href="#webm_005fdash_005fmanifest"> &para;</a></span></h3>
  6086. <p>WebM DASH Manifest muxer.
  6087. </p>
  6088. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  6089. manifest XML. It also supports manifest generation for DASH live streams.
  6090. </p>
  6091. <p>For more information see:
  6092. </p>
  6093. <ul class="itemize mark-bullet">
  6094. <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>
  6095. </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>
  6096. </li></ul>
  6097. <ul class="mini-toc">
  6098. <li><a href="#Options-34" accesskey="1">Options</a></li>
  6099. <li><a href="#Example-10" accesskey="2">Example</a></li>
  6100. </ul>
  6101. <div class="subsection-level-extent" id="Options-34">
  6102. <h4 class="subsection"><span>4.63.1 Options<a class="copiable-link" href="#Options-34"> &para;</a></span></h4>
  6103. <p>This muxer supports the following options:
  6104. </p>
  6105. <dl class="table">
  6106. <dt><samp class="option">adaptation_sets</samp></dt>
  6107. <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
  6108. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  6109. audio and video streams. Any number of adaptation sets can be added using this option.
  6110. </p>
  6111. </dd>
  6112. <dt><samp class="option">live</samp></dt>
  6113. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  6114. </p>
  6115. </dd>
  6116. <dt><samp class="option">chunk_start_index</samp></dt>
  6117. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp class="samp">startNumber</samp>&rsquo; attribute
  6118. of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  6119. </p>
  6120. </dd>
  6121. <dt><samp class="option">chunk_duration_ms</samp></dt>
  6122. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp class="samp">duration</samp>&rsquo;
  6123. attribute of the &lsquo;<samp class="samp">SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  6124. </p>
  6125. </dd>
  6126. <dt><samp class="option">utc_timing_url</samp></dt>
  6127. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  6128. in the &lsquo;<samp class="samp">value</samp>&rsquo; attribute of the &lsquo;<samp class="samp">UTCTiming</samp>&rsquo; element in the manifest.
  6129. Default: None.
  6130. </p>
  6131. </dd>
  6132. <dt><samp class="option">time_shift_buffer_depth</samp></dt>
  6133. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  6134. guaranteed to be available. This will go in the &lsquo;<samp class="samp">timeShiftBufferDepth</samp>&rsquo;
  6135. attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 60.
  6136. </p>
  6137. </dd>
  6138. <dt><samp class="option">minimum_update_period</samp></dt>
  6139. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  6140. &lsquo;<samp class="samp">minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp class="samp">MPD</samp>&rsquo; element. Default: 0.
  6141. </p>
  6142. </dd>
  6143. </dl>
  6144. </div>
  6145. <div class="subsection-level-extent" id="Example-10">
  6146. <h4 class="subsection"><span>4.63.2 Example<a class="copiable-link" href="#Example-10"> &para;</a></span></h4>
  6147. <div class="example">
  6148. <pre class="example-preformatted">ffmpeg -f webm_dash_manifest -i video1.webm \
  6149. -f webm_dash_manifest -i video2.webm \
  6150. -f webm_dash_manifest -i audio1.webm \
  6151. -f webm_dash_manifest -i audio2.webm \
  6152. -map 0 -map 1 -map 2 -map 3 \
  6153. -c copy \
  6154. -f webm_dash_manifest \
  6155. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  6156. manifest.xml
  6157. </pre></div>
  6158. <a class="anchor" id="metadata"></a></div>
  6159. </div>
  6160. </div>
  6161. <div class="chapter-level-extent" id="Metadata-1">
  6162. <h2 class="chapter"><span>5 Metadata<a class="copiable-link" href="#Metadata-1"> &para;</a></span></h2>
  6163. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  6164. INI-like text file and then load it back using the metadata muxer/demuxer.
  6165. </p>
  6166. <p>The file format is as follows:
  6167. </p><ol class="enumerate">
  6168. <li> A file consists of a header and a number of metadata tags divided into sections,
  6169. each on its own line.
  6170. </li><li> The header is a &lsquo;<samp class="samp">;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  6171. </li><li> Metadata tags are of the form &lsquo;<samp class="samp">key=value</samp>&rsquo;
  6172. </li><li> Immediately after header follows global metadata
  6173. </li><li> After global metadata there may be sections with per-stream/per-chapter
  6174. metadata.
  6175. </li><li> A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  6176. brackets (&lsquo;<samp class="samp">[</samp>&rsquo;, &lsquo;<samp class="samp">]</samp>&rsquo;) and ends with next section or end of file.
  6177. </li><li> At the beginning of a chapter section there may be an optional timebase to be
  6178. used for start/end values. It must be in form
  6179. &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
  6180. integers. If the timebase is missing then start/end times are assumed to
  6181. be in nanoseconds.
  6182. <p>Next a chapter section must contain chapter start and end times in form
  6183. &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
  6184. integer.
  6185. </p>
  6186. </li><li> Empty lines and lines starting with &lsquo;<samp class="samp">;</samp>&rsquo; or &lsquo;<samp class="samp">#</samp>&rsquo; are ignored.
  6187. </li><li> Metadata keys or values containing special characters (&lsquo;<samp class="samp">=</samp>&rsquo;, &lsquo;<samp class="samp">;</samp>&rsquo;,
  6188. &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;.
  6189. </li><li> Note that whitespace in metadata (e.g. &lsquo;<samp class="samp">foo = bar</samp>&rsquo;) is considered to be
  6190. a part of the tag (in the example above key is &lsquo;<samp class="samp">foo </samp>&rsquo;, value is
  6191. &lsquo;<samp class="samp"> bar</samp>&rsquo;).
  6192. </li></ol>
  6193. <p>A ffmetadata file might look like this:
  6194. </p><div class="example">
  6195. <pre class="example-preformatted">;FFMETADATA1
  6196. title=bike\\shed
  6197. ;this is a comment
  6198. artist=FFmpeg troll team
  6199. [CHAPTER]
  6200. TIMEBASE=1/1000
  6201. START=0
  6202. #chapter ends at 0:01:00
  6203. END=60000
  6204. title=chapter \#1
  6205. [STREAM]
  6206. title=multi\
  6207. line
  6208. </pre></div>
  6209. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  6210. metadata from an input file to an ffmetadata file, and then transcode
  6211. the file into an output file with the edited ffmetadata file.
  6212. </p>
  6213. <p>Extracting an ffmetadata file with <samp class="file">ffmpeg</samp> goes as follows:
  6214. </p><div class="example">
  6215. <pre class="example-preformatted">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  6216. </pre></div>
  6217. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  6218. be done as:
  6219. </p><div class="example">
  6220. <pre class="example-preformatted">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  6221. </pre></div>
  6222. </div>
  6223. <div class="chapter-level-extent" id="See-Also">
  6224. <h2 class="chapter"><span>6 See Also<a class="copiable-link" href="#See-Also"> &para;</a></span></h2>
  6225. <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>,
  6226. <a class="url" href="libavformat.html">libavformat</a>
  6227. </p>
  6228. </div>
  6229. <div class="chapter-level-extent" id="Authors">
  6230. <h2 class="chapter"><span>7 Authors<a class="copiable-link" href="#Authors"> &para;</a></span></h2>
  6231. <p>The FFmpeg developers.
  6232. </p>
  6233. <p>For details about the authorship, see the Git history of the project
  6234. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  6235. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  6236. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  6237. </p>
  6238. <p>Maintainers for the specific components are listed in the file
  6239. <samp class="file">MAINTAINERS</samp> in the source code tree.
  6240. </p>
  6241. </div>
  6242. </div>
  6243. <p style="font-size: small;">
  6244. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  6245. </p>
  6246. </div>
  6247. </body>
  6248. </html>