ffmpeg-formats.1 166 KB

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