星火直播PC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ffmpeg-all.html 1.8MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  6. <title>FFmpeg documentation</title>
  7. <link rel="stylesheet" href="bootstrap.min.css" />
  8. <link rel="stylesheet" href="style.min.css" />
  9. <meta name="description" content="ffmpeg Documentation: ">
  10. <meta name="keywords" content="FFmpeg documentation : ffmpeg ">
  11. <meta name="Generator" content="texi2html 5.0">
  12. <!-- Created on March 9, 2020 by texi2html 5.0 -->
  13. <!--
  14. texi2html was written by:
  15. Lionel Cons <Lionel.Cons@cern.ch> (original author)
  16. Karl Berry <karl@freefriends.org>
  17. Olaf Bachmann <obachman@mathematik.uni-kl.de>
  18. and many others.
  19. Maintained by: Many creative people.
  20. Send bugs and suggestions to <texi2html-bug@nongnu.org>
  21. -->
  22. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  23. </head>
  24. <body>
  25. <div class="container">
  26. <h1 class="titlefont">ffmpeg Documentation</h1>
  27. <hr>
  28. <a name="SEC_Top"></a>
  29. <a name="SEC_Contents"></a>
  30. <h1>Table of Contents</h1>
  31. <div class="contents">
  32. <ul class="no-bullet">
  33. <li><a name="toc-Synopsis" href="#Synopsis">1 Synopsis</a></li>
  34. <li><a name="toc-Description-1" href="#Description-1">2 Description</a></li>
  35. <li><a name="toc-Detailed-description" href="#Detailed-description">3 Detailed description</a>
  36. <ul class="no-bullet">
  37. <li><a name="toc-Filtering" href="#Filtering">3.1 Filtering</a>
  38. <ul class="no-bullet">
  39. <li><a name="toc-Simple-filtergraphs" href="#Simple-filtergraphs">3.1.1 Simple filtergraphs</a></li>
  40. <li><a name="toc-Complex-filtergraphs-1" href="#Complex-filtergraphs-1">3.1.2 Complex filtergraphs</a></li>
  41. </ul></li>
  42. <li><a name="toc-Stream-copy" href="#Stream-copy">3.2 Stream copy</a></li>
  43. </ul></li>
  44. <li><a name="toc-Stream-selection" href="#Stream-selection">4 Stream selection</a>
  45. <ul class="no-bullet">
  46. <li><a name="toc-Description" href="#Description">4.1 Description</a>
  47. <ul class="no-bullet">
  48. <li><a name="toc-Automatic-stream-selection" href="#Automatic-stream-selection">4.1.1 Automatic stream selection</a></li>
  49. <li><a name="toc-Manual-stream-selection" href="#Manual-stream-selection">4.1.2 Manual stream selection</a></li>
  50. <li><a name="toc-Complex-filtergraphs" href="#Complex-filtergraphs">4.1.3 Complex filtergraphs</a></li>
  51. <li><a name="toc-Stream-handling" href="#Stream-handling">4.1.4 Stream handling</a></li>
  52. </ul></li>
  53. <li><a name="toc-Examples-110" href="#Examples-110">4.2 Examples</a></li>
  54. </ul></li>
  55. <li><a name="toc-Options-35" href="#Options-35">5 Options</a>
  56. <ul class="no-bullet">
  57. <li><a name="toc-Stream-specifiers-1" href="#Stream-specifiers-1">5.1 Stream specifiers</a></li>
  58. <li><a name="toc-Generic-options" href="#Generic-options">5.2 Generic options</a></li>
  59. <li><a name="toc-AVOptions" href="#AVOptions">5.3 AVOptions</a></li>
  60. <li><a name="toc-Main-options" href="#Main-options">5.4 Main options</a></li>
  61. <li><a name="toc-Video-Options" href="#Video-Options">5.5 Video Options</a></li>
  62. <li><a name="toc-Advanced-Video-options" href="#Advanced-Video-options">5.6 Advanced Video options</a></li>
  63. <li><a name="toc-Audio-Options" href="#Audio-Options">5.7 Audio Options</a></li>
  64. <li><a name="toc-Advanced-Audio-options" href="#Advanced-Audio-options">5.8 Advanced Audio options</a></li>
  65. <li><a name="toc-Subtitle-options" href="#Subtitle-options">5.9 Subtitle options</a></li>
  66. <li><a name="toc-Advanced-Subtitle-options" href="#Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></li>
  67. <li><a name="toc-Advanced-options" href="#Advanced-options">5.11 Advanced options</a></li>
  68. <li><a name="toc-Preset-files" href="#Preset-files">5.12 Preset files</a>
  69. <ul class="no-bullet">
  70. <li><a name="toc-ffpreset-files" href="#ffpreset-files">5.12.1 ffpreset files</a></li>
  71. <li><a name="toc-avpreset-files" href="#avpreset-files">5.12.2 avpreset files</a></li>
  72. </ul>
  73. </li>
  74. </ul></li>
  75. <li><a name="toc-Examples-174" href="#Examples-174">6 Examples</a>
  76. <ul class="no-bullet">
  77. <li><a name="toc-Video-and-Audio-grabbing" href="#Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></li>
  78. <li><a name="toc-X11-grabbing" href="#X11-grabbing">6.2 X11 grabbing</a></li>
  79. <li><a name="toc-Video-and-Audio-file-format-conversion" href="#Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></li>
  80. </ul></li>
  81. <li><a name="toc-Syntax-1" href="#Syntax-1">7 Syntax</a>
  82. <ul class="no-bullet">
  83. <li><a name="toc-Quoting-and-escaping" href="#Quoting-and-escaping">7.1 Quoting and escaping</a>
  84. <ul class="no-bullet">
  85. <li><a name="toc-Examples-35" href="#Examples-35">7.1.1 Examples</a></li>
  86. </ul></li>
  87. <li><a name="toc-Date" href="#Date">7.2 Date</a></li>
  88. <li><a name="toc-Time-duration" href="#Time-duration">7.3 Time duration</a>
  89. <ul class="no-bullet">
  90. <li><a name="toc-Examples-98" href="#Examples-98">7.3.1 Examples</a></li>
  91. </ul></li>
  92. <li><a name="toc-Video-size" href="#Video-size">7.4 Video size</a></li>
  93. <li><a name="toc-Video-rate" href="#Video-rate">7.5 Video rate</a></li>
  94. <li><a name="toc-Ratio" href="#Ratio">7.6 Ratio</a></li>
  95. <li><a name="toc-Color" href="#Color">7.7 Color</a></li>
  96. <li><a name="toc-Channel-Layout" href="#Channel-Layout">7.8 Channel Layout</a></li>
  97. </ul></li>
  98. <li><a name="toc-Expression-Evaluation" href="#Expression-Evaluation">8 Expression Evaluation</a></li>
  99. <li><a name="toc-Codec-Options" href="#Codec-Options">9 Codec Options</a></li>
  100. <li><a name="toc-Decoders" href="#Decoders">10 Decoders</a></li>
  101. <li><a name="toc-Video-Decoders" href="#Video-Decoders">11 Video Decoders</a>
  102. <ul class="no-bullet">
  103. <li><a name="toc-rawvideo" href="#rawvideo">11.1 rawvideo</a>
  104. <ul class="no-bullet">
  105. <li><a name="toc-Options-16" href="#Options-16">11.1.1 Options</a></li>
  106. </ul></li>
  107. <li><a name="toc-libdav1d" href="#libdav1d">11.2 libdav1d</a>
  108. <ul class="no-bullet">
  109. <li><a name="toc-Options-72" href="#Options-72">11.2.1 Options</a></li>
  110. </ul></li>
  111. <li><a name="toc-libdavs2" href="#libdavs2">11.3 libdavs2</a></li>
  112. </ul></li>
  113. <li><a name="toc-Audio-Decoders" href="#Audio-Decoders">12 Audio Decoders</a>
  114. <ul class="no-bullet">
  115. <li><a name="toc-ac3" href="#ac3">12.1 ac3</a>
  116. <ul class="no-bullet">
  117. <li><a name="toc-AC_002d3-Decoder-Options" href="#AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></li>
  118. </ul></li>
  119. <li><a name="toc-flac-2" href="#flac-2">12.2 flac</a>
  120. <ul class="no-bullet">
  121. <li><a name="toc-FLAC-Decoder-options" href="#FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></li>
  122. </ul></li>
  123. <li><a name="toc-ffwavesynth" href="#ffwavesynth">12.3 ffwavesynth</a></li>
  124. <li><a name="toc-libcelt" href="#libcelt">12.4 libcelt</a></li>
  125. <li><a name="toc-libgsm" href="#libgsm">12.5 libgsm</a></li>
  126. <li><a name="toc-libilbc" href="#libilbc">12.6 libilbc</a>
  127. <ul class="no-bullet">
  128. <li><a name="toc-Options-74" href="#Options-74">12.6.1 Options</a></li>
  129. </ul></li>
  130. <li><a name="toc-libopencore_002damrnb" href="#libopencore_002damrnb">12.7 libopencore-amrnb</a></li>
  131. <li><a name="toc-libopencore_002damrwb" href="#libopencore_002damrwb">12.8 libopencore-amrwb</a></li>
  132. <li><a name="toc-libopus" href="#libopus">12.9 libopus</a></li>
  133. </ul></li>
  134. <li><a name="toc-Subtitles-Decoders" href="#Subtitles-Decoders">13 Subtitles Decoders</a>
  135. <ul class="no-bullet">
  136. <li><a name="toc-libaribb24" href="#libaribb24">13.1 libaribb24</a>
  137. <ul class="no-bullet">
  138. <li><a name="toc-libaribb24-Decoder-Options" href="#libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></li>
  139. </ul></li>
  140. <li><a name="toc-dvbsub" href="#dvbsub">13.2 dvbsub</a>
  141. <ul class="no-bullet">
  142. <li><a name="toc-Options-85" href="#Options-85">13.2.1 Options</a></li>
  143. </ul></li>
  144. <li><a name="toc-dvdsub-1" href="#dvdsub-1">13.3 dvdsub</a>
  145. <ul class="no-bullet">
  146. <li><a name="toc-Options-40" href="#Options-40">13.3.1 Options</a></li>
  147. </ul></li>
  148. <li><a name="toc-libzvbi_002dteletext" href="#libzvbi_002dteletext">13.4 libzvbi-teletext</a>
  149. <ul class="no-bullet">
  150. <li><a name="toc-Options-1" href="#Options-1">13.4.1 Options</a></li>
  151. </ul>
  152. </li>
  153. </ul></li>
  154. <li><a name="toc-Encoders" href="#Encoders">14 Encoders</a></li>
  155. <li><a name="toc-Audio-Encoders" href="#Audio-Encoders">15 Audio Encoders</a>
  156. <ul class="no-bullet">
  157. <li><a name="toc-aac" href="#aac">15.1 aac</a>
  158. <ul class="no-bullet">
  159. <li><a name="toc-Options-49" href="#Options-49">15.1.1 Options</a></li>
  160. </ul></li>
  161. <li><a name="toc-ac3-and-ac3_005ffixed" href="#ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a>
  162. <ul class="no-bullet">
  163. <li><a name="toc-AC_002d3-Metadata" href="#AC_002d3-Metadata">15.2.1 AC-3 Metadata</a>
  164. <ul class="no-bullet">
  165. <li><a name="toc-Metadata-Control-Options" href="#Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></li>
  166. <li><a name="toc-Downmix-Levels" href="#Downmix-Levels">15.2.1.2 Downmix Levels</a></li>
  167. <li><a name="toc-Audio-Production-Information" href="#Audio-Production-Information">15.2.1.3 Audio Production Information</a></li>
  168. <li><a name="toc-Other-Metadata-Options" href="#Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></li>
  169. </ul></li>
  170. <li><a name="toc-Extended-Bitstream-Information" href="#Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a>
  171. <ul class="no-bullet">
  172. <li><a name="toc-Extended-Bitstream-Information-_002d-Part-1" href="#Extended-Bitstream-Information-_002d-Part-1">15.2.2.1 Extended Bitstream Information - Part 1</a></li>
  173. <li><a name="toc-Extended-Bitstream-Information-_002d-Part-2" href="#Extended-Bitstream-Information-_002d-Part-2">15.2.2.2 Extended Bitstream Information - Part 2</a></li>
  174. </ul></li>
  175. <li><a name="toc-Other-AC_002d3-Encoding-Options" href="#Other-AC_002d3-Encoding-Options">15.2.3 Other AC-3 Encoding Options</a></li>
  176. <li><a name="toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options" href="#Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">15.2.4 Floating-Point-Only AC-3 Encoding Options</a></li>
  177. </ul></li>
  178. <li><a name="toc-flac-1" href="#flac-1">15.3 flac</a>
  179. <ul class="no-bullet">
  180. <li><a name="toc-Options-59" href="#Options-59">15.3.1 Options</a></li>
  181. </ul></li>
  182. <li><a name="toc-opus" href="#opus">15.4 opus</a>
  183. <ul class="no-bullet">
  184. <li><a name="toc-Options-50" href="#Options-50">15.4.1 Options</a></li>
  185. </ul></li>
  186. <li><a name="toc-libfdk_005faac" href="#libfdk_005faac">15.5 libfdk_aac</a>
  187. <ul class="no-bullet">
  188. <li><a name="toc-Options-63" href="#Options-63">15.5.1 Options</a></li>
  189. <li><a name="toc-Examples-105" href="#Examples-105">15.5.2 Examples</a></li>
  190. </ul></li>
  191. <li><a name="toc-libmp3lame-1" href="#libmp3lame-1">15.6 libmp3lame</a>
  192. <ul class="no-bullet">
  193. <li><a name="toc-Options-43" href="#Options-43">15.6.1 Options</a></li>
  194. </ul></li>
  195. <li><a name="toc-libopencore_002damrnb-1" href="#libopencore_002damrnb-1">15.7 libopencore-amrnb</a>
  196. <ul class="no-bullet">
  197. <li><a name="toc-Options-23" href="#Options-23">15.7.1 Options</a></li>
  198. </ul></li>
  199. <li><a name="toc-libopus-1" href="#libopus-1">15.8 libopus</a>
  200. <ul class="no-bullet">
  201. <li><a name="toc-Option-Mapping" href="#Option-Mapping">15.8.1 Option Mapping</a></li>
  202. </ul></li>
  203. <li><a name="toc-libshine-1" href="#libshine-1">15.9 libshine</a>
  204. <ul class="no-bullet">
  205. <li><a name="toc-Options-37" href="#Options-37">15.9.1 Options</a></li>
  206. </ul></li>
  207. <li><a name="toc-libtwolame" href="#libtwolame">15.10 libtwolame</a>
  208. <ul class="no-bullet">
  209. <li><a name="toc-Options-44" href="#Options-44">15.10.1 Options</a></li>
  210. </ul></li>
  211. <li><a name="toc-libvo_002damrwbenc" href="#libvo_002damrwbenc">15.11 libvo-amrwbenc</a>
  212. <ul class="no-bullet">
  213. <li><a name="toc-Options-33" href="#Options-33">15.11.1 Options</a></li>
  214. </ul></li>
  215. <li><a name="toc-libvorbis" href="#libvorbis">15.12 libvorbis</a>
  216. <ul class="no-bullet">
  217. <li><a name="toc-Options-82" href="#Options-82">15.12.1 Options</a></li>
  218. </ul></li>
  219. <li><a name="toc-libwavpack-1" href="#libwavpack-1">15.13 libwavpack</a>
  220. <ul class="no-bullet">
  221. <li><a name="toc-Options-36" href="#Options-36">15.13.1 Options</a></li>
  222. </ul></li>
  223. <li><a name="toc-mjpeg" href="#mjpeg">15.14 mjpeg</a>
  224. <ul class="no-bullet">
  225. <li><a name="toc-Options-30" href="#Options-30">15.14.1 Options</a></li>
  226. </ul></li>
  227. <li><a name="toc-wavpack" href="#wavpack">15.15 wavpack</a>
  228. <ul class="no-bullet">
  229. <li><a name="toc-Options-73" href="#Options-73">15.15.1 Options</a>
  230. <ul class="no-bullet">
  231. <li><a name="toc-Shared-options" href="#Shared-options">15.15.1.1 Shared options</a></li>
  232. <li><a name="toc-Private-options" href="#Private-options">15.15.1.2 Private options</a></li>
  233. </ul>
  234. </li>
  235. </ul>
  236. </li>
  237. </ul></li>
  238. <li><a name="toc-Video-Encoders" href="#Video-Encoders">16 Video Encoders</a>
  239. <ul class="no-bullet">
  240. <li><a name="toc-Hap" href="#Hap">16.1 Hap</a>
  241. <ul class="no-bullet">
  242. <li><a name="toc-Options-11" href="#Options-11">16.1.1 Options</a></li>
  243. </ul></li>
  244. <li><a name="toc-jpeg2000" href="#jpeg2000">16.2 jpeg2000</a>
  245. <ul class="no-bullet">
  246. <li><a name="toc-Options-38" href="#Options-38">16.2.1 Options</a></li>
  247. </ul></li>
  248. <li><a name="toc-librav1e" href="#librav1e">16.3 librav1e</a>
  249. <ul class="no-bullet">
  250. <li><a name="toc-Options-68" href="#Options-68">16.3.1 Options</a></li>
  251. </ul></li>
  252. <li><a name="toc-libaom_002dav1" href="#libaom_002dav1">16.4 libaom-av1</a>
  253. <ul class="no-bullet">
  254. <li><a name="toc-Options-27" href="#Options-27">16.4.1 Options</a></li>
  255. </ul></li>
  256. <li><a name="toc-libkvazaar" href="#libkvazaar">16.5 libkvazaar</a>
  257. <ul class="no-bullet">
  258. <li><a name="toc-Options-45" href="#Options-45">16.5.1 Options</a></li>
  259. </ul></li>
  260. <li><a name="toc-libopenh264" href="#libopenh264">16.6 libopenh264</a>
  261. <ul class="no-bullet">
  262. <li><a name="toc-Options-24" href="#Options-24">16.6.1 Options</a></li>
  263. </ul></li>
  264. <li><a name="toc-libtheora" href="#libtheora">16.7 libtheora</a>
  265. <ul class="no-bullet">
  266. <li><a name="toc-Options-25" href="#Options-25">16.7.1 Options</a></li>
  267. <li><a name="toc-Examples-179" href="#Examples-179">16.7.2 Examples</a></li>
  268. </ul></li>
  269. <li><a name="toc-libvpx" href="#libvpx">16.8 libvpx</a>
  270. <ul class="no-bullet">
  271. <li><a name="toc-Options-9" href="#Options-9">16.8.1 Options</a></li>
  272. </ul></li>
  273. <li><a name="toc-libwebp" href="#libwebp">16.9 libwebp</a>
  274. <ul class="no-bullet">
  275. <li><a name="toc-Pixel-Format" href="#Pixel-Format">16.9.1 Pixel Format</a></li>
  276. <li><a name="toc-Options-18" href="#Options-18">16.9.2 Options</a></li>
  277. </ul></li>
  278. <li><a name="toc-libx264_002c-libx264rgb" href="#libx264_002c-libx264rgb">16.10 libx264, libx264rgb</a>
  279. <ul class="no-bullet">
  280. <li><a name="toc-Supported-Pixel-Formats" href="#Supported-Pixel-Formats">16.10.1 Supported Pixel Formats</a></li>
  281. <li><a name="toc-Options-47" href="#Options-47">16.10.2 Options</a></li>
  282. </ul></li>
  283. <li><a name="toc-libx265" href="#libx265">16.11 libx265</a>
  284. <ul class="no-bullet">
  285. <li><a name="toc-Options-79" href="#Options-79">16.11.1 Options</a></li>
  286. </ul></li>
  287. <li><a name="toc-libxavs2" href="#libxavs2">16.12 libxavs2</a>
  288. <ul class="no-bullet">
  289. <li><a name="toc-Options-65" href="#Options-65">16.12.1 Options</a></li>
  290. </ul></li>
  291. <li><a name="toc-libxvid" href="#libxvid">16.13 libxvid</a>
  292. <ul class="no-bullet">
  293. <li><a name="toc-Options-10" href="#Options-10">16.13.1 Options</a></li>
  294. </ul></li>
  295. <li><a name="toc-mpeg2" href="#mpeg2">16.14 mpeg2</a>
  296. <ul class="no-bullet">
  297. <li><a name="toc-Options-69" href="#Options-69">16.14.1 Options</a></li>
  298. </ul></li>
  299. <li><a name="toc-png" href="#png">16.15 png</a>
  300. <ul class="no-bullet">
  301. <li><a name="toc-Private-options-1" href="#Private-options-1">16.15.1 Private options</a></li>
  302. </ul></li>
  303. <li><a name="toc-ProRes" href="#ProRes">16.16 ProRes</a>
  304. <ul class="no-bullet">
  305. <li><a name="toc-Private-Options-for-prores_002dks" href="#Private-Options-for-prores_002dks">16.16.1 Private Options for prores-ks</a></li>
  306. <li><a name="toc-Speed-considerations" href="#Speed-considerations">16.16.2 Speed considerations</a></li>
  307. </ul></li>
  308. <li><a name="toc-QSV-encoders" href="#QSV-encoders">16.17 QSV encoders</a></li>
  309. <li><a name="toc-snow" href="#snow">16.18 snow</a>
  310. <ul class="no-bullet">
  311. <li><a name="toc-Options-78" href="#Options-78">16.18.1 Options</a></li>
  312. </ul></li>
  313. <li><a name="toc-VAAPI-encoders" href="#VAAPI-encoders">16.19 VAAPI encoders</a></li>
  314. <li><a name="toc-vc2" href="#vc2">16.20 vc2</a>
  315. <ul class="no-bullet">
  316. <li><a name="toc-Options-60" href="#Options-60">16.20.1 Options</a></li>
  317. </ul>
  318. </li>
  319. </ul></li>
  320. <li><a name="toc-Subtitles-Encoders" href="#Subtitles-Encoders">17 Subtitles Encoders</a>
  321. <ul class="no-bullet">
  322. <li><a name="toc-dvdsub" href="#dvdsub">17.1 dvdsub</a>
  323. <ul class="no-bullet">
  324. <li><a name="toc-Options-56" href="#Options-56">17.1.1 Options</a></li>
  325. </ul>
  326. </li>
  327. </ul></li>
  328. <li><a name="toc-Bitstream-Filters" href="#Bitstream-Filters">18 Bitstream Filters</a>
  329. <ul class="no-bullet">
  330. <li><a name="toc-aac_005fadtstoasc" href="#aac_005fadtstoasc">18.1 aac_adtstoasc</a></li>
  331. <li><a name="toc-av1_005fmetadata" href="#av1_005fmetadata">18.2 av1_metadata</a></li>
  332. <li><a name="toc-chomp" href="#chomp">18.3 chomp</a></li>
  333. <li><a name="toc-dca_005fcore" href="#dca_005fcore">18.4 dca_core</a></li>
  334. <li><a name="toc-dump_005fextra" href="#dump_005fextra">18.5 dump_extra</a></li>
  335. <li><a name="toc-eac3_005fcore" href="#eac3_005fcore">18.6 eac3_core</a></li>
  336. <li><a name="toc-extract_005fextradata" href="#extract_005fextradata">18.7 extract_extradata</a></li>
  337. <li><a name="toc-filter_005funits" href="#filter_005funits">18.8 filter_units</a></li>
  338. <li><a name="toc-hapqa_005fextract" href="#hapqa_005fextract">18.9 hapqa_extract</a></li>
  339. <li><a name="toc-h264_005fmetadata" href="#h264_005fmetadata">18.10 h264_metadata</a></li>
  340. <li><a name="toc-h264_005fmp4toannexb" href="#h264_005fmp4toannexb">18.11 h264_mp4toannexb</a></li>
  341. <li><a name="toc-h264_005fredundant_005fpps" href="#h264_005fredundant_005fpps">18.12 h264_redundant_pps</a></li>
  342. <li><a name="toc-hevc_005fmetadata" href="#hevc_005fmetadata">18.13 hevc_metadata</a></li>
  343. <li><a name="toc-hevc_005fmp4toannexb" href="#hevc_005fmp4toannexb">18.14 hevc_mp4toannexb</a></li>
  344. <li><a name="toc-imxdump" href="#imxdump">18.15 imxdump</a></li>
  345. <li><a name="toc-mjpeg2jpeg" href="#mjpeg2jpeg">18.16 mjpeg2jpeg</a></li>
  346. <li><a name="toc-mjpegadump" href="#mjpegadump">18.17 mjpegadump</a></li>
  347. <li><a name="toc-mov2textsub-1" href="#mov2textsub-1">18.18 mov2textsub</a></li>
  348. <li><a name="toc-mp3decomp" href="#mp3decomp">18.19 mp3decomp</a></li>
  349. <li><a name="toc-mpeg2_005fmetadata" href="#mpeg2_005fmetadata">18.20 mpeg2_metadata</a></li>
  350. <li><a name="toc-mpeg4_005funpack_005fbframes" href="#mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></li>
  351. <li><a name="toc-noise" href="#noise">18.22 noise</a></li>
  352. <li><a name="toc-null-2" href="#null-2">18.23 null</a></li>
  353. <li><a name="toc-prores_005fmetadata" href="#prores_005fmetadata">18.24 prores_metadata</a></li>
  354. <li><a name="toc-remove_005fextra" href="#remove_005fextra">18.25 remove_extra</a></li>
  355. <li><a name="toc-text2movsub-1" href="#text2movsub-1">18.26 text2movsub</a></li>
  356. <li><a name="toc-trace_005fheaders" href="#trace_005fheaders">18.27 trace_headers</a></li>
  357. <li><a name="toc-truehd_005fcore" href="#truehd_005fcore">18.28 truehd_core</a></li>
  358. <li><a name="toc-vp9_005fmetadata" href="#vp9_005fmetadata">18.29 vp9_metadata</a></li>
  359. <li><a name="toc-vp9_005fsuperframe" href="#vp9_005fsuperframe">18.30 vp9_superframe</a></li>
  360. <li><a name="toc-vp9_005fsuperframe_005fsplit" href="#vp9_005fsuperframe_005fsplit">18.31 vp9_superframe_split</a></li>
  361. <li><a name="toc-vp9_005fraw_005freorder" href="#vp9_005fraw_005freorder">18.32 vp9_raw_reorder</a></li>
  362. </ul></li>
  363. <li><a name="toc-Format-Options" href="#Format-Options">19 Format Options</a>
  364. <ul class="no-bullet">
  365. <li><a name="toc-Format-stream-specifiers-1" href="#Format-stream-specifiers-1">19.1 Format stream specifiers</a></li>
  366. </ul></li>
  367. <li><a name="toc-Demuxers" href="#Demuxers">20 Demuxers</a>
  368. <ul class="no-bullet">
  369. <li><a name="toc-aa" href="#aa">20.1 aa</a></li>
  370. <li><a name="toc-apng" href="#apng">20.2 apng</a></li>
  371. <li><a name="toc-asf-2" href="#asf-2">20.3 asf</a></li>
  372. <li><a name="toc-concat-1" href="#concat-1">20.4 concat</a>
  373. <ul class="no-bullet">
  374. <li><a name="toc-Syntax-2" href="#Syntax-2">20.4.1 Syntax</a></li>
  375. <li><a name="toc-Options-17" href="#Options-17">20.4.2 Options</a></li>
  376. <li><a name="toc-Examples-76" href="#Examples-76">20.4.3 Examples</a></li>
  377. </ul></li>
  378. <li><a name="toc-dash-1" href="#dash-1">20.5 dash</a></li>
  379. <li><a name="toc-flv_002c-live_005fflv" href="#flv_002c-live_005fflv">20.6 flv, live_flv</a></li>
  380. <li><a name="toc-gif-1" href="#gif-1">20.7 gif</a></li>
  381. <li><a name="toc-hls-1" href="#hls-1">20.8 hls</a></li>
  382. <li><a name="toc-image2-2" href="#image2-2">20.9 image2</a>
  383. <ul class="no-bullet">
  384. <li><a name="toc-Examples-164" href="#Examples-164">20.9.1 Examples</a></li>
  385. </ul></li>
  386. <li><a name="toc-libgme" href="#libgme">20.10 libgme</a></li>
  387. <li><a name="toc-libmodplug" href="#libmodplug">20.11 libmodplug</a></li>
  388. <li><a name="toc-libopenmpt" href="#libopenmpt">20.12 libopenmpt</a></li>
  389. <li><a name="toc-mov_002fmp4_002f3gp" href="#mov_002fmp4_002f3gp">20.13 mov/mp4/3gp</a>
  390. <ul class="no-bullet">
  391. <li><a name="toc-Options-51" href="#Options-51">20.13.1 Options</a></li>
  392. <li><a name="toc-Audible-AAX" href="#Audible-AAX">20.13.2 Audible AAX</a></li>
  393. </ul></li>
  394. <li><a name="toc-mpegts-1" href="#mpegts-1">20.14 mpegts</a></li>
  395. <li><a name="toc-mpjpeg" href="#mpjpeg">20.15 mpjpeg</a></li>
  396. <li><a name="toc-rawvideo-1" href="#rawvideo-1">20.16 rawvideo</a></li>
  397. <li><a name="toc-sbg" href="#sbg">20.17 sbg</a></li>
  398. <li><a name="toc-tedcaptions" href="#tedcaptions">20.18 tedcaptions</a></li>
  399. <li><a name="toc-vapoursynth" href="#vapoursynth">20.19 vapoursynth</a></li>
  400. </ul></li>
  401. <li><a name="toc-Muxers" href="#Muxers">21 Muxers</a>
  402. <ul class="no-bullet">
  403. <li><a name="toc-aiff-1" href="#aiff-1">21.1 aiff</a>
  404. <ul class="no-bullet">
  405. <li><a name="toc-Options-61" href="#Options-61">21.1.1 Options</a></li>
  406. </ul></li>
  407. <li><a name="toc-asf-1" href="#asf-1">21.2 asf</a>
  408. <ul class="no-bullet">
  409. <li><a name="toc-Options-26" href="#Options-26">21.2.1 Options</a></li>
  410. </ul></li>
  411. <li><a name="toc-avi-1" href="#avi-1">21.3 avi</a>
  412. <ul class="no-bullet">
  413. <li><a name="toc-Options-54" href="#Options-54">21.3.1 Options</a></li>
  414. </ul></li>
  415. <li><a name="toc-chromaprint-1" href="#chromaprint-1">21.4 chromaprint</a>
  416. <ul class="no-bullet">
  417. <li><a name="toc-Options-53" href="#Options-53">21.4.1 Options</a></li>
  418. </ul></li>
  419. <li><a name="toc-crc-1" href="#crc-1">21.5 crc</a>
  420. <ul class="no-bullet">
  421. <li><a name="toc-Examples-100" href="#Examples-100">21.5.1 Examples</a></li>
  422. </ul></li>
  423. <li><a name="toc-flv" href="#flv">21.6 flv</a></li>
  424. <li><a name="toc-dash-2" href="#dash-2">21.7 dash</a></li>
  425. <li><a name="toc-framecrc-1" href="#framecrc-1">21.8 framecrc</a>
  426. <ul class="no-bullet">
  427. <li><a name="toc-Examples-165" href="#Examples-165">21.8.1 Examples</a></li>
  428. </ul></li>
  429. <li><a name="toc-framehash-1" href="#framehash-1">21.9 framehash</a>
  430. <ul class="no-bullet">
  431. <li><a name="toc-Examples-132" href="#Examples-132">21.9.1 Examples</a></li>
  432. </ul></li>
  433. <li><a name="toc-framemd5-1" href="#framemd5-1">21.10 framemd5</a>
  434. <ul class="no-bullet">
  435. <li><a name="toc-Examples-112" href="#Examples-112">21.10.1 Examples</a></li>
  436. </ul></li>
  437. <li><a name="toc-gif-2" href="#gif-2">21.11 gif</a></li>
  438. <li><a name="toc-hash-1" href="#hash-1">21.12 hash</a>
  439. <ul class="no-bullet">
  440. <li><a name="toc-Examples-134" href="#Examples-134">21.12.1 Examples</a></li>
  441. </ul></li>
  442. <li><a name="toc-hls-2" href="#hls-2">21.13 hls</a>
  443. <ul class="no-bullet">
  444. <li><a name="toc-Options-66" href="#Options-66">21.13.1 Options</a></li>
  445. </ul></li>
  446. <li><a name="toc-ico-1" href="#ico-1">21.14 ico</a></li>
  447. <li><a name="toc-image2-1" href="#image2-1">21.15 image2</a>
  448. <ul class="no-bullet">
  449. <li><a name="toc-Options-64" href="#Options-64">21.15.1 Options</a></li>
  450. <li><a name="toc-Examples-104" href="#Examples-104">21.15.2 Examples</a></li>
  451. </ul></li>
  452. <li><a name="toc-matroska" href="#matroska">21.16 matroska</a>
  453. <ul class="no-bullet">
  454. <li><a name="toc-Metadata-1" href="#Metadata-1">21.16.1 Metadata</a></li>
  455. <li><a name="toc-Options-8" href="#Options-8">21.16.2 Options</a></li>
  456. </ul></li>
  457. <li><a name="toc-md5-2" href="#md5-2">21.17 md5</a>
  458. <ul class="no-bullet">
  459. <li><a name="toc-Examples-119" href="#Examples-119">21.17.1 Examples</a></li>
  460. </ul></li>
  461. <li><a name="toc-mov_002c-mp4_002c-ismv" href="#mov_002c-mp4_002c-ismv">21.18 mov, mp4, ismv</a>
  462. <ul class="no-bullet">
  463. <li><a name="toc-Options-75" href="#Options-75">21.18.1 Options</a></li>
  464. <li><a name="toc-Example" href="#Example">21.18.2 Example</a></li>
  465. </ul></li>
  466. <li><a name="toc-mp3" href="#mp3">21.19 mp3</a></li>
  467. <li><a name="toc-mpegts" href="#mpegts">21.20 mpegts</a>
  468. <ul class="no-bullet">
  469. <li><a name="toc-Options-34" href="#Options-34">21.20.1 Options</a></li>
  470. <li><a name="toc-Example-9" href="#Example-9">21.20.2 Example</a></li>
  471. </ul></li>
  472. <li><a name="toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom" href="#mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.21 mxf, mxf_d10, mxf_opatom</a>
  473. <ul class="no-bullet">
  474. <li><a name="toc-Options-13" href="#Options-13">21.21.1 Options</a></li>
  475. </ul></li>
  476. <li><a name="toc-null" href="#null">21.22 null</a></li>
  477. <li><a name="toc-nut" href="#nut">21.23 nut</a></li>
  478. <li><a name="toc-ogg" href="#ogg">21.24 ogg</a></li>
  479. <li><a name="toc-segment_002c-stream_005fsegment_002c-ssegment" href="#segment_002c-stream_005fsegment_002c-ssegment">21.25 segment, stream_segment, ssegment</a>
  480. <ul class="no-bullet">
  481. <li><a name="toc-Options-2" href="#Options-2">21.25.1 Options</a></li>
  482. <li><a name="toc-Examples-71" href="#Examples-71">21.25.2 Examples</a></li>
  483. </ul></li>
  484. <li><a name="toc-smoothstreaming" href="#smoothstreaming">21.26 smoothstreaming</a></li>
  485. <li><a name="toc-streamhash-1" href="#streamhash-1">21.27 streamhash</a>
  486. <ul class="no-bullet">
  487. <li><a name="toc-Examples-72" href="#Examples-72">21.27.1 Examples</a></li>
  488. </ul></li>
  489. <li><a name="toc-fifo-1" href="#fifo-1">21.28 fifo</a>
  490. <ul class="no-bullet">
  491. <li><a name="toc-Examples-34" href="#Examples-34">21.28.1 Examples</a></li>
  492. </ul></li>
  493. <li><a name="toc-tee-1" href="#tee-1">21.29 tee</a>
  494. <ul class="no-bullet">
  495. <li><a name="toc-Options-4" href="#Options-4">21.29.1 Options</a></li>
  496. <li><a name="toc-Examples-162" href="#Examples-162">21.29.2 Examples</a></li>
  497. </ul></li>
  498. <li><a name="toc-webm_005fdash_005fmanifest" href="#webm_005fdash_005fmanifest">21.30 webm_dash_manifest</a>
  499. <ul class="no-bullet">
  500. <li><a name="toc-Options-6" href="#Options-6">21.30.1 Options</a></li>
  501. <li><a name="toc-Example-1" href="#Example-1">21.30.2 Example</a></li>
  502. </ul></li>
  503. <li><a name="toc-webm_005fchunk" href="#webm_005fchunk">21.31 webm_chunk</a>
  504. <ul class="no-bullet">
  505. <li><a name="toc-Options-29" href="#Options-29">21.31.1 Options</a></li>
  506. <li><a name="toc-Example-8" href="#Example-8">21.31.2 Example</a></li>
  507. </ul>
  508. </li>
  509. </ul></li>
  510. <li><a name="toc-Metadata" href="#Metadata">22 Metadata</a></li>
  511. <li><a name="toc-Protocol-Options" href="#Protocol-Options">23 Protocol Options</a></li>
  512. <li><a name="toc-Protocols" href="#Protocols">24 Protocols</a>
  513. <ul class="no-bullet">
  514. <li><a name="toc-async" href="#async">24.1 async</a></li>
  515. <li><a name="toc-bluray" href="#bluray">24.2 bluray</a></li>
  516. <li><a name="toc-cache" href="#cache">24.3 cache</a></li>
  517. <li><a name="toc-concat-3" href="#concat-3">24.4 concat</a></li>
  518. <li><a name="toc-crypto" href="#crypto">24.5 crypto</a></li>
  519. <li><a name="toc-data" href="#data">24.6 data</a></li>
  520. <li><a name="toc-file" href="#file">24.7 file</a></li>
  521. <li><a name="toc-ftp" href="#ftp">24.8 ftp</a></li>
  522. <li><a name="toc-gopher" href="#gopher">24.9 gopher</a></li>
  523. <li><a name="toc-hls-3" href="#hls-3">24.10 hls</a></li>
  524. <li><a name="toc-http" href="#http">24.11 http</a>
  525. <ul class="no-bullet">
  526. <li><a name="toc-HTTP-Cookies" href="#HTTP-Cookies">24.11.1 HTTP Cookies</a></li>
  527. </ul></li>
  528. <li><a name="toc-Icecast" href="#Icecast">24.12 Icecast</a></li>
  529. <li><a name="toc-mmst" href="#mmst">24.13 mmst</a></li>
  530. <li><a name="toc-mmsh" href="#mmsh">24.14 mmsh</a></li>
  531. <li><a name="toc-md5-1" href="#md5-1">24.15 md5</a></li>
  532. <li><a name="toc-pipe" href="#pipe">24.16 pipe</a></li>
  533. <li><a name="toc-prompeg" href="#prompeg">24.17 prompeg</a></li>
  534. <li><a name="toc-rtmp" href="#rtmp">24.18 rtmp</a></li>
  535. <li><a name="toc-rtmpe" href="#rtmpe">24.19 rtmpe</a></li>
  536. <li><a name="toc-rtmps" href="#rtmps">24.20 rtmps</a></li>
  537. <li><a name="toc-rtmpt" href="#rtmpt">24.21 rtmpt</a></li>
  538. <li><a name="toc-rtmpte" href="#rtmpte">24.22 rtmpte</a></li>
  539. <li><a name="toc-rtmpts" href="#rtmpts">24.23 rtmpts</a></li>
  540. <li><a name="toc-libsmbclient" href="#libsmbclient">24.24 libsmbclient</a></li>
  541. <li><a name="toc-libssh" href="#libssh">24.25 libssh</a></li>
  542. <li><a name="toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte" href="#librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">24.26 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></li>
  543. <li><a name="toc-rtp" href="#rtp">24.27 rtp</a></li>
  544. <li><a name="toc-rtsp" href="#rtsp">24.28 rtsp</a>
  545. <ul class="no-bullet">
  546. <li><a name="toc-Examples-96" href="#Examples-96">24.28.1 Examples</a></li>
  547. </ul></li>
  548. <li><a name="toc-sap" href="#sap">24.29 sap</a>
  549. <ul class="no-bullet">
  550. <li><a name="toc-Muxer" href="#Muxer">24.29.1 Muxer</a></li>
  551. <li><a name="toc-Demuxer" href="#Demuxer">24.29.2 Demuxer</a></li>
  552. </ul></li>
  553. <li><a name="toc-sctp" href="#sctp">24.30 sctp</a></li>
  554. <li><a name="toc-srt" href="#srt">24.31 srt</a></li>
  555. <li><a name="toc-srtp" href="#srtp">24.32 srtp</a></li>
  556. <li><a name="toc-subfile" href="#subfile">24.33 subfile</a></li>
  557. <li><a name="toc-tee-2" href="#tee-2">24.34 tee</a></li>
  558. <li><a name="toc-tcp" href="#tcp">24.35 tcp</a></li>
  559. <li><a name="toc-tls" href="#tls">24.36 tls</a></li>
  560. <li><a name="toc-udp" href="#udp">24.37 udp</a>
  561. <ul class="no-bullet">
  562. <li><a name="toc-Examples-42" href="#Examples-42">24.37.1 Examples</a></li>
  563. </ul></li>
  564. <li><a name="toc-unix" href="#unix">24.38 unix</a></li>
  565. <li><a name="toc-zmq" href="#zmq">24.39 zmq</a></li>
  566. </ul></li>
  567. <li><a name="toc-Device-Options" href="#Device-Options">25 Device Options</a></li>
  568. <li><a name="toc-Input-Devices" href="#Input-Devices">26 Input Devices</a>
  569. <ul class="no-bullet">
  570. <li><a name="toc-alsa-1" href="#alsa-1">26.1 alsa</a>
  571. <ul class="no-bullet">
  572. <li><a name="toc-Options-46" href="#Options-46">26.1.1 Options</a></li>
  573. </ul></li>
  574. <li><a name="toc-android_005fcamera" href="#android_005fcamera">26.2 android_camera</a>
  575. <ul class="no-bullet">
  576. <li><a name="toc-Options-57" href="#Options-57">26.2.1 Options</a></li>
  577. </ul></li>
  578. <li><a name="toc-avfoundation" href="#avfoundation">26.3 avfoundation</a>
  579. <ul class="no-bullet">
  580. <li><a name="toc-Options-20" href="#Options-20">26.3.1 Options</a></li>
  581. <li><a name="toc-Examples-109" href="#Examples-109">26.3.2 Examples</a></li>
  582. </ul></li>
  583. <li><a name="toc-bktr" href="#bktr">26.4 bktr</a>
  584. <ul class="no-bullet">
  585. <li><a name="toc-Options-31" href="#Options-31">26.4.1 Options</a></li>
  586. </ul></li>
  587. <li><a name="toc-decklink" href="#decklink">26.5 decklink</a>
  588. <ul class="no-bullet">
  589. <li><a name="toc-Options-41" href="#Options-41">26.5.1 Options</a></li>
  590. <li><a name="toc-Examples-127" href="#Examples-127">26.5.2 Examples</a></li>
  591. </ul></li>
  592. <li><a name="toc-dshow" href="#dshow">26.6 dshow</a>
  593. <ul class="no-bullet">
  594. <li><a name="toc-Options-19" href="#Options-19">26.6.1 Options</a></li>
  595. <li><a name="toc-Examples-145" href="#Examples-145">26.6.2 Examples</a></li>
  596. </ul></li>
  597. <li><a name="toc-fbdev" href="#fbdev">26.7 fbdev</a>
  598. <ul class="no-bullet">
  599. <li><a name="toc-Options-77" href="#Options-77">26.7.1 Options</a></li>
  600. </ul></li>
  601. <li><a name="toc-gdigrab" href="#gdigrab">26.8 gdigrab</a>
  602. <ul class="no-bullet">
  603. <li><a name="toc-Options-21" href="#Options-21">26.8.1 Options</a></li>
  604. </ul></li>
  605. <li><a name="toc-iec61883" href="#iec61883">26.9 iec61883</a>
  606. <ul class="no-bullet">
  607. <li><a name="toc-Options-3" href="#Options-3">26.9.1 Options</a></li>
  608. <li><a name="toc-Examples-138" href="#Examples-138">26.9.2 Examples</a></li>
  609. </ul></li>
  610. <li><a name="toc-jack" href="#jack">26.10 jack</a>
  611. <ul class="no-bullet">
  612. <li><a name="toc-Options-58" href="#Options-58">26.10.1 Options</a></li>
  613. </ul></li>
  614. <li><a name="toc-kmsgrab" href="#kmsgrab">26.11 kmsgrab</a>
  615. <ul class="no-bullet">
  616. <li><a name="toc-Options-5" href="#Options-5">26.11.1 Options</a></li>
  617. <li><a name="toc-Examples-85" href="#Examples-85">26.11.2 Examples</a></li>
  618. </ul></li>
  619. <li><a name="toc-lavfi" href="#lavfi">26.12 lavfi</a>
  620. <ul class="no-bullet">
  621. <li><a name="toc-Options-84" href="#Options-84">26.12.1 Options</a></li>
  622. <li><a name="toc-Examples-106" href="#Examples-106">26.12.2 Examples</a></li>
  623. </ul></li>
  624. <li><a name="toc-libcdio" href="#libcdio">26.13 libcdio</a>
  625. <ul class="no-bullet">
  626. <li><a name="toc-Options-80" href="#Options-80">26.13.1 Options</a></li>
  627. </ul></li>
  628. <li><a name="toc-libdc1394" href="#libdc1394">26.14 libdc1394</a>
  629. <ul class="no-bullet">
  630. <li><a name="toc-Options-15" href="#Options-15">26.14.1 Options</a></li>
  631. </ul></li>
  632. <li><a name="toc-openal" href="#openal">26.15 openal</a>
  633. <ul class="no-bullet">
  634. <li><a name="toc-Options-70" href="#Options-70">26.15.1 Options</a></li>
  635. <li><a name="toc-Examples-20" href="#Examples-20">26.15.2 Examples</a></li>
  636. </ul></li>
  637. <li><a name="toc-oss" href="#oss">26.16 oss</a>
  638. <ul class="no-bullet">
  639. <li><a name="toc-Options-76" href="#Options-76">26.16.1 Options</a></li>
  640. </ul></li>
  641. <li><a name="toc-pulse" href="#pulse">26.17 pulse</a>
  642. <ul class="no-bullet">
  643. <li><a name="toc-Options-32" href="#Options-32">26.17.1 Options</a></li>
  644. <li><a name="toc-Examples-187" href="#Examples-187">26.17.2 Examples</a></li>
  645. </ul></li>
  646. <li><a name="toc-sndio" href="#sndio">26.18 sndio</a>
  647. <ul class="no-bullet">
  648. <li><a name="toc-Options-81" href="#Options-81">26.18.1 Options</a></li>
  649. </ul></li>
  650. <li><a name="toc-video4linux2_002c-v4l2" href="#video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a>
  651. <ul class="no-bullet">
  652. <li><a name="toc-Options-48" href="#Options-48">26.19.1 Options</a></li>
  653. </ul></li>
  654. <li><a name="toc-vfwcap" href="#vfwcap">26.20 vfwcap</a>
  655. <ul class="no-bullet">
  656. <li><a name="toc-Options-42" href="#Options-42">26.20.1 Options</a></li>
  657. </ul></li>
  658. <li><a name="toc-x11grab" href="#x11grab">26.21 x11grab</a>
  659. <ul class="no-bullet">
  660. <li><a name="toc-Options-14" href="#Options-14">26.21.1 Options</a></li>
  661. </ul>
  662. </li>
  663. </ul></li>
  664. <li><a name="toc-Output-Devices" href="#Output-Devices">27 Output Devices</a>
  665. <ul class="no-bullet">
  666. <li><a name="toc-alsa" href="#alsa">27.1 alsa</a>
  667. <ul class="no-bullet">
  668. <li><a name="toc-Examples-115" href="#Examples-115">27.1.1 Examples</a></li>
  669. </ul></li>
  670. <li><a name="toc-caca" href="#caca">27.2 caca</a>
  671. <ul class="no-bullet">
  672. <li><a name="toc-Options-62" href="#Options-62">27.2.1 Options</a></li>
  673. <li><a name="toc-Examples-7" href="#Examples-7">27.2.2 Examples</a></li>
  674. </ul></li>
  675. <li><a name="toc-decklink-1" href="#decklink-1">27.3 decklink</a>
  676. <ul class="no-bullet">
  677. <li><a name="toc-Options-52" href="#Options-52">27.3.1 Options</a></li>
  678. <li><a name="toc-Examples-41" href="#Examples-41">27.3.2 Examples</a></li>
  679. </ul></li>
  680. <li><a name="toc-fbdev-1" href="#fbdev-1">27.4 fbdev</a>
  681. <ul class="no-bullet">
  682. <li><a name="toc-Options-12" href="#Options-12">27.4.1 Options</a></li>
  683. <li><a name="toc-Examples-107" href="#Examples-107">27.4.2 Examples</a></li>
  684. </ul></li>
  685. <li><a name="toc-opengl" href="#opengl">27.5 opengl</a>
  686. <ul class="no-bullet">
  687. <li><a name="toc-Options-39" href="#Options-39">27.5.1 Options</a></li>
  688. <li><a name="toc-Examples-161" href="#Examples-161">27.5.2 Examples</a></li>
  689. </ul></li>
  690. <li><a name="toc-oss-1" href="#oss-1">27.6 oss</a></li>
  691. <li><a name="toc-pulse-1" href="#pulse-1">27.7 pulse</a>
  692. <ul class="no-bullet">
  693. <li><a name="toc-Options-83" href="#Options-83">27.7.1 Options</a></li>
  694. <li><a name="toc-Examples-12" href="#Examples-12">27.7.2 Examples</a></li>
  695. </ul></li>
  696. <li><a name="toc-sdl" href="#sdl">27.8 sdl</a>
  697. <ul class="no-bullet">
  698. <li><a name="toc-Options-67" href="#Options-67">27.8.1 Options</a></li>
  699. <li><a name="toc-Interactive-commands" href="#Interactive-commands">27.8.2 Interactive commands</a></li>
  700. <li><a name="toc-Examples-8" href="#Examples-8">27.8.3 Examples</a></li>
  701. </ul></li>
  702. <li><a name="toc-sndio-1" href="#sndio-1">27.9 sndio</a></li>
  703. <li><a name="toc-v4l2" href="#v4l2">27.10 v4l2</a></li>
  704. <li><a name="toc-xv" href="#xv">27.11 xv</a>
  705. <ul class="no-bullet">
  706. <li><a name="toc-Options-71" href="#Options-71">27.11.1 Options</a></li>
  707. <li><a name="toc-Examples-158" href="#Examples-158">27.11.2 Examples</a></li>
  708. </ul>
  709. </li>
  710. </ul></li>
  711. <li><a name="toc-Resampler-Options" href="#Resampler-Options">28 Resampler Options</a></li>
  712. <li><a name="toc-Scaler-Options" href="#Scaler-Options">29 Scaler Options</a></li>
  713. <li><a name="toc-Filtering-Introduction" href="#Filtering-Introduction">30 Filtering Introduction</a></li>
  714. <li><a name="toc-graph2dot" href="#graph2dot">31 graph2dot</a></li>
  715. <li><a name="toc-Filtergraph-description" href="#Filtergraph-description">32 Filtergraph description</a>
  716. <ul class="no-bullet">
  717. <li><a name="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">32.1 Filtergraph syntax</a></li>
  718. <li><a name="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></li>
  719. </ul></li>
  720. <li><a name="toc-Timeline-editing" href="#Timeline-editing">33 Timeline editing</a></li>
  721. <li><a name="toc-Changing-options-at-runtime-with-a-command" href="#Changing-options-at-runtime-with-a-command">34 Changing options at runtime with a command</a></li>
  722. <li><a name="toc-Options-for-filters-with-several-inputs-_0028framesync_0029" href="#Options-for-filters-with-several-inputs-_0028framesync_0029">35 Options for filters with several inputs (framesync)</a></li>
  723. <li><a name="toc-Audio-Filters" href="#Audio-Filters">36 Audio Filters</a>
  724. <ul class="no-bullet">
  725. <li><a name="toc-acompressor" href="#acompressor">36.1 acompressor</a>
  726. <ul class="no-bullet">
  727. <li><a name="toc-Commands-49" href="#Commands-49">36.1.1 Commands</a></li>
  728. </ul></li>
  729. <li><a name="toc-acontrast" href="#acontrast">36.2 acontrast</a></li>
  730. <li><a name="toc-acopy" href="#acopy">36.3 acopy</a></li>
  731. <li><a name="toc-acrossfade" href="#acrossfade">36.4 acrossfade</a>
  732. <ul class="no-bullet">
  733. <li><a name="toc-Examples-50" href="#Examples-50">36.4.1 Examples</a></li>
  734. </ul></li>
  735. <li><a name="toc-acrossover" href="#acrossover">36.5 acrossover</a></li>
  736. <li><a name="toc-acrusher" href="#acrusher">36.6 acrusher</a></li>
  737. <li><a name="toc-acue" href="#acue">36.7 acue</a></li>
  738. <li><a name="toc-adeclick" href="#adeclick">36.8 adeclick</a></li>
  739. <li><a name="toc-adeclip" href="#adeclip">36.9 adeclip</a></li>
  740. <li><a name="toc-adelay" href="#adelay">36.10 adelay</a>
  741. <ul class="no-bullet">
  742. <li><a name="toc-Examples-168" href="#Examples-168">36.10.1 Examples</a></li>
  743. </ul></li>
  744. <li><a name="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">36.11 aderivative, aintegral</a></li>
  745. <li><a name="toc-aecho" href="#aecho">36.12 aecho</a>
  746. <ul class="no-bullet">
  747. <li><a name="toc-Examples-86" href="#Examples-86">36.12.1 Examples</a></li>
  748. </ul></li>
  749. <li><a name="toc-aemphasis" href="#aemphasis">36.13 aemphasis</a></li>
  750. <li><a name="toc-aeval" href="#aeval">36.14 aeval</a>
  751. <ul class="no-bullet">
  752. <li><a name="toc-Examples-90" href="#Examples-90">36.14.1 Examples</a></li>
  753. </ul></li>
  754. <li><a name="toc-afade-1" href="#afade-1">36.15 afade</a>
  755. <ul class="no-bullet">
  756. <li><a name="toc-Examples-17" href="#Examples-17">36.15.1 Examples</a></li>
  757. </ul></li>
  758. <li><a name="toc-afftdn" href="#afftdn">36.16 afftdn</a>
  759. <ul class="no-bullet">
  760. <li><a name="toc-Commands-17" href="#Commands-17">36.16.1 Commands</a></li>
  761. </ul></li>
  762. <li><a name="toc-afftfilt" href="#afftfilt">36.17 afftfilt</a>
  763. <ul class="no-bullet">
  764. <li><a name="toc-Examples-144" href="#Examples-144">36.17.1 Examples</a></li>
  765. </ul></li>
  766. <li><a name="toc-afir-1" href="#afir-1">36.18 afir</a>
  767. <ul class="no-bullet">
  768. <li><a name="toc-Examples-156" href="#Examples-156">36.18.1 Examples</a></li>
  769. </ul></li>
  770. <li><a name="toc-aformat-1" href="#aformat-1">36.19 aformat</a></li>
  771. <li><a name="toc-agate" href="#agate">36.20 agate</a></li>
  772. <li><a name="toc-aiir" href="#aiir">36.21 aiir</a>
  773. <ul class="no-bullet">
  774. <li><a name="toc-Examples-184" href="#Examples-184">36.21.1 Examples</a></li>
  775. </ul></li>
  776. <li><a name="toc-alimiter" href="#alimiter">36.22 alimiter</a></li>
  777. <li><a name="toc-allpass" href="#allpass">36.23 allpass</a>
  778. <ul class="no-bullet">
  779. <li><a name="toc-Commands-38" href="#Commands-38">36.23.1 Commands</a></li>
  780. </ul></li>
  781. <li><a name="toc-aloop" href="#aloop">36.24 aloop</a></li>
  782. <li><a name="toc-amerge-1" href="#amerge-1">36.25 amerge</a>
  783. <ul class="no-bullet">
  784. <li><a name="toc-Examples-101" href="#Examples-101">36.25.1 Examples</a></li>
  785. </ul></li>
  786. <li><a name="toc-amix" href="#amix">36.26 amix</a></li>
  787. <li><a name="toc-amultiply" href="#amultiply">36.27 amultiply</a></li>
  788. <li><a name="toc-anequalizer" href="#anequalizer">36.28 anequalizer</a>
  789. <ul class="no-bullet">
  790. <li><a name="toc-Examples-146" href="#Examples-146">36.28.1 Examples</a></li>
  791. <li><a name="toc-Commands-42" href="#Commands-42">36.28.2 Commands</a></li>
  792. </ul></li>
  793. <li><a name="toc-anlmdn" href="#anlmdn">36.29 anlmdn</a>
  794. <ul class="no-bullet">
  795. <li><a name="toc-Commands-37" href="#Commands-37">36.29.1 Commands</a></li>
  796. </ul></li>
  797. <li><a name="toc-anlms" href="#anlms">36.30 anlms</a>
  798. <ul class="no-bullet">
  799. <li><a name="toc-Examples-182" href="#Examples-182">36.30.1 Examples</a></li>
  800. <li><a name="toc-Commands-5" href="#Commands-5">36.30.2 Commands</a></li>
  801. </ul></li>
  802. <li><a name="toc-anull" href="#anull">36.31 anull</a></li>
  803. <li><a name="toc-apad" href="#apad">36.32 apad</a>
  804. <ul class="no-bullet">
  805. <li><a name="toc-Examples-26" href="#Examples-26">36.32.1 Examples</a></li>
  806. </ul></li>
  807. <li><a name="toc-aphaser" href="#aphaser">36.33 aphaser</a></li>
  808. <li><a name="toc-apulsator" href="#apulsator">36.34 apulsator</a></li>
  809. <li><a name="toc-aresample-1" href="#aresample-1">36.35 aresample</a>
  810. <ul class="no-bullet">
  811. <li><a name="toc-Examples-126" href="#Examples-126">36.35.1 Examples</a></li>
  812. </ul></li>
  813. <li><a name="toc-areverse" href="#areverse">36.36 areverse</a>
  814. <ul class="no-bullet">
  815. <li><a name="toc-Examples-131" href="#Examples-131">36.36.1 Examples</a></li>
  816. </ul></li>
  817. <li><a name="toc-arnndn" href="#arnndn">36.37 arnndn</a></li>
  818. <li><a name="toc-asetnsamples" href="#asetnsamples">36.38 asetnsamples</a></li>
  819. <li><a name="toc-asetrate" href="#asetrate">36.39 asetrate</a></li>
  820. <li><a name="toc-ashowinfo" href="#ashowinfo">36.40 ashowinfo</a></li>
  821. <li><a name="toc-asoftclip" href="#asoftclip">36.41 asoftclip</a>
  822. <ul class="no-bullet">
  823. <li><a name="toc-Commands-30" href="#Commands-30">36.41.1 Commands</a></li>
  824. </ul></li>
  825. <li><a name="toc-asr" href="#asr">36.42 asr</a></li>
  826. <li><a name="toc-astats-1" href="#astats-1">36.43 astats</a></li>
  827. <li><a name="toc-atempo" href="#atempo">36.44 atempo</a>
  828. <ul class="no-bullet">
  829. <li><a name="toc-Examples-38" href="#Examples-38">36.44.1 Examples</a></li>
  830. <li><a name="toc-Commands-61" href="#Commands-61">36.44.2 Commands</a></li>
  831. </ul></li>
  832. <li><a name="toc-atrim" href="#atrim">36.45 atrim</a></li>
  833. <li><a name="toc-axcorrelate" href="#axcorrelate">36.46 axcorrelate</a>
  834. <ul class="no-bullet">
  835. <li><a name="toc-Examples-1" href="#Examples-1">36.46.1 Examples</a></li>
  836. </ul></li>
  837. <li><a name="toc-bandpass" href="#bandpass">36.47 bandpass</a>
  838. <ul class="no-bullet">
  839. <li><a name="toc-Commands-33" href="#Commands-33">36.47.1 Commands</a></li>
  840. </ul></li>
  841. <li><a name="toc-bandreject" href="#bandreject">36.48 bandreject</a>
  842. <ul class="no-bullet">
  843. <li><a name="toc-Commands" href="#Commands">36.48.1 Commands</a></li>
  844. </ul></li>
  845. <li><a name="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">36.49 bass, lowshelf</a>
  846. <ul class="no-bullet">
  847. <li><a name="toc-Commands-15" href="#Commands-15">36.49.1 Commands</a></li>
  848. </ul></li>
  849. <li><a name="toc-biquad" href="#biquad">36.50 biquad</a>
  850. <ul class="no-bullet">
  851. <li><a name="toc-Commands-24" href="#Commands-24">36.50.1 Commands</a></li>
  852. </ul></li>
  853. <li><a name="toc-bs2b" href="#bs2b">36.51 bs2b</a></li>
  854. <li><a name="toc-channelmap" href="#channelmap">36.52 channelmap</a>
  855. <ul class="no-bullet">
  856. <li><a name="toc-Examples-55" href="#Examples-55">36.52.1 Examples</a></li>
  857. </ul></li>
  858. <li><a name="toc-channelsplit" href="#channelsplit">36.53 channelsplit</a>
  859. <ul class="no-bullet">
  860. <li><a name="toc-Examples-5" href="#Examples-5">36.53.1 Examples</a></li>
  861. </ul></li>
  862. <li><a name="toc-chorus" href="#chorus">36.54 chorus</a>
  863. <ul class="no-bullet">
  864. <li><a name="toc-Examples-33" href="#Examples-33">36.54.1 Examples</a></li>
  865. </ul></li>
  866. <li><a name="toc-compand" href="#compand">36.55 compand</a>
  867. <ul class="no-bullet">
  868. <li><a name="toc-Examples-120" href="#Examples-120">36.55.1 Examples</a></li>
  869. </ul></li>
  870. <li><a name="toc-compensationdelay" href="#compensationdelay">36.56 compensationdelay</a></li>
  871. <li><a name="toc-crossfeed" href="#crossfeed">36.57 crossfeed</a></li>
  872. <li><a name="toc-crystalizer" href="#crystalizer">36.58 crystalizer</a>
  873. <ul class="no-bullet">
  874. <li><a name="toc-Commands-47" href="#Commands-47">36.58.1 Commands</a></li>
  875. </ul></li>
  876. <li><a name="toc-dcshift" href="#dcshift">36.59 dcshift</a></li>
  877. <li><a name="toc-deesser" href="#deesser">36.60 deesser</a></li>
  878. <li><a name="toc-drmeter" href="#drmeter">36.61 drmeter</a></li>
  879. <li><a name="toc-dynaudnorm" href="#dynaudnorm">36.62 dynaudnorm</a>
  880. <ul class="no-bullet">
  881. <li><a name="toc-Commands-44" href="#Commands-44">36.62.1 Commands</a></li>
  882. </ul></li>
  883. <li><a name="toc-earwax" href="#earwax">36.63 earwax</a></li>
  884. <li><a name="toc-equalizer" href="#equalizer">36.64 equalizer</a>
  885. <ul class="no-bullet">
  886. <li><a name="toc-Examples-36" href="#Examples-36">36.64.1 Examples</a></li>
  887. <li><a name="toc-Commands-34" href="#Commands-34">36.64.2 Commands</a></li>
  888. </ul></li>
  889. <li><a name="toc-extrastereo" href="#extrastereo">36.65 extrastereo</a>
  890. <ul class="no-bullet">
  891. <li><a name="toc-Commands-39" href="#Commands-39">36.65.1 Commands</a></li>
  892. </ul></li>
  893. <li><a name="toc-firequalizer" href="#firequalizer">36.66 firequalizer</a>
  894. <ul class="no-bullet">
  895. <li><a name="toc-Examples-171" href="#Examples-171">36.66.1 Examples</a></li>
  896. </ul></li>
  897. <li><a name="toc-flanger" href="#flanger">36.67 flanger</a></li>
  898. <li><a name="toc-haas" href="#haas">36.68 haas</a></li>
  899. <li><a name="toc-hdcd" href="#hdcd">36.69 hdcd</a></li>
  900. <li><a name="toc-headphone" href="#headphone">36.70 headphone</a>
  901. <ul class="no-bullet">
  902. <li><a name="toc-Examples-97" href="#Examples-97">36.70.1 Examples</a></li>
  903. </ul></li>
  904. <li><a name="toc-highpass" href="#highpass">36.71 highpass</a>
  905. <ul class="no-bullet">
  906. <li><a name="toc-Commands-35" href="#Commands-35">36.71.1 Commands</a></li>
  907. </ul></li>
  908. <li><a name="toc-join" href="#join">36.72 join</a></li>
  909. <li><a name="toc-ladspa" href="#ladspa">36.73 ladspa</a>
  910. <ul class="no-bullet">
  911. <li><a name="toc-Examples-116" href="#Examples-116">36.73.1 Examples</a></li>
  912. <li><a name="toc-Commands-32" href="#Commands-32">36.73.2 Commands</a></li>
  913. </ul></li>
  914. <li><a name="toc-loudnorm" href="#loudnorm">36.74 loudnorm</a></li>
  915. <li><a name="toc-lowpass" href="#lowpass">36.75 lowpass</a>
  916. <ul class="no-bullet">
  917. <li><a name="toc-Examples-52" href="#Examples-52">36.75.1 Examples</a></li>
  918. <li><a name="toc-Commands-45" href="#Commands-45">36.75.2 Commands</a></li>
  919. </ul></li>
  920. <li><a name="toc-lv2" href="#lv2">36.76 lv2</a>
  921. <ul class="no-bullet">
  922. <li><a name="toc-Examples-121" href="#Examples-121">36.76.1 Examples</a></li>
  923. </ul></li>
  924. <li><a name="toc-mcompand" href="#mcompand">36.77 mcompand</a></li>
  925. <li><a name="toc-pan-1" href="#pan-1">36.78 pan</a>
  926. <ul class="no-bullet">
  927. <li><a name="toc-Mixing-examples" href="#Mixing-examples">36.78.1 Mixing examples</a></li>
  928. <li><a name="toc-Remapping-examples" href="#Remapping-examples">36.78.2 Remapping examples</a></li>
  929. </ul></li>
  930. <li><a name="toc-replaygain" href="#replaygain">36.79 replaygain</a></li>
  931. <li><a name="toc-resample" href="#resample">36.80 resample</a></li>
  932. <li><a name="toc-rubberband" href="#rubberband">36.81 rubberband</a>
  933. <ul class="no-bullet">
  934. <li><a name="toc-Commands-27" href="#Commands-27">36.81.1 Commands</a></li>
  935. </ul></li>
  936. <li><a name="toc-sidechaincompress" href="#sidechaincompress">36.82 sidechaincompress</a>
  937. <ul class="no-bullet">
  938. <li><a name="toc-Commands-63" href="#Commands-63">36.82.1 Commands</a></li>
  939. <li><a name="toc-Examples-54" href="#Examples-54">36.82.2 Examples</a></li>
  940. </ul></li>
  941. <li><a name="toc-sidechaingate" href="#sidechaingate">36.83 sidechaingate</a></li>
  942. <li><a name="toc-silencedetect" href="#silencedetect">36.84 silencedetect</a>
  943. <ul class="no-bullet">
  944. <li><a name="toc-Examples-95" href="#Examples-95">36.84.1 Examples</a></li>
  945. </ul></li>
  946. <li><a name="toc-silenceremove" href="#silenceremove">36.85 silenceremove</a>
  947. <ul class="no-bullet">
  948. <li><a name="toc-Examples-147" href="#Examples-147">36.85.1 Examples</a></li>
  949. </ul></li>
  950. <li><a name="toc-sofalizer" href="#sofalizer">36.86 sofalizer</a>
  951. <ul class="no-bullet">
  952. <li><a name="toc-Examples-40" href="#Examples-40">36.86.1 Examples</a></li>
  953. </ul></li>
  954. <li><a name="toc-stereotools" href="#stereotools">36.87 stereotools</a>
  955. <ul class="no-bullet">
  956. <li><a name="toc-Examples-148" href="#Examples-148">36.87.1 Examples</a></li>
  957. </ul></li>
  958. <li><a name="toc-stereowiden" href="#stereowiden">36.88 stereowiden</a>
  959. <ul class="no-bullet">
  960. <li><a name="toc-Commands-22" href="#Commands-22">36.88.1 Commands</a></li>
  961. </ul></li>
  962. <li><a name="toc-superequalizer" href="#superequalizer">36.89 superequalizer</a></li>
  963. <li><a name="toc-surround" href="#surround">36.90 surround</a></li>
  964. <li><a name="toc-treble_002c-highshelf" href="#treble_002c-highshelf">36.91 treble, highshelf</a>
  965. <ul class="no-bullet">
  966. <li><a name="toc-Commands-8" href="#Commands-8">36.91.1 Commands</a></li>
  967. </ul></li>
  968. <li><a name="toc-tremolo" href="#tremolo">36.92 tremolo</a></li>
  969. <li><a name="toc-vibrato" href="#vibrato">36.93 vibrato</a></li>
  970. <li><a name="toc-volume" href="#volume">36.94 volume</a>
  971. <ul class="no-bullet">
  972. <li><a name="toc-Commands-46" href="#Commands-46">36.94.1 Commands</a></li>
  973. <li><a name="toc-Examples-152" href="#Examples-152">36.94.2 Examples</a></li>
  974. </ul></li>
  975. <li><a name="toc-volumedetect" href="#volumedetect">36.95 volumedetect</a>
  976. <ul class="no-bullet">
  977. <li><a name="toc-Examples-153" href="#Examples-153">36.95.1 Examples</a></li>
  978. </ul>
  979. </li>
  980. </ul></li>
  981. <li><a name="toc-Audio-Sources" href="#Audio-Sources">37 Audio Sources</a>
  982. <ul class="no-bullet">
  983. <li><a name="toc-abuffer" href="#abuffer">37.1 abuffer</a>
  984. <ul class="no-bullet">
  985. <li><a name="toc-Examples-155" href="#Examples-155">37.1.1 Examples</a></li>
  986. </ul></li>
  987. <li><a name="toc-aevalsrc" href="#aevalsrc">37.2 aevalsrc</a>
  988. <ul class="no-bullet">
  989. <li><a name="toc-Examples-47" href="#Examples-47">37.2.1 Examples</a></li>
  990. </ul></li>
  991. <li><a name="toc-afirsrc" href="#afirsrc">37.3 afirsrc</a></li>
  992. <li><a name="toc-anullsrc" href="#anullsrc">37.4 anullsrc</a>
  993. <ul class="no-bullet">
  994. <li><a name="toc-Examples-22" href="#Examples-22">37.4.1 Examples</a></li>
  995. </ul></li>
  996. <li><a name="toc-flite" href="#flite">37.5 flite</a>
  997. <ul class="no-bullet">
  998. <li><a name="toc-Examples-137" href="#Examples-137">37.5.1 Examples</a></li>
  999. </ul></li>
  1000. <li><a name="toc-anoisesrc" href="#anoisesrc">37.6 anoisesrc</a>
  1001. <ul class="no-bullet">
  1002. <li><a name="toc-Examples-163" href="#Examples-163">37.6.1 Examples</a></li>
  1003. </ul></li>
  1004. <li><a name="toc-hilbert" href="#hilbert">37.7 hilbert</a></li>
  1005. <li><a name="toc-sinc" href="#sinc">37.8 sinc</a></li>
  1006. <li><a name="toc-sine" href="#sine">37.9 sine</a>
  1007. <ul class="no-bullet">
  1008. <li><a name="toc-Examples-63" href="#Examples-63">37.9.1 Examples</a></li>
  1009. </ul>
  1010. </li>
  1011. </ul></li>
  1012. <li><a name="toc-Audio-Sinks" href="#Audio-Sinks">38 Audio Sinks</a>
  1013. <ul class="no-bullet">
  1014. <li><a name="toc-abuffersink" href="#abuffersink">38.1 abuffersink</a></li>
  1015. <li><a name="toc-anullsink" href="#anullsink">38.2 anullsink</a></li>
  1016. </ul></li>
  1017. <li><a name="toc-Video-Filters" href="#Video-Filters">39 Video Filters</a>
  1018. <ul class="no-bullet">
  1019. <li><a name="toc-addroi" href="#addroi">39.1 addroi</a>
  1020. <ul class="no-bullet">
  1021. <li><a name="toc-Examples-44" href="#Examples-44">39.1.1 Examples</a></li>
  1022. </ul></li>
  1023. <li><a name="toc-alphaextract" href="#alphaextract">39.2 alphaextract</a></li>
  1024. <li><a name="toc-alphamerge" href="#alphamerge">39.3 alphamerge</a></li>
  1025. <li><a name="toc-amplify" href="#amplify">39.4 amplify</a>
  1026. <ul class="no-bullet">
  1027. <li><a name="toc-Commands-43" href="#Commands-43">39.4.1 Commands</a></li>
  1028. </ul></li>
  1029. <li><a name="toc-ass" href="#ass">39.5 ass</a></li>
  1030. <li><a name="toc-atadenoise" href="#atadenoise">39.6 atadenoise</a>
  1031. <ul class="no-bullet">
  1032. <li><a name="toc-Commands-29" href="#Commands-29">39.6.1 Commands</a></li>
  1033. </ul></li>
  1034. <li><a name="toc-avgblur" href="#avgblur">39.7 avgblur</a>
  1035. <ul class="no-bullet">
  1036. <li><a name="toc-Commands-36" href="#Commands-36">39.7.1 Commands</a></li>
  1037. </ul></li>
  1038. <li><a name="toc-bbox" href="#bbox">39.8 bbox</a></li>
  1039. <li><a name="toc-bilateral" href="#bilateral">39.9 bilateral</a></li>
  1040. <li><a name="toc-bitplanenoise" href="#bitplanenoise">39.10 bitplanenoise</a></li>
  1041. <li><a name="toc-blackdetect" href="#blackdetect">39.11 blackdetect</a></li>
  1042. <li><a name="toc-blackframe" href="#blackframe">39.12 blackframe</a></li>
  1043. <li><a name="toc-blend-1" href="#blend-1">39.13 blend</a>
  1044. <ul class="no-bullet">
  1045. <li><a name="toc-Examples-69" href="#Examples-69">39.13.1 Examples</a></li>
  1046. </ul></li>
  1047. <li><a name="toc-bm3d" href="#bm3d">39.14 bm3d</a>
  1048. <ul class="no-bullet">
  1049. <li><a name="toc-Examples-56" href="#Examples-56">39.14.1 Examples</a></li>
  1050. </ul></li>
  1051. <li><a name="toc-boxblur" href="#boxblur">39.15 boxblur</a>
  1052. <ul class="no-bullet">
  1053. <li><a name="toc-Examples-99" href="#Examples-99">39.15.1 Examples</a></li>
  1054. </ul></li>
  1055. <li><a name="toc-bwdif" href="#bwdif">39.16 bwdif</a></li>
  1056. <li><a name="toc-cas" href="#cas">39.17 cas</a></li>
  1057. <li><a name="toc-chromahold" href="#chromahold">39.18 chromahold</a>
  1058. <ul class="no-bullet">
  1059. <li><a name="toc-Commands-16" href="#Commands-16">39.18.1 Commands</a></li>
  1060. </ul></li>
  1061. <li><a name="toc-chromakey" href="#chromakey">39.19 chromakey</a>
  1062. <ul class="no-bullet">
  1063. <li><a name="toc-Commands-19" href="#Commands-19">39.19.1 Commands</a></li>
  1064. <li><a name="toc-Examples-48" href="#Examples-48">39.19.2 Examples</a></li>
  1065. </ul></li>
  1066. <li><a name="toc-chromashift" href="#chromashift">39.20 chromashift</a>
  1067. <ul class="no-bullet">
  1068. <li><a name="toc-Commands-56" href="#Commands-56">39.20.1 Commands</a></li>
  1069. </ul></li>
  1070. <li><a name="toc-ciescope" href="#ciescope">39.21 ciescope</a></li>
  1071. <li><a name="toc-codecview" href="#codecview">39.22 codecview</a>
  1072. <ul class="no-bullet">
  1073. <li><a name="toc-Examples-94" href="#Examples-94">39.22.1 Examples</a></li>
  1074. </ul></li>
  1075. <li><a name="toc-colorbalance" href="#colorbalance">39.23 colorbalance</a>
  1076. <ul class="no-bullet">
  1077. <li><a name="toc-Examples-167" href="#Examples-167">39.23.1 Examples</a></li>
  1078. <li><a name="toc-Commands-20" href="#Commands-20">39.23.2 Commands</a></li>
  1079. </ul></li>
  1080. <li><a name="toc-colorchannelmixer" href="#colorchannelmixer">39.24 colorchannelmixer</a>
  1081. <ul class="no-bullet">
  1082. <li><a name="toc-Examples-88" href="#Examples-88">39.24.1 Examples</a></li>
  1083. <li><a name="toc-Commands-21" href="#Commands-21">39.24.2 Commands</a></li>
  1084. </ul></li>
  1085. <li><a name="toc-colorkey" href="#colorkey">39.25 colorkey</a>
  1086. <ul class="no-bullet">
  1087. <li><a name="toc-Examples-186" href="#Examples-186">39.25.1 Examples</a></li>
  1088. <li><a name="toc-Commands-41" href="#Commands-41">39.25.2 Commands</a></li>
  1089. </ul></li>
  1090. <li><a name="toc-colorhold" href="#colorhold">39.26 colorhold</a>
  1091. <ul class="no-bullet">
  1092. <li><a name="toc-Commands-53" href="#Commands-53">39.26.1 Commands</a></li>
  1093. </ul></li>
  1094. <li><a name="toc-colorlevels" href="#colorlevels">39.27 colorlevels</a>
  1095. <ul class="no-bullet">
  1096. <li><a name="toc-Examples-10" href="#Examples-10">39.27.1 Examples</a></li>
  1097. <li><a name="toc-Commands-40" href="#Commands-40">39.27.2 Commands</a></li>
  1098. </ul></li>
  1099. <li><a name="toc-colormatrix" href="#colormatrix">39.28 colormatrix</a></li>
  1100. <li><a name="toc-colorspace" href="#colorspace">39.29 colorspace</a></li>
  1101. <li><a name="toc-convolution" href="#convolution">39.30 convolution</a>
  1102. <ul class="no-bullet">
  1103. <li><a name="toc-Examples-39" href="#Examples-39">39.30.1 Examples</a></li>
  1104. </ul></li>
  1105. <li><a name="toc-convolve" href="#convolve">39.31 convolve</a></li>
  1106. <li><a name="toc-copy" href="#copy">39.32 copy</a></li>
  1107. <li><a name="toc-coreimage-1" href="#coreimage-1">39.33 coreimage</a>
  1108. <ul class="no-bullet">
  1109. <li><a name="toc-Examples-24" href="#Examples-24">39.33.1 Examples</a></li>
  1110. </ul></li>
  1111. <li><a name="toc-cover_005frect" href="#cover_005frect">39.34 cover_rect</a>
  1112. <ul class="no-bullet">
  1113. <li><a name="toc-Examples-43" href="#Examples-43">39.34.1 Examples</a></li>
  1114. </ul></li>
  1115. <li><a name="toc-crop" href="#crop">39.35 crop</a>
  1116. <ul class="no-bullet">
  1117. <li><a name="toc-Examples-30" href="#Examples-30">39.35.1 Examples</a></li>
  1118. <li><a name="toc-Commands-12" href="#Commands-12">39.35.2 Commands</a></li>
  1119. </ul></li>
  1120. <li><a name="toc-cropdetect" href="#cropdetect">39.36 cropdetect</a></li>
  1121. <li><a name="toc-cue-1" href="#cue-1">39.37 cue</a></li>
  1122. <li><a name="toc-curves-1" href="#curves-1">39.38 curves</a>
  1123. <ul class="no-bullet">
  1124. <li><a name="toc-Examples-16" href="#Examples-16">39.38.1 Examples</a></li>
  1125. </ul></li>
  1126. <li><a name="toc-datascope" href="#datascope">39.39 datascope</a></li>
  1127. <li><a name="toc-dctdnoiz" href="#dctdnoiz">39.40 dctdnoiz</a>
  1128. <ul class="no-bullet">
  1129. <li><a name="toc-Examples-108" href="#Examples-108">39.40.1 Examples</a></li>
  1130. </ul></li>
  1131. <li><a name="toc-deband" href="#deband">39.41 deband</a></li>
  1132. <li><a name="toc-deblock" href="#deblock">39.42 deblock</a>
  1133. <ul class="no-bullet">
  1134. <li><a name="toc-Examples-178" href="#Examples-178">39.42.1 Examples</a></li>
  1135. </ul></li>
  1136. <li><a name="toc-decimate-1" href="#decimate-1">39.43 decimate</a></li>
  1137. <li><a name="toc-deconvolve" href="#deconvolve">39.44 deconvolve</a></li>
  1138. <li><a name="toc-dedot" href="#dedot">39.45 dedot</a></li>
  1139. <li><a name="toc-deflate" href="#deflate">39.46 deflate</a>
  1140. <ul class="no-bullet">
  1141. <li><a name="toc-Commands-2" href="#Commands-2">39.46.1 Commands</a></li>
  1142. </ul></li>
  1143. <li><a name="toc-deflicker" href="#deflicker">39.47 deflicker</a></li>
  1144. <li><a name="toc-dejudder" href="#dejudder">39.48 dejudder</a></li>
  1145. <li><a name="toc-delogo" href="#delogo">39.49 delogo</a>
  1146. <ul class="no-bullet">
  1147. <li><a name="toc-Examples-53" href="#Examples-53">39.49.1 Examples</a></li>
  1148. </ul></li>
  1149. <li><a name="toc-derain" href="#derain">39.50 derain</a></li>
  1150. <li><a name="toc-deshake" href="#deshake">39.51 deshake</a></li>
  1151. <li><a name="toc-despill" href="#despill">39.52 despill</a></li>
  1152. <li><a name="toc-detelecine" href="#detelecine">39.53 detelecine</a></li>
  1153. <li><a name="toc-dilation" href="#dilation">39.54 dilation</a>
  1154. <ul class="no-bullet">
  1155. <li><a name="toc-Commands-23" href="#Commands-23">39.54.1 Commands</a></li>
  1156. </ul></li>
  1157. <li><a name="toc-displace" href="#displace">39.55 displace</a>
  1158. <ul class="no-bullet">
  1159. <li><a name="toc-Examples-77" href="#Examples-77">39.55.1 Examples</a></li>
  1160. </ul></li>
  1161. <li><a name="toc-dnn_005fprocessing" href="#dnn_005fprocessing">39.56 dnn_processing</a></li>
  1162. <li><a name="toc-drawbox" href="#drawbox">39.57 drawbox</a>
  1163. <ul class="no-bullet">
  1164. <li><a name="toc-Examples-166" href="#Examples-166">39.57.1 Examples</a></li>
  1165. <li><a name="toc-Commands-1" href="#Commands-1">39.57.2 Commands</a></li>
  1166. </ul></li>
  1167. <li><a name="toc-drawgraph-1" href="#drawgraph-1">39.58 drawgraph</a></li>
  1168. <li><a name="toc-drawgrid" href="#drawgrid">39.59 drawgrid</a>
  1169. <ul class="no-bullet">
  1170. <li><a name="toc-Examples-78" href="#Examples-78">39.59.1 Examples</a></li>
  1171. <li><a name="toc-Commands-18" href="#Commands-18">39.59.2 Commands</a></li>
  1172. </ul></li>
  1173. <li><a name="toc-drawtext-1" href="#drawtext-1">39.60 drawtext</a>
  1174. <ul class="no-bullet">
  1175. <li><a name="toc-Syntax" href="#Syntax">39.60.1 Syntax</a></li>
  1176. <li><a name="toc-Text-expansion" href="#Text-expansion">39.60.2 Text expansion</a></li>
  1177. <li><a name="toc-Commands-31" href="#Commands-31">39.60.3 Commands</a></li>
  1178. <li><a name="toc-Examples-3" href="#Examples-3">39.60.4 Examples</a></li>
  1179. </ul></li>
  1180. <li><a name="toc-edgedetect" href="#edgedetect">39.61 edgedetect</a>
  1181. <ul class="no-bullet">
  1182. <li><a name="toc-Examples-172" href="#Examples-172">39.61.1 Examples</a></li>
  1183. </ul></li>
  1184. <li><a name="toc-elbg" href="#elbg">39.62 elbg</a></li>
  1185. <li><a name="toc-entropy" href="#entropy">39.63 entropy</a></li>
  1186. <li><a name="toc-eq" href="#eq">39.64 eq</a>
  1187. <ul class="no-bullet">
  1188. <li><a name="toc-Commands-52" href="#Commands-52">39.64.1 Commands</a></li>
  1189. </ul></li>
  1190. <li><a name="toc-erosion" href="#erosion">39.65 erosion</a>
  1191. <ul class="no-bullet">
  1192. <li><a name="toc-Commands-64" href="#Commands-64">39.65.1 Commands</a></li>
  1193. </ul></li>
  1194. <li><a name="toc-extractplanes" href="#extractplanes">39.66 extractplanes</a>
  1195. <ul class="no-bullet">
  1196. <li><a name="toc-Examples-133" href="#Examples-133">39.66.1 Examples</a></li>
  1197. </ul></li>
  1198. <li><a name="toc-fade" href="#fade">39.67 fade</a>
  1199. <ul class="no-bullet">
  1200. <li><a name="toc-Examples-180" href="#Examples-180">39.67.1 Examples</a></li>
  1201. </ul></li>
  1202. <li><a name="toc-fftdnoiz" href="#fftdnoiz">39.68 fftdnoiz</a></li>
  1203. <li><a name="toc-fftfilt" href="#fftfilt">39.69 fftfilt</a>
  1204. <ul class="no-bullet">
  1205. <li><a name="toc-Examples-45" href="#Examples-45">39.69.1 Examples</a></li>
  1206. </ul></li>
  1207. <li><a name="toc-field" href="#field">39.70 field</a></li>
  1208. <li><a name="toc-fieldhint" href="#fieldhint">39.71 fieldhint</a></li>
  1209. <li><a name="toc-fieldmatch" href="#fieldmatch">39.72 fieldmatch</a>
  1210. <ul class="no-bullet">
  1211. <li><a name="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">39.72.1 p/c/n/u/b meaning</a>
  1212. <ul class="no-bullet">
  1213. <li><a name="toc-p_002fc_002fn" href="#p_002fc_002fn">39.72.1.1 p/c/n</a></li>
  1214. <li><a name="toc-u_002fb" href="#u_002fb">39.72.1.2 u/b</a></li>
  1215. </ul></li>
  1216. <li><a name="toc-Examples-149" href="#Examples-149">39.72.2 Examples</a></li>
  1217. </ul></li>
  1218. <li><a name="toc-fieldorder" href="#fieldorder">39.73 fieldorder</a></li>
  1219. <li><a name="toc-fifo_002c-afifo" href="#fifo_002c-afifo">39.74 fifo, afifo</a></li>
  1220. <li><a name="toc-fillborders" href="#fillborders">39.75 fillborders</a>
  1221. <ul class="no-bullet">
  1222. <li><a name="toc-Commands-57" href="#Commands-57">39.75.1 Commands</a></li>
  1223. </ul></li>
  1224. <li><a name="toc-find_005frect" href="#find_005frect">39.76 find_rect</a>
  1225. <ul class="no-bullet">
  1226. <li><a name="toc-Examples-11" href="#Examples-11">39.76.1 Examples</a></li>
  1227. </ul></li>
  1228. <li><a name="toc-floodfill" href="#floodfill">39.77 floodfill</a></li>
  1229. <li><a name="toc-format-1" href="#format-1">39.78 format</a>
  1230. <ul class="no-bullet">
  1231. <li><a name="toc-Examples-13" href="#Examples-13">39.78.1 Examples</a></li>
  1232. </ul></li>
  1233. <li><a name="toc-fps-1" href="#fps-1">39.79 fps</a>
  1234. <ul class="no-bullet">
  1235. <li><a name="toc-Examples-28" href="#Examples-28">39.79.1 Examples</a></li>
  1236. </ul></li>
  1237. <li><a name="toc-framepack" href="#framepack">39.80 framepack</a></li>
  1238. <li><a name="toc-framerate" href="#framerate">39.81 framerate</a></li>
  1239. <li><a name="toc-framestep" href="#framestep">39.82 framestep</a></li>
  1240. <li><a name="toc-freezedetect" href="#freezedetect">39.83 freezedetect</a></li>
  1241. <li><a name="toc-freezeframes" href="#freezeframes">39.84 freezeframes</a></li>
  1242. <li><a name="toc-frei0r-1" href="#frei0r-1">39.85 frei0r</a>
  1243. <ul class="no-bullet">
  1244. <li><a name="toc-Examples-102" href="#Examples-102">39.85.1 Examples</a></li>
  1245. </ul></li>
  1246. <li><a name="toc-fspp" href="#fspp">39.86 fspp</a></li>
  1247. <li><a name="toc-gblur" href="#gblur">39.87 gblur</a>
  1248. <ul class="no-bullet">
  1249. <li><a name="toc-Commands-67" href="#Commands-67">39.87.1 Commands</a></li>
  1250. </ul></li>
  1251. <li><a name="toc-geq" href="#geq">39.88 geq</a>
  1252. <ul class="no-bullet">
  1253. <li><a name="toc-Examples-9" href="#Examples-9">39.88.1 Examples</a></li>
  1254. </ul></li>
  1255. <li><a name="toc-gradfun" href="#gradfun">39.89 gradfun</a>
  1256. <ul class="no-bullet">
  1257. <li><a name="toc-Examples-169" href="#Examples-169">39.89.1 Examples</a></li>
  1258. </ul></li>
  1259. <li><a name="toc-graphmonitor-1" href="#graphmonitor-1">39.90 graphmonitor</a></li>
  1260. <li><a name="toc-greyedge" href="#greyedge">39.91 greyedge</a>
  1261. <ul class="no-bullet">
  1262. <li><a name="toc-Examples-123" href="#Examples-123">39.91.1 Examples</a></li>
  1263. </ul></li>
  1264. <li><a name="toc-haldclut-1" href="#haldclut-1">39.92 haldclut</a>
  1265. <ul class="no-bullet">
  1266. <li><a name="toc-Workflow-examples" href="#Workflow-examples">39.92.1 Workflow examples</a>
  1267. <ul class="no-bullet">
  1268. <li><a name="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">39.92.1.1 Hald CLUT video stream</a></li>
  1269. <li><a name="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">39.92.1.2 Hald CLUT with preview</a></li>
  1270. </ul>
  1271. </li>
  1272. </ul></li>
  1273. <li><a name="toc-hflip" href="#hflip">39.93 hflip</a></li>
  1274. <li><a name="toc-histeq" href="#histeq">39.94 histeq</a></li>
  1275. <li><a name="toc-histogram-1" href="#histogram-1">39.95 histogram</a>
  1276. <ul class="no-bullet">
  1277. <li><a name="toc-Examples-128" href="#Examples-128">39.95.1 Examples</a></li>
  1278. </ul></li>
  1279. <li><a name="toc-hqdn3d-1" href="#hqdn3d-1">39.96 hqdn3d</a>
  1280. <ul class="no-bullet">
  1281. <li><a name="toc-Commands-9" href="#Commands-9">39.96.1 Commands</a></li>
  1282. </ul></li>
  1283. <li><a name="toc-hwdownload-1" href="#hwdownload-1">39.97 hwdownload</a></li>
  1284. <li><a name="toc-hwmap" href="#hwmap">39.98 hwmap</a></li>
  1285. <li><a name="toc-hwupload-1" href="#hwupload-1">39.99 hwupload</a></li>
  1286. <li><a name="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">39.100 hwupload_cuda</a></li>
  1287. <li><a name="toc-hqx" href="#hqx">39.101 hqx</a></li>
  1288. <li><a name="toc-hstack" href="#hstack">39.102 hstack</a></li>
  1289. <li><a name="toc-hue" href="#hue">39.103 hue</a>
  1290. <ul class="no-bullet">
  1291. <li><a name="toc-Examples-111" href="#Examples-111">39.103.1 Examples</a></li>
  1292. <li><a name="toc-Commands-28" href="#Commands-28">39.103.2 Commands</a></li>
  1293. </ul></li>
  1294. <li><a name="toc-hysteresis" href="#hysteresis">39.104 hysteresis</a></li>
  1295. <li><a name="toc-idet" href="#idet">39.105 idet</a></li>
  1296. <li><a name="toc-il" href="#il">39.106 il</a>
  1297. <ul class="no-bullet">
  1298. <li><a name="toc-Commands-60" href="#Commands-60">39.106.1 Commands</a></li>
  1299. </ul></li>
  1300. <li><a name="toc-inflate" href="#inflate">39.107 inflate</a>
  1301. <ul class="no-bullet">
  1302. <li><a name="toc-Commands-11" href="#Commands-11">39.107.1 Commands</a></li>
  1303. </ul></li>
  1304. <li><a name="toc-interlace" href="#interlace">39.108 interlace</a></li>
  1305. <li><a name="toc-kerndeint" href="#kerndeint">39.109 kerndeint</a>
  1306. <ul class="no-bullet">
  1307. <li><a name="toc-Examples-61" href="#Examples-61">39.109.1 Examples</a></li>
  1308. </ul></li>
  1309. <li><a name="toc-lagfun" href="#lagfun">39.110 lagfun</a></li>
  1310. <li><a name="toc-lenscorrection" href="#lenscorrection">39.111 lenscorrection</a>
  1311. <ul class="no-bullet">
  1312. <li><a name="toc-Options-28" href="#Options-28">39.111.1 Options</a></li>
  1313. </ul></li>
  1314. <li><a name="toc-lensfun" href="#lensfun">39.112 lensfun</a>
  1315. <ul class="no-bullet">
  1316. <li><a name="toc-Examples-58" href="#Examples-58">39.112.1 Examples</a></li>
  1317. </ul></li>
  1318. <li><a name="toc-libvmaf" href="#libvmaf">39.113 libvmaf</a>
  1319. <ul class="no-bullet">
  1320. <li><a name="toc-Examples-173" href="#Examples-173">39.113.1 Examples</a></li>
  1321. </ul></li>
  1322. <li><a name="toc-limiter" href="#limiter">39.114 limiter</a></li>
  1323. <li><a name="toc-loop" href="#loop">39.115 loop</a>
  1324. <ul class="no-bullet">
  1325. <li><a name="toc-Examples-31" href="#Examples-31">39.115.1 Examples</a></li>
  1326. </ul></li>
  1327. <li><a name="toc-lut1d" href="#lut1d">39.116 lut1d</a></li>
  1328. <li><a name="toc-lut3d-1" href="#lut3d-1">39.117 lut3d</a></li>
  1329. <li><a name="toc-lumakey" href="#lumakey">39.118 lumakey</a>
  1330. <ul class="no-bullet">
  1331. <li><a name="toc-Commands-48" href="#Commands-48">39.118.1 Commands</a></li>
  1332. </ul></li>
  1333. <li><a name="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">39.119 lut, lutrgb, lutyuv</a>
  1334. <ul class="no-bullet">
  1335. <li><a name="toc-Examples-14" href="#Examples-14">39.119.1 Examples</a></li>
  1336. </ul></li>
  1337. <li><a name="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">39.120 lut2, tlut2</a>
  1338. <ul class="no-bullet">
  1339. <li><a name="toc-Examples-136" href="#Examples-136">39.120.1 Examples</a></li>
  1340. </ul></li>
  1341. <li><a name="toc-maskedclamp" href="#maskedclamp">39.121 maskedclamp</a></li>
  1342. <li><a name="toc-maskedmax" href="#maskedmax">39.122 maskedmax</a></li>
  1343. <li><a name="toc-maskedmerge" href="#maskedmerge">39.123 maskedmerge</a></li>
  1344. <li><a name="toc-maskedmin" href="#maskedmin">39.124 maskedmin</a></li>
  1345. <li><a name="toc-maskfun" href="#maskfun">39.125 maskfun</a></li>
  1346. <li><a name="toc-mcdeint" href="#mcdeint">39.126 mcdeint</a></li>
  1347. <li><a name="toc-median" href="#median">39.127 median</a>
  1348. <ul class="no-bullet">
  1349. <li><a name="toc-Commands-58" href="#Commands-58">39.127.1 Commands</a></li>
  1350. </ul></li>
  1351. <li><a name="toc-mergeplanes" href="#mergeplanes">39.128 mergeplanes</a>
  1352. <ul class="no-bullet">
  1353. <li><a name="toc-Examples-27" href="#Examples-27">39.128.1 Examples</a></li>
  1354. </ul></li>
  1355. <li><a name="toc-mestimate" href="#mestimate">39.129 mestimate</a></li>
  1356. <li><a name="toc-midequalizer" href="#midequalizer">39.130 midequalizer</a></li>
  1357. <li><a name="toc-minterpolate" href="#minterpolate">39.131 minterpolate</a></li>
  1358. <li><a name="toc-mix" href="#mix">39.132 mix</a></li>
  1359. <li><a name="toc-mpdecimate" href="#mpdecimate">39.133 mpdecimate</a></li>
  1360. <li><a name="toc-negate" href="#negate">39.134 negate</a></li>
  1361. <li><a name="toc-nlmeans-1" href="#nlmeans-1">39.135 nlmeans</a></li>
  1362. <li><a name="toc-nnedi" href="#nnedi">39.136 nnedi</a></li>
  1363. <li><a name="toc-noformat" href="#noformat">39.137 noformat</a>
  1364. <ul class="no-bullet">
  1365. <li><a name="toc-Examples-129" href="#Examples-129">39.137.1 Examples</a></li>
  1366. </ul></li>
  1367. <li><a name="toc-noise-1" href="#noise-1">39.138 noise</a>
  1368. <ul class="no-bullet">
  1369. <li><a name="toc-Examples-65" href="#Examples-65">39.138.1 Examples</a></li>
  1370. </ul></li>
  1371. <li><a name="toc-normalize" href="#normalize">39.139 normalize</a>
  1372. <ul class="no-bullet">
  1373. <li><a name="toc-Commands-51" href="#Commands-51">39.139.1 Commands</a></li>
  1374. <li><a name="toc-Examples-150" href="#Examples-150">39.139.2 Examples</a></li>
  1375. </ul></li>
  1376. <li><a name="toc-null-1" href="#null-1">39.140 null</a></li>
  1377. <li><a name="toc-ocr" href="#ocr">39.141 ocr</a></li>
  1378. <li><a name="toc-ocv" href="#ocv">39.142 ocv</a>
  1379. <ul class="no-bullet">
  1380. <li><a name="toc-dilate-1" href="#dilate-1">39.142.1 dilate</a></li>
  1381. <li><a name="toc-erode" href="#erode">39.142.2 erode</a></li>
  1382. <li><a name="toc-smooth" href="#smooth">39.142.3 smooth</a></li>
  1383. </ul></li>
  1384. <li><a name="toc-oscilloscope" href="#oscilloscope">39.143 oscilloscope</a>
  1385. <ul class="no-bullet">
  1386. <li><a name="toc-Commands-65" href="#Commands-65">39.143.1 Commands</a></li>
  1387. <li><a name="toc-Examples-103" href="#Examples-103">39.143.2 Examples</a></li>
  1388. </ul></li>
  1389. <li><a name="toc-overlay-1" href="#overlay-1">39.144 overlay</a>
  1390. <ul class="no-bullet">
  1391. <li><a name="toc-Commands-59" href="#Commands-59">39.144.1 Commands</a></li>
  1392. <li><a name="toc-Examples-92" href="#Examples-92">39.144.2 Examples</a></li>
  1393. </ul></li>
  1394. <li><a name="toc-owdenoise" href="#owdenoise">39.145 owdenoise</a></li>
  1395. <li><a name="toc-pad-1" href="#pad-1">39.146 pad</a>
  1396. <ul class="no-bullet">
  1397. <li><a name="toc-Examples-29" href="#Examples-29">39.146.1 Examples</a></li>
  1398. </ul></li>
  1399. <li><a name="toc-palettegen-1" href="#palettegen-1">39.147 palettegen</a>
  1400. <ul class="no-bullet">
  1401. <li><a name="toc-Examples-25" href="#Examples-25">39.147.1 Examples</a></li>
  1402. </ul></li>
  1403. <li><a name="toc-paletteuse" href="#paletteuse">39.148 paletteuse</a>
  1404. <ul class="no-bullet">
  1405. <li><a name="toc-Examples-32" href="#Examples-32">39.148.1 Examples</a></li>
  1406. </ul></li>
  1407. <li><a name="toc-perspective" href="#perspective">39.149 perspective</a></li>
  1408. <li><a name="toc-phase" href="#phase">39.150 phase</a></li>
  1409. <li><a name="toc-photosensitivity" href="#photosensitivity">39.151 photosensitivity</a></li>
  1410. <li><a name="toc-pixdesctest" href="#pixdesctest">39.152 pixdesctest</a></li>
  1411. <li><a name="toc-pixscope" href="#pixscope">39.153 pixscope</a></li>
  1412. <li><a name="toc-pp" href="#pp">39.154 pp</a>
  1413. <ul class="no-bullet">
  1414. <li><a name="toc-Examples-18" href="#Examples-18">39.154.1 Examples</a></li>
  1415. </ul></li>
  1416. <li><a name="toc-pp7" href="#pp7">39.155 pp7</a></li>
  1417. <li><a name="toc-premultiply" href="#premultiply">39.156 premultiply</a></li>
  1418. <li><a name="toc-prewitt" href="#prewitt">39.157 prewitt</a></li>
  1419. <li><a name="toc-pseudocolor" href="#pseudocolor">39.158 pseudocolor</a>
  1420. <ul class="no-bullet">
  1421. <li><a name="toc-Examples-151" href="#Examples-151">39.158.1 Examples</a></li>
  1422. </ul></li>
  1423. <li><a name="toc-psnr" href="#psnr">39.159 psnr</a>
  1424. <ul class="no-bullet">
  1425. <li><a name="toc-Examples" href="#Examples">39.159.1 Examples</a></li>
  1426. </ul></li>
  1427. <li><a name="toc-pullup-1" href="#pullup-1">39.160 pullup</a></li>
  1428. <li><a name="toc-qp" href="#qp">39.161 qp</a>
  1429. <ul class="no-bullet">
  1430. <li><a name="toc-Examples-177" href="#Examples-177">39.161.1 Examples</a></li>
  1431. </ul></li>
  1432. <li><a name="toc-random" href="#random">39.162 random</a></li>
  1433. <li><a name="toc-readeia608" href="#readeia608">39.163 readeia608</a>
  1434. <ul class="no-bullet">
  1435. <li><a name="toc-Examples-89" href="#Examples-89">39.163.1 Examples</a></li>
  1436. </ul></li>
  1437. <li><a name="toc-readvitc" href="#readvitc">39.164 readvitc</a>
  1438. <ul class="no-bullet">
  1439. <li><a name="toc-Examples-139" href="#Examples-139">39.164.1 Examples</a></li>
  1440. </ul></li>
  1441. <li><a name="toc-remap" href="#remap">39.165 remap</a></li>
  1442. <li><a name="toc-removegrain" href="#removegrain">39.166 removegrain</a></li>
  1443. <li><a name="toc-removelogo" href="#removelogo">39.167 removelogo</a></li>
  1444. <li><a name="toc-repeatfields" href="#repeatfields">39.168 repeatfields</a></li>
  1445. <li><a name="toc-reverse" href="#reverse">39.169 reverse</a>
  1446. <ul class="no-bullet">
  1447. <li><a name="toc-Examples-118" href="#Examples-118">39.169.1 Examples</a></li>
  1448. </ul></li>
  1449. <li><a name="toc-rgbashift" href="#rgbashift">39.170 rgbashift</a>
  1450. <ul class="no-bullet">
  1451. <li><a name="toc-Commands-50" href="#Commands-50">39.170.1 Commands</a></li>
  1452. </ul></li>
  1453. <li><a name="toc-roberts" href="#roberts">39.171 roberts</a></li>
  1454. <li><a name="toc-rotate" href="#rotate">39.172 rotate</a>
  1455. <ul class="no-bullet">
  1456. <li><a name="toc-Examples-143" href="#Examples-143">39.172.1 Examples</a></li>
  1457. <li><a name="toc-Commands-3" href="#Commands-3">39.172.2 Commands</a></li>
  1458. </ul></li>
  1459. <li><a name="toc-sab" href="#sab">39.173 sab</a></li>
  1460. <li><a name="toc-scale-1" href="#scale-1">39.174 scale</a>
  1461. <ul class="no-bullet">
  1462. <li><a name="toc-Options-22" href="#Options-22">39.174.1 Options</a></li>
  1463. <li><a name="toc-Examples-154" href="#Examples-154">39.174.2 Examples</a></li>
  1464. <li><a name="toc-Commands-54" href="#Commands-54">39.174.3 Commands</a></li>
  1465. </ul></li>
  1466. <li><a name="toc-scale_005fnpp" href="#scale_005fnpp">39.175 scale_npp</a></li>
  1467. <li><a name="toc-scale2ref" href="#scale2ref">39.176 scale2ref</a>
  1468. <ul class="no-bullet">
  1469. <li><a name="toc-Examples-75" href="#Examples-75">39.176.1 Examples</a></li>
  1470. <li><a name="toc-Commands-7" href="#Commands-7">39.176.2 Commands</a></li>
  1471. </ul></li>
  1472. <li><a name="toc-scroll" href="#scroll">39.177 scroll</a>
  1473. <ul class="no-bullet">
  1474. <li><a name="toc-Commands-55" href="#Commands-55">39.177.1 Commands</a></li>
  1475. </ul></li>
  1476. <li><a name="toc-selectivecolor-1" href="#selectivecolor-1">39.178 selectivecolor</a>
  1477. <ul class="no-bullet">
  1478. <li><a name="toc-Examples-185" href="#Examples-185">39.178.1 Examples</a></li>
  1479. </ul></li>
  1480. <li><a name="toc-separatefields-1" href="#separatefields-1">39.179 separatefields</a></li>
  1481. <li><a name="toc-setdar_002c-setsar" href="#setdar_002c-setsar">39.180 setdar, setsar</a>
  1482. <ul class="no-bullet">
  1483. <li><a name="toc-Examples-62" href="#Examples-62">39.180.1 Examples</a></li>
  1484. </ul></li>
  1485. <li><a name="toc-setfield-1" href="#setfield-1">39.181 setfield</a></li>
  1486. <li><a name="toc-setparams-1" href="#setparams-1">39.182 setparams</a></li>
  1487. <li><a name="toc-showinfo" href="#showinfo">39.183 showinfo</a></li>
  1488. <li><a name="toc-showpalette" href="#showpalette">39.184 showpalette</a></li>
  1489. <li><a name="toc-shuffleframes" href="#shuffleframes">39.185 shuffleframes</a>
  1490. <ul class="no-bullet">
  1491. <li><a name="toc-Examples-80" href="#Examples-80">39.185.1 Examples</a></li>
  1492. </ul></li>
  1493. <li><a name="toc-shuffleplanes" href="#shuffleplanes">39.186 shuffleplanes</a>
  1494. <ul class="no-bullet">
  1495. <li><a name="toc-Examples-176" href="#Examples-176">39.186.1 Examples</a></li>
  1496. </ul></li>
  1497. <li><a name="toc-signalstats-1" href="#signalstats-1">39.187 signalstats</a>
  1498. <ul class="no-bullet">
  1499. <li><a name="toc-Examples-82" href="#Examples-82">39.187.1 Examples</a></li>
  1500. </ul></li>
  1501. <li><a name="toc-signature-1" href="#signature-1">39.188 signature</a>
  1502. <ul class="no-bullet">
  1503. <li><a name="toc-Examples-51" href="#Examples-51">39.188.1 Examples</a></li>
  1504. </ul></li>
  1505. <li><a name="toc-smartblur-1" href="#smartblur-1">39.189 smartblur</a></li>
  1506. <li><a name="toc-sobel" href="#sobel">39.190 sobel</a></li>
  1507. <li><a name="toc-spp-1" href="#spp-1">39.191 spp</a>
  1508. <ul class="no-bullet">
  1509. <li><a name="toc-Commands-13" href="#Commands-13">39.191.1 Commands</a></li>
  1510. </ul></li>
  1511. <li><a name="toc-sr" href="#sr">39.192 sr</a></li>
  1512. <li><a name="toc-ssim" href="#ssim">39.193 ssim</a>
  1513. <ul class="no-bullet">
  1514. <li><a name="toc-Examples-114" href="#Examples-114">39.193.1 Examples</a></li>
  1515. </ul></li>
  1516. <li><a name="toc-stereo3d" href="#stereo3d">39.194 stereo3d</a>
  1517. <ul class="no-bullet">
  1518. <li><a name="toc-Examples-117" href="#Examples-117">39.194.1 Examples</a></li>
  1519. </ul></li>
  1520. <li><a name="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">39.195 streamselect, astreamselect</a>
  1521. <ul class="no-bullet">
  1522. <li><a name="toc-Commands-25" href="#Commands-25">39.195.1 Commands</a></li>
  1523. <li><a name="toc-Examples-84" href="#Examples-84">39.195.2 Examples</a></li>
  1524. </ul></li>
  1525. <li><a name="toc-subtitles-1" href="#subtitles-1">39.196 subtitles</a></li>
  1526. <li><a name="toc-super2xsai" href="#super2xsai">39.197 super2xsai</a></li>
  1527. <li><a name="toc-swaprect" href="#swaprect">39.198 swaprect</a></li>
  1528. <li><a name="toc-swapuv" href="#swapuv">39.199 swapuv</a></li>
  1529. <li><a name="toc-tblend" href="#tblend">39.200 tblend</a></li>
  1530. <li><a name="toc-telecine" href="#telecine">39.201 telecine</a></li>
  1531. <li><a name="toc-thistogram" href="#thistogram">39.202 thistogram</a></li>
  1532. <li><a name="toc-threshold" href="#threshold">39.203 threshold</a>
  1533. <ul class="no-bullet">
  1534. <li><a name="toc-Examples-21" href="#Examples-21">39.203.1 Examples</a></li>
  1535. </ul></li>
  1536. <li><a name="toc-thumbnail" href="#thumbnail">39.204 thumbnail</a>
  1537. <ul class="no-bullet">
  1538. <li><a name="toc-Examples-79" href="#Examples-79">39.204.1 Examples</a></li>
  1539. </ul></li>
  1540. <li><a name="toc-tile" href="#tile">39.205 tile</a>
  1541. <ul class="no-bullet">
  1542. <li><a name="toc-Examples-175" href="#Examples-175">39.205.1 Examples</a></li>
  1543. </ul></li>
  1544. <li><a name="toc-tinterlace" href="#tinterlace">39.206 tinterlace</a></li>
  1545. <li><a name="toc-tmix" href="#tmix">39.207 tmix</a>
  1546. <ul class="no-bullet">
  1547. <li><a name="toc-Examples-73" href="#Examples-73">39.207.1 Examples</a></li>
  1548. </ul></li>
  1549. <li><a name="toc-tonemap-1" href="#tonemap-1">39.208 tonemap</a>
  1550. <ul class="no-bullet">
  1551. <li><a name="toc-Options-55" href="#Options-55">39.208.1 Options</a></li>
  1552. </ul></li>
  1553. <li><a name="toc-tpad" href="#tpad">39.209 tpad</a></li>
  1554. <li><a name="toc-transpose-1" href="#transpose-1">39.210 transpose</a></li>
  1555. <li><a name="toc-transpose_005fnpp" href="#transpose_005fnpp">39.211 transpose_npp</a></li>
  1556. <li><a name="toc-trim" href="#trim">39.212 trim</a></li>
  1557. <li><a name="toc-unpremultiply" href="#unpremultiply">39.213 unpremultiply</a></li>
  1558. <li><a name="toc-unsharp-1" href="#unsharp-1">39.214 unsharp</a>
  1559. <ul class="no-bullet">
  1560. <li><a name="toc-Examples-125" href="#Examples-125">39.214.1 Examples</a></li>
  1561. </ul></li>
  1562. <li><a name="toc-uspp" href="#uspp">39.215 uspp</a></li>
  1563. <li><a name="toc-v360" href="#v360">39.216 v360</a>
  1564. <ul class="no-bullet">
  1565. <li><a name="toc-Examples-67" href="#Examples-67">39.216.1 Examples</a></li>
  1566. <li><a name="toc-Commands-66" href="#Commands-66">39.216.2 Commands</a></li>
  1567. </ul></li>
  1568. <li><a name="toc-vaguedenoiser" href="#vaguedenoiser">39.217 vaguedenoiser</a></li>
  1569. <li><a name="toc-vectorscope" href="#vectorscope">39.218 vectorscope</a></li>
  1570. <li><a name="toc-vidstabdetect-1" href="#vidstabdetect-1">39.219 vidstabdetect</a>
  1571. <ul class="no-bullet">
  1572. <li><a name="toc-Examples-130" href="#Examples-130">39.219.1 Examples</a></li>
  1573. </ul></li>
  1574. <li><a name="toc-vidstabtransform-1" href="#vidstabtransform-1">39.220 vidstabtransform</a>
  1575. <ul class="no-bullet">
  1576. <li><a name="toc-Options" href="#Options">39.220.1 Options</a></li>
  1577. <li><a name="toc-Examples-135" href="#Examples-135">39.220.2 Examples</a></li>
  1578. </ul></li>
  1579. <li><a name="toc-vflip" href="#vflip">39.221 vflip</a></li>
  1580. <li><a name="toc-vfrdet" href="#vfrdet">39.222 vfrdet</a></li>
  1581. <li><a name="toc-vibrance" href="#vibrance">39.223 vibrance</a>
  1582. <ul class="no-bullet">
  1583. <li><a name="toc-Commands-4" href="#Commands-4">39.223.1 Commands</a></li>
  1584. </ul></li>
  1585. <li><a name="toc-vignette-1" href="#vignette-1">39.224 vignette</a>
  1586. <ul class="no-bullet">
  1587. <li><a name="toc-Expressions" href="#Expressions">39.224.1 Expressions</a></li>
  1588. <li><a name="toc-Examples-57" href="#Examples-57">39.224.2 Examples</a></li>
  1589. </ul></li>
  1590. <li><a name="toc-vmafmotion" href="#vmafmotion">39.225 vmafmotion</a></li>
  1591. <li><a name="toc-vstack" href="#vstack">39.226 vstack</a></li>
  1592. <li><a name="toc-w3fdif" href="#w3fdif">39.227 w3fdif</a></li>
  1593. <li><a name="toc-waveform" href="#waveform">39.228 waveform</a></li>
  1594. <li><a name="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">39.229 weave, doubleweave</a>
  1595. <ul class="no-bullet">
  1596. <li><a name="toc-Examples-60" href="#Examples-60">39.229.1 Examples</a></li>
  1597. </ul></li>
  1598. <li><a name="toc-xbr" href="#xbr">39.230 xbr</a></li>
  1599. <li><a name="toc-xfade" href="#xfade">39.231 xfade</a>
  1600. <ul class="no-bullet">
  1601. <li><a name="toc-Examples-81" href="#Examples-81">39.231.1 Examples</a></li>
  1602. </ul></li>
  1603. <li><a name="toc-xmedian" href="#xmedian">39.232 xmedian</a></li>
  1604. <li><a name="toc-xstack" href="#xstack">39.233 xstack</a>
  1605. <ul class="no-bullet">
  1606. <li><a name="toc-Examples-64" href="#Examples-64">39.233.1 Examples</a></li>
  1607. </ul></li>
  1608. <li><a name="toc-yadif-1" href="#yadif-1">39.234 yadif</a></li>
  1609. <li><a name="toc-yadif_005fcuda" href="#yadif_005fcuda">39.235 yadif_cuda</a></li>
  1610. <li><a name="toc-yaepblur" href="#yaepblur">39.236 yaepblur</a>
  1611. <ul class="no-bullet">
  1612. <li><a name="toc-Commands-26" href="#Commands-26">39.236.1 Commands</a></li>
  1613. </ul></li>
  1614. <li><a name="toc-zoompan" href="#zoompan">39.237 zoompan</a>
  1615. <ul class="no-bullet">
  1616. <li><a name="toc-Examples-83" href="#Examples-83">39.237.1 Examples</a></li>
  1617. </ul></li>
  1618. <li><a name="toc-zscale-1" href="#zscale-1">39.238 zscale</a>
  1619. <ul class="no-bullet">
  1620. <li><a name="toc-Options-7" href="#Options-7">39.238.1 Options</a></li>
  1621. <li><a name="toc-Commands-10" href="#Commands-10">39.238.2 Commands</a></li>
  1622. </ul>
  1623. </li>
  1624. </ul></li>
  1625. <li><a name="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">40 OpenCL Video Filters</a>
  1626. <ul class="no-bullet">
  1627. <li><a name="toc-avgblur_005fopencl" href="#avgblur_005fopencl">40.1 avgblur_opencl</a>
  1628. <ul class="no-bullet">
  1629. <li><a name="toc-Example-6" href="#Example-6">40.1.1 Example</a></li>
  1630. </ul></li>
  1631. <li><a name="toc-boxblur_005fopencl" href="#boxblur_005fopencl">40.2 boxblur_opencl</a>
  1632. <ul class="no-bullet">
  1633. <li><a name="toc-Examples-170" href="#Examples-170">40.2.1 Examples</a></li>
  1634. </ul></li>
  1635. <li><a name="toc-colorkey_005fopencl" href="#colorkey_005fopencl">40.3 colorkey_opencl</a>
  1636. <ul class="no-bullet">
  1637. <li><a name="toc-Examples-23" href="#Examples-23">40.3.1 Examples</a></li>
  1638. </ul></li>
  1639. <li><a name="toc-convolution_005fopencl" href="#convolution_005fopencl">40.4 convolution_opencl</a>
  1640. <ul class="no-bullet">
  1641. <li><a name="toc-Examples-124" href="#Examples-124">40.4.1 Examples</a></li>
  1642. </ul></li>
  1643. <li><a name="toc-erosion_005fopencl" href="#erosion_005fopencl">40.5 erosion_opencl</a>
  1644. <ul class="no-bullet">
  1645. <li><a name="toc-Example-3" href="#Example-3">40.5.1 Example</a></li>
  1646. </ul></li>
  1647. <li><a name="toc-deshake_005fopencl" href="#deshake_005fopencl">40.6 deshake_opencl</a>
  1648. <ul class="no-bullet">
  1649. <li><a name="toc-Examples-183" href="#Examples-183">40.6.1 Examples</a></li>
  1650. </ul></li>
  1651. <li><a name="toc-dilation_005fopencl" href="#dilation_005fopencl">40.7 dilation_opencl</a>
  1652. <ul class="no-bullet">
  1653. <li><a name="toc-Example-2" href="#Example-2">40.7.1 Example</a></li>
  1654. </ul></li>
  1655. <li><a name="toc-nlmeans_005fopencl" href="#nlmeans_005fopencl">40.8 nlmeans_opencl</a></li>
  1656. <li><a name="toc-overlay_005fopencl" href="#overlay_005fopencl">40.9 overlay_opencl</a>
  1657. <ul class="no-bullet">
  1658. <li><a name="toc-Examples-15" href="#Examples-15">40.9.1 Examples</a></li>
  1659. </ul></li>
  1660. <li><a name="toc-pad_005fopencl" href="#pad_005fopencl">40.10 pad_opencl</a></li>
  1661. <li><a name="toc-prewitt_005fopencl" href="#prewitt_005fopencl">40.11 prewitt_opencl</a>
  1662. <ul class="no-bullet">
  1663. <li><a name="toc-Example-11" href="#Example-11">40.11.1 Example</a></li>
  1664. </ul></li>
  1665. <li><a name="toc-program_005fopencl-1" href="#program_005fopencl-1">40.12 program_opencl</a></li>
  1666. <li><a name="toc-roberts_005fopencl" href="#roberts_005fopencl">40.13 roberts_opencl</a>
  1667. <ul class="no-bullet">
  1668. <li><a name="toc-Example-5" href="#Example-5">40.13.1 Example</a></li>
  1669. </ul></li>
  1670. <li><a name="toc-sobel_005fopencl" href="#sobel_005fopencl">40.14 sobel_opencl</a>
  1671. <ul class="no-bullet">
  1672. <li><a name="toc-Example-10" href="#Example-10">40.14.1 Example</a></li>
  1673. </ul></li>
  1674. <li><a name="toc-tonemap_005fopencl" href="#tonemap_005fopencl">40.15 tonemap_opencl</a>
  1675. <ul class="no-bullet">
  1676. <li><a name="toc-Example-7" href="#Example-7">40.15.1 Example</a></li>
  1677. </ul></li>
  1678. <li><a name="toc-unsharp_005fopencl" href="#unsharp_005fopencl">40.16 unsharp_opencl</a>
  1679. <ul class="no-bullet">
  1680. <li><a name="toc-Examples-93" href="#Examples-93">40.16.1 Examples</a></li>
  1681. </ul></li>
  1682. <li><a name="toc-xfade_005fopencl" href="#xfade_005fopencl">40.17 xfade_opencl</a></li>
  1683. </ul></li>
  1684. <li><a name="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">41 VAAPI Video Filters</a>
  1685. <ul class="no-bullet">
  1686. <li><a name="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">41.1 tonemap_vaapi</a>
  1687. <ul class="no-bullet">
  1688. <li><a name="toc-Example-4" href="#Example-4">41.1.1 Example</a></li>
  1689. </ul>
  1690. </li>
  1691. </ul></li>
  1692. <li><a name="toc-Video-Sources" href="#Video-Sources">42 Video Sources</a>
  1693. <ul class="no-bullet">
  1694. <li><a name="toc-buffer" href="#buffer">42.1 buffer</a></li>
  1695. <li><a name="toc-cellauto" href="#cellauto">42.2 cellauto</a>
  1696. <ul class="no-bullet">
  1697. <li><a name="toc-Examples-159" href="#Examples-159">42.2.1 Examples</a></li>
  1698. </ul></li>
  1699. <li><a name="toc-coreimagesrc-1" href="#coreimagesrc-1">42.3 coreimagesrc</a>
  1700. <ul class="no-bullet">
  1701. <li><a name="toc-Examples-46" href="#Examples-46">42.3.1 Examples</a></li>
  1702. </ul></li>
  1703. <li><a name="toc-mandelbrot" href="#mandelbrot">42.4 mandelbrot</a></li>
  1704. <li><a name="toc-mptestsrc" href="#mptestsrc">42.5 mptestsrc</a></li>
  1705. <li><a name="toc-frei0r_005fsrc" href="#frei0r_005fsrc">42.6 frei0r_src</a></li>
  1706. <li><a name="toc-life" href="#life">42.7 life</a>
  1707. <ul class="no-bullet">
  1708. <li><a name="toc-Examples-87" href="#Examples-87">42.7.1 Examples</a></li>
  1709. </ul></li>
  1710. <li><a name="toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" href="#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">42.8 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1711. <ul class="no-bullet">
  1712. <li><a name="toc-Examples-37" href="#Examples-37">42.8.1 Examples</a></li>
  1713. <li><a name="toc-Commands-14" href="#Commands-14">42.8.2 Commands</a></li>
  1714. </ul></li>
  1715. <li><a name="toc-openclsrc" href="#openclsrc">42.9 openclsrc</a></li>
  1716. <li><a name="toc-sierpinski" href="#sierpinski">42.10 sierpinski</a></li>
  1717. </ul></li>
  1718. <li><a name="toc-Video-Sinks" href="#Video-Sinks">43 Video Sinks</a>
  1719. <ul class="no-bullet">
  1720. <li><a name="toc-buffersink" href="#buffersink">43.1 buffersink</a></li>
  1721. <li><a name="toc-nullsink" href="#nullsink">43.2 nullsink</a></li>
  1722. </ul></li>
  1723. <li><a name="toc-Multimedia-Filters" href="#Multimedia-Filters">44 Multimedia Filters</a>
  1724. <ul class="no-bullet">
  1725. <li><a name="toc-abitscope" href="#abitscope">44.1 abitscope</a></li>
  1726. <li><a name="toc-adrawgraph" href="#adrawgraph">44.2 adrawgraph</a></li>
  1727. <li><a name="toc-agraphmonitor" href="#agraphmonitor">44.3 agraphmonitor</a></li>
  1728. <li><a name="toc-ahistogram" href="#ahistogram">44.4 ahistogram</a></li>
  1729. <li><a name="toc-aphasemeter" href="#aphasemeter">44.5 aphasemeter</a></li>
  1730. <li><a name="toc-avectorscope" href="#avectorscope">44.6 avectorscope</a>
  1731. <ul class="no-bullet">
  1732. <li><a name="toc-Examples-142" href="#Examples-142">44.6.1 Examples</a></li>
  1733. </ul></li>
  1734. <li><a name="toc-bench_002c-abench" href="#bench_002c-abench">44.7 bench, abench</a>
  1735. <ul class="no-bullet">
  1736. <li><a name="toc-Examples-70" href="#Examples-70">44.7.1 Examples</a></li>
  1737. </ul></li>
  1738. <li><a name="toc-concat-2" href="#concat-2">44.8 concat</a>
  1739. <ul class="no-bullet">
  1740. <li><a name="toc-Examples-2" href="#Examples-2">44.8.1 Examples</a></li>
  1741. <li><a name="toc-Commands-62" href="#Commands-62">44.8.2 Commands</a></li>
  1742. </ul></li>
  1743. <li><a name="toc-ebur128-1" href="#ebur128-1">44.9 ebur128</a>
  1744. <ul class="no-bullet">
  1745. <li><a name="toc-Examples-19" href="#Examples-19">44.9.1 Examples</a></li>
  1746. </ul></li>
  1747. <li><a name="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">44.10 interleave, ainterleave</a>
  1748. <ul class="no-bullet">
  1749. <li><a name="toc-Examples-74" href="#Examples-74">44.10.1 Examples</a></li>
  1750. </ul></li>
  1751. <li><a name="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">44.11 metadata, ametadata</a>
  1752. <ul class="no-bullet">
  1753. <li><a name="toc-Examples-91" href="#Examples-91">44.11.1 Examples</a></li>
  1754. </ul></li>
  1755. <li><a name="toc-perms_002c-aperms" href="#perms_002c-aperms">44.12 perms, aperms</a></li>
  1756. <li><a name="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">44.13 realtime, arealtime</a></li>
  1757. <li><a name="toc-select_002c-aselect" href="#select_002c-aselect">44.14 select, aselect</a>
  1758. <ul class="no-bullet">
  1759. <li><a name="toc-Examples-113" href="#Examples-113">44.14.1 Examples</a></li>
  1760. </ul></li>
  1761. <li><a name="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">44.15 sendcmd, asendcmd</a>
  1762. <ul class="no-bullet">
  1763. <li><a name="toc-Commands-syntax" href="#Commands-syntax">44.15.1 Commands syntax</a></li>
  1764. <li><a name="toc-Examples-122" href="#Examples-122">44.15.2 Examples</a></li>
  1765. </ul></li>
  1766. <li><a name="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">44.16 setpts, asetpts</a>
  1767. <ul class="no-bullet">
  1768. <li><a name="toc-Examples-68" href="#Examples-68">44.16.1 Examples</a></li>
  1769. </ul></li>
  1770. <li><a name="toc-setrange" href="#setrange">44.17 setrange</a></li>
  1771. <li><a name="toc-settb_002c-asettb" href="#settb_002c-asettb">44.18 settb, asettb</a>
  1772. <ul class="no-bullet">
  1773. <li><a name="toc-Examples-157" href="#Examples-157">44.18.1 Examples</a></li>
  1774. </ul></li>
  1775. <li><a name="toc-showcqt" href="#showcqt">44.19 showcqt</a>
  1776. <ul class="no-bullet">
  1777. <li><a name="toc-Examples-49" href="#Examples-49">44.19.1 Examples</a></li>
  1778. </ul></li>
  1779. <li><a name="toc-showfreqs" href="#showfreqs">44.20 showfreqs</a></li>
  1780. <li><a name="toc-showspatial" href="#showspatial">44.21 showspatial</a></li>
  1781. <li><a name="toc-showspectrum-1" href="#showspectrum-1">44.22 showspectrum</a>
  1782. <ul class="no-bullet">
  1783. <li><a name="toc-Examples-4" href="#Examples-4">44.22.1 Examples</a></li>
  1784. </ul></li>
  1785. <li><a name="toc-showspectrumpic" href="#showspectrumpic">44.23 showspectrumpic</a>
  1786. <ul class="no-bullet">
  1787. <li><a name="toc-Examples-181" href="#Examples-181">44.23.1 Examples</a></li>
  1788. </ul></li>
  1789. <li><a name="toc-showvolume" href="#showvolume">44.24 showvolume</a></li>
  1790. <li><a name="toc-showwaves" href="#showwaves">44.25 showwaves</a>
  1791. <ul class="no-bullet">
  1792. <li><a name="toc-Examples-66" href="#Examples-66">44.25.1 Examples</a></li>
  1793. </ul></li>
  1794. <li><a name="toc-showwavespic" href="#showwavespic">44.26 showwavespic</a>
  1795. <ul class="no-bullet">
  1796. <li><a name="toc-Examples-59" href="#Examples-59">44.26.1 Examples</a></li>
  1797. </ul></li>
  1798. <li><a name="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">44.27 sidedata, asidedata</a></li>
  1799. <li><a name="toc-spectrumsynth" href="#spectrumsynth">44.28 spectrumsynth</a>
  1800. <ul class="no-bullet">
  1801. <li><a name="toc-Examples-141" href="#Examples-141">44.28.1 Examples</a></li>
  1802. </ul></li>
  1803. <li><a name="toc-split_002c-asplit" href="#split_002c-asplit">44.29 split, asplit</a>
  1804. <ul class="no-bullet">
  1805. <li><a name="toc-Examples-6" href="#Examples-6">44.29.1 Examples</a></li>
  1806. </ul></li>
  1807. <li><a name="toc-zmq_002c-azmq" href="#zmq_002c-azmq">44.30 zmq, azmq</a>
  1808. <ul class="no-bullet">
  1809. <li><a name="toc-Examples-140" href="#Examples-140">44.30.1 Examples</a></li>
  1810. </ul>
  1811. </li>
  1812. </ul></li>
  1813. <li><a name="toc-Multimedia-Sources" href="#Multimedia-Sources">45 Multimedia Sources</a>
  1814. <ul class="no-bullet">
  1815. <li><a name="toc-amovie" href="#amovie">45.1 amovie</a></li>
  1816. <li><a name="toc-movie-1" href="#movie-1">45.2 movie</a>
  1817. <ul class="no-bullet">
  1818. <li><a name="toc-Examples-160" href="#Examples-160">45.2.1 Examples</a></li>
  1819. <li><a name="toc-Commands-6" href="#Commands-6">45.2.2 Commands</a></li>
  1820. </ul>
  1821. </li>
  1822. </ul></li>
  1823. <li><a name="toc-See-Also" href="#See-Also">46 See Also</a></li>
  1824. <li><a name="toc-Authors" href="#Authors">47 Authors</a></li>
  1825. </ul>
  1826. </div>
  1827. <hr size="6">
  1828. <a name="Synopsis"></a>
  1829. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Synopsis">1 Synopsis</a></h1>
  1830. <p>ffmpeg [<var>global_options</var>] {[<var>input_file_options</var>] -i &lsquo;<tt>input_url</tt>&rsquo;} ... {[<var>output_file_options</var>] &lsquo;<tt>output_url</tt>&rsquo;} ...
  1831. </p>
  1832. <a name="Description-1"></a>
  1833. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Description-1">2 Description</a></h1>
  1834. <p><code>ffmpeg</code> is a very fast video and audio converter that can also grab from
  1835. a live audio/video source. It can also convert between arbitrary sample
  1836. rates and resize video on the fly with a high quality polyphase filter.
  1837. </p>
  1838. <p><code>ffmpeg</code> reads from an arbitrary number of input &quot;files&quot; (which can be regular
  1839. files, pipes, network streams, grabbing devices, etc.), specified by the
  1840. <code>-i</code> option, and writes to an arbitrary number of output &quot;files&quot;, which are
  1841. specified by a plain output url. Anything found on the command line which
  1842. cannot be interpreted as an option is considered to be an output url.
  1843. </p>
  1844. <p>Each input or output url can, in principle, contain any number of streams of
  1845. different types (video/audio/subtitle/attachment/data). The allowed number and/or
  1846. types of streams may be limited by the container format. Selecting which
  1847. streams from which inputs will go into which output is either done automatically
  1848. or with the <code>-map</code> option (see the Stream selection chapter).
  1849. </p>
  1850. <p>To refer to input files in options, you must use their indices (0-based). E.g.
  1851. the first input file is <code>0</code>, the second is <code>1</code>, etc. Similarly, streams
  1852. within a file are referred to by their indices. E.g. <code>2:3</code> refers to the
  1853. fourth stream in the third input file. Also see the Stream specifiers chapter.
  1854. </p>
  1855. <p>As a general rule, options are applied to the next specified
  1856. file. Therefore, order is important, and you can have the same
  1857. option on the command line multiple times. Each occurrence is
  1858. then applied to the next input or output file.
  1859. Exceptions from this rule are the global options (e.g. verbosity level),
  1860. which should be specified first.
  1861. </p>
  1862. <p>Do not mix input and output files &ndash; first specify all input files, then all
  1863. output files. Also do not mix options which belong to different files. All
  1864. options apply ONLY to the next input or output file and are reset between files.
  1865. </p>
  1866. <ul>
  1867. <li>
  1868. To set the video bitrate of the output file to 64 kbit/s:
  1869. <div class="example">
  1870. <pre class="example">ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi
  1871. </pre></div>
  1872. </li><li>
  1873. To force the frame rate of the output file to 24 fps:
  1874. <div class="example">
  1875. <pre class="example">ffmpeg -i input.avi -r 24 output.avi
  1876. </pre></div>
  1877. </li><li>
  1878. To force the frame rate of the input file (valid for raw formats only)
  1879. to 1 fps and the frame rate of the output file to 24 fps:
  1880. <div class="example">
  1881. <pre class="example">ffmpeg -r 1 -i input.m2v -r 24 output.avi
  1882. </pre></div>
  1883. </li></ul>
  1884. <p>The format option may be needed for raw input files.
  1885. </p>
  1886. <a name="Detailed-description"></a>
  1887. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Detailed-description">3 Detailed description</a></h1>
  1888. <p>The transcoding process in <code>ffmpeg</code> for each output can be described by
  1889. the following diagram:
  1890. </p>
  1891. <pre class="verbatim"> _______ ______________
  1892. | | | |
  1893. | input | demuxer | encoded data | decoder
  1894. | file | ---------&gt; | packets | -----+
  1895. |_______| |______________| |
  1896. v
  1897. _________
  1898. | |
  1899. | decoded |
  1900. | frames |
  1901. |_________|
  1902. ________ ______________ |
  1903. | | | | |
  1904. | output | &lt;-------- | encoded data | &lt;----+
  1905. | file | muxer | packets | encoder
  1906. |________| |______________|
  1907. </pre>
  1908. <p><code>ffmpeg</code> calls the libavformat library (containing demuxers) to read
  1909. input files and get packets containing encoded data from them. When there are
  1910. multiple input files, <code>ffmpeg</code> tries to keep them synchronized by
  1911. tracking lowest timestamp on any active input stream.
  1912. </p>
  1913. <p>Encoded packets are then passed to the decoder (unless streamcopy is selected
  1914. for the stream, see further for a description). The decoder produces
  1915. uncompressed frames (raw video/PCM audio/...) which can be processed further by
  1916. filtering (see next section). After filtering, the frames are passed to the
  1917. encoder, which encodes them and outputs encoded packets. Finally those are
  1918. passed to the muxer, which writes the encoded packets to the output file.
  1919. </p>
  1920. <a name="Filtering"></a>
  1921. <h2 class="section"><a href="ffmpeg-all.html#toc-Filtering">3.1 Filtering</a></h2>
  1922. <p>Before encoding, <code>ffmpeg</code> can process raw audio and video frames using
  1923. filters from the libavfilter library. Several chained filters form a filter
  1924. graph. <code>ffmpeg</code> distinguishes between two types of filtergraphs:
  1925. simple and complex.
  1926. </p>
  1927. <a name="Simple-filtergraphs"></a>
  1928. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Simple-filtergraphs">3.1.1 Simple filtergraphs</a></h3>
  1929. <p>Simple filtergraphs are those that have exactly one input and output, both of
  1930. the same type. In the above diagram they can be represented by simply inserting
  1931. an additional step between decoding and encoding:
  1932. </p>
  1933. <pre class="verbatim"> _________ ______________
  1934. | | | |
  1935. | decoded | | encoded data |
  1936. | frames |\ _ | packets |
  1937. |_________| \ /||______________|
  1938. \ __________ /
  1939. simple _\|| | / encoder
  1940. filtergraph | filtered |/
  1941. | frames |
  1942. |__________|
  1943. </pre>
  1944. <p>Simple filtergraphs are configured with the per-stream &lsquo;<samp>-filter</samp>&rsquo; option
  1945. (with &lsquo;<samp>-vf</samp>&rsquo; and &lsquo;<samp>-af</samp>&rsquo; aliases for video and audio respectively).
  1946. A simple filtergraph for video can look for example like this:
  1947. </p>
  1948. <pre class="verbatim"> _______ _____________ _______ ________
  1949. | | | | | | | |
  1950. | input | ---&gt; | deinterlace | ---&gt; | scale | ---&gt; | output |
  1951. |_______| |_____________| |_______| |________|
  1952. </pre>
  1953. <p>Note that some filters change frame properties but not frame contents. E.g. the
  1954. <code>fps</code> filter in the example above changes number of frames, but does not
  1955. touch the frame contents. Another example is the <code>setpts</code> filter, which
  1956. only sets timestamps and otherwise passes the frames unchanged.
  1957. </p>
  1958. <a name="Complex-filtergraphs-1"></a>
  1959. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Complex-filtergraphs-1">3.1.2 Complex filtergraphs</a></h3>
  1960. <p>Complex filtergraphs are those which cannot be described as simply a linear
  1961. processing chain applied to one stream. This is the case, for example, when the graph has
  1962. more than one input and/or output, or when output stream type is different from
  1963. input. They can be represented with the following diagram:
  1964. </p>
  1965. <pre class="verbatim"> _________
  1966. | |
  1967. | input 0 |\ __________
  1968. |_________| \ | |
  1969. \ _________ /| output 0 |
  1970. \ | | / |__________|
  1971. _________ \| complex | /
  1972. | | | |/
  1973. | input 1 |----&gt;| filter |\
  1974. |_________| | | \ __________
  1975. /| graph | \ | |
  1976. / | | \| output 1 |
  1977. _________ / |_________| |__________|
  1978. | | /
  1979. | input 2 |/
  1980. |_________|
  1981. </pre>
  1982. <p>Complex filtergraphs are configured with the &lsquo;<samp>-filter_complex</samp>&rsquo; option.
  1983. Note that this option is global, since a complex filtergraph, by its nature,
  1984. cannot be unambiguously associated with a single stream or file.
  1985. </p>
  1986. <p>The &lsquo;<samp>-lavfi</samp>&rsquo; option is equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
  1987. </p>
  1988. <p>A trivial example of a complex filtergraph is the <code>overlay</code> filter, which
  1989. has two video inputs and one video output, containing one video overlaid on top
  1990. of the other. Its audio counterpart is the <code>amix</code> filter.
  1991. </p>
  1992. <a name="Stream-copy"></a>
  1993. <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-copy">3.2 Stream copy</a></h2>
  1994. <p>Stream copy is a mode selected by supplying the <code>copy</code> parameter to the
  1995. &lsquo;<samp>-codec</samp>&rsquo; option. It makes <code>ffmpeg</code> omit the decoding and encoding
  1996. step for the specified stream, so it does only demuxing and muxing. It is useful
  1997. for changing the container format or modifying container-level metadata. The
  1998. diagram above will, in this case, simplify to this:
  1999. </p>
  2000. <pre class="verbatim"> _______ ______________ ________
  2001. | | | | | |
  2002. | input | demuxer | encoded data | muxer | output |
  2003. | file | ---------&gt; | packets | -------&gt; | file |
  2004. |_______| |______________| |________|
  2005. </pre>
  2006. <p>Since there is no decoding or encoding, it is very fast and there is no quality
  2007. loss. However, it might not work in some cases because of many factors. Applying
  2008. filters is obviously also impossible, since filters work on uncompressed data.
  2009. </p>
  2010. <a name="Stream-selection"></a>
  2011. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Stream-selection">4 Stream selection</a></h1>
  2012. <p><code>ffmpeg</code> provides the <code>-map</code> option for manual control of stream selection in each
  2013. output file. Users can skip <code>-map</code> and let ffmpeg perform automatic stream selection as
  2014. described below. The <code>-vn / -an / -sn / -dn</code> options can be used to skip inclusion of
  2015. video, audio, subtitle and data streams respectively, whether manually mapped or automatically
  2016. selected, except for those streams which are outputs of complex filtergraphs.
  2017. </p>
  2018. <a name="Description"></a>
  2019. <h2 class="section"><a href="ffmpeg-all.html#toc-Description">4.1 Description</a></h2>
  2020. <p>The sub-sections that follow describe the various rules that are involved in stream selection.
  2021. The examples that follow next show how these rules are applied in practice.
  2022. </p>
  2023. <p>While every effort is made to accurately reflect the behavior of the program, FFmpeg is under
  2024. continuous development and the code may have changed since the time of this writing.
  2025. </p>
  2026. <a name="Automatic-stream-selection"></a>
  2027. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Automatic-stream-selection">4.1.1 Automatic stream selection</a></h3>
  2028. <p>In the absence of any map options for a particular output file, ffmpeg inspects the output
  2029. format to check which type of streams can be included in it, viz. video, audio and/or
  2030. subtitles. For each acceptable stream type, ffmpeg will pick one stream, when available,
  2031. from among all the inputs.
  2032. </p>
  2033. <p>It will select that stream based upon the following criteria:
  2034. </p><ul>
  2035. <li>
  2036. for video, it is the stream with the highest resolution,
  2037. </li><li>
  2038. for audio, it is the stream with the most channels,
  2039. </li><li>
  2040. for subtitles, it is the first subtitle stream found but there&rsquo;s a caveat.
  2041. The output format&rsquo;s default subtitle encoder can be either text-based or image-based,
  2042. and only a subtitle stream of the same type will be chosen.
  2043. </li></ul>
  2044. <p>In the case where several streams of the same type rate equally, the stream with the lowest
  2045. index is chosen.
  2046. </p>
  2047. <p>Data or attachment streams are not automatically selected and can only be included
  2048. using <code>-map</code>.
  2049. </p><a name="Manual-stream-selection"></a>
  2050. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Manual-stream-selection">4.1.2 Manual stream selection</a></h3>
  2051. <p>When <code>-map</code> is used, only user-mapped streams are included in that output file,
  2052. with one possible exception for filtergraph outputs described below.
  2053. </p>
  2054. <a name="Complex-filtergraphs"></a>
  2055. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Complex-filtergraphs">4.1.3 Complex filtergraphs</a></h3>
  2056. <p>If there are any complex filtergraph output streams with unlabeled pads, they will be added
  2057. to the first output file. This will lead to a fatal error if the stream type is not supported
  2058. by the output format. In the absence of the map option, the inclusion of these streams leads
  2059. to the automatic stream selection of their types being skipped. If map options are present,
  2060. these filtergraph streams are included in addition to the mapped streams.
  2061. </p>
  2062. <p>Complex filtergraph output streams with labeled pads must be mapped once and exactly once.
  2063. </p>
  2064. <a name="Stream-handling"></a>
  2065. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Stream-handling">4.1.4 Stream handling</a></h3>
  2066. <p>Stream handling is independent of stream selection, with an exception for subtitles described
  2067. below. Stream handling is set via the <code>-codec</code> option addressed to streams within a
  2068. specific <em>output</em> file. In particular, codec options are applied by ffmpeg after the
  2069. stream selection process and thus do not influence the latter. If no <code>-codec</code> option is
  2070. specified for a stream type, ffmpeg will select the default encoder registered by the output
  2071. file muxer.
  2072. </p>
  2073. <p>An exception exists for subtitles. If a subtitle encoder is specified for an output file, the
  2074. first subtitle stream found of any type, text or image, will be included. ffmpeg does not validate
  2075. if the specified encoder can convert the selected stream or if the converted stream is acceptable
  2076. within the output format. This applies generally as well: when the user sets an encoder manually,
  2077. the stream selection process cannot check if the encoded stream can be muxed into the output file.
  2078. If it cannot, ffmpeg will abort and <em>all</em> output files will fail to be processed.
  2079. </p>
  2080. <a name="Examples-110"></a>
  2081. <h2 class="section"><a href="ffmpeg-all.html#toc-Examples-110">4.2 Examples</a></h2>
  2082. <p>The following examples illustrate the behavior, quirks and limitations of ffmpeg&rsquo;s stream
  2083. selection methods.
  2084. </p>
  2085. <p>They assume the following three input files.
  2086. </p>
  2087. <pre class="verbatim">
  2088. input file 'A.avi'
  2089. stream 0: video 640x360
  2090. stream 1: audio 2 channels
  2091. input file 'B.mp4'
  2092. stream 0: video 1920x1080
  2093. stream 1: audio 2 channels
  2094. stream 2: subtitles (text)
  2095. stream 3: audio 5.1 channels
  2096. stream 4: subtitles (text)
  2097. input file 'C.mkv'
  2098. stream 0: video 1280x720
  2099. stream 1: audio 2 channels
  2100. stream 2: subtitles (image)
  2101. </pre>
  2102. <a name="Example_003a-automatic-stream-selection"></a>
  2103. <h4 class="subsubheading">Example: automatic stream selection</h4>
  2104. <div class="example">
  2105. <pre class="example">ffmpeg -i A.avi -i B.mp4 out1.mkv out2.wav -map 1:a -c:a copy out3.mov
  2106. </pre></div>
  2107. <p>There are three output files specified, and for the first two, no <code>-map</code> options
  2108. are set, so ffmpeg will select streams for these two files automatically.
  2109. </p>
  2110. <p>&lsquo;<tt>out1.mkv</tt>&rsquo; is a Matroska container file and accepts video, audio and subtitle streams,
  2111. so ffmpeg will try to select one of each type.<br>
  2112. For video, it will select <code>stream 0</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, which has the highest
  2113. resolution among all the input video streams.<br>
  2114. For audio, it will select <code>stream 3</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, since it has the greatest
  2115. number of channels.<br>
  2116. For subtitles, it will select <code>stream 2</code> from &lsquo;<tt>B.mp4</tt>&rsquo;, which is the first subtitle
  2117. stream from among &lsquo;<tt>A.avi</tt>&rsquo; and &lsquo;<tt>B.mp4</tt>&rsquo;.
  2118. </p>
  2119. <p>&lsquo;<tt>out2.wav</tt>&rsquo; accepts only audio streams, so only <code>stream 3</code> from &lsquo;<tt>B.mp4</tt>&rsquo; is
  2120. selected.
  2121. </p>
  2122. <p>For &lsquo;<tt>out3.mov</tt>&rsquo;, since a <code>-map</code> option is set, no automatic stream selection will
  2123. occur. The <code>-map 1:a</code> option will select all audio streams from the second input
  2124. &lsquo;<tt>B.mp4</tt>&rsquo;. No other streams will be included in this output file.
  2125. </p>
  2126. <p>For the first two outputs, all included streams will be transcoded. The encoders chosen will
  2127. be the default ones registered by each output format, which may not match the codec of the
  2128. selected input streams.
  2129. </p>
  2130. <p>For the third output, codec option for audio streams has been set
  2131. to <code>copy</code>, so no decoding-filtering-encoding operations will occur, or <em>can</em> occur.
  2132. Packets of selected streams shall be conveyed from the input file and muxed within the output
  2133. file.
  2134. </p>
  2135. <a name="Example_003a-automatic-subtitles-selection"></a>
  2136. <h4 class="subsubheading">Example: automatic subtitles selection</h4>
  2137. <div class="example">
  2138. <pre class="example">ffmpeg -i C.mkv out1.mkv -c:s dvdsub -an out2.mkv
  2139. </pre></div>
  2140. <p>Although &lsquo;<tt>out1.mkv</tt>&rsquo; is a Matroska container file which accepts subtitle streams, only a
  2141. video and audio stream shall be selected. The subtitle stream of &lsquo;<tt>C.mkv</tt>&rsquo; is image-based
  2142. and the default subtitle encoder of the Matroska muxer is text-based, so a transcode operation
  2143. for the subtitles is expected to fail and hence the stream isn&rsquo;t selected. However, in
  2144. &lsquo;<tt>out2.mkv</tt>&rsquo;, a subtitle encoder is specified in the command and so, the subtitle stream is
  2145. selected, in addition to the video stream. The presence of <code>-an</code> disables audio stream
  2146. selection for &lsquo;<tt>out2.mkv</tt>&rsquo;.
  2147. </p>
  2148. <a name="Example_003a-unlabeled-filtergraph-outputs"></a>
  2149. <h4 class="subsubheading">Example: unlabeled filtergraph outputs</h4>
  2150. <div class="example">
  2151. <pre class="example">ffmpeg -i A.avi -i C.mkv -i B.mp4 -filter_complex &quot;overlay&quot; out1.mp4 out2.srt
  2152. </pre></div>
  2153. <p>A filtergraph is setup here using the <code>-filter_complex</code> option and consists of a single
  2154. video filter. The <code>overlay</code> filter requires exactly two video inputs, but none are
  2155. specified, so the first two available video streams are used, those of &lsquo;<tt>A.avi</tt>&rsquo; and
  2156. &lsquo;<tt>C.mkv</tt>&rsquo;. The output pad of the filter has no label and so is sent to the first output file
  2157. &lsquo;<tt>out1.mp4</tt>&rsquo;. Due to this, automatic selection of the video stream is skipped, which would
  2158. have selected the stream in &lsquo;<tt>B.mp4</tt>&rsquo;. The audio stream with most channels viz. <code>stream 3</code>
  2159. in &lsquo;<tt>B.mp4</tt>&rsquo;, is chosen automatically. No subtitle stream is chosen however, since the MP4
  2160. format has no default subtitle encoder registered, and the user hasn&rsquo;t specified a subtitle encoder.
  2161. </p>
  2162. <p>The 2nd output file, &lsquo;<tt>out2.srt</tt>&rsquo;, only accepts text-based subtitle streams. So, even though
  2163. the first subtitle stream available belongs to &lsquo;<tt>C.mkv</tt>&rsquo;, it is image-based and hence skipped.
  2164. The selected stream, <code>stream 2</code> in &lsquo;<tt>B.mp4</tt>&rsquo;, is the first text-based subtitle stream.
  2165. </p>
  2166. <a name="Example_003a-labeled-filtergraph-outputs"></a>
  2167. <h4 class="subsubheading">Example: labeled filtergraph outputs</h4>
  2168. <div class="example">
  2169. <pre class="example">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  2170. -map '[outv]' -an out1.mp4 \
  2171. out2.mkv \
  2172. -map '[outv]' -map 1:a:0 out3.mkv
  2173. </pre></div>
  2174. <p>The above command will fail, as the output pad labelled <code>[outv]</code> has been mapped twice.
  2175. None of the output files shall be processed.
  2176. </p>
  2177. <div class="example">
  2178. <pre class="example">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0[outv];overlay;aresample&quot; \
  2179. -an out1.mp4 \
  2180. out2.mkv \
  2181. -map 1:a:0 out3.mkv
  2182. </pre></div>
  2183. <p>This command above will also fail as the hue filter output has a label, <code>[outv]</code>,
  2184. and hasn&rsquo;t been mapped anywhere.
  2185. </p>
  2186. <p>The command should be modified as follows,
  2187. </p><div class="example">
  2188. <pre class="example">ffmpeg -i A.avi -i B.mp4 -i C.mkv -filter_complex &quot;[1:v]hue=s=0,split=2[outv1][outv2];overlay;aresample&quot; \
  2189. -map '[outv1]' -an out1.mp4 \
  2190. out2.mkv \
  2191. -map '[outv2]' -map 1:a:0 out3.mkv
  2192. </pre></div>
  2193. <p>The video stream from &lsquo;<tt>B.mp4</tt>&rsquo; is sent to the hue filter, whose output is cloned once using
  2194. the split filter, and both outputs labelled. Then a copy each is mapped to the first and third
  2195. output files.
  2196. </p>
  2197. <p>The overlay filter, requiring two video inputs, uses the first two unused video streams. Those
  2198. are the streams from &lsquo;<tt>A.avi</tt>&rsquo; and &lsquo;<tt>C.mkv</tt>&rsquo;. The overlay output isn&rsquo;t labelled, so it is
  2199. sent to the first output file &lsquo;<tt>out1.mp4</tt>&rsquo;, regardless of the presence of the <code>-map</code> option.
  2200. </p>
  2201. <p>The aresample filter is sent the first unused audio stream, that of &lsquo;<tt>A.avi</tt>&rsquo;. Since this filter
  2202. output is also unlabelled, it too is mapped to the first output file. The presence of <code>-an</code>
  2203. only suppresses automatic or manual stream selection of audio streams, not outputs sent from
  2204. filtergraphs. Both these mapped streams shall be ordered before the mapped stream in &lsquo;<tt>out1.mp4</tt>&rsquo;.
  2205. </p>
  2206. <p>The video, audio and subtitle streams mapped to <code>out2.mkv</code> are entirely determined by
  2207. automatic stream selection.
  2208. </p>
  2209. <p>&lsquo;<tt>out3.mkv</tt>&rsquo; consists of the cloned video output from the hue filter and the first audio
  2210. stream from &lsquo;<tt>B.mp4</tt>&rsquo;.
  2211. <br>
  2212. </p>
  2213. <a name="Options-35"></a>
  2214. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Options-35">5 Options</a></h1>
  2215. <p>All the numerical options, if not specified otherwise, accept a string
  2216. representing a number as input, which may be followed by one of the SI
  2217. unit prefixes, for example: &rsquo;K&rsquo;, &rsquo;M&rsquo;, or &rsquo;G&rsquo;.
  2218. </p>
  2219. <p>If &rsquo;i&rsquo; is appended to the SI unit prefix, the complete prefix will be
  2220. interpreted as a unit prefix for binary multiples, which are based on
  2221. powers of 1024 instead of powers of 1000. Appending &rsquo;B&rsquo; to the SI unit
  2222. prefix multiplies the value by 8. This allows using, for example:
  2223. &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;, &rsquo;G&rsquo; and &rsquo;B&rsquo; as number suffixes.
  2224. </p>
  2225. <p>Options which do not take arguments are boolean options, and set the
  2226. corresponding value to true. They can be set to false by prefixing
  2227. the option name with &quot;no&quot;. For example using &quot;-nofoo&quot;
  2228. will set the boolean option with name &quot;foo&quot; to false.
  2229. </p>
  2230. <p><a name="Stream-specifiers"></a>
  2231. </p><a name="Stream-specifiers-1"></a>
  2232. <h2 class="section"><a href="ffmpeg-all.html#toc-Stream-specifiers-1">5.1 Stream specifiers</a></h2>
  2233. <p>Some options are applied per-stream, e.g. bitrate or codec. Stream specifiers
  2234. are used to precisely specify which stream(s) a given option belongs to.
  2235. </p>
  2236. <p>A stream specifier is a string generally appended to the option name and
  2237. separated from it by a colon. E.g. <code>-codec:a:1 ac3</code> contains the
  2238. <code>a:1</code> stream specifier, which matches the second audio stream. Therefore, it
  2239. would select the ac3 codec for the second audio stream.
  2240. </p>
  2241. <p>A stream specifier can match several streams, so that the option is applied to all
  2242. of them. E.g. the stream specifier in <code>-b:a 128k</code> matches all audio
  2243. streams.
  2244. </p>
  2245. <p>An empty stream specifier matches all streams. For example, <code>-codec copy</code>
  2246. or <code>-codec: copy</code> would copy all the streams without reencoding.
  2247. </p>
  2248. <p>Possible forms of stream specifiers are:
  2249. </p><dl compact="compact">
  2250. <dt>&lsquo;<samp><var>stream_index</var></samp>&rsquo;</dt>
  2251. <dd><p>Matches the stream with this index. E.g. <code>-threads:1 4</code> would set the
  2252. thread count for the second stream to 4. If <var>stream_index</var> is used as an
  2253. additional stream specifier (see below), then it selects stream number
  2254. <var>stream_index</var> from the matching streams. Stream numbering is based on the
  2255. order of the streams as detected by libavformat except when a program ID is
  2256. also specified. In this case it is based on the ordering of the streams in the
  2257. program.
  2258. </p></dd>
  2259. <dt>&lsquo;<samp><var>stream_type</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
  2260. <dd><p><var>stream_type</var> is one of following: &rsquo;v&rsquo; or &rsquo;V&rsquo; for video, &rsquo;a&rsquo; for audio, &rsquo;s&rsquo;
  2261. for subtitle, &rsquo;d&rsquo; for data, and &rsquo;t&rsquo; for attachments. &rsquo;v&rsquo; matches all video
  2262. streams, &rsquo;V&rsquo; only matches video streams which are not attached pictures, video
  2263. thumbnails or cover arts. If <var>additional_stream_specifier</var> is used, then
  2264. it matches streams which both have this type and match the
  2265. <var>additional_stream_specifier</var>. Otherwise, it matches all streams of the
  2266. specified type.
  2267. </p></dd>
  2268. <dt>&lsquo;<samp>p:<var>program_id</var>[:<var>additional_stream_specifier</var>]</samp>&rsquo;</dt>
  2269. <dd><p>Matches streams which are in the program with the id <var>program_id</var>. If
  2270. <var>additional_stream_specifier</var> is used, then it matches streams which both
  2271. are part of the program and match the <var>additional_stream_specifier</var>.
  2272. </p>
  2273. </dd>
  2274. <dt>&lsquo;<samp>#<var>stream_id</var> or i:<var>stream_id</var></samp>&rsquo;</dt>
  2275. <dd><p>Match the stream by stream id (e.g. PID in MPEG-TS container).
  2276. </p></dd>
  2277. <dt>&lsquo;<samp>m:<var>key</var>[:<var>value</var>]</samp>&rsquo;</dt>
  2278. <dd><p>Matches streams with the metadata tag <var>key</var> having the specified value. If
  2279. <var>value</var> is not given, matches streams that contain the given tag with any
  2280. value.
  2281. </p></dd>
  2282. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  2283. <dd><p>Matches streams with usable configuration, the codec must be defined and the
  2284. essential information such as video dimension or audio sample rate must be present.
  2285. </p>
  2286. <p>Note that in <code>ffmpeg</code>, matching by metadata will only work properly for
  2287. input files.
  2288. </p></dd>
  2289. </dl>
  2290. <a name="Generic-options"></a>
  2291. <h2 class="section"><a href="ffmpeg-all.html#toc-Generic-options">5.2 Generic options</a></h2>
  2292. <p>These options are shared amongst the ff* tools.
  2293. </p>
  2294. <dl compact="compact">
  2295. <dt>&lsquo;<samp>-L</samp>&rsquo;</dt>
  2296. <dd><p>Show license.
  2297. </p>
  2298. </dd>
  2299. <dt>&lsquo;<samp>-h, -?, -help, --help [<var>arg</var>]</samp>&rsquo;</dt>
  2300. <dd><p>Show help. An optional parameter may be specified to print help about a specific
  2301. item. If no argument is specified, only basic (non advanced) tool
  2302. options are shown.
  2303. </p>
  2304. <p>Possible values of <var>arg</var> are:
  2305. </p><dl compact="compact">
  2306. <dt>&lsquo;<samp>long</samp>&rsquo;</dt>
  2307. <dd><p>Print advanced tool options in addition to the basic tool options.
  2308. </p>
  2309. </dd>
  2310. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  2311. <dd><p>Print complete list of options, including shared and private options
  2312. for encoders, decoders, demuxers, muxers, filters, etc.
  2313. </p>
  2314. </dd>
  2315. <dt>&lsquo;<samp>decoder=<var>decoder_name</var></samp>&rsquo;</dt>
  2316. <dd><p>Print detailed information about the decoder named <var>decoder_name</var>. Use the
  2317. &lsquo;<samp>-decoders</samp>&rsquo; option to get a list of all decoders.
  2318. </p>
  2319. </dd>
  2320. <dt>&lsquo;<samp>encoder=<var>encoder_name</var></samp>&rsquo;</dt>
  2321. <dd><p>Print detailed information about the encoder named <var>encoder_name</var>. Use the
  2322. &lsquo;<samp>-encoders</samp>&rsquo; option to get a list of all encoders.
  2323. </p>
  2324. </dd>
  2325. <dt>&lsquo;<samp>demuxer=<var>demuxer_name</var></samp>&rsquo;</dt>
  2326. <dd><p>Print detailed information about the demuxer named <var>demuxer_name</var>. Use the
  2327. &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all demuxers and muxers.
  2328. </p>
  2329. </dd>
  2330. <dt>&lsquo;<samp>muxer=<var>muxer_name</var></samp>&rsquo;</dt>
  2331. <dd><p>Print detailed information about the muxer named <var>muxer_name</var>. Use the
  2332. &lsquo;<samp>-formats</samp>&rsquo; option to get a list of all muxers and demuxers.
  2333. </p>
  2334. </dd>
  2335. <dt>&lsquo;<samp>filter=<var>filter_name</var></samp>&rsquo;</dt>
  2336. <dd><p>Print detailed information about the filter name <var>filter_name</var>. Use the
  2337. &lsquo;<samp>-filters</samp>&rsquo; option to get a list of all filters.
  2338. </p>
  2339. </dd>
  2340. <dt>&lsquo;<samp>bsf=<var>bitstream_filter_name</var></samp>&rsquo;</dt>
  2341. <dd><p>Print detailed information about the bitstream filter name <var>bitstream_filter_name</var>.
  2342. Use the &lsquo;<samp>-bsfs</samp>&rsquo; option to get a list of all bitstream filters.
  2343. </p></dd>
  2344. </dl>
  2345. </dd>
  2346. <dt>&lsquo;<samp>-version</samp>&rsquo;</dt>
  2347. <dd><p>Show version.
  2348. </p>
  2349. </dd>
  2350. <dt>&lsquo;<samp>-formats</samp>&rsquo;</dt>
  2351. <dd><p>Show available formats (including devices).
  2352. </p>
  2353. </dd>
  2354. <dt>&lsquo;<samp>-demuxers</samp>&rsquo;</dt>
  2355. <dd><p>Show available demuxers.
  2356. </p>
  2357. </dd>
  2358. <dt>&lsquo;<samp>-muxers</samp>&rsquo;</dt>
  2359. <dd><p>Show available muxers.
  2360. </p>
  2361. </dd>
  2362. <dt>&lsquo;<samp>-devices</samp>&rsquo;</dt>
  2363. <dd><p>Show available devices.
  2364. </p>
  2365. </dd>
  2366. <dt>&lsquo;<samp>-codecs</samp>&rsquo;</dt>
  2367. <dd><p>Show all codecs known to libavcodec.
  2368. </p>
  2369. <p>Note that the term &rsquo;codec&rsquo; is used throughout this documentation as a shortcut
  2370. for what is more correctly called a media bitstream format.
  2371. </p>
  2372. </dd>
  2373. <dt>&lsquo;<samp>-decoders</samp>&rsquo;</dt>
  2374. <dd><p>Show available decoders.
  2375. </p>
  2376. </dd>
  2377. <dt>&lsquo;<samp>-encoders</samp>&rsquo;</dt>
  2378. <dd><p>Show all available encoders.
  2379. </p>
  2380. </dd>
  2381. <dt>&lsquo;<samp>-bsfs</samp>&rsquo;</dt>
  2382. <dd><p>Show available bitstream filters.
  2383. </p>
  2384. </dd>
  2385. <dt>&lsquo;<samp>-protocols</samp>&rsquo;</dt>
  2386. <dd><p>Show available protocols.
  2387. </p>
  2388. </dd>
  2389. <dt>&lsquo;<samp>-filters</samp>&rsquo;</dt>
  2390. <dd><p>Show available libavfilter filters.
  2391. </p>
  2392. </dd>
  2393. <dt>&lsquo;<samp>-pix_fmts</samp>&rsquo;</dt>
  2394. <dd><p>Show available pixel formats.
  2395. </p>
  2396. </dd>
  2397. <dt>&lsquo;<samp>-sample_fmts</samp>&rsquo;</dt>
  2398. <dd><p>Show available sample formats.
  2399. </p>
  2400. </dd>
  2401. <dt>&lsquo;<samp>-layouts</samp>&rsquo;</dt>
  2402. <dd><p>Show channel names and standard channel layouts.
  2403. </p>
  2404. </dd>
  2405. <dt>&lsquo;<samp>-colors</samp>&rsquo;</dt>
  2406. <dd><p>Show recognized color names.
  2407. </p>
  2408. </dd>
  2409. <dt>&lsquo;<samp>-sources <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
  2410. <dd><p>Show autodetected sources of the input device.
  2411. Some devices may provide system-dependent source names that cannot be autodetected.
  2412. The returned list cannot be assumed to be always complete.
  2413. </p><div class="example">
  2414. <pre class="example">ffmpeg -sources pulse,server=192.168.0.4
  2415. </pre></div>
  2416. </dd>
  2417. <dt>&lsquo;<samp>-sinks <var>device</var>[,<var>opt1</var>=<var>val1</var>[,<var>opt2</var>=<var>val2</var>]...]</samp>&rsquo;</dt>
  2418. <dd><p>Show autodetected sinks of the output device.
  2419. Some devices may provide system-dependent sink names that cannot be autodetected.
  2420. The returned list cannot be assumed to be always complete.
  2421. </p><div class="example">
  2422. <pre class="example">ffmpeg -sinks pulse,server=192.168.0.4
  2423. </pre></div>
  2424. </dd>
  2425. <dt>&lsquo;<samp>-loglevel [<var>flags</var>+]<var>loglevel</var> | -v [<var>flags</var>+]<var>loglevel</var></samp>&rsquo;</dt>
  2426. <dd><p>Set logging level and flags used by the library.
  2427. </p>
  2428. <p>The optional <var>flags</var> prefix can consist of the following values:
  2429. </p><dl compact="compact">
  2430. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  2431. <dd><p>Indicates that repeated log output should not be compressed to the first line
  2432. and the &quot;Last message repeated n times&quot; line will be omitted.
  2433. </p></dd>
  2434. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2435. <dd><p>Indicates that log output should add a <code>[level]</code> prefix to each message
  2436. line. This can be used as an alternative to log coloring, e.g. when dumping the
  2437. log to file.
  2438. </p></dd>
  2439. </dl>
  2440. <p>Flags can also be used alone by adding a &rsquo;+&rsquo;/&rsquo;-&rsquo; prefix to set/reset a single
  2441. flag without affecting other <var>flags</var> or changing <var>loglevel</var>. When
  2442. setting both <var>flags</var> and <var>loglevel</var>, a &rsquo;+&rsquo; separator is expected
  2443. between the last <var>flags</var> value and before <var>loglevel</var>.
  2444. </p>
  2445. <p><var>loglevel</var> is a string or a number containing one of the following values:
  2446. </p><dl compact="compact">
  2447. <dt>&lsquo;<samp>quiet, -8</samp>&rsquo;</dt>
  2448. <dd><p>Show nothing at all; be silent.
  2449. </p></dd>
  2450. <dt>&lsquo;<samp>panic, 0</samp>&rsquo;</dt>
  2451. <dd><p>Only show fatal errors which could lead the process to crash, such as
  2452. an assertion failure. This is not currently used for anything.
  2453. </p></dd>
  2454. <dt>&lsquo;<samp>fatal, 8</samp>&rsquo;</dt>
  2455. <dd><p>Only show fatal errors. These are errors after which the process absolutely
  2456. cannot continue.
  2457. </p></dd>
  2458. <dt>&lsquo;<samp>error, 16</samp>&rsquo;</dt>
  2459. <dd><p>Show all errors, including ones which can be recovered from.
  2460. </p></dd>
  2461. <dt>&lsquo;<samp>warning, 24</samp>&rsquo;</dt>
  2462. <dd><p>Show all warnings and errors. Any message related to possibly
  2463. incorrect or unexpected events will be shown.
  2464. </p></dd>
  2465. <dt>&lsquo;<samp>info, 32</samp>&rsquo;</dt>
  2466. <dd><p>Show informative messages during processing. This is in addition to
  2467. warnings and errors. This is the default value.
  2468. </p></dd>
  2469. <dt>&lsquo;<samp>verbose, 40</samp>&rsquo;</dt>
  2470. <dd><p>Same as <code>info</code>, except more verbose.
  2471. </p></dd>
  2472. <dt>&lsquo;<samp>debug, 48</samp>&rsquo;</dt>
  2473. <dd><p>Show everything, including debugging information.
  2474. </p></dd>
  2475. <dt>&lsquo;<samp>trace, 56</samp>&rsquo;</dt>
  2476. </dl>
  2477. <p>For example to enable repeated log output, add the <code>level</code> prefix, and set
  2478. <var>loglevel</var> to <code>verbose</code>:
  2479. </p><div class="example">
  2480. <pre class="example">ffmpeg -loglevel repeat+level+verbose -i input output
  2481. </pre></div>
  2482. <p>Another example that enables repeated log output without affecting current
  2483. state of <code>level</code> prefix flag or <var>loglevel</var>:
  2484. </p><div class="example">
  2485. <pre class="example">ffmpeg [...] -loglevel +repeat
  2486. </pre></div>
  2487. <p>By default the program logs to stderr. If coloring is supported by the
  2488. terminal, colors are used to mark errors and warnings. Log coloring
  2489. can be disabled setting the environment variable
  2490. <code>AV_LOG_FORCE_NOCOLOR</code>, or can be forced setting
  2491. the environment variable <code>AV_LOG_FORCE_COLOR</code>.
  2492. </p>
  2493. </dd>
  2494. <dt>&lsquo;<samp>-report</samp>&rsquo;</dt>
  2495. <dd><p>Dump full command line and log output to a file named
  2496. <code><var>program</var>-<var>YYYYMMDD</var>-<var>HHMMSS</var>.log</code> in the current
  2497. directory.
  2498. This file can be useful for bug reports.
  2499. It also implies <code>-loglevel debug</code>.
  2500. </p>
  2501. <p>Setting the environment variable <code>FFREPORT</code> to any value has the
  2502. same effect. If the value is a &rsquo;:&rsquo;-separated key=value sequence, these
  2503. options will affect the report; option values must be escaped if they
  2504. contain special characters or the options delimiter &rsquo;:&rsquo; (see the
  2505. &ldquo;Quoting and escaping&rdquo; section in the ffmpeg-utils manual).
  2506. </p>
  2507. <p>The following options are recognized:
  2508. </p><dl compact="compact">
  2509. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  2510. <dd><p>set the file name to use for the report; <code>%p</code> is expanded to the name
  2511. of the program, <code>%t</code> is expanded to a timestamp, <code>%%</code> is expanded
  2512. to a plain <code>%</code>
  2513. </p></dd>
  2514. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  2515. <dd><p>set the log verbosity level using a numerical value (see <code>-loglevel</code>).
  2516. </p></dd>
  2517. </dl>
  2518. <p>For example, to output a report to a file named &lsquo;<tt>ffreport.log</tt>&rsquo;
  2519. using a log level of <code>32</code> (alias for log level <code>info</code>):
  2520. </p>
  2521. <div class="example">
  2522. <pre class="example">FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
  2523. </pre></div>
  2524. <p>Errors in parsing the environment variable are not fatal, and will not
  2525. appear in the report.
  2526. </p>
  2527. </dd>
  2528. <dt>&lsquo;<samp>-hide_banner</samp>&rsquo;</dt>
  2529. <dd><p>Suppress printing banner.
  2530. </p>
  2531. <p>All FFmpeg tools will normally show a copyright notice, build options
  2532. and library versions. This option can be used to suppress printing
  2533. this information.
  2534. </p>
  2535. </dd>
  2536. <dt>&lsquo;<samp>-cpuflags flags (<em>global</em>)</samp>&rsquo;</dt>
  2537. <dd><p>Allows setting and clearing cpu flags. This option is intended
  2538. for testing. Do not use it unless you know what you&rsquo;re doing.
  2539. </p><div class="example">
  2540. <pre class="example">ffmpeg -cpuflags -sse+mmx ...
  2541. ffmpeg -cpuflags mmx ...
  2542. ffmpeg -cpuflags 0 ...
  2543. </pre></div>
  2544. <p>Possible flags for this option are:
  2545. </p><dl compact="compact">
  2546. <dt>&lsquo;<samp>x86</samp>&rsquo;</dt>
  2547. <dd><dl compact="compact">
  2548. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  2549. <dt>&lsquo;<samp>mmxext</samp>&rsquo;</dt>
  2550. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  2551. <dt>&lsquo;<samp>sse2</samp>&rsquo;</dt>
  2552. <dt>&lsquo;<samp>sse2slow</samp>&rsquo;</dt>
  2553. <dt>&lsquo;<samp>sse3</samp>&rsquo;</dt>
  2554. <dt>&lsquo;<samp>sse3slow</samp>&rsquo;</dt>
  2555. <dt>&lsquo;<samp>ssse3</samp>&rsquo;</dt>
  2556. <dt>&lsquo;<samp>atom</samp>&rsquo;</dt>
  2557. <dt>&lsquo;<samp>sse4.1</samp>&rsquo;</dt>
  2558. <dt>&lsquo;<samp>sse4.2</samp>&rsquo;</dt>
  2559. <dt>&lsquo;<samp>avx</samp>&rsquo;</dt>
  2560. <dt>&lsquo;<samp>avx2</samp>&rsquo;</dt>
  2561. <dt>&lsquo;<samp>xop</samp>&rsquo;</dt>
  2562. <dt>&lsquo;<samp>fma3</samp>&rsquo;</dt>
  2563. <dt>&lsquo;<samp>fma4</samp>&rsquo;</dt>
  2564. <dt>&lsquo;<samp>3dnow</samp>&rsquo;</dt>
  2565. <dt>&lsquo;<samp>3dnowext</samp>&rsquo;</dt>
  2566. <dt>&lsquo;<samp>bmi1</samp>&rsquo;</dt>
  2567. <dt>&lsquo;<samp>bmi2</samp>&rsquo;</dt>
  2568. <dt>&lsquo;<samp>cmov</samp>&rsquo;</dt>
  2569. </dl>
  2570. </dd>
  2571. <dt>&lsquo;<samp>ARM</samp>&rsquo;</dt>
  2572. <dd><dl compact="compact">
  2573. <dt>&lsquo;<samp>armv5te</samp>&rsquo;</dt>
  2574. <dt>&lsquo;<samp>armv6</samp>&rsquo;</dt>
  2575. <dt>&lsquo;<samp>armv6t2</samp>&rsquo;</dt>
  2576. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2577. <dt>&lsquo;<samp>vfpv3</samp>&rsquo;</dt>
  2578. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2579. <dt>&lsquo;<samp>setend</samp>&rsquo;</dt>
  2580. </dl>
  2581. </dd>
  2582. <dt>&lsquo;<samp>AArch64</samp>&rsquo;</dt>
  2583. <dd><dl compact="compact">
  2584. <dt>&lsquo;<samp>armv8</samp>&rsquo;</dt>
  2585. <dt>&lsquo;<samp>vfp</samp>&rsquo;</dt>
  2586. <dt>&lsquo;<samp>neon</samp>&rsquo;</dt>
  2587. </dl>
  2588. </dd>
  2589. <dt>&lsquo;<samp>PowerPC</samp>&rsquo;</dt>
  2590. <dd><dl compact="compact">
  2591. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  2592. </dl>
  2593. </dd>
  2594. <dt>&lsquo;<samp>Specific Processors</samp>&rsquo;</dt>
  2595. <dd><dl compact="compact">
  2596. <dt>&lsquo;<samp>pentium2</samp>&rsquo;</dt>
  2597. <dt>&lsquo;<samp>pentium3</samp>&rsquo;</dt>
  2598. <dt>&lsquo;<samp>pentium4</samp>&rsquo;</dt>
  2599. <dt>&lsquo;<samp>k6</samp>&rsquo;</dt>
  2600. <dt>&lsquo;<samp>k62</samp>&rsquo;</dt>
  2601. <dt>&lsquo;<samp>athlon</samp>&rsquo;</dt>
  2602. <dt>&lsquo;<samp>athlonxp</samp>&rsquo;</dt>
  2603. <dt>&lsquo;<samp>k8</samp>&rsquo;</dt>
  2604. </dl>
  2605. </dd>
  2606. </dl>
  2607. </dd>
  2608. </dl>
  2609. <a name="AVOptions"></a>
  2610. <h2 class="section"><a href="ffmpeg-all.html#toc-AVOptions">5.3 AVOptions</a></h2>
  2611. <p>These options are provided directly by the libavformat, libavdevice and
  2612. libavcodec libraries. To see the list of available AVOptions, use the
  2613. &lsquo;<samp>-help</samp>&rsquo; option. They are separated into two categories:
  2614. </p><dl compact="compact">
  2615. <dt>&lsquo;<samp>generic</samp>&rsquo;</dt>
  2616. <dd><p>These options can be set for any container, codec or device. Generic options
  2617. are listed under AVFormatContext options for containers/devices and under
  2618. AVCodecContext options for codecs.
  2619. </p></dd>
  2620. <dt>&lsquo;<samp>private</samp>&rsquo;</dt>
  2621. <dd><p>These options are specific to the given container, device or codec. Private
  2622. options are listed under their corresponding containers/devices/codecs.
  2623. </p></dd>
  2624. </dl>
  2625. <p>For example to write an ID3v2.3 header instead of a default ID3v2.4 to
  2626. an MP3 file, use the &lsquo;<samp>id3v2_version</samp>&rsquo; private option of the MP3
  2627. muxer:
  2628. </p><div class="example">
  2629. <pre class="example">ffmpeg -i input.flac -id3v2_version 3 out.mp3
  2630. </pre></div>
  2631. <p>All codec AVOptions are per-stream, and thus a stream specifier
  2632. should be attached to them:
  2633. </p><div class="example">
  2634. <pre class="example">ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
  2635. </pre></div>
  2636. <p>In the above example, a multichannel audio stream is mapped twice for output.
  2637. The first instance is encoded with codec ac3 and bitrate 640k.
  2638. The second instance is downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified for it using
  2639. absolute index of the output stream.
  2640. </p>
  2641. <p>Note: the &lsquo;<samp>-nooption</samp>&rsquo; syntax cannot be used for boolean
  2642. AVOptions, use &lsquo;<samp>-option 0</samp>&rsquo;/&lsquo;<samp>-option 1</samp>&rsquo;.
  2643. </p>
  2644. <p>Note: the old undocumented way of specifying per-stream AVOptions by
  2645. prepending v/a/s to the options name is now obsolete and will be
  2646. removed soon.
  2647. </p>
  2648. <a name="Main-options"></a>
  2649. <h2 class="section"><a href="ffmpeg-all.html#toc-Main-options">5.4 Main options</a></h2>
  2650. <dl compact="compact">
  2651. <dt>&lsquo;<samp>-f <var>fmt</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2652. <dd><p>Force input or output file format. The format is normally auto detected for input
  2653. files and guessed from the file extension for output files, so this option is not
  2654. needed in most cases.
  2655. </p>
  2656. </dd>
  2657. <dt>&lsquo;<samp>-i <var>url</var> (<em>input</em>)</samp>&rsquo;</dt>
  2658. <dd><p>input file url
  2659. </p>
  2660. </dd>
  2661. <dt>&lsquo;<samp>-y (<em>global</em>)</samp>&rsquo;</dt>
  2662. <dd><p>Overwrite output files without asking.
  2663. </p>
  2664. </dd>
  2665. <dt>&lsquo;<samp>-n (<em>global</em>)</samp>&rsquo;</dt>
  2666. <dd><p>Do not overwrite output files, and exit immediately if a specified
  2667. output file already exists.
  2668. </p>
  2669. </dd>
  2670. <dt>&lsquo;<samp>-stream_loop <var>number</var> (<em>input</em>)</samp>&rsquo;</dt>
  2671. <dd><p>Set number of times input stream shall be looped. Loop 0 means no loop,
  2672. loop -1 means infinite loop.
  2673. </p>
  2674. </dd>
  2675. <dt>&lsquo;<samp>-c[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  2676. <dt>&lsquo;<samp>-codec[:<var>stream_specifier</var>] <var>codec</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  2677. <dd><p>Select an encoder (when used before an output file) or a decoder (when used
  2678. before an input file) for one or more streams. <var>codec</var> is the name of a
  2679. decoder/encoder or a special value <code>copy</code> (output only) to indicate that
  2680. the stream is not to be re-encoded.
  2681. </p>
  2682. <p>For example
  2683. </p><div class="example">
  2684. <pre class="example">ffmpeg -i INPUT -map 0 -c:v libx264 -c:a copy OUTPUT
  2685. </pre></div>
  2686. <p>encodes all video streams with libx264 and copies all audio streams.
  2687. </p>
  2688. <p>For each stream, the last matching <code>c</code> option is applied, so
  2689. </p><div class="example">
  2690. <pre class="example">ffmpeg -i INPUT -map 0 -c copy -c:v:1 libx264 -c:a:137 libvorbis OUTPUT
  2691. </pre></div>
  2692. <p>will copy all the streams except the second video, which will be encoded with
  2693. libx264, and the 138th audio, which will be encoded with libvorbis.
  2694. </p>
  2695. </dd>
  2696. <dt>&lsquo;<samp>-t <var>duration</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2697. <dd><p>When used as an input option (before <code>-i</code>), limit the <var>duration</var> of
  2698. data read from the input file.
  2699. </p>
  2700. <p>When used as an output option (before an output url), stop writing the
  2701. output after its duration reaches <var>duration</var>.
  2702. </p>
  2703. <p><var>duration</var> must be a time duration specification,
  2704. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2705. </p>
  2706. <p>-to and -t are mutually exclusive and -t has priority.
  2707. </p>
  2708. </dd>
  2709. <dt>&lsquo;<samp>-to <var>position</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2710. <dd><p>Stop writing the output or reading the input at <var>position</var>.
  2711. <var>position</var> must be a time duration specification,
  2712. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2713. </p>
  2714. <p>-to and -t are mutually exclusive and -t has priority.
  2715. </p>
  2716. </dd>
  2717. <dt>&lsquo;<samp>-fs <var>limit_size</var> (<em>output</em>)</samp>&rsquo;</dt>
  2718. <dd><p>Set the file size limit, expressed in bytes. No further chunk of bytes is written
  2719. after the limit is exceeded. The size of the output file is slightly more than the
  2720. requested file size.
  2721. </p>
  2722. </dd>
  2723. <dt>&lsquo;<samp>-ss <var>position</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  2724. <dd><p>When used as an input option (before <code>-i</code>), seeks in this input file to
  2725. <var>position</var>. Note that in most formats it is not possible to seek exactly,
  2726. so <code>ffmpeg</code> will seek to the closest seek point before <var>position</var>.
  2727. When transcoding and &lsquo;<samp>-accurate_seek</samp>&rsquo; is enabled (the default), this
  2728. extra segment between the seek point and <var>position</var> will be decoded and
  2729. discarded. When doing stream copy or when &lsquo;<samp>-noaccurate_seek</samp>&rsquo; is used, it
  2730. will be preserved.
  2731. </p>
  2732. <p>When used as an output option (before an output url), decodes but discards
  2733. input until the timestamps reach <var>position</var>.
  2734. </p>
  2735. <p><var>position</var> must be a time duration specification,
  2736. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2737. </p>
  2738. </dd>
  2739. <dt>&lsquo;<samp>-sseof <var>position</var> (<em>input</em>)</samp>&rsquo;</dt>
  2740. <dd>
  2741. <p>Like the <code>-ss</code> option but relative to the &quot;end of file&quot;. That is negative
  2742. values are earlier in the file, 0 is at EOF.
  2743. </p>
  2744. </dd>
  2745. <dt>&lsquo;<samp>-itsoffset <var>offset</var> (<em>input</em>)</samp>&rsquo;</dt>
  2746. <dd><p>Set the input time offset.
  2747. </p>
  2748. <p><var>offset</var> must be a time duration specification,
  2749. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  2750. </p>
  2751. <p>The offset is added to the timestamps of the input files. Specifying
  2752. a positive offset means that the corresponding streams are delayed by
  2753. the time duration specified in <var>offset</var>.
  2754. </p>
  2755. </dd>
  2756. <dt>&lsquo;<samp>-itsscale <var>scale</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  2757. <dd><p>Rescale input timestamps. <var>scale</var> should be a floating point number.
  2758. </p>
  2759. </dd>
  2760. <dt>&lsquo;<samp>-timestamp <var>date</var> (<em>output</em>)</samp>&rsquo;</dt>
  2761. <dd><p>Set the recording timestamp in the container.
  2762. </p>
  2763. <p><var>date</var> must be a date specification,
  2764. see <a href="ffmpeg-utils.html#date-syntax">(ffmpeg-utils)the Date section in the ffmpeg-utils(1) manual</a>.
  2765. </p>
  2766. </dd>
  2767. <dt>&lsquo;<samp>-metadata[:metadata_specifier] <var>key</var>=<var>value</var> (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
  2768. <dd><p>Set a metadata key/value pair.
  2769. </p>
  2770. <p>An optional <var>metadata_specifier</var> may be given to set metadata
  2771. on streams, chapters or programs. See <code>-map_metadata</code>
  2772. documentation for details.
  2773. </p>
  2774. <p>This option overrides metadata set with <code>-map_metadata</code>. It is
  2775. also possible to delete metadata by using an empty value.
  2776. </p>
  2777. <p>For example, for setting the title in the output file:
  2778. </p><div class="example">
  2779. <pre class="example">ffmpeg -i in.avi -metadata title=&quot;my title&quot; out.flv
  2780. </pre></div>
  2781. <p>To set the language of the first audio stream:
  2782. </p><div class="example">
  2783. <pre class="example">ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
  2784. </pre></div>
  2785. </dd>
  2786. <dt>&lsquo;<samp>-disposition[:stream_specifier] <var>value</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2787. <dd><p>Sets the disposition for a stream.
  2788. </p>
  2789. <p>This option overrides the disposition copied from the input stream. It is also
  2790. possible to delete the disposition by setting it to 0.
  2791. </p>
  2792. <p>The following dispositions are recognized:
  2793. </p><dl compact="compact">
  2794. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  2795. <dt>&lsquo;<samp>dub</samp>&rsquo;</dt>
  2796. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  2797. <dt>&lsquo;<samp>comment</samp>&rsquo;</dt>
  2798. <dt>&lsquo;<samp>lyrics</samp>&rsquo;</dt>
  2799. <dt>&lsquo;<samp>karaoke</samp>&rsquo;</dt>
  2800. <dt>&lsquo;<samp>forced</samp>&rsquo;</dt>
  2801. <dt>&lsquo;<samp>hearing_impaired</samp>&rsquo;</dt>
  2802. <dt>&lsquo;<samp>visual_impaired</samp>&rsquo;</dt>
  2803. <dt>&lsquo;<samp>clean_effects</samp>&rsquo;</dt>
  2804. <dt>&lsquo;<samp>attached_pic</samp>&rsquo;</dt>
  2805. <dt>&lsquo;<samp>captions</samp>&rsquo;</dt>
  2806. <dt>&lsquo;<samp>descriptions</samp>&rsquo;</dt>
  2807. <dt>&lsquo;<samp>dependent</samp>&rsquo;</dt>
  2808. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  2809. </dl>
  2810. <p>For example, to make the second audio stream the default stream:
  2811. </p><div class="example">
  2812. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:a:1 default out.mkv
  2813. </pre></div>
  2814. <p>To make the second subtitle stream the default stream and remove the default
  2815. disposition from the first subtitle stream:
  2816. </p><div class="example">
  2817. <pre class="example">ffmpeg -i in.mkv -c copy -disposition:s:0 0 -disposition:s:1 default out.mkv
  2818. </pre></div>
  2819. <p>To add an embedded cover/thumbnail:
  2820. </p><div class="example">
  2821. <pre class="example">ffmpeg -i in.mp4 -i IMAGE -map 0 -map 1 -c copy -c:v:1 png -disposition:v:1 attached_pic out.mp4
  2822. </pre></div>
  2823. <p>Not all muxers support embedded thumbnails, and those who do, only support a few formats, like JPEG or PNG.
  2824. </p>
  2825. </dd>
  2826. <dt>&lsquo;<samp>-program [title=<var>title</var>:][program_num=<var>program_num</var>:]st=<var>stream</var>[:st=<var>stream</var>...] (<em>output</em>)</samp>&rsquo;</dt>
  2827. <dd>
  2828. <p>Creates a program with the specified <var>title</var>, <var>program_num</var> and adds the specified
  2829. <var>stream</var>(s) to it.
  2830. </p>
  2831. </dd>
  2832. <dt>&lsquo;<samp>-target <var>type</var> (<em>output</em>)</samp>&rsquo;</dt>
  2833. <dd><p>Specify target file type (<code>vcd</code>, <code>svcd</code>, <code>dvd</code>, <code>dv</code>,
  2834. <code>dv50</code>). <var>type</var> may be prefixed with <code>pal-</code>, <code>ntsc-</code> or
  2835. <code>film-</code> to use the corresponding standard. All the format options
  2836. (bitrate, codecs, buffer sizes) are then set automatically. You can just type:
  2837. </p>
  2838. <div class="example">
  2839. <pre class="example">ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
  2840. </pre></div>
  2841. <p>Nevertheless you can specify additional options as long as you know
  2842. they do not conflict with the standard, as in:
  2843. </p>
  2844. <div class="example">
  2845. <pre class="example">ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
  2846. </pre></div>
  2847. </dd>
  2848. <dt>&lsquo;<samp>-dn (<em>input/output</em>)</samp>&rsquo;</dt>
  2849. <dd><p>As an input option, blocks all data streams of a file from being filtered or
  2850. being automatically selected or mapped for any output. See <code>-discard</code>
  2851. option to disable streams individually.
  2852. </p>
  2853. <p>As an output option, disables data recording i.e. automatic selection or
  2854. mapping of any data stream. For full manual control see the <code>-map</code>
  2855. option.
  2856. </p>
  2857. </dd>
  2858. <dt>&lsquo;<samp>-dframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  2859. <dd><p>Set the number of data frames to output. This is an obsolete alias for
  2860. <code>-frames:d</code>, which you should use instead.
  2861. </p>
  2862. </dd>
  2863. <dt>&lsquo;<samp>-frames[:<var>stream_specifier</var>] <var>framecount</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2864. <dd><p>Stop writing to the stream after <var>framecount</var> frames.
  2865. </p>
  2866. </dd>
  2867. <dt>&lsquo;<samp>-q[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2868. <dt>&lsquo;<samp>-qscale[:<var>stream_specifier</var>] <var>q</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2869. <dd><p>Use fixed quality scale (VBR). The meaning of <var>q</var>/<var>qscale</var> is
  2870. codec-dependent.
  2871. If <var>qscale</var> is used without a <var>stream_specifier</var> then it applies only
  2872. to the video stream, this is to maintain compatibility with previous behavior
  2873. and as specifying the same codec specific value to 2 different codecs that is
  2874. audio and video generally is not what is intended when no stream_specifier is
  2875. used.
  2876. </p>
  2877. <p><a name="filter_005foption"></a>
  2878. </p></dd>
  2879. <dt>&lsquo;<samp>-filter[:<var>stream_specifier</var>] <var>filtergraph</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2880. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  2881. filter the stream.
  2882. </p>
  2883. <p><var>filtergraph</var> is a description of the filtergraph to apply to
  2884. the stream, and must have a single input and a single output of the
  2885. same type of the stream. In the filtergraph, the input is associated
  2886. to the label <code>in</code>, and the output to the label <code>out</code>. See
  2887. the ffmpeg-filters manual for more information about the filtergraph
  2888. syntax.
  2889. </p>
  2890. <p>See the <a href="#filter_005fcomplex_005foption">-filter_complex option</a> if you
  2891. want to create filtergraphs with multiple inputs and/or outputs.
  2892. </p>
  2893. </dd>
  2894. <dt>&lsquo;<samp>-filter_script[:<var>stream_specifier</var>] <var>filename</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2895. <dd><p>This option is similar to &lsquo;<samp>-filter</samp>&rsquo;, the only difference is that its
  2896. argument is the name of the file from which a filtergraph description is to be
  2897. read.
  2898. </p>
  2899. </dd>
  2900. <dt>&lsquo;<samp>-filter_threads <var>nb_threads</var> (<em>global</em>)</samp>&rsquo;</dt>
  2901. <dd><p>Defines how many threads are used to process a filter pipeline. Each pipeline
  2902. will produce a thread pool with this many threads available for parallel processing.
  2903. The default is the number of available CPUs.
  2904. </p>
  2905. </dd>
  2906. <dt>&lsquo;<samp>-pre[:<var>stream_specifier</var>] <var>preset_name</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  2907. <dd><p>Specify the preset for matching stream(s).
  2908. </p>
  2909. </dd>
  2910. <dt>&lsquo;<samp>-stats (<em>global</em>)</samp>&rsquo;</dt>
  2911. <dd><p>Print encoding progress/statistics. It is on by default, to explicitly
  2912. disable it you need to specify <code>-nostats</code>.
  2913. </p>
  2914. </dd>
  2915. <dt>&lsquo;<samp>-progress <var>url</var> (<em>global</em>)</samp>&rsquo;</dt>
  2916. <dd><p>Send program-friendly progress information to <var>url</var>.
  2917. </p>
  2918. <p>Progress information is written approximately every second and at the end of
  2919. the encoding process. It is made of &quot;<var>key</var>=<var>value</var>&quot; lines. <var>key</var>
  2920. consists of only alphanumeric characters. The last key of a sequence of
  2921. progress information is always &quot;progress&quot;.
  2922. </p>
  2923. <p><a name="stdin-option"></a>
  2924. </p></dd>
  2925. <dt>&lsquo;<samp>-stdin</samp>&rsquo;</dt>
  2926. <dd><p>Enable interaction on standard input. On by default unless standard input is
  2927. used as an input. To explicitly disable interaction you need to specify
  2928. <code>-nostdin</code>.
  2929. </p>
  2930. <p>Disabling interaction on standard input is useful, for example, if
  2931. ffmpeg is in the background process group. Roughly the same result can
  2932. be achieved with <code>ffmpeg ... &lt; /dev/null</code> but it requires a
  2933. shell.
  2934. </p>
  2935. </dd>
  2936. <dt>&lsquo;<samp>-debug_ts (<em>global</em>)</samp>&rsquo;</dt>
  2937. <dd><p>Print timestamp information. It is off by default. This option is
  2938. mostly useful for testing and debugging purposes, and the output
  2939. format may change from one version to another, so it should not be
  2940. employed by portable scripts.
  2941. </p>
  2942. <p>See also the option <code>-fdebug ts</code>.
  2943. </p>
  2944. </dd>
  2945. <dt>&lsquo;<samp>-attach <var>filename</var> (<em>output</em>)</samp>&rsquo;</dt>
  2946. <dd><p>Add an attachment to the output file. This is supported by a few formats
  2947. like Matroska for e.g. fonts used in rendering subtitles. Attachments
  2948. are implemented as a specific type of stream, so this option will add
  2949. a new stream to the file. It is then possible to use per-stream options
  2950. on this stream in the usual way. Attachment streams created with this
  2951. option will be created after all the other streams (i.e. those created
  2952. with <code>-map</code> or automatic mappings).
  2953. </p>
  2954. <p>Note that for Matroska you also have to set the mimetype metadata tag:
  2955. </p><div class="example">
  2956. <pre class="example">ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv
  2957. </pre></div>
  2958. <p>(assuming that the attachment stream will be third in the output file).
  2959. </p>
  2960. </dd>
  2961. <dt>&lsquo;<samp>-dump_attachment[:<var>stream_specifier</var>] <var>filename</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  2962. <dd><p>Extract the matching attachment stream into a file named <var>filename</var>. If
  2963. <var>filename</var> is empty, then the value of the <code>filename</code> metadata tag
  2964. will be used.
  2965. </p>
  2966. <p>E.g. to extract the first attachment to a file named &rsquo;out.ttf&rsquo;:
  2967. </p><div class="example">
  2968. <pre class="example">ffmpeg -dump_attachment:t:0 out.ttf -i INPUT
  2969. </pre></div>
  2970. <p>To extract all attachments to files determined by the <code>filename</code> tag:
  2971. </p><div class="example">
  2972. <pre class="example">ffmpeg -dump_attachment:t &quot;&quot; -i INPUT
  2973. </pre></div>
  2974. <p>Technical note &ndash; attachments are implemented as codec extradata, so this
  2975. option can actually be used to extract extradata from any stream, not just
  2976. attachments.
  2977. </p>
  2978. </dd>
  2979. <dt>&lsquo;<samp>-noautorotate</samp>&rsquo;</dt>
  2980. <dd><p>Disable automatically rotating video based on file metadata.
  2981. </p>
  2982. </dd>
  2983. </dl>
  2984. <a name="Video-Options"></a>
  2985. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-Options">5.5 Video Options</a></h2>
  2986. <dl compact="compact">
  2987. <dt>&lsquo;<samp>-vframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  2988. <dd><p>Set the number of video frames to output. This is an obsolete alias for
  2989. <code>-frames:v</code>, which you should use instead.
  2990. </p></dd>
  2991. <dt>&lsquo;<samp>-r[:<var>stream_specifier</var>] <var>fps</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  2992. <dd><p>Set frame rate (Hz value, fraction or abbreviation).
  2993. </p>
  2994. <p>As an input option, ignore any timestamps stored in the file and instead
  2995. generate timestamps assuming constant frame rate <var>fps</var>.
  2996. This is not the same as the &lsquo;<samp>-framerate</samp>&rsquo; option used for some input formats
  2997. like image2 or v4l2 (it used to be the same in older versions of FFmpeg).
  2998. If in doubt use &lsquo;<samp>-framerate</samp>&rsquo; instead of the input option &lsquo;<samp>-r</samp>&rsquo;.
  2999. </p>
  3000. <p>As an output option, duplicate or drop input frames to achieve constant output
  3001. frame rate <var>fps</var>.
  3002. </p>
  3003. </dd>
  3004. <dt>&lsquo;<samp>-s[:<var>stream_specifier</var>] <var>size</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3005. <dd><p>Set frame size.
  3006. </p>
  3007. <p>As an input option, this is a shortcut for the &lsquo;<samp>video_size</samp>&rsquo; private
  3008. option, recognized by some demuxers for which the frame size is either not
  3009. stored in the file or is configurable &ndash; e.g. raw video or video grabbers.
  3010. </p>
  3011. <p>As an output option, this inserts the <code>scale</code> video filter to the
  3012. <em>end</em> of the corresponding filtergraph. Please use the <code>scale</code> filter
  3013. directly to insert it at the beginning or some other place.
  3014. </p>
  3015. <p>The format is &lsquo;<samp>wxh</samp>&rsquo; (default - same as source).
  3016. </p>
  3017. </dd>
  3018. <dt>&lsquo;<samp>-aspect[:<var>stream_specifier</var>] <var>aspect</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3019. <dd><p>Set the video display aspect ratio specified by <var>aspect</var>.
  3020. </p>
  3021. <p><var>aspect</var> can be a floating point number string, or a string of the
  3022. form <var>num</var>:<var>den</var>, where <var>num</var> and <var>den</var> are the
  3023. numerator and denominator of the aspect ratio. For example &quot;4:3&quot;,
  3024. &quot;16:9&quot;, &quot;1.3333&quot;, and &quot;1.7777&quot; are valid argument values.
  3025. </p>
  3026. <p>If used together with &lsquo;<samp>-vcodec copy</samp>&rsquo;, it will affect the aspect ratio
  3027. stored at container level, but not the aspect ratio stored in encoded
  3028. frames, if it exists.
  3029. </p>
  3030. </dd>
  3031. <dt>&lsquo;<samp>-vn (<em>input/output</em>)</samp>&rsquo;</dt>
  3032. <dd><p>As an input option, blocks all video streams of a file from being filtered or
  3033. being automatically selected or mapped for any output. See <code>-discard</code>
  3034. option to disable streams individually.
  3035. </p>
  3036. <p>As an output option, disables video recording i.e. automatic selection or
  3037. mapping of any video stream. For full manual control see the <code>-map</code>
  3038. option.
  3039. </p>
  3040. </dd>
  3041. <dt>&lsquo;<samp>-vcodec <var>codec</var> (<em>output</em>)</samp>&rsquo;</dt>
  3042. <dd><p>Set the video codec. This is an alias for <code>-codec:v</code>.
  3043. </p>
  3044. </dd>
  3045. <dt>&lsquo;<samp>-pass[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3046. <dd><p>Select the pass number (1 or 2). It is used to do two-pass
  3047. video encoding. The statistics of the video are recorded in the first
  3048. pass into a log file (see also the option -passlogfile),
  3049. and in the second pass that log file is used to generate the video
  3050. at the exact requested bitrate.
  3051. On pass 1, you may just deactivate audio and set output to null,
  3052. examples for Windows and Unix:
  3053. </p><div class="example">
  3054. <pre class="example">ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
  3055. ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null
  3056. </pre></div>
  3057. </dd>
  3058. <dt>&lsquo;<samp>-passlogfile[:<var>stream_specifier</var>] <var>prefix</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3059. <dd><p>Set two-pass log file name prefix to <var>prefix</var>, the default file name
  3060. prefix is &ldquo;ffmpeg2pass&rdquo;. The complete file name will be
  3061. &lsquo;<tt>PREFIX-N.log</tt>&rsquo;, where N is a number specific to the output
  3062. stream
  3063. </p>
  3064. </dd>
  3065. <dt>&lsquo;<samp>-vf <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
  3066. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3067. filter the stream.
  3068. </p>
  3069. <p>This is an alias for <code>-filter:v</code>, see the <a href="#filter_005foption">-filter option</a>.
  3070. </p></dd>
  3071. </dl>
  3072. <a name="Advanced-Video-options"></a>
  3073. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Video-options">5.6 Advanced Video options</a></h2>
  3074. <dl compact="compact">
  3075. <dt>&lsquo;<samp>-pix_fmt[:<var>stream_specifier</var>] <var>format</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3076. <dd><p>Set pixel format. Use <code>-pix_fmts</code> to show all the supported
  3077. pixel formats.
  3078. If the selected pixel format can not be selected, ffmpeg will print a
  3079. warning and select the best pixel format supported by the encoder.
  3080. If <var>pix_fmt</var> is prefixed by a <code>+</code>, ffmpeg will exit with an error
  3081. if the requested pixel format can not be selected, and automatic conversions
  3082. inside filtergraphs are disabled.
  3083. If <var>pix_fmt</var> is a single <code>+</code>, ffmpeg selects the same pixel format
  3084. as the input (or graph output) and automatic conversions are disabled.
  3085. </p>
  3086. </dd>
  3087. <dt>&lsquo;<samp>-sws_flags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3088. <dd><p>Set SwScaler flags.
  3089. </p>
  3090. </dd>
  3091. <dt>&lsquo;<samp>-rc_override[:<var>stream_specifier</var>] <var>override</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3092. <dd><p>Rate control override for specific intervals, formatted as &quot;int,int,int&quot;
  3093. list separated with slashes. Two first values are the beginning and
  3094. end frame numbers, last one is quantizer to use if positive, or quality
  3095. factor if negative.
  3096. </p>
  3097. </dd>
  3098. <dt>&lsquo;<samp>-ilme</samp>&rsquo;</dt>
  3099. <dd><p>Force interlacing support in encoder (MPEG-2 and MPEG-4 only).
  3100. Use this option if your input file is interlaced and you want
  3101. to keep the interlaced format for minimum losses.
  3102. The alternative is to deinterlace the input stream with
  3103. &lsquo;<samp>-deinterlace</samp>&rsquo;, but deinterlacing introduces losses.
  3104. </p></dd>
  3105. <dt>&lsquo;<samp>-psnr</samp>&rsquo;</dt>
  3106. <dd><p>Calculate PSNR of compressed frames.
  3107. </p></dd>
  3108. <dt>&lsquo;<samp>-vstats</samp>&rsquo;</dt>
  3109. <dd><p>Dump video coding statistics to &lsquo;<tt>vstats_HHMMSS.log</tt>&rsquo;.
  3110. </p></dd>
  3111. <dt>&lsquo;<samp>-vstats_file <var>file</var></samp>&rsquo;</dt>
  3112. <dd><p>Dump video coding statistics to <var>file</var>.
  3113. </p></dd>
  3114. <dt>&lsquo;<samp>-vstats_version <var>file</var></samp>&rsquo;</dt>
  3115. <dd><p>Specifies which version of the vstats format to use. Default is 2.
  3116. </p>
  3117. <p>version = 1 :
  3118. </p>
  3119. <p><code>frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s</code>
  3120. </p>
  3121. <p>version &gt; 1:
  3122. </p>
  3123. <p><code>out= %2d st= %2d frame= %5d q= %2.1f PSNR= %6.2f f_size= %6d s_size= %8.0fkB time= %0.3f br= %7.1fkbits/s avg_br= %7.1fkbits/s</code>
  3124. </p></dd>
  3125. <dt>&lsquo;<samp>-top[:<var>stream_specifier</var>] <var>n</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3126. <dd><p>top=1/bottom=0/auto=-1 field first
  3127. </p></dd>
  3128. <dt>&lsquo;<samp>-dc <var>precision</var></samp>&rsquo;</dt>
  3129. <dd><p>Intra_dc_precision.
  3130. </p></dd>
  3131. <dt>&lsquo;<samp>-vtag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
  3132. <dd><p>Force video tag/fourcc. This is an alias for <code>-tag:v</code>.
  3133. </p></dd>
  3134. <dt>&lsquo;<samp>-qphist (<em>global</em>)</samp>&rsquo;</dt>
  3135. <dd><p>Show QP histogram
  3136. </p></dd>
  3137. <dt>&lsquo;<samp>-vbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3138. <dd><p>Deprecated see -bsf
  3139. </p>
  3140. </dd>
  3141. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] <var>time</var>[,<var>time</var>...] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3142. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] expr:<var>expr</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3143. <dt>&lsquo;<samp>-force_key_frames[:<var>stream_specifier</var>] source (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3144. <dd>
  3145. <p><var>force_key_frames</var> can take arguments of the following form:
  3146. </p>
  3147. <dl compact="compact">
  3148. <dt>&lsquo;<samp><var>time</var>[,<var>time</var>...]</samp>&rsquo;</dt>
  3149. <dd><p>If the argument consists of timestamps, ffmpeg will round the specified times to the nearest
  3150. output timestamp as per the encoder time base and force a keyframe at the first frame having
  3151. timestamp equal or greater than the computed timestamp. Note that if the encoder time base is too
  3152. coarse, then the keyframes may be forced on frames with timestamps lower than the specified time.
  3153. The default encoder time base is the inverse of the output framerate but may be set otherwise
  3154. via <code>-enc_time_base</code>.
  3155. </p>
  3156. <p>If one of the times is &quot;<code>chapters</code>[<var>delta</var>]&quot;, it is expanded into
  3157. the time of the beginning of all chapters in the file, shifted by
  3158. <var>delta</var>, expressed as a time in seconds.
  3159. This option can be useful to ensure that a seek point is present at a
  3160. chapter mark or any other designated place in the output file.
  3161. </p>
  3162. <p>For example, to insert a key frame at 5 minutes, plus key frames 0.1 second
  3163. before the beginning of every chapter:
  3164. </p><div class="example">
  3165. <pre class="example">-force_key_frames 0:05:00,chapters-0.1
  3166. </pre></div>
  3167. </dd>
  3168. <dt>&lsquo;<samp>expr:<var>expr</var></samp>&rsquo;</dt>
  3169. <dd><p>If the argument is prefixed with <code>expr:</code>, the string <var>expr</var>
  3170. is interpreted like an expression and is evaluated for each frame. A
  3171. key frame is forced in case the evaluation is non-zero.
  3172. </p>
  3173. <p>The expression in <var>expr</var> can contain the following constants:
  3174. </p><dl compact="compact">
  3175. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  3176. <dd><p>the number of current processed frame, starting from 0
  3177. </p></dd>
  3178. <dt>&lsquo;<samp>n_forced</samp>&rsquo;</dt>
  3179. <dd><p>the number of forced frames
  3180. </p></dd>
  3181. <dt>&lsquo;<samp>prev_forced_n</samp>&rsquo;</dt>
  3182. <dd><p>the number of the previous forced frame, it is <code>NAN</code> when no
  3183. keyframe was forced yet
  3184. </p></dd>
  3185. <dt>&lsquo;<samp>prev_forced_t</samp>&rsquo;</dt>
  3186. <dd><p>the time of the previous forced frame, it is <code>NAN</code> when no
  3187. keyframe was forced yet
  3188. </p></dd>
  3189. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  3190. <dd><p>the time of the current processed frame
  3191. </p></dd>
  3192. </dl>
  3193. <p>For example to force a key frame every 5 seconds, you can specify:
  3194. </p><div class="example">
  3195. <pre class="example">-force_key_frames expr:gte(t,n_forced*5)
  3196. </pre></div>
  3197. <p>To force a key frame 5 seconds after the time of the last forced one,
  3198. starting from second 13:
  3199. </p><div class="example">
  3200. <pre class="example">-force_key_frames expr:if(isnan(prev_forced_t),gte(t,13),gte(t,prev_forced_t+5))
  3201. </pre></div>
  3202. </dd>
  3203. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  3204. <dd><p>If the argument is <code>source</code>, ffmpeg will force a key frame if
  3205. the current frame being encoded is marked as a key frame in its source.
  3206. </p>
  3207. </dd>
  3208. </dl>
  3209. <p>Note that forcing too many keyframes is very harmful for the lookahead
  3210. algorithms of certain encoders: using fixed-GOP options or similar
  3211. would be more efficient.
  3212. </p>
  3213. </dd>
  3214. <dt>&lsquo;<samp>-copyinkf[:<var>stream_specifier</var>] (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3215. <dd><p>When doing stream copy, copy also non-key frames found at the
  3216. beginning.
  3217. </p>
  3218. </dd>
  3219. <dt>&lsquo;<samp>-init_hw_device <var>type</var>[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp>&rsquo;</dt>
  3220. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>, using the
  3221. given device parameters.
  3222. If no name is specified it will receive a default name of the form &quot;<var>type</var>%d&quot;.
  3223. </p>
  3224. <p>The meaning of <var>device</var> and the following arguments depends on the
  3225. device type:
  3226. </p><dl compact="compact">
  3227. <dt>&lsquo;<samp>cuda</samp>&rsquo;</dt>
  3228. <dd><p><var>device</var> is the number of the CUDA device.
  3229. </p>
  3230. </dd>
  3231. <dt>&lsquo;<samp>dxva2</samp>&rsquo;</dt>
  3232. <dd><p><var>device</var> is the number of the Direct3D 9 display adapter.
  3233. </p>
  3234. </dd>
  3235. <dt>&lsquo;<samp>vaapi</samp>&rsquo;</dt>
  3236. <dd><p><var>device</var> is either an X11 display name or a DRM render node.
  3237. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>)
  3238. and then the first DRM render node (<em>/dev/dri/renderD128</em>).
  3239. </p>
  3240. </dd>
  3241. <dt>&lsquo;<samp>vdpau</samp>&rsquo;</dt>
  3242. <dd><p><var>device</var> is an X11 display name.
  3243. If not specified, it will attempt to open the default X11 display (<em>$DISPLAY</em>).
  3244. </p>
  3245. </dd>
  3246. <dt>&lsquo;<samp>qsv</samp>&rsquo;</dt>
  3247. <dd><p><var>device</var> selects a value in &lsquo;<samp>MFX_IMPL_*</samp>&rsquo;. Allowed values are:
  3248. </p><dl compact="compact">
  3249. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  3250. <dt>&lsquo;<samp>sw</samp>&rsquo;</dt>
  3251. <dt>&lsquo;<samp>hw</samp>&rsquo;</dt>
  3252. <dt>&lsquo;<samp>auto_any</samp>&rsquo;</dt>
  3253. <dt>&lsquo;<samp>hw_any</samp>&rsquo;</dt>
  3254. <dt>&lsquo;<samp>hw2</samp>&rsquo;</dt>
  3255. <dt>&lsquo;<samp>hw3</samp>&rsquo;</dt>
  3256. <dt>&lsquo;<samp>hw4</samp>&rsquo;</dt>
  3257. </dl>
  3258. <p>If not specified, &lsquo;<samp>auto_any</samp>&rsquo; is used.
  3259. (Note that it may be easier to achieve the desired result for QSV by creating the
  3260. platform-appropriate subdevice (&lsquo;<samp>dxva2</samp>&rsquo; or &lsquo;<samp>vaapi</samp>&rsquo;) and then deriving a
  3261. QSV device from that.)
  3262. </p>
  3263. </dd>
  3264. <dt>&lsquo;<samp>opencl</samp>&rsquo;</dt>
  3265. <dd><p><var>device</var> selects the platform and device as <em>platform_index.device_index</em>.
  3266. </p>
  3267. <p>The set of devices can also be filtered using the key-value pairs to find only
  3268. devices matching particular platform or device strings.
  3269. </p>
  3270. <p>The strings usable as filters are:
  3271. </p><dl compact="compact">
  3272. <dt>&lsquo;<samp>platform_profile</samp>&rsquo;</dt>
  3273. <dt>&lsquo;<samp>platform_version</samp>&rsquo;</dt>
  3274. <dt>&lsquo;<samp>platform_name</samp>&rsquo;</dt>
  3275. <dt>&lsquo;<samp>platform_vendor</samp>&rsquo;</dt>
  3276. <dt>&lsquo;<samp>platform_extensions</samp>&rsquo;</dt>
  3277. <dt>&lsquo;<samp>device_name</samp>&rsquo;</dt>
  3278. <dt>&lsquo;<samp>device_vendor</samp>&rsquo;</dt>
  3279. <dt>&lsquo;<samp>driver_version</samp>&rsquo;</dt>
  3280. <dt>&lsquo;<samp>device_version</samp>&rsquo;</dt>
  3281. <dt>&lsquo;<samp>device_profile</samp>&rsquo;</dt>
  3282. <dt>&lsquo;<samp>device_extensions</samp>&rsquo;</dt>
  3283. <dt>&lsquo;<samp>device_type</samp>&rsquo;</dt>
  3284. </dl>
  3285. <p>The indices and filters must together uniquely select a device.
  3286. </p>
  3287. <p>Examples:
  3288. </p><dl compact="compact">
  3289. <dt><em>-init_hw_device opencl:0.1</em></dt>
  3290. <dd><p>Choose the second device on the first platform.
  3291. </p>
  3292. </dd>
  3293. <dt><em>-init_hw_device opencl:,device_name=Foo9000</em></dt>
  3294. <dd><p>Choose the device with a name containing the string <em>Foo9000</em>.
  3295. </p>
  3296. </dd>
  3297. <dt><em>-init_hw_device opencl:1,device_type=gpu,device_extensions=cl_khr_fp16</em></dt>
  3298. <dd><p>Choose the GPU device on the second platform supporting the <em>cl_khr_fp16</em>
  3299. extension.
  3300. </p></dd>
  3301. </dl>
  3302. </dd>
  3303. <dt>&lsquo;<samp>vulkan</samp>&rsquo;</dt>
  3304. <dd><p>If <var>device</var> is an integer, it selects the device by its index in a
  3305. system-dependent list of devices. If <var>device</var> is any other string, it
  3306. selects the first device with a name containing that string as a substring.
  3307. </p>
  3308. <p>Examples:
  3309. </p><dl compact="compact">
  3310. <dt><em>-init_hw_device vulkan:1</em></dt>
  3311. <dd><p>Choose the second device on the system.
  3312. </p>
  3313. </dd>
  3314. <dt><em>-init_hw_device vulkan:RADV</em></dt>
  3315. <dd><p>Choose the first device with a name containing the string <em>RADV</em>.
  3316. </p></dd>
  3317. </dl>
  3318. </dd>
  3319. </dl>
  3320. </dd>
  3321. <dt>&lsquo;<samp>-init_hw_device <var>type</var>[=<var>name</var>]@<var>source</var></samp>&rsquo;</dt>
  3322. <dd><p>Initialise a new hardware device of type <var>type</var> called <var>name</var>,
  3323. deriving it from the existing device with the name <var>source</var>.
  3324. </p>
  3325. </dd>
  3326. <dt>&lsquo;<samp>-init_hw_device list</samp>&rsquo;</dt>
  3327. <dd><p>List all hardware device types supported in this build of ffmpeg.
  3328. </p>
  3329. </dd>
  3330. <dt>&lsquo;<samp>-filter_hw_device <var>name</var></samp>&rsquo;</dt>
  3331. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  3332. This can be used to set the device to upload to with the <code>hwupload</code> filter,
  3333. or the device to map to with the <code>hwmap</code> filter. Other filters may also
  3334. make use of this parameter when they require a hardware device. Note that this
  3335. is typically only required when the input is not already in hardware frames -
  3336. when it is, filters will derive the device they require from the context of the
  3337. frames they receive as input.
  3338. </p>
  3339. <p>This is a global setting, so all filters will receive the same device.
  3340. </p>
  3341. </dd>
  3342. <dt>&lsquo;<samp>-hwaccel[:<var>stream_specifier</var>] <var>hwaccel</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3343. <dd><p>Use hardware acceleration to decode the matching stream(s). The allowed values
  3344. of <var>hwaccel</var> are:
  3345. </p><dl compact="compact">
  3346. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  3347. <dd><p>Do not use any hardware acceleration (the default).
  3348. </p>
  3349. </dd>
  3350. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  3351. <dd><p>Automatically select the hardware acceleration method.
  3352. </p>
  3353. </dd>
  3354. <dt>&lsquo;<samp>vdpau</samp>&rsquo;</dt>
  3355. <dd><p>Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
  3356. </p>
  3357. </dd>
  3358. <dt>&lsquo;<samp>dxva2</samp>&rsquo;</dt>
  3359. <dd><p>Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
  3360. </p>
  3361. </dd>
  3362. <dt>&lsquo;<samp>vaapi</samp>&rsquo;</dt>
  3363. <dd><p>Use VAAPI (Video Acceleration API) hardware acceleration.
  3364. </p>
  3365. </dd>
  3366. <dt>&lsquo;<samp>qsv</samp>&rsquo;</dt>
  3367. <dd><p>Use the Intel QuickSync Video acceleration for video transcoding.
  3368. </p>
  3369. <p>Unlike most other values, this option does not enable accelerated decoding (that
  3370. is used automatically whenever a qsv decoder is selected), but accelerated
  3371. transcoding, without copying the frames into the system memory.
  3372. </p>
  3373. <p>For it to work, both the decoder and the encoder must support QSV acceleration
  3374. and no filters must be used.
  3375. </p></dd>
  3376. </dl>
  3377. <p>This option has no effect if the selected hwaccel is not available or not
  3378. supported by the chosen decoder.
  3379. </p>
  3380. <p>Note that most acceleration methods are intended for playback and will not be
  3381. faster than software decoding on modern CPUs. Additionally, <code>ffmpeg</code>
  3382. will usually need to copy the decoded frames from the GPU memory into the system
  3383. memory, resulting in further performance loss. This option is thus mainly
  3384. useful for testing.
  3385. </p>
  3386. </dd>
  3387. <dt>&lsquo;<samp>-hwaccel_device[:<var>stream_specifier</var>] <var>hwaccel_device</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3388. <dd><p>Select a device to use for hardware acceleration.
  3389. </p>
  3390. <p>This option only makes sense when the &lsquo;<samp>-hwaccel</samp>&rsquo; option is also specified.
  3391. It can either refer to an existing device created with &lsquo;<samp>-init_hw_device</samp>&rsquo;
  3392. by name, or it can create a new device as if
  3393. &lsquo;<samp>-init_hw_device</samp>&rsquo; <var>type</var>:<var>hwaccel_device</var>
  3394. were called immediately before.
  3395. </p>
  3396. </dd>
  3397. <dt>&lsquo;<samp>-hwaccels</samp>&rsquo;</dt>
  3398. <dd><p>List all hardware acceleration methods supported in this build of ffmpeg.
  3399. </p>
  3400. </dd>
  3401. </dl>
  3402. <a name="Audio-Options"></a>
  3403. <h2 class="section"><a href="ffmpeg-all.html#toc-Audio-Options">5.7 Audio Options</a></h2>
  3404. <dl compact="compact">
  3405. <dt>&lsquo;<samp>-aframes <var>number</var> (<em>output</em>)</samp>&rsquo;</dt>
  3406. <dd><p>Set the number of audio frames to output. This is an obsolete alias for
  3407. <code>-frames:a</code>, which you should use instead.
  3408. </p></dd>
  3409. <dt>&lsquo;<samp>-ar[:<var>stream_specifier</var>] <var>freq</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3410. <dd><p>Set the audio sampling frequency. For output streams it is set by
  3411. default to the frequency of the corresponding input stream. For input
  3412. streams this option only makes sense for audio grabbing devices and raw
  3413. demuxers and is mapped to the corresponding demuxer options.
  3414. </p></dd>
  3415. <dt>&lsquo;<samp>-aq <var>q</var> (<em>output</em>)</samp>&rsquo;</dt>
  3416. <dd><p>Set the audio quality (codec-specific, VBR). This is an alias for -q:a.
  3417. </p></dd>
  3418. <dt>&lsquo;<samp>-ac[:<var>stream_specifier</var>] <var>channels</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3419. <dd><p>Set the number of audio channels. For output streams it is set by
  3420. default to the number of input audio channels. For input streams
  3421. this option only makes sense for audio grabbing devices and raw demuxers
  3422. and is mapped to the corresponding demuxer options.
  3423. </p></dd>
  3424. <dt>&lsquo;<samp>-an (<em>input/output</em>)</samp>&rsquo;</dt>
  3425. <dd><p>As an input option, blocks all audio streams of a file from being filtered or
  3426. being automatically selected or mapped for any output. See <code>-discard</code>
  3427. option to disable streams individually.
  3428. </p>
  3429. <p>As an output option, disables audio recording i.e. automatic selection or
  3430. mapping of any audio stream. For full manual control see the <code>-map</code>
  3431. option.
  3432. </p></dd>
  3433. <dt>&lsquo;<samp>-acodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3434. <dd><p>Set the audio codec. This is an alias for <code>-codec:a</code>.
  3435. </p></dd>
  3436. <dt>&lsquo;<samp>-sample_fmt[:<var>stream_specifier</var>] <var>sample_fmt</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3437. <dd><p>Set the audio sample format. Use <code>-sample_fmts</code> to get a list
  3438. of supported sample formats.
  3439. </p>
  3440. </dd>
  3441. <dt>&lsquo;<samp>-af <var>filtergraph</var> (<em>output</em>)</samp>&rsquo;</dt>
  3442. <dd><p>Create the filtergraph specified by <var>filtergraph</var> and use it to
  3443. filter the stream.
  3444. </p>
  3445. <p>This is an alias for <code>-filter:a</code>, see the <a href="#filter_005foption">-filter option</a>.
  3446. </p></dd>
  3447. </dl>
  3448. <a name="Advanced-Audio-options"></a>
  3449. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Audio-options">5.8 Advanced Audio options</a></h2>
  3450. <dl compact="compact">
  3451. <dt>&lsquo;<samp>-atag <var>fourcc/tag</var> (<em>output</em>)</samp>&rsquo;</dt>
  3452. <dd><p>Force audio tag/fourcc. This is an alias for <code>-tag:a</code>.
  3453. </p></dd>
  3454. <dt>&lsquo;<samp>-absf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3455. <dd><p>Deprecated, see -bsf
  3456. </p></dd>
  3457. <dt>&lsquo;<samp>-guess_layout_max <var>channels</var> (<em>input,per-stream</em>)</samp>&rsquo;</dt>
  3458. <dd><p>If some input channel layout is not known, try to guess only if it
  3459. corresponds to at most the specified number of channels. For example, 2
  3460. tells to <code>ffmpeg</code> to recognize 1 channel as mono and 2 channels as
  3461. stereo but not 6 channels as 5.1. The default is to always try to guess. Use
  3462. 0 to disable all guessing.
  3463. </p></dd>
  3464. </dl>
  3465. <a name="Subtitle-options"></a>
  3466. <h2 class="section"><a href="ffmpeg-all.html#toc-Subtitle-options">5.9 Subtitle options</a></h2>
  3467. <dl compact="compact">
  3468. <dt>&lsquo;<samp>-scodec <var>codec</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  3469. <dd><p>Set the subtitle codec. This is an alias for <code>-codec:s</code>.
  3470. </p></dd>
  3471. <dt>&lsquo;<samp>-sn (<em>input/output</em>)</samp>&rsquo;</dt>
  3472. <dd><p>As an input option, blocks all subtitle streams of a file from being filtered or
  3473. being automatically selected or mapped for any output. See <code>-discard</code>
  3474. option to disable streams individually.
  3475. </p>
  3476. <p>As an output option, disables subtitle recording i.e. automatic selection or
  3477. mapping of any subtitle stream. For full manual control see the <code>-map</code>
  3478. option.
  3479. </p></dd>
  3480. <dt>&lsquo;<samp>-sbsf <var>bitstream_filter</var></samp>&rsquo;</dt>
  3481. <dd><p>Deprecated, see -bsf
  3482. </p></dd>
  3483. </dl>
  3484. <a name="Advanced-Subtitle-options"></a>
  3485. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-Subtitle-options">5.10 Advanced Subtitle options</a></h2>
  3486. <dl compact="compact">
  3487. <dt>&lsquo;<samp>-fix_sub_duration</samp>&rsquo;</dt>
  3488. <dd><p>Fix subtitles durations. For each subtitle, wait for the next packet in the
  3489. same stream and adjust the duration of the first to avoid overlap. This is
  3490. necessary with some subtitles codecs, especially DVB subtitles, because the
  3491. duration in the original packet is only a rough estimate and the end is
  3492. actually marked by an empty subtitle frame. Failing to use this option when
  3493. necessary can result in exaggerated durations or muxing failures due to
  3494. non-monotonic timestamps.
  3495. </p>
  3496. <p>Note that this option will delay the output of all data until the next
  3497. subtitle packet is decoded: it may increase memory consumption and latency a
  3498. lot.
  3499. </p>
  3500. </dd>
  3501. <dt>&lsquo;<samp>-canvas_size <var>size</var></samp>&rsquo;</dt>
  3502. <dd><p>Set the size of the canvas used to render subtitles.
  3503. </p>
  3504. </dd>
  3505. </dl>
  3506. <a name="Advanced-options"></a>
  3507. <h2 class="section"><a href="ffmpeg-all.html#toc-Advanced-options">5.11 Advanced options</a></h2>
  3508. <dl compact="compact">
  3509. <dt>&lsquo;<samp>-map [-]<var>input_file_id</var>[:<var>stream_specifier</var>][?][,<var>sync_file_id</var>[:<var>stream_specifier</var>]] | <var>[linklabel]</var> (<em>output</em>)</samp>&rsquo;</dt>
  3510. <dd>
  3511. <p>Designate one or more input streams as a source for the output file. Each input
  3512. stream is identified by the input file index <var>input_file_id</var> and
  3513. the input stream index <var>input_stream_id</var> within the input
  3514. file. Both indices start at 0. If specified,
  3515. <var>sync_file_id</var>:<var>stream_specifier</var> sets which input stream
  3516. is used as a presentation sync reference.
  3517. </p>
  3518. <p>The first <code>-map</code> option on the command line specifies the
  3519. source for output stream 0, the second <code>-map</code> option specifies
  3520. the source for output stream 1, etc.
  3521. </p>
  3522. <p>A <code>-</code> character before the stream identifier creates a &quot;negative&quot; mapping.
  3523. It disables matching streams from already created mappings.
  3524. </p>
  3525. <p>A trailing <code>?</code> after the stream index will allow the map to be
  3526. optional: if the map matches no streams the map will be ignored instead
  3527. of failing. Note the map will still fail if an invalid input file index
  3528. is used; such as if the map refers to a non-existent input.
  3529. </p>
  3530. <p>An alternative <var>[linklabel]</var> form will map outputs from complex filter
  3531. graphs (see the &lsquo;<samp>-filter_complex</samp>&rsquo; option) to the output file.
  3532. <var>linklabel</var> must correspond to a defined output link label in the graph.
  3533. </p>
  3534. <p>For example, to map ALL streams from the first input file to output
  3535. </p><div class="example">
  3536. <pre class="example">ffmpeg -i INPUT -map 0 output
  3537. </pre></div>
  3538. <p>For example, if you have two audio streams in the first input file,
  3539. these streams are identified by &quot;0:0&quot; and &quot;0:1&quot;. You can use
  3540. <code>-map</code> to select which streams to place in an output file. For
  3541. example:
  3542. </p><div class="example">
  3543. <pre class="example">ffmpeg -i INPUT -map 0:1 out.wav
  3544. </pre></div>
  3545. <p>will map the input stream in &lsquo;<tt>INPUT</tt>&rsquo; identified by &quot;0:1&quot; to
  3546. the (single) output stream in &lsquo;<tt>out.wav</tt>&rsquo;.
  3547. </p>
  3548. <p>For example, to select the stream with index 2 from input file
  3549. &lsquo;<tt>a.mov</tt>&rsquo; (specified by the identifier &quot;0:2&quot;), and stream with
  3550. index 6 from input &lsquo;<tt>b.mov</tt>&rsquo; (specified by the identifier &quot;1:6&quot;),
  3551. and copy them to the output file &lsquo;<tt>out.mov</tt>&rsquo;:
  3552. </p><div class="example">
  3553. <pre class="example">ffmpeg -i a.mov -i b.mov -c copy -map 0:2 -map 1:6 out.mov
  3554. </pre></div>
  3555. <p>To select all video and the third audio stream from an input file:
  3556. </p><div class="example">
  3557. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a:2 OUTPUT
  3558. </pre></div>
  3559. <p>To map all the streams except the second audio, use negative mappings
  3560. </p><div class="example">
  3561. <pre class="example">ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT
  3562. </pre></div>
  3563. <p>To map the video and audio streams from the first input, and using the
  3564. trailing <code>?</code>, ignore the audio mapping if no audio streams exist in
  3565. the first input:
  3566. </p><div class="example">
  3567. <pre class="example">ffmpeg -i INPUT -map 0:v -map 0:a? OUTPUT
  3568. </pre></div>
  3569. <p>To pick the English audio stream:
  3570. </p><div class="example">
  3571. <pre class="example">ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
  3572. </pre></div>
  3573. <p>Note that using this option disables the default mappings for this output file.
  3574. </p>
  3575. </dd>
  3576. <dt>&lsquo;<samp>-ignore_unknown</samp>&rsquo;</dt>
  3577. <dd><p>Ignore input streams with unknown type instead of failing if copying
  3578. such streams is attempted.
  3579. </p>
  3580. </dd>
  3581. <dt>&lsquo;<samp>-copy_unknown</samp>&rsquo;</dt>
  3582. <dd><p>Allow input streams with unknown type to be copied instead of failing if copying
  3583. such streams is attempted.
  3584. </p>
  3585. </dd>
  3586. <dt>&lsquo;<samp>-map_channel [<var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var>|-1][?][:<var>output_file_id</var>.<var>stream_specifier</var>]</samp>&rsquo;</dt>
  3587. <dd><p>Map an audio channel from a given input to an output. If
  3588. <var>output_file_id</var>.<var>stream_specifier</var> is not set, the audio channel will
  3589. be mapped on all the audio streams.
  3590. </p>
  3591. <p>Using &quot;-1&quot; instead of
  3592. <var>input_file_id</var>.<var>stream_specifier</var>.<var>channel_id</var> will map a muted
  3593. channel.
  3594. </p>
  3595. <p>A trailing <code>?</code> will allow the map_channel to be
  3596. optional: if the map_channel matches no channel the map_channel will be ignored instead
  3597. of failing.
  3598. </p>
  3599. <p>For example, assuming <var>INPUT</var> is a stereo audio file, you can switch the
  3600. two audio channels with the following command:
  3601. </p><div class="example">
  3602. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.1 -map_channel 0.0.0 OUTPUT
  3603. </pre></div>
  3604. <p>If you want to mute the first channel and keep the second:
  3605. </p><div class="example">
  3606. <pre class="example">ffmpeg -i INPUT -map_channel -1 -map_channel 0.0.1 OUTPUT
  3607. </pre></div>
  3608. <p>The order of the &quot;-map_channel&quot; option specifies the order of the channels in
  3609. the output stream. The output channel layout is guessed from the number of
  3610. channels mapped (mono if one &quot;-map_channel&quot;, stereo if two, etc.). Using &quot;-ac&quot;
  3611. in combination of &quot;-map_channel&quot; makes the channel gain levels to be updated if
  3612. input and output channel layouts don&rsquo;t match (for instance two &quot;-map_channel&quot;
  3613. options and &quot;-ac 6&quot;).
  3614. </p>
  3615. <p>You can also extract each channel of an input to specific outputs; the following
  3616. command extracts two channels of the <var>INPUT</var> audio stream (file 0, stream 0)
  3617. to the respective <var>OUTPUT_CH0</var> and <var>OUTPUT_CH1</var> outputs:
  3618. </p><div class="example">
  3619. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 OUTPUT_CH0 -map_channel 0.0.1 OUTPUT_CH1
  3620. </pre></div>
  3621. <p>The following example splits the channels of a stereo input into two separate
  3622. streams, which are put into the same output file:
  3623. </p><div class="example">
  3624. <pre class="example">ffmpeg -i stereo.wav -map 0:0 -map 0:0 -map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -y out.ogg
  3625. </pre></div>
  3626. <p>Note that currently each output stream can only contain channels from a single
  3627. input stream; you can&rsquo;t for example use &quot;-map_channel&quot; to pick multiple input
  3628. audio channels contained in different streams (from the same or different files)
  3629. and merge them into a single output stream. It is therefore not currently
  3630. possible, for example, to turn two separate mono streams into a single stereo
  3631. stream. However splitting a stereo stream into two single channel mono streams
  3632. is possible.
  3633. </p>
  3634. <p>If you need this feature, a possible workaround is to use the <em>amerge</em>
  3635. filter. For example, if you need to merge a media (here &lsquo;<tt>input.mkv</tt>&rsquo;) with 2
  3636. mono audio streams into one single stereo channel audio stream (and keep the
  3637. video stream), you can use the following command:
  3638. </p><div class="example">
  3639. <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1] [0:2] amerge&quot; -c:a pcm_s16le -c:v copy output.mkv
  3640. </pre></div>
  3641. <p>To map the first two audio channels from the first input, and using the
  3642. trailing <code>?</code>, ignore the audio channel mapping if the first input is
  3643. mono instead of stereo:
  3644. </p><div class="example">
  3645. <pre class="example">ffmpeg -i INPUT -map_channel 0.0.0 -map_channel 0.0.1? OUTPUT
  3646. </pre></div>
  3647. </dd>
  3648. <dt>&lsquo;<samp>-map_metadata[:<var>metadata_spec_out</var>] <var>infile</var>[:<var>metadata_spec_in</var>] (<em>output,per-metadata</em>)</samp>&rsquo;</dt>
  3649. <dd><p>Set metadata information of the next output file from <var>infile</var>. Note that
  3650. those are file indices (zero-based), not filenames.
  3651. Optional <var>metadata_spec_in/out</var> parameters specify, which metadata to copy.
  3652. A metadata specifier can have the following forms:
  3653. </p><dl compact="compact">
  3654. <dt>&lsquo;<samp><var>g</var></samp>&rsquo;</dt>
  3655. <dd><p>global metadata, i.e. metadata that applies to the whole file
  3656. </p>
  3657. </dd>
  3658. <dt>&lsquo;<samp><var>s</var>[:<var>stream_spec</var>]</samp>&rsquo;</dt>
  3659. <dd><p>per-stream metadata. <var>stream_spec</var> is a stream specifier as described
  3660. in the <a href="#Stream-specifiers">Stream specifiers</a> chapter. In an input metadata specifier, the first
  3661. matching stream is copied from. In an output metadata specifier, all matching
  3662. streams are copied to.
  3663. </p>
  3664. </dd>
  3665. <dt>&lsquo;<samp><var>c</var>:<var>chapter_index</var></samp>&rsquo;</dt>
  3666. <dd><p>per-chapter metadata. <var>chapter_index</var> is the zero-based chapter index.
  3667. </p>
  3668. </dd>
  3669. <dt>&lsquo;<samp><var>p</var>:<var>program_index</var></samp>&rsquo;</dt>
  3670. <dd><p>per-program metadata. <var>program_index</var> is the zero-based program index.
  3671. </p></dd>
  3672. </dl>
  3673. <p>If metadata specifier is omitted, it defaults to global.
  3674. </p>
  3675. <p>By default, global metadata is copied from the first input file,
  3676. per-stream and per-chapter metadata is copied along with streams/chapters. These
  3677. default mappings are disabled by creating any mapping of the relevant type. A negative
  3678. file index can be used to create a dummy mapping that just disables automatic copying.
  3679. </p>
  3680. <p>For example to copy metadata from the first stream of the input file to global metadata
  3681. of the output file:
  3682. </p><div class="example">
  3683. <pre class="example">ffmpeg -i in.ogg -map_metadata 0:s:0 out.mp3
  3684. </pre></div>
  3685. <p>To do the reverse, i.e. copy global metadata to all audio streams:
  3686. </p><div class="example">
  3687. <pre class="example">ffmpeg -i in.mkv -map_metadata:s:a 0:g out.mkv
  3688. </pre></div>
  3689. <p>Note that simple <code>0</code> would work as well in this example, since global
  3690. metadata is assumed by default.
  3691. </p>
  3692. </dd>
  3693. <dt>&lsquo;<samp>-map_chapters <var>input_file_index</var> (<em>output</em>)</samp>&rsquo;</dt>
  3694. <dd><p>Copy chapters from input file with index <var>input_file_index</var> to the next
  3695. output file. If no chapter mapping is specified, then chapters are copied from
  3696. the first input file with at least one chapter. Use a negative file index to
  3697. disable any chapter copying.
  3698. </p>
  3699. </dd>
  3700. <dt>&lsquo;<samp>-benchmark (<em>global</em>)</samp>&rsquo;</dt>
  3701. <dd><p>Show benchmarking information at the end of an encode.
  3702. Shows real, system and user time used and maximum memory consumption.
  3703. Maximum memory consumption is not supported on all systems,
  3704. it will usually display as 0 if not supported.
  3705. </p></dd>
  3706. <dt>&lsquo;<samp>-benchmark_all (<em>global</em>)</samp>&rsquo;</dt>
  3707. <dd><p>Show benchmarking information during the encode.
  3708. Shows real, system and user time used in various steps (audio/video encode/decode).
  3709. </p></dd>
  3710. <dt>&lsquo;<samp>-timelimit <var>duration</var> (<em>global</em>)</samp>&rsquo;</dt>
  3711. <dd><p>Exit after ffmpeg has been running for <var>duration</var> seconds in CPU user time.
  3712. </p></dd>
  3713. <dt>&lsquo;<samp>-dump (<em>global</em>)</samp>&rsquo;</dt>
  3714. <dd><p>Dump each input packet to stderr.
  3715. </p></dd>
  3716. <dt>&lsquo;<samp>-hex (<em>global</em>)</samp>&rsquo;</dt>
  3717. <dd><p>When dumping packets, also dump the payload.
  3718. </p></dd>
  3719. <dt>&lsquo;<samp>-re (<em>input</em>)</samp>&rsquo;</dt>
  3720. <dd><p>Read input at native frame rate. Mainly used to simulate a grab device,
  3721. or live input stream (e.g. when reading from a file). Should not be used
  3722. with actual grab devices or live input streams (where it can cause packet
  3723. loss).
  3724. By default <code>ffmpeg</code> attempts to read the input(s) as fast as possible.
  3725. This option will slow down the reading of the input(s) to the native frame rate
  3726. of the input(s). It is useful for real-time output (e.g. live streaming).
  3727. </p></dd>
  3728. <dt>&lsquo;<samp>-vsync <var>parameter</var></samp>&rsquo;</dt>
  3729. <dd><p>Video sync method.
  3730. For compatibility reasons old values can be specified as numbers.
  3731. Newly added values will have to be specified as strings always.
  3732. </p>
  3733. <dl compact="compact">
  3734. <dt>&lsquo;<samp>0, passthrough</samp>&rsquo;</dt>
  3735. <dd><p>Each frame is passed with its timestamp from the demuxer to the muxer.
  3736. </p></dd>
  3737. <dt>&lsquo;<samp>1, cfr</samp>&rsquo;</dt>
  3738. <dd><p>Frames will be duplicated and dropped to achieve exactly the requested
  3739. constant frame rate.
  3740. </p></dd>
  3741. <dt>&lsquo;<samp>2, vfr</samp>&rsquo;</dt>
  3742. <dd><p>Frames are passed through with their timestamp or dropped so as to
  3743. prevent 2 frames from having the same timestamp.
  3744. </p></dd>
  3745. <dt>&lsquo;<samp>drop</samp>&rsquo;</dt>
  3746. <dd><p>As passthrough but destroys all timestamps, making the muxer generate
  3747. fresh timestamps based on frame-rate.
  3748. </p></dd>
  3749. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  3750. <dd><p>Chooses between 1 and 2 depending on muxer capabilities. This is the
  3751. default method.
  3752. </p></dd>
  3753. </dl>
  3754. <p>Note that the timestamps may be further modified by the muxer, after this.
  3755. For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3756. is enabled.
  3757. </p>
  3758. <p>With -map you can select from which stream the timestamps should be
  3759. taken. You can leave either video or audio unchanged and sync the
  3760. remaining stream(s) to the unchanged one.
  3761. </p>
  3762. </dd>
  3763. <dt>&lsquo;<samp>-frame_drop_threshold <var>parameter</var></samp>&rsquo;</dt>
  3764. <dd><p>Frame drop threshold, which specifies how much behind video frames can
  3765. be before they are dropped. In frame rate units, so 1.0 is one frame.
  3766. The default is -1.1. One possible usecase is to avoid framedrops in case
  3767. of noisy timestamps or to increase frame drop precision in case of exact
  3768. timestamps.
  3769. </p>
  3770. </dd>
  3771. <dt>&lsquo;<samp>-async <var>samples_per_second</var></samp>&rsquo;</dt>
  3772. <dd><p>Audio sync method. &quot;Stretches/squeezes&quot; the audio stream to match the timestamps,
  3773. the parameter is the maximum samples per second by which the audio is changed.
  3774. -async 1 is a special case where only the start of the audio stream is corrected
  3775. without any later correction.
  3776. </p>
  3777. <p>Note that the timestamps may be further modified by the muxer, after this.
  3778. For example, in the case that the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3779. is enabled.
  3780. </p>
  3781. <p>This option has been deprecated. Use the <code>aresample</code> audio filter instead.
  3782. </p>
  3783. </dd>
  3784. <dt>&lsquo;<samp>-copyts</samp>&rsquo;</dt>
  3785. <dd><p>Do not process input timestamps, but keep their values without trying
  3786. to sanitize them. In particular, do not remove the initial start time
  3787. offset value.
  3788. </p>
  3789. <p>Note that, depending on the &lsquo;<samp>vsync</samp>&rsquo; option or on specific muxer
  3790. processing (e.g. in case the format option &lsquo;<samp>avoid_negative_ts</samp>&rsquo;
  3791. is enabled) the output timestamps may mismatch with the input
  3792. timestamps even when this option is selected.
  3793. </p>
  3794. </dd>
  3795. <dt>&lsquo;<samp>-start_at_zero</samp>&rsquo;</dt>
  3796. <dd><p>When used with &lsquo;<samp>copyts</samp>&rsquo;, shift input timestamps so they start at zero.
  3797. </p>
  3798. <p>This means that using e.g. <code>-ss 50</code> will make output timestamps start at
  3799. 50 seconds, regardless of what timestamp the input file started at.
  3800. </p>
  3801. </dd>
  3802. <dt>&lsquo;<samp>-copytb <var>mode</var></samp>&rsquo;</dt>
  3803. <dd><p>Specify how to set the encoder timebase when stream copying. <var>mode</var> is an
  3804. integer numeric value, and can assume one of the following values:
  3805. </p>
  3806. <dl compact="compact">
  3807. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  3808. <dd><p>Use the demuxer timebase.
  3809. </p>
  3810. <p>The time base is copied to the output encoder from the corresponding input
  3811. demuxer. This is sometimes required to avoid non monotonically increasing
  3812. timestamps when copying video streams with variable frame rate.
  3813. </p>
  3814. </dd>
  3815. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3816. <dd><p>Use the decoder timebase.
  3817. </p>
  3818. <p>The time base is copied to the output encoder from the corresponding input
  3819. decoder.
  3820. </p>
  3821. </dd>
  3822. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  3823. <dd><p>Try to make the choice automatically, in order to generate a sane output.
  3824. </p></dd>
  3825. </dl>
  3826. <p>Default value is -1.
  3827. </p>
  3828. </dd>
  3829. <dt>&lsquo;<samp>-enc_time_base[:<var>stream_specifier</var>] <var>timebase</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3830. <dd><p>Set the encoder timebase. <var>timebase</var> is a floating point number,
  3831. and can assume one of the following values:
  3832. </p>
  3833. <dl compact="compact">
  3834. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3835. <dd><p>Assign a default value according to the media type.
  3836. </p>
  3837. <p>For video - use 1/framerate, for audio - use 1/samplerate.
  3838. </p>
  3839. </dd>
  3840. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  3841. <dd><p>Use the input stream timebase when possible.
  3842. </p>
  3843. <p>If an input stream is not available, the default timebase will be used.
  3844. </p>
  3845. </dd>
  3846. <dt>&lsquo;<samp>&gt;0</samp>&rsquo;</dt>
  3847. <dd><p>Use the provided number as the timebase.
  3848. </p>
  3849. <p>This field can be provided as a ratio of two integers (e.g. 1:24, 1:48000)
  3850. or as a floating point number (e.g. 0.04166, 2.0833e-5)
  3851. </p></dd>
  3852. </dl>
  3853. <p>Default value is 0.
  3854. </p>
  3855. </dd>
  3856. <dt>&lsquo;<samp>-bitexact (<em>input/output</em>)</samp>&rsquo;</dt>
  3857. <dd><p>Enable bitexact mode for (de)muxer and (de/en)coder
  3858. </p></dd>
  3859. <dt>&lsquo;<samp>-shortest (<em>output</em>)</samp>&rsquo;</dt>
  3860. <dd><p>Finish encoding when the shortest input stream ends.
  3861. </p></dd>
  3862. <dt>&lsquo;<samp>-dts_delta_threshold</samp>&rsquo;</dt>
  3863. <dd><p>Timestamp discontinuity delta threshold.
  3864. </p></dd>
  3865. <dt>&lsquo;<samp>-dts_error_threshold <var>seconds</var></samp>&rsquo;</dt>
  3866. <dd><p>Timestamp error delta threshold. This threshold use to discard crazy/damaged
  3867. timestamps and the default is 30 hours which is arbitrarily picked and quite
  3868. conservative.
  3869. </p></dd>
  3870. <dt>&lsquo;<samp>-muxdelay <var>seconds</var> (<em>output</em>)</samp>&rsquo;</dt>
  3871. <dd><p>Set the maximum demux-decode delay.
  3872. </p></dd>
  3873. <dt>&lsquo;<samp>-muxpreload <var>seconds</var> (<em>output</em>)</samp>&rsquo;</dt>
  3874. <dd><p>Set the initial demux-decode delay.
  3875. </p></dd>
  3876. <dt>&lsquo;<samp>-streamid <var>output-stream-index</var>:<var>new-value</var> (<em>output</em>)</samp>&rsquo;</dt>
  3877. <dd><p>Assign a new stream-id value to an output stream. This option should be
  3878. specified prior to the output filename to which it applies.
  3879. For the situation where multiple output files exist, a streamid
  3880. may be reassigned to a different value.
  3881. </p>
  3882. <p>For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for
  3883. an output mpegts file:
  3884. </p><div class="example">
  3885. <pre class="example">ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts
  3886. </pre></div>
  3887. </dd>
  3888. <dt>&lsquo;<samp>-bsf[:<var>stream_specifier</var>] <var>bitstream_filters</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  3889. <dd><p>Set bitstream filters for matching streams. <var>bitstream_filters</var> is
  3890. a comma-separated list of bitstream filters. Use the <code>-bsfs</code> option
  3891. to get the list of bitstream filters.
  3892. </p><div class="example">
  3893. <pre class="example">ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
  3894. </pre></div>
  3895. <div class="example">
  3896. <pre class="example">ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt
  3897. </pre></div>
  3898. </dd>
  3899. <dt>&lsquo;<samp>-tag[:<var>stream_specifier</var>] <var>codec_tag</var> (<em>input/output,per-stream</em>)</samp>&rsquo;</dt>
  3900. <dd><p>Force a tag/fourcc for matching streams.
  3901. </p>
  3902. </dd>
  3903. <dt>&lsquo;<samp>-timecode <var>hh</var>:<var>mm</var>:<var>ss</var>SEP<var>ff</var></samp>&rsquo;</dt>
  3904. <dd><p>Specify Timecode for writing. <var>SEP</var> is &rsquo;:&rsquo; for non drop timecode and &rsquo;;&rsquo;
  3905. (or &rsquo;.&rsquo;) for drop.
  3906. </p><div class="example">
  3907. <pre class="example">ffmpeg -i input.mpg -timecode 01:02:03.04 -r 30000/1001 -s ntsc output.mpg
  3908. </pre></div>
  3909. <p><a name="filter_005fcomplex_005foption"></a>
  3910. </p></dd>
  3911. <dt>&lsquo;<samp>-filter_complex <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
  3912. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  3913. outputs. For simple graphs &ndash; those with one input and one output of the same
  3914. type &ndash; see the &lsquo;<samp>-filter</samp>&rsquo; options. <var>filtergraph</var> is a description of
  3915. the filtergraph, as described in the &ldquo;Filtergraph syntax&rdquo; section of the
  3916. ffmpeg-filters manual.
  3917. </p>
  3918. <p>Input link labels must refer to input streams using the
  3919. <code>[file_index:stream_specifier]</code> syntax (i.e. the same as &lsquo;<samp>-map</samp>&rsquo;
  3920. uses). If <var>stream_specifier</var> matches multiple streams, the first one will be
  3921. used. An unlabeled input will be connected to the first unused input stream of
  3922. the matching type.
  3923. </p>
  3924. <p>Output link labels are referred to with &lsquo;<samp>-map</samp>&rsquo;. Unlabeled outputs are
  3925. added to the first output file.
  3926. </p>
  3927. <p>Note that with this option it is possible to use only lavfi sources without
  3928. normal input files.
  3929. </p>
  3930. <p>For example, to overlay an image over video
  3931. </p><div class="example">
  3932. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex '[0:v][1:v]overlay[out]' -map
  3933. '[out]' out.mkv
  3934. </pre></div>
  3935. <p>Here <code>[0:v]</code> refers to the first video stream in the first input file,
  3936. which is linked to the first (main) input of the overlay filter. Similarly the
  3937. first video stream in the second input is linked to the second (overlay) input
  3938. of overlay.
  3939. </p>
  3940. <p>Assuming there is only one video stream in each input file, we can omit input
  3941. labels, so the above is equivalent to
  3942. </p><div class="example">
  3943. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay[out]' -map
  3944. '[out]' out.mkv
  3945. </pre></div>
  3946. <p>Furthermore we can omit the output label and the single output from the filter
  3947. graph will be added to the output file automatically, so we can simply write
  3948. </p><div class="example">
  3949. <pre class="example">ffmpeg -i video.mkv -i image.png -filter_complex 'overlay' out.mkv
  3950. </pre></div>
  3951. <p>To generate 5 seconds of pure red video using lavfi <code>color</code> source:
  3952. </p><div class="example">
  3953. <pre class="example">ffmpeg -filter_complex 'color=c=red' -t 5 out.mkv
  3954. </pre></div>
  3955. </dd>
  3956. <dt>&lsquo;<samp>-filter_complex_threads <var>nb_threads</var> (<em>global</em>)</samp>&rsquo;</dt>
  3957. <dd><p>Defines how many threads are used to process a filter_complex graph.
  3958. Similar to filter_threads but used for <code>-filter_complex</code> graphs only.
  3959. The default is the number of available CPUs.
  3960. </p>
  3961. </dd>
  3962. <dt>&lsquo;<samp>-lavfi <var>filtergraph</var> (<em>global</em>)</samp>&rsquo;</dt>
  3963. <dd><p>Define a complex filtergraph, i.e. one with arbitrary number of inputs and/or
  3964. outputs. Equivalent to &lsquo;<samp>-filter_complex</samp>&rsquo;.
  3965. </p>
  3966. </dd>
  3967. <dt>&lsquo;<samp>-filter_complex_script <var>filename</var> (<em>global</em>)</samp>&rsquo;</dt>
  3968. <dd><p>This option is similar to &lsquo;<samp>-filter_complex</samp>&rsquo;, the only difference is that
  3969. its argument is the name of the file from which a complex filtergraph
  3970. description is to be read.
  3971. </p>
  3972. </dd>
  3973. <dt>&lsquo;<samp>-accurate_seek (<em>input</em>)</samp>&rsquo;</dt>
  3974. <dd><p>This option enables or disables accurate seeking in input files with the
  3975. &lsquo;<samp>-ss</samp>&rsquo; option. It is enabled by default, so seeking is accurate when
  3976. transcoding. Use &lsquo;<samp>-noaccurate_seek</samp>&rsquo; to disable it, which may be useful
  3977. e.g. when copying some streams and transcoding the others.
  3978. </p>
  3979. </dd>
  3980. <dt>&lsquo;<samp>-seek_timestamp (<em>input</em>)</samp>&rsquo;</dt>
  3981. <dd><p>This option enables or disables seeking by timestamp in input files with the
  3982. &lsquo;<samp>-ss</samp>&rsquo; option. It is disabled by default. If enabled, the argument
  3983. to the &lsquo;<samp>-ss</samp>&rsquo; option is considered an actual timestamp, and is not
  3984. offset by the start time of the file. This matters only for files which do
  3985. not start from timestamp 0, such as transport streams.
  3986. </p>
  3987. </dd>
  3988. <dt>&lsquo;<samp>-thread_queue_size <var>size</var> (<em>input</em>)</samp>&rsquo;</dt>
  3989. <dd><p>This option sets the maximum number of queued packets when reading from the
  3990. file or device. With low latency / high rate live streams, packets may be
  3991. discarded if they are not read in a timely manner; raising this value can
  3992. avoid it.
  3993. </p>
  3994. </dd>
  3995. <dt>&lsquo;<samp>-sdp_file <var>file</var> (<em>global</em>)</samp>&rsquo;</dt>
  3996. <dd><p>Print sdp information for an output stream to <var>file</var>.
  3997. This allows dumping sdp information when at least one output isn&rsquo;t an
  3998. rtp stream. (Requires at least one of the output formats to be rtp).
  3999. </p>
  4000. </dd>
  4001. <dt>&lsquo;<samp>-discard (<em>input</em>)</samp>&rsquo;</dt>
  4002. <dd><p>Allows discarding specific streams or frames from streams.
  4003. Any input stream can be fully discarded, using value <code>all</code> whereas
  4004. selective discarding of frames from a stream occurs at the demuxer
  4005. and is not supported by all demuxers.
  4006. </p>
  4007. <dl compact="compact">
  4008. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  4009. <dd><p>Discard no frame.
  4010. </p>
  4011. </dd>
  4012. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  4013. <dd><p>Default, which discards no frames.
  4014. </p>
  4015. </dd>
  4016. <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
  4017. <dd><p>Discard all non-reference frames.
  4018. </p>
  4019. </dd>
  4020. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  4021. <dd><p>Discard all bidirectional frames.
  4022. </p>
  4023. </dd>
  4024. <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
  4025. <dd><p>Discard all frames excepts keyframes.
  4026. </p>
  4027. </dd>
  4028. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  4029. <dd><p>Discard all frames.
  4030. </p></dd>
  4031. </dl>
  4032. </dd>
  4033. <dt>&lsquo;<samp>-abort_on <var>flags</var> (<em>global</em>)</samp>&rsquo;</dt>
  4034. <dd><p>Stop and abort on various conditions. The following flags are available:
  4035. </p>
  4036. <dl compact="compact">
  4037. <dt>&lsquo;<samp>empty_output</samp>&rsquo;</dt>
  4038. <dd><p>No packets were passed to the muxer, the output is empty.
  4039. </p></dd>
  4040. </dl>
  4041. </dd>
  4042. <dt>&lsquo;<samp>-xerror (<em>global</em>)</samp>&rsquo;</dt>
  4043. <dd><p>Stop and exit on error
  4044. </p>
  4045. </dd>
  4046. <dt>&lsquo;<samp>-max_muxing_queue_size <var>packets</var> (<em>output,per-stream</em>)</samp>&rsquo;</dt>
  4047. <dd><p>When transcoding audio and/or video streams, ffmpeg will not begin writing into
  4048. the output until it has one packet for each such stream. While waiting for that
  4049. to happen, packets for other streams are buffered. This option sets the size of
  4050. this buffer, in packets, for the matching output stream.
  4051. </p>
  4052. <p>The default value of this option should be high enough for most uses, so only
  4053. touch this option if you are sure that you need it.
  4054. </p>
  4055. </dd>
  4056. </dl>
  4057. <p>As a special exception, you can use a bitmap subtitle stream as input: it
  4058. will be converted into a video with the same size as the largest video in
  4059. the file, or 720x576 if no video is present. Note that this is an
  4060. experimental and temporary solution. It will be removed once libavfilter has
  4061. proper support for subtitles.
  4062. </p>
  4063. <p>For example, to hardcode subtitles on top of a DVB-T recording stored in
  4064. MPEG-TS format, delaying the subtitles by 1 second:
  4065. </p><div class="example">
  4066. <pre class="example">ffmpeg -i input.ts -filter_complex \
  4067. '[#0x2ef] setpts=PTS+1/TB [sub] ; [#0x2d0] [sub] overlay' \
  4068. -sn -map '#0x2dc' output.mkv
  4069. </pre></div>
  4070. <p>(0x2d0, 0x2dc and 0x2ef are the MPEG-TS PIDs of respectively the video,
  4071. audio and subtitles streams; 0:0, 0:3 and 0:7 would have worked too)
  4072. </p>
  4073. <a name="Preset-files"></a>
  4074. <h2 class="section"><a href="ffmpeg-all.html#toc-Preset-files">5.12 Preset files</a></h2>
  4075. <p>A preset file contains a sequence of <var>option</var>=<var>value</var> pairs,
  4076. one for each line, specifying a sequence of options which would be
  4077. awkward to specify on the command line. Lines starting with the hash
  4078. (&rsquo;#&rsquo;) character are ignored and are used to provide comments. Check
  4079. the &lsquo;<tt>presets</tt>&rsquo; directory in the FFmpeg source tree for examples.
  4080. </p>
  4081. <p>There are two types of preset files: ffpreset and avpreset files.
  4082. </p>
  4083. <a name="ffpreset-files"></a>
  4084. <h3 class="subsection"><a href="ffmpeg-all.html#toc-ffpreset-files">5.12.1 ffpreset files</a></h3>
  4085. <p>ffpreset files are specified with the <code>vpre</code>, <code>apre</code>,
  4086. <code>spre</code>, and <code>fpre</code> options. The <code>fpre</code> option takes the
  4087. filename of the preset instead of a preset name as input and can be
  4088. used for any kind of codec. For the <code>vpre</code>, <code>apre</code>, and
  4089. <code>spre</code> options, the options specified in a preset file are
  4090. applied to the currently selected codec of the same type as the preset
  4091. option.
  4092. </p>
  4093. <p>The argument passed to the <code>vpre</code>, <code>apre</code>, and <code>spre</code>
  4094. preset options identifies the preset file to use according to the
  4095. following rules:
  4096. </p>
  4097. <p>First ffmpeg searches for a file named <var>arg</var>.ffpreset in the
  4098. directories &lsquo;<tt>$FFMPEG_DATADIR</tt>&rsquo; (if set), and &lsquo;<tt>$HOME/.ffmpeg</tt>&rsquo;, and in
  4099. the datadir defined at configuration time (usually &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;)
  4100. or in a &lsquo;<tt>ffpresets</tt>&rsquo; folder along the executable on win32,
  4101. in that order. For example, if the argument is <code>libvpx-1080p</code>, it will
  4102. search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
  4103. </p>
  4104. <p>If no such file is found, then ffmpeg will search for a file named
  4105. <var>codec_name</var>-<var>arg</var>.ffpreset in the above-mentioned
  4106. directories, where <var>codec_name</var> is the name of the codec to which
  4107. the preset file options will be applied. For example, if you select
  4108. the video codec with <code>-vcodec libvpx</code> and use <code>-vpre 1080p</code>,
  4109. then it will search for the file &lsquo;<tt>libvpx-1080p.ffpreset</tt>&rsquo;.
  4110. </p>
  4111. <a name="avpreset-files"></a>
  4112. <h3 class="subsection"><a href="ffmpeg-all.html#toc-avpreset-files">5.12.2 avpreset files</a></h3>
  4113. <p>avpreset files are specified with the <code>pre</code> option. They work similar to
  4114. ffpreset files, but they only allow encoder- specific options. Therefore, an
  4115. <var>option</var>=<var>value</var> pair specifying an encoder cannot be used.
  4116. </p>
  4117. <p>When the <code>pre</code> option is specified, ffmpeg will look for files with the
  4118. suffix .avpreset in the directories &lsquo;<tt>$AVCONV_DATADIR</tt>&rsquo; (if set), and
  4119. &lsquo;<tt>$HOME/.avconv</tt>&rsquo;, and in the datadir defined at configuration time (usually
  4120. &lsquo;<tt>PREFIX/share/ffmpeg</tt>&rsquo;), in that order.
  4121. </p>
  4122. <p>First ffmpeg searches for a file named <var>codec_name</var>-<var>arg</var>.avpreset in
  4123. the above-mentioned directories, where <var>codec_name</var> is the name of the codec
  4124. to which the preset file options will be applied. For example, if you select the
  4125. video codec with <code>-vcodec libvpx</code> and use <code>-pre 1080p</code>, then it will
  4126. search for the file &lsquo;<tt>libvpx-1080p.avpreset</tt>&rsquo;.
  4127. </p>
  4128. <p>If no such file is found, then ffmpeg will search for a file named
  4129. <var>arg</var>.avpreset in the same directories.
  4130. </p>
  4131. <a name="Examples-174"></a>
  4132. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Examples-174">6 Examples</a></h1>
  4133. <a name="Video-and-Audio-grabbing"></a>
  4134. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-grabbing">6.1 Video and Audio grabbing</a></h2>
  4135. <p>If you specify the input format and device then ffmpeg can grab video
  4136. and audio directly.
  4137. </p>
  4138. <div class="example">
  4139. <pre class="example">ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4140. </pre></div>
  4141. <p>Or with an ALSA audio source (mono input, card id 1) instead of OSS:
  4142. </p><div class="example">
  4143. <pre class="example">ffmpeg -f alsa -ac 1 -i hw:1 -f video4linux2 -i /dev/video0 /tmp/out.mpg
  4144. </pre></div>
  4145. <p>Note that you must activate the right video source and channel before
  4146. launching ffmpeg with any TV viewer such as
  4147. <a href="http://linux.bytesex.org/xawtv/">xawtv</a> by Gerd Knorr. You also
  4148. have to set the audio recording levels correctly with a
  4149. standard mixer.
  4150. </p>
  4151. <a name="X11-grabbing"></a>
  4152. <h2 class="section"><a href="ffmpeg-all.html#toc-X11-grabbing">6.2 X11 grabbing</a></h2>
  4153. <p>Grab the X11 display with ffmpeg via
  4154. </p>
  4155. <div class="example">
  4156. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0 /tmp/out.mpg
  4157. </pre></div>
  4158. <p>0.0 is display.screen number of your X11 server, same as
  4159. the DISPLAY environment variable.
  4160. </p>
  4161. <div class="example">
  4162. <pre class="example">ffmpeg -f x11grab -video_size cif -framerate 25 -i :0.0+10,20 /tmp/out.mpg
  4163. </pre></div>
  4164. <p>0.0 is display.screen number of your X11 server, same as the DISPLAY environment
  4165. variable. 10 is the x-offset and 20 the y-offset for the grabbing.
  4166. </p>
  4167. <a name="Video-and-Audio-file-format-conversion"></a>
  4168. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-and-Audio-file-format-conversion">6.3 Video and Audio file format conversion</a></h2>
  4169. <p>Any supported file format and protocol can serve as input to ffmpeg:
  4170. </p>
  4171. <p>Examples:
  4172. </p><ul>
  4173. <li>
  4174. You can use YUV files as input:
  4175. <div class="example">
  4176. <pre class="example">ffmpeg -i /tmp/test%d.Y /tmp/out.mpg
  4177. </pre></div>
  4178. <p>It will use the files:
  4179. </p><div class="example">
  4180. <pre class="example">/tmp/test0.Y, /tmp/test0.U, /tmp/test0.V,
  4181. /tmp/test1.Y, /tmp/test1.U, /tmp/test1.V, etc...
  4182. </pre></div>
  4183. <p>The Y files use twice the resolution of the U and V files. They are
  4184. raw files, without header. They can be generated by all decent video
  4185. decoders. You must specify the size of the image with the &lsquo;<samp>-s</samp>&rsquo; option
  4186. if ffmpeg cannot guess it.
  4187. </p>
  4188. </li><li>
  4189. You can input from a raw YUV420P file:
  4190. <div class="example">
  4191. <pre class="example">ffmpeg -i /tmp/test.yuv /tmp/out.avi
  4192. </pre></div>
  4193. <p>test.yuv is a file containing raw YUV planar data. Each frame is composed
  4194. of the Y plane followed by the U and V planes at half vertical and
  4195. horizontal resolution.
  4196. </p>
  4197. </li><li>
  4198. You can output to a raw YUV420P file:
  4199. <div class="example">
  4200. <pre class="example">ffmpeg -i mydivx.avi hugefile.yuv
  4201. </pre></div>
  4202. </li><li>
  4203. You can set several input files and output files:
  4204. <div class="example">
  4205. <pre class="example">ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg
  4206. </pre></div>
  4207. <p>Converts the audio file a.wav and the raw YUV video file a.yuv
  4208. to MPEG file a.mpg.
  4209. </p>
  4210. </li><li>
  4211. You can also do audio and video conversions at the same time:
  4212. <div class="example">
  4213. <pre class="example">ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2
  4214. </pre></div>
  4215. <p>Converts a.wav to MPEG audio at 22050 Hz sample rate.
  4216. </p>
  4217. </li><li>
  4218. You can encode to several formats at the same time and define a
  4219. mapping from input stream to output streams:
  4220. <div class="example">
  4221. <pre class="example">ffmpeg -i /tmp/a.wav -map 0:a -b:a 64k /tmp/a.mp2 -map 0:a -b:a 128k /tmp/b.mp2
  4222. </pre></div>
  4223. <p>Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. &rsquo;-map
  4224. file:index&rsquo; specifies which input stream is used for each output
  4225. stream, in the order of the definition of output streams.
  4226. </p>
  4227. </li><li>
  4228. You can transcode decrypted VOBs:
  4229. <div class="example">
  4230. <pre class="example">ffmpeg -i snatch_1.vob -f avi -c:v mpeg4 -b:v 800k -g 300 -bf 2 -c:a libmp3lame -b:a 128k snatch.avi
  4231. </pre></div>
  4232. <p>This is a typical DVD ripping example; the input is a VOB file, the
  4233. output an AVI file with MPEG-4 video and MP3 audio. Note that in this
  4234. command we use B-frames so the MPEG-4 stream is DivX5 compatible, and
  4235. GOP size is 300 which means one intra frame every 10 seconds for 29.97fps
  4236. input video. Furthermore, the audio stream is MP3-encoded so you need
  4237. to enable LAME support by passing <code>--enable-libmp3lame</code> to configure.
  4238. The mapping is particularly useful for DVD transcoding
  4239. to get the desired audio language.
  4240. </p>
  4241. <p>NOTE: To see the supported input formats, use <code>ffmpeg -demuxers</code>.
  4242. </p>
  4243. </li><li>
  4244. You can extract images from a video, or create a video from many images:
  4245. <p>For extracting images from a video:
  4246. </p><div class="example">
  4247. <pre class="example">ffmpeg -i foo.avi -r 1 -s WxH -f image2 foo-%03d.jpeg
  4248. </pre></div>
  4249. <p>This will extract one video frame per second from the video and will
  4250. output them in files named &lsquo;<tt>foo-001.jpeg</tt>&rsquo;, &lsquo;<tt>foo-002.jpeg</tt>&rsquo;,
  4251. etc. Images will be rescaled to fit the new WxH values.
  4252. </p>
  4253. <p>If you want to extract just a limited number of frames, you can use the
  4254. above command in combination with the <code>-frames:v</code> or <code>-t</code> option,
  4255. or in combination with -ss to start extracting from a certain point in time.
  4256. </p>
  4257. <p>For creating a video from many images:
  4258. </p><div class="example">
  4259. <pre class="example">ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi
  4260. </pre></div>
  4261. <p>The syntax <code>foo-%03d.jpeg</code> specifies to use a decimal number
  4262. composed of three digits padded with zeroes to express the sequence
  4263. number. It is the same syntax supported by the C printf function, but
  4264. only formats accepting a normal integer are suitable.
  4265. </p>
  4266. <p>When importing an image sequence, -i also supports expanding
  4267. shell-like wildcard patterns (globbing) internally, by selecting the
  4268. image2-specific <code>-pattern_type glob</code> option.
  4269. </p>
  4270. <p>For example, for creating a video from filenames matching the glob pattern
  4271. <code>foo-*.jpeg</code>:
  4272. </p><div class="example">
  4273. <pre class="example">ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi
  4274. </pre></div>
  4275. </li><li>
  4276. You can put many streams of the same type in the output:
  4277. <div class="example">
  4278. <pre class="example">ffmpeg -i test1.avi -i test2.avi -map 1:1 -map 1:0 -map 0:1 -map 0:0 -c copy -y test12.nut
  4279. </pre></div>
  4280. <p>The resulting output file &lsquo;<tt>test12.nut</tt>&rsquo; will contain the first four streams
  4281. from the input files in reverse order.
  4282. </p>
  4283. </li><li>
  4284. To force CBR video output:
  4285. <div class="example">
  4286. <pre class="example">ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
  4287. </pre></div>
  4288. </li><li>
  4289. The four options lmin, lmax, mblmin and mblmax use &rsquo;lambda&rsquo; units,
  4290. but you may use the QP2LAMBDA constant to easily convert from &rsquo;q&rsquo; units:
  4291. <div class="example">
  4292. <pre class="example">ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
  4293. </pre></div>
  4294. </li></ul>
  4295. <a name="Syntax-1"></a>
  4296. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Syntax-1">7 Syntax</a></h1>
  4297. <p>This section documents the syntax and formats employed by the FFmpeg
  4298. libraries and tools.
  4299. </p>
  4300. <p><a name="quoting_005fand_005fescaping"></a>
  4301. </p><a name="Quoting-and-escaping"></a>
  4302. <h2 class="section"><a href="ffmpeg-all.html#toc-Quoting-and-escaping">7.1 Quoting and escaping</a></h2>
  4303. <p>FFmpeg adopts the following quoting and escaping mechanism, unless
  4304. explicitly specified. The following rules are applied:
  4305. </p>
  4306. <ul>
  4307. <li>
  4308. &lsquo;<samp>'</samp>&rsquo; and &lsquo;<samp>\</samp>&rsquo; are special characters (respectively used for
  4309. quoting and escaping). In addition to them, there might be other
  4310. special characters depending on the specific syntax where the escaping
  4311. and quoting are employed.
  4312. </li><li>
  4313. A special character is escaped by prefixing it with a &lsquo;<samp>\</samp>&rsquo;.
  4314. </li><li>
  4315. All characters enclosed between &lsquo;<samp>''</samp>&rsquo; are included literally in the
  4316. parsed string. The quote character &lsquo;<samp>'</samp>&rsquo; itself cannot be quoted,
  4317. so you may need to close the quote and escape it.
  4318. </li><li>
  4319. Leading and trailing whitespaces, unless escaped or quoted, are
  4320. removed from the parsed string.
  4321. </li></ul>
  4322. <p>Note that you may need to add a second level of escaping when using
  4323. the command line or a script, which depends on the syntax of the
  4324. adopted shell language.
  4325. </p>
  4326. <p>The function <code>av_get_token</code> defined in
  4327. &lsquo;<tt>libavutil/avstring.h</tt>&rsquo; can be used to parse a token quoted or
  4328. escaped according to the rules defined above.
  4329. </p>
  4330. <p>The tool &lsquo;<tt>tools/ffescape</tt>&rsquo; in the FFmpeg source tree can be used
  4331. to automatically quote or escape a string in a script.
  4332. </p>
  4333. <a name="Examples-35"></a>
  4334. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-35">7.1.1 Examples</a></h3>
  4335. <ul>
  4336. <li>
  4337. Escape the string <code>Crime d'Amour</code> containing the <code>'</code> special
  4338. character:
  4339. <div class="example">
  4340. <pre class="example">Crime d\'Amour
  4341. </pre></div>
  4342. </li><li>
  4343. The string above contains a quote, so the <code>'</code> needs to be escaped
  4344. when quoting it:
  4345. <div class="example">
  4346. <pre class="example">'Crime d'\''Amour'
  4347. </pre></div>
  4348. </li><li>
  4349. Include leading or trailing whitespaces using quoting:
  4350. <div class="example">
  4351. <pre class="example">' this string starts and ends with whitespaces '
  4352. </pre></div>
  4353. </li><li>
  4354. Escaping and quoting can be mixed together:
  4355. <div class="example">
  4356. <pre class="example">' The string '\'string\'' is a string '
  4357. </pre></div>
  4358. </li><li>
  4359. To include a literal &lsquo;<samp>\</samp>&rsquo; you can use either escaping or quoting:
  4360. <div class="example">
  4361. <pre class="example">'c:\foo' can be written as c:\\foo
  4362. </pre></div>
  4363. </li></ul>
  4364. <p><a name="date-syntax"></a>
  4365. </p><a name="Date"></a>
  4366. <h2 class="section"><a href="ffmpeg-all.html#toc-Date">7.2 Date</a></h2>
  4367. <p>The accepted syntax is:
  4368. </p><div class="example">
  4369. <pre class="example">[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
  4370. now
  4371. </pre></div>
  4372. <p>If the value is &quot;now&quot; it takes the current time.
  4373. </p>
  4374. <p>Time is local time unless Z is appended, in which case it is
  4375. interpreted as UTC.
  4376. If the year-month-day part is not specified it takes the current
  4377. year-month-day.
  4378. </p>
  4379. <p><a name="time-duration-syntax"></a>
  4380. </p><a name="Time-duration"></a>
  4381. <h2 class="section"><a href="ffmpeg-all.html#toc-Time-duration">7.3 Time duration</a></h2>
  4382. <p>There are two accepted syntaxes for expressing time duration.
  4383. </p>
  4384. <div class="example">
  4385. <pre class="example">[-][<var>HH</var>:]<var>MM</var>:<var>SS</var>[.<var>m</var>...]
  4386. </pre></div>
  4387. <p><var>HH</var> expresses the number of hours, <var>MM</var> the number of minutes
  4388. for a maximum of 2 digits, and <var>SS</var> the number of seconds for a
  4389. maximum of 2 digits. The <var>m</var> at the end expresses decimal value for
  4390. <var>SS</var>.
  4391. </p>
  4392. <p><em>or</em>
  4393. </p>
  4394. <div class="example">
  4395. <pre class="example">[-]<var>S</var>+[.<var>m</var>...]
  4396. </pre></div>
  4397. <p><var>S</var> expresses the number of seconds, with the optional decimal part
  4398. <var>m</var>.
  4399. </p>
  4400. <p>In both expressions, the optional &lsquo;<samp>-</samp>&rsquo; indicates negative duration.
  4401. </p>
  4402. <a name="Examples-98"></a>
  4403. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-98">7.3.1 Examples</a></h3>
  4404. <p>The following examples are all valid time duration:
  4405. </p>
  4406. <dl compact="compact">
  4407. <dt>&lsquo;<samp>55</samp>&rsquo;</dt>
  4408. <dd><p>55 seconds
  4409. </p>
  4410. </dd>
  4411. <dt>&lsquo;<samp>12:03:45</samp>&rsquo;</dt>
  4412. <dd><p>12 hours, 03 minutes and 45 seconds
  4413. </p>
  4414. </dd>
  4415. <dt>&lsquo;<samp>23.189</samp>&rsquo;</dt>
  4416. <dd><p>23.189 seconds
  4417. </p></dd>
  4418. </dl>
  4419. <p><a name="video-size-syntax"></a>
  4420. </p><a name="Video-size"></a>
  4421. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-size">7.4 Video size</a></h2>
  4422. <p>Specify the size of the sourced video, it may be a string of the form
  4423. <var>width</var>x<var>height</var>, or the name of a size abbreviation.
  4424. </p>
  4425. <p>The following abbreviations are recognized:
  4426. </p><dl compact="compact">
  4427. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  4428. <dd><p>720x480
  4429. </p></dd>
  4430. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  4431. <dd><p>720x576
  4432. </p></dd>
  4433. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  4434. <dd><p>352x240
  4435. </p></dd>
  4436. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  4437. <dd><p>352x288
  4438. </p></dd>
  4439. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  4440. <dd><p>640x480
  4441. </p></dd>
  4442. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  4443. <dd><p>768x576
  4444. </p></dd>
  4445. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  4446. <dd><p>352x240
  4447. </p></dd>
  4448. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  4449. <dd><p>352x240
  4450. </p></dd>
  4451. <dt>&lsquo;<samp>sqcif</samp>&rsquo;</dt>
  4452. <dd><p>128x96
  4453. </p></dd>
  4454. <dt>&lsquo;<samp>qcif</samp>&rsquo;</dt>
  4455. <dd><p>176x144
  4456. </p></dd>
  4457. <dt>&lsquo;<samp>cif</samp>&rsquo;</dt>
  4458. <dd><p>352x288
  4459. </p></dd>
  4460. <dt>&lsquo;<samp>4cif</samp>&rsquo;</dt>
  4461. <dd><p>704x576
  4462. </p></dd>
  4463. <dt>&lsquo;<samp>16cif</samp>&rsquo;</dt>
  4464. <dd><p>1408x1152
  4465. </p></dd>
  4466. <dt>&lsquo;<samp>qqvga</samp>&rsquo;</dt>
  4467. <dd><p>160x120
  4468. </p></dd>
  4469. <dt>&lsquo;<samp>qvga</samp>&rsquo;</dt>
  4470. <dd><p>320x240
  4471. </p></dd>
  4472. <dt>&lsquo;<samp>vga</samp>&rsquo;</dt>
  4473. <dd><p>640x480
  4474. </p></dd>
  4475. <dt>&lsquo;<samp>svga</samp>&rsquo;</dt>
  4476. <dd><p>800x600
  4477. </p></dd>
  4478. <dt>&lsquo;<samp>xga</samp>&rsquo;</dt>
  4479. <dd><p>1024x768
  4480. </p></dd>
  4481. <dt>&lsquo;<samp>uxga</samp>&rsquo;</dt>
  4482. <dd><p>1600x1200
  4483. </p></dd>
  4484. <dt>&lsquo;<samp>qxga</samp>&rsquo;</dt>
  4485. <dd><p>2048x1536
  4486. </p></dd>
  4487. <dt>&lsquo;<samp>sxga</samp>&rsquo;</dt>
  4488. <dd><p>1280x1024
  4489. </p></dd>
  4490. <dt>&lsquo;<samp>qsxga</samp>&rsquo;</dt>
  4491. <dd><p>2560x2048
  4492. </p></dd>
  4493. <dt>&lsquo;<samp>hsxga</samp>&rsquo;</dt>
  4494. <dd><p>5120x4096
  4495. </p></dd>
  4496. <dt>&lsquo;<samp>wvga</samp>&rsquo;</dt>
  4497. <dd><p>852x480
  4498. </p></dd>
  4499. <dt>&lsquo;<samp>wxga</samp>&rsquo;</dt>
  4500. <dd><p>1366x768
  4501. </p></dd>
  4502. <dt>&lsquo;<samp>wsxga</samp>&rsquo;</dt>
  4503. <dd><p>1600x1024
  4504. </p></dd>
  4505. <dt>&lsquo;<samp>wuxga</samp>&rsquo;</dt>
  4506. <dd><p>1920x1200
  4507. </p></dd>
  4508. <dt>&lsquo;<samp>woxga</samp>&rsquo;</dt>
  4509. <dd><p>2560x1600
  4510. </p></dd>
  4511. <dt>&lsquo;<samp>wqsxga</samp>&rsquo;</dt>
  4512. <dd><p>3200x2048
  4513. </p></dd>
  4514. <dt>&lsquo;<samp>wquxga</samp>&rsquo;</dt>
  4515. <dd><p>3840x2400
  4516. </p></dd>
  4517. <dt>&lsquo;<samp>whsxga</samp>&rsquo;</dt>
  4518. <dd><p>6400x4096
  4519. </p></dd>
  4520. <dt>&lsquo;<samp>whuxga</samp>&rsquo;</dt>
  4521. <dd><p>7680x4800
  4522. </p></dd>
  4523. <dt>&lsquo;<samp>cga</samp>&rsquo;</dt>
  4524. <dd><p>320x200
  4525. </p></dd>
  4526. <dt>&lsquo;<samp>ega</samp>&rsquo;</dt>
  4527. <dd><p>640x350
  4528. </p></dd>
  4529. <dt>&lsquo;<samp>hd480</samp>&rsquo;</dt>
  4530. <dd><p>852x480
  4531. </p></dd>
  4532. <dt>&lsquo;<samp>hd720</samp>&rsquo;</dt>
  4533. <dd><p>1280x720
  4534. </p></dd>
  4535. <dt>&lsquo;<samp>hd1080</samp>&rsquo;</dt>
  4536. <dd><p>1920x1080
  4537. </p></dd>
  4538. <dt>&lsquo;<samp>2k</samp>&rsquo;</dt>
  4539. <dd><p>2048x1080
  4540. </p></dd>
  4541. <dt>&lsquo;<samp>2kflat</samp>&rsquo;</dt>
  4542. <dd><p>1998x1080
  4543. </p></dd>
  4544. <dt>&lsquo;<samp>2kscope</samp>&rsquo;</dt>
  4545. <dd><p>2048x858
  4546. </p></dd>
  4547. <dt>&lsquo;<samp>4k</samp>&rsquo;</dt>
  4548. <dd><p>4096x2160
  4549. </p></dd>
  4550. <dt>&lsquo;<samp>4kflat</samp>&rsquo;</dt>
  4551. <dd><p>3996x2160
  4552. </p></dd>
  4553. <dt>&lsquo;<samp>4kscope</samp>&rsquo;</dt>
  4554. <dd><p>4096x1716
  4555. </p></dd>
  4556. <dt>&lsquo;<samp>nhd</samp>&rsquo;</dt>
  4557. <dd><p>640x360
  4558. </p></dd>
  4559. <dt>&lsquo;<samp>hqvga</samp>&rsquo;</dt>
  4560. <dd><p>240x160
  4561. </p></dd>
  4562. <dt>&lsquo;<samp>wqvga</samp>&rsquo;</dt>
  4563. <dd><p>400x240
  4564. </p></dd>
  4565. <dt>&lsquo;<samp>fwqvga</samp>&rsquo;</dt>
  4566. <dd><p>432x240
  4567. </p></dd>
  4568. <dt>&lsquo;<samp>hvga</samp>&rsquo;</dt>
  4569. <dd><p>480x320
  4570. </p></dd>
  4571. <dt>&lsquo;<samp>qhd</samp>&rsquo;</dt>
  4572. <dd><p>960x540
  4573. </p></dd>
  4574. <dt>&lsquo;<samp>2kdci</samp>&rsquo;</dt>
  4575. <dd><p>2048x1080
  4576. </p></dd>
  4577. <dt>&lsquo;<samp>4kdci</samp>&rsquo;</dt>
  4578. <dd><p>4096x2160
  4579. </p></dd>
  4580. <dt>&lsquo;<samp>uhd2160</samp>&rsquo;</dt>
  4581. <dd><p>3840x2160
  4582. </p></dd>
  4583. <dt>&lsquo;<samp>uhd4320</samp>&rsquo;</dt>
  4584. <dd><p>7680x4320
  4585. </p></dd>
  4586. </dl>
  4587. <p><a name="video-rate-syntax"></a>
  4588. </p><a name="Video-rate"></a>
  4589. <h2 class="section"><a href="ffmpeg-all.html#toc-Video-rate">7.5 Video rate</a></h2>
  4590. <p>Specify the frame rate of a video, expressed as the number of frames
  4591. generated per second. It has to be a string in the format
  4592. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a float
  4593. number or a valid video frame rate abbreviation.
  4594. </p>
  4595. <p>The following abbreviations are recognized:
  4596. </p><dl compact="compact">
  4597. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  4598. <dd><p>30000/1001
  4599. </p></dd>
  4600. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  4601. <dd><p>25/1
  4602. </p></dd>
  4603. <dt>&lsquo;<samp>qntsc</samp>&rsquo;</dt>
  4604. <dd><p>30000/1001
  4605. </p></dd>
  4606. <dt>&lsquo;<samp>qpal</samp>&rsquo;</dt>
  4607. <dd><p>25/1
  4608. </p></dd>
  4609. <dt>&lsquo;<samp>sntsc</samp>&rsquo;</dt>
  4610. <dd><p>30000/1001
  4611. </p></dd>
  4612. <dt>&lsquo;<samp>spal</samp>&rsquo;</dt>
  4613. <dd><p>25/1
  4614. </p></dd>
  4615. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  4616. <dd><p>24/1
  4617. </p></dd>
  4618. <dt>&lsquo;<samp>ntsc-film</samp>&rsquo;</dt>
  4619. <dd><p>24000/1001
  4620. </p></dd>
  4621. </dl>
  4622. <p><a name="ratio-syntax"></a>
  4623. </p><a name="Ratio"></a>
  4624. <h2 class="section"><a href="ffmpeg-all.html#toc-Ratio">7.6 Ratio</a></h2>
  4625. <p>A ratio can be expressed as an expression, or in the form
  4626. <var>numerator</var>:<var>denominator</var>.
  4627. </p>
  4628. <p>Note that a ratio with infinite (1/0) or negative value is
  4629. considered valid, so you should check on the returned value if you
  4630. want to exclude those values.
  4631. </p>
  4632. <p>The undefined value can be expressed using the &quot;0:0&quot; string.
  4633. </p>
  4634. <p><a name="color-syntax"></a>
  4635. </p><a name="Color"></a>
  4636. <h2 class="section"><a href="ffmpeg-all.html#toc-Color">7.7 Color</a></h2>
  4637. <p>It can be the name of a color as defined below (case insensitive match) or a
  4638. <code>[0x|#]RRGGBB[AA]</code> sequence, possibly followed by @ and a string
  4639. representing the alpha component.
  4640. </p>
  4641. <p>The alpha component may be a string composed by &quot;0x&quot; followed by an
  4642. hexadecimal number or a decimal number between 0.0 and 1.0, which
  4643. represents the opacity value (&lsquo;<samp>0x00</samp>&rsquo; or &lsquo;<samp>0.0</samp>&rsquo; means completely
  4644. transparent, &lsquo;<samp>0xff</samp>&rsquo; or &lsquo;<samp>1.0</samp>&rsquo; completely opaque). If the alpha
  4645. component is not specified then &lsquo;<samp>0xff</samp>&rsquo; is assumed.
  4646. </p>
  4647. <p>The string &lsquo;<samp>random</samp>&rsquo; will result in a random color.
  4648. </p>
  4649. <p>The following names of colors are recognized:
  4650. </p><dl compact="compact">
  4651. <dt>&lsquo;<samp>AliceBlue</samp>&rsquo;</dt>
  4652. <dd><p>0xF0F8FF
  4653. </p></dd>
  4654. <dt>&lsquo;<samp>AntiqueWhite</samp>&rsquo;</dt>
  4655. <dd><p>0xFAEBD7
  4656. </p></dd>
  4657. <dt>&lsquo;<samp>Aqua</samp>&rsquo;</dt>
  4658. <dd><p>0x00FFFF
  4659. </p></dd>
  4660. <dt>&lsquo;<samp>Aquamarine</samp>&rsquo;</dt>
  4661. <dd><p>0x7FFFD4
  4662. </p></dd>
  4663. <dt>&lsquo;<samp>Azure</samp>&rsquo;</dt>
  4664. <dd><p>0xF0FFFF
  4665. </p></dd>
  4666. <dt>&lsquo;<samp>Beige</samp>&rsquo;</dt>
  4667. <dd><p>0xF5F5DC
  4668. </p></dd>
  4669. <dt>&lsquo;<samp>Bisque</samp>&rsquo;</dt>
  4670. <dd><p>0xFFE4C4
  4671. </p></dd>
  4672. <dt>&lsquo;<samp>Black</samp>&rsquo;</dt>
  4673. <dd><p>0x000000
  4674. </p></dd>
  4675. <dt>&lsquo;<samp>BlanchedAlmond</samp>&rsquo;</dt>
  4676. <dd><p>0xFFEBCD
  4677. </p></dd>
  4678. <dt>&lsquo;<samp>Blue</samp>&rsquo;</dt>
  4679. <dd><p>0x0000FF
  4680. </p></dd>
  4681. <dt>&lsquo;<samp>BlueViolet</samp>&rsquo;</dt>
  4682. <dd><p>0x8A2BE2
  4683. </p></dd>
  4684. <dt>&lsquo;<samp>Brown</samp>&rsquo;</dt>
  4685. <dd><p>0xA52A2A
  4686. </p></dd>
  4687. <dt>&lsquo;<samp>BurlyWood</samp>&rsquo;</dt>
  4688. <dd><p>0xDEB887
  4689. </p></dd>
  4690. <dt>&lsquo;<samp>CadetBlue</samp>&rsquo;</dt>
  4691. <dd><p>0x5F9EA0
  4692. </p></dd>
  4693. <dt>&lsquo;<samp>Chartreuse</samp>&rsquo;</dt>
  4694. <dd><p>0x7FFF00
  4695. </p></dd>
  4696. <dt>&lsquo;<samp>Chocolate</samp>&rsquo;</dt>
  4697. <dd><p>0xD2691E
  4698. </p></dd>
  4699. <dt>&lsquo;<samp>Coral</samp>&rsquo;</dt>
  4700. <dd><p>0xFF7F50
  4701. </p></dd>
  4702. <dt>&lsquo;<samp>CornflowerBlue</samp>&rsquo;</dt>
  4703. <dd><p>0x6495ED
  4704. </p></dd>
  4705. <dt>&lsquo;<samp>Cornsilk</samp>&rsquo;</dt>
  4706. <dd><p>0xFFF8DC
  4707. </p></dd>
  4708. <dt>&lsquo;<samp>Crimson</samp>&rsquo;</dt>
  4709. <dd><p>0xDC143C
  4710. </p></dd>
  4711. <dt>&lsquo;<samp>Cyan</samp>&rsquo;</dt>
  4712. <dd><p>0x00FFFF
  4713. </p></dd>
  4714. <dt>&lsquo;<samp>DarkBlue</samp>&rsquo;</dt>
  4715. <dd><p>0x00008B
  4716. </p></dd>
  4717. <dt>&lsquo;<samp>DarkCyan</samp>&rsquo;</dt>
  4718. <dd><p>0x008B8B
  4719. </p></dd>
  4720. <dt>&lsquo;<samp>DarkGoldenRod</samp>&rsquo;</dt>
  4721. <dd><p>0xB8860B
  4722. </p></dd>
  4723. <dt>&lsquo;<samp>DarkGray</samp>&rsquo;</dt>
  4724. <dd><p>0xA9A9A9
  4725. </p></dd>
  4726. <dt>&lsquo;<samp>DarkGreen</samp>&rsquo;</dt>
  4727. <dd><p>0x006400
  4728. </p></dd>
  4729. <dt>&lsquo;<samp>DarkKhaki</samp>&rsquo;</dt>
  4730. <dd><p>0xBDB76B
  4731. </p></dd>
  4732. <dt>&lsquo;<samp>DarkMagenta</samp>&rsquo;</dt>
  4733. <dd><p>0x8B008B
  4734. </p></dd>
  4735. <dt>&lsquo;<samp>DarkOliveGreen</samp>&rsquo;</dt>
  4736. <dd><p>0x556B2F
  4737. </p></dd>
  4738. <dt>&lsquo;<samp>Darkorange</samp>&rsquo;</dt>
  4739. <dd><p>0xFF8C00
  4740. </p></dd>
  4741. <dt>&lsquo;<samp>DarkOrchid</samp>&rsquo;</dt>
  4742. <dd><p>0x9932CC
  4743. </p></dd>
  4744. <dt>&lsquo;<samp>DarkRed</samp>&rsquo;</dt>
  4745. <dd><p>0x8B0000
  4746. </p></dd>
  4747. <dt>&lsquo;<samp>DarkSalmon</samp>&rsquo;</dt>
  4748. <dd><p>0xE9967A
  4749. </p></dd>
  4750. <dt>&lsquo;<samp>DarkSeaGreen</samp>&rsquo;</dt>
  4751. <dd><p>0x8FBC8F
  4752. </p></dd>
  4753. <dt>&lsquo;<samp>DarkSlateBlue</samp>&rsquo;</dt>
  4754. <dd><p>0x483D8B
  4755. </p></dd>
  4756. <dt>&lsquo;<samp>DarkSlateGray</samp>&rsquo;</dt>
  4757. <dd><p>0x2F4F4F
  4758. </p></dd>
  4759. <dt>&lsquo;<samp>DarkTurquoise</samp>&rsquo;</dt>
  4760. <dd><p>0x00CED1
  4761. </p></dd>
  4762. <dt>&lsquo;<samp>DarkViolet</samp>&rsquo;</dt>
  4763. <dd><p>0x9400D3
  4764. </p></dd>
  4765. <dt>&lsquo;<samp>DeepPink</samp>&rsquo;</dt>
  4766. <dd><p>0xFF1493
  4767. </p></dd>
  4768. <dt>&lsquo;<samp>DeepSkyBlue</samp>&rsquo;</dt>
  4769. <dd><p>0x00BFFF
  4770. </p></dd>
  4771. <dt>&lsquo;<samp>DimGray</samp>&rsquo;</dt>
  4772. <dd><p>0x696969
  4773. </p></dd>
  4774. <dt>&lsquo;<samp>DodgerBlue</samp>&rsquo;</dt>
  4775. <dd><p>0x1E90FF
  4776. </p></dd>
  4777. <dt>&lsquo;<samp>FireBrick</samp>&rsquo;</dt>
  4778. <dd><p>0xB22222
  4779. </p></dd>
  4780. <dt>&lsquo;<samp>FloralWhite</samp>&rsquo;</dt>
  4781. <dd><p>0xFFFAF0
  4782. </p></dd>
  4783. <dt>&lsquo;<samp>ForestGreen</samp>&rsquo;</dt>
  4784. <dd><p>0x228B22
  4785. </p></dd>
  4786. <dt>&lsquo;<samp>Fuchsia</samp>&rsquo;</dt>
  4787. <dd><p>0xFF00FF
  4788. </p></dd>
  4789. <dt>&lsquo;<samp>Gainsboro</samp>&rsquo;</dt>
  4790. <dd><p>0xDCDCDC
  4791. </p></dd>
  4792. <dt>&lsquo;<samp>GhostWhite</samp>&rsquo;</dt>
  4793. <dd><p>0xF8F8FF
  4794. </p></dd>
  4795. <dt>&lsquo;<samp>Gold</samp>&rsquo;</dt>
  4796. <dd><p>0xFFD700
  4797. </p></dd>
  4798. <dt>&lsquo;<samp>GoldenRod</samp>&rsquo;</dt>
  4799. <dd><p>0xDAA520
  4800. </p></dd>
  4801. <dt>&lsquo;<samp>Gray</samp>&rsquo;</dt>
  4802. <dd><p>0x808080
  4803. </p></dd>
  4804. <dt>&lsquo;<samp>Green</samp>&rsquo;</dt>
  4805. <dd><p>0x008000
  4806. </p></dd>
  4807. <dt>&lsquo;<samp>GreenYellow</samp>&rsquo;</dt>
  4808. <dd><p>0xADFF2F
  4809. </p></dd>
  4810. <dt>&lsquo;<samp>HoneyDew</samp>&rsquo;</dt>
  4811. <dd><p>0xF0FFF0
  4812. </p></dd>
  4813. <dt>&lsquo;<samp>HotPink</samp>&rsquo;</dt>
  4814. <dd><p>0xFF69B4
  4815. </p></dd>
  4816. <dt>&lsquo;<samp>IndianRed</samp>&rsquo;</dt>
  4817. <dd><p>0xCD5C5C
  4818. </p></dd>
  4819. <dt>&lsquo;<samp>Indigo</samp>&rsquo;</dt>
  4820. <dd><p>0x4B0082
  4821. </p></dd>
  4822. <dt>&lsquo;<samp>Ivory</samp>&rsquo;</dt>
  4823. <dd><p>0xFFFFF0
  4824. </p></dd>
  4825. <dt>&lsquo;<samp>Khaki</samp>&rsquo;</dt>
  4826. <dd><p>0xF0E68C
  4827. </p></dd>
  4828. <dt>&lsquo;<samp>Lavender</samp>&rsquo;</dt>
  4829. <dd><p>0xE6E6FA
  4830. </p></dd>
  4831. <dt>&lsquo;<samp>LavenderBlush</samp>&rsquo;</dt>
  4832. <dd><p>0xFFF0F5
  4833. </p></dd>
  4834. <dt>&lsquo;<samp>LawnGreen</samp>&rsquo;</dt>
  4835. <dd><p>0x7CFC00
  4836. </p></dd>
  4837. <dt>&lsquo;<samp>LemonChiffon</samp>&rsquo;</dt>
  4838. <dd><p>0xFFFACD
  4839. </p></dd>
  4840. <dt>&lsquo;<samp>LightBlue</samp>&rsquo;</dt>
  4841. <dd><p>0xADD8E6
  4842. </p></dd>
  4843. <dt>&lsquo;<samp>LightCoral</samp>&rsquo;</dt>
  4844. <dd><p>0xF08080
  4845. </p></dd>
  4846. <dt>&lsquo;<samp>LightCyan</samp>&rsquo;</dt>
  4847. <dd><p>0xE0FFFF
  4848. </p></dd>
  4849. <dt>&lsquo;<samp>LightGoldenRodYellow</samp>&rsquo;</dt>
  4850. <dd><p>0xFAFAD2
  4851. </p></dd>
  4852. <dt>&lsquo;<samp>LightGreen</samp>&rsquo;</dt>
  4853. <dd><p>0x90EE90
  4854. </p></dd>
  4855. <dt>&lsquo;<samp>LightGrey</samp>&rsquo;</dt>
  4856. <dd><p>0xD3D3D3
  4857. </p></dd>
  4858. <dt>&lsquo;<samp>LightPink</samp>&rsquo;</dt>
  4859. <dd><p>0xFFB6C1
  4860. </p></dd>
  4861. <dt>&lsquo;<samp>LightSalmon</samp>&rsquo;</dt>
  4862. <dd><p>0xFFA07A
  4863. </p></dd>
  4864. <dt>&lsquo;<samp>LightSeaGreen</samp>&rsquo;</dt>
  4865. <dd><p>0x20B2AA
  4866. </p></dd>
  4867. <dt>&lsquo;<samp>LightSkyBlue</samp>&rsquo;</dt>
  4868. <dd><p>0x87CEFA
  4869. </p></dd>
  4870. <dt>&lsquo;<samp>LightSlateGray</samp>&rsquo;</dt>
  4871. <dd><p>0x778899
  4872. </p></dd>
  4873. <dt>&lsquo;<samp>LightSteelBlue</samp>&rsquo;</dt>
  4874. <dd><p>0xB0C4DE
  4875. </p></dd>
  4876. <dt>&lsquo;<samp>LightYellow</samp>&rsquo;</dt>
  4877. <dd><p>0xFFFFE0
  4878. </p></dd>
  4879. <dt>&lsquo;<samp>Lime</samp>&rsquo;</dt>
  4880. <dd><p>0x00FF00
  4881. </p></dd>
  4882. <dt>&lsquo;<samp>LimeGreen</samp>&rsquo;</dt>
  4883. <dd><p>0x32CD32
  4884. </p></dd>
  4885. <dt>&lsquo;<samp>Linen</samp>&rsquo;</dt>
  4886. <dd><p>0xFAF0E6
  4887. </p></dd>
  4888. <dt>&lsquo;<samp>Magenta</samp>&rsquo;</dt>
  4889. <dd><p>0xFF00FF
  4890. </p></dd>
  4891. <dt>&lsquo;<samp>Maroon</samp>&rsquo;</dt>
  4892. <dd><p>0x800000
  4893. </p></dd>
  4894. <dt>&lsquo;<samp>MediumAquaMarine</samp>&rsquo;</dt>
  4895. <dd><p>0x66CDAA
  4896. </p></dd>
  4897. <dt>&lsquo;<samp>MediumBlue</samp>&rsquo;</dt>
  4898. <dd><p>0x0000CD
  4899. </p></dd>
  4900. <dt>&lsquo;<samp>MediumOrchid</samp>&rsquo;</dt>
  4901. <dd><p>0xBA55D3
  4902. </p></dd>
  4903. <dt>&lsquo;<samp>MediumPurple</samp>&rsquo;</dt>
  4904. <dd><p>0x9370D8
  4905. </p></dd>
  4906. <dt>&lsquo;<samp>MediumSeaGreen</samp>&rsquo;</dt>
  4907. <dd><p>0x3CB371
  4908. </p></dd>
  4909. <dt>&lsquo;<samp>MediumSlateBlue</samp>&rsquo;</dt>
  4910. <dd><p>0x7B68EE
  4911. </p></dd>
  4912. <dt>&lsquo;<samp>MediumSpringGreen</samp>&rsquo;</dt>
  4913. <dd><p>0x00FA9A
  4914. </p></dd>
  4915. <dt>&lsquo;<samp>MediumTurquoise</samp>&rsquo;</dt>
  4916. <dd><p>0x48D1CC
  4917. </p></dd>
  4918. <dt>&lsquo;<samp>MediumVioletRed</samp>&rsquo;</dt>
  4919. <dd><p>0xC71585
  4920. </p></dd>
  4921. <dt>&lsquo;<samp>MidnightBlue</samp>&rsquo;</dt>
  4922. <dd><p>0x191970
  4923. </p></dd>
  4924. <dt>&lsquo;<samp>MintCream</samp>&rsquo;</dt>
  4925. <dd><p>0xF5FFFA
  4926. </p></dd>
  4927. <dt>&lsquo;<samp>MistyRose</samp>&rsquo;</dt>
  4928. <dd><p>0xFFE4E1
  4929. </p></dd>
  4930. <dt>&lsquo;<samp>Moccasin</samp>&rsquo;</dt>
  4931. <dd><p>0xFFE4B5
  4932. </p></dd>
  4933. <dt>&lsquo;<samp>NavajoWhite</samp>&rsquo;</dt>
  4934. <dd><p>0xFFDEAD
  4935. </p></dd>
  4936. <dt>&lsquo;<samp>Navy</samp>&rsquo;</dt>
  4937. <dd><p>0x000080
  4938. </p></dd>
  4939. <dt>&lsquo;<samp>OldLace</samp>&rsquo;</dt>
  4940. <dd><p>0xFDF5E6
  4941. </p></dd>
  4942. <dt>&lsquo;<samp>Olive</samp>&rsquo;</dt>
  4943. <dd><p>0x808000
  4944. </p></dd>
  4945. <dt>&lsquo;<samp>OliveDrab</samp>&rsquo;</dt>
  4946. <dd><p>0x6B8E23
  4947. </p></dd>
  4948. <dt>&lsquo;<samp>Orange</samp>&rsquo;</dt>
  4949. <dd><p>0xFFA500
  4950. </p></dd>
  4951. <dt>&lsquo;<samp>OrangeRed</samp>&rsquo;</dt>
  4952. <dd><p>0xFF4500
  4953. </p></dd>
  4954. <dt>&lsquo;<samp>Orchid</samp>&rsquo;</dt>
  4955. <dd><p>0xDA70D6
  4956. </p></dd>
  4957. <dt>&lsquo;<samp>PaleGoldenRod</samp>&rsquo;</dt>
  4958. <dd><p>0xEEE8AA
  4959. </p></dd>
  4960. <dt>&lsquo;<samp>PaleGreen</samp>&rsquo;</dt>
  4961. <dd><p>0x98FB98
  4962. </p></dd>
  4963. <dt>&lsquo;<samp>PaleTurquoise</samp>&rsquo;</dt>
  4964. <dd><p>0xAFEEEE
  4965. </p></dd>
  4966. <dt>&lsquo;<samp>PaleVioletRed</samp>&rsquo;</dt>
  4967. <dd><p>0xD87093
  4968. </p></dd>
  4969. <dt>&lsquo;<samp>PapayaWhip</samp>&rsquo;</dt>
  4970. <dd><p>0xFFEFD5
  4971. </p></dd>
  4972. <dt>&lsquo;<samp>PeachPuff</samp>&rsquo;</dt>
  4973. <dd><p>0xFFDAB9
  4974. </p></dd>
  4975. <dt>&lsquo;<samp>Peru</samp>&rsquo;</dt>
  4976. <dd><p>0xCD853F
  4977. </p></dd>
  4978. <dt>&lsquo;<samp>Pink</samp>&rsquo;</dt>
  4979. <dd><p>0xFFC0CB
  4980. </p></dd>
  4981. <dt>&lsquo;<samp>Plum</samp>&rsquo;</dt>
  4982. <dd><p>0xDDA0DD
  4983. </p></dd>
  4984. <dt>&lsquo;<samp>PowderBlue</samp>&rsquo;</dt>
  4985. <dd><p>0xB0E0E6
  4986. </p></dd>
  4987. <dt>&lsquo;<samp>Purple</samp>&rsquo;</dt>
  4988. <dd><p>0x800080
  4989. </p></dd>
  4990. <dt>&lsquo;<samp>Red</samp>&rsquo;</dt>
  4991. <dd><p>0xFF0000
  4992. </p></dd>
  4993. <dt>&lsquo;<samp>RosyBrown</samp>&rsquo;</dt>
  4994. <dd><p>0xBC8F8F
  4995. </p></dd>
  4996. <dt>&lsquo;<samp>RoyalBlue</samp>&rsquo;</dt>
  4997. <dd><p>0x4169E1
  4998. </p></dd>
  4999. <dt>&lsquo;<samp>SaddleBrown</samp>&rsquo;</dt>
  5000. <dd><p>0x8B4513
  5001. </p></dd>
  5002. <dt>&lsquo;<samp>Salmon</samp>&rsquo;</dt>
  5003. <dd><p>0xFA8072
  5004. </p></dd>
  5005. <dt>&lsquo;<samp>SandyBrown</samp>&rsquo;</dt>
  5006. <dd><p>0xF4A460
  5007. </p></dd>
  5008. <dt>&lsquo;<samp>SeaGreen</samp>&rsquo;</dt>
  5009. <dd><p>0x2E8B57
  5010. </p></dd>
  5011. <dt>&lsquo;<samp>SeaShell</samp>&rsquo;</dt>
  5012. <dd><p>0xFFF5EE
  5013. </p></dd>
  5014. <dt>&lsquo;<samp>Sienna</samp>&rsquo;</dt>
  5015. <dd><p>0xA0522D
  5016. </p></dd>
  5017. <dt>&lsquo;<samp>Silver</samp>&rsquo;</dt>
  5018. <dd><p>0xC0C0C0
  5019. </p></dd>
  5020. <dt>&lsquo;<samp>SkyBlue</samp>&rsquo;</dt>
  5021. <dd><p>0x87CEEB
  5022. </p></dd>
  5023. <dt>&lsquo;<samp>SlateBlue</samp>&rsquo;</dt>
  5024. <dd><p>0x6A5ACD
  5025. </p></dd>
  5026. <dt>&lsquo;<samp>SlateGray</samp>&rsquo;</dt>
  5027. <dd><p>0x708090
  5028. </p></dd>
  5029. <dt>&lsquo;<samp>Snow</samp>&rsquo;</dt>
  5030. <dd><p>0xFFFAFA
  5031. </p></dd>
  5032. <dt>&lsquo;<samp>SpringGreen</samp>&rsquo;</dt>
  5033. <dd><p>0x00FF7F
  5034. </p></dd>
  5035. <dt>&lsquo;<samp>SteelBlue</samp>&rsquo;</dt>
  5036. <dd><p>0x4682B4
  5037. </p></dd>
  5038. <dt>&lsquo;<samp>Tan</samp>&rsquo;</dt>
  5039. <dd><p>0xD2B48C
  5040. </p></dd>
  5041. <dt>&lsquo;<samp>Teal</samp>&rsquo;</dt>
  5042. <dd><p>0x008080
  5043. </p></dd>
  5044. <dt>&lsquo;<samp>Thistle</samp>&rsquo;</dt>
  5045. <dd><p>0xD8BFD8
  5046. </p></dd>
  5047. <dt>&lsquo;<samp>Tomato</samp>&rsquo;</dt>
  5048. <dd><p>0xFF6347
  5049. </p></dd>
  5050. <dt>&lsquo;<samp>Turquoise</samp>&rsquo;</dt>
  5051. <dd><p>0x40E0D0
  5052. </p></dd>
  5053. <dt>&lsquo;<samp>Violet</samp>&rsquo;</dt>
  5054. <dd><p>0xEE82EE
  5055. </p></dd>
  5056. <dt>&lsquo;<samp>Wheat</samp>&rsquo;</dt>
  5057. <dd><p>0xF5DEB3
  5058. </p></dd>
  5059. <dt>&lsquo;<samp>White</samp>&rsquo;</dt>
  5060. <dd><p>0xFFFFFF
  5061. </p></dd>
  5062. <dt>&lsquo;<samp>WhiteSmoke</samp>&rsquo;</dt>
  5063. <dd><p>0xF5F5F5
  5064. </p></dd>
  5065. <dt>&lsquo;<samp>Yellow</samp>&rsquo;</dt>
  5066. <dd><p>0xFFFF00
  5067. </p></dd>
  5068. <dt>&lsquo;<samp>YellowGreen</samp>&rsquo;</dt>
  5069. <dd><p>0x9ACD32
  5070. </p></dd>
  5071. </dl>
  5072. <p><a name="channel-layout-syntax"></a>
  5073. </p><a name="Channel-Layout"></a>
  5074. <h2 class="section"><a href="ffmpeg-all.html#toc-Channel-Layout">7.8 Channel Layout</a></h2>
  5075. <p>A channel layout specifies the spatial disposition of the channels in
  5076. a multi-channel audio stream. To specify a channel layout, FFmpeg
  5077. makes use of a special syntax.
  5078. </p>
  5079. <p>Individual channels are identified by an id, as given by the table
  5080. below:
  5081. </p><dl compact="compact">
  5082. <dt>&lsquo;<samp>FL</samp>&rsquo;</dt>
  5083. <dd><p>front left
  5084. </p></dd>
  5085. <dt>&lsquo;<samp>FR</samp>&rsquo;</dt>
  5086. <dd><p>front right
  5087. </p></dd>
  5088. <dt>&lsquo;<samp>FC</samp>&rsquo;</dt>
  5089. <dd><p>front center
  5090. </p></dd>
  5091. <dt>&lsquo;<samp>LFE</samp>&rsquo;</dt>
  5092. <dd><p>low frequency
  5093. </p></dd>
  5094. <dt>&lsquo;<samp>BL</samp>&rsquo;</dt>
  5095. <dd><p>back left
  5096. </p></dd>
  5097. <dt>&lsquo;<samp>BR</samp>&rsquo;</dt>
  5098. <dd><p>back right
  5099. </p></dd>
  5100. <dt>&lsquo;<samp>FLC</samp>&rsquo;</dt>
  5101. <dd><p>front left-of-center
  5102. </p></dd>
  5103. <dt>&lsquo;<samp>FRC</samp>&rsquo;</dt>
  5104. <dd><p>front right-of-center
  5105. </p></dd>
  5106. <dt>&lsquo;<samp>BC</samp>&rsquo;</dt>
  5107. <dd><p>back center
  5108. </p></dd>
  5109. <dt>&lsquo;<samp>SL</samp>&rsquo;</dt>
  5110. <dd><p>side left
  5111. </p></dd>
  5112. <dt>&lsquo;<samp>SR</samp>&rsquo;</dt>
  5113. <dd><p>side right
  5114. </p></dd>
  5115. <dt>&lsquo;<samp>TC</samp>&rsquo;</dt>
  5116. <dd><p>top center
  5117. </p></dd>
  5118. <dt>&lsquo;<samp>TFL</samp>&rsquo;</dt>
  5119. <dd><p>top front left
  5120. </p></dd>
  5121. <dt>&lsquo;<samp>TFC</samp>&rsquo;</dt>
  5122. <dd><p>top front center
  5123. </p></dd>
  5124. <dt>&lsquo;<samp>TFR</samp>&rsquo;</dt>
  5125. <dd><p>top front right
  5126. </p></dd>
  5127. <dt>&lsquo;<samp>TBL</samp>&rsquo;</dt>
  5128. <dd><p>top back left
  5129. </p></dd>
  5130. <dt>&lsquo;<samp>TBC</samp>&rsquo;</dt>
  5131. <dd><p>top back center
  5132. </p></dd>
  5133. <dt>&lsquo;<samp>TBR</samp>&rsquo;</dt>
  5134. <dd><p>top back right
  5135. </p></dd>
  5136. <dt>&lsquo;<samp>DL</samp>&rsquo;</dt>
  5137. <dd><p>downmix left
  5138. </p></dd>
  5139. <dt>&lsquo;<samp>DR</samp>&rsquo;</dt>
  5140. <dd><p>downmix right
  5141. </p></dd>
  5142. <dt>&lsquo;<samp>WL</samp>&rsquo;</dt>
  5143. <dd><p>wide left
  5144. </p></dd>
  5145. <dt>&lsquo;<samp>WR</samp>&rsquo;</dt>
  5146. <dd><p>wide right
  5147. </p></dd>
  5148. <dt>&lsquo;<samp>SDL</samp>&rsquo;</dt>
  5149. <dd><p>surround direct left
  5150. </p></dd>
  5151. <dt>&lsquo;<samp>SDR</samp>&rsquo;</dt>
  5152. <dd><p>surround direct right
  5153. </p></dd>
  5154. <dt>&lsquo;<samp>LFE2</samp>&rsquo;</dt>
  5155. <dd><p>low frequency 2
  5156. </p></dd>
  5157. </dl>
  5158. <p>Standard channel layout compositions can be specified by using the
  5159. following identifiers:
  5160. </p><dl compact="compact">
  5161. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  5162. <dd><p>FC
  5163. </p></dd>
  5164. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  5165. <dd><p>FL+FR
  5166. </p></dd>
  5167. <dt>&lsquo;<samp>2.1</samp>&rsquo;</dt>
  5168. <dd><p>FL+FR+LFE
  5169. </p></dd>
  5170. <dt>&lsquo;<samp>3.0</samp>&rsquo;</dt>
  5171. <dd><p>FL+FR+FC
  5172. </p></dd>
  5173. <dt>&lsquo;<samp>3.0(back)</samp>&rsquo;</dt>
  5174. <dd><p>FL+FR+BC
  5175. </p></dd>
  5176. <dt>&lsquo;<samp>4.0</samp>&rsquo;</dt>
  5177. <dd><p>FL+FR+FC+BC
  5178. </p></dd>
  5179. <dt>&lsquo;<samp>quad</samp>&rsquo;</dt>
  5180. <dd><p>FL+FR+BL+BR
  5181. </p></dd>
  5182. <dt>&lsquo;<samp>quad(side)</samp>&rsquo;</dt>
  5183. <dd><p>FL+FR+SL+SR
  5184. </p></dd>
  5185. <dt>&lsquo;<samp>3.1</samp>&rsquo;</dt>
  5186. <dd><p>FL+FR+FC+LFE
  5187. </p></dd>
  5188. <dt>&lsquo;<samp>5.0</samp>&rsquo;</dt>
  5189. <dd><p>FL+FR+FC+BL+BR
  5190. </p></dd>
  5191. <dt>&lsquo;<samp>5.0(side)</samp>&rsquo;</dt>
  5192. <dd><p>FL+FR+FC+SL+SR
  5193. </p></dd>
  5194. <dt>&lsquo;<samp>4.1</samp>&rsquo;</dt>
  5195. <dd><p>FL+FR+FC+LFE+BC
  5196. </p></dd>
  5197. <dt>&lsquo;<samp>5.1</samp>&rsquo;</dt>
  5198. <dd><p>FL+FR+FC+LFE+BL+BR
  5199. </p></dd>
  5200. <dt>&lsquo;<samp>5.1(side)</samp>&rsquo;</dt>
  5201. <dd><p>FL+FR+FC+LFE+SL+SR
  5202. </p></dd>
  5203. <dt>&lsquo;<samp>6.0</samp>&rsquo;</dt>
  5204. <dd><p>FL+FR+FC+BC+SL+SR
  5205. </p></dd>
  5206. <dt>&lsquo;<samp>6.0(front)</samp>&rsquo;</dt>
  5207. <dd><p>FL+FR+FLC+FRC+SL+SR
  5208. </p></dd>
  5209. <dt>&lsquo;<samp>hexagonal</samp>&rsquo;</dt>
  5210. <dd><p>FL+FR+FC+BL+BR+BC
  5211. </p></dd>
  5212. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5213. <dd><p>FL+FR+FC+LFE+BC+SL+SR
  5214. </p></dd>
  5215. <dt>&lsquo;<samp>6.1</samp>&rsquo;</dt>
  5216. <dd><p>FL+FR+FC+LFE+BL+BR+BC
  5217. </p></dd>
  5218. <dt>&lsquo;<samp>6.1(front)</samp>&rsquo;</dt>
  5219. <dd><p>FL+FR+LFE+FLC+FRC+SL+SR
  5220. </p></dd>
  5221. <dt>&lsquo;<samp>7.0</samp>&rsquo;</dt>
  5222. <dd><p>FL+FR+FC+BL+BR+SL+SR
  5223. </p></dd>
  5224. <dt>&lsquo;<samp>7.0(front)</samp>&rsquo;</dt>
  5225. <dd><p>FL+FR+FC+FLC+FRC+SL+SR
  5226. </p></dd>
  5227. <dt>&lsquo;<samp>7.1</samp>&rsquo;</dt>
  5228. <dd><p>FL+FR+FC+LFE+BL+BR+SL+SR
  5229. </p></dd>
  5230. <dt>&lsquo;<samp>7.1(wide)</samp>&rsquo;</dt>
  5231. <dd><p>FL+FR+FC+LFE+BL+BR+FLC+FRC
  5232. </p></dd>
  5233. <dt>&lsquo;<samp>7.1(wide-side)</samp>&rsquo;</dt>
  5234. <dd><p>FL+FR+FC+LFE+FLC+FRC+SL+SR
  5235. </p></dd>
  5236. <dt>&lsquo;<samp>octagonal</samp>&rsquo;</dt>
  5237. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR
  5238. </p></dd>
  5239. <dt>&lsquo;<samp>hexadecagonal</samp>&rsquo;</dt>
  5240. <dd><p>FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
  5241. </p></dd>
  5242. <dt>&lsquo;<samp>downmix</samp>&rsquo;</dt>
  5243. <dd><p>DL+DR
  5244. </p></dd>
  5245. </dl>
  5246. <p>A custom channel layout can be specified as a sequence of terms, separated by
  5247. &rsquo;+&rsquo; or &rsquo;|&rsquo;. Each term can be:
  5248. </p><ul>
  5249. <li>
  5250. the name of a standard channel layout (e.g. &lsquo;<samp>mono</samp>&rsquo;,
  5251. &lsquo;<samp>stereo</samp>&rsquo;, &lsquo;<samp>4.0</samp>&rsquo;, &lsquo;<samp>quad</samp>&rsquo;, &lsquo;<samp>5.0</samp>&rsquo;, etc.)
  5252. </li><li>
  5253. the name of a single channel (e.g. &lsquo;<samp>FL</samp>&rsquo;, &lsquo;<samp>FR</samp>&rsquo;, &lsquo;<samp>FC</samp>&rsquo;, &lsquo;<samp>LFE</samp>&rsquo;, etc.)
  5254. </li><li>
  5255. a number of channels, in decimal, followed by &rsquo;c&rsquo;, yielding the default channel
  5256. layout for that number of channels (see the function
  5257. <code>av_get_default_channel_layout</code>). Note that not all channel counts have a
  5258. default layout.
  5259. </li><li>
  5260. a number of channels, in decimal, followed by &rsquo;C&rsquo;, yielding an unknown channel
  5261. layout with the specified number of channels. Note that not all channel layout
  5262. specification strings support unknown channel layouts.
  5263. </li><li>
  5264. a channel layout mask, in hexadecimal starting with &quot;0x&quot; (see the
  5265. <code>AV_CH_*</code> macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
  5266. </li></ul>
  5267. <p>Before libavutil version 53 the trailing character &quot;c&quot; to specify a number of
  5268. channels was optional, but now it is required, while a channel layout mask can
  5269. also be specified as a decimal number (if and only if not followed by &quot;c&quot; or &quot;C&quot;).
  5270. </p>
  5271. <p>See also the function <code>av_get_channel_layout</code> defined in
  5272. &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;.
  5273. </p>
  5274. <a name="Expression-Evaluation"></a>
  5275. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Expression-Evaluation">8 Expression Evaluation</a></h1>
  5276. <p>When evaluating an arithmetic expression, FFmpeg uses an internal
  5277. formula evaluator, implemented through the &lsquo;<tt>libavutil/eval.h</tt>&rsquo;
  5278. interface.
  5279. </p>
  5280. <p>An expression may contain unary, binary operators, constants, and
  5281. functions.
  5282. </p>
  5283. <p>Two expressions <var>expr1</var> and <var>expr2</var> can be combined to form
  5284. another expression &quot;<var>expr1</var>;<var>expr2</var>&quot;.
  5285. <var>expr1</var> and <var>expr2</var> are evaluated in turn, and the new
  5286. expression evaluates to the value of <var>expr2</var>.
  5287. </p>
  5288. <p>The following binary operators are available: <code>+</code>, <code>-</code>,
  5289. <code>*</code>, <code>/</code>, <code>^</code>.
  5290. </p>
  5291. <p>The following unary operators are available: <code>+</code>, <code>-</code>.
  5292. </p>
  5293. <p>The following functions are available:
  5294. </p><dl compact="compact">
  5295. <dt>&lsquo;<samp>abs(x)</samp>&rsquo;</dt>
  5296. <dd><p>Compute absolute value of <var>x</var>.
  5297. </p>
  5298. </dd>
  5299. <dt>&lsquo;<samp>acos(x)</samp>&rsquo;</dt>
  5300. <dd><p>Compute arccosine of <var>x</var>.
  5301. </p>
  5302. </dd>
  5303. <dt>&lsquo;<samp>asin(x)</samp>&rsquo;</dt>
  5304. <dd><p>Compute arcsine of <var>x</var>.
  5305. </p>
  5306. </dd>
  5307. <dt>&lsquo;<samp>atan(x)</samp>&rsquo;</dt>
  5308. <dd><p>Compute arctangent of <var>x</var>.
  5309. </p>
  5310. </dd>
  5311. <dt>&lsquo;<samp>atan2(x, y)</samp>&rsquo;</dt>
  5312. <dd><p>Compute principal value of the arc tangent of <var>y</var>/<var>x</var>.
  5313. </p>
  5314. </dd>
  5315. <dt>&lsquo;<samp>between(x, min, max)</samp>&rsquo;</dt>
  5316. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>min</var> and lesser than or
  5317. equal to <var>max</var>, 0 otherwise.
  5318. </p>
  5319. </dd>
  5320. <dt>&lsquo;<samp>bitand(x, y)</samp>&rsquo;</dt>
  5321. <dt>&lsquo;<samp>bitor(x, y)</samp>&rsquo;</dt>
  5322. <dd><p>Compute bitwise and/or operation on <var>x</var> and <var>y</var>.
  5323. </p>
  5324. <p>The results of the evaluation of <var>x</var> and <var>y</var> are converted to
  5325. integers before executing the bitwise operation.
  5326. </p>
  5327. <p>Note that both the conversion to integer and the conversion back to
  5328. floating point can lose precision. Beware of unexpected results for
  5329. large numbers (usually 2^53 and larger).
  5330. </p>
  5331. </dd>
  5332. <dt>&lsquo;<samp>ceil(expr)</samp>&rsquo;</dt>
  5333. <dd><p>Round the value of expression <var>expr</var> upwards to the nearest
  5334. integer. For example, &quot;ceil(1.5)&quot; is &quot;2.0&quot;.
  5335. </p>
  5336. </dd>
  5337. <dt>&lsquo;<samp>clip(x, min, max)</samp>&rsquo;</dt>
  5338. <dd><p>Return the value of <var>x</var> clipped between <var>min</var> and <var>max</var>.
  5339. </p>
  5340. </dd>
  5341. <dt>&lsquo;<samp>cos(x)</samp>&rsquo;</dt>
  5342. <dd><p>Compute cosine of <var>x</var>.
  5343. </p>
  5344. </dd>
  5345. <dt>&lsquo;<samp>cosh(x)</samp>&rsquo;</dt>
  5346. <dd><p>Compute hyperbolic cosine of <var>x</var>.
  5347. </p>
  5348. </dd>
  5349. <dt>&lsquo;<samp>eq(x, y)</samp>&rsquo;</dt>
  5350. <dd><p>Return 1 if <var>x</var> and <var>y</var> are equivalent, 0 otherwise.
  5351. </p>
  5352. </dd>
  5353. <dt>&lsquo;<samp>exp(x)</samp>&rsquo;</dt>
  5354. <dd><p>Compute exponential of <var>x</var> (with base <code>e</code>, the Euler&rsquo;s number).
  5355. </p>
  5356. </dd>
  5357. <dt>&lsquo;<samp>floor(expr)</samp>&rsquo;</dt>
  5358. <dd><p>Round the value of expression <var>expr</var> downwards to the nearest
  5359. integer. For example, &quot;floor(-1.5)&quot; is &quot;-2.0&quot;.
  5360. </p>
  5361. </dd>
  5362. <dt>&lsquo;<samp>gauss(x)</samp>&rsquo;</dt>
  5363. <dd><p>Compute Gauss function of <var>x</var>, corresponding to
  5364. <code>exp(-x*x/2) / sqrt(2*PI)</code>.
  5365. </p>
  5366. </dd>
  5367. <dt>&lsquo;<samp>gcd(x, y)</samp>&rsquo;</dt>
  5368. <dd><p>Return the greatest common divisor of <var>x</var> and <var>y</var>. If both <var>x</var> and
  5369. <var>y</var> are 0 or either or both are less than zero then behavior is undefined.
  5370. </p>
  5371. </dd>
  5372. <dt>&lsquo;<samp>gt(x, y)</samp>&rsquo;</dt>
  5373. <dd><p>Return 1 if <var>x</var> is greater than <var>y</var>, 0 otherwise.
  5374. </p>
  5375. </dd>
  5376. <dt>&lsquo;<samp>gte(x, y)</samp>&rsquo;</dt>
  5377. <dd><p>Return 1 if <var>x</var> is greater than or equal to <var>y</var>, 0 otherwise.
  5378. </p>
  5379. </dd>
  5380. <dt>&lsquo;<samp>hypot(x, y)</samp>&rsquo;</dt>
  5381. <dd><p>This function is similar to the C function with the same name; it returns
  5382. &quot;sqrt(<var>x</var>*<var>x</var> + <var>y</var>*<var>y</var>)&quot;, the length of the hypotenuse of a
  5383. right triangle with sides of length <var>x</var> and <var>y</var>, or the distance of the
  5384. point (<var>x</var>, <var>y</var>) from the origin.
  5385. </p>
  5386. </dd>
  5387. <dt>&lsquo;<samp>if(x, y)</samp>&rsquo;</dt>
  5388. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the result of
  5389. the evaluation of <var>y</var>, return 0 otherwise.
  5390. </p>
  5391. </dd>
  5392. <dt>&lsquo;<samp>if(x, y, z)</samp>&rsquo;</dt>
  5393. <dd><p>Evaluate <var>x</var>, and if the result is non-zero return the evaluation
  5394. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5395. </p>
  5396. </dd>
  5397. <dt>&lsquo;<samp>ifnot(x, y)</samp>&rsquo;</dt>
  5398. <dd><p>Evaluate <var>x</var>, and if the result is zero return the result of the
  5399. evaluation of <var>y</var>, return 0 otherwise.
  5400. </p>
  5401. </dd>
  5402. <dt>&lsquo;<samp>ifnot(x, y, z)</samp>&rsquo;</dt>
  5403. <dd><p>Evaluate <var>x</var>, and if the result is zero return the evaluation
  5404. result of <var>y</var>, otherwise the evaluation result of <var>z</var>.
  5405. </p>
  5406. </dd>
  5407. <dt>&lsquo;<samp>isinf(x)</samp>&rsquo;</dt>
  5408. <dd><p>Return 1.0 if <var>x</var> is +/-INFINITY, 0.0 otherwise.
  5409. </p>
  5410. </dd>
  5411. <dt>&lsquo;<samp>isnan(x)</samp>&rsquo;</dt>
  5412. <dd><p>Return 1.0 if <var>x</var> is NAN, 0.0 otherwise.
  5413. </p>
  5414. </dd>
  5415. <dt>&lsquo;<samp>ld(var)</samp>&rsquo;</dt>
  5416. <dd><p>Load the value of the internal variable with number
  5417. <var>var</var>, which was previously stored with st(<var>var</var>, <var>expr</var>).
  5418. The function returns the loaded value.
  5419. </p>
  5420. </dd>
  5421. <dt>&lsquo;<samp>lerp(x, y, z)</samp>&rsquo;</dt>
  5422. <dd><p>Return linear interpolation between <var>x</var> and <var>y</var> by amount of <var>z</var>.
  5423. </p>
  5424. </dd>
  5425. <dt>&lsquo;<samp>log(x)</samp>&rsquo;</dt>
  5426. <dd><p>Compute natural logarithm of <var>x</var>.
  5427. </p>
  5428. </dd>
  5429. <dt>&lsquo;<samp>lt(x, y)</samp>&rsquo;</dt>
  5430. <dd><p>Return 1 if <var>x</var> is lesser than <var>y</var>, 0 otherwise.
  5431. </p>
  5432. </dd>
  5433. <dt>&lsquo;<samp>lte(x, y)</samp>&rsquo;</dt>
  5434. <dd><p>Return 1 if <var>x</var> is lesser than or equal to <var>y</var>, 0 otherwise.
  5435. </p>
  5436. </dd>
  5437. <dt>&lsquo;<samp>max(x, y)</samp>&rsquo;</dt>
  5438. <dd><p>Return the maximum between <var>x</var> and <var>y</var>.
  5439. </p>
  5440. </dd>
  5441. <dt>&lsquo;<samp>min(x, y)</samp>&rsquo;</dt>
  5442. <dd><p>Return the minimum between <var>x</var> and <var>y</var>.
  5443. </p>
  5444. </dd>
  5445. <dt>&lsquo;<samp>mod(x, y)</samp>&rsquo;</dt>
  5446. <dd><p>Compute the remainder of division of <var>x</var> by <var>y</var>.
  5447. </p>
  5448. </dd>
  5449. <dt>&lsquo;<samp>not(expr)</samp>&rsquo;</dt>
  5450. <dd><p>Return 1.0 if <var>expr</var> is zero, 0.0 otherwise.
  5451. </p>
  5452. </dd>
  5453. <dt>&lsquo;<samp>pow(x, y)</samp>&rsquo;</dt>
  5454. <dd><p>Compute the power of <var>x</var> elevated <var>y</var>, it is equivalent to
  5455. &quot;(<var>x</var>)^(<var>y</var>)&quot;.
  5456. </p>
  5457. </dd>
  5458. <dt>&lsquo;<samp>print(t)</samp>&rsquo;</dt>
  5459. <dt>&lsquo;<samp>print(t, l)</samp>&rsquo;</dt>
  5460. <dd><p>Print the value of expression <var>t</var> with loglevel <var>l</var>. If
  5461. <var>l</var> is not specified then a default log level is used.
  5462. Returns the value of the expression printed.
  5463. </p>
  5464. <p>Prints t with loglevel l
  5465. </p>
  5466. </dd>
  5467. <dt>&lsquo;<samp>random(x)</samp>&rsquo;</dt>
  5468. <dd><p>Return a pseudo random value between 0.0 and 1.0. <var>x</var> is the index of the
  5469. internal variable which will be used to save the seed/state.
  5470. </p>
  5471. </dd>
  5472. <dt>&lsquo;<samp>root(expr, max)</samp>&rsquo;</dt>
  5473. <dd><p>Find an input value for which the function represented by <var>expr</var>
  5474. with argument <var>ld(0)</var> is 0 in the interval 0..<var>max</var>.
  5475. </p>
  5476. <p>The expression in <var>expr</var> must denote a continuous function or the
  5477. result is undefined.
  5478. </p>
  5479. <p><var>ld(0)</var> is used to represent the function input value, which means
  5480. that the given expression will be evaluated multiple times with
  5481. various input values that the expression can access through
  5482. <code>ld(0)</code>. When the expression evaluates to 0 then the
  5483. corresponding input value will be returned.
  5484. </p>
  5485. </dd>
  5486. <dt>&lsquo;<samp>round(expr)</samp>&rsquo;</dt>
  5487. <dd><p>Round the value of expression <var>expr</var> to the nearest integer. For example, &quot;round(1.5)&quot; is &quot;2.0&quot;.
  5488. </p>
  5489. </dd>
  5490. <dt>&lsquo;<samp>sgn(x)</samp>&rsquo;</dt>
  5491. <dd><p>Compute sign of <var>x</var>.
  5492. </p>
  5493. </dd>
  5494. <dt>&lsquo;<samp>sin(x)</samp>&rsquo;</dt>
  5495. <dd><p>Compute sine of <var>x</var>.
  5496. </p>
  5497. </dd>
  5498. <dt>&lsquo;<samp>sinh(x)</samp>&rsquo;</dt>
  5499. <dd><p>Compute hyperbolic sine of <var>x</var>.
  5500. </p>
  5501. </dd>
  5502. <dt>&lsquo;<samp>sqrt(expr)</samp>&rsquo;</dt>
  5503. <dd><p>Compute the square root of <var>expr</var>. This is equivalent to
  5504. &quot;(<var>expr</var>)^.5&quot;.
  5505. </p>
  5506. </dd>
  5507. <dt>&lsquo;<samp>squish(x)</samp>&rsquo;</dt>
  5508. <dd><p>Compute expression <code>1/(1 + exp(4*x))</code>.
  5509. </p>
  5510. </dd>
  5511. <dt>&lsquo;<samp>st(var, expr)</samp>&rsquo;</dt>
  5512. <dd><p>Store the value of the expression <var>expr</var> in an internal
  5513. variable. <var>var</var> specifies the number of the variable where to
  5514. store the value, and it is a value ranging from 0 to 9. The function
  5515. returns the value stored in the internal variable.
  5516. Note, Variables are currently not shared between expressions.
  5517. </p>
  5518. </dd>
  5519. <dt>&lsquo;<samp>tan(x)</samp>&rsquo;</dt>
  5520. <dd><p>Compute tangent of <var>x</var>.
  5521. </p>
  5522. </dd>
  5523. <dt>&lsquo;<samp>tanh(x)</samp>&rsquo;</dt>
  5524. <dd><p>Compute hyperbolic tangent of <var>x</var>.
  5525. </p>
  5526. </dd>
  5527. <dt>&lsquo;<samp>taylor(expr, x)</samp>&rsquo;</dt>
  5528. <dt>&lsquo;<samp>taylor(expr, x, id)</samp>&rsquo;</dt>
  5529. <dd><p>Evaluate a Taylor series at <var>x</var>, given an expression representing
  5530. the <code>ld(id)</code>-th derivative of a function at 0.
  5531. </p>
  5532. <p>When the series does not converge the result is undefined.
  5533. </p>
  5534. <p><var>ld(id)</var> is used to represent the derivative order in <var>expr</var>,
  5535. which means that the given expression will be evaluated multiple times
  5536. with various input values that the expression can access through
  5537. <code>ld(id)</code>. If <var>id</var> is not specified then 0 is assumed.
  5538. </p>
  5539. <p>Note, when you have the derivatives at y instead of 0,
  5540. <code>taylor(expr, x-y)</code> can be used.
  5541. </p>
  5542. </dd>
  5543. <dt>&lsquo;<samp>time(0)</samp>&rsquo;</dt>
  5544. <dd><p>Return the current (wallclock) time in seconds.
  5545. </p>
  5546. </dd>
  5547. <dt>&lsquo;<samp>trunc(expr)</samp>&rsquo;</dt>
  5548. <dd><p>Round the value of expression <var>expr</var> towards zero to the nearest
  5549. integer. For example, &quot;trunc(-1.5)&quot; is &quot;-1.0&quot;.
  5550. </p>
  5551. </dd>
  5552. <dt>&lsquo;<samp>while(cond, expr)</samp>&rsquo;</dt>
  5553. <dd><p>Evaluate expression <var>expr</var> while the expression <var>cond</var> is
  5554. non-zero, and returns the value of the last <var>expr</var> evaluation, or
  5555. NAN if <var>cond</var> was always false.
  5556. </p></dd>
  5557. </dl>
  5558. <p>The following constants are available:
  5559. </p><dl compact="compact">
  5560. <dt>&lsquo;<samp>PI</samp>&rsquo;</dt>
  5561. <dd><p>area of the unit disc, approximately 3.14
  5562. </p></dd>
  5563. <dt>&lsquo;<samp>E</samp>&rsquo;</dt>
  5564. <dd><p>exp(1) (Euler&rsquo;s number), approximately 2.718
  5565. </p></dd>
  5566. <dt>&lsquo;<samp>PHI</samp>&rsquo;</dt>
  5567. <dd><p>golden ratio (1+sqrt(5))/2, approximately 1.618
  5568. </p></dd>
  5569. </dl>
  5570. <p>Assuming that an expression is considered &quot;true&quot; if it has a non-zero
  5571. value, note that:
  5572. </p>
  5573. <p><code>*</code> works like AND
  5574. </p>
  5575. <p><code>+</code> works like OR
  5576. </p>
  5577. <p>For example the construct:
  5578. </p><div class="example">
  5579. <pre class="example">if (A AND B) then C
  5580. </pre></div>
  5581. <p>is equivalent to:
  5582. </p><div class="example">
  5583. <pre class="example">if(A*B, C)
  5584. </pre></div>
  5585. <p>In your C code, you can extend the list of unary and binary functions,
  5586. and define recognized constants, so that they are available for your
  5587. expressions.
  5588. </p>
  5589. <p>The evaluator also recognizes the International System unit prefixes.
  5590. If &rsquo;i&rsquo; is appended after the prefix, binary prefixes are used, which
  5591. are based on powers of 1024 instead of powers of 1000.
  5592. The &rsquo;B&rsquo; postfix multiplies the value by 8, and can be appended after a
  5593. unit prefix or used alone. This allows using for example &rsquo;KB&rsquo;, &rsquo;MiB&rsquo;,
  5594. &rsquo;G&rsquo; and &rsquo;B&rsquo; as number postfix.
  5595. </p>
  5596. <p>The list of available International System prefixes follows, with
  5597. indication of the corresponding powers of 10 and of 2.
  5598. </p><dl compact="compact">
  5599. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  5600. <dd><p>10^-24 / 2^-80
  5601. </p></dd>
  5602. <dt>&lsquo;<samp>z</samp>&rsquo;</dt>
  5603. <dd><p>10^-21 / 2^-70
  5604. </p></dd>
  5605. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  5606. <dd><p>10^-18 / 2^-60
  5607. </p></dd>
  5608. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  5609. <dd><p>10^-15 / 2^-50
  5610. </p></dd>
  5611. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  5612. <dd><p>10^-12 / 2^-40
  5613. </p></dd>
  5614. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  5615. <dd><p>10^-9 / 2^-30
  5616. </p></dd>
  5617. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  5618. <dd><p>10^-6 / 2^-20
  5619. </p></dd>
  5620. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  5621. <dd><p>10^-3 / 2^-10
  5622. </p></dd>
  5623. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  5624. <dd><p>10^-2
  5625. </p></dd>
  5626. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  5627. <dd><p>10^-1
  5628. </p></dd>
  5629. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  5630. <dd><p>10^2
  5631. </p></dd>
  5632. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  5633. <dd><p>10^3 / 2^10
  5634. </p></dd>
  5635. <dt>&lsquo;<samp>K</samp>&rsquo;</dt>
  5636. <dd><p>10^3 / 2^10
  5637. </p></dd>
  5638. <dt>&lsquo;<samp>M</samp>&rsquo;</dt>
  5639. <dd><p>10^6 / 2^20
  5640. </p></dd>
  5641. <dt>&lsquo;<samp>G</samp>&rsquo;</dt>
  5642. <dd><p>10^9 / 2^30
  5643. </p></dd>
  5644. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  5645. <dd><p>10^12 / 2^40
  5646. </p></dd>
  5647. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  5648. <dd><p>10^15 / 2^40
  5649. </p></dd>
  5650. <dt>&lsquo;<samp>E</samp>&rsquo;</dt>
  5651. <dd><p>10^18 / 2^50
  5652. </p></dd>
  5653. <dt>&lsquo;<samp>Z</samp>&rsquo;</dt>
  5654. <dd><p>10^21 / 2^60
  5655. </p></dd>
  5656. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  5657. <dd><p>10^24 / 2^70
  5658. </p></dd>
  5659. </dl>
  5660. <p><a name="codec_002doptions"></a>
  5661. </p><a name="Codec-Options"></a>
  5662. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Codec-Options">9 Codec Options</a></h1>
  5663. <p>libavcodec provides some generic global options, which can be set on
  5664. all the encoders and decoders. In addition each codec may support
  5665. so-called private options, which are specific for a given codec.
  5666. </p>
  5667. <p>Sometimes, a global option may only affect a specific kind of codec,
  5668. and may be nonsensical or ignored by another, so you need to be aware
  5669. of the meaning of the specified options. Also some options are
  5670. meant only for decoding or encoding.
  5671. </p>
  5672. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  5673. FFmpeg tools, or by setting the value explicitly in the
  5674. <code>AVCodecContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  5675. for programmatic use.
  5676. </p>
  5677. <p>The list of supported options follow:
  5678. </p>
  5679. <dl compact="compact">
  5680. <dt>&lsquo;<samp>b <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  5681. <dd><p>Set bitrate in bits/s. Default value is 200K.
  5682. </p>
  5683. </dd>
  5684. <dt>&lsquo;<samp>ab <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5685. <dd><p>Set audio bitrate (in bits/s). Default value is 128K.
  5686. </p>
  5687. </dd>
  5688. <dt>&lsquo;<samp>bt <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5689. <dd><p>Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate
  5690. tolerance specifies how far ratecontrol is willing to deviate from the
  5691. target average bitrate value. This is not related to min/max
  5692. bitrate. Lowering tolerance too much has an adverse effect on quality.
  5693. </p>
  5694. </dd>
  5695. <dt>&lsquo;<samp>flags <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  5696. <dd><p>Set generic flags.
  5697. </p>
  5698. <p>Possible values:
  5699. </p><dl compact="compact">
  5700. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  5701. <dd><p>Use four motion vector by macroblock (mpeg4).
  5702. </p></dd>
  5703. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  5704. <dd><p>Use 1/4 pel motion compensation.
  5705. </p></dd>
  5706. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  5707. <dd><p>Use loop filter.
  5708. </p></dd>
  5709. <dt>&lsquo;<samp>qscale</samp>&rsquo;</dt>
  5710. <dd><p>Use fixed qscale.
  5711. </p></dd>
  5712. <dt>&lsquo;<samp>pass1</samp>&rsquo;</dt>
  5713. <dd><p>Use internal 2pass ratecontrol in first pass mode.
  5714. </p></dd>
  5715. <dt>&lsquo;<samp>pass2</samp>&rsquo;</dt>
  5716. <dd><p>Use internal 2pass ratecontrol in second pass mode.
  5717. </p></dd>
  5718. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  5719. <dd><p>Only decode/encode grayscale.
  5720. </p></dd>
  5721. <dt>&lsquo;<samp>emu_edge</samp>&rsquo;</dt>
  5722. <dd><p>Do not draw edges.
  5723. </p></dd>
  5724. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  5725. <dd><p>Set error[?] variables during encoding.
  5726. </p></dd>
  5727. <dt>&lsquo;<samp>truncated</samp>&rsquo;</dt>
  5728. <dd><p>Input bitstream might be randomly truncated.
  5729. </p></dd>
  5730. <dt>&lsquo;<samp>drop_changed</samp>&rsquo;</dt>
  5731. <dd><p>Don&rsquo;t output frames whose parameters differ from first decoded frame in stream.
  5732. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped.
  5733. </p>
  5734. </dd>
  5735. <dt>&lsquo;<samp>ildct</samp>&rsquo;</dt>
  5736. <dd><p>Use interlaced DCT.
  5737. </p></dd>
  5738. <dt>&lsquo;<samp>low_delay</samp>&rsquo;</dt>
  5739. <dd><p>Force low delay.
  5740. </p></dd>
  5741. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  5742. <dd><p>Place global headers in extradata instead of every keyframe.
  5743. </p></dd>
  5744. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  5745. <dd><p>Only write platform-, build- and time-independent data. (except (I)DCT).
  5746. This ensures that file and data checksums are reproducible and match between
  5747. platforms. Its primary use is for regression testing.
  5748. </p></dd>
  5749. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  5750. <dd><p>Apply H263 advanced intra coding / mpeg4 ac prediction.
  5751. </p></dd>
  5752. <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
  5753. <dd><p>Deprecated, use mpegvideo private options instead.
  5754. </p></dd>
  5755. <dt>&lsquo;<samp>qprd</samp>&rsquo;</dt>
  5756. <dd><p>Deprecated, use mpegvideo private options instead.
  5757. </p></dd>
  5758. <dt>&lsquo;<samp>ilme</samp>&rsquo;</dt>
  5759. <dd><p>Apply interlaced motion estimation.
  5760. </p></dd>
  5761. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  5762. <dd><p>Use closed gop.
  5763. </p></dd>
  5764. <dt>&lsquo;<samp>output_corrupt</samp>&rsquo;</dt>
  5765. <dd><p>Output even potentially corrupted frames.
  5766. </p></dd>
  5767. </dl>
  5768. </dd>
  5769. <dt>&lsquo;<samp>me_method <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5770. <dd><p>Set motion estimation method.
  5771. </p>
  5772. <p>Possible values:
  5773. </p><dl compact="compact">
  5774. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  5775. <dd><p>zero motion estimation (fastest)
  5776. </p></dd>
  5777. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  5778. <dd><p>full motion estimation (slowest)
  5779. </p></dd>
  5780. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  5781. <dd><p>EPZS motion estimation (default)
  5782. </p></dd>
  5783. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  5784. <dd><p>esa motion estimation (alias for full)
  5785. </p></dd>
  5786. <dt>&lsquo;<samp>tesa</samp>&rsquo;</dt>
  5787. <dd><p>tesa motion estimation
  5788. </p></dd>
  5789. <dt>&lsquo;<samp>dia</samp>&rsquo;</dt>
  5790. <dd><p>dia motion estimation (alias for epzs)
  5791. </p></dd>
  5792. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  5793. <dd><p>log motion estimation
  5794. </p></dd>
  5795. <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
  5796. <dd><p>phods motion estimation
  5797. </p></dd>
  5798. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  5799. <dd><p>X1 motion estimation
  5800. </p></dd>
  5801. <dt>&lsquo;<samp>hex</samp>&rsquo;</dt>
  5802. <dd><p>hex motion estimation
  5803. </p></dd>
  5804. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  5805. <dd><p>umh motion estimation
  5806. </p></dd>
  5807. <dt>&lsquo;<samp>iter</samp>&rsquo;</dt>
  5808. <dd><p>iter motion estimation
  5809. </p></dd>
  5810. </dl>
  5811. </dd>
  5812. <dt>&lsquo;<samp>extradata_size <var>integer</var></samp>&rsquo;</dt>
  5813. <dd><p>Set extradata size.
  5814. </p>
  5815. </dd>
  5816. <dt>&lsquo;<samp>time_base <var>rational number</var></samp>&rsquo;</dt>
  5817. <dd><p>Set codec time base.
  5818. </p>
  5819. <p>It is the fundamental unit of time (in seconds) in terms of which
  5820. frame timestamps are represented. For fixed-fps content, timebase
  5821. should be <code>1 / frame_rate</code> and timestamp increments should be
  5822. identically 1.
  5823. </p>
  5824. </dd>
  5825. <dt>&lsquo;<samp>g <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5826. <dd><p>Set the group of picture (GOP) size. Default value is 12.
  5827. </p>
  5828. </dd>
  5829. <dt>&lsquo;<samp>ar <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  5830. <dd><p>Set audio sampling rate (in Hz).
  5831. </p>
  5832. </dd>
  5833. <dt>&lsquo;<samp>ac <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  5834. <dd><p>Set number of audio channels.
  5835. </p>
  5836. </dd>
  5837. <dt>&lsquo;<samp>cutoff <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5838. <dd><p>Set cutoff bandwidth. (Supported only by selected encoders, see
  5839. their respective documentation sections.)
  5840. </p>
  5841. </dd>
  5842. <dt>&lsquo;<samp>frame_size <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  5843. <dd><p>Set audio frame size.
  5844. </p>
  5845. <p>Each submitted frame except the last must contain exactly frame_size
  5846. samples per channel. May be 0 when the codec has
  5847. CODEC_CAP_VARIABLE_FRAME_SIZE set, in that case the frame size is not
  5848. restricted. It is set by some decoders to indicate constant frame
  5849. size.
  5850. </p>
  5851. </dd>
  5852. <dt>&lsquo;<samp>frame_number <var>integer</var></samp>&rsquo;</dt>
  5853. <dd><p>Set the frame number.
  5854. </p>
  5855. </dd>
  5856. <dt>&lsquo;<samp>delay <var>integer</var></samp>&rsquo;</dt>
  5857. <dt>&lsquo;<samp>qcomp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5858. <dd><p>Set video quantizer scale compression (VBR). It is used as a constant
  5859. in the ratecontrol equation. Recommended range for default rc_eq:
  5860. 0.0-1.0.
  5861. </p>
  5862. </dd>
  5863. <dt>&lsquo;<samp>qblur <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5864. <dd><p>Set video quantizer scale blur (VBR).
  5865. </p>
  5866. </dd>
  5867. <dt>&lsquo;<samp>qmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5868. <dd><p>Set min video quantizer scale (VBR). Must be included between -1 and
  5869. 69, default value is 2.
  5870. </p>
  5871. </dd>
  5872. <dt>&lsquo;<samp>qmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5873. <dd><p>Set max video quantizer scale (VBR). Must be included between -1 and
  5874. 1024, default value is 31.
  5875. </p>
  5876. </dd>
  5877. <dt>&lsquo;<samp>qdiff <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5878. <dd><p>Set max difference between the quantizer scale (VBR).
  5879. </p>
  5880. </dd>
  5881. <dt>&lsquo;<samp>bf <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5882. <dd><p>Set max number of B frames between non-B-frames.
  5883. </p>
  5884. <p>Must be an integer between -1 and 16. 0 means that B-frames are
  5885. disabled. If a value of -1 is used, it will choose an automatic value
  5886. depending on the encoder.
  5887. </p>
  5888. <p>Default value is 0.
  5889. </p>
  5890. </dd>
  5891. <dt>&lsquo;<samp>b_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5892. <dd><p>Set qp factor between P and B frames.
  5893. </p>
  5894. </dd>
  5895. <dt>&lsquo;<samp>rc_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5896. <dd><p>Set ratecontrol method.
  5897. </p>
  5898. </dd>
  5899. <dt>&lsquo;<samp>b_strategy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5900. <dd><p>Set strategy to choose between I/P/B-frames.
  5901. </p>
  5902. </dd>
  5903. <dt>&lsquo;<samp>ps <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5904. <dd><p>Set RTP payload size in bytes.
  5905. </p>
  5906. </dd>
  5907. <dt>&lsquo;<samp>mv_bits <var>integer</var></samp>&rsquo;</dt>
  5908. <dt>&lsquo;<samp>header_bits <var>integer</var></samp>&rsquo;</dt>
  5909. <dt>&lsquo;<samp>i_tex_bits <var>integer</var></samp>&rsquo;</dt>
  5910. <dt>&lsquo;<samp>p_tex_bits <var>integer</var></samp>&rsquo;</dt>
  5911. <dt>&lsquo;<samp>i_count <var>integer</var></samp>&rsquo;</dt>
  5912. <dt>&lsquo;<samp>p_count <var>integer</var></samp>&rsquo;</dt>
  5913. <dt>&lsquo;<samp>skip_count <var>integer</var></samp>&rsquo;</dt>
  5914. <dt>&lsquo;<samp>misc_bits <var>integer</var></samp>&rsquo;</dt>
  5915. <dt>&lsquo;<samp>frame_bits <var>integer</var></samp>&rsquo;</dt>
  5916. <dt>&lsquo;<samp>codec_tag <var>integer</var></samp>&rsquo;</dt>
  5917. <dt>&lsquo;<samp>bug <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  5918. <dd><p>Workaround not auto detected encoder bugs.
  5919. </p>
  5920. <p>Possible values:
  5921. </p><dl compact="compact">
  5922. <dt>&lsquo;<samp>autodetect</samp>&rsquo;</dt>
  5923. <dt>&lsquo;<samp>old_msmpeg4</samp>&rsquo;</dt>
  5924. <dd><p>some old lavc generated msmpeg4v3 files (no autodetection)
  5925. </p></dd>
  5926. <dt>&lsquo;<samp>xvid_ilace</samp>&rsquo;</dt>
  5927. <dd><p>Xvid interlacing bug (autodetected if fourcc==XVIX)
  5928. </p></dd>
  5929. <dt>&lsquo;<samp>ump4</samp>&rsquo;</dt>
  5930. <dd><p>(autodetected if fourcc==UMP4)
  5931. </p></dd>
  5932. <dt>&lsquo;<samp>no_padding</samp>&rsquo;</dt>
  5933. <dd><p>padding bug (autodetected)
  5934. </p></dd>
  5935. <dt>&lsquo;<samp>amv</samp>&rsquo;</dt>
  5936. <dt>&lsquo;<samp>ac_vlc</samp>&rsquo;</dt>
  5937. <dd><p>illegal vlc bug (autodetected per fourcc)
  5938. </p></dd>
  5939. <dt>&lsquo;<samp>qpel_chroma</samp>&rsquo;</dt>
  5940. <dt>&lsquo;<samp>std_qpel</samp>&rsquo;</dt>
  5941. <dd><p>old standard qpel (autodetected per fourcc/version)
  5942. </p></dd>
  5943. <dt>&lsquo;<samp>qpel_chroma2</samp>&rsquo;</dt>
  5944. <dt>&lsquo;<samp>direct_blocksize</samp>&rsquo;</dt>
  5945. <dd><p>direct-qpel-blocksize bug (autodetected per fourcc/version)
  5946. </p></dd>
  5947. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  5948. <dd><p>edge padding bug (autodetected per fourcc/version)
  5949. </p></dd>
  5950. <dt>&lsquo;<samp>hpel_chroma</samp>&rsquo;</dt>
  5951. <dt>&lsquo;<samp>dc_clip</samp>&rsquo;</dt>
  5952. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  5953. <dd><p>Workaround various bugs in microsoft broken decoders.
  5954. </p></dd>
  5955. <dt>&lsquo;<samp>trunc</samp>&rsquo;</dt>
  5956. <dd><p>trancated frames
  5957. </p></dd>
  5958. </dl>
  5959. </dd>
  5960. <dt>&lsquo;<samp>lelim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5961. <dd><p>Set single coefficient elimination threshold for luminance (negative
  5962. values also consider DC coefficient).
  5963. </p>
  5964. </dd>
  5965. <dt>&lsquo;<samp>celim <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5966. <dd><p>Set single coefficient elimination threshold for chrominance (negative
  5967. values also consider dc coefficient)
  5968. </p>
  5969. </dd>
  5970. <dt>&lsquo;<samp>strict <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
  5971. <dd><p>Specify how strictly to follow the standards.
  5972. </p>
  5973. <p>Possible values:
  5974. </p><dl compact="compact">
  5975. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  5976. <dd><p>strictly conform to an older more strict version of the spec or reference software
  5977. </p></dd>
  5978. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  5979. <dd><p>strictly conform to all the things in the spec no matter what consequences
  5980. </p></dd>
  5981. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  5982. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  5983. <dd><p>allow unofficial extensions
  5984. </p></dd>
  5985. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  5986. <dd><p>allow non standardized experimental things, experimental
  5987. (unfinished/work in progress/not well tested) decoders and encoders.
  5988. Note: experimental decoders can pose a security risk, do not use this for
  5989. decoding untrusted input.
  5990. </p></dd>
  5991. </dl>
  5992. </dd>
  5993. <dt>&lsquo;<samp>b_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  5994. <dd><p>Set QP offset between P and B frames.
  5995. </p>
  5996. </dd>
  5997. <dt>&lsquo;<samp>err_detect <var>flags</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
  5998. <dd><p>Set error detection flags.
  5999. </p>
  6000. <p>Possible values:
  6001. </p><dl compact="compact">
  6002. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  6003. <dd><p>verify embedded CRCs
  6004. </p></dd>
  6005. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6006. <dd><p>detect bitstream specification deviations
  6007. </p></dd>
  6008. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  6009. <dd><p>detect improper bitstream length
  6010. </p></dd>
  6011. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  6012. <dd><p>abort decoding on minor error detection
  6013. </p></dd>
  6014. <dt>&lsquo;<samp>ignore_err</samp>&rsquo;</dt>
  6015. <dd><p>ignore decoding errors, and continue decoding.
  6016. This is useful if you want to analyze the content of a video and thus want
  6017. everything to be decoded no matter what. This option will not result in a video
  6018. that is pleasing to watch in case of errors.
  6019. </p></dd>
  6020. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  6021. <dd><p>consider things that violate the spec and have not been seen in the wild as errors
  6022. </p></dd>
  6023. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  6024. <dd><p>consider all spec non compliancies as errors
  6025. </p></dd>
  6026. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  6027. <dd><p>consider things that a sane encoder should not do as an error
  6028. </p></dd>
  6029. </dl>
  6030. </dd>
  6031. <dt>&lsquo;<samp>has_b_frames <var>integer</var></samp>&rsquo;</dt>
  6032. <dt>&lsquo;<samp>block_align <var>integer</var></samp>&rsquo;</dt>
  6033. <dt>&lsquo;<samp>mpeg_quant <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6034. <dd><p>Use MPEG quantizers instead of H.263.
  6035. </p>
  6036. </dd>
  6037. <dt>&lsquo;<samp>qsquish <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6038. <dd><p>How to keep quantizer between qmin and qmax (0 = clip, 1 = use
  6039. differentiable function).
  6040. </p>
  6041. </dd>
  6042. <dt>&lsquo;<samp>rc_qmod_amp <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6043. <dd><p>Set experimental quantizer modulation.
  6044. </p>
  6045. </dd>
  6046. <dt>&lsquo;<samp>rc_qmod_freq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6047. <dd><p>Set experimental quantizer modulation.
  6048. </p>
  6049. </dd>
  6050. <dt>&lsquo;<samp>rc_override_count <var>integer</var></samp>&rsquo;</dt>
  6051. <dt>&lsquo;<samp>rc_eq <var>string</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6052. <dd><p>Set rate control equation. When computing the expression, besides the
  6053. standard functions defined in the section &rsquo;Expression Evaluation&rsquo;, the
  6054. following functions are available: bits2qp(bits), qp2bits(qp). Also
  6055. the following constants are available: iTex pTex tex mv fCode iCount
  6056. mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex
  6057. avgTex.
  6058. </p>
  6059. </dd>
  6060. <dt>&lsquo;<samp>maxrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6061. <dd><p>Set max bitrate tolerance (in bits/s). Requires bufsize to be set.
  6062. </p>
  6063. </dd>
  6064. <dt>&lsquo;<samp>minrate <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6065. <dd><p>Set min bitrate tolerance (in bits/s). Most useful in setting up a CBR
  6066. encode. It is of little use elsewise.
  6067. </p>
  6068. </dd>
  6069. <dt>&lsquo;<samp>bufsize <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6070. <dd><p>Set ratecontrol buffer size (in bits).
  6071. </p>
  6072. </dd>
  6073. <dt>&lsquo;<samp>rc_buf_aggressivity <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6074. <dd><p>Currently useless.
  6075. </p>
  6076. </dd>
  6077. <dt>&lsquo;<samp>i_qfactor <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6078. <dd><p>Set QP factor between P and I frames.
  6079. </p>
  6080. </dd>
  6081. <dt>&lsquo;<samp>i_qoffset <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6082. <dd><p>Set QP offset between P and I frames.
  6083. </p>
  6084. </dd>
  6085. <dt>&lsquo;<samp>rc_init_cplx <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6086. <dd><p>Set initial complexity for 1-pass encoding.
  6087. </p>
  6088. </dd>
  6089. <dt>&lsquo;<samp>dct <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6090. <dd><p>Set DCT algorithm.
  6091. </p>
  6092. <p>Possible values:
  6093. </p><dl compact="compact">
  6094. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6095. <dd><p>autoselect a good one (default)
  6096. </p></dd>
  6097. <dt>&lsquo;<samp>fastint</samp>&rsquo;</dt>
  6098. <dd><p>fast integer
  6099. </p></dd>
  6100. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6101. <dd><p>accurate integer
  6102. </p></dd>
  6103. <dt>&lsquo;<samp>mmx</samp>&rsquo;</dt>
  6104. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6105. <dt>&lsquo;<samp>faan</samp>&rsquo;</dt>
  6106. <dd><p>floating point AAN DCT
  6107. </p></dd>
  6108. </dl>
  6109. </dd>
  6110. <dt>&lsquo;<samp>lumi_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6111. <dd><p>Compress bright areas stronger than medium ones.
  6112. </p>
  6113. </dd>
  6114. <dt>&lsquo;<samp>tcplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6115. <dd><p>Set temporal complexity masking.
  6116. </p>
  6117. </dd>
  6118. <dt>&lsquo;<samp>scplx_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6119. <dd><p>Set spatial complexity masking.
  6120. </p>
  6121. </dd>
  6122. <dt>&lsquo;<samp>p_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6123. <dd><p>Set inter masking.
  6124. </p>
  6125. </dd>
  6126. <dt>&lsquo;<samp>dark_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6127. <dd><p>Compress dark areas stronger than medium ones.
  6128. </p>
  6129. </dd>
  6130. <dt>&lsquo;<samp>idct <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6131. <dd><p>Select IDCT implementation.
  6132. </p>
  6133. <p>Possible values:
  6134. </p><dl compact="compact">
  6135. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  6136. <dt>&lsquo;<samp>int</samp>&rsquo;</dt>
  6137. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6138. <dt>&lsquo;<samp>simplemmx</samp>&rsquo;</dt>
  6139. <dt>&lsquo;<samp>simpleauto</samp>&rsquo;</dt>
  6140. <dd><p>Automatically pick a IDCT compatible with the simple one
  6141. </p>
  6142. </dd>
  6143. <dt>&lsquo;<samp>arm</samp>&rsquo;</dt>
  6144. <dt>&lsquo;<samp>altivec</samp>&rsquo;</dt>
  6145. <dt>&lsquo;<samp>sh4</samp>&rsquo;</dt>
  6146. <dt>&lsquo;<samp>simplearm</samp>&rsquo;</dt>
  6147. <dt>&lsquo;<samp>simplearmv5te</samp>&rsquo;</dt>
  6148. <dt>&lsquo;<samp>simplearmv6</samp>&rsquo;</dt>
  6149. <dt>&lsquo;<samp>simpleneon</samp>&rsquo;</dt>
  6150. <dt>&lsquo;<samp>simplealpha</samp>&rsquo;</dt>
  6151. <dt>&lsquo;<samp>ipp</samp>&rsquo;</dt>
  6152. <dt>&lsquo;<samp>xvidmmx</samp>&rsquo;</dt>
  6153. <dt>&lsquo;<samp>faani</samp>&rsquo;</dt>
  6154. <dd><p>floating point AAN IDCT
  6155. </p></dd>
  6156. </dl>
  6157. </dd>
  6158. <dt>&lsquo;<samp>slice_count <var>integer</var></samp>&rsquo;</dt>
  6159. <dt>&lsquo;<samp>ec <var>flags</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6160. <dd><p>Set error concealment strategy.
  6161. </p>
  6162. <p>Possible values:
  6163. </p><dl compact="compact">
  6164. <dt>&lsquo;<samp>guess_mvs</samp>&rsquo;</dt>
  6165. <dd><p>iterative motion vector (MV) search (slow)
  6166. </p></dd>
  6167. <dt>&lsquo;<samp>deblock</samp>&rsquo;</dt>
  6168. <dd><p>use strong deblock filter for damaged MBs
  6169. </p></dd>
  6170. <dt>&lsquo;<samp>favor_inter</samp>&rsquo;</dt>
  6171. <dd><p>favor predicting from the previous frame instead of the current
  6172. </p></dd>
  6173. </dl>
  6174. </dd>
  6175. <dt>&lsquo;<samp>bits_per_coded_sample <var>integer</var></samp>&rsquo;</dt>
  6176. <dt>&lsquo;<samp>pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6177. <dd><p>Set prediction method.
  6178. </p>
  6179. <p>Possible values:
  6180. </p><dl compact="compact">
  6181. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  6182. <dt>&lsquo;<samp>plane</samp>&rsquo;</dt>
  6183. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  6184. </dl>
  6185. </dd>
  6186. <dt>&lsquo;<samp>aspect <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6187. <dd><p>Set sample aspect ratio.
  6188. </p>
  6189. </dd>
  6190. <dt>&lsquo;<samp>sar <var>rational number</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6191. <dd><p>Set sample aspect ratio. Alias to <var>aspect</var>.
  6192. </p>
  6193. </dd>
  6194. <dt>&lsquo;<samp>debug <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6195. <dd><p>Print specific debug info.
  6196. </p>
  6197. <p>Possible values:
  6198. </p><dl compact="compact">
  6199. <dt>&lsquo;<samp>pict</samp>&rsquo;</dt>
  6200. <dd><p>picture info
  6201. </p></dd>
  6202. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  6203. <dd><p>rate control
  6204. </p></dd>
  6205. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  6206. <dt>&lsquo;<samp>mb_type</samp>&rsquo;</dt>
  6207. <dd><p>macroblock (MB) type
  6208. </p></dd>
  6209. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  6210. <dd><p>per-block quantization parameter (QP)
  6211. </p></dd>
  6212. <dt>&lsquo;<samp>dct_coeff</samp>&rsquo;</dt>
  6213. <dt>&lsquo;<samp>green_metadata</samp>&rsquo;</dt>
  6214. <dd><p>display complexity metadata for the upcoming frame, GoP or for a given duration.
  6215. </p>
  6216. </dd>
  6217. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  6218. <dt>&lsquo;<samp>startcode</samp>&rsquo;</dt>
  6219. <dt>&lsquo;<samp>er</samp>&rsquo;</dt>
  6220. <dd><p>error recognition
  6221. </p></dd>
  6222. <dt>&lsquo;<samp>mmco</samp>&rsquo;</dt>
  6223. <dd><p>memory management control operations (H.264)
  6224. </p></dd>
  6225. <dt>&lsquo;<samp>bugs</samp>&rsquo;</dt>
  6226. <dt>&lsquo;<samp>buffers</samp>&rsquo;</dt>
  6227. <dd><p>picture buffer allocations
  6228. </p></dd>
  6229. <dt>&lsquo;<samp>thread_ops</samp>&rsquo;</dt>
  6230. <dd><p>threading operations
  6231. </p></dd>
  6232. <dt>&lsquo;<samp>nomc</samp>&rsquo;</dt>
  6233. <dd><p>skip motion compensation
  6234. </p></dd>
  6235. </dl>
  6236. </dd>
  6237. <dt>&lsquo;<samp>cmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6238. <dd><p>Set full pel me compare function.
  6239. </p>
  6240. <p>Possible values:
  6241. </p><dl compact="compact">
  6242. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6243. <dd><p>sum of absolute differences, fast (default)
  6244. </p></dd>
  6245. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6246. <dd><p>sum of squared errors
  6247. </p></dd>
  6248. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6249. <dd><p>sum of absolute Hadamard transformed differences
  6250. </p></dd>
  6251. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6252. <dd><p>sum of absolute DCT transformed differences
  6253. </p></dd>
  6254. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6255. <dd><p>sum of squared quantization errors (avoid, low quality)
  6256. </p></dd>
  6257. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6258. <dd><p>number of bits needed for the block
  6259. </p></dd>
  6260. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6261. <dd><p>rate distortion optimal, slow
  6262. </p></dd>
  6263. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6264. <dd><p>0
  6265. </p></dd>
  6266. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6267. <dd><p>sum of absolute vertical differences
  6268. </p></dd>
  6269. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6270. <dd><p>sum of squared vertical differences
  6271. </p></dd>
  6272. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6273. <dd><p>noise preserving sum of squared differences
  6274. </p></dd>
  6275. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6276. <dd><p>5/3 wavelet, only used in snow
  6277. </p></dd>
  6278. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6279. <dd><p>9/7 wavelet, only used in snow
  6280. </p></dd>
  6281. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6282. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6283. </dl>
  6284. </dd>
  6285. <dt>&lsquo;<samp>subcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6286. <dd><p>Set sub pel me compare function.
  6287. </p>
  6288. <p>Possible values:
  6289. </p><dl compact="compact">
  6290. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6291. <dd><p>sum of absolute differences, fast (default)
  6292. </p></dd>
  6293. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6294. <dd><p>sum of squared errors
  6295. </p></dd>
  6296. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6297. <dd><p>sum of absolute Hadamard transformed differences
  6298. </p></dd>
  6299. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6300. <dd><p>sum of absolute DCT transformed differences
  6301. </p></dd>
  6302. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6303. <dd><p>sum of squared quantization errors (avoid, low quality)
  6304. </p></dd>
  6305. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6306. <dd><p>number of bits needed for the block
  6307. </p></dd>
  6308. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6309. <dd><p>rate distortion optimal, slow
  6310. </p></dd>
  6311. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6312. <dd><p>0
  6313. </p></dd>
  6314. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6315. <dd><p>sum of absolute vertical differences
  6316. </p></dd>
  6317. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6318. <dd><p>sum of squared vertical differences
  6319. </p></dd>
  6320. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6321. <dd><p>noise preserving sum of squared differences
  6322. </p></dd>
  6323. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6324. <dd><p>5/3 wavelet, only used in snow
  6325. </p></dd>
  6326. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6327. <dd><p>9/7 wavelet, only used in snow
  6328. </p></dd>
  6329. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6330. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6331. </dl>
  6332. </dd>
  6333. <dt>&lsquo;<samp>mbcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6334. <dd><p>Set macroblock compare function.
  6335. </p>
  6336. <p>Possible values:
  6337. </p><dl compact="compact">
  6338. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6339. <dd><p>sum of absolute differences, fast (default)
  6340. </p></dd>
  6341. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6342. <dd><p>sum of squared errors
  6343. </p></dd>
  6344. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6345. <dd><p>sum of absolute Hadamard transformed differences
  6346. </p></dd>
  6347. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6348. <dd><p>sum of absolute DCT transformed differences
  6349. </p></dd>
  6350. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6351. <dd><p>sum of squared quantization errors (avoid, low quality)
  6352. </p></dd>
  6353. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6354. <dd><p>number of bits needed for the block
  6355. </p></dd>
  6356. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6357. <dd><p>rate distortion optimal, slow
  6358. </p></dd>
  6359. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6360. <dd><p>0
  6361. </p></dd>
  6362. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6363. <dd><p>sum of absolute vertical differences
  6364. </p></dd>
  6365. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6366. <dd><p>sum of squared vertical differences
  6367. </p></dd>
  6368. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6369. <dd><p>noise preserving sum of squared differences
  6370. </p></dd>
  6371. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6372. <dd><p>5/3 wavelet, only used in snow
  6373. </p></dd>
  6374. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6375. <dd><p>9/7 wavelet, only used in snow
  6376. </p></dd>
  6377. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6378. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6379. </dl>
  6380. </dd>
  6381. <dt>&lsquo;<samp>ildctcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6382. <dd><p>Set interlaced dct compare function.
  6383. </p>
  6384. <p>Possible values:
  6385. </p><dl compact="compact">
  6386. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6387. <dd><p>sum of absolute differences, fast (default)
  6388. </p></dd>
  6389. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6390. <dd><p>sum of squared errors
  6391. </p></dd>
  6392. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6393. <dd><p>sum of absolute Hadamard transformed differences
  6394. </p></dd>
  6395. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6396. <dd><p>sum of absolute DCT transformed differences
  6397. </p></dd>
  6398. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6399. <dd><p>sum of squared quantization errors (avoid, low quality)
  6400. </p></dd>
  6401. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6402. <dd><p>number of bits needed for the block
  6403. </p></dd>
  6404. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6405. <dd><p>rate distortion optimal, slow
  6406. </p></dd>
  6407. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6408. <dd><p>0
  6409. </p></dd>
  6410. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6411. <dd><p>sum of absolute vertical differences
  6412. </p></dd>
  6413. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6414. <dd><p>sum of squared vertical differences
  6415. </p></dd>
  6416. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6417. <dd><p>noise preserving sum of squared differences
  6418. </p></dd>
  6419. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6420. <dd><p>5/3 wavelet, only used in snow
  6421. </p></dd>
  6422. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6423. <dd><p>9/7 wavelet, only used in snow
  6424. </p></dd>
  6425. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6426. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6427. </dl>
  6428. </dd>
  6429. <dt>&lsquo;<samp>dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6430. <dd><p>Set diamond type &amp; size for motion estimation.
  6431. </p>
  6432. </dd>
  6433. <dt>&lsquo;<samp>last_pred <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6434. <dd><p>Set amount of motion predictors from the previous frame.
  6435. </p>
  6436. </dd>
  6437. <dt>&lsquo;<samp>preme <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6438. <dd><p>Set pre motion estimation.
  6439. </p>
  6440. </dd>
  6441. <dt>&lsquo;<samp>precmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6442. <dd><p>Set pre motion estimation compare function.
  6443. </p>
  6444. <p>Possible values:
  6445. </p><dl compact="compact">
  6446. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6447. <dd><p>sum of absolute differences, fast (default)
  6448. </p></dd>
  6449. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6450. <dd><p>sum of squared errors
  6451. </p></dd>
  6452. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6453. <dd><p>sum of absolute Hadamard transformed differences
  6454. </p></dd>
  6455. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6456. <dd><p>sum of absolute DCT transformed differences
  6457. </p></dd>
  6458. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6459. <dd><p>sum of squared quantization errors (avoid, low quality)
  6460. </p></dd>
  6461. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6462. <dd><p>number of bits needed for the block
  6463. </p></dd>
  6464. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6465. <dd><p>rate distortion optimal, slow
  6466. </p></dd>
  6467. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6468. <dd><p>0
  6469. </p></dd>
  6470. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6471. <dd><p>sum of absolute vertical differences
  6472. </p></dd>
  6473. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6474. <dd><p>sum of squared vertical differences
  6475. </p></dd>
  6476. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6477. <dd><p>noise preserving sum of squared differences
  6478. </p></dd>
  6479. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6480. <dd><p>5/3 wavelet, only used in snow
  6481. </p></dd>
  6482. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6483. <dd><p>9/7 wavelet, only used in snow
  6484. </p></dd>
  6485. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6486. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6487. </dl>
  6488. </dd>
  6489. <dt>&lsquo;<samp>pre_dia_size <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6490. <dd><p>Set diamond type &amp; size for motion estimation pre-pass.
  6491. </p>
  6492. </dd>
  6493. <dt>&lsquo;<samp>subq <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6494. <dd><p>Set sub pel motion estimation quality.
  6495. </p>
  6496. </dd>
  6497. <dt>&lsquo;<samp>dtg_active_format <var>integer</var></samp>&rsquo;</dt>
  6498. <dt>&lsquo;<samp>me_range <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6499. <dd><p>Set limit motion vectors range (1023 for DivX player).
  6500. </p>
  6501. </dd>
  6502. <dt>&lsquo;<samp>ibias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6503. <dd><p>Set intra quant bias.
  6504. </p>
  6505. </dd>
  6506. <dt>&lsquo;<samp>pbias <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6507. <dd><p>Set inter quant bias.
  6508. </p>
  6509. </dd>
  6510. <dt>&lsquo;<samp>color_table_id <var>integer</var></samp>&rsquo;</dt>
  6511. <dt>&lsquo;<samp>global_quality <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6512. <dt>&lsquo;<samp>coder <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6513. <dd>
  6514. <p>Possible values:
  6515. </p><dl compact="compact">
  6516. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  6517. <dd><p>variable length coder / huffman coder
  6518. </p></dd>
  6519. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  6520. <dd><p>arithmetic coder
  6521. </p></dd>
  6522. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  6523. <dd><p>raw (no encoding)
  6524. </p></dd>
  6525. <dt>&lsquo;<samp>rle</samp>&rsquo;</dt>
  6526. <dd><p>run-length coder
  6527. </p></dd>
  6528. <dt>&lsquo;<samp>deflate</samp>&rsquo;</dt>
  6529. <dd><p>deflate-based coder
  6530. </p></dd>
  6531. </dl>
  6532. </dd>
  6533. <dt>&lsquo;<samp>context <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6534. <dd><p>Set context model.
  6535. </p>
  6536. </dd>
  6537. <dt>&lsquo;<samp>slice_flags <var>integer</var></samp>&rsquo;</dt>
  6538. <dt>&lsquo;<samp>mbd <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6539. <dd><p>Set macroblock decision algorithm (high quality mode).
  6540. </p>
  6541. <p>Possible values:
  6542. </p><dl compact="compact">
  6543. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  6544. <dd><p>use mbcmp (default)
  6545. </p></dd>
  6546. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  6547. <dd><p>use fewest bits
  6548. </p></dd>
  6549. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6550. <dd><p>use best rate distortion
  6551. </p></dd>
  6552. </dl>
  6553. </dd>
  6554. <dt>&lsquo;<samp>stream_codec_tag <var>integer</var></samp>&rsquo;</dt>
  6555. <dt>&lsquo;<samp>sc_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6556. <dd><p>Set scene change threshold.
  6557. </p>
  6558. </dd>
  6559. <dt>&lsquo;<samp>lmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6560. <dd><p>Set min lagrange factor (VBR).
  6561. </p>
  6562. </dd>
  6563. <dt>&lsquo;<samp>lmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6564. <dd><p>Set max lagrange factor (VBR).
  6565. </p>
  6566. </dd>
  6567. <dt>&lsquo;<samp>nr <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6568. <dd><p>Set noise reduction.
  6569. </p>
  6570. </dd>
  6571. <dt>&lsquo;<samp>rc_init_occupancy <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6572. <dd><p>Set number of bits which should be loaded into the rc buffer before
  6573. decoding starts.
  6574. </p>
  6575. </dd>
  6576. <dt>&lsquo;<samp>flags2 <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6577. <dd>
  6578. <p>Possible values:
  6579. </p><dl compact="compact">
  6580. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  6581. <dd><p>Allow non spec compliant speedup tricks.
  6582. </p></dd>
  6583. <dt>&lsquo;<samp>noout</samp>&rsquo;</dt>
  6584. <dd><p>Skip bitstream encoding.
  6585. </p></dd>
  6586. <dt>&lsquo;<samp>ignorecrop</samp>&rsquo;</dt>
  6587. <dd><p>Ignore cropping information from sps.
  6588. </p></dd>
  6589. <dt>&lsquo;<samp>local_header</samp>&rsquo;</dt>
  6590. <dd><p>Place global headers at every keyframe instead of in extradata.
  6591. </p></dd>
  6592. <dt>&lsquo;<samp>chunks</samp>&rsquo;</dt>
  6593. <dd><p>Frame data might be split into multiple chunks.
  6594. </p></dd>
  6595. <dt>&lsquo;<samp>showall</samp>&rsquo;</dt>
  6596. <dd><p>Show all frames before the first keyframe.
  6597. </p></dd>
  6598. <dt>&lsquo;<samp>export_mvs</samp>&rsquo;</dt>
  6599. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6600. for codecs that support it. See also &lsquo;<tt>doc/examples/export_mvs.c</tt>&rsquo;.
  6601. </p></dd>
  6602. <dt>&lsquo;<samp>skip_manual</samp>&rsquo;</dt>
  6603. <dd><p>Do not skip samples and export skip information as frame side data.
  6604. </p></dd>
  6605. <dt>&lsquo;<samp>ass_ro_flush_noop</samp>&rsquo;</dt>
  6606. <dd><p>Do not reset ASS ReadOrder field on flush.
  6607. </p></dd>
  6608. </dl>
  6609. </dd>
  6610. <dt>&lsquo;<samp>export_side_data <var>flags</var> (<em>decoding/encoding,audio,video,subtitles</em>)</samp>&rsquo;</dt>
  6611. <dd>
  6612. <p>Possible values:
  6613. </p><dl compact="compact">
  6614. <dt>&lsquo;<samp>mvs</samp>&rsquo;</dt>
  6615. <dd><p>Export motion vectors into frame side-data (see <code>AV_FRAME_DATA_MOTION_VECTORS</code>)
  6616. for codecs that support it. See also &lsquo;<tt>doc/examples/export_mvs.c</tt>&rsquo;.
  6617. </p></dd>
  6618. <dt>&lsquo;<samp>prft</samp>&rsquo;</dt>
  6619. <dd><p>Export encoder Producer Reference Time into packet side-data (see <code>AV_PKT_DATA_PRFT</code>)
  6620. for codecs that support it.
  6621. </p></dd>
  6622. </dl>
  6623. </dd>
  6624. <dt>&lsquo;<samp>error <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6625. <dt>&lsquo;<samp>qns <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6626. <dd><p>Deprecated, use mpegvideo private options instead.
  6627. </p>
  6628. </dd>
  6629. <dt>&lsquo;<samp>threads <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6630. <dd><p>Set the number of threads to be used, in case the selected codec
  6631. implementation supports multi-threading.
  6632. </p>
  6633. <p>Possible values:
  6634. </p><dl compact="compact">
  6635. <dt>&lsquo;<samp>auto, 0</samp>&rsquo;</dt>
  6636. <dd><p>automatically select the number of threads to set
  6637. </p></dd>
  6638. </dl>
  6639. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  6640. </p>
  6641. </dd>
  6642. <dt>&lsquo;<samp>me_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6643. <dd><p>Set motion estimation threshold.
  6644. </p>
  6645. </dd>
  6646. <dt>&lsquo;<samp>mb_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6647. <dd><p>Set macroblock threshold.
  6648. </p>
  6649. </dd>
  6650. <dt>&lsquo;<samp>dc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6651. <dd><p>Set intra_dc_precision.
  6652. </p>
  6653. </dd>
  6654. <dt>&lsquo;<samp>nssew <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6655. <dd><p>Set nsse weight.
  6656. </p>
  6657. </dd>
  6658. <dt>&lsquo;<samp>skip_top <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6659. <dd><p>Set number of macroblock rows at the top which are skipped.
  6660. </p>
  6661. </dd>
  6662. <dt>&lsquo;<samp>skip_bottom <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6663. <dd><p>Set number of macroblock rows at the bottom which are skipped.
  6664. </p>
  6665. </dd>
  6666. <dt>&lsquo;<samp>profile <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6667. <dd>
  6668. <p>Possible values:
  6669. </p><dl compact="compact">
  6670. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  6671. <dt>&lsquo;<samp>aac_main</samp>&rsquo;</dt>
  6672. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  6673. <dt>&lsquo;<samp>aac_ssr</samp>&rsquo;</dt>
  6674. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  6675. <dt>&lsquo;<samp>aac_he</samp>&rsquo;</dt>
  6676. <dt>&lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
  6677. <dt>&lsquo;<samp>aac_ld</samp>&rsquo;</dt>
  6678. <dt>&lsquo;<samp>aac_eld</samp>&rsquo;</dt>
  6679. <dt>&lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
  6680. <dt>&lsquo;<samp>mpeg2_aac_he</samp>&rsquo;</dt>
  6681. <dt>&lsquo;<samp>mpeg4_sp</samp>&rsquo;</dt>
  6682. <dt>&lsquo;<samp>mpeg4_core</samp>&rsquo;</dt>
  6683. <dt>&lsquo;<samp>mpeg4_main</samp>&rsquo;</dt>
  6684. <dt>&lsquo;<samp>mpeg4_asp</samp>&rsquo;</dt>
  6685. <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
  6686. <dt>&lsquo;<samp>dts_es</samp>&rsquo;</dt>
  6687. <dt>&lsquo;<samp>dts_96_24</samp>&rsquo;</dt>
  6688. <dt>&lsquo;<samp>dts_hd_hra</samp>&rsquo;</dt>
  6689. <dt>&lsquo;<samp>dts_hd_ma</samp>&rsquo;</dt>
  6690. </dl>
  6691. </dd>
  6692. <dt>&lsquo;<samp>level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6693. <dd>
  6694. <p>Possible values:
  6695. </p><dl compact="compact">
  6696. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  6697. </dl>
  6698. </dd>
  6699. <dt>&lsquo;<samp>lowres <var>integer</var> (<em>decoding,audio,video</em>)</samp>&rsquo;</dt>
  6700. <dd><p>Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
  6701. </p>
  6702. </dd>
  6703. <dt>&lsquo;<samp>skip_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6704. <dd><p>Set frame skip threshold.
  6705. </p>
  6706. </dd>
  6707. <dt>&lsquo;<samp>skip_factor <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6708. <dd><p>Set frame skip factor.
  6709. </p>
  6710. </dd>
  6711. <dt>&lsquo;<samp>skip_exp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6712. <dd><p>Set frame skip exponent.
  6713. Negative values behave identical to the corresponding positive ones, except
  6714. that the score is normalized.
  6715. Positive values exist primarily for compatibility reasons and are not so useful.
  6716. </p>
  6717. </dd>
  6718. <dt>&lsquo;<samp>skipcmp <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6719. <dd><p>Set frame skip compare function.
  6720. </p>
  6721. <p>Possible values:
  6722. </p><dl compact="compact">
  6723. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  6724. <dd><p>sum of absolute differences, fast (default)
  6725. </p></dd>
  6726. <dt>&lsquo;<samp>sse</samp>&rsquo;</dt>
  6727. <dd><p>sum of squared errors
  6728. </p></dd>
  6729. <dt>&lsquo;<samp>satd</samp>&rsquo;</dt>
  6730. <dd><p>sum of absolute Hadamard transformed differences
  6731. </p></dd>
  6732. <dt>&lsquo;<samp>dct</samp>&rsquo;</dt>
  6733. <dd><p>sum of absolute DCT transformed differences
  6734. </p></dd>
  6735. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  6736. <dd><p>sum of squared quantization errors (avoid, low quality)
  6737. </p></dd>
  6738. <dt>&lsquo;<samp>bit</samp>&rsquo;</dt>
  6739. <dd><p>number of bits needed for the block
  6740. </p></dd>
  6741. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  6742. <dd><p>rate distortion optimal, slow
  6743. </p></dd>
  6744. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  6745. <dd><p>0
  6746. </p></dd>
  6747. <dt>&lsquo;<samp>vsad</samp>&rsquo;</dt>
  6748. <dd><p>sum of absolute vertical differences
  6749. </p></dd>
  6750. <dt>&lsquo;<samp>vsse</samp>&rsquo;</dt>
  6751. <dd><p>sum of squared vertical differences
  6752. </p></dd>
  6753. <dt>&lsquo;<samp>nsse</samp>&rsquo;</dt>
  6754. <dd><p>noise preserving sum of squared differences
  6755. </p></dd>
  6756. <dt>&lsquo;<samp>w53</samp>&rsquo;</dt>
  6757. <dd><p>5/3 wavelet, only used in snow
  6758. </p></dd>
  6759. <dt>&lsquo;<samp>w97</samp>&rsquo;</dt>
  6760. <dd><p>9/7 wavelet, only used in snow
  6761. </p></dd>
  6762. <dt>&lsquo;<samp>dctmax</samp>&rsquo;</dt>
  6763. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  6764. </dl>
  6765. </dd>
  6766. <dt>&lsquo;<samp>border_mask <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6767. <dd><p>Increase the quantizer for macroblocks close to borders.
  6768. </p>
  6769. </dd>
  6770. <dt>&lsquo;<samp>mblmin <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6771. <dd><p>Set min macroblock lagrange factor (VBR).
  6772. </p>
  6773. </dd>
  6774. <dt>&lsquo;<samp>mblmax <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6775. <dd><p>Set max macroblock lagrange factor (VBR).
  6776. </p>
  6777. </dd>
  6778. <dt>&lsquo;<samp>mepc <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6779. <dd><p>Set motion estimation bitrate penalty compensation (1.0 = 256).
  6780. </p>
  6781. </dd>
  6782. <dt>&lsquo;<samp>skip_loop_filter <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6783. <dt>&lsquo;<samp>skip_idct <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6784. <dt>&lsquo;<samp>skip_frame <var>integer</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  6785. <dd>
  6786. <p>Make decoder discard processing depending on the frame type selected
  6787. by the option value.
  6788. </p>
  6789. <p>&lsquo;<samp>skip_loop_filter</samp>&rsquo; skips frame loop filtering, &lsquo;<samp>skip_idct</samp>&rsquo;
  6790. skips frame IDCT/dequantization, &lsquo;<samp>skip_frame</samp>&rsquo; skips decoding.
  6791. </p>
  6792. <p>Possible values:
  6793. </p><dl compact="compact">
  6794. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  6795. <dd><p>Discard no frame.
  6796. </p>
  6797. </dd>
  6798. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  6799. <dd><p>Discard useless frames like 0-sized frames.
  6800. </p>
  6801. </dd>
  6802. <dt>&lsquo;<samp>noref</samp>&rsquo;</dt>
  6803. <dd><p>Discard all non-reference frames.
  6804. </p>
  6805. </dd>
  6806. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  6807. <dd><p>Discard all bidirectional frames.
  6808. </p>
  6809. </dd>
  6810. <dt>&lsquo;<samp>nokey</samp>&rsquo;</dt>
  6811. <dd><p>Discard all frames excepts keyframes.
  6812. </p>
  6813. </dd>
  6814. <dt>&lsquo;<samp>nointra</samp>&rsquo;</dt>
  6815. <dd><p>Discard all frames except I frames.
  6816. </p>
  6817. </dd>
  6818. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  6819. <dd><p>Discard all frames.
  6820. </p></dd>
  6821. </dl>
  6822. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  6823. </p>
  6824. </dd>
  6825. <dt>&lsquo;<samp>bidir_refine <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6826. <dd><p>Refine the two motion vectors used in bidirectional macroblocks.
  6827. </p>
  6828. </dd>
  6829. <dt>&lsquo;<samp>brd_scale <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6830. <dd><p>Downscale frames for dynamic B-frame decision.
  6831. </p>
  6832. </dd>
  6833. <dt>&lsquo;<samp>keyint_min <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6834. <dd><p>Set minimum interval between IDR-frames.
  6835. </p>
  6836. </dd>
  6837. <dt>&lsquo;<samp>refs <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6838. <dd><p>Set reference frames to consider for motion compensation.
  6839. </p>
  6840. </dd>
  6841. <dt>&lsquo;<samp>chromaoffset <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6842. <dd><p>Set chroma qp offset from luma.
  6843. </p>
  6844. </dd>
  6845. <dt>&lsquo;<samp>trellis <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6846. <dd><p>Set rate-distortion optimal quantization.
  6847. </p>
  6848. </dd>
  6849. <dt>&lsquo;<samp>mv0_threshold <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6850. <dt>&lsquo;<samp>b_sensitivity <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6851. <dd><p>Adjust sensitivity of b_frame_strategy 1.
  6852. </p>
  6853. </dd>
  6854. <dt>&lsquo;<samp>compression_level <var>integer</var> (<em>encoding,audio,video</em>)</samp>&rsquo;</dt>
  6855. <dt>&lsquo;<samp>min_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  6856. <dt>&lsquo;<samp>max_prediction_order <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  6857. <dt>&lsquo;<samp>timecode_frame_start <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6858. <dd><p>Set GOP timecode frame start number, in non drop frame format.
  6859. </p>
  6860. </dd>
  6861. <dt>&lsquo;<samp>request_channels <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  6862. <dd><p>Set desired number of audio channels.
  6863. </p>
  6864. </dd>
  6865. <dt>&lsquo;<samp>bits_per_raw_sample <var>integer</var></samp>&rsquo;</dt>
  6866. <dt>&lsquo;<samp>channel_layout <var>integer</var> (<em>decoding/encoding,audio</em>)</samp>&rsquo;</dt>
  6867. <dd>
  6868. <p>Possible values:
  6869. </p></dd>
  6870. <dt>&lsquo;<samp>request_channel_layout <var>integer</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  6871. <dd>
  6872. <p>Possible values:
  6873. </p></dd>
  6874. <dt>&lsquo;<samp>rc_max_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6875. <dt>&lsquo;<samp>rc_min_vbv_use <var>float</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  6876. <dt>&lsquo;<samp>ticks_per_frame <var>integer</var> (<em>decoding/encoding,audio,video</em>)</samp>&rsquo;</dt>
  6877. <dt>&lsquo;<samp>color_primaries <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6878. <dd><p>Possible values:
  6879. </p><dl compact="compact">
  6880. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  6881. <dd><p>BT.709
  6882. </p></dd>
  6883. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  6884. <dd><p>BT.470 M
  6885. </p></dd>
  6886. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  6887. <dd><p>BT.470 BG
  6888. </p></dd>
  6889. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  6890. <dd><p>SMPTE 170 M
  6891. </p></dd>
  6892. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  6893. <dd><p>SMPTE 240 M
  6894. </p></dd>
  6895. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  6896. <dd><p>Film
  6897. </p></dd>
  6898. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  6899. <dd><p>BT.2020
  6900. </p></dd>
  6901. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  6902. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  6903. <dd><p>SMPTE ST 428-1
  6904. </p></dd>
  6905. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  6906. <dd><p>SMPTE 431-2
  6907. </p></dd>
  6908. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  6909. <dd><p>SMPTE 432-1
  6910. </p></dd>
  6911. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  6912. <dd><p>JEDEC P22
  6913. </p></dd>
  6914. </dl>
  6915. </dd>
  6916. <dt>&lsquo;<samp>color_trc <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6917. <dd><p>Possible values:
  6918. </p><dl compact="compact">
  6919. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  6920. <dd><p>BT.709
  6921. </p></dd>
  6922. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  6923. <dd><p>BT.470 M
  6924. </p></dd>
  6925. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  6926. <dd><p>BT.470 BG
  6927. </p></dd>
  6928. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  6929. <dd><p>SMPTE 170 M
  6930. </p></dd>
  6931. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  6932. <dd><p>SMPTE 240 M
  6933. </p></dd>
  6934. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  6935. <dd><p>Linear
  6936. </p></dd>
  6937. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  6938. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  6939. <dd><p>Log
  6940. </p></dd>
  6941. <dt>&lsquo;<samp>log_sqrt</samp>&rsquo;</dt>
  6942. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  6943. <dd><p>Log square root
  6944. </p></dd>
  6945. <dt>&lsquo;<samp>iec61966_2_4</samp>&rsquo;</dt>
  6946. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  6947. <dd><p>IEC 61966-2-4
  6948. </p></dd>
  6949. <dt>&lsquo;<samp>bt1361</samp>&rsquo;</dt>
  6950. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  6951. <dd><p>BT.1361
  6952. </p></dd>
  6953. <dt>&lsquo;<samp>iec61966_2_1</samp>&rsquo;</dt>
  6954. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  6955. <dd><p>IEC 61966-2-1
  6956. </p></dd>
  6957. <dt>&lsquo;<samp>bt2020_10</samp>&rsquo;</dt>
  6958. <dt>&lsquo;<samp>bt2020_10bit</samp>&rsquo;</dt>
  6959. <dd><p>BT.2020 - 10 bit
  6960. </p></dd>
  6961. <dt>&lsquo;<samp>bt2020_12</samp>&rsquo;</dt>
  6962. <dt>&lsquo;<samp>bt2020_12bit</samp>&rsquo;</dt>
  6963. <dd><p>BT.2020 - 12 bit
  6964. </p></dd>
  6965. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  6966. <dd><p>SMPTE ST 2084
  6967. </p></dd>
  6968. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  6969. <dt>&lsquo;<samp>smpte428_1</samp>&rsquo;</dt>
  6970. <dd><p>SMPTE ST 428-1
  6971. </p></dd>
  6972. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  6973. <dd><p>ARIB STD-B67
  6974. </p></dd>
  6975. </dl>
  6976. </dd>
  6977. <dt>&lsquo;<samp>colorspace <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  6978. <dd><p>Possible values:
  6979. </p><dl compact="compact">
  6980. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  6981. <dd><p>RGB
  6982. </p></dd>
  6983. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  6984. <dd><p>BT.709
  6985. </p></dd>
  6986. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  6987. <dd><p>FCC
  6988. </p></dd>
  6989. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  6990. <dd><p>BT.470 BG
  6991. </p></dd>
  6992. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  6993. <dd><p>SMPTE 170 M
  6994. </p></dd>
  6995. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  6996. <dd><p>SMPTE 240 M
  6997. </p></dd>
  6998. <dt>&lsquo;<samp>ycocg</samp>&rsquo;</dt>
  6999. <dd><p>YCOCG
  7000. </p></dd>
  7001. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  7002. <dt>&lsquo;<samp>bt2020_ncl</samp>&rsquo;</dt>
  7003. <dd><p>BT.2020 NCL
  7004. </p></dd>
  7005. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  7006. <dt>&lsquo;<samp>bt2020_cl</samp>&rsquo;</dt>
  7007. <dd><p>BT.2020 CL
  7008. </p></dd>
  7009. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  7010. <dd><p>SMPTE 2085
  7011. </p></dd>
  7012. </dl>
  7013. </dd>
  7014. <dt>&lsquo;<samp>color_range <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7015. <dd><p>If used as input parameter, it serves as a hint to the decoder, which
  7016. color_range the input has.
  7017. Possible values:
  7018. </p><dl compact="compact">
  7019. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  7020. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  7021. <dd><p>MPEG (219*2^(n-8))
  7022. </p></dd>
  7023. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  7024. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  7025. <dd><p>JPEG (2^n-1)
  7026. </p></dd>
  7027. </dl>
  7028. </dd>
  7029. <dt>&lsquo;<samp>chroma_sample_location <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7030. <dd><p>Possible values:
  7031. </p><dl compact="compact">
  7032. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  7033. <dt>&lsquo;<samp>center</samp>&rsquo;</dt>
  7034. <dt>&lsquo;<samp>topleft</samp>&rsquo;</dt>
  7035. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  7036. <dt>&lsquo;<samp>bottomleft</samp>&rsquo;</dt>
  7037. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  7038. </dl>
  7039. </dd>
  7040. <dt>&lsquo;<samp>log_level_offset <var>integer</var></samp>&rsquo;</dt>
  7041. <dd><p>Set the log level offset.
  7042. </p>
  7043. </dd>
  7044. <dt>&lsquo;<samp>slices <var>integer</var> (<em>encoding,video</em>)</samp>&rsquo;</dt>
  7045. <dd><p>Number of slices, used in parallelized encoding.
  7046. </p>
  7047. </dd>
  7048. <dt>&lsquo;<samp>thread_type <var>flags</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7049. <dd><p>Select which multithreading methods to use.
  7050. </p>
  7051. <p>Use of &lsquo;<samp>frame</samp>&rsquo; will increase decoding delay by one frame per
  7052. thread, so clients which cannot provide future frames should not use
  7053. it.
  7054. </p>
  7055. <p>Possible values:
  7056. </p><dl compact="compact">
  7057. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  7058. <dd><p>Decode more than one part of a single frame at once.
  7059. </p>
  7060. <p>Multithreading using slices works only when the video was encoded with
  7061. slices.
  7062. </p>
  7063. </dd>
  7064. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  7065. <dd><p>Decode more than one frame at once.
  7066. </p></dd>
  7067. </dl>
  7068. <p>Default value is &lsquo;<samp>slice+frame</samp>&rsquo;.
  7069. </p>
  7070. </dd>
  7071. <dt>&lsquo;<samp>audio_service_type <var>integer</var> (<em>encoding,audio</em>)</samp>&rsquo;</dt>
  7072. <dd><p>Set audio service type.
  7073. </p>
  7074. <p>Possible values:
  7075. </p><dl compact="compact">
  7076. <dt>&lsquo;<samp>ma</samp>&rsquo;</dt>
  7077. <dd><p>Main Audio Service
  7078. </p></dd>
  7079. <dt>&lsquo;<samp>ef</samp>&rsquo;</dt>
  7080. <dd><p>Effects
  7081. </p></dd>
  7082. <dt>&lsquo;<samp>vi</samp>&rsquo;</dt>
  7083. <dd><p>Visually Impaired
  7084. </p></dd>
  7085. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  7086. <dd><p>Hearing Impaired
  7087. </p></dd>
  7088. <dt>&lsquo;<samp>di</samp>&rsquo;</dt>
  7089. <dd><p>Dialogue
  7090. </p></dd>
  7091. <dt>&lsquo;<samp>co</samp>&rsquo;</dt>
  7092. <dd><p>Commentary
  7093. </p></dd>
  7094. <dt>&lsquo;<samp>em</samp>&rsquo;</dt>
  7095. <dd><p>Emergency
  7096. </p></dd>
  7097. <dt>&lsquo;<samp>vo</samp>&rsquo;</dt>
  7098. <dd><p>Voice Over
  7099. </p></dd>
  7100. <dt>&lsquo;<samp>ka</samp>&rsquo;</dt>
  7101. <dd><p>Karaoke
  7102. </p></dd>
  7103. </dl>
  7104. </dd>
  7105. <dt>&lsquo;<samp>request_sample_fmt <var>sample_fmt</var> (<em>decoding,audio</em>)</samp>&rsquo;</dt>
  7106. <dd><p>Set sample format audio decoders should prefer. Default value is
  7107. <code>none</code>.
  7108. </p>
  7109. </dd>
  7110. <dt>&lsquo;<samp>pkt_timebase <var>rational number</var></samp>&rsquo;</dt>
  7111. <dt>&lsquo;<samp>sub_charenc <var>encoding</var> (<em>decoding,subtitles</em>)</samp>&rsquo;</dt>
  7112. <dd><p>Set the input subtitles character encoding.
  7113. </p>
  7114. </dd>
  7115. <dt>&lsquo;<samp>field_order <var>field_order</var> (<em>video</em>)</samp>&rsquo;</dt>
  7116. <dd><p>Set/override the field order of the video.
  7117. Possible values:
  7118. </p><dl compact="compact">
  7119. <dt>&lsquo;<samp>progressive</samp>&rsquo;</dt>
  7120. <dd><p>Progressive video
  7121. </p></dd>
  7122. <dt>&lsquo;<samp>tt</samp>&rsquo;</dt>
  7123. <dd><p>Interlaced video, top field coded and displayed first
  7124. </p></dd>
  7125. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  7126. <dd><p>Interlaced video, bottom field coded and displayed first
  7127. </p></dd>
  7128. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  7129. <dd><p>Interlaced video, top coded first, bottom displayed first
  7130. </p></dd>
  7131. <dt>&lsquo;<samp>bt</samp>&rsquo;</dt>
  7132. <dd><p>Interlaced video, bottom coded first, top displayed first
  7133. </p></dd>
  7134. </dl>
  7135. </dd>
  7136. <dt>&lsquo;<samp>skip_alpha <var>bool</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  7137. <dd><p>Set to 1 to disable processing alpha (transparency). This works like the
  7138. &lsquo;<samp>gray</samp>&rsquo; flag in the &lsquo;<samp>flags</samp>&rsquo; option which skips chroma information
  7139. instead of alpha. Default is 0.
  7140. </p>
  7141. </dd>
  7142. <dt>&lsquo;<samp>codec_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  7143. <dd><p>&quot;,&quot; separated list of allowed decoders. By default all are allowed.
  7144. </p>
  7145. </dd>
  7146. <dt>&lsquo;<samp>dump_separator <var>string</var> (<em>input</em>)</samp>&rsquo;</dt>
  7147. <dd><p>Separator used to separate the fields printed on the command line about the
  7148. Stream parameters.
  7149. For example, to separate the fields with newlines and indentation:
  7150. </p><div class="example">
  7151. <pre class="example">ffprobe -dump_separator &quot;
  7152. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  7153. </pre></div>
  7154. </dd>
  7155. <dt>&lsquo;<samp>max_pixels <var>integer</var> (<em>decoding/encoding,video</em>)</samp>&rsquo;</dt>
  7156. <dd><p>Maximum number of pixels per image. This value can be used to avoid out of
  7157. memory failures due to large images.
  7158. </p>
  7159. </dd>
  7160. <dt>&lsquo;<samp>apply_cropping <var>bool</var> (<em>decoding,video</em>)</samp>&rsquo;</dt>
  7161. <dd><p>Enable cropping if cropping parameters are multiples of the required
  7162. alignment for the left and top parameters. If the alignment is not met the
  7163. cropping will be partially applied to maintain alignment.
  7164. Default is 1 (enabled).
  7165. Note: The required alignment depends on if <code>AV_CODEC_FLAG_UNALIGNED</code> is set and the
  7166. CPU. <code>AV_CODEC_FLAG_UNALIGNED</code> cannot be changed from the command line. Also hardware
  7167. decoders will not apply left/top Cropping.
  7168. </p>
  7169. </dd>
  7170. </dl>
  7171. <a name="Decoders"></a>
  7172. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Decoders">10 Decoders</a></h1>
  7173. <p>Decoders are configured elements in FFmpeg which allow the decoding of
  7174. multimedia streams.
  7175. </p>
  7176. <p>When you configure your FFmpeg build, all the supported native decoders
  7177. are enabled by default. Decoders requiring an external library must be enabled
  7178. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7179. available decoders using the configure option <code>--list-decoders</code>.
  7180. </p>
  7181. <p>You can disable all the decoders with the configure option
  7182. <code>--disable-decoders</code> and selectively enable / disable single decoders
  7183. with the options <code>--enable-decoder=<var>DECODER</var></code> /
  7184. <code>--disable-decoder=<var>DECODER</var></code>.
  7185. </p>
  7186. <p>The option <code>-decoders</code> of the ff* tools will display the list of
  7187. enabled decoders.
  7188. </p>
  7189. <a name="Video-Decoders"></a>
  7190. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Decoders">11 Video Decoders</a></h1>
  7191. <p>A description of some of the currently available video decoders
  7192. follows.
  7193. </p>
  7194. <a name="rawvideo"></a>
  7195. <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo">11.1 rawvideo</a></h2>
  7196. <p>Raw video decoder.
  7197. </p>
  7198. <p>This decoder decodes rawvideo streams.
  7199. </p>
  7200. <a name="Options-16"></a>
  7201. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-16">11.1.1 Options</a></h3>
  7202. <dl compact="compact">
  7203. <dt>&lsquo;<samp>top <var>top_field_first</var></samp>&rsquo;</dt>
  7204. <dd><p>Specify the assumed field type of the input video.
  7205. </p><dl compact="compact">
  7206. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  7207. <dd><p>the video is assumed to be progressive (default)
  7208. </p></dd>
  7209. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7210. <dd><p>bottom-field-first is assumed
  7211. </p></dd>
  7212. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7213. <dd><p>top-field-first is assumed
  7214. </p></dd>
  7215. </dl>
  7216. </dd>
  7217. </dl>
  7218. <a name="libdav1d"></a>
  7219. <h2 class="section"><a href="ffmpeg-all.html#toc-libdav1d">11.2 libdav1d</a></h2>
  7220. <p>dav1d AV1 decoder.
  7221. </p>
  7222. <p>libdav1d allows libavcodec to decode the AOMedia Video 1 (AV1) codec.
  7223. Requires the presence of the libdav1d headers and library during configuration.
  7224. You need to explicitly configure the build with <code>--enable-libdav1d</code>.
  7225. </p>
  7226. <a name="Options-72"></a>
  7227. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-72">11.2.1 Options</a></h3>
  7228. <p>The following options are supported by the libdav1d wrapper.
  7229. </p>
  7230. <dl compact="compact">
  7231. <dt>&lsquo;<samp>framethreads</samp>&rsquo;</dt>
  7232. <dd><p>Set amount of frame threads to use during decoding. The default value is 0 (autodetect).
  7233. </p>
  7234. </dd>
  7235. <dt>&lsquo;<samp>tilethreads</samp>&rsquo;</dt>
  7236. <dd><p>Set amount of tile threads to use during decoding. The default value is 0 (autodetect).
  7237. </p>
  7238. </dd>
  7239. <dt>&lsquo;<samp>filmgrain</samp>&rsquo;</dt>
  7240. <dd><p>Apply film grain to the decoded video if present in the bitstream. Defaults to the
  7241. internal default of the library.
  7242. </p>
  7243. </dd>
  7244. <dt>&lsquo;<samp>oppoint</samp>&rsquo;</dt>
  7245. <dd><p>Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the
  7246. internal default of the library.
  7247. </p>
  7248. </dd>
  7249. <dt>&lsquo;<samp>alllayers</samp>&rsquo;</dt>
  7250. <dd><p>Output all spatial layers of a scalable AV1 bitstream. The default value is false.
  7251. </p>
  7252. </dd>
  7253. </dl>
  7254. <a name="libdavs2"></a>
  7255. <h2 class="section"><a href="ffmpeg-all.html#toc-libdavs2">11.3 libdavs2</a></h2>
  7256. <p>AVS2-P2/IEEE1857.4 video decoder wrapper.
  7257. </p>
  7258. <p>This decoder allows libavcodec to decode AVS2 streams with davs2 library.
  7259. </p>
  7260. <a name="Audio-Decoders"></a>
  7261. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Decoders">12 Audio Decoders</a></h1>
  7262. <p>A description of some of the currently available audio decoders
  7263. follows.
  7264. </p>
  7265. <a name="ac3"></a>
  7266. <h2 class="section"><a href="ffmpeg-all.html#toc-ac3">12.1 ac3</a></h2>
  7267. <p>AC-3 audio decoder.
  7268. </p>
  7269. <p>This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  7270. the undocumented RealAudio 3 (a.k.a. dnet).
  7271. </p>
  7272. <a name="AC_002d3-Decoder-Options"></a>
  7273. <h3 class="subsection"><a href="ffmpeg-all.html#toc-AC_002d3-Decoder-Options">12.1.1 AC-3 Decoder Options</a></h3>
  7274. <dl compact="compact">
  7275. <dt>&lsquo;<samp>-drc_scale <var>value</var></samp>&rsquo;</dt>
  7276. <dd><p>Dynamic Range Scale Factor. The factor to apply to dynamic range values
  7277. from the AC-3 stream. This factor is applied exponentially.
  7278. There are 3 notable scale factor ranges:
  7279. </p><dl compact="compact">
  7280. <dt>&lsquo;<samp>drc_scale == 0</samp>&rsquo;</dt>
  7281. <dd><p>DRC disabled. Produces full range audio.
  7282. </p></dd>
  7283. <dt>&lsquo;<samp>0 &lt; drc_scale &lt;= 1</samp>&rsquo;</dt>
  7284. <dd><p>DRC enabled. Applies a fraction of the stream DRC value.
  7285. Audio reproduction is between full range and full compression.
  7286. </p></dd>
  7287. <dt>&lsquo;<samp>drc_scale &gt; 1</samp>&rsquo;</dt>
  7288. <dd><p>DRC enabled. Applies drc_scale asymmetrically.
  7289. Loud sounds are fully compressed. Soft sounds are enhanced.
  7290. </p></dd>
  7291. </dl>
  7292. </dd>
  7293. </dl>
  7294. <a name="flac-2"></a>
  7295. <h2 class="section"><a href="ffmpeg-all.html#toc-flac-2">12.2 flac</a></h2>
  7296. <p>FLAC audio decoder.
  7297. </p>
  7298. <p>This decoder aims to implement the complete FLAC specification from Xiph.
  7299. </p>
  7300. <a name="FLAC-Decoder-options"></a>
  7301. <h3 class="subsection"><a href="ffmpeg-all.html#toc-FLAC-Decoder-options">12.2.1 FLAC Decoder options</a></h3>
  7302. <dl compact="compact">
  7303. <dt>&lsquo;<samp>-use_buggy_lpc</samp>&rsquo;</dt>
  7304. <dd><p>The lavc FLAC encoder used to produce buggy streams with high lpc values
  7305. (like the default value). This option makes it possible to decode such streams
  7306. correctly by using lavc&rsquo;s old buggy lpc logic for decoding.
  7307. </p>
  7308. </dd>
  7309. </dl>
  7310. <a name="ffwavesynth"></a>
  7311. <h2 class="section"><a href="ffmpeg-all.html#toc-ffwavesynth">12.3 ffwavesynth</a></h2>
  7312. <p>Internal wave synthesizer.
  7313. </p>
  7314. <p>This decoder generates wave patterns according to predefined sequences. Its
  7315. use is purely internal and the format of the data it accepts is not publicly
  7316. documented.
  7317. </p>
  7318. <a name="libcelt"></a>
  7319. <h2 class="section"><a href="ffmpeg-all.html#toc-libcelt">12.4 libcelt</a></h2>
  7320. <p>libcelt decoder wrapper.
  7321. </p>
  7322. <p>libcelt allows libavcodec to decode the Xiph CELT ultra-low delay audio codec.
  7323. Requires the presence of the libcelt headers and library during configuration.
  7324. You need to explicitly configure the build with <code>--enable-libcelt</code>.
  7325. </p>
  7326. <a name="libgsm"></a>
  7327. <h2 class="section"><a href="ffmpeg-all.html#toc-libgsm">12.5 libgsm</a></h2>
  7328. <p>libgsm decoder wrapper.
  7329. </p>
  7330. <p>libgsm allows libavcodec to decode the GSM full rate audio codec. Requires
  7331. the presence of the libgsm headers and library during configuration. You need
  7332. to explicitly configure the build with <code>--enable-libgsm</code>.
  7333. </p>
  7334. <p>This decoder supports both the ordinary GSM and the Microsoft variant.
  7335. </p>
  7336. <a name="libilbc"></a>
  7337. <h2 class="section"><a href="ffmpeg-all.html#toc-libilbc">12.6 libilbc</a></h2>
  7338. <p>libilbc decoder wrapper.
  7339. </p>
  7340. <p>libilbc allows libavcodec to decode the Internet Low Bitrate Codec (iLBC)
  7341. audio codec. Requires the presence of the libilbc headers and library during
  7342. configuration. You need to explicitly configure the build with
  7343. <code>--enable-libilbc</code>.
  7344. </p>
  7345. <a name="Options-74"></a>
  7346. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-74">12.6.1 Options</a></h3>
  7347. <p>The following option is supported by the libilbc wrapper.
  7348. </p>
  7349. <dl compact="compact">
  7350. <dt>&lsquo;<samp>enhance</samp>&rsquo;</dt>
  7351. <dd>
  7352. <p>Enable the enhancement of the decoded audio when set to 1. The default
  7353. value is 0 (disabled).
  7354. </p>
  7355. </dd>
  7356. </dl>
  7357. <a name="libopencore_002damrnb"></a>
  7358. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb">12.7 libopencore-amrnb</a></h2>
  7359. <p>libopencore-amrnb decoder wrapper.
  7360. </p>
  7361. <p>libopencore-amrnb allows libavcodec to decode the Adaptive Multi-Rate
  7362. Narrowband audio codec. Using it requires the presence of the
  7363. libopencore-amrnb headers and library during configuration. You need to
  7364. explicitly configure the build with <code>--enable-libopencore-amrnb</code>.
  7365. </p>
  7366. <p>An FFmpeg native decoder for AMR-NB exists, so users can decode AMR-NB
  7367. without this library.
  7368. </p>
  7369. <a name="libopencore_002damrwb"></a>
  7370. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrwb">12.8 libopencore-amrwb</a></h2>
  7371. <p>libopencore-amrwb decoder wrapper.
  7372. </p>
  7373. <p>libopencore-amrwb allows libavcodec to decode the Adaptive Multi-Rate
  7374. Wideband audio codec. Using it requires the presence of the
  7375. libopencore-amrwb headers and library during configuration. You need to
  7376. explicitly configure the build with <code>--enable-libopencore-amrwb</code>.
  7377. </p>
  7378. <p>An FFmpeg native decoder for AMR-WB exists, so users can decode AMR-WB
  7379. without this library.
  7380. </p>
  7381. <a name="libopus"></a>
  7382. <h2 class="section"><a href="ffmpeg-all.html#toc-libopus">12.9 libopus</a></h2>
  7383. <p>libopus decoder wrapper.
  7384. </p>
  7385. <p>libopus allows libavcodec to decode the Opus Interactive Audio Codec.
  7386. Requires the presence of the libopus headers and library during
  7387. configuration. You need to explicitly configure the build with
  7388. <code>--enable-libopus</code>.
  7389. </p>
  7390. <p>An FFmpeg native decoder for Opus exists, so users can decode Opus
  7391. without this library.
  7392. </p>
  7393. <a name="Subtitles-Decoders"></a>
  7394. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Subtitles-Decoders">13 Subtitles Decoders</a></h1>
  7395. <a name="libaribb24"></a>
  7396. <h2 class="section"><a href="ffmpeg-all.html#toc-libaribb24">13.1 libaribb24</a></h2>
  7397. <p>ARIB STD-B24 caption decoder.
  7398. </p>
  7399. <p>Implements profiles A and C of the ARIB STD-B24 standard.
  7400. </p>
  7401. <a name="libaribb24-Decoder-Options"></a>
  7402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-libaribb24-Decoder-Options">13.1.1 libaribb24 Decoder Options</a></h3>
  7403. <dl compact="compact">
  7404. <dt>&lsquo;<samp>-aribb24-base-path <var>path</var></samp>&rsquo;</dt>
  7405. <dd><p>Sets the base path for the libaribb24 library. This is utilized for reading of
  7406. configuration files (for custom unicode conversions), and for dumping of
  7407. non-text symbols as images under that location.
  7408. </p>
  7409. <p>Unset by default.
  7410. </p>
  7411. </dd>
  7412. <dt>&lsquo;<samp>-aribb24-skip-ruby-text <var>boolean</var></samp>&rsquo;</dt>
  7413. <dd><p>Tells the decoder wrapper to skip text blocks that contain half-height ruby
  7414. text.
  7415. </p>
  7416. <p>Enabled by default.
  7417. </p>
  7418. </dd>
  7419. </dl>
  7420. <a name="dvbsub"></a>
  7421. <h2 class="section"><a href="ffmpeg-all.html#toc-dvbsub">13.2 dvbsub</a></h2>
  7422. <a name="Options-85"></a>
  7423. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-85">13.2.1 Options</a></h3>
  7424. <dl compact="compact">
  7425. <dt>&lsquo;<samp>compute_clut</samp>&rsquo;</dt>
  7426. <dd><dl compact="compact">
  7427. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  7428. <dd><p>Compute clut if no matching CLUT is in the stream.
  7429. </p></dd>
  7430. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7431. <dd><p>Never compute CLUT
  7432. </p></dd>
  7433. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7434. <dd><p>Always compute CLUT and override the one provided in the stream.
  7435. </p></dd>
  7436. </dl>
  7437. </dd>
  7438. <dt>&lsquo;<samp>dvb_substream</samp>&rsquo;</dt>
  7439. <dd><p>Selects the dvb substream, or all substreams if -1 which is default.
  7440. </p>
  7441. </dd>
  7442. </dl>
  7443. <a name="dvdsub-1"></a>
  7444. <h2 class="section"><a href="ffmpeg-all.html#toc-dvdsub-1">13.3 dvdsub</a></h2>
  7445. <p>This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
  7446. also be found in VobSub file pairs and in some Matroska files.
  7447. </p>
  7448. <a name="Options-40"></a>
  7449. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-40">13.3.1 Options</a></h3>
  7450. <dl compact="compact">
  7451. <dt>&lsquo;<samp>palette</samp>&rsquo;</dt>
  7452. <dd><p>Specify the global palette used by the bitmaps. When stored in VobSub, the
  7453. palette is normally specified in the index file; in Matroska, the palette is
  7454. stored in the codec extra-data in the same format as in VobSub. In DVDs, the
  7455. palette is stored in the IFO file, and therefore not available when reading
  7456. from dumped VOB files.
  7457. </p>
  7458. <p>The format for this option is a string containing 16 24-bits hexadecimal
  7459. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  7460. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  7461. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  7462. </p>
  7463. </dd>
  7464. <dt>&lsquo;<samp>ifo_palette</samp>&rsquo;</dt>
  7465. <dd><p>Specify the IFO file from which the global palette is obtained.
  7466. (experimental)
  7467. </p>
  7468. </dd>
  7469. <dt>&lsquo;<samp>forced_subs_only</samp>&rsquo;</dt>
  7470. <dd><p>Only decode subtitle entries marked as forced. Some titles have forced
  7471. and non-forced subtitles in the same track. Setting this flag to <code>1</code>
  7472. will only keep the forced subtitles. Default value is <code>0</code>.
  7473. </p></dd>
  7474. </dl>
  7475. <a name="libzvbi_002dteletext"></a>
  7476. <h2 class="section"><a href="ffmpeg-all.html#toc-libzvbi_002dteletext">13.4 libzvbi-teletext</a></h2>
  7477. <p>Libzvbi allows libavcodec to decode DVB teletext pages and DVB teletext
  7478. subtitles. Requires the presence of the libzvbi headers and library during
  7479. configuration. You need to explicitly configure the build with
  7480. <code>--enable-libzvbi</code>.
  7481. </p>
  7482. <a name="Options-1"></a>
  7483. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-1">13.4.1 Options</a></h3>
  7484. <dl compact="compact">
  7485. <dt>&lsquo;<samp>txt_page</samp>&rsquo;</dt>
  7486. <dd><p>List of teletext page numbers to decode. Pages that do not match the specified
  7487. list are dropped. You may use the special <code>*</code> string to match all pages,
  7488. or <code>subtitle</code> to match all subtitle pages.
  7489. Default value is *.
  7490. </p></dd>
  7491. <dt>&lsquo;<samp>txt_default_region</samp>&rsquo;</dt>
  7492. <dd><p>Set default G0 character set used for decoding, a value between 0 and 80 (see
  7493. ETS 300 706, Section 15, Table 32). Default value is -1, which does not
  7494. override the libzvbi default. This option is needed for some legacy level 1.0
  7495. transmissions which cannot signal the proper charset.
  7496. </p></dd>
  7497. <dt>&lsquo;<samp>txt_chop_top</samp>&rsquo;</dt>
  7498. <dd><p>Discards the top teletext line. Default value is 1.
  7499. </p></dd>
  7500. <dt>&lsquo;<samp>txt_format</samp>&rsquo;</dt>
  7501. <dd><p>Specifies the format of the decoded subtitles.
  7502. </p><dl compact="compact">
  7503. <dt>&lsquo;<samp>bitmap</samp>&rsquo;</dt>
  7504. <dd><p>The default format, you should use this for teletext pages, because certain
  7505. graphics and colors cannot be expressed in simple text or even ASS.
  7506. </p></dd>
  7507. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  7508. <dd><p>Simple text based output without formatting.
  7509. </p></dd>
  7510. <dt>&lsquo;<samp>ass</samp>&rsquo;</dt>
  7511. <dd><p>Formatted ASS output, subtitle pages and teletext pages are returned in
  7512. different styles, subtitle pages are stripped down to text, but an effort is
  7513. made to keep the text alignment and the formatting.
  7514. </p></dd>
  7515. </dl>
  7516. </dd>
  7517. <dt>&lsquo;<samp>txt_left</samp>&rsquo;</dt>
  7518. <dd><p>X offset of generated bitmaps, default is 0.
  7519. </p></dd>
  7520. <dt>&lsquo;<samp>txt_top</samp>&rsquo;</dt>
  7521. <dd><p>Y offset of generated bitmaps, default is 0.
  7522. </p></dd>
  7523. <dt>&lsquo;<samp>txt_chop_spaces</samp>&rsquo;</dt>
  7524. <dd><p>Chops leading and trailing spaces and removes empty lines from the generated
  7525. text. This option is useful for teletext based subtitles where empty spaces may
  7526. be present at the start or at the end of the lines or empty lines may be
  7527. present between the subtitle lines because of double-sized teletext characters.
  7528. Default value is 1.
  7529. </p></dd>
  7530. <dt>&lsquo;<samp>txt_duration</samp>&rsquo;</dt>
  7531. <dd><p>Sets the display duration of the decoded teletext pages or subtitles in
  7532. milliseconds. Default value is -1 which means infinity or until the next
  7533. subtitle event comes.
  7534. </p></dd>
  7535. <dt>&lsquo;<samp>txt_transparent</samp>&rsquo;</dt>
  7536. <dd><p>Force transparent background of the generated teletext bitmaps. Default value
  7537. is 0 which means an opaque background.
  7538. </p></dd>
  7539. <dt>&lsquo;<samp>txt_opacity</samp>&rsquo;</dt>
  7540. <dd><p>Sets the opacity (0-255) of the teletext background. If
  7541. &lsquo;<samp>txt_transparent</samp>&rsquo; is not set, it only affects characters between a start
  7542. box and an end box, typically subtitles. Default value is 0 if
  7543. &lsquo;<samp>txt_transparent</samp>&rsquo; is set, 255 otherwise.
  7544. </p>
  7545. </dd>
  7546. </dl>
  7547. <a name="Encoders"></a>
  7548. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Encoders">14 Encoders</a></h1>
  7549. <p>Encoders are configured elements in FFmpeg which allow the encoding of
  7550. multimedia streams.
  7551. </p>
  7552. <p>When you configure your FFmpeg build, all the supported native encoders
  7553. are enabled by default. Encoders requiring an external library must be enabled
  7554. manually via the corresponding <code>--enable-lib</code> option. You can list all
  7555. available encoders using the configure option <code>--list-encoders</code>.
  7556. </p>
  7557. <p>You can disable all the encoders with the configure option
  7558. <code>--disable-encoders</code> and selectively enable / disable single encoders
  7559. with the options <code>--enable-encoder=<var>ENCODER</var></code> /
  7560. <code>--disable-encoder=<var>ENCODER</var></code>.
  7561. </p>
  7562. <p>The option <code>-encoders</code> of the ff* tools will display the list of
  7563. enabled encoders.
  7564. </p>
  7565. <a name="Audio-Encoders"></a>
  7566. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Encoders">15 Audio Encoders</a></h1>
  7567. <p>A description of some of the currently available audio encoders
  7568. follows.
  7569. </p>
  7570. <p><a name="aacenc"></a>
  7571. </p><a name="aac"></a>
  7572. <h2 class="section"><a href="ffmpeg-all.html#toc-aac">15.1 aac</a></h2>
  7573. <p>Advanced Audio Coding (AAC) encoder.
  7574. </p>
  7575. <p>This encoder is the default AAC encoder, natively implemented into FFmpeg. Its
  7576. quality is on par or better than libfdk_aac at the default bitrate of 128kbps.
  7577. This encoder also implements more options, profiles and samplerates than
  7578. other encoders (with only the AAC-HE profile pending to be implemented) so this
  7579. encoder has become the default and is the recommended choice.
  7580. </p>
  7581. <a name="Options-49"></a>
  7582. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-49">15.1.1 Options</a></h3>
  7583. <dl compact="compact">
  7584. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  7585. <dd><p>Set bit rate in bits/s. Setting this automatically activates constant bit rate
  7586. (CBR) mode. If this option is unspecified it is set to 128kbps.
  7587. </p>
  7588. </dd>
  7589. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  7590. <dd><p>Set quality for variable bit rate (VBR) mode. This option is valid only using
  7591. the <code>ffmpeg</code> command-line tool. For library interface users, use
  7592. &lsquo;<samp>global_quality</samp>&rsquo;.
  7593. </p>
  7594. </dd>
  7595. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  7596. <dd><p>Set cutoff frequency. If unspecified will allow the encoder to dynamically
  7597. adjust the cutoff to improve clarity on low bitrates.
  7598. </p>
  7599. </dd>
  7600. <dt>&lsquo;<samp>aac_coder</samp>&rsquo;</dt>
  7601. <dd><p>Set AAC encoder coding method. Possible values:
  7602. </p>
  7603. <dl compact="compact">
  7604. <dt>&lsquo;<samp>twoloop</samp>&rsquo;</dt>
  7605. <dd><p>Two loop searching (TLS) method.
  7606. </p>
  7607. <p>This method first sets quantizers depending on band thresholds and then tries
  7608. to find an optimal combination by adding or subtracting a specific value from
  7609. all quantizers and adjusting some individual quantizer a little. Will tune
  7610. itself based on whether &lsquo;<samp>aac_is</samp>&rsquo;, &lsquo;<samp>aac_ms</samp>&rsquo; and &lsquo;<samp>aac_pns</samp>&rsquo;
  7611. are enabled.
  7612. </p>
  7613. </dd>
  7614. <dt>&lsquo;<samp>anmr</samp>&rsquo;</dt>
  7615. <dd><p>Average noise to mask ratio (ANMR) trellis-based solution.
  7616. </p>
  7617. <p>This is an experimental coder which currently produces a lower quality, is more
  7618. unstable and is slower than the default twoloop coder but has potential.
  7619. Currently has no support for the &lsquo;<samp>aac_is</samp>&rsquo; or &lsquo;<samp>aac_pns</samp>&rsquo; options.
  7620. Not currently recommended.
  7621. </p>
  7622. </dd>
  7623. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  7624. <dd><p>Constant quantizer method.
  7625. </p>
  7626. <p>Uses a cheaper version of twoloop algorithm that doesn&rsquo;t try to do as many
  7627. clever adjustments. Worse with low bitrates (less than 64kbps), but is better
  7628. and much faster at higher bitrates.
  7629. This is the default choice for a coder
  7630. </p>
  7631. </dd>
  7632. </dl>
  7633. </dd>
  7634. <dt>&lsquo;<samp>aac_ms</samp>&rsquo;</dt>
  7635. <dd><p>Sets mid/side coding mode. The default value of &quot;auto&quot; will automatically use
  7636. M/S with bands which will benefit from such coding. Can be forced for all bands
  7637. using the value &quot;enable&quot;, which is mainly useful for debugging or disabled using
  7638. &quot;disable&quot;.
  7639. </p>
  7640. </dd>
  7641. <dt>&lsquo;<samp>aac_is</samp>&rsquo;</dt>
  7642. <dd><p>Sets intensity stereo coding tool usage. By default, it&rsquo;s enabled and will
  7643. automatically toggle IS for similar pairs of stereo bands if it&rsquo;s beneficial.
  7644. Can be disabled for debugging by setting the value to &quot;disable&quot;.
  7645. </p>
  7646. </dd>
  7647. <dt>&lsquo;<samp>aac_pns</samp>&rsquo;</dt>
  7648. <dd><p>Uses perceptual noise substitution to replace low entropy high frequency bands
  7649. with imperceptible white noise during the decoding process. By default, it&rsquo;s
  7650. enabled, but can be disabled for debugging purposes by using &quot;disable&quot;.
  7651. </p>
  7652. </dd>
  7653. <dt>&lsquo;<samp>aac_tns</samp>&rsquo;</dt>
  7654. <dd><p>Enables the use of a multitap FIR filter which spans through the high frequency
  7655. bands to hide quantization noise during the encoding process and is reverted
  7656. by the decoder. As well as decreasing unpleasant artifacts in the high range
  7657. this also reduces the entropy in the high bands and allows for more bits to
  7658. be used by the mid-low bands. By default it&rsquo;s enabled but can be disabled for
  7659. debugging by setting the option to &quot;disable&quot;.
  7660. </p>
  7661. </dd>
  7662. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  7663. <dd><p>Enables the use of the long term prediction extension which increases coding
  7664. efficiency in very low bandwidth situations such as encoding of voice or
  7665. solo piano music by extending constant harmonic peaks in bands throughout
  7666. frames. This option is implied by profile:a aac_low and is incompatible with
  7667. aac_pred. Use in conjunction with &lsquo;<samp>-ar</samp>&rsquo; to decrease the samplerate.
  7668. </p>
  7669. </dd>
  7670. <dt>&lsquo;<samp>aac_pred</samp>&rsquo;</dt>
  7671. <dd><p>Enables the use of a more traditional style of prediction where the spectral
  7672. coefficients transmitted are replaced by the difference of the current
  7673. coefficients minus the previous &quot;predicted&quot; coefficients. In theory and sometimes
  7674. in practice this can improve quality for low to mid bitrate audio.
  7675. This option implies the aac_main profile and is incompatible with aac_ltp.
  7676. </p>
  7677. </dd>
  7678. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  7679. <dd><p>Sets the encoding profile, possible values:
  7680. </p>
  7681. <dl compact="compact">
  7682. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  7683. <dd><p>The default, AAC &quot;Low-complexity&quot; profile. Is the most compatible and produces
  7684. decent quality.
  7685. </p>
  7686. </dd>
  7687. <dt>&lsquo;<samp>mpeg2_aac_low</samp>&rsquo;</dt>
  7688. <dd><p>Equivalent to <code>-profile:a aac_low -aac_pns 0</code>. PNS was introduced with the
  7689. MPEG4 specifications.
  7690. </p>
  7691. </dd>
  7692. <dt>&lsquo;<samp>aac_ltp</samp>&rsquo;</dt>
  7693. <dd><p>Long term prediction profile, is enabled by and will enable the &lsquo;<samp>aac_ltp</samp>&rsquo;
  7694. option. Introduced in MPEG4.
  7695. </p>
  7696. </dd>
  7697. <dt>&lsquo;<samp>aac_main</samp>&rsquo;</dt>
  7698. <dd><p>Main-type prediction profile, is enabled by and will enable the &lsquo;<samp>aac_pred</samp>&rsquo;
  7699. option. Introduced in MPEG2.
  7700. </p>
  7701. </dd>
  7702. </dl>
  7703. <p>If this option is unspecified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  7704. </p></dd>
  7705. </dl>
  7706. <a name="ac3-and-ac3_005ffixed"></a>
  7707. <h2 class="section"><a href="ffmpeg-all.html#toc-ac3-and-ac3_005ffixed">15.2 ac3 and ac3_fixed</a></h2>
  7708. <p>AC-3 audio encoders.
  7709. </p>
  7710. <p>These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as
  7711. the undocumented RealAudio 3 (a.k.a. dnet).
  7712. </p>
  7713. <p>The <var>ac3</var> encoder uses floating-point math, while the <var>ac3_fixed</var>
  7714. encoder only uses fixed-point integer math. This does not mean that one is
  7715. always faster, just that one or the other may be better suited to a
  7716. particular system. The floating-point encoder will generally produce better
  7717. quality audio for a given bitrate. The <var>ac3_fixed</var> encoder is not the
  7718. default codec for any of the output formats, so it must be specified explicitly
  7719. using the option <code>-acodec ac3_fixed</code> in order to use it.
  7720. </p>
  7721. <a name="AC_002d3-Metadata"></a>
  7722. <h3 class="subsection"><a href="ffmpeg-all.html#toc-AC_002d3-Metadata">15.2.1 AC-3 Metadata</a></h3>
  7723. <p>The AC-3 metadata options are used to set parameters that describe the audio,
  7724. but in most cases do not affect the audio encoding itself. Some of the options
  7725. do directly affect or influence the decoding and playback of the resulting
  7726. bitstream, while others are just for informational purposes. A few of the
  7727. options will add bits to the output stream that could otherwise be used for
  7728. audio data, and will thus affect the quality of the output. Those will be
  7729. indicated accordingly with a note in the option list below.
  7730. </p>
  7731. <p>These parameters are described in detail in several publicly-available
  7732. documents.
  7733. </p><ul>
  7734. <li> <a href="http://www.atsc.org/cms/standards/a_52-2010.pdf">A/52:2010 - Digital Audio Compression (AC-3) (E-AC-3) Standard</a>
  7735. </li><li> <a href="http://www.atsc.org/cms/standards/a_54a_with_corr_1.pdf">A/54 - Guide to the Use of the ATSC Digital Television Standard</a>
  7736. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/18_Metadata.Guide.pdf">Dolby Metadata Guide</a>
  7737. </li><li> <a href="http://www.dolby.com/uploadedFiles/zz-_Shared_Assets/English_PDFs/Professional/46_DDEncodingGuidelines.pdf">Dolby Digital Professional Encoding Guidelines</a>
  7738. </li></ul>
  7739. <a name="Metadata-Control-Options"></a>
  7740. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Metadata-Control-Options">15.2.1.1 Metadata Control Options</a></h4>
  7741. <dl compact="compact">
  7742. <dt>&lsquo;<samp>-per_frame_metadata <var>boolean</var></samp>&rsquo;</dt>
  7743. <dd><p>Allow Per-Frame Metadata. Specifies if the encoder should check for changing
  7744. metadata for each frame.
  7745. </p><dl compact="compact">
  7746. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7747. <dd><p>The metadata values set at initialization will be used for every frame in the
  7748. stream. (default)
  7749. </p></dd>
  7750. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7751. <dd><p>Metadata values can be changed before encoding each frame.
  7752. </p></dd>
  7753. </dl>
  7754. </dd>
  7755. </dl>
  7756. <a name="Downmix-Levels"></a>
  7757. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Downmix-Levels">15.2.1.2 Downmix Levels</a></h4>
  7758. <dl compact="compact">
  7759. <dt>&lsquo;<samp>-center_mixlev <var>level</var></samp>&rsquo;</dt>
  7760. <dd><p>Center Mix Level. The amount of gain the decoder should apply to the center
  7761. channel when downmixing to stereo. This field will only be written to the
  7762. bitstream if a center channel is present. The value is specified as a scale
  7763. factor. There are 3 valid values:
  7764. </p><dl compact="compact">
  7765. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7766. <dd><p>Apply -3dB gain
  7767. </p></dd>
  7768. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  7769. <dd><p>Apply -4.5dB gain (default)
  7770. </p></dd>
  7771. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7772. <dd><p>Apply -6dB gain
  7773. </p></dd>
  7774. </dl>
  7775. </dd>
  7776. <dt>&lsquo;<samp>-surround_mixlev <var>level</var></samp>&rsquo;</dt>
  7777. <dd><p>Surround Mix Level. The amount of gain the decoder should apply to the surround
  7778. channel(s) when downmixing to stereo. This field will only be written to the
  7779. bitstream if one or more surround channels are present. The value is specified
  7780. as a scale factor. There are 3 valid values:
  7781. </p><dl compact="compact">
  7782. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7783. <dd><p>Apply -3dB gain
  7784. </p></dd>
  7785. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7786. <dd><p>Apply -6dB gain (default)
  7787. </p></dd>
  7788. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  7789. <dd><p>Silence Surround Channel(s)
  7790. </p></dd>
  7791. </dl>
  7792. </dd>
  7793. </dl>
  7794. <a name="Audio-Production-Information"></a>
  7795. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Audio-Production-Information">15.2.1.3 Audio Production Information</a></h4>
  7796. <p>Audio Production Information is optional information describing the mixing
  7797. environment. Either none or both of the fields are written to the bitstream.
  7798. </p>
  7799. <dl compact="compact">
  7800. <dt>&lsquo;<samp>-mixing_level <var>number</var></samp>&rsquo;</dt>
  7801. <dd><p>Mixing Level. Specifies peak sound pressure level (SPL) in the production
  7802. environment when the mix was mastered. Valid values are 80 to 111, or -1 for
  7803. unknown or not indicated. The default value is -1, but that value cannot be
  7804. used if the Audio Production Information is written to the bitstream. Therefore,
  7805. if the <code>room_type</code> option is not the default value, the <code>mixing_level</code>
  7806. option must not be -1.
  7807. </p>
  7808. </dd>
  7809. <dt>&lsquo;<samp>-room_type <var>type</var></samp>&rsquo;</dt>
  7810. <dd><p>Room Type. Describes the equalization used during the final mixing session at
  7811. the studio or on the dubbing stage. A large room is a dubbing stage with the
  7812. industry standard X-curve equalization; a small room has flat equalization.
  7813. This field will not be written to the bitstream if both the <code>mixing_level</code>
  7814. option and the <code>room_type</code> option have the default values.
  7815. </p><dl compact="compact">
  7816. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7817. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7818. <dd><p>Not Indicated (default)
  7819. </p></dd>
  7820. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7821. <dt>&lsquo;<samp>large</samp>&rsquo;</dt>
  7822. <dd><p>Large Room
  7823. </p></dd>
  7824. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7825. <dt>&lsquo;<samp>small</samp>&rsquo;</dt>
  7826. <dd><p>Small Room
  7827. </p></dd>
  7828. </dl>
  7829. </dd>
  7830. </dl>
  7831. <a name="Other-Metadata-Options"></a>
  7832. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Other-Metadata-Options">15.2.1.4 Other Metadata Options</a></h4>
  7833. <dl compact="compact">
  7834. <dt>&lsquo;<samp>-copyright <var>boolean</var></samp>&rsquo;</dt>
  7835. <dd><p>Copyright Indicator. Specifies whether a copyright exists for this audio.
  7836. </p><dl compact="compact">
  7837. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7838. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7839. <dd><p>No Copyright Exists (default)
  7840. </p></dd>
  7841. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7842. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7843. <dd><p>Copyright Exists
  7844. </p></dd>
  7845. </dl>
  7846. </dd>
  7847. <dt>&lsquo;<samp>-dialnorm <var>value</var></samp>&rsquo;</dt>
  7848. <dd><p>Dialogue Normalization. Indicates how far the average dialogue level of the
  7849. program is below digital 100% full scale (0 dBFS). This parameter determines a
  7850. level shift during audio reproduction that sets the average volume of the
  7851. dialogue to a preset level. The goal is to match volume level between program
  7852. sources. A value of -31dB will result in no volume level change, relative to
  7853. the source volume, during audio reproduction. Valid values are whole numbers in
  7854. the range -31 to -1, with -31 being the default.
  7855. </p>
  7856. </dd>
  7857. <dt>&lsquo;<samp>-dsur_mode <var>mode</var></samp>&rsquo;</dt>
  7858. <dd><p>Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround
  7859. (Pro Logic). This field will only be written to the bitstream if the audio
  7860. stream is stereo. Using this option does <b>NOT</b> mean the encoder will actually
  7861. apply Dolby Surround processing.
  7862. </p><dl compact="compact">
  7863. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7864. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7865. <dd><p>Not Indicated (default)
  7866. </p></dd>
  7867. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7868. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7869. <dd><p>Not Dolby Surround Encoded
  7870. </p></dd>
  7871. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7872. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7873. <dd><p>Dolby Surround Encoded
  7874. </p></dd>
  7875. </dl>
  7876. </dd>
  7877. <dt>&lsquo;<samp>-original <var>boolean</var></samp>&rsquo;</dt>
  7878. <dd><p>Original Bit Stream Indicator. Specifies whether this audio is from the
  7879. original source and not a copy.
  7880. </p><dl compact="compact">
  7881. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7882. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  7883. <dd><p>Not Original Source
  7884. </p></dd>
  7885. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7886. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  7887. <dd><p>Original Source (default)
  7888. </p></dd>
  7889. </dl>
  7890. </dd>
  7891. </dl>
  7892. <a name="Extended-Bitstream-Information"></a>
  7893. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information">15.2.2 Extended Bitstream Information</a></h3>
  7894. <p>The extended bitstream options are part of the Alternate Bit Stream Syntax as
  7895. specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts.
  7896. If any one parameter in a group is specified, all values in that group will be
  7897. written to the bitstream. Default values are used for those that are written
  7898. but have not been specified. If the mixing levels are written, the decoder
  7899. will use these values instead of the ones specified in the <code>center_mixlev</code>
  7900. and <code>surround_mixlev</code> options if it supports the Alternate Bit Stream
  7901. Syntax.
  7902. </p>
  7903. <a name="Extended-Bitstream-Information-_002d-Part-1"></a>
  7904. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-1">15.2.2.1 Extended Bitstream Information - Part 1</a></h4>
  7905. <dl compact="compact">
  7906. <dt>&lsquo;<samp>-dmix_mode <var>mode</var></samp>&rsquo;</dt>
  7907. <dd><p>Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt
  7908. (Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode.
  7909. </p><dl compact="compact">
  7910. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  7911. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  7912. <dd><p>Not Indicated (default)
  7913. </p></dd>
  7914. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  7915. <dt>&lsquo;<samp>ltrt</samp>&rsquo;</dt>
  7916. <dd><p>Lt/Rt Downmix Preferred
  7917. </p></dd>
  7918. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  7919. <dt>&lsquo;<samp>loro</samp>&rsquo;</dt>
  7920. <dd><p>Lo/Ro Downmix Preferred
  7921. </p></dd>
  7922. </dl>
  7923. </dd>
  7924. <dt>&lsquo;<samp>-ltrt_cmixlev <var>level</var></samp>&rsquo;</dt>
  7925. <dd><p>Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the
  7926. center channel when downmixing to stereo in Lt/Rt mode.
  7927. </p><dl compact="compact">
  7928. <dt>&lsquo;<samp>1.414</samp>&rsquo;</dt>
  7929. <dd><p>Apply +3dB gain
  7930. </p></dd>
  7931. <dt>&lsquo;<samp>1.189</samp>&rsquo;</dt>
  7932. <dd><p>Apply +1.5dB gain
  7933. </p></dd>
  7934. <dt>&lsquo;<samp>1.000</samp>&rsquo;</dt>
  7935. <dd><p>Apply 0dB gain
  7936. </p></dd>
  7937. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  7938. <dd><p>Apply -1.5dB gain
  7939. </p></dd>
  7940. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7941. <dd><p>Apply -3.0dB gain
  7942. </p></dd>
  7943. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  7944. <dd><p>Apply -4.5dB gain (default)
  7945. </p></dd>
  7946. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7947. <dd><p>Apply -6.0dB gain
  7948. </p></dd>
  7949. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  7950. <dd><p>Silence Center Channel
  7951. </p></dd>
  7952. </dl>
  7953. </dd>
  7954. <dt>&lsquo;<samp>-ltrt_surmixlev <var>level</var></samp>&rsquo;</dt>
  7955. <dd><p>Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the
  7956. surround channel(s) when downmixing to stereo in Lt/Rt mode.
  7957. </p><dl compact="compact">
  7958. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  7959. <dd><p>Apply -1.5dB gain
  7960. </p></dd>
  7961. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7962. <dd><p>Apply -3.0dB gain
  7963. </p></dd>
  7964. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  7965. <dd><p>Apply -4.5dB gain
  7966. </p></dd>
  7967. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7968. <dd><p>Apply -6.0dB gain (default)
  7969. </p></dd>
  7970. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  7971. <dd><p>Silence Surround Channel(s)
  7972. </p></dd>
  7973. </dl>
  7974. </dd>
  7975. <dt>&lsquo;<samp>-loro_cmixlev <var>level</var></samp>&rsquo;</dt>
  7976. <dd><p>Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the
  7977. center channel when downmixing to stereo in Lo/Ro mode.
  7978. </p><dl compact="compact">
  7979. <dt>&lsquo;<samp>1.414</samp>&rsquo;</dt>
  7980. <dd><p>Apply +3dB gain
  7981. </p></dd>
  7982. <dt>&lsquo;<samp>1.189</samp>&rsquo;</dt>
  7983. <dd><p>Apply +1.5dB gain
  7984. </p></dd>
  7985. <dt>&lsquo;<samp>1.000</samp>&rsquo;</dt>
  7986. <dd><p>Apply 0dB gain
  7987. </p></dd>
  7988. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  7989. <dd><p>Apply -1.5dB gain
  7990. </p></dd>
  7991. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  7992. <dd><p>Apply -3.0dB gain
  7993. </p></dd>
  7994. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  7995. <dd><p>Apply -4.5dB gain (default)
  7996. </p></dd>
  7997. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  7998. <dd><p>Apply -6.0dB gain
  7999. </p></dd>
  8000. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8001. <dd><p>Silence Center Channel
  8002. </p></dd>
  8003. </dl>
  8004. </dd>
  8005. <dt>&lsquo;<samp>-loro_surmixlev <var>level</var></samp>&rsquo;</dt>
  8006. <dd><p>Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the
  8007. surround channel(s) when downmixing to stereo in Lo/Ro mode.
  8008. </p><dl compact="compact">
  8009. <dt>&lsquo;<samp>0.841</samp>&rsquo;</dt>
  8010. <dd><p>Apply -1.5dB gain
  8011. </p></dd>
  8012. <dt>&lsquo;<samp>0.707</samp>&rsquo;</dt>
  8013. <dd><p>Apply -3.0dB gain
  8014. </p></dd>
  8015. <dt>&lsquo;<samp>0.595</samp>&rsquo;</dt>
  8016. <dd><p>Apply -4.5dB gain
  8017. </p></dd>
  8018. <dt>&lsquo;<samp>0.500</samp>&rsquo;</dt>
  8019. <dd><p>Apply -6.0dB gain (default)
  8020. </p></dd>
  8021. <dt>&lsquo;<samp>0.000</samp>&rsquo;</dt>
  8022. <dd><p>Silence Surround Channel(s)
  8023. </p></dd>
  8024. </dl>
  8025. </dd>
  8026. </dl>
  8027. <a name="Extended-Bitstream-Information-_002d-Part-2"></a>
  8028. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Extended-Bitstream-Information-_002d-Part-2">15.2.2.2 Extended Bitstream Information - Part 2</a></h4>
  8029. <dl compact="compact">
  8030. <dt>&lsquo;<samp>-dsurex_mode <var>mode</var></samp>&rsquo;</dt>
  8031. <dd><p>Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX
  8032. (7.1 matrixed to 5.1). Using this option does <b>NOT</b> mean the encoder will actually
  8033. apply Dolby Surround EX processing.
  8034. </p><dl compact="compact">
  8035. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8036. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  8037. <dd><p>Not Indicated (default)
  8038. </p></dd>
  8039. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8040. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8041. <dd><p>Dolby Surround EX Off
  8042. </p></dd>
  8043. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8044. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8045. <dd><p>Dolby Surround EX On
  8046. </p></dd>
  8047. </dl>
  8048. </dd>
  8049. <dt>&lsquo;<samp>-dheadphone_mode <var>mode</var></samp>&rsquo;</dt>
  8050. <dd><p>Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone
  8051. encoding (multi-channel matrixed to 2.0 for use with headphones). Using this
  8052. option does <b>NOT</b> mean the encoder will actually apply Dolby Headphone
  8053. processing.
  8054. </p><dl compact="compact">
  8055. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8056. <dt>&lsquo;<samp>notindicated</samp>&rsquo;</dt>
  8057. <dd><p>Not Indicated (default)
  8058. </p></dd>
  8059. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8060. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8061. <dd><p>Dolby Headphone Off
  8062. </p></dd>
  8063. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8064. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8065. <dd><p>Dolby Headphone On
  8066. </p></dd>
  8067. </dl>
  8068. </dd>
  8069. <dt>&lsquo;<samp>-ad_conv_type <var>type</var></samp>&rsquo;</dt>
  8070. <dd><p>A/D Converter Type. Indicates whether the audio has passed through HDCD A/D
  8071. conversion.
  8072. </p><dl compact="compact">
  8073. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8074. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  8075. <dd><p>Standard A/D Converter (default)
  8076. </p></dd>
  8077. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8078. <dt>&lsquo;<samp>hdcd</samp>&rsquo;</dt>
  8079. <dd><p>HDCD A/D Converter
  8080. </p></dd>
  8081. </dl>
  8082. </dd>
  8083. </dl>
  8084. <a name="Other-AC_002d3-Encoding-Options"></a>
  8085. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Other-AC_002d3-Encoding-Options">15.2.3 Other AC-3 Encoding Options</a></h3>
  8086. <dl compact="compact">
  8087. <dt>&lsquo;<samp>-stereo_rematrixing <var>boolean</var></samp>&rsquo;</dt>
  8088. <dd><p>Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This
  8089. is an optional AC-3 feature that increases quality by selectively encoding
  8090. the left/right channels as mid/side. This option is enabled by default, and it
  8091. is highly recommended that it be left as enabled except for testing purposes.
  8092. </p>
  8093. </dd>
  8094. <dt>&lsquo;<samp>cutoff <var>frequency</var></samp>&rsquo;</dt>
  8095. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder selects a default
  8096. determined by various other encoding parameters.
  8097. </p>
  8098. </dd>
  8099. </dl>
  8100. <a name="Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options"></a>
  8101. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Floating_002dPoint_002dOnly-AC_002d3-Encoding-Options">15.2.4 Floating-Point-Only AC-3 Encoding Options</a></h3>
  8102. <p>These options are only valid for the floating-point encoder and do not exist
  8103. for the fixed-point encoder due to the corresponding features not being
  8104. implemented in fixed-point.
  8105. </p>
  8106. <dl compact="compact">
  8107. <dt>&lsquo;<samp>-channel_coupling <var>boolean</var></samp>&rsquo;</dt>
  8108. <dd><p>Enables/Disables use of channel coupling, which is an optional AC-3 feature
  8109. that increases quality by combining high frequency information from multiple
  8110. channels into a single channel. The per-channel high frequency information is
  8111. sent with less accuracy in both the frequency and time domains. This allows
  8112. more bits to be used for lower frequencies while preserving enough information
  8113. to reconstruct the high frequencies. This option is enabled by default for the
  8114. floating-point encoder and should generally be left as enabled except for
  8115. testing purposes or to increase encoding speed.
  8116. </p><dl compact="compact">
  8117. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  8118. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8119. <dd><p>Selected by Encoder (default)
  8120. </p></dd>
  8121. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  8122. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8123. <dd><p>Disable Channel Coupling
  8124. </p></dd>
  8125. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8126. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8127. <dd><p>Enable Channel Coupling
  8128. </p></dd>
  8129. </dl>
  8130. </dd>
  8131. <dt>&lsquo;<samp>-cpl_start_band <var>number</var></samp>&rsquo;</dt>
  8132. <dd><p>Coupling Start Band. Sets the channel coupling start band, from 1 to 15. If a
  8133. value higher than the bandwidth is used, it will be reduced to 1 less than the
  8134. coupling end band. If <var>auto</var> is used, the start band will be determined by
  8135. the encoder based on the bit rate, sample rate, and channel layout. This option
  8136. has no effect if channel coupling is disabled.
  8137. </p><dl compact="compact">
  8138. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  8139. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8140. <dd><p>Selected by Encoder (default)
  8141. </p></dd>
  8142. </dl>
  8143. </dd>
  8144. </dl>
  8145. <p><a name="flac"></a>
  8146. </p><a name="flac-1"></a>
  8147. <h2 class="section"><a href="ffmpeg-all.html#toc-flac-1">15.3 flac</a></h2>
  8148. <p>FLAC (Free Lossless Audio Codec) Encoder
  8149. </p>
  8150. <a name="Options-59"></a>
  8151. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-59">15.3.1 Options</a></h3>
  8152. <p>The following options are supported by FFmpeg&rsquo;s flac encoder.
  8153. </p>
  8154. <dl compact="compact">
  8155. <dt>&lsquo;<samp>compression_level</samp>&rsquo;</dt>
  8156. <dd><p>Sets the compression level, which chooses defaults for many other options
  8157. if they are not set explicitly. Valid values are from 0 to 12, 5 is the
  8158. default.
  8159. </p>
  8160. </dd>
  8161. <dt>&lsquo;<samp>frame_size</samp>&rsquo;</dt>
  8162. <dd><p>Sets the size of the frames in samples per channel.
  8163. </p>
  8164. </dd>
  8165. <dt>&lsquo;<samp>lpc_coeff_precision</samp>&rsquo;</dt>
  8166. <dd><p>Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
  8167. default.
  8168. </p>
  8169. </dd>
  8170. <dt>&lsquo;<samp>lpc_type</samp>&rsquo;</dt>
  8171. <dd><p>Sets the first stage LPC algorithm
  8172. </p><dl compact="compact">
  8173. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  8174. <dd><p>LPC is not used
  8175. </p>
  8176. </dd>
  8177. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  8178. <dd><p>fixed LPC coefficients
  8179. </p>
  8180. </dd>
  8181. <dt>&lsquo;<samp>levinson</samp>&rsquo;</dt>
  8182. <dt>&lsquo;<samp>cholesky</samp>&rsquo;</dt>
  8183. </dl>
  8184. </dd>
  8185. <dt>&lsquo;<samp>lpc_passes</samp>&rsquo;</dt>
  8186. <dd><p>Number of passes to use for Cholesky factorization during LPC analysis
  8187. </p>
  8188. </dd>
  8189. <dt>&lsquo;<samp>min_partition_order</samp>&rsquo;</dt>
  8190. <dd><p>The minimum partition order
  8191. </p>
  8192. </dd>
  8193. <dt>&lsquo;<samp>max_partition_order</samp>&rsquo;</dt>
  8194. <dd><p>The maximum partition order
  8195. </p>
  8196. </dd>
  8197. <dt>&lsquo;<samp>prediction_order_method</samp>&rsquo;</dt>
  8198. <dd><dl compact="compact">
  8199. <dt>&lsquo;<samp>estimation</samp>&rsquo;</dt>
  8200. <dt>&lsquo;<samp>2level</samp>&rsquo;</dt>
  8201. <dt>&lsquo;<samp>4level</samp>&rsquo;</dt>
  8202. <dt>&lsquo;<samp>8level</samp>&rsquo;</dt>
  8203. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  8204. <dd><p>Bruteforce search
  8205. </p></dd>
  8206. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  8207. </dl>
  8208. </dd>
  8209. <dt>&lsquo;<samp>ch_mode</samp>&rsquo;</dt>
  8210. <dd><p>Channel mode
  8211. </p><dl compact="compact">
  8212. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8213. <dd><p>The mode is chosen automatically for each frame
  8214. </p></dd>
  8215. <dt>&lsquo;<samp>indep</samp>&rsquo;</dt>
  8216. <dd><p>Channels are independently coded
  8217. </p></dd>
  8218. <dt>&lsquo;<samp>left_side</samp>&rsquo;</dt>
  8219. <dt>&lsquo;<samp>right_side</samp>&rsquo;</dt>
  8220. <dt>&lsquo;<samp>mid_side</samp>&rsquo;</dt>
  8221. </dl>
  8222. </dd>
  8223. <dt>&lsquo;<samp>exact_rice_parameters</samp>&rsquo;</dt>
  8224. <dd><p>Chooses if rice parameters are calculated exactly or approximately.
  8225. if set to 1 then they are chosen exactly, which slows the code down slightly and
  8226. improves compression slightly.
  8227. </p>
  8228. </dd>
  8229. <dt>&lsquo;<samp>multi_dim_quant</samp>&rsquo;</dt>
  8230. <dd><p>Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
  8231. applied after the first stage to finetune the coefficients. This is quite slow
  8232. and slightly improves compression.
  8233. </p>
  8234. </dd>
  8235. </dl>
  8236. <p><a name="opusenc"></a>
  8237. </p><a name="opus"></a>
  8238. <h2 class="section"><a href="ffmpeg-all.html#toc-opus">15.4 opus</a></h2>
  8239. <p>Opus encoder.
  8240. </p>
  8241. <p>This is a native FFmpeg encoder for the Opus format. Currently its in development and
  8242. only implements the CELT part of the codec. Its quality is usually worse and at best
  8243. is equal to the libopus encoder.
  8244. </p>
  8245. <a name="Options-50"></a>
  8246. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-50">15.4.1 Options</a></h3>
  8247. <dl compact="compact">
  8248. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8249. <dd><p>Set bit rate in bits/s. If unspecified it uses the number of channels and the layout
  8250. to make a good guess.
  8251. </p>
  8252. </dd>
  8253. <dt>&lsquo;<samp>opus_delay</samp>&rsquo;</dt>
  8254. <dd><p>Sets the maximum delay in milliseconds. Lower delays than 20ms will very quickly
  8255. decrease quality.
  8256. </p></dd>
  8257. </dl>
  8258. <p><a name="libfdk_002daac_002denc"></a>
  8259. </p><a name="libfdk_005faac"></a>
  8260. <h2 class="section"><a href="ffmpeg-all.html#toc-libfdk_005faac">15.5 libfdk_aac</a></h2>
  8261. <p>libfdk-aac AAC (Advanced Audio Coding) encoder wrapper.
  8262. </p>
  8263. <p>The libfdk-aac library is based on the Fraunhofer FDK AAC code from
  8264. the Android project.
  8265. </p>
  8266. <p>Requires the presence of the libfdk-aac headers and library during
  8267. configuration. You need to explicitly configure the build with
  8268. <code>--enable-libfdk-aac</code>. The library is also incompatible with GPL,
  8269. so if you allow the use of GPL, you should configure with
  8270. <code>--enable-gpl --enable-nonfree --enable-libfdk-aac</code>.
  8271. </p>
  8272. <p>This encoder is considered to produce output on par or worse at 128kbps to the
  8273. <a href="#aacenc">the native FFmpeg AAC encoder</a> but can often produce better
  8274. sounding audio at identical or lower bitrates and has support for the
  8275. AAC-HE profiles.
  8276. </p>
  8277. <p>VBR encoding, enabled through the &lsquo;<samp>vbr</samp>&rsquo; or &lsquo;<samp>flags
  8278. +qscale</samp>&rsquo; options, is experimental and only works with some
  8279. combinations of parameters.
  8280. </p>
  8281. <p>Support for encoding 7.1 audio is only available with libfdk-aac 0.1.3 or
  8282. higher.
  8283. </p>
  8284. <p>For more information see the fdk-aac project at
  8285. <a href="http://sourceforge.net/p/opencore-amr/fdk-aac/">http://sourceforge.net/p/opencore-amr/fdk-aac/</a>.
  8286. </p>
  8287. <a name="Options-63"></a>
  8288. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-63">15.5.1 Options</a></h3>
  8289. <p>The following options are mapped on the shared FFmpeg codec options.
  8290. </p>
  8291. <dl compact="compact">
  8292. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8293. <dd><p>Set bit rate in bits/s. If the bitrate is not explicitly specified, it
  8294. is automatically set to a suitable value depending on the selected
  8295. profile.
  8296. </p>
  8297. <p>In case VBR mode is enabled the option is ignored.
  8298. </p>
  8299. </dd>
  8300. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  8301. <dd><p>Set audio sampling rate (in Hz).
  8302. </p>
  8303. </dd>
  8304. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  8305. <dd><p>Set the number of audio channels.
  8306. </p>
  8307. </dd>
  8308. <dt>&lsquo;<samp>flags +qscale</samp>&rsquo;</dt>
  8309. <dd><p>Enable fixed quality, VBR (Variable Bit Rate) mode.
  8310. Note that VBR is implicitly enabled when the &lsquo;<samp>vbr</samp>&rsquo; value is
  8311. positive.
  8312. </p>
  8313. </dd>
  8314. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  8315. <dd><p>Set cutoff frequency. If not specified (or explicitly set to 0) it
  8316. will use a value automatically computed by the library. Default value
  8317. is 0.
  8318. </p>
  8319. </dd>
  8320. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  8321. <dd><p>Set audio profile.
  8322. </p>
  8323. <p>The following profiles are recognized:
  8324. </p><dl compact="compact">
  8325. <dt>&lsquo;<samp>aac_low</samp>&rsquo;</dt>
  8326. <dd><p>Low Complexity AAC (LC)
  8327. </p>
  8328. </dd>
  8329. <dt>&lsquo;<samp>aac_he</samp>&rsquo;</dt>
  8330. <dd><p>High Efficiency AAC (HE-AAC)
  8331. </p>
  8332. </dd>
  8333. <dt>&lsquo;<samp>aac_he_v2</samp>&rsquo;</dt>
  8334. <dd><p>High Efficiency AAC version 2 (HE-AACv2)
  8335. </p>
  8336. </dd>
  8337. <dt>&lsquo;<samp>aac_ld</samp>&rsquo;</dt>
  8338. <dd><p>Low Delay AAC (LD)
  8339. </p>
  8340. </dd>
  8341. <dt>&lsquo;<samp>aac_eld</samp>&rsquo;</dt>
  8342. <dd><p>Enhanced Low Delay AAC (ELD)
  8343. </p></dd>
  8344. </dl>
  8345. <p>If not specified it is set to &lsquo;<samp>aac_low</samp>&rsquo;.
  8346. </p></dd>
  8347. </dl>
  8348. <p>The following are private options of the libfdk_aac encoder.
  8349. </p>
  8350. <dl compact="compact">
  8351. <dt>&lsquo;<samp>afterburner</samp>&rsquo;</dt>
  8352. <dd><p>Enable afterburner feature if set to 1, disabled if set to 0. This
  8353. improves the quality but also the required processing power.
  8354. </p>
  8355. <p>Default value is 1.
  8356. </p>
  8357. </dd>
  8358. <dt>&lsquo;<samp>eld_sbr</samp>&rsquo;</dt>
  8359. <dd><p>Enable SBR (Spectral Band Replication) for ELD if set to 1, disabled
  8360. if set to 0.
  8361. </p>
  8362. <p>Default value is 0.
  8363. </p>
  8364. </dd>
  8365. <dt>&lsquo;<samp>eld_v2</samp>&rsquo;</dt>
  8366. <dd><p>Enable ELDv2 (LD-MPS extension for ELD stereo signals) for ELDv2 if set to 1,
  8367. disabled if set to 0.
  8368. </p>
  8369. <p>Note that option is available when fdk-aac version (AACENCODER_LIB_VL0.AACENCODER_LIB_VL1.AACENCODER_LIB_VL2) &gt; (4.0.0).
  8370. </p>
  8371. <p>Default value is 0.
  8372. </p>
  8373. </dd>
  8374. <dt>&lsquo;<samp>signaling</samp>&rsquo;</dt>
  8375. <dd><p>Set SBR/PS signaling style.
  8376. </p>
  8377. <p>It can assume one of the following values:
  8378. </p><dl compact="compact">
  8379. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  8380. <dd><p>choose signaling implicitly (explicit hierarchical by default,
  8381. implicit if global header is disabled)
  8382. </p>
  8383. </dd>
  8384. <dt>&lsquo;<samp>implicit</samp>&rsquo;</dt>
  8385. <dd><p>implicit backwards compatible signaling
  8386. </p>
  8387. </dd>
  8388. <dt>&lsquo;<samp>explicit_sbr</samp>&rsquo;</dt>
  8389. <dd><p>explicit SBR, implicit PS signaling
  8390. </p>
  8391. </dd>
  8392. <dt>&lsquo;<samp>explicit_hierarchical</samp>&rsquo;</dt>
  8393. <dd><p>explicit hierarchical signaling
  8394. </p></dd>
  8395. </dl>
  8396. <p>Default value is &lsquo;<samp>default</samp>&rsquo;.
  8397. </p>
  8398. </dd>
  8399. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  8400. <dd><p>Output LATM/LOAS encapsulated data if set to 1, disabled if set to 0.
  8401. </p>
  8402. <p>Default value is 0.
  8403. </p>
  8404. </dd>
  8405. <dt>&lsquo;<samp>header_period</samp>&rsquo;</dt>
  8406. <dd><p>Set StreamMuxConfig and PCE repetition period (in frames) for sending
  8407. in-band configuration buffers within LATM/LOAS transport layer.
  8408. </p>
  8409. <p>Must be a 16-bits non-negative integer.
  8410. </p>
  8411. <p>Default value is 0.
  8412. </p>
  8413. </dd>
  8414. <dt>&lsquo;<samp>vbr</samp>&rsquo;</dt>
  8415. <dd><p>Set VBR mode, from 1 to 5. 1 is lowest quality (though still pretty
  8416. good) and 5 is highest quality. A value of 0 will disable VBR, and CBR
  8417. (Constant Bit Rate) is enabled.
  8418. </p>
  8419. <p>Currently only the &lsquo;<samp>aac_low</samp>&rsquo; profile supports VBR encoding.
  8420. </p>
  8421. <p>VBR modes 1-5 correspond to roughly the following average bit rates:
  8422. </p>
  8423. <dl compact="compact">
  8424. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8425. <dd><p>32 kbps/channel
  8426. </p></dd>
  8427. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  8428. <dd><p>40 kbps/channel
  8429. </p></dd>
  8430. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  8431. <dd><p>48-56 kbps/channel
  8432. </p></dd>
  8433. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  8434. <dd><p>64 kbps/channel
  8435. </p></dd>
  8436. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  8437. <dd><p>about 80-96 kbps/channel
  8438. </p></dd>
  8439. </dl>
  8440. <p>Default value is 0.
  8441. </p></dd>
  8442. </dl>
  8443. <a name="Examples-105"></a>
  8444. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-105">15.5.2 Examples</a></h3>
  8445. <ul>
  8446. <li>
  8447. Use <code>ffmpeg</code> to convert an audio file to VBR AAC in an M4A (MP4)
  8448. container:
  8449. <div class="example">
  8450. <pre class="example">ffmpeg -i input.wav -codec:a libfdk_aac -vbr 3 output.m4a
  8451. </pre></div>
  8452. </li><li>
  8453. Use <code>ffmpeg</code> to convert an audio file to CBR 64k kbps AAC, using the
  8454. High-Efficiency AAC profile:
  8455. <div class="example">
  8456. <pre class="example">ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
  8457. </pre></div>
  8458. </li></ul>
  8459. <p><a name="libmp3lame"></a>
  8460. </p><a name="libmp3lame-1"></a>
  8461. <h2 class="section"><a href="ffmpeg-all.html#toc-libmp3lame-1">15.6 libmp3lame</a></h2>
  8462. <p>LAME (Lame Ain&rsquo;t an MP3 Encoder) MP3 encoder wrapper.
  8463. </p>
  8464. <p>Requires the presence of the libmp3lame headers and library during
  8465. configuration. You need to explicitly configure the build with
  8466. <code>--enable-libmp3lame</code>.
  8467. </p>
  8468. <p>See <a href="#libshine">libshine</a> for a fixed-point MP3 encoder, although with a
  8469. lower quality.
  8470. </p>
  8471. <a name="Options-43"></a>
  8472. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-43">15.6.1 Options</a></h3>
  8473. <p>The following options are supported by the libmp3lame wrapper. The
  8474. <code>lame</code>-equivalent of the options are listed in parentheses.
  8475. </p>
  8476. <dl compact="compact">
  8477. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8478. <dd><p>Set bitrate expressed in bits/s for CBR or ABR. LAME <code>bitrate</code> is
  8479. expressed in kilobits/s.
  8480. </p>
  8481. </dd>
  8482. <dt>&lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
  8483. <dd><p>Set constant quality setting for VBR. This option is valid only
  8484. using the <code>ffmpeg</code> command-line tool. For library interface
  8485. users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  8486. </p>
  8487. </dd>
  8488. <dt>&lsquo;<samp>compression_level (<em>-q</em>)</samp>&rsquo;</dt>
  8489. <dd><p>Set algorithm quality. Valid arguments are integers in the 0-9 range,
  8490. with 0 meaning highest quality but slowest, and 9 meaning fastest
  8491. while producing the worst quality.
  8492. </p>
  8493. </dd>
  8494. <dt>&lsquo;<samp>cutoff (<em>--lowpass</em>)</samp>&rsquo;</dt>
  8495. <dd><p>Set lowpass cutoff frequency. If unspecified, the encoder dynamically
  8496. adjusts the cutoff.
  8497. </p>
  8498. </dd>
  8499. <dt>&lsquo;<samp>reservoir</samp>&rsquo;</dt>
  8500. <dd><p>Enable use of bit reservoir when set to 1. Default value is 1. LAME
  8501. has this enabled by default, but can be overridden by use
  8502. &lsquo;<samp>--nores</samp>&rsquo; option.
  8503. </p>
  8504. </dd>
  8505. <dt>&lsquo;<samp>joint_stereo (<em>-m j</em>)</samp>&rsquo;</dt>
  8506. <dd><p>Enable the encoder to use (on a frame by frame basis) either L/R
  8507. stereo or mid/side stereo. Default value is 1.
  8508. </p>
  8509. </dd>
  8510. <dt>&lsquo;<samp>abr (<em>--abr</em>)</samp>&rsquo;</dt>
  8511. <dd><p>Enable the encoder to use ABR when set to 1. The <code>lame</code>
  8512. &lsquo;<samp>--abr</samp>&rsquo; sets the target bitrate, while this options only
  8513. tells FFmpeg to use ABR still relies on &lsquo;<samp>b</samp>&rsquo; to set bitrate.
  8514. </p>
  8515. </dd>
  8516. </dl>
  8517. <a name="libopencore_002damrnb-1"></a>
  8518. <h2 class="section"><a href="ffmpeg-all.html#toc-libopencore_002damrnb-1">15.7 libopencore-amrnb</a></h2>
  8519. <p>OpenCORE Adaptive Multi-Rate Narrowband encoder.
  8520. </p>
  8521. <p>Requires the presence of the libopencore-amrnb headers and library during
  8522. configuration. You need to explicitly configure the build with
  8523. <code>--enable-libopencore-amrnb --enable-version3</code>.
  8524. </p>
  8525. <p>This is a mono-only encoder. Officially it only supports 8000Hz sample rate,
  8526. but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to &lsquo;<samp>unofficial</samp>&rsquo; or
  8527. lower.
  8528. </p>
  8529. <a name="Options-23"></a>
  8530. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-23">15.7.1 Options</a></h3>
  8531. <dl compact="compact">
  8532. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8533. <dd><p>Set bitrate in bits per second. Only the following bitrates are supported,
  8534. otherwise libavcodec will round to the nearest valid bitrate.
  8535. </p>
  8536. <dl compact="compact">
  8537. <dt>&lsquo;<samp>4750</samp>&rsquo;</dt>
  8538. <dt>&lsquo;<samp>5150</samp>&rsquo;</dt>
  8539. <dt>&lsquo;<samp>5900</samp>&rsquo;</dt>
  8540. <dt>&lsquo;<samp>6700</samp>&rsquo;</dt>
  8541. <dt>&lsquo;<samp>7400</samp>&rsquo;</dt>
  8542. <dt>&lsquo;<samp>7950</samp>&rsquo;</dt>
  8543. <dt>&lsquo;<samp>10200</samp>&rsquo;</dt>
  8544. <dt>&lsquo;<samp>12200</samp>&rsquo;</dt>
  8545. </dl>
  8546. </dd>
  8547. <dt>&lsquo;<samp>dtx</samp>&rsquo;</dt>
  8548. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  8549. default value is 0 (disabled).
  8550. </p>
  8551. </dd>
  8552. </dl>
  8553. <a name="libopus-1"></a>
  8554. <h2 class="section"><a href="ffmpeg-all.html#toc-libopus-1">15.8 libopus</a></h2>
  8555. <p>libopus Opus Interactive Audio Codec encoder wrapper.
  8556. </p>
  8557. <p>Requires the presence of the libopus headers and library during
  8558. configuration. You need to explicitly configure the build with
  8559. <code>--enable-libopus</code>.
  8560. </p>
  8561. <a name="Option-Mapping"></a>
  8562. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Option-Mapping">15.8.1 Option Mapping</a></h3>
  8563. <p>Most libopus options are modelled after the <code>opusenc</code> utility from
  8564. opus-tools. The following is an option mapping chart describing options
  8565. supported by the libopus wrapper, and their <code>opusenc</code>-equivalent
  8566. in parentheses.
  8567. </p>
  8568. <dl compact="compact">
  8569. <dt>&lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
  8570. <dd><p>Set the bit rate in bits/s. FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  8571. expressed in bits/s, while <code>opusenc</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; in
  8572. kilobits/s.
  8573. </p>
  8574. </dd>
  8575. <dt>&lsquo;<samp>vbr (<em>vbr</em>, <em>hard-cbr</em>, and <em>cvbr</em>)</samp>&rsquo;</dt>
  8576. <dd><p>Set VBR mode. The FFmpeg &lsquo;<samp>vbr</samp>&rsquo; option has the following
  8577. valid arguments, with the <code>opusenc</code> equivalent options
  8578. in parentheses:
  8579. </p>
  8580. <dl compact="compact">
  8581. <dt>&lsquo;<samp>off (<em>hard-cbr</em>)</samp>&rsquo;</dt>
  8582. <dd><p>Use constant bit rate encoding.
  8583. </p>
  8584. </dd>
  8585. <dt>&lsquo;<samp>on (<em>vbr</em>)</samp>&rsquo;</dt>
  8586. <dd><p>Use variable bit rate encoding (the default).
  8587. </p>
  8588. </dd>
  8589. <dt>&lsquo;<samp>constrained (<em>cvbr</em>)</samp>&rsquo;</dt>
  8590. <dd><p>Use constrained variable bit rate encoding.
  8591. </p></dd>
  8592. </dl>
  8593. </dd>
  8594. <dt>&lsquo;<samp>compression_level (<em>comp</em>)</samp>&rsquo;</dt>
  8595. <dd><p>Set encoding algorithm complexity. Valid options are integers in
  8596. the 0-10 range. 0 gives the fastest encodes but lower quality, while 10
  8597. gives the highest quality but slowest encoding. The default is 10.
  8598. </p>
  8599. </dd>
  8600. <dt>&lsquo;<samp>frame_duration (<em>framesize</em>)</samp>&rsquo;</dt>
  8601. <dd><p>Set maximum frame size, or duration of a frame in milliseconds. The
  8602. argument must be exactly the following: 2.5, 5, 10, 20, 40, 60. Smaller
  8603. frame sizes achieve lower latency but less quality at a given bitrate.
  8604. Sizes greater than 20ms are only interesting at fairly low bitrates.
  8605. The default is 20ms.
  8606. </p>
  8607. </dd>
  8608. <dt>&lsquo;<samp>packet_loss (<em>expect-loss</em>)</samp>&rsquo;</dt>
  8609. <dd><p>Set expected packet loss percentage. The default is 0.
  8610. </p>
  8611. </dd>
  8612. <dt>&lsquo;<samp>application (N.A.)</samp>&rsquo;</dt>
  8613. <dd><p>Set intended application type. Valid options are listed below:
  8614. </p>
  8615. <dl compact="compact">
  8616. <dt>&lsquo;<samp>voip</samp>&rsquo;</dt>
  8617. <dd><p>Favor improved speech intelligibility.
  8618. </p></dd>
  8619. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  8620. <dd><p>Favor faithfulness to the input (the default).
  8621. </p></dd>
  8622. <dt>&lsquo;<samp>lowdelay</samp>&rsquo;</dt>
  8623. <dd><p>Restrict to only the lowest delay modes.
  8624. </p></dd>
  8625. </dl>
  8626. </dd>
  8627. <dt>&lsquo;<samp>cutoff (N.A.)</samp>&rsquo;</dt>
  8628. <dd><p>Set cutoff bandwidth in Hz. The argument must be exactly one of the
  8629. following: 4000, 6000, 8000, 12000, or 20000, corresponding to
  8630. narrowband, mediumband, wideband, super wideband, and fullband
  8631. respectively. The default is 0 (cutoff disabled).
  8632. </p>
  8633. </dd>
  8634. <dt>&lsquo;<samp>mapping_family (<em>mapping_family</em>)</samp>&rsquo;</dt>
  8635. <dd><p>Set channel mapping family to be used by the encoder. The default value of -1
  8636. uses mapping family 0 for mono and stereo inputs, and mapping family 1
  8637. otherwise. The default also disables the surround masking and LFE bandwidth
  8638. optimzations in libopus, and requires that the input contains 8 channels or
  8639. fewer.
  8640. </p>
  8641. <p>Other values include 0 for mono and stereo, 1 for surround sound with masking
  8642. and LFE bandwidth optimizations, and 255 for independent streams with an
  8643. unspecified channel layout.
  8644. </p>
  8645. </dd>
  8646. <dt>&lsquo;<samp>apply_phase_inv (N.A.) (requires libopus &gt;= 1.2)</samp>&rsquo;</dt>
  8647. <dd><p>If set to 0, disables the use of phase inversion for intensity stereo,
  8648. improving the quality of mono downmixes, but slightly reducing normal stereo
  8649. quality. The default is 1 (phase inversion enabled).
  8650. </p>
  8651. </dd>
  8652. </dl>
  8653. <p><a name="libshine"></a>
  8654. </p><a name="libshine-1"></a>
  8655. <h2 class="section"><a href="ffmpeg-all.html#toc-libshine-1">15.9 libshine</a></h2>
  8656. <p>Shine Fixed-Point MP3 encoder wrapper.
  8657. </p>
  8658. <p>Shine is a fixed-point MP3 encoder. It has a far better performance on
  8659. platforms without an FPU, e.g. armel CPUs, and some phones and tablets.
  8660. However, as it is more targeted on performance than quality, it is not on par
  8661. with LAME and other production-grade encoders quality-wise. Also, according to
  8662. the project&rsquo;s homepage, this encoder may not be free of bugs as the code was
  8663. written a long time ago and the project was dead for at least 5 years.
  8664. </p>
  8665. <p>This encoder only supports stereo and mono input. This is also CBR-only.
  8666. </p>
  8667. <p>The original project (last updated in early 2007) is at
  8668. <a href="http://sourceforge.net/projects/libshine-fxp/">http://sourceforge.net/projects/libshine-fxp/</a>. We only support the
  8669. updated fork by the Savonet/Liquidsoap project at <a href="https://github.com/savonet/shine">https://github.com/savonet/shine</a>.
  8670. </p>
  8671. <p>Requires the presence of the libshine headers and library during
  8672. configuration. You need to explicitly configure the build with
  8673. <code>--enable-libshine</code>.
  8674. </p>
  8675. <p>See also <a href="#libmp3lame">libmp3lame</a>.
  8676. </p>
  8677. <a name="Options-37"></a>
  8678. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-37">15.9.1 Options</a></h3>
  8679. <p>The following options are supported by the libshine wrapper. The
  8680. <code>shineenc</code>-equivalent of the options are listed in parentheses.
  8681. </p>
  8682. <dl compact="compact">
  8683. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8684. <dd><p>Set bitrate expressed in bits/s for CBR. <code>shineenc</code> &lsquo;<samp>-b</samp>&rsquo; option
  8685. is expressed in kilobits/s.
  8686. </p>
  8687. </dd>
  8688. </dl>
  8689. <a name="libtwolame"></a>
  8690. <h2 class="section"><a href="ffmpeg-all.html#toc-libtwolame">15.10 libtwolame</a></h2>
  8691. <p>TwoLAME MP2 encoder wrapper.
  8692. </p>
  8693. <p>Requires the presence of the libtwolame headers and library during
  8694. configuration. You need to explicitly configure the build with
  8695. <code>--enable-libtwolame</code>.
  8696. </p>
  8697. <a name="Options-44"></a>
  8698. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-44">15.10.1 Options</a></h3>
  8699. <p>The following options are supported by the libtwolame wrapper. The
  8700. <code>twolame</code>-equivalent options follow the FFmpeg ones and are in
  8701. parentheses.
  8702. </p>
  8703. <dl compact="compact">
  8704. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8705. <dd><p>Set bitrate expressed in bits/s for CBR. <code>twolame</code> &lsquo;<samp>b</samp>&rsquo;
  8706. option is expressed in kilobits/s. Default value is 128k.
  8707. </p>
  8708. </dd>
  8709. <dt>&lsquo;<samp>q (<em>-V</em>)</samp>&rsquo;</dt>
  8710. <dd><p>Set quality for experimental VBR support. Maximum value range is
  8711. from -50 to 50, useful range is from -10 to 10. The higher the
  8712. value, the better the quality. This option is valid only using the
  8713. <code>ffmpeg</code> command-line tool. For library interface users,
  8714. use &lsquo;<samp>global_quality</samp>&rsquo;.
  8715. </p>
  8716. </dd>
  8717. <dt>&lsquo;<samp>mode (<em>--mode</em>)</samp>&rsquo;</dt>
  8718. <dd><p>Set the mode of the resulting audio. Possible values:
  8719. </p>
  8720. <dl compact="compact">
  8721. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8722. <dd><p>Choose mode automatically based on the input. This is the default.
  8723. </p></dd>
  8724. <dt>&lsquo;<samp>stereo</samp>&rsquo;</dt>
  8725. <dd><p>Stereo
  8726. </p></dd>
  8727. <dt>&lsquo;<samp>joint_stereo</samp>&rsquo;</dt>
  8728. <dd><p>Joint stereo
  8729. </p></dd>
  8730. <dt>&lsquo;<samp>dual_channel</samp>&rsquo;</dt>
  8731. <dd><p>Dual channel
  8732. </p></dd>
  8733. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  8734. <dd><p>Mono
  8735. </p></dd>
  8736. </dl>
  8737. </dd>
  8738. <dt>&lsquo;<samp>psymodel (<em>--psyc-mode</em>)</samp>&rsquo;</dt>
  8739. <dd><p>Set psychoacoustic model to use in encoding. The argument must be
  8740. an integer between -1 and 4, inclusive. The higher the value, the
  8741. better the quality. The default value is 3.
  8742. </p>
  8743. </dd>
  8744. <dt>&lsquo;<samp>energy_levels (<em>--energy</em>)</samp>&rsquo;</dt>
  8745. <dd><p>Enable energy levels extensions when set to 1. The default value is
  8746. 0 (disabled).
  8747. </p>
  8748. </dd>
  8749. <dt>&lsquo;<samp>error_protection (<em>--protect</em>)</samp>&rsquo;</dt>
  8750. <dd><p>Enable CRC error protection when set to 1. The default value is 0
  8751. (disabled).
  8752. </p>
  8753. </dd>
  8754. <dt>&lsquo;<samp>copyright (<em>--copyright</em>)</samp>&rsquo;</dt>
  8755. <dd><p>Set MPEG audio copyright flag when set to 1. The default value is 0
  8756. (disabled).
  8757. </p>
  8758. </dd>
  8759. <dt>&lsquo;<samp>original (<em>--original</em>)</samp>&rsquo;</dt>
  8760. <dd><p>Set MPEG audio original flag when set to 1. The default value is 0
  8761. (disabled).
  8762. </p>
  8763. </dd>
  8764. </dl>
  8765. <a name="libvo_002damrwbenc"></a>
  8766. <h2 class="section"><a href="ffmpeg-all.html#toc-libvo_002damrwbenc">15.11 libvo-amrwbenc</a></h2>
  8767. <p>VisualOn Adaptive Multi-Rate Wideband encoder.
  8768. </p>
  8769. <p>Requires the presence of the libvo-amrwbenc headers and library during
  8770. configuration. You need to explicitly configure the build with
  8771. <code>--enable-libvo-amrwbenc --enable-version3</code>.
  8772. </p>
  8773. <p>This is a mono-only encoder. Officially it only supports 16000Hz sample
  8774. rate, but you can override it by setting &lsquo;<samp>strict</samp>&rsquo; to
  8775. &lsquo;<samp>unofficial</samp>&rsquo; or lower.
  8776. </p>
  8777. <a name="Options-33"></a>
  8778. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-33">15.11.1 Options</a></h3>
  8779. <dl compact="compact">
  8780. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  8781. <dd><p>Set bitrate in bits/s. Only the following bitrates are supported, otherwise
  8782. libavcodec will round to the nearest valid bitrate.
  8783. </p>
  8784. <dl compact="compact">
  8785. <dt>&lsquo;<samp>6600</samp>&rsquo;</dt>
  8786. <dt>&lsquo;<samp>8850</samp>&rsquo;</dt>
  8787. <dt>&lsquo;<samp>12650</samp>&rsquo;</dt>
  8788. <dt>&lsquo;<samp>14250</samp>&rsquo;</dt>
  8789. <dt>&lsquo;<samp>15850</samp>&rsquo;</dt>
  8790. <dt>&lsquo;<samp>18250</samp>&rsquo;</dt>
  8791. <dt>&lsquo;<samp>19850</samp>&rsquo;</dt>
  8792. <dt>&lsquo;<samp>23050</samp>&rsquo;</dt>
  8793. <dt>&lsquo;<samp>23850</samp>&rsquo;</dt>
  8794. </dl>
  8795. </dd>
  8796. <dt>&lsquo;<samp>dtx</samp>&rsquo;</dt>
  8797. <dd><p>Allow discontinuous transmission (generate comfort noise) when set to 1. The
  8798. default value is 0 (disabled).
  8799. </p>
  8800. </dd>
  8801. </dl>
  8802. <a name="libvorbis"></a>
  8803. <h2 class="section"><a href="ffmpeg-all.html#toc-libvorbis">15.12 libvorbis</a></h2>
  8804. <p>libvorbis encoder wrapper.
  8805. </p>
  8806. <p>Requires the presence of the libvorbisenc headers and library during
  8807. configuration. You need to explicitly configure the build with
  8808. <code>--enable-libvorbis</code>.
  8809. </p>
  8810. <a name="Options-82"></a>
  8811. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-82">15.12.1 Options</a></h3>
  8812. <p>The following options are supported by the libvorbis wrapper. The
  8813. <code>oggenc</code>-equivalent of the options are listed in parentheses.
  8814. </p>
  8815. <p>To get a more accurate and extensive documentation of the libvorbis
  8816. options, consult the libvorbisenc&rsquo;s and <code>oggenc</code>&rsquo;s documentations.
  8817. See <a href="http://xiph.org/vorbis/">http://xiph.org/vorbis/</a>,
  8818. <a href="http://wiki.xiph.org/Vorbis-tools">http://wiki.xiph.org/Vorbis-tools</a>, and oggenc(1).
  8819. </p>
  8820. <dl compact="compact">
  8821. <dt>&lsquo;<samp>b (<em>-b</em>)</samp>&rsquo;</dt>
  8822. <dd><p>Set bitrate expressed in bits/s for ABR. <code>oggenc</code> &lsquo;<samp>-b</samp>&rsquo; is
  8823. expressed in kilobits/s.
  8824. </p>
  8825. </dd>
  8826. <dt>&lsquo;<samp>q (<em>-q</em>)</samp>&rsquo;</dt>
  8827. <dd><p>Set constant quality setting for VBR. The value should be a float
  8828. number in the range of -1.0 to 10.0. The higher the value, the better
  8829. the quality. The default value is &lsquo;<samp>3.0</samp>&rsquo;.
  8830. </p>
  8831. <p>This option is valid only using the <code>ffmpeg</code> command-line tool.
  8832. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  8833. </p>
  8834. </dd>
  8835. <dt>&lsquo;<samp>cutoff (<em>--advanced-encode-option lowpass_frequency=N</em>)</samp>&rsquo;</dt>
  8836. <dd><p>Set cutoff bandwidth in Hz, a value of 0 disables cutoff. <code>oggenc</code>&rsquo;s
  8837. related option is expressed in kHz. The default value is &lsquo;<samp>0</samp>&rsquo; (cutoff
  8838. disabled).
  8839. </p>
  8840. </dd>
  8841. <dt>&lsquo;<samp>minrate (<em>-m</em>)</samp>&rsquo;</dt>
  8842. <dd><p>Set minimum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-m</samp>&rsquo; is
  8843. expressed in kilobits/s.
  8844. </p>
  8845. </dd>
  8846. <dt>&lsquo;<samp>maxrate (<em>-M</em>)</samp>&rsquo;</dt>
  8847. <dd><p>Set maximum bitrate expressed in bits/s. <code>oggenc</code> &lsquo;<samp>-M</samp>&rsquo; is
  8848. expressed in kilobits/s. This only has effect on ABR mode.
  8849. </p>
  8850. </dd>
  8851. <dt>&lsquo;<samp>iblock (<em>--advanced-encode-option impulse_noisetune=N</em>)</samp>&rsquo;</dt>
  8852. <dd><p>Set noise floor bias for impulse blocks. The value is a float number from
  8853. -15.0 to 0.0. A negative bias instructs the encoder to pay special attention
  8854. to the crispness of transients in the encoded audio. The tradeoff for better
  8855. transient response is a higher bitrate.
  8856. </p>
  8857. </dd>
  8858. </dl>
  8859. <p><a name="libwavpack"></a>
  8860. </p><a name="libwavpack-1"></a>
  8861. <h2 class="section"><a href="ffmpeg-all.html#toc-libwavpack-1">15.13 libwavpack</a></h2>
  8862. <p>A wrapper providing WavPack encoding through libwavpack.
  8863. </p>
  8864. <p>Only lossless mode using 32-bit integer samples is supported currently.
  8865. </p>
  8866. <p>Requires the presence of the libwavpack headers and library during
  8867. configuration. You need to explicitly configure the build with
  8868. <code>--enable-libwavpack</code>.
  8869. </p>
  8870. <p>Note that a libavcodec-native encoder for the WavPack codec exists so users can
  8871. encode audios with this codec without using this encoder. See <a href="#wavpackenc">wavpackenc</a>.
  8872. </p>
  8873. <a name="Options-36"></a>
  8874. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-36">15.13.1 Options</a></h3>
  8875. <p><code>wavpack</code> command line utility&rsquo;s corresponding options are listed in
  8876. parentheses, if any.
  8877. </p>
  8878. <dl compact="compact">
  8879. <dt>&lsquo;<samp>frame_size (<em>--blocksize</em>)</samp>&rsquo;</dt>
  8880. <dd><p>Default is 32768.
  8881. </p>
  8882. </dd>
  8883. <dt>&lsquo;<samp>compression_level</samp>&rsquo;</dt>
  8884. <dd><p>Set speed vs. compression tradeoff. Acceptable arguments are listed below:
  8885. </p>
  8886. <dl compact="compact">
  8887. <dt>&lsquo;<samp>0 (<em>-f</em>)</samp>&rsquo;</dt>
  8888. <dd><p>Fast mode.
  8889. </p>
  8890. </dd>
  8891. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  8892. <dd><p>Normal (default) settings.
  8893. </p>
  8894. </dd>
  8895. <dt>&lsquo;<samp>2 (<em>-h</em>)</samp>&rsquo;</dt>
  8896. <dd><p>High quality.
  8897. </p>
  8898. </dd>
  8899. <dt>&lsquo;<samp>3 (<em>-hh</em>)</samp>&rsquo;</dt>
  8900. <dd><p>Very high quality.
  8901. </p>
  8902. </dd>
  8903. <dt>&lsquo;<samp>4-8 (<em>-hh -x</em><var>EXTRAPROC</var>)</samp>&rsquo;</dt>
  8904. <dd><p>Same as &lsquo;<samp>3</samp>&rsquo;, but with extra processing enabled.
  8905. </p>
  8906. <p>&lsquo;<samp>4</samp>&rsquo; is the same as &lsquo;<samp>-x2</samp>&rsquo; and &lsquo;<samp>8</samp>&rsquo; is the same as &lsquo;<samp>-x6</samp>&rsquo;.
  8907. </p>
  8908. </dd>
  8909. </dl>
  8910. </dd>
  8911. </dl>
  8912. <p><a name="mjpegenc"></a>
  8913. </p><a name="mjpeg"></a>
  8914. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpeg">15.14 mjpeg</a></h2>
  8915. <p>Motion JPEG encoder.
  8916. </p>
  8917. <a name="Options-30"></a>
  8918. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-30">15.14.1 Options</a></h3>
  8919. <dl compact="compact">
  8920. <dt>&lsquo;<samp>huffman</samp>&rsquo;</dt>
  8921. <dd><p>Set the huffman encoding strategy. Possible values:
  8922. </p>
  8923. <dl compact="compact">
  8924. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  8925. <dd><p>Use the default huffman tables. This is the default strategy.
  8926. </p>
  8927. </dd>
  8928. <dt>&lsquo;<samp>optimal</samp>&rsquo;</dt>
  8929. <dd><p>Compute and use optimal huffman tables.
  8930. </p>
  8931. </dd>
  8932. </dl>
  8933. </dd>
  8934. </dl>
  8935. <p><a name="wavpackenc"></a>
  8936. </p><a name="wavpack"></a>
  8937. <h2 class="section"><a href="ffmpeg-all.html#toc-wavpack">15.15 wavpack</a></h2>
  8938. <p>WavPack lossless audio encoder.
  8939. </p>
  8940. <p>This is a libavcodec-native WavPack encoder. There is also an encoder based on
  8941. libwavpack, but there is virtually no reason to use that encoder.
  8942. </p>
  8943. <p>See also <a href="#libwavpack">libwavpack</a>.
  8944. </p>
  8945. <a name="Options-73"></a>
  8946. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-73">15.15.1 Options</a></h3>
  8947. <p>The equivalent options for <code>wavpack</code> command line utility are listed in
  8948. parentheses.
  8949. </p>
  8950. <a name="Shared-options"></a>
  8951. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Shared-options">15.15.1.1 Shared options</a></h4>
  8952. <p>The following shared options are effective for this encoder. Only special notes
  8953. about this particular encoder will be documented here. For the general meaning
  8954. of the options, see <a href="#codec_002doptions">the Codec Options chapter</a>.
  8955. </p>
  8956. <dl compact="compact">
  8957. <dt>&lsquo;<samp>frame_size (<em>--blocksize</em>)</samp>&rsquo;</dt>
  8958. <dd><p>For this encoder, the range for this option is between 128 and 131072. Default
  8959. is automatically decided based on sample rate and number of channel.
  8960. </p>
  8961. <p>For the complete formula of calculating default, see
  8962. &lsquo;<tt>libavcodec/wavpackenc.c</tt>&rsquo;.
  8963. </p>
  8964. </dd>
  8965. <dt>&lsquo;<samp>compression_level (<em>-f</em>, <em>-h</em>, <em>-hh</em>, and <em>-x</em>)</samp>&rsquo;</dt>
  8966. <dd><p>This option&rsquo;s syntax is consistent with <a href="#libwavpack">libwavpack</a>&rsquo;s.
  8967. </p></dd>
  8968. </dl>
  8969. <a name="Private-options"></a>
  8970. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Private-options">15.15.1.2 Private options</a></h4>
  8971. <dl compact="compact">
  8972. <dt>&lsquo;<samp>joint_stereo (<em>-j</em>)</samp>&rsquo;</dt>
  8973. <dd><p>Set whether to enable joint stereo. Valid values are:
  8974. </p>
  8975. <dl compact="compact">
  8976. <dt>&lsquo;<samp>on (<em>1</em>)</samp>&rsquo;</dt>
  8977. <dd><p>Force mid/side audio encoding.
  8978. </p></dd>
  8979. <dt>&lsquo;<samp>off (<em>0</em>)</samp>&rsquo;</dt>
  8980. <dd><p>Force left/right audio encoding.
  8981. </p></dd>
  8982. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  8983. <dd><p>Let the encoder decide automatically.
  8984. </p></dd>
  8985. </dl>
  8986. </dd>
  8987. <dt>&lsquo;<samp>optimize_mono</samp>&rsquo;</dt>
  8988. <dd><p>Set whether to enable optimization for mono. This option is only effective for
  8989. non-mono streams. Available values:
  8990. </p>
  8991. <dl compact="compact">
  8992. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  8993. <dd><p>enabled
  8994. </p></dd>
  8995. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  8996. <dd><p>disabled
  8997. </p></dd>
  8998. </dl>
  8999. </dd>
  9000. </dl>
  9001. <a name="Video-Encoders"></a>
  9002. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Encoders">16 Video Encoders</a></h1>
  9003. <p>A description of some of the currently available video encoders
  9004. follows.
  9005. </p>
  9006. <a name="Hap"></a>
  9007. <h2 class="section"><a href="ffmpeg-all.html#toc-Hap">16.1 Hap</a></h2>
  9008. <p>Vidvox Hap video encoder.
  9009. </p>
  9010. <a name="Options-11"></a>
  9011. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-11">16.1.1 Options</a></h3>
  9012. <dl compact="compact">
  9013. <dt>&lsquo;<samp>format <var>integer</var></samp>&rsquo;</dt>
  9014. <dd><p>Specifies the Hap format to encode.
  9015. </p>
  9016. <dl compact="compact">
  9017. <dt>&lsquo;<samp>hap</samp>&rsquo;</dt>
  9018. <dt>&lsquo;<samp>hap_alpha</samp>&rsquo;</dt>
  9019. <dt>&lsquo;<samp>hap_q</samp>&rsquo;</dt>
  9020. </dl>
  9021. <p>Default value is &lsquo;<samp>hap</samp>&rsquo;.
  9022. </p>
  9023. </dd>
  9024. <dt>&lsquo;<samp>chunks <var>integer</var></samp>&rsquo;</dt>
  9025. <dd><p>Specifies the number of chunks to split frames into, between 1 and 64. This
  9026. permits multithreaded decoding of large frames, potentially at the cost of
  9027. data-rate. The encoder may modify this value to divide frames evenly.
  9028. </p>
  9029. <p>Default value is <var>1</var>.
  9030. </p>
  9031. </dd>
  9032. <dt>&lsquo;<samp>compressor <var>integer</var></samp>&rsquo;</dt>
  9033. <dd><p>Specifies the second-stage compressor to use. If set to &lsquo;<samp>none</samp>&rsquo;,
  9034. &lsquo;<samp>chunks</samp>&rsquo; will be limited to 1, as chunked uncompressed frames offer no
  9035. benefit.
  9036. </p>
  9037. <dl compact="compact">
  9038. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  9039. <dt>&lsquo;<samp>snappy</samp>&rsquo;</dt>
  9040. </dl>
  9041. <p>Default value is &lsquo;<samp>snappy</samp>&rsquo;.
  9042. </p>
  9043. </dd>
  9044. </dl>
  9045. <a name="jpeg2000"></a>
  9046. <h2 class="section"><a href="ffmpeg-all.html#toc-jpeg2000">16.2 jpeg2000</a></h2>
  9047. <p>The native jpeg 2000 encoder is lossy by default, the <code>-q:v</code>
  9048. option can be used to set the encoding quality. Lossless encoding
  9049. can be selected with <code>-pred 1</code>.
  9050. </p>
  9051. <a name="Options-38"></a>
  9052. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-38">16.2.1 Options</a></h3>
  9053. <dl compact="compact">
  9054. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  9055. <dd><p>Can be set to either <code>j2k</code> or <code>jp2</code> (the default) that
  9056. makes it possible to store non-rgb pix_fmts.
  9057. </p>
  9058. </dd>
  9059. </dl>
  9060. <a name="librav1e"></a>
  9061. <h2 class="section"><a href="ffmpeg-all.html#toc-librav1e">16.3 librav1e</a></h2>
  9062. <p>rav1e AV1 encoder wrapper.
  9063. </p>
  9064. <p>Requires the presence of the rav1e headers and library during configuration.
  9065. You need to explicitly configure the build with <code>--enable-librav1e</code>.
  9066. </p>
  9067. <a name="Options-68"></a>
  9068. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-68">16.3.1 Options</a></h3>
  9069. <dl compact="compact">
  9070. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  9071. <dd><p>Sets the maximum quantizer to use when using bitrate mode.
  9072. </p>
  9073. </dd>
  9074. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  9075. <dd><p>Sets the minimum quantizer to use when using bitrate mode.
  9076. </p>
  9077. </dd>
  9078. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  9079. <dd><p>Uses quantizer mode to encode at the given quantizer (0-255).
  9080. </p>
  9081. </dd>
  9082. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  9083. <dd><p>Selects the speed preset (0-10) to encode with.
  9084. </p>
  9085. </dd>
  9086. <dt>&lsquo;<samp>tiles</samp>&rsquo;</dt>
  9087. <dd><p>Selects how many tiles to encode with.
  9088. </p>
  9089. </dd>
  9090. <dt>&lsquo;<samp>tile-rows</samp>&rsquo;</dt>
  9091. <dd><p>Selects how many rows of tiles to encode with.
  9092. </p>
  9093. </dd>
  9094. <dt>&lsquo;<samp>tile-columns</samp>&rsquo;</dt>
  9095. <dd><p>Selects how many columns of tiles to encode with.
  9096. </p>
  9097. </dd>
  9098. <dt>&lsquo;<samp>rav1e-params</samp>&rsquo;</dt>
  9099. <dd><p>Set rav1e options using a list of <var>key</var>=<var>value</var> pairs separated
  9100. by &quot;:&quot;. See <code>rav1e --help</code> for a list of options.
  9101. </p>
  9102. <p>For example to specify librav1e encoding options with &lsquo;<samp>-rav1e-params</samp>&rsquo;:
  9103. </p>
  9104. <div class="example">
  9105. <pre class="example">ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4
  9106. </pre></div>
  9107. </dd>
  9108. </dl>
  9109. <a name="libaom_002dav1"></a>
  9110. <h2 class="section"><a href="ffmpeg-all.html#toc-libaom_002dav1">16.4 libaom-av1</a></h2>
  9111. <p>libaom AV1 encoder wrapper.
  9112. </p>
  9113. <p>Requires the presence of the libaom headers and library during
  9114. configuration. You need to explicitly configure the build with
  9115. <code>--enable-libaom</code>.
  9116. </p>
  9117. <a name="Options-27"></a>
  9118. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-27">16.4.1 Options</a></h3>
  9119. <p>The wrapper supports the following standard libavcodec options:
  9120. </p>
  9121. <dl compact="compact">
  9122. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9123. <dd><p>Set bitrate target in bits/second. By default this will use
  9124. variable-bitrate mode. If &lsquo;<samp>maxrate</samp>&rsquo; and &lsquo;<samp>minrate</samp>&rsquo; are
  9125. also set to the same value then it will use constant-bitrate mode,
  9126. otherwise if &lsquo;<samp>crf</samp>&rsquo; is set as well then it will use
  9127. constrained-quality mode.
  9128. </p>
  9129. </dd>
  9130. <dt>&lsquo;<samp>g keyint_min</samp>&rsquo;</dt>
  9131. <dd><p>Set key frame placement. The GOP size sets the maximum distance between
  9132. key frames; if zero the output stream will be intra-only. The minimum
  9133. distance is ignored unless it is the same as the GOP size, in which case
  9134. key frames will always appear at a fixed interval. Not set by default,
  9135. so without this option the library has completely free choice about
  9136. where to place key frames.
  9137. </p>
  9138. </dd>
  9139. <dt>&lsquo;<samp>qmin qmax</samp>&rsquo;</dt>
  9140. <dd><p>Set minimum/maximum quantisation values. Valid range is from 0 to 63
  9141. (warning: this does not match the quantiser values actually used by AV1
  9142. - divide by four to map real quantiser values to this range). Defaults
  9143. to min/max (no constraint).
  9144. </p>
  9145. </dd>
  9146. <dt>&lsquo;<samp>minrate maxrate bufsize rc_init_occupancy</samp>&rsquo;</dt>
  9147. <dd><p>Set rate control buffering parameters. Not used if not set - defaults
  9148. to unconstrained variable bitrate.
  9149. </p>
  9150. </dd>
  9151. <dt>&lsquo;<samp>threads</samp>&rsquo;</dt>
  9152. <dd><p>Set the number of threads to use while encoding. This may require the
  9153. &lsquo;<samp>tiles</samp>&rsquo; or &lsquo;<samp>row-mt</samp>&rsquo; options to also be set to actually
  9154. use the specified number of threads fully. Defaults to the number of
  9155. hardware threads supported by the host machine.
  9156. </p>
  9157. </dd>
  9158. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  9159. <dd><p>Set the encoding profile. Defaults to using the profile which matches
  9160. the bit depth and chroma subsampling of the input.
  9161. </p>
  9162. </dd>
  9163. </dl>
  9164. <p>The wrapper also has some specific options:
  9165. </p>
  9166. <dl compact="compact">
  9167. <dt>&lsquo;<samp>cpu-used</samp>&rsquo;</dt>
  9168. <dd><p>Set the quality/encoding speed tradeoff. Valid range is from 0 to 8,
  9169. higher numbers indicating greater speed and lower quality. The default
  9170. value is 1, which will be slow and high quality.
  9171. </p>
  9172. </dd>
  9173. <dt>&lsquo;<samp>auto-alt-ref</samp>&rsquo;</dt>
  9174. <dd><p>Enable use of alternate reference frames. Defaults to the internal
  9175. default of the library.
  9176. </p>
  9177. </dd>
  9178. <dt>&lsquo;<samp>arnr-max-frames (<em>frames</em>)</samp>&rsquo;</dt>
  9179. <dd><p>Set altref noise reduction max frame count. Default is -1.
  9180. </p>
  9181. </dd>
  9182. <dt>&lsquo;<samp>arnr-strength (<em>strength</em>)</samp>&rsquo;</dt>
  9183. <dd><p>Set altref noise reduction filter strength. Range is -1 to 6. Default is -1.
  9184. </p>
  9185. </dd>
  9186. <dt>&lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
  9187. <dd><p>Set adaptive quantization mode. Possible values:
  9188. </p>
  9189. <dl compact="compact">
  9190. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  9191. <dd><p>Disabled.
  9192. </p>
  9193. </dd>
  9194. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  9195. <dd><p>Variance-based.
  9196. </p>
  9197. </dd>
  9198. <dt>&lsquo;<samp>complexity (<em>2</em>)</samp>&rsquo;</dt>
  9199. <dd><p>Complexity-based.
  9200. </p>
  9201. </dd>
  9202. <dt>&lsquo;<samp>cyclic (<em>3</em>)</samp>&rsquo;</dt>
  9203. <dd><p>Cyclic refresh.
  9204. </p></dd>
  9205. </dl>
  9206. </dd>
  9207. <dt>&lsquo;<samp>lag-in-frames</samp>&rsquo;</dt>
  9208. <dd><p>Set the maximum number of frames which the encoder may keep in flight
  9209. at any one time for lookahead purposes. Defaults to the internal
  9210. default of the library.
  9211. </p>
  9212. </dd>
  9213. <dt>&lsquo;<samp>error-resilience</samp>&rsquo;</dt>
  9214. <dd><p>Enable error resilience features:
  9215. </p><dl compact="compact">
  9216. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  9217. <dd><p>Improve resilience against losses of whole frames.
  9218. </p></dd>
  9219. </dl>
  9220. <p>Not enabled by default.
  9221. </p>
  9222. </dd>
  9223. <dt>&lsquo;<samp>crf</samp>&rsquo;</dt>
  9224. <dd><p>Set the quality/size tradeoff for constant-quality (no bitrate target)
  9225. and constrained-quality (with maximum bitrate target) modes. Valid
  9226. range is 0 to 63, higher numbers indicating lower quality and smaller
  9227. output size. Only used if set; by default only the bitrate target is
  9228. used.
  9229. </p>
  9230. </dd>
  9231. <dt>&lsquo;<samp>static-thresh</samp>&rsquo;</dt>
  9232. <dd><p>Set a change threshold on blocks below which they will be skipped by
  9233. the encoder. Defined in arbitrary units as a nonnegative integer,
  9234. defaulting to zero (no blocks are skipped).
  9235. </p>
  9236. </dd>
  9237. <dt>&lsquo;<samp>drop-threshold</samp>&rsquo;</dt>
  9238. <dd><p>Set a threshold for dropping frames when close to rate control bounds.
  9239. Defined as a percentage of the target buffer - when the rate control
  9240. buffer falls below this percentage, frames will be dropped until it
  9241. has refilled above the threshold. Defaults to zero (no frames are
  9242. dropped).
  9243. </p>
  9244. </dd>
  9245. <dt>&lsquo;<samp>denoise-noise-level (<em>level</em>)</samp>&rsquo;</dt>
  9246. <dd><p>Amount of noise to be removed for grain synthesis. Grain synthesis is disabled if
  9247. this option is not set or set to 0.
  9248. </p>
  9249. </dd>
  9250. <dt>&lsquo;<samp>denoise-block-size (<em>pixels</em>)</samp>&rsquo;</dt>
  9251. <dd><p>Block size used for denoising for grain synthesis. If not set, AV1 codec
  9252. uses the default value of 32.
  9253. </p>
  9254. </dd>
  9255. <dt>&lsquo;<samp>undershoot-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9256. <dd><p>Set datarate undershoot (min) percentage of the target bitrate. Range is -1 to 100.
  9257. Default is -1.
  9258. </p>
  9259. </dd>
  9260. <dt>&lsquo;<samp>overshoot-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9261. <dd><p>Set datarate overshoot (max) percentage of the target bitrate. Range is -1 to 1000.
  9262. Default is -1.
  9263. </p>
  9264. </dd>
  9265. <dt>&lsquo;<samp>minsection-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9266. <dd><p>Minimum percentage variation of the GOP bitrate from the target bitrate. If minsection-pct
  9267. is not set, the libaomenc wrapper computes it as follows: <code>(minrate * 100 / bitrate)</code>.
  9268. Range is -1 to 100. Default is -1 (unset).
  9269. </p>
  9270. </dd>
  9271. <dt>&lsquo;<samp>maxsection-pct (<em>pct</em>)</samp>&rsquo;</dt>
  9272. <dd><p>Maximum percentage variation of the GOP bitrate from the target bitrate. If maxsection-pct
  9273. is not set, the libaomenc wrapper computes it as follows: <code>(maxrate * 100 / bitrate)</code>.
  9274. Range is -1 to 5000. Default is -1 (unset).
  9275. </p>
  9276. </dd>
  9277. <dt>&lsquo;<samp>frame-parallel (<em>boolean</em>)</samp>&rsquo;</dt>
  9278. <dd><p>Enable frame parallel decodability features. Default is true.
  9279. </p>
  9280. </dd>
  9281. <dt>&lsquo;<samp>tiles</samp>&rsquo;</dt>
  9282. <dd><p>Set the number of tiles to encode the input video with, as columns x
  9283. rows. Larger numbers allow greater parallelism in both encoding and
  9284. decoding, but may decrease coding efficiency. Defaults to the minimum
  9285. number of tiles required by the size of the input video (this is 1x1
  9286. (that is, a single tile) for sizes up to and including 4K).
  9287. </p>
  9288. </dd>
  9289. <dt>&lsquo;<samp>tile-columns tile-rows</samp>&rsquo;</dt>
  9290. <dd><p>Set the number of tiles as log2 of the number of tile rows and columns.
  9291. Provided for compatibility with libvpx/VP9.
  9292. </p>
  9293. </dd>
  9294. <dt>&lsquo;<samp>row-mt (Requires libaom &gt;= 1.0.0-759-g90a15f4f2)</samp>&rsquo;</dt>
  9295. <dd><p>Enable row based multi-threading. Disabled by default.
  9296. </p>
  9297. </dd>
  9298. <dt>&lsquo;<samp>enable-cdef (<em>boolean</em>)</samp>&rsquo;</dt>
  9299. <dd><p>Enable Constrained Directional Enhancement Filter. The libaom-av1
  9300. encoder enables CDEF by default.
  9301. </p>
  9302. </dd>
  9303. <dt>&lsquo;<samp>enable-restoration (<em>boolean</em>)</samp>&rsquo;</dt>
  9304. <dd><p>Enable Loop Restoration Filter. Default is true for libaom-av1.
  9305. </p>
  9306. </dd>
  9307. <dt>&lsquo;<samp>enable-global-motion (<em>boolean</em>)</samp>&rsquo;</dt>
  9308. <dd><p>Enable the use of global motion for block prediction. Default is true.
  9309. </p>
  9310. </dd>
  9311. <dt>&lsquo;<samp>enable-intrabc (<em>boolean</em>)</samp>&rsquo;</dt>
  9312. <dd><p>Enable block copy mode for intra block prediction. This mode is
  9313. useful for screen content. Default is true.
  9314. </p>
  9315. </dd>
  9316. </dl>
  9317. <a name="libkvazaar"></a>
  9318. <h2 class="section"><a href="ffmpeg-all.html#toc-libkvazaar">16.5 libkvazaar</a></h2>
  9319. <p>Kvazaar H.265/HEVC encoder.
  9320. </p>
  9321. <p>Requires the presence of the libkvazaar headers and library during
  9322. configuration. You need to explicitly configure the build with
  9323. &lsquo;<samp>--enable-libkvazaar</samp>&rsquo;.
  9324. </p>
  9325. <a name="Options-45"></a>
  9326. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-45">16.5.1 Options</a></h3>
  9327. <dl compact="compact">
  9328. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9329. <dd><p>Set target video bitrate in bit/s and enable rate control.
  9330. </p>
  9331. </dd>
  9332. <dt>&lsquo;<samp>kvazaar-params</samp>&rsquo;</dt>
  9333. <dd><p>Set kvazaar parameters as a list of <var>name</var>=<var>value</var> pairs separated
  9334. by commas (,). See kvazaar documentation for a list of options.
  9335. </p>
  9336. </dd>
  9337. </dl>
  9338. <a name="libopenh264"></a>
  9339. <h2 class="section"><a href="ffmpeg-all.html#toc-libopenh264">16.6 libopenh264</a></h2>
  9340. <p>Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
  9341. </p>
  9342. <p>This encoder requires the presence of the libopenh264 headers and
  9343. library during configuration. You need to explicitly configure the
  9344. build with <code>--enable-libopenh264</code>. The library is detected using
  9345. <code>pkg-config</code>.
  9346. </p>
  9347. <p>For more information about the library see
  9348. <a href="http://www.openh264.org">http://www.openh264.org</a>.
  9349. </p>
  9350. <a name="Options-24"></a>
  9351. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-24">16.6.1 Options</a></h3>
  9352. <p>The following FFmpeg global options affect the configurations of the
  9353. libopenh264 encoder.
  9354. </p>
  9355. <dl compact="compact">
  9356. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9357. <dd><p>Set the bitrate (as a number of bits per second).
  9358. </p>
  9359. </dd>
  9360. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  9361. <dd><p>Set the GOP size.
  9362. </p>
  9363. </dd>
  9364. <dt>&lsquo;<samp>maxrate</samp>&rsquo;</dt>
  9365. <dd><p>Set the max bitrate (as a number of bits per second).
  9366. </p>
  9367. </dd>
  9368. <dt>&lsquo;<samp>flags +global_header</samp>&rsquo;</dt>
  9369. <dd><p>Set global header in the bitstream.
  9370. </p>
  9371. </dd>
  9372. <dt>&lsquo;<samp>slices</samp>&rsquo;</dt>
  9373. <dd><p>Set the number of slices, used in parallelized encoding. Default value
  9374. is 0. This is only used when &lsquo;<samp>slice_mode</samp>&rsquo; is set to
  9375. &lsquo;<samp>fixed</samp>&rsquo;.
  9376. </p>
  9377. </dd>
  9378. <dt>&lsquo;<samp>slice_mode</samp>&rsquo;</dt>
  9379. <dd><p>Set slice mode. Can assume one of the following possible values:
  9380. </p>
  9381. <dl compact="compact">
  9382. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  9383. <dd><p>a fixed number of slices
  9384. </p></dd>
  9385. <dt>&lsquo;<samp>rowmb</samp>&rsquo;</dt>
  9386. <dd><p>one slice per row of macroblocks
  9387. </p></dd>
  9388. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9389. <dd><p>automatic number of slices according to number of threads
  9390. </p></dd>
  9391. <dt>&lsquo;<samp>dyn</samp>&rsquo;</dt>
  9392. <dd><p>dynamic slicing
  9393. </p></dd>
  9394. </dl>
  9395. <p>Default value is &lsquo;<samp>auto</samp>&rsquo;.
  9396. </p>
  9397. </dd>
  9398. <dt>&lsquo;<samp>loopfilter</samp>&rsquo;</dt>
  9399. <dd><p>Enable loop filter, if set to 1 (automatically enabled). To disable
  9400. set a value of 0.
  9401. </p>
  9402. </dd>
  9403. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  9404. <dd><p>Set profile restrictions. If set to the value of &lsquo;<samp>main</samp>&rsquo; enable
  9405. CABAC (set the <code>SEncParamExt.iEntropyCodingModeFlag</code> flag to 1).
  9406. </p>
  9407. </dd>
  9408. <dt>&lsquo;<samp>max_nal_size</samp>&rsquo;</dt>
  9409. <dd><p>Set maximum NAL size in bytes.
  9410. </p>
  9411. </dd>
  9412. <dt>&lsquo;<samp>allow_skip_frames</samp>&rsquo;</dt>
  9413. <dd><p>Allow skipping frames to hit the target bitrate if set to 1.
  9414. </p></dd>
  9415. </dl>
  9416. <a name="libtheora"></a>
  9417. <h2 class="section"><a href="ffmpeg-all.html#toc-libtheora">16.7 libtheora</a></h2>
  9418. <p>libtheora Theora encoder wrapper.
  9419. </p>
  9420. <p>Requires the presence of the libtheora headers and library during
  9421. configuration. You need to explicitly configure the build with
  9422. <code>--enable-libtheora</code>.
  9423. </p>
  9424. <p>For more information about the libtheora project see
  9425. <a href="http://www.theora.org/">http://www.theora.org/</a>.
  9426. </p>
  9427. <a name="Options-25"></a>
  9428. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-25">16.7.1 Options</a></h3>
  9429. <p>The following global options are mapped to internal libtheora options
  9430. which affect the quality and the bitrate of the encoded stream.
  9431. </p>
  9432. <dl compact="compact">
  9433. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  9434. <dd><p>Set the video bitrate in bit/s for CBR (Constant Bit Rate) mode. In
  9435. case VBR (Variable Bit Rate) mode is enabled this option is ignored.
  9436. </p>
  9437. </dd>
  9438. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  9439. <dd><p>Used to enable constant quality mode (VBR) encoding through the
  9440. &lsquo;<samp>qscale</samp>&rsquo; flag, and to enable the <code>pass1</code> and <code>pass2</code>
  9441. modes.
  9442. </p>
  9443. </dd>
  9444. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  9445. <dd><p>Set the GOP size.
  9446. </p>
  9447. </dd>
  9448. <dt>&lsquo;<samp>global_quality</samp>&rsquo;</dt>
  9449. <dd><p>Set the global quality as an integer in lambda units.
  9450. </p>
  9451. <p>Only relevant when VBR mode is enabled with <code>flags +qscale</code>. The
  9452. value is converted to QP units by dividing it by <code>FF_QP2LAMBDA</code>,
  9453. clipped in the [0 - 10] range, and then multiplied by 6.3 to get a
  9454. value in the native libtheora range [0-63]. A higher value corresponds
  9455. to a higher quality.
  9456. </p>
  9457. </dd>
  9458. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  9459. <dd><p>Enable VBR mode when set to a non-negative value, and set constant
  9460. quality value as a double floating point value in QP units.
  9461. </p>
  9462. <p>The value is clipped in the [0-10] range, and then multiplied by 6.3
  9463. to get a value in the native libtheora range [0-63].
  9464. </p>
  9465. <p>This option is valid only using the <code>ffmpeg</code> command-line
  9466. tool. For library interface users, use &lsquo;<samp>global_quality</samp>&rsquo;.
  9467. </p></dd>
  9468. </dl>
  9469. <a name="Examples-179"></a>
  9470. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-179">16.7.2 Examples</a></h3>
  9471. <ul>
  9472. <li>
  9473. Set maximum constant quality (VBR) encoding with <code>ffmpeg</code>:
  9474. <div class="example">
  9475. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -q:v 10 OUTPUT.ogg
  9476. </pre></div>
  9477. </li><li>
  9478. Use <code>ffmpeg</code> to convert a CBR 1000 kbps Theora video stream:
  9479. <div class="example">
  9480. <pre class="example">ffmpeg -i INPUT -codec:v libtheora -b:v 1000k OUTPUT.ogg
  9481. </pre></div>
  9482. </li></ul>
  9483. <a name="libvpx"></a>
  9484. <h2 class="section"><a href="ffmpeg-all.html#toc-libvpx">16.8 libvpx</a></h2>
  9485. <p>VP8/VP9 format supported through libvpx.
  9486. </p>
  9487. <p>Requires the presence of the libvpx headers and library during configuration.
  9488. You need to explicitly configure the build with <code>--enable-libvpx</code>.
  9489. </p>
  9490. <a name="Options-9"></a>
  9491. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-9">16.8.1 Options</a></h3>
  9492. <p>The following options are supported by the libvpx wrapper. The
  9493. <code>vpxenc</code>-equivalent options or values are listed in parentheses
  9494. for easy migration.
  9495. </p>
  9496. <p>To reduce the duplication of documentation, only the private options
  9497. and some others requiring special attention are documented here. For
  9498. the documentation of the undocumented generic options, see
  9499. <a href="#codec_002doptions">the Codec Options chapter</a>.
  9500. </p>
  9501. <p>To get more documentation of the libvpx options, invoke the command
  9502. <code>ffmpeg -h encoder=libvpx</code>, <code>ffmpeg -h encoder=libvpx-vp9</code> or
  9503. <code>vpxenc --help</code>. Further information is available in the libvpx API
  9504. documentation.
  9505. </p>
  9506. <dl compact="compact">
  9507. <dt>&lsquo;<samp>b (<em>target-bitrate</em>)</samp>&rsquo;</dt>
  9508. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  9509. expressed in bits/s, while <code>vpxenc</code>&rsquo;s &lsquo;<samp>target-bitrate</samp>&rsquo; is in
  9510. kilobits/s.
  9511. </p>
  9512. </dd>
  9513. <dt>&lsquo;<samp>g (<em>kf-max-dist</em>)</samp>&rsquo;</dt>
  9514. <dt>&lsquo;<samp>keyint_min (<em>kf-min-dist</em>)</samp>&rsquo;</dt>
  9515. <dt>&lsquo;<samp>qmin (<em>min-q</em>)</samp>&rsquo;</dt>
  9516. <dt>&lsquo;<samp>qmax (<em>max-q</em>)</samp>&rsquo;</dt>
  9517. <dt>&lsquo;<samp>bufsize (<em>buf-sz</em>, <em>buf-optimal-sz</em>)</samp>&rsquo;</dt>
  9518. <dd><p>Set ratecontrol buffer size (in bits). Note <code>vpxenc</code>&rsquo;s options are
  9519. specified in milliseconds, the libvpx wrapper converts this value as follows:
  9520. <code>buf-sz = bufsize * 1000 / bitrate</code>,
  9521. <code>buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6</code>.
  9522. </p>
  9523. </dd>
  9524. <dt>&lsquo;<samp>rc_init_occupancy (<em>buf-initial-sz</em>)</samp>&rsquo;</dt>
  9525. <dd><p>Set number of bits which should be loaded into the rc buffer before decoding
  9526. starts. Note <code>vpxenc</code>&rsquo;s option is specified in milliseconds, the libvpx
  9527. wrapper converts this value as follows:
  9528. <code>rc_init_occupancy * 1000 / bitrate</code>.
  9529. </p>
  9530. </dd>
  9531. <dt>&lsquo;<samp>undershoot-pct</samp>&rsquo;</dt>
  9532. <dd><p>Set datarate undershoot (min) percentage of the target bitrate.
  9533. </p>
  9534. </dd>
  9535. <dt>&lsquo;<samp>overshoot-pct</samp>&rsquo;</dt>
  9536. <dd><p>Set datarate overshoot (max) percentage of the target bitrate.
  9537. </p>
  9538. </dd>
  9539. <dt>&lsquo;<samp>skip_threshold (<em>drop-frame</em>)</samp>&rsquo;</dt>
  9540. <dt>&lsquo;<samp>qcomp (<em>bias-pct</em>)</samp>&rsquo;</dt>
  9541. <dt>&lsquo;<samp>maxrate (<em>maxsection-pct</em>)</samp>&rsquo;</dt>
  9542. <dd><p>Set GOP max bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  9543. percentage of the target bitrate, the libvpx wrapper converts this value as
  9544. follows: <code>(maxrate * 100 / bitrate)</code>.
  9545. </p>
  9546. </dd>
  9547. <dt>&lsquo;<samp>minrate (<em>minsection-pct</em>)</samp>&rsquo;</dt>
  9548. <dd><p>Set GOP min bitrate in bits/s. Note <code>vpxenc</code>&rsquo;s option is specified as a
  9549. percentage of the target bitrate, the libvpx wrapper converts this value as
  9550. follows: <code>(minrate * 100 / bitrate)</code>.
  9551. </p>
  9552. </dd>
  9553. <dt>&lsquo;<samp>minrate, maxrate, b <em>end-usage=cbr</em></samp>&rsquo;</dt>
  9554. <dd><p><code>(minrate == maxrate == bitrate)</code>.
  9555. </p>
  9556. </dd>
  9557. <dt>&lsquo;<samp>crf (<em>end-usage=cq</em>, <em>cq-level</em>)</samp>&rsquo;</dt>
  9558. <dt>&lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
  9559. <dd><dl compact="compact">
  9560. <dt>&lsquo;<samp>psnr (<em>psnr</em>)</samp>&rsquo;</dt>
  9561. <dt>&lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
  9562. </dl>
  9563. </dd>
  9564. <dt>&lsquo;<samp>quality, deadline (<em>deadline</em>)</samp>&rsquo;</dt>
  9565. <dd><dl compact="compact">
  9566. <dt>&lsquo;<samp>best</samp>&rsquo;</dt>
  9567. <dd><p>Use best quality deadline. Poorly named and quite slow, this option should be
  9568. avoided as it may give worse quality output than good.
  9569. </p></dd>
  9570. <dt>&lsquo;<samp>good</samp>&rsquo;</dt>
  9571. <dd><p>Use good quality deadline. This is a good trade-off between speed and quality
  9572. when used with the &lsquo;<samp>cpu-used</samp>&rsquo; option.
  9573. </p></dd>
  9574. <dt>&lsquo;<samp>realtime</samp>&rsquo;</dt>
  9575. <dd><p>Use realtime quality deadline.
  9576. </p></dd>
  9577. </dl>
  9578. </dd>
  9579. <dt>&lsquo;<samp>speed, cpu-used (<em>cpu-used</em>)</samp>&rsquo;</dt>
  9580. <dd><p>Set quality/speed ratio modifier. Higher values speed up the encode at the cost
  9581. of quality.
  9582. </p>
  9583. </dd>
  9584. <dt>&lsquo;<samp>nr (<em>noise-sensitivity</em>)</samp>&rsquo;</dt>
  9585. <dt>&lsquo;<samp>static-thresh</samp>&rsquo;</dt>
  9586. <dd><p>Set a change threshold on blocks below which they will be skipped by the
  9587. encoder.
  9588. </p>
  9589. </dd>
  9590. <dt>&lsquo;<samp>slices (<em>token-parts</em>)</samp>&rsquo;</dt>
  9591. <dd><p>Note that FFmpeg&rsquo;s &lsquo;<samp>slices</samp>&rsquo; option gives the total number of partitions,
  9592. while <code>vpxenc</code>&rsquo;s &lsquo;<samp>token-parts</samp>&rsquo; is given as
  9593. <code>log2(partitions)</code>.
  9594. </p>
  9595. </dd>
  9596. <dt>&lsquo;<samp>max-intra-rate</samp>&rsquo;</dt>
  9597. <dd><p>Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0
  9598. means unlimited.
  9599. </p>
  9600. </dd>
  9601. <dt>&lsquo;<samp>force_key_frames</samp>&rsquo;</dt>
  9602. <dd><p><code>VPX_EFLAG_FORCE_KF</code>
  9603. </p>
  9604. </dd>
  9605. <dt>&lsquo;<samp>Alternate reference frame related</samp>&rsquo;</dt>
  9606. <dd><dl compact="compact">
  9607. <dt>&lsquo;<samp>auto-alt-ref</samp>&rsquo;</dt>
  9608. <dd><p>Enable use of alternate reference frames (2-pass only).
  9609. Values greater than 1 enable multi-layer alternate reference frames (VP9 only).
  9610. </p></dd>
  9611. <dt>&lsquo;<samp>arnr-maxframes</samp>&rsquo;</dt>
  9612. <dd><p>Set altref noise reduction max frame count.
  9613. </p></dd>
  9614. <dt>&lsquo;<samp>arnr-type</samp>&rsquo;</dt>
  9615. <dd><p>Set altref noise reduction filter type: backward, forward, centered.
  9616. </p></dd>
  9617. <dt>&lsquo;<samp>arnr-strength</samp>&rsquo;</dt>
  9618. <dd><p>Set altref noise reduction filter strength.
  9619. </p></dd>
  9620. <dt>&lsquo;<samp>rc-lookahead, lag-in-frames (<em>lag-in-frames</em>)</samp>&rsquo;</dt>
  9621. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  9622. </p></dd>
  9623. </dl>
  9624. </dd>
  9625. <dt>&lsquo;<samp>error-resilient</samp>&rsquo;</dt>
  9626. <dd><p>Enable error resiliency features.
  9627. </p>
  9628. </dd>
  9629. <dt>&lsquo;<samp>sharpness <var>integer</var></samp>&rsquo;</dt>
  9630. <dd><p>Increase sharpness at the expense of lower PSNR.
  9631. The valid range is [0, 7].
  9632. </p>
  9633. </dd>
  9634. <dt>&lsquo;<samp>ts-parameters</samp>&rsquo;</dt>
  9635. <dd><p>Sets the temporal scalability configuration using a :-separated list of
  9636. key=value pairs. For example, to specify temporal scalability parameters
  9637. with <code>ffmpeg</code>:
  9638. </p><div class="example">
  9639. <pre class="example">ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\
  9640. ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\
  9641. ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT
  9642. </pre></div>
  9643. <p>Below is a brief explanation of each of the parameters, please
  9644. refer to <code>struct vpx_codec_enc_cfg</code> in <code>vpx/vpx_encoder.h</code> for more
  9645. details.
  9646. </p><dl compact="compact">
  9647. <dt>&lsquo;<samp>ts_number_layers</samp>&rsquo;</dt>
  9648. <dd><p>Number of temporal coding layers.
  9649. </p></dd>
  9650. <dt>&lsquo;<samp>ts_target_bitrate</samp>&rsquo;</dt>
  9651. <dd><p>Target bitrate for each temporal layer (in kbps).
  9652. (bitrate should be inclusive of the lower temporal layer).
  9653. </p></dd>
  9654. <dt>&lsquo;<samp>ts_rate_decimator</samp>&rsquo;</dt>
  9655. <dd><p>Frame rate decimation factor for each temporal layer.
  9656. </p></dd>
  9657. <dt>&lsquo;<samp>ts_periodicity</samp>&rsquo;</dt>
  9658. <dd><p>Length of the sequence defining frame temporal layer membership.
  9659. </p></dd>
  9660. <dt>&lsquo;<samp>ts_layer_id</samp>&rsquo;</dt>
  9661. <dd><p>Template defining the membership of frames to temporal layers.
  9662. </p></dd>
  9663. <dt>&lsquo;<samp>ts_layering_mode</samp>&rsquo;</dt>
  9664. <dd><p>(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes.
  9665. Currently supports the following options.
  9666. </p><dl compact="compact">
  9667. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  9668. <dd><p>No temporal layering flags are provided internally,
  9669. relies on flags being passed in using <code>metadata</code> field in <code>AVFrame</code>
  9670. with following keys.
  9671. </p><dl compact="compact">
  9672. <dt>&lsquo;<samp>vp8-flags</samp>&rsquo;</dt>
  9673. <dd><p>Sets the flags passed into the encoder to indicate the referencing scheme for
  9674. the current frame.
  9675. Refer to function <code>vpx_codec_encode</code> in <code>vpx/vpx_encoder.h</code> for more
  9676. details.
  9677. </p></dd>
  9678. <dt>&lsquo;<samp>temporal_id</samp>&rsquo;</dt>
  9679. <dd><p>Explicitly sets the temporal id of the current frame to encode.
  9680. </p></dd>
  9681. </dl>
  9682. </dd>
  9683. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  9684. <dd><p>Two temporal layers. 0-1...
  9685. </p></dd>
  9686. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  9687. <dd><p>Three temporal layers. 0-2-1-2...; with single reference frame.
  9688. </p></dd>
  9689. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  9690. <dd><p>Same as option &quot;3&quot;, except there is a dependency between
  9691. the two temporal layer 2 frames within the temporal period.
  9692. </p></dd>
  9693. </dl>
  9694. </dd>
  9695. </dl>
  9696. </dd>
  9697. <dt>&lsquo;<samp>VP9-specific options</samp>&rsquo;</dt>
  9698. <dd><dl compact="compact">
  9699. <dt>&lsquo;<samp>lossless</samp>&rsquo;</dt>
  9700. <dd><p>Enable lossless mode.
  9701. </p></dd>
  9702. <dt>&lsquo;<samp>tile-columns</samp>&rsquo;</dt>
  9703. <dd><p>Set number of tile columns to use. Note this is given as
  9704. <code>log2(tile_columns)</code>. For example, 8 tile columns would be requested by
  9705. setting the &lsquo;<samp>tile-columns</samp>&rsquo; option to 3.
  9706. </p></dd>
  9707. <dt>&lsquo;<samp>tile-rows</samp>&rsquo;</dt>
  9708. <dd><p>Set number of tile rows to use. Note this is given as <code>log2(tile_rows)</code>.
  9709. For example, 4 tile rows would be requested by setting the &lsquo;<samp>tile-rows</samp>&rsquo;
  9710. option to 2.
  9711. </p></dd>
  9712. <dt>&lsquo;<samp>frame-parallel</samp>&rsquo;</dt>
  9713. <dd><p>Enable frame parallel decodability features.
  9714. </p></dd>
  9715. <dt>&lsquo;<samp>aq-mode</samp>&rsquo;</dt>
  9716. <dd><p>Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
  9717. cyclic refresh, 4: equator360).
  9718. </p></dd>
  9719. <dt>&lsquo;<samp>colorspace <em>color-space</em></samp>&rsquo;</dt>
  9720. <dd><p>Set input color space. The VP9 bitstream supports signaling the following
  9721. colorspaces:
  9722. </p><dl compact="compact">
  9723. <dt>&lsquo;<samp>&lsquo;<samp>rgb</samp>&rsquo; <em>sRGB</em></samp>&rsquo;</dt>
  9724. <dt>&lsquo;<samp>&lsquo;<samp>bt709</samp>&rsquo; <em>bt709</em></samp>&rsquo;</dt>
  9725. <dt>&lsquo;<samp>&lsquo;<samp>unspecified</samp>&rsquo; <em>unknown</em></samp>&rsquo;</dt>
  9726. <dt>&lsquo;<samp>&lsquo;<samp>bt470bg</samp>&rsquo; <em>bt601</em></samp>&rsquo;</dt>
  9727. <dt>&lsquo;<samp>&lsquo;<samp>smpte170m</samp>&rsquo; <em>smpte170</em></samp>&rsquo;</dt>
  9728. <dt>&lsquo;<samp>&lsquo;<samp>smpte240m</samp>&rsquo; <em>smpte240</em></samp>&rsquo;</dt>
  9729. <dt>&lsquo;<samp>&lsquo;<samp>bt2020_ncl</samp>&rsquo; <em>bt2020</em></samp>&rsquo;</dt>
  9730. </dl>
  9731. </dd>
  9732. <dt>&lsquo;<samp>row-mt <var>boolean</var></samp>&rsquo;</dt>
  9733. <dd><p>Enable row based multi-threading.
  9734. </p></dd>
  9735. <dt>&lsquo;<samp>tune-content</samp>&rsquo;</dt>
  9736. <dd><p>Set content type: default (0), screen (1), film (2).
  9737. </p></dd>
  9738. <dt>&lsquo;<samp>corpus-complexity</samp>&rsquo;</dt>
  9739. <dd><p>Corpus VBR mode is a variant of standard VBR where the complexity distribution
  9740. midpoint is passed in rather than calculated for a specific clip or chunk.
  9741. </p>
  9742. <p>The valid range is [0, 10000]. 0 (default) uses standard VBR.
  9743. </p></dd>
  9744. <dt>&lsquo;<samp>enable-tpl <var>boolean</var></samp>&rsquo;</dt>
  9745. <dd><p>Enable temporal dependency model.
  9746. </p></dd>
  9747. </dl>
  9748. </dd>
  9749. </dl>
  9750. <p>For more information about libvpx see:
  9751. <a href="http://www.webmproject.org/">http://www.webmproject.org/</a>
  9752. </p>
  9753. <a name="libwebp"></a>
  9754. <h2 class="section"><a href="ffmpeg-all.html#toc-libwebp">16.9 libwebp</a></h2>
  9755. <p>libwebp WebP Image encoder wrapper
  9756. </p>
  9757. <p>libwebp is Google&rsquo;s official encoder for WebP images. It can encode in either
  9758. lossy or lossless mode. Lossy images are essentially a wrapper around a VP8
  9759. frame. Lossless images are a separate codec developed by Google.
  9760. </p>
  9761. <a name="Pixel-Format"></a>
  9762. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Pixel-Format">16.9.1 Pixel Format</a></h3>
  9763. <p>Currently, libwebp only supports YUV420 for lossy and RGB for lossless due
  9764. to limitations of the format and libwebp. Alpha is supported for either mode.
  9765. Because of API limitations, if RGB is passed in when encoding lossy or YUV is
  9766. passed in for encoding lossless, the pixel format will automatically be
  9767. converted using functions from libwebp. This is not ideal and is done only for
  9768. convenience.
  9769. </p>
  9770. <a name="Options-18"></a>
  9771. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-18">16.9.2 Options</a></h3>
  9772. <dl compact="compact">
  9773. <dt>&lsquo;<samp>-lossless <var>boolean</var></samp>&rsquo;</dt>
  9774. <dd><p>Enables/Disables use of lossless mode. Default is 0.
  9775. </p>
  9776. </dd>
  9777. <dt>&lsquo;<samp>-compression_level <var>integer</var></samp>&rsquo;</dt>
  9778. <dd><p>For lossy, this is a quality/speed tradeoff. Higher values give better quality
  9779. for a given size at the cost of increased encoding time. For lossless, this is
  9780. a size/speed tradeoff. Higher values give smaller size at the cost of increased
  9781. encoding time. More specifically, it controls the number of extra algorithms
  9782. and compression tools used, and varies the combination of these tools. This
  9783. maps to the <var>method</var> option in libwebp. The valid range is 0 to 6.
  9784. Default is 4.
  9785. </p>
  9786. </dd>
  9787. <dt>&lsquo;<samp>-qscale <var>float</var></samp>&rsquo;</dt>
  9788. <dd><p>For lossy encoding, this controls image quality, 0 to 100. For lossless
  9789. encoding, this controls the effort and time spent at compressing more. The
  9790. default value is 75. Note that for usage via libavcodec, this option is called
  9791. <var>global_quality</var> and must be multiplied by <var>FF_QP2LAMBDA</var>.
  9792. </p>
  9793. </dd>
  9794. <dt>&lsquo;<samp>-preset <var>type</var></samp>&rsquo;</dt>
  9795. <dd><p>Configuration preset. This does some automatic settings based on the general
  9796. type of the image.
  9797. </p><dl compact="compact">
  9798. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  9799. <dd><p>Do not use a preset.
  9800. </p></dd>
  9801. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  9802. <dd><p>Use the encoder default.
  9803. </p></dd>
  9804. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  9805. <dd><p>Digital picture, like portrait, inner shot
  9806. </p></dd>
  9807. <dt>&lsquo;<samp>photo</samp>&rsquo;</dt>
  9808. <dd><p>Outdoor photograph, with natural lighting
  9809. </p></dd>
  9810. <dt>&lsquo;<samp>drawing</samp>&rsquo;</dt>
  9811. <dd><p>Hand or line drawing, with high-contrast details
  9812. </p></dd>
  9813. <dt>&lsquo;<samp>icon</samp>&rsquo;</dt>
  9814. <dd><p>Small-sized colorful images
  9815. </p></dd>
  9816. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  9817. <dd><p>Text-like
  9818. </p></dd>
  9819. </dl>
  9820. </dd>
  9821. </dl>
  9822. <a name="libx264_002c-libx264rgb"></a>
  9823. <h2 class="section"><a href="ffmpeg-all.html#toc-libx264_002c-libx264rgb">16.10 libx264, libx264rgb</a></h2>
  9824. <p>x264 H.264/MPEG-4 AVC encoder wrapper.
  9825. </p>
  9826. <p>This encoder requires the presence of the libx264 headers and library
  9827. during configuration. You need to explicitly configure the build with
  9828. <code>--enable-libx264</code>.
  9829. </p>
  9830. <p>libx264 supports an impressive number of features, including 8x8 and
  9831. 4x4 adaptive spatial transform, adaptive B-frame placement, CAVLC/CABAC
  9832. entropy coding, interlacing (MBAFF), lossless mode, psy optimizations
  9833. for detail retention (adaptive quantization, psy-RD, psy-trellis).
  9834. </p>
  9835. <p>Many libx264 encoder options are mapped to FFmpeg global codec
  9836. options, while unique encoder options are provided through private
  9837. options. Additionally the &lsquo;<samp>x264opts</samp>&rsquo; and &lsquo;<samp>x264-params</samp>&rsquo;
  9838. private options allows one to pass a list of key=value tuples as accepted
  9839. by the libx264 <code>x264_param_parse</code> function.
  9840. </p>
  9841. <p>The x264 project website is at
  9842. <a href="http://www.videolan.org/developers/x264.html">http://www.videolan.org/developers/x264.html</a>.
  9843. </p>
  9844. <p>The libx264rgb encoder is the same as libx264, except it accepts packed RGB
  9845. pixel formats as input instead of YUV.
  9846. </p>
  9847. <a name="Supported-Pixel-Formats"></a>
  9848. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Supported-Pixel-Formats">16.10.1 Supported Pixel Formats</a></h3>
  9849. <p>x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at
  9850. x264&rsquo;s configure time. FFmpeg only supports one bit depth in one particular
  9851. build. In other words, it is not possible to build one FFmpeg with multiple
  9852. versions of x264 with different bit depths.
  9853. </p>
  9854. <a name="Options-47"></a>
  9855. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-47">16.10.2 Options</a></h3>
  9856. <p>The following options are supported by the libx264 wrapper. The
  9857. <code>x264</code>-equivalent options or values are listed in parentheses
  9858. for easy migration.
  9859. </p>
  9860. <p>To reduce the duplication of documentation, only the private options
  9861. and some others requiring special attention are documented here. For
  9862. the documentation of the undocumented generic options, see
  9863. <a href="#codec_002doptions">the Codec Options chapter</a>.
  9864. </p>
  9865. <p>To get a more accurate and extensive documentation of the libx264
  9866. options, invoke the command <code>x264 --fullhelp</code> or consult
  9867. the libx264 documentation.
  9868. </p>
  9869. <dl compact="compact">
  9870. <dt>&lsquo;<samp>b (<em>bitrate</em>)</samp>&rsquo;</dt>
  9871. <dd><p>Set bitrate in bits/s. Note that FFmpeg&rsquo;s &lsquo;<samp>b</samp>&rsquo; option is
  9872. expressed in bits/s, while <code>x264</code>&rsquo;s &lsquo;<samp>bitrate</samp>&rsquo; is in
  9873. kilobits/s.
  9874. </p>
  9875. </dd>
  9876. <dt>&lsquo;<samp>bf (<em>bframes</em>)</samp>&rsquo;</dt>
  9877. <dt>&lsquo;<samp>g (<em>keyint</em>)</samp>&rsquo;</dt>
  9878. <dt>&lsquo;<samp>qmin (<em>qpmin</em>)</samp>&rsquo;</dt>
  9879. <dd><p>Minimum quantizer scale.
  9880. </p>
  9881. </dd>
  9882. <dt>&lsquo;<samp>qmax (<em>qpmax</em>)</samp>&rsquo;</dt>
  9883. <dd><p>Maximum quantizer scale.
  9884. </p>
  9885. </dd>
  9886. <dt>&lsquo;<samp>qdiff (<em>qpstep</em>)</samp>&rsquo;</dt>
  9887. <dd><p>Maximum difference between quantizer scales.
  9888. </p>
  9889. </dd>
  9890. <dt>&lsquo;<samp>qblur (<em>qblur</em>)</samp>&rsquo;</dt>
  9891. <dd><p>Quantizer curve blur
  9892. </p>
  9893. </dd>
  9894. <dt>&lsquo;<samp>qcomp (<em>qcomp</em>)</samp>&rsquo;</dt>
  9895. <dd><p>Quantizer curve compression factor
  9896. </p>
  9897. </dd>
  9898. <dt>&lsquo;<samp>refs (<em>ref</em>)</samp>&rsquo;</dt>
  9899. <dd><p>Number of reference frames each P-frame can use. The range is from <var>0-16</var>.
  9900. </p>
  9901. </dd>
  9902. <dt>&lsquo;<samp>sc_threshold (<em>scenecut</em>)</samp>&rsquo;</dt>
  9903. <dd><p>Sets the threshold for the scene change detection.
  9904. </p>
  9905. </dd>
  9906. <dt>&lsquo;<samp>trellis (<em>trellis</em>)</samp>&rsquo;</dt>
  9907. <dd><p>Performs Trellis quantization to increase efficiency. Enabled by default.
  9908. </p>
  9909. </dd>
  9910. <dt>&lsquo;<samp>nr (<em>nr</em>)</samp>&rsquo;</dt>
  9911. <dt>&lsquo;<samp>me_range (<em>merange</em>)</samp>&rsquo;</dt>
  9912. <dd><p>Maximum range of the motion search in pixels.
  9913. </p>
  9914. </dd>
  9915. <dt>&lsquo;<samp>me_method (<em>me</em>)</samp>&rsquo;</dt>
  9916. <dd><p>Set motion estimation method. Possible values in the decreasing order
  9917. of speed:
  9918. </p>
  9919. <dl compact="compact">
  9920. <dt>&lsquo;<samp>dia (<em>dia</em>)</samp>&rsquo;</dt>
  9921. <dt>&lsquo;<samp>epzs (<em>dia</em>)</samp>&rsquo;</dt>
  9922. <dd><p>Diamond search with radius 1 (fastest). &lsquo;<samp>epzs</samp>&rsquo; is an alias for
  9923. &lsquo;<samp>dia</samp>&rsquo;.
  9924. </p></dd>
  9925. <dt>&lsquo;<samp>hex (<em>hex</em>)</samp>&rsquo;</dt>
  9926. <dd><p>Hexagonal search with radius 2.
  9927. </p></dd>
  9928. <dt>&lsquo;<samp>umh (<em>umh</em>)</samp>&rsquo;</dt>
  9929. <dd><p>Uneven multi-hexagon search.
  9930. </p></dd>
  9931. <dt>&lsquo;<samp>esa (<em>esa</em>)</samp>&rsquo;</dt>
  9932. <dd><p>Exhaustive search.
  9933. </p></dd>
  9934. <dt>&lsquo;<samp>tesa (<em>tesa</em>)</samp>&rsquo;</dt>
  9935. <dd><p>Hadamard exhaustive search (slowest).
  9936. </p></dd>
  9937. </dl>
  9938. </dd>
  9939. <dt>&lsquo;<samp>forced-idr</samp>&rsquo;</dt>
  9940. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  9941. of I-frame. This option forces it to choose an IDR-frame.
  9942. </p>
  9943. </dd>
  9944. <dt>&lsquo;<samp>subq (<em>subme</em>)</samp>&rsquo;</dt>
  9945. <dd><p>Sub-pixel motion estimation method.
  9946. </p>
  9947. </dd>
  9948. <dt>&lsquo;<samp>b_strategy (<em>b-adapt</em>)</samp>&rsquo;</dt>
  9949. <dd><p>Adaptive B-frame placement decision algorithm. Use only on first-pass.
  9950. </p>
  9951. </dd>
  9952. <dt>&lsquo;<samp>keyint_min (<em>min-keyint</em>)</samp>&rsquo;</dt>
  9953. <dd><p>Minimum GOP size.
  9954. </p>
  9955. </dd>
  9956. <dt>&lsquo;<samp>coder</samp>&rsquo;</dt>
  9957. <dd><p>Set entropy encoder. Possible values:
  9958. </p>
  9959. <dl compact="compact">
  9960. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  9961. <dd><p>Enable CABAC.
  9962. </p>
  9963. </dd>
  9964. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  9965. <dd><p>Enable CAVLC and disable CABAC. It generates the same effect as
  9966. <code>x264</code>&rsquo;s &lsquo;<samp>--no-cabac</samp>&rsquo; option.
  9967. </p></dd>
  9968. </dl>
  9969. </dd>
  9970. <dt>&lsquo;<samp>cmp</samp>&rsquo;</dt>
  9971. <dd><p>Set full pixel motion estimation comparison algorithm. Possible values:
  9972. </p>
  9973. <dl compact="compact">
  9974. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  9975. <dd><p>Enable chroma in motion estimation.
  9976. </p>
  9977. </dd>
  9978. <dt>&lsquo;<samp>sad</samp>&rsquo;</dt>
  9979. <dd><p>Ignore chroma in motion estimation. It generates the same effect as
  9980. <code>x264</code>&rsquo;s &lsquo;<samp>--no-chroma-me</samp>&rsquo; option.
  9981. </p></dd>
  9982. </dl>
  9983. </dd>
  9984. <dt>&lsquo;<samp>threads (<em>threads</em>)</samp>&rsquo;</dt>
  9985. <dd><p>Number of encoding threads.
  9986. </p>
  9987. </dd>
  9988. <dt>&lsquo;<samp>thread_type</samp>&rsquo;</dt>
  9989. <dd><p>Set multithreading technique. Possible values:
  9990. </p>
  9991. <dl compact="compact">
  9992. <dt>&lsquo;<samp>slice</samp>&rsquo;</dt>
  9993. <dd><p>Slice-based multithreading. It generates the same effect as
  9994. <code>x264</code>&rsquo;s &lsquo;<samp>--sliced-threads</samp>&rsquo; option.
  9995. </p></dd>
  9996. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  9997. <dd><p>Frame-based multithreading.
  9998. </p></dd>
  9999. </dl>
  10000. </dd>
  10001. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  10002. <dd><p>Set encoding flags. It can be used to disable closed GOP and enable
  10003. open GOP by setting it to <code>-cgop</code>. The result is similar to
  10004. the behavior of <code>x264</code>&rsquo;s &lsquo;<samp>--open-gop</samp>&rsquo; option.
  10005. </p>
  10006. </dd>
  10007. <dt>&lsquo;<samp>rc_init_occupancy (<em>vbv-init</em>)</samp>&rsquo;</dt>
  10008. <dt>&lsquo;<samp>preset (<em>preset</em>)</samp>&rsquo;</dt>
  10009. <dd><p>Set the encoding preset.
  10010. </p>
  10011. </dd>
  10012. <dt>&lsquo;<samp>tune (<em>tune</em>)</samp>&rsquo;</dt>
  10013. <dd><p>Set tuning of the encoding params.
  10014. </p>
  10015. </dd>
  10016. <dt>&lsquo;<samp>profile (<em>profile</em>)</samp>&rsquo;</dt>
  10017. <dd><p>Set profile restrictions.
  10018. </p>
  10019. </dd>
  10020. <dt>&lsquo;<samp>fastfirstpass</samp>&rsquo;</dt>
  10021. <dd><p>Enable fast settings when encoding first pass, when set to 1. When set
  10022. to 0, it has the same effect of <code>x264</code>&rsquo;s
  10023. &lsquo;<samp>--slow-firstpass</samp>&rsquo; option.
  10024. </p>
  10025. </dd>
  10026. <dt>&lsquo;<samp>crf (<em>crf</em>)</samp>&rsquo;</dt>
  10027. <dd><p>Set the quality for constant quality mode.
  10028. </p>
  10029. </dd>
  10030. <dt>&lsquo;<samp>crf_max (<em>crf-max</em>)</samp>&rsquo;</dt>
  10031. <dd><p>In CRF mode, prevents VBV from lowering quality beyond this point.
  10032. </p>
  10033. </dd>
  10034. <dt>&lsquo;<samp>qp (<em>qp</em>)</samp>&rsquo;</dt>
  10035. <dd><p>Set constant quantization rate control method parameter.
  10036. </p>
  10037. </dd>
  10038. <dt>&lsquo;<samp>aq-mode (<em>aq-mode</em>)</samp>&rsquo;</dt>
  10039. <dd><p>Set AQ method. Possible values:
  10040. </p>
  10041. <dl compact="compact">
  10042. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10043. <dd><p>Disabled.
  10044. </p>
  10045. </dd>
  10046. <dt>&lsquo;<samp>variance (<em>1</em>)</samp>&rsquo;</dt>
  10047. <dd><p>Variance AQ (complexity mask).
  10048. </p>
  10049. </dd>
  10050. <dt>&lsquo;<samp>autovariance (<em>2</em>)</samp>&rsquo;</dt>
  10051. <dd><p>Auto-variance AQ (experimental).
  10052. </p></dd>
  10053. </dl>
  10054. </dd>
  10055. <dt>&lsquo;<samp>aq-strength (<em>aq-strength</em>)</samp>&rsquo;</dt>
  10056. <dd><p>Set AQ strength, reduce blocking and blurring in flat and textured areas.
  10057. </p>
  10058. </dd>
  10059. <dt>&lsquo;<samp>psy</samp>&rsquo;</dt>
  10060. <dd><p>Use psychovisual optimizations when set to 1. When set to 0, it has the
  10061. same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-psy</samp>&rsquo; option.
  10062. </p>
  10063. </dd>
  10064. <dt>&lsquo;<samp>psy-rd (<em>psy-rd</em>)</samp>&rsquo;</dt>
  10065. <dd><p>Set strength of psychovisual optimization, in
  10066. <var>psy-rd</var>:<var>psy-trellis</var> format.
  10067. </p>
  10068. </dd>
  10069. <dt>&lsquo;<samp>rc-lookahead (<em>rc-lookahead</em>)</samp>&rsquo;</dt>
  10070. <dd><p>Set number of frames to look ahead for frametype and ratecontrol.
  10071. </p>
  10072. </dd>
  10073. <dt>&lsquo;<samp>weightb</samp>&rsquo;</dt>
  10074. <dd><p>Enable weighted prediction for B-frames when set to 1. When set to 0,
  10075. it has the same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-weightb</samp>&rsquo; option.
  10076. </p>
  10077. </dd>
  10078. <dt>&lsquo;<samp>weightp (<em>weightp</em>)</samp>&rsquo;</dt>
  10079. <dd><p>Set weighted prediction method for P-frames. Possible values:
  10080. </p>
  10081. <dl compact="compact">
  10082. <dt>&lsquo;<samp>none (<em>0</em>)</samp>&rsquo;</dt>
  10083. <dd><p>Disabled
  10084. </p></dd>
  10085. <dt>&lsquo;<samp>simple (<em>1</em>)</samp>&rsquo;</dt>
  10086. <dd><p>Enable only weighted refs
  10087. </p></dd>
  10088. <dt>&lsquo;<samp>smart (<em>2</em>)</samp>&rsquo;</dt>
  10089. <dd><p>Enable both weighted refs and duplicates
  10090. </p></dd>
  10091. </dl>
  10092. </dd>
  10093. <dt>&lsquo;<samp>ssim (<em>ssim</em>)</samp>&rsquo;</dt>
  10094. <dd><p>Enable calculation and printing SSIM stats after the encoding.
  10095. </p>
  10096. </dd>
  10097. <dt>&lsquo;<samp>intra-refresh (<em>intra-refresh</em>)</samp>&rsquo;</dt>
  10098. <dd><p>Enable the use of Periodic Intra Refresh instead of IDR frames when set
  10099. to 1.
  10100. </p>
  10101. </dd>
  10102. <dt>&lsquo;<samp>avcintra-class (<em>class</em>)</samp>&rsquo;</dt>
  10103. <dd><p>Configure the encoder to generate AVC-Intra.
  10104. Valid values are 50,100 and 200
  10105. </p>
  10106. </dd>
  10107. <dt>&lsquo;<samp>bluray-compat (<em>bluray-compat</em>)</samp>&rsquo;</dt>
  10108. <dd><p>Configure the encoder to be compatible with the bluray standard.
  10109. It is a shorthand for setting &quot;bluray-compat=1 force-cfr=1&quot;.
  10110. </p>
  10111. </dd>
  10112. <dt>&lsquo;<samp>b-bias (<em>b-bias</em>)</samp>&rsquo;</dt>
  10113. <dd><p>Set the influence on how often B-frames are used.
  10114. </p>
  10115. </dd>
  10116. <dt>&lsquo;<samp>b-pyramid (<em>b-pyramid</em>)</samp>&rsquo;</dt>
  10117. <dd><p>Set method for keeping of some B-frames as references. Possible values:
  10118. </p>
  10119. <dl compact="compact">
  10120. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10121. <dd><p>Disabled.
  10122. </p></dd>
  10123. <dt>&lsquo;<samp>strict (<em>strict</em>)</samp>&rsquo;</dt>
  10124. <dd><p>Strictly hierarchical pyramid.
  10125. </p></dd>
  10126. <dt>&lsquo;<samp>normal (<em>normal</em>)</samp>&rsquo;</dt>
  10127. <dd><p>Non-strict (not Blu-ray compatible).
  10128. </p></dd>
  10129. </dl>
  10130. </dd>
  10131. <dt>&lsquo;<samp>mixed-refs</samp>&rsquo;</dt>
  10132. <dd><p>Enable the use of one reference per partition, as opposed to one
  10133. reference per macroblock when set to 1. When set to 0, it has the
  10134. same effect as <code>x264</code>&rsquo;s &lsquo;<samp>--no-mixed-refs</samp>&rsquo; option.
  10135. </p>
  10136. </dd>
  10137. <dt>&lsquo;<samp>8x8dct</samp>&rsquo;</dt>
  10138. <dd><p>Enable adaptive spatial transform (high profile 8x8 transform)
  10139. when set to 1. When set to 0, it has the same effect as
  10140. <code>x264</code>&rsquo;s &lsquo;<samp>--no-8x8dct</samp>&rsquo; option.
  10141. </p>
  10142. </dd>
  10143. <dt>&lsquo;<samp>fast-pskip</samp>&rsquo;</dt>
  10144. <dd><p>Enable early SKIP detection on P-frames when set to 1. When set
  10145. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10146. &lsquo;<samp>--no-fast-pskip</samp>&rsquo; option.
  10147. </p>
  10148. </dd>
  10149. <dt>&lsquo;<samp>aud (<em>aud</em>)</samp>&rsquo;</dt>
  10150. <dd><p>Enable use of access unit delimiters when set to 1.
  10151. </p>
  10152. </dd>
  10153. <dt>&lsquo;<samp>mbtree</samp>&rsquo;</dt>
  10154. <dd><p>Enable use macroblock tree ratecontrol when set to 1. When set
  10155. to 0, it has the same effect as <code>x264</code>&rsquo;s
  10156. &lsquo;<samp>--no-mbtree</samp>&rsquo; option.
  10157. </p>
  10158. </dd>
  10159. <dt>&lsquo;<samp>deblock (<em>deblock</em>)</samp>&rsquo;</dt>
  10160. <dd><p>Set loop filter parameters, in <var>alpha</var>:<var>beta</var> form.
  10161. </p>
  10162. </dd>
  10163. <dt>&lsquo;<samp>cplxblur (<em>cplxblur</em>)</samp>&rsquo;</dt>
  10164. <dd><p>Set fluctuations reduction in QP (before curve compression).
  10165. </p>
  10166. </dd>
  10167. <dt>&lsquo;<samp>partitions (<em>partitions</em>)</samp>&rsquo;</dt>
  10168. <dd><p>Set partitions to consider as a comma-separated list of. Possible
  10169. values in the list:
  10170. </p>
  10171. <dl compact="compact">
  10172. <dt>&lsquo;<samp>p8x8</samp>&rsquo;</dt>
  10173. <dd><p>8x8 P-frame partition.
  10174. </p></dd>
  10175. <dt>&lsquo;<samp>p4x4</samp>&rsquo;</dt>
  10176. <dd><p>4x4 P-frame partition.
  10177. </p></dd>
  10178. <dt>&lsquo;<samp>b8x8</samp>&rsquo;</dt>
  10179. <dd><p>4x4 B-frame partition.
  10180. </p></dd>
  10181. <dt>&lsquo;<samp>i8x8</samp>&rsquo;</dt>
  10182. <dd><p>8x8 I-frame partition.
  10183. </p></dd>
  10184. <dt>&lsquo;<samp>i4x4</samp>&rsquo;</dt>
  10185. <dd><p>4x4 I-frame partition.
  10186. (Enabling &lsquo;<samp>p4x4</samp>&rsquo; requires &lsquo;<samp>p8x8</samp>&rsquo; to be enabled. Enabling
  10187. &lsquo;<samp>i8x8</samp>&rsquo; requires adaptive spatial transform (&lsquo;<samp>8x8dct</samp>&rsquo;
  10188. option) to be enabled.)
  10189. </p></dd>
  10190. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10191. <dd><p>Do not consider any partitions.
  10192. </p></dd>
  10193. <dt>&lsquo;<samp>all (<em>all</em>)</samp>&rsquo;</dt>
  10194. <dd><p>Consider every partition.
  10195. </p></dd>
  10196. </dl>
  10197. </dd>
  10198. <dt>&lsquo;<samp>direct-pred (<em>direct</em>)</samp>&rsquo;</dt>
  10199. <dd><p>Set direct MV prediction mode. Possible values:
  10200. </p>
  10201. <dl compact="compact">
  10202. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10203. <dd><p>Disable MV prediction.
  10204. </p></dd>
  10205. <dt>&lsquo;<samp>spatial (<em>spatial</em>)</samp>&rsquo;</dt>
  10206. <dd><p>Enable spatial predicting.
  10207. </p></dd>
  10208. <dt>&lsquo;<samp>temporal (<em>temporal</em>)</samp>&rsquo;</dt>
  10209. <dd><p>Enable temporal predicting.
  10210. </p></dd>
  10211. <dt>&lsquo;<samp>auto (<em>auto</em>)</samp>&rsquo;</dt>
  10212. <dd><p>Automatically decided.
  10213. </p></dd>
  10214. </dl>
  10215. </dd>
  10216. <dt>&lsquo;<samp>slice-max-size (<em>slice-max-size</em>)</samp>&rsquo;</dt>
  10217. <dd><p>Set the limit of the size of each slice in bytes. If not specified
  10218. but RTP payload size (&lsquo;<samp>ps</samp>&rsquo;) is specified, that is used.
  10219. </p>
  10220. </dd>
  10221. <dt>&lsquo;<samp>stats (<em>stats</em>)</samp>&rsquo;</dt>
  10222. <dd><p>Set the file name for multi-pass stats.
  10223. </p>
  10224. </dd>
  10225. <dt>&lsquo;<samp>nal-hrd (<em>nal-hrd</em>)</samp>&rsquo;</dt>
  10226. <dd><p>Set signal HRD information (requires &lsquo;<samp>vbv-bufsize</samp>&rsquo; to be set).
  10227. Possible values:
  10228. </p>
  10229. <dl compact="compact">
  10230. <dt>&lsquo;<samp>none (<em>none</em>)</samp>&rsquo;</dt>
  10231. <dd><p>Disable HRD information signaling.
  10232. </p></dd>
  10233. <dt>&lsquo;<samp>vbr (<em>vbr</em>)</samp>&rsquo;</dt>
  10234. <dd><p>Variable bit rate.
  10235. </p></dd>
  10236. <dt>&lsquo;<samp>cbr (<em>cbr</em>)</samp>&rsquo;</dt>
  10237. <dd><p>Constant bit rate (not allowed in MP4 container).
  10238. </p></dd>
  10239. </dl>
  10240. </dd>
  10241. <dt>&lsquo;<samp>x264opts (N.A.)</samp>&rsquo;</dt>
  10242. <dd><p>Set any x264 option, see <code>x264 --fullhelp</code> for a list.
  10243. </p>
  10244. <p>Argument is a list of <var>key</var>=<var>value</var> couples separated by
  10245. &quot;:&quot;. In <var>filter</var> and <var>psy-rd</var> options that use &quot;:&quot; as a separator
  10246. themselves, use &quot;,&quot; instead. They accept it as well since long ago but this
  10247. is kept undocumented for some reason.
  10248. </p>
  10249. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10250. </p><div class="example">
  10251. <pre class="example">ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
  10252. </pre></div>
  10253. </dd>
  10254. <dt>&lsquo;<samp>a53cc <var>boolean</var></samp>&rsquo;</dt>
  10255. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  10256. Only the mpeg2 and h264 decoders provide these. Default is 1 (on).
  10257. </p>
  10258. </dd>
  10259. <dt>&lsquo;<samp>x264-params (N.A.)</samp>&rsquo;</dt>
  10260. <dd><p>Override the x264 configuration using a :-separated list of key=value
  10261. parameters.
  10262. </p>
  10263. <p>This option is functionally the same as the &lsquo;<samp>x264opts</samp>&rsquo;, but is
  10264. duplicated for compatibility with the Libav fork.
  10265. </p>
  10266. <p>For example to specify libx264 encoding options with <code>ffmpeg</code>:
  10267. </p><div class="example">
  10268. <pre class="example">ffmpeg -i INPUT -c:v libx264 -x264-params level=30:bframes=0:weightp=0:\
  10269. cabac=0:ref=1:vbv-maxrate=768:vbv-bufsize=2000:analyse=all:me=umh:\
  10270. no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT
  10271. </pre></div>
  10272. </dd>
  10273. </dl>
  10274. <p>Encoding ffpresets for common usages are provided so they can be used with the
  10275. general presets system (e.g. passing the &lsquo;<samp>pre</samp>&rsquo; option).
  10276. </p>
  10277. <a name="libx265"></a>
  10278. <h2 class="section"><a href="ffmpeg-all.html#toc-libx265">16.11 libx265</a></h2>
  10279. <p>x265 H.265/HEVC encoder wrapper.
  10280. </p>
  10281. <p>This encoder requires the presence of the libx265 headers and library
  10282. during configuration. You need to explicitly configure the build with
  10283. &lsquo;<samp>--enable-libx265</samp>&rsquo;.
  10284. </p>
  10285. <a name="Options-79"></a>
  10286. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-79">16.11.1 Options</a></h3>
  10287. <dl compact="compact">
  10288. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  10289. <dd><p>Sets target video bitrate.
  10290. </p>
  10291. </dd>
  10292. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  10293. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  10294. <dd><p>Set the GOP size.
  10295. </p>
  10296. </dd>
  10297. <dt>&lsquo;<samp>keyint_min</samp>&rsquo;</dt>
  10298. <dd><p>Minimum GOP size.
  10299. </p>
  10300. </dd>
  10301. <dt>&lsquo;<samp>refs</samp>&rsquo;</dt>
  10302. <dd><p>Number of reference frames each P-frame can use. The range is from <var>1-16</var>.
  10303. </p>
  10304. </dd>
  10305. <dt>&lsquo;<samp>preset</samp>&rsquo;</dt>
  10306. <dd><p>Set the x265 preset.
  10307. </p>
  10308. </dd>
  10309. <dt>&lsquo;<samp>tune</samp>&rsquo;</dt>
  10310. <dd><p>Set the x265 tune parameter.
  10311. </p>
  10312. </dd>
  10313. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  10314. <dd><p>Set profile restrictions.
  10315. </p>
  10316. </dd>
  10317. <dt>&lsquo;<samp>crf</samp>&rsquo;</dt>
  10318. <dd><p>Set the quality for constant quality mode.
  10319. </p>
  10320. </dd>
  10321. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  10322. <dd><p>Set constant quantization rate control method parameter.
  10323. </p>
  10324. </dd>
  10325. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  10326. <dd><p>Minimum quantizer scale.
  10327. </p>
  10328. </dd>
  10329. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  10330. <dd><p>Maximum quantizer scale.
  10331. </p>
  10332. </dd>
  10333. <dt>&lsquo;<samp>qdiff</samp>&rsquo;</dt>
  10334. <dd><p>Maximum difference between quantizer scales.
  10335. </p>
  10336. </dd>
  10337. <dt>&lsquo;<samp>qblur</samp>&rsquo;</dt>
  10338. <dd><p>Quantizer curve blur
  10339. </p>
  10340. </dd>
  10341. <dt>&lsquo;<samp>qcomp</samp>&rsquo;</dt>
  10342. <dd><p>Quantizer curve compression factor
  10343. </p>
  10344. </dd>
  10345. <dt>&lsquo;<samp>i_qfactor</samp>&rsquo;</dt>
  10346. <dt>&lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
  10347. <dt>&lsquo;<samp>forced-idr</samp>&rsquo;</dt>
  10348. <dd><p>Normally, when forcing a I-frame type, the encoder can select any type
  10349. of I-frame. This option forces it to choose an IDR-frame.
  10350. </p>
  10351. </dd>
  10352. <dt>&lsquo;<samp>x265-params</samp>&rsquo;</dt>
  10353. <dd><p>Set x265 options using a list of <var>key</var>=<var>value</var> couples separated
  10354. by &quot;:&quot;. See <code>x265 --help</code> for a list of options.
  10355. </p>
  10356. <p>For example to specify libx265 encoding options with &lsquo;<samp>-x265-params</samp>&rsquo;:
  10357. </p>
  10358. <div class="example">
  10359. <pre class="example">ffmpeg -i input -c:v libx265 -x265-params crf=26:psy-rd=1 output.mp4
  10360. </pre></div>
  10361. </dd>
  10362. </dl>
  10363. <a name="libxavs2"></a>
  10364. <h2 class="section"><a href="ffmpeg-all.html#toc-libxavs2">16.12 libxavs2</a></h2>
  10365. <p>xavs2 AVS2-P2/IEEE1857.4 encoder wrapper.
  10366. </p>
  10367. <p>This encoder requires the presence of the libxavs2 headers and library
  10368. during configuration. You need to explicitly configure the build with
  10369. &lsquo;<samp>--enable-libxavs2</samp>&rsquo;.
  10370. </p>
  10371. <p>The following standard libavcodec options are used:
  10372. </p><ul>
  10373. <li>
  10374. &lsquo;<samp>b</samp>&rsquo; / &lsquo;<samp>bit_rate</samp>&rsquo;
  10375. </li><li>
  10376. &lsquo;<samp>g</samp>&rsquo; / &lsquo;<samp>gop_size</samp>&rsquo;
  10377. </li><li>
  10378. &lsquo;<samp>bf</samp>&rsquo; / &lsquo;<samp>max_b_frames</samp>&rsquo;
  10379. </li></ul>
  10380. <p>The encoder also has its own specific options:
  10381. </p><a name="Options-65"></a>
  10382. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-65">16.12.1 Options</a></h3>
  10383. <dl compact="compact">
  10384. <dt>&lsquo;<samp>lcu_row_threads</samp>&rsquo;</dt>
  10385. <dd><p>Set the number of parallel threads for rows from 1 to 8 (default 5).
  10386. </p>
  10387. </dd>
  10388. <dt>&lsquo;<samp>initial_qp</samp>&rsquo;</dt>
  10389. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10390. used to set the initial qp for the first frame.
  10391. </p>
  10392. </dd>
  10393. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  10394. <dd><p>Set the xavs2 quantization parameter from 1 to 63 (default 34). This is
  10395. used to set the qp value under constant-QP mode.
  10396. </p>
  10397. </dd>
  10398. <dt>&lsquo;<samp>max_qp</samp>&rsquo;</dt>
  10399. <dd><p>Set the max qp for rate control from 1 to 63 (default 55).
  10400. </p>
  10401. </dd>
  10402. <dt>&lsquo;<samp>min_qp</samp>&rsquo;</dt>
  10403. <dd><p>Set the min qp for rate control from 1 to 63 (default 20).
  10404. </p>
  10405. </dd>
  10406. <dt>&lsquo;<samp>speed_level</samp>&rsquo;</dt>
  10407. <dd><p>Set the Speed level from 0 to 9 (default 0). Higher is better but slower.
  10408. </p>
  10409. </dd>
  10410. <dt>&lsquo;<samp>log_level</samp>&rsquo;</dt>
  10411. <dd><p>Set the log level from -1 to 3 (default 0). -1: none, 0: error,
  10412. 1: warning, 2: info, 3: debug.
  10413. </p>
  10414. </dd>
  10415. <dt>&lsquo;<samp>xavs2-params</samp>&rsquo;</dt>
  10416. <dd><p>Set xavs2 options using a list of <var>key</var>=<var>value</var> couples separated
  10417. by &quot;:&quot;.
  10418. </p>
  10419. <p>For example to specify libxavs2 encoding options with &lsquo;<samp>-xavs2-params</samp>&rsquo;:
  10420. </p>
  10421. <div class="example">
  10422. <pre class="example">ffmpeg -i input -c:v libxavs2 -xavs2-params RdoqLevel=0 output.avs2
  10423. </pre></div>
  10424. </dd>
  10425. </dl>
  10426. <a name="libxvid"></a>
  10427. <h2 class="section"><a href="ffmpeg-all.html#toc-libxvid">16.13 libxvid</a></h2>
  10428. <p>Xvid MPEG-4 Part 2 encoder wrapper.
  10429. </p>
  10430. <p>This encoder requires the presence of the libxvidcore headers and library
  10431. during configuration. You need to explicitly configure the build with
  10432. <code>--enable-libxvid --enable-gpl</code>.
  10433. </p>
  10434. <p>The native <code>mpeg4</code> encoder supports the MPEG-4 Part 2 format, so
  10435. users can encode to this format without this library.
  10436. </p>
  10437. <a name="Options-10"></a>
  10438. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-10">16.13.1 Options</a></h3>
  10439. <p>The following options are supported by the libxvid wrapper. Some of
  10440. the following options are listed but are not documented, and
  10441. correspond to shared codec options. See <a href="#codec_002doptions">the Codec Options chapter</a> for their documentation. The other shared options
  10442. which are not listed have no effect for the libxvid encoder.
  10443. </p>
  10444. <dl compact="compact">
  10445. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  10446. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  10447. <dt>&lsquo;<samp>qmin</samp>&rsquo;</dt>
  10448. <dt>&lsquo;<samp>qmax</samp>&rsquo;</dt>
  10449. <dt>&lsquo;<samp>mpeg_quant</samp>&rsquo;</dt>
  10450. <dt>&lsquo;<samp>threads</samp>&rsquo;</dt>
  10451. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  10452. <dt>&lsquo;<samp>b_qfactor</samp>&rsquo;</dt>
  10453. <dt>&lsquo;<samp>b_qoffset</samp>&rsquo;</dt>
  10454. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  10455. <dd><p>Set specific encoding flags. Possible values:
  10456. </p>
  10457. <dl compact="compact">
  10458. <dt>&lsquo;<samp>mv4</samp>&rsquo;</dt>
  10459. <dd><p>Use four motion vector by macroblock.
  10460. </p>
  10461. </dd>
  10462. <dt>&lsquo;<samp>aic</samp>&rsquo;</dt>
  10463. <dd><p>Enable high quality AC prediction.
  10464. </p>
  10465. </dd>
  10466. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  10467. <dd><p>Only encode grayscale.
  10468. </p>
  10469. </dd>
  10470. <dt>&lsquo;<samp>gmc</samp>&rsquo;</dt>
  10471. <dd><p>Enable the use of global motion compensation (GMC).
  10472. </p>
  10473. </dd>
  10474. <dt>&lsquo;<samp>qpel</samp>&rsquo;</dt>
  10475. <dd><p>Enable quarter-pixel motion compensation.
  10476. </p>
  10477. </dd>
  10478. <dt>&lsquo;<samp>cgop</samp>&rsquo;</dt>
  10479. <dd><p>Enable closed GOP.
  10480. </p>
  10481. </dd>
  10482. <dt>&lsquo;<samp>global_header</samp>&rsquo;</dt>
  10483. <dd><p>Place global headers in extradata instead of every keyframe.
  10484. </p>
  10485. </dd>
  10486. </dl>
  10487. </dd>
  10488. <dt>&lsquo;<samp>trellis</samp>&rsquo;</dt>
  10489. <dt>&lsquo;<samp>me_method</samp>&rsquo;</dt>
  10490. <dd><p>Set motion estimation method. Possible values in decreasing order of
  10491. speed and increasing order of quality:
  10492. </p>
  10493. <dl compact="compact">
  10494. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  10495. <dd><p>Use no motion estimation (default).
  10496. </p>
  10497. </dd>
  10498. <dt>&lsquo;<samp>phods</samp>&rsquo;</dt>
  10499. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  10500. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  10501. <dd><p>Enable advanced diamond zonal search for 16x16 blocks and half-pixel
  10502. refinement for 16x16 blocks. &lsquo;<samp>x1</samp>&rsquo; and &lsquo;<samp>log</samp>&rsquo; are aliases for
  10503. &lsquo;<samp>phods</samp>&rsquo;.
  10504. </p>
  10505. </dd>
  10506. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  10507. <dd><p>Enable all of the things described above, plus advanced diamond zonal
  10508. search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion
  10509. estimation on chroma planes.
  10510. </p>
  10511. </dd>
  10512. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  10513. <dd><p>Enable all of the things described above, plus extended 16x16 and 8x8
  10514. blocks search.
  10515. </p></dd>
  10516. </dl>
  10517. </dd>
  10518. <dt>&lsquo;<samp>mbd</samp>&rsquo;</dt>
  10519. <dd><p>Set macroblock decision algorithm. Possible values in the increasing
  10520. order of quality:
  10521. </p>
  10522. <dl compact="compact">
  10523. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  10524. <dd><p>Use macroblock comparing function algorithm (default).
  10525. </p>
  10526. </dd>
  10527. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  10528. <dd><p>Enable rate distortion-based half pixel and quarter pixel refinement for
  10529. 16x16 blocks.
  10530. </p>
  10531. </dd>
  10532. <dt>&lsquo;<samp>rd</samp>&rsquo;</dt>
  10533. <dd><p>Enable all of the things described above, plus rate distortion-based
  10534. half pixel and quarter pixel refinement for 8x8 blocks, and rate
  10535. distortion-based search using square pattern.
  10536. </p></dd>
  10537. </dl>
  10538. </dd>
  10539. <dt>&lsquo;<samp>lumi_aq</samp>&rsquo;</dt>
  10540. <dd><p>Enable lumi masking adaptive quantization when set to 1. Default is 0
  10541. (disabled).
  10542. </p>
  10543. </dd>
  10544. <dt>&lsquo;<samp>variance_aq</samp>&rsquo;</dt>
  10545. <dd><p>Enable variance adaptive quantization when set to 1. Default is 0
  10546. (disabled).
  10547. </p>
  10548. <p>When combined with &lsquo;<samp>lumi_aq</samp>&rsquo;, the resulting quality will not
  10549. be better than any of the two specified individually. In other
  10550. words, the resulting quality will be the worse one of the two
  10551. effects.
  10552. </p>
  10553. </dd>
  10554. <dt>&lsquo;<samp>ssim</samp>&rsquo;</dt>
  10555. <dd><p>Set structural similarity (SSIM) displaying method. Possible values:
  10556. </p>
  10557. <dl compact="compact">
  10558. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  10559. <dd><p>Disable displaying of SSIM information.
  10560. </p>
  10561. </dd>
  10562. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  10563. <dd><p>Output average SSIM at the end of encoding to stdout. The format of
  10564. showing the average SSIM is:
  10565. </p>
  10566. <div class="example">
  10567. <pre class="example">Average SSIM: %f
  10568. </pre></div>
  10569. <p>For users who are not familiar with C, %f means a float number, or
  10570. a decimal (e.g. 0.939232).
  10571. </p>
  10572. </dd>
  10573. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  10574. <dd><p>Output both per-frame SSIM data during encoding and average SSIM at
  10575. the end of encoding to stdout. The format of per-frame information
  10576. is:
  10577. </p>
  10578. <div class="example">
  10579. <pre class="example"> SSIM: avg: %1.3f min: %1.3f max: %1.3f
  10580. </pre></div>
  10581. <p>For users who are not familiar with C, %1.3f means a float number
  10582. rounded to 3 digits after the dot (e.g. 0.932).
  10583. </p>
  10584. </dd>
  10585. </dl>
  10586. </dd>
  10587. <dt>&lsquo;<samp>ssim_acc</samp>&rsquo;</dt>
  10588. <dd><p>Set SSIM accuracy. Valid options are integers within the range of
  10589. 0-4, while 0 gives the most accurate result and 4 computes the
  10590. fastest.
  10591. </p>
  10592. </dd>
  10593. </dl>
  10594. <a name="mpeg2"></a>
  10595. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg2">16.14 mpeg2</a></h2>
  10596. <p>MPEG-2 video encoder.
  10597. </p>
  10598. <a name="Options-69"></a>
  10599. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-69">16.14.1 Options</a></h3>
  10600. <dl compact="compact">
  10601. <dt>&lsquo;<samp>seq_disp_ext <var>integer</var></samp>&rsquo;</dt>
  10602. <dd><p>Specifies if the encoder should write a sequence_display_extension to the
  10603. output.
  10604. </p><dl compact="compact">
  10605. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  10606. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10607. <dd><p>Decide automatically to write it or not (this is the default) by checking if
  10608. the data to be written is different from the default or unspecified values.
  10609. </p></dd>
  10610. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  10611. <dt>&lsquo;<samp>never</samp>&rsquo;</dt>
  10612. <dd><p>Never write it.
  10613. </p></dd>
  10614. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  10615. <dt>&lsquo;<samp>always</samp>&rsquo;</dt>
  10616. <dd><p>Always write it.
  10617. </p></dd>
  10618. </dl>
  10619. </dd>
  10620. <dt>&lsquo;<samp>video_format <var>integer</var></samp>&rsquo;</dt>
  10621. <dd><p>Specifies the video_format written into the sequence display extension
  10622. indicating the source of the video pictures. The default is &lsquo;<samp>unspecified</samp>&rsquo;,
  10623. can be &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>pal</samp>&rsquo;, &lsquo;<samp>ntsc</samp>&rsquo;, &lsquo;<samp>secam</samp>&rsquo; or &lsquo;<samp>mac</samp>&rsquo;.
  10624. For maximum compatibility, use &lsquo;<samp>component</samp>&rsquo;.
  10625. </p></dd>
  10626. <dt>&lsquo;<samp>a53cc <var>boolean</var></samp>&rsquo;</dt>
  10627. <dd><p>Import closed captions (which must be ATSC compatible format) into output.
  10628. Default is 1 (on).
  10629. </p></dd>
  10630. </dl>
  10631. <a name="png"></a>
  10632. <h2 class="section"><a href="ffmpeg-all.html#toc-png">16.15 png</a></h2>
  10633. <p>PNG image encoder.
  10634. </p>
  10635. <a name="Private-options-1"></a>
  10636. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-options-1">16.15.1 Private options</a></h3>
  10637. <dl compact="compact">
  10638. <dt>&lsquo;<samp>dpi <var>integer</var></samp>&rsquo;</dt>
  10639. <dd><p>Set physical density of pixels, in dots per inch, unset by default
  10640. </p></dd>
  10641. <dt>&lsquo;<samp>dpm <var>integer</var></samp>&rsquo;</dt>
  10642. <dd><p>Set physical density of pixels, in dots per meter, unset by default
  10643. </p></dd>
  10644. </dl>
  10645. <a name="ProRes"></a>
  10646. <h2 class="section"><a href="ffmpeg-all.html#toc-ProRes">16.16 ProRes</a></h2>
  10647. <p>Apple ProRes encoder.
  10648. </p>
  10649. <p>FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
  10650. The used encoder can be chosen with the <code>-vcodec</code> option.
  10651. </p>
  10652. <a name="Private-Options-for-prores_002dks"></a>
  10653. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Private-Options-for-prores_002dks">16.16.1 Private Options for prores-ks</a></h3>
  10654. <dl compact="compact">
  10655. <dt>&lsquo;<samp>profile <var>integer</var></samp>&rsquo;</dt>
  10656. <dd><p>Select the ProRes profile to encode
  10657. </p><dl compact="compact">
  10658. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  10659. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  10660. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  10661. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  10662. <dt>&lsquo;<samp>4444</samp>&rsquo;</dt>
  10663. <dt>&lsquo;<samp>4444xq</samp>&rsquo;</dt>
  10664. </dl>
  10665. </dd>
  10666. <dt>&lsquo;<samp>quant_mat <var>integer</var></samp>&rsquo;</dt>
  10667. <dd><p>Select quantization matrix.
  10668. </p><dl compact="compact">
  10669. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10670. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  10671. <dt>&lsquo;<samp>proxy</samp>&rsquo;</dt>
  10672. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  10673. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  10674. <dt>&lsquo;<samp>hq</samp>&rsquo;</dt>
  10675. </dl>
  10676. <p>If set to <var>auto</var>, the matrix matching the profile will be picked.
  10677. If not set, the matrix providing the highest quality, <var>default</var>, will be
  10678. picked.
  10679. </p>
  10680. </dd>
  10681. <dt>&lsquo;<samp>bits_per_mb <var>integer</var></samp>&rsquo;</dt>
  10682. <dd><p>How many bits to allot for coding one macroblock. Different profiles use
  10683. between 200 and 2400 bits per macroblock, the maximum is 8000.
  10684. </p>
  10685. </dd>
  10686. <dt>&lsquo;<samp>mbs_per_slice <var>integer</var></samp>&rsquo;</dt>
  10687. <dd><p>Number of macroblocks in each slice (1-8); the default value (8)
  10688. should be good in almost all situations.
  10689. </p>
  10690. </dd>
  10691. <dt>&lsquo;<samp>vendor <var>string</var></samp>&rsquo;</dt>
  10692. <dd><p>Override the 4-byte vendor ID.
  10693. A custom vendor ID like <var>apl0</var> would claim the stream was produced by
  10694. the Apple encoder.
  10695. </p>
  10696. </dd>
  10697. <dt>&lsquo;<samp>alpha_bits <var>integer</var></samp>&rsquo;</dt>
  10698. <dd><p>Specify number of bits for alpha component.
  10699. Possible values are <var>0</var>, <var>8</var> and <var>16</var>.
  10700. Use <var>0</var> to disable alpha plane coding.
  10701. </p>
  10702. </dd>
  10703. </dl>
  10704. <a name="Speed-considerations"></a>
  10705. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Speed-considerations">16.16.2 Speed considerations</a></h3>
  10706. <p>In the default mode of operation the encoder has to honor frame constraints
  10707. (i.e. not produce frames with size bigger than requested) while still making
  10708. output picture as good as possible.
  10709. A frame containing a lot of small details is harder to compress and the encoder
  10710. would spend more time searching for appropriate quantizers for each slice.
  10711. </p>
  10712. <p>Setting a higher &lsquo;<samp>bits_per_mb</samp>&rsquo; limit will improve the speed.
  10713. </p>
  10714. <p>For the fastest encoding speed set the &lsquo;<samp>qscale</samp>&rsquo; parameter (4 is the
  10715. recommended value) and do not set a size constraint.
  10716. </p>
  10717. <a name="QSV-encoders"></a>
  10718. <h2 class="section"><a href="ffmpeg-all.html#toc-QSV-encoders">16.17 QSV encoders</a></h2>
  10719. <p>The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG and VP9)
  10720. </p>
  10721. <p>The ratecontrol method is selected as follows:
  10722. </p>
  10723. <ul>
  10724. <li>
  10725. When &lsquo;<samp>global_quality</samp>&rsquo; is specified, a quality-based mode is used.
  10726. Specifically this means either
  10727. <ul class="no-bullet">
  10728. <li>-
  10729. <var>CQP</var> - constant quantizer scale, when the &lsquo;<samp>qscale</samp>&rsquo; codec flag is
  10730. also set (the &lsquo;<samp>-qscale</samp>&rsquo; ffmpeg option).
  10731. </li><li>-
  10732. <var>LA_ICQ</var> - intelligent constant quality with lookahead, when the
  10733. &lsquo;<samp>look_ahead</samp>&rsquo; option is also set.
  10734. </li><li>-
  10735. <var>ICQ</var> &ndash; intelligent constant quality otherwise.
  10736. </li></ul>
  10737. </li><li>
  10738. Otherwise, a bitrate-based mode is used. For all of those, you should specify at
  10739. least the desired average bitrate with the &lsquo;<samp>b</samp>&rsquo; option.
  10740. <ul class="no-bullet">
  10741. <li>-
  10742. <var>LA</var> - VBR with lookahead, when the &lsquo;<samp>look_ahead</samp>&rsquo; option is specified.
  10743. </li><li>-
  10744. <var>VCM</var> - video conferencing mode, when the &lsquo;<samp>vcm</samp>&rsquo; option is set.
  10745. </li><li>-
  10746. <var>CBR</var> - constant bitrate, when &lsquo;<samp>maxrate</samp>&rsquo; is specified and equal to
  10747. the average bitrate.
  10748. </li><li>-
  10749. <var>VBR</var> - variable bitrate, when &lsquo;<samp>maxrate</samp>&rsquo; is specified, but is higher
  10750. than the average bitrate.
  10751. </li><li>-
  10752. <var>AVBR</var> - average VBR mode, when &lsquo;<samp>maxrate</samp>&rsquo; is not specified. This mode
  10753. is further configured by the &lsquo;<samp>avbr_accuracy</samp>&rsquo; and
  10754. &lsquo;<samp>avbr_convergence</samp>&rsquo; options.
  10755. </li></ul>
  10756. </li></ul>
  10757. <p>Note that depending on your system, a different mode than the one you specified
  10758. may be selected by the encoder. Set the verbosity level to <var>verbose</var> or
  10759. higher to see the actual settings used by the QSV runtime.
  10760. </p>
  10761. <p>Additional libavcodec global options are mapped to MSDK options as follows:
  10762. </p>
  10763. <ul>
  10764. <li>
  10765. &lsquo;<samp>g/gop_size</samp>&rsquo; -&gt; &lsquo;<samp>GopPicSize</samp>&rsquo;
  10766. </li><li>
  10767. &lsquo;<samp>bf/max_b_frames</samp>&rsquo;+1 -&gt; &lsquo;<samp>GopRefDist</samp>&rsquo;
  10768. </li><li>
  10769. &lsquo;<samp>rc_init_occupancy/rc_initial_buffer_occupancy</samp>&rsquo; -&gt;
  10770. &lsquo;<samp>InitialDelayInKB</samp>&rsquo;
  10771. </li><li>
  10772. &lsquo;<samp>slices</samp>&rsquo; -&gt; &lsquo;<samp>NumSlice</samp>&rsquo;
  10773. </li><li>
  10774. &lsquo;<samp>refs</samp>&rsquo; -&gt; &lsquo;<samp>NumRefFrame</samp>&rsquo;
  10775. </li><li>
  10776. &lsquo;<samp>b_strategy/b_frame_strategy</samp>&rsquo; -&gt; &lsquo;<samp>BRefType</samp>&rsquo;
  10777. </li><li>
  10778. &lsquo;<samp>cgop/CLOSED_GOP</samp>&rsquo; codec flag -&gt; &lsquo;<samp>GopOptFlag</samp>&rsquo;
  10779. </li><li>
  10780. For the <var>CQP</var> mode, the &lsquo;<samp>i_qfactor/i_qoffset</samp>&rsquo; and
  10781. &lsquo;<samp>b_qfactor/b_qoffset</samp>&rsquo; set the difference between <var>QPP</var> and <var>QPI</var>,
  10782. and <var>QPP</var> and <var>QPB</var> respectively.
  10783. </li><li>
  10784. Setting the &lsquo;<samp>coder</samp>&rsquo; option to the value <var>vlc</var> will make the H.264
  10785. encoder use CAVLC instead of CABAC.
  10786. </li></ul>
  10787. <a name="snow"></a>
  10788. <h2 class="section"><a href="ffmpeg-all.html#toc-snow">16.18 snow</a></h2>
  10789. <a name="Options-78"></a>
  10790. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-78">16.18.1 Options</a></h3>
  10791. <dl compact="compact">
  10792. <dt>&lsquo;<samp>iterative_dia_size</samp>&rsquo;</dt>
  10793. <dd><p>dia size for the iterative motion estimation
  10794. </p></dd>
  10795. </dl>
  10796. <a name="VAAPI-encoders"></a>
  10797. <h2 class="section"><a href="ffmpeg-all.html#toc-VAAPI-encoders">16.19 VAAPI encoders</a></h2>
  10798. <p>Wrappers for hardware encoders accessible via VAAPI.
  10799. </p>
  10800. <p>These encoders only accept input in VAAPI hardware surfaces. If you have input
  10801. in software frames, use the &lsquo;<samp>hwupload</samp>&rsquo; filter to upload them to the GPU.
  10802. </p>
  10803. <p>The following standard libavcodec options are used:
  10804. </p><ul>
  10805. <li>
  10806. &lsquo;<samp>g</samp>&rsquo; / &lsquo;<samp>gop_size</samp>&rsquo;
  10807. </li><li>
  10808. &lsquo;<samp>bf</samp>&rsquo; / &lsquo;<samp>max_b_frames</samp>&rsquo;
  10809. </li><li>
  10810. &lsquo;<samp>profile</samp>&rsquo;
  10811. <p>If not set, this will be determined automatically from the format of the input
  10812. frames and the profiles supported by the driver.
  10813. </p></li><li>
  10814. &lsquo;<samp>level</samp>&rsquo;
  10815. </li><li>
  10816. &lsquo;<samp>b</samp>&rsquo; / &lsquo;<samp>bit_rate</samp>&rsquo;
  10817. </li><li>
  10818. &lsquo;<samp>maxrate</samp>&rsquo; / &lsquo;<samp>rc_max_rate</samp>&rsquo;
  10819. </li><li>
  10820. &lsquo;<samp>bufsize</samp>&rsquo; / &lsquo;<samp>rc_buffer_size</samp>&rsquo;
  10821. </li><li>
  10822. &lsquo;<samp>rc_init_occupancy</samp>&rsquo; / &lsquo;<samp>rc_initial_buffer_occupancy</samp>&rsquo;
  10823. </li><li>
  10824. &lsquo;<samp>compression_level</samp>&rsquo;
  10825. <p>Speed / quality tradeoff: higher values are faster / worse quality.
  10826. </p></li><li>
  10827. &lsquo;<samp>q</samp>&rsquo; / &lsquo;<samp>global_quality</samp>&rsquo;
  10828. <p>Size / quality tradeoff: higher values are smaller / worse quality.
  10829. </p></li><li>
  10830. &lsquo;<samp>qmin</samp>&rsquo;
  10831. </li><li>
  10832. &lsquo;<samp>qmax</samp>&rsquo;
  10833. </li><li>
  10834. &lsquo;<samp>i_qfactor</samp>&rsquo; / &lsquo;<samp>i_quant_factor</samp>&rsquo;
  10835. </li><li>
  10836. &lsquo;<samp>i_qoffset</samp>&rsquo; / &lsquo;<samp>i_quant_offset</samp>&rsquo;
  10837. </li><li>
  10838. &lsquo;<samp>b_qfactor</samp>&rsquo; / &lsquo;<samp>b_quant_factor</samp>&rsquo;
  10839. </li><li>
  10840. &lsquo;<samp>b_qoffset</samp>&rsquo; / &lsquo;<samp>b_quant_offset</samp>&rsquo;
  10841. </li><li>
  10842. &lsquo;<samp>slices</samp>&rsquo;
  10843. </li></ul>
  10844. <p>All encoders support the following options:
  10845. </p><dl compact="compact">
  10846. <dt>&lsquo;<samp>low_power</samp>&rsquo;</dt>
  10847. <dd><p>Some drivers/platforms offer a second encoder for some codecs intended to use
  10848. less power than the default encoder; setting this option will attempt to use
  10849. that encoder. Note that it may support a reduced feature set, so some other
  10850. options may not be available in this mode.
  10851. </p>
  10852. </dd>
  10853. <dt>&lsquo;<samp>idr_interval</samp>&rsquo;</dt>
  10854. <dd><p>Set the number of normal intra frames between full-refresh (IDR) frames in
  10855. open-GOP mode. The intra frames are still IRAPs, but will not include global
  10856. headers and may have non-decodable leading pictures.
  10857. </p>
  10858. </dd>
  10859. <dt>&lsquo;<samp>b_depth</samp>&rsquo;</dt>
  10860. <dd><p>Set the B-frame reference depth. When set to one (the default), all B-frames
  10861. will refer only to P- or I-frames. When set to greater values multiple layers
  10862. of B-frames will be present, frames in each layer only referring to frames in
  10863. higher layers.
  10864. </p>
  10865. </dd>
  10866. <dt>&lsquo;<samp>rc_mode</samp>&rsquo;</dt>
  10867. <dd><p>Set the rate control mode to use. A given driver may only support a subset of
  10868. modes.
  10869. </p>
  10870. <p>Possible modes:
  10871. </p><dl compact="compact">
  10872. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  10873. <dd><p>Choose the mode automatically based on driver support and the other options.
  10874. This is the default.
  10875. </p></dd>
  10876. <dt>&lsquo;<samp>CQP</samp>&rsquo;</dt>
  10877. <dd><p>Constant-quality.
  10878. </p></dd>
  10879. <dt>&lsquo;<samp>CBR</samp>&rsquo;</dt>
  10880. <dd><p>Constant-bitrate.
  10881. </p></dd>
  10882. <dt>&lsquo;<samp>VBR</samp>&rsquo;</dt>
  10883. <dd><p>Variable-bitrate.
  10884. </p></dd>
  10885. <dt>&lsquo;<samp>ICQ</samp>&rsquo;</dt>
  10886. <dd><p>Intelligent constant-quality.
  10887. </p></dd>
  10888. <dt>&lsquo;<samp>QVBR</samp>&rsquo;</dt>
  10889. <dd><p>Quality-defined variable-bitrate.
  10890. </p></dd>
  10891. <dt>&lsquo;<samp>AVBR</samp>&rsquo;</dt>
  10892. <dd><p>Average variable bitrate.
  10893. </p></dd>
  10894. </dl>
  10895. </dd>
  10896. </dl>
  10897. <p>Each encoder also has its own specific options:
  10898. </p><dl compact="compact">
  10899. <dt>&lsquo;<samp>h264_vaapi</samp>&rsquo;</dt>
  10900. <dd><p>&lsquo;<samp>profile</samp>&rsquo; sets the value of <em>profile_idc</em> and the <em>constraint_set*_flag</em>s.
  10901. &lsquo;<samp>level</samp>&rsquo; sets the value of <em>level_idc</em>.
  10902. </p>
  10903. <dl compact="compact">
  10904. <dt>&lsquo;<samp>coder</samp>&rsquo;</dt>
  10905. <dd><p>Set entropy encoder (default is <em>cabac</em>). Possible values:
  10906. </p>
  10907. <dl compact="compact">
  10908. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  10909. <dt>&lsquo;<samp>cabac</samp>&rsquo;</dt>
  10910. <dd><p>Use CABAC.
  10911. </p>
  10912. </dd>
  10913. <dt>&lsquo;<samp>vlc</samp>&rsquo;</dt>
  10914. <dt>&lsquo;<samp>cavlc</samp>&rsquo;</dt>
  10915. <dd><p>Use CAVLC.
  10916. </p></dd>
  10917. </dl>
  10918. </dd>
  10919. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  10920. <dd><p>Include access unit delimiters in the stream (not included by default).
  10921. </p>
  10922. </dd>
  10923. <dt>&lsquo;<samp>sei</samp>&rsquo;</dt>
  10924. <dd><p>Set SEI message types to include.
  10925. Some combination of the following values:
  10926. </p><dl compact="compact">
  10927. <dt>&lsquo;<samp>identifier</samp>&rsquo;</dt>
  10928. <dd><p>Include a <em>user_data_unregistered</em> message containing information about
  10929. the encoder.
  10930. </p></dd>
  10931. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  10932. <dd><p>Include picture timing parameters (<em>buffering_period</em> and
  10933. <em>pic_timing</em> messages).
  10934. </p></dd>
  10935. <dt>&lsquo;<samp>recovery_point</samp>&rsquo;</dt>
  10936. <dd><p>Include recovery points where appropriate (<em>recovery_point</em> messages).
  10937. </p></dd>
  10938. </dl>
  10939. </dd>
  10940. </dl>
  10941. </dd>
  10942. <dt>&lsquo;<samp>hevc_vaapi</samp>&rsquo;</dt>
  10943. <dd><p>&lsquo;<samp>profile</samp>&rsquo; and &lsquo;<samp>level</samp>&rsquo; set the values of
  10944. <em>general_profile_idc</em> and <em>general_level_idc</em> respectively.
  10945. </p>
  10946. <dl compact="compact">
  10947. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  10948. <dd><p>Include access unit delimiters in the stream (not included by default).
  10949. </p>
  10950. </dd>
  10951. <dt>&lsquo;<samp>tier</samp>&rsquo;</dt>
  10952. <dd><p>Set <em>general_tier_flag</em>. This may affect the level chosen for the stream
  10953. if it is not explicitly specified.
  10954. </p>
  10955. </dd>
  10956. <dt>&lsquo;<samp>sei</samp>&rsquo;</dt>
  10957. <dd><p>Set SEI message types to include.
  10958. Some combination of the following values:
  10959. </p><dl compact="compact">
  10960. <dt>&lsquo;<samp>hdr</samp>&rsquo;</dt>
  10961. <dd><p>Include HDR metadata if the input frames have it
  10962. (<em>mastering_display_colour_volume</em> and <em>content_light_level</em>
  10963. messages).
  10964. </p></dd>
  10965. </dl>
  10966. </dd>
  10967. </dl>
  10968. </dd>
  10969. <dt>&lsquo;<samp>mjpeg_vaapi</samp>&rsquo;</dt>
  10970. <dd><p>Only baseline DCT encoding is supported. The encoder always uses the standard
  10971. quantisation and huffman tables - &lsquo;<samp>global_quality</samp>&rsquo; scales the standard
  10972. quantisation table (range 1-100).
  10973. </p>
  10974. <p>For YUV, 4:2:0, 4:2:2 and 4:4:4 subsampling modes are supported. RGB is also
  10975. supported, and will create an RGB JPEG.
  10976. </p>
  10977. <dl compact="compact">
  10978. <dt>&lsquo;<samp>jfif</samp>&rsquo;</dt>
  10979. <dd><p>Include JFIF header in each frame (not included by default).
  10980. </p></dd>
  10981. <dt>&lsquo;<samp>huffman</samp>&rsquo;</dt>
  10982. <dd><p>Include standard huffman tables (on by default). Turning this off will save
  10983. a few hundred bytes in each output frame, but may lose compatibility with some
  10984. JPEG decoders which don&rsquo;t fully handle MJPEG.
  10985. </p></dd>
  10986. </dl>
  10987. </dd>
  10988. <dt>&lsquo;<samp>mpeg2_vaapi</samp>&rsquo;</dt>
  10989. <dd><p>&lsquo;<samp>profile</samp>&rsquo; and &lsquo;<samp>level</samp>&rsquo; set the value of <em>profile_and_level_indication</em>.
  10990. </p>
  10991. </dd>
  10992. <dt>&lsquo;<samp>vp8_vaapi</samp>&rsquo;</dt>
  10993. <dd><p>B-frames are not supported.
  10994. </p>
  10995. <p>&lsquo;<samp>global_quality</samp>&rsquo; sets the <em>q_idx</em> used for non-key frames (range 0-127).
  10996. </p>
  10997. <dl compact="compact">
  10998. <dt>&lsquo;<samp>loop_filter_level</samp>&rsquo;</dt>
  10999. <dt>&lsquo;<samp>loop_filter_sharpness</samp>&rsquo;</dt>
  11000. <dd><p>Manually set the loop filter parameters.
  11001. </p></dd>
  11002. </dl>
  11003. </dd>
  11004. <dt>&lsquo;<samp>vp9_vaapi</samp>&rsquo;</dt>
  11005. <dd><p>&lsquo;<samp>global_quality</samp>&rsquo; sets the <em>q_idx</em> used for P-frames (range 0-255).
  11006. </p>
  11007. <dl compact="compact">
  11008. <dt>&lsquo;<samp>loop_filter_level</samp>&rsquo;</dt>
  11009. <dt>&lsquo;<samp>loop_filter_sharpness</samp>&rsquo;</dt>
  11010. <dd><p>Manually set the loop filter parameters.
  11011. </p></dd>
  11012. </dl>
  11013. <p>B-frames are supported, but the output stream is always in encode order rather than display
  11014. order. If B-frames are enabled, it may be necessary to use the &lsquo;<samp>vp9_raw_reorder</samp>&rsquo;
  11015. bitstream filter to modify the output stream to display frames in the correct order.
  11016. </p>
  11017. <p>Only normal frames are produced - the &lsquo;<samp>vp9_superframe</samp>&rsquo; bitstream filter may be
  11018. required to produce a stream usable with all decoders.
  11019. </p>
  11020. </dd>
  11021. </dl>
  11022. <a name="vc2"></a>
  11023. <h2 class="section"><a href="ffmpeg-all.html#toc-vc2">16.20 vc2</a></h2>
  11024. <p>SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
  11025. professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
  11026. 8 (limited range or full range), 10 or 12 bits, this makes it suitable for
  11027. other tasks which require low overhead and low compression (like screen
  11028. recording).
  11029. </p>
  11030. <a name="Options-60"></a>
  11031. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-60">16.20.1 Options</a></h3>
  11032. <dl compact="compact">
  11033. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  11034. <dd><p>Sets target video bitrate. Usually that&rsquo;s around 1:6 of the uncompressed
  11035. video bitrate (e.g. for 1920x1080 50fps yuv422p10 that&rsquo;s around 400Mbps). Higher
  11036. values (close to the uncompressed bitrate) turn on lossless compression mode.
  11037. </p>
  11038. </dd>
  11039. <dt>&lsquo;<samp>field_order</samp>&rsquo;</dt>
  11040. <dd><p>Enables field coding when set (e.g. to tt - top field first) for interlaced
  11041. inputs. Should increase compression with interlaced content as it splits the
  11042. fields and encodes each separately.
  11043. </p>
  11044. </dd>
  11045. <dt>&lsquo;<samp>wavelet_depth</samp>&rsquo;</dt>
  11046. <dd><p>Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
  11047. Lower values reduce compression and quality. Less capable decoders may not be
  11048. able to handle values of &lsquo;<samp>wavelet_depth</samp>&rsquo; over 3.
  11049. </p>
  11050. </dd>
  11051. <dt>&lsquo;<samp>wavelet_type</samp>&rsquo;</dt>
  11052. <dd><p>Sets the transform type. Currently only <var>5_3</var> (LeGall) and <var>9_7</var>
  11053. (Deslauriers-Dubuc)
  11054. are implemented, with 9_7 being the one with better compression and thus
  11055. is the default.
  11056. </p>
  11057. </dd>
  11058. <dt>&lsquo;<samp>slice_width</samp>&rsquo;</dt>
  11059. <dt>&lsquo;<samp>slice_height</samp>&rsquo;</dt>
  11060. <dd><p>Sets the slice size for each slice. Larger values result in better compression.
  11061. For compatibility with other more limited decoders use &lsquo;<samp>slice_width</samp>&rsquo; of
  11062. 32 and &lsquo;<samp>slice_height</samp>&rsquo; of 8.
  11063. </p>
  11064. </dd>
  11065. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  11066. <dd><p>Sets the undershoot tolerance of the rate control system in percent. This is
  11067. to prevent an expensive search from being run.
  11068. </p>
  11069. </dd>
  11070. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  11071. <dd><p>Sets the quantization matrix preset to use by default or when &lsquo;<samp>wavelet_depth</samp>&rsquo;
  11072. is set to 5
  11073. </p><ul class="no-bullet">
  11074. <li>-
  11075. <var>default</var>
  11076. Uses the default quantization matrix from the specifications, extended with
  11077. values for the fifth level. This provides a good balance between keeping detail
  11078. and omitting artifacts.
  11079. </li><li>-
  11080. <var>flat</var>
  11081. Use a completely zeroed out quantization matrix. This increases PSNR but might
  11082. reduce perception. Use in bogus benchmarks.
  11083. </li><li>-
  11084. <var>color</var>
  11085. Reduces detail but attempts to preserve color at extremely low bitrates.
  11086. </li></ul>
  11087. </dd>
  11088. </dl>
  11089. <a name="Subtitles-Encoders"></a>
  11090. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Subtitles-Encoders">17 Subtitles Encoders</a></h1>
  11091. <a name="dvdsub"></a>
  11092. <h2 class="section"><a href="ffmpeg-all.html#toc-dvdsub">17.1 dvdsub</a></h2>
  11093. <p>This codec encodes the bitmap subtitle format that is used in DVDs.
  11094. Typically they are stored in VOBSUB file pairs (*.idx + *.sub),
  11095. and they can also be used in Matroska files.
  11096. </p>
  11097. <a name="Options-56"></a>
  11098. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-56">17.1.1 Options</a></h3>
  11099. <dl compact="compact">
  11100. <dt>&lsquo;<samp>palette</samp>&rsquo;</dt>
  11101. <dd><p>Specify the global palette used by the bitmaps.
  11102. </p>
  11103. <p>The format for this option is a string containing 16 24-bits hexadecimal
  11104. numbers (without 0x prefix) separated by commas, for example <code>0d00ee,
  11105. ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1,
  11106. 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b</code>.
  11107. </p>
  11108. </dd>
  11109. <dt>&lsquo;<samp>even_rows_fix</samp>&rsquo;</dt>
  11110. <dd><p>When set to 1, enable a work-around that makes the number of pixel rows
  11111. even in all subtitles. This fixes a problem with some players that
  11112. cut off the bottom row if the number is odd. The work-around just adds
  11113. a fully transparent row if needed. The overhead is low, typically
  11114. one byte per subtitle on average.
  11115. </p>
  11116. <p>By default, this work-around is disabled.
  11117. </p></dd>
  11118. </dl>
  11119. <a name="Bitstream-Filters"></a>
  11120. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Bitstream-Filters">18 Bitstream Filters</a></h1>
  11121. <p>When you configure your FFmpeg build, all the supported bitstream
  11122. filters are enabled by default. You can list all available ones using
  11123. the configure option <code>--list-bsfs</code>.
  11124. </p>
  11125. <p>You can disable all the bitstream filters using the configure option
  11126. <code>--disable-bsfs</code>, and selectively enable any bitstream filter using
  11127. the option <code>--enable-bsf=BSF</code>, or you can disable a particular
  11128. bitstream filter using the option <code>--disable-bsf=BSF</code>.
  11129. </p>
  11130. <p>The option <code>-bsfs</code> of the ff* tools will display the list of
  11131. all the supported bitstream filters included in your build.
  11132. </p>
  11133. <p>The ff* tools have a -bsf option applied per stream, taking a
  11134. comma-separated list of filters, whose parameters follow the filter
  11135. name after a &rsquo;=&rsquo;.
  11136. </p>
  11137. <div class="example">
  11138. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
  11139. </pre></div>
  11140. <p>Below is a description of the currently available bitstream filters,
  11141. with their parameters, if any.
  11142. </p>
  11143. <a name="aac_005fadtstoasc"></a>
  11144. <h2 class="section"><a href="ffmpeg-all.html#toc-aac_005fadtstoasc">18.1 aac_adtstoasc</a></h2>
  11145. <p>Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
  11146. bitstream.
  11147. </p>
  11148. <p>This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4
  11149. ADTS header and removes the ADTS header.
  11150. </p>
  11151. <p>This filter is required for example when copying an AAC stream from a
  11152. raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
  11153. to MOV/MP4 files and related formats such as 3GP or M4A. Please note
  11154. that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
  11155. </p>
  11156. <a name="av1_005fmetadata"></a>
  11157. <h2 class="section"><a href="ffmpeg-all.html#toc-av1_005fmetadata">18.2 av1_metadata</a></h2>
  11158. <p>Modify metadata embedded in an AV1 stream.
  11159. </p>
  11160. <dl compact="compact">
  11161. <dt>&lsquo;<samp>td</samp>&rsquo;</dt>
  11162. <dd><p>Insert or remove temporal delimiter OBUs in all temporal units of the
  11163. stream.
  11164. </p>
  11165. <dl compact="compact">
  11166. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11167. <dd><p>Insert a TD at the beginning of every TU which does not already have one.
  11168. </p></dd>
  11169. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11170. <dd><p>Remove the TD from the beginning of every TU which has one.
  11171. </p></dd>
  11172. </dl>
  11173. </dd>
  11174. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  11175. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11176. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11177. <dd><p>Set the color description fields in the stream (see AV1 section 6.4.2).
  11178. </p>
  11179. </dd>
  11180. <dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
  11181. <dd><p>Set the color range in the stream (see AV1 section 6.4.2; note that
  11182. this cannot be set for streams using BT.709 primaries, sRGB transfer
  11183. characteristic and identity (RGB) matrix coefficients).
  11184. </p><dl compact="compact">
  11185. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  11186. <dd><p>Limited range.
  11187. </p></dd>
  11188. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  11189. <dd><p>Full range.
  11190. </p></dd>
  11191. </dl>
  11192. </dd>
  11193. <dt>&lsquo;<samp>chroma_sample_position</samp>&rsquo;</dt>
  11194. <dd><p>Set the chroma sample location in the stream (see AV1 section 6.4.2).
  11195. This can only be set for 4:2:0 streams.
  11196. </p>
  11197. <dl compact="compact">
  11198. <dt>&lsquo;<samp>vertical</samp>&rsquo;</dt>
  11199. <dd><p>Left position (matching the default in MPEG-2 and H.264).
  11200. </p></dd>
  11201. <dt>&lsquo;<samp>colocated</samp>&rsquo;</dt>
  11202. <dd><p>Top-left position.
  11203. </p></dd>
  11204. </dl>
  11205. </dd>
  11206. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11207. <dd><p>Set the tick rate (<em>num_units_in_display_tick / time_scale</em>) in
  11208. the timing info in the sequence header.
  11209. </p></dd>
  11210. <dt>&lsquo;<samp>num_ticks_per_picture</samp>&rsquo;</dt>
  11211. <dd><p>Set the number of ticks in each picture, to indicate that the stream
  11212. has a fixed framerate. Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
  11213. </p>
  11214. </dd>
  11215. <dt>&lsquo;<samp>delete_padding</samp>&rsquo;</dt>
  11216. <dd><p>Deletes Padding OBUs.
  11217. </p>
  11218. </dd>
  11219. </dl>
  11220. <a name="chomp"></a>
  11221. <h2 class="section"><a href="ffmpeg-all.html#toc-chomp">18.3 chomp</a></h2>
  11222. <p>Remove zero padding at the end of a packet.
  11223. </p>
  11224. <a name="dca_005fcore"></a>
  11225. <h2 class="section"><a href="ffmpeg-all.html#toc-dca_005fcore">18.4 dca_core</a></h2>
  11226. <p>Extract the core from a DCA/DTS stream, dropping extensions such as
  11227. DTS-HD.
  11228. </p>
  11229. <a name="dump_005fextra"></a>
  11230. <h2 class="section"><a href="ffmpeg-all.html#toc-dump_005fextra">18.5 dump_extra</a></h2>
  11231. <p>Add extradata to the beginning of the filtered packets except when
  11232. said packets already exactly begin with the extradata that is intended
  11233. to be added.
  11234. </p>
  11235. <dl compact="compact">
  11236. <dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
  11237. <dd><p>The additional argument specifies which packets should be filtered.
  11238. It accepts the values:
  11239. </p><dl compact="compact">
  11240. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  11241. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  11242. <dd><p>add extradata to all key packets
  11243. </p>
  11244. </dd>
  11245. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  11246. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  11247. <dd><p>add extradata to all packets
  11248. </p></dd>
  11249. </dl>
  11250. </dd>
  11251. </dl>
  11252. <p>If not specified it is assumed &lsquo;<samp>k</samp>&rsquo;.
  11253. </p>
  11254. <p>For example the following <code>ffmpeg</code> command forces a global
  11255. header (thus disabling individual packet headers) in the H.264 packets
  11256. generated by the <code>libx264</code> encoder, but corrects them by adding
  11257. the header stored in extradata to the key packets:
  11258. </p><div class="example">
  11259. <pre class="example">ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
  11260. </pre></div>
  11261. <a name="eac3_005fcore"></a>
  11262. <h2 class="section"><a href="ffmpeg-all.html#toc-eac3_005fcore">18.6 eac3_core</a></h2>
  11263. <p>Extract the core from a E-AC-3 stream, dropping extra channels.
  11264. </p>
  11265. <a name="extract_005fextradata"></a>
  11266. <h2 class="section"><a href="ffmpeg-all.html#toc-extract_005fextradata">18.7 extract_extradata</a></h2>
  11267. <p>Extract the in-band extradata.
  11268. </p>
  11269. <p>Certain codecs allow the long-term headers (e.g. MPEG-2 sequence headers,
  11270. or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either &quot;in-band&quot; (i.e. as a part
  11271. of the bitstream containing the coded frames) or &quot;out of band&quot; (e.g. on the
  11272. container level). This latter form is called &quot;extradata&quot; in FFmpeg terminology.
  11273. </p>
  11274. <p>This bitstream filter detects the in-band headers and makes them available as
  11275. extradata.
  11276. </p>
  11277. <dl compact="compact">
  11278. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11279. <dd><p>When this option is enabled, the long-term headers are removed from the
  11280. bitstream after extraction.
  11281. </p></dd>
  11282. </dl>
  11283. <a name="filter_005funits"></a>
  11284. <h2 class="section"><a href="ffmpeg-all.html#toc-filter_005funits">18.8 filter_units</a></h2>
  11285. <p>Remove units with types in or not in a given set from the stream.
  11286. </p>
  11287. <dl compact="compact">
  11288. <dt>&lsquo;<samp>pass_types</samp>&rsquo;</dt>
  11289. <dd><p>List of unit types or ranges of unit types to pass through while removing
  11290. all others. This is specified as a &rsquo;|&rsquo;-separated list of unit type values
  11291. or ranges of values with &rsquo;-&rsquo;.
  11292. </p>
  11293. </dd>
  11294. <dt>&lsquo;<samp>remove_types</samp>&rsquo;</dt>
  11295. <dd><p>Identical to &lsquo;<samp>pass_types</samp>&rsquo;, except the units in the given set
  11296. removed and all others passed through.
  11297. </p></dd>
  11298. </dl>
  11299. <p>Extradata is unchanged by this transformation, but note that if the stream
  11300. contains inline parameter sets then the output may be unusable if they are
  11301. removed.
  11302. </p>
  11303. <p>For example, to remove all non-VCL NAL units from an H.264 stream:
  11304. </p><div class="example">
  11305. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
  11306. </pre></div>
  11307. <p>To remove all AUDs, SEI and filler from an H.265 stream:
  11308. </p><div class="example">
  11309. <pre class="example">ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
  11310. </pre></div>
  11311. <a name="hapqa_005fextract"></a>
  11312. <h2 class="section"><a href="ffmpeg-all.html#toc-hapqa_005fextract">18.9 hapqa_extract</a></h2>
  11313. <p>Extract Rgb or Alpha part of an HAPQA file, without recompression, in order to create an HAPQ or an HAPAlphaOnly file.
  11314. </p>
  11315. <dl compact="compact">
  11316. <dt>&lsquo;<samp>texture</samp>&rsquo;</dt>
  11317. <dd><p>Specifies the texture to keep.
  11318. </p>
  11319. <dl compact="compact">
  11320. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  11321. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  11322. </dl>
  11323. </dd>
  11324. </dl>
  11325. <p>Convert HAPQA to HAPQ
  11326. </p><div class="example">
  11327. <pre class="example">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder=&quot;HAPQ&quot; hapq_file.mov
  11328. </pre></div>
  11329. <p>Convert HAPQA to HAPAlphaOnly
  11330. </p><div class="example">
  11331. <pre class="example">ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder=&quot;HAPAlpha Only&quot; hapalphaonly_file.mov
  11332. </pre></div>
  11333. <a name="h264_005fmetadata"></a>
  11334. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fmetadata">18.10 h264_metadata</a></h2>
  11335. <p>Modify metadata embedded in an H.264 stream.
  11336. </p>
  11337. <dl compact="compact">
  11338. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11339. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  11340. </p>
  11341. <dl compact="compact">
  11342. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11343. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11344. </dl>
  11345. </dd>
  11346. <dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
  11347. <dd><p>Set the sample aspect ratio of the stream in the VUI parameters.
  11348. </p>
  11349. </dd>
  11350. <dt>&lsquo;<samp>overscan_appropriate_flag</samp>&rsquo;</dt>
  11351. <dd><p>Set whether the stream is suitable for display using overscan
  11352. or not (see H.264 section E.2.1).
  11353. </p>
  11354. </dd>
  11355. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11356. <dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
  11357. <dd><p>Set the video format in the stream (see H.264 section E.2.1 and
  11358. table E-2).
  11359. </p>
  11360. </dd>
  11361. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11362. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11363. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11364. <dd><p>Set the colour description in the stream (see H.264 section E.2.1
  11365. and tables E-3, E-4 and E-5).
  11366. </p>
  11367. </dd>
  11368. <dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
  11369. <dd><p>Set the chroma sample location in the stream (see H.264 section
  11370. E.2.1 and figure E-1).
  11371. </p>
  11372. </dd>
  11373. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11374. <dd><p>Set the tick rate (num_units_in_tick / time_scale) in the VUI
  11375. parameters. This is the smallest time unit representable in the
  11376. stream, and in many cases represents the field rate of the stream
  11377. (double the frame rate).
  11378. </p></dd>
  11379. <dt>&lsquo;<samp>fixed_frame_rate_flag</samp>&rsquo;</dt>
  11380. <dd><p>Set whether the stream has fixed framerate - typically this indicates
  11381. that the framerate is exactly half the tick rate, but the exact
  11382. meaning is dependent on interlacing and the picture structure (see
  11383. H.264 section E.2.1 and table E-6).
  11384. </p>
  11385. </dd>
  11386. <dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
  11387. <dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
  11388. <dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
  11389. <dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
  11390. <dd><p>Set the frame cropping offsets in the SPS. These values will replace
  11391. the current ones if the stream is already cropped.
  11392. </p>
  11393. <p>These fields are set in pixels. Note that some sizes may not be
  11394. representable if the chroma is subsampled or the stream is interlaced
  11395. (see H.264 section 7.4.2.1.1).
  11396. </p>
  11397. </dd>
  11398. <dt>&lsquo;<samp>sei_user_data</samp>&rsquo;</dt>
  11399. <dd><p>Insert a string as SEI unregistered user data. The argument must
  11400. be of the form <em>UUID+string</em>, where the UUID is as hex digits
  11401. possibly separated by hyphens, and the string can be anything.
  11402. </p>
  11403. <p>For example, &lsquo;<samp>086f3693-b7b3-4f2c-9653-21492feee5b8+hello</samp>&rsquo; will
  11404. insert the string &ldquo;hello&rdquo; associated with the given UUID.
  11405. </p>
  11406. </dd>
  11407. <dt>&lsquo;<samp>delete_filler</samp>&rsquo;</dt>
  11408. <dd><p>Deletes both filler NAL units and filler SEI messages.
  11409. </p>
  11410. </dd>
  11411. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  11412. <dd><p>Set the level in the SPS. Refer to H.264 section A.3 and tables A-1
  11413. to A-5.
  11414. </p>
  11415. <p>The argument must be the name of a level (for example, &lsquo;<samp>4.2</samp>&rsquo;), a
  11416. level_idc value (for example, &lsquo;<samp>42</samp>&rsquo;), or the special name &lsquo;<samp>auto</samp>&rsquo;
  11417. indicating that the filter should attempt to guess the level from the
  11418. input stream properties.
  11419. </p>
  11420. </dd>
  11421. </dl>
  11422. <a name="h264_005fmp4toannexb"></a>
  11423. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fmp4toannexb">18.11 h264_mp4toannexb</a></h2>
  11424. <p>Convert an H.264 bitstream from length prefixed mode to start code
  11425. prefixed mode (as defined in the Annex B of the ITU-T H.264
  11426. specification).
  11427. </p>
  11428. <p>This is required by some streaming formats, typically the MPEG-2
  11429. transport stream format (muxer <code>mpegts</code>).
  11430. </p>
  11431. <p>For example to remux an MP4 file containing an H.264 stream to mpegts
  11432. format with <code>ffmpeg</code>, you can use the command:
  11433. </p>
  11434. <div class="example">
  11435. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
  11436. </pre></div>
  11437. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  11438. <code>mpegts</code>) and raw H.264 (muxer <code>h264</code>) output formats.
  11439. </p>
  11440. <a name="h264_005fredundant_005fpps"></a>
  11441. <h2 class="section"><a href="ffmpeg-all.html#toc-h264_005fredundant_005fpps">18.12 h264_redundant_pps</a></h2>
  11442. <p>This applies a specific fixup to some Blu-ray streams which contain
  11443. redundant PPSs modifying irrelevant parameters of the stream which
  11444. confuse other transformations which require correct extradata.
  11445. </p>
  11446. <p>A new single global PPS is created, and all of the redundant PPSs
  11447. within the stream are removed.
  11448. </p>
  11449. <a name="hevc_005fmetadata"></a>
  11450. <h2 class="section"><a href="ffmpeg-all.html#toc-hevc_005fmetadata">18.13 hevc_metadata</a></h2>
  11451. <p>Modify metadata embedded in an HEVC stream.
  11452. </p>
  11453. <dl compact="compact">
  11454. <dt>&lsquo;<samp>aud</samp>&rsquo;</dt>
  11455. <dd><p>Insert or remove AUD NAL units in all access units of the stream.
  11456. </p>
  11457. <dl compact="compact">
  11458. <dt>&lsquo;<samp>insert</samp>&rsquo;</dt>
  11459. <dt>&lsquo;<samp>remove</samp>&rsquo;</dt>
  11460. </dl>
  11461. </dd>
  11462. <dt>&lsquo;<samp>sample_aspect_ratio</samp>&rsquo;</dt>
  11463. <dd><p>Set the sample aspect ratio in the stream in the VUI parameters.
  11464. </p>
  11465. </dd>
  11466. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11467. <dt>&lsquo;<samp>video_full_range_flag</samp>&rsquo;</dt>
  11468. <dd><p>Set the video format in the stream (see H.265 section E.3.1 and
  11469. table E.2).
  11470. </p>
  11471. </dd>
  11472. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11473. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11474. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11475. <dd><p>Set the colour description in the stream (see H.265 section E.3.1
  11476. and tables E.3, E.4 and E.5).
  11477. </p>
  11478. </dd>
  11479. <dt>&lsquo;<samp>chroma_sample_loc_type</samp>&rsquo;</dt>
  11480. <dd><p>Set the chroma sample location in the stream (see H.265 section
  11481. E.3.1 and figure E.1).
  11482. </p>
  11483. </dd>
  11484. <dt>&lsquo;<samp>tick_rate</samp>&rsquo;</dt>
  11485. <dd><p>Set the tick rate in the VPS and VUI parameters (num_units_in_tick /
  11486. time_scale). Combined with &lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;, this can
  11487. set a constant framerate in the stream. Note that it is likely to be
  11488. overridden by container parameters when the stream is in a container.
  11489. </p>
  11490. </dd>
  11491. <dt>&lsquo;<samp>num_ticks_poc_diff_one</samp>&rsquo;</dt>
  11492. <dd><p>Set poc_proportional_to_timing_flag in VPS and VUI and use this value
  11493. to set num_ticks_poc_diff_one_minus1 (see H.265 sections 7.4.3.1 and
  11494. E.3.1). Ignored if &lsquo;<samp>tick_rate</samp>&rsquo; is not also set.
  11495. </p>
  11496. </dd>
  11497. <dt>&lsquo;<samp>crop_left</samp>&rsquo;</dt>
  11498. <dt>&lsquo;<samp>crop_right</samp>&rsquo;</dt>
  11499. <dt>&lsquo;<samp>crop_top</samp>&rsquo;</dt>
  11500. <dt>&lsquo;<samp>crop_bottom</samp>&rsquo;</dt>
  11501. <dd><p>Set the conformance window cropping offsets in the SPS. These values
  11502. will replace the current ones if the stream is already cropped.
  11503. </p>
  11504. <p>These fields are set in pixels. Note that some sizes may not be
  11505. representable if the chroma is subsampled (H.265 section 7.4.3.2.1).
  11506. </p>
  11507. </dd>
  11508. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  11509. <dd><p>Set the level in the VPS and SPS. See H.265 section A.4 and tables
  11510. A.6 and A.7.
  11511. </p>
  11512. <p>The argument must be the name of a level (for example, &lsquo;<samp>5.1</samp>&rsquo;), a
  11513. <em>general_level_idc</em> value (for example, &lsquo;<samp>153</samp>&rsquo; for level 5.1),
  11514. or the special name &lsquo;<samp>auto</samp>&rsquo; indicating that the filter should
  11515. attempt to guess the level from the input stream properties.
  11516. </p>
  11517. </dd>
  11518. </dl>
  11519. <a name="hevc_005fmp4toannexb"></a>
  11520. <h2 class="section"><a href="ffmpeg-all.html#toc-hevc_005fmp4toannexb">18.14 hevc_mp4toannexb</a></h2>
  11521. <p>Convert an HEVC/H.265 bitstream from length prefixed mode to start code
  11522. prefixed mode (as defined in the Annex B of the ITU-T H.265
  11523. specification).
  11524. </p>
  11525. <p>This is required by some streaming formats, typically the MPEG-2
  11526. transport stream format (muxer <code>mpegts</code>).
  11527. </p>
  11528. <p>For example to remux an MP4 file containing an HEVC stream to mpegts
  11529. format with <code>ffmpeg</code>, you can use the command:
  11530. </p>
  11531. <div class="example">
  11532. <pre class="example">ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
  11533. </pre></div>
  11534. <p>Please note that this filter is auto-inserted for MPEG-TS (muxer
  11535. <code>mpegts</code>) and raw HEVC/H.265 (muxer <code>h265</code> or
  11536. <code>hevc</code>) output formats.
  11537. </p>
  11538. <a name="imxdump"></a>
  11539. <h2 class="section"><a href="ffmpeg-all.html#toc-imxdump">18.15 imxdump</a></h2>
  11540. <p>Modifies the bitstream to fit in MOV and to be usable by the Final Cut
  11541. Pro decoder. This filter only applies to the mpeg2video codec, and is
  11542. likely not needed for Final Cut Pro 7 and newer with the appropriate
  11543. &lsquo;<samp>-tag:v</samp>&rsquo;.
  11544. </p>
  11545. <p>For example, to remux 30 MB/sec NTSC IMX to MOV:
  11546. </p>
  11547. <div class="example">
  11548. <pre class="example">ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
  11549. </pre></div>
  11550. <a name="mjpeg2jpeg"></a>
  11551. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpeg2jpeg">18.16 mjpeg2jpeg</a></h2>
  11552. <p>Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
  11553. </p>
  11554. <p>MJPEG is a video codec wherein each video frame is essentially a
  11555. JPEG image. The individual frames can be extracted without loss,
  11556. e.g. by
  11557. </p>
  11558. <div class="example">
  11559. <pre class="example">ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
  11560. </pre></div>
  11561. <p>Unfortunately, these chunks are incomplete JPEG images, because
  11562. they lack the DHT segment required for decoding. Quoting from
  11563. <a href="http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml">http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml</a>:
  11564. </p>
  11565. <p>Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
  11566. commented that &quot;MJPEG, or at least the MJPEG in AVIs having the
  11567. MJPG fourcc, is restricted JPEG with a fixed &ndash; and *omitted* &ndash;
  11568. Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2,
  11569. and it must use basic Huffman encoding, not arithmetic or
  11570. progressive. . . . You can indeed extract the MJPEG frames and
  11571. decode them with a regular JPEG decoder, but you have to prepend
  11572. the DHT segment to them, or else the decoder won&rsquo;t have any idea
  11573. how to decompress the data. The exact table necessary is given in
  11574. the OpenDML spec.&quot;
  11575. </p>
  11576. <p>This bitstream filter patches the header of frames extracted from an MJPEG
  11577. stream (carrying the AVI1 header ID and lacking a DHT segment) to
  11578. produce fully qualified JPEG images.
  11579. </p>
  11580. <div class="example">
  11581. <pre class="example">ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
  11582. exiftran -i -9 frame*.jpg
  11583. ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
  11584. </pre></div>
  11585. <a name="mjpegadump"></a>
  11586. <h2 class="section"><a href="ffmpeg-all.html#toc-mjpegadump">18.17 mjpegadump</a></h2>
  11587. <p>Add an MJPEG A header to the bitstream, to enable decoding by
  11588. Quicktime.
  11589. </p>
  11590. <p><a name="mov2textsub"></a>
  11591. </p><a name="mov2textsub-1"></a>
  11592. <h2 class="section"><a href="ffmpeg-all.html#toc-mov2textsub-1">18.18 mov2textsub</a></h2>
  11593. <p>Extract a representable text file from MOV subtitles, stripping the
  11594. metadata header from each subtitle packet.
  11595. </p>
  11596. <p>See also the <a href="#text2movsub">text2movsub</a> filter.
  11597. </p>
  11598. <a name="mp3decomp"></a>
  11599. <h2 class="section"><a href="ffmpeg-all.html#toc-mp3decomp">18.19 mp3decomp</a></h2>
  11600. <p>Decompress non-standard compressed MP3 audio headers.
  11601. </p>
  11602. <a name="mpeg2_005fmetadata"></a>
  11603. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg2_005fmetadata">18.20 mpeg2_metadata</a></h2>
  11604. <p>Modify metadata embedded in an MPEG-2 stream.
  11605. </p>
  11606. <dl compact="compact">
  11607. <dt>&lsquo;<samp>display_aspect_ratio</samp>&rsquo;</dt>
  11608. <dd><p>Set the display aspect ratio in the stream.
  11609. </p>
  11610. <p>The following fixed values are supported:
  11611. </p><dl compact="compact">
  11612. <dt>&lsquo;<samp>4/3</samp>&rsquo;</dt>
  11613. <dt>&lsquo;<samp>16/9</samp>&rsquo;</dt>
  11614. <dt>&lsquo;<samp>221/100</samp>&rsquo;</dt>
  11615. </dl>
  11616. <p>Any other value will result in square pixels being signalled instead
  11617. (see H.262 section 6.3.3 and table 6-3).
  11618. </p>
  11619. </dd>
  11620. <dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
  11621. <dd><p>Set the frame rate in the stream. This is constructed from a table
  11622. of known values combined with a small multiplier and divisor - if
  11623. the supplied value is not exactly representable, the nearest
  11624. representable value will be used instead (see H.262 section 6.3.3
  11625. and table 6-4).
  11626. </p>
  11627. </dd>
  11628. <dt>&lsquo;<samp>video_format</samp>&rsquo;</dt>
  11629. <dd><p>Set the video format in the stream (see H.262 section 6.3.6 and
  11630. table 6-6).
  11631. </p>
  11632. </dd>
  11633. <dt>&lsquo;<samp>colour_primaries</samp>&rsquo;</dt>
  11634. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11635. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11636. <dd><p>Set the colour description in the stream (see H.262 section 6.3.6
  11637. and tables 6-7, 6-8 and 6-9).
  11638. </p>
  11639. </dd>
  11640. </dl>
  11641. <a name="mpeg4_005funpack_005fbframes"></a>
  11642. <h2 class="section"><a href="ffmpeg-all.html#toc-mpeg4_005funpack_005fbframes">18.21 mpeg4_unpack_bframes</a></h2>
  11643. <p>Unpack DivX-style packed B-frames.
  11644. </p>
  11645. <p>DivX-style packed B-frames are not valid MPEG-4 and were only a
  11646. workaround for the broken Video for Windows subsystem.
  11647. They use more space, can cause minor AV sync issues, require more
  11648. CPU power to decode (unless the player has some decoded picture queue
  11649. to compensate the 2,0,2,0 frame per packet style) and cause
  11650. trouble if copied into a standard container like mp4 or mpeg-ps/ts,
  11651. because MPEG-4 decoders may not be able to decode them, since they are
  11652. not valid MPEG-4.
  11653. </p>
  11654. <p>For example to fix an AVI file containing an MPEG-4 stream with
  11655. DivX-style packed B-frames using <code>ffmpeg</code>, you can use the command:
  11656. </p>
  11657. <div class="example">
  11658. <pre class="example">ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
  11659. </pre></div>
  11660. <a name="noise"></a>
  11661. <h2 class="section"><a href="ffmpeg-all.html#toc-noise">18.22 noise</a></h2>
  11662. <p>Damages the contents of packets or simply drops them without damaging the
  11663. container. Can be used for fuzzing or testing error resilience/concealment.
  11664. </p>
  11665. <p>Parameters:
  11666. </p><dl compact="compact">
  11667. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  11668. <dd><p>A numeral string, whose value is related to how often output bytes will
  11669. be modified. Therefore, values below or equal to 0 are forbidden, and
  11670. the lower the more frequent bytes will be modified, with 1 meaning
  11671. every byte is modified.
  11672. </p></dd>
  11673. <dt>&lsquo;<samp>dropamount</samp>&rsquo;</dt>
  11674. <dd><p>A numeral string, whose value is related to how often packets will be dropped.
  11675. Therefore, values below or equal to 0 are forbidden, and the lower the more
  11676. frequent packets will be dropped, with 1 meaning every packet is dropped.
  11677. </p></dd>
  11678. </dl>
  11679. <p>The following example applies the modification to every byte but does not drop
  11680. any packets.
  11681. </p><div class="example">
  11682. <pre class="example">ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv
  11683. </pre></div>
  11684. <a name="null-2"></a>
  11685. <h2 class="section"><a href="ffmpeg-all.html#toc-null-2">18.23 null</a></h2>
  11686. <p>This bitstream filter passes the packets through unchanged.
  11687. </p>
  11688. <a name="prores_005fmetadata"></a>
  11689. <h2 class="section"><a href="ffmpeg-all.html#toc-prores_005fmetadata">18.24 prores_metadata</a></h2>
  11690. <p>Modify color property metadata embedded in prores stream.
  11691. </p>
  11692. <dl compact="compact">
  11693. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  11694. <dd><p>Set the color primaries.
  11695. Available values are:
  11696. </p>
  11697. <dl compact="compact">
  11698. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11699. <dd><p>Keep the same color primaries property (default).
  11700. </p>
  11701. </dd>
  11702. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11703. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11704. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  11705. <dd><p>BT601 625
  11706. </p>
  11707. </dd>
  11708. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  11709. <dd><p>BT601 525
  11710. </p>
  11711. </dd>
  11712. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  11713. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  11714. <dd><p>DCI P3
  11715. </p>
  11716. </dd>
  11717. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  11718. <dd><p>P3 D65
  11719. </p>
  11720. </dd>
  11721. </dl>
  11722. </dd>
  11723. <dt>&lsquo;<samp>transfer_characteristics</samp>&rsquo;</dt>
  11724. <dd><p>Set the color transfer.
  11725. Available values are:
  11726. </p>
  11727. <dl compact="compact">
  11728. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11729. <dd><p>Keep the same transfer characteristics property (default).
  11730. </p>
  11731. </dd>
  11732. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11733. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11734. <dd><p>BT 601, BT 709, BT 2020
  11735. </p></dd>
  11736. </dl>
  11737. </dd>
  11738. <dt>&lsquo;<samp>matrix_coefficients</samp>&rsquo;</dt>
  11739. <dd><p>Set the matrix coefficient.
  11740. Available values are:
  11741. </p>
  11742. <dl compact="compact">
  11743. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  11744. <dd><p>Keep the same colorspace property (default).
  11745. </p>
  11746. </dd>
  11747. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11748. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11749. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  11750. <dd><p>BT 601
  11751. </p>
  11752. </dd>
  11753. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  11754. </dl>
  11755. </dd>
  11756. </dl>
  11757. <p>Set Rec709 colorspace for each frame of the file
  11758. </p><div class="example">
  11759. <pre class="example">ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
  11760. </pre></div>
  11761. <a name="remove_005fextra"></a>
  11762. <h2 class="section"><a href="ffmpeg-all.html#toc-remove_005fextra">18.25 remove_extra</a></h2>
  11763. <p>Remove extradata from packets.
  11764. </p>
  11765. <p>It accepts the following parameter:
  11766. </p><dl compact="compact">
  11767. <dt>&lsquo;<samp>freq</samp>&rsquo;</dt>
  11768. <dd><p>Set which frame types to remove extradata from.
  11769. </p>
  11770. <dl compact="compact">
  11771. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  11772. <dd><p>Remove extradata from non-keyframes only.
  11773. </p>
  11774. </dd>
  11775. <dt>&lsquo;<samp>keyframe</samp>&rsquo;</dt>
  11776. <dd><p>Remove extradata from keyframes only.
  11777. </p>
  11778. </dd>
  11779. <dt>&lsquo;<samp>e, all</samp>&rsquo;</dt>
  11780. <dd><p>Remove extradata from all frames.
  11781. </p>
  11782. </dd>
  11783. </dl>
  11784. </dd>
  11785. </dl>
  11786. <p><a name="text2movsub"></a>
  11787. </p><a name="text2movsub-1"></a>
  11788. <h2 class="section"><a href="ffmpeg-all.html#toc-text2movsub-1">18.26 text2movsub</a></h2>
  11789. <p>Convert text subtitles to MOV subtitles (as used by the <code>mov_text</code>
  11790. codec) with metadata headers.
  11791. </p>
  11792. <p>See also the <a href="#mov2textsub">mov2textsub</a> filter.
  11793. </p>
  11794. <a name="trace_005fheaders"></a>
  11795. <h2 class="section"><a href="ffmpeg-all.html#toc-trace_005fheaders">18.27 trace_headers</a></h2>
  11796. <p>Log trace output containing all syntax elements in the coded stream
  11797. headers (everything above the level of individual coded blocks).
  11798. This can be useful for debugging low-level stream issues.
  11799. </p>
  11800. <p>Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending
  11801. on the build only a subset of these may be available.
  11802. </p>
  11803. <a name="truehd_005fcore"></a>
  11804. <h2 class="section"><a href="ffmpeg-all.html#toc-truehd_005fcore">18.28 truehd_core</a></h2>
  11805. <p>Extract the core from a TrueHD stream, dropping ATMOS data.
  11806. </p>
  11807. <a name="vp9_005fmetadata"></a>
  11808. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fmetadata">18.29 vp9_metadata</a></h2>
  11809. <p>Modify metadata embedded in a VP9 stream.
  11810. </p>
  11811. <dl compact="compact">
  11812. <dt>&lsquo;<samp>color_space</samp>&rsquo;</dt>
  11813. <dd><p>Set the color space value in the frame header. Note that any frame
  11814. set to RGB will be implicitly set to PC range and that RGB is
  11815. incompatible with profiles 0 and 2.
  11816. </p><dl compact="compact">
  11817. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  11818. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  11819. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  11820. <dt>&lsquo;<samp>smpte170</samp>&rsquo;</dt>
  11821. <dt>&lsquo;<samp>smpte240</samp>&rsquo;</dt>
  11822. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  11823. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  11824. </dl>
  11825. </dd>
  11826. <dt>&lsquo;<samp>color_range</samp>&rsquo;</dt>
  11827. <dd><p>Set the color range value in the frame header. Note that any value
  11828. imposed by the color space will take precedence over this value.
  11829. </p><dl compact="compact">
  11830. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  11831. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  11832. </dl>
  11833. </dd>
  11834. </dl>
  11835. <a name="vp9_005fsuperframe"></a>
  11836. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fsuperframe">18.30 vp9_superframe</a></h2>
  11837. <p>Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
  11838. fixes merging of split/segmented VP9 streams where the alt-ref frame
  11839. was split from its visible counterpart.
  11840. </p>
  11841. <a name="vp9_005fsuperframe_005fsplit"></a>
  11842. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fsuperframe_005fsplit">18.31 vp9_superframe_split</a></h2>
  11843. <p>Split VP9 superframes into single frames.
  11844. </p>
  11845. <a name="vp9_005fraw_005freorder"></a>
  11846. <h2 class="section"><a href="ffmpeg-all.html#toc-vp9_005fraw_005freorder">18.32 vp9_raw_reorder</a></h2>
  11847. <p>Given a VP9 stream with correct timestamps but possibly out of order,
  11848. insert additional show-existing-frame packets to correct the ordering.
  11849. </p>
  11850. <a name="Format-Options"></a>
  11851. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Format-Options">19 Format Options</a></h1>
  11852. <p>The libavformat library provides some generic global options, which
  11853. can be set on all the muxers and demuxers. In addition each muxer or
  11854. demuxer may support so-called private options, which are specific for
  11855. that component.
  11856. </p>
  11857. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  11858. FFmpeg tools, or by setting the value explicitly in the
  11859. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  11860. for programmatic use.
  11861. </p>
  11862. <p>The list of supported options follows:
  11863. </p>
  11864. <dl compact="compact">
  11865. <dt>&lsquo;<samp>avioflags <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  11866. <dd><p>Possible values:
  11867. </p><dl compact="compact">
  11868. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  11869. <dd><p>Reduce buffering.
  11870. </p></dd>
  11871. </dl>
  11872. </dd>
  11873. <dt>&lsquo;<samp>probesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11874. <dd><p>Set probing size in bytes, i.e. the size of the data to analyze to get
  11875. stream information. A higher value will enable detecting more
  11876. information in case it is dispersed into the stream, but will increase
  11877. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  11878. </p>
  11879. </dd>
  11880. <dt>&lsquo;<samp>max_probe_packets <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11881. <dd><p>Set the maximum number of buffered packets when probing a codec.
  11882. Default is 2500 packets.
  11883. </p>
  11884. </dd>
  11885. <dt>&lsquo;<samp>packetsize <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  11886. <dd><p>Set packet size.
  11887. </p>
  11888. </dd>
  11889. <dt>&lsquo;<samp>fflags <var>flags</var></samp>&rsquo;</dt>
  11890. <dd><p>Set format flags. Some are implemented for a limited number of formats.
  11891. </p>
  11892. <p>Possible values for input files:
  11893. </p><dl compact="compact">
  11894. <dt>&lsquo;<samp>discardcorrupt</samp>&rsquo;</dt>
  11895. <dd><p>Discard corrupted packets.
  11896. </p></dd>
  11897. <dt>&lsquo;<samp>fastseek</samp>&rsquo;</dt>
  11898. <dd><p>Enable fast, but inaccurate seeks for some formats.
  11899. </p></dd>
  11900. <dt>&lsquo;<samp>genpts</samp>&rsquo;</dt>
  11901. <dd><p>Generate missing PTS if DTS is present.
  11902. </p></dd>
  11903. <dt>&lsquo;<samp>igndts</samp>&rsquo;</dt>
  11904. <dd><p>Ignore DTS if PTS is set. Inert when nofillin is set.
  11905. </p></dd>
  11906. <dt>&lsquo;<samp>ignidx</samp>&rsquo;</dt>
  11907. <dd><p>Ignore index.
  11908. </p></dd>
  11909. <dt>&lsquo;<samp>keepside (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  11910. <dt>&lsquo;<samp>nobuffer</samp>&rsquo;</dt>
  11911. <dd><p>Reduce the latency introduced by buffering during initial input streams analysis.
  11912. </p></dd>
  11913. <dt>&lsquo;<samp>nofillin</samp>&rsquo;</dt>
  11914. <dd><p>Do not fill in missing values in packet fields that can be exactly calculated.
  11915. </p></dd>
  11916. <dt>&lsquo;<samp>noparse</samp>&rsquo;</dt>
  11917. <dd><p>Disable AVParsers, this needs <code>+nofillin</code> too.
  11918. </p></dd>
  11919. <dt>&lsquo;<samp>sortdts</samp>&rsquo;</dt>
  11920. <dd><p>Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  11921. </p></dd>
  11922. </dl>
  11923. <p>Possible values for output files:
  11924. </p><dl compact="compact">
  11925. <dt>&lsquo;<samp>autobsf</samp>&rsquo;</dt>
  11926. <dd><p>Automatically apply bitstream filters as required by the output format. Enabled by default.
  11927. </p></dd>
  11928. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  11929. <dd><p>Only write platform-, build- and time-independent data.
  11930. This ensures that file and data checksums are reproducible and match between
  11931. platforms. Its primary use is for regression testing.
  11932. </p></dd>
  11933. <dt>&lsquo;<samp>flush_packets</samp>&rsquo;</dt>
  11934. <dd><p>Write out packets immediately.
  11935. </p></dd>
  11936. <dt>&lsquo;<samp>latm (<em>deprecated</em>,<em>inert</em>)</samp>&rsquo;</dt>
  11937. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  11938. <dd><p>Stop muxing at the end of the shortest stream.
  11939. It may be needed to increase max_interleave_delta to avoid flushing the longer
  11940. streams before EOF.
  11941. </p></dd>
  11942. </dl>
  11943. </dd>
  11944. <dt>&lsquo;<samp>seek2any <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11945. <dd><p>Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  11946. Default is 0.
  11947. </p>
  11948. </dd>
  11949. <dt>&lsquo;<samp>analyzeduration <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11950. <dd><p>Specify how many microseconds are analyzed to probe the input. A
  11951. higher value will enable detecting more accurate information, but will
  11952. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  11953. </p>
  11954. </dd>
  11955. <dt>&lsquo;<samp>cryptokey <var>hexadecimal string</var> (<em>input</em>)</samp>&rsquo;</dt>
  11956. <dd><p>Set decryption key.
  11957. </p>
  11958. </dd>
  11959. <dt>&lsquo;<samp>indexmem <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11960. <dd><p>Set max memory used for timestamp index (per stream).
  11961. </p>
  11962. </dd>
  11963. <dt>&lsquo;<samp>rtbufsize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11964. <dd><p>Set max memory used for buffering real-time frames.
  11965. </p>
  11966. </dd>
  11967. <dt>&lsquo;<samp>fdebug <var>flags</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  11968. <dd><p>Print specific debug info.
  11969. </p>
  11970. <p>Possible values:
  11971. </p><dl compact="compact">
  11972. <dt>&lsquo;<samp>ts</samp>&rsquo;</dt>
  11973. </dl>
  11974. </dd>
  11975. <dt>&lsquo;<samp>max_delay <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  11976. <dd><p>Set maximum muxing or demuxing delay in microseconds.
  11977. </p>
  11978. </dd>
  11979. <dt>&lsquo;<samp>fpsprobesize <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  11980. <dd><p>Set number of frames used to probe fps.
  11981. </p>
  11982. </dd>
  11983. <dt>&lsquo;<samp>audio_preload <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  11984. <dd><p>Set microseconds by which audio packets should be interleaved earlier.
  11985. </p>
  11986. </dd>
  11987. <dt>&lsquo;<samp>chunk_duration <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  11988. <dd><p>Set microseconds for each chunk.
  11989. </p>
  11990. </dd>
  11991. <dt>&lsquo;<samp>chunk_size <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  11992. <dd><p>Set size in bytes for each chunk.
  11993. </p>
  11994. </dd>
  11995. <dt>&lsquo;<samp>err_detect, f_err_detect <var>flags</var> (<em>input</em>)</samp>&rsquo;</dt>
  11996. <dd><p>Set error detection flags. <code>f_err_detect</code> is deprecated and
  11997. should be used only via the <code>ffmpeg</code> tool.
  11998. </p>
  11999. <p>Possible values:
  12000. </p><dl compact="compact">
  12001. <dt>&lsquo;<samp>crccheck</samp>&rsquo;</dt>
  12002. <dd><p>Verify embedded CRCs.
  12003. </p></dd>
  12004. <dt>&lsquo;<samp>bitstream</samp>&rsquo;</dt>
  12005. <dd><p>Detect bitstream specification deviations.
  12006. </p></dd>
  12007. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  12008. <dd><p>Detect improper bitstream length.
  12009. </p></dd>
  12010. <dt>&lsquo;<samp>explode</samp>&rsquo;</dt>
  12011. <dd><p>Abort decoding on minor error detection.
  12012. </p></dd>
  12013. <dt>&lsquo;<samp>careful</samp>&rsquo;</dt>
  12014. <dd><p>Consider things that violate the spec and have not been seen in the
  12015. wild as errors.
  12016. </p></dd>
  12017. <dt>&lsquo;<samp>compliant</samp>&rsquo;</dt>
  12018. <dd><p>Consider all spec non compliancies as errors.
  12019. </p></dd>
  12020. <dt>&lsquo;<samp>aggressive</samp>&rsquo;</dt>
  12021. <dd><p>Consider things that a sane encoder should not do as an error.
  12022. </p></dd>
  12023. </dl>
  12024. </dd>
  12025. <dt>&lsquo;<samp>max_interleave_delta <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12026. <dd><p>Set maximum buffering duration for interleaving. The duration is
  12027. expressed in microseconds, and defaults to 10000000 (10 seconds).
  12028. </p>
  12029. <p>To ensure all the streams are interleaved correctly, libavformat will
  12030. wait until it has at least one packet for each stream before actually
  12031. writing any packets to the output file. When some streams are
  12032. &quot;sparse&quot; (i.e. there are large gaps between successive packets), this
  12033. can result in excessive buffering.
  12034. </p>
  12035. <p>This field specifies the maximum difference between the timestamps of the
  12036. first and the last packet in the muxing queue, above which libavformat
  12037. will output a packet regardless of whether it has queued a packet for all
  12038. the streams.
  12039. </p>
  12040. <p>If set to 0, libavformat will continue buffering packets until it has
  12041. a packet for each stream, regardless of the maximum timestamp
  12042. difference between the buffered packets.
  12043. </p>
  12044. </dd>
  12045. <dt>&lsquo;<samp>use_wallclock_as_timestamps <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12046. <dd><p>Use wallclock as timestamps if set to 1. Default is 0.
  12047. </p>
  12048. </dd>
  12049. <dt>&lsquo;<samp>avoid_negative_ts <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12050. <dd>
  12051. <p>Possible values:
  12052. </p><dl compact="compact">
  12053. <dt>&lsquo;<samp>make_non_negative</samp>&rsquo;</dt>
  12054. <dd><p>Shift timestamps to make them non-negative.
  12055. Also note that this affects only leading negative timestamps, and not
  12056. non-monotonic negative timestamps.
  12057. </p></dd>
  12058. <dt>&lsquo;<samp>make_zero</samp>&rsquo;</dt>
  12059. <dd><p>Shift timestamps so that the first timestamp is 0.
  12060. </p></dd>
  12061. <dt>&lsquo;<samp>auto (default)</samp>&rsquo;</dt>
  12062. <dd><p>Enables shifting when required by the target format.
  12063. </p></dd>
  12064. <dt>&lsquo;<samp>disabled</samp>&rsquo;</dt>
  12065. <dd><p>Disables shifting of timestamp.
  12066. </p></dd>
  12067. </dl>
  12068. <p>When shifting is enabled, all output timestamps are shifted by the
  12069. same amount. Audio, video, and subtitles desynching and relative
  12070. timestamp differences are preserved compared to how they would have
  12071. been without shifting.
  12072. </p>
  12073. </dd>
  12074. <dt>&lsquo;<samp>skip_initial_bytes <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12075. <dd><p>Set number of bytes to skip before reading header and frames if set to 1.
  12076. Default is 0.
  12077. </p>
  12078. </dd>
  12079. <dt>&lsquo;<samp>correct_ts_overflow <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12080. <dd><p>Correct single timestamp overflows if set to 1. Default is 1.
  12081. </p>
  12082. </dd>
  12083. <dt>&lsquo;<samp>flush_packets <var>integer</var> (<em>output</em>)</samp>&rsquo;</dt>
  12084. <dd><p>Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  12085. means that the underlying protocol will decide, 1 enables it, and has the
  12086. effect of reducing the latency, 0 disables it and may increase IO throughput in
  12087. some cases.
  12088. </p>
  12089. </dd>
  12090. <dt>&lsquo;<samp>output_ts_offset <var>offset</var> (<em>output</em>)</samp>&rsquo;</dt>
  12091. <dd><p>Set the output time offset.
  12092. </p>
  12093. <p><var>offset</var> must be a time duration specification,
  12094. see <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  12095. </p>
  12096. <p>The offset is added by the muxer to the output timestamps.
  12097. </p>
  12098. <p>Specifying a positive offset means that the corresponding streams are
  12099. delayed bt the time duration specified in <var>offset</var>. Default value
  12100. is <code>0</code> (meaning that no offset is applied).
  12101. </p>
  12102. </dd>
  12103. <dt>&lsquo;<samp>format_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  12104. <dd><p>&quot;,&quot; separated list of allowed demuxers. By default all are allowed.
  12105. </p>
  12106. </dd>
  12107. <dt>&lsquo;<samp>dump_separator <var>string</var> (<em>input</em>)</samp>&rsquo;</dt>
  12108. <dd><p>Separator used to separate the fields printed on the command line about the
  12109. Stream parameters.
  12110. For example, to separate the fields with newlines and indentation:
  12111. </p><div class="example">
  12112. <pre class="example">ffprobe -dump_separator &quot;
  12113. &quot; -i ~/videos/matrixbench_mpeg2.mpg
  12114. </pre></div>
  12115. </dd>
  12116. <dt>&lsquo;<samp>max_streams <var>integer</var> (<em>input</em>)</samp>&rsquo;</dt>
  12117. <dd><p>Specifies the maximum number of streams. This can be used to reject files that
  12118. would require too many resources due to a large number of streams.
  12119. </p>
  12120. </dd>
  12121. <dt>&lsquo;<samp>skip_estimate_duration_from_pts <var>bool</var> (<em>input</em>)</samp>&rsquo;</dt>
  12122. <dd><p>Skip estimation of input duration when calculated using PTS.
  12123. At present, applicable for MPEG-PS and MPEG-TS.
  12124. </p>
  12125. </dd>
  12126. <dt>&lsquo;<samp>strict, f_strict <var>integer</var> (<em>input/output</em>)</samp>&rsquo;</dt>
  12127. <dd><p>Specify how strictly to follow the standards. <code>f_strict</code> is deprecated and
  12128. should be used only via the <code>ffmpeg</code> tool.
  12129. </p>
  12130. <p>Possible values:
  12131. </p><dl compact="compact">
  12132. <dt>&lsquo;<samp>very</samp>&rsquo;</dt>
  12133. <dd><p>strictly conform to an older more strict version of the spec or reference software
  12134. </p></dd>
  12135. <dt>&lsquo;<samp>strict</samp>&rsquo;</dt>
  12136. <dd><p>strictly conform to all the things in the spec no matter what consequences
  12137. </p></dd>
  12138. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  12139. <dt>&lsquo;<samp>unofficial</samp>&rsquo;</dt>
  12140. <dd><p>allow unofficial extensions
  12141. </p></dd>
  12142. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  12143. <dd><p>allow non standardized experimental things, experimental
  12144. (unfinished/work in progress/not well tested) decoders and encoders.
  12145. Note: experimental decoders can pose a security risk, do not use this for
  12146. decoding untrusted input.
  12147. </p></dd>
  12148. </dl>
  12149. </dd>
  12150. </dl>
  12151. <p><a name="Format-stream-specifiers"></a>
  12152. </p><a name="Format-stream-specifiers-1"></a>
  12153. <h2 class="section"><a href="ffmpeg-all.html#toc-Format-stream-specifiers-1">19.1 Format stream specifiers</a></h2>
  12154. <p>Format stream specifiers allow selection of one or more streams that
  12155. match specific properties.
  12156. </p>
  12157. <p>The exact semantics of stream specifiers is defined by the
  12158. <code>avformat_match_stream_specifier()</code> function declared in the
  12159. &lsquo;<tt>libavformat/avformat.h</tt>&rsquo; header and documented in the
  12160. <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)Stream specifiers section in the ffmpeg(1) manual</a>.
  12161. </p>
  12162. <a name="Demuxers"></a>
  12163. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Demuxers">20 Demuxers</a></h1>
  12164. <p>Demuxers are configured elements in FFmpeg that can read the
  12165. multimedia streams from a particular type of file.
  12166. </p>
  12167. <p>When you configure your FFmpeg build, all the supported demuxers
  12168. are enabled by default. You can list all available ones using the
  12169. configure option <code>--list-demuxers</code>.
  12170. </p>
  12171. <p>You can disable all the demuxers using the configure option
  12172. <code>--disable-demuxers</code>, and selectively enable a single demuxer with
  12173. the option <code>--enable-demuxer=<var>DEMUXER</var></code>, or disable it
  12174. with the option <code>--disable-demuxer=<var>DEMUXER</var></code>.
  12175. </p>
  12176. <p>The option <code>-demuxers</code> of the ff* tools will display the list of
  12177. enabled demuxers. Use <code>-formats</code> to view a combined list of
  12178. enabled demuxers and muxers.
  12179. </p>
  12180. <p>The description of some of the currently available demuxers follows.
  12181. </p>
  12182. <a name="aa"></a>
  12183. <h2 class="section"><a href="ffmpeg-all.html#toc-aa">20.1 aa</a></h2>
  12184. <p>Audible Format 2, 3, and 4 demuxer.
  12185. </p>
  12186. <p>This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
  12187. </p>
  12188. <a name="apng"></a>
  12189. <h2 class="section"><a href="ffmpeg-all.html#toc-apng">20.2 apng</a></h2>
  12190. <p>Animated Portable Network Graphics demuxer.
  12191. </p>
  12192. <p>This demuxer is used to demux APNG files.
  12193. All headers, but the PNG signature, up to (but not including) the first
  12194. fcTL chunk are transmitted as extradata.
  12195. Frames are then split as being all the chunks between two fcTL ones, or
  12196. between the last fcTL and IEND chunks.
  12197. </p>
  12198. <dl compact="compact">
  12199. <dt>&lsquo;<samp>-ignore_loop <var>bool</var></samp>&rsquo;</dt>
  12200. <dd><p>Ignore the loop variable in the file if set.
  12201. </p></dd>
  12202. <dt>&lsquo;<samp>-max_fps <var>int</var></samp>&rsquo;</dt>
  12203. <dd><p>Maximum framerate in frames per second (0 for no limit).
  12204. </p></dd>
  12205. <dt>&lsquo;<samp>-default_fps <var>int</var></samp>&rsquo;</dt>
  12206. <dd><p>Default framerate in frames per second when none is specified in the file
  12207. (0 meaning as fast as possible).
  12208. </p></dd>
  12209. </dl>
  12210. <a name="asf-2"></a>
  12211. <h2 class="section"><a href="ffmpeg-all.html#toc-asf-2">20.3 asf</a></h2>
  12212. <p>Advanced Systems Format demuxer.
  12213. </p>
  12214. <p>This demuxer is used to demux ASF files and MMS network streams.
  12215. </p>
  12216. <dl compact="compact">
  12217. <dt>&lsquo;<samp>-no_resync_search <var>bool</var></samp>&rsquo;</dt>
  12218. <dd><p>Do not try to resynchronize by looking for a certain optional start code.
  12219. </p></dd>
  12220. </dl>
  12221. <p><a name="concat"></a>
  12222. </p><a name="concat-1"></a>
  12223. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-1">20.4 concat</a></h2>
  12224. <p>Virtual concatenation script demuxer.
  12225. </p>
  12226. <p>This demuxer reads a list of files and other directives from a text file and
  12227. demuxes them one after the other, as if all their packets had been muxed
  12228. together.
  12229. </p>
  12230. <p>The timestamps in the files are adjusted so that the first file starts at 0
  12231. and each next file starts where the previous one finishes. Note that it is
  12232. done globally and may cause gaps if all streams do not have exactly the same
  12233. length.
  12234. </p>
  12235. <p>All files must have the same streams (same codecs, same time base, etc.).
  12236. </p>
  12237. <p>The duration of each file is used to adjust the timestamps of the next file:
  12238. if the duration is incorrect (because it was computed using the bit-rate or
  12239. because the file is truncated, for example), it can cause artifacts. The
  12240. <code>duration</code> directive can be used to override the duration stored in
  12241. each file.
  12242. </p>
  12243. <a name="Syntax-2"></a>
  12244. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax-2">20.4.1 Syntax</a></h3>
  12245. <p>The script is a text file in extended-ASCII, with one directive per line.
  12246. Empty lines, leading spaces and lines starting with &rsquo;#&rsquo; are ignored. The
  12247. following directive is recognized:
  12248. </p>
  12249. <dl compact="compact">
  12250. <dt>&lsquo;<samp><code>file <var>path</var></code></samp>&rsquo;</dt>
  12251. <dd><p>Path to a file to read; special characters and spaces must be escaped with
  12252. backslash or single quotes.
  12253. </p>
  12254. <p>All subsequent file-related directives apply to that file.
  12255. </p>
  12256. </dd>
  12257. <dt>&lsquo;<samp><code>ffconcat version 1.0</code></samp>&rsquo;</dt>
  12258. <dd><p>Identify the script type and version. It also sets the &lsquo;<samp>safe</samp>&rsquo; option
  12259. to 1 if it was -1.
  12260. </p>
  12261. <p>To make FFmpeg recognize the format automatically, this directive must
  12262. appear exactly as is (no extra space or byte-order-mark) on the very first
  12263. line of the script.
  12264. </p>
  12265. </dd>
  12266. <dt>&lsquo;<samp><code>duration <var>dur</var></code></samp>&rsquo;</dt>
  12267. <dd><p>Duration of the file. This information can be specified from the file;
  12268. specifying it here may be more efficient or help if the information from the
  12269. file is not available or accurate.
  12270. </p>
  12271. <p>If the duration is set for all files, then it is possible to seek in the
  12272. whole concatenated video.
  12273. </p>
  12274. </dd>
  12275. <dt>&lsquo;<samp><code>inpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  12276. <dd><p>In point of the file. When the demuxer opens the file it instantly seeks to the
  12277. specified timestamp. Seeking is done so that all streams can be presented
  12278. successfully at In point.
  12279. </p>
  12280. <p>This directive works best with intra frame codecs, because for non-intra frame
  12281. ones you will usually get extra packets before the actual In point and the
  12282. decoded content will most likely contain frames before In point too.
  12283. </p>
  12284. <p>For each file, packets before the file In point will have timestamps less than
  12285. the calculated start timestamp of the file (negative in case of the first
  12286. file), and the duration of the files (if not specified by the <code>duration</code>
  12287. directive) will be reduced based on their specified In point.
  12288. </p>
  12289. <p>Because of potential packets before the specified In point, packet timestamps
  12290. may overlap between two concatenated files.
  12291. </p>
  12292. </dd>
  12293. <dt>&lsquo;<samp><code>outpoint <var>timestamp</var></code></samp>&rsquo;</dt>
  12294. <dd><p>Out point of the file. When the demuxer reaches the specified decoding
  12295. timestamp in any of the streams, it handles it as an end of file condition and
  12296. skips the current and all the remaining packets from all streams.
  12297. </p>
  12298. <p>Out point is exclusive, which means that the demuxer will not output packets
  12299. with a decoding timestamp greater or equal to Out point.
  12300. </p>
  12301. <p>This directive works best with intra frame codecs and formats where all streams
  12302. are tightly interleaved. For non-intra frame codecs you will usually get
  12303. additional packets with presentation timestamp after Out point therefore the
  12304. decoded content will most likely contain frames after Out point too. If your
  12305. streams are not tightly interleaved you may not get all the packets from all
  12306. streams before Out point and you may only will be able to decode the earliest
  12307. stream until Out point.
  12308. </p>
  12309. <p>The duration of the files (if not specified by the <code>duration</code>
  12310. directive) will be reduced based on their specified Out point.
  12311. </p>
  12312. </dd>
  12313. <dt>&lsquo;<samp><code>file_packet_metadata <var>key=value</var></code></samp>&rsquo;</dt>
  12314. <dd><p>Metadata of the packets of the file. The specified metadata will be set for
  12315. each file packet. You can specify this directive multiple times to add multiple
  12316. metadata entries.
  12317. </p>
  12318. </dd>
  12319. <dt>&lsquo;<samp><code>stream</code></samp>&rsquo;</dt>
  12320. <dd><p>Introduce a stream in the virtual file.
  12321. All subsequent stream-related directives apply to the last introduced
  12322. stream.
  12323. Some streams properties must be set in order to allow identifying the
  12324. matching streams in the subfiles.
  12325. If no streams are defined in the script, the streams from the first file are
  12326. copied.
  12327. </p>
  12328. </dd>
  12329. <dt>&lsquo;<samp><code>exact_stream_id <var>id</var></code></samp>&rsquo;</dt>
  12330. <dd><p>Set the id of the stream.
  12331. If this directive is given, the string with the corresponding id in the
  12332. subfiles will be used.
  12333. This is especially useful for MPEG-PS (VOB) files, where the order of the
  12334. streams is not reliable.
  12335. </p>
  12336. </dd>
  12337. </dl>
  12338. <a name="Options-17"></a>
  12339. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-17">20.4.2 Options</a></h3>
  12340. <p>This demuxer accepts the following option:
  12341. </p>
  12342. <dl compact="compact">
  12343. <dt>&lsquo;<samp>safe</samp>&rsquo;</dt>
  12344. <dd><p>If set to 1, reject unsafe file paths. A file path is considered safe if it
  12345. does not contain a protocol specification and is relative and all components
  12346. only contain characters from the portable character set (letters, digits,
  12347. period, underscore and hyphen) and have no period at the beginning of a
  12348. component.
  12349. </p>
  12350. <p>If set to 0, any file name is accepted.
  12351. </p>
  12352. <p>The default is 1.
  12353. </p>
  12354. <p>-1 is equivalent to 1 if the format was automatically
  12355. probed and 0 otherwise.
  12356. </p>
  12357. </dd>
  12358. <dt>&lsquo;<samp>auto_convert</samp>&rsquo;</dt>
  12359. <dd><p>If set to 1, try to perform automatic conversions on packet data to make the
  12360. streams concatenable.
  12361. The default is 1.
  12362. </p>
  12363. <p>Currently, the only conversion is adding the h264_mp4toannexb bitstream
  12364. filter to H.264 streams in MP4 format. This is necessary in particular if
  12365. there are resolution changes.
  12366. </p>
  12367. </dd>
  12368. <dt>&lsquo;<samp>segment_time_metadata</samp>&rsquo;</dt>
  12369. <dd><p>If set to 1, every packet will contain the <var>lavf.concat.start_time</var> and the
  12370. <var>lavf.concat.duration</var> packet metadata values which are the start_time and
  12371. the duration of the respective file segments in the concatenated output
  12372. expressed in microseconds. The duration metadata is only set if it is known
  12373. based on the concat file.
  12374. The default is 0.
  12375. </p>
  12376. </dd>
  12377. </dl>
  12378. <a name="Examples-76"></a>
  12379. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-76">20.4.3 Examples</a></h3>
  12380. <ul>
  12381. <li>
  12382. Use absolute filenames and include some comments:
  12383. <div class="example">
  12384. <pre class="example"># my first filename
  12385. file /mnt/share/file-1.wav
  12386. # my second filename including whitespace
  12387. file '/mnt/share/file 2.wav'
  12388. # my third filename including whitespace plus single quote
  12389. file '/mnt/share/file 3'\''.wav'
  12390. </pre></div>
  12391. </li><li>
  12392. Allow for input format auto-probing, use safe filenames and set the duration of
  12393. the first file:
  12394. <div class="example">
  12395. <pre class="example">ffconcat version 1.0
  12396. file file-1.wav
  12397. duration 20.0
  12398. file subdir/file-2.wav
  12399. </pre></div>
  12400. </li></ul>
  12401. <a name="dash-1"></a>
  12402. <h2 class="section"><a href="ffmpeg-all.html#toc-dash-1">20.5 dash</a></h2>
  12403. <p>Dynamic Adaptive Streaming over HTTP demuxer.
  12404. </p>
  12405. <p>This demuxer presents all AVStreams found in the manifest.
  12406. By setting the discard flags on AVStreams the caller can decide
  12407. which streams to actually receive.
  12408. Each stream mirrors the <code>id</code> and <code>bandwidth</code> properties from the
  12409. <code>&lt;Representation&gt;</code> as metadata keys named &quot;id&quot; and &quot;variant_bitrate&quot; respectively.
  12410. </p>
  12411. <a name="flv_002c-live_005fflv"></a>
  12412. <h2 class="section"><a href="ffmpeg-all.html#toc-flv_002c-live_005fflv">20.6 flv, live_flv</a></h2>
  12413. <p>Adobe Flash Video Format demuxer.
  12414. </p>
  12415. <p>This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities.
  12416. </p>
  12417. <div class="example">
  12418. <pre class="example">ffmpeg -f flv -i myfile.flv ...
  12419. ffmpeg -f live_flv -i rtmp://&lt;any.server&gt;/anything/key ....
  12420. </pre></div>
  12421. <dl compact="compact">
  12422. <dt>&lsquo;<samp>-flv_metadata <var>bool</var></samp>&rsquo;</dt>
  12423. <dd><p>Allocate the streams according to the onMetaData array content.
  12424. </p>
  12425. </dd>
  12426. <dt>&lsquo;<samp>-flv_ignore_prevtag <var>bool</var></samp>&rsquo;</dt>
  12427. <dd><p>Ignore the size of previous tag value.
  12428. </p>
  12429. </dd>
  12430. <dt>&lsquo;<samp>-flv_full_metadata <var>bool</var></samp>&rsquo;</dt>
  12431. <dd><p>Output all context of the onMetadata.
  12432. </p></dd>
  12433. </dl>
  12434. <a name="gif-1"></a>
  12435. <h2 class="section"><a href="ffmpeg-all.html#toc-gif-1">20.7 gif</a></h2>
  12436. <p>Animated GIF demuxer.
  12437. </p>
  12438. <p>It accepts the following options:
  12439. </p>
  12440. <dl compact="compact">
  12441. <dt>&lsquo;<samp>min_delay</samp>&rsquo;</dt>
  12442. <dd><p>Set the minimum valid delay between frames in hundredths of seconds.
  12443. Range is 0 to 6000. Default value is 2.
  12444. </p>
  12445. </dd>
  12446. <dt>&lsquo;<samp>max_gif_delay</samp>&rsquo;</dt>
  12447. <dd><p>Set the maximum valid delay between frames in hundredth of seconds.
  12448. Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
  12449. the maximum value allowed by the specification.
  12450. </p>
  12451. </dd>
  12452. <dt>&lsquo;<samp>default_delay</samp>&rsquo;</dt>
  12453. <dd><p>Set the default delay between frames in hundredths of seconds.
  12454. Range is 0 to 6000. Default value is 10.
  12455. </p>
  12456. </dd>
  12457. <dt>&lsquo;<samp>ignore_loop</samp>&rsquo;</dt>
  12458. <dd><p>GIF files can contain information to loop a certain number of times (or
  12459. infinitely). If &lsquo;<samp>ignore_loop</samp>&rsquo; is set to 1, then the loop setting
  12460. from the input will be ignored and looping will not occur. If set to 0,
  12461. then looping will occur and will cycle the number of times according to
  12462. the GIF. Default value is 1.
  12463. </p></dd>
  12464. </dl>
  12465. <p>For example, with the overlay filter, place an infinitely looping GIF
  12466. over another video:
  12467. </p><div class="example">
  12468. <pre class="example">ffmpeg -i input.mp4 -ignore_loop 0 -i input.gif -filter_complex overlay=shortest=1 out.mkv
  12469. </pre></div>
  12470. <p>Note that in the above example the shortest option for overlay filter is
  12471. used to end the output video at the length of the shortest input file,
  12472. which in this case is &lsquo;<tt>input.mp4</tt>&rsquo; as the GIF in this example loops
  12473. infinitely.
  12474. </p>
  12475. <a name="hls-1"></a>
  12476. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-1">20.8 hls</a></h2>
  12477. <p>HLS demuxer
  12478. </p>
  12479. <p>Apple HTTP Live Streaming demuxer.
  12480. </p>
  12481. <p>This demuxer presents all AVStreams from all variant streams.
  12482. The id field is set to the bitrate variant index number. By setting
  12483. the discard flags on AVStreams (by pressing &rsquo;a&rsquo; or &rsquo;v&rsquo; in ffplay),
  12484. the caller can decide which variant streams to actually receive.
  12485. The total bitrate of the variant that the stream belongs to is
  12486. available in a metadata key named &quot;variant_bitrate&quot;.
  12487. </p>
  12488. <p>It accepts the following options:
  12489. </p>
  12490. <dl compact="compact">
  12491. <dt>&lsquo;<samp>live_start_index</samp>&rsquo;</dt>
  12492. <dd><p>segment index to start live streams at (negative values are from the end).
  12493. </p>
  12494. </dd>
  12495. <dt>&lsquo;<samp>allowed_extensions</samp>&rsquo;</dt>
  12496. <dd><p>&rsquo;,&rsquo; separated list of file extensions that hls is allowed to access.
  12497. </p>
  12498. </dd>
  12499. <dt>&lsquo;<samp>max_reload</samp>&rsquo;</dt>
  12500. <dd><p>Maximum number of times a insufficient list is attempted to be reloaded.
  12501. Default value is 1000.
  12502. </p>
  12503. </dd>
  12504. <dt>&lsquo;<samp>m3u8_hold_counters</samp>&rsquo;</dt>
  12505. <dd><p>The maximum number of times to load m3u8 when it refreshes without new segments.
  12506. Default value is 1000.
  12507. </p>
  12508. </dd>
  12509. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  12510. <dd><p>Use persistent HTTP connections. Applicable only for HTTP streams.
  12511. Enabled by default.
  12512. </p>
  12513. </dd>
  12514. <dt>&lsquo;<samp>http_multiple</samp>&rsquo;</dt>
  12515. <dd><p>Use multiple HTTP connections for downloading HTTP segments.
  12516. Enabled by default for HTTP/1.1 servers.
  12517. </p>
  12518. </dd>
  12519. <dt>&lsquo;<samp>http_seekable</samp>&rsquo;</dt>
  12520. <dd><p>Use HTTP partial requests for downloading HTTP segments.
  12521. 0 = disable, 1 = enable, -1 = auto, Default is auto.
  12522. </p></dd>
  12523. </dl>
  12524. <a name="image2-2"></a>
  12525. <h2 class="section"><a href="ffmpeg-all.html#toc-image2-2">20.9 image2</a></h2>
  12526. <p>Image file demuxer.
  12527. </p>
  12528. <p>This demuxer reads from a list of image files specified by a pattern.
  12529. The syntax and meaning of the pattern is specified by the
  12530. option <var>pattern_type</var>.
  12531. </p>
  12532. <p>The pattern may contain a suffix which is used to automatically
  12533. determine the format of the images contained in the files.
  12534. </p>
  12535. <p>The size, the pixel format, and the format of each image must be the
  12536. same for all the files in the sequence.
  12537. </p>
  12538. <p>This demuxer accepts the following options:
  12539. </p><dl compact="compact">
  12540. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  12541. <dd><p>Set the frame rate for the video stream. It defaults to 25.
  12542. </p></dd>
  12543. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  12544. <dd><p>If set to 1, loop over the input. Default value is 0.
  12545. </p></dd>
  12546. <dt>&lsquo;<samp>pattern_type</samp>&rsquo;</dt>
  12547. <dd><p>Select the pattern type used to interpret the provided filename.
  12548. </p>
  12549. <p><var>pattern_type</var> accepts one of the following values.
  12550. </p><dl compact="compact">
  12551. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  12552. <dd><p>Disable pattern matching, therefore the video will only contain the specified
  12553. image. You should use this option if you do not want to create sequences from
  12554. multiple images and your filenames may contain special pattern characters.
  12555. </p></dd>
  12556. <dt>&lsquo;<samp>sequence</samp>&rsquo;</dt>
  12557. <dd><p>Select a sequence pattern type, used to specify a sequence of files
  12558. indexed by sequential numbers.
  12559. </p>
  12560. <p>A sequence pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, which
  12561. specifies the position of the characters representing a sequential
  12562. number in each filename matched by the pattern. If the form
  12563. &quot;%d0<var>N</var>d&quot; is used, the string representing the number in each
  12564. filename is 0-padded and <var>N</var> is the total number of 0-padded
  12565. digits representing the number. The literal character &rsquo;%&rsquo; can be
  12566. specified in the pattern with the string &quot;%%&quot;.
  12567. </p>
  12568. <p>If the sequence pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  12569. the file list specified by the pattern must contain a number
  12570. inclusively contained between <var>start_number</var> and
  12571. <var>start_number</var>+<var>start_number_range</var>-1, and all the following
  12572. numbers must be sequential.
  12573. </p>
  12574. <p>For example the pattern &quot;img-%03d.bmp&quot; will match a sequence of
  12575. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  12576. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.; the pattern &quot;i%%m%%g-%d.jpg&quot; will match a
  12577. sequence of filenames of the form &lsquo;<tt>i%m%g-1.jpg</tt>&rsquo;,
  12578. &lsquo;<tt>i%m%g-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>i%m%g-10.jpg</tt>&rsquo;, etc.
  12579. </p>
  12580. <p>Note that the pattern must not necessarily contain &quot;%d&quot; or
  12581. &quot;%0<var>N</var>d&quot;, for example to convert a single image file
  12582. &lsquo;<tt>img.jpeg</tt>&rsquo; you can employ the command:
  12583. </p><div class="example">
  12584. <pre class="example">ffmpeg -i img.jpeg img.png
  12585. </pre></div>
  12586. </dd>
  12587. <dt>&lsquo;<samp>glob</samp>&rsquo;</dt>
  12588. <dd><p>Select a glob wildcard pattern type.
  12589. </p>
  12590. <p>The pattern is interpreted like a <code>glob()</code> pattern. This is only
  12591. selectable if libavformat was compiled with globbing support.
  12592. </p>
  12593. </dd>
  12594. <dt>&lsquo;<samp>glob_sequence <em>(deprecated, will be removed)</em></samp>&rsquo;</dt>
  12595. <dd><p>Select a mixed glob wildcard/sequence pattern.
  12596. </p>
  12597. <p>If your version of libavformat was compiled with globbing support, and
  12598. the provided pattern contains at least one glob meta character among
  12599. <code>%*?[]{}</code> that is preceded by an unescaped &quot;%&quot;, the pattern is
  12600. interpreted like a <code>glob()</code> pattern, otherwise it is interpreted
  12601. like a sequence pattern.
  12602. </p>
  12603. <p>All glob special characters <code>%*?[]{}</code> must be prefixed
  12604. with &quot;%&quot;. To escape a literal &quot;%&quot; you shall use &quot;%%&quot;.
  12605. </p>
  12606. <p>For example the pattern <code>foo-%*.jpeg</code> will match all the
  12607. filenames prefixed by &quot;foo-&quot; and terminating with &quot;.jpeg&quot;, and
  12608. <code>foo-%?%?%?.jpeg</code> will match all the filenames prefixed with
  12609. &quot;foo-&quot;, followed by a sequence of three characters, and terminating
  12610. with &quot;.jpeg&quot;.
  12611. </p>
  12612. <p>This pattern type is deprecated in favor of <var>glob</var> and
  12613. <var>sequence</var>.
  12614. </p></dd>
  12615. </dl>
  12616. <p>Default value is <var>glob_sequence</var>.
  12617. </p></dd>
  12618. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  12619. <dd><p>Set the pixel format of the images to read. If not specified the pixel
  12620. format is guessed from the first image file in the sequence.
  12621. </p></dd>
  12622. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  12623. <dd><p>Set the index of the file matched by the image file pattern to start
  12624. to read from. Default value is 0.
  12625. </p></dd>
  12626. <dt>&lsquo;<samp>start_number_range</samp>&rsquo;</dt>
  12627. <dd><p>Set the index interval range to check when looking for the first image
  12628. file in the sequence, starting from <var>start_number</var>. Default value
  12629. is 5.
  12630. </p></dd>
  12631. <dt>&lsquo;<samp>ts_from_file</samp>&rsquo;</dt>
  12632. <dd><p>If set to 1, will set frame timestamp to modification time of image file. Note
  12633. that monotonity of timestamps is not provided: images go in the same order as
  12634. without this option. Default value is 0.
  12635. If set to 2, will set frame timestamp to the modification time of the image file in
  12636. nanosecond precision.
  12637. </p></dd>
  12638. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  12639. <dd><p>Set the video size of the images to read. If not specified the video
  12640. size is guessed from the first image file in the sequence.
  12641. </p></dd>
  12642. <dt>&lsquo;<samp>export_path_metadata</samp>&rsquo;</dt>
  12643. <dd><p>If set to 1, will add two extra fields to the metadata found in input, making them
  12644. also available for other filters (see <var>drawtext</var> filter for examples). Default
  12645. value is 0. The extra fields are described below:
  12646. </p><dl compact="compact">
  12647. <dt>&lsquo;<samp>lavf.image2dec.source_path</samp>&rsquo;</dt>
  12648. <dd><p>Corresponds to the full path to the input file being read.
  12649. </p></dd>
  12650. <dt>&lsquo;<samp>lavf.image2dec.source_basename</samp>&rsquo;</dt>
  12651. <dd><p>Corresponds to the name of the file being read.
  12652. </p></dd>
  12653. </dl>
  12654. </dd>
  12655. </dl>
  12656. <a name="Examples-164"></a>
  12657. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-164">20.9.1 Examples</a></h3>
  12658. <ul>
  12659. <li>
  12660. Use <code>ffmpeg</code> for creating a video from the images in the file
  12661. sequence &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ..., assuming an
  12662. input frame rate of 10 frames per second:
  12663. <div class="example">
  12664. <pre class="example">ffmpeg -framerate 10 -i 'img-%03d.jpeg' out.mkv
  12665. </pre></div>
  12666. </li><li>
  12667. As above, but start by reading from a file with index 100 in the sequence:
  12668. <div class="example">
  12669. <pre class="example">ffmpeg -framerate 10 -start_number 100 -i 'img-%03d.jpeg' out.mkv
  12670. </pre></div>
  12671. </li><li>
  12672. Read images matching the &quot;*.png&quot; glob pattern , that is all the files
  12673. terminating with the &quot;.png&quot; suffix:
  12674. <div class="example">
  12675. <pre class="example">ffmpeg -framerate 10 -pattern_type glob -i &quot;*.png&quot; out.mkv
  12676. </pre></div>
  12677. </li></ul>
  12678. <a name="libgme"></a>
  12679. <h2 class="section"><a href="ffmpeg-all.html#toc-libgme">20.10 libgme</a></h2>
  12680. <p>The Game Music Emu library is a collection of video game music file emulators.
  12681. </p>
  12682. <p>See <a href="https://bitbucket.org/mpyne/game-music-emu/overview">https://bitbucket.org/mpyne/game-music-emu/overview</a> for more information.
  12683. </p>
  12684. <p>It accepts the following options:
  12685. </p>
  12686. <dl compact="compact">
  12687. <dt>&lsquo;<samp>track_index</samp>&rsquo;</dt>
  12688. <dd><p>Set the index of which track to demux. The demuxer can only export one track.
  12689. Track indexes start at 0. Default is to pick the first track. Number of tracks
  12690. is exported as <var>tracks</var> metadata entry.
  12691. </p>
  12692. </dd>
  12693. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  12694. <dd><p>Set the sampling rate of the exported track. Range is 1000 to 999999. Default is 44100.
  12695. </p>
  12696. </dd>
  12697. <dt>&lsquo;<samp>max_size <em>(bytes)</em></samp>&rsquo;</dt>
  12698. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  12699. which in turn, acts as a ceiling for the size of files that can be read.
  12700. Default is 50 MiB.
  12701. </p>
  12702. </dd>
  12703. </dl>
  12704. <a name="libmodplug"></a>
  12705. <h2 class="section"><a href="ffmpeg-all.html#toc-libmodplug">20.11 libmodplug</a></h2>
  12706. <p>ModPlug based module demuxer
  12707. </p>
  12708. <p>See <a href="https://github.com/Konstanty/libmodplug">https://github.com/Konstanty/libmodplug</a>
  12709. </p>
  12710. <p>It will export one 2-channel 16-bit 44.1 kHz audio stream.
  12711. Optionally, a <code>pal8</code> 16-color video stream can be exported with or without printed metadata.
  12712. </p>
  12713. <p>It accepts the following options:
  12714. </p>
  12715. <dl compact="compact">
  12716. <dt>&lsquo;<samp>noise_reduction</samp>&rsquo;</dt>
  12717. <dd><p>Apply a simple low-pass filter. Can be 1 (on) or 0 (off). Default is 0.
  12718. </p>
  12719. </dd>
  12720. <dt>&lsquo;<samp>reverb_depth</samp>&rsquo;</dt>
  12721. <dd><p>Set amount of reverb. Range 0-100. Default is 0.
  12722. </p>
  12723. </dd>
  12724. <dt>&lsquo;<samp>reverb_delay</samp>&rsquo;</dt>
  12725. <dd><p>Set delay in ms, clamped to 40-250 ms. Default is 0.
  12726. </p>
  12727. </dd>
  12728. <dt>&lsquo;<samp>bass_amount</samp>&rsquo;</dt>
  12729. <dd><p>Apply bass expansion a.k.a. XBass or megabass. Range is 0 (quiet) to 100 (loud). Default is 0.
  12730. </p>
  12731. </dd>
  12732. <dt>&lsquo;<samp>bass_range</samp>&rsquo;</dt>
  12733. <dd><p>Set cutoff i.e. upper-bound for bass frequencies. Range is 10-100 Hz. Default is 0.
  12734. </p>
  12735. </dd>
  12736. <dt>&lsquo;<samp>surround_depth</samp>&rsquo;</dt>
  12737. <dd><p>Apply a Dolby Pro-Logic surround effect. Range is 0 (quiet) to 100 (heavy). Default is 0.
  12738. </p>
  12739. </dd>
  12740. <dt>&lsquo;<samp>surround_delay</samp>&rsquo;</dt>
  12741. <dd><p>Set surround delay in ms, clamped to 5-40 ms. Default is 0.
  12742. </p>
  12743. </dd>
  12744. <dt>&lsquo;<samp>max_size</samp>&rsquo;</dt>
  12745. <dd><p>The demuxer buffers the entire file into memory. Adjust this value to set the maximum buffer size,
  12746. which in turn, acts as a ceiling for the size of files that can be read. Range is 0 to 100 MiB.
  12747. 0 removes buffer size limit (not recommended). Default is 5 MiB.
  12748. </p>
  12749. </dd>
  12750. <dt>&lsquo;<samp>video_stream_expr</samp>&rsquo;</dt>
  12751. <dd><p>String which is evaluated using the eval API to assign colors to the generated video stream.
  12752. Variables which can be used are <code>x</code>, <code>y</code>, <code>w</code>, <code>h</code>, <code>t</code>, <code>speed</code>,
  12753. <code>tempo</code>, <code>order</code>, <code>pattern</code> and <code>row</code>.
  12754. </p>
  12755. </dd>
  12756. <dt>&lsquo;<samp>video_stream</samp>&rsquo;</dt>
  12757. <dd><p>Generate video stream. Can be 1 (on) or 0 (off). Default is 0.
  12758. </p>
  12759. </dd>
  12760. <dt>&lsquo;<samp>video_stream_w</samp>&rsquo;</dt>
  12761. <dd><p>Set video frame width in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  12762. </p>
  12763. </dd>
  12764. <dt>&lsquo;<samp>video_stream_h</samp>&rsquo;</dt>
  12765. <dd><p>Set video frame height in &rsquo;chars&rsquo; where one char indicates 8 pixels. Range is 20-512. Default is 30.
  12766. </p>
  12767. </dd>
  12768. <dt>&lsquo;<samp>video_stream_ptxt</samp>&rsquo;</dt>
  12769. <dd><p>Print metadata on video stream. Includes <code>speed</code>, <code>tempo</code>, <code>order</code>, <code>pattern</code>,
  12770. <code>row</code> and <code>ts</code> (time in ms). Can be 1 (on) or 0 (off). Default is 1.
  12771. </p>
  12772. </dd>
  12773. </dl>
  12774. <a name="libopenmpt"></a>
  12775. <h2 class="section"><a href="ffmpeg-all.html#toc-libopenmpt">20.12 libopenmpt</a></h2>
  12776. <p>libopenmpt based module demuxer
  12777. </p>
  12778. <p>See <a href="https://lib.openmpt.org/libopenmpt/">https://lib.openmpt.org/libopenmpt/</a> for more information.
  12779. </p>
  12780. <p>Some files have multiple subsongs (tracks) this can be set with the &lsquo;<samp>subsong</samp>&rsquo;
  12781. option.
  12782. </p>
  12783. <p>It accepts the following options:
  12784. </p>
  12785. <dl compact="compact">
  12786. <dt>&lsquo;<samp>subsong</samp>&rsquo;</dt>
  12787. <dd><p>Set the subsong index. This can be either &rsquo;all&rsquo;, &rsquo;auto&rsquo;, or the index of the
  12788. subsong. Subsong indexes start at 0. The default is &rsquo;auto&rsquo;.
  12789. </p>
  12790. <p>The default value is to let libopenmpt choose.
  12791. </p>
  12792. </dd>
  12793. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  12794. <dd><p>Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
  12795. The default value is STEREO.
  12796. </p>
  12797. </dd>
  12798. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  12799. <dd><p>Set the sample rate for libopenmpt to output.
  12800. Range is from 1000 to INT_MAX. The value default is 48000.
  12801. </p></dd>
  12802. </dl>
  12803. <a name="mov_002fmp4_002f3gp"></a>
  12804. <h2 class="section"><a href="ffmpeg-all.html#toc-mov_002fmp4_002f3gp">20.13 mov/mp4/3gp</a></h2>
  12805. <p>Demuxer for Quicktime File Format &amp; ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12).
  12806. </p>
  12807. <p>Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v
  12808. </p>
  12809. <a name="Options-51"></a>
  12810. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-51">20.13.1 Options</a></h3>
  12811. <p>This demuxer accepts the following options:
  12812. </p><dl compact="compact">
  12813. <dt>&lsquo;<samp>enable_drefs</samp>&rsquo;</dt>
  12814. <dd><p>Enable loading of external tracks, disabled by default.
  12815. Enabling this can theoretically leak information in some use cases.
  12816. </p>
  12817. </dd>
  12818. <dt>&lsquo;<samp>use_absolute_path</samp>&rsquo;</dt>
  12819. <dd><p>Allows loading of external tracks via absolute paths, disabled by default.
  12820. Enabling this poses a security risk. It should only be enabled if the source
  12821. is known to be non-malicious.
  12822. </p>
  12823. </dd>
  12824. <dt>&lsquo;<samp>seek_streams_individually</samp>&rsquo;</dt>
  12825. <dd><p>When seeking, identify the closest point in each stream individually and demux packets in
  12826. that stream from identified point. This can lead to a different sequence of packets compared
  12827. to demuxing linearly from the beginning. Default is true.
  12828. </p>
  12829. </dd>
  12830. <dt>&lsquo;<samp>ignore_editlist</samp>&rsquo;</dt>
  12831. <dd><p>Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the
  12832. timeline described by the edit list. Default is false.
  12833. </p>
  12834. </dd>
  12835. <dt>&lsquo;<samp>advanced_editlist</samp>&rsquo;</dt>
  12836. <dd><p>Modify the stream index to reflect the timeline described by the edit list. <code>ignore_editlist</code>
  12837. must be set to false for this option to be effective.
  12838. If both <code>ignore_editlist</code> and this option are set to false, then only the
  12839. start of the stream index is modified to reflect initial dwell time or starting timestamp
  12840. described by the edit list. Default is true.
  12841. </p>
  12842. </dd>
  12843. <dt>&lsquo;<samp>ignore_chapters</samp>&rsquo;</dt>
  12844. <dd><p>Don&rsquo;t parse chapters. This includes GoPro &rsquo;HiLight&rsquo; tags/moments. Note that chapters are
  12845. only parsed when input is seekable. Default is false.
  12846. </p>
  12847. </dd>
  12848. <dt>&lsquo;<samp>use_mfra_for</samp>&rsquo;</dt>
  12849. <dd><p>For seekable fragmented input, set fragment&rsquo;s starting timestamp from media fragment random access box, if present.
  12850. </p>
  12851. <p>Following options are available:
  12852. </p><dl compact="compact">
  12853. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  12854. <dd><p>Auto-detect whether to set mfra timestamps as PTS or DTS <em>(default)</em>
  12855. </p>
  12856. </dd>
  12857. <dt>&lsquo;<samp>dts</samp>&rsquo;</dt>
  12858. <dd><p>Set mfra timestamps as DTS
  12859. </p>
  12860. </dd>
  12861. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  12862. <dd><p>Set mfra timestamps as PTS
  12863. </p>
  12864. </dd>
  12865. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  12866. <dd><p>Don&rsquo;t use mfra box to set timestamps
  12867. </p></dd>
  12868. </dl>
  12869. </dd>
  12870. <dt>&lsquo;<samp>export_all</samp>&rsquo;</dt>
  12871. <dd><p>Export unrecognized boxes within the <var>udta</var> box as metadata entries. The first four
  12872. characters of the box type are set as the key. Default is false.
  12873. </p>
  12874. </dd>
  12875. <dt>&lsquo;<samp>export_xmp</samp>&rsquo;</dt>
  12876. <dd><p>Export entire contents of <var>XMP_</var> box and <var>uuid</var> box as a string with key <code>xmp</code>. Note that
  12877. if <code>export_all</code> is set and this option isn&rsquo;t, the contents of <var>XMP_</var> box are still exported
  12878. but with key <code>XMP_</code>. Default is false.
  12879. </p>
  12880. </dd>
  12881. <dt>&lsquo;<samp>activation_bytes</samp>&rsquo;</dt>
  12882. <dd><p>4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below.
  12883. </p>
  12884. </dd>
  12885. <dt>&lsquo;<samp>audible_fixed_key</samp>&rsquo;</dt>
  12886. <dd><p>Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to
  12887. specify.
  12888. </p>
  12889. </dd>
  12890. <dt>&lsquo;<samp>decryption_key</samp>&rsquo;</dt>
  12891. <dd><p>16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7).
  12892. </p></dd>
  12893. </dl>
  12894. <a name="Audible-AAX"></a>
  12895. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Audible-AAX">20.13.2 Audible AAX</a></h3>
  12896. <p>Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
  12897. </p><div class="example">
  12898. <pre class="example">ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
  12899. </pre></div>
  12900. <a name="mpegts-1"></a>
  12901. <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts-1">20.14 mpegts</a></h2>
  12902. <p>MPEG-2 transport stream demuxer.
  12903. </p>
  12904. <p>This demuxer accepts the following options:
  12905. </p><dl compact="compact">
  12906. <dt>&lsquo;<samp>resync_size</samp>&rsquo;</dt>
  12907. <dd><p>Set size limit for looking up a new synchronization. Default value is
  12908. 65536.
  12909. </p>
  12910. </dd>
  12911. <dt>&lsquo;<samp>skip_unknown_pmt</samp>&rsquo;</dt>
  12912. <dd><p>Skip PMTs for programs not defined in the PAT. Default value is 0.
  12913. </p>
  12914. </dd>
  12915. <dt>&lsquo;<samp>fix_teletext_pts</samp>&rsquo;</dt>
  12916. <dd><p>Override teletext packet PTS and DTS values with the timestamps calculated
  12917. from the PCR of the first program which the teletext stream is part of and is
  12918. not discarded. Default value is 1, set this option to 0 if you want your
  12919. teletext packet PTS and DTS values untouched.
  12920. </p>
  12921. </dd>
  12922. <dt>&lsquo;<samp>ts_packetsize</samp>&rsquo;</dt>
  12923. <dd><p>Output option carrying the raw packet size in bytes.
  12924. Show the detected raw packet size, cannot be set by the user.
  12925. </p>
  12926. </dd>
  12927. <dt>&lsquo;<samp>scan_all_pmts</samp>&rsquo;</dt>
  12928. <dd><p>Scan and combine all PMTs. The value is an integer with value from -1
  12929. to 1 (-1 means automatic setting, 1 means enabled, 0 means
  12930. disabled). Default value is -1.
  12931. </p>
  12932. </dd>
  12933. <dt>&lsquo;<samp>merge_pmt_versions</samp>&rsquo;</dt>
  12934. <dd><p>Re-use existing streams when a PMT&rsquo;s version is updated and elementary
  12935. streams move to different PIDs. Default value is 0.
  12936. </p></dd>
  12937. </dl>
  12938. <a name="mpjpeg"></a>
  12939. <h2 class="section"><a href="ffmpeg-all.html#toc-mpjpeg">20.15 mpjpeg</a></h2>
  12940. <p>MJPEG encapsulated in multi-part MIME demuxer.
  12941. </p>
  12942. <p>This demuxer allows reading of MJPEG, where each frame is represented as a part of
  12943. multipart/x-mixed-replace stream.
  12944. </p><dl compact="compact">
  12945. <dt>&lsquo;<samp>strict_mime_boundary</samp>&rsquo;</dt>
  12946. <dd><p>Default implementation applies a relaxed standard to multi-part MIME boundary detection,
  12947. to prevent regression with numerous existing endpoints not generating a proper MIME
  12948. MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
  12949. of the boundary value.
  12950. </p></dd>
  12951. </dl>
  12952. <a name="rawvideo-1"></a>
  12953. <h2 class="section"><a href="ffmpeg-all.html#toc-rawvideo-1">20.16 rawvideo</a></h2>
  12954. <p>Raw video demuxer.
  12955. </p>
  12956. <p>This demuxer allows one to read raw video data. Since there is no header
  12957. specifying the assumed video parameters, the user must specify them
  12958. in order to be able to decode the data correctly.
  12959. </p>
  12960. <p>This demuxer accepts the following options:
  12961. </p><dl compact="compact">
  12962. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  12963. <dd><p>Set input video frame rate. Default value is 25.
  12964. </p>
  12965. </dd>
  12966. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  12967. <dd><p>Set the input video pixel format. Default value is <code>yuv420p</code>.
  12968. </p>
  12969. </dd>
  12970. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  12971. <dd><p>Set the input video size. This value must be specified explicitly.
  12972. </p></dd>
  12973. </dl>
  12974. <p>For example to read a rawvideo file &lsquo;<tt>input.raw</tt>&rsquo; with
  12975. <code>ffplay</code>, assuming a pixel format of <code>rgb24</code>, a video
  12976. size of <code>320x240</code>, and a frame rate of 10 images per second, use
  12977. the command:
  12978. </p><div class="example">
  12979. <pre class="example">ffplay -f rawvideo -pixel_format rgb24 -video_size 320x240 -framerate 10 input.raw
  12980. </pre></div>
  12981. <a name="sbg"></a>
  12982. <h2 class="section"><a href="ffmpeg-all.html#toc-sbg">20.17 sbg</a></h2>
  12983. <p>SBaGen script demuxer.
  12984. </p>
  12985. <p>This demuxer reads the script language used by SBaGen
  12986. <a href="http://uazu.net/sbagen/">http://uazu.net/sbagen/</a> to generate binaural beats sessions. A SBG
  12987. script looks like that:
  12988. </p><div class="example">
  12989. <pre class="example">-SE
  12990. a: 300-2.5/3 440+4.5/0
  12991. b: 300-2.5/0 440+4.5/3
  12992. off: -
  12993. NOW == a
  12994. +0:07:00 == b
  12995. +0:14:00 == a
  12996. +0:21:00 == b
  12997. +0:30:00 off
  12998. </pre></div>
  12999. <p>A SBG script can mix absolute and relative timestamps. If the script uses
  13000. either only absolute timestamps (including the script start time) or only
  13001. relative ones, then its layout is fixed, and the conversion is
  13002. straightforward. On the other hand, if the script mixes both kind of
  13003. timestamps, then the <var>NOW</var> reference for relative timestamps will be
  13004. taken from the current time of day at the time the script is read, and the
  13005. script layout will be frozen according to that reference. That means that if
  13006. the script is directly played, the actual times will match the absolute
  13007. timestamps up to the sound controller&rsquo;s clock accuracy, but if the user
  13008. somehow pauses the playback or seeks, all times will be shifted accordingly.
  13009. </p>
  13010. <a name="tedcaptions"></a>
  13011. <h2 class="section"><a href="ffmpeg-all.html#toc-tedcaptions">20.18 tedcaptions</a></h2>
  13012. <p>JSON captions used for <a href="http://www.ted.com/">TED Talks</a>.
  13013. </p>
  13014. <p>TED does not provide links to the captions, but they can be guessed from the
  13015. page. The file &lsquo;<tt>tools/bookmarklets.html</tt>&rsquo; from the FFmpeg source tree
  13016. contains a bookmarklet to expose them.
  13017. </p>
  13018. <p>This demuxer accepts the following option:
  13019. </p><dl compact="compact">
  13020. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  13021. <dd><p>Set the start time of the TED talk, in milliseconds. The default is 15000
  13022. (15s). It is used to sync the captions with the downloadable videos, because
  13023. they include a 15s intro.
  13024. </p></dd>
  13025. </dl>
  13026. <p>Example: convert the captions to a format most players understand:
  13027. </p><div class="example">
  13028. <pre class="example">ffmpeg -i http://www.ted.com/talks/subtitles/id/1/lang/en talk1-en.srt
  13029. </pre></div>
  13030. <a name="vapoursynth"></a>
  13031. <h2 class="section"><a href="ffmpeg-all.html#toc-vapoursynth">20.19 vapoursynth</a></h2>
  13032. <p>Vapoursynth wrapper.
  13033. </p>
  13034. <p>Due to security concerns, Vapoursynth scripts will not
  13035. be autodetected so the input format has to be forced. For ff* CLI tools,
  13036. add <code>-f vapoursynth</code> before the input <code>-i yourscript.vpy</code>.
  13037. </p>
  13038. <p>This demuxer accepts the following option:
  13039. </p><dl compact="compact">
  13040. <dt>&lsquo;<samp>max_script_size</samp>&rsquo;</dt>
  13041. <dd><p>The demuxer buffers the entire script into memory. Adjust this value to set the maximum buffer size,
  13042. which in turn, acts as a ceiling for the size of scripts that can be read.
  13043. Default is 1 MiB.
  13044. </p></dd>
  13045. </dl>
  13046. <a name="Muxers"></a>
  13047. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Muxers">21 Muxers</a></h1>
  13048. <p>Muxers are configured elements in FFmpeg which allow writing
  13049. multimedia streams to a particular type of file.
  13050. </p>
  13051. <p>When you configure your FFmpeg build, all the supported muxers
  13052. are enabled by default. You can list all available muxers using the
  13053. configure option <code>--list-muxers</code>.
  13054. </p>
  13055. <p>You can disable all the muxers with the configure option
  13056. <code>--disable-muxers</code> and selectively enable / disable single muxers
  13057. with the options <code>--enable-muxer=<var>MUXER</var></code> /
  13058. <code>--disable-muxer=<var>MUXER</var></code>.
  13059. </p>
  13060. <p>The option <code>-muxers</code> of the ff* tools will display the list of
  13061. enabled muxers. Use <code>-formats</code> to view a combined list of
  13062. enabled demuxers and muxers.
  13063. </p>
  13064. <p>A description of some of the currently available muxers follows.
  13065. </p>
  13066. <p><a name="aiff"></a>
  13067. </p><a name="aiff-1"></a>
  13068. <h2 class="section"><a href="ffmpeg-all.html#toc-aiff-1">21.1 aiff</a></h2>
  13069. <p>Audio Interchange File Format muxer.
  13070. </p>
  13071. <a name="Options-61"></a>
  13072. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-61">21.1.1 Options</a></h3>
  13073. <p>It accepts the following options:
  13074. </p>
  13075. <dl compact="compact">
  13076. <dt>&lsquo;<samp>write_id3v2</samp>&rsquo;</dt>
  13077. <dd><p>Enable ID3v2 tags writing when set to 1. Default is 0 (disabled).
  13078. </p>
  13079. </dd>
  13080. <dt>&lsquo;<samp>id3v2_version</samp>&rsquo;</dt>
  13081. <dd><p>Select ID3v2 version to write. Currently only version 3 and 4 (aka.
  13082. ID3v2.3 and ID3v2.4) are supported. The default is version 4.
  13083. </p>
  13084. </dd>
  13085. </dl>
  13086. <p><a name="asf"></a>
  13087. </p><a name="asf-1"></a>
  13088. <h2 class="section"><a href="ffmpeg-all.html#toc-asf-1">21.2 asf</a></h2>
  13089. <p>Advanced Systems Format muxer.
  13090. </p>
  13091. <p>Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
  13092. muxer too.
  13093. </p>
  13094. <a name="Options-26"></a>
  13095. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-26">21.2.1 Options</a></h3>
  13096. <p>It accepts the following options:
  13097. </p>
  13098. <dl compact="compact">
  13099. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  13100. <dd><p>Set the muxer packet size. By tuning this setting you may reduce data
  13101. fragmentation or muxer overhead depending on your source. Default value is
  13102. 3200, minimum is 100, maximum is 64k.
  13103. </p>
  13104. </dd>
  13105. </dl>
  13106. <p><a name="avi"></a>
  13107. </p><a name="avi-1"></a>
  13108. <h2 class="section"><a href="ffmpeg-all.html#toc-avi-1">21.3 avi</a></h2>
  13109. <p>Audio Video Interleaved muxer.
  13110. </p>
  13111. <a name="Options-54"></a>
  13112. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-54">21.3.1 Options</a></h3>
  13113. <p>It accepts the following options:
  13114. </p>
  13115. <dl compact="compact">
  13116. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  13117. <dd><p>Reserve the specified amount of bytes for the OpenDML master index of each
  13118. stream within the file header. By default additional master indexes are
  13119. embedded within the data packets if there is no space left in the first master
  13120. index and are linked together as a chain of indexes. This index structure can
  13121. cause problems for some use cases, e.g. third-party software strictly relying
  13122. on the OpenDML index specification or when file seeking is slow. Reserving
  13123. enough index space in the file header avoids these problems.
  13124. </p>
  13125. <p>The required index space depends on the output file size and should be about 16
  13126. bytes per gigabyte. When this option is omitted or set to zero the necessary
  13127. index space is guessed.
  13128. </p>
  13129. </dd>
  13130. <dt>&lsquo;<samp>write_channel_mask</samp>&rsquo;</dt>
  13131. <dd><p>Write the channel layout mask into the audio stream header.
  13132. </p>
  13133. <p>This option is enabled by default. Disabling the channel mask can be useful in
  13134. specific scenarios, e.g. when merging multiple audio streams into one for
  13135. compatibility with software that only supports a single audio stream in AVI
  13136. (see <a href="ffmpeg-filters.html#amerge">(ffmpeg-filters)the &quot;amerge&quot; section in the ffmpeg-filters manual</a>).
  13137. </p>
  13138. </dd>
  13139. </dl>
  13140. <p><a name="chromaprint"></a>
  13141. </p><a name="chromaprint-1"></a>
  13142. <h2 class="section"><a href="ffmpeg-all.html#toc-chromaprint-1">21.4 chromaprint</a></h2>
  13143. <p>Chromaprint fingerprinter.
  13144. </p>
  13145. <p>This muxer feeds audio data to the Chromaprint library,
  13146. which generates a fingerprint for the provided audio data. See <a href="https://acoustid.org/chromaprint">https://acoustid.org/chromaprint</a>
  13147. </p>
  13148. <p>It takes a single signed native-endian 16-bit raw audio stream of at most 2 channels.
  13149. </p>
  13150. <a name="Options-53"></a>
  13151. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-53">21.4.1 Options</a></h3>
  13152. <dl compact="compact">
  13153. <dt>&lsquo;<samp>silence_threshold</samp>&rsquo;</dt>
  13154. <dd><p>Threshold for detecting silence. Range is from -1 to 32767, where -1 disables
  13155. silence detection. Silence detection can only be used with version 3 of the
  13156. algorithm.
  13157. Silence detection must be disabled for use with the AcoustID service. Default is -1.
  13158. </p>
  13159. </dd>
  13160. <dt>&lsquo;<samp>algorithm</samp>&rsquo;</dt>
  13161. <dd><p>Version of algorithm to fingerprint with. Range is 0 to 4.
  13162. Version 3 enables silence detection. Default is 1.
  13163. </p>
  13164. </dd>
  13165. <dt>&lsquo;<samp>fp_format</samp>&rsquo;</dt>
  13166. <dd><p>Format to output the fingerprint as. Accepts the following options:
  13167. </p><dl compact="compact">
  13168. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  13169. <dd><p>Binary raw fingerprint
  13170. </p>
  13171. </dd>
  13172. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  13173. <dd><p>Binary compressed fingerprint
  13174. </p>
  13175. </dd>
  13176. <dt>&lsquo;<samp>base64</samp>&rsquo;</dt>
  13177. <dd><p>Base64 compressed fingerprint <em>(default)</em>
  13178. </p>
  13179. </dd>
  13180. </dl>
  13181. </dd>
  13182. </dl>
  13183. <p><a name="crc"></a>
  13184. </p><a name="crc-1"></a>
  13185. <h2 class="section"><a href="ffmpeg-all.html#toc-crc-1">21.5 crc</a></h2>
  13186. <p>CRC (Cyclic Redundancy Check) testing format.
  13187. </p>
  13188. <p>This muxer computes and prints the Adler-32 CRC of all the input audio
  13189. and video frames. By default audio frames are converted to signed
  13190. 16-bit raw audio and video frames to raw video before computing the
  13191. CRC.
  13192. </p>
  13193. <p>The output of the muxer consists of a single line of the form:
  13194. CRC=0x<var>CRC</var>, where <var>CRC</var> is a hexadecimal number 0-padded to
  13195. 8 digits containing the CRC for all the decoded input frames.
  13196. </p>
  13197. <p>See also the <a href="#framecrc">framecrc</a> muxer.
  13198. </p>
  13199. <a name="Examples-100"></a>
  13200. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-100">21.5.1 Examples</a></h3>
  13201. <p>For example to compute the CRC of the input, and store it in the file
  13202. &lsquo;<tt>out.crc</tt>&rsquo;:
  13203. </p><div class="example">
  13204. <pre class="example">ffmpeg -i INPUT -f crc out.crc
  13205. </pre></div>
  13206. <p>You can print the CRC to stdout with the command:
  13207. </p><div class="example">
  13208. <pre class="example">ffmpeg -i INPUT -f crc -
  13209. </pre></div>
  13210. <p>You can select the output format of each frame with <code>ffmpeg</code> by
  13211. specifying the audio and video codec and format. For example to
  13212. compute the CRC of the input audio converted to PCM unsigned 8-bit
  13213. and the input video converted to MPEG-2 video, use the command:
  13214. </p><div class="example">
  13215. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  13216. </pre></div>
  13217. <a name="flv"></a>
  13218. <h2 class="section"><a href="ffmpeg-all.html#toc-flv">21.6 flv</a></h2>
  13219. <p>Adobe Flash Video Format muxer.
  13220. </p>
  13221. <p>This muxer accepts the following options:
  13222. </p>
  13223. <dl compact="compact">
  13224. <dt>&lsquo;<samp>flvflags <var>flags</var></samp>&rsquo;</dt>
  13225. <dd><p>Possible values:
  13226. </p>
  13227. <dl compact="compact">
  13228. <dt>&lsquo;<samp>aac_seq_header_detect</samp>&rsquo;</dt>
  13229. <dd><p>Place AAC sequence header based on audio stream data.
  13230. </p>
  13231. </dd>
  13232. <dt>&lsquo;<samp>no_sequence_end</samp>&rsquo;</dt>
  13233. <dd><p>Disable sequence end tag.
  13234. </p>
  13235. </dd>
  13236. <dt>&lsquo;<samp>no_metadata</samp>&rsquo;</dt>
  13237. <dd><p>Disable metadata tag.
  13238. </p>
  13239. </dd>
  13240. <dt>&lsquo;<samp>no_duration_filesize</samp>&rsquo;</dt>
  13241. <dd><p>Disable duration and filesize in metadata when they are equal to zero
  13242. at the end of stream. (Be used to non-seekable living stream).
  13243. </p>
  13244. </dd>
  13245. <dt>&lsquo;<samp>add_keyframe_index</samp>&rsquo;</dt>
  13246. <dd><p>Used to facilitate seeking; particularly for HTTP pseudo streaming.
  13247. </p></dd>
  13248. </dl>
  13249. </dd>
  13250. </dl>
  13251. <p><a name="dash"></a>
  13252. </p><a name="dash-2"></a>
  13253. <h2 class="section"><a href="ffmpeg-all.html#toc-dash-2">21.7 dash</a></h2>
  13254. <p>Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  13255. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  13256. </p>
  13257. <p>For more information see:
  13258. </p>
  13259. <ul>
  13260. <li>
  13261. ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  13262. </li><li>
  13263. WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  13264. </li></ul>
  13265. <p>It creates a MPD manifest file and segment files for each stream.
  13266. </p>
  13267. <p>The segment filename might contain pre-defined identifiers used with SegmentTemplate
  13268. as defined in section 5.3.9.4.4 of the standard. Available identifiers are &quot;$RepresentationID$&quot;,
  13269. &quot;$Number$&quot;, &quot;$Bandwidth$&quot; and &quot;$Time$&quot;.
  13270. In addition to the standard identifiers, an ffmpeg-specific &quot;$ext$&quot; identifier is also supported.
  13271. When specified ffmpeg will replace $ext$ in the file name with muxing format&rsquo;s extensions such as mp4, webm etc.,
  13272. </p>
  13273. <div class="example">
  13274. <pre class="example">ffmpeg -re -i &lt;input&gt; -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
  13275. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
  13276. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
  13277. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
  13278. -window_size 5 -adaptation_sets &quot;id=0,streams=v id=1,streams=a&quot; \
  13279. -f dash /path/to/out.mpd
  13280. </pre></div>
  13281. <dl compact="compact">
  13282. <dt>&lsquo;<samp>min_seg_duration <var>microseconds</var></samp>&rsquo;</dt>
  13283. <dd><p>This is a deprecated option to set the segment length in microseconds, use <var>seg_duration</var> instead.
  13284. </p></dd>
  13285. <dt>&lsquo;<samp>seg_duration <var>duration</var></samp>&rsquo;</dt>
  13286. <dd><p>Set the segment length in seconds (fractional value can be set). The value is
  13287. treated as average segment duration when <var>use_template</var> is enabled and
  13288. </p></dd>
  13289. <dt>&lsquo;<samp>frag_duration <var>duration</var></samp>&rsquo;</dt>
  13290. <dd><p>Set the length in seconds of fragments within segments (fractional value can be set).
  13291. </p></dd>
  13292. <dt>&lsquo;<samp>frag_type <var>type</var></samp>&rsquo;</dt>
  13293. <dd><p>Set the type of interval for fragmentation.
  13294. </p></dd>
  13295. <dt>&lsquo;<samp>window_size <var>size</var></samp>&rsquo;</dt>
  13296. <dd><p>Set the maximum number of segments kept in the manifest.
  13297. </p></dd>
  13298. <dt>&lsquo;<samp>extra_window_size <var>size</var></samp>&rsquo;</dt>
  13299. <dd><p>Set the maximum number of segments kept outside of the manifest before removing from disk.
  13300. </p></dd>
  13301. <dt>&lsquo;<samp>remove_at_exit <var>remove</var></samp>&rsquo;</dt>
  13302. <dd><p>Enable (1) or disable (0) removal of all segments when finished.
  13303. </p></dd>
  13304. <dt>&lsquo;<samp>use_template <var>template</var></samp>&rsquo;</dt>
  13305. <dd><p>Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  13306. </p></dd>
  13307. <dt>&lsquo;<samp>use_timeline <var>timeline</var></samp>&rsquo;</dt>
  13308. <dd><p>Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  13309. </p></dd>
  13310. <dt>&lsquo;<samp>single_file <var>single_file</var></samp>&rsquo;</dt>
  13311. <dd><p>Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  13312. </p></dd>
  13313. <dt>&lsquo;<samp>single_file_name <var>file_name</var></samp>&rsquo;</dt>
  13314. <dd><p>DASH-templated name to be used for baseURL. Implies <var>single_file</var> set to &quot;1&quot;. In the template, &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  13315. </p></dd>
  13316. <dt>&lsquo;<samp>init_seg_name <var>init_name</var></samp>&rsquo;</dt>
  13317. <dd><p>DASH-templated name to used for the initialization segment. Default is &quot;init-stream$RepresentationID$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  13318. </p></dd>
  13319. <dt>&lsquo;<samp>media_seg_name <var>segment_name</var></samp>&rsquo;</dt>
  13320. <dd><p>DASH-templated name to used for the media segments. Default is &quot;chunk-stream$RepresentationID$-$Number%05d$.$ext$&quot;. &quot;$ext$&quot; is replaced with the file name extension specific for the segment format.
  13321. </p></dd>
  13322. <dt>&lsquo;<samp>utc_timing_url <var>utc_url</var></samp>&rsquo;</dt>
  13323. <dd><p>URL of the page that will return the UTC timestamp in ISO format. Example: &quot;https://time.akamai.com/?iso&quot;
  13324. </p></dd>
  13325. <dt>&lsquo;<samp>method <var>method</var></samp>&rsquo;</dt>
  13326. <dd><p>Use the given HTTP method to create output files. Generally set to PUT or POST.
  13327. </p></dd>
  13328. <dt>&lsquo;<samp>http_user_agent <var>user_agent</var></samp>&rsquo;</dt>
  13329. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  13330. </p></dd>
  13331. <dt>&lsquo;<samp>http_persistent <var>http_persistent</var></samp>&rsquo;</dt>
  13332. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  13333. </p></dd>
  13334. <dt>&lsquo;<samp>hls_playlist <var>hls_playlist</var></samp>&rsquo;</dt>
  13335. <dd><p>Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8.
  13336. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.
  13337. </p></dd>
  13338. <dt>&lsquo;<samp>streaming <var>streaming</var></samp>&rsquo;</dt>
  13339. <dd><p>Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming
  13340. mode, each frame will be a moof fragment which forms a chunk.
  13341. </p></dd>
  13342. <dt>&lsquo;<samp>adaptation_sets <var>adaptation_sets</var></samp>&rsquo;</dt>
  13343. <dd><p>Assign streams to AdaptationSets. Syntax is &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; with x and y being the IDs
  13344. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  13345. </p>
  13346. <p>To map all video (or audio) streams to an AdaptationSet, &quot;v&quot; (or &quot;a&quot;) can be used as stream identifier instead of IDs.
  13347. </p>
  13348. <p>When no assignment is defined, this defaults to an AdaptationSet for each stream.
  13349. </p>
  13350. <p>Optional syntax is &quot;id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e&quot; and so on,
  13351. descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015.
  13352. For example, -adaptation_sets &quot;id=0,descriptor=&lt;SupplementalProperty schemeIdUri=\&quot;urn:mpeg:dash:srd:2014\&quot; value=\&quot;0,0,0,1,1,2,2\&quot;/&gt;,streams=v&quot;.
  13353. Please note that descriptor string should be a self-closing xml tag.
  13354. seg_duration, frag_duration and frag_type override the global option values for each adaptation set.
  13355. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a&quot;
  13356. type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set.
  13357. For example, -adaptation_sets &quot;id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1&quot;
  13358. </p></dd>
  13359. <dt>&lsquo;<samp>timeout <var>timeout</var></samp>&rsquo;</dt>
  13360. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  13361. </p></dd>
  13362. <dt>&lsquo;<samp>index_correction <var>index_correction</var></samp>&rsquo;</dt>
  13363. <dd><p>Enable (1) or Disable (0) segment index correction logic. Applicable only when
  13364. <var>use_template</var> is enabled and <var>use_timeline</var> is disabled.
  13365. </p>
  13366. <p>When enabled, the logic monitors the flow of segment indexes. If a streams&rsquo;s
  13367. segment index value is not at the expected real time position, then the logic
  13368. corrects that index value.
  13369. </p>
  13370. <p>Typically this logic is needed in live streaming use cases. The network bandwidth
  13371. fluctuations are common during long run streaming. Each fluctuation can cause
  13372. the segment indexes fall behind the expected real time position.
  13373. </p></dd>
  13374. <dt>&lsquo;<samp>format_options <var>options_list</var></samp>&rsquo;</dt>
  13375. <dd><p>Set container format (mp4/webm) options using a <code>:</code> separated list of
  13376. key=value parameters. Values containing <code>:</code> special characters must be
  13377. escaped.
  13378. </p>
  13379. </dd>
  13380. <dt>&lsquo;<samp>global_sidx <var>global_sidx</var></samp>&rsquo;</dt>
  13381. <dd><p>Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
  13382. </p>
  13383. </dd>
  13384. <dt>&lsquo;<samp>dash_segment_type <var>dash_segment_type</var></samp>&rsquo;</dt>
  13385. <dd><p>Possible values:
  13386. </p><dl compact="compact">
  13387. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  13388. <dd><p>If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.
  13389. </p>
  13390. </dd>
  13391. <dt>&lsquo;<samp>mp4</samp>&rsquo;</dt>
  13392. <dd><p>If this flag is set, the dash segment files will be in in ISOBMFF format.
  13393. </p>
  13394. </dd>
  13395. <dt>&lsquo;<samp>webm</samp>&rsquo;</dt>
  13396. <dd><p>If this flag is set, the dash segment files will be in in WebM format.
  13397. </p></dd>
  13398. </dl>
  13399. </dd>
  13400. <dt>&lsquo;<samp>ignore_io_errors <var>ignore_io_errors</var></samp>&rsquo;</dt>
  13401. <dd><p>Ignore IO errors during open and write. Useful for long-duration runs with network output.
  13402. </p>
  13403. </dd>
  13404. <dt>&lsquo;<samp>lhls <var>lhls</var></samp>&rsquo;</dt>
  13405. <dd><p>Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment&rsquo;s URI.
  13406. Apple doesn&rsquo;t have an official spec for LHLS. Meanwhile hls.js player folks are
  13407. trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md
  13408. This option will also try to comply with the above open spec, till Apple&rsquo;s spec officially supports it.
  13409. Applicable only when <var>streaming</var> and <var>hls_playlist</var> options are enabled.
  13410. This is an experimental feature.
  13411. </p>
  13412. </dd>
  13413. <dt>&lsquo;<samp>ldash <var>ldash</var></samp>&rsquo;</dt>
  13414. <dd><p>Enable Low-latency Dash by constraining the presence and values of some elements.
  13415. </p>
  13416. </dd>
  13417. <dt>&lsquo;<samp>master_m3u8_publish_rate <var>master_m3u8_publish_rate</var></samp>&rsquo;</dt>
  13418. <dd><p>Publish master playlist repeatedly every after specified number of segment intervals.
  13419. </p>
  13420. </dd>
  13421. <dt>&lsquo;<samp>-write_prft <var>write_prft</var></samp>&rsquo;</dt>
  13422. <dd><p>Write Producer Reference Time elements on supported streams. This also enables writing
  13423. prft boxes in the underlying muxer. Applicable only when the <var>utc_url</var> option is enabled.
  13424. It&rsquo;s set to auto by default, in which case the muxer will attempt to enable it only in modes
  13425. that require it.
  13426. </p>
  13427. </dd>
  13428. <dt>&lsquo;<samp>-mpd_profile <var>mpd_profile</var></samp>&rsquo;</dt>
  13429. <dd><p>Set one or more manifest profiles.
  13430. </p>
  13431. </dd>
  13432. <dt>&lsquo;<samp>-http_opts <var>http_opts</var></samp>&rsquo;</dt>
  13433. <dd><p>A :-separated list of key=value options to pass to the underlying HTTP
  13434. protocol. Applicable only for HTTP output.
  13435. </p>
  13436. </dd>
  13437. <dt>&lsquo;<samp>-target_latency <var>target_latency</var></samp>&rsquo;</dt>
  13438. <dd><p>Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when <var>streaming</var> and <var>write_prft</var> options are enabled.
  13439. This is an informative fields clients can use to measure the latency of the service.
  13440. </p>
  13441. </dd>
  13442. </dl>
  13443. <p><a name="framecrc"></a>
  13444. </p><a name="framecrc-1"></a>
  13445. <h2 class="section"><a href="ffmpeg-all.html#toc-framecrc-1">21.8 framecrc</a></h2>
  13446. <p>Per-packet CRC (Cyclic Redundancy Check) testing format.
  13447. </p>
  13448. <p>This muxer computes and prints the Adler-32 CRC for each audio
  13449. and video packet. By default audio frames are converted to signed
  13450. 16-bit raw audio and video frames to raw video before computing the
  13451. CRC.
  13452. </p>
  13453. <p>The output of the muxer consists of a line for each audio and video
  13454. packet of the form:
  13455. </p><div class="example">
  13456. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, 0x<var>CRC</var>
  13457. </pre></div>
  13458. <p><var>CRC</var> is a hexadecimal number 0-padded to 8 digits containing the
  13459. CRC of the packet.
  13460. </p>
  13461. <a name="Examples-165"></a>
  13462. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-165">21.8.1 Examples</a></h3>
  13463. <p>For example to compute the CRC of the audio and video frames in
  13464. &lsquo;<tt>INPUT</tt>&rsquo;, converted to raw audio and video packets, and store it
  13465. in the file &lsquo;<tt>out.crc</tt>&rsquo;:
  13466. </p><div class="example">
  13467. <pre class="example">ffmpeg -i INPUT -f framecrc out.crc
  13468. </pre></div>
  13469. <p>To print the information to stdout, use the command:
  13470. </p><div class="example">
  13471. <pre class="example">ffmpeg -i INPUT -f framecrc -
  13472. </pre></div>
  13473. <p>With <code>ffmpeg</code>, you can select the output format to which the
  13474. audio and video frames are encoded before computing the CRC for each
  13475. packet by specifying the audio and video codec. For example, to
  13476. compute the CRC of each decoded input audio frame converted to PCM
  13477. unsigned 8-bit and of each decoded input video frame converted to
  13478. MPEG-2 video, use the command:
  13479. </p><div class="example">
  13480. <pre class="example">ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  13481. </pre></div>
  13482. <p>See also the <a href="#crc">crc</a> muxer.
  13483. </p>
  13484. <p><a name="framehash"></a>
  13485. </p><a name="framehash-1"></a>
  13486. <h2 class="section"><a href="ffmpeg-all.html#toc-framehash-1">21.9 framehash</a></h2>
  13487. <p>Per-packet hash testing format.
  13488. </p>
  13489. <p>This muxer computes and prints a cryptographic hash for each audio
  13490. and video packet. This can be used for packet-by-packet equality
  13491. checks without having to individually do a binary comparison on each.
  13492. </p>
  13493. <p>By default audio frames are converted to signed 16-bit raw audio and
  13494. video frames to raw video before computing the hash, but the output
  13495. of explicit conversions to other codecs can also be used. It uses the
  13496. SHA-256 cryptographic hash function by default, but supports several
  13497. other algorithms.
  13498. </p>
  13499. <p>The output of the muxer consists of a line for each audio and video
  13500. packet of the form:
  13501. </p><div class="example">
  13502. <pre class="example"><var>stream_index</var>, <var>packet_dts</var>, <var>packet_pts</var>, <var>packet_duration</var>, <var>packet_size</var>, <var>hash</var>
  13503. </pre></div>
  13504. <p><var>hash</var> is a hexadecimal number representing the computed hash
  13505. for the packet.
  13506. </p>
  13507. <dl compact="compact">
  13508. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  13509. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  13510. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  13511. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  13512. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  13513. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  13514. </p>
  13515. </dd>
  13516. </dl>
  13517. <a name="Examples-132"></a>
  13518. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-132">21.9.1 Examples</a></h3>
  13519. <p>To compute the SHA-256 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  13520. converted to raw audio and video packets, and store it in the file
  13521. &lsquo;<tt>out.sha256</tt>&rsquo;:
  13522. </p><div class="example">
  13523. <pre class="example">ffmpeg -i INPUT -f framehash out.sha256
  13524. </pre></div>
  13525. <p>To print the information to stdout, using the MD5 hash function, use
  13526. the command:
  13527. </p><div class="example">
  13528. <pre class="example">ffmpeg -i INPUT -f framehash -hash md5 -
  13529. </pre></div>
  13530. <p>See also the <a href="#hash">hash</a> muxer.
  13531. </p>
  13532. <p><a name="framemd5"></a>
  13533. </p><a name="framemd5-1"></a>
  13534. <h2 class="section"><a href="ffmpeg-all.html#toc-framemd5-1">21.10 framemd5</a></h2>
  13535. <p>Per-packet MD5 testing format.
  13536. </p>
  13537. <p>This is a variant of the <a href="#framehash">framehash</a> muxer. Unlike that muxer,
  13538. it defaults to using the MD5 hash function.
  13539. </p>
  13540. <a name="Examples-112"></a>
  13541. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-112">21.10.1 Examples</a></h3>
  13542. <p>To compute the MD5 hash of the audio and video frames in &lsquo;<tt>INPUT</tt>&rsquo;,
  13543. converted to raw audio and video packets, and store it in the file
  13544. &lsquo;<tt>out.md5</tt>&rsquo;:
  13545. </p><div class="example">
  13546. <pre class="example">ffmpeg -i INPUT -f framemd5 out.md5
  13547. </pre></div>
  13548. <p>To print the information to stdout, use the command:
  13549. </p><div class="example">
  13550. <pre class="example">ffmpeg -i INPUT -f framemd5 -
  13551. </pre></div>
  13552. <p>See also the <a href="#framehash">framehash</a> and <a href="#md5">md5</a> muxers.
  13553. </p>
  13554. <p><a name="gif"></a>
  13555. </p><a name="gif-2"></a>
  13556. <h2 class="section"><a href="ffmpeg-all.html#toc-gif-2">21.11 gif</a></h2>
  13557. <p>Animated GIF muxer.
  13558. </p>
  13559. <p>It accepts the following options:
  13560. </p>
  13561. <dl compact="compact">
  13562. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  13563. <dd><p>Set the number of times to loop the output. Use <code>-1</code> for no loop, <code>0</code>
  13564. for looping indefinitely (default).
  13565. </p>
  13566. </dd>
  13567. <dt>&lsquo;<samp>final_delay</samp>&rsquo;</dt>
  13568. <dd><p>Force the delay (expressed in centiseconds) after the last frame. Each frame
  13569. ends with a delay until the next frame. The default is <code>-1</code>, which is a
  13570. special value to tell the muxer to re-use the previous delay. In case of a
  13571. loop, you might want to customize this value to mark a pause for instance.
  13572. </p></dd>
  13573. </dl>
  13574. <p>For example, to encode a gif looping 10 times, with a 5 seconds delay between
  13575. the loops:
  13576. </p><div class="example">
  13577. <pre class="example">ffmpeg -i INPUT -loop 10 -final_delay 500 out.gif
  13578. </pre></div>
  13579. <p>Note 1: if you wish to extract the frames into separate GIF files, you need to
  13580. force the <a href="#image2">image2</a> muxer:
  13581. </p><div class="example">
  13582. <pre class="example">ffmpeg -i INPUT -c:v gif -f image2 &quot;out%d.gif&quot;
  13583. </pre></div>
  13584. <p>Note 2: the GIF format has a very large time base: the delay between two frames
  13585. can therefore not be smaller than one centi second.
  13586. </p>
  13587. <p><a name="hash"></a>
  13588. </p><a name="hash-1"></a>
  13589. <h2 class="section"><a href="ffmpeg-all.html#toc-hash-1">21.12 hash</a></h2>
  13590. <p>Hash testing format.
  13591. </p>
  13592. <p>This muxer computes and prints a cryptographic hash of all the input
  13593. audio and video frames. This can be used for equality checks without
  13594. having to do a complete binary comparison.
  13595. </p>
  13596. <p>By default audio frames are converted to signed 16-bit raw audio and
  13597. video frames to raw video before computing the hash, but the output
  13598. of explicit conversions to other codecs can also be used. Timestamps
  13599. are ignored. It uses the SHA-256 cryptographic hash function by default,
  13600. but supports several other algorithms.
  13601. </p>
  13602. <p>The output of the muxer consists of a single line of the form:
  13603. <var>algo</var>=<var>hash</var>, where <var>algo</var> is a short string representing
  13604. the hash function used, and <var>hash</var> is a hexadecimal number
  13605. representing the computed hash.
  13606. </p>
  13607. <dl compact="compact">
  13608. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  13609. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  13610. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  13611. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  13612. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  13613. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  13614. </p>
  13615. </dd>
  13616. </dl>
  13617. <a name="Examples-134"></a>
  13618. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-134">21.12.1 Examples</a></h3>
  13619. <p>To compute the SHA-256 hash of the input converted to raw audio and
  13620. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  13621. </p><div class="example">
  13622. <pre class="example">ffmpeg -i INPUT -f hash out.sha256
  13623. </pre></div>
  13624. <p>To print an MD5 hash to stdout use the command:
  13625. </p><div class="example">
  13626. <pre class="example">ffmpeg -i INPUT -f hash -hash md5 -
  13627. </pre></div>
  13628. <p>See also the <a href="#framehash">framehash</a> muxer.
  13629. </p>
  13630. <p><a name="hls"></a>
  13631. </p><a name="hls-2"></a>
  13632. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-2">21.13 hls</a></h2>
  13633. <p>Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  13634. the HTTP Live Streaming (HLS) specification.
  13635. </p>
  13636. <p>It creates a playlist file, and one or more segment files. The output filename
  13637. specifies the playlist filename.
  13638. </p>
  13639. <p>By default, the muxer creates a file for each segment produced. These files
  13640. have the same name as the playlist, followed by a sequential number and a
  13641. .ts extension.
  13642. </p>
  13643. <p>Make sure to require a closed GOP when encoding and to set the GOP
  13644. size to fit your segment time constraint.
  13645. </p>
  13646. <p>For example, to convert an input file with <code>ffmpeg</code>:
  13647. </p><div class="example">
  13648. <pre class="example">ffmpeg -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  13649. </pre></div>
  13650. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13651. &lsquo;<tt>out0.ts</tt>&rsquo;, &lsquo;<tt>out1.ts</tt>&rsquo;, &lsquo;<tt>out2.ts</tt>&rsquo;, etc.
  13652. </p>
  13653. <p>See also the <a href="#segment">segment</a> muxer, which provides a more generic and
  13654. flexible implementation of a segmenter, and can be used to perform HLS
  13655. segmentation.
  13656. </p>
  13657. <a name="Options-66"></a>
  13658. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-66">21.13.1 Options</a></h3>
  13659. <p>This muxer supports the following options:
  13660. </p>
  13661. <dl compact="compact">
  13662. <dt>&lsquo;<samp>hls_init_time <var>seconds</var></samp>&rsquo;</dt>
  13663. <dd><p>Set the initial target segment length in seconds. Default value is <var>0</var>.
  13664. Segment will be cut on the next key frame after this time has passed on the first m3u8 list.
  13665. After the initial playlist is filled <code>ffmpeg</code> will cut segments
  13666. at duration equal to <code>hls_time</code>
  13667. </p>
  13668. </dd>
  13669. <dt>&lsquo;<samp>hls_time <var>seconds</var></samp>&rsquo;</dt>
  13670. <dd><p>Set the target segment length in seconds. Default value is 2.
  13671. Segment will be cut on the next key frame after this time has passed.
  13672. </p>
  13673. </dd>
  13674. <dt>&lsquo;<samp>hls_list_size <var>size</var></samp>&rsquo;</dt>
  13675. <dd><p>Set the maximum number of playlist entries. If set to 0 the list file
  13676. will contain all the segments. Default value is 5.
  13677. </p>
  13678. </dd>
  13679. <dt>&lsquo;<samp>hls_delete_threshold <var>size</var></samp>&rsquo;</dt>
  13680. <dd><p>Set the number of unreferenced segments to keep on disk before <code>hls_flags delete_segments</code>
  13681. deletes them. Increase this to allow continue clients to download segments which
  13682. were recently referenced in the playlist. Default value is 1, meaning segments older than
  13683. <code>hls_list_size+1</code> will be deleted.
  13684. </p>
  13685. </dd>
  13686. <dt>&lsquo;<samp>hls_ts_options <var>options_list</var></samp>&rsquo;</dt>
  13687. <dd><p>Set output format options using a :-separated list of key=value
  13688. parameters. Values containing <code>:</code> special characters must be
  13689. escaped.
  13690. </p>
  13691. </dd>
  13692. <dt>&lsquo;<samp>hls_wrap <var>wrap</var></samp>&rsquo;</dt>
  13693. <dd><p>This is a deprecated option, you can use <code>hls_list_size</code>
  13694. and <code>hls_flags delete_segments</code> instead it
  13695. </p>
  13696. <p>This option is useful to avoid to fill the disk with many segment
  13697. files, and limits the maximum number of segment files written to disk
  13698. to <var>wrap</var>.
  13699. </p>
  13700. </dd>
  13701. <dt>&lsquo;<samp>hls_start_number_source</samp>&rsquo;</dt>
  13702. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) according to the specified source.
  13703. Unless <code>hls_flags single_file</code> is set, it also specifies source of starting sequence numbers of
  13704. segment and subtitle filenames. In any case, if <code>hls_flags append_list</code>
  13705. is set and read playlist sequence number is greater than the specified start sequence number,
  13706. then that value will be used as start value.
  13707. </p>
  13708. <p>It accepts the following values:
  13709. </p>
  13710. <dl compact="compact">
  13711. <dt>&lsquo;<samp>generic (default)</samp>&rsquo;</dt>
  13712. <dd><p>Set the starting sequence numbers according to <var>start_number</var> option value.
  13713. </p>
  13714. </dd>
  13715. <dt>&lsquo;<samp>epoch</samp>&rsquo;</dt>
  13716. <dd><p>The start number will be the seconds since epoch (1970-01-01 00:00:00)
  13717. </p>
  13718. </dd>
  13719. <dt>&lsquo;<samp>datetime</samp>&rsquo;</dt>
  13720. <dd><p>The start number will be based on the current date/time as YYYYmmddHHMMSS. e.g. 20161231235759.
  13721. </p>
  13722. </dd>
  13723. </dl>
  13724. </dd>
  13725. <dt>&lsquo;<samp>start_number <var>number</var></samp>&rsquo;</dt>
  13726. <dd><p>Start the playlist sequence number (<code>#EXT-X-MEDIA-SEQUENCE</code>) from the specified <var>number</var>
  13727. when <var>hls_start_number_source</var> value is <var>generic</var>. (This is the default case.)
  13728. Unless <code>hls_flags single_file</code> is set, it also specifies starting sequence numbers of segment and subtitle filenames.
  13729. Default value is 0.
  13730. </p>
  13731. </dd>
  13732. <dt>&lsquo;<samp>hls_allow_cache <var>allowcache</var></samp>&rsquo;</dt>
  13733. <dd><p>Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments.
  13734. </p>
  13735. </dd>
  13736. <dt>&lsquo;<samp>hls_base_url <var>baseurl</var></samp>&rsquo;</dt>
  13737. <dd><p>Append <var>baseurl</var> to every entry in the playlist.
  13738. Useful to generate playlists with absolute paths.
  13739. </p>
  13740. <p>Note that the playlist sequence number must be unique for each segment
  13741. and it is not to be confused with the segment filename sequence number
  13742. which can be cyclic, for example if the &lsquo;<samp>wrap</samp>&rsquo; option is
  13743. specified.
  13744. </p>
  13745. </dd>
  13746. <dt>&lsquo;<samp>hls_segment_filename <var>filename</var></samp>&rsquo;</dt>
  13747. <dd><p>Set the segment filename. Unless <code>hls_flags single_file</code> is set,
  13748. <var>filename</var> is used as a string format with the segment number:
  13749. </p><div class="example">
  13750. <pre class="example">ffmpeg -i in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
  13751. </pre></div>
  13752. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13753. &lsquo;<tt>file000.ts</tt>&rsquo;, &lsquo;<tt>file001.ts</tt>&rsquo;, &lsquo;<tt>file002.ts</tt>&rsquo;, etc.
  13754. </p>
  13755. <p><var>filename</var> may contain full path or relative path specification,
  13756. but only the file name part without any path info will be contained in the m3u8 segment list.
  13757. Should a relative path be specified, the path of the created segment
  13758. files will be relative to the current working directory.
  13759. When strftime_mkdir is set, the whole expanded value of <var>filename</var> will be written into the m3u8 segment list.
  13760. </p>
  13761. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  13762. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  13763. the position of variant stream index in the generated segment file names.
  13764. </p><div class="example">
  13765. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  13766. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  13767. -hls_segment_filename 'file_%v_%03d.ts' out_%v.m3u8
  13768. </pre></div>
  13769. <p>This example will produce the playlists segment file sets:
  13770. &lsquo;<tt>file_0_000.ts</tt>&rsquo;, &lsquo;<tt>file_0_001.ts</tt>&rsquo;, &lsquo;<tt>file_0_002.ts</tt>&rsquo;, etc. and
  13771. &lsquo;<tt>file_1_000.ts</tt>&rsquo;, &lsquo;<tt>file_1_001.ts</tt>&rsquo;, &lsquo;<tt>file_1_002.ts</tt>&rsquo;, etc.
  13772. </p>
  13773. <p>The string &quot;%v&quot; may be present in the filename or in the last directory name
  13774. containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
  13775. sub-directory or filename.) If the string %v is present in the directory name, then
  13776. sub-directories are created after expanding the directory name pattern. This
  13777. enables creation of segments corresponding to different variant streams in
  13778. subdirectories.
  13779. </p><div class="example">
  13780. <pre class="example">ffmpeg -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  13781. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  13782. -hls_segment_filename 'vs%v/file_%03d.ts' vs%v/out.m3u8
  13783. </pre></div>
  13784. <p>This example will produce the playlists segment file sets:
  13785. &lsquo;<tt>vs0/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs0/file_002.ts</tt>&rsquo;, etc. and
  13786. &lsquo;<tt>vs1/file_000.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_001.ts</tt>&rsquo;, &lsquo;<tt>vs1/file_002.ts</tt>&rsquo;, etc.
  13787. </p>
  13788. </dd>
  13789. <dt>&lsquo;<samp>use_localtime</samp>&rsquo;</dt>
  13790. <dd><p>Same as strftime option, will be deprecated.
  13791. </p>
  13792. </dd>
  13793. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  13794. <dd><p>Use strftime() on <var>filename</var> to expand the segment filename with localtime.
  13795. The segment number is also available in this mode, but to use it, you need to specify second_level_segment_index
  13796. hls_flag and %%d will be the specifier.
  13797. </p><div class="example">
  13798. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
  13799. </pre></div>
  13800. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13801. &lsquo;<tt>file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13802. Note: On some systems/environments, the <code>%s</code> specifier is not available. See
  13803. <code>strftime()</code> documentation.
  13804. </p><div class="example">
  13805. <pre class="example">ffmpeg -i in.nut -strftime 1 -hls_flags second_level_segment_index -hls_segment_filename 'file-%Y%m%d-%%04d.ts' out.m3u8
  13806. </pre></div>
  13807. <p>This example will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13808. &lsquo;<tt>file-20160215-0001.ts</tt>&rsquo;, &lsquo;<tt>file-20160215-0002.ts</tt>&rsquo;, etc.
  13809. </p>
  13810. </dd>
  13811. <dt>&lsquo;<samp>use_localtime_mkdir</samp>&rsquo;</dt>
  13812. <dd><p>Same as strftime_mkdir option, will be deprecated .
  13813. </p>
  13814. </dd>
  13815. <dt>&lsquo;<samp>strftime_mkdir</samp>&rsquo;</dt>
  13816. <dd><p>Used together with -strftime_mkdir, it will create all subdirectories which
  13817. is expanded in <var>filename</var>.
  13818. </p><div class="example">
  13819. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
  13820. </pre></div>
  13821. <p>This example will create a directory 201560215 (if it does not exist), and then
  13822. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13823. &lsquo;<tt>20160215/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>20160215/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13824. </p>
  13825. <div class="example">
  13826. <pre class="example">ffmpeg -i in.nut -strftime 1 -strftime_mkdir 1 -hls_segment_filename '%Y/%m/%d/file-%Y%m%d-%s.ts' out.m3u8
  13827. </pre></div>
  13828. <p>This example will create a directory hierarchy 2016/02/15 (if any of them do not exist), and then
  13829. produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and segment files:
  13830. &lsquo;<tt>2016/02/15/file-20160215-1455569023.ts</tt>&rsquo;, &lsquo;<tt>2016/02/15/file-20160215-1455569024.ts</tt>&rsquo;, etc.
  13831. </p>
  13832. </dd>
  13833. <dt>&lsquo;<samp>hls_key_info_file <var>key_info_file</var></samp>&rsquo;</dt>
  13834. <dd><p>Use the information in <var>key_info_file</var> for segment encryption. The first
  13835. line of <var>key_info_file</var> specifies the key URI written to the playlist. The
  13836. key URL is used to access the encryption key during playback. The second line
  13837. specifies the path to the key file used to obtain the key during the encryption
  13838. process. The key file is read as a single packed array of 16 octets in binary
  13839. format. The optional third line specifies the initialization vector (IV) as a
  13840. hexadecimal string to be used instead of the segment sequence number (default)
  13841. for encryption. Changes to <var>key_info_file</var> will result in segment
  13842. encryption with the new key/IV and an entry in the playlist for the new key
  13843. URI/IV if <code>hls_flags periodic_rekey</code> is enabled.
  13844. </p>
  13845. <p>Key info file format:
  13846. </p><div class="example">
  13847. <pre class="example"><var>key URI</var>
  13848. <var>key file path</var>
  13849. <var>IV</var> (optional)
  13850. </pre></div>
  13851. <p>Example key URIs:
  13852. </p><div class="example">
  13853. <pre class="example">http://server/file.key
  13854. /path/to/file.key
  13855. file.key
  13856. </pre></div>
  13857. <p>Example key file paths:
  13858. </p><div class="example">
  13859. <pre class="example">file.key
  13860. /path/to/file.key
  13861. </pre></div>
  13862. <p>Example IV:
  13863. </p><div class="example">
  13864. <pre class="example">0123456789ABCDEF0123456789ABCDEF
  13865. </pre></div>
  13866. <p>Key info file example:
  13867. </p><div class="example">
  13868. <pre class="example">http://server/file.key
  13869. /path/to/file.key
  13870. 0123456789ABCDEF0123456789ABCDEF
  13871. </pre></div>
  13872. <p>Example shell script:
  13873. </p><div class="example">
  13874. <pre class="example">#!/bin/sh
  13875. BASE_URL=${1:-'.'}
  13876. openssl rand 16 &gt; file.key
  13877. echo $BASE_URL/file.key &gt; file.keyinfo
  13878. echo file.key &gt;&gt; file.keyinfo
  13879. echo $(openssl rand -hex 16) &gt;&gt; file.keyinfo
  13880. ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
  13881. -hls_key_info_file file.keyinfo out.m3u8
  13882. </pre></div>
  13883. </dd>
  13884. <dt>&lsquo;<samp>-hls_enc <var>enc</var></samp>&rsquo;</dt>
  13885. <dd><p>Enable (1) or disable (0) the AES128 encryption.
  13886. When enabled every segment generated is encrypted and the encryption key
  13887. is saved as <var>playlist name</var>.key.
  13888. </p>
  13889. </dd>
  13890. <dt>&lsquo;<samp>-hls_enc_key <var>key</var></samp>&rsquo;</dt>
  13891. <dd><p>Hex-coded 16byte key to encrypt the segments, by default it
  13892. is randomly generated.
  13893. </p>
  13894. </dd>
  13895. <dt>&lsquo;<samp>-hls_enc_key_url <var>keyurl</var></samp>&rsquo;</dt>
  13896. <dd><p>If set, <var>keyurl</var> is prepended instead of <var>baseurl</var> to the key filename
  13897. in the playlist.
  13898. </p>
  13899. </dd>
  13900. <dt>&lsquo;<samp>-hls_enc_iv <var>iv</var></samp>&rsquo;</dt>
  13901. <dd><p>Hex-coded 16byte initialization vector for every segment instead
  13902. of the autogenerated ones.
  13903. </p>
  13904. </dd>
  13905. <dt>&lsquo;<samp>hls_segment_type <var>flags</var></samp>&rsquo;</dt>
  13906. <dd><p>Possible values:
  13907. </p>
  13908. <dl compact="compact">
  13909. <dt>&lsquo;<samp>mpegts</samp>&rsquo;</dt>
  13910. <dd><p>Output segment files in MPEG-2 Transport Stream format. This is
  13911. compatible with all HLS versions.
  13912. </p>
  13913. </dd>
  13914. <dt>&lsquo;<samp>fmp4</samp>&rsquo;</dt>
  13915. <dd><p>Output segment files in fragmented MP4 format, similar to MPEG-DASH.
  13916. fmp4 files may be used in HLS version 7 and above.
  13917. </p>
  13918. </dd>
  13919. </dl>
  13920. </dd>
  13921. <dt>&lsquo;<samp>hls_fmp4_init_filename <var>filename</var></samp>&rsquo;</dt>
  13922. <dd><p>Set filename to the fragment files header file, default filename is &lsquo;<tt>init.mp4</tt>&rsquo;.
  13923. </p>
  13924. <p>When <code>var_stream_map</code> is set with two or more variant streams, the
  13925. <var>filename</var> pattern must contain the string &quot;%v&quot;, this string specifies
  13926. the position of variant stream index in the generated init file names.
  13927. The string &quot;%v&quot; may be present in the filename or in the last directory name
  13928. containing the file. If the string is present in the directory name, then
  13929. sub-directories are created after expanding the directory name pattern. This
  13930. enables creation of init files corresponding to different variant streams in
  13931. subdirectories.
  13932. </p>
  13933. </dd>
  13934. <dt>&lsquo;<samp>hls_flags <var>flags</var></samp>&rsquo;</dt>
  13935. <dd><p>Possible values:
  13936. </p>
  13937. <dl compact="compact">
  13938. <dt>&lsquo;<samp>single_file</samp>&rsquo;</dt>
  13939. <dd><p>If this flag is set, the muxer will store all segments in a single MPEG-TS
  13940. file, and will use byte ranges in the playlist. HLS playlists generated with
  13941. this way will have the version number 4.
  13942. For example:
  13943. </p><div class="example">
  13944. <pre class="example">ffmpeg -i in.nut -hls_flags single_file out.m3u8
  13945. </pre></div>
  13946. <p>Will produce the playlist, &lsquo;<tt>out.m3u8</tt>&rsquo;, and a single segment file,
  13947. &lsquo;<tt>out.ts</tt>&rsquo;.
  13948. </p>
  13949. </dd>
  13950. <dt>&lsquo;<samp>delete_segments</samp>&rsquo;</dt>
  13951. <dd><p>Segment files removed from the playlist are deleted after a period of time
  13952. equal to the duration of the segment plus the duration of the playlist.
  13953. </p>
  13954. </dd>
  13955. <dt>&lsquo;<samp>append_list</samp>&rsquo;</dt>
  13956. <dd><p>Append new segments into the end of old segment list,
  13957. and remove the <code>#EXT-X-ENDLIST</code> from the old segment list.
  13958. </p>
  13959. </dd>
  13960. <dt>&lsquo;<samp>round_durations</samp>&rsquo;</dt>
  13961. <dd><p>Round the duration info in the playlist file segment info to integer
  13962. values, instead of using floating point.
  13963. </p>
  13964. </dd>
  13965. <dt>&lsquo;<samp>discont_start</samp>&rsquo;</dt>
  13966. <dd><p>Add the <code>#EXT-X-DISCONTINUITY</code> tag to the playlist, before the
  13967. first segment&rsquo;s information.
  13968. </p>
  13969. </dd>
  13970. <dt>&lsquo;<samp>omit_endlist</samp>&rsquo;</dt>
  13971. <dd><p>Do not append the <code>EXT-X-ENDLIST</code> tag at the end of the playlist.
  13972. </p>
  13973. </dd>
  13974. <dt>&lsquo;<samp>periodic_rekey</samp>&rsquo;</dt>
  13975. <dd><p>The file specified by <code>hls_key_info_file</code> will be checked periodically and
  13976. detect updates to the encryption info. Be sure to replace this file atomically,
  13977. including the file containing the AES encryption key.
  13978. </p>
  13979. </dd>
  13980. <dt>&lsquo;<samp>independent_segments</samp>&rsquo;</dt>
  13981. <dd><p>Add the <code>#EXT-X-INDEPENDENT-SEGMENTS</code> to playlists that has video segments
  13982. and when all the segments of that playlist are guaranteed to start with a Key frame.
  13983. </p>
  13984. </dd>
  13985. <dt>&lsquo;<samp>iframes_only</samp>&rsquo;</dt>
  13986. <dd><p>Add the <code>#EXT-X-I-FRAMES-ONLY</code> to playlists that has video segments
  13987. and can play only I-frames in the <code>#EXT-X-BYTERANGE</code> mode.
  13988. </p>
  13989. </dd>
  13990. <dt>&lsquo;<samp>split_by_time</samp>&rsquo;</dt>
  13991. <dd><p>Allow segments to start on frames other than keyframes. This improves
  13992. behavior on some players when the time between keyframes is inconsistent,
  13993. but may make things worse on others, and can cause some oddities during
  13994. seeking. This flag should be used with the <code>hls_time</code> option.
  13995. </p>
  13996. </dd>
  13997. <dt>&lsquo;<samp>program_date_time</samp>&rsquo;</dt>
  13998. <dd><p>Generate <code>EXT-X-PROGRAM-DATE-TIME</code> tags.
  13999. </p>
  14000. </dd>
  14001. <dt>&lsquo;<samp>second_level_segment_index</samp>&rsquo;</dt>
  14002. <dd><p>Makes it possible to use segment indexes as %%d in hls_segment_filename expression
  14003. besides date/time values when strftime is on.
  14004. To get fixed width numbers with trailing zeroes, %%0xd format is available where x is the required width.
  14005. </p>
  14006. </dd>
  14007. <dt>&lsquo;<samp>second_level_segment_size</samp>&rsquo;</dt>
  14008. <dd><p>Makes it possible to use segment sizes (counted in bytes) as %%s in hls_segment_filename
  14009. expression besides date/time values when strftime is on.
  14010. To get fixed width numbers with trailing zeroes, %%0xs format is available where x is the required width.
  14011. </p>
  14012. </dd>
  14013. <dt>&lsquo;<samp>second_level_segment_duration</samp>&rsquo;</dt>
  14014. <dd><p>Makes it possible to use segment duration (calculated in microseconds) as %%t in hls_segment_filename
  14015. expression besides date/time values when strftime is on.
  14016. To get fixed width numbers with trailing zeroes, %%0xt format is available where x is the required width.
  14017. </p>
  14018. <div class="example">
  14019. <pre class="example">ffmpeg -i sample.mpeg \
  14020. -f hls -hls_time 3 -hls_list_size 5 \
  14021. -hls_flags second_level_segment_index+second_level_segment_size+second_level_segment_duration \
  14022. -strftime 1 -strftime_mkdir 1 -hls_segment_filename &quot;segment_%Y%m%d%H%M%S_%%04d_%%08s_%%013t.ts&quot; stream.m3u8
  14023. </pre></div>
  14024. <p>This will produce segments like this:
  14025. &lsquo;<tt>segment_20170102194334_0003_00122200_0000003000000.ts</tt>&rsquo;, &lsquo;<tt>segment_20170102194334_0004_00120072_0000003000000.ts</tt>&rsquo; etc.
  14026. </p>
  14027. </dd>
  14028. <dt>&lsquo;<samp>temp_file</samp>&rsquo;</dt>
  14029. <dd><p>Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
  14030. serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
  14031. before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
  14032. If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
  14033. But playlists with <code>file</code> protocol and with type (<code>hls_playlist_type</code>) other than <code>vod</code>
  14034. are always written into temporary file regardless of this flag. Master playlist files (<code>master_pl_name</code>), if any, with <code>file</code> protocol,
  14035. are always written into temporary file regardless of this flag if <code>master_pl_publish_rate</code> value is other than zero.
  14036. </p>
  14037. </dd>
  14038. </dl>
  14039. </dd>
  14040. <dt>&lsquo;<samp>hls_playlist_type event</samp>&rsquo;</dt>
  14041. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:EVENT</code> in the m3u8 header. Forces
  14042. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist can only be appended to.
  14043. </p>
  14044. </dd>
  14045. <dt>&lsquo;<samp>hls_playlist_type vod</samp>&rsquo;</dt>
  14046. <dd><p>Emit <code>#EXT-X-PLAYLIST-TYPE:VOD</code> in the m3u8 header. Forces
  14047. &lsquo;<samp>hls_list_size</samp>&rsquo; to 0; the playlist must not change.
  14048. </p>
  14049. </dd>
  14050. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  14051. <dd><p>Use the given HTTP method to create the hls files.
  14052. </p><div class="example">
  14053. <pre class="example">ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
  14054. </pre></div>
  14055. <p>This example will upload all the mpegts segment files to the HTTP
  14056. server using the HTTP PUT method, and update the m3u8 files every
  14057. <code>refresh</code> times using the same method.
  14058. Note that the HTTP server must support the given method for uploading
  14059. files.
  14060. </p>
  14061. </dd>
  14062. <dt>&lsquo;<samp>http_user_agent</samp>&rsquo;</dt>
  14063. <dd><p>Override User-Agent field in HTTP header. Applicable only for HTTP output.
  14064. </p>
  14065. </dd>
  14066. <dt>&lsquo;<samp>var_stream_map</samp>&rsquo;</dt>
  14067. <dd><p>Map string which specifies how to group the audio, video and subtitle streams
  14068. into different variant streams. The variant stream groups are separated
  14069. by space.
  14070. Expected string format is like this &quot;a:0,v:0 a:1,v:1 ....&quot;. Here a:, v:, s: are
  14071. the keys to specify audio, video and subtitle streams respectively.
  14072. Allowed values are 0 to 9 (limited just based on practical usage).
  14073. </p>
  14074. <p>When there are two or more variant streams, the output filename pattern must
  14075. contain the string &quot;%v&quot;, this string specifies the position of variant stream
  14076. index in the output media playlist filenames. The string &quot;%v&quot; may be present in
  14077. the filename or in the last directory name containing the file. If the string is
  14078. present in the directory name, then sub-directories are created after expanding
  14079. the directory name pattern. This enables creation of variant streams in
  14080. subdirectories.
  14081. </p>
  14082. <div class="example">
  14083. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14084. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  14085. http://example.com/live/out_%v.m3u8
  14086. </pre></div>
  14087. <p>This example creates two hls variant streams. The first variant stream will
  14088. contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
  14089. second variant stream will contain video stream of bitrate 256k and audio
  14090. stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
  14091. out_1.m3u8 will be created. If you want something meaningful text instead of indexes
  14092. in result names, you may specify names for each or some of the variants
  14093. as in the following example.
  14094. </p>
  14095. <div class="example">
  14096. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14097. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0,name:my_hd v:1,a:1,name:my_sd&quot; \
  14098. http://example.com/live/out_%v.m3u8
  14099. </pre></div>
  14100. <p>This example creates two hls variant streams as in the previous one.
  14101. But here, the two media playlist with file names out_my_hd.m3u8 and
  14102. out_my_sd.m3u8 will be created.
  14103. </p>
  14104. <div class="example">
  14105. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
  14106. -map 0:v -map 0:a -map 0:v -f hls -var_stream_map &quot;v:0 a:0 v:1&quot; \
  14107. http://example.com/live/out_%v.m3u8
  14108. </pre></div>
  14109. <p>This example creates three hls variant streams. The first variant stream will
  14110. be a video only stream with video bitrate 1000k, the second variant stream will
  14111. be an audio only stream with bitrate 64k and the third variant stream will be a
  14112. video only stream with bitrate 256k. Here, three media playlist with file names
  14113. out_0.m3u8, out_1.m3u8 and out_2.m3u8 will be created.
  14114. </p><div class="example">
  14115. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14116. -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map &quot;v:0,a:0 v:1,a:1&quot; \
  14117. http://example.com/live/vs_%v/out.m3u8
  14118. </pre></div>
  14119. <p>This example creates the variant streams in subdirectories. Here, the first
  14120. media playlist is created at &lsquo;<tt>http://example.com/live/vs_0/out.m3u8</tt>&rsquo; and
  14121. the second one at &lsquo;<tt>http://example.com/live/vs_1/out.m3u8</tt>&rsquo;.
  14122. </p><div class="example">
  14123. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k -b:v:1 3000k \
  14124. -map 0:a -map 0:a -map 0:v -map 0:v -f hls \
  14125. -var_stream_map &quot;a:0,agroup:aud_low a:1,agroup:aud_high v:0,agroup:aud_low v:1,agroup:aud_high&quot; \
  14126. -master_pl_name master.m3u8 \
  14127. http://example.com/live/out_%v.m3u8
  14128. </pre></div>
  14129. <p>This example creates two audio only and two video only variant streams. In
  14130. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14131. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14132. and they are mapped to the two video only variant streams with audio group names
  14133. &rsquo;aud_low&rsquo; and &rsquo;aud_high&rsquo;.
  14134. </p>
  14135. <p>By default, a single hls variant containing all the encoded streams is created.
  14136. </p>
  14137. <div class="example">
  14138. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14139. -map 0:a -map 0:a -map 0:v -f hls \
  14140. -var_stream_map &quot;a:0,agroup:aud_low,default:yes a:1,agroup:aud_low v:0,agroup:aud_low&quot; \
  14141. -master_pl_name master.m3u8 \
  14142. http://example.com/live/out_%v.m3u8
  14143. </pre></div>
  14144. <p>This example creates two audio only and one video only variant streams. In
  14145. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14146. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14147. and they are mapped to the one video only variant streams with audio group name
  14148. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES.
  14149. </p>
  14150. <p>By default, a single hls variant containing all the encoded streams is created.
  14151. </p>
  14152. <div class="example">
  14153. <pre class="example">ffmpeg -re -i in.ts -b:a:0 32k -b:a:1 64k -b:v:0 1000k \
  14154. -map 0:a -map 0:a -map 0:v -f hls \
  14155. -var_stream_map &quot;a:0,agroup:aud_low,default:yes,language:ENG a:1,agroup:aud_low,language:CHN v:0,agroup:aud_low&quot; \
  14156. -master_pl_name master.m3u8 \
  14157. http://example.com/live/out_%v.m3u8
  14158. </pre></div>
  14159. <p>This example creates two audio only and one video only variant streams. In
  14160. addition to the #EXT-X-STREAM-INF tag for each variant stream in the master
  14161. playlist, #EXT-X-MEDIA tag is also added for the two audio only variant streams
  14162. and they are mapped to the one video only variant streams with audio group name
  14163. &rsquo;aud_low&rsquo;, and the audio group have default stat is NO or YES, and one audio
  14164. have and language is named ENG, the other audio language is named CHN.
  14165. </p>
  14166. <p>By default, a single hls variant containing all the encoded streams is created.
  14167. </p>
  14168. </dd>
  14169. <dt>&lsquo;<samp>cc_stream_map</samp>&rsquo;</dt>
  14170. <dd><p>Map string which specifies different closed captions groups and their
  14171. attributes. The closed captions stream groups are separated by space.
  14172. Expected string format is like this
  14173. &quot;ccgroup:&lt;group name&gt;,instreamid:&lt;INSTREAM-ID&gt;,language:&lt;language code&gt; ....&quot;.
  14174. &rsquo;ccgroup&rsquo; and &rsquo;instreamid&rsquo; are mandatory attributes. &rsquo;language&rsquo; is an optional
  14175. attribute.
  14176. The closed captions groups configured using this option are mapped to different
  14177. variant streams by providing the same &rsquo;ccgroup&rsquo; name in the
  14178. <code>var_stream_map</code> string. If <code>var_stream_map</code> is not set, then the
  14179. first available ccgroup in <code>cc_stream_map</code> is mapped to the output variant
  14180. stream. The examples for these two use cases are given below.
  14181. </p>
  14182. <div class="example">
  14183. <pre class="example">ffmpeg -re -i in.ts -b:v 1000k -b:a 64k -a53cc 1 -f hls \
  14184. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en&quot; \
  14185. -master_pl_name master.m3u8 \
  14186. http://example.com/live/out.m3u8
  14187. </pre></div>
  14188. <p>This example adds <code>#EXT-X-MEDIA</code> tag with <code>TYPE=CLOSED-CAPTIONS</code> in
  14189. the master playlist with group name &rsquo;cc&rsquo;, language &rsquo;en&rsquo; (english) and
  14190. INSTREAM-ID &rsquo;CC1&rsquo;. Also, it adds <code>CLOSED-CAPTIONS</code> attribute with group
  14191. name &rsquo;cc&rsquo; for the output variant stream.
  14192. </p><div class="example">
  14193. <pre class="example">ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
  14194. -a53cc:0 1 -a53cc:1 1\
  14195. -map 0:v -map 0:a -map 0:v -map 0:a -f hls \
  14196. -cc_stream_map &quot;ccgroup:cc,instreamid:CC1,language:en ccgroup:cc,instreamid:CC2,language:sp&quot; \
  14197. -var_stream_map &quot;v:0,a:0,ccgroup:cc v:1,a:1,ccgroup:cc&quot; \
  14198. -master_pl_name master.m3u8 \
  14199. http://example.com/live/out_%v.m3u8
  14200. </pre></div>
  14201. <p>This example adds two <code>#EXT-X-MEDIA</code> tags with <code>TYPE=CLOSED-CAPTIONS</code> in
  14202. the master playlist for the INSTREAM-IDs &rsquo;CC1&rsquo; and &rsquo;CC2&rsquo;. Also, it adds
  14203. <code>CLOSED-CAPTIONS</code> attribute with group name &rsquo;cc&rsquo; for the two output variant
  14204. streams.
  14205. </p>
  14206. </dd>
  14207. <dt>&lsquo;<samp>master_pl_name</samp>&rsquo;</dt>
  14208. <dd><p>Create HLS master playlist with the given name.
  14209. </p>
  14210. <div class="example">
  14211. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 http://example.com/live/out.m3u8
  14212. </pre></div>
  14213. <p>This example creates HLS master playlist with name master.m3u8 and it is
  14214. published at http://example.com/live/
  14215. </p>
  14216. </dd>
  14217. <dt>&lsquo;<samp>master_pl_publish_rate</samp>&rsquo;</dt>
  14218. <dd><p>Publish master play list repeatedly every after specified number of segment intervals.
  14219. </p>
  14220. <div class="example">
  14221. <pre class="example">ffmpeg -re -i in.ts -f hls -master_pl_name master.m3u8 \
  14222. -hls_time 2 -master_pl_publish_rate 30 http://example.com/live/out.m3u8
  14223. </pre></div>
  14224. <p>This example creates HLS master playlist with name master.m3u8 and keep
  14225. publishing it repeatedly every after 30 segments i.e. every after 60s.
  14226. </p>
  14227. </dd>
  14228. <dt>&lsquo;<samp>http_persistent</samp>&rsquo;</dt>
  14229. <dd><p>Use persistent HTTP connections. Applicable only for HTTP output.
  14230. </p>
  14231. </dd>
  14232. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  14233. <dd><p>Set timeout for socket I/O operations. Applicable only for HTTP output.
  14234. </p>
  14235. </dd>
  14236. <dt>&lsquo;<samp>-ignore_io_errors</samp>&rsquo;</dt>
  14237. <dd><p>Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
  14238. </p>
  14239. </dd>
  14240. <dt>&lsquo;<samp>headers</samp>&rsquo;</dt>
  14241. <dd><p>Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
  14242. </p>
  14243. </dd>
  14244. </dl>
  14245. <p><a name="ico"></a>
  14246. </p><a name="ico-1"></a>
  14247. <h2 class="section"><a href="ffmpeg-all.html#toc-ico-1">21.14 ico</a></h2>
  14248. <p>ICO file muxer.
  14249. </p>
  14250. <p>Microsoft&rsquo;s icon file format (ICO) has some strict limitations that should be noted:
  14251. </p>
  14252. <ul>
  14253. <li>
  14254. Size cannot exceed 256 pixels in any dimension
  14255. </li><li>
  14256. Only BMP and PNG images can be stored
  14257. </li><li>
  14258. If a BMP image is used, it must be one of the following pixel formats:
  14259. <div class="example">
  14260. <pre class="example">BMP Bit Depth FFmpeg Pixel Format
  14261. 1bit pal8
  14262. 4bit pal8
  14263. 8bit pal8
  14264. 16bit rgb555le
  14265. 24bit bgr24
  14266. 32bit bgra
  14267. </pre></div>
  14268. </li><li>
  14269. If a BMP image is used, it must use the BITMAPINFOHEADER DIB header
  14270. </li><li>
  14271. If a PNG image is used, it must use the rgba pixel format
  14272. </li></ul>
  14273. <p><a name="image2"></a>
  14274. </p><a name="image2-1"></a>
  14275. <h2 class="section"><a href="ffmpeg-all.html#toc-image2-1">21.15 image2</a></h2>
  14276. <p>Image file muxer.
  14277. </p>
  14278. <p>The image file muxer writes video frames to image files.
  14279. </p>
  14280. <p>The output filenames are specified by a pattern, which can be used to
  14281. produce sequentially numbered series of files.
  14282. The pattern may contain the string &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, this string
  14283. specifies the position of the characters representing a numbering in
  14284. the filenames. If the form &quot;%0<var>N</var>d&quot; is used, the string
  14285. representing the number in each filename is 0-padded to <var>N</var>
  14286. digits. The literal character &rsquo;%&rsquo; can be specified in the pattern with
  14287. the string &quot;%%&quot;.
  14288. </p>
  14289. <p>If the pattern contains &quot;%d&quot; or &quot;%0<var>N</var>d&quot;, the first filename of
  14290. the file list specified will contain the number 1, all the following
  14291. numbers will be sequential.
  14292. </p>
  14293. <p>The pattern may contain a suffix which is used to automatically
  14294. determine the format of the image files to write.
  14295. </p>
  14296. <p>For example the pattern &quot;img-%03d.bmp&quot; will specify a sequence of
  14297. filenames of the form &lsquo;<tt>img-001.bmp</tt>&rsquo;, &lsquo;<tt>img-002.bmp</tt>&rsquo;, ...,
  14298. &lsquo;<tt>img-010.bmp</tt>&rsquo;, etc.
  14299. The pattern &quot;img%%-%d.jpg&quot; will specify a sequence of filenames of the
  14300. form &lsquo;<tt>img%-1.jpg</tt>&rsquo;, &lsquo;<tt>img%-2.jpg</tt>&rsquo;, ..., &lsquo;<tt>img%-10.jpg</tt>&rsquo;,
  14301. etc.
  14302. </p>
  14303. <p>The image muxer supports the .Y.U.V image file format. This format is
  14304. special in that that each image frame consists of three files, for
  14305. each of the YUV420P components. To read or write this image file format,
  14306. specify the name of the &rsquo;.Y&rsquo; file. The muxer will automatically open the
  14307. &rsquo;.U&rsquo; and &rsquo;.V&rsquo; files as required.
  14308. </p>
  14309. <a name="Options-64"></a>
  14310. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-64">21.15.1 Options</a></h3>
  14311. <dl compact="compact">
  14312. <dt>&lsquo;<samp>frame_pts</samp>&rsquo;</dt>
  14313. <dd><p>If set to 1, expand the filename with pts from pkt-&gt;pts.
  14314. Default value is 0.
  14315. </p>
  14316. </dd>
  14317. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  14318. <dd><p>Start the sequence from the specified number. Default value is 1.
  14319. </p>
  14320. </dd>
  14321. <dt>&lsquo;<samp>update</samp>&rsquo;</dt>
  14322. <dd><p>If set to 1, the filename will always be interpreted as just a
  14323. filename, not a pattern, and the corresponding file will be continuously
  14324. overwritten with new images. Default value is 0.
  14325. </p>
  14326. </dd>
  14327. <dt>&lsquo;<samp>strftime</samp>&rsquo;</dt>
  14328. <dd><p>If set to 1, expand the filename with date and time information from
  14329. <code>strftime()</code>. Default value is 0.
  14330. </p>
  14331. </dd>
  14332. <dt>&lsquo;<samp>protocol_opts <var>options_list</var></samp>&rsquo;</dt>
  14333. <dd><p>Set protocol options as a :-separated list of key=value parameters. Values
  14334. containing the <code>:</code> special character must be escaped.
  14335. </p>
  14336. </dd>
  14337. </dl>
  14338. <a name="Examples-104"></a>
  14339. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-104">21.15.2 Examples</a></h3>
  14340. <p>The following example shows how to use <code>ffmpeg</code> for creating a
  14341. sequence of files &lsquo;<tt>img-001.jpeg</tt>&rsquo;, &lsquo;<tt>img-002.jpeg</tt>&rsquo;, ...,
  14342. taking one image every second from the input video:
  14343. </p><div class="example">
  14344. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 -f image2 'img-%03d.jpeg'
  14345. </pre></div>
  14346. <p>Note that with <code>ffmpeg</code>, if the format is not specified with the
  14347. <code>-f</code> option and the output filename specifies an image file
  14348. format, the image2 muxer is automatically selected, so the previous
  14349. command can be written as:
  14350. </p><div class="example">
  14351. <pre class="example">ffmpeg -i in.avi -vsync cfr -r 1 'img-%03d.jpeg'
  14352. </pre></div>
  14353. <p>Note also that the pattern must not necessarily contain &quot;%d&quot; or
  14354. &quot;%0<var>N</var>d&quot;, for example to create a single image file
  14355. &lsquo;<tt>img.jpeg</tt>&rsquo; from the start of the input video you can employ the command:
  14356. </p><div class="example">
  14357. <pre class="example">ffmpeg -i in.avi -f image2 -frames:v 1 img.jpeg
  14358. </pre></div>
  14359. <p>The &lsquo;<samp>strftime</samp>&rsquo; option allows you to expand the filename with
  14360. date and time information. Check the documentation of
  14361. the <code>strftime()</code> function for the syntax.
  14362. </p>
  14363. <p>For example to generate image files from the <code>strftime()</code>
  14364. &quot;%Y-%m-%d_%H-%M-%S&quot; pattern, the following <code>ffmpeg</code> command
  14365. can be used:
  14366. </p><div class="example">
  14367. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 &quot;%Y-%m-%d_%H-%M-%S.jpg&quot;
  14368. </pre></div>
  14369. <p>You can set the file name with current frame&rsquo;s PTS:
  14370. </p><div class="example">
  14371. <pre class="example">ffmpeg -f v4l2 -r 1 -i /dev/video0 -copyts -f image2 -frame_pts true %d.jpg&quot;
  14372. </pre></div>
  14373. <p>A more complex example is to publish contents of your desktop directly to a
  14374. WebDAV server every second:
  14375. </p><div class="example">
  14376. <pre class="example">ffmpeg -f x11grab -framerate 1 -i :0.0 -q:v 6 -update 1 -protocol_opts method=PUT http://example.com/desktop.jpg
  14377. </pre></div>
  14378. <a name="matroska"></a>
  14379. <h2 class="section"><a href="ffmpeg-all.html#toc-matroska">21.16 matroska</a></h2>
  14380. <p>Matroska container muxer.
  14381. </p>
  14382. <p>This muxer implements the matroska and webm container specs.
  14383. </p>
  14384. <a name="Metadata-1"></a>
  14385. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Metadata-1">21.16.1 Metadata</a></h3>
  14386. <p>The recognized metadata settings in this muxer are:
  14387. </p>
  14388. <dl compact="compact">
  14389. <dt>&lsquo;<samp>title</samp>&rsquo;</dt>
  14390. <dd><p>Set title name provided to a single track.
  14391. </p>
  14392. </dd>
  14393. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  14394. <dd><p>Specify the language of the track in the Matroska languages form.
  14395. </p>
  14396. <p>The language can be either the 3 letters bibliographic ISO-639-2 (ISO
  14397. 639-2/B) form (like &quot;fre&quot; for French), or a language code mixed with a
  14398. country code for specialities in languages (like &quot;fre-ca&quot; for Canadian
  14399. French).
  14400. </p>
  14401. </dd>
  14402. <dt>&lsquo;<samp>stereo_mode</samp>&rsquo;</dt>
  14403. <dd><p>Set stereo 3D video layout of two views in a single video track.
  14404. </p>
  14405. <p>The following values are recognized:
  14406. </p><dl compact="compact">
  14407. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  14408. <dd><p>video is not stereo
  14409. </p></dd>
  14410. <dt>&lsquo;<samp>left_right</samp>&rsquo;</dt>
  14411. <dd><p>Both views are arranged side by side, Left-eye view is on the left
  14412. </p></dd>
  14413. <dt>&lsquo;<samp>bottom_top</samp>&rsquo;</dt>
  14414. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  14415. </p></dd>
  14416. <dt>&lsquo;<samp>top_bottom</samp>&rsquo;</dt>
  14417. <dd><p>Both views are arranged in top-bottom orientation, Left-eye view is on top
  14418. </p></dd>
  14419. <dt>&lsquo;<samp>checkerboard_rl</samp>&rsquo;</dt>
  14420. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  14421. </p></dd>
  14422. <dt>&lsquo;<samp>checkerboard_lr</samp>&rsquo;</dt>
  14423. <dd><p>Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  14424. </p></dd>
  14425. <dt>&lsquo;<samp>row_interleaved_rl</samp>&rsquo;</dt>
  14426. <dd><p>Each view is constituted by a row based interleaving, Right-eye view is first row
  14427. </p></dd>
  14428. <dt>&lsquo;<samp>row_interleaved_lr</samp>&rsquo;</dt>
  14429. <dd><p>Each view is constituted by a row based interleaving, Left-eye view is first row
  14430. </p></dd>
  14431. <dt>&lsquo;<samp>col_interleaved_rl</samp>&rsquo;</dt>
  14432. <dd><p>Both views are arranged in a column based interleaving manner, Right-eye view is first column
  14433. </p></dd>
  14434. <dt>&lsquo;<samp>col_interleaved_lr</samp>&rsquo;</dt>
  14435. <dd><p>Both views are arranged in a column based interleaving manner, Left-eye view is first column
  14436. </p></dd>
  14437. <dt>&lsquo;<samp>anaglyph_cyan_red</samp>&rsquo;</dt>
  14438. <dd><p>All frames are in anaglyph format viewable through red-cyan filters
  14439. </p></dd>
  14440. <dt>&lsquo;<samp>right_left</samp>&rsquo;</dt>
  14441. <dd><p>Both views are arranged side by side, Right-eye view is on the left
  14442. </p></dd>
  14443. <dt>&lsquo;<samp>anaglyph_green_magenta</samp>&rsquo;</dt>
  14444. <dd><p>All frames are in anaglyph format viewable through green-magenta filters
  14445. </p></dd>
  14446. <dt>&lsquo;<samp>block_lr</samp>&rsquo;</dt>
  14447. <dd><p>Both eyes laced in one Block, Left-eye view is first
  14448. </p></dd>
  14449. <dt>&lsquo;<samp>block_rl</samp>&rsquo;</dt>
  14450. <dd><p>Both eyes laced in one Block, Right-eye view is first
  14451. </p></dd>
  14452. </dl>
  14453. </dd>
  14454. </dl>
  14455. <p>For example a 3D WebM clip can be created using the following command line:
  14456. </p><div class="example">
  14457. <pre class="example">ffmpeg -i sample_left_right_clip.mpg -an -c:v libvpx -metadata stereo_mode=left_right -y stereo_clip.webm
  14458. </pre></div>
  14459. <a name="Options-8"></a>
  14460. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-8">21.16.2 Options</a></h3>
  14461. <p>This muxer supports the following options:
  14462. </p>
  14463. <dl compact="compact">
  14464. <dt>&lsquo;<samp>reserve_index_space</samp>&rsquo;</dt>
  14465. <dd><p>By default, this muxer writes the index for seeking (called cues in Matroska
  14466. terms) at the end of the file, because it cannot know in advance how much space
  14467. to leave for the index at the beginning of the file. However for some use cases
  14468. &ndash; e.g. streaming where seeking is possible but slow &ndash; it is useful to put the
  14469. index at the beginning of the file.
  14470. </p>
  14471. <p>If this option is set to a non-zero value, the muxer will reserve a given amount
  14472. of space in the file header and then try to write the cues there when the muxing
  14473. finishes. If the available space does not suffice, muxing will fail. A safe size
  14474. for most use cases should be about 50kB per hour of video.
  14475. </p>
  14476. <p>Note that cues are only written if the output is seekable and this option will
  14477. have no effect if it is not.
  14478. </p></dd>
  14479. </dl>
  14480. <p><a name="md5"></a>
  14481. </p><a name="md5-2"></a>
  14482. <h2 class="section"><a href="ffmpeg-all.html#toc-md5-2">21.17 md5</a></h2>
  14483. <p>MD5 testing format.
  14484. </p>
  14485. <p>This is a variant of the <a href="#hash">hash</a> muxer. Unlike that muxer, it
  14486. defaults to using the MD5 hash function.
  14487. </p>
  14488. <a name="Examples-119"></a>
  14489. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-119">21.17.1 Examples</a></h3>
  14490. <p>To compute the MD5 hash of the input converted to raw
  14491. audio and video, and store it in the file &lsquo;<tt>out.md5</tt>&rsquo;:
  14492. </p><div class="example">
  14493. <pre class="example">ffmpeg -i INPUT -f md5 out.md5
  14494. </pre></div>
  14495. <p>You can print the MD5 to stdout with the command:
  14496. </p><div class="example">
  14497. <pre class="example">ffmpeg -i INPUT -f md5 -
  14498. </pre></div>
  14499. <p>See also the <a href="#hash">hash</a> and <a href="#framemd5">framemd5</a> muxers.
  14500. </p>
  14501. <a name="mov_002c-mp4_002c-ismv"></a>
  14502. <h2 class="section"><a href="ffmpeg-all.html#toc-mov_002c-mp4_002c-ismv">21.18 mov, mp4, ismv</a></h2>
  14503. <p>MOV/MP4/ISMV (Smooth Streaming) muxer.
  14504. </p>
  14505. <p>The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  14506. file has all the metadata about all packets stored in one location
  14507. (written at the end of the file, it can be moved to the start for
  14508. better playback by adding <var>faststart</var> to the <var>movflags</var>, or
  14509. using the <code>qt-faststart</code> tool). A fragmented
  14510. file consists of a number of fragments, where packets and metadata
  14511. about these packets are stored together. Writing a fragmented
  14512. file has the advantage that the file is decodable even if the
  14513. writing is interrupted (while a normal MOV/MP4 is undecodable if
  14514. it is not properly finished), and it requires less memory when writing
  14515. very long files (since writing normal MOV/MP4 files stores info about
  14516. every single packet in memory until the file is closed). The downside
  14517. is that it is less compatible with other applications.
  14518. </p>
  14519. <a name="Options-75"></a>
  14520. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-75">21.18.1 Options</a></h3>
  14521. <p>Fragmentation is enabled by setting one of the AVOptions that define
  14522. how to cut the file into fragments:
  14523. </p>
  14524. <dl compact="compact">
  14525. <dt>&lsquo;<samp>-moov_size <var>bytes</var></samp>&rsquo;</dt>
  14526. <dd><p>Reserves space for the moov atom at the beginning of the file instead of placing the
  14527. moov atom at the end. If the space reserved is insufficient, muxing will fail.
  14528. </p></dd>
  14529. <dt>&lsquo;<samp>-movflags frag_keyframe</samp>&rsquo;</dt>
  14530. <dd><p>Start a new fragment at each video keyframe.
  14531. </p></dd>
  14532. <dt>&lsquo;<samp>-frag_duration <var>duration</var></samp>&rsquo;</dt>
  14533. <dd><p>Create fragments that are <var>duration</var> microseconds long.
  14534. </p></dd>
  14535. <dt>&lsquo;<samp>-frag_size <var>size</var></samp>&rsquo;</dt>
  14536. <dd><p>Create fragments that contain up to <var>size</var> bytes of payload data.
  14537. </p></dd>
  14538. <dt>&lsquo;<samp>-movflags frag_custom</samp>&rsquo;</dt>
  14539. <dd><p>Allow the caller to manually choose when to cut fragments, by
  14540. calling <code>av_write_frame(ctx, NULL)</code> to write a fragment with
  14541. the packets written so far. (This is only useful with other
  14542. applications integrating libavformat, not from <code>ffmpeg</code>.)
  14543. </p></dd>
  14544. <dt>&lsquo;<samp>-min_frag_duration <var>duration</var></samp>&rsquo;</dt>
  14545. <dd><p>Don&rsquo;t create fragments that are shorter than <var>duration</var> microseconds long.
  14546. </p></dd>
  14547. </dl>
  14548. <p>If more than one condition is specified, fragments are cut when
  14549. one of the specified conditions is fulfilled. The exception to this is
  14550. <code>-min_frag_duration</code>, which has to be fulfilled for any of the other
  14551. conditions to apply.
  14552. </p>
  14553. <p>Additionally, the way the output file is written can be adjusted
  14554. through a few other options:
  14555. </p>
  14556. <dl compact="compact">
  14557. <dt>&lsquo;<samp>-movflags empty_moov</samp>&rsquo;</dt>
  14558. <dd><p>Write an initial moov atom directly at the start of the file, without
  14559. describing any samples in it. Generally, an mdat/moov pair is written
  14560. at the start of the file, as a normal MOV/MP4 file, containing only
  14561. a short portion of the file. With this option set, there is no initial
  14562. mdat atom, and the moov atom only describes the tracks but has
  14563. a zero duration.
  14564. </p>
  14565. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14566. </p></dd>
  14567. <dt>&lsquo;<samp>-movflags separate_moof</samp>&rsquo;</dt>
  14568. <dd><p>Write a separate moof (movie fragment) atom for each track. Normally,
  14569. packets for all tracks are written in a moof atom (which is slightly
  14570. more efficient), but with this option set, the muxer writes one moof/mdat
  14571. pair for each track, making it easier to separate tracks.
  14572. </p>
  14573. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14574. </p></dd>
  14575. <dt>&lsquo;<samp>-movflags skip_sidx</samp>&rsquo;</dt>
  14576. <dd><p>Skip writing of sidx atom. When bitrate overhead due to sidx atom is high,
  14577. this option could be used for cases where sidx atom is not mandatory.
  14578. When global_sidx flag is enabled, this option will be ignored.
  14579. </p></dd>
  14580. <dt>&lsquo;<samp>-movflags faststart</samp>&rsquo;</dt>
  14581. <dd><p>Run a second pass moving the index (moov atom) to the beginning of the file.
  14582. This operation can take a while, and will not work in various situations such
  14583. as fragmented output, thus it is not enabled by default.
  14584. </p></dd>
  14585. <dt>&lsquo;<samp>-movflags rtphint</samp>&rsquo;</dt>
  14586. <dd><p>Add RTP hinting tracks to the output file.
  14587. </p></dd>
  14588. <dt>&lsquo;<samp>-movflags disable_chpl</samp>&rsquo;</dt>
  14589. <dd><p>Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  14590. and a QuickTime chapter track are written to the file. With this option
  14591. set, only the QuickTime chapter track will be written. Nero chapters can
  14592. cause failures when the file is reprocessed with certain tagging programs, like
  14593. mp3Tag 2.61a and iTunes 11.3, most likely other versions are affected as well.
  14594. </p></dd>
  14595. <dt>&lsquo;<samp>-movflags omit_tfhd_offset</samp>&rsquo;</dt>
  14596. <dd><p>Do not write any absolute base_data_offset in tfhd atoms. This avoids
  14597. tying fragments to absolute byte positions in the file/streams.
  14598. </p></dd>
  14599. <dt>&lsquo;<samp>-movflags default_base_moof</samp>&rsquo;</dt>
  14600. <dd><p>Similarly to the omit_tfhd_offset, this flag avoids writing the
  14601. absolute base_data_offset field in tfhd atoms, but does so by using
  14602. the new default-base-is-moof flag instead. This flag is new from
  14603. 14496-12:2012. This may make the fragments easier to parse in certain
  14604. circumstances (avoiding basing track fragment location calculations
  14605. on the implicit end of the previous track fragment).
  14606. </p></dd>
  14607. <dt>&lsquo;<samp>-write_tmcd</samp>&rsquo;</dt>
  14608. <dd><p>Specify <code>on</code> to force writing a timecode track, <code>off</code> to disable it
  14609. and <code>auto</code> to write a timecode track only for mov and mp4 output (default).
  14610. </p></dd>
  14611. <dt>&lsquo;<samp>-movflags negative_cts_offsets</samp>&rsquo;</dt>
  14612. <dd><p>Enables utilization of version 1 of the CTTS box, in which the CTS offsets can
  14613. be negative. This enables the initial sample to have DTS/CTS of zero, and
  14614. reduces the need for edit lists for some cases such as video tracks with
  14615. B-frames. Additionally, eases conformance with the DASH-IF interoperability
  14616. guidelines.
  14617. </p>
  14618. <p>This option is implicitly set when writing ismv (Smooth Streaming) files.
  14619. </p></dd>
  14620. <dt>&lsquo;<samp>-write_prft</samp>&rsquo;</dt>
  14621. <dd><p>Write producer time reference box (PRFT) with a specified time source for the
  14622. NTP field in the PRFT box. Set value as &lsquo;<samp>wallclock</samp>&rsquo; to specify timesource
  14623. as wallclock time and &lsquo;<samp>pts</samp>&rsquo; to specify timesource as input packets&rsquo; PTS
  14624. values.
  14625. </p>
  14626. <p>Setting value to &lsquo;<samp>pts</samp>&rsquo; is applicable only for a live encoding use case,
  14627. where PTS values are set as as wallclock time at the source. For example, an
  14628. encoding use case with decklink capture source where &lsquo;<samp>video_pts</samp>&rsquo; and
  14629. &lsquo;<samp>audio_pts</samp>&rsquo; are set to &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  14630. </p></dd>
  14631. </dl>
  14632. <a name="Example"></a>
  14633. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example">21.18.2 Example</a></h3>
  14634. <p>Smooth Streaming content can be pushed in real time to a publishing
  14635. point on IIS with this muxer. Example:
  14636. </p><div class="example">
  14637. <pre class="example">ffmpeg -re <var>&lt;normal input/transcoding options&gt;</var> -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  14638. </pre></div>
  14639. <a name="mp3"></a>
  14640. <h2 class="section"><a href="ffmpeg-all.html#toc-mp3">21.19 mp3</a></h2>
  14641. <p>The MP3 muxer writes a raw MP3 stream with the following optional features:
  14642. </p><ul>
  14643. <li>
  14644. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  14645. 2.4 are supported, the <code>id3v2_version</code> private option controls which one is
  14646. used (3 or 4). Setting <code>id3v2_version</code> to 0 disables the ID3v2 header
  14647. completely.
  14648. <p>The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  14649. The pictures are supplied to the muxer in form of a video stream with a single
  14650. packet. There can be any number of those streams, each will correspond to a
  14651. single APIC frame. The stream metadata tags <var>title</var> and <var>comment</var> map
  14652. to APIC <var>description</var> and <var>picture type</var> respectively. See
  14653. <a href="http://id3.org/id3v2.4.0-frames">http://id3.org/id3v2.4.0-frames</a> for allowed picture types.
  14654. </p>
  14655. <p>Note that the APIC frames must be written at the beginning, so the muxer will
  14656. buffer the audio frames until it gets all the pictures. It is therefore advised
  14657. to provide the pictures as soon as possible to avoid excessive buffering.
  14658. </p>
  14659. </li><li>
  14660. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  14661. default, but will be written only if the output is seekable. The
  14662. <code>write_xing</code> private option can be used to disable it. The frame contains
  14663. various information that may be useful to the decoder, like the audio duration
  14664. or encoder delay.
  14665. </li><li>
  14666. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  14667. enabled with the <code>write_id3v1</code> private option, but as its capabilities are
  14668. very limited, its usage is not recommended.
  14669. </li></ul>
  14670. <p>Examples:
  14671. </p>
  14672. <p>Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  14673. </p><div class="example">
  14674. <pre class="example">ffmpeg -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  14675. </pre></div>
  14676. <p>To attach a picture to an mp3 file select both the audio and the picture stream
  14677. with <code>map</code>:
  14678. </p><div class="example">
  14679. <pre class="example">ffmpeg -i input.mp3 -i cover.png -c copy -map 0 -map 1
  14680. -metadata:s:v title=&quot;Album cover&quot; -metadata:s:v comment=&quot;Cover (Front)&quot; out.mp3
  14681. </pre></div>
  14682. <p>Write a &quot;clean&quot; MP3 without any extra features:
  14683. </p><div class="example">
  14684. <pre class="example">ffmpeg -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  14685. </pre></div>
  14686. <a name="mpegts"></a>
  14687. <h2 class="section"><a href="ffmpeg-all.html#toc-mpegts">21.20 mpegts</a></h2>
  14688. <p>MPEG transport stream muxer.
  14689. </p>
  14690. <p>This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  14691. </p>
  14692. <p>The recognized metadata settings in mpegts muxer are <code>service_provider</code>
  14693. and <code>service_name</code>. If they are not set the default for
  14694. <code>service_provider</code> is &lsquo;<samp>FFmpeg</samp>&rsquo; and the default for
  14695. <code>service_name</code> is &lsquo;<samp>Service01</samp>&rsquo;.
  14696. </p>
  14697. <a name="Options-34"></a>
  14698. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-34">21.20.1 Options</a></h3>
  14699. <p>The muxer options are:
  14700. </p>
  14701. <dl compact="compact">
  14702. <dt>&lsquo;<samp>mpegts_transport_stream_id <var>integer</var></samp>&rsquo;</dt>
  14703. <dd><p>Set the &lsquo;<samp>transport_stream_id</samp>&rsquo;. This identifies a transponder in DVB.
  14704. Default is <code>0x0001</code>.
  14705. </p>
  14706. </dd>
  14707. <dt>&lsquo;<samp>mpegts_original_network_id <var>integer</var></samp>&rsquo;</dt>
  14708. <dd><p>Set the &lsquo;<samp>original_network_id</samp>&rsquo;. This is unique identifier of a
  14709. network in DVB. Its main use is in the unique identification of a service
  14710. through the path &lsquo;<samp>Original_Network_ID, Transport_Stream_ID</samp>&rsquo;. Default
  14711. is <code>0x0001</code>.
  14712. </p>
  14713. </dd>
  14714. <dt>&lsquo;<samp>mpegts_service_id <var>integer</var></samp>&rsquo;</dt>
  14715. <dd><p>Set the &lsquo;<samp>service_id</samp>&rsquo;, also known as program in DVB. Default is
  14716. <code>0x0001</code>.
  14717. </p>
  14718. </dd>
  14719. <dt>&lsquo;<samp>mpegts_service_type <var>integer</var></samp>&rsquo;</dt>
  14720. <dd><p>Set the program &lsquo;<samp>service_type</samp>&rsquo;. Default is <code>digital_tv</code>.
  14721. Accepts the following options:
  14722. </p><dl compact="compact">
  14723. <dt>&lsquo;<samp>hex_value</samp>&rsquo;</dt>
  14724. <dd><p>Any hexadecimal value between <code>0x01</code> and <code>0xff</code> as defined in
  14725. ETSI 300 468.
  14726. </p></dd>
  14727. <dt>&lsquo;<samp>digital_tv</samp>&rsquo;</dt>
  14728. <dd><p>Digital TV service.
  14729. </p></dd>
  14730. <dt>&lsquo;<samp>digital_radio</samp>&rsquo;</dt>
  14731. <dd><p>Digital Radio service.
  14732. </p></dd>
  14733. <dt>&lsquo;<samp>teletext</samp>&rsquo;</dt>
  14734. <dd><p>Teletext service.
  14735. </p></dd>
  14736. <dt>&lsquo;<samp>advanced_codec_digital_radio</samp>&rsquo;</dt>
  14737. <dd><p>Advanced Codec Digital Radio service.
  14738. </p></dd>
  14739. <dt>&lsquo;<samp>mpeg2_digital_hdtv</samp>&rsquo;</dt>
  14740. <dd><p>MPEG2 Digital HDTV service.
  14741. </p></dd>
  14742. <dt>&lsquo;<samp>advanced_codec_digital_sdtv</samp>&rsquo;</dt>
  14743. <dd><p>Advanced Codec Digital SDTV service.
  14744. </p></dd>
  14745. <dt>&lsquo;<samp>advanced_codec_digital_hdtv</samp>&rsquo;</dt>
  14746. <dd><p>Advanced Codec Digital HDTV service.
  14747. </p></dd>
  14748. </dl>
  14749. </dd>
  14750. <dt>&lsquo;<samp>mpegts_pmt_start_pid <var>integer</var></samp>&rsquo;</dt>
  14751. <dd><p>Set the first PID for PMTs. Default is <code>0x1000</code>, minimum is <code>0x0020</code>,
  14752. maximum is <code>0x1ffa</code>.
  14753. </p>
  14754. </dd>
  14755. <dt>&lsquo;<samp>mpegts_start_pid <var>integer</var></samp>&rsquo;</dt>
  14756. <dd><p>Set the first PID for elementary streams. Default is <code>0x0100</code>, minimum is
  14757. <code>0x0020</code>, maximum is <code>0x1ffa</code>.
  14758. </p>
  14759. </dd>
  14760. <dt>&lsquo;<samp>mpegts_m2ts_mode <var>boolean</var></samp>&rsquo;</dt>
  14761. <dd><p>Enable m2ts mode if set to <code>1</code>. Default value is <code>-1</code> which
  14762. disables m2ts mode.
  14763. </p>
  14764. </dd>
  14765. <dt>&lsquo;<samp>muxrate <var>integer</var></samp>&rsquo;</dt>
  14766. <dd><p>Set a constant muxrate. Default is VBR.
  14767. </p>
  14768. </dd>
  14769. <dt>&lsquo;<samp>pes_payload_size <var>integer</var></samp>&rsquo;</dt>
  14770. <dd><p>Set minimum PES packet payload in bytes. Default is <code>2930</code>.
  14771. </p>
  14772. </dd>
  14773. <dt>&lsquo;<samp>mpegts_flags <var>flags</var></samp>&rsquo;</dt>
  14774. <dd><p>Set mpegts flags. Accepts the following options:
  14775. </p><dl compact="compact">
  14776. <dt>&lsquo;<samp>resend_headers</samp>&rsquo;</dt>
  14777. <dd><p>Reemit PAT/PMT before writing the next packet.
  14778. </p></dd>
  14779. <dt>&lsquo;<samp>latm</samp>&rsquo;</dt>
  14780. <dd><p>Use LATM packetization for AAC.
  14781. </p></dd>
  14782. <dt>&lsquo;<samp>pat_pmt_at_frames</samp>&rsquo;</dt>
  14783. <dd><p>Reemit PAT and PMT at each video frame.
  14784. </p></dd>
  14785. <dt>&lsquo;<samp>system_b</samp>&rsquo;</dt>
  14786. <dd><p>Conform to System B (DVB) instead of System A (ATSC).
  14787. </p></dd>
  14788. <dt>&lsquo;<samp>initial_discontinuity</samp>&rsquo;</dt>
  14789. <dd><p>Mark the initial packet of each stream as discontinuity.
  14790. </p></dd>
  14791. </dl>
  14792. </dd>
  14793. <dt>&lsquo;<samp>mpegts_copyts <var>boolean</var></samp>&rsquo;</dt>
  14794. <dd><p>Preserve original timestamps, if value is set to <code>1</code>. Default value
  14795. is <code>-1</code>, which results in shifting timestamps so that they start from 0.
  14796. </p>
  14797. </dd>
  14798. <dt>&lsquo;<samp>omit_video_pes_length <var>boolean</var></samp>&rsquo;</dt>
  14799. <dd><p>Omit the PES packet length for video packets. Default is <code>1</code> (true).
  14800. </p>
  14801. </dd>
  14802. <dt>&lsquo;<samp>pcr_period <var>integer</var></samp>&rsquo;</dt>
  14803. <dd><p>Override the default PCR retransmission time in milliseconds. Default is
  14804. <code>-1</code> which means that the PCR interval will be determined automatically:
  14805. 20 ms is used for CBR streams, the highest multiple of the frame duration which
  14806. is less than 100 ms is used for VBR streams.
  14807. </p>
  14808. </dd>
  14809. <dt>&lsquo;<samp>pat_period <var>duration</var></samp>&rsquo;</dt>
  14810. <dd><p>Maximum time in seconds between PAT/PMT tables. Default is <code>0.1</code>.
  14811. </p>
  14812. </dd>
  14813. <dt>&lsquo;<samp>sdt_period <var>duration</var></samp>&rsquo;</dt>
  14814. <dd><p>Maximum time in seconds between SDT tables. Default is <code>0.5</code>.
  14815. </p>
  14816. </dd>
  14817. <dt>&lsquo;<samp>tables_version <var>integer</var></samp>&rsquo;</dt>
  14818. <dd><p>Set PAT, PMT and SDT version (default <code>0</code>, valid values are from 0 to 31, inclusively).
  14819. This option allows updating stream structure so that standard consumer may
  14820. detect the change. To do so, reopen output <code>AVFormatContext</code> (in case of API
  14821. usage) or restart <code>ffmpeg</code> instance, cyclically changing
  14822. &lsquo;<samp>tables_version</samp>&rsquo; value:
  14823. </p>
  14824. <div class="example">
  14825. <pre class="example">ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  14826. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  14827. ...
  14828. ffmpeg -i source3.ts -codec copy -f mpegts -tables_version 31 udp://1.1.1.1:1111
  14829. ffmpeg -i source1.ts -codec copy -f mpegts -tables_version 0 udp://1.1.1.1:1111
  14830. ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
  14831. ...
  14832. </pre></div>
  14833. </dd>
  14834. </dl>
  14835. <a name="Example-9"></a>
  14836. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-9">21.20.2 Example</a></h3>
  14837. <div class="example">
  14838. <pre class="example">ffmpeg -i file.mpg -c copy \
  14839. -mpegts_original_network_id 0x1122 \
  14840. -mpegts_transport_stream_id 0x3344 \
  14841. -mpegts_service_id 0x5566 \
  14842. -mpegts_pmt_start_pid 0x1500 \
  14843. -mpegts_start_pid 0x150 \
  14844. -metadata service_provider=&quot;Some provider&quot; \
  14845. -metadata service_name=&quot;Some Channel&quot; \
  14846. out.ts
  14847. </pre></div>
  14848. <a name="mxf_002c-mxf_005fd10_002c-mxf_005fopatom"></a>
  14849. <h2 class="section"><a href="ffmpeg-all.html#toc-mxf_002c-mxf_005fd10_002c-mxf_005fopatom">21.21 mxf, mxf_d10, mxf_opatom</a></h2>
  14850. <p>MXF muxer.
  14851. </p>
  14852. <a name="Options-13"></a>
  14853. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-13">21.21.1 Options</a></h3>
  14854. <p>The muxer options are:
  14855. </p>
  14856. <dl compact="compact">
  14857. <dt>&lsquo;<samp>store_user_comments <var>bool</var></samp>&rsquo;</dt>
  14858. <dd><p>Set if user comments should be stored if available or never.
  14859. IRT D-10 does not allow user comments. The default is thus to write them for
  14860. mxf and mxf_opatom but not for mxf_d10
  14861. </p></dd>
  14862. </dl>
  14863. <a name="null"></a>
  14864. <h2 class="section"><a href="ffmpeg-all.html#toc-null">21.22 null</a></h2>
  14865. <p>Null muxer.
  14866. </p>
  14867. <p>This muxer does not generate any output file, it is mainly useful for
  14868. testing or benchmarking purposes.
  14869. </p>
  14870. <p>For example to benchmark decoding with <code>ffmpeg</code> you can use the
  14871. command:
  14872. </p><div class="example">
  14873. <pre class="example">ffmpeg -benchmark -i INPUT -f null out.null
  14874. </pre></div>
  14875. <p>Note that the above command does not read or write the &lsquo;<tt>out.null</tt>&rsquo;
  14876. file, but specifying the output file is required by the <code>ffmpeg</code>
  14877. syntax.
  14878. </p>
  14879. <p>Alternatively you can write the command as:
  14880. </p><div class="example">
  14881. <pre class="example">ffmpeg -benchmark -i INPUT -f null -
  14882. </pre></div>
  14883. <a name="nut"></a>
  14884. <h2 class="section"><a href="ffmpeg-all.html#toc-nut">21.23 nut</a></h2>
  14885. <dl compact="compact">
  14886. <dt>&lsquo;<samp>-syncpoints <var>flags</var></samp>&rsquo;</dt>
  14887. <dd><p>Change the syncpoint usage in nut:
  14888. </p><dl compact="compact">
  14889. <dt>&lsquo;<samp><var>default</var> use the normal low-overhead seeking aids.</samp>&rsquo;</dt>
  14890. <dt>&lsquo;<samp><var>none</var> do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;</samp>&rsquo;</dt>
  14891. <dd><p> Use of this option is not recommended, as the resulting files are very damage
  14892. sensitive and seeking is not possible. Also in general the overhead from
  14893. syncpoints is negligible. Note, -<code>write_index</code> 0 can be used to disable
  14894. all growing data tables, allowing to mux endless streams with limited memory
  14895. and without these disadvantages.
  14896. </p></dd>
  14897. <dt>&lsquo;<samp><var>timestamped</var> extend the syncpoint with a wallclock field.</samp>&rsquo;</dt>
  14898. </dl>
  14899. <p>The <var>none</var> and <var>timestamped</var> flags are experimental.
  14900. </p></dd>
  14901. <dt>&lsquo;<samp>-write_index <var>bool</var></samp>&rsquo;</dt>
  14902. <dd><p>Write index at the end, the default is to write an index.
  14903. </p></dd>
  14904. </dl>
  14905. <div class="example">
  14906. <pre class="example">ffmpeg -i INPUT -f_strict experimental -syncpoints none - | processor
  14907. </pre></div>
  14908. <a name="ogg"></a>
  14909. <h2 class="section"><a href="ffmpeg-all.html#toc-ogg">21.24 ogg</a></h2>
  14910. <p>Ogg container muxer.
  14911. </p>
  14912. <dl compact="compact">
  14913. <dt>&lsquo;<samp>-page_duration <var>duration</var></samp>&rsquo;</dt>
  14914. <dd><p>Preferred page duration, in microseconds. The muxer will attempt to create
  14915. pages that are approximately <var>duration</var> microseconds long. This allows the
  14916. user to compromise between seek granularity and container overhead. The default
  14917. is 1 second. A value of 0 will fill all segments, making pages as large as
  14918. possible. A value of 1 will effectively use 1 packet-per-page in most
  14919. situations, giving a small seek granularity at the cost of additional container
  14920. overhead.
  14921. </p></dd>
  14922. <dt>&lsquo;<samp>-serial_offset <var>value</var></samp>&rsquo;</dt>
  14923. <dd><p>Serial value from which to set the streams serial number.
  14924. Setting it to different and sufficiently large values ensures that the produced
  14925. ogg files can be safely chained.
  14926. </p>
  14927. </dd>
  14928. </dl>
  14929. <p><a name="segment"></a>
  14930. </p><a name="segment_002c-stream_005fsegment_002c-ssegment"></a>
  14931. <h2 class="section"><a href="ffmpeg-all.html#toc-segment_002c-stream_005fsegment_002c-ssegment">21.25 segment, stream_segment, ssegment</a></h2>
  14932. <p>Basic stream segmenter.
  14933. </p>
  14934. <p>This muxer outputs streams to a number of separate files of nearly
  14935. fixed duration. Output filename pattern can be set in a fashion
  14936. similar to <a href="#image2">image2</a>, or by using a <code>strftime</code> template if
  14937. the &lsquo;<samp>strftime</samp>&rsquo; option is enabled.
  14938. </p>
  14939. <p><code>stream_segment</code> is a variant of the muxer used to write to
  14940. streaming output formats, i.e. which do not require global headers,
  14941. and is recommended for outputting e.g. to MPEG transport stream segments.
  14942. <code>ssegment</code> is a shorter alias for <code>stream_segment</code>.
  14943. </p>
  14944. <p>Every segment starts with a keyframe of the selected reference stream,
  14945. which is set through the &lsquo;<samp>reference_stream</samp>&rsquo; option.
  14946. </p>
  14947. <p>Note that if you want accurate splitting for a video file, you need to
  14948. make the input key frames correspond to the exact splitting times
  14949. expected by the segmenter, or the segment muxer will start the new
  14950. segment with the key frame found next after the specified start
  14951. time.
  14952. </p>
  14953. <p>The segment muxer works best with a single constant frame rate video.
  14954. </p>
  14955. <p>Optionally it can generate a list of the created segments, by setting
  14956. the option <var>segment_list</var>. The list type is specified by the
  14957. <var>segment_list_type</var> option. The entry filenames in the segment
  14958. list are set by default to the basename of the corresponding segment
  14959. files.
  14960. </p>
  14961. <p>See also the <a href="#hls">hls</a> muxer, which provides a more specific
  14962. implementation for HLS segmentation.
  14963. </p>
  14964. <a name="Options-2"></a>
  14965. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-2">21.25.1 Options</a></h3>
  14966. <p>The segment muxer supports the following options:
  14967. </p>
  14968. <dl compact="compact">
  14969. <dt>&lsquo;<samp>increment_tc <var>1|0</var></samp>&rsquo;</dt>
  14970. <dd><p>if set to <code>1</code>, increment timecode between each segment
  14971. If this is selected, the input need to have
  14972. a timecode in the first video stream. Default value is
  14973. <code>0</code>.
  14974. </p>
  14975. </dd>
  14976. <dt>&lsquo;<samp>reference_stream <var>specifier</var></samp>&rsquo;</dt>
  14977. <dd><p>Set the reference stream, as specified by the string <var>specifier</var>.
  14978. If <var>specifier</var> is set to <code>auto</code>, the reference is chosen
  14979. automatically. Otherwise it must be a stream specifier (see the &ldquo;Stream
  14980. specifiers&rdquo; chapter in the ffmpeg manual) which specifies the
  14981. reference stream. The default value is <code>auto</code>.
  14982. </p>
  14983. </dd>
  14984. <dt>&lsquo;<samp>segment_format <var>format</var></samp>&rsquo;</dt>
  14985. <dd><p>Override the inner container format, by default it is guessed by the filename
  14986. extension.
  14987. </p>
  14988. </dd>
  14989. <dt>&lsquo;<samp>segment_format_options <var>options_list</var></samp>&rsquo;</dt>
  14990. <dd><p>Set output format options using a :-separated list of key=value
  14991. parameters. Values containing the <code>:</code> special character must be
  14992. escaped.
  14993. </p>
  14994. </dd>
  14995. <dt>&lsquo;<samp>segment_list <var>name</var></samp>&rsquo;</dt>
  14996. <dd><p>Generate also a listfile named <var>name</var>. If not specified no
  14997. listfile is generated.
  14998. </p>
  14999. </dd>
  15000. <dt>&lsquo;<samp>segment_list_flags <var>flags</var></samp>&rsquo;</dt>
  15001. <dd><p>Set flags affecting the segment list generation.
  15002. </p>
  15003. <p>It currently supports the following flags:
  15004. </p><dl compact="compact">
  15005. <dt>&lsquo;<samp>cache</samp>&rsquo;</dt>
  15006. <dd><p>Allow caching (only affects M3U8 list files).
  15007. </p>
  15008. </dd>
  15009. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  15010. <dd><p>Allow live-friendly file generation.
  15011. </p></dd>
  15012. </dl>
  15013. </dd>
  15014. <dt>&lsquo;<samp>segment_list_size <var>size</var></samp>&rsquo;</dt>
  15015. <dd><p>Update the list file so that it contains at most <var>size</var>
  15016. segments. If 0 the list file will contain all the segments. Default
  15017. value is 0.
  15018. </p>
  15019. </dd>
  15020. <dt>&lsquo;<samp>segment_list_entry_prefix <var>prefix</var></samp>&rsquo;</dt>
  15021. <dd><p>Prepend <var>prefix</var> to each entry. Useful to generate absolute paths.
  15022. By default no prefix is applied.
  15023. </p>
  15024. </dd>
  15025. <dt>&lsquo;<samp>segment_list_type <var>type</var></samp>&rsquo;</dt>
  15026. <dd><p>Select the listing format.
  15027. </p>
  15028. <p>The following values are recognized:
  15029. </p><dl compact="compact">
  15030. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  15031. <dd><p>Generate a flat list for the created segments, one segment per line.
  15032. </p>
  15033. </dd>
  15034. <dt>&lsquo;<samp>csv, ext</samp>&rsquo;</dt>
  15035. <dd><p>Generate a list for the created segments, one segment per line,
  15036. each line matching the format (comma-separated values):
  15037. </p><div class="example">
  15038. <pre class="example"><var>segment_filename</var>,<var>segment_start_time</var>,<var>segment_end_time</var>
  15039. </pre></div>
  15040. <p><var>segment_filename</var> is the name of the output file generated by the
  15041. muxer according to the provided pattern. CSV escaping (according to
  15042. RFC4180) is applied if required.
  15043. </p>
  15044. <p><var>segment_start_time</var> and <var>segment_end_time</var> specify
  15045. the segment start and end time expressed in seconds.
  15046. </p>
  15047. <p>A list file with the suffix <code>&quot;.csv&quot;</code> or <code>&quot;.ext&quot;</code> will
  15048. auto-select this format.
  15049. </p>
  15050. <p>&lsquo;<samp>ext</samp>&rsquo; is deprecated in favor or &lsquo;<samp>csv</samp>&rsquo;.
  15051. </p>
  15052. </dd>
  15053. <dt>&lsquo;<samp>ffconcat</samp>&rsquo;</dt>
  15054. <dd><p>Generate an ffconcat file for the created segments. The resulting file
  15055. can be read using the FFmpeg <a href="#concat">concat</a> demuxer.
  15056. </p>
  15057. <p>A list file with the suffix <code>&quot;.ffcat&quot;</code> or <code>&quot;.ffconcat&quot;</code> will
  15058. auto-select this format.
  15059. </p>
  15060. </dd>
  15061. <dt>&lsquo;<samp>m3u8</samp>&rsquo;</dt>
  15062. <dd><p>Generate an extended M3U8 file, version 3, compliant with
  15063. <a href="http://tools.ietf.org/id/draft-pantos-http-live-streaming">http://tools.ietf.org/id/draft-pantos-http-live-streaming</a>.
  15064. </p>
  15065. <p>A list file with the suffix <code>&quot;.m3u8&quot;</code> will auto-select this format.
  15066. </p></dd>
  15067. </dl>
  15068. <p>If not specified the type is guessed from the list file name suffix.
  15069. </p>
  15070. </dd>
  15071. <dt>&lsquo;<samp>segment_time <var>time</var></samp>&rsquo;</dt>
  15072. <dd><p>Set segment duration to <var>time</var>, the value must be a duration
  15073. specification. Default value is &quot;2&quot;. See also the
  15074. &lsquo;<samp>segment_times</samp>&rsquo; option.
  15075. </p>
  15076. <p>Note that splitting may not be accurate, unless you force the
  15077. reference stream key-frames at the given time. See the introductory
  15078. notice and the examples below.
  15079. </p>
  15080. </dd>
  15081. <dt>&lsquo;<samp>segment_atclocktime <var>1|0</var></samp>&rsquo;</dt>
  15082. <dd><p>If set to &quot;1&quot; split at regular clock time intervals starting from 00:00
  15083. o&rsquo;clock. The <var>time</var> value specified in &lsquo;<samp>segment_time</samp>&rsquo; is
  15084. used for setting the length of the splitting interval.
  15085. </p>
  15086. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; this makes it possible
  15087. to create files at 12:00 o&rsquo;clock, 12:15, 12:30, etc.
  15088. </p>
  15089. <p>Default value is &quot;0&quot;.
  15090. </p>
  15091. </dd>
  15092. <dt>&lsquo;<samp>segment_clocktime_offset <var>duration</var></samp>&rsquo;</dt>
  15093. <dd><p>Delay the segment splitting times with the specified duration when using
  15094. &lsquo;<samp>segment_atclocktime</samp>&rsquo;.
  15095. </p>
  15096. <p>For example with &lsquo;<samp>segment_time</samp>&rsquo; set to &quot;900&quot; and
  15097. &lsquo;<samp>segment_clocktime_offset</samp>&rsquo; set to &quot;300&quot; this makes it possible to
  15098. create files at 12:05, 12:20, 12:35, etc.
  15099. </p>
  15100. <p>Default value is &quot;0&quot;.
  15101. </p>
  15102. </dd>
  15103. <dt>&lsquo;<samp>segment_clocktime_wrap_duration <var>duration</var></samp>&rsquo;</dt>
  15104. <dd><p>Force the segmenter to only start a new segment if a packet reaches the muxer
  15105. within the specified duration after the segmenting clock time. This way you
  15106. can make the segmenter more resilient to backward local time jumps, such as
  15107. leap seconds or transition to standard time from daylight savings time.
  15108. </p>
  15109. <p>Default is the maximum possible duration which means starting a new segment
  15110. regardless of the elapsed time since the last clock time.
  15111. </p>
  15112. </dd>
  15113. <dt>&lsquo;<samp>segment_time_delta <var>delta</var></samp>&rsquo;</dt>
  15114. <dd><p>Specify the accuracy time when selecting the start time for a
  15115. segment, expressed as a duration specification. Default value is &quot;0&quot;.
  15116. </p>
  15117. <p>When delta is specified a key-frame will start a new segment if its
  15118. PTS satisfies the relation:
  15119. </p><div class="example">
  15120. <pre class="example">PTS &gt;= start_time - time_delta
  15121. </pre></div>
  15122. <p>This option is useful when splitting video content, which is always
  15123. split at GOP boundaries, in case a key frame is found just before the
  15124. specified split time.
  15125. </p>
  15126. <p>In particular may be used in combination with the &lsquo;<tt>ffmpeg</tt>&rsquo; option
  15127. <var>force_key_frames</var>. The key frame times specified by
  15128. <var>force_key_frames</var> may not be set accurately because of rounding
  15129. issues, with the consequence that a key frame time may result set just
  15130. before the specified time. For constant frame rate videos a value of
  15131. 1/(2*<var>frame_rate</var>) should address the worst case mismatch between
  15132. the specified time and the time set by <var>force_key_frames</var>.
  15133. </p>
  15134. </dd>
  15135. <dt>&lsquo;<samp>segment_times <var>times</var></samp>&rsquo;</dt>
  15136. <dd><p>Specify a list of split points. <var>times</var> contains a list of comma
  15137. separated duration specifications, in increasing order. See also
  15138. the &lsquo;<samp>segment_time</samp>&rsquo; option.
  15139. </p>
  15140. </dd>
  15141. <dt>&lsquo;<samp>segment_frames <var>frames</var></samp>&rsquo;</dt>
  15142. <dd><p>Specify a list of split video frame numbers. <var>frames</var> contains a
  15143. list of comma separated integer numbers, in increasing order.
  15144. </p>
  15145. <p>This option specifies to start a new segment whenever a reference
  15146. stream key frame is found and the sequential number (starting from 0)
  15147. of the frame is greater or equal to the next value in the list.
  15148. </p>
  15149. </dd>
  15150. <dt>&lsquo;<samp>segment_wrap <var>limit</var></samp>&rsquo;</dt>
  15151. <dd><p>Wrap around segment index once it reaches <var>limit</var>.
  15152. </p>
  15153. </dd>
  15154. <dt>&lsquo;<samp>segment_start_number <var>number</var></samp>&rsquo;</dt>
  15155. <dd><p>Set the sequence number of the first segment. Defaults to <code>0</code>.
  15156. </p>
  15157. </dd>
  15158. <dt>&lsquo;<samp>strftime <var>1|0</var></samp>&rsquo;</dt>
  15159. <dd><p>Use the <code>strftime</code> function to define the name of the new
  15160. segments to write. If this is selected, the output segment name must
  15161. contain a <code>strftime</code> function template. Default value is
  15162. <code>0</code>.
  15163. </p>
  15164. </dd>
  15165. <dt>&lsquo;<samp>break_non_keyframes <var>1|0</var></samp>&rsquo;</dt>
  15166. <dd><p>If enabled, allow segments to start on frames other than keyframes. This
  15167. improves behavior on some players when the time between keyframes is
  15168. inconsistent, but may make things worse on others, and can cause some oddities
  15169. during seeking. Defaults to <code>0</code>.
  15170. </p>
  15171. </dd>
  15172. <dt>&lsquo;<samp>reset_timestamps <var>1|0</var></samp>&rsquo;</dt>
  15173. <dd><p>Reset timestamps at the beginning of each segment, so that each segment
  15174. will start with near-zero timestamps. It is meant to ease the playback
  15175. of the generated segments. May not work with some combinations of
  15176. muxers/codecs. It is set to <code>0</code> by default.
  15177. </p>
  15178. </dd>
  15179. <dt>&lsquo;<samp>initial_offset <var>offset</var></samp>&rsquo;</dt>
  15180. <dd><p>Specify timestamp offset to apply to the output packet timestamps. The
  15181. argument must be a time duration specification, and defaults to 0.
  15182. </p>
  15183. </dd>
  15184. <dt>&lsquo;<samp>write_empty_segments <var>1|0</var></samp>&rsquo;</dt>
  15185. <dd><p>If enabled, write an empty segment if there are no packets during the period a
  15186. segment would usually span. Otherwise, the segment will be filled with the next
  15187. packet written. Defaults to <code>0</code>.
  15188. </p></dd>
  15189. </dl>
  15190. <p>Make sure to require a closed GOP when encoding and to set the GOP
  15191. size to fit your segment time constraint.
  15192. </p>
  15193. <a name="Examples-71"></a>
  15194. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-71">21.25.2 Examples</a></h3>
  15195. <ul>
  15196. <li>
  15197. Remux the content of file &lsquo;<tt>in.mkv</tt>&rsquo; to a list of segments
  15198. &lsquo;<tt>out-000.nut</tt>&rsquo;, &lsquo;<tt>out-001.nut</tt>&rsquo;, etc., and write the list of
  15199. generated segments to &lsquo;<tt>out.list</tt>&rsquo;:
  15200. <div class="example">
  15201. <pre class="example">ffmpeg -i in.mkv -codec hevc -flags +cgop -g 60 -map 0 -f segment -segment_list out.list out%03d.nut
  15202. </pre></div>
  15203. </li><li>
  15204. Segment input and set output format options for the output segments:
  15205. <div class="example">
  15206. <pre class="example">ffmpeg -i in.mkv -f segment -segment_time 10 -segment_format_options movflags=+faststart out%03d.mp4
  15207. </pre></div>
  15208. </li><li>
  15209. Segment the input file according to the split points specified by the
  15210. <var>segment_times</var> option:
  15211. <div class="example">
  15212. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 out%03d.nut
  15213. </pre></div>
  15214. </li><li>
  15215. Use the <code>ffmpeg</code> &lsquo;<samp>force_key_frames</samp>&rsquo;
  15216. option to force key frames in the input at the specified location, together
  15217. with the segment option &lsquo;<samp>segment_time_delta</samp>&rsquo; to account for
  15218. possible roundings operated when setting key frame times.
  15219. <div class="example">
  15220. <pre class="example">ffmpeg -i in.mkv -force_key_frames 1,2,3,5,8,13,21 -codec:v mpeg4 -codec:a pcm_s16le -map 0 \
  15221. -f segment -segment_list out.csv -segment_times 1,2,3,5,8,13,21 -segment_time_delta 0.05 out%03d.nut
  15222. </pre></div>
  15223. <p>In order to force key frames on the input file, transcoding is
  15224. required.
  15225. </p>
  15226. </li><li>
  15227. Segment the input file by splitting the input file according to the
  15228. frame numbers sequence specified with the &lsquo;<samp>segment_frames</samp>&rsquo; option:
  15229. <div class="example">
  15230. <pre class="example">ffmpeg -i in.mkv -codec copy -map 0 -f segment -segment_list out.csv -segment_frames 100,200,300,500,800 out%03d.nut
  15231. </pre></div>
  15232. </li><li>
  15233. Convert the &lsquo;<tt>in.mkv</tt>&rsquo; to TS segments using the <code>libx264</code>
  15234. and <code>aac</code> encoders:
  15235. <div class="example">
  15236. <pre class="example">ffmpeg -i in.mkv -map 0 -codec:v libx264 -codec:a aac -f ssegment -segment_list out.list out%03d.ts
  15237. </pre></div>
  15238. </li><li>
  15239. Segment the input file, and create an M3U8 live playlist (can be used
  15240. as live HLS source):
  15241. <div class="example">
  15242. <pre class="example">ffmpeg -re -i in.mkv -codec copy -map 0 -f segment -segment_list playlist.m3u8 \
  15243. -segment_list_flags +live -segment_time 10 out%03d.mkv
  15244. </pre></div>
  15245. </li></ul>
  15246. <a name="smoothstreaming"></a>
  15247. <h2 class="section"><a href="ffmpeg-all.html#toc-smoothstreaming">21.26 smoothstreaming</a></h2>
  15248. <p>Smooth Streaming muxer generates a set of files (Manifest, chunks) suitable for serving with conventional web server.
  15249. </p>
  15250. <dl compact="compact">
  15251. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  15252. <dd><p>Specify the number of fragments kept in the manifest. Default 0 (keep all).
  15253. </p>
  15254. </dd>
  15255. <dt>&lsquo;<samp>extra_window_size</samp>&rsquo;</dt>
  15256. <dd><p>Specify the number of fragments kept outside of the manifest before removing from disk. Default 5.
  15257. </p>
  15258. </dd>
  15259. <dt>&lsquo;<samp>lookahead_count</samp>&rsquo;</dt>
  15260. <dd><p>Specify the number of lookahead fragments. Default 2.
  15261. </p>
  15262. </dd>
  15263. <dt>&lsquo;<samp>min_frag_duration</samp>&rsquo;</dt>
  15264. <dd><p>Specify the minimum fragment duration (in microseconds). Default 5000000.
  15265. </p>
  15266. </dd>
  15267. <dt>&lsquo;<samp>remove_at_exit</samp>&rsquo;</dt>
  15268. <dd><p>Specify whether to remove all fragments when finished. Default 0 (do not remove).
  15269. </p>
  15270. </dd>
  15271. </dl>
  15272. <p><a name="streamhash"></a>
  15273. </p><a name="streamhash-1"></a>
  15274. <h2 class="section"><a href="ffmpeg-all.html#toc-streamhash-1">21.27 streamhash</a></h2>
  15275. <p>Per stream hash testing format.
  15276. </p>
  15277. <p>This muxer computes and prints a cryptographic hash of all the input frames,
  15278. on a per-stream basis. This can be used for equality checks without having
  15279. to do a complete binary comparison.
  15280. </p>
  15281. <p>By default audio frames are converted to signed 16-bit raw audio and
  15282. video frames to raw video before computing the hash, but the output
  15283. of explicit conversions to other codecs can also be used. Timestamps
  15284. are ignored. It uses the SHA-256 cryptographic hash function by default,
  15285. but supports several other algorithms.
  15286. </p>
  15287. <p>The output of the muxer consists of one line per stream of the form:
  15288. <var>streamindex</var>,<var>streamtype</var>,<var>algo</var>=<var>hash</var>, where
  15289. <var>streamindex</var> is the index of the mapped stream, <var>streamtype</var> is a
  15290. single character indicating the type of stream, <var>algo</var> is a short string
  15291. representing the hash function used, and <var>hash</var> is a hexadecimal number
  15292. representing the computed hash.
  15293. </p>
  15294. <dl compact="compact">
  15295. <dt>&lsquo;<samp>hash <var>algorithm</var></samp>&rsquo;</dt>
  15296. <dd><p>Use the cryptographic hash function specified by the string <var>algorithm</var>.
  15297. Supported values include <code>MD5</code>, <code>murmur3</code>, <code>RIPEMD128</code>,
  15298. <code>RIPEMD160</code>, <code>RIPEMD256</code>, <code>RIPEMD320</code>, <code>SHA160</code>,
  15299. <code>SHA224</code>, <code>SHA256</code> (default), <code>SHA512/224</code>, <code>SHA512/256</code>,
  15300. <code>SHA384</code>, <code>SHA512</code>, <code>CRC32</code> and <code>adler32</code>.
  15301. </p>
  15302. </dd>
  15303. </dl>
  15304. <a name="Examples-72"></a>
  15305. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-72">21.27.1 Examples</a></h3>
  15306. <p>To compute the SHA-256 hash of the input converted to raw audio and
  15307. video, and store it in the file &lsquo;<tt>out.sha256</tt>&rsquo;:
  15308. </p><div class="example">
  15309. <pre class="example">ffmpeg -i INPUT -f streamhash out.sha256
  15310. </pre></div>
  15311. <p>To print an MD5 hash to stdout use the command:
  15312. </p><div class="example">
  15313. <pre class="example">ffmpeg -i INPUT -f streamhash -hash md5 -
  15314. </pre></div>
  15315. <p>See also the <a href="#hash">hash</a> and <a href="#framehash">framehash</a> muxers.
  15316. </p>
  15317. <p><a name="fifo"></a>
  15318. </p><a name="fifo-1"></a>
  15319. <h2 class="section"><a href="ffmpeg-all.html#toc-fifo-1">21.28 fifo</a></h2>
  15320. <p>The fifo pseudo-muxer allows the separation of encoding and muxing by using
  15321. first-in-first-out queue and running the actual muxer in a separate thread. This
  15322. is especially useful in combination with the <a href="#tee">tee</a> muxer and can be used to
  15323. send data to several destinations with different reliability/writing speed/latency.
  15324. </p>
  15325. <p>API users should be aware that callback functions (interrupt_callback,
  15326. io_open and io_close) used within its AVFormatContext must be thread-safe.
  15327. </p>
  15328. <p>The behavior of the fifo muxer if the queue fills up or if the output fails is
  15329. selectable,
  15330. </p>
  15331. <ul>
  15332. <li>
  15333. output can be transparently restarted with configurable delay between retries
  15334. based on real time or time of the processed stream.
  15335. </li><li>
  15336. encoding can be blocked during temporary failure, or continue transparently
  15337. dropping packets in case fifo queue fills up.
  15338. </li></ul>
  15339. <dl compact="compact">
  15340. <dt>&lsquo;<samp>fifo_format</samp>&rsquo;</dt>
  15341. <dd><p>Specify the format name. Useful if it cannot be guessed from the
  15342. output name suffix.
  15343. </p>
  15344. </dd>
  15345. <dt>&lsquo;<samp>queue_size</samp>&rsquo;</dt>
  15346. <dd><p>Specify size of the queue (number of packets). Default value is 60.
  15347. </p>
  15348. </dd>
  15349. <dt>&lsquo;<samp>format_opts</samp>&rsquo;</dt>
  15350. <dd><p>Specify format options for the underlying muxer. Muxer options can be specified
  15351. as a list of <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;.
  15352. </p>
  15353. </dd>
  15354. <dt>&lsquo;<samp>drop_pkts_on_overflow <var>bool</var></samp>&rsquo;</dt>
  15355. <dd><p>If set to 1 (true), in case the fifo queue fills up, packets will be dropped
  15356. rather than blocking the encoder. This makes it possible to continue streaming without
  15357. delaying the input, at the cost of omitting part of the stream. By default
  15358. this option is set to 0 (false), so in such cases the encoder will be blocked
  15359. until the muxer processes some of the packets and none of them is lost.
  15360. </p>
  15361. </dd>
  15362. <dt>&lsquo;<samp>attempt_recovery <var>bool</var></samp>&rsquo;</dt>
  15363. <dd><p>If failure occurs, attempt to recover the output. This is especially useful
  15364. when used with network output, since it makes it possible to restart streaming transparently.
  15365. By default this option is set to 0 (false).
  15366. </p>
  15367. </dd>
  15368. <dt>&lsquo;<samp>max_recovery_attempts</samp>&rsquo;</dt>
  15369. <dd><p>Sets maximum number of successive unsuccessful recovery attempts after which
  15370. the output fails permanently. By default this option is set to 0 (unlimited).
  15371. </p>
  15372. </dd>
  15373. <dt>&lsquo;<samp>recovery_wait_time <var>duration</var></samp>&rsquo;</dt>
  15374. <dd><p>Waiting time before the next recovery attempt after previous unsuccessful
  15375. recovery attempt. Default value is 5 seconds.
  15376. </p>
  15377. </dd>
  15378. <dt>&lsquo;<samp>recovery_wait_streamtime <var>bool</var></samp>&rsquo;</dt>
  15379. <dd><p>If set to 0 (false), the real time is used when waiting for the recovery
  15380. attempt (i.e. the recovery will be attempted after at least
  15381. recovery_wait_time seconds).
  15382. If set to 1 (true), the time of the processed stream is taken into account
  15383. instead (i.e. the recovery will be attempted after at least <var>recovery_wait_time</var>
  15384. seconds of the stream is omitted).
  15385. By default, this option is set to 0 (false).
  15386. </p>
  15387. </dd>
  15388. <dt>&lsquo;<samp>recover_any_error <var>bool</var></samp>&rsquo;</dt>
  15389. <dd><p>If set to 1 (true), recovery will be attempted regardless of type of the error
  15390. causing the failure. By default this option is set to 0 (false) and in case of
  15391. certain (usually permanent) errors the recovery is not attempted even when
  15392. <var>attempt_recovery</var> is set to 1.
  15393. </p>
  15394. </dd>
  15395. <dt>&lsquo;<samp>restart_with_keyframe <var>bool</var></samp>&rsquo;</dt>
  15396. <dd><p>Specify whether to wait for the keyframe after recovering from
  15397. queue overflow or failure. This option is set to 0 (false) by default.
  15398. </p>
  15399. </dd>
  15400. </dl>
  15401. <a name="Examples-34"></a>
  15402. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-34">21.28.1 Examples</a></h3>
  15403. <ul>
  15404. <li>
  15405. Stream something to rtmp server, continue processing the stream at real-time
  15406. rate even in case of temporary failure (network outage) and attempt to recover
  15407. streaming every second indefinitely.
  15408. <div class="example">
  15409. <pre class="example">ffmpeg -re -i ... -c:v libx264 -c:a aac -f fifo -fifo_format flv -map 0:v -map 0:a
  15410. -drop_pkts_on_overflow 1 -attempt_recovery 1 -recovery_wait_time 1 rtmp://example.com/live/stream_name
  15411. </pre></div>
  15412. </li></ul>
  15413. <p><a name="tee"></a>
  15414. </p><a name="tee-1"></a>
  15415. <h2 class="section"><a href="ffmpeg-all.html#toc-tee-1">21.29 tee</a></h2>
  15416. <p>The tee muxer can be used to write the same data to several outputs, such as files or streams.
  15417. It can be used, for example, to stream a video over a network and save it to disk at the same time.
  15418. </p>
  15419. <p>It is different from specifying several outputs to the <code>ffmpeg</code>
  15420. command-line tool. With the tee muxer, the audio and video data will be encoded only once.
  15421. With conventional multiple outputs, multiple encoding operations in parallel are initiated,
  15422. which can be a very expensive process. The tee muxer is not useful when using the libavformat API
  15423. directly because it is then possible to feed the same packets to several muxers directly.
  15424. </p>
  15425. <p>Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select
  15426. output streams. So all streams intended for output must be specified using <code>-map</code>. See
  15427. the examples below.
  15428. </p>
  15429. <p>Some encoders may need different options depending on the output format;
  15430. the auto-detection of this can not work with the tee muxer, so they need to be explicitly specified.
  15431. The main example is the &lsquo;<samp>global_header</samp>&rsquo; flag.
  15432. </p>
  15433. <p>The slave outputs are specified in the file name given to the muxer,
  15434. separated by &rsquo;|&rsquo;. If any of the slave name contains the &rsquo;|&rsquo; separator,
  15435. leading or trailing spaces or any special character, those must be
  15436. escaped (see <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a>).
  15437. </p>
  15438. <a name="Options-4"></a>
  15439. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-4">21.29.1 Options</a></h3>
  15440. <dl compact="compact">
  15441. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  15442. <dd><p>If set to 1, slave outputs will be processed in separate threads using the <a href="#fifo">fifo</a>
  15443. muxer. This allows to compensate for different speed/latency/reliability of
  15444. outputs and setup transparent recovery. By default this feature is turned off.
  15445. </p>
  15446. </dd>
  15447. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  15448. <dd><p>Options to pass to fifo pseudo-muxer instances. See <a href="#fifo">fifo</a>.
  15449. </p>
  15450. </dd>
  15451. </dl>
  15452. <p>Muxer options can be specified for each slave by prepending them as a list of
  15453. <var>key</var>=<var>value</var> pairs separated by &rsquo;:&rsquo;, between square brackets. If
  15454. the options values contain a special character or the &rsquo;:&rsquo; separator, they
  15455. must be escaped; note that this is a second level escaping.
  15456. </p>
  15457. <p>The following special options are also recognized:
  15458. </p><dl compact="compact">
  15459. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  15460. <dd><p>Specify the format name. Required if it cannot be guessed from the
  15461. output URL.
  15462. </p>
  15463. </dd>
  15464. <dt>&lsquo;<samp>bsfs[/<var>spec</var>]</samp>&rsquo;</dt>
  15465. <dd><p>Specify a list of bitstream filters to apply to the specified
  15466. output.
  15467. </p>
  15468. <p>It is possible to specify to which streams a given bitstream filter
  15469. applies, by appending a stream specifier to the option separated by
  15470. <code>/</code>. <var>spec</var> must be a stream specifier (see <a href="#Format-stream-specifiers">Format stream specifiers</a>).
  15471. </p>
  15472. <p>If the stream specifier is not specified, the bitstream filters will be
  15473. applied to all streams in the output. This will cause that output operation
  15474. to fail if the output contains streams to which the bitstream filter cannot
  15475. be applied e.g. <code>h264_mp4toannexb</code> being applied to an output containing an audio stream.
  15476. </p>
  15477. <p>Options for a bitstream filter must be specified in the form of <code>opt=value</code>.
  15478. </p>
  15479. <p>Several bitstream filters can be specified, separated by &quot;,&quot;.
  15480. </p>
  15481. </dd>
  15482. <dt>&lsquo;<samp>use_fifo <var>bool</var></samp>&rsquo;</dt>
  15483. <dd><p>This allows to override tee muxer use_fifo option for individual slave muxer.
  15484. </p>
  15485. </dd>
  15486. <dt>&lsquo;<samp>fifo_options</samp>&rsquo;</dt>
  15487. <dd><p>This allows to override tee muxer fifo_options for individual slave muxer.
  15488. See <a href="#fifo">fifo</a>.
  15489. </p>
  15490. </dd>
  15491. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  15492. <dd><p>Select the streams that should be mapped to the slave output,
  15493. specified by a stream specifier. If not specified, this defaults to
  15494. all the mapped streams. This will cause that output operation to fail
  15495. if the output format does not accept all mapped streams.
  15496. </p>
  15497. <p>You may use multiple stream specifiers separated by commas (<code>,</code>) e.g.: <code>a:0,v</code>
  15498. </p>
  15499. </dd>
  15500. <dt>&lsquo;<samp>onfail</samp>&rsquo;</dt>
  15501. <dd><p>Specify behaviour on output failure. This can be set to either <code>abort</code> (which is
  15502. default) or <code>ignore</code>. <code>abort</code> will cause whole process to fail in case of failure
  15503. on this slave output. <code>ignore</code> will ignore failure on this output, so other outputs
  15504. will continue without being affected.
  15505. </p></dd>
  15506. </dl>
  15507. <a name="Examples-162"></a>
  15508. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-162">21.29.2 Examples</a></h3>
  15509. <ul>
  15510. <li>
  15511. Encode something and both archive it in a WebM file and stream it
  15512. as MPEG-TS over UDP:
  15513. <div class="example">
  15514. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  15515. &quot;archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  15516. </pre></div>
  15517. </li><li>
  15518. As above, but continue streaming even if output to local file fails
  15519. (for example local drive fills up):
  15520. <div class="example">
  15521. <pre class="example">ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
  15522. &quot;[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/&quot;
  15523. </pre></div>
  15524. </li><li>
  15525. Use <code>ffmpeg</code> to encode the input, and send the output
  15526. to three different destinations. The <code>dump_extra</code> bitstream
  15527. filter is used to add extradata information to all the output video
  15528. keyframes packets, as requested by the MPEG-TS format. The select
  15529. option is applied to &lsquo;<tt>out.aac</tt>&rsquo; in order to make it contain only
  15530. audio packets.
  15531. <div class="example">
  15532. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  15533. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=a]out.aac&quot;
  15534. </pre></div>
  15535. </li><li>
  15536. As above, but select only stream <code>a:1</code> for the audio output. Note
  15537. that a second level escaping must be performed, as &quot;:&quot; is a special
  15538. character used to separate options.
  15539. <div class="example">
  15540. <pre class="example">ffmpeg -i ... -map 0 -flags +global_header -c:v libx264 -c:a aac
  15541. -f tee &quot;[bsfs/v=dump_extra=freq=keyframe]out.ts|[movflags=+faststart]out.mp4|[select=\'a:1\']out.aac&quot;
  15542. </pre></div>
  15543. </li></ul>
  15544. <a name="webm_005fdash_005fmanifest"></a>
  15545. <h2 class="section"><a href="ffmpeg-all.html#toc-webm_005fdash_005fmanifest">21.30 webm_dash_manifest</a></h2>
  15546. <p>WebM DASH Manifest muxer.
  15547. </p>
  15548. <p>This muxer implements the WebM DASH Manifest specification to generate the DASH
  15549. manifest XML. It also supports manifest generation for DASH live streams.
  15550. </p>
  15551. <p>For more information see:
  15552. </p>
  15553. <ul>
  15554. <li>
  15555. WebM DASH Specification: <a href="https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification">https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification</a>
  15556. </li><li>
  15557. ISO DASH Specification: <a href="http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip">http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip</a>
  15558. </li></ul>
  15559. <a name="Options-6"></a>
  15560. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-6">21.30.1 Options</a></h3>
  15561. <p>This muxer supports the following options:
  15562. </p>
  15563. <dl compact="compact">
  15564. <dt>&lsquo;<samp>adaptation_sets</samp>&rsquo;</dt>
  15565. <dd><p>This option has the following syntax: &quot;id=x,streams=a,b,c id=y,streams=d,e&quot; where x and y are the
  15566. unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
  15567. audio and video streams. Any number of adaptation sets can be added using this option.
  15568. </p>
  15569. </dd>
  15570. <dt>&lsquo;<samp>live</samp>&rsquo;</dt>
  15571. <dd><p>Set this to 1 to create a live stream DASH Manifest. Default: 0.
  15572. </p>
  15573. </dd>
  15574. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  15575. <dd><p>Start index of the first chunk. This will go in the &lsquo;<samp>startNumber</samp>&rsquo; attribute
  15576. of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 0.
  15577. </p>
  15578. </dd>
  15579. <dt>&lsquo;<samp>chunk_duration_ms</samp>&rsquo;</dt>
  15580. <dd><p>Duration of each chunk in milliseconds. This will go in the &lsquo;<samp>duration</samp>&rsquo;
  15581. attribute of the &lsquo;<samp>SegmentTemplate</samp>&rsquo; element in the manifest. Default: 1000.
  15582. </p>
  15583. </dd>
  15584. <dt>&lsquo;<samp>utc_timing_url</samp>&rsquo;</dt>
  15585. <dd><p>URL of the page that will return the UTC timestamp in ISO format. This will go
  15586. in the &lsquo;<samp>value</samp>&rsquo; attribute of the &lsquo;<samp>UTCTiming</samp>&rsquo; element in the manifest.
  15587. Default: None.
  15588. </p>
  15589. </dd>
  15590. <dt>&lsquo;<samp>time_shift_buffer_depth</samp>&rsquo;</dt>
  15591. <dd><p>Smallest time (in seconds) shifting buffer for which any Representation is
  15592. guaranteed to be available. This will go in the &lsquo;<samp>timeShiftBufferDepth</samp>&rsquo;
  15593. attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 60.
  15594. </p>
  15595. </dd>
  15596. <dt>&lsquo;<samp>minimum_update_period</samp>&rsquo;</dt>
  15597. <dd><p>Minimum update period (in seconds) of the manifest. This will go in the
  15598. &lsquo;<samp>minimumUpdatePeriod</samp>&rsquo; attribute of the &lsquo;<samp>MPD</samp>&rsquo; element. Default: 0.
  15599. </p>
  15600. </dd>
  15601. </dl>
  15602. <a name="Example-1"></a>
  15603. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-1">21.30.2 Example</a></h3>
  15604. <div class="example">
  15605. <pre class="example">ffmpeg -f webm_dash_manifest -i video1.webm \
  15606. -f webm_dash_manifest -i video2.webm \
  15607. -f webm_dash_manifest -i audio1.webm \
  15608. -f webm_dash_manifest -i audio2.webm \
  15609. -map 0 -map 1 -map 2 -map 3 \
  15610. -c copy \
  15611. -f webm_dash_manifest \
  15612. -adaptation_sets &quot;id=0,streams=0,1 id=1,streams=2,3&quot; \
  15613. manifest.xml
  15614. </pre></div>
  15615. <a name="webm_005fchunk"></a>
  15616. <h2 class="section"><a href="ffmpeg-all.html#toc-webm_005fchunk">21.31 webm_chunk</a></h2>
  15617. <p>WebM Live Chunk Muxer.
  15618. </p>
  15619. <p>This muxer writes out WebM headers and chunks as separate files which can be
  15620. consumed by clients that support WebM Live streams via DASH.
  15621. </p>
  15622. <a name="Options-29"></a>
  15623. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-29">21.31.1 Options</a></h3>
  15624. <p>This muxer supports the following options:
  15625. </p>
  15626. <dl compact="compact">
  15627. <dt>&lsquo;<samp>chunk_start_index</samp>&rsquo;</dt>
  15628. <dd><p>Index of the first chunk (defaults to 0).
  15629. </p>
  15630. </dd>
  15631. <dt>&lsquo;<samp>header</samp>&rsquo;</dt>
  15632. <dd><p>Filename of the header where the initialization data will be written.
  15633. </p>
  15634. </dd>
  15635. <dt>&lsquo;<samp>audio_chunk_duration</samp>&rsquo;</dt>
  15636. <dd><p>Duration of each audio chunk in milliseconds (defaults to 5000).
  15637. </p></dd>
  15638. </dl>
  15639. <a name="Example-8"></a>
  15640. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-8">21.31.2 Example</a></h3>
  15641. <div class="example">
  15642. <pre class="example">ffmpeg -f v4l2 -i /dev/video0 \
  15643. -f alsa -i hw:0 \
  15644. -map 0:0 \
  15645. -c:v libvpx-vp9 \
  15646. -s 640x360 -keyint_min 30 -g 30 \
  15647. -f webm_chunk \
  15648. -header webm_live_video_360.hdr \
  15649. -chunk_start_index 1 \
  15650. webm_live_video_360_%d.chk \
  15651. -map 1:0 \
  15652. -c:a libvorbis \
  15653. -b:a 128k \
  15654. -f webm_chunk \
  15655. -header webm_live_audio_128.hdr \
  15656. -chunk_start_index 1 \
  15657. -audio_chunk_duration 1000 \
  15658. webm_live_audio_128_%d.chk
  15659. </pre></div>
  15660. <a name="Metadata"></a>
  15661. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Metadata">22 Metadata</a></h1>
  15662. <p>FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded
  15663. INI-like text file and then load it back using the metadata muxer/demuxer.
  15664. </p>
  15665. <p>The file format is as follows:
  15666. </p><ol>
  15667. <li>
  15668. A file consists of a header and a number of metadata tags divided into sections,
  15669. each on its own line.
  15670. </li><li>
  15671. The header is a &lsquo;<samp>;FFMETADATA</samp>&rsquo; string, followed by a version number (now 1).
  15672. </li><li>
  15673. Metadata tags are of the form &lsquo;<samp>key=value</samp>&rsquo;
  15674. </li><li>
  15675. Immediately after header follows global metadata
  15676. </li><li>
  15677. After global metadata there may be sections with per-stream/per-chapter
  15678. metadata.
  15679. </li><li>
  15680. A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
  15681. brackets (&lsquo;<samp>[</samp>&rsquo;, &lsquo;<samp>]</samp>&rsquo;) and ends with next section or end of file.
  15682. </li><li>
  15683. At the beginning of a chapter section there may be an optional timebase to be
  15684. used for start/end values. It must be in form
  15685. &lsquo;<samp>TIMEBASE=<var>num</var>/<var>den</var></samp>&rsquo;, where <var>num</var> and <var>den</var> are
  15686. integers. If the timebase is missing then start/end times are assumed to
  15687. be in nanoseconds.
  15688. <p>Next a chapter section must contain chapter start and end times in form
  15689. &lsquo;<samp>START=<var>num</var></samp>&rsquo;, &lsquo;<samp>END=<var>num</var></samp>&rsquo;, where <var>num</var> is a positive
  15690. integer.
  15691. </p>
  15692. </li><li>
  15693. Empty lines and lines starting with &lsquo;<samp>;</samp>&rsquo; or &lsquo;<samp>#</samp>&rsquo; are ignored.
  15694. </li><li>
  15695. Metadata keys or values containing special characters (&lsquo;<samp>=</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;,
  15696. &lsquo;<samp>#</samp>&rsquo;, &lsquo;<samp>\</samp>&rsquo; and a newline) must be escaped with a backslash &lsquo;<samp>\</samp>&rsquo;.
  15697. </li><li>
  15698. Note that whitespace in metadata (e.g. &lsquo;<samp>foo = bar</samp>&rsquo;) is considered to be
  15699. a part of the tag (in the example above key is &lsquo;<samp>foo </samp>&rsquo;, value is
  15700. &lsquo;<samp> bar</samp>&rsquo;).
  15701. </li></ol>
  15702. <p>A ffmetadata file might look like this:
  15703. </p><div class="example">
  15704. <pre class="example">;FFMETADATA1
  15705. title=bike\\shed
  15706. ;this is a comment
  15707. artist=FFmpeg troll team
  15708. [CHAPTER]
  15709. TIMEBASE=1/1000
  15710. START=0
  15711. #chapter ends at 0:01:00
  15712. END=60000
  15713. title=chapter \#1
  15714. [STREAM]
  15715. title=multi\
  15716. line
  15717. </pre></div>
  15718. <p>By using the ffmetadata muxer and demuxer it is possible to extract
  15719. metadata from an input file to an ffmetadata file, and then transcode
  15720. the file into an output file with the edited ffmetadata file.
  15721. </p>
  15722. <p>Extracting an ffmetadata file with &lsquo;<tt>ffmpeg</tt>&rsquo; goes as follows:
  15723. </p><div class="example">
  15724. <pre class="example">ffmpeg -i INPUT -f ffmetadata FFMETADATAFILE
  15725. </pre></div>
  15726. <p>Reinserting edited metadata information from the FFMETADATAFILE file can
  15727. be done as:
  15728. </p><div class="example">
  15729. <pre class="example">ffmpeg -i INPUT -i FFMETADATAFILE -map_metadata 1 -codec copy OUTPUT
  15730. </pre></div>
  15731. <a name="Protocol-Options"></a>
  15732. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Protocol-Options">23 Protocol Options</a></h1>
  15733. <p>The libavformat library provides some generic global options, which
  15734. can be set on all the protocols. In addition each protocol may support
  15735. so-called private options, which are specific for that component.
  15736. </p>
  15737. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  15738. FFmpeg tools, or by setting the value explicitly in the
  15739. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  15740. for programmatic use.
  15741. </p>
  15742. <p>The list of supported options follows:
  15743. </p>
  15744. <dl compact="compact">
  15745. <dt>&lsquo;<samp>protocol_whitelist <var>list</var> (<em>input</em>)</samp>&rsquo;</dt>
  15746. <dd><p>Set a &quot;,&quot;-separated list of allowed protocols. &quot;ALL&quot; matches all protocols. Protocols
  15747. prefixed by &quot;-&quot; are disabled.
  15748. All protocols are allowed by default but protocols used by an another
  15749. protocol (nested protocols) are restricted to a per protocol subset.
  15750. </p></dd>
  15751. </dl>
  15752. <a name="Protocols"></a>
  15753. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Protocols">24 Protocols</a></h1>
  15754. <p>Protocols are configured elements in FFmpeg that enable access to
  15755. resources that require specific protocols.
  15756. </p>
  15757. <p>When you configure your FFmpeg build, all the supported protocols are
  15758. enabled by default. You can list all available ones using the
  15759. configure option &quot;&ndash;list-protocols&quot;.
  15760. </p>
  15761. <p>You can disable all the protocols using the configure option
  15762. &quot;&ndash;disable-protocols&quot;, and selectively enable a protocol using the
  15763. option &quot;&ndash;enable-protocol=<var>PROTOCOL</var>&quot;, or you can disable a
  15764. particular protocol using the option
  15765. &quot;&ndash;disable-protocol=<var>PROTOCOL</var>&quot;.
  15766. </p>
  15767. <p>The option &quot;-protocols&quot; of the ff* tools will display the list of
  15768. supported protocols.
  15769. </p>
  15770. <p>All protocols accept the following options:
  15771. </p>
  15772. <dl compact="compact">
  15773. <dt>&lsquo;<samp>rw_timeout</samp>&rsquo;</dt>
  15774. <dd><p>Maximum time to wait for (network) read/write operations to complete,
  15775. in microseconds.
  15776. </p></dd>
  15777. </dl>
  15778. <p>A description of the currently available protocols follows.
  15779. </p>
  15780. <a name="async"></a>
  15781. <h2 class="section"><a href="ffmpeg-all.html#toc-async">24.1 async</a></h2>
  15782. <p>Asynchronous data filling wrapper for input stream.
  15783. </p>
  15784. <p>Fill data in a background thread, to decouple I/O operation from demux thread.
  15785. </p>
  15786. <div class="example">
  15787. <pre class="example">async:<var>URL</var>
  15788. async:http://host/resource
  15789. async:cache:http://host/resource
  15790. </pre></div>
  15791. <a name="bluray"></a>
  15792. <h2 class="section"><a href="ffmpeg-all.html#toc-bluray">24.2 bluray</a></h2>
  15793. <p>Read BluRay playlist.
  15794. </p>
  15795. <p>The accepted options are:
  15796. </p><dl compact="compact">
  15797. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  15798. <dd><p>BluRay angle
  15799. </p>
  15800. </dd>
  15801. <dt>&lsquo;<samp>chapter</samp>&rsquo;</dt>
  15802. <dd><p>Start chapter (1...N)
  15803. </p>
  15804. </dd>
  15805. <dt>&lsquo;<samp>playlist</samp>&rsquo;</dt>
  15806. <dd><p>Playlist to read (BDMV/PLAYLIST/?????.mpls)
  15807. </p>
  15808. </dd>
  15809. </dl>
  15810. <p>Examples:
  15811. </p>
  15812. <p>Read longest playlist from BluRay mounted to /mnt/bluray:
  15813. </p><div class="example">
  15814. <pre class="example">bluray:/mnt/bluray
  15815. </pre></div>
  15816. <p>Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2:
  15817. </p><div class="example">
  15818. <pre class="example">-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
  15819. </pre></div>
  15820. <a name="cache"></a>
  15821. <h2 class="section"><a href="ffmpeg-all.html#toc-cache">24.3 cache</a></h2>
  15822. <p>Caching wrapper for input stream.
  15823. </p>
  15824. <p>Cache the input stream to temporary file. It brings seeking capability to live streams.
  15825. </p>
  15826. <div class="example">
  15827. <pre class="example">cache:<var>URL</var>
  15828. </pre></div>
  15829. <a name="concat-3"></a>
  15830. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-3">24.4 concat</a></h2>
  15831. <p>Physical concatenation protocol.
  15832. </p>
  15833. <p>Read and seek from many resources in sequence as if they were
  15834. a unique resource.
  15835. </p>
  15836. <p>A URL accepted by this protocol has the syntax:
  15837. </p><div class="example">
  15838. <pre class="example">concat:<var>URL1</var>|<var>URL2</var>|...|<var>URLN</var>
  15839. </pre></div>
  15840. <p>where <var>URL1</var>, <var>URL2</var>, ..., <var>URLN</var> are the urls of the
  15841. resource to be concatenated, each one possibly specifying a distinct
  15842. protocol.
  15843. </p>
  15844. <p>For example to read a sequence of files &lsquo;<tt>split1.mpeg</tt>&rsquo;,
  15845. &lsquo;<tt>split2.mpeg</tt>&rsquo;, &lsquo;<tt>split3.mpeg</tt>&rsquo; with <code>ffplay</code> use the
  15846. command:
  15847. </p><div class="example">
  15848. <pre class="example">ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
  15849. </pre></div>
  15850. <p>Note that you may need to escape the character &quot;|&quot; which is special for
  15851. many shells.
  15852. </p>
  15853. <a name="crypto"></a>
  15854. <h2 class="section"><a href="ffmpeg-all.html#toc-crypto">24.5 crypto</a></h2>
  15855. <p>AES-encrypted stream reading protocol.
  15856. </p>
  15857. <p>The accepted options are:
  15858. </p><dl compact="compact">
  15859. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  15860. <dd><p>Set the AES decryption key binary block from given hexadecimal representation.
  15861. </p>
  15862. </dd>
  15863. <dt>&lsquo;<samp>iv</samp>&rsquo;</dt>
  15864. <dd><p>Set the AES decryption initialization vector binary block from given hexadecimal representation.
  15865. </p></dd>
  15866. </dl>
  15867. <p>Accepted URL formats:
  15868. </p><div class="example">
  15869. <pre class="example">crypto:<var>URL</var>
  15870. crypto+<var>URL</var>
  15871. </pre></div>
  15872. <a name="data"></a>
  15873. <h2 class="section"><a href="ffmpeg-all.html#toc-data">24.6 data</a></h2>
  15874. <p>Data in-line in the URI. See <a href="http://en.wikipedia.org/wiki/Data_URI_scheme">http://en.wikipedia.org/wiki/Data_URI_scheme</a>.
  15875. </p>
  15876. <p>For example, to convert a GIF file given inline with <code>ffmpeg</code>:
  15877. </p><div class="example">
  15878. <pre class="example">ffmpeg -i &quot;data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=&quot; smiley.png
  15879. </pre></div>
  15880. <a name="file"></a>
  15881. <h2 class="section"><a href="ffmpeg-all.html#toc-file">24.7 file</a></h2>
  15882. <p>File access protocol.
  15883. </p>
  15884. <p>Read from or write to a file.
  15885. </p>
  15886. <p>A file URL can have the form:
  15887. </p><div class="example">
  15888. <pre class="example">file:<var>filename</var>
  15889. </pre></div>
  15890. <p>where <var>filename</var> is the path of the file to read.
  15891. </p>
  15892. <p>An URL that does not have a protocol prefix will be assumed to be a
  15893. file URL. Depending on the build, an URL that looks like a Windows
  15894. path with the drive letter at the beginning will also be assumed to be
  15895. a file URL (usually not the case in builds for unix-like systems).
  15896. </p>
  15897. <p>For example to read from a file &lsquo;<tt>input.mpeg</tt>&rsquo; with <code>ffmpeg</code>
  15898. use the command:
  15899. </p><div class="example">
  15900. <pre class="example">ffmpeg -i file:input.mpeg output.mpeg
  15901. </pre></div>
  15902. <p>This protocol accepts the following options:
  15903. </p>
  15904. <dl compact="compact">
  15905. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  15906. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  15907. truncating. Default value is 1.
  15908. </p>
  15909. </dd>
  15910. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  15911. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  15912. <code>INT_MAX</code>, which results in not limiting the requested block size.
  15913. Setting this value reasonably low improves user termination request reaction
  15914. time, which is valuable for files on slow medium.
  15915. </p>
  15916. </dd>
  15917. <dt>&lsquo;<samp>follow</samp>&rsquo;</dt>
  15918. <dd><p>If set to 1, the protocol will retry reading at the end of the file, allowing
  15919. reading files that still are being written. In order for this to terminate,
  15920. you either need to use the rw_timeout option, or use the interrupt callback
  15921. (for API users).
  15922. </p>
  15923. </dd>
  15924. <dt>&lsquo;<samp>seekable</samp>&rsquo;</dt>
  15925. <dd><p>Controls if seekability is advertised on the file. 0 means non-seekable, -1
  15926. means auto (seekable for normal files, non-seekable for named pipes).
  15927. </p>
  15928. <p>Many demuxers handle seekable and non-seekable resources differently,
  15929. overriding this might speed up opening certain files at the cost of losing some
  15930. features (e.g. accurate seeking).
  15931. </p></dd>
  15932. </dl>
  15933. <a name="ftp"></a>
  15934. <h2 class="section"><a href="ffmpeg-all.html#toc-ftp">24.8 ftp</a></h2>
  15935. <p>FTP (File Transfer Protocol).
  15936. </p>
  15937. <p>Read from or write to remote resources using FTP protocol.
  15938. </p>
  15939. <p>Following syntax is required.
  15940. </p><div class="example">
  15941. <pre class="example">ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  15942. </pre></div>
  15943. <p>This protocol accepts the following options.
  15944. </p>
  15945. <dl compact="compact">
  15946. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  15947. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  15948. operation. By default it is set to -1, which means that the timeout is
  15949. not specified.
  15950. </p>
  15951. </dd>
  15952. <dt>&lsquo;<samp>ftp-user</samp>&rsquo;</dt>
  15953. <dd><p>Set a user to be used for authenticating to the FTP server. This is overridden by the
  15954. user in the FTP URL.
  15955. </p>
  15956. </dd>
  15957. <dt>&lsquo;<samp>ftp-password</samp>&rsquo;</dt>
  15958. <dd><p>Set a password to be used for authenticating to the FTP server. This is overridden by
  15959. the password in the FTP URL, or by &lsquo;<samp>ftp-anonymous-password</samp>&rsquo; if no user is set.
  15960. </p>
  15961. </dd>
  15962. <dt>&lsquo;<samp>ftp-anonymous-password</samp>&rsquo;</dt>
  15963. <dd><p>Password used when login as anonymous user. Typically an e-mail address
  15964. should be used.
  15965. </p>
  15966. </dd>
  15967. <dt>&lsquo;<samp>ftp-write-seekable</samp>&rsquo;</dt>
  15968. <dd><p>Control seekability of connection during encoding. If set to 1 the
  15969. resource is supposed to be seekable, if set to 0 it is assumed not
  15970. to be seekable. Default value is 0.
  15971. </p></dd>
  15972. </dl>
  15973. <p>NOTE: Protocol can be used as output, but it is recommended to not do
  15974. it, unless special care is taken (tests, customized server configuration
  15975. etc.). Different FTP servers behave in different way during seek
  15976. operation. ff* tools may produce incomplete content due to server limitations.
  15977. </p>
  15978. <a name="gopher"></a>
  15979. <h2 class="section"><a href="ffmpeg-all.html#toc-gopher">24.9 gopher</a></h2>
  15980. <p>Gopher protocol.
  15981. </p>
  15982. <a name="hls-3"></a>
  15983. <h2 class="section"><a href="ffmpeg-all.html#toc-hls-3">24.10 hls</a></h2>
  15984. <p>Read Apple HTTP Live Streaming compliant segmented stream as
  15985. a uniform one. The M3U8 playlists describing the segments can be
  15986. remote HTTP resources or local files, accessed using the standard
  15987. file protocol.
  15988. The nested protocol is declared by specifying
  15989. &quot;+<var>proto</var>&quot; after the hls URI scheme name, where <var>proto</var>
  15990. is either &quot;file&quot; or &quot;http&quot;.
  15991. </p>
  15992. <div class="example">
  15993. <pre class="example">hls+http://host/path/to/remote/resource.m3u8
  15994. hls+file://path/to/local/resource.m3u8
  15995. </pre></div>
  15996. <p>Using this protocol is discouraged - the hls demuxer should work
  15997. just as well (if not, please report the issues) and is more complete.
  15998. To use the hls demuxer instead, simply use the direct URLs to the
  15999. m3u8 files.
  16000. </p>
  16001. <a name="http"></a>
  16002. <h2 class="section"><a href="ffmpeg-all.html#toc-http">24.11 http</a></h2>
  16003. <p>HTTP (Hyper Text Transfer Protocol).
  16004. </p>
  16005. <p>This protocol accepts the following options:
  16006. </p>
  16007. <dl compact="compact">
  16008. <dt>&lsquo;<samp>seekable</samp>&rsquo;</dt>
  16009. <dd><p>Control seekability of connection. If set to 1 the resource is
  16010. supposed to be seekable, if set to 0 it is assumed not to be seekable,
  16011. if set to -1 it will try to autodetect if it is seekable. Default
  16012. value is -1.
  16013. </p>
  16014. </dd>
  16015. <dt>&lsquo;<samp>chunked_post</samp>&rsquo;</dt>
  16016. <dd><p>If set to 1 use chunked Transfer-Encoding for posts, default is 1.
  16017. </p>
  16018. </dd>
  16019. <dt>&lsquo;<samp>content_type</samp>&rsquo;</dt>
  16020. <dd><p>Set a specific content type for the POST messages or for listen mode.
  16021. </p>
  16022. </dd>
  16023. <dt>&lsquo;<samp>http_proxy</samp>&rsquo;</dt>
  16024. <dd><p>set HTTP proxy to tunnel through e.g. http://example.com:1234
  16025. </p>
  16026. </dd>
  16027. <dt>&lsquo;<samp>headers</samp>&rsquo;</dt>
  16028. <dd><p>Set custom HTTP headers, can override built in default headers. The
  16029. value must be a string encoding the headers.
  16030. </p>
  16031. </dd>
  16032. <dt>&lsquo;<samp>multiple_requests</samp>&rsquo;</dt>
  16033. <dd><p>Use persistent connections if set to 1, default is 0.
  16034. </p>
  16035. </dd>
  16036. <dt>&lsquo;<samp>post_data</samp>&rsquo;</dt>
  16037. <dd><p>Set custom HTTP post data.
  16038. </p>
  16039. </dd>
  16040. <dt>&lsquo;<samp>referer</samp>&rsquo;</dt>
  16041. <dd><p>Set the Referer header. Include &rsquo;Referer: URL&rsquo; header in HTTP request.
  16042. </p>
  16043. </dd>
  16044. <dt>&lsquo;<samp>user_agent</samp>&rsquo;</dt>
  16045. <dd><p>Override the User-Agent header. If not specified the protocol will use a
  16046. string describing the libavformat build. (&quot;Lavf/&lt;version&gt;&quot;)
  16047. </p>
  16048. </dd>
  16049. <dt>&lsquo;<samp>user-agent</samp>&rsquo;</dt>
  16050. <dd><p>This is a deprecated option, you can use user_agent instead it.
  16051. </p>
  16052. </dd>
  16053. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16054. <dd><p>Set timeout in microseconds of socket I/O operations used by the underlying low level
  16055. operation. By default it is set to -1, which means that the timeout is
  16056. not specified.
  16057. </p>
  16058. </dd>
  16059. <dt>&lsquo;<samp>reconnect_at_eof</samp>&rsquo;</dt>
  16060. <dd><p>If set then eof is treated like an error and causes reconnection, this is useful
  16061. for live / endless streams.
  16062. </p>
  16063. </dd>
  16064. <dt>&lsquo;<samp>reconnect_streamed</samp>&rsquo;</dt>
  16065. <dd><p>If set then even streamed/non seekable streams will be reconnected on errors.
  16066. </p>
  16067. </dd>
  16068. <dt>&lsquo;<samp>reconnect_delay_max</samp>&rsquo;</dt>
  16069. <dd><p>Sets the maximum delay in seconds after which to give up reconnecting
  16070. </p>
  16071. </dd>
  16072. <dt>&lsquo;<samp>mime_type</samp>&rsquo;</dt>
  16073. <dd><p>Export the MIME type.
  16074. </p>
  16075. </dd>
  16076. <dt>&lsquo;<samp>http_version</samp>&rsquo;</dt>
  16077. <dd><p>Exports the HTTP response version number. Usually &quot;1.0&quot; or &quot;1.1&quot;.
  16078. </p>
  16079. </dd>
  16080. <dt>&lsquo;<samp>icy</samp>&rsquo;</dt>
  16081. <dd><p>If set to 1 request ICY (SHOUTcast) metadata from the server. If the server
  16082. supports this, the metadata has to be retrieved by the application by reading
  16083. the &lsquo;<samp>icy_metadata_headers</samp>&rsquo; and &lsquo;<samp>icy_metadata_packet</samp>&rsquo; options.
  16084. The default is 1.
  16085. </p>
  16086. </dd>
  16087. <dt>&lsquo;<samp>icy_metadata_headers</samp>&rsquo;</dt>
  16088. <dd><p>If the server supports ICY metadata, this contains the ICY-specific HTTP reply
  16089. headers, separated by newline characters.
  16090. </p>
  16091. </dd>
  16092. <dt>&lsquo;<samp>icy_metadata_packet</samp>&rsquo;</dt>
  16093. <dd><p>If the server supports ICY metadata, and &lsquo;<samp>icy</samp>&rsquo; was set to 1, this
  16094. contains the last non-empty metadata packet sent by the server. It should be
  16095. polled in regular intervals by applications interested in mid-stream metadata
  16096. updates.
  16097. </p>
  16098. </dd>
  16099. <dt>&lsquo;<samp>cookies</samp>&rsquo;</dt>
  16100. <dd><p>Set the cookies to be sent in future requests. The format of each cookie is the
  16101. same as the value of a Set-Cookie HTTP response field. Multiple cookies can be
  16102. delimited by a newline character.
  16103. </p>
  16104. </dd>
  16105. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  16106. <dd><p>Set initial byte offset.
  16107. </p>
  16108. </dd>
  16109. <dt>&lsquo;<samp>end_offset</samp>&rsquo;</dt>
  16110. <dd><p>Try to limit the request to bytes preceding this offset.
  16111. </p>
  16112. </dd>
  16113. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  16114. <dd><p>When used as a client option it sets the HTTP method for the request.
  16115. </p>
  16116. <p>When used as a server option it sets the HTTP method that is going to be
  16117. expected from the client(s).
  16118. If the expected and the received HTTP method do not match the client will
  16119. be given a Bad Request response.
  16120. When unset the HTTP method is not checked for now. This will be replaced by
  16121. autodetection in the future.
  16122. </p>
  16123. </dd>
  16124. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16125. <dd><p>If set to 1 enables experimental HTTP server. This can be used to send data when
  16126. used as an output option, or read data from a client with HTTP POST when used as
  16127. an input option.
  16128. If set to 2 enables experimental multi-client HTTP server. This is not yet implemented
  16129. in ffmpeg.c and thus must not be used as a command line option.
  16130. </p><div class="example">
  16131. <pre class="example"># Server side (sending):
  16132. ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<var>server</var>:<var>port</var>
  16133. # Client side (receiving):
  16134. ffmpeg -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16135. # Client can also be done with wget:
  16136. wget http://<var>server</var>:<var>port</var> -O somefile.ogg
  16137. # Server side (receiving):
  16138. ffmpeg -listen 1 -i http://<var>server</var>:<var>port</var> -c copy somefile.ogg
  16139. # Client side (sending):
  16140. ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<var>server</var>:<var>port</var>
  16141. # Client can also be done with wget:
  16142. wget --post-file=somefile.ogg http://<var>server</var>:<var>port</var>
  16143. </pre></div>
  16144. </dd>
  16145. <dt>&lsquo;<samp>send_expect_100</samp>&rsquo;</dt>
  16146. <dd><p>Send an Expect: 100-continue header for POST. If set to 1 it will send, if set
  16147. to 0 it won&rsquo;t, if set to -1 it will try to send if it is applicable. Default
  16148. value is -1.
  16149. </p>
  16150. </dd>
  16151. </dl>
  16152. <a name="HTTP-Cookies"></a>
  16153. <h3 class="subsection"><a href="ffmpeg-all.html#toc-HTTP-Cookies">24.11.1 HTTP Cookies</a></h3>
  16154. <p>Some HTTP requests will be denied unless cookie values are passed in with the
  16155. request. The &lsquo;<samp>cookies</samp>&rsquo; option allows these cookies to be specified. At
  16156. the very least, each cookie must specify a value along with a path and domain.
  16157. HTTP requests that match both the domain and path will automatically include the
  16158. cookie value in the HTTP Cookie header field. Multiple cookies can be delimited
  16159. by a newline.
  16160. </p>
  16161. <p>The required syntax to play a stream specifying a cookie is:
  16162. </p><div class="example">
  16163. <pre class="example">ffplay -cookies &quot;nlqptid=nltid=tsn; path=/; domain=somedomain.com;&quot; http://somedomain.com/somestream.m3u8
  16164. </pre></div>
  16165. <a name="Icecast"></a>
  16166. <h2 class="section"><a href="ffmpeg-all.html#toc-Icecast">24.12 Icecast</a></h2>
  16167. <p>Icecast protocol (stream to Icecast servers)
  16168. </p>
  16169. <p>This protocol accepts the following options:
  16170. </p>
  16171. <dl compact="compact">
  16172. <dt>&lsquo;<samp>ice_genre</samp>&rsquo;</dt>
  16173. <dd><p>Set the stream genre.
  16174. </p>
  16175. </dd>
  16176. <dt>&lsquo;<samp>ice_name</samp>&rsquo;</dt>
  16177. <dd><p>Set the stream name.
  16178. </p>
  16179. </dd>
  16180. <dt>&lsquo;<samp>ice_description</samp>&rsquo;</dt>
  16181. <dd><p>Set the stream description.
  16182. </p>
  16183. </dd>
  16184. <dt>&lsquo;<samp>ice_url</samp>&rsquo;</dt>
  16185. <dd><p>Set the stream website URL.
  16186. </p>
  16187. </dd>
  16188. <dt>&lsquo;<samp>ice_public</samp>&rsquo;</dt>
  16189. <dd><p>Set if the stream should be public.
  16190. The default is 0 (not public).
  16191. </p>
  16192. </dd>
  16193. <dt>&lsquo;<samp>user_agent</samp>&rsquo;</dt>
  16194. <dd><p>Override the User-Agent header. If not specified a string of the form
  16195. &quot;Lavf/&lt;version&gt;&quot; will be used.
  16196. </p>
  16197. </dd>
  16198. <dt>&lsquo;<samp>password</samp>&rsquo;</dt>
  16199. <dd><p>Set the Icecast mountpoint password.
  16200. </p>
  16201. </dd>
  16202. <dt>&lsquo;<samp>content_type</samp>&rsquo;</dt>
  16203. <dd><p>Set the stream content type. This must be set if it is different from
  16204. audio/mpeg.
  16205. </p>
  16206. </dd>
  16207. <dt>&lsquo;<samp>legacy_icecast</samp>&rsquo;</dt>
  16208. <dd><p>This enables support for Icecast versions &lt; 2.4.0, that do not support the
  16209. HTTP PUT method but the SOURCE method.
  16210. </p>
  16211. </dd>
  16212. </dl>
  16213. <div class="example">
  16214. <pre class="example">icecast://[<var>username</var>[:<var>password</var>]@]<var>server</var>:<var>port</var>/<var>mountpoint</var>
  16215. </pre></div>
  16216. <a name="mmst"></a>
  16217. <h2 class="section"><a href="ffmpeg-all.html#toc-mmst">24.13 mmst</a></h2>
  16218. <p>MMS (Microsoft Media Server) protocol over TCP.
  16219. </p>
  16220. <a name="mmsh"></a>
  16221. <h2 class="section"><a href="ffmpeg-all.html#toc-mmsh">24.14 mmsh</a></h2>
  16222. <p>MMS (Microsoft Media Server) protocol over HTTP.
  16223. </p>
  16224. <p>The required syntax is:
  16225. </p><div class="example">
  16226. <pre class="example">mmsh://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>]
  16227. </pre></div>
  16228. <a name="md5-1"></a>
  16229. <h2 class="section"><a href="ffmpeg-all.html#toc-md5-1">24.15 md5</a></h2>
  16230. <p>MD5 output protocol.
  16231. </p>
  16232. <p>Computes the MD5 hash of the data to be written, and on close writes
  16233. this to the designated output or stdout if none is specified. It can
  16234. be used to test muxers without writing an actual file.
  16235. </p>
  16236. <p>Some examples follow.
  16237. </p><div class="example">
  16238. <pre class="example"># Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
  16239. ffmpeg -i input.flv -f avi -y md5:output.avi.md5
  16240. # Write the MD5 hash of the encoded AVI file to stdout.
  16241. ffmpeg -i input.flv -f avi -y md5:
  16242. </pre></div>
  16243. <p>Note that some formats (typically MOV) require the output protocol to
  16244. be seekable, so they will fail with the MD5 output protocol.
  16245. </p>
  16246. <a name="pipe"></a>
  16247. <h2 class="section"><a href="ffmpeg-all.html#toc-pipe">24.16 pipe</a></h2>
  16248. <p>UNIX pipe access protocol.
  16249. </p>
  16250. <p>Read and write from UNIX pipes.
  16251. </p>
  16252. <p>The accepted syntax is:
  16253. </p><div class="example">
  16254. <pre class="example">pipe:[<var>number</var>]
  16255. </pre></div>
  16256. <p><var>number</var> is the number corresponding to the file descriptor of the
  16257. pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If <var>number</var>
  16258. is not specified, by default the stdout file descriptor will be used
  16259. for writing, stdin for reading.
  16260. </p>
  16261. <p>For example to read from stdin with <code>ffmpeg</code>:
  16262. </p><div class="example">
  16263. <pre class="example">cat test.wav | ffmpeg -i pipe:0
  16264. # ...this is the same as...
  16265. cat test.wav | ffmpeg -i pipe:
  16266. </pre></div>
  16267. <p>For writing to stdout with <code>ffmpeg</code>:
  16268. </p><div class="example">
  16269. <pre class="example">ffmpeg -i test.wav -f avi pipe:1 | cat &gt; test.avi
  16270. # ...this is the same as...
  16271. ffmpeg -i test.wav -f avi pipe: | cat &gt; test.avi
  16272. </pre></div>
  16273. <p>This protocol accepts the following options:
  16274. </p>
  16275. <dl compact="compact">
  16276. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  16277. <dd><p>Set I/O operation maximum block size, in bytes. Default value is
  16278. <code>INT_MAX</code>, which results in not limiting the requested block size.
  16279. Setting this value reasonably low improves user termination request reaction
  16280. time, which is valuable if data transmission is slow.
  16281. </p></dd>
  16282. </dl>
  16283. <p>Note that some formats (typically MOV), require the output protocol to
  16284. be seekable, so they will fail with the pipe output protocol.
  16285. </p>
  16286. <a name="prompeg"></a>
  16287. <h2 class="section"><a href="ffmpeg-all.html#toc-prompeg">24.17 prompeg</a></h2>
  16288. <p>Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
  16289. </p>
  16290. <p>The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction mechanism
  16291. for MPEG-2 Transport Streams sent over RTP.
  16292. </p>
  16293. <p>This protocol must be used in conjunction with the <code>rtp_mpegts</code> muxer and
  16294. the <code>rtp</code> protocol.
  16295. </p>
  16296. <p>The required syntax is:
  16297. </p><div class="example">
  16298. <pre class="example">-f rtp_mpegts -fec prompeg=<var>option</var>=<var>val</var>... rtp://<var>hostname</var>:<var>port</var>
  16299. </pre></div>
  16300. <p>The destination UDP ports are <code>port + 2</code> for the column FEC stream
  16301. and <code>port + 4</code> for the row FEC stream.
  16302. </p>
  16303. <p>This protocol accepts the following options:
  16304. </p><dl compact="compact">
  16305. <dt>&lsquo;<samp>l=<var>n</var></samp>&rsquo;</dt>
  16306. <dd><p>The number of columns (4-20, LxD &lt;= 100)
  16307. </p>
  16308. </dd>
  16309. <dt>&lsquo;<samp>d=<var>n</var></samp>&rsquo;</dt>
  16310. <dd><p>The number of rows (4-20, LxD &lt;= 100)
  16311. </p>
  16312. </dd>
  16313. </dl>
  16314. <p>Example usage:
  16315. </p>
  16316. <div class="example">
  16317. <pre class="example">-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<var>hostname</var>:<var>port</var>
  16318. </pre></div>
  16319. <a name="rtmp"></a>
  16320. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmp">24.18 rtmp</a></h2>
  16321. <p>Real-Time Messaging Protocol.
  16322. </p>
  16323. <p>The Real-Time Messaging Protocol (RTMP) is used for streaming multimedia
  16324. content across a TCP/IP network.
  16325. </p>
  16326. <p>The required syntax is:
  16327. </p><div class="example">
  16328. <pre class="example">rtmp://[<var>username</var>:<var>password</var>@]<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>instance</var>][/<var>playpath</var>]
  16329. </pre></div>
  16330. <p>The accepted parameters are:
  16331. </p><dl compact="compact">
  16332. <dt>&lsquo;<samp>username</samp>&rsquo;</dt>
  16333. <dd><p>An optional username (mostly for publishing).
  16334. </p>
  16335. </dd>
  16336. <dt>&lsquo;<samp>password</samp>&rsquo;</dt>
  16337. <dd><p>An optional password (mostly for publishing).
  16338. </p>
  16339. </dd>
  16340. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  16341. <dd><p>The address of the RTMP server.
  16342. </p>
  16343. </dd>
  16344. <dt>&lsquo;<samp>port</samp>&rsquo;</dt>
  16345. <dd><p>The number of the TCP port to use (by default is 1935).
  16346. </p>
  16347. </dd>
  16348. <dt>&lsquo;<samp>app</samp>&rsquo;</dt>
  16349. <dd><p>It is the name of the application to access. It usually corresponds to
  16350. the path where the application is installed on the RTMP server
  16351. (e.g. &lsquo;<tt>/ondemand/</tt>&rsquo;, &lsquo;<tt>/flash/live/</tt>&rsquo;, etc.). You can override
  16352. the value parsed from the URI through the <code>rtmp_app</code> option, too.
  16353. </p>
  16354. </dd>
  16355. <dt>&lsquo;<samp>playpath</samp>&rsquo;</dt>
  16356. <dd><p>It is the path or name of the resource to play with reference to the
  16357. application specified in <var>app</var>, may be prefixed by &quot;mp4:&quot;. You
  16358. can override the value parsed from the URI through the <code>rtmp_playpath</code>
  16359. option, too.
  16360. </p>
  16361. </dd>
  16362. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16363. <dd><p>Act as a server, listening for an incoming connection.
  16364. </p>
  16365. </dd>
  16366. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16367. <dd><p>Maximum time to wait for the incoming connection. Implies listen.
  16368. </p></dd>
  16369. </dl>
  16370. <p>Additionally, the following parameters can be set via command line options
  16371. (or in code via <code>AVOption</code>s):
  16372. </p><dl compact="compact">
  16373. <dt>&lsquo;<samp>rtmp_app</samp>&rsquo;</dt>
  16374. <dd><p>Name of application to connect on the RTMP server. This option
  16375. overrides the parameter specified in the URI.
  16376. </p>
  16377. </dd>
  16378. <dt>&lsquo;<samp>rtmp_buffer</samp>&rsquo;</dt>
  16379. <dd><p>Set the client buffer time in milliseconds. The default is 3000.
  16380. </p>
  16381. </dd>
  16382. <dt>&lsquo;<samp>rtmp_conn</samp>&rsquo;</dt>
  16383. <dd><p>Extra arbitrary AMF connection parameters, parsed from a string,
  16384. e.g. like <code>B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0</code>.
  16385. Each value is prefixed by a single character denoting the type,
  16386. B for Boolean, N for number, S for string, O for object, or Z for null,
  16387. followed by a colon. For Booleans the data must be either 0 or 1 for
  16388. FALSE or TRUE, respectively. Likewise for Objects the data must be 0 or
  16389. 1 to end or begin an object, respectively. Data items in subobjects may
  16390. be named, by prefixing the type with &rsquo;N&rsquo; and specifying the name before
  16391. the value (i.e. <code>NB:myFlag:1</code>). This option may be used multiple
  16392. times to construct arbitrary AMF sequences.
  16393. </p>
  16394. </dd>
  16395. <dt>&lsquo;<samp>rtmp_flashver</samp>&rsquo;</dt>
  16396. <dd><p>Version of the Flash plugin used to run the SWF player. The default
  16397. is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
  16398. &lt;libavformat version&gt;).)
  16399. </p>
  16400. </dd>
  16401. <dt>&lsquo;<samp>rtmp_flush_interval</samp>&rsquo;</dt>
  16402. <dd><p>Number of packets flushed in the same request (RTMPT only). The default
  16403. is 10.
  16404. </p>
  16405. </dd>
  16406. <dt>&lsquo;<samp>rtmp_live</samp>&rsquo;</dt>
  16407. <dd><p>Specify that the media is a live stream. No resuming or seeking in
  16408. live streams is possible. The default value is <code>any</code>, which means the
  16409. subscriber first tries to play the live stream specified in the
  16410. playpath. If a live stream of that name is not found, it plays the
  16411. recorded stream. The other possible values are <code>live</code> and
  16412. <code>recorded</code>.
  16413. </p>
  16414. </dd>
  16415. <dt>&lsquo;<samp>rtmp_pageurl</samp>&rsquo;</dt>
  16416. <dd><p>URL of the web page in which the media was embedded. By default no
  16417. value will be sent.
  16418. </p>
  16419. </dd>
  16420. <dt>&lsquo;<samp>rtmp_playpath</samp>&rsquo;</dt>
  16421. <dd><p>Stream identifier to play or to publish. This option overrides the
  16422. parameter specified in the URI.
  16423. </p>
  16424. </dd>
  16425. <dt>&lsquo;<samp>rtmp_subscribe</samp>&rsquo;</dt>
  16426. <dd><p>Name of live stream to subscribe to. By default no value will be sent.
  16427. It is only sent if the option is specified or if rtmp_live
  16428. is set to live.
  16429. </p>
  16430. </dd>
  16431. <dt>&lsquo;<samp>rtmp_swfhash</samp>&rsquo;</dt>
  16432. <dd><p>SHA256 hash of the decompressed SWF file (32 bytes).
  16433. </p>
  16434. </dd>
  16435. <dt>&lsquo;<samp>rtmp_swfsize</samp>&rsquo;</dt>
  16436. <dd><p>Size of the decompressed SWF file, required for SWFVerification.
  16437. </p>
  16438. </dd>
  16439. <dt>&lsquo;<samp>rtmp_swfurl</samp>&rsquo;</dt>
  16440. <dd><p>URL of the SWF player for the media. By default no value will be sent.
  16441. </p>
  16442. </dd>
  16443. <dt>&lsquo;<samp>rtmp_swfverify</samp>&rsquo;</dt>
  16444. <dd><p>URL to player swf file, compute hash/size automatically.
  16445. </p>
  16446. </dd>
  16447. <dt>&lsquo;<samp>rtmp_tcurl</samp>&rsquo;</dt>
  16448. <dd><p>URL of the target stream. Defaults to proto://host[:port]/app.
  16449. </p>
  16450. </dd>
  16451. </dl>
  16452. <p>For example to read with <code>ffplay</code> a multimedia resource named
  16453. &quot;sample&quot; from the application &quot;vod&quot; from an RTMP server &quot;myserver&quot;:
  16454. </p><div class="example">
  16455. <pre class="example">ffplay rtmp://myserver/vod/sample
  16456. </pre></div>
  16457. <p>To publish to a password protected server, passing the playpath and
  16458. app names separately:
  16459. </p><div class="example">
  16460. <pre class="example">ffmpeg -re -i &lt;input&gt; -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
  16461. </pre></div>
  16462. <a name="rtmpe"></a>
  16463. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpe">24.19 rtmpe</a></h2>
  16464. <p>Encrypted Real-Time Messaging Protocol.
  16465. </p>
  16466. <p>The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
  16467. streaming multimedia content within standard cryptographic primitives,
  16468. consisting of Diffie-Hellman key exchange and HMACSHA256, generating
  16469. a pair of RC4 keys.
  16470. </p>
  16471. <a name="rtmps"></a>
  16472. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmps">24.20 rtmps</a></h2>
  16473. <p>Real-Time Messaging Protocol over a secure SSL connection.
  16474. </p>
  16475. <p>The Real-Time Messaging Protocol (RTMPS) is used for streaming
  16476. multimedia content across an encrypted connection.
  16477. </p>
  16478. <a name="rtmpt"></a>
  16479. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpt">24.21 rtmpt</a></h2>
  16480. <p>Real-Time Messaging Protocol tunneled through HTTP.
  16481. </p>
  16482. <p>The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
  16483. for streaming multimedia content within HTTP requests to traverse
  16484. firewalls.
  16485. </p>
  16486. <a name="rtmpte"></a>
  16487. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpte">24.22 rtmpte</a></h2>
  16488. <p>Encrypted Real-Time Messaging Protocol tunneled through HTTP.
  16489. </p>
  16490. <p>The Encrypted Real-Time Messaging Protocol tunneled through HTTP (RTMPTE)
  16491. is used for streaming multimedia content within HTTP requests to traverse
  16492. firewalls.
  16493. </p>
  16494. <a name="rtmpts"></a>
  16495. <h2 class="section"><a href="ffmpeg-all.html#toc-rtmpts">24.23 rtmpts</a></h2>
  16496. <p>Real-Time Messaging Protocol tunneled through HTTPS.
  16497. </p>
  16498. <p>The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is used
  16499. for streaming multimedia content within HTTPS requests to traverse
  16500. firewalls.
  16501. </p>
  16502. <a name="libsmbclient"></a>
  16503. <h2 class="section"><a href="ffmpeg-all.html#toc-libsmbclient">24.24 libsmbclient</a></h2>
  16504. <p>libsmbclient permits one to manipulate CIFS/SMB network resources.
  16505. </p>
  16506. <p>Following syntax is required.
  16507. </p>
  16508. <div class="example">
  16509. <pre class="example">smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
  16510. </pre></div>
  16511. <p>This protocol accepts the following options.
  16512. </p>
  16513. <dl compact="compact">
  16514. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16515. <dd><p>Set timeout in milliseconds of socket I/O operations used by the underlying
  16516. low level operation. By default it is set to -1, which means that the timeout
  16517. is not specified.
  16518. </p>
  16519. </dd>
  16520. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  16521. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16522. truncating. Default value is 1.
  16523. </p>
  16524. </dd>
  16525. <dt>&lsquo;<samp>workgroup</samp>&rsquo;</dt>
  16526. <dd><p>Set the workgroup used for making connections. By default workgroup is not specified.
  16527. </p>
  16528. </dd>
  16529. </dl>
  16530. <p>For more information see: <a href="http://www.samba.org/">http://www.samba.org/</a>.
  16531. </p>
  16532. <a name="libssh"></a>
  16533. <h2 class="section"><a href="ffmpeg-all.html#toc-libssh">24.25 libssh</a></h2>
  16534. <p>Secure File Transfer Protocol via libssh
  16535. </p>
  16536. <p>Read from or write to remote resources using SFTP protocol.
  16537. </p>
  16538. <p>Following syntax is required.
  16539. </p>
  16540. <div class="example">
  16541. <pre class="example">sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
  16542. </pre></div>
  16543. <p>This protocol accepts the following options.
  16544. </p>
  16545. <dl compact="compact">
  16546. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16547. <dd><p>Set timeout of socket I/O operations used by the underlying low level
  16548. operation. By default it is set to -1, which means that the timeout
  16549. is not specified.
  16550. </p>
  16551. </dd>
  16552. <dt>&lsquo;<samp>truncate</samp>&rsquo;</dt>
  16553. <dd><p>Truncate existing files on write, if set to 1. A value of 0 prevents
  16554. truncating. Default value is 1.
  16555. </p>
  16556. </dd>
  16557. <dt>&lsquo;<samp>private_key</samp>&rsquo;</dt>
  16558. <dd><p>Specify the path of the file containing private key to use during authorization.
  16559. By default libssh searches for keys in the &lsquo;<tt>~/.ssh/</tt>&rsquo; directory.
  16560. </p>
  16561. </dd>
  16562. </dl>
  16563. <p>Example: Play a file stored on remote server.
  16564. </p>
  16565. <div class="example">
  16566. <pre class="example">ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
  16567. </pre></div>
  16568. <a name="librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte"></a>
  16569. <h2 class="section"><a href="ffmpeg-all.html#toc-librtmp-rtmp_002c-rtmpe_002c-rtmps_002c-rtmpt_002c-rtmpte">24.26 librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte</a></h2>
  16570. <p>Real-Time Messaging Protocol and its variants supported through
  16571. librtmp.
  16572. </p>
  16573. <p>Requires the presence of the librtmp headers and library during
  16574. configuration. You need to explicitly configure the build with
  16575. &quot;&ndash;enable-librtmp&quot;. If enabled this will replace the native RTMP
  16576. protocol.
  16577. </p>
  16578. <p>This protocol provides most client functions and a few server
  16579. functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT),
  16580. encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled
  16581. variants of these encrypted types (RTMPTE, RTMPTS).
  16582. </p>
  16583. <p>The required syntax is:
  16584. </p><div class="example">
  16585. <pre class="example"><var>rtmp_proto</var>://<var>server</var>[:<var>port</var>][/<var>app</var>][/<var>playpath</var>] <var>options</var>
  16586. </pre></div>
  16587. <p>where <var>rtmp_proto</var> is one of the strings &quot;rtmp&quot;, &quot;rtmpt&quot;, &quot;rtmpe&quot;,
  16588. &quot;rtmps&quot;, &quot;rtmpte&quot;, &quot;rtmpts&quot; corresponding to each RTMP variant, and
  16589. <var>server</var>, <var>port</var>, <var>app</var> and <var>playpath</var> have the same
  16590. meaning as specified for the RTMP native protocol.
  16591. <var>options</var> contains a list of space-separated options of the form
  16592. <var>key</var>=<var>val</var>.
  16593. </p>
  16594. <p>See the librtmp manual page (man 3 librtmp) for more information.
  16595. </p>
  16596. <p>For example, to stream a file in real-time to an RTMP server using
  16597. <code>ffmpeg</code>:
  16598. </p><div class="example">
  16599. <pre class="example">ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
  16600. </pre></div>
  16601. <p>To play the same stream using <code>ffplay</code>:
  16602. </p><div class="example">
  16603. <pre class="example">ffplay &quot;rtmp://myserver/live/mystream live=1&quot;
  16604. </pre></div>
  16605. <a name="rtp"></a>
  16606. <h2 class="section"><a href="ffmpeg-all.html#toc-rtp">24.27 rtp</a></h2>
  16607. <p>Real-time Transport Protocol.
  16608. </p>
  16609. <p>The required syntax for an RTP URL is:
  16610. rtp://<var>hostname</var>[:<var>port</var>][?<var>option</var>=<var>val</var>...]
  16611. </p>
  16612. <p><var>port</var> specifies the RTP port to use.
  16613. </p>
  16614. <p>The following URL options are supported:
  16615. </p>
  16616. <dl compact="compact">
  16617. <dt>&lsquo;<samp>ttl=<var>n</var></samp>&rsquo;</dt>
  16618. <dd><p>Set the TTL (Time-To-Live) value (for multicast only).
  16619. </p>
  16620. </dd>
  16621. <dt>&lsquo;<samp>rtcpport=<var>n</var></samp>&rsquo;</dt>
  16622. <dd><p>Set the remote RTCP port to <var>n</var>.
  16623. </p>
  16624. </dd>
  16625. <dt>&lsquo;<samp>localrtpport=<var>n</var></samp>&rsquo;</dt>
  16626. <dd><p>Set the local RTP port to <var>n</var>.
  16627. </p>
  16628. </dd>
  16629. <dt>&lsquo;<samp>localrtcpport=<var>n</var>'</samp>&rsquo;</dt>
  16630. <dd><p>Set the local RTCP port to <var>n</var>.
  16631. </p>
  16632. </dd>
  16633. <dt>&lsquo;<samp>pkt_size=<var>n</var></samp>&rsquo;</dt>
  16634. <dd><p>Set max packet size (in bytes) to <var>n</var>.
  16635. </p>
  16636. </dd>
  16637. <dt>&lsquo;<samp>connect=0|1</samp>&rsquo;</dt>
  16638. <dd><p>Do a <code>connect()</code> on the UDP socket (if set to 1) or not (if set
  16639. to 0).
  16640. </p>
  16641. </dd>
  16642. <dt>&lsquo;<samp>sources=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
  16643. <dd><p>List allowed source IP addresses.
  16644. </p>
  16645. </dd>
  16646. <dt>&lsquo;<samp>block=<var>ip</var>[,<var>ip</var>]</samp>&rsquo;</dt>
  16647. <dd><p>List disallowed (blocked) source IP addresses.
  16648. </p>
  16649. </dd>
  16650. <dt>&lsquo;<samp>write_to_source=0|1</samp>&rsquo;</dt>
  16651. <dd><p>Send packets to the source address of the latest received packet (if
  16652. set to 1) or to a default remote address (if set to 0).
  16653. </p>
  16654. </dd>
  16655. <dt>&lsquo;<samp>localport=<var>n</var></samp>&rsquo;</dt>
  16656. <dd><p>Set the local RTP port to <var>n</var>.
  16657. </p>
  16658. <p>This is a deprecated option. Instead, &lsquo;<samp>localrtpport</samp>&rsquo; should be
  16659. used.
  16660. </p>
  16661. </dd>
  16662. </dl>
  16663. <p>Important notes:
  16664. </p>
  16665. <ol>
  16666. <li>
  16667. If &lsquo;<samp>rtcpport</samp>&rsquo; is not set the RTCP port will be set to the RTP
  16668. port value plus 1.
  16669. </li><li>
  16670. If &lsquo;<samp>localrtpport</samp>&rsquo; (the local RTP port) is not set any available
  16671. port will be used for the local RTP and RTCP ports.
  16672. </li><li>
  16673. If &lsquo;<samp>localrtcpport</samp>&rsquo; (the local RTCP port) is not set it will be
  16674. set to the local RTP port value plus 1.
  16675. </li></ol>
  16676. <a name="rtsp"></a>
  16677. <h2 class="section"><a href="ffmpeg-all.html#toc-rtsp">24.28 rtsp</a></h2>
  16678. <p>Real-Time Streaming Protocol.
  16679. </p>
  16680. <p>RTSP is not technically a protocol handler in libavformat, it is a demuxer
  16681. and muxer. The demuxer supports both normal RTSP (with data transferred
  16682. over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with
  16683. data transferred over RDT).
  16684. </p>
  16685. <p>The muxer can be used to send a stream using RTSP ANNOUNCE to a server
  16686. supporting it (currently Darwin Streaming Server and Mischa Spiegelmock&rsquo;s
  16687. <a href="https://github.com/revmischa/rtsp-server">RTSP server</a>).
  16688. </p>
  16689. <p>The required syntax for a RTSP url is:
  16690. </p><div class="example">
  16691. <pre class="example">rtsp://<var>hostname</var>[:<var>port</var>]/<var>path</var>
  16692. </pre></div>
  16693. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  16694. line, or set in code via <code>AVOption</code>s or in
  16695. <code>avformat_open_input</code>.
  16696. </p>
  16697. <p>The following options are supported.
  16698. </p>
  16699. <dl compact="compact">
  16700. <dt>&lsquo;<samp>initial_pause</samp>&rsquo;</dt>
  16701. <dd><p>Do not start playing the stream immediately if set to 1. Default value
  16702. is 0.
  16703. </p>
  16704. </dd>
  16705. <dt>&lsquo;<samp>rtsp_transport</samp>&rsquo;</dt>
  16706. <dd><p>Set RTSP transport protocols.
  16707. </p>
  16708. <p>It accepts the following values:
  16709. </p><dl compact="compact">
  16710. <dt>&lsquo;<samp>udp</samp>&rsquo;</dt>
  16711. <dd><p>Use UDP as lower transport protocol.
  16712. </p>
  16713. </dd>
  16714. <dt>&lsquo;<samp>tcp</samp>&rsquo;</dt>
  16715. <dd><p>Use TCP (interleaving within the RTSP control channel) as lower
  16716. transport protocol.
  16717. </p>
  16718. </dd>
  16719. <dt>&lsquo;<samp>udp_multicast</samp>&rsquo;</dt>
  16720. <dd><p>Use UDP multicast as lower transport protocol.
  16721. </p>
  16722. </dd>
  16723. <dt>&lsquo;<samp>http</samp>&rsquo;</dt>
  16724. <dd><p>Use HTTP tunneling as lower transport protocol, which is useful for
  16725. passing proxies.
  16726. </p></dd>
  16727. </dl>
  16728. <p>Multiple lower transport protocols may be specified, in that case they are
  16729. tried one at a time (if the setup of one fails, the next one is tried).
  16730. For the muxer, only the &lsquo;<samp>tcp</samp>&rsquo; and &lsquo;<samp>udp</samp>&rsquo; options are supported.
  16731. </p>
  16732. </dd>
  16733. <dt>&lsquo;<samp>rtsp_flags</samp>&rsquo;</dt>
  16734. <dd><p>Set RTSP flags.
  16735. </p>
  16736. <p>The following values are accepted:
  16737. </p><dl compact="compact">
  16738. <dt>&lsquo;<samp>filter_src</samp>&rsquo;</dt>
  16739. <dd><p>Accept packets only from negotiated peer address and port.
  16740. </p></dd>
  16741. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16742. <dd><p>Act as a server, listening for an incoming connection.
  16743. </p></dd>
  16744. <dt>&lsquo;<samp>prefer_tcp</samp>&rsquo;</dt>
  16745. <dd><p>Try TCP for RTP transport first, if TCP is available as RTSP RTP transport.
  16746. </p></dd>
  16747. </dl>
  16748. <p>Default value is &lsquo;<samp>none</samp>&rsquo;.
  16749. </p>
  16750. </dd>
  16751. <dt>&lsquo;<samp>allowed_media_types</samp>&rsquo;</dt>
  16752. <dd><p>Set media types to accept from the server.
  16753. </p>
  16754. <p>The following flags are accepted:
  16755. </p><dl compact="compact">
  16756. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  16757. <dt>&lsquo;<samp>audio</samp>&rsquo;</dt>
  16758. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  16759. </dl>
  16760. <p>By default it accepts all media types.
  16761. </p>
  16762. </dd>
  16763. <dt>&lsquo;<samp>min_port</samp>&rsquo;</dt>
  16764. <dd><p>Set minimum local UDP port. Default value is 5000.
  16765. </p>
  16766. </dd>
  16767. <dt>&lsquo;<samp>max_port</samp>&rsquo;</dt>
  16768. <dd><p>Set maximum local UDP port. Default value is 65000.
  16769. </p>
  16770. </dd>
  16771. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  16772. <dd><p>Set maximum timeout (in seconds) to wait for incoming connections.
  16773. </p>
  16774. <p>A value of -1 means infinite (default). This option implies the
  16775. &lsquo;<samp>rtsp_flags</samp>&rsquo; set to &lsquo;<samp>listen</samp>&rsquo;.
  16776. </p>
  16777. </dd>
  16778. <dt>&lsquo;<samp>reorder_queue_size</samp>&rsquo;</dt>
  16779. <dd><p>Set number of packets to buffer for handling of reordered packets.
  16780. </p>
  16781. </dd>
  16782. <dt>&lsquo;<samp>stimeout</samp>&rsquo;</dt>
  16783. <dd><p>Set socket TCP I/O timeout in microseconds.
  16784. </p>
  16785. </dd>
  16786. <dt>&lsquo;<samp>user-agent</samp>&rsquo;</dt>
  16787. <dd><p>Override User-Agent header. If not specified, it defaults to the
  16788. libavformat identifier string.
  16789. </p></dd>
  16790. </dl>
  16791. <p>When receiving data over UDP, the demuxer tries to reorder received packets
  16792. (since they may arrive out of order, or packets may get lost totally). This
  16793. can be disabled by setting the maximum demuxing delay to zero (via
  16794. the <code>max_delay</code> field of AVFormatContext).
  16795. </p>
  16796. <p>When watching multi-bitrate Real-RTSP streams with <code>ffplay</code>, the
  16797. streams to display can be chosen with <code>-vst</code> <var>n</var> and
  16798. <code>-ast</code> <var>n</var> for video and audio respectively, and can be switched
  16799. on the fly by pressing <code>v</code> and <code>a</code>.
  16800. </p>
  16801. <a name="Examples-96"></a>
  16802. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-96">24.28.1 Examples</a></h3>
  16803. <p>The following examples all make use of the <code>ffplay</code> and
  16804. <code>ffmpeg</code> tools.
  16805. </p>
  16806. <ul>
  16807. <li>
  16808. Watch a stream over UDP, with a max reordering delay of 0.5 seconds:
  16809. <div class="example">
  16810. <pre class="example">ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
  16811. </pre></div>
  16812. </li><li>
  16813. Watch a stream tunneled over HTTP:
  16814. <div class="example">
  16815. <pre class="example">ffplay -rtsp_transport http rtsp://server/video.mp4
  16816. </pre></div>
  16817. </li><li>
  16818. Send a stream in realtime to a RTSP server, for others to watch:
  16819. <div class="example">
  16820. <pre class="example">ffmpeg -re -i <var>input</var> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
  16821. </pre></div>
  16822. </li><li>
  16823. Receive a stream in realtime:
  16824. <div class="example">
  16825. <pre class="example">ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <var>output</var>
  16826. </pre></div>
  16827. </li></ul>
  16828. <a name="sap"></a>
  16829. <h2 class="section"><a href="ffmpeg-all.html#toc-sap">24.29 sap</a></h2>
  16830. <p>Session Announcement Protocol (RFC 2974). This is not technically a
  16831. protocol handler in libavformat, it is a muxer and demuxer.
  16832. It is used for signalling of RTP streams, by announcing the SDP for the
  16833. streams regularly on a separate port.
  16834. </p>
  16835. <a name="Muxer"></a>
  16836. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Muxer">24.29.1 Muxer</a></h3>
  16837. <p>The syntax for a SAP url given to the muxer is:
  16838. </p><div class="example">
  16839. <pre class="example">sap://<var>destination</var>[:<var>port</var>][?<var>options</var>]
  16840. </pre></div>
  16841. <p>The RTP packets are sent to <var>destination</var> on port <var>port</var>,
  16842. or to port 5004 if no port is specified.
  16843. <var>options</var> is a <code>&amp;</code>-separated list. The following options
  16844. are supported:
  16845. </p>
  16846. <dl compact="compact">
  16847. <dt>&lsquo;<samp>announce_addr=<var>address</var></samp>&rsquo;</dt>
  16848. <dd><p>Specify the destination IP address for sending the announcements to.
  16849. If omitted, the announcements are sent to the commonly used SAP
  16850. announcement multicast address 224.2.127.254 (sap.mcast.net), or
  16851. ff0e::2:7ffe if <var>destination</var> is an IPv6 address.
  16852. </p>
  16853. </dd>
  16854. <dt>&lsquo;<samp>announce_port=<var>port</var></samp>&rsquo;</dt>
  16855. <dd><p>Specify the port to send the announcements on, defaults to
  16856. 9875 if not specified.
  16857. </p>
  16858. </dd>
  16859. <dt>&lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
  16860. <dd><p>Specify the time to live value for the announcements and RTP packets,
  16861. defaults to 255.
  16862. </p>
  16863. </dd>
  16864. <dt>&lsquo;<samp>same_port=<var>0|1</var></samp>&rsquo;</dt>
  16865. <dd><p>If set to 1, send all RTP streams on the same port pair. If zero (the
  16866. default), all streams are sent on unique ports, with each stream on a
  16867. port 2 numbers higher than the previous.
  16868. VLC/Live555 requires this to be set to 1, to be able to receive the stream.
  16869. The RTP stack in libavformat for receiving requires all streams to be sent
  16870. on unique ports.
  16871. </p></dd>
  16872. </dl>
  16873. <p>Example command lines follow.
  16874. </p>
  16875. <p>To broadcast a stream on the local subnet, for watching in VLC:
  16876. </p>
  16877. <div class="example">
  16878. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255?same_port=1
  16879. </pre></div>
  16880. <p>Similarly, for watching in <code>ffplay</code>:
  16881. </p>
  16882. <div class="example">
  16883. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://224.0.0.255
  16884. </pre></div>
  16885. <p>And for watching in <code>ffplay</code>, over IPv6:
  16886. </p>
  16887. <div class="example">
  16888. <pre class="example">ffmpeg -re -i <var>input</var> -f sap sap://[ff0e::1:2:3:4]
  16889. </pre></div>
  16890. <a name="Demuxer"></a>
  16891. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Demuxer">24.29.2 Demuxer</a></h3>
  16892. <p>The syntax for a SAP url given to the demuxer is:
  16893. </p><div class="example">
  16894. <pre class="example">sap://[<var>address</var>][:<var>port</var>]
  16895. </pre></div>
  16896. <p><var>address</var> is the multicast address to listen for announcements on,
  16897. if omitted, the default 224.2.127.254 (sap.mcast.net) is used. <var>port</var>
  16898. is the port that is listened on, 9875 if omitted.
  16899. </p>
  16900. <p>The demuxers listens for announcements on the given address and port.
  16901. Once an announcement is received, it tries to receive that particular stream.
  16902. </p>
  16903. <p>Example command lines follow.
  16904. </p>
  16905. <p>To play back the first stream announced on the normal SAP multicast address:
  16906. </p>
  16907. <div class="example">
  16908. <pre class="example">ffplay sap://
  16909. </pre></div>
  16910. <p>To play back the first stream announced on one the default IPv6 SAP multicast address:
  16911. </p>
  16912. <div class="example">
  16913. <pre class="example">ffplay sap://[ff0e::2:7ffe]
  16914. </pre></div>
  16915. <a name="sctp"></a>
  16916. <h2 class="section"><a href="ffmpeg-all.html#toc-sctp">24.30 sctp</a></h2>
  16917. <p>Stream Control Transmission Protocol.
  16918. </p>
  16919. <p>The accepted URL syntax is:
  16920. </p><div class="example">
  16921. <pre class="example">sctp://<var>host</var>:<var>port</var>[?<var>options</var>]
  16922. </pre></div>
  16923. <p>The protocol accepts the following options:
  16924. </p><dl compact="compact">
  16925. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  16926. <dd><p>If set to any value, listen for an incoming connection. Outgoing connection is done by default.
  16927. </p>
  16928. </dd>
  16929. <dt>&lsquo;<samp>max_streams</samp>&rsquo;</dt>
  16930. <dd><p>Set the maximum number of streams. By default no limit is set.
  16931. </p></dd>
  16932. </dl>
  16933. <a name="srt"></a>
  16934. <h2 class="section"><a href="ffmpeg-all.html#toc-srt">24.31 srt</a></h2>
  16935. <p>Haivision Secure Reliable Transport Protocol via libsrt.
  16936. </p>
  16937. <p>The supported syntax for a SRT URL is:
  16938. </p><div class="example">
  16939. <pre class="example">srt://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  16940. </pre></div>
  16941. <p><var>options</var> contains a list of &amp;-separated options of the form
  16942. <var>key</var>=<var>val</var>.
  16943. </p>
  16944. <p>or
  16945. </p>
  16946. <div class="example">
  16947. <pre class="example"><var>options</var> srt://<var>hostname</var>:<var>port</var>
  16948. </pre></div>
  16949. <p><var>options</var> contains a list of &rsquo;-<var>key</var> <var>val</var>&rsquo;
  16950. options.
  16951. </p>
  16952. <p>This protocol accepts the following options.
  16953. </p>
  16954. <dl compact="compact">
  16955. <dt>&lsquo;<samp>connect_timeout</samp>&rsquo;</dt>
  16956. <dd><p>Connection timeout; SRT cannot connect for RTT &gt; 1500 msec
  16957. (2 handshake exchanges) with the default connect timeout of
  16958. 3 seconds. This option applies to the caller and rendezvous
  16959. connection modes. The connect timeout is 10 times the value
  16960. set for the rendezvous mode (which can be used as a
  16961. workaround for this connection problem with earlier versions).
  16962. </p>
  16963. </dd>
  16964. <dt>&lsquo;<samp>ffs=<var>bytes</var></samp>&rsquo;</dt>
  16965. <dd><p>Flight Flag Size (Window Size), in bytes. FFS is actually an
  16966. internal parameter and you should set it to not less than
  16967. &lsquo;<samp>recv_buffer_size</samp>&rsquo; and &lsquo;<samp>mss</samp>&rsquo;. The default value
  16968. is relatively large, therefore unless you set a very large receiver buffer,
  16969. you do not need to change this option. Default value is 25600.
  16970. </p>
  16971. </dd>
  16972. <dt>&lsquo;<samp>inputbw=<var>bytes/seconds</var></samp>&rsquo;</dt>
  16973. <dd><p>Sender nominal input rate, in bytes per seconds. Used along with
  16974. &lsquo;<samp>oheadbw</samp>&rsquo;, when &lsquo;<samp>maxbw</samp>&rsquo; is set to relative (0), to
  16975. calculate maximum sending rate when recovery packets are sent
  16976. along with the main media stream:
  16977. &lsquo;<samp>inputbw</samp>&rsquo; * (100 + &lsquo;<samp>oheadbw</samp>&rsquo;) / 100
  16978. if &lsquo;<samp>inputbw</samp>&rsquo; is not set while &lsquo;<samp>maxbw</samp>&rsquo; is set to
  16979. relative (0), the actual input rate is evaluated inside
  16980. the library. Default value is 0.
  16981. </p>
  16982. </dd>
  16983. <dt>&lsquo;<samp>iptos=<var>tos</var></samp>&rsquo;</dt>
  16984. <dd><p>IP Type of Service. Applies to sender only. Default value is 0xB8.
  16985. </p>
  16986. </dd>
  16987. <dt>&lsquo;<samp>ipttl=<var>ttl</var></samp>&rsquo;</dt>
  16988. <dd><p>IP Time To Live. Applies to sender only. Default value is 64.
  16989. </p>
  16990. </dd>
  16991. <dt>&lsquo;<samp>latency</samp>&rsquo;</dt>
  16992. <dd><p>Timestamp-based Packet Delivery Delay.
  16993. Used to absorb bursts of missed packet retransmissions.
  16994. This flag sets both &lsquo;<samp>rcvlatency</samp>&rsquo; and &lsquo;<samp>peerlatency</samp>&rsquo;
  16995. to the same value. Note that prior to version 1.3.0
  16996. this is the only flag to set the latency, however
  16997. this is effectively equivalent to setting &lsquo;<samp>peerlatency</samp>&rsquo;,
  16998. when side is sender and &lsquo;<samp>rcvlatency</samp>&rsquo;
  16999. when side is receiver, and the bidirectional stream
  17000. sending is not supported.
  17001. </p>
  17002. </dd>
  17003. <dt>&lsquo;<samp>listen_timeout</samp>&rsquo;</dt>
  17004. <dd><p>Set socket listen timeout.
  17005. </p>
  17006. </dd>
  17007. <dt>&lsquo;<samp>maxbw=<var>bytes/seconds</var></samp>&rsquo;</dt>
  17008. <dd><p>Maximum sending bandwidth, in bytes per seconds.
  17009. -1 infinite (CSRTCC limit is 30mbps)
  17010. 0 relative to input rate (see &lsquo;<samp>inputbw</samp>&rsquo;)
  17011. &gt;0 absolute limit value
  17012. Default value is 0 (relative)
  17013. </p>
  17014. </dd>
  17015. <dt>&lsquo;<samp>mode=<var>caller|listener|rendezvous</var></samp>&rsquo;</dt>
  17016. <dd><p>Connection mode.
  17017. &lsquo;<samp>caller</samp>&rsquo; opens client connection.
  17018. &lsquo;<samp>listener</samp>&rsquo; starts server to listen for incoming connections.
  17019. &lsquo;<samp>rendezvous</samp>&rsquo; use Rendez-Vous connection mode.
  17020. Default value is caller.
  17021. </p>
  17022. </dd>
  17023. <dt>&lsquo;<samp>mss=<var>bytes</var></samp>&rsquo;</dt>
  17024. <dd><p>Maximum Segment Size, in bytes. Used for buffer allocation
  17025. and rate calculation using a packet counter assuming fully
  17026. filled packets. The smallest MSS between the peers is
  17027. used. This is 1500 by default in the overall internet.
  17028. This is the maximum size of the UDP packet and can be
  17029. only decreased, unless you have some unusual dedicated
  17030. network settings. Default value is 1500.
  17031. </p>
  17032. </dd>
  17033. <dt>&lsquo;<samp>nakreport=<var>1|0</var></samp>&rsquo;</dt>
  17034. <dd><p>If set to 1, Receiver will send &lsquo;UMSG_LOSSREPORT&lsquo; messages
  17035. periodically until a lost packet is retransmitted or
  17036. intentionally dropped. Default value is 1.
  17037. </p>
  17038. </dd>
  17039. <dt>&lsquo;<samp>oheadbw=<var>percents</var></samp>&rsquo;</dt>
  17040. <dd><p>Recovery bandwidth overhead above input rate, in percents.
  17041. See &lsquo;<samp>inputbw</samp>&rsquo;. Default value is 25%.
  17042. </p>
  17043. </dd>
  17044. <dt>&lsquo;<samp>passphrase=<var>string</var></samp>&rsquo;</dt>
  17045. <dd><p>HaiCrypt Encryption/Decryption Passphrase string, length
  17046. from 10 to 79 characters. The passphrase is the shared
  17047. secret between the sender and the receiver. It is used
  17048. to generate the Key Encrypting Key using PBKDF2
  17049. (Password-Based Key Derivation Function). It is used
  17050. only if &lsquo;<samp>pbkeylen</samp>&rsquo; is non-zero. It is used on
  17051. the receiver only if the received data is encrypted.
  17052. The configured passphrase cannot be recovered (write-only).
  17053. </p>
  17054. </dd>
  17055. <dt>&lsquo;<samp>enforced_encryption=<var>1|0</var></samp>&rsquo;</dt>
  17056. <dd><p>If true, both connection parties must have the same password
  17057. set (including empty, that is, with no encryption). If the
  17058. password doesn&rsquo;t match or only one side is unencrypted,
  17059. the connection is rejected. Default is true.
  17060. </p>
  17061. </dd>
  17062. <dt>&lsquo;<samp>kmrefreshrate=<var>packets</var></samp>&rsquo;</dt>
  17063. <dd><p>The number of packets to be transmitted after which the
  17064. encryption key is switched to a new key. Default is -1.
  17065. -1 means auto (0x1000000 in srt library). The range for
  17066. this option is integers in the 0 - <code>INT_MAX</code>.
  17067. </p>
  17068. </dd>
  17069. <dt>&lsquo;<samp>kmpreannounce=<var>packets</var></samp>&rsquo;</dt>
  17070. <dd><p>The interval between when a new encryption key is sent and
  17071. when switchover occurs. This value also applies to the
  17072. subsequent interval between when switchover occurs and
  17073. when the old encryption key is decommissioned. Default is -1.
  17074. -1 means auto (0x1000 in srt library). The range for
  17075. this option is integers in the 0 - <code>INT_MAX</code>.
  17076. </p>
  17077. </dd>
  17078. <dt>&lsquo;<samp>payload_size=<var>bytes</var></samp>&rsquo;</dt>
  17079. <dd><p>Sets the maximum declared size of a packet transferred
  17080. during the single call to the sending function in Live
  17081. mode. Use 0 if this value isn&rsquo;t used (which is default in
  17082. file mode).
  17083. Default is -1 (automatic), which typically means MPEG-TS;
  17084. if you are going to use SRT
  17085. to send any different kind of payload, such as, for example,
  17086. wrapping a live stream in very small frames, then you can
  17087. use a bigger maximum frame size, though not greater than
  17088. 1456 bytes.
  17089. </p>
  17090. </dd>
  17091. <dt>&lsquo;<samp>pkt_size=<var>bytes</var></samp>&rsquo;</dt>
  17092. <dd><p>Alias for &lsquo;<samp>payload_size</samp>&rsquo;.
  17093. </p>
  17094. </dd>
  17095. <dt>&lsquo;<samp>peerlatency</samp>&rsquo;</dt>
  17096. <dd><p>The latency value (as described in &lsquo;<samp>rcvlatency</samp>&rsquo;) that is
  17097. set by the sender side as a minimum value for the receiver.
  17098. </p>
  17099. </dd>
  17100. <dt>&lsquo;<samp>pbkeylen=<var>bytes</var></samp>&rsquo;</dt>
  17101. <dd><p>Sender encryption key length, in bytes.
  17102. Only can be set to 0, 16, 24 and 32.
  17103. Enable sender encryption if not 0.
  17104. Not required on receiver (set to 0),
  17105. key size obtained from sender in HaiCrypt handshake.
  17106. Default value is 0.
  17107. </p>
  17108. </dd>
  17109. <dt>&lsquo;<samp>rcvlatency</samp>&rsquo;</dt>
  17110. <dd><p>The time that should elapse since the moment when the
  17111. packet was sent and the moment when it&rsquo;s delivered to
  17112. the receiver application in the receiving function.
  17113. This time should be a buffer time large enough to cover
  17114. the time spent for sending, unexpectedly extended RTT
  17115. time, and the time needed to retransmit the lost UDP
  17116. packet. The effective latency value will be the maximum
  17117. of this options&rsquo; value and the value of &lsquo;<samp>peerlatency</samp>&rsquo;
  17118. set by the peer side. Before version 1.3.0 this option
  17119. is only available as &lsquo;<samp>latency</samp>&rsquo;.
  17120. </p>
  17121. </dd>
  17122. <dt>&lsquo;<samp>recv_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17123. <dd><p>Set UDP receive buffer size, expressed in bytes.
  17124. </p>
  17125. </dd>
  17126. <dt>&lsquo;<samp>send_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17127. <dd><p>Set UDP send buffer size, expressed in bytes.
  17128. </p>
  17129. </dd>
  17130. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  17131. <dd><p>Set raise error timeouts for read, write and connect operations. Note that the
  17132. SRT library has internal timeouts which can be controlled separately, the
  17133. value set here is only a cap on those.
  17134. </p>
  17135. </dd>
  17136. <dt>&lsquo;<samp>tlpktdrop=<var>1|0</var></samp>&rsquo;</dt>
  17137. <dd><p>Too-late Packet Drop. When enabled on receiver, it skips
  17138. missing packets that have not been delivered in time and
  17139. delivers the following packets to the application when
  17140. their time-to-play has come. It also sends a fake ACK to
  17141. the sender. When enabled on sender and enabled on the
  17142. receiving peer, the sender drops the older packets that
  17143. have no chance of being delivered in time. It was
  17144. automatically enabled in the sender if the receiver
  17145. supports it.
  17146. </p>
  17147. </dd>
  17148. <dt>&lsquo;<samp>sndbuf=<var>bytes</var></samp>&rsquo;</dt>
  17149. <dd><p>Set send buffer size, expressed in bytes.
  17150. </p>
  17151. </dd>
  17152. <dt>&lsquo;<samp>rcvbuf=<var>bytes</var></samp>&rsquo;</dt>
  17153. <dd><p>Set receive buffer size, expressed in bytes.
  17154. </p>
  17155. <p>Receive buffer must not be greater than &lsquo;<samp>ffs</samp>&rsquo;.
  17156. </p>
  17157. </dd>
  17158. <dt>&lsquo;<samp>lossmaxttl=<var>packets</var></samp>&rsquo;</dt>
  17159. <dd><p>The value up to which the Reorder Tolerance may grow. When
  17160. Reorder Tolerance is &gt; 0, then packet loss report is delayed
  17161. until that number of packets come in. Reorder Tolerance
  17162. increases every time a &quot;belated&quot; packet has come, but it
  17163. wasn&rsquo;t due to retransmission (that is, when UDP packets tend
  17164. to come out of order), with the difference between the latest
  17165. sequence and this packet&rsquo;s sequence, and not more than the
  17166. value of this option. By default it&rsquo;s 0, which means that this
  17167. mechanism is turned off, and the loss report is always sent
  17168. immediately upon experiencing a &quot;gap&quot; in sequences.
  17169. </p>
  17170. </dd>
  17171. <dt>&lsquo;<samp>minversion</samp>&rsquo;</dt>
  17172. <dd><p>The minimum SRT version that is required from the peer. A connection
  17173. to a peer that does not satisfy the minimum version requirement
  17174. will be rejected.
  17175. </p>
  17176. <p>The version format in hex is 0xXXYYZZ for x.y.z in human readable
  17177. form.
  17178. </p>
  17179. </dd>
  17180. <dt>&lsquo;<samp>streamid=<var>string</var></samp>&rsquo;</dt>
  17181. <dd><p>A string limited to 512 characters that can be set on the socket prior
  17182. to connecting. This stream ID will be able to be retrieved by the
  17183. listener side from the socket that is returned from srt_accept and
  17184. was connected by a socket with that set stream ID. SRT does not enforce
  17185. any special interpretation of the contents of this string.
  17186. This option doesn’t make sense in Rendezvous connection; the result
  17187. might be that simply one side will override the value from the other
  17188. side and it’s the matter of luck which one would win
  17189. </p>
  17190. </dd>
  17191. <dt>&lsquo;<samp>smoother=<var>live|file</var></samp>&rsquo;</dt>
  17192. <dd><p>The type of Smoother used for the transmission for that socket, which
  17193. is responsible for the transmission and congestion control. The Smoother
  17194. type must be exactly the same on both connecting parties, otherwise
  17195. the connection is rejected.
  17196. </p>
  17197. </dd>
  17198. <dt>&lsquo;<samp>messageapi=<var>1|0</var></samp>&rsquo;</dt>
  17199. <dd><p>When set, this socket uses the Message API, otherwise it uses Buffer
  17200. API. Note that in live mode (see &lsquo;<samp>transtype</samp>&rsquo;) there’s only
  17201. message API available. In File mode you can chose to use one of two modes:
  17202. </p>
  17203. <p>Stream API (default, when this option is false). In this mode you may
  17204. send as many data as you wish with one sending instruction, or even use
  17205. dedicated functions that read directly from a file. The internal facility
  17206. will take care of any speed and congestion control. When receiving, you
  17207. can also receive as many data as desired, the data not extracted will be
  17208. waiting for the next call. There is no boundary between data portions in
  17209. the Stream mode.
  17210. </p>
  17211. <p>Message API. In this mode your single sending instruction passes exactly
  17212. one piece of data that has boundaries (a message). Contrary to Live mode,
  17213. this message may span across multiple UDP packets and the only size
  17214. limitation is that it shall fit as a whole in the sending buffer. The
  17215. receiver shall use as large buffer as necessary to receive the message,
  17216. otherwise the message will not be given up. When the message is not
  17217. complete (not all packets received or there was a packet loss) it will
  17218. not be given up.
  17219. </p>
  17220. </dd>
  17221. <dt>&lsquo;<samp>transtype=<var>live|file</var></samp>&rsquo;</dt>
  17222. <dd><p>Sets the transmission type for the socket, in particular, setting this
  17223. option sets multiple other parameters to their default values as required
  17224. for a particular transmission type.
  17225. </p>
  17226. <p>live: Set options as for live transmission. In this mode, you should
  17227. send by one sending instruction only so many data that fit in one UDP packet,
  17228. and limited to the value defined first in &lsquo;<samp>payload_size</samp>&rsquo; (1316 is
  17229. default in this mode). There is no speed control in this mode, only the
  17230. bandwidth control, if configured, in order to not exceed the bandwidth with
  17231. the overhead transmission (retransmitted and control packets).
  17232. </p>
  17233. <p>file: Set options as for non-live transmission. See &lsquo;<samp>messageapi</samp>&rsquo;
  17234. for further explanations
  17235. </p>
  17236. </dd>
  17237. <dt>&lsquo;<samp>linger=<var>seconds</var></samp>&rsquo;</dt>
  17238. <dd><p>The number of seconds that the socket waits for unsent data when closing.
  17239. Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
  17240. seconds in file mode). The range for this option is integers in the
  17241. 0 - <code>INT_MAX</code>.
  17242. </p>
  17243. </dd>
  17244. </dl>
  17245. <p>For more information see: <a href="https://github.com/Haivision/srt">https://github.com/Haivision/srt</a>.
  17246. </p>
  17247. <a name="srtp"></a>
  17248. <h2 class="section"><a href="ffmpeg-all.html#toc-srtp">24.32 srtp</a></h2>
  17249. <p>Secure Real-time Transport Protocol.
  17250. </p>
  17251. <p>The accepted options are:
  17252. </p><dl compact="compact">
  17253. <dt>&lsquo;<samp>srtp_in_suite</samp>&rsquo;</dt>
  17254. <dt>&lsquo;<samp>srtp_out_suite</samp>&rsquo;</dt>
  17255. <dd><p>Select input and output encoding suites.
  17256. </p>
  17257. <p>Supported values:
  17258. </p><dl compact="compact">
  17259. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_80</samp>&rsquo;</dt>
  17260. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_80</samp>&rsquo;</dt>
  17261. <dt>&lsquo;<samp>AES_CM_128_HMAC_SHA1_32</samp>&rsquo;</dt>
  17262. <dt>&lsquo;<samp>SRTP_AES128_CM_HMAC_SHA1_32</samp>&rsquo;</dt>
  17263. </dl>
  17264. </dd>
  17265. <dt>&lsquo;<samp>srtp_in_params</samp>&rsquo;</dt>
  17266. <dt>&lsquo;<samp>srtp_out_params</samp>&rsquo;</dt>
  17267. <dd><p>Set input and output encoding parameters, which are expressed by a
  17268. base64-encoded representation of a binary block. The first 16 bytes of
  17269. this binary block are used as master key, the following 14 bytes are
  17270. used as master salt.
  17271. </p></dd>
  17272. </dl>
  17273. <a name="subfile"></a>
  17274. <h2 class="section"><a href="ffmpeg-all.html#toc-subfile">24.33 subfile</a></h2>
  17275. <p>Virtually extract a segment of a file or another stream.
  17276. The underlying stream must be seekable.
  17277. </p>
  17278. <p>Accepted options:
  17279. </p><dl compact="compact">
  17280. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  17281. <dd><p>Start offset of the extracted segment, in bytes.
  17282. </p></dd>
  17283. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  17284. <dd><p>End offset of the extracted segment, in bytes.
  17285. If set to 0, extract till end of file.
  17286. </p></dd>
  17287. </dl>
  17288. <p>Examples:
  17289. </p>
  17290. <p>Extract a chapter from a DVD VOB file (start and end sectors obtained
  17291. externally and multiplied by 2048):
  17292. </p><div class="example">
  17293. <pre class="example">subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
  17294. </pre></div>
  17295. <p>Play an AVI file directly from a TAR archive:
  17296. </p><div class="example">
  17297. <pre class="example">subfile,,start,183241728,end,366490624,,:archive.tar
  17298. </pre></div>
  17299. <p>Play a MPEG-TS file from start offset till end:
  17300. </p><div class="example">
  17301. <pre class="example">subfile,,start,32815239,end,0,,:video.ts
  17302. </pre></div>
  17303. <a name="tee-2"></a>
  17304. <h2 class="section"><a href="ffmpeg-all.html#toc-tee-2">24.34 tee</a></h2>
  17305. <p>Writes the output to multiple protocols. The individual outputs are separated
  17306. by |
  17307. </p>
  17308. <div class="example">
  17309. <pre class="example">tee:file://path/to/local/this.avi|file://path/to/local/that.avi
  17310. </pre></div>
  17311. <a name="tcp"></a>
  17312. <h2 class="section"><a href="ffmpeg-all.html#toc-tcp">24.35 tcp</a></h2>
  17313. <p>Transmission Control Protocol.
  17314. </p>
  17315. <p>The required syntax for a TCP url is:
  17316. </p><div class="example">
  17317. <pre class="example">tcp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17318. </pre></div>
  17319. <p><var>options</var> contains a list of &amp;-separated options of the form
  17320. <var>key</var>=<var>val</var>.
  17321. </p>
  17322. <p>The list of supported options follows.
  17323. </p>
  17324. <dl compact="compact">
  17325. <dt>&lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
  17326. <dd><p>Listen for an incoming connection. Default value is 0.
  17327. </p>
  17328. </dd>
  17329. <dt>&lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17330. <dd><p>Set raise error timeout, expressed in microseconds.
  17331. </p>
  17332. <p>This option is only relevant in read mode: if no data arrived in more
  17333. than this time interval, raise error.
  17334. </p>
  17335. </dd>
  17336. <dt>&lsquo;<samp>listen_timeout=<var>milliseconds</var></samp>&rsquo;</dt>
  17337. <dd><p>Set listen timeout, expressed in milliseconds.
  17338. </p>
  17339. </dd>
  17340. <dt>&lsquo;<samp>recv_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17341. <dd><p>Set receive buffer size, expressed bytes.
  17342. </p>
  17343. </dd>
  17344. <dt>&lsquo;<samp>send_buffer_size=<var>bytes</var></samp>&rsquo;</dt>
  17345. <dd><p>Set send buffer size, expressed bytes.
  17346. </p>
  17347. </dd>
  17348. <dt>&lsquo;<samp>tcp_nodelay=<var>1|0</var></samp>&rsquo;</dt>
  17349. <dd><p>Set TCP_NODELAY to disable Nagle&rsquo;s algorithm. Default value is 0.
  17350. </p>
  17351. </dd>
  17352. <dt>&lsquo;<samp>tcp_mss=<var>bytes</var></samp>&rsquo;</dt>
  17353. <dd><p>Set maximum segment size for outgoing TCP packets, expressed in bytes.
  17354. </p></dd>
  17355. </dl>
  17356. <p>The following example shows how to setup a listening TCP connection
  17357. with <code>ffmpeg</code>, which is then accessed with <code>ffplay</code>:
  17358. </p><div class="example">
  17359. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tcp://<var>hostname</var>:<var>port</var>?listen
  17360. ffplay tcp://<var>hostname</var>:<var>port</var>
  17361. </pre></div>
  17362. <a name="tls"></a>
  17363. <h2 class="section"><a href="ffmpeg-all.html#toc-tls">24.36 tls</a></h2>
  17364. <p>Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
  17365. </p>
  17366. <p>The required syntax for a TLS/SSL url is:
  17367. </p><div class="example">
  17368. <pre class="example">tls://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17369. </pre></div>
  17370. <p>The following parameters can be set via command line options
  17371. (or in code via <code>AVOption</code>s):
  17372. </p>
  17373. <dl compact="compact">
  17374. <dt>&lsquo;<samp>ca_file, cafile=<var>filename</var></samp>&rsquo;</dt>
  17375. <dd><p>A file containing certificate authority (CA) root certificates to treat
  17376. as trusted. If the linked TLS library contains a default this might not
  17377. need to be specified for verification to work, but not all libraries and
  17378. setups have defaults built in.
  17379. The file must be in OpenSSL PEM format.
  17380. </p>
  17381. </dd>
  17382. <dt>&lsquo;<samp>tls_verify=<var>1|0</var></samp>&rsquo;</dt>
  17383. <dd><p>If enabled, try to verify the peer that we are communicating with.
  17384. Note, if using OpenSSL, this currently only makes sure that the
  17385. peer certificate is signed by one of the root certificates in the CA
  17386. database, but it does not validate that the certificate actually
  17387. matches the host name we are trying to connect to. (With other backends,
  17388. the host name is validated as well.)
  17389. </p>
  17390. <p>This is disabled by default since it requires a CA database to be
  17391. provided by the caller in many cases.
  17392. </p>
  17393. </dd>
  17394. <dt>&lsquo;<samp>cert_file, cert=<var>filename</var></samp>&rsquo;</dt>
  17395. <dd><p>A file containing a certificate to use in the handshake with the peer.
  17396. (When operating as server, in listen mode, this is more often required
  17397. by the peer, while client certificates only are mandated in certain
  17398. setups.)
  17399. </p>
  17400. </dd>
  17401. <dt>&lsquo;<samp>key_file, key=<var>filename</var></samp>&rsquo;</dt>
  17402. <dd><p>A file containing the private key for the certificate.
  17403. </p>
  17404. </dd>
  17405. <dt>&lsquo;<samp>listen=<var>1|0</var></samp>&rsquo;</dt>
  17406. <dd><p>If enabled, listen for connections on the provided port, and assume
  17407. the server role in the handshake instead of the client role.
  17408. </p>
  17409. </dd>
  17410. </dl>
  17411. <p>Example command lines:
  17412. </p>
  17413. <p>To create a TLS/SSL server that serves an input stream.
  17414. </p>
  17415. <div class="example">
  17416. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> tls://<var>hostname</var>:<var>port</var>?listen&amp;cert=<var>server.crt</var>&amp;key=<var>server.key</var>
  17417. </pre></div>
  17418. <p>To play back a stream from the TLS/SSL server using <code>ffplay</code>:
  17419. </p>
  17420. <div class="example">
  17421. <pre class="example">ffplay tls://<var>hostname</var>:<var>port</var>
  17422. </pre></div>
  17423. <a name="udp"></a>
  17424. <h2 class="section"><a href="ffmpeg-all.html#toc-udp">24.37 udp</a></h2>
  17425. <p>User Datagram Protocol.
  17426. </p>
  17427. <p>The required syntax for an UDP URL is:
  17428. </p><div class="example">
  17429. <pre class="example">udp://<var>hostname</var>:<var>port</var>[?<var>options</var>]
  17430. </pre></div>
  17431. <p><var>options</var> contains a list of &amp;-separated options of the form <var>key</var>=<var>val</var>.
  17432. </p>
  17433. <p>In case threading is enabled on the system, a circular buffer is used
  17434. to store the incoming data, which allows one to reduce loss of data due to
  17435. UDP socket buffer overruns. The <var>fifo_size</var> and
  17436. <var>overrun_nonfatal</var> options are related to this buffer.
  17437. </p>
  17438. <p>The list of supported options follows.
  17439. </p>
  17440. <dl compact="compact">
  17441. <dt>&lsquo;<samp>buffer_size=<var>size</var></samp>&rsquo;</dt>
  17442. <dd><p>Set the UDP maximum socket buffer size in bytes. This is used to set either
  17443. the receive or send buffer size, depending on what the socket is used for.
  17444. Default is 32 KB for output, 384 KB for input. See also <var>fifo_size</var>.
  17445. </p>
  17446. </dd>
  17447. <dt>&lsquo;<samp>bitrate=<var>bitrate</var></samp>&rsquo;</dt>
  17448. <dd><p>If set to nonzero, the output will have the specified constant bitrate if the
  17449. input has enough packets to sustain it.
  17450. </p>
  17451. </dd>
  17452. <dt>&lsquo;<samp>burst_bits=<var>bits</var></samp>&rsquo;</dt>
  17453. <dd><p>When using <var>bitrate</var> this specifies the maximum number of bits in
  17454. packet bursts.
  17455. </p>
  17456. </dd>
  17457. <dt>&lsquo;<samp>localport=<var>port</var></samp>&rsquo;</dt>
  17458. <dd><p>Override the local UDP port to bind with.
  17459. </p>
  17460. </dd>
  17461. <dt>&lsquo;<samp>localaddr=<var>addr</var></samp>&rsquo;</dt>
  17462. <dd><p>Local IP address of a network interface used for sending packets or joining
  17463. multicast groups.
  17464. </p>
  17465. </dd>
  17466. <dt>&lsquo;<samp>pkt_size=<var>size</var></samp>&rsquo;</dt>
  17467. <dd><p>Set the size in bytes of UDP packets.
  17468. </p>
  17469. </dd>
  17470. <dt>&lsquo;<samp>reuse=<var>1|0</var></samp>&rsquo;</dt>
  17471. <dd><p>Explicitly allow or disallow reusing UDP sockets.
  17472. </p>
  17473. </dd>
  17474. <dt>&lsquo;<samp>ttl=<var>ttl</var></samp>&rsquo;</dt>
  17475. <dd><p>Set the time to live value (for multicast only).
  17476. </p>
  17477. </dd>
  17478. <dt>&lsquo;<samp>connect=<var>1|0</var></samp>&rsquo;</dt>
  17479. <dd><p>Initialize the UDP socket with <code>connect()</code>. In this case, the
  17480. destination address can&rsquo;t be changed with ff_udp_set_remote_url later.
  17481. If the destination address isn&rsquo;t known at the start, this option can
  17482. be specified in ff_udp_set_remote_url, too.
  17483. This allows finding out the source address for the packets with getsockname,
  17484. and makes writes return with AVERROR(ECONNREFUSED) if &quot;destination
  17485. unreachable&quot; is received.
  17486. For receiving, this gives the benefit of only receiving packets from
  17487. the specified peer address/port.
  17488. </p>
  17489. </dd>
  17490. <dt>&lsquo;<samp>sources=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
  17491. <dd><p>Only receive packets sent from the specified addresses. In case of multicast,
  17492. also subscribe to multicast traffic coming from these addresses only.
  17493. </p>
  17494. </dd>
  17495. <dt>&lsquo;<samp>block=<var>address</var>[,<var>address</var>]</samp>&rsquo;</dt>
  17496. <dd><p>Ignore packets sent from the specified addresses. In case of multicast, also
  17497. exclude the source addresses in the multicast subscription.
  17498. </p>
  17499. </dd>
  17500. <dt>&lsquo;<samp>fifo_size=<var>units</var></samp>&rsquo;</dt>
  17501. <dd><p>Set the UDP receiving circular buffer size, expressed as a number of
  17502. packets with size of 188 bytes. If not specified defaults to 7*4096.
  17503. </p>
  17504. </dd>
  17505. <dt>&lsquo;<samp>overrun_nonfatal=<var>1|0</var></samp>&rsquo;</dt>
  17506. <dd><p>Survive in case of UDP receiving circular buffer overrun. Default
  17507. value is 0.
  17508. </p>
  17509. </dd>
  17510. <dt>&lsquo;<samp>timeout=<var>microseconds</var></samp>&rsquo;</dt>
  17511. <dd><p>Set raise error timeout, expressed in microseconds.
  17512. </p>
  17513. <p>This option is only relevant in read mode: if no data arrived in more
  17514. than this time interval, raise error.
  17515. </p>
  17516. </dd>
  17517. <dt>&lsquo;<samp>broadcast=<var>1|0</var></samp>&rsquo;</dt>
  17518. <dd><p>Explicitly allow or disallow UDP broadcasting.
  17519. </p>
  17520. <p>Note that broadcasting may not work properly on networks having
  17521. a broadcast storm protection.
  17522. </p></dd>
  17523. </dl>
  17524. <a name="Examples-42"></a>
  17525. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-42">24.37.1 Examples</a></h3>
  17526. <ul>
  17527. <li>
  17528. Use <code>ffmpeg</code> to stream over UDP to a remote endpoint:
  17529. <div class="example">
  17530. <pre class="example">ffmpeg -i <var>input</var> -f <var>format</var> udp://<var>hostname</var>:<var>port</var>
  17531. </pre></div>
  17532. </li><li>
  17533. Use <code>ffmpeg</code> to stream in mpegts format over UDP using 188
  17534. sized UDP packets, using a large input buffer:
  17535. <div class="example">
  17536. <pre class="example">ffmpeg -i <var>input</var> -f mpegts udp://<var>hostname</var>:<var>port</var>?pkt_size=188&amp;buffer_size=65535
  17537. </pre></div>
  17538. </li><li>
  17539. Use <code>ffmpeg</code> to receive over UDP from a remote endpoint:
  17540. <div class="example">
  17541. <pre class="example">ffmpeg -i udp://[<var>multicast-address</var>]:<var>port</var> ...
  17542. </pre></div>
  17543. </li></ul>
  17544. <a name="unix"></a>
  17545. <h2 class="section"><a href="ffmpeg-all.html#toc-unix">24.38 unix</a></h2>
  17546. <p>Unix local socket
  17547. </p>
  17548. <p>The required syntax for a Unix socket URL is:
  17549. </p>
  17550. <div class="example">
  17551. <pre class="example">unix://<var>filepath</var>
  17552. </pre></div>
  17553. <p>The following parameters can be set via command line options
  17554. (or in code via <code>AVOption</code>s):
  17555. </p>
  17556. <dl compact="compact">
  17557. <dt>&lsquo;<samp>timeout</samp>&rsquo;</dt>
  17558. <dd><p>Timeout in ms.
  17559. </p></dd>
  17560. <dt>&lsquo;<samp>listen</samp>&rsquo;</dt>
  17561. <dd><p>Create the Unix socket in listening mode.
  17562. </p></dd>
  17563. </dl>
  17564. <a name="zmq"></a>
  17565. <h2 class="section"><a href="ffmpeg-all.html#toc-zmq">24.39 zmq</a></h2>
  17566. <p>ZeroMQ asynchronous messaging using the libzmq library.
  17567. </p>
  17568. <p>This library supports unicast streaming to multiple clients without relying on
  17569. an external server.
  17570. </p>
  17571. <p>The required syntax for streaming or connecting to a stream is:
  17572. </p><div class="example">
  17573. <pre class="example">zmq:tcp://ip-address:port
  17574. </pre></div>
  17575. <p>Example:
  17576. Create a localhost stream on port 5555:
  17577. </p><div class="example">
  17578. <pre class="example">ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
  17579. </pre></div>
  17580. <p>Multiple clients may connect to the stream using:
  17581. </p><div class="example">
  17582. <pre class="example">ffplay zmq:tcp://127.0.0.1:5555
  17583. </pre></div>
  17584. <p>Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub pattern.
  17585. The server side binds to a port and publishes data. Clients connect to the
  17586. server (via IP address/port) and subscribe to the stream. The order in which
  17587. the server and client start generally does not matter.
  17588. </p>
  17589. <p>ffmpeg must be compiled with the &ndash;enable-libzmq option to support
  17590. this protocol.
  17591. </p>
  17592. <p>Options can be set on the <code>ffmpeg</code>/<code>ffplay</code> command
  17593. line. The following options are supported:
  17594. </p>
  17595. <dl compact="compact">
  17596. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  17597. <dd><p>Forces the maximum packet size for sending/receiving data. The default value is
  17598. 32,768 bytes. On the server side, this sets the maximum size of sent packets
  17599. via ZeroMQ. On the clients, it sets an internal buffer size for receiving
  17600. packets. Note that pkt_size on the clients should be equal to or greater than
  17601. pkt_size on the server. Otherwise the received message may be truncated causing
  17602. decoding errors.
  17603. </p>
  17604. </dd>
  17605. </dl>
  17606. <a name="Device-Options"></a>
  17607. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Device-Options">25 Device Options</a></h1>
  17608. <p>The libavdevice library provides the same interface as
  17609. libavformat. Namely, an input device is considered like a demuxer, and
  17610. an output device like a muxer, and the interface and generic device
  17611. options are the same provided by libavformat (see the ffmpeg-formats
  17612. manual).
  17613. </p>
  17614. <p>In addition each input or output device may support so-called private
  17615. options, which are specific for that component.
  17616. </p>
  17617. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  17618. FFmpeg tools, or by setting the value explicitly in the device
  17619. <code>AVFormatContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API
  17620. for programmatic use.
  17621. </p>
  17622. <a name="Input-Devices"></a>
  17623. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Input-Devices">26 Input Devices</a></h1>
  17624. <p>Input devices are configured elements in FFmpeg which enable accessing
  17625. the data coming from a multimedia device attached to your system.
  17626. </p>
  17627. <p>When you configure your FFmpeg build, all the supported input devices
  17628. are enabled by default. You can list all available ones using the
  17629. configure option &quot;&ndash;list-indevs&quot;.
  17630. </p>
  17631. <p>You can disable all the input devices using the configure option
  17632. &quot;&ndash;disable-indevs&quot;, and selectively enable an input device using the
  17633. option &quot;&ndash;enable-indev=<var>INDEV</var>&quot;, or you can disable a particular
  17634. input device using the option &quot;&ndash;disable-indev=<var>INDEV</var>&quot;.
  17635. </p>
  17636. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  17637. supported input devices.
  17638. </p>
  17639. <p>A description of the currently available input devices follows.
  17640. </p>
  17641. <a name="alsa-1"></a>
  17642. <h2 class="section"><a href="ffmpeg-all.html#toc-alsa-1">26.1 alsa</a></h2>
  17643. <p>ALSA (Advanced Linux Sound Architecture) input device.
  17644. </p>
  17645. <p>To enable this input device during configuration you need libasound
  17646. installed on your system.
  17647. </p>
  17648. <p>This device allows capturing from an ALSA device. The name of the
  17649. device to capture has to be an ALSA card identifier.
  17650. </p>
  17651. <p>An ALSA identifier has the syntax:
  17652. </p><div class="example">
  17653. <pre class="example">hw:<var>CARD</var>[,<var>DEV</var>[,<var>SUBDEV</var>]]
  17654. </pre></div>
  17655. <p>where the <var>DEV</var> and <var>SUBDEV</var> components are optional.
  17656. </p>
  17657. <p>The three arguments (in order: <var>CARD</var>,<var>DEV</var>,<var>SUBDEV</var>)
  17658. specify card number or identifier, device number and subdevice number
  17659. (-1 means any).
  17660. </p>
  17661. <p>To see the list of cards currently recognized by your system check the
  17662. files &lsquo;<tt>/proc/asound/cards</tt>&rsquo; and &lsquo;<tt>/proc/asound/devices</tt>&rsquo;.
  17663. </p>
  17664. <p>For example to capture with <code>ffmpeg</code> from an ALSA device with
  17665. card id 0, you may run the command:
  17666. </p><div class="example">
  17667. <pre class="example">ffmpeg -f alsa -i hw:0 alsaout.wav
  17668. </pre></div>
  17669. <p>For more information see:
  17670. <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html">http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html</a>
  17671. </p>
  17672. <a name="Options-46"></a>
  17673. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-46">26.1.1 Options</a></h3>
  17674. <dl compact="compact">
  17675. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  17676. <dd><p>Set the sample rate in Hz. Default is 48000.
  17677. </p>
  17678. </dd>
  17679. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  17680. <dd><p>Set the number of channels. Default is 2.
  17681. </p>
  17682. </dd>
  17683. </dl>
  17684. <a name="android_005fcamera"></a>
  17685. <h2 class="section"><a href="ffmpeg-all.html#toc-android_005fcamera">26.2 android_camera</a></h2>
  17686. <p>Android camera input device.
  17687. </p>
  17688. <p>This input devices uses the Android Camera2 NDK API which is
  17689. available on devices with API level 24+. The availability of
  17690. android_camera is autodetected during configuration.
  17691. </p>
  17692. <p>This device allows capturing from all cameras on an Android device,
  17693. which are integrated into the Camera2 NDK API.
  17694. </p>
  17695. <p>The available cameras are enumerated internally and can be selected
  17696. with the <var>camera_index</var> parameter. The input file string is
  17697. discarded.
  17698. </p>
  17699. <p>Generally the back facing camera has index 0 while the front facing
  17700. camera has index 1.
  17701. </p>
  17702. <a name="Options-57"></a>
  17703. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-57">26.2.1 Options</a></h3>
  17704. <dl compact="compact">
  17705. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  17706. <dd><p>Set the video size given as a string such as 640x480 or hd720.
  17707. Falls back to the first available configuration reported by
  17708. Android if requested video size is not available or by default.
  17709. </p>
  17710. </dd>
  17711. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  17712. <dd><p>Set the video framerate.
  17713. Falls back to the first available configuration reported by
  17714. Android if requested framerate is not available or by default (-1).
  17715. </p>
  17716. </dd>
  17717. <dt>&lsquo;<samp>camera_index</samp>&rsquo;</dt>
  17718. <dd><p>Set the index of the camera to use. Default is 0.
  17719. </p>
  17720. </dd>
  17721. <dt>&lsquo;<samp>input_queue_size</samp>&rsquo;</dt>
  17722. <dd><p>Set the maximum number of frames to buffer. Default is 5.
  17723. </p>
  17724. </dd>
  17725. </dl>
  17726. <a name="avfoundation"></a>
  17727. <h2 class="section"><a href="ffmpeg-all.html#toc-avfoundation">26.3 avfoundation</a></h2>
  17728. <p>AVFoundation input device.
  17729. </p>
  17730. <p>AVFoundation is the currently recommended framework by Apple for streamgrabbing on OSX &gt;= 10.7 as well as on iOS.
  17731. </p>
  17732. <p>The input filename has to be given in the following syntax:
  17733. </p><div class="example">
  17734. <pre class="example">-i &quot;[[VIDEO]:[AUDIO]]&quot;
  17735. </pre></div>
  17736. <p>The first entry selects the video input while the latter selects the audio input.
  17737. The stream has to be specified by the device name or the device index as shown by the device list.
  17738. Alternatively, the video and/or audio input device can be chosen by index using the
  17739. &lsquo;<samp>
  17740. -video_device_index &lt;INDEX&gt;
  17741. </samp>&rsquo;
  17742. and/or
  17743. &lsquo;<samp>
  17744. -audio_device_index &lt;INDEX&gt;
  17745. </samp>&rsquo;
  17746. , overriding any
  17747. device name or index given in the input filename.
  17748. </p>
  17749. <p>All available devices can be enumerated by using &lsquo;<samp>-list_devices true</samp>&rsquo;, listing
  17750. all device names and corresponding indices.
  17751. </p>
  17752. <p>There are two device name aliases:
  17753. </p><dl compact="compact">
  17754. <dt><code>default</code></dt>
  17755. <dd><p>Select the AVFoundation default device of the corresponding type.
  17756. </p>
  17757. </dd>
  17758. <dt><code>none</code></dt>
  17759. <dd><p>Do not record the corresponding media type.
  17760. This is equivalent to specifying an empty device name or index.
  17761. </p>
  17762. </dd>
  17763. </dl>
  17764. <a name="Options-20"></a>
  17765. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-20">26.3.1 Options</a></h3>
  17766. <p>AVFoundation supports the following options:
  17767. </p>
  17768. <dl compact="compact">
  17769. <dt>&lsquo;<samp>-list_devices &lt;TRUE|FALSE&gt;</samp>&rsquo;</dt>
  17770. <dd><p>If set to true, a list of all available input devices is given showing all
  17771. device names and indices.
  17772. </p>
  17773. </dd>
  17774. <dt>&lsquo;<samp>-video_device_index &lt;INDEX&gt;</samp>&rsquo;</dt>
  17775. <dd><p>Specify the video device by its index. Overrides anything given in the input filename.
  17776. </p>
  17777. </dd>
  17778. <dt>&lsquo;<samp>-audio_device_index &lt;INDEX&gt;</samp>&rsquo;</dt>
  17779. <dd><p>Specify the audio device by its index. Overrides anything given in the input filename.
  17780. </p>
  17781. </dd>
  17782. <dt>&lsquo;<samp>-pixel_format &lt;FORMAT&gt;</samp>&rsquo;</dt>
  17783. <dd><p>Request the video device to use a specific pixel format.
  17784. If the specified format is not supported, a list of available formats is given
  17785. and the first one in this list is used instead. Available pixel formats are:
  17786. <code>monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
  17787. bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
  17788. yuv420p, nv12, yuyv422, gray</code>
  17789. </p>
  17790. </dd>
  17791. <dt>&lsquo;<samp>-framerate</samp>&rsquo;</dt>
  17792. <dd><p>Set the grabbing frame rate. Default is <code>ntsc</code>, corresponding to a
  17793. frame rate of <code>30000/1001</code>.
  17794. </p>
  17795. </dd>
  17796. <dt>&lsquo;<samp>-video_size</samp>&rsquo;</dt>
  17797. <dd><p>Set the video frame size.
  17798. </p>
  17799. </dd>
  17800. <dt>&lsquo;<samp>-capture_cursor</samp>&rsquo;</dt>
  17801. <dd><p>Capture the mouse pointer. Default is 0.
  17802. </p>
  17803. </dd>
  17804. <dt>&lsquo;<samp>-capture_mouse_clicks</samp>&rsquo;</dt>
  17805. <dd><p>Capture the screen mouse clicks. Default is 0.
  17806. </p>
  17807. </dd>
  17808. <dt>&lsquo;<samp>-capture_raw_data</samp>&rsquo;</dt>
  17809. <dd><p>Capture the raw device data. Default is 0.
  17810. Using this option may result in receiving the underlying data delivered to the AVFoundation framework. E.g. for muxed devices that sends raw DV data to the framework (like tape-based camcorders), setting this option to false results in extracted video frames captured in the designated pixel format only. Setting this option to true results in receiving the raw DV stream untouched.
  17811. </p></dd>
  17812. </dl>
  17813. <a name="Examples-109"></a>
  17814. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-109">26.3.2 Examples</a></h3>
  17815. <ul>
  17816. <li>
  17817. Print the list of AVFoundation supported devices and exit:
  17818. <div class="example">
  17819. <pre class="example">$ ffmpeg -f avfoundation -list_devices true -i &quot;&quot;
  17820. </pre></div>
  17821. </li><li>
  17822. Record video from video device 0 and audio from audio device 0 into out.avi:
  17823. <div class="example">
  17824. <pre class="example">$ ffmpeg -f avfoundation -i &quot;0:0&quot; out.avi
  17825. </pre></div>
  17826. </li><li>
  17827. Record video from video device 2 and audio from audio device 1 into out.avi:
  17828. <div class="example">
  17829. <pre class="example">$ ffmpeg -f avfoundation -video_device_index 2 -i &quot;:1&quot; out.avi
  17830. </pre></div>
  17831. </li><li>
  17832. Record video from the system default video device using the pixel format bgr0 and do not record any audio into out.avi:
  17833. <div class="example">
  17834. <pre class="example">$ ffmpeg -f avfoundation -pixel_format bgr0 -i &quot;default:none&quot; out.avi
  17835. </pre></div>
  17836. </li><li>
  17837. Record raw DV data from a suitable input device and write the output into out.dv:
  17838. <div class="example">
  17839. <pre class="example">$ ffmpeg -f avfoundation -capture_raw_data true -i &quot;zr100:none&quot; out.dv
  17840. </pre></div>
  17841. </li></ul>
  17842. <a name="bktr"></a>
  17843. <h2 class="section"><a href="ffmpeg-all.html#toc-bktr">26.4 bktr</a></h2>
  17844. <p>BSD video input device.
  17845. </p>
  17846. <a name="Options-31"></a>
  17847. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-31">26.4.1 Options</a></h3>
  17848. <dl compact="compact">
  17849. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  17850. <dd><p>Set the frame rate.
  17851. </p>
  17852. </dd>
  17853. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  17854. <dd><p>Set the video frame size. Default is <code>vga</code>.
  17855. </p>
  17856. </dd>
  17857. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  17858. <dd>
  17859. <p>Available values are:
  17860. </p><dl compact="compact">
  17861. <dt>&lsquo;<samp>pal</samp>&rsquo;</dt>
  17862. <dt>&lsquo;<samp>ntsc</samp>&rsquo;</dt>
  17863. <dt>&lsquo;<samp>secam</samp>&rsquo;</dt>
  17864. <dt>&lsquo;<samp>paln</samp>&rsquo;</dt>
  17865. <dt>&lsquo;<samp>palm</samp>&rsquo;</dt>
  17866. <dt>&lsquo;<samp>ntscj</samp>&rsquo;</dt>
  17867. </dl>
  17868. </dd>
  17869. </dl>
  17870. <a name="decklink"></a>
  17871. <h2 class="section"><a href="ffmpeg-all.html#toc-decklink">26.5 decklink</a></h2>
  17872. <p>The decklink input device provides capture capabilities for Blackmagic
  17873. DeckLink devices.
  17874. </p>
  17875. <p>To enable this input device, you need the Blackmagic DeckLink SDK and you
  17876. need to configure with the appropriate <code>--extra-cflags</code>
  17877. and <code>--extra-ldflags</code>.
  17878. On Windows, you need to run the IDL files through <code>widl</code>.
  17879. </p>
  17880. <p>DeckLink is very picky about the formats it supports. Pixel format of the
  17881. input can be set with &lsquo;<samp>raw_format</samp>&rsquo;.
  17882. Framerate and video size must be determined for your device with
  17883. <code>-list_formats 1</code>. Audio sample rate is always 48 kHz and the number
  17884. of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
  17885. audio track.
  17886. </p>
  17887. <a name="Options-41"></a>
  17888. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-41">26.5.1 Options</a></h3>
  17889. <dl compact="compact">
  17890. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  17891. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  17892. Defaults to &lsquo;<samp>false</samp>&rsquo;. This option is deprecated, please use the
  17893. <code>-sources</code> option of ffmpeg to list the available input devices.
  17894. </p>
  17895. </dd>
  17896. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  17897. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of supported formats and exit.
  17898. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  17899. </p>
  17900. </dd>
  17901. <dt>&lsquo;<samp>format_code &lt;FourCC&gt;</samp>&rsquo;</dt>
  17902. <dd><p>This sets the input video format to the format given by the FourCC. To see
  17903. the supported values of your device(s) use &lsquo;<samp>list_formats</samp>&rsquo;.
  17904. Note that there is a FourCC &lsquo;<samp>'pal '</samp>&rsquo; that can also be used
  17905. as &lsquo;<samp>pal</samp>&rsquo; (3 letters).
  17906. Default behavior is autodetection of the input video format, if the hardware
  17907. supports it.
  17908. </p>
  17909. </dd>
  17910. <dt>&lsquo;<samp>raw_format</samp>&rsquo;</dt>
  17911. <dd><p>Set the pixel format of the captured video.
  17912. Available values are:
  17913. </p><dl compact="compact">
  17914. <dt>&lsquo;<samp>uyvy422</samp>&rsquo;</dt>
  17915. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  17916. <dt>&lsquo;<samp>argb</samp>&rsquo;</dt>
  17917. <dt>&lsquo;<samp>bgra</samp>&rsquo;</dt>
  17918. <dt>&lsquo;<samp>rgb10</samp>&rsquo;</dt>
  17919. </dl>
  17920. </dd>
  17921. <dt>&lsquo;<samp>teletext_lines</samp>&rsquo;</dt>
  17922. <dd><p>If set to nonzero, an additional teletext stream will be captured from the
  17923. vertical ancillary data. Both SD PAL (576i) and HD (1080i or 1080p)
  17924. sources are supported. In case of HD sources, OP47 packets are decoded.
  17925. </p>
  17926. <p>This option is a bitmask of the SD PAL VBI lines captured, specifically lines 6
  17927. to 22, and lines 318 to 335. Line 6 is the LSB in the mask. Selected lines
  17928. which do not contain teletext information will be ignored. You can use the
  17929. special &lsquo;<samp>all</samp>&rsquo; constant to select all possible lines, or
  17930. &lsquo;<samp>standard</samp>&rsquo; to skip lines 6, 318 and 319, which are not compatible with
  17931. all receivers.
  17932. </p>
  17933. <p>For SD sources, ffmpeg needs to be compiled with <code>--enable-libzvbi</code>. For
  17934. HD sources, on older (pre-4K) DeckLink card models you have to capture in 10
  17935. bit mode.
  17936. </p>
  17937. </dd>
  17938. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  17939. <dd><p>Defines number of audio channels to capture. Must be &lsquo;<samp>2</samp>&rsquo;, &lsquo;<samp>8</samp>&rsquo; or &lsquo;<samp>16</samp>&rsquo;.
  17940. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  17941. </p>
  17942. </dd>
  17943. <dt>&lsquo;<samp>duplex_mode</samp>&rsquo;</dt>
  17944. <dd><p>Sets the decklink device duplex mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo; or &lsquo;<samp>full</samp>&rsquo;.
  17945. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  17946. </p>
  17947. </dd>
  17948. <dt>&lsquo;<samp>timecode_format</samp>&rsquo;</dt>
  17949. <dd><p>Timecode type to include in the frame and video stream metadata. Must be
  17950. &lsquo;<samp>none</samp>&rsquo;, &lsquo;<samp>rp188vitc</samp>&rsquo;, &lsquo;<samp>rp188vitc2</samp>&rsquo;, &lsquo;<samp>rp188ltc</samp>&rsquo;,
  17951. &lsquo;<samp>rp188any</samp>&rsquo;, &lsquo;<samp>vitc</samp>&rsquo;, &lsquo;<samp>vitc2</samp>&rsquo;, or &lsquo;<samp>serial</samp>&rsquo;. Defaults to
  17952. &lsquo;<samp>none</samp>&rsquo; (not included).
  17953. </p>
  17954. </dd>
  17955. <dt>&lsquo;<samp>video_input</samp>&rsquo;</dt>
  17956. <dd><p>Sets the video input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>sdi</samp>&rsquo;, &lsquo;<samp>hdmi</samp>&rsquo;,
  17957. &lsquo;<samp>optical_sdi</samp>&rsquo;, &lsquo;<samp>component</samp>&rsquo;, &lsquo;<samp>composite</samp>&rsquo; or &lsquo;<samp>s_video</samp>&rsquo;.
  17958. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  17959. </p>
  17960. </dd>
  17961. <dt>&lsquo;<samp>audio_input</samp>&rsquo;</dt>
  17962. <dd><p>Sets the audio input source. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>embedded</samp>&rsquo;,
  17963. &lsquo;<samp>aes_ebu</samp>&rsquo;, &lsquo;<samp>analog</samp>&rsquo;, &lsquo;<samp>analog_xlr</samp>&rsquo;, &lsquo;<samp>analog_rca</samp>&rsquo; or
  17964. &lsquo;<samp>microphone</samp>&rsquo;. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  17965. </p>
  17966. </dd>
  17967. <dt>&lsquo;<samp>video_pts</samp>&rsquo;</dt>
  17968. <dd><p>Sets the video packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  17969. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  17970. Defaults to &lsquo;<samp>video</samp>&rsquo;.
  17971. </p>
  17972. </dd>
  17973. <dt>&lsquo;<samp>audio_pts</samp>&rsquo;</dt>
  17974. <dd><p>Sets the audio packet timestamp source. Must be &lsquo;<samp>video</samp>&rsquo;, &lsquo;<samp>audio</samp>&rsquo;,
  17975. &lsquo;<samp>reference</samp>&rsquo;, &lsquo;<samp>wallclock</samp>&rsquo; or &lsquo;<samp>abs_wallclock</samp>&rsquo;.
  17976. Defaults to &lsquo;<samp>audio</samp>&rsquo;.
  17977. </p>
  17978. </dd>
  17979. <dt>&lsquo;<samp>draw_bars</samp>&rsquo;</dt>
  17980. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, color bars are drawn in the event of a signal loss.
  17981. Defaults to &lsquo;<samp>true</samp>&rsquo;.
  17982. </p>
  17983. </dd>
  17984. <dt>&lsquo;<samp>queue_size</samp>&rsquo;</dt>
  17985. <dd><p>Sets maximum input buffer size in bytes. If the buffering reaches this value,
  17986. incoming frames will be dropped.
  17987. Defaults to &lsquo;<samp>1073741824</samp>&rsquo;.
  17988. </p>
  17989. </dd>
  17990. <dt>&lsquo;<samp>audio_depth</samp>&rsquo;</dt>
  17991. <dd><p>Sets the audio sample bit depth. Must be &lsquo;<samp>16</samp>&rsquo; or &lsquo;<samp>32</samp>&rsquo;.
  17992. Defaults to &lsquo;<samp>16</samp>&rsquo;.
  17993. </p>
  17994. </dd>
  17995. <dt>&lsquo;<samp>decklink_copyts</samp>&rsquo;</dt>
  17996. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, timestamps are forwarded as they are without removing
  17997. the initial offset.
  17998. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  17999. </p>
  18000. </dd>
  18001. <dt>&lsquo;<samp>timestamp_align</samp>&rsquo;</dt>
  18002. <dd><p>Capture start time alignment in seconds. If set to nonzero, input frames are
  18003. dropped till the system timestamp aligns with configured value.
  18004. Alignment difference of up to one frame duration is tolerated.
  18005. This is useful for maintaining input synchronization across N different
  18006. hardware devices deployed for &rsquo;N-way&rsquo; redundancy. The system time of different
  18007. hardware devices should be synchronized with protocols such as NTP or PTP,
  18008. before using this option.
  18009. Note that this method is not foolproof. In some border cases input
  18010. synchronization may not happen due to thread scheduling jitters in the OS.
  18011. Either sync could go wrong by 1 frame or in a rarer case
  18012. &lsquo;<samp>timestamp_align</samp>&rsquo; seconds.
  18013. Defaults to &lsquo;<samp>0</samp>&rsquo;.
  18014. </p>
  18015. </dd>
  18016. <dt>&lsquo;<samp>wait_for_tc (<em>bool</em>)</samp>&rsquo;</dt>
  18017. <dd><p>Drop frames till a frame with timecode is received. Sometimes serial timecode
  18018. isn&rsquo;t received with the first input frame. If that happens, the stored stream
  18019. timecode will be inaccurate. If this option is set to &lsquo;<samp>true</samp>&rsquo;, input frames
  18020. are dropped till a frame with timecode is received.
  18021. Option <var>timecode_format</var> must be specified.
  18022. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  18023. </p>
  18024. </dd>
  18025. </dl>
  18026. <a name="Examples-127"></a>
  18027. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-127">26.5.2 Examples</a></h3>
  18028. <ul>
  18029. <li>
  18030. List input devices:
  18031. <div class="example">
  18032. <pre class="example">ffmpeg -sources decklink
  18033. </pre></div>
  18034. </li><li>
  18035. List supported formats:
  18036. <div class="example">
  18037. <pre class="example">ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
  18038. </pre></div>
  18039. </li><li>
  18040. Capture video clip at 1080i50:
  18041. <div class="example">
  18042. <pre class="example">ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
  18043. </pre></div>
  18044. </li><li>
  18045. Capture video clip at 1080i50 10 bit:
  18046. <div class="example">
  18047. <pre class="example">ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18048. </pre></div>
  18049. </li><li>
  18050. Capture video clip at 1080i50 with 16 audio channels:
  18051. <div class="example">
  18052. <pre class="example">ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
  18053. </pre></div>
  18054. </li></ul>
  18055. <a name="dshow"></a>
  18056. <h2 class="section"><a href="ffmpeg-all.html#toc-dshow">26.6 dshow</a></h2>
  18057. <p>Windows DirectShow input device.
  18058. </p>
  18059. <p>DirectShow support is enabled when FFmpeg is built with the mingw-w64 project.
  18060. Currently only audio and video devices are supported.
  18061. </p>
  18062. <p>Multiple devices may be opened as separate inputs, but they may also be
  18063. opened on the same input, which should improve synchronism between them.
  18064. </p>
  18065. <p>The input name should be in the format:
  18066. </p>
  18067. <div class="example">
  18068. <pre class="example"><var>TYPE</var>=<var>NAME</var>[:<var>TYPE</var>=<var>NAME</var>]
  18069. </pre></div>
  18070. <p>where <var>TYPE</var> can be either <var>audio</var> or <var>video</var>,
  18071. and <var>NAME</var> is the device&rsquo;s name or alternative name..
  18072. </p>
  18073. <a name="Options-19"></a>
  18074. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-19">26.6.1 Options</a></h3>
  18075. <p>If no options are specified, the device&rsquo;s defaults are used.
  18076. If the device does not support the requested options, it will
  18077. fail to open.
  18078. </p>
  18079. <dl compact="compact">
  18080. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18081. <dd><p>Set the video size in the captured video.
  18082. </p>
  18083. </dd>
  18084. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18085. <dd><p>Set the frame rate in the captured video.
  18086. </p>
  18087. </dd>
  18088. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18089. <dd><p>Set the sample rate (in Hz) of the captured audio.
  18090. </p>
  18091. </dd>
  18092. <dt>&lsquo;<samp>sample_size</samp>&rsquo;</dt>
  18093. <dd><p>Set the sample size (in bits) of the captured audio.
  18094. </p>
  18095. </dd>
  18096. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18097. <dd><p>Set the number of channels in the captured audio.
  18098. </p>
  18099. </dd>
  18100. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  18101. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  18102. </p>
  18103. </dd>
  18104. <dt>&lsquo;<samp>list_options</samp>&rsquo;</dt>
  18105. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of selected device&rsquo;s options
  18106. and exit.
  18107. </p>
  18108. </dd>
  18109. <dt>&lsquo;<samp>video_device_number</samp>&rsquo;</dt>
  18110. <dd><p>Set video device number for devices with the same name (starts at 0,
  18111. defaults to 0).
  18112. </p>
  18113. </dd>
  18114. <dt>&lsquo;<samp>audio_device_number</samp>&rsquo;</dt>
  18115. <dd><p>Set audio device number for devices with the same name (starts at 0,
  18116. defaults to 0).
  18117. </p>
  18118. </dd>
  18119. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  18120. <dd><p>Select pixel format to be used by DirectShow. This may only be set when
  18121. the video codec is not set or set to rawvideo.
  18122. </p>
  18123. </dd>
  18124. <dt>&lsquo;<samp>audio_buffer_size</samp>&rsquo;</dt>
  18125. <dd><p>Set audio device buffer size in milliseconds (which can directly
  18126. impact latency, depending on the device).
  18127. Defaults to using the audio device&rsquo;s
  18128. default buffer size (typically some multiple of 500ms).
  18129. Setting this value too low can degrade performance.
  18130. See also
  18131. <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx">http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx</a>
  18132. </p>
  18133. </dd>
  18134. <dt>&lsquo;<samp>video_pin_name</samp>&rsquo;</dt>
  18135. <dd><p>Select video capture pin to use by name or alternative name.
  18136. </p>
  18137. </dd>
  18138. <dt>&lsquo;<samp>audio_pin_name</samp>&rsquo;</dt>
  18139. <dd><p>Select audio capture pin to use by name or alternative name.
  18140. </p>
  18141. </dd>
  18142. <dt>&lsquo;<samp>crossbar_video_input_pin_number</samp>&rsquo;</dt>
  18143. <dd><p>Select video input pin number for crossbar device. This will be
  18144. routed to the crossbar device&rsquo;s Video Decoder output pin.
  18145. Note that changing this value can affect future invocations
  18146. (sets a new default) until system reboot occurs.
  18147. </p>
  18148. </dd>
  18149. <dt>&lsquo;<samp>crossbar_audio_input_pin_number</samp>&rsquo;</dt>
  18150. <dd><p>Select audio input pin number for crossbar device. This will be
  18151. routed to the crossbar device&rsquo;s Audio Decoder output pin.
  18152. Note that changing this value can affect future invocations
  18153. (sets a new default) until system reboot occurs.
  18154. </p>
  18155. </dd>
  18156. <dt>&lsquo;<samp>show_video_device_dialog</samp>&rsquo;</dt>
  18157. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display dialog
  18158. to the end user, allowing them to change video filter properties
  18159. and configurations manually.
  18160. Note that for crossbar devices, adjusting values in this dialog
  18161. may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
  18162. input frame rates, sizes, interlacing, etc. Changing these values can
  18163. enable different scan rates/frame rates and avoiding green bars at
  18164. the bottom, flickering scan lines, etc.
  18165. Note that with some devices, changing these properties can also affect future
  18166. invocations (sets new defaults) until system reboot occurs.
  18167. </p>
  18168. </dd>
  18169. <dt>&lsquo;<samp>show_audio_device_dialog</samp>&rsquo;</dt>
  18170. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display dialog
  18171. to the end user, allowing them to change audio filter properties
  18172. and configurations manually.
  18173. </p>
  18174. </dd>
  18175. <dt>&lsquo;<samp>show_video_crossbar_connection_dialog</samp>&rsquo;</dt>
  18176. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18177. dialog to the end user, allowing them to manually
  18178. modify crossbar pin routings, when it opens a video device.
  18179. </p>
  18180. </dd>
  18181. <dt>&lsquo;<samp>show_audio_crossbar_connection_dialog</samp>&rsquo;</dt>
  18182. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18183. dialog to the end user, allowing them to manually
  18184. modify crossbar pin routings, when it opens an audio device.
  18185. </p>
  18186. </dd>
  18187. <dt>&lsquo;<samp>show_analog_tv_tuner_dialog</samp>&rsquo;</dt>
  18188. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18189. dialog to the end user, allowing them to manually
  18190. modify TV channels and frequencies.
  18191. </p>
  18192. </dd>
  18193. <dt>&lsquo;<samp>show_analog_tv_tuner_audio_dialog</samp>&rsquo;</dt>
  18194. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, before capture starts, popup a display
  18195. dialog to the end user, allowing them to manually
  18196. modify TV audio (like mono vs. stereo, Language A,B or C).
  18197. </p>
  18198. </dd>
  18199. <dt>&lsquo;<samp>audio_device_load</samp>&rsquo;</dt>
  18200. <dd><p>Load an audio capture filter device from file instead of searching
  18201. it by name. It may load additional parameters too, if the filter
  18202. supports the serialization of its properties to.
  18203. To use this an audio capture source has to be specified, but it can
  18204. be anything even fake one.
  18205. </p>
  18206. </dd>
  18207. <dt>&lsquo;<samp>audio_device_save</samp>&rsquo;</dt>
  18208. <dd><p>Save the currently used audio capture filter device and its
  18209. parameters (if the filter supports it) to a file.
  18210. If a file with the same name exists it will be overwritten.
  18211. </p>
  18212. </dd>
  18213. <dt>&lsquo;<samp>video_device_load</samp>&rsquo;</dt>
  18214. <dd><p>Load a video capture filter device from file instead of searching
  18215. it by name. It may load additional parameters too, if the filter
  18216. supports the serialization of its properties to.
  18217. To use this a video capture source has to be specified, but it can
  18218. be anything even fake one.
  18219. </p>
  18220. </dd>
  18221. <dt>&lsquo;<samp>video_device_save</samp>&rsquo;</dt>
  18222. <dd><p>Save the currently used video capture filter device and its
  18223. parameters (if the filter supports it) to a file.
  18224. If a file with the same name exists it will be overwritten.
  18225. </p>
  18226. </dd>
  18227. </dl>
  18228. <a name="Examples-145"></a>
  18229. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-145">26.6.2 Examples</a></h3>
  18230. <ul>
  18231. <li>
  18232. Print the list of DirectShow supported devices and exit:
  18233. <div class="example">
  18234. <pre class="example">$ ffmpeg -list_devices true -f dshow -i dummy
  18235. </pre></div>
  18236. </li><li>
  18237. Open video device <var>Camera</var>:
  18238. <div class="example">
  18239. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;
  18240. </pre></div>
  18241. </li><li>
  18242. Open second video device with name <var>Camera</var>:
  18243. <div class="example">
  18244. <pre class="example">$ ffmpeg -f dshow -video_device_number 1 -i video=&quot;Camera&quot;
  18245. </pre></div>
  18246. </li><li>
  18247. Open video device <var>Camera</var> and audio device <var>Microphone</var>:
  18248. <div class="example">
  18249. <pre class="example">$ ffmpeg -f dshow -i video=&quot;Camera&quot;:audio=&quot;Microphone&quot;
  18250. </pre></div>
  18251. </li><li>
  18252. Print the list of supported options in selected device and exit:
  18253. <div class="example">
  18254. <pre class="example">$ ffmpeg -list_options true -f dshow -i video=&quot;Camera&quot;
  18255. </pre></div>
  18256. </li><li>
  18257. Specify pin names to capture by name or alternative name, specify alternative device name:
  18258. <div class="example">
  18259. <pre class="example">$ ffmpeg -f dshow -audio_pin_name &quot;Audio Out&quot; -video_pin_name 2 -i video=video=&quot;@device_pnp_\\?\pci#ven_1a0a&amp;dev_6200&amp;subsys_62021461&amp;rev_01#4&amp;e2c7dd6&amp;0&amp;00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}&quot;:audio=&quot;Microphone&quot;
  18260. </pre></div>
  18261. </li><li>
  18262. Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
  18263. <div class="example">
  18264. <pre class="example">$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
  18265. -crossbar_audio_input_pin_number 3 -i video=&quot;AVerMedia BDA Analog Capture&quot;:audio=&quot;AVerMedia BDA Analog Capture&quot;
  18266. </pre></div>
  18267. </li></ul>
  18268. <a name="fbdev"></a>
  18269. <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev">26.7 fbdev</a></h2>
  18270. <p>Linux framebuffer input device.
  18271. </p>
  18272. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  18273. layer to show graphics on a computer monitor, typically on the
  18274. console. It is accessed through a file device node, usually
  18275. &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  18276. </p>
  18277. <p>For more detailed information read the file
  18278. Documentation/fb/framebuffer.txt included in the Linux source tree.
  18279. </p>
  18280. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  18281. </p>
  18282. <p>To record from the framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo; with
  18283. <code>ffmpeg</code>:
  18284. </p><div class="example">
  18285. <pre class="example">ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
  18286. </pre></div>
  18287. <p>You can take a single screenshot image with the command:
  18288. </p><div class="example">
  18289. <pre class="example">ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
  18290. </pre></div>
  18291. <a name="Options-77"></a>
  18292. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-77">26.7.1 Options</a></h3>
  18293. <dl compact="compact">
  18294. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18295. <dd><p>Set the frame rate. Default is 25.
  18296. </p>
  18297. </dd>
  18298. </dl>
  18299. <a name="gdigrab"></a>
  18300. <h2 class="section"><a href="ffmpeg-all.html#toc-gdigrab">26.8 gdigrab</a></h2>
  18301. <p>Win32 GDI-based screen capture device.
  18302. </p>
  18303. <p>This device allows you to capture a region of the display on Windows.
  18304. </p>
  18305. <p>There are two options for the input filename:
  18306. </p><div class="example">
  18307. <pre class="example">desktop
  18308. </pre></div>
  18309. <p>or
  18310. </p><div class="example">
  18311. <pre class="example">title=<var>window_title</var>
  18312. </pre></div>
  18313. <p>The first option will capture the entire desktop, or a fixed region of the
  18314. desktop. The second option will instead capture the contents of a single
  18315. window, regardless of its position on the screen.
  18316. </p>
  18317. <p>For example, to grab the entire desktop using <code>ffmpeg</code>:
  18318. </p><div class="example">
  18319. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
  18320. </pre></div>
  18321. <p>Grab a 640x480 region at position <code>10,20</code>:
  18322. </p><div class="example">
  18323. <pre class="example">ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
  18324. </pre></div>
  18325. <p>Grab the contents of the window named &quot;Calculator&quot;
  18326. </p><div class="example">
  18327. <pre class="example">ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
  18328. </pre></div>
  18329. <a name="Options-21"></a>
  18330. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-21">26.8.1 Options</a></h3>
  18331. <dl compact="compact">
  18332. <dt>&lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
  18333. <dd><p>Specify whether to draw the mouse pointer. Use the value <code>0</code> to
  18334. not draw the pointer. Default value is <code>1</code>.
  18335. </p>
  18336. </dd>
  18337. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18338. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  18339. corresponding to a frame rate of <code>30000/1001</code>.
  18340. </p>
  18341. </dd>
  18342. <dt>&lsquo;<samp>show_region</samp>&rsquo;</dt>
  18343. <dd><p>Show grabbed region on screen.
  18344. </p>
  18345. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  18346. region will be indicated on screen. With this option, it is easy to
  18347. know what is being grabbed if only a portion of the screen is grabbed.
  18348. </p>
  18349. <p>Note that <var>show_region</var> is incompatible with grabbing the contents
  18350. of a single window.
  18351. </p>
  18352. <p>For example:
  18353. </p><div class="example">
  18354. <pre class="example">ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
  18355. </pre></div>
  18356. </dd>
  18357. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18358. <dd><p>Set the video frame size. The default is to capture the full screen if &lsquo;<tt>desktop</tt>&rsquo; is selected, or the full window size if &lsquo;<tt>title=<var>window_title</var></tt>&rsquo; is selected.
  18359. </p>
  18360. </dd>
  18361. <dt>&lsquo;<samp>offset_x</samp>&rsquo;</dt>
  18362. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the left edge of the screen or desktop.
  18363. </p>
  18364. <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned to the left of your primary monitor, you will need to use a negative <var>offset_x</var> value to move the region to that monitor.
  18365. </p>
  18366. </dd>
  18367. <dt>&lsquo;<samp>offset_y</samp>&rsquo;</dt>
  18368. <dd><p>When capturing a region with <var>video_size</var>, set the distance from the top edge of the screen or desktop.
  18369. </p>
  18370. <p>Note that the offset calculation is from the top left corner of the primary monitor on Windows. If you have a monitor positioned above your primary monitor, you will need to use a negative <var>offset_y</var> value to move the region to that monitor.
  18371. </p>
  18372. </dd>
  18373. </dl>
  18374. <a name="iec61883"></a>
  18375. <h2 class="section"><a href="ffmpeg-all.html#toc-iec61883">26.9 iec61883</a></h2>
  18376. <p>FireWire DV/HDV input device using libiec61883.
  18377. </p>
  18378. <p>To enable this input device, you need libiec61883, libraw1394 and
  18379. libavc1394 installed on your system. Use the configure option
  18380. <code>--enable-libiec61883</code> to compile with the device enabled.
  18381. </p>
  18382. <p>The iec61883 capture device supports capturing from a video device
  18383. connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
  18384. FireWire stack (juju). This is the default DV/HDV input method in Linux
  18385. Kernel 2.6.37 and later, since the old FireWire stack was removed.
  18386. </p>
  18387. <p>Specify the FireWire port to be used as input file, or &quot;auto&quot;
  18388. to choose the first port connected.
  18389. </p>
  18390. <a name="Options-3"></a>
  18391. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-3">26.9.1 Options</a></h3>
  18392. <dl compact="compact">
  18393. <dt>&lsquo;<samp>dvtype</samp>&rsquo;</dt>
  18394. <dd><p>Override autodetection of DV/HDV. This should only be used if auto
  18395. detection does not work, or if usage of a different device type
  18396. should be prohibited. Treating a DV device as HDV (or vice versa) will
  18397. not work and result in undefined behavior.
  18398. The values &lsquo;<samp>auto</samp>&rsquo;, &lsquo;<samp>dv</samp>&rsquo; and &lsquo;<samp>hdv</samp>&rsquo; are supported.
  18399. </p>
  18400. </dd>
  18401. <dt>&lsquo;<samp>dvbuffer</samp>&rsquo;</dt>
  18402. <dd><p>Set maximum size of buffer for incoming data, in frames. For DV, this
  18403. is an exact value. For HDV, it is not frame exact, since HDV does
  18404. not have a fixed frame size.
  18405. </p>
  18406. </dd>
  18407. <dt>&lsquo;<samp>dvguid</samp>&rsquo;</dt>
  18408. <dd><p>Select the capture device by specifying its GUID. Capturing will only
  18409. be performed from the specified device and fails if no device with the
  18410. given GUID is found. This is useful to select the input if multiple
  18411. devices are connected at the same time.
  18412. Look at /sys/bus/firewire/devices to find out the GUIDs.
  18413. </p>
  18414. </dd>
  18415. </dl>
  18416. <a name="Examples-138"></a>
  18417. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-138">26.9.2 Examples</a></h3>
  18418. <ul>
  18419. <li>
  18420. Grab and show the input of a FireWire DV/HDV device.
  18421. <div class="example">
  18422. <pre class="example">ffplay -f iec61883 -i auto
  18423. </pre></div>
  18424. </li><li>
  18425. Grab and record the input of a FireWire DV/HDV device,
  18426. using a packet buffer of 100000 packets if the source is HDV.
  18427. <div class="example">
  18428. <pre class="example">ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
  18429. </pre></div>
  18430. </li></ul>
  18431. <a name="jack"></a>
  18432. <h2 class="section"><a href="ffmpeg-all.html#toc-jack">26.10 jack</a></h2>
  18433. <p>JACK input device.
  18434. </p>
  18435. <p>To enable this input device during configuration you need libjack
  18436. installed on your system.
  18437. </p>
  18438. <p>A JACK input device creates one or more JACK writable clients, one for
  18439. each audio channel, with name <var>client_name</var>:input_<var>N</var>, where
  18440. <var>client_name</var> is the name provided by the application, and <var>N</var>
  18441. is a number which identifies the channel.
  18442. Each writable client will send the acquired data to the FFmpeg input
  18443. device.
  18444. </p>
  18445. <p>Once you have created one or more JACK readable clients, you need to
  18446. connect them to one or more JACK writable clients.
  18447. </p>
  18448. <p>To connect or disconnect JACK clients you can use the <code>jack_connect</code>
  18449. and <code>jack_disconnect</code> programs, or do it through a graphical interface,
  18450. for example with <code>qjackctl</code>.
  18451. </p>
  18452. <p>To list the JACK clients and their properties you can invoke the command
  18453. <code>jack_lsp</code>.
  18454. </p>
  18455. <p>Follows an example which shows how to capture a JACK readable client
  18456. with <code>ffmpeg</code>.
  18457. </p><div class="example">
  18458. <pre class="example"># Create a JACK writable client with name &quot;ffmpeg&quot;.
  18459. $ ffmpeg -f jack -i ffmpeg -y out.wav
  18460. # Start the sample jack_metro readable client.
  18461. $ jack_metro -b 120 -d 0.2 -f 4000
  18462. # List the current JACK clients.
  18463. $ jack_lsp -c
  18464. system:capture_1
  18465. system:capture_2
  18466. system:playback_1
  18467. system:playback_2
  18468. ffmpeg:input_1
  18469. metro:120_bpm
  18470. # Connect metro to the ffmpeg writable client.
  18471. $ jack_connect metro:120_bpm ffmpeg:input_1
  18472. </pre></div>
  18473. <p>For more information read:
  18474. <a href="http://jackaudio.org/">http://jackaudio.org/</a>
  18475. </p>
  18476. <a name="Options-58"></a>
  18477. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-58">26.10.1 Options</a></h3>
  18478. <dl compact="compact">
  18479. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18480. <dd><p>Set the number of channels. Default is 2.
  18481. </p>
  18482. </dd>
  18483. </dl>
  18484. <a name="kmsgrab"></a>
  18485. <h2 class="section"><a href="ffmpeg-all.html#toc-kmsgrab">26.11 kmsgrab</a></h2>
  18486. <p>KMS video input device.
  18487. </p>
  18488. <p>Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a
  18489. DRM object that can be passed to other hardware functions.
  18490. </p>
  18491. <p>Requires either DRM master or CAP_SYS_ADMIN to run.
  18492. </p>
  18493. <p>If you don&rsquo;t understand what all of that means, you probably don&rsquo;t want this. Look at
  18494. &lsquo;<samp>x11grab</samp>&rsquo; instead.
  18495. </p>
  18496. <a name="Options-5"></a>
  18497. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-5">26.11.1 Options</a></h3>
  18498. <dl compact="compact">
  18499. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  18500. <dd><p>DRM device to capture on. Defaults to &lsquo;<samp>/dev/dri/card0</samp>&rsquo;.
  18501. </p>
  18502. </dd>
  18503. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  18504. <dd><p>Pixel format of the framebuffer. Defaults to &lsquo;<samp>bgr0</samp>&rsquo;.
  18505. </p>
  18506. </dd>
  18507. <dt>&lsquo;<samp>format_modifier</samp>&rsquo;</dt>
  18508. <dd><p>Format modifier to signal on output frames. This is necessary to import correctly into
  18509. some APIs, but can&rsquo;t be autodetected. See the libdrm documentation for possible values.
  18510. </p>
  18511. </dd>
  18512. <dt>&lsquo;<samp>crtc_id</samp>&rsquo;</dt>
  18513. <dd><p>KMS CRTC ID to define the capture source. The first active plane on the given CRTC
  18514. will be used.
  18515. </p>
  18516. </dd>
  18517. <dt>&lsquo;<samp>plane_id</samp>&rsquo;</dt>
  18518. <dd><p>KMS plane ID to define the capture source. Defaults to the first active plane found if
  18519. neither &lsquo;<samp>crtc_id</samp>&rsquo; nor &lsquo;<samp>plane_id</samp>&rsquo; are specified.
  18520. </p>
  18521. </dd>
  18522. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18523. <dd><p>Framerate to capture at. This is not synchronised to any page flipping or framebuffer
  18524. changes - it just defines the interval at which the framebuffer is sampled. Sampling
  18525. faster than the framebuffer update rate will generate independent frames with the same
  18526. content. Defaults to <code>30</code>.
  18527. </p>
  18528. </dd>
  18529. </dl>
  18530. <a name="Examples-85"></a>
  18531. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-85">26.11.2 Examples</a></h3>
  18532. <ul>
  18533. <li>
  18534. Capture from the first active plane, download the result to normal frames and encode.
  18535. This will only work if the framebuffer is both linear and mappable - if not, the result
  18536. may be scrambled or fail to download.
  18537. <div class="example">
  18538. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
  18539. </pre></div>
  18540. </li><li>
  18541. Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264.
  18542. <div class="example">
  18543. <pre class="example">ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
  18544. </pre></div>
  18545. </li><li>
  18546. To capture only part of a plane the output can be cropped - this can be used to capture
  18547. a single window, as long as it has a known absolute position and size. For example, to
  18548. capture and encode the middle quarter of a 1920x1080 plane:
  18549. <div class="example">
  18550. <pre class="example">ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
  18551. </pre></div>
  18552. </li></ul>
  18553. <a name="lavfi"></a>
  18554. <h2 class="section"><a href="ffmpeg-all.html#toc-lavfi">26.12 lavfi</a></h2>
  18555. <p>Libavfilter input virtual device.
  18556. </p>
  18557. <p>This input device reads data from the open output pads of a libavfilter
  18558. filtergraph.
  18559. </p>
  18560. <p>For each filtergraph open output, the input device will create a
  18561. corresponding stream which is mapped to the generated output. Currently
  18562. only video data is supported. The filtergraph is specified through the
  18563. option &lsquo;<samp>graph</samp>&rsquo;.
  18564. </p>
  18565. <a name="Options-84"></a>
  18566. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-84">26.12.1 Options</a></h3>
  18567. <dl compact="compact">
  18568. <dt>&lsquo;<samp>graph</samp>&rsquo;</dt>
  18569. <dd><p>Specify the filtergraph to use as input. Each video open output must be
  18570. labelled by a unique string of the form &quot;out<var>N</var>&quot;, where <var>N</var> is a
  18571. number starting from 0 corresponding to the mapped input stream
  18572. generated by the device.
  18573. The first unlabelled output is automatically assigned to the &quot;out0&quot;
  18574. label, but all the others need to be specified explicitly.
  18575. </p>
  18576. <p>The suffix &quot;+subcc&quot; can be appended to the output label to create an extra
  18577. stream with the closed captions packets attached to that output
  18578. (experimental; only for EIA-608 / CEA-708 for now).
  18579. The subcc streams are created after all the normal streams, in the order of
  18580. the corresponding stream.
  18581. For example, if there is &quot;out19+subcc&quot;, &quot;out7+subcc&quot; and up to &quot;out42&quot;, the
  18582. stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
  18583. </p>
  18584. <p>If not specified defaults to the filename specified for the input
  18585. device.
  18586. </p>
  18587. </dd>
  18588. <dt>&lsquo;<samp>graph_file</samp>&rsquo;</dt>
  18589. <dd><p>Set the filename of the filtergraph to be read and sent to the other
  18590. filters. Syntax of the filtergraph is the same as the one specified by
  18591. the option <var>graph</var>.
  18592. </p>
  18593. </dd>
  18594. <dt>&lsquo;<samp>dumpgraph</samp>&rsquo;</dt>
  18595. <dd><p>Dump graph to stderr.
  18596. </p>
  18597. </dd>
  18598. </dl>
  18599. <a name="Examples-106"></a>
  18600. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-106">26.12.2 Examples</a></h3>
  18601. <ul>
  18602. <li>
  18603. Create a color video stream and play it back with <code>ffplay</code>:
  18604. <div class="example">
  18605. <pre class="example">ffplay -f lavfi -graph &quot;color=c=pink [out0]&quot; dummy
  18606. </pre></div>
  18607. </li><li>
  18608. As the previous example, but use filename for specifying the graph
  18609. description, and omit the &quot;out0&quot; label:
  18610. <div class="example">
  18611. <pre class="example">ffplay -f lavfi color=c=pink
  18612. </pre></div>
  18613. </li><li>
  18614. Create three different video test filtered sources and play them:
  18615. <div class="example">
  18616. <pre class="example">ffplay -f lavfi -graph &quot;testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]&quot; test3
  18617. </pre></div>
  18618. </li><li>
  18619. Read an audio stream from a file using the amovie source and play it
  18620. back with <code>ffplay</code>:
  18621. <div class="example">
  18622. <pre class="example">ffplay -f lavfi &quot;amovie=test.wav&quot;
  18623. </pre></div>
  18624. </li><li>
  18625. Read an audio stream and a video stream and play it back with
  18626. <code>ffplay</code>:
  18627. <div class="example">
  18628. <pre class="example">ffplay -f lavfi &quot;movie=test.avi[out0];amovie=test.wav[out1]&quot;
  18629. </pre></div>
  18630. </li><li>
  18631. Dump decoded frames to images and closed captions to a file (experimental):
  18632. <div class="example">
  18633. <pre class="example">ffmpeg -f lavfi -i &quot;movie=test.ts[out0+subcc]&quot; -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
  18634. </pre></div>
  18635. </li></ul>
  18636. <a name="libcdio"></a>
  18637. <h2 class="section"><a href="ffmpeg-all.html#toc-libcdio">26.13 libcdio</a></h2>
  18638. <p>Audio-CD input device based on libcdio.
  18639. </p>
  18640. <p>To enable this input device during configuration you need libcdio
  18641. installed on your system. It requires the configure option
  18642. <code>--enable-libcdio</code>.
  18643. </p>
  18644. <p>This device allows playing and grabbing from an Audio-CD.
  18645. </p>
  18646. <p>For example to copy with <code>ffmpeg</code> the entire Audio-CD in &lsquo;<tt>/dev/sr0</tt>&rsquo;,
  18647. you may run the command:
  18648. </p><div class="example">
  18649. <pre class="example">ffmpeg -f libcdio -i /dev/sr0 cd.wav
  18650. </pre></div>
  18651. <a name="Options-80"></a>
  18652. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-80">26.13.1 Options</a></h3>
  18653. <dl compact="compact">
  18654. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  18655. <dd><p>Set drive reading speed. Default value is 0.
  18656. </p>
  18657. <p>The speed is specified CD-ROM speed units. The speed is set through
  18658. the libcdio <code>cdio_cddap_speed_set</code> function. On many CD-ROM
  18659. drives, specifying a value too large will result in using the fastest
  18660. speed.
  18661. </p>
  18662. </dd>
  18663. <dt>&lsquo;<samp>paranoia_mode</samp>&rsquo;</dt>
  18664. <dd><p>Set paranoia recovery mode flags. It accepts one of the following values:
  18665. </p>
  18666. <dl compact="compact">
  18667. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  18668. <dt>&lsquo;<samp>verify</samp>&rsquo;</dt>
  18669. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  18670. <dt>&lsquo;<samp>neverskip</samp>&rsquo;</dt>
  18671. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  18672. </dl>
  18673. <p>Default value is &lsquo;<samp>disable</samp>&rsquo;.
  18674. </p>
  18675. <p>For more information about the available recovery modes, consult the
  18676. paranoia project documentation.
  18677. </p></dd>
  18678. </dl>
  18679. <a name="libdc1394"></a>
  18680. <h2 class="section"><a href="ffmpeg-all.html#toc-libdc1394">26.14 libdc1394</a></h2>
  18681. <p>IIDC1394 input device, based on libdc1394 and libraw1394.
  18682. </p>
  18683. <p>Requires the configure option <code>--enable-libdc1394</code>.
  18684. </p>
  18685. <a name="Options-15"></a>
  18686. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-15">26.14.1 Options</a></h3>
  18687. <dl compact="compact">
  18688. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18689. <dd><p>Set the frame rate. Default is <code>ntsc</code>, corresponding to a frame
  18690. rate of <code>30000/1001</code>.
  18691. </p>
  18692. </dd>
  18693. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  18694. <dd><p>Select the pixel format. Default is <code>uyvy422</code>.
  18695. </p>
  18696. </dd>
  18697. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18698. <dd><p>Set the video size given as a string such as <code>640x480</code> or <code>hd720</code>.
  18699. Default is <code>qvga</code>.
  18700. </p></dd>
  18701. </dl>
  18702. <a name="openal"></a>
  18703. <h2 class="section"><a href="ffmpeg-all.html#toc-openal">26.15 openal</a></h2>
  18704. <p>The OpenAL input device provides audio capture on all systems with a
  18705. working OpenAL 1.1 implementation.
  18706. </p>
  18707. <p>To enable this input device during configuration, you need OpenAL
  18708. headers and libraries installed on your system, and need to configure
  18709. FFmpeg with <code>--enable-openal</code>.
  18710. </p>
  18711. <p>OpenAL headers and libraries should be provided as part of your OpenAL
  18712. implementation, or as an additional download (an SDK). Depending on your
  18713. installation you may need to specify additional flags via the
  18714. <code>--extra-cflags</code> and <code>--extra-ldflags</code> for allowing the build
  18715. system to locate the OpenAL headers and libraries.
  18716. </p>
  18717. <p>An incomplete list of OpenAL implementations follows:
  18718. </p>
  18719. <dl compact="compact">
  18720. <dt><strong>Creative</strong></dt>
  18721. <dd><p>The official Windows implementation, providing hardware acceleration
  18722. with supported devices and software fallback.
  18723. See <a href="http://openal.org/">http://openal.org/</a>.
  18724. </p></dd>
  18725. <dt><strong>OpenAL Soft</strong></dt>
  18726. <dd><p>Portable, open source (LGPL) software implementation. Includes
  18727. backends for the most common sound APIs on the Windows, Linux,
  18728. Solaris, and BSD operating systems.
  18729. See <a href="http://kcat.strangesoft.net/openal.html">http://kcat.strangesoft.net/openal.html</a>.
  18730. </p></dd>
  18731. <dt><strong>Apple</strong></dt>
  18732. <dd><p>OpenAL is part of Core Audio, the official Mac OS X Audio interface.
  18733. See <a href="http://developer.apple.com/technologies/mac/audio-and-video.html">http://developer.apple.com/technologies/mac/audio-and-video.html</a>
  18734. </p></dd>
  18735. </dl>
  18736. <p>This device allows one to capture from an audio input device handled
  18737. through OpenAL.
  18738. </p>
  18739. <p>You need to specify the name of the device to capture in the provided
  18740. filename. If the empty string is provided, the device will
  18741. automatically select the default device. You can get the list of the
  18742. supported devices by using the option <var>list_devices</var>.
  18743. </p>
  18744. <a name="Options-70"></a>
  18745. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-70">26.15.1 Options</a></h3>
  18746. <dl compact="compact">
  18747. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18748. <dd><p>Set the number of channels in the captured audio. Only the values
  18749. &lsquo;<samp>1</samp>&rsquo; (monaural) and &lsquo;<samp>2</samp>&rsquo; (stereo) are currently supported.
  18750. Defaults to &lsquo;<samp>2</samp>&rsquo;.
  18751. </p>
  18752. </dd>
  18753. <dt>&lsquo;<samp>sample_size</samp>&rsquo;</dt>
  18754. <dd><p>Set the sample size (in bits) of the captured audio. Only the values
  18755. &lsquo;<samp>8</samp>&rsquo; and &lsquo;<samp>16</samp>&rsquo; are currently supported. Defaults to
  18756. &lsquo;<samp>16</samp>&rsquo;.
  18757. </p>
  18758. </dd>
  18759. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18760. <dd><p>Set the sample rate (in Hz) of the captured audio.
  18761. Defaults to &lsquo;<samp>44.1k</samp>&rsquo;.
  18762. </p>
  18763. </dd>
  18764. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  18765. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  18766. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  18767. </p>
  18768. </dd>
  18769. </dl>
  18770. <a name="Examples-20"></a>
  18771. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-20">26.15.2 Examples</a></h3>
  18772. <p>Print the list of OpenAL supported devices and exit:
  18773. </p><div class="example">
  18774. <pre class="example">$ ffmpeg -list_devices true -f openal -i dummy out.ogg
  18775. </pre></div>
  18776. <p>Capture from the OpenAL device &lsquo;<tt>DR-BT101 via PulseAudio</tt>&rsquo;:
  18777. </p><div class="example">
  18778. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
  18779. </pre></div>
  18780. <p>Capture from the default device (note the empty string &rdquo; as filename):
  18781. </p><div class="example">
  18782. <pre class="example">$ ffmpeg -f openal -i '' out.ogg
  18783. </pre></div>
  18784. <p>Capture from two devices simultaneously, writing to two different files,
  18785. within the same <code>ffmpeg</code> command:
  18786. </p><div class="example">
  18787. <pre class="example">$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
  18788. </pre></div>
  18789. <p>Note: not all OpenAL implementations support multiple simultaneous capture -
  18790. try the latest OpenAL Soft if the above does not work.
  18791. </p>
  18792. <a name="oss"></a>
  18793. <h2 class="section"><a href="ffmpeg-all.html#toc-oss">26.16 oss</a></h2>
  18794. <p>Open Sound System input device.
  18795. </p>
  18796. <p>The filename to provide to the input device is the device node
  18797. representing the OSS input device, and is usually set to
  18798. &lsquo;<tt>/dev/dsp</tt>&rsquo;.
  18799. </p>
  18800. <p>For example to grab from &lsquo;<tt>/dev/dsp</tt>&rsquo; using <code>ffmpeg</code> use the
  18801. command:
  18802. </p><div class="example">
  18803. <pre class="example">ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
  18804. </pre></div>
  18805. <p>For more information about OSS see:
  18806. <a href="http://manuals.opensound.com/usersguide/dsp.html">http://manuals.opensound.com/usersguide/dsp.html</a>
  18807. </p>
  18808. <a name="Options-76"></a>
  18809. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-76">26.16.1 Options</a></h3>
  18810. <dl compact="compact">
  18811. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18812. <dd><p>Set the sample rate in Hz. Default is 48000.
  18813. </p>
  18814. </dd>
  18815. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18816. <dd><p>Set the number of channels. Default is 2.
  18817. </p>
  18818. </dd>
  18819. </dl>
  18820. <a name="pulse"></a>
  18821. <h2 class="section"><a href="ffmpeg-all.html#toc-pulse">26.17 pulse</a></h2>
  18822. <p>PulseAudio input device.
  18823. </p>
  18824. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  18825. </p>
  18826. <p>The filename to provide to the input device is a source device or the
  18827. string &quot;default&quot;
  18828. </p>
  18829. <p>To list the PulseAudio source devices and their properties you can invoke
  18830. the command <code>pactl list sources</code>.
  18831. </p>
  18832. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>.
  18833. </p>
  18834. <a name="Options-32"></a>
  18835. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-32">26.17.1 Options</a></h3>
  18836. <dl compact="compact">
  18837. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  18838. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  18839. Default server is used when not provided.
  18840. </p>
  18841. </dd>
  18842. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  18843. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  18844. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  18845. </p>
  18846. </dd>
  18847. <dt>&lsquo;<samp>stream_name</samp>&rsquo;</dt>
  18848. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  18849. by default it is &quot;record&quot;.
  18850. </p>
  18851. </dd>
  18852. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18853. <dd><p>Specify the samplerate in Hz, by default 48kHz is used.
  18854. </p>
  18855. </dd>
  18856. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18857. <dd><p>Specify the channels in use, by default 2 (stereo) is set.
  18858. </p>
  18859. </dd>
  18860. <dt>&lsquo;<samp>frame_size</samp>&rsquo;</dt>
  18861. <dd><p>Specify the number of bytes per frame, by default it is set to 1024.
  18862. </p>
  18863. </dd>
  18864. <dt>&lsquo;<samp>fragment_size</samp>&rsquo;</dt>
  18865. <dd><p>Specify the minimal buffering fragment in PulseAudio, it will affect the
  18866. audio latency. By default it is unset.
  18867. </p>
  18868. </dd>
  18869. <dt>&lsquo;<samp>wallclock</samp>&rsquo;</dt>
  18870. <dd><p>Set the initial PTS using the current time. Default is 1.
  18871. </p>
  18872. </dd>
  18873. </dl>
  18874. <a name="Examples-187"></a>
  18875. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-187">26.17.2 Examples</a></h3>
  18876. <p>Record a stream from default device:
  18877. </p><div class="example">
  18878. <pre class="example">ffmpeg -f pulse -i default /tmp/pulse.wav
  18879. </pre></div>
  18880. <a name="sndio"></a>
  18881. <h2 class="section"><a href="ffmpeg-all.html#toc-sndio">26.18 sndio</a></h2>
  18882. <p>sndio input device.
  18883. </p>
  18884. <p>To enable this input device during configuration you need libsndio
  18885. installed on your system.
  18886. </p>
  18887. <p>The filename to provide to the input device is the device node
  18888. representing the sndio input device, and is usually set to
  18889. &lsquo;<tt>/dev/audio0</tt>&rsquo;.
  18890. </p>
  18891. <p>For example to grab from &lsquo;<tt>/dev/audio0</tt>&rsquo; using <code>ffmpeg</code> use the
  18892. command:
  18893. </p><div class="example">
  18894. <pre class="example">ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
  18895. </pre></div>
  18896. <a name="Options-81"></a>
  18897. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-81">26.18.1 Options</a></h3>
  18898. <dl compact="compact">
  18899. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  18900. <dd><p>Set the sample rate in Hz. Default is 48000.
  18901. </p>
  18902. </dd>
  18903. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  18904. <dd><p>Set the number of channels. Default is 2.
  18905. </p>
  18906. </dd>
  18907. </dl>
  18908. <a name="video4linux2_002c-v4l2"></a>
  18909. <h2 class="section"><a href="ffmpeg-all.html#toc-video4linux2_002c-v4l2">26.19 video4linux2, v4l2</a></h2>
  18910. <p>Video4Linux2 input video device.
  18911. </p>
  18912. <p>&quot;v4l2&quot; can be used as alias for &quot;video4linux2&quot;.
  18913. </p>
  18914. <p>If FFmpeg is built with v4l-utils support (by using the
  18915. <code>--enable-libv4l2</code> configure option), it is possible to use it with the
  18916. <code>-use_libv4l2</code> input device option.
  18917. </p>
  18918. <p>The name of the device to grab is a file device node, usually Linux
  18919. systems tend to automatically create such nodes when the device
  18920. (e.g. an USB webcam) is plugged into the system, and has a name of the
  18921. kind &lsquo;<tt>/dev/video<var>N</var></tt>&rsquo;, where <var>N</var> is a number associated to
  18922. the device.
  18923. </p>
  18924. <p>Video4Linux2 devices usually support a limited set of
  18925. <var>width</var>x<var>height</var> sizes and frame rates. You can check which are
  18926. supported using <code>-list_formats all</code> for Video4Linux2 devices.
  18927. Some devices, like TV cards, support one or more standards. It is possible
  18928. to list all the supported standards using <code>-list_standards all</code>.
  18929. </p>
  18930. <p>The time base for the timestamps is 1 microsecond. Depending on the kernel
  18931. version and configuration, the timestamps may be derived from the real time
  18932. clock (origin at the Unix Epoch) or the monotonic clock (origin usually at
  18933. boot time, unaffected by NTP or manual changes to the clock). The
  18934. &lsquo;<samp>-timestamps abs</samp>&rsquo; or &lsquo;<samp>-ts abs</samp>&rsquo; option can be used to force
  18935. conversion into the real time clock.
  18936. </p>
  18937. <p>Some usage examples of the video4linux2 device with <code>ffmpeg</code>
  18938. and <code>ffplay</code>:
  18939. </p><ul>
  18940. <li>
  18941. List supported formats for a video4linux2 device:
  18942. <div class="example">
  18943. <pre class="example">ffplay -f video4linux2 -list_formats all /dev/video0
  18944. </pre></div>
  18945. </li><li>
  18946. Grab and show the input of a video4linux2 device:
  18947. <div class="example">
  18948. <pre class="example">ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
  18949. </pre></div>
  18950. </li><li>
  18951. Grab and record the input of a video4linux2 device, leave the
  18952. frame rate and size as previously set:
  18953. <div class="example">
  18954. <pre class="example">ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
  18955. </pre></div>
  18956. </li></ul>
  18957. <p>For more information about Video4Linux, check <a href="http://linuxtv.org/">http://linuxtv.org/</a>.
  18958. </p>
  18959. <a name="Options-48"></a>
  18960. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-48">26.19.1 Options</a></h3>
  18961. <dl compact="compact">
  18962. <dt>&lsquo;<samp>standard</samp>&rsquo;</dt>
  18963. <dd><p>Set the standard. Must be the name of a supported standard. To get a
  18964. list of the supported standards, use the &lsquo;<samp>list_standards</samp>&rsquo;
  18965. option.
  18966. </p>
  18967. </dd>
  18968. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  18969. <dd><p>Set the input channel number. Default to -1, which means using the
  18970. previously selected channel.
  18971. </p>
  18972. </dd>
  18973. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  18974. <dd><p>Set the video frame size. The argument must be a string in the form
  18975. <var>WIDTH</var>x<var>HEIGHT</var> or a valid size abbreviation.
  18976. </p>
  18977. </dd>
  18978. <dt>&lsquo;<samp>pixel_format</samp>&rsquo;</dt>
  18979. <dd><p>Select the pixel format (only valid for raw video input).
  18980. </p>
  18981. </dd>
  18982. <dt>&lsquo;<samp>input_format</samp>&rsquo;</dt>
  18983. <dd><p>Set the preferred pixel format (for raw video) or a codec name.
  18984. This option allows one to select the input format, when several are
  18985. available.
  18986. </p>
  18987. </dd>
  18988. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  18989. <dd><p>Set the preferred video frame rate.
  18990. </p>
  18991. </dd>
  18992. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  18993. <dd><p>List available formats (supported pixel formats, codecs, and frame
  18994. sizes) and exit.
  18995. </p>
  18996. <p>Available values are:
  18997. </p><dl compact="compact">
  18998. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  18999. <dd><p>Show all available (compressed and non-compressed) formats.
  19000. </p>
  19001. </dd>
  19002. <dt>&lsquo;<samp>raw</samp>&rsquo;</dt>
  19003. <dd><p>Show only raw video (non-compressed) formats.
  19004. </p>
  19005. </dd>
  19006. <dt>&lsquo;<samp>compressed</samp>&rsquo;</dt>
  19007. <dd><p>Show only compressed formats.
  19008. </p></dd>
  19009. </dl>
  19010. </dd>
  19011. <dt>&lsquo;<samp>list_standards</samp>&rsquo;</dt>
  19012. <dd><p>List supported standards and exit.
  19013. </p>
  19014. <p>Available values are:
  19015. </p><dl compact="compact">
  19016. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  19017. <dd><p>Show all supported standards.
  19018. </p></dd>
  19019. </dl>
  19020. </dd>
  19021. <dt>&lsquo;<samp>timestamps, ts</samp>&rsquo;</dt>
  19022. <dd><p>Set type of timestamps for grabbed frames.
  19023. </p>
  19024. <p>Available values are:
  19025. </p><dl compact="compact">
  19026. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  19027. <dd><p>Use timestamps from the kernel.
  19028. </p>
  19029. </dd>
  19030. <dt>&lsquo;<samp>abs</samp>&rsquo;</dt>
  19031. <dd><p>Use absolute timestamps (wall clock).
  19032. </p>
  19033. </dd>
  19034. <dt>&lsquo;<samp>mono2abs</samp>&rsquo;</dt>
  19035. <dd><p>Force conversion from monotonic to absolute timestamps.
  19036. </p></dd>
  19037. </dl>
  19038. <p>Default value is <code>default</code>.
  19039. </p>
  19040. </dd>
  19041. <dt>&lsquo;<samp>use_libv4l2</samp>&rsquo;</dt>
  19042. <dd><p>Use libv4l2 (v4l-utils) conversion functions. Default is 0.
  19043. </p>
  19044. </dd>
  19045. </dl>
  19046. <a name="vfwcap"></a>
  19047. <h2 class="section"><a href="ffmpeg-all.html#toc-vfwcap">26.20 vfwcap</a></h2>
  19048. <p>VfW (Video for Windows) capture input device.
  19049. </p>
  19050. <p>The filename passed as input is the capture driver number, ranging from
  19051. 0 to 9. You may use &quot;list&quot; as filename to print a list of drivers. Any
  19052. other filename will be interpreted as device number 0.
  19053. </p>
  19054. <a name="Options-42"></a>
  19055. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-42">26.20.1 Options</a></h3>
  19056. <dl compact="compact">
  19057. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  19058. <dd><p>Set the video frame size.
  19059. </p>
  19060. </dd>
  19061. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  19062. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19063. corresponding to a frame rate of <code>30000/1001</code>.
  19064. </p>
  19065. </dd>
  19066. </dl>
  19067. <a name="x11grab"></a>
  19068. <h2 class="section"><a href="ffmpeg-all.html#toc-x11grab">26.21 x11grab</a></h2>
  19069. <p>X11 video input device.
  19070. </p>
  19071. <p>To enable this input device during configuration you need libxcb
  19072. installed on your system. It will be automatically detected during
  19073. configuration.
  19074. </p>
  19075. <p>This device allows one to capture a region of an X11 display.
  19076. </p>
  19077. <p>The filename passed as input has the syntax:
  19078. </p><div class="example">
  19079. <pre class="example">[<var>hostname</var>]:<var>display_number</var>.<var>screen_number</var>[+<var>x_offset</var>,<var>y_offset</var>]
  19080. </pre></div>
  19081. <p><var>hostname</var>:<var>display_number</var>.<var>screen_number</var> specifies the
  19082. X11 display name of the screen to grab from. <var>hostname</var> can be
  19083. omitted, and defaults to &quot;localhost&quot;. The environment variable
  19084. <code>DISPLAY</code> contains the default display name.
  19085. </p>
  19086. <p><var>x_offset</var> and <var>y_offset</var> specify the offsets of the grabbed
  19087. area with respect to the top-left border of the X11 screen. They
  19088. default to 0.
  19089. </p>
  19090. <p>Check the X11 documentation (e.g. <code>man X</code>) for more detailed
  19091. information.
  19092. </p>
  19093. <p>Use the <code>xdpyinfo</code> program for getting basic information about
  19094. the properties of your X11 display (e.g. grep for &quot;name&quot; or
  19095. &quot;dimensions&quot;).
  19096. </p>
  19097. <p>For example to grab from &lsquo;<tt>:0.0</tt>&rsquo; using <code>ffmpeg</code>:
  19098. </p><div class="example">
  19099. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
  19100. </pre></div>
  19101. <p>Grab at position <code>10,20</code>:
  19102. </p><div class="example">
  19103. <pre class="example">ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  19104. </pre></div>
  19105. <a name="Options-14"></a>
  19106. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-14">26.21.1 Options</a></h3>
  19107. <dl compact="compact">
  19108. <dt>&lsquo;<samp>draw_mouse</samp>&rsquo;</dt>
  19109. <dd><p>Specify whether to draw the mouse pointer. A value of <code>0</code> specifies
  19110. not to draw the pointer. Default value is <code>1</code>.
  19111. </p>
  19112. </dd>
  19113. <dt>&lsquo;<samp>follow_mouse</samp>&rsquo;</dt>
  19114. <dd><p>Make the grabbed area follow the mouse. The argument can be
  19115. <code>centered</code> or a number of pixels <var>PIXELS</var>.
  19116. </p>
  19117. <p>When it is specified with &quot;centered&quot;, the grabbing region follows the mouse
  19118. pointer and keeps the pointer at the center of region; otherwise, the region
  19119. follows only when the mouse pointer reaches within <var>PIXELS</var> (greater than
  19120. zero) to the edge of region.
  19121. </p>
  19122. <p>For example:
  19123. </p><div class="example">
  19124. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
  19125. </pre></div>
  19126. <p>To follow only when the mouse pointer reaches within 100 pixels to edge:
  19127. </p><div class="example">
  19128. <pre class="example">ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
  19129. </pre></div>
  19130. </dd>
  19131. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  19132. <dd><p>Set the grabbing frame rate. Default value is <code>ntsc</code>,
  19133. corresponding to a frame rate of <code>30000/1001</code>.
  19134. </p>
  19135. </dd>
  19136. <dt>&lsquo;<samp>show_region</samp>&rsquo;</dt>
  19137. <dd><p>Show grabbed region on screen.
  19138. </p>
  19139. <p>If <var>show_region</var> is specified with <code>1</code>, then the grabbing
  19140. region will be indicated on screen. With this option, it is easy to
  19141. know what is being grabbed if only a portion of the screen is grabbed.
  19142. </p>
  19143. </dd>
  19144. <dt>&lsquo;<samp>region_border</samp>&rsquo;</dt>
  19145. <dd><p>Set the region border thickness if &lsquo;<samp>-show_region 1</samp>&rsquo; is used.
  19146. Range is 1 to 128 and default is 3 (XCB-based x11grab only).
  19147. </p>
  19148. <p>For example:
  19149. </p><div class="example">
  19150. <pre class="example">ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
  19151. </pre></div>
  19152. <p>With <var>follow_mouse</var>:
  19153. </p><div class="example">
  19154. <pre class="example">ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
  19155. </pre></div>
  19156. </dd>
  19157. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  19158. <dd><p>Set the video frame size. Default is the full desktop.
  19159. </p>
  19160. </dd>
  19161. <dt>&lsquo;<samp>grab_x</samp>&rsquo;</dt>
  19162. <dt>&lsquo;<samp>grab_y</samp>&rsquo;</dt>
  19163. <dd><p>Set the grabbing region coordinates. They are expressed as offset from
  19164. the top left corner of the X11 window and correspond to the
  19165. <var>x_offset</var> and <var>y_offset</var> parameters in the device name. The
  19166. default value for both options is 0.
  19167. </p></dd>
  19168. </dl>
  19169. <a name="Output-Devices"></a>
  19170. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Output-Devices">27 Output Devices</a></h1>
  19171. <p>Output devices are configured elements in FFmpeg that can write
  19172. multimedia data to an output device attached to your system.
  19173. </p>
  19174. <p>When you configure your FFmpeg build, all the supported output devices
  19175. are enabled by default. You can list all available ones using the
  19176. configure option &quot;&ndash;list-outdevs&quot;.
  19177. </p>
  19178. <p>You can disable all the output devices using the configure option
  19179. &quot;&ndash;disable-outdevs&quot;, and selectively enable an output device using the
  19180. option &quot;&ndash;enable-outdev=<var>OUTDEV</var>&quot;, or you can disable a particular
  19181. input device using the option &quot;&ndash;disable-outdev=<var>OUTDEV</var>&quot;.
  19182. </p>
  19183. <p>The option &quot;-devices&quot; of the ff* tools will display the list of
  19184. enabled output devices.
  19185. </p>
  19186. <p>A description of the currently available output devices follows.
  19187. </p>
  19188. <a name="alsa"></a>
  19189. <h2 class="section"><a href="ffmpeg-all.html#toc-alsa">27.1 alsa</a></h2>
  19190. <p>ALSA (Advanced Linux Sound Architecture) output device.
  19191. </p>
  19192. <a name="Examples-115"></a>
  19193. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-115">27.1.1 Examples</a></h3>
  19194. <ul>
  19195. <li>
  19196. Play a file on default ALSA device:
  19197. <div class="example">
  19198. <pre class="example">ffmpeg -i INPUT -f alsa default
  19199. </pre></div>
  19200. </li><li>
  19201. Play a file on soundcard 1, audio device 7:
  19202. <div class="example">
  19203. <pre class="example">ffmpeg -i INPUT -f alsa hw:1,7
  19204. </pre></div>
  19205. </li></ul>
  19206. <a name="caca"></a>
  19207. <h2 class="section"><a href="ffmpeg-all.html#toc-caca">27.2 caca</a></h2>
  19208. <p>CACA output device.
  19209. </p>
  19210. <p>This output device allows one to show a video stream in CACA window.
  19211. Only one CACA window is allowed per application, so you can
  19212. have only one instance of this output device in an application.
  19213. </p>
  19214. <p>To enable this output device you need to configure FFmpeg with
  19215. <code>--enable-libcaca</code>.
  19216. libcaca is a graphics library that outputs text instead of pixels.
  19217. </p>
  19218. <p>For more information about libcaca, check:
  19219. <a href="http://caca.zoy.org/wiki/libcaca">http://caca.zoy.org/wiki/libcaca</a>
  19220. </p>
  19221. <a name="Options-62"></a>
  19222. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-62">27.2.1 Options</a></h3>
  19223. <dl compact="compact">
  19224. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19225. <dd><p>Set the CACA window title, if not specified default to the filename
  19226. specified for the output device.
  19227. </p>
  19228. </dd>
  19229. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19230. <dd><p>Set the CACA window size, can be a string of the form
  19231. <var>width</var>x<var>height</var> or a video size abbreviation.
  19232. If not specified it defaults to the size of the input video.
  19233. </p>
  19234. </dd>
  19235. <dt>&lsquo;<samp>driver</samp>&rsquo;</dt>
  19236. <dd><p>Set display driver.
  19237. </p>
  19238. </dd>
  19239. <dt>&lsquo;<samp>algorithm</samp>&rsquo;</dt>
  19240. <dd><p>Set dithering algorithm. Dithering is necessary
  19241. because the picture being rendered has usually far more colours than
  19242. the available palette.
  19243. The accepted values are listed with <code>-list_dither algorithms</code>.
  19244. </p>
  19245. </dd>
  19246. <dt>&lsquo;<samp>antialias</samp>&rsquo;</dt>
  19247. <dd><p>Set antialias method. Antialiasing smoothens the rendered
  19248. image and avoids the commonly seen staircase effect.
  19249. The accepted values are listed with <code>-list_dither antialiases</code>.
  19250. </p>
  19251. </dd>
  19252. <dt>&lsquo;<samp>charset</samp>&rsquo;</dt>
  19253. <dd><p>Set which characters are going to be used when rendering text.
  19254. The accepted values are listed with <code>-list_dither charsets</code>.
  19255. </p>
  19256. </dd>
  19257. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  19258. <dd><p>Set color to be used when rendering text.
  19259. The accepted values are listed with <code>-list_dither colors</code>.
  19260. </p>
  19261. </dd>
  19262. <dt>&lsquo;<samp>list_drivers</samp>&rsquo;</dt>
  19263. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of available drivers and exit.
  19264. </p>
  19265. </dd>
  19266. <dt>&lsquo;<samp>list_dither</samp>&rsquo;</dt>
  19267. <dd><p>List available dither options related to the argument.
  19268. The argument must be one of <code>algorithms</code>, <code>antialiases</code>,
  19269. <code>charsets</code>, <code>colors</code>.
  19270. </p></dd>
  19271. </dl>
  19272. <a name="Examples-7"></a>
  19273. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-7">27.2.2 Examples</a></h3>
  19274. <ul>
  19275. <li>
  19276. The following command shows the <code>ffmpeg</code> output is an
  19277. CACA window, forcing its size to 80x25:
  19278. <div class="example">
  19279. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
  19280. </pre></div>
  19281. </li><li>
  19282. Show the list of available drivers and exit:
  19283. <div class="example">
  19284. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
  19285. </pre></div>
  19286. </li><li>
  19287. Show the list of available dither colors and exit:
  19288. <div class="example">
  19289. <pre class="example">ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
  19290. </pre></div>
  19291. </li></ul>
  19292. <a name="decklink-1"></a>
  19293. <h2 class="section"><a href="ffmpeg-all.html#toc-decklink-1">27.3 decklink</a></h2>
  19294. <p>The decklink output device provides playback capabilities for Blackmagic
  19295. DeckLink devices.
  19296. </p>
  19297. <p>To enable this output device, you need the Blackmagic DeckLink SDK and you
  19298. need to configure with the appropriate <code>--extra-cflags</code>
  19299. and <code>--extra-ldflags</code>.
  19300. On Windows, you need to run the IDL files through <code>widl</code>.
  19301. </p>
  19302. <p>DeckLink is very picky about the formats it supports. Pixel format is always
  19303. uyvy422, framerate, field order and video size must be determined for your
  19304. device with <code>-list_formats 1</code>. Audio sample rate is always 48 kHz.
  19305. </p>
  19306. <a name="Options-52"></a>
  19307. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-52">27.3.1 Options</a></h3>
  19308. <dl compact="compact">
  19309. <dt>&lsquo;<samp>list_devices</samp>&rsquo;</dt>
  19310. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of devices and exit.
  19311. Defaults to &lsquo;<samp>false</samp>&rsquo;. This option is deprecated, please use the
  19312. <code>-sinks</code> option of ffmpeg to list the available output devices.
  19313. </p>
  19314. </dd>
  19315. <dt>&lsquo;<samp>list_formats</samp>&rsquo;</dt>
  19316. <dd><p>If set to &lsquo;<samp>true</samp>&rsquo;, print a list of supported formats and exit.
  19317. Defaults to &lsquo;<samp>false</samp>&rsquo;.
  19318. </p>
  19319. </dd>
  19320. <dt>&lsquo;<samp>preroll</samp>&rsquo;</dt>
  19321. <dd><p>Amount of time to preroll video in seconds.
  19322. Defaults to &lsquo;<samp>0.5</samp>&rsquo;.
  19323. </p>
  19324. </dd>
  19325. <dt>&lsquo;<samp>duplex_mode</samp>&rsquo;</dt>
  19326. <dd><p>Sets the decklink device duplex mode. Must be &lsquo;<samp>unset</samp>&rsquo;, &lsquo;<samp>half</samp>&rsquo; or &lsquo;<samp>full</samp>&rsquo;.
  19327. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  19328. </p>
  19329. </dd>
  19330. <dt>&lsquo;<samp>timing_offset</samp>&rsquo;</dt>
  19331. <dd><p>Sets the genlock timing pixel offset on the used output.
  19332. Defaults to &lsquo;<samp>unset</samp>&rsquo;.
  19333. </p>
  19334. </dd>
  19335. </dl>
  19336. <a name="Examples-41"></a>
  19337. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-41">27.3.2 Examples</a></h3>
  19338. <ul>
  19339. <li>
  19340. List output devices:
  19341. <div class="example">
  19342. <pre class="example">ffmpeg -sinks decklink
  19343. </pre></div>
  19344. </li><li>
  19345. List supported formats:
  19346. <div class="example">
  19347. <pre class="example">ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
  19348. </pre></div>
  19349. </li><li>
  19350. Play video clip:
  19351. <div class="example">
  19352. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
  19353. </pre></div>
  19354. </li><li>
  19355. Play video clip with non-standard framerate or video size:
  19356. <div class="example">
  19357. <pre class="example">ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
  19358. </pre></div>
  19359. </li></ul>
  19360. <a name="fbdev-1"></a>
  19361. <h2 class="section"><a href="ffmpeg-all.html#toc-fbdev-1">27.4 fbdev</a></h2>
  19362. <p>Linux framebuffer output device.
  19363. </p>
  19364. <p>The Linux framebuffer is a graphic hardware-independent abstraction
  19365. layer to show graphics on a computer monitor, typically on the
  19366. console. It is accessed through a file device node, usually
  19367. &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  19368. </p>
  19369. <p>For more detailed information read the file
  19370. &lsquo;<tt>Documentation/fb/framebuffer.txt</tt>&rsquo; included in the Linux source tree.
  19371. </p>
  19372. <a name="Options-12"></a>
  19373. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-12">27.4.1 Options</a></h3>
  19374. <dl compact="compact">
  19375. <dt>&lsquo;<samp>xoffset</samp>&rsquo;</dt>
  19376. <dt>&lsquo;<samp>yoffset</samp>&rsquo;</dt>
  19377. <dd><p>Set x/y coordinate of top left corner. Default is 0.
  19378. </p></dd>
  19379. </dl>
  19380. <a name="Examples-107"></a>
  19381. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-107">27.4.2 Examples</a></h3>
  19382. <p>Play a file on framebuffer device &lsquo;<tt>/dev/fb0</tt>&rsquo;.
  19383. Required pixel format depends on current framebuffer settings.
  19384. </p><div class="example">
  19385. <pre class="example">ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
  19386. </pre></div>
  19387. <p>See also <a href="http://linux-fbdev.sourceforge.net/">http://linux-fbdev.sourceforge.net/</a>, and fbset(1).
  19388. </p>
  19389. <a name="opengl"></a>
  19390. <h2 class="section"><a href="ffmpeg-all.html#toc-opengl">27.5 opengl</a></h2>
  19391. <p>OpenGL output device.
  19392. </p>
  19393. <p>To enable this output device you need to configure FFmpeg with <code>--enable-opengl</code>.
  19394. </p>
  19395. <p>This output device allows one to render to OpenGL context.
  19396. Context may be provided by application or default SDL window is created.
  19397. </p>
  19398. <p>When device renders to external context, application must implement handlers for following messages:
  19399. <code>AV_DEV_TO_APP_CREATE_WINDOW_BUFFER</code> - create OpenGL context on current thread.
  19400. <code>AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER</code> - make OpenGL context current.
  19401. <code>AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER</code> - swap buffers.
  19402. <code>AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER</code> - destroy OpenGL context.
  19403. Application is also required to inform a device about current resolution by sending <code>AV_APP_TO_DEV_WINDOW_SIZE</code> message.
  19404. </p>
  19405. <a name="Options-39"></a>
  19406. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-39">27.5.1 Options</a></h3>
  19407. <dl compact="compact">
  19408. <dt>&lsquo;<samp>background</samp>&rsquo;</dt>
  19409. <dd><p>Set background color. Black is a default.
  19410. </p></dd>
  19411. <dt>&lsquo;<samp>no_window</samp>&rsquo;</dt>
  19412. <dd><p>Disables default SDL window when set to non-zero value.
  19413. Application must provide OpenGL context and both <code>window_size_cb</code> and <code>window_swap_buffers_cb</code> callbacks when set.
  19414. </p></dd>
  19415. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19416. <dd><p>Set the SDL window title, if not specified default to the filename specified for the output device.
  19417. Ignored when &lsquo;<samp>no_window</samp>&rsquo; is set.
  19418. </p></dd>
  19419. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19420. <dd><p>Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
  19421. If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
  19422. Mostly usable when &lsquo;<samp>no_window</samp>&rsquo; is not set.
  19423. </p>
  19424. </dd>
  19425. </dl>
  19426. <a name="Examples-161"></a>
  19427. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-161">27.5.2 Examples</a></h3>
  19428. <p>Play a file on SDL window using OpenGL rendering:
  19429. </p><div class="example">
  19430. <pre class="example">ffmpeg -i INPUT -f opengl &quot;window title&quot;
  19431. </pre></div>
  19432. <a name="oss-1"></a>
  19433. <h2 class="section"><a href="ffmpeg-all.html#toc-oss-1">27.6 oss</a></h2>
  19434. <p>OSS (Open Sound System) output device.
  19435. </p>
  19436. <a name="pulse-1"></a>
  19437. <h2 class="section"><a href="ffmpeg-all.html#toc-pulse-1">27.7 pulse</a></h2>
  19438. <p>PulseAudio output device.
  19439. </p>
  19440. <p>To enable this output device you need to configure FFmpeg with <code>--enable-libpulse</code>.
  19441. </p>
  19442. <p>More information about PulseAudio can be found on <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>
  19443. </p>
  19444. <a name="Options-83"></a>
  19445. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-83">27.7.1 Options</a></h3>
  19446. <dl compact="compact">
  19447. <dt>&lsquo;<samp>server</samp>&rsquo;</dt>
  19448. <dd><p>Connect to a specific PulseAudio server, specified by an IP address.
  19449. Default server is used when not provided.
  19450. </p>
  19451. </dd>
  19452. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  19453. <dd><p>Specify the application name PulseAudio will use when showing active clients,
  19454. by default it is the <code>LIBAVFORMAT_IDENT</code> string.
  19455. </p>
  19456. </dd>
  19457. <dt>&lsquo;<samp>stream_name</samp>&rsquo;</dt>
  19458. <dd><p>Specify the stream name PulseAudio will use when showing active streams,
  19459. by default it is set to the specified output name.
  19460. </p>
  19461. </dd>
  19462. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  19463. <dd><p>Specify the device to use. Default device is used when not provided.
  19464. List of output devices can be obtained with command <code>pactl list sinks</code>.
  19465. </p>
  19466. </dd>
  19467. <dt>&lsquo;<samp>buffer_size</samp>&rsquo;</dt>
  19468. <dt>&lsquo;<samp>buffer_duration</samp>&rsquo;</dt>
  19469. <dd><p>Control the size and duration of the PulseAudio buffer. A small buffer
  19470. gives more control, but requires more frequent updates.
  19471. </p>
  19472. <p>&lsquo;<samp>buffer_size</samp>&rsquo; specifies size in bytes while
  19473. &lsquo;<samp>buffer_duration</samp>&rsquo; specifies duration in milliseconds.
  19474. </p>
  19475. <p>When both options are provided then the highest value is used
  19476. (duration is recalculated to bytes using stream parameters). If they
  19477. are set to 0 (which is default), the device will use the default
  19478. PulseAudio duration value. By default PulseAudio set buffer duration
  19479. to around 2 seconds.
  19480. </p>
  19481. </dd>
  19482. <dt>&lsquo;<samp>prebuf</samp>&rsquo;</dt>
  19483. <dd><p>Specify pre-buffering size in bytes. The server does not start with
  19484. playback before at least &lsquo;<samp>prebuf</samp>&rsquo; bytes are available in the
  19485. buffer. By default this option is initialized to the same value as
  19486. &lsquo;<samp>buffer_size</samp>&rsquo; or &lsquo;<samp>buffer_duration</samp>&rsquo; (whichever is bigger).
  19487. </p>
  19488. </dd>
  19489. <dt>&lsquo;<samp>minreq</samp>&rsquo;</dt>
  19490. <dd><p>Specify minimum request size in bytes. The server does not request less
  19491. than &lsquo;<samp>minreq</samp>&rsquo; bytes from the client, instead waits until the buffer
  19492. is free enough to request more bytes at once. It is recommended to not set
  19493. this option, which will initialize this to a value that is deemed sensible
  19494. by the server.
  19495. </p>
  19496. </dd>
  19497. </dl>
  19498. <a name="Examples-12"></a>
  19499. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-12">27.7.2 Examples</a></h3>
  19500. <p>Play a file on default device on default server:
  19501. </p><div class="example">
  19502. <pre class="example">ffmpeg -i INPUT -f pulse &quot;stream name&quot;
  19503. </pre></div>
  19504. <a name="sdl"></a>
  19505. <h2 class="section"><a href="ffmpeg-all.html#toc-sdl">27.8 sdl</a></h2>
  19506. <p>SDL (Simple DirectMedia Layer) output device.
  19507. </p>
  19508. <p>&quot;sdl2&quot; can be used as alias for &quot;sdl&quot;.
  19509. </p>
  19510. <p>This output device allows one to show a video stream in an SDL
  19511. window. Only one SDL window is allowed per application, so you can
  19512. have only one instance of this output device in an application.
  19513. </p>
  19514. <p>To enable this output device you need libsdl installed on your system
  19515. when configuring your build.
  19516. </p>
  19517. <p>For more information about SDL, check:
  19518. <a href="http://www.libsdl.org/">http://www.libsdl.org/</a>
  19519. </p>
  19520. <a name="Options-67"></a>
  19521. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-67">27.8.1 Options</a></h3>
  19522. <dl compact="compact">
  19523. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19524. <dd><p>Set the SDL window title, if not specified default to the filename
  19525. specified for the output device.
  19526. </p>
  19527. </dd>
  19528. <dt>&lsquo;<samp>icon_title</samp>&rsquo;</dt>
  19529. <dd><p>Set the name of the iconified SDL window, if not specified it is set
  19530. to the same value of <var>window_title</var>.
  19531. </p>
  19532. </dd>
  19533. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19534. <dd><p>Set the SDL window size, can be a string of the form
  19535. <var>width</var>x<var>height</var> or a video size abbreviation.
  19536. If not specified it defaults to the size of the input video,
  19537. downscaled according to the aspect ratio.
  19538. </p>
  19539. </dd>
  19540. <dt>&lsquo;<samp>window_x</samp>&rsquo;</dt>
  19541. <dt>&lsquo;<samp>window_y</samp>&rsquo;</dt>
  19542. <dd><p>Set the position of the window on the screen.
  19543. </p>
  19544. </dd>
  19545. <dt>&lsquo;<samp>window_fullscreen</samp>&rsquo;</dt>
  19546. <dd><p>Set fullscreen mode when non-zero value is provided.
  19547. Default value is zero.
  19548. </p>
  19549. </dd>
  19550. <dt>&lsquo;<samp>window_enable_quit</samp>&rsquo;</dt>
  19551. <dd><p>Enable quit action (using window button or keyboard key)
  19552. when non-zero value is provided.
  19553. Default value is 1 (enable quit action)
  19554. </p></dd>
  19555. </dl>
  19556. <a name="Interactive-commands"></a>
  19557. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Interactive-commands">27.8.2 Interactive commands</a></h3>
  19558. <p>The window created by the device can be controlled through the
  19559. following interactive commands.
  19560. </p>
  19561. <dl compact="compact">
  19562. <dt>&lt;q, ESC&gt;</dt>
  19563. <dd><p>Quit the device immediately.
  19564. </p></dd>
  19565. </dl>
  19566. <a name="Examples-8"></a>
  19567. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-8">27.8.3 Examples</a></h3>
  19568. <p>The following command shows the <code>ffmpeg</code> output is an
  19569. SDL window, forcing its size to the qcif format:
  19570. </p><div class="example">
  19571. <pre class="example">ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl &quot;SDL output&quot;
  19572. </pre></div>
  19573. <a name="sndio-1"></a>
  19574. <h2 class="section"><a href="ffmpeg-all.html#toc-sndio-1">27.9 sndio</a></h2>
  19575. <p>sndio audio output device.
  19576. </p>
  19577. <a name="v4l2"></a>
  19578. <h2 class="section"><a href="ffmpeg-all.html#toc-v4l2">27.10 v4l2</a></h2>
  19579. <p>Video4Linux2 output device.
  19580. </p>
  19581. <a name="xv"></a>
  19582. <h2 class="section"><a href="ffmpeg-all.html#toc-xv">27.11 xv</a></h2>
  19583. <p>XV (XVideo) output device.
  19584. </p>
  19585. <p>This output device allows one to show a video stream in a X Window System
  19586. window.
  19587. </p>
  19588. <a name="Options-71"></a>
  19589. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-71">27.11.1 Options</a></h3>
  19590. <dl compact="compact">
  19591. <dt>&lsquo;<samp>display_name</samp>&rsquo;</dt>
  19592. <dd><p>Specify the hardware display name, which determines the display and
  19593. communications domain to be used.
  19594. </p>
  19595. <p>The display name or DISPLAY environment variable can be a string in
  19596. the format <var>hostname</var>[:<var>number</var>[.<var>screen_number</var>]].
  19597. </p>
  19598. <p><var>hostname</var> specifies the name of the host machine on which the
  19599. display is physically attached. <var>number</var> specifies the number of
  19600. the display server on that host machine. <var>screen_number</var> specifies
  19601. the screen to be used on that server.
  19602. </p>
  19603. <p>If unspecified, it defaults to the value of the DISPLAY environment
  19604. variable.
  19605. </p>
  19606. <p>For example, <code>dual-headed:0.1</code> would specify screen 1 of display
  19607. 0 on the machine named &ldquo;dual-headed&rdquo;.
  19608. </p>
  19609. <p>Check the X11 specification for more detailed information about the
  19610. display name format.
  19611. </p>
  19612. </dd>
  19613. <dt>&lsquo;<samp>window_id</samp>&rsquo;</dt>
  19614. <dd><p>When set to non-zero value then device doesn&rsquo;t create new window,
  19615. but uses existing one with provided <var>window_id</var>. By default
  19616. this options is set to zero and device creates its own window.
  19617. </p>
  19618. </dd>
  19619. <dt>&lsquo;<samp>window_size</samp>&rsquo;</dt>
  19620. <dd><p>Set the created window size, can be a string of the form
  19621. <var>width</var>x<var>height</var> or a video size abbreviation. If not
  19622. specified it defaults to the size of the input video.
  19623. Ignored when <var>window_id</var> is set.
  19624. </p>
  19625. </dd>
  19626. <dt>&lsquo;<samp>window_x</samp>&rsquo;</dt>
  19627. <dt>&lsquo;<samp>window_y</samp>&rsquo;</dt>
  19628. <dd><p>Set the X and Y window offsets for the created window. They are both
  19629. set to 0 by default. The values may be ignored by the window manager.
  19630. Ignored when <var>window_id</var> is set.
  19631. </p>
  19632. </dd>
  19633. <dt>&lsquo;<samp>window_title</samp>&rsquo;</dt>
  19634. <dd><p>Set the window title, if not specified default to the filename
  19635. specified for the output device. Ignored when <var>window_id</var> is set.
  19636. </p></dd>
  19637. </dl>
  19638. <p>For more information about XVideo see <a href="http://www.x.org/">http://www.x.org/</a>.
  19639. </p>
  19640. <a name="Examples-158"></a>
  19641. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-158">27.11.2 Examples</a></h3>
  19642. <ul>
  19643. <li>
  19644. Decode, display and encode video input with <code>ffmpeg</code> at the
  19645. same time:
  19646. <div class="example">
  19647. <pre class="example">ffmpeg -i INPUT OUTPUT -f xv display
  19648. </pre></div>
  19649. </li><li>
  19650. Decode and display the input video to multiple X11 windows:
  19651. <div class="example">
  19652. <pre class="example">ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
  19653. </pre></div>
  19654. </li></ul>
  19655. <a name="Resampler-Options"></a>
  19656. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Resampler-Options">28 Resampler Options</a></h1>
  19657. <p>The audio resampler supports the following named options.
  19658. </p>
  19659. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  19660. FFmpeg tools, <var>option</var>=<var>value</var> for the aresample filter,
  19661. by setting the value explicitly in the
  19662. <code>SwrContext</code> options or using the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API for
  19663. programmatic use.
  19664. </p>
  19665. <dl compact="compact">
  19666. <dt>&lsquo;<samp>ich, in_channel_count</samp>&rsquo;</dt>
  19667. <dd><p>Set the number of input channels. Default value is 0. Setting this
  19668. value is not mandatory if the corresponding channel layout
  19669. &lsquo;<samp>in_channel_layout</samp>&rsquo; is set.
  19670. </p>
  19671. </dd>
  19672. <dt>&lsquo;<samp>och, out_channel_count</samp>&rsquo;</dt>
  19673. <dd><p>Set the number of output channels. Default value is 0. Setting this
  19674. value is not mandatory if the corresponding channel layout
  19675. &lsquo;<samp>out_channel_layout</samp>&rsquo; is set.
  19676. </p>
  19677. </dd>
  19678. <dt>&lsquo;<samp>uch, used_channel_count</samp>&rsquo;</dt>
  19679. <dd><p>Set the number of used input channels. Default value is 0. This option is
  19680. only used for special remapping.
  19681. </p>
  19682. </dd>
  19683. <dt>&lsquo;<samp>isr, in_sample_rate</samp>&rsquo;</dt>
  19684. <dd><p>Set the input sample rate. Default value is 0.
  19685. </p>
  19686. </dd>
  19687. <dt>&lsquo;<samp>osr, out_sample_rate</samp>&rsquo;</dt>
  19688. <dd><p>Set the output sample rate. Default value is 0.
  19689. </p>
  19690. </dd>
  19691. <dt>&lsquo;<samp>isf, in_sample_fmt</samp>&rsquo;</dt>
  19692. <dd><p>Specify the input sample format. It is set by default to <code>none</code>.
  19693. </p>
  19694. </dd>
  19695. <dt>&lsquo;<samp>osf, out_sample_fmt</samp>&rsquo;</dt>
  19696. <dd><p>Specify the output sample format. It is set by default to <code>none</code>.
  19697. </p>
  19698. </dd>
  19699. <dt>&lsquo;<samp>tsf, internal_sample_fmt</samp>&rsquo;</dt>
  19700. <dd><p>Set the internal sample format. Default value is <code>none</code>.
  19701. This will automatically be chosen when it is not explicitly set.
  19702. </p>
  19703. </dd>
  19704. <dt>&lsquo;<samp>icl, in_channel_layout</samp>&rsquo;</dt>
  19705. <dt>&lsquo;<samp>ocl, out_channel_layout</samp>&rsquo;</dt>
  19706. <dd><p>Set the input/output channel layout.
  19707. </p>
  19708. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  19709. for the required syntax.
  19710. </p>
  19711. </dd>
  19712. <dt>&lsquo;<samp>clev, center_mix_level</samp>&rsquo;</dt>
  19713. <dd><p>Set the center mix level. It is a value expressed in deciBel, and must be
  19714. in the interval [-32,32].
  19715. </p>
  19716. </dd>
  19717. <dt>&lsquo;<samp>slev, surround_mix_level</samp>&rsquo;</dt>
  19718. <dd><p>Set the surround mix level. It is a value expressed in deciBel, and must
  19719. be in the interval [-32,32].
  19720. </p>
  19721. </dd>
  19722. <dt>&lsquo;<samp>lfe_mix_level</samp>&rsquo;</dt>
  19723. <dd><p>Set LFE mix into non LFE level. It is used when there is a LFE input but no
  19724. LFE output. It is a value expressed in deciBel, and must
  19725. be in the interval [-32,32].
  19726. </p>
  19727. </dd>
  19728. <dt>&lsquo;<samp>rmvol, rematrix_volume</samp>&rsquo;</dt>
  19729. <dd><p>Set rematrix volume. Default value is 1.0.
  19730. </p>
  19731. </dd>
  19732. <dt>&lsquo;<samp>rematrix_maxval</samp>&rsquo;</dt>
  19733. <dd><p>Set maximum output value for rematrixing.
  19734. This can be used to prevent clipping vs. preventing volume reduction.
  19735. A value of 1.0 prevents clipping.
  19736. </p>
  19737. </dd>
  19738. <dt>&lsquo;<samp>flags, swr_flags</samp>&rsquo;</dt>
  19739. <dd><p>Set flags used by the converter. Default value is 0.
  19740. </p>
  19741. <p>It supports the following individual flags:
  19742. </p><dl compact="compact">
  19743. <dt>&lsquo;<samp>res</samp>&rsquo;</dt>
  19744. <dd><p>force resampling, this flag forces resampling to be used even when the
  19745. input and output sample rates match.
  19746. </p></dd>
  19747. </dl>
  19748. </dd>
  19749. <dt>&lsquo;<samp>dither_scale</samp>&rsquo;</dt>
  19750. <dd><p>Set the dither scale. Default value is 1.
  19751. </p>
  19752. </dd>
  19753. <dt>&lsquo;<samp>dither_method</samp>&rsquo;</dt>
  19754. <dd><p>Set dither method. Default value is 0.
  19755. </p>
  19756. <p>Supported values:
  19757. </p><dl compact="compact">
  19758. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  19759. <dd><p>select rectangular dither
  19760. </p></dd>
  19761. <dt>&lsquo;<samp>triangular</samp>&rsquo;</dt>
  19762. <dd><p>select triangular dither
  19763. </p></dd>
  19764. <dt>&lsquo;<samp>triangular_hp</samp>&rsquo;</dt>
  19765. <dd><p>select triangular dither with high pass
  19766. </p></dd>
  19767. <dt>&lsquo;<samp>lipshitz</samp>&rsquo;</dt>
  19768. <dd><p>select Lipshitz noise shaping dither.
  19769. </p></dd>
  19770. <dt>&lsquo;<samp>shibata</samp>&rsquo;</dt>
  19771. <dd><p>select Shibata noise shaping dither.
  19772. </p></dd>
  19773. <dt>&lsquo;<samp>low_shibata</samp>&rsquo;</dt>
  19774. <dd><p>select low Shibata noise shaping dither.
  19775. </p></dd>
  19776. <dt>&lsquo;<samp>high_shibata</samp>&rsquo;</dt>
  19777. <dd><p>select high Shibata noise shaping dither.
  19778. </p></dd>
  19779. <dt>&lsquo;<samp>f_weighted</samp>&rsquo;</dt>
  19780. <dd><p>select f-weighted noise shaping dither
  19781. </p></dd>
  19782. <dt>&lsquo;<samp>modified_e_weighted</samp>&rsquo;</dt>
  19783. <dd><p>select modified-e-weighted noise shaping dither
  19784. </p></dd>
  19785. <dt>&lsquo;<samp>improved_e_weighted</samp>&rsquo;</dt>
  19786. <dd><p>select improved-e-weighted noise shaping dither
  19787. </p>
  19788. </dd>
  19789. </dl>
  19790. </dd>
  19791. <dt>&lsquo;<samp>resampler</samp>&rsquo;</dt>
  19792. <dd><p>Set resampling engine. Default value is swr.
  19793. </p>
  19794. <p>Supported values:
  19795. </p><dl compact="compact">
  19796. <dt>&lsquo;<samp>swr</samp>&rsquo;</dt>
  19797. <dd><p>select the native SW Resampler; filter options precision and cheby are not
  19798. applicable in this case.
  19799. </p></dd>
  19800. <dt>&lsquo;<samp>soxr</samp>&rsquo;</dt>
  19801. <dd><p>select the SoX Resampler (where available); compensation, and filter options
  19802. filter_size, phase_shift, exact_rational, filter_type &amp; kaiser_beta, are not
  19803. applicable in this case.
  19804. </p></dd>
  19805. </dl>
  19806. </dd>
  19807. <dt>&lsquo;<samp>filter_size</samp>&rsquo;</dt>
  19808. <dd><p>For swr only, set resampling filter size, default value is 32.
  19809. </p>
  19810. </dd>
  19811. <dt>&lsquo;<samp>phase_shift</samp>&rsquo;</dt>
  19812. <dd><p>For swr only, set resampling phase shift, default value is 10, and must be in
  19813. the interval [0,30].
  19814. </p>
  19815. </dd>
  19816. <dt>&lsquo;<samp>linear_interp</samp>&rsquo;</dt>
  19817. <dd><p>Use linear interpolation when enabled (the default). Disable it if you want
  19818. to preserve speed instead of quality when exact_rational fails.
  19819. </p>
  19820. </dd>
  19821. <dt>&lsquo;<samp>exact_rational</samp>&rsquo;</dt>
  19822. <dd><p>For swr only, when enabled, try to use exact phase_count based on input and
  19823. output sample rate. However, if it is larger than <code>1 &lt;&lt; phase_shift</code>,
  19824. the phase_count will be <code>1 &lt;&lt; phase_shift</code> as fallback. Default is enabled.
  19825. </p>
  19826. </dd>
  19827. <dt>&lsquo;<samp>cutoff</samp>&rsquo;</dt>
  19828. <dd><p>Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must be a float
  19829. value between 0 and 1. Default value is 0.97 with swr, and 0.91 with soxr
  19830. (which, with a sample-rate of 44100, preserves the entire audio band to 20kHz).
  19831. </p>
  19832. </dd>
  19833. <dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
  19834. <dd><p>For soxr only, the precision in bits to which the resampled signal will be
  19835. calculated. The default value of 20 (which, with suitable dithering, is
  19836. appropriate for a destination bit-depth of 16) gives SoX&rsquo;s &rsquo;High Quality&rsquo;; a
  19837. value of 28 gives SoX&rsquo;s &rsquo;Very High Quality&rsquo;.
  19838. </p>
  19839. </dd>
  19840. <dt>&lsquo;<samp>cheby</samp>&rsquo;</dt>
  19841. <dd><p>For soxr only, selects passband rolloff none (Chebyshev) &amp; higher-precision
  19842. approximation for &rsquo;irrational&rsquo; ratios. Default value is 0.
  19843. </p>
  19844. </dd>
  19845. <dt>&lsquo;<samp>async</samp>&rsquo;</dt>
  19846. <dd><p>For swr only, simple 1 parameter audio sync to timestamps using stretching,
  19847. squeezing, filling and trimming. Setting this to 1 will enable filling and
  19848. trimming, larger values represent the maximum amount in samples that the data
  19849. may be stretched or squeezed for each second.
  19850. Default value is 0, thus no compensation is applied to make the samples match
  19851. the audio timestamps.
  19852. </p>
  19853. </dd>
  19854. <dt>&lsquo;<samp>first_pts</samp>&rsquo;</dt>
  19855. <dd><p>For swr only, assume the first pts should be this value. The time unit is 1 / sample rate.
  19856. This allows for padding/trimming at the start of stream. By default, no
  19857. assumption is made about the first frame&rsquo;s expected pts, so no padding or
  19858. trimming is done. For example, this could be set to 0 to pad the beginning with
  19859. silence if an audio stream starts after the video stream or to trim any samples
  19860. with a negative pts due to encoder delay.
  19861. </p>
  19862. </dd>
  19863. <dt>&lsquo;<samp>min_comp</samp>&rsquo;</dt>
  19864. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  19865. seconds) to trigger stretching/squeezing/filling or trimming of the
  19866. data to make it match the timestamps. The default is that
  19867. stretching/squeezing/filling and trimming is disabled
  19868. (&lsquo;<samp>min_comp</samp>&rsquo; = <code>FLT_MAX</code>).
  19869. </p>
  19870. </dd>
  19871. <dt>&lsquo;<samp>min_hard_comp</samp>&rsquo;</dt>
  19872. <dd><p>For swr only, set the minimum difference between timestamps and audio data (in
  19873. seconds) to trigger adding/dropping samples to make it match the
  19874. timestamps. This option effectively is a threshold to select between
  19875. hard (trim/fill) and soft (squeeze/stretch) compensation. Note that
  19876. all compensation is by default disabled through &lsquo;<samp>min_comp</samp>&rsquo;.
  19877. The default is 0.1.
  19878. </p>
  19879. </dd>
  19880. <dt>&lsquo;<samp>comp_duration</samp>&rsquo;</dt>
  19881. <dd><p>For swr only, set duration (in seconds) over which data is stretched/squeezed
  19882. to make it match the timestamps. Must be a non-negative double float value,
  19883. default value is 1.0.
  19884. </p>
  19885. </dd>
  19886. <dt>&lsquo;<samp>max_soft_comp</samp>&rsquo;</dt>
  19887. <dd><p>For swr only, set maximum factor by which data is stretched/squeezed to make it
  19888. match the timestamps. Must be a non-negative double float value, default value
  19889. is 0.
  19890. </p>
  19891. </dd>
  19892. <dt>&lsquo;<samp>matrix_encoding</samp>&rsquo;</dt>
  19893. <dd><p>Select matrixed stereo encoding.
  19894. </p>
  19895. <p>It accepts the following values:
  19896. </p><dl compact="compact">
  19897. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  19898. <dd><p>select none
  19899. </p></dd>
  19900. <dt>&lsquo;<samp>dolby</samp>&rsquo;</dt>
  19901. <dd><p>select Dolby
  19902. </p></dd>
  19903. <dt>&lsquo;<samp>dplii</samp>&rsquo;</dt>
  19904. <dd><p>select Dolby Pro Logic II
  19905. </p></dd>
  19906. </dl>
  19907. <p>Default value is <code>none</code>.
  19908. </p>
  19909. </dd>
  19910. <dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
  19911. <dd><p>For swr only, select resampling filter type. This only affects resampling
  19912. operations.
  19913. </p>
  19914. <p>It accepts the following values:
  19915. </p><dl compact="compact">
  19916. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  19917. <dd><p>select cubic
  19918. </p></dd>
  19919. <dt>&lsquo;<samp>blackman_nuttall</samp>&rsquo;</dt>
  19920. <dd><p>select Blackman Nuttall windowed sinc
  19921. </p></dd>
  19922. <dt>&lsquo;<samp>kaiser</samp>&rsquo;</dt>
  19923. <dd><p>select Kaiser windowed sinc
  19924. </p></dd>
  19925. </dl>
  19926. </dd>
  19927. <dt>&lsquo;<samp>kaiser_beta</samp>&rsquo;</dt>
  19928. <dd><p>For swr only, set Kaiser window beta value. Must be a double float value in the
  19929. interval [2,16], default value is 9.
  19930. </p>
  19931. </dd>
  19932. <dt>&lsquo;<samp>output_sample_bits</samp>&rsquo;</dt>
  19933. <dd><p>For swr only, set number of used output sample bits for dithering. Must be an integer in the
  19934. interval [0,64], default value is 0, which means it&rsquo;s not used.
  19935. </p>
  19936. </dd>
  19937. </dl>
  19938. <p><a name="scaler_005foptions"></a>
  19939. </p><a name="Scaler-Options"></a>
  19940. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Scaler-Options">29 Scaler Options</a></h1>
  19941. <p>The video scaler supports the following named options.
  19942. </p>
  19943. <p>Options may be set by specifying -<var>option</var> <var>value</var> in the
  19944. FFmpeg tools, with a few API-only exceptions noted below.
  19945. For programmatic use, they can be set explicitly in the
  19946. <code>SwsContext</code> options or through the &lsquo;<tt>libavutil/opt.h</tt>&rsquo; API.
  19947. </p>
  19948. <dl compact="compact">
  19949. <dd>
  19950. <p><a name="sws_005fflags"></a>
  19951. </p></dd>
  19952. <dt>&lsquo;<samp>sws_flags</samp>&rsquo;</dt>
  19953. <dd><p>Set the scaler flags. This is also used to set the scaling
  19954. algorithm. Only a single algorithm should be selected. Default
  19955. value is &lsquo;<samp>bicubic</samp>&rsquo;.
  19956. </p>
  19957. <p>It accepts the following values:
  19958. </p><dl compact="compact">
  19959. <dt>&lsquo;<samp>fast_bilinear</samp>&rsquo;</dt>
  19960. <dd><p>Select fast bilinear scaling algorithm.
  19961. </p>
  19962. </dd>
  19963. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  19964. <dd><p>Select bilinear scaling algorithm.
  19965. </p>
  19966. </dd>
  19967. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  19968. <dd><p>Select bicubic scaling algorithm.
  19969. </p>
  19970. </dd>
  19971. <dt>&lsquo;<samp>experimental</samp>&rsquo;</dt>
  19972. <dd><p>Select experimental scaling algorithm.
  19973. </p>
  19974. </dd>
  19975. <dt>&lsquo;<samp>neighbor</samp>&rsquo;</dt>
  19976. <dd><p>Select nearest neighbor rescaling algorithm.
  19977. </p>
  19978. </dd>
  19979. <dt>&lsquo;<samp>area</samp>&rsquo;</dt>
  19980. <dd><p>Select averaging area rescaling algorithm.
  19981. </p>
  19982. </dd>
  19983. <dt>&lsquo;<samp>bicublin</samp>&rsquo;</dt>
  19984. <dd><p>Select bicubic scaling algorithm for the luma component, bilinear for
  19985. chroma components.
  19986. </p>
  19987. </dd>
  19988. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  19989. <dd><p>Select Gaussian rescaling algorithm.
  19990. </p>
  19991. </dd>
  19992. <dt>&lsquo;<samp>sinc</samp>&rsquo;</dt>
  19993. <dd><p>Select sinc rescaling algorithm.
  19994. </p>
  19995. </dd>
  19996. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  19997. <dd><p>Select Lanczos rescaling algorithm. The default width (alpha) is 3 and can be
  19998. changed by setting <code>param0</code>.
  19999. </p>
  20000. </dd>
  20001. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  20002. <dd><p>Select natural bicubic spline rescaling algorithm.
  20003. </p>
  20004. </dd>
  20005. <dt>&lsquo;<samp>print_info</samp>&rsquo;</dt>
  20006. <dd><p>Enable printing/debug logging.
  20007. </p>
  20008. </dd>
  20009. <dt>&lsquo;<samp>accurate_rnd</samp>&rsquo;</dt>
  20010. <dd><p>Enable accurate rounding.
  20011. </p>
  20012. </dd>
  20013. <dt>&lsquo;<samp>full_chroma_int</samp>&rsquo;</dt>
  20014. <dd><p>Enable full chroma interpolation.
  20015. </p>
  20016. </dd>
  20017. <dt>&lsquo;<samp>full_chroma_inp</samp>&rsquo;</dt>
  20018. <dd><p>Select full chroma input.
  20019. </p>
  20020. </dd>
  20021. <dt>&lsquo;<samp>bitexact</samp>&rsquo;</dt>
  20022. <dd><p>Enable bitexact output.
  20023. </p></dd>
  20024. </dl>
  20025. </dd>
  20026. <dt>&lsquo;<samp>srcw <var>(API only)</var></samp>&rsquo;</dt>
  20027. <dd><p>Set source width.
  20028. </p>
  20029. </dd>
  20030. <dt>&lsquo;<samp>srch <var>(API only)</var></samp>&rsquo;</dt>
  20031. <dd><p>Set source height.
  20032. </p>
  20033. </dd>
  20034. <dt>&lsquo;<samp>dstw <var>(API only)</var></samp>&rsquo;</dt>
  20035. <dd><p>Set destination width.
  20036. </p>
  20037. </dd>
  20038. <dt>&lsquo;<samp>dsth <var>(API only)</var></samp>&rsquo;</dt>
  20039. <dd><p>Set destination height.
  20040. </p>
  20041. </dd>
  20042. <dt>&lsquo;<samp>src_format <var>(API only)</var></samp>&rsquo;</dt>
  20043. <dd><p>Set source pixel format (must be expressed as an integer).
  20044. </p>
  20045. </dd>
  20046. <dt>&lsquo;<samp>dst_format <var>(API only)</var></samp>&rsquo;</dt>
  20047. <dd><p>Set destination pixel format (must be expressed as an integer).
  20048. </p>
  20049. </dd>
  20050. <dt>&lsquo;<samp>src_range <var>(boolean)</var></samp>&rsquo;</dt>
  20051. <dd><p>If value is set to <code>1</code>, indicates source is full range. Default value is
  20052. <code>0</code>, which indicates source is limited range.
  20053. </p>
  20054. </dd>
  20055. <dt>&lsquo;<samp>dst_range <var>(boolean)</var></samp>&rsquo;</dt>
  20056. <dd><p>If value is set to <code>1</code>, enable full range for destination. Default value
  20057. is <code>0</code>, which enables limited range.
  20058. </p>
  20059. <p><a name="sws_005fparams"></a>
  20060. </p></dd>
  20061. <dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
  20062. <dd><p>Set scaling algorithm parameters. The specified values are specific of
  20063. some scaling algorithms and ignored by others. The specified values
  20064. are floating point number values.
  20065. </p>
  20066. </dd>
  20067. <dt>&lsquo;<samp>sws_dither</samp>&rsquo;</dt>
  20068. <dd><p>Set the dithering algorithm. Accepts one of the following
  20069. values. Default value is &lsquo;<samp>auto</samp>&rsquo;.
  20070. </p>
  20071. <dl compact="compact">
  20072. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20073. <dd><p>automatic choice
  20074. </p>
  20075. </dd>
  20076. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20077. <dd><p>no dithering
  20078. </p>
  20079. </dd>
  20080. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  20081. <dd><p>bayer dither
  20082. </p>
  20083. </dd>
  20084. <dt>&lsquo;<samp>ed</samp>&rsquo;</dt>
  20085. <dd><p>error diffusion dither
  20086. </p>
  20087. </dd>
  20088. <dt>&lsquo;<samp>a_dither</samp>&rsquo;</dt>
  20089. <dd><p>arithmetic dither, based using addition
  20090. </p>
  20091. </dd>
  20092. <dt>&lsquo;<samp>x_dither</samp>&rsquo;</dt>
  20093. <dd><p>arithmetic dither, based using xor (more random/less apparent patterning that
  20094. a_dither).
  20095. </p>
  20096. </dd>
  20097. </dl>
  20098. </dd>
  20099. <dt>&lsquo;<samp>alphablend</samp>&rsquo;</dt>
  20100. <dd><p>Set the alpha blending to use when the input has alpha but the output does not.
  20101. Default value is &lsquo;<samp>none</samp>&rsquo;.
  20102. </p>
  20103. <dl compact="compact">
  20104. <dt>&lsquo;<samp>uniform_color</samp>&rsquo;</dt>
  20105. <dd><p>Blend onto a uniform background color
  20106. </p>
  20107. </dd>
  20108. <dt>&lsquo;<samp>checkerboard</samp>&rsquo;</dt>
  20109. <dd><p>Blend onto a checkerboard
  20110. </p>
  20111. </dd>
  20112. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  20113. <dd><p>No blending
  20114. </p>
  20115. </dd>
  20116. </dl>
  20117. </dd>
  20118. </dl>
  20119. <a name="Filtering-Introduction"></a>
  20120. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtering-Introduction">30 Filtering Introduction</a></h1>
  20121. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  20122. </p>
  20123. <p>In libavfilter, a filter can have multiple inputs and multiple
  20124. outputs.
  20125. To illustrate the sorts of things that are possible, we consider the
  20126. following filtergraph.
  20127. </p>
  20128. <pre class="verbatim"> [main]
  20129. input --&gt; split ---------------------&gt; overlay --&gt; output
  20130. | ^
  20131. |[tmp] [flip]|
  20132. +-----&gt; crop --&gt; vflip -------+
  20133. </pre>
  20134. <p>This filtergraph splits the input stream in two streams, then sends one
  20135. stream through the crop filter and the vflip filter, before merging it
  20136. back with the other stream by overlaying it on top. You can use the
  20137. following command to achieve this:
  20138. </p>
  20139. <div class="example">
  20140. <pre class="example">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
  20141. </pre></div>
  20142. <p>The result will be that the top half of the video is mirrored
  20143. onto the bottom half of the output video.
  20144. </p>
  20145. <p>Filters in the same linear chain are separated by commas, and distinct
  20146. linear chains of filters are separated by semicolons. In our example,
  20147. <var>crop,vflip</var> are in one linear chain, <var>split</var> and
  20148. <var>overlay</var> are separately in another. The points where the linear
  20149. chains join are labelled by names enclosed in square brackets. In the
  20150. example, the split filter generates two outputs that are associated to
  20151. the labels <var>[main]</var> and <var>[tmp]</var>.
  20152. </p>
  20153. <p>The stream sent to the second output of <var>split</var>, labelled as
  20154. <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
  20155. away the lower half part of the video, and then vertically flipped. The
  20156. <var>overlay</var> filter takes in input the first unchanged output of the
  20157. split filter (which was labelled as <var>[main]</var>), and overlay on its
  20158. lower half the output generated by the <var>crop,vflip</var> filterchain.
  20159. </p>
  20160. <p>Some filters take in input a list of parameters: they are specified
  20161. after the filter name and an equal sign, and are separated from each other
  20162. by a colon.
  20163. </p>
  20164. <p>There exist so-called <var>source filters</var> that do not have an
  20165. audio/video input, and <var>sink filters</var> that will not have audio/video
  20166. output.
  20167. </p>
  20168. <a name="graph2dot"></a>
  20169. <h1 class="chapter"><a href="ffmpeg-all.html#toc-graph2dot">31 graph2dot</a></h1>
  20170. <p>The &lsquo;<tt>graph2dot</tt>&rsquo; program included in the FFmpeg &lsquo;<tt>tools</tt>&rsquo;
  20171. directory can be used to parse a filtergraph description and issue a
  20172. corresponding textual representation in the dot language.
  20173. </p>
  20174. <p>Invoke the command:
  20175. </p><div class="example">
  20176. <pre class="example">graph2dot -h
  20177. </pre></div>
  20178. <p>to see how to use &lsquo;<tt>graph2dot</tt>&rsquo;.
  20179. </p>
  20180. <p>You can then pass the dot description to the &lsquo;<tt>dot</tt>&rsquo; program (from
  20181. the graphviz suite of programs) and obtain a graphical representation
  20182. of the filtergraph.
  20183. </p>
  20184. <p>For example the sequence of commands:
  20185. </p><div class="example">
  20186. <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
  20187. tools/graph2dot -o graph.tmp &amp;&amp; \
  20188. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  20189. display graph.png
  20190. </pre></div>
  20191. <p>can be used to create and display an image representing the graph
  20192. described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
  20193. a complete self-contained graph, with its inputs and outputs explicitly defined.
  20194. For example if your command line is of the form:
  20195. </p><div class="example">
  20196. <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
  20197. </pre></div>
  20198. <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
  20199. </p><div class="example">
  20200. <pre class="example">nullsrc,scale=640:360,nullsink
  20201. </pre></div>
  20202. <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
  20203. filter in order to simulate a specific input file.
  20204. </p>
  20205. <a name="Filtergraph-description"></a>
  20206. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Filtergraph-description">32 Filtergraph description</a></h1>
  20207. <p>A filtergraph is a directed graph of connected filters. It can contain
  20208. cycles, and there can be multiple links between a pair of
  20209. filters. Each link has one input pad on one side connecting it to one
  20210. filter from which it takes its input, and one output pad on the other
  20211. side connecting it to one filter accepting its output.
  20212. </p>
  20213. <p>Each filter in a filtergraph is an instance of a filter class
  20214. registered in the application, which defines the features and the
  20215. number of input and output pads of the filter.
  20216. </p>
  20217. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  20218. output pads is called a &quot;sink&quot;.
  20219. </p>
  20220. <p><a name="Filtergraph-syntax"></a>
  20221. </p><a name="Filtergraph-syntax-1"></a>
  20222. <h2 class="section"><a href="ffmpeg-all.html#toc-Filtergraph-syntax-1">32.1 Filtergraph syntax</a></h2>
  20223. <p>A filtergraph has a textual representation, which is recognized by the
  20224. &lsquo;<samp>-filter</samp>&rsquo;/&lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; and
  20225. &lsquo;<samp>-filter_complex</samp>&rsquo; options in <code>ffmpeg</code> and
  20226. &lsquo;<samp>-vf</samp>&rsquo;/&lsquo;<samp>-af</samp>&rsquo; in <code>ffplay</code>, and by the
  20227. <code>avfilter_graph_parse_ptr()</code> function defined in
  20228. &lsquo;<tt>libavfilter/avfilter.h</tt>&rsquo;.
  20229. </p>
  20230. <p>A filterchain consists of a sequence of connected filters, each one
  20231. connected to the previous one in the sequence. A filterchain is
  20232. represented by a list of &quot;,&quot;-separated filter descriptions.
  20233. </p>
  20234. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  20235. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  20236. descriptions.
  20237. </p>
  20238. <p>A filter is represented by a string of the form:
  20239. [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>@<var>id</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
  20240. </p>
  20241. <p><var>filter_name</var> is the name of the filter class of which the
  20242. described filter is an instance of, and has to be the name of one of
  20243. the filter classes registered in the program optionally followed by &quot;@<var>id</var>&quot;.
  20244. The name of the filter class is optionally followed by a string
  20245. &quot;=<var>arguments</var>&quot;.
  20246. </p>
  20247. <p><var>arguments</var> is a string which contains the parameters used to
  20248. initialize the filter instance. It may have one of two forms:
  20249. </p><ul>
  20250. <li>
  20251. A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
  20252. </li><li>
  20253. A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
  20254. the option names in the order they are declared. E.g. the <code>fade</code> filter
  20255. declares three options in this order &ndash; &lsquo;<samp>type</samp>&rsquo;, &lsquo;<samp>start_frame</samp>&rsquo; and
  20256. &lsquo;<samp>nb_frames</samp>&rsquo;. Then the parameter list <var>in:0:30</var> means that the value
  20257. <var>in</var> is assigned to the option &lsquo;<samp>type</samp>&rsquo;, <var>0</var> to
  20258. &lsquo;<samp>start_frame</samp>&rsquo; and <var>30</var> to &lsquo;<samp>nb_frames</samp>&rsquo;.
  20259. </li><li>
  20260. A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
  20261. pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
  20262. follow the same constraints order of the previous point. The following
  20263. <var>key=value</var> pairs can be set in any preferred order.
  20264. </li></ul>
  20265. <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
  20266. takes a list of pixel formats), the items in the list are usually separated by
  20267. &lsquo;<samp>|</samp>&rsquo;.
  20268. </p>
  20269. <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
  20270. and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
  20271. within the quoted text; otherwise the argument string is considered
  20272. terminated when the next special character (belonging to the set
  20273. &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
  20274. </p>
  20275. <p>The name and arguments of the filter are optionally preceded and
  20276. followed by a list of link labels.
  20277. A link label allows one to name a link and associate it to a filter output
  20278. or input pad. The preceding labels <var>in_link_1</var>
  20279. ... <var>in_link_N</var>, are associated to the filter input pads,
  20280. the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
  20281. associated to the output pads.
  20282. </p>
  20283. <p>When two link labels with the same name are found in the
  20284. filtergraph, a link between the corresponding input and output pad is
  20285. created.
  20286. </p>
  20287. <p>If an output pad is not labelled, it is linked by default to the first
  20288. unlabelled input pad of the next filter in the filterchain.
  20289. For example in the filterchain
  20290. </p><div class="example">
  20291. <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
  20292. </pre></div>
  20293. <p>the split filter instance has two output pads, and the overlay filter
  20294. instance two input pads. The first output pad of split is labelled
  20295. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  20296. output pad of split is linked to the second input pad of overlay,
  20297. which are both unlabelled.
  20298. </p>
  20299. <p>In a filter description, if the input label of the first filter is not
  20300. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  20301. specified, &quot;out&quot; is assumed.
  20302. </p>
  20303. <p>In a complete filterchain all the unlabelled filter input and output
  20304. pads must be connected. A filtergraph is considered valid if all the
  20305. filter input and output pads of all the filterchains are connected.
  20306. </p>
  20307. <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
  20308. conversion is required. It is possible to specify swscale flags
  20309. for those automatically inserted scalers by prepending
  20310. <code>sws_flags=<var>flags</var>;</code>
  20311. to the filtergraph description.
  20312. </p>
  20313. <p>Here is a BNF description of the filtergraph syntax:
  20314. </p><div class="example">
  20315. <pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
  20316. <var>FILTER_NAME</var> ::= <var>NAME</var>[&quot;@&quot;<var>NAME</var>]
  20317. <var>LINKLABEL</var> ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
  20318. <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
  20319. <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  20320. <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>FILTER_NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
  20321. <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
  20322. <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
  20323. </pre></div>
  20324. <p><a name="filtergraph-escaping"></a>
  20325. </p><a name="Notes-on-filtergraph-escaping"></a>
  20326. <h2 class="section"><a href="ffmpeg-all.html#toc-Notes-on-filtergraph-escaping">32.2 Notes on filtergraph escaping</a></h2>
  20327. <p>Filtergraph description composition entails several levels of
  20328. escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot; section in the ffmpeg-utils(1) manual</a> for more
  20329. information about the employed escaping procedure.
  20330. </p>
  20331. <p>A first level escaping affects the content of each filter option
  20332. value, which may contain the special character <code>:</code> used to
  20333. separate values, or one of the escaping characters <code>\'</code>.
  20334. </p>
  20335. <p>A second level escaping affects the whole filter description, which
  20336. may contain the escaping characters <code>\'</code> or the special
  20337. characters <code>[],;</code> used by the filtergraph description.
  20338. </p>
  20339. <p>Finally, when you specify a filtergraph on a shell commandline, you
  20340. need to perform a third level escaping for the shell special
  20341. characters contained within it.
  20342. </p>
  20343. <p>For example, consider the following string to be embedded in
  20344. the <a href="#drawtext">drawtext</a> filter description &lsquo;<samp>text</samp>&rsquo; value:
  20345. </p><div class="example">
  20346. <pre class="example">this is a 'string': may contain one, or more, special characters
  20347. </pre></div>
  20348. <p>This string contains the <code>'</code> special escaping character, and the
  20349. <code>:</code> special character, so it needs to be escaped in this way:
  20350. </p><div class="example">
  20351. <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
  20352. </pre></div>
  20353. <p>A second level of escaping is required when embedding the filter
  20354. description in a filtergraph description, in order to escape all the
  20355. filtergraph special characters. Thus the example above becomes:
  20356. </p><div class="example">
  20357. <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  20358. </pre></div>
  20359. <p>(note that in addition to the <code>\'</code> escaping special characters,
  20360. also <code>,</code> needs to be escaped).
  20361. </p>
  20362. <p>Finally an additional level of escaping is needed when writing the
  20363. filtergraph description in a shell command, which depends on the
  20364. escaping rules of the adopted shell. For example, assuming that
  20365. <code>\</code> is special and needs to be escaped with another <code>\</code>, the
  20366. previous string will finally result in:
  20367. </p><div class="example">
  20368. <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  20369. </pre></div>
  20370. <a name="Timeline-editing"></a>
  20371. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Timeline-editing">33 Timeline editing</a></h1>
  20372. <p>Some filters support a generic &lsquo;<samp>enable</samp>&rsquo; option. For the filters
  20373. supporting timeline editing, this option can be set to an expression which is
  20374. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  20375. the filter will be enabled, otherwise the frame will be sent unchanged to the
  20376. next filter in the filtergraph.
  20377. </p>
  20378. <p>The expression accepts the following values:
  20379. </p><dl compact="compact">
  20380. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20381. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  20382. </p>
  20383. </dd>
  20384. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20385. <dd><p>sequential number of the input frame, starting from 0
  20386. </p>
  20387. </dd>
  20388. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  20389. <dd><p>the position in the file of the input frame, NAN if unknown
  20390. </p>
  20391. </dd>
  20392. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20393. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  20394. <dd><p>width and height of the input frame if video
  20395. </p></dd>
  20396. </dl>
  20397. <p>Additionally, these filters support an &lsquo;<samp>enable</samp>&rsquo; command that can be used
  20398. to re-define the expression.
  20399. </p>
  20400. <p>Like any other filtering option, the &lsquo;<samp>enable</samp>&rsquo; option follows the same
  20401. rules.
  20402. </p>
  20403. <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
  20404. minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
  20405. </p><div class="example">
  20406. <pre class="example">smartblur = enable='between(t,10,3*60)',
  20407. curves = enable='gte(t,3)' : preset=cross_process
  20408. </pre></div>
  20409. <p>See <code>ffmpeg -filters</code> to view which filters have timeline support.
  20410. </p>
  20411. <p><a name="commands"></a>
  20412. </p><a name="Changing-options-at-runtime-with-a-command"></a>
  20413. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Changing-options-at-runtime-with-a-command">34 Changing options at runtime with a command</a></h1>
  20414. <p>Some options can be changed during the operation of the filter using
  20415. a command. These options are marked &rsquo;T&rsquo; on the output of
  20416. <code>ffmpeg</code> &lsquo;<samp>-h filter=&lt;name of filter&gt;</samp>&rsquo;.
  20417. The name of the command is the name of the option and the argument is
  20418. the new value.
  20419. </p>
  20420. <p><a name="framesync"></a>
  20421. </p><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  20422. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Options-for-filters-with-several-inputs-_0028framesync_0029">35 Options for filters with several inputs (framesync)</a></h1>
  20423. <p>Some filters with several inputs support a common set of options.
  20424. These options can only be set by name, not with the short notation.
  20425. </p>
  20426. <dl compact="compact">
  20427. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  20428. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  20429. one of the following values:
  20430. </p>
  20431. <dl compact="compact">
  20432. <dt>&lsquo;<samp>repeat</samp>&rsquo;</dt>
  20433. <dd><p>Repeat the last frame (the default).
  20434. </p></dd>
  20435. <dt>&lsquo;<samp>endall</samp>&rsquo;</dt>
  20436. <dd><p>End both streams.
  20437. </p></dd>
  20438. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  20439. <dd><p>Pass the main input through.
  20440. </p></dd>
  20441. </dl>
  20442. </dd>
  20443. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  20444. <dd><p>If set to 1, force the output to terminate when the shortest input
  20445. terminates. Default value is 0.
  20446. </p>
  20447. </dd>
  20448. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  20449. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  20450. until the end of the primary stream. A value of 0 disables this behavior.
  20451. Default value is 1.
  20452. </p></dd>
  20453. </dl>
  20454. <a name="Audio-Filters"></a>
  20455. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Filters">36 Audio Filters</a></h1>
  20456. <p>When you configure your FFmpeg build, you can disable any of the
  20457. existing filters using <code>--disable-filters</code>.
  20458. The configure output will show the audio filters included in your
  20459. build.
  20460. </p>
  20461. <p>Below is a description of the currently available audio filters.
  20462. </p>
  20463. <a name="acompressor"></a>
  20464. <h2 class="section"><a href="ffmpeg-all.html#toc-acompressor">36.1 acompressor</a></h2>
  20465. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  20466. Especially modern music is mostly compressed at a high ratio to
  20467. improve the overall loudness. It&rsquo;s done to get the highest attention
  20468. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  20469. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  20470. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  20471. but can also destroy a track completely).
  20472. The right compression is the key to reach a professional sound and is
  20473. the high art of mixing and mastering. Because of its complex settings
  20474. it may take a long time to get the right feeling for this kind of effect.
  20475. </p>
  20476. <p>Compression is done by detecting the volume above a chosen level
  20477. <code>threshold</code> and dividing it by the factor set with <code>ratio</code>.
  20478. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  20479. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  20480. the signal would cause distortion of the waveform the reduction can be
  20481. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  20482. <code>attack</code> determines how long the signal has to rise above the threshold
  20483. before any reduction will occur and <code>release</code> sets the time the signal
  20484. has to fall below the threshold to reduce the reduction again. Shorter signals
  20485. than the chosen attack time will be left untouched.
  20486. The overall reduction of the signal can be made up afterwards with the
  20487. <code>makeup</code> setting. So compressing the peaks of a signal about 6dB and
  20488. raising the makeup to this level results in a signal twice as loud than the
  20489. source. To gain a softer entry in the compression the <code>knee</code> flattens the
  20490. hard edge at the threshold in the range of the chosen decibels.
  20491. </p>
  20492. <p>The filter accepts the following options:
  20493. </p>
  20494. <dl compact="compact">
  20495. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  20496. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  20497. </p>
  20498. </dd>
  20499. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20500. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  20501. Default is <code>downward</code>.
  20502. </p>
  20503. </dd>
  20504. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  20505. <dd><p>If a signal of stream rises above this level it will affect the gain
  20506. reduction.
  20507. By default it is 0.125. Range is between 0.00097563 and 1.
  20508. </p>
  20509. </dd>
  20510. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  20511. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  20512. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  20513. Default is 2. Range is between 1 and 20.
  20514. </p>
  20515. </dd>
  20516. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  20517. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  20518. reduction starts. Default is 20. Range is between 0.01 and 2000.
  20519. </p>
  20520. </dd>
  20521. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  20522. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  20523. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  20524. </p>
  20525. </dd>
  20526. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  20527. <dd><p>Set the amount by how much signal will be amplified after processing.
  20528. Default is 1. Range is from 1 to 64.
  20529. </p>
  20530. </dd>
  20531. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  20532. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  20533. Default is 2.82843. Range is between 1 and 8.
  20534. </p>
  20535. </dd>
  20536. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  20537. <dd><p>Choose if the <code>average</code> level between all channels of input stream
  20538. or the louder(<code>maximum</code>) channel of input stream affects the
  20539. reduction. Default is <code>average</code>.
  20540. </p>
  20541. </dd>
  20542. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  20543. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  20544. of <code>rms</code>. Default is <code>rms</code> which is mostly smoother.
  20545. </p>
  20546. </dd>
  20547. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  20548. <dd><p>How much to use compressed signal in output. Default is 1.
  20549. Range is between 0 and 1.
  20550. </p></dd>
  20551. </dl>
  20552. <a name="Commands-49"></a>
  20553. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-49">36.1.1 Commands</a></h3>
  20554. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  20555. </p>
  20556. <a name="acontrast"></a>
  20557. <h2 class="section"><a href="ffmpeg-all.html#toc-acontrast">36.2 acontrast</a></h2>
  20558. <p>Simple audio dynamic range compression/expansion filter.
  20559. </p>
  20560. <p>The filter accepts the following options:
  20561. </p>
  20562. <dl compact="compact">
  20563. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  20564. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  20565. </p></dd>
  20566. </dl>
  20567. <a name="acopy"></a>
  20568. <h2 class="section"><a href="ffmpeg-all.html#toc-acopy">36.3 acopy</a></h2>
  20569. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  20570. testing purposes.
  20571. </p>
  20572. <a name="acrossfade"></a>
  20573. <h2 class="section"><a href="ffmpeg-all.html#toc-acrossfade">36.4 acrossfade</a></h2>
  20574. <p>Apply cross fade from one input audio stream to another input audio stream.
  20575. The cross fade is applied for specified duration near the end of first stream.
  20576. </p>
  20577. <p>The filter accepts the following options:
  20578. </p>
  20579. <dl compact="compact">
  20580. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  20581. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  20582. At the end of the cross fade effect the first input audio will be completely
  20583. silent. Default is 44100.
  20584. </p>
  20585. </dd>
  20586. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  20587. <dd><p>Specify the duration of the cross fade effect. See
  20588. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  20589. for the accepted syntax.
  20590. By default the duration is determined by <var>nb_samples</var>.
  20591. If set this option is used instead of <var>nb_samples</var>.
  20592. </p>
  20593. </dd>
  20594. <dt>&lsquo;<samp>overlap, o</samp>&rsquo;</dt>
  20595. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  20596. </p>
  20597. </dd>
  20598. <dt>&lsquo;<samp>curve1</samp>&rsquo;</dt>
  20599. <dd><p>Set curve for cross fade transition for first stream.
  20600. </p>
  20601. </dd>
  20602. <dt>&lsquo;<samp>curve2</samp>&rsquo;</dt>
  20603. <dd><p>Set curve for cross fade transition for second stream.
  20604. </p>
  20605. <p>For description of available curve types see <a href="#afade">afade</a> filter description.
  20606. </p></dd>
  20607. </dl>
  20608. <a name="Examples-50"></a>
  20609. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-50">36.4.1 Examples</a></h3>
  20610. <ul>
  20611. <li>
  20612. Cross fade from one input to another:
  20613. <div class="example">
  20614. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  20615. </pre></div>
  20616. </li><li>
  20617. Cross fade from one input to another but without overlapping:
  20618. <div class="example">
  20619. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  20620. </pre></div>
  20621. </li></ul>
  20622. <a name="acrossover"></a>
  20623. <h2 class="section"><a href="ffmpeg-all.html#toc-acrossover">36.5 acrossover</a></h2>
  20624. <p>Split audio stream into several bands.
  20625. </p>
  20626. <p>This filter splits audio stream into two or more frequency ranges.
  20627. Summing all streams back will give flat output.
  20628. </p>
  20629. <p>The filter accepts the following options:
  20630. </p>
  20631. <dl compact="compact">
  20632. <dt>&lsquo;<samp>split</samp>&rsquo;</dt>
  20633. <dd><p>Set split frequencies. Those must be positive and increasing.
  20634. </p>
  20635. </dd>
  20636. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  20637. <dd><p>Set filter order, can be <var>2nd</var>, <var>4th</var> or <var>8th</var>.
  20638. Default is <var>4th</var>.
  20639. </p></dd>
  20640. </dl>
  20641. <a name="acrusher"></a>
  20642. <h2 class="section"><a href="ffmpeg-all.html#toc-acrusher">36.6 acrusher</a></h2>
  20643. <p>Reduce audio bit resolution.
  20644. </p>
  20645. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  20646. is used to audibly reduce number of bits an audio signal is sampled
  20647. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  20648. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  20649. This filter is able to even round to continuous values instead of discrete
  20650. bit depths.
  20651. Additionally it has a D/C offset which results in different crushing of
  20652. the lower and the upper half of the signal.
  20653. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  20654. </p>
  20655. <p>Another feature of this filter is the logarithmic mode.
  20656. This setting switches from linear distances between bits to logarithmic ones.
  20657. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  20658. signals for example. The human ear has a logarithmic perception,
  20659. so this kind of crushing is much more pleasant.
  20660. Logarithmic crushing is also able to get anti-aliased.
  20661. </p>
  20662. <p>The filter accepts the following options:
  20663. </p>
  20664. <dl compact="compact">
  20665. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  20666. <dd><p>Set level in.
  20667. </p>
  20668. </dd>
  20669. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  20670. <dd><p>Set level out.
  20671. </p>
  20672. </dd>
  20673. <dt>&lsquo;<samp>bits</samp>&rsquo;</dt>
  20674. <dd><p>Set bit reduction.
  20675. </p>
  20676. </dd>
  20677. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  20678. <dd><p>Set mixing amount.
  20679. </p>
  20680. </dd>
  20681. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20682. <dd><p>Can be linear: <code>lin</code> or logarithmic: <code>log</code>.
  20683. </p>
  20684. </dd>
  20685. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  20686. <dd><p>Set DC.
  20687. </p>
  20688. </dd>
  20689. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  20690. <dd><p>Set anti-aliasing.
  20691. </p>
  20692. </dd>
  20693. <dt>&lsquo;<samp>samples</samp>&rsquo;</dt>
  20694. <dd><p>Set sample reduction.
  20695. </p>
  20696. </dd>
  20697. <dt>&lsquo;<samp>lfo</samp>&rsquo;</dt>
  20698. <dd><p>Enable LFO. By default disabled.
  20699. </p>
  20700. </dd>
  20701. <dt>&lsquo;<samp>lforange</samp>&rsquo;</dt>
  20702. <dd><p>Set LFO range.
  20703. </p>
  20704. </dd>
  20705. <dt>&lsquo;<samp>lforate</samp>&rsquo;</dt>
  20706. <dd><p>Set LFO rate.
  20707. </p></dd>
  20708. </dl>
  20709. <a name="acue"></a>
  20710. <h2 class="section"><a href="ffmpeg-all.html#toc-acue">36.7 acue</a></h2>
  20711. <p>Delay audio filtering until a given wallclock timestamp. See the <a href="#cue">cue</a>
  20712. filter.
  20713. </p>
  20714. <a name="adeclick"></a>
  20715. <h2 class="section"><a href="ffmpeg-all.html#toc-adeclick">36.8 adeclick</a></h2>
  20716. <p>Remove impulsive noise from input audio.
  20717. </p>
  20718. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  20719. autoregressive modelling.
  20720. </p>
  20721. <dl compact="compact">
  20722. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20723. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to
  20724. <code>100</code>. Default value is <code>55</code> milliseconds.
  20725. This sets size of window which will be processed at once.
  20726. </p>
  20727. </dd>
  20728. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  20729. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  20730. <code>50</code> to <code>95</code>. Default value is <code>75</code> percent.
  20731. Setting this to a very high value increases impulsive noise removal but makes
  20732. whole process much slower.
  20733. </p>
  20734. </dd>
  20735. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20736. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  20737. <code>0</code> to <code>25</code>. Default value is <code>2</code> percent. This option also
  20738. controls quality of interpolated samples using neighbour good samples.
  20739. </p>
  20740. </dd>
  20741. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20742. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  20743. Default value is <code>2</code>.
  20744. This controls the strength of impulsive noise which is going to be removed.
  20745. The lower value, the more samples will be detected as impulsive noise.
  20746. </p>
  20747. </dd>
  20748. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  20749. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code>0</code> to
  20750. <code>10</code>. Default value is <code>2</code>.
  20751. If any two samples detected as noise are spaced less than this value then any
  20752. sample between those two samples will be also detected as noise.
  20753. </p>
  20754. </dd>
  20755. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  20756. <dd><p>Set overlap method.
  20757. </p>
  20758. <p>It accepts the following values:
  20759. </p><dl compact="compact">
  20760. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20761. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  20762. changed with this method.
  20763. </p>
  20764. </dd>
  20765. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  20766. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  20767. </p></dd>
  20768. </dl>
  20769. <p>Default value is <code>a</code>.
  20770. </p></dd>
  20771. </dl>
  20772. <a name="adeclip"></a>
  20773. <h2 class="section"><a href="ffmpeg-all.html#toc-adeclip">36.9 adeclip</a></h2>
  20774. <p>Remove clipped samples from input audio.
  20775. </p>
  20776. <p>Samples detected as clipped are replaced by interpolated samples using
  20777. autoregressive modelling.
  20778. </p>
  20779. <dl compact="compact">
  20780. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  20781. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to <code>100</code>.
  20782. Default value is <code>55</code> milliseconds.
  20783. This sets size of window which will be processed at once.
  20784. </p>
  20785. </dd>
  20786. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  20787. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code>50</code>
  20788. to <code>95</code>. Default value is <code>75</code> percent.
  20789. </p>
  20790. </dd>
  20791. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20792. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  20793. <code>0</code> to <code>25</code>. Default value is <code>8</code> percent. This option also controls
  20794. quality of interpolated samples using neighbour good samples.
  20795. </p>
  20796. </dd>
  20797. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  20798. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  20799. Default value is <code>10</code>. Higher values make clip detection less aggressive.
  20800. </p>
  20801. </dd>
  20802. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  20803. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code>100</code> to <code>9999</code>.
  20804. Default value is <code>1000</code>. Higher values make clip detection less aggressive.
  20805. </p>
  20806. </dd>
  20807. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  20808. <dd><p>Set overlap method.
  20809. </p>
  20810. <p>It accepts the following values:
  20811. </p><dl compact="compact">
  20812. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  20813. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  20814. with this method.
  20815. </p>
  20816. </dd>
  20817. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  20818. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  20819. </p></dd>
  20820. </dl>
  20821. <p>Default value is <code>a</code>.
  20822. </p></dd>
  20823. </dl>
  20824. <a name="adelay"></a>
  20825. <h2 class="section"><a href="ffmpeg-all.html#toc-adelay">36.10 adelay</a></h2>
  20826. <p>Delay one or more audio channels.
  20827. </p>
  20828. <p>Samples in delayed channel are filled with silence.
  20829. </p>
  20830. <p>The filter accepts the following option:
  20831. </p>
  20832. <dl compact="compact">
  20833. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  20834. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  20835. Unused delays will be silently ignored. If number of given delays is
  20836. smaller than number of channels all remaining channels will not be delayed.
  20837. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  20838. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  20839. </p>
  20840. </dd>
  20841. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  20842. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  20843. This option if enabled changes how option <code>delays</code> is interpreted.
  20844. </p></dd>
  20845. </dl>
  20846. <a name="Examples-168"></a>
  20847. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-168">36.10.1 Examples</a></h3>
  20848. <ul>
  20849. <li>
  20850. Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  20851. the second channel (and any other channels that may be present) unchanged.
  20852. <div class="example">
  20853. <pre class="example">adelay=1500|0|500
  20854. </pre></div>
  20855. </li><li>
  20856. Delay second channel by 500 samples, the third channel by 700 samples and leave
  20857. the first channel (and any other channels that may be present) unchanged.
  20858. <div class="example">
  20859. <pre class="example">adelay=0|500S|700S
  20860. </pre></div>
  20861. </li><li>
  20862. Delay all channels by same number of samples:
  20863. <div class="example">
  20864. <pre class="example">adelay=delays=64S:all=1
  20865. </pre></div>
  20866. </li></ul>
  20867. <a name="aderivative_002c-aintegral"></a>
  20868. <h2 class="section"><a href="ffmpeg-all.html#toc-aderivative_002c-aintegral">36.11 aderivative, aintegral</a></h2>
  20869. <p>Compute derivative/integral of audio stream.
  20870. </p>
  20871. <p>Applying both filters one after another produces original audio.
  20872. </p>
  20873. <a name="aecho"></a>
  20874. <h2 class="section"><a href="ffmpeg-all.html#toc-aecho">36.12 aecho</a></h2>
  20875. <p>Apply echoing to the input audio.
  20876. </p>
  20877. <p>Echoes are reflected sound and can occur naturally amongst mountains
  20878. (and sometimes large buildings) when talking or shouting; digital echo
  20879. effects emulate this behaviour and are often used to help fill out the
  20880. sound of a single instrument or vocal. The time difference between the
  20881. original signal and the reflection is the <code>delay</code>, and the
  20882. loudness of the reflected signal is the <code>decay</code>.
  20883. Multiple echoes can have different delays and decays.
  20884. </p>
  20885. <p>A description of the accepted parameters follows.
  20886. </p>
  20887. <dl compact="compact">
  20888. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  20889. <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
  20890. </p>
  20891. </dd>
  20892. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  20893. <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
  20894. </p>
  20895. </dd>
  20896. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  20897. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  20898. separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
  20899. Default is <code>1000</code>.
  20900. </p>
  20901. </dd>
  20902. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  20903. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  20904. Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
  20905. Default is <code>0.5</code>.
  20906. </p></dd>
  20907. </dl>
  20908. <a name="Examples-86"></a>
  20909. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-86">36.12.1 Examples</a></h3>
  20910. <ul>
  20911. <li>
  20912. Make it sound as if there are twice as many instruments as are actually playing:
  20913. <div class="example">
  20914. <pre class="example">aecho=0.8:0.88:60:0.4
  20915. </pre></div>
  20916. </li><li>
  20917. If delay is very short, then it sounds like a (metallic) robot playing music:
  20918. <div class="example">
  20919. <pre class="example">aecho=0.8:0.88:6:0.4
  20920. </pre></div>
  20921. </li><li>
  20922. A longer delay will sound like an open air concert in the mountains:
  20923. <div class="example">
  20924. <pre class="example">aecho=0.8:0.9:1000:0.3
  20925. </pre></div>
  20926. </li><li>
  20927. Same as above but with one more mountain:
  20928. <div class="example">
  20929. <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
  20930. </pre></div>
  20931. </li></ul>
  20932. <a name="aemphasis"></a>
  20933. <h2 class="section"><a href="ffmpeg-all.html#toc-aemphasis">36.13 aemphasis</a></h2>
  20934. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  20935. emphased CDs with different filter curves. E.g. to store music on vinyl the
  20936. signal has to be altered by a filter first to even out the disadvantages of
  20937. this recording medium.
  20938. Once the material is played back the inverse filter has to be applied to
  20939. restore the distortion of the frequency response.
  20940. </p>
  20941. <p>The filter accepts the following options:
  20942. </p>
  20943. <dl compact="compact">
  20944. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  20945. <dd><p>Set input gain.
  20946. </p>
  20947. </dd>
  20948. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  20949. <dd><p>Set output gain.
  20950. </p>
  20951. </dd>
  20952. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  20953. <dd><p>Set filter mode. For restoring material use <code>reproduction</code> mode, otherwise
  20954. use <code>production</code> mode. Default is <code>reproduction</code> mode.
  20955. </p>
  20956. </dd>
  20957. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  20958. <dd><p>Set filter type. Selects medium. Can be one of the following:
  20959. </p>
  20960. <dl compact="compact">
  20961. <dt>&lsquo;<samp>col</samp>&rsquo;</dt>
  20962. <dd><p>select Columbia.
  20963. </p></dd>
  20964. <dt>&lsquo;<samp>emi</samp>&rsquo;</dt>
  20965. <dd><p>select EMI.
  20966. </p></dd>
  20967. <dt>&lsquo;<samp>bsi</samp>&rsquo;</dt>
  20968. <dd><p>select BSI (78RPM).
  20969. </p></dd>
  20970. <dt>&lsquo;<samp>riaa</samp>&rsquo;</dt>
  20971. <dd><p>select RIAA.
  20972. </p></dd>
  20973. <dt>&lsquo;<samp>cd</samp>&rsquo;</dt>
  20974. <dd><p>select Compact Disc (CD).
  20975. </p></dd>
  20976. <dt>&lsquo;<samp>50fm</samp>&rsquo;</dt>
  20977. <dd><p>select 50µs (FM).
  20978. </p></dd>
  20979. <dt>&lsquo;<samp>75fm</samp>&rsquo;</dt>
  20980. <dd><p>select 75µs (FM).
  20981. </p></dd>
  20982. <dt>&lsquo;<samp>50kf</samp>&rsquo;</dt>
  20983. <dd><p>select 50µs (FM-KF).
  20984. </p></dd>
  20985. <dt>&lsquo;<samp>75kf</samp>&rsquo;</dt>
  20986. <dd><p>select 75µs (FM-KF).
  20987. </p></dd>
  20988. </dl>
  20989. </dd>
  20990. </dl>
  20991. <a name="aeval"></a>
  20992. <h2 class="section"><a href="ffmpeg-all.html#toc-aeval">36.14 aeval</a></h2>
  20993. <p>Modify an audio signal according to the specified expressions.
  20994. </p>
  20995. <p>This filter accepts one or more expressions (one for each channel),
  20996. which are evaluated and used to modify a corresponding audio signal.
  20997. </p>
  20998. <p>It accepts the following parameters:
  20999. </p>
  21000. <dl compact="compact">
  21001. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  21002. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  21003. the number of input channels is greater than the number of
  21004. expressions, the last specified expression is used for the remaining
  21005. output channels.
  21006. </p>
  21007. </dd>
  21008. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  21009. <dd><p>Set output channel layout. If not specified, the channel layout is
  21010. specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
  21011. use by default the same input channel layout.
  21012. </p></dd>
  21013. </dl>
  21014. <p>Each expression in <var>exprs</var> can contain the following constants and functions:
  21015. </p>
  21016. <dl compact="compact">
  21017. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  21018. <dd><p>channel number of the current expression
  21019. </p>
  21020. </dd>
  21021. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21022. <dd><p>number of the evaluated sample, starting from 0
  21023. </p>
  21024. </dd>
  21025. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21026. <dd><p>sample rate
  21027. </p>
  21028. </dd>
  21029. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  21030. <dd><p>time of the evaluated sample expressed in seconds
  21031. </p>
  21032. </dd>
  21033. <dt>&lsquo;<samp>nb_in_channels</samp>&rsquo;</dt>
  21034. <dt>&lsquo;<samp>nb_out_channels</samp>&rsquo;</dt>
  21035. <dd><p>input and output number of channels
  21036. </p>
  21037. </dd>
  21038. <dt>&lsquo;<samp>val(CH)</samp>&rsquo;</dt>
  21039. <dd><p>the value of input channel with number <var>CH</var>
  21040. </p></dd>
  21041. </dl>
  21042. <p>Note: this filter is slow. For faster processing you should use a
  21043. dedicated filter.
  21044. </p>
  21045. <a name="Examples-90"></a>
  21046. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-90">36.14.1 Examples</a></h3>
  21047. <ul>
  21048. <li>
  21049. Half volume:
  21050. <div class="example">
  21051. <pre class="example">aeval=val(ch)/2:c=same
  21052. </pre></div>
  21053. </li><li>
  21054. Invert phase of the second channel:
  21055. <div class="example">
  21056. <pre class="example">aeval=val(0)|-val(1)
  21057. </pre></div>
  21058. </li></ul>
  21059. <p><a name="afade"></a>
  21060. </p><a name="afade-1"></a>
  21061. <h2 class="section"><a href="ffmpeg-all.html#toc-afade-1">36.15 afade</a></h2>
  21062. <p>Apply fade-in/out effect to input audio.
  21063. </p>
  21064. <p>A description of the accepted parameters follows.
  21065. </p>
  21066. <dl compact="compact">
  21067. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  21068. <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
  21069. <code>out</code> for a fade-out effect. Default is <code>in</code>.
  21070. </p>
  21071. </dd>
  21072. <dt>&lsquo;<samp>start_sample, ss</samp>&rsquo;</dt>
  21073. <dd><p>Specify the number of the start sample for starting to apply the fade
  21074. effect. Default is 0.
  21075. </p>
  21076. </dd>
  21077. <dt>&lsquo;<samp>nb_samples, ns</samp>&rsquo;</dt>
  21078. <dd><p>Specify the number of samples for which the fade effect has to last. At
  21079. the end of the fade-in effect the output audio will have the same
  21080. volume as the input audio, at the end of the fade-out transition
  21081. the output audio will be silence. Default is 44100.
  21082. </p>
  21083. </dd>
  21084. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  21085. <dd><p>Specify the start time of the fade effect. Default is 0.
  21086. The value must be specified as a time duration; see
  21087. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21088. for the accepted syntax.
  21089. If set this option is used instead of <var>start_sample</var>.
  21090. </p>
  21091. </dd>
  21092. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  21093. <dd><p>Specify the duration of the fade effect. See
  21094. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  21095. for the accepted syntax.
  21096. At the end of the fade-in effect the output audio will have the same
  21097. volume as the input audio, at the end of the fade-out transition
  21098. the output audio will be silence.
  21099. By default the duration is determined by <var>nb_samples</var>.
  21100. If set this option is used instead of <var>nb_samples</var>.
  21101. </p>
  21102. </dd>
  21103. <dt>&lsquo;<samp>curve</samp>&rsquo;</dt>
  21104. <dd><p>Set curve for fade transition.
  21105. </p>
  21106. <p>It accepts the following values:
  21107. </p><dl compact="compact">
  21108. <dt>&lsquo;<samp>tri</samp>&rsquo;</dt>
  21109. <dd><p>select triangular, linear slope (default)
  21110. </p></dd>
  21111. <dt>&lsquo;<samp>qsin</samp>&rsquo;</dt>
  21112. <dd><p>select quarter of sine wave
  21113. </p></dd>
  21114. <dt>&lsquo;<samp>hsin</samp>&rsquo;</dt>
  21115. <dd><p>select half of sine wave
  21116. </p></dd>
  21117. <dt>&lsquo;<samp>esin</samp>&rsquo;</dt>
  21118. <dd><p>select exponential sine wave
  21119. </p></dd>
  21120. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  21121. <dd><p>select logarithmic
  21122. </p></dd>
  21123. <dt>&lsquo;<samp>ipar</samp>&rsquo;</dt>
  21124. <dd><p>select inverted parabola
  21125. </p></dd>
  21126. <dt>&lsquo;<samp>qua</samp>&rsquo;</dt>
  21127. <dd><p>select quadratic
  21128. </p></dd>
  21129. <dt>&lsquo;<samp>cub</samp>&rsquo;</dt>
  21130. <dd><p>select cubic
  21131. </p></dd>
  21132. <dt>&lsquo;<samp>squ</samp>&rsquo;</dt>
  21133. <dd><p>select square root
  21134. </p></dd>
  21135. <dt>&lsquo;<samp>cbr</samp>&rsquo;</dt>
  21136. <dd><p>select cubic root
  21137. </p></dd>
  21138. <dt>&lsquo;<samp>par</samp>&rsquo;</dt>
  21139. <dd><p>select parabola
  21140. </p></dd>
  21141. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  21142. <dd><p>select exponential
  21143. </p></dd>
  21144. <dt>&lsquo;<samp>iqsin</samp>&rsquo;</dt>
  21145. <dd><p>select inverted quarter of sine wave
  21146. </p></dd>
  21147. <dt>&lsquo;<samp>ihsin</samp>&rsquo;</dt>
  21148. <dd><p>select inverted half of sine wave
  21149. </p></dd>
  21150. <dt>&lsquo;<samp>dese</samp>&rsquo;</dt>
  21151. <dd><p>select double-exponential seat
  21152. </p></dd>
  21153. <dt>&lsquo;<samp>desi</samp>&rsquo;</dt>
  21154. <dd><p>select double-exponential sigmoid
  21155. </p></dd>
  21156. <dt>&lsquo;<samp>losi</samp>&rsquo;</dt>
  21157. <dd><p>select logistic sigmoid
  21158. </p></dd>
  21159. <dt>&lsquo;<samp>nofade</samp>&rsquo;</dt>
  21160. <dd><p>no fade applied
  21161. </p></dd>
  21162. </dl>
  21163. </dd>
  21164. </dl>
  21165. <a name="Examples-17"></a>
  21166. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-17">36.15.1 Examples</a></h3>
  21167. <ul>
  21168. <li>
  21169. Fade in first 15 seconds of audio:
  21170. <div class="example">
  21171. <pre class="example">afade=t=in:ss=0:d=15
  21172. </pre></div>
  21173. </li><li>
  21174. Fade out last 25 seconds of a 900 seconds audio:
  21175. <div class="example">
  21176. <pre class="example">afade=t=out:st=875:d=25
  21177. </pre></div>
  21178. </li></ul>
  21179. <a name="afftdn"></a>
  21180. <h2 class="section"><a href="ffmpeg-all.html#toc-afftdn">36.16 afftdn</a></h2>
  21181. <p>Denoise audio samples with FFT.
  21182. </p>
  21183. <p>A description of the accepted parameters follows.
  21184. </p>
  21185. <dl compact="compact">
  21186. <dt>&lsquo;<samp>nr</samp>&rsquo;</dt>
  21187. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  21188. Default value is 12 dB.
  21189. </p>
  21190. </dd>
  21191. <dt>&lsquo;<samp>nf</samp>&rsquo;</dt>
  21192. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  21193. Default value is -50 dB.
  21194. </p>
  21195. </dd>
  21196. <dt>&lsquo;<samp>nt</samp>&rsquo;</dt>
  21197. <dd><p>Set the noise type.
  21198. </p>
  21199. <p>It accepts the following values:
  21200. </p><dl compact="compact">
  21201. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  21202. <dd><p>Select white noise.
  21203. </p>
  21204. </dd>
  21205. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  21206. <dd><p>Select vinyl noise.
  21207. </p>
  21208. </dd>
  21209. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21210. <dd><p>Select shellac noise.
  21211. </p>
  21212. </dd>
  21213. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  21214. <dd><p>Select custom noise, defined in <code>bn</code> option.
  21215. </p>
  21216. <p>Default value is white noise.
  21217. </p></dd>
  21218. </dl>
  21219. </dd>
  21220. <dt>&lsquo;<samp>bn</samp>&rsquo;</dt>
  21221. <dd><p>Set custom band noise for every one of 15 bands.
  21222. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  21223. </p>
  21224. </dd>
  21225. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  21226. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  21227. Default value is -38 dB.
  21228. </p>
  21229. </dd>
  21230. <dt>&lsquo;<samp>tn</samp>&rsquo;</dt>
  21231. <dd><p>Enable noise tracking. By default is disabled.
  21232. With this enabled, noise floor is automatically adjusted.
  21233. </p>
  21234. </dd>
  21235. <dt>&lsquo;<samp>tr</samp>&rsquo;</dt>
  21236. <dd><p>Enable residual tracking. By default is disabled.
  21237. </p>
  21238. </dd>
  21239. <dt>&lsquo;<samp>om</samp>&rsquo;</dt>
  21240. <dd><p>Set the output mode.
  21241. </p>
  21242. <p>It accepts the following values:
  21243. </p><dl compact="compact">
  21244. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  21245. <dd><p>Pass input unchanged.
  21246. </p>
  21247. </dd>
  21248. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  21249. <dd><p>Pass noise filtered out.
  21250. </p>
  21251. </dd>
  21252. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  21253. <dd><p>Pass only noise.
  21254. </p>
  21255. <p>Default value is <var>o</var>.
  21256. </p></dd>
  21257. </dl>
  21258. </dd>
  21259. </dl>
  21260. <a name="Commands-17"></a>
  21261. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-17">36.16.1 Commands</a></h3>
  21262. <p>This filter supports the following commands:
  21263. </p><dl compact="compact">
  21264. <dt>&lsquo;<samp>sample_noise, sn</samp>&rsquo;</dt>
  21265. <dd><p>Start or stop measuring noise profile.
  21266. Syntax for the command is : &quot;start&quot; or &quot;stop&quot; string.
  21267. After measuring noise profile is stopped it will be
  21268. automatically applied in filtering.
  21269. </p>
  21270. </dd>
  21271. <dt>&lsquo;<samp>noise_reduction, nr</samp>&rsquo;</dt>
  21272. <dd><p>Change noise reduction. Argument is single float number.
  21273. Syntax for the command is : &quot;<var>noise_reduction</var>&quot;
  21274. </p>
  21275. </dd>
  21276. <dt>&lsquo;<samp>noise_floor, nf</samp>&rsquo;</dt>
  21277. <dd><p>Change noise floor. Argument is single float number.
  21278. Syntax for the command is : &quot;<var>noise_floor</var>&quot;
  21279. </p>
  21280. </dd>
  21281. <dt>&lsquo;<samp>output_mode, om</samp>&rsquo;</dt>
  21282. <dd><p>Change output mode operation.
  21283. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  21284. </p></dd>
  21285. </dl>
  21286. <a name="afftfilt"></a>
  21287. <h2 class="section"><a href="ffmpeg-all.html#toc-afftfilt">36.17 afftfilt</a></h2>
  21288. <p>Apply arbitrary expressions to samples in frequency domain.
  21289. </p>
  21290. <dl compact="compact">
  21291. <dt>&lsquo;<samp>real</samp>&rsquo;</dt>
  21292. <dd><p>Set frequency domain real expression for each separate channel separated
  21293. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  21294. If the number of input channels is greater than the number of
  21295. expressions, the last specified expression is used for the remaining
  21296. output channels.
  21297. </p>
  21298. </dd>
  21299. <dt>&lsquo;<samp>imag</samp>&rsquo;</dt>
  21300. <dd><p>Set frequency domain imaginary expression for each separate channel
  21301. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  21302. </p>
  21303. <p>Each expression in <var>real</var> and <var>imag</var> can contain the following
  21304. constants and functions:
  21305. </p>
  21306. <dl compact="compact">
  21307. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  21308. <dd><p>sample rate
  21309. </p>
  21310. </dd>
  21311. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  21312. <dd><p>current frequency bin number
  21313. </p>
  21314. </dd>
  21315. <dt>&lsquo;<samp>nb</samp>&rsquo;</dt>
  21316. <dd><p>number of available bins
  21317. </p>
  21318. </dd>
  21319. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  21320. <dd><p>channel number of the current expression
  21321. </p>
  21322. </dd>
  21323. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  21324. <dd><p>number of channels
  21325. </p>
  21326. </dd>
  21327. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  21328. <dd><p>current frame pts
  21329. </p>
  21330. </dd>
  21331. <dt>&lsquo;<samp>re</samp>&rsquo;</dt>
  21332. <dd><p>current real part of frequency bin of current channel
  21333. </p>
  21334. </dd>
  21335. <dt>&lsquo;<samp>im</samp>&rsquo;</dt>
  21336. <dd><p>current imaginary part of frequency bin of current channel
  21337. </p>
  21338. </dd>
  21339. <dt>&lsquo;<samp>real(b, ch)</samp>&rsquo;</dt>
  21340. <dd><p>Return the value of real part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  21341. </p>
  21342. </dd>
  21343. <dt>&lsquo;<samp>imag(b, ch)</samp>&rsquo;</dt>
  21344. <dd><p>Return the value of imaginary part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  21345. </p></dd>
  21346. </dl>
  21347. </dd>
  21348. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  21349. <dd><p>Set window size. Allowed range is from 16 to 131072.
  21350. Default is <code>4096</code>
  21351. </p>
  21352. </dd>
  21353. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  21354. <dd><p>Set window function. Default is <code>hann</code>.
  21355. </p>
  21356. </dd>
  21357. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  21358. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  21359. window function will be picked. Default is <code>0.75</code>.
  21360. </p></dd>
  21361. </dl>
  21362. <a name="Examples-144"></a>
  21363. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-144">36.17.1 Examples</a></h3>
  21364. <ul>
  21365. <li>
  21366. Leave almost only low frequencies in audio:
  21367. <div class="example">
  21368. <pre class="example">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  21369. </pre></div>
  21370. </li><li>
  21371. Apply robotize effect:
  21372. <div class="example">
  21373. <pre class="example">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  21374. </pre></div>
  21375. </li><li>
  21376. Apply whisper effect:
  21377. <div class="example">
  21378. <pre class="example">afftfilt=&quot;real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8&quot;
  21379. </pre></div>
  21380. </li></ul>
  21381. <p><a name="afir"></a>
  21382. </p><a name="afir-1"></a>
  21383. <h2 class="section"><a href="ffmpeg-all.html#toc-afir-1">36.18 afir</a></h2>
  21384. <p>Apply an arbitrary Finite Impulse Response filter.
  21385. </p>
  21386. <p>This filter is designed for applying long FIR filters,
  21387. up to 60 seconds long.
  21388. </p>
  21389. <p>It can be used as component for digital crossover filters,
  21390. room equalization, cross talk cancellation, wavefield synthesis,
  21391. auralization, ambiophonics, ambisonics and spatialization.
  21392. </p>
  21393. <p>This filter uses the streams higher than first one as FIR coefficients.
  21394. If the non-first stream holds a single channel, it will be used
  21395. for all input channels in the first stream, otherwise
  21396. the number of channels in the non-first stream must be same as
  21397. the number of channels in the first stream.
  21398. </p>
  21399. <p>It accepts the following parameters:
  21400. </p>
  21401. <dl compact="compact">
  21402. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  21403. <dd><p>Set dry gain. This sets input gain.
  21404. </p>
  21405. </dd>
  21406. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  21407. <dd><p>Set wet gain. This sets final output gain.
  21408. </p>
  21409. </dd>
  21410. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  21411. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  21412. </p>
  21413. </dd>
  21414. <dt>&lsquo;<samp>gtype</samp>&rsquo;</dt>
  21415. <dd><p>Enable applying gain measured from power of IR.
  21416. </p>
  21417. <p>Set which approach to use for auto gain measurement.
  21418. </p>
  21419. <dl compact="compact">
  21420. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  21421. <dd><p>Do not apply any gain.
  21422. </p>
  21423. </dd>
  21424. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  21425. <dd><p>select peak gain, very conservative approach. This is default value.
  21426. </p>
  21427. </dd>
  21428. <dt>&lsquo;<samp>dc</samp>&rsquo;</dt>
  21429. <dd><p>select DC gain, limited application.
  21430. </p>
  21431. </dd>
  21432. <dt>&lsquo;<samp>gn</samp>&rsquo;</dt>
  21433. <dd><p>select gain to noise approach, this is most popular one.
  21434. </p></dd>
  21435. </dl>
  21436. </dd>
  21437. <dt>&lsquo;<samp>irgain</samp>&rsquo;</dt>
  21438. <dd><p>Set gain to be applied to IR coefficients before filtering.
  21439. Allowed range is 0 to 1. This gain is applied after any gain applied with <var>gtype</var> option.
  21440. </p>
  21441. </dd>
  21442. <dt>&lsquo;<samp>irfmt</samp>&rsquo;</dt>
  21443. <dd><p>Set format of IR stream. Can be <code>mono</code> or <code>input</code>.
  21444. Default is <code>input</code>.
  21445. </p>
  21446. </dd>
  21447. <dt>&lsquo;<samp>maxir</samp>&rsquo;</dt>
  21448. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  21449. Allowed range is 0.1 to 60 seconds.
  21450. </p>
  21451. </dd>
  21452. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  21453. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  21454. By default it is disabled.
  21455. </p>
  21456. </dd>
  21457. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  21458. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  21459. displayed. This option is used only when <var>response</var> is enabled.
  21460. </p>
  21461. </dd>
  21462. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  21463. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  21464. </p>
  21465. </dd>
  21466. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  21467. <dd><p>Set video stream frame rate. This option is used only when <var>response</var> is enabled.
  21468. </p>
  21469. </dd>
  21470. <dt>&lsquo;<samp>minp</samp>&rsquo;</dt>
  21471. <dd><p>Set minimal partition size used for convolution. Default is <var>8192</var>.
  21472. Allowed range is from <var>1</var> to <var>32768</var>.
  21473. Lower values decreases latency at cost of higher CPU usage.
  21474. </p>
  21475. </dd>
  21476. <dt>&lsquo;<samp>maxp</samp>&rsquo;</dt>
  21477. <dd><p>Set maximal partition size used for convolution. Default is <var>8192</var>.
  21478. Allowed range is from <var>8</var> to <var>32768</var>.
  21479. Lower values may increase CPU usage.
  21480. </p>
  21481. </dd>
  21482. <dt>&lsquo;<samp>nbirs</samp>&rsquo;</dt>
  21483. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  21484. Allowed range is from <var>1</var> to <var>32</var>. Default is <var>1</var>.
  21485. </p>
  21486. </dd>
  21487. <dt>&lsquo;<samp>ir</samp>&rsquo;</dt>
  21488. <dd><p>Set IR stream which will be used for convolution, starting from <var>0</var>, should always be
  21489. lower than supplied value by <code>nbirs</code> option. Default is <var>0</var>.
  21490. This option can be changed at runtime via <a href="#commands">commands</a>.
  21491. </p></dd>
  21492. </dl>
  21493. <a name="Examples-156"></a>
  21494. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-156">36.18.1 Examples</a></h3>
  21495. <ul>
  21496. <li>
  21497. Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  21498. <div class="example">
  21499. <pre class="example">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  21500. </pre></div>
  21501. </li></ul>
  21502. <p><a name="aformat"></a>
  21503. </p><a name="aformat-1"></a>
  21504. <h2 class="section"><a href="ffmpeg-all.html#toc-aformat-1">36.19 aformat</a></h2>
  21505. <p>Set output format constraints for the input audio. The framework will
  21506. negotiate the most appropriate format to minimize conversions.
  21507. </p>
  21508. <p>It accepts the following parameters:
  21509. </p><dl compact="compact">
  21510. <dt>&lsquo;<samp>sample_fmts, f</samp>&rsquo;</dt>
  21511. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  21512. </p>
  21513. </dd>
  21514. <dt>&lsquo;<samp>sample_rates, r</samp>&rsquo;</dt>
  21515. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  21516. </p>
  21517. </dd>
  21518. <dt>&lsquo;<samp>channel_layouts, cl</samp>&rsquo;</dt>
  21519. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  21520. </p>
  21521. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  21522. for the required syntax.
  21523. </p></dd>
  21524. </dl>
  21525. <p>If a parameter is omitted, all values are allowed.
  21526. </p>
  21527. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  21528. </p><div class="example">
  21529. <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  21530. </pre></div>
  21531. <a name="agate"></a>
  21532. <h2 class="section"><a href="ffmpeg-all.html#toc-agate">36.20 agate</a></h2>
  21533. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  21534. processing reduces disturbing noise between useful signals.
  21535. </p>
  21536. <p>Gating is done by detecting the volume below a chosen level <var>threshold</var>
  21537. and dividing it by the factor set with <var>ratio</var>. The bottom of the noise
  21538. floor is set via <var>range</var>. Because an exact manipulation of the signal
  21539. would cause distortion of the waveform the reduction can be levelled over
  21540. time. This is done by setting <var>attack</var> and <var>release</var>.
  21541. </p>
  21542. <p><var>attack</var> determines how long the signal has to fall below the threshold
  21543. before any reduction will occur and <var>release</var> sets the time the signal
  21544. has to rise above the threshold to reduce the reduction again.
  21545. Shorter signals than the chosen attack time will be left untouched.
  21546. </p>
  21547. <dl compact="compact">
  21548. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  21549. <dd><p>Set input level before filtering.
  21550. Default is 1. Allowed range is from 0.015625 to 64.
  21551. </p>
  21552. </dd>
  21553. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  21554. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  21555. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  21556. will be amplified, expanding dynamic range in upward direction.
  21557. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  21558. </p>
  21559. </dd>
  21560. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  21561. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  21562. Default is 0.06125. Allowed range is from 0 to 1.
  21563. Setting this to 0 disables reduction and then filter behaves like expander.
  21564. </p>
  21565. </dd>
  21566. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  21567. <dd><p>If a signal rises above this level the gain reduction is released.
  21568. Default is 0.125. Allowed range is from 0 to 1.
  21569. </p>
  21570. </dd>
  21571. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  21572. <dd><p>Set a ratio by which the signal is reduced.
  21573. Default is 2. Allowed range is from 1 to 9000.
  21574. </p>
  21575. </dd>
  21576. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  21577. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  21578. reduction stops.
  21579. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  21580. </p>
  21581. </dd>
  21582. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  21583. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  21584. reduction is increased again. Default is 250 milliseconds.
  21585. Allowed range is from 0.01 to 9000.
  21586. </p>
  21587. </dd>
  21588. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  21589. <dd><p>Set amount of amplification of signal after processing.
  21590. Default is 1. Allowed range is from 1 to 64.
  21591. </p>
  21592. </dd>
  21593. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  21594. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  21595. Default is 2.828427125. Allowed range is from 1 to 8.
  21596. </p>
  21597. </dd>
  21598. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  21599. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  21600. Default is <code>rms</code>. Can be <code>peak</code> or <code>rms</code>.
  21601. </p>
  21602. </dd>
  21603. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  21604. <dd><p>Choose if the average level between all channels or the louder channel affects
  21605. the reduction.
  21606. Default is <code>average</code>. Can be <code>average</code> or <code>maximum</code>.
  21607. </p></dd>
  21608. </dl>
  21609. <a name="aiir"></a>
  21610. <h2 class="section"><a href="ffmpeg-all.html#toc-aiir">36.21 aiir</a></h2>
  21611. <p>Apply an arbitrary Infinite Impulse Response filter.
  21612. </p>
  21613. <p>It accepts the following parameters:
  21614. </p>
  21615. <dl compact="compact">
  21616. <dt>&lsquo;<samp>z</samp>&rsquo;</dt>
  21617. <dd><p>Set numerator/zeros coefficients.
  21618. </p>
  21619. </dd>
  21620. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  21621. <dd><p>Set denominator/poles coefficients.
  21622. </p>
  21623. </dd>
  21624. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  21625. <dd><p>Set channels gains.
  21626. </p>
  21627. </dd>
  21628. <dt>&lsquo;<samp>dry_gain</samp>&rsquo;</dt>
  21629. <dd><p>Set input gain.
  21630. </p>
  21631. </dd>
  21632. <dt>&lsquo;<samp>wet_gain</samp>&rsquo;</dt>
  21633. <dd><p>Set output gain.
  21634. </p>
  21635. </dd>
  21636. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  21637. <dd><p>Set coefficients format.
  21638. </p>
  21639. <dl compact="compact">
  21640. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  21641. <dd><p>transfer function
  21642. </p></dd>
  21643. <dt>&lsquo;<samp>zp</samp>&rsquo;</dt>
  21644. <dd><p>Z-plane zeros/poles, cartesian (default)
  21645. </p></dd>
  21646. <dt>&lsquo;<samp>pr</samp>&rsquo;</dt>
  21647. <dd><p>Z-plane zeros/poles, polar radians
  21648. </p></dd>
  21649. <dt>&lsquo;<samp>pd</samp>&rsquo;</dt>
  21650. <dd><p>Z-plane zeros/poles, polar degrees
  21651. </p></dd>
  21652. </dl>
  21653. </dd>
  21654. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  21655. <dd><p>Set kind of processing.
  21656. Can be <code>d</code> - direct or <code>s</code> - serial cascading. Default is <code>s</code>.
  21657. </p>
  21658. </dd>
  21659. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  21660. <dd><p>Set filtering precision.
  21661. </p>
  21662. <dl compact="compact">
  21663. <dt>&lsquo;<samp>dbl</samp>&rsquo;</dt>
  21664. <dd><p>double-precision floating-point (default)
  21665. </p></dd>
  21666. <dt>&lsquo;<samp>flt</samp>&rsquo;</dt>
  21667. <dd><p>single-precision floating-point
  21668. </p></dd>
  21669. <dt>&lsquo;<samp>i32</samp>&rsquo;</dt>
  21670. <dd><p>32-bit integers
  21671. </p></dd>
  21672. <dt>&lsquo;<samp>i16</samp>&rsquo;</dt>
  21673. <dd><p>16-bit integers
  21674. </p></dd>
  21675. </dl>
  21676. </dd>
  21677. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  21678. <dd><p>How much to use filtered signal in output. Default is 1.
  21679. Range is between 0 and 1.
  21680. </p>
  21681. </dd>
  21682. <dt>&lsquo;<samp>response</samp>&rsquo;</dt>
  21683. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  21684. By default it is disabled.
  21685. </p>
  21686. </dd>
  21687. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  21688. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  21689. displayed. This option is used only when <var>response</var> is enabled.
  21690. </p>
  21691. </dd>
  21692. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  21693. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  21694. </p></dd>
  21695. </dl>
  21696. <p>Coefficients in <code>tf</code> format are separated by spaces and are in ascending
  21697. order.
  21698. </p>
  21699. <p>Coefficients in <code>zp</code> format are separated by spaces and order of coefficients
  21700. doesn&rsquo;t matter. Coefficients in <code>zp</code> format are complex numbers with <var>i</var>
  21701. imaginary unit.
  21702. </p>
  21703. <p>Different coefficients and gains can be provided for every channel, in such case
  21704. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  21705. used for all remaining channels.
  21706. </p>
  21707. <a name="Examples-184"></a>
  21708. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-184">36.21.1 Examples</a></h3>
  21709. <ul>
  21710. <li>
  21711. Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  21712. <div class="example">
  21713. <pre class="example">aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
  21714. </pre></div>
  21715. </li><li>
  21716. Same as above but in <code>zp</code> format:
  21717. <div class="example">
  21718. <pre class="example">aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
  21719. </pre></div>
  21720. </li></ul>
  21721. <a name="alimiter"></a>
  21722. <h2 class="section"><a href="ffmpeg-all.html#toc-alimiter">36.22 alimiter</a></h2>
  21723. <p>The limiter prevents an input signal from rising over a desired threshold.
  21724. This limiter uses lookahead technology to prevent your signal from distorting.
  21725. It means that there is a small delay after the signal is processed. Keep in mind
  21726. that the delay it produces is the attack time you set.
  21727. </p>
  21728. <p>The filter accepts the following options:
  21729. </p>
  21730. <dl compact="compact">
  21731. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  21732. <dd><p>Set input gain. Default is 1.
  21733. </p>
  21734. </dd>
  21735. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  21736. <dd><p>Set output gain. Default is 1.
  21737. </p>
  21738. </dd>
  21739. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  21740. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  21741. </p>
  21742. </dd>
  21743. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  21744. <dd><p>The limiter will reach its attenuation level in this amount of time in
  21745. milliseconds. Default is 5 milliseconds.
  21746. </p>
  21747. </dd>
  21748. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  21749. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  21750. Default is 50 milliseconds.
  21751. </p>
  21752. </dd>
  21753. <dt>&lsquo;<samp>asc</samp>&rsquo;</dt>
  21754. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  21755. average reduction level rather than reaching a reduction of 0 in the release
  21756. time.
  21757. </p>
  21758. </dd>
  21759. <dt>&lsquo;<samp>asc_level</samp>&rsquo;</dt>
  21760. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  21761. in release time while 1 produces higher release times.
  21762. </p>
  21763. </dd>
  21764. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  21765. <dd><p>Auto level output signal. Default is enabled.
  21766. This normalizes audio back to 0dB if enabled.
  21767. </p></dd>
  21768. </dl>
  21769. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  21770. with <a href="#aresample">aresample</a> before applying this filter.
  21771. </p>
  21772. <a name="allpass"></a>
  21773. <h2 class="section"><a href="ffmpeg-all.html#toc-allpass">36.23 allpass</a></h2>
  21774. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  21775. <var>frequency</var>, and filter-width <var>width</var>.
  21776. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  21777. without changing its frequency to amplitude relationship.
  21778. </p>
  21779. <p>The filter accepts the following options:
  21780. </p>
  21781. <dl compact="compact">
  21782. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  21783. <dd><p>Set frequency in Hz.
  21784. </p>
  21785. </dd>
  21786. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  21787. <dd><p>Set method to specify band-width of filter.
  21788. </p><dl compact="compact">
  21789. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  21790. <dd><p>Hz
  21791. </p></dd>
  21792. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  21793. <dd><p>Q-Factor
  21794. </p></dd>
  21795. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  21796. <dd><p>octave
  21797. </p></dd>
  21798. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  21799. <dd><p>slope
  21800. </p></dd>
  21801. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  21802. <dd><p>kHz
  21803. </p></dd>
  21804. </dl>
  21805. </dd>
  21806. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  21807. <dd><p>Specify the band-width of a filter in width_type units.
  21808. </p>
  21809. </dd>
  21810. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  21811. <dd><p>How much to use filtered signal in output. Default is 1.
  21812. Range is between 0 and 1.
  21813. </p>
  21814. </dd>
  21815. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  21816. <dd><p>Specify which channels to filter, by default all available are filtered.
  21817. </p>
  21818. </dd>
  21819. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  21820. <dd><p>Normalize biquad coefficients, by default is disabled.
  21821. Enabling it will normalize magnitude response at DC to 0dB.
  21822. </p></dd>
  21823. </dl>
  21824. <a name="Commands-38"></a>
  21825. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-38">36.23.1 Commands</a></h3>
  21826. <p>This filter supports the following commands:
  21827. </p><dl compact="compact">
  21828. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  21829. <dd><p>Change allpass frequency.
  21830. Syntax for the command is : &quot;<var>frequency</var>&quot;
  21831. </p>
  21832. </dd>
  21833. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  21834. <dd><p>Change allpass width_type.
  21835. Syntax for the command is : &quot;<var>width_type</var>&quot;
  21836. </p>
  21837. </dd>
  21838. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  21839. <dd><p>Change allpass width.
  21840. Syntax for the command is : &quot;<var>width</var>&quot;
  21841. </p>
  21842. </dd>
  21843. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  21844. <dd><p>Change allpass mix.
  21845. Syntax for the command is : &quot;<var>mix</var>&quot;
  21846. </p></dd>
  21847. </dl>
  21848. <a name="aloop"></a>
  21849. <h2 class="section"><a href="ffmpeg-all.html#toc-aloop">36.24 aloop</a></h2>
  21850. <p>Loop audio samples.
  21851. </p>
  21852. <p>The filter accepts the following options:
  21853. </p>
  21854. <dl compact="compact">
  21855. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  21856. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  21857. Default is 0.
  21858. </p>
  21859. </dd>
  21860. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  21861. <dd><p>Set maximal number of samples. Default is 0.
  21862. </p>
  21863. </dd>
  21864. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  21865. <dd><p>Set first sample of loop. Default is 0.
  21866. </p></dd>
  21867. </dl>
  21868. <p><a name="amerge"></a>
  21869. </p><a name="amerge-1"></a>
  21870. <h2 class="section"><a href="ffmpeg-all.html#toc-amerge-1">36.25 amerge</a></h2>
  21871. <p>Merge two or more audio streams into a single multi-channel stream.
  21872. </p>
  21873. <p>The filter accepts the following options:
  21874. </p>
  21875. <dl compact="compact">
  21876. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  21877. <dd><p>Set the number of inputs. Default is 2.
  21878. </p>
  21879. </dd>
  21880. </dl>
  21881. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  21882. the channel layout of the output will be set accordingly and the channels
  21883. will be reordered as necessary. If the channel layouts of the inputs are not
  21884. disjoint, the output will have all the channels of the first input then all
  21885. the channels of the second input, in that order, and the channel layout of
  21886. the output will be the default value corresponding to the total number of
  21887. channels.
  21888. </p>
  21889. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  21890. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  21891. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  21892. first input, b1 is the first channel of the second input).
  21893. </p>
  21894. <p>On the other hand, if both input are in stereo, the output channels will be
  21895. in the default order: a1, a2, b1, b2, and the channel layout will be
  21896. arbitrarily set to 4.0, which may or may not be the expected value.
  21897. </p>
  21898. <p>All inputs must have the same sample rate, and format.
  21899. </p>
  21900. <p>If inputs do not have the same duration, the output will stop with the
  21901. shortest.
  21902. </p>
  21903. <a name="Examples-101"></a>
  21904. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-101">36.25.1 Examples</a></h3>
  21905. <ul>
  21906. <li>
  21907. Merge two mono files into a stereo stream:
  21908. <div class="example">
  21909. <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  21910. </pre></div>
  21911. </li><li>
  21912. Multiple merges assuming 1 video stream and 6 audio streams in &lsquo;<tt>input.mkv</tt>&rsquo;:
  21913. <div class="example">
  21914. <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
  21915. </pre></div>
  21916. </li></ul>
  21917. <a name="amix"></a>
  21918. <h2 class="section"><a href="ffmpeg-all.html#toc-amix">36.26 amix</a></h2>
  21919. <p>Mixes multiple audio inputs into a single output.
  21920. </p>
  21921. <p>Note that this filter only supports float samples (the <var>amerge</var>
  21922. and <var>pan</var> audio filters support many formats). If the <var>amix</var>
  21923. input has integer samples then <a href="#aresample">aresample</a> will be automatically
  21924. inserted to perform the conversion to float samples.
  21925. </p>
  21926. <p>For example
  21927. </p><div class="example">
  21928. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  21929. </pre></div>
  21930. <p>will mix 3 input audio streams to a single output with the same duration as the
  21931. first input and a dropout transition time of 3 seconds.
  21932. </p>
  21933. <p>It accepts the following parameters:
  21934. </p><dl compact="compact">
  21935. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  21936. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  21937. </p>
  21938. </dd>
  21939. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  21940. <dd><p>How to determine the end-of-stream.
  21941. </p><dl compact="compact">
  21942. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  21943. <dd><p>The duration of the longest input. (default)
  21944. </p>
  21945. </dd>
  21946. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  21947. <dd><p>The duration of the shortest input.
  21948. </p>
  21949. </dd>
  21950. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  21951. <dd><p>The duration of the first input.
  21952. </p>
  21953. </dd>
  21954. </dl>
  21955. </dd>
  21956. <dt>&lsquo;<samp>dropout_transition</samp>&rsquo;</dt>
  21957. <dd><p>The transition time, in seconds, for volume renormalization when an input
  21958. stream ends. The default value is 2 seconds.
  21959. </p>
  21960. </dd>
  21961. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  21962. <dd><p>Specify weight of each input audio stream as sequence.
  21963. Each weight is separated by space. By default all inputs have same weight.
  21964. </p></dd>
  21965. </dl>
  21966. <a name="amultiply"></a>
  21967. <h2 class="section"><a href="ffmpeg-all.html#toc-amultiply">36.27 amultiply</a></h2>
  21968. <p>Multiply first audio stream with second audio stream and store result
  21969. in output audio stream. Multiplication is done by multiplying each
  21970. sample from first stream with sample at same position from second stream.
  21971. </p>
  21972. <p>With this element-wise multiplication one can create amplitude fades and
  21973. amplitude modulations.
  21974. </p>
  21975. <a name="anequalizer"></a>
  21976. <h2 class="section"><a href="ffmpeg-all.html#toc-anequalizer">36.28 anequalizer</a></h2>
  21977. <p>High-order parametric multiband equalizer for each channel.
  21978. </p>
  21979. <p>It accepts the following parameters:
  21980. </p><dl compact="compact">
  21981. <dt>&lsquo;<samp>params</samp>&rsquo;</dt>
  21982. <dd>
  21983. <p>This option string is in format:
  21984. &quot;c<var>chn</var> f=<var>cf</var> w=<var>w</var> g=<var>g</var> t=<var>f</var> | ...&quot;
  21985. Each equalizer band is separated by &rsquo;|&rsquo;.
  21986. </p>
  21987. <dl compact="compact">
  21988. <dt>&lsquo;<samp>chn</samp>&rsquo;</dt>
  21989. <dd><p>Set channel number to which equalization will be applied.
  21990. If input doesn&rsquo;t have that channel the entry is ignored.
  21991. </p>
  21992. </dd>
  21993. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  21994. <dd><p>Set central frequency for band.
  21995. If input doesn&rsquo;t have that frequency the entry is ignored.
  21996. </p>
  21997. </dd>
  21998. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  21999. <dd><p>Set band width in hertz.
  22000. </p>
  22001. </dd>
  22002. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  22003. <dd><p>Set band gain in dB.
  22004. </p>
  22005. </dd>
  22006. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  22007. <dd><p>Set filter type for band, optional, can be:
  22008. </p>
  22009. <dl compact="compact">
  22010. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  22011. <dd><p>Butterworth, this is default.
  22012. </p>
  22013. </dd>
  22014. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  22015. <dd><p>Chebyshev type 1.
  22016. </p>
  22017. </dd>
  22018. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  22019. <dd><p>Chebyshev type 2.
  22020. </p></dd>
  22021. </dl>
  22022. </dd>
  22023. </dl>
  22024. </dd>
  22025. <dt>&lsquo;<samp>curves</samp>&rsquo;</dt>
  22026. <dd><p>With this option activated frequency response of anequalizer is displayed
  22027. in video stream.
  22028. </p>
  22029. </dd>
  22030. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  22031. <dd><p>Set video stream size. Only useful if curves option is activated.
  22032. </p>
  22033. </dd>
  22034. <dt>&lsquo;<samp>mgain</samp>&rsquo;</dt>
  22035. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  22036. Setting this to a reasonable value makes it possible to display gain which is derived from
  22037. neighbour bands which are too close to each other and thus produce higher gain
  22038. when both are activated.
  22039. </p>
  22040. </dd>
  22041. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  22042. <dd><p>Set frequency scale used to draw frequency response in video output.
  22043. Can be linear or logarithmic. Default is logarithmic.
  22044. </p>
  22045. </dd>
  22046. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  22047. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  22048. This is list of color names separated by space or by &rsquo;|&rsquo;.
  22049. Unrecognised or missing colors will be replaced by white color.
  22050. </p></dd>
  22051. </dl>
  22052. <a name="Examples-146"></a>
  22053. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-146">36.28.1 Examples</a></h3>
  22054. <ul>
  22055. <li>
  22056. Lower gain by 10 of central frequency 200Hz and width 100 Hz
  22057. for first 2 channels using Chebyshev type 1 filter:
  22058. <div class="example">
  22059. <pre class="example">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  22060. </pre></div>
  22061. </li></ul>
  22062. <a name="Commands-42"></a>
  22063. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-42">36.28.2 Commands</a></h3>
  22064. <p>This filter supports the following commands:
  22065. </p><dl compact="compact">
  22066. <dt>&lsquo;<samp>change</samp>&rsquo;</dt>
  22067. <dd><p>Alter existing filter parameters.
  22068. Syntax for the commands is : &quot;<var>fN</var>|f=<var>freq</var>|w=<var>width</var>|g=<var>gain</var>&quot;
  22069. </p>
  22070. <p><var>fN</var> is existing filter number, starting from 0, if no such filter is available
  22071. error is returned.
  22072. <var>freq</var> set new frequency parameter.
  22073. <var>width</var> set new width parameter in herz.
  22074. <var>gain</var> set new gain parameter in dB.
  22075. </p>
  22076. <p>Full filter invocation with asendcmd may look like this:
  22077. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  22078. </p></dd>
  22079. </dl>
  22080. <a name="anlmdn"></a>
  22081. <h2 class="section"><a href="ffmpeg-all.html#toc-anlmdn">36.29 anlmdn</a></h2>
  22082. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  22083. </p>
  22084. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  22085. context similarity is defined by comparing their surrounding patches of size
  22086. &lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo; around the sample.
  22087. </p>
  22088. <p>The filter accepts the following options:
  22089. </p>
  22090. <dl compact="compact">
  22091. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22092. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001.
  22093. </p>
  22094. </dd>
  22095. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  22096. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  22097. Default value is 2 milliseconds.
  22098. </p>
  22099. </dd>
  22100. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  22101. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  22102. Default value is 6 milliseconds.
  22103. </p>
  22104. </dd>
  22105. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22106. <dd><p>Set the output mode.
  22107. </p>
  22108. <p>It accepts the following values:
  22109. </p><dl compact="compact">
  22110. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  22111. <dd><p>Pass input unchanged.
  22112. </p>
  22113. </dd>
  22114. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22115. <dd><p>Pass noise filtered out.
  22116. </p>
  22117. </dd>
  22118. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22119. <dd><p>Pass only noise.
  22120. </p>
  22121. <p>Default value is <var>o</var>.
  22122. </p></dd>
  22123. </dl>
  22124. </dd>
  22125. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  22126. <dd><p>Set smooth factor. Default value is <var>11</var>. Allowed range is from <var>1</var> to <var>15</var>.
  22127. </p></dd>
  22128. </dl>
  22129. <a name="Commands-37"></a>
  22130. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-37">36.29.1 Commands</a></h3>
  22131. <p>This filter supports the following commands:
  22132. </p><dl compact="compact">
  22133. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22134. <dd><p>Change denoise strength. Argument is single float number.
  22135. Syntax for the command is : &quot;<var>s</var>&quot;
  22136. </p>
  22137. </dd>
  22138. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22139. <dd><p>Change output mode.
  22140. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  22141. </p></dd>
  22142. </dl>
  22143. <a name="anlms"></a>
  22144. <h2 class="section"><a href="ffmpeg-all.html#toc-anlms">36.30 anlms</a></h2>
  22145. <p>Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream.
  22146. </p>
  22147. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  22148. relate to producing the least mean square of the error signal (difference between the desired,
  22149. 2nd input audio stream and the actual signal, the 1st input audio stream).
  22150. </p>
  22151. <p>A description of the accepted options follows.
  22152. </p>
  22153. <dl compact="compact">
  22154. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  22155. <dd><p>Set filter order.
  22156. </p>
  22157. </dd>
  22158. <dt>&lsquo;<samp>mu</samp>&rsquo;</dt>
  22159. <dd><p>Set filter mu.
  22160. </p>
  22161. </dd>
  22162. <dt>&lsquo;<samp>eps</samp>&rsquo;</dt>
  22163. <dd><p>Set the filter eps.
  22164. </p>
  22165. </dd>
  22166. <dt>&lsquo;<samp>leakage</samp>&rsquo;</dt>
  22167. <dd><p>Set the filter leakage.
  22168. </p>
  22169. </dd>
  22170. <dt>&lsquo;<samp>out_mode</samp>&rsquo;</dt>
  22171. <dd><p>It accepts the following values:
  22172. </p><dl compact="compact">
  22173. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  22174. <dd><p>Pass the 1st input.
  22175. </p>
  22176. </dd>
  22177. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  22178. <dd><p>Pass the 2nd input.
  22179. </p>
  22180. </dd>
  22181. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22182. <dd><p>Pass filtered samples.
  22183. </p>
  22184. </dd>
  22185. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22186. <dd><p>Pass difference between desired and filtered samples.
  22187. </p>
  22188. <p>Default value is <var>o</var>.
  22189. </p></dd>
  22190. </dl>
  22191. </dd>
  22192. </dl>
  22193. <a name="Examples-182"></a>
  22194. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-182">36.30.1 Examples</a></h3>
  22195. <ul>
  22196. <li>
  22197. One of many usages of this filter is noise reduction, input audio is filtered
  22198. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  22199. <div class="example">
  22200. <pre class="example">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  22201. </pre></div>
  22202. </li></ul>
  22203. <a name="Commands-5"></a>
  22204. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-5">36.30.2 Commands</a></h3>
  22205. <p>This filter supports the same commands as options, excluding option <code>order</code>.
  22206. </p>
  22207. <a name="anull"></a>
  22208. <h2 class="section"><a href="ffmpeg-all.html#toc-anull">36.31 anull</a></h2>
  22209. <p>Pass the audio source unchanged to the output.
  22210. </p>
  22211. <a name="apad"></a>
  22212. <h2 class="section"><a href="ffmpeg-all.html#toc-apad">36.32 apad</a></h2>
  22213. <p>Pad the end of an audio stream with silence.
  22214. </p>
  22215. <p>This can be used together with <code>ffmpeg</code> &lsquo;<samp>-shortest</samp>&rsquo; to
  22216. extend audio streams to the same length as the video stream.
  22217. </p>
  22218. <p>A description of the accepted options follows.
  22219. </p>
  22220. <dl compact="compact">
  22221. <dt>&lsquo;<samp>packet_size</samp>&rsquo;</dt>
  22222. <dd><p>Set silence packet size. Default value is 4096.
  22223. </p>
  22224. </dd>
  22225. <dt>&lsquo;<samp>pad_len</samp>&rsquo;</dt>
  22226. <dd><p>Set the number of samples of silence to add to the end. After the
  22227. value is reached, the stream is terminated. This option is mutually
  22228. exclusive with &lsquo;<samp>whole_len</samp>&rsquo;.
  22229. </p>
  22230. </dd>
  22231. <dt>&lsquo;<samp>whole_len</samp>&rsquo;</dt>
  22232. <dd><p>Set the minimum total number of samples in the output audio stream. If
  22233. the value is longer than the input audio length, silence is added to
  22234. the end, until the value is reached. This option is mutually exclusive
  22235. with &lsquo;<samp>pad_len</samp>&rsquo;.
  22236. </p>
  22237. </dd>
  22238. <dt>&lsquo;<samp>pad_dur</samp>&rsquo;</dt>
  22239. <dd><p>Specify the duration of samples of silence to add. See
  22240. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22241. for the accepted syntax. Used only if set to non-zero value.
  22242. </p>
  22243. </dd>
  22244. <dt>&lsquo;<samp>whole_dur</samp>&rsquo;</dt>
  22245. <dd><p>Specify the minimum total duration in the output audio stream. See
  22246. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22247. for the accepted syntax. Used only if set to non-zero value. If the value is longer than
  22248. the input audio length, silence is added to the end, until the value is reached.
  22249. This option is mutually exclusive with &lsquo;<samp>pad_dur</samp>&rsquo;
  22250. </p></dd>
  22251. </dl>
  22252. <p>If neither the &lsquo;<samp>pad_len</samp>&rsquo; nor the &lsquo;<samp>whole_len</samp>&rsquo; nor &lsquo;<samp>pad_dur</samp>&rsquo;
  22253. nor &lsquo;<samp>whole_dur</samp>&rsquo; option is set, the filter will add silence to the end of
  22254. the input stream indefinitely.
  22255. </p>
  22256. <a name="Examples-26"></a>
  22257. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-26">36.32.1 Examples</a></h3>
  22258. <ul>
  22259. <li>
  22260. Add 1024 samples of silence to the end of the input:
  22261. <div class="example">
  22262. <pre class="example">apad=pad_len=1024
  22263. </pre></div>
  22264. </li><li>
  22265. Make sure the audio output will contain at least 10000 samples, pad
  22266. the input with silence if required:
  22267. <div class="example">
  22268. <pre class="example">apad=whole_len=10000
  22269. </pre></div>
  22270. </li><li>
  22271. Use <code>ffmpeg</code> to pad the audio input with silence, so that the
  22272. video stream will always result the shortest and will be converted
  22273. until the end in the output file when using the &lsquo;<samp>shortest</samp>&rsquo;
  22274. option:
  22275. <div class="example">
  22276. <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  22277. </pre></div>
  22278. </li></ul>
  22279. <a name="aphaser"></a>
  22280. <h2 class="section"><a href="ffmpeg-all.html#toc-aphaser">36.33 aphaser</a></h2>
  22281. <p>Add a phasing effect to the input audio.
  22282. </p>
  22283. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  22284. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  22285. </p>
  22286. <p>A description of the accepted parameters follows.
  22287. </p>
  22288. <dl compact="compact">
  22289. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  22290. <dd><p>Set input gain. Default is 0.4.
  22291. </p>
  22292. </dd>
  22293. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  22294. <dd><p>Set output gain. Default is 0.74
  22295. </p>
  22296. </dd>
  22297. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  22298. <dd><p>Set delay in milliseconds. Default is 3.0.
  22299. </p>
  22300. </dd>
  22301. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  22302. <dd><p>Set decay. Default is 0.4.
  22303. </p>
  22304. </dd>
  22305. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  22306. <dd><p>Set modulation speed in Hz. Default is 0.5.
  22307. </p>
  22308. </dd>
  22309. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  22310. <dd><p>Set modulation type. Default is triangular.
  22311. </p>
  22312. <p>It accepts the following values:
  22313. </p><dl compact="compact">
  22314. <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
  22315. <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
  22316. </dl>
  22317. </dd>
  22318. </dl>
  22319. <a name="apulsator"></a>
  22320. <h2 class="section"><a href="ffmpeg-all.html#toc-apulsator">36.34 apulsator</a></h2>
  22321. <p>Audio pulsator is something between an autopanner and a tremolo.
  22322. But it can produce funny stereo effects as well. Pulsator changes the volume
  22323. of the left and right channel based on a LFO (low frequency oscillator) with
  22324. different waveforms and shifted phases.
  22325. This filter have the ability to define an offset between left and right
  22326. channel. An offset of 0 means that both LFO shapes match each other.
  22327. The left and right channel are altered equally - a conventional tremolo.
  22328. An offset of 50% means that the shape of the right channel is exactly shifted
  22329. in phase (or moved backwards about half of the frequency) - pulsator acts as
  22330. an autopanner. At 1 both curves match again. Every setting in between moves the
  22331. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  22332. sine and triangle waveforms. The more you set the offset near 1 (starting from
  22333. the 0.5) the faster the signal passes from the left to the right speaker.
  22334. </p>
  22335. <p>The filter accepts the following options:
  22336. </p>
  22337. <dl compact="compact">
  22338. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  22339. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  22340. </p>
  22341. </dd>
  22342. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  22343. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  22344. </p>
  22345. </dd>
  22346. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  22347. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  22348. sawup or sawdown. Default is sine.
  22349. </p>
  22350. </dd>
  22351. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  22352. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  22353. </p>
  22354. </dd>
  22355. <dt>&lsquo;<samp>offset_l</samp>&rsquo;</dt>
  22356. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  22357. </p>
  22358. </dd>
  22359. <dt>&lsquo;<samp>offset_r</samp>&rsquo;</dt>
  22360. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  22361. </p>
  22362. </dd>
  22363. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  22364. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  22365. </p>
  22366. </dd>
  22367. <dt>&lsquo;<samp>timing</samp>&rsquo;</dt>
  22368. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  22369. </p>
  22370. </dd>
  22371. <dt>&lsquo;<samp>bpm</samp>&rsquo;</dt>
  22372. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  22373. is set to bpm.
  22374. </p>
  22375. </dd>
  22376. <dt>&lsquo;<samp>ms</samp>&rsquo;</dt>
  22377. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  22378. is set to ms.
  22379. </p>
  22380. </dd>
  22381. <dt>&lsquo;<samp>hz</samp>&rsquo;</dt>
  22382. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  22383. if timing is set to hz.
  22384. </p></dd>
  22385. </dl>
  22386. <p><a name="aresample"></a>
  22387. </p><a name="aresample-1"></a>
  22388. <h2 class="section"><a href="ffmpeg-all.html#toc-aresample-1">36.35 aresample</a></h2>
  22389. <p>Resample the input audio to the specified parameters, using the
  22390. libswresample library. If none are specified then the filter will
  22391. automatically convert between its input and output.
  22392. </p>
  22393. <p>This filter is also able to stretch/squeeze the audio data to make it match
  22394. the timestamps or to inject silence / cut out audio to make it match the
  22395. timestamps, do a combination of both or do neither.
  22396. </p>
  22397. <p>The filter accepts the syntax
  22398. [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
  22399. expresses a sample rate and <var>resampler_options</var> is a list of
  22400. <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
  22401. <a href="ffmpeg-resampler.html#Resampler-Options">(ffmpeg-resampler)&quot;Resampler Options&quot; section in the ffmpeg-resampler(1) manual</a>
  22402. for the complete list of supported options.
  22403. </p>
  22404. <a name="Examples-126"></a>
  22405. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-126">36.35.1 Examples</a></h3>
  22406. <ul>
  22407. <li>
  22408. Resample the input audio to 44100Hz:
  22409. <div class="example">
  22410. <pre class="example">aresample=44100
  22411. </pre></div>
  22412. </li><li>
  22413. Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  22414. samples per second compensation:
  22415. <div class="example">
  22416. <pre class="example">aresample=async=1000
  22417. </pre></div>
  22418. </li></ul>
  22419. <a name="areverse"></a>
  22420. <h2 class="section"><a href="ffmpeg-all.html#toc-areverse">36.36 areverse</a></h2>
  22421. <p>Reverse an audio clip.
  22422. </p>
  22423. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  22424. is suggested.
  22425. </p>
  22426. <a name="Examples-131"></a>
  22427. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-131">36.36.1 Examples</a></h3>
  22428. <ul>
  22429. <li>
  22430. Take the first 5 seconds of a clip, and reverse it.
  22431. <div class="example">
  22432. <pre class="example">atrim=end=5,areverse
  22433. </pre></div>
  22434. </li></ul>
  22435. <a name="arnndn"></a>
  22436. <h2 class="section"><a href="ffmpeg-all.html#toc-arnndn">36.37 arnndn</a></h2>
  22437. <p>Reduce noise from speech using Recurrent Neural Networks.
  22438. </p>
  22439. <p>This filter accepts the following options:
  22440. </p>
  22441. <dl compact="compact">
  22442. <dt>&lsquo;<samp>model, m</samp>&rsquo;</dt>
  22443. <dd><p>Set train model file to load. This option is always required.
  22444. </p></dd>
  22445. </dl>
  22446. <a name="asetnsamples"></a>
  22447. <h2 class="section"><a href="ffmpeg-all.html#toc-asetnsamples">36.38 asetnsamples</a></h2>
  22448. <p>Set the number of samples per each output audio frame.
  22449. </p>
  22450. <p>The last output packet may contain a different number of samples, as
  22451. the filter will flush all the remaining samples when the input audio
  22452. signals its end.
  22453. </p>
  22454. <p>The filter accepts the following options:
  22455. </p>
  22456. <dl compact="compact">
  22457. <dt>&lsquo;<samp>nb_out_samples, n</samp>&rsquo;</dt>
  22458. <dd><p>Set the number of frames per each output audio frame. The number is
  22459. intended as the number of samples <em>per each channel</em>.
  22460. Default value is 1024.
  22461. </p>
  22462. </dd>
  22463. <dt>&lsquo;<samp>pad, p</samp>&rsquo;</dt>
  22464. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  22465. that the last frame will contain the same number of samples as the
  22466. previous ones. Default value is 1.
  22467. </p></dd>
  22468. </dl>
  22469. <p>For example, to set the number of per-frame samples to 1234 and
  22470. disable padding for the last frame, use:
  22471. </p><div class="example">
  22472. <pre class="example">asetnsamples=n=1234:p=0
  22473. </pre></div>
  22474. <a name="asetrate"></a>
  22475. <h2 class="section"><a href="ffmpeg-all.html#toc-asetrate">36.39 asetrate</a></h2>
  22476. <p>Set the sample rate without altering the PCM data.
  22477. This will result in a change of speed and pitch.
  22478. </p>
  22479. <p>The filter accepts the following options:
  22480. </p>
  22481. <dl compact="compact">
  22482. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  22483. <dd><p>Set the output sample rate. Default is 44100 Hz.
  22484. </p></dd>
  22485. </dl>
  22486. <a name="ashowinfo"></a>
  22487. <h2 class="section"><a href="ffmpeg-all.html#toc-ashowinfo">36.40 ashowinfo</a></h2>
  22488. <p>Show a line containing various information for each input audio frame.
  22489. The input audio is not modified.
  22490. </p>
  22491. <p>The shown line contains a sequence of key/value pairs of the form
  22492. <var>key</var>:<var>value</var>.
  22493. </p>
  22494. <p>The following values are shown in the output:
  22495. </p>
  22496. <dl compact="compact">
  22497. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  22498. <dd><p>The (sequential) number of the input frame, starting from 0.
  22499. </p>
  22500. </dd>
  22501. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  22502. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  22503. depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
  22504. </p>
  22505. </dd>
  22506. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  22507. <dd><p>The presentation timestamp of the input frame in seconds.
  22508. </p>
  22509. </dd>
  22510. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  22511. <dd><p>position of the frame in the input stream, -1 if this information in
  22512. unavailable and/or meaningless (for example in case of synthetic audio)
  22513. </p>
  22514. </dd>
  22515. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  22516. <dd><p>The sample format.
  22517. </p>
  22518. </dd>
  22519. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  22520. <dd><p>The channel layout.
  22521. </p>
  22522. </dd>
  22523. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  22524. <dd><p>The sample rate for the audio frame.
  22525. </p>
  22526. </dd>
  22527. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  22528. <dd><p>The number of samples (per channel) in the frame.
  22529. </p>
  22530. </dd>
  22531. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  22532. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  22533. audio, the data is treated as if all the planes were concatenated.
  22534. </p>
  22535. </dd>
  22536. <dt>&lsquo;<samp>plane_checksums</samp>&rsquo;</dt>
  22537. <dd><p>A list of Adler-32 checksums for each data plane.
  22538. </p></dd>
  22539. </dl>
  22540. <a name="asoftclip"></a>
  22541. <h2 class="section"><a href="ffmpeg-all.html#toc-asoftclip">36.41 asoftclip</a></h2>
  22542. <p>Apply audio soft clipping.
  22543. </p>
  22544. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  22545. along a smooth curve, rather than the abrupt shape of hard-clipping.
  22546. </p>
  22547. <p>This filter accepts the following options:
  22548. </p>
  22549. <dl compact="compact">
  22550. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  22551. <dd><p>Set type of soft-clipping.
  22552. </p>
  22553. <p>It accepts the following values:
  22554. </p><dl compact="compact">
  22555. <dt>&lsquo;<samp>tanh</samp>&rsquo;</dt>
  22556. <dt>&lsquo;<samp>atan</samp>&rsquo;</dt>
  22557. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  22558. <dt>&lsquo;<samp>exp</samp>&rsquo;</dt>
  22559. <dt>&lsquo;<samp>alg</samp>&rsquo;</dt>
  22560. <dt>&lsquo;<samp>quintic</samp>&rsquo;</dt>
  22561. <dt>&lsquo;<samp>sin</samp>&rsquo;</dt>
  22562. </dl>
  22563. </dd>
  22564. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  22565. <dd><p>Set additional parameter which controls sigmoid function.
  22566. </p></dd>
  22567. </dl>
  22568. <a name="Commands-30"></a>
  22569. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-30">36.41.1 Commands</a></h3>
  22570. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  22571. </p>
  22572. <a name="asr"></a>
  22573. <h2 class="section"><a href="ffmpeg-all.html#toc-asr">36.42 asr</a></h2>
  22574. <p>Automatic Speech Recognition
  22575. </p>
  22576. <p>This filter uses PocketSphinx for speech recognition. To enable
  22577. compilation of this filter, you need to configure FFmpeg with
  22578. <code>--enable-pocketsphinx</code>.
  22579. </p>
  22580. <p>It accepts the following options:
  22581. </p>
  22582. <dl compact="compact">
  22583. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  22584. <dd><p>Set sampling rate of input audio. Defaults is <code>16000</code>.
  22585. This need to match speech models, otherwise one will get poor results.
  22586. </p>
  22587. </dd>
  22588. <dt>&lsquo;<samp>hmm</samp>&rsquo;</dt>
  22589. <dd><p>Set dictionary containing acoustic model files.
  22590. </p>
  22591. </dd>
  22592. <dt>&lsquo;<samp>dict</samp>&rsquo;</dt>
  22593. <dd><p>Set pronunciation dictionary.
  22594. </p>
  22595. </dd>
  22596. <dt>&lsquo;<samp>lm</samp>&rsquo;</dt>
  22597. <dd><p>Set language model file.
  22598. </p>
  22599. </dd>
  22600. <dt>&lsquo;<samp>lmctl</samp>&rsquo;</dt>
  22601. <dd><p>Set language model set.
  22602. </p>
  22603. </dd>
  22604. <dt>&lsquo;<samp>lmname</samp>&rsquo;</dt>
  22605. <dd><p>Set which language model to use.
  22606. </p>
  22607. </dd>
  22608. <dt>&lsquo;<samp>logfn</samp>&rsquo;</dt>
  22609. <dd><p>Set output for log messages.
  22610. </p></dd>
  22611. </dl>
  22612. <p>The filter exports recognized speech as the frame metadata <code>lavfi.asr.text</code>.
  22613. </p>
  22614. <p><a name="astats"></a>
  22615. </p><a name="astats-1"></a>
  22616. <h2 class="section"><a href="ffmpeg-all.html#toc-astats-1">36.43 astats</a></h2>
  22617. <p>Display time domain statistical information about the audio channels.
  22618. Statistics are calculated and displayed for each audio channel and,
  22619. where applicable, an overall figure is also given.
  22620. </p>
  22621. <p>It accepts the following option:
  22622. </p><dl compact="compact">
  22623. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  22624. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  22625. Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.01 - 10]</code>.
  22626. </p>
  22627. </dd>
  22628. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  22629. <dd>
  22630. <p>Set metadata injection. All the metadata keys are prefixed with <code>lavfi.astats.X</code>,
  22631. where <code>X</code> is channel number starting from 1 or string <code>Overall</code>. Default is
  22632. disabled.
  22633. </p>
  22634. <p>Available keys for each channel are:
  22635. DC_offset
  22636. Min_level
  22637. Max_level
  22638. Min_difference
  22639. Max_difference
  22640. Mean_difference
  22641. RMS_difference
  22642. Peak_level
  22643. RMS_peak
  22644. RMS_trough
  22645. Crest_factor
  22646. Flat_factor
  22647. Peak_count
  22648. Bit_depth
  22649. Dynamic_range
  22650. Zero_crossings
  22651. Zero_crossings_rate
  22652. Number_of_NaNs
  22653. Number_of_Infs
  22654. Number_of_denormals
  22655. </p>
  22656. <p>and for Overall:
  22657. DC_offset
  22658. Min_level
  22659. Max_level
  22660. Min_difference
  22661. Max_difference
  22662. Mean_difference
  22663. RMS_difference
  22664. Peak_level
  22665. RMS_level
  22666. RMS_peak
  22667. RMS_trough
  22668. Flat_factor
  22669. Peak_count
  22670. Bit_depth
  22671. Number_of_samples
  22672. Number_of_NaNs
  22673. Number_of_Infs
  22674. Number_of_denormals
  22675. </p>
  22676. <p>For example full key look like this <code>lavfi.astats.1.DC_offset</code> or
  22677. this <code>lavfi.astats.Overall.Peak_count</code>.
  22678. </p>
  22679. <p>For description what each key means read below.
  22680. </p>
  22681. </dd>
  22682. <dt>&lsquo;<samp>reset</samp>&rsquo;</dt>
  22683. <dd><p>Set number of frame after which stats are going to be recalculated.
  22684. Default is disabled.
  22685. </p>
  22686. </dd>
  22687. <dt>&lsquo;<samp>measure_perchannel</samp>&rsquo;</dt>
  22688. <dd><p>Select the entries which need to be measured per channel. The metadata keys can
  22689. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  22690. &lsquo;<samp>none</samp>&rsquo; disables all per channel measurement.
  22691. </p>
  22692. </dd>
  22693. <dt>&lsquo;<samp>measure_overall</samp>&rsquo;</dt>
  22694. <dd><p>Select the entries which need to be measured overall. The metadata keys can
  22695. be used as flags, default is &lsquo;<samp>all</samp>&rsquo; which measures everything.
  22696. &lsquo;<samp>none</samp>&rsquo; disables all overall measurement.
  22697. </p>
  22698. </dd>
  22699. </dl>
  22700. <p>A description of each shown parameter follows:
  22701. </p>
  22702. <dl compact="compact">
  22703. <dt>&lsquo;<samp>DC offset</samp>&rsquo;</dt>
  22704. <dd><p>Mean amplitude displacement from zero.
  22705. </p>
  22706. </dd>
  22707. <dt>&lsquo;<samp>Min level</samp>&rsquo;</dt>
  22708. <dd><p>Minimal sample level.
  22709. </p>
  22710. </dd>
  22711. <dt>&lsquo;<samp>Max level</samp>&rsquo;</dt>
  22712. <dd><p>Maximal sample level.
  22713. </p>
  22714. </dd>
  22715. <dt>&lsquo;<samp>Min difference</samp>&rsquo;</dt>
  22716. <dd><p>Minimal difference between two consecutive samples.
  22717. </p>
  22718. </dd>
  22719. <dt>&lsquo;<samp>Max difference</samp>&rsquo;</dt>
  22720. <dd><p>Maximal difference between two consecutive samples.
  22721. </p>
  22722. </dd>
  22723. <dt>&lsquo;<samp>Mean difference</samp>&rsquo;</dt>
  22724. <dd><p>Mean difference between two consecutive samples.
  22725. The average of each difference between two consecutive samples.
  22726. </p>
  22727. </dd>
  22728. <dt>&lsquo;<samp>RMS difference</samp>&rsquo;</dt>
  22729. <dd><p>Root Mean Square difference between two consecutive samples.
  22730. </p>
  22731. </dd>
  22732. <dt>&lsquo;<samp>Peak level dB</samp>&rsquo;</dt>
  22733. <dt>&lsquo;<samp>RMS level dB</samp>&rsquo;</dt>
  22734. <dd><p>Standard peak and RMS level measured in dBFS.
  22735. </p>
  22736. </dd>
  22737. <dt>&lsquo;<samp>RMS peak dB</samp>&rsquo;</dt>
  22738. <dt>&lsquo;<samp>RMS trough dB</samp>&rsquo;</dt>
  22739. <dd><p>Peak and trough values for RMS level measured over a short window.
  22740. </p>
  22741. </dd>
  22742. <dt>&lsquo;<samp>Crest factor</samp>&rsquo;</dt>
  22743. <dd><p>Standard ratio of peak to RMS level (note: not in dB).
  22744. </p>
  22745. </dd>
  22746. <dt>&lsquo;<samp>Flat factor</samp>&rsquo;</dt>
  22747. <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  22748. (i.e. either <var>Min level</var> or <var>Max level</var>).
  22749. </p>
  22750. </dd>
  22751. <dt>&lsquo;<samp>Peak count</samp>&rsquo;</dt>
  22752. <dd><p>Number of occasions (not the number of samples) that the signal attained either
  22753. <var>Min level</var> or <var>Max level</var>.
  22754. </p>
  22755. </dd>
  22756. <dt>&lsquo;<samp>Bit depth</samp>&rsquo;</dt>
  22757. <dd><p>Overall bit depth of audio. Number of bits used for each sample.
  22758. </p>
  22759. </dd>
  22760. <dt>&lsquo;<samp>Dynamic range</samp>&rsquo;</dt>
  22761. <dd><p>Measured dynamic range of audio in dB.
  22762. </p>
  22763. </dd>
  22764. <dt>&lsquo;<samp>Zero crossings</samp>&rsquo;</dt>
  22765. <dd><p>Number of points where the waveform crosses the zero level axis.
  22766. </p>
  22767. </dd>
  22768. <dt>&lsquo;<samp>Zero crossings rate</samp>&rsquo;</dt>
  22769. <dd><p>Rate of Zero crossings and number of audio samples.
  22770. </p></dd>
  22771. </dl>
  22772. <a name="atempo"></a>
  22773. <h2 class="section"><a href="ffmpeg-all.html#toc-atempo">36.44 atempo</a></h2>
  22774. <p>Adjust audio tempo.
  22775. </p>
  22776. <p>The filter accepts exactly one parameter, the audio tempo. If not
  22777. specified then the filter will assume nominal 1.0 tempo. Tempo must
  22778. be in the [0.5, 100.0] range.
  22779. </p>
  22780. <p>Note that tempo greater than 2 will skip some samples rather than
  22781. blend them in. If for any reason this is a concern it is always
  22782. possible to daisy-chain several instances of atempo to achieve the
  22783. desired product tempo.
  22784. </p>
  22785. <a name="Examples-38"></a>
  22786. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-38">36.44.1 Examples</a></h3>
  22787. <ul>
  22788. <li>
  22789. Slow down audio to 80% tempo:
  22790. <div class="example">
  22791. <pre class="example">atempo=0.8
  22792. </pre></div>
  22793. </li><li>
  22794. To speed up audio to 300% tempo:
  22795. <div class="example">
  22796. <pre class="example">atempo=3
  22797. </pre></div>
  22798. </li><li>
  22799. To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  22800. <div class="example">
  22801. <pre class="example">atempo=sqrt(3),atempo=sqrt(3)
  22802. </pre></div>
  22803. </li></ul>
  22804. <a name="Commands-61"></a>
  22805. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-61">36.44.2 Commands</a></h3>
  22806. <p>This filter supports the following commands:
  22807. </p><dl compact="compact">
  22808. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  22809. <dd><p>Change filter tempo scale factor.
  22810. Syntax for the command is : &quot;<var>tempo</var>&quot;
  22811. </p></dd>
  22812. </dl>
  22813. <a name="atrim"></a>
  22814. <h2 class="section"><a href="ffmpeg-all.html#toc-atrim">36.45 atrim</a></h2>
  22815. <p>Trim the input so that the output contains one continuous subpart of the input.
  22816. </p>
  22817. <p>It accepts the following parameters:
  22818. </p><dl compact="compact">
  22819. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  22820. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  22821. sample with the timestamp <var>start</var> will be the first sample in the output.
  22822. </p>
  22823. </dd>
  22824. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  22825. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  22826. audio sample immediately preceding the one with the timestamp <var>end</var> will be
  22827. the last sample in the output.
  22828. </p>
  22829. </dd>
  22830. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  22831. <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
  22832. instead of seconds.
  22833. </p>
  22834. </dd>
  22835. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  22836. <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
  22837. of seconds.
  22838. </p>
  22839. </dd>
  22840. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  22841. <dd><p>The maximum duration of the output in seconds.
  22842. </p>
  22843. </dd>
  22844. <dt>&lsquo;<samp>start_sample</samp>&rsquo;</dt>
  22845. <dd><p>The number of the first sample that should be output.
  22846. </p>
  22847. </dd>
  22848. <dt>&lsquo;<samp>end_sample</samp>&rsquo;</dt>
  22849. <dd><p>The number of the first sample that should be dropped.
  22850. </p></dd>
  22851. </dl>
  22852. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  22853. duration specifications; see
  22854. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  22855. </p>
  22856. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  22857. option look at the frame timestamp, while the _sample options simply count the
  22858. samples that pass through the filter. So start/end_pts and start/end_sample will
  22859. give different results when the timestamps are wrong, inexact or do not start at
  22860. zero. Also note that this filter does not modify the timestamps. If you wish
  22861. to have the output timestamps start at zero, insert the asetpts filter after the
  22862. atrim filter.
  22863. </p>
  22864. <p>If multiple start or end options are set, this filter tries to be greedy and
  22865. keep all samples that match at least one of the specified constraints. To keep
  22866. only the part that matches all the constraints at once, chain multiple atrim
  22867. filters.
  22868. </p>
  22869. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  22870. just the end values to keep everything before the specified time.
  22871. </p>
  22872. <p>Examples:
  22873. </p><ul>
  22874. <li>
  22875. Drop everything except the second minute of input:
  22876. <div class="example">
  22877. <pre class="example">ffmpeg -i INPUT -af atrim=60:120
  22878. </pre></div>
  22879. </li><li>
  22880. Keep only the first 1000 samples:
  22881. <div class="example">
  22882. <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
  22883. </pre></div>
  22884. </li></ul>
  22885. <a name="axcorrelate"></a>
  22886. <h2 class="section"><a href="ffmpeg-all.html#toc-axcorrelate">36.46 axcorrelate</a></h2>
  22887. <p>Calculate normalized cross-correlation between two input audio streams.
  22888. </p>
  22889. <p>Resulted samples are always between -1 and 1 inclusive.
  22890. If result is 1 it means two input samples are highly correlated in that selected segment.
  22891. Result 0 means they are not correlated at all.
  22892. If result is -1 it means two input samples are out of phase, which means they cancel each
  22893. other.
  22894. </p>
  22895. <p>The filter accepts the following options:
  22896. </p>
  22897. <dl compact="compact">
  22898. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  22899. <dd><p>Set size of segment over which cross-correlation is calculated.
  22900. Default is 256. Allowed range is from 2 to 131072.
  22901. </p>
  22902. </dd>
  22903. <dt>&lsquo;<samp>algo</samp>&rsquo;</dt>
  22904. <dd><p>Set algorithm for cross-correlation. Can be <code>slow</code> or <code>fast</code>.
  22905. Default is <code>slow</code>. Fast algorithm assumes mean values over any given segment
  22906. are always zero and thus need much less calculations to make.
  22907. This is generally not true, but is valid for typical audio streams.
  22908. </p></dd>
  22909. </dl>
  22910. <a name="Examples-1"></a>
  22911. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-1">36.46.1 Examples</a></h3>
  22912. <ul>
  22913. <li>
  22914. Calculate correlation between channels in stereo audio stream:
  22915. <div class="example">
  22916. <pre class="example">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  22917. </pre></div>
  22918. </li></ul>
  22919. <a name="bandpass"></a>
  22920. <h2 class="section"><a href="ffmpeg-all.html#toc-bandpass">36.47 bandpass</a></h2>
  22921. <p>Apply a two-pole Butterworth band-pass filter with central
  22922. frequency <var>frequency</var>, and (3dB-point) band-width width.
  22923. The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
  22924. instead of the default: constant 0dB peak gain.
  22925. The filter roll off at 6dB per octave (20dB per decade).
  22926. </p>
  22927. <p>The filter accepts the following options:
  22928. </p>
  22929. <dl compact="compact">
  22930. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  22931. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  22932. </p>
  22933. </dd>
  22934. <dt>&lsquo;<samp>csg</samp>&rsquo;</dt>
  22935. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  22936. </p>
  22937. </dd>
  22938. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  22939. <dd><p>Set method to specify band-width of filter.
  22940. </p><dl compact="compact">
  22941. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  22942. <dd><p>Hz
  22943. </p></dd>
  22944. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  22945. <dd><p>Q-Factor
  22946. </p></dd>
  22947. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  22948. <dd><p>octave
  22949. </p></dd>
  22950. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  22951. <dd><p>slope
  22952. </p></dd>
  22953. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  22954. <dd><p>kHz
  22955. </p></dd>
  22956. </dl>
  22957. </dd>
  22958. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  22959. <dd><p>Specify the band-width of a filter in width_type units.
  22960. </p>
  22961. </dd>
  22962. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  22963. <dd><p>How much to use filtered signal in output. Default is 1.
  22964. Range is between 0 and 1.
  22965. </p>
  22966. </dd>
  22967. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  22968. <dd><p>Specify which channels to filter, by default all available are filtered.
  22969. </p>
  22970. </dd>
  22971. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  22972. <dd><p>Normalize biquad coefficients, by default is disabled.
  22973. Enabling it will normalize magnitude response at DC to 0dB.
  22974. </p></dd>
  22975. </dl>
  22976. <a name="Commands-33"></a>
  22977. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-33">36.47.1 Commands</a></h3>
  22978. <p>This filter supports the following commands:
  22979. </p><dl compact="compact">
  22980. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  22981. <dd><p>Change bandpass frequency.
  22982. Syntax for the command is : &quot;<var>frequency</var>&quot;
  22983. </p>
  22984. </dd>
  22985. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  22986. <dd><p>Change bandpass width_type.
  22987. Syntax for the command is : &quot;<var>width_type</var>&quot;
  22988. </p>
  22989. </dd>
  22990. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  22991. <dd><p>Change bandpass width.
  22992. Syntax for the command is : &quot;<var>width</var>&quot;
  22993. </p>
  22994. </dd>
  22995. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  22996. <dd><p>Change bandpass mix.
  22997. Syntax for the command is : &quot;<var>mix</var>&quot;
  22998. </p></dd>
  22999. </dl>
  23000. <a name="bandreject"></a>
  23001. <h2 class="section"><a href="ffmpeg-all.html#toc-bandreject">36.48 bandreject</a></h2>
  23002. <p>Apply a two-pole Butterworth band-reject filter with central
  23003. frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
  23004. The filter roll off at 6dB per octave (20dB per decade).
  23005. </p>
  23006. <p>The filter accepts the following options:
  23007. </p>
  23008. <dl compact="compact">
  23009. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23010. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  23011. </p>
  23012. </dd>
  23013. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23014. <dd><p>Set method to specify band-width of filter.
  23015. </p><dl compact="compact">
  23016. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23017. <dd><p>Hz
  23018. </p></dd>
  23019. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23020. <dd><p>Q-Factor
  23021. </p></dd>
  23022. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23023. <dd><p>octave
  23024. </p></dd>
  23025. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23026. <dd><p>slope
  23027. </p></dd>
  23028. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23029. <dd><p>kHz
  23030. </p></dd>
  23031. </dl>
  23032. </dd>
  23033. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23034. <dd><p>Specify the band-width of a filter in width_type units.
  23035. </p>
  23036. </dd>
  23037. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23038. <dd><p>How much to use filtered signal in output. Default is 1.
  23039. Range is between 0 and 1.
  23040. </p>
  23041. </dd>
  23042. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23043. <dd><p>Specify which channels to filter, by default all available are filtered.
  23044. </p>
  23045. </dd>
  23046. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23047. <dd><p>Normalize biquad coefficients, by default is disabled.
  23048. Enabling it will normalize magnitude response at DC to 0dB.
  23049. </p></dd>
  23050. </dl>
  23051. <a name="Commands"></a>
  23052. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands">36.48.1 Commands</a></h3>
  23053. <p>This filter supports the following commands:
  23054. </p><dl compact="compact">
  23055. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23056. <dd><p>Change bandreject frequency.
  23057. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23058. </p>
  23059. </dd>
  23060. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23061. <dd><p>Change bandreject width_type.
  23062. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23063. </p>
  23064. </dd>
  23065. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23066. <dd><p>Change bandreject width.
  23067. Syntax for the command is : &quot;<var>width</var>&quot;
  23068. </p>
  23069. </dd>
  23070. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23071. <dd><p>Change bandreject mix.
  23072. Syntax for the command is : &quot;<var>mix</var>&quot;
  23073. </p></dd>
  23074. </dl>
  23075. <a name="bass_002c-lowshelf"></a>
  23076. <h2 class="section"><a href="ffmpeg-all.html#toc-bass_002c-lowshelf">36.49 bass, lowshelf</a></h2>
  23077. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  23078. shelving filter with a response similar to that of a standard
  23079. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  23080. </p>
  23081. <p>The filter accepts the following options:
  23082. </p>
  23083. <dl compact="compact">
  23084. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23085. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  23086. (for a large cut) to +20 (for a large boost).
  23087. Beware of clipping when using a positive gain.
  23088. </p>
  23089. </dd>
  23090. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23091. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  23092. to extend or reduce the frequency range to be boosted or cut.
  23093. The default value is <code>100</code> Hz.
  23094. </p>
  23095. </dd>
  23096. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23097. <dd><p>Set method to specify band-width of filter.
  23098. </p><dl compact="compact">
  23099. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23100. <dd><p>Hz
  23101. </p></dd>
  23102. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23103. <dd><p>Q-Factor
  23104. </p></dd>
  23105. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23106. <dd><p>octave
  23107. </p></dd>
  23108. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23109. <dd><p>slope
  23110. </p></dd>
  23111. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23112. <dd><p>kHz
  23113. </p></dd>
  23114. </dl>
  23115. </dd>
  23116. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23117. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  23118. </p>
  23119. </dd>
  23120. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23121. <dd><p>How much to use filtered signal in output. Default is 1.
  23122. Range is between 0 and 1.
  23123. </p>
  23124. </dd>
  23125. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23126. <dd><p>Specify which channels to filter, by default all available are filtered.
  23127. </p>
  23128. </dd>
  23129. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23130. <dd><p>Normalize biquad coefficients, by default is disabled.
  23131. Enabling it will normalize magnitude response at DC to 0dB.
  23132. </p></dd>
  23133. </dl>
  23134. <a name="Commands-15"></a>
  23135. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-15">36.49.1 Commands</a></h3>
  23136. <p>This filter supports the following commands:
  23137. </p><dl compact="compact">
  23138. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23139. <dd><p>Change bass frequency.
  23140. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23141. </p>
  23142. </dd>
  23143. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23144. <dd><p>Change bass width_type.
  23145. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23146. </p>
  23147. </dd>
  23148. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23149. <dd><p>Change bass width.
  23150. Syntax for the command is : &quot;<var>width</var>&quot;
  23151. </p>
  23152. </dd>
  23153. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23154. <dd><p>Change bass gain.
  23155. Syntax for the command is : &quot;<var>gain</var>&quot;
  23156. </p>
  23157. </dd>
  23158. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23159. <dd><p>Change bass mix.
  23160. Syntax for the command is : &quot;<var>mix</var>&quot;
  23161. </p></dd>
  23162. </dl>
  23163. <a name="biquad"></a>
  23164. <h2 class="section"><a href="ffmpeg-all.html#toc-biquad">36.50 biquad</a></h2>
  23165. <p>Apply a biquad IIR filter with the given coefficients.
  23166. Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
  23167. are the numerator and denominator coefficients respectively.
  23168. and <var>channels</var>, <var>c</var> specify which channels to filter, by default all
  23169. available are filtered.
  23170. </p>
  23171. <a name="Commands-24"></a>
  23172. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-24">36.50.1 Commands</a></h3>
  23173. <p>This filter supports the following commands:
  23174. </p><dl compact="compact">
  23175. <dt>&lsquo;<samp>a0</samp>&rsquo;</dt>
  23176. <dt>&lsquo;<samp>a1</samp>&rsquo;</dt>
  23177. <dt>&lsquo;<samp>a2</samp>&rsquo;</dt>
  23178. <dt>&lsquo;<samp>b0</samp>&rsquo;</dt>
  23179. <dt>&lsquo;<samp>b1</samp>&rsquo;</dt>
  23180. <dt>&lsquo;<samp>b2</samp>&rsquo;</dt>
  23181. <dd><p>Change biquad parameter.
  23182. Syntax for the command is : &quot;<var>value</var>&quot;
  23183. </p>
  23184. </dd>
  23185. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23186. <dd><p>How much to use filtered signal in output. Default is 1.
  23187. Range is between 0 and 1.
  23188. </p>
  23189. </dd>
  23190. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23191. <dd><p>Specify which channels to filter, by default all available are filtered.
  23192. </p>
  23193. </dd>
  23194. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23195. <dd><p>Normalize biquad coefficients, by default is disabled.
  23196. Enabling it will normalize magnitude response at DC to 0dB.
  23197. </p></dd>
  23198. </dl>
  23199. <a name="bs2b"></a>
  23200. <h2 class="section"><a href="ffmpeg-all.html#toc-bs2b">36.51 bs2b</a></h2>
  23201. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  23202. stereo audio records.
  23203. </p>
  23204. <p>To enable compilation of this filter you need to configure FFmpeg with
  23205. <code>--enable-libbs2b</code>.
  23206. </p>
  23207. <p>It accepts the following parameters:
  23208. </p><dl compact="compact">
  23209. <dt>&lsquo;<samp>profile</samp>&rsquo;</dt>
  23210. <dd><p>Pre-defined crossfeed level.
  23211. </p><dl compact="compact">
  23212. <dt>&lsquo;<samp>default</samp>&rsquo;</dt>
  23213. <dd><p>Default level (fcut=700, feed=50).
  23214. </p>
  23215. </dd>
  23216. <dt>&lsquo;<samp>cmoy</samp>&rsquo;</dt>
  23217. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  23218. </p>
  23219. </dd>
  23220. <dt>&lsquo;<samp>jmeier</samp>&rsquo;</dt>
  23221. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  23222. </p>
  23223. </dd>
  23224. </dl>
  23225. </dd>
  23226. <dt>&lsquo;<samp>fcut</samp>&rsquo;</dt>
  23227. <dd><p>Cut frequency (in Hz).
  23228. </p>
  23229. </dd>
  23230. <dt>&lsquo;<samp>feed</samp>&rsquo;</dt>
  23231. <dd><p>Feed level (in Hz).
  23232. </p>
  23233. </dd>
  23234. </dl>
  23235. <a name="channelmap"></a>
  23236. <h2 class="section"><a href="ffmpeg-all.html#toc-channelmap">36.52 channelmap</a></h2>
  23237. <p>Remap input channels to new locations.
  23238. </p>
  23239. <p>It accepts the following parameters:
  23240. </p><dl compact="compact">
  23241. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  23242. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  23243. mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
  23244. <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
  23245. channel (e.g. FL for front left) or its index in the input channel layout.
  23246. <var>out_channel</var> is the name of the output channel or its index in the output
  23247. channel layout. If <var>out_channel</var> is not given then it is implicitly an
  23248. index, starting with zero and increasing by one for each mapping.
  23249. </p>
  23250. </dd>
  23251. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  23252. <dd><p>The channel layout of the output stream.
  23253. </p></dd>
  23254. </dl>
  23255. <p>If no mapping is present, the filter will implicitly map input channels to
  23256. output channels, preserving indices.
  23257. </p>
  23258. <a name="Examples-55"></a>
  23259. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-55">36.52.1 Examples</a></h3>
  23260. <ul>
  23261. <li>
  23262. For example, assuming a 5.1+downmix input MOV file,
  23263. <div class="example">
  23264. <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  23265. </pre></div>
  23266. <p>will create an output WAV file tagged as stereo from the downmix channels of
  23267. the input.
  23268. </p>
  23269. </li><li>
  23270. To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  23271. <div class="example">
  23272. <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  23273. </pre></div>
  23274. </li></ul>
  23275. <a name="channelsplit"></a>
  23276. <h2 class="section"><a href="ffmpeg-all.html#toc-channelsplit">36.53 channelsplit</a></h2>
  23277. <p>Split each channel from an input audio stream into a separate output stream.
  23278. </p>
  23279. <p>It accepts the following parameters:
  23280. </p><dl compact="compact">
  23281. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  23282. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  23283. </p></dd>
  23284. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  23285. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  23286. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  23287. </p>
  23288. <p>Choosing channels not present in channel layout in the input will result in an error.
  23289. </p></dd>
  23290. </dl>
  23291. <a name="Examples-5"></a>
  23292. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-5">36.53.1 Examples</a></h3>
  23293. <ul>
  23294. <li>
  23295. For example, assuming a stereo input MP3 file,
  23296. <div class="example">
  23297. <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  23298. </pre></div>
  23299. <p>will create an output Matroska file with two audio streams, one containing only
  23300. the left channel and the other the right channel.
  23301. </p>
  23302. </li><li>
  23303. Split a 5.1 WAV file into per-channel files:
  23304. <div class="example">
  23305. <pre class="example">ffmpeg -i in.wav -filter_complex
  23306. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  23307. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  23308. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  23309. side_right.wav
  23310. </pre></div>
  23311. </li><li>
  23312. Extract only LFE from a 5.1 WAV file:
  23313. <div class="example">
  23314. <pre class="example">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  23315. -map '[LFE]' lfe.wav
  23316. </pre></div>
  23317. </li></ul>
  23318. <a name="chorus"></a>
  23319. <h2 class="section"><a href="ffmpeg-all.html#toc-chorus">36.54 chorus</a></h2>
  23320. <p>Add a chorus effect to the audio.
  23321. </p>
  23322. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  23323. </p>
  23324. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  23325. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  23326. The modulation depth defines the range the modulated delay is played before or after
  23327. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  23328. sound tuned around the original one, like in a chorus where some vocals are slightly
  23329. off key.
  23330. </p>
  23331. <p>It accepts the following parameters:
  23332. </p><dl compact="compact">
  23333. <dt>&lsquo;<samp>in_gain</samp>&rsquo;</dt>
  23334. <dd><p>Set input gain. Default is 0.4.
  23335. </p>
  23336. </dd>
  23337. <dt>&lsquo;<samp>out_gain</samp>&rsquo;</dt>
  23338. <dd><p>Set output gain. Default is 0.4.
  23339. </p>
  23340. </dd>
  23341. <dt>&lsquo;<samp>delays</samp>&rsquo;</dt>
  23342. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  23343. </p>
  23344. </dd>
  23345. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  23346. <dd><p>Set decays.
  23347. </p>
  23348. </dd>
  23349. <dt>&lsquo;<samp>speeds</samp>&rsquo;</dt>
  23350. <dd><p>Set speeds.
  23351. </p>
  23352. </dd>
  23353. <dt>&lsquo;<samp>depths</samp>&rsquo;</dt>
  23354. <dd><p>Set depths.
  23355. </p></dd>
  23356. </dl>
  23357. <a name="Examples-33"></a>
  23358. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-33">36.54.1 Examples</a></h3>
  23359. <ul>
  23360. <li>
  23361. A single delay:
  23362. <div class="example">
  23363. <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
  23364. </pre></div>
  23365. </li><li>
  23366. Two delays:
  23367. <div class="example">
  23368. <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  23369. </pre></div>
  23370. </li><li>
  23371. Fuller sounding chorus with three delays:
  23372. <div class="example">
  23373. <pre class="example">chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
  23374. </pre></div>
  23375. </li></ul>
  23376. <a name="compand"></a>
  23377. <h2 class="section"><a href="ffmpeg-all.html#toc-compand">36.55 compand</a></h2>
  23378. <p>Compress or expand the audio&rsquo;s dynamic range.
  23379. </p>
  23380. <p>It accepts the following parameters:
  23381. </p>
  23382. <dl compact="compact">
  23383. <dt>&lsquo;<samp>attacks</samp>&rsquo;</dt>
  23384. <dt>&lsquo;<samp>decays</samp>&rsquo;</dt>
  23385. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  23386. of the input signal is averaged to determine its volume. <var>attacks</var> refers to
  23387. increase of volume and <var>decays</var> refers to decrease of volume. For most
  23388. situations, the attack time (response to the audio getting louder) should be
  23389. shorter than the decay time, because the human ear is more sensitive to sudden
  23390. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  23391. a typical value for decay is 0.8 seconds.
  23392. If specified number of attacks &amp; decays is lower than number of channels, the last
  23393. set attack/decay will be used for all remaining channels.
  23394. </p>
  23395. </dd>
  23396. <dt>&lsquo;<samp>points</samp>&rsquo;</dt>
  23397. <dd><p>A list of points for the transfer function, specified in dB relative to the
  23398. maximum possible signal amplitude. Each key points list must be defined using
  23399. the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
  23400. <code>x0/y0 x1/y1 x2/y2 ....</code>
  23401. </p>
  23402. <p>The input values must be in strictly increasing order but the transfer function
  23403. does not have to be monotonically rising. The point <code>0/0</code> is assumed but
  23404. may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
  23405. function are <code>-70/-70|-60/-20|1/0</code>.
  23406. </p>
  23407. </dd>
  23408. <dt>&lsquo;<samp>soft-knee</samp>&rsquo;</dt>
  23409. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  23410. </p>
  23411. </dd>
  23412. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  23413. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  23414. function. This allows for easy adjustment of the overall gain.
  23415. It defaults to 0.
  23416. </p>
  23417. </dd>
  23418. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  23419. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  23420. starts. This permits the user to supply a nominal level initially, so that, for
  23421. example, a very large gain is not applied to initial signal levels before the
  23422. companding has begun to operate. A typical value for audio which is initially
  23423. quiet is -90 dB. It defaults to 0.
  23424. </p>
  23425. </dd>
  23426. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  23427. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  23428. delayed before being fed to the volume adjuster. Specifying a delay
  23429. approximately equal to the attack/decay times allows the filter to effectively
  23430. operate in predictive rather than reactive mode. It defaults to 0.
  23431. </p>
  23432. </dd>
  23433. </dl>
  23434. <a name="Examples-120"></a>
  23435. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-120">36.55.1 Examples</a></h3>
  23436. <ul>
  23437. <li>
  23438. Make music with both quiet and loud passages suitable for listening to in a
  23439. noisy environment:
  23440. <div class="example">
  23441. <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  23442. </pre></div>
  23443. <p>Another example for audio with whisper and explosion parts:
  23444. </p><div class="example">
  23445. <pre class="example">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  23446. </pre></div>
  23447. </li><li>
  23448. A noise gate for when the noise is at a lower level than the signal:
  23449. <div class="example">
  23450. <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  23451. </pre></div>
  23452. </li><li>
  23453. Here is another noise gate, this time for when the noise is at a higher level
  23454. than the signal (making it, in some ways, similar to squelch):
  23455. <div class="example">
  23456. <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  23457. </pre></div>
  23458. </li><li>
  23459. 2:1 compression starting at -6dB:
  23460. <div class="example">
  23461. <pre class="example">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  23462. </pre></div>
  23463. </li><li>
  23464. 2:1 compression starting at -9dB:
  23465. <div class="example">
  23466. <pre class="example">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  23467. </pre></div>
  23468. </li><li>
  23469. 2:1 compression starting at -12dB:
  23470. <div class="example">
  23471. <pre class="example">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  23472. </pre></div>
  23473. </li><li>
  23474. 2:1 compression starting at -18dB:
  23475. <div class="example">
  23476. <pre class="example">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  23477. </pre></div>
  23478. </li><li>
  23479. 3:1 compression starting at -15dB:
  23480. <div class="example">
  23481. <pre class="example">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  23482. </pre></div>
  23483. </li><li>
  23484. Compressor/Gate:
  23485. <div class="example">
  23486. <pre class="example">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  23487. </pre></div>
  23488. </li><li>
  23489. Expander:
  23490. <div class="example">
  23491. <pre class="example">compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
  23492. </pre></div>
  23493. </li><li>
  23494. Hard limiter at -6dB:
  23495. <div class="example">
  23496. <pre class="example">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  23497. </pre></div>
  23498. </li><li>
  23499. Hard limiter at -12dB:
  23500. <div class="example">
  23501. <pre class="example">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  23502. </pre></div>
  23503. </li><li>
  23504. Hard noise gate at -35 dB:
  23505. <div class="example">
  23506. <pre class="example">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  23507. </pre></div>
  23508. </li><li>
  23509. Soft limiter:
  23510. <div class="example">
  23511. <pre class="example">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  23512. </pre></div>
  23513. </li></ul>
  23514. <a name="compensationdelay"></a>
  23515. <h2 class="section"><a href="ffmpeg-all.html#toc-compensationdelay">36.56 compensationdelay</a></h2>
  23516. <p>Compensation Delay Line is a metric based delay to compensate differing
  23517. positions of microphones or speakers.
  23518. </p>
  23519. <p>For example, you have recorded guitar with two microphones placed in
  23520. different locations. Because the front of sound wave has fixed speed in
  23521. normal conditions, the phasing of microphones can vary and depends on
  23522. their location and interposition. The best sound mix can be achieved when
  23523. these microphones are in phase (synchronized). Note that a distance of
  23524. ~30 cm between microphones makes one microphone capture the signal in
  23525. antiphase to the other microphone. That makes the final mix sound moody.
  23526. This filter helps to solve phasing problems by adding different delays
  23527. to each microphone track and make them synchronized.
  23528. </p>
  23529. <p>The best result can be reached when you take one track as base and
  23530. synchronize other tracks one by one with it.
  23531. Remember that synchronization/delay tolerance depends on sample rate, too.
  23532. Higher sample rates will give more tolerance.
  23533. </p>
  23534. <p>The filter accepts the following parameters:
  23535. </p>
  23536. <dl compact="compact">
  23537. <dt>&lsquo;<samp>mm</samp>&rsquo;</dt>
  23538. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  23539. Default is 0.
  23540. </p>
  23541. </dd>
  23542. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  23543. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  23544. Default is 0.
  23545. </p>
  23546. </dd>
  23547. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  23548. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  23549. Default is 0.
  23550. </p>
  23551. </dd>
  23552. <dt>&lsquo;<samp>dry</samp>&rsquo;</dt>
  23553. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  23554. Default is 0.
  23555. </p>
  23556. </dd>
  23557. <dt>&lsquo;<samp>wet</samp>&rsquo;</dt>
  23558. <dd><p>Set wet amount. Amount of processed (wet) signal.
  23559. Default is 1.
  23560. </p>
  23561. </dd>
  23562. <dt>&lsquo;<samp>temp</samp>&rsquo;</dt>
  23563. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  23564. Default is 20.
  23565. </p></dd>
  23566. </dl>
  23567. <a name="crossfeed"></a>
  23568. <h2 class="section"><a href="ffmpeg-all.html#toc-crossfeed">36.57 crossfeed</a></h2>
  23569. <p>Apply headphone crossfeed filter.
  23570. </p>
  23571. <p>Crossfeed is the process of blending the left and right channels of stereo
  23572. audio recording.
  23573. It is mainly used to reduce extreme stereo separation of low frequencies.
  23574. </p>
  23575. <p>The intent is to produce more speaker like sound to the listener.
  23576. </p>
  23577. <p>The filter accepts the following options:
  23578. </p>
  23579. <dl compact="compact">
  23580. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  23581. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  23582. This sets gain of low shelf filter for side part of stereo image.
  23583. Default is -6dB. Max allowed is -30db when strength is set to 1.
  23584. </p>
  23585. </dd>
  23586. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  23587. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  23588. This sets cut off frequency of low shelf filter. Default is cut off near
  23589. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  23590. </p>
  23591. </dd>
  23592. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  23593. <dd><p>Set input gain. Default is 0.9.
  23594. </p>
  23595. </dd>
  23596. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  23597. <dd><p>Set output gain. Default is 1.
  23598. </p></dd>
  23599. </dl>
  23600. <a name="crystalizer"></a>
  23601. <h2 class="section"><a href="ffmpeg-all.html#toc-crystalizer">36.58 crystalizer</a></h2>
  23602. <p>Simple algorithm to expand audio dynamic range.
  23603. </p>
  23604. <p>The filter accepts the following options:
  23605. </p>
  23606. <dl compact="compact">
  23607. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  23608. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between 0.0
  23609. (unchanged sound) to 10.0 (maximum effect).
  23610. </p>
  23611. </dd>
  23612. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  23613. <dd><p>Enable clipping. By default is enabled.
  23614. </p></dd>
  23615. </dl>
  23616. <a name="Commands-47"></a>
  23617. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-47">36.58.1 Commands</a></h3>
  23618. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23619. </p>
  23620. <a name="dcshift"></a>
  23621. <h2 class="section"><a href="ffmpeg-all.html#toc-dcshift">36.59 dcshift</a></h2>
  23622. <p>Apply a DC shift to the audio.
  23623. </p>
  23624. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  23625. in the recording chain) from the audio. The effect of a DC offset is reduced
  23626. headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
  23627. a signal has a DC offset.
  23628. </p>
  23629. <dl compact="compact">
  23630. <dt>&lsquo;<samp>shift</samp>&rsquo;</dt>
  23631. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  23632. the audio.
  23633. </p>
  23634. </dd>
  23635. <dt>&lsquo;<samp>limitergain</samp>&rsquo;</dt>
  23636. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  23637. used to prevent clipping.
  23638. </p></dd>
  23639. </dl>
  23640. <a name="deesser"></a>
  23641. <h2 class="section"><a href="ffmpeg-all.html#toc-deesser">36.60 deesser</a></h2>
  23642. <p>Apply de-essing to the audio samples.
  23643. </p>
  23644. <dl compact="compact">
  23645. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  23646. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  23647. Default is 0.
  23648. </p>
  23649. </dd>
  23650. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  23651. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  23652. Default is 0.5.
  23653. </p>
  23654. </dd>
  23655. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  23656. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  23657. Default is 0.5.
  23658. </p>
  23659. </dd>
  23660. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23661. <dd><p>Set the output mode.
  23662. </p>
  23663. <p>It accepts the following values:
  23664. </p><dl compact="compact">
  23665. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  23666. <dd><p>Pass input unchanged.
  23667. </p>
  23668. </dd>
  23669. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23670. <dd><p>Pass ess filtered out.
  23671. </p>
  23672. </dd>
  23673. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  23674. <dd><p>Pass only ess.
  23675. </p>
  23676. <p>Default value is <var>o</var>.
  23677. </p></dd>
  23678. </dl>
  23679. </dd>
  23680. </dl>
  23681. <a name="drmeter"></a>
  23682. <h2 class="section"><a href="ffmpeg-all.html#toc-drmeter">36.61 drmeter</a></h2>
  23683. <p>Measure audio dynamic range.
  23684. </p>
  23685. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  23686. is found in transition material. And anything less that 8 have very poor dynamics
  23687. and is very compressed.
  23688. </p>
  23689. <p>The filter accepts the following options:
  23690. </p>
  23691. <dl compact="compact">
  23692. <dt>&lsquo;<samp>length</samp>&rsquo;</dt>
  23693. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  23694. Default is 3 seconds.
  23695. </p></dd>
  23696. </dl>
  23697. <a name="dynaudnorm"></a>
  23698. <h2 class="section"><a href="ffmpeg-all.html#toc-dynaudnorm">36.62 dynaudnorm</a></h2>
  23699. <p>Dynamic Audio Normalizer.
  23700. </p>
  23701. <p>This filter applies a certain amount of gain to the input audio in order
  23702. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  23703. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  23704. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  23705. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  23706. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  23707. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  23708. sections, in the sense that the volume of each section is brought to the
  23709. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  23710. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  23711. of the dynamic range *within* each section of the audio file.
  23712. </p>
  23713. <dl compact="compact">
  23714. <dt>&lsquo;<samp>framelen, f</samp>&rsquo;</dt>
  23715. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  23716. Default is 500 milliseconds.
  23717. The Dynamic Audio Normalizer processes the input audio in small chunks,
  23718. referred to as frames. This is required, because a peak magnitude has no
  23719. meaning for just a single sample value. Instead, we need to determine the
  23720. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  23721. normalizer would simply use the peak magnitude of the complete file, the
  23722. Dynamic Audio Normalizer determines the peak magnitude individually for each
  23723. frame. The length of a frame is specified in milliseconds. By default, the
  23724. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  23725. been found to give good results with most files.
  23726. Note that the exact frame length, in number of samples, will be determined
  23727. automatically, based on the sampling rate of the individual input audio file.
  23728. </p>
  23729. </dd>
  23730. <dt>&lsquo;<samp>gausssize, g</samp>&rsquo;</dt>
  23731. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  23732. number. Default is 31.
  23733. Probably the most important parameter of the Dynamic Audio Normalizer is the
  23734. <code>window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  23735. is specified in frames, centered around the current frame. For the sake of
  23736. simplicity, this must be an odd number. Consequently, the default value of 31
  23737. takes into account the current frame, as well as the 15 preceding frames and
  23738. the 15 subsequent frames. Using a larger window results in a stronger
  23739. smoothing effect and thus in less gain variation, i.e. slower gain
  23740. adaptation. Conversely, using a smaller window results in a weaker smoothing
  23741. effect and thus in more gain variation, i.e. faster gain adaptation.
  23742. In other words, the more you increase this value, the more the Dynamic Audio
  23743. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  23744. contrary, the more you decrease this value, the more the Dynamic Audio
  23745. Normalizer will behave like a dynamic range compressor.
  23746. </p>
  23747. </dd>
  23748. <dt>&lsquo;<samp>peak, p</samp>&rsquo;</dt>
  23749. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  23750. level for the normalized audio input. This filter will try to approach the
  23751. target peak magnitude as closely as possible, but at the same time it also
  23752. makes sure that the normalized signal will never exceed the peak magnitude.
  23753. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  23754. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  23755. It is not recommended to go above this value.
  23756. </p>
  23757. </dd>
  23758. <dt>&lsquo;<samp>maxgain, m</samp>&rsquo;</dt>
  23759. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  23760. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  23761. factor for each input frame, i.e. the maximum gain factor that does not
  23762. result in clipping or distortion. The maximum gain factor is determined by
  23763. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  23764. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  23765. (global) maximum gain factor. This is done in order to avoid excessive gain
  23766. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  23767. factor is 10.0, For most inputs the default value should be sufficient and
  23768. it usually is not recommended to increase this value. Though, for input
  23769. with an extremely low overall volume level, it may be necessary to allow even
  23770. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  23771. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  23772. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  23773. gain factors will smoothly approach the threshold value, but never exceed that
  23774. value.
  23775. </p>
  23776. </dd>
  23777. <dt>&lsquo;<samp>targetrms, r</samp>&rsquo;</dt>
  23778. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  23779. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  23780. This means that the maximum local gain factor for each frame is defined
  23781. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  23782. be amplified as much as possible without exceeding the maximum signal
  23783. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  23784. Normalizer can also take into account the frame&rsquo;s root mean square,
  23785. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  23786. determine the power of a time-varying signal. It is therefore considered
  23787. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  23788. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  23789. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  23790. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  23791. factor is defined as the factor that would result in exactly that RMS value.
  23792. Note, however, that the maximum local gain factor is still restricted by the
  23793. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  23794. </p>
  23795. </dd>
  23796. <dt>&lsquo;<samp>coupling, n</samp>&rsquo;</dt>
  23797. <dd><p>Enable channels coupling. By default is enabled.
  23798. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  23799. amount. This means the same gain factor will be applied to all channels, i.e.
  23800. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  23801. However, in some recordings, it may happen that the volume of the different
  23802. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  23803. In this case, this option can be used to disable the channel coupling. This way,
  23804. the gain factor will be determined independently for each channel, depending
  23805. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  23806. harmonizing the volume of the different channels.
  23807. </p>
  23808. </dd>
  23809. <dt>&lsquo;<samp>correctdc, c</samp>&rsquo;</dt>
  23810. <dd><p>Enable DC bias correction. By default is disabled.
  23811. An audio signal (in the time domain) is a sequence of sample values.
  23812. In the Dynamic Audio Normalizer these sample values are represented in the
  23813. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  23814. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  23815. That means if we calculate the mean value of all samples in a file, or in a
  23816. single frame, then the result should be 0.0 or at least very close to that
  23817. value. If, however, there is a significant deviation of the mean value from
  23818. 0.0, in either positive or negative direction, this is referred to as a
  23819. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  23820. Audio Normalizer provides optional DC bias correction.
  23821. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  23822. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  23823. that value from all of the frame&rsquo;s sample values which ensures those samples
  23824. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  23825. boundaries, the DC correction offset values will be interpolated smoothly
  23826. between neighbouring frames.
  23827. </p>
  23828. </dd>
  23829. <dt>&lsquo;<samp>altboundary, b</samp>&rsquo;</dt>
  23830. <dd><p>Enable alternative boundary mode. By default is disabled.
  23831. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  23832. around each frame. This includes the preceding frames as well as the
  23833. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  23834. beginning and at the very end of the audio file, not all neighbouring
  23835. frames are available. In particular, for the first few frames in the audio
  23836. file, the preceding frames are not known. And, similarly, for the last few
  23837. frames in the audio file, the subsequent frames are not known. Thus, the
  23838. question arises which gain factors should be assumed for the missing frames
  23839. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  23840. to deal with this situation. The default boundary mode assumes a gain factor
  23841. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  23842. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  23843. </p>
  23844. </dd>
  23845. <dt>&lsquo;<samp>compress, s</samp>&rsquo;</dt>
  23846. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  23847. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  23848. compression. This means that signal peaks will not be pruned and thus the
  23849. full dynamic range will be retained within each local neighbourhood. However,
  23850. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  23851. normalization algorithm with a more &quot;traditional&quot; compression.
  23852. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  23853. (thresholding) function. If (and only if) the compression feature is enabled,
  23854. all input frames will be processed by a soft knee thresholding function prior
  23855. to the actual normalization process. Put simply, the thresholding function is
  23856. going to prune all samples whose magnitude exceeds a certain threshold value.
  23857. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  23858. value. Instead, the threshold value will be adjusted for each individual
  23859. frame.
  23860. In general, smaller parameters result in stronger compression, and vice versa.
  23861. Values below 3.0 are not recommended, because audible distortion may appear.
  23862. </p>
  23863. </dd>
  23864. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  23865. <dd><p>Set the target threshold value. This specifies the lowest permissible
  23866. magnitude level for the audio input which will be normalized.
  23867. If input frame volume is above this value frame will be normalized.
  23868. Otherwise frame may not be normalized at all. The default value is set
  23869. to 0, which means all input frames will be normalized.
  23870. This option is mostly useful if digital noise is not wanted to be amplified.
  23871. </p></dd>
  23872. </dl>
  23873. <a name="Commands-44"></a>
  23874. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-44">36.62.1 Commands</a></h3>
  23875. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23876. </p>
  23877. <a name="earwax"></a>
  23878. <h2 class="section"><a href="ffmpeg-all.html#toc-earwax">36.63 earwax</a></h2>
  23879. <p>Make audio easier to listen to on headphones.
  23880. </p>
  23881. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  23882. so that when listened to on headphones the stereo image is moved from
  23883. inside your head (standard for headphones) to outside and in front of
  23884. the listener (standard for speakers).
  23885. </p>
  23886. <p>Ported from SoX.
  23887. </p>
  23888. <a name="equalizer"></a>
  23889. <h2 class="section"><a href="ffmpeg-all.html#toc-equalizer">36.64 equalizer</a></h2>
  23890. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  23891. filter, the signal-level at and around a selected frequency can
  23892. be increased or decreased, whilst (unlike bandpass and bandreject
  23893. filters) that at all other frequencies is unchanged.
  23894. </p>
  23895. <p>In order to produce complex equalisation curves, this filter can
  23896. be given several times, each with a different central frequency.
  23897. </p>
  23898. <p>The filter accepts the following options:
  23899. </p>
  23900. <dl compact="compact">
  23901. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23902. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  23903. </p>
  23904. </dd>
  23905. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23906. <dd><p>Set method to specify band-width of filter.
  23907. </p><dl compact="compact">
  23908. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  23909. <dd><p>Hz
  23910. </p></dd>
  23911. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  23912. <dd><p>Q-Factor
  23913. </p></dd>
  23914. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  23915. <dd><p>octave
  23916. </p></dd>
  23917. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  23918. <dd><p>slope
  23919. </p></dd>
  23920. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  23921. <dd><p>kHz
  23922. </p></dd>
  23923. </dl>
  23924. </dd>
  23925. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23926. <dd><p>Specify the band-width of a filter in width_type units.
  23927. </p>
  23928. </dd>
  23929. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23930. <dd><p>Set the required gain or attenuation in dB.
  23931. Beware of clipping when using a positive gain.
  23932. </p>
  23933. </dd>
  23934. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23935. <dd><p>How much to use filtered signal in output. Default is 1.
  23936. Range is between 0 and 1.
  23937. </p>
  23938. </dd>
  23939. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  23940. <dd><p>Specify which channels to filter, by default all available are filtered.
  23941. </p>
  23942. </dd>
  23943. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  23944. <dd><p>Normalize biquad coefficients, by default is disabled.
  23945. Enabling it will normalize magnitude response at DC to 0dB.
  23946. </p></dd>
  23947. </dl>
  23948. <a name="Examples-36"></a>
  23949. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-36">36.64.1 Examples</a></h3>
  23950. <ul>
  23951. <li>
  23952. Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  23953. <div class="example">
  23954. <pre class="example">equalizer=f=1000:t=h:width=200:g=-10
  23955. </pre></div>
  23956. </li><li>
  23957. Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  23958. <div class="example">
  23959. <pre class="example">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  23960. </pre></div>
  23961. </li></ul>
  23962. <a name="Commands-34"></a>
  23963. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-34">36.64.2 Commands</a></h3>
  23964. <p>This filter supports the following commands:
  23965. </p><dl compact="compact">
  23966. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  23967. <dd><p>Change equalizer frequency.
  23968. Syntax for the command is : &quot;<var>frequency</var>&quot;
  23969. </p>
  23970. </dd>
  23971. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  23972. <dd><p>Change equalizer width_type.
  23973. Syntax for the command is : &quot;<var>width_type</var>&quot;
  23974. </p>
  23975. </dd>
  23976. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  23977. <dd><p>Change equalizer width.
  23978. Syntax for the command is : &quot;<var>width</var>&quot;
  23979. </p>
  23980. </dd>
  23981. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  23982. <dd><p>Change equalizer gain.
  23983. Syntax for the command is : &quot;<var>gain</var>&quot;
  23984. </p>
  23985. </dd>
  23986. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  23987. <dd><p>Change equalizer mix.
  23988. Syntax for the command is : &quot;<var>mix</var>&quot;
  23989. </p></dd>
  23990. </dl>
  23991. <a name="extrastereo"></a>
  23992. <h2 class="section"><a href="ffmpeg-all.html#toc-extrastereo">36.65 extrastereo</a></h2>
  23993. <p>Linearly increases the difference between left and right channels which
  23994. adds some sort of &quot;live&quot; effect to playback.
  23995. </p>
  23996. <p>The filter accepts the following options:
  23997. </p>
  23998. <dl compact="compact">
  23999. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  24000. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  24001. (average of both channels), with 1.0 sound will be unchanged, with
  24002. -1.0 left and right channels will be swapped.
  24003. </p>
  24004. </dd>
  24005. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  24006. <dd><p>Enable clipping. By default is enabled.
  24007. </p></dd>
  24008. </dl>
  24009. <a name="Commands-39"></a>
  24010. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-39">36.65.1 Commands</a></h3>
  24011. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  24012. </p>
  24013. <a name="firequalizer"></a>
  24014. <h2 class="section"><a href="ffmpeg-all.html#toc-firequalizer">36.66 firequalizer</a></h2>
  24015. <p>Apply FIR Equalization using arbitrary frequency response.
  24016. </p>
  24017. <p>The filter accepts the following option:
  24018. </p>
  24019. <dl compact="compact">
  24020. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  24021. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  24022. </p><dl compact="compact">
  24023. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  24024. <dd><p>the evaluated frequency
  24025. </p></dd>
  24026. <dt>&lsquo;<samp>sr</samp>&rsquo;</dt>
  24027. <dd><p>sample rate
  24028. </p></dd>
  24029. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  24030. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  24031. </p></dd>
  24032. <dt>&lsquo;<samp>chid</samp>&rsquo;</dt>
  24033. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  24034. multichannels evaluation is disabled
  24035. </p></dd>
  24036. <dt>&lsquo;<samp>chs</samp>&rsquo;</dt>
  24037. <dd><p>number of channels
  24038. </p></dd>
  24039. <dt>&lsquo;<samp>chlayout</samp>&rsquo;</dt>
  24040. <dd><p>channel_layout, see libavutil/channel_layout.h
  24041. </p>
  24042. </dd>
  24043. </dl>
  24044. <p>and functions:
  24045. </p><dl compact="compact">
  24046. <dt>&lsquo;<samp>gain_interpolate(f)</samp>&rsquo;</dt>
  24047. <dd><p>interpolate gain on frequency f based on gain_entry
  24048. </p></dd>
  24049. <dt>&lsquo;<samp>cubic_interpolate(f)</samp>&rsquo;</dt>
  24050. <dd><p>same as gain_interpolate, but smoother
  24051. </p></dd>
  24052. </dl>
  24053. <p>This option is also available as command. Default is <code>gain_interpolate(f)</code>.
  24054. </p>
  24055. </dd>
  24056. <dt>&lsquo;<samp>gain_entry</samp>&rsquo;</dt>
  24057. <dd><p>Set gain entry for gain_interpolate function. The expression can
  24058. contain functions:
  24059. </p><dl compact="compact">
  24060. <dt>&lsquo;<samp>entry(f, g)</samp>&rsquo;</dt>
  24061. <dd><p>store gain entry at frequency f with value g
  24062. </p></dd>
  24063. </dl>
  24064. <p>This option is also available as command.
  24065. </p>
  24066. </dd>
  24067. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  24068. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  24069. Default is <code>0.01</code>.
  24070. </p>
  24071. </dd>
  24072. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  24073. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  24074. Default is <code>5</code>.
  24075. </p>
  24076. </dd>
  24077. <dt>&lsquo;<samp>wfunc</samp>&rsquo;</dt>
  24078. <dd><p>Set window function. Acceptable values are:
  24079. </p><dl compact="compact">
  24080. <dt>&lsquo;<samp>rectangular</samp>&rsquo;</dt>
  24081. <dd><p>rectangular window, useful when gain curve is already smooth
  24082. </p></dd>
  24083. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  24084. <dd><p>hann window (default)
  24085. </p></dd>
  24086. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  24087. <dd><p>hamming window
  24088. </p></dd>
  24089. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  24090. <dd><p>blackman window
  24091. </p></dd>
  24092. <dt>&lsquo;<samp>nuttall3</samp>&rsquo;</dt>
  24093. <dd><p>3-terms continuous 1st derivative nuttall window
  24094. </p></dd>
  24095. <dt>&lsquo;<samp>mnuttall3</samp>&rsquo;</dt>
  24096. <dd><p>minimum 3-terms discontinuous nuttall window
  24097. </p></dd>
  24098. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  24099. <dd><p>4-terms continuous 1st derivative nuttall window
  24100. </p></dd>
  24101. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  24102. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  24103. </p></dd>
  24104. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  24105. <dd><p>blackman-harris window
  24106. </p></dd>
  24107. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  24108. <dd><p>tukey window
  24109. </p></dd>
  24110. </dl>
  24111. </dd>
  24112. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  24113. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  24114. filtering with large delay. Default is disabled.
  24115. </p>
  24116. </dd>
  24117. <dt>&lsquo;<samp>multi</samp>&rsquo;</dt>
  24118. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  24119. </p>
  24120. </dd>
  24121. <dt>&lsquo;<samp>zero_phase</samp>&rsquo;</dt>
  24122. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  24123. Default is disabled.
  24124. </p>
  24125. </dd>
  24126. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  24127. <dd><p>Set scale used by gain. Acceptable values are:
  24128. </p><dl compact="compact">
  24129. <dt>&lsquo;<samp>linlin</samp>&rsquo;</dt>
  24130. <dd><p>linear frequency, linear gain
  24131. </p></dd>
  24132. <dt>&lsquo;<samp>linlog</samp>&rsquo;</dt>
  24133. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  24134. </p></dd>
  24135. <dt>&lsquo;<samp>loglin</samp>&rsquo;</dt>
  24136. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  24137. </p></dd>
  24138. <dt>&lsquo;<samp>loglog</samp>&rsquo;</dt>
  24139. <dd><p>logarithmic frequency, logarithmic gain
  24140. </p></dd>
  24141. </dl>
  24142. </dd>
  24143. <dt>&lsquo;<samp>dumpfile</samp>&rsquo;</dt>
  24144. <dd><p>Set file for dumping, suitable for gnuplot.
  24145. </p>
  24146. </dd>
  24147. <dt>&lsquo;<samp>dumpscale</samp>&rsquo;</dt>
  24148. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  24149. Default is linlog.
  24150. </p>
  24151. </dd>
  24152. <dt>&lsquo;<samp>fft2</samp>&rsquo;</dt>
  24153. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  24154. Default is disabled.
  24155. </p>
  24156. </dd>
  24157. <dt>&lsquo;<samp>min_phase</samp>&rsquo;</dt>
  24158. <dd><p>Enable minimum phase impulse response. Default is disabled.
  24159. </p></dd>
  24160. </dl>
  24161. <a name="Examples-171"></a>
  24162. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-171">36.66.1 Examples</a></h3>
  24163. <ul>
  24164. <li>
  24165. lowpass at 1000 Hz:
  24166. <div class="example">
  24167. <pre class="example">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  24168. </pre></div>
  24169. </li><li>
  24170. lowpass at 1000 Hz with gain_entry:
  24171. <div class="example">
  24172. <pre class="example">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  24173. </pre></div>
  24174. </li><li>
  24175. custom equalization:
  24176. <div class="example">
  24177. <pre class="example">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  24178. </pre></div>
  24179. </li><li>
  24180. higher delay with zero phase to compensate delay:
  24181. <div class="example">
  24182. <pre class="example">firequalizer=delay=0.1:fixed=on:zero_phase=on
  24183. </pre></div>
  24184. </li><li>
  24185. lowpass on left channel, highpass on right channel:
  24186. <div class="example">
  24187. <pre class="example">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  24188. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  24189. </pre></div>
  24190. </li></ul>
  24191. <a name="flanger"></a>
  24192. <h2 class="section"><a href="ffmpeg-all.html#toc-flanger">36.67 flanger</a></h2>
  24193. <p>Apply a flanging effect to the audio.
  24194. </p>
  24195. <p>The filter accepts the following options:
  24196. </p>
  24197. <dl compact="compact">
  24198. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  24199. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  24200. </p>
  24201. </dd>
  24202. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  24203. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  24204. </p>
  24205. </dd>
  24206. <dt>&lsquo;<samp>regen</samp>&rsquo;</dt>
  24207. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  24208. Default value is 0.
  24209. </p>
  24210. </dd>
  24211. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  24212. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  24213. Default value is 71.
  24214. </p>
  24215. </dd>
  24216. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  24217. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  24218. </p>
  24219. </dd>
  24220. <dt>&lsquo;<samp>shape</samp>&rsquo;</dt>
  24221. <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
  24222. Default value is <var>sinusoidal</var>.
  24223. </p>
  24224. </dd>
  24225. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  24226. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  24227. Default value is 25.
  24228. </p>
  24229. </dd>
  24230. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  24231. <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
  24232. Default is <var>linear</var>.
  24233. </p></dd>
  24234. </dl>
  24235. <a name="haas"></a>
  24236. <h2 class="section"><a href="ffmpeg-all.html#toc-haas">36.68 haas</a></h2>
  24237. <p>Apply Haas effect to audio.
  24238. </p>
  24239. <p>Note that this makes most sense to apply on mono signals.
  24240. With this filter applied to mono signals it give some directionality and
  24241. stretches its stereo image.
  24242. </p>
  24243. <p>The filter accepts the following options:
  24244. </p>
  24245. <dl compact="compact">
  24246. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  24247. <dd><p>Set input level. By default is <var>1</var>, or 0dB
  24248. </p>
  24249. </dd>
  24250. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  24251. <dd><p>Set output level. By default is <var>1</var>, or 0dB.
  24252. </p>
  24253. </dd>
  24254. <dt>&lsquo;<samp>side_gain</samp>&rsquo;</dt>
  24255. <dd><p>Set gain applied to side part of signal. By default is <var>1</var>.
  24256. </p>
  24257. </dd>
  24258. <dt>&lsquo;<samp>middle_source</samp>&rsquo;</dt>
  24259. <dd><p>Set kind of middle source. Can be one of the following:
  24260. </p>
  24261. <dl compact="compact">
  24262. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  24263. <dd><p>Pick left channel.
  24264. </p>
  24265. </dd>
  24266. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  24267. <dd><p>Pick right channel.
  24268. </p>
  24269. </dd>
  24270. <dt>&lsquo;<samp>mid</samp>&rsquo;</dt>
  24271. <dd><p>Pick middle part signal of stereo image.
  24272. </p>
  24273. </dd>
  24274. <dt>&lsquo;<samp>side</samp>&rsquo;</dt>
  24275. <dd><p>Pick side part signal of stereo image.
  24276. </p></dd>
  24277. </dl>
  24278. </dd>
  24279. <dt>&lsquo;<samp>middle_phase</samp>&rsquo;</dt>
  24280. <dd><p>Change middle phase. By default is disabled.
  24281. </p>
  24282. </dd>
  24283. <dt>&lsquo;<samp>left_delay</samp>&rsquo;</dt>
  24284. <dd><p>Set left channel delay. By default is <var>2.05</var> milliseconds.
  24285. </p>
  24286. </dd>
  24287. <dt>&lsquo;<samp>left_balance</samp>&rsquo;</dt>
  24288. <dd><p>Set left channel balance. By default is <var>-1</var>.
  24289. </p>
  24290. </dd>
  24291. <dt>&lsquo;<samp>left_gain</samp>&rsquo;</dt>
  24292. <dd><p>Set left channel gain. By default is <var>1</var>.
  24293. </p>
  24294. </dd>
  24295. <dt>&lsquo;<samp>left_phase</samp>&rsquo;</dt>
  24296. <dd><p>Change left phase. By default is disabled.
  24297. </p>
  24298. </dd>
  24299. <dt>&lsquo;<samp>right_delay</samp>&rsquo;</dt>
  24300. <dd><p>Set right channel delay. By defaults is <var>2.12</var> milliseconds.
  24301. </p>
  24302. </dd>
  24303. <dt>&lsquo;<samp>right_balance</samp>&rsquo;</dt>
  24304. <dd><p>Set right channel balance. By default is <var>1</var>.
  24305. </p>
  24306. </dd>
  24307. <dt>&lsquo;<samp>right_gain</samp>&rsquo;</dt>
  24308. <dd><p>Set right channel gain. By default is <var>1</var>.
  24309. </p>
  24310. </dd>
  24311. <dt>&lsquo;<samp>right_phase</samp>&rsquo;</dt>
  24312. <dd><p>Change right phase. By default is enabled.
  24313. </p></dd>
  24314. </dl>
  24315. <a name="hdcd"></a>
  24316. <h2 class="section"><a href="ffmpeg-all.html#toc-hdcd">36.69 hdcd</a></h2>
  24317. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  24318. embedded HDCD codes is expanded into a 20-bit PCM stream.
  24319. </p>
  24320. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  24321. of HDCD, and detects the Transient Filter flag.
  24322. </p>
  24323. <div class="example">
  24324. <pre class="example">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  24325. </pre></div>
  24326. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  24327. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  24328. like <code>-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  24329. </p><div class="example">
  24330. <pre class="example">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  24331. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  24332. </pre></div>
  24333. <p>The filter accepts the following options:
  24334. </p>
  24335. <dl compact="compact">
  24336. <dt>&lsquo;<samp>disable_autoconvert</samp>&rsquo;</dt>
  24337. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  24338. </p>
  24339. </dd>
  24340. <dt>&lsquo;<samp>process_stereo</samp>&rsquo;</dt>
  24341. <dd><p>Process the stereo channels together. If target_gain does not match between
  24342. channels, consider it invalid and use the last valid target_gain.
  24343. </p>
  24344. </dd>
  24345. <dt>&lsquo;<samp>cdt_ms</samp>&rsquo;</dt>
  24346. <dd><p>Set the code detect timer period in ms.
  24347. </p>
  24348. </dd>
  24349. <dt>&lsquo;<samp>force_pe</samp>&rsquo;</dt>
  24350. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  24351. </p>
  24352. </dd>
  24353. <dt>&lsquo;<samp>analyze_mode</samp>&rsquo;</dt>
  24354. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  24355. specific aspect of the decoding process. The output file can be loaded in
  24356. an audio editor alongside the original to aid analysis.
  24357. </p>
  24358. <p><code>analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  24359. </p>
  24360. <p>Modes are:
  24361. </p><dl compact="compact">
  24362. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  24363. <dd><p>Disabled
  24364. </p></dd>
  24365. <dt>&lsquo;<samp>1, lle</samp>&rsquo;</dt>
  24366. <dd><p>Gain adjustment level at each sample
  24367. </p></dd>
  24368. <dt>&lsquo;<samp>2, pe</samp>&rsquo;</dt>
  24369. <dd><p>Samples where peak extend occurs
  24370. </p></dd>
  24371. <dt>&lsquo;<samp>3, cdt</samp>&rsquo;</dt>
  24372. <dd><p>Samples where the code detect timer is active
  24373. </p></dd>
  24374. <dt>&lsquo;<samp>4, tgm</samp>&rsquo;</dt>
  24375. <dd><p>Samples where the target gain does not match between channels
  24376. </p></dd>
  24377. </dl>
  24378. </dd>
  24379. </dl>
  24380. <a name="headphone"></a>
  24381. <h2 class="section"><a href="ffmpeg-all.html#toc-headphone">36.70 headphone</a></h2>
  24382. <p>Apply head-related transfer functions (HRTFs) to create virtual
  24383. loudspeakers around the user for binaural listening via headphones.
  24384. The HRIRs are provided via additional streams, for each channel
  24385. one stereo input stream is needed.
  24386. </p>
  24387. <p>The filter accepts the following options:
  24388. </p>
  24389. <dl compact="compact">
  24390. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  24391. <dd><p>Set mapping of input streams for convolution.
  24392. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  24393. are given as additional stream inputs for filter.
  24394. This also specify number of input streams. Number of input streams
  24395. must be not less than number of channels in first stream plus one.
  24396. </p>
  24397. </dd>
  24398. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  24399. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  24400. </p>
  24401. </dd>
  24402. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  24403. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  24404. processing audio in time domain which is slow.
  24405. <var>freq</var> is processing audio in frequency domain which is fast.
  24406. Default is <var>freq</var>.
  24407. </p>
  24408. </dd>
  24409. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  24410. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  24411. </p>
  24412. </dd>
  24413. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  24414. <dd><p>Set size of frame in number of samples which will be processed at once.
  24415. Default value is <var>1024</var>. Allowed range is from 1024 to 96000.
  24416. </p>
  24417. </dd>
  24418. <dt>&lsquo;<samp>hrir</samp>&rsquo;</dt>
  24419. <dd><p>Set format of hrir stream.
  24420. Default value is <var>stereo</var>. Alternative value is <var>multich</var>.
  24421. If value is set to <var>stereo</var>, number of additional streams should
  24422. be greater or equal to number of input channels in first input stream.
  24423. Also each additional stream should have stereo number of channels.
  24424. If value is set to <var>multich</var>, number of additional streams should
  24425. be exactly one. Also number of input channels of additional stream
  24426. should be equal or greater than twice number of channels of first input
  24427. stream.
  24428. </p></dd>
  24429. </dl>
  24430. <a name="Examples-97"></a>
  24431. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-97">36.70.1 Examples</a></h3>
  24432. <ul>
  24433. <li>
  24434. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  24435. each amovie filter use stereo file with IR coefficients as input.
  24436. The files give coefficients for each position of virtual loudspeaker:
  24437. <div class="example">
  24438. <pre class="example">ffmpeg -i input.wav
  24439. -filter_complex &quot;amovie=azi_270_ele_0_DFC.wav[sr];amovie=azi_90_ele_0_DFC.wav[sl];amovie=azi_225_ele_0_DFC.wav[br];amovie=azi_135_ele_0_DFC.wav[bl];amovie=azi_0_ele_0_DFC.wav,asplit[fc][lfe];amovie=azi_35_ele_0_DFC.wav[fl];amovie=azi_325_ele_0_DFC.wav[fr];[0:a][fl][fr][fc][lfe][bl][br][sl][sr]headphone=FL|FR|FC|LFE|BL|BR|SL|SR&quot;
  24440. output.wav
  24441. </pre></div>
  24442. </li><li>
  24443. Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  24444. but now in <var>multich</var> <var>hrir</var> format.
  24445. <div class="example">
  24446. <pre class="example">ffmpeg -i input.wav -filter_complex &quot;amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich&quot;
  24447. output.wav
  24448. </pre></div>
  24449. </li></ul>
  24450. <a name="highpass"></a>
  24451. <h2 class="section"><a href="ffmpeg-all.html#toc-highpass">36.71 highpass</a></h2>
  24452. <p>Apply a high-pass filter with 3dB point frequency.
  24453. The filter can be either single-pole, or double-pole (the default).
  24454. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  24455. </p>
  24456. <p>The filter accepts the following options:
  24457. </p>
  24458. <dl compact="compact">
  24459. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24460. <dd><p>Set frequency in Hz. Default is 3000.
  24461. </p>
  24462. </dd>
  24463. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  24464. <dd><p>Set number of poles. Default is 2.
  24465. </p>
  24466. </dd>
  24467. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24468. <dd><p>Set method to specify band-width of filter.
  24469. </p><dl compact="compact">
  24470. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  24471. <dd><p>Hz
  24472. </p></dd>
  24473. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  24474. <dd><p>Q-Factor
  24475. </p></dd>
  24476. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  24477. <dd><p>octave
  24478. </p></dd>
  24479. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  24480. <dd><p>slope
  24481. </p></dd>
  24482. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  24483. <dd><p>kHz
  24484. </p></dd>
  24485. </dl>
  24486. </dd>
  24487. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24488. <dd><p>Specify the band-width of a filter in width_type units.
  24489. Applies only to double-pole filter.
  24490. The default is 0.707q and gives a Butterworth response.
  24491. </p>
  24492. </dd>
  24493. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24494. <dd><p>How much to use filtered signal in output. Default is 1.
  24495. Range is between 0 and 1.
  24496. </p>
  24497. </dd>
  24498. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  24499. <dd><p>Specify which channels to filter, by default all available are filtered.
  24500. </p>
  24501. </dd>
  24502. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  24503. <dd><p>Normalize biquad coefficients, by default is disabled.
  24504. Enabling it will normalize magnitude response at DC to 0dB.
  24505. </p></dd>
  24506. </dl>
  24507. <a name="Commands-35"></a>
  24508. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-35">36.71.1 Commands</a></h3>
  24509. <p>This filter supports the following commands:
  24510. </p><dl compact="compact">
  24511. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24512. <dd><p>Change highpass frequency.
  24513. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24514. </p>
  24515. </dd>
  24516. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24517. <dd><p>Change highpass width_type.
  24518. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24519. </p>
  24520. </dd>
  24521. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24522. <dd><p>Change highpass width.
  24523. Syntax for the command is : &quot;<var>width</var>&quot;
  24524. </p>
  24525. </dd>
  24526. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24527. <dd><p>Change highpass mix.
  24528. Syntax for the command is : &quot;<var>mix</var>&quot;
  24529. </p></dd>
  24530. </dl>
  24531. <a name="join"></a>
  24532. <h2 class="section"><a href="ffmpeg-all.html#toc-join">36.72 join</a></h2>
  24533. <p>Join multiple input streams into one multi-channel stream.
  24534. </p>
  24535. <p>It accepts the following parameters:
  24536. </p><dl compact="compact">
  24537. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  24538. <dd><p>The number of input streams. It defaults to 2.
  24539. </p>
  24540. </dd>
  24541. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  24542. <dd><p>The desired output channel layout. It defaults to stereo.
  24543. </p>
  24544. </dd>
  24545. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  24546. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  24547. mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
  24548. form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
  24549. can be either the name of the input channel (e.g. FL for front left) or its
  24550. index in the specified input stream. <var>out_channel</var> is the name of the output
  24551. channel.
  24552. </p></dd>
  24553. </dl>
  24554. <p>The filter will attempt to guess the mappings when they are not specified
  24555. explicitly. It does so by first trying to find an unused matching input channel
  24556. and if that fails it picks the first unused input channel.
  24557. </p>
  24558. <p>Join 3 inputs (with properly set channel layouts):
  24559. </p><div class="example">
  24560. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  24561. </pre></div>
  24562. <p>Build a 5.1 output from 6 single-channel streams:
  24563. </p><div class="example">
  24564. <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  24565. 'join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-SL|4.0-SR|5.0-LFE'
  24566. out
  24567. </pre></div>
  24568. <a name="ladspa"></a>
  24569. <h2 class="section"><a href="ffmpeg-all.html#toc-ladspa">36.73 ladspa</a></h2>
  24570. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  24571. </p>
  24572. <p>To enable compilation of this filter you need to configure FFmpeg with
  24573. <code>--enable-ladspa</code>.
  24574. </p>
  24575. <dl compact="compact">
  24576. <dt>&lsquo;<samp>file, f</samp>&rsquo;</dt>
  24577. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  24578. variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  24579. each one of the directories specified by the colon separated list in
  24580. <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  24581. this order: &lsquo;<tt>HOME/.ladspa/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/ladspa/</tt>&rsquo;,
  24582. &lsquo;<tt>/usr/lib/ladspa/</tt>&rsquo;.
  24583. </p>
  24584. </dd>
  24585. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  24586. <dd><p>Specifies the plugin within the library. Some libraries contain only
  24587. one plugin, but others contain many of them. If this is not set filter
  24588. will list all available plugins within the specified library.
  24589. </p>
  24590. </dd>
  24591. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  24592. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  24593. values that determine the behavior of the loaded plugin (for example delay,
  24594. threshold or gain).
  24595. Controls need to be defined using the following syntax:
  24596. c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
  24597. <var>valuei</var> is the value set on the <var>i</var>-th control.
  24598. Alternatively they can be also defined using the following syntax:
  24599. <var>value0</var>|<var>value1</var>|<var>value2</var>|..., where
  24600. <var>valuei</var> is the value set on the <var>i</var>-th control.
  24601. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  24602. their valid ranges are printed.
  24603. </p>
  24604. </dd>
  24605. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  24606. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  24607. zero inputs.
  24608. </p>
  24609. </dd>
  24610. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  24611. <dd><p>Set the number of samples per channel per each output frame, default
  24612. is 1024. Only used if plugin have zero inputs.
  24613. </p>
  24614. </dd>
  24615. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  24616. <dd><p>Set the minimum duration of the sourced audio. See
  24617. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  24618. for the accepted syntax.
  24619. Note that the resulting duration may be greater than the specified duration,
  24620. as the generated audio is always cut at the end of a complete frame.
  24621. If not specified, or the expressed duration is negative, the audio is
  24622. supposed to be generated forever.
  24623. Only used if plugin have zero inputs.
  24624. </p>
  24625. </dd>
  24626. </dl>
  24627. <a name="Examples-116"></a>
  24628. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-116">36.73.1 Examples</a></h3>
  24629. <ul>
  24630. <li>
  24631. List all available plugins within amp (LADSPA example plugin) library:
  24632. <div class="example">
  24633. <pre class="example">ladspa=file=amp
  24634. </pre></div>
  24635. </li><li>
  24636. List all available controls and their valid ranges for <code>vcf_notch</code>
  24637. plugin from <code>VCF</code> library:
  24638. <div class="example">
  24639. <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
  24640. </pre></div>
  24641. </li><li>
  24642. Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
  24643. plugin library:
  24644. <div class="example">
  24645. <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  24646. </pre></div>
  24647. </li><li>
  24648. Add reverberation to the audio using TAP-plugins
  24649. (Tom&rsquo;s Audio Processing plugins):
  24650. <div class="example">
  24651. <pre class="example">ladspa=file=tap_reverb:tap_reverb
  24652. </pre></div>
  24653. </li><li>
  24654. Generate white noise, with 0.2 amplitude:
  24655. <div class="example">
  24656. <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
  24657. </pre></div>
  24658. </li><li>
  24659. Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
  24660. <code>C* Audio Plugin Suite</code> (CAPS) library:
  24661. <div class="example">
  24662. <pre class="example">ladspa=file=caps:Click:c=c1=20'
  24663. </pre></div>
  24664. </li><li>
  24665. Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  24666. <div class="example">
  24667. <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  24668. </pre></div>
  24669. </li><li>
  24670. Increase volume by 20dB using fast lookahead limiter from Steve Harris
  24671. <code>SWH Plugins</code> collection:
  24672. <div class="example">
  24673. <pre class="example">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  24674. </pre></div>
  24675. </li><li>
  24676. Attenuate low frequencies using Multiband EQ from Steve Harris
  24677. <code>SWH Plugins</code> collection:
  24678. <div class="example">
  24679. <pre class="example">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  24680. </pre></div>
  24681. </li><li>
  24682. Reduce stereo image using <code>Narrower</code> from the <code>C* Audio Plugin Suite</code>
  24683. (CAPS) library:
  24684. <div class="example">
  24685. <pre class="example">ladspa=caps:Narrower
  24686. </pre></div>
  24687. </li><li>
  24688. Another white noise, now using <code>C* Audio Plugin Suite</code> (CAPS) library:
  24689. <div class="example">
  24690. <pre class="example">ladspa=caps:White:.2
  24691. </pre></div>
  24692. </li><li>
  24693. Some fractal noise, using <code>C* Audio Plugin Suite</code> (CAPS) library:
  24694. <div class="example">
  24695. <pre class="example">ladspa=caps:Fractal:c=c1=1
  24696. </pre></div>
  24697. </li><li>
  24698. Dynamic volume normalization using <code>VLevel</code> plugin:
  24699. <div class="example">
  24700. <pre class="example">ladspa=vlevel-ladspa:vlevel_mono
  24701. </pre></div>
  24702. </li></ul>
  24703. <a name="Commands-32"></a>
  24704. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-32">36.73.2 Commands</a></h3>
  24705. <p>This filter supports the following commands:
  24706. </p><dl compact="compact">
  24707. <dt>&lsquo;<samp>cN</samp>&rsquo;</dt>
  24708. <dd><p>Modify the <var>N</var>-th control value.
  24709. </p>
  24710. <p>If the specified value is not valid, it is ignored and prior one is kept.
  24711. </p></dd>
  24712. </dl>
  24713. <a name="loudnorm"></a>
  24714. <h2 class="section"><a href="ffmpeg-all.html#toc-loudnorm">36.74 loudnorm</a></h2>
  24715. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  24716. Support for both single pass (livestreams, files) and double pass (files) modes.
  24717. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  24718. detect true peaks, the audio stream will be upsampled to 192 kHz.
  24719. Use the <code>-ar</code> option or <code>aresample</code> filter to explicitly set an output sample rate.
  24720. </p>
  24721. <p>The filter accepts the following options:
  24722. </p>
  24723. <dl compact="compact">
  24724. <dt>&lsquo;<samp>I, i</samp>&rsquo;</dt>
  24725. <dd><p>Set integrated loudness target.
  24726. Range is -70.0 - -5.0. Default value is -24.0.
  24727. </p>
  24728. </dd>
  24729. <dt>&lsquo;<samp>LRA, lra</samp>&rsquo;</dt>
  24730. <dd><p>Set loudness range target.
  24731. Range is 1.0 - 20.0. Default value is 7.0.
  24732. </p>
  24733. </dd>
  24734. <dt>&lsquo;<samp>TP, tp</samp>&rsquo;</dt>
  24735. <dd><p>Set maximum true peak.
  24736. Range is -9.0 - +0.0. Default value is -2.0.
  24737. </p>
  24738. </dd>
  24739. <dt>&lsquo;<samp>measured_I, measured_i</samp>&rsquo;</dt>
  24740. <dd><p>Measured IL of input file.
  24741. Range is -99.0 - +0.0.
  24742. </p>
  24743. </dd>
  24744. <dt>&lsquo;<samp>measured_LRA, measured_lra</samp>&rsquo;</dt>
  24745. <dd><p>Measured LRA of input file.
  24746. Range is 0.0 - 99.0.
  24747. </p>
  24748. </dd>
  24749. <dt>&lsquo;<samp>measured_TP, measured_tp</samp>&rsquo;</dt>
  24750. <dd><p>Measured true peak of input file.
  24751. Range is -99.0 - +99.0.
  24752. </p>
  24753. </dd>
  24754. <dt>&lsquo;<samp>measured_thresh</samp>&rsquo;</dt>
  24755. <dd><p>Measured threshold of input file.
  24756. Range is -99.0 - +0.0.
  24757. </p>
  24758. </dd>
  24759. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  24760. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  24761. Range is -99.0 - +99.0. Default is +0.0.
  24762. </p>
  24763. </dd>
  24764. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  24765. <dd><p>Normalize by linearly scaling the source audio.
  24766. <code>measured_I</code>, <code>measured_LRA</code>, <code>measured_TP</code>,
  24767. and <code>measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  24768. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  24769. result in a true peak which exceeds the target TP. If any of these
  24770. conditions aren&rsquo;t met, normalization mode will revert to <var>dynamic</var>.
  24771. Options are <code>true</code> or <code>false</code>. Default is <code>true</code>.
  24772. </p>
  24773. </dd>
  24774. <dt>&lsquo;<samp>dual_mono</samp>&rsquo;</dt>
  24775. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  24776. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  24777. If set to <code>true</code>, this option will compensate for this effect.
  24778. Multi-channel input files are not affected by this option.
  24779. Options are true or false. Default is false.
  24780. </p>
  24781. </dd>
  24782. <dt>&lsquo;<samp>print_format</samp>&rsquo;</dt>
  24783. <dd><p>Set print format for stats. Options are summary, json, or none.
  24784. Default value is none.
  24785. </p></dd>
  24786. </dl>
  24787. <a name="lowpass"></a>
  24788. <h2 class="section"><a href="ffmpeg-all.html#toc-lowpass">36.75 lowpass</a></h2>
  24789. <p>Apply a low-pass filter with 3dB point frequency.
  24790. The filter can be either single-pole or double-pole (the default).
  24791. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  24792. </p>
  24793. <p>The filter accepts the following options:
  24794. </p>
  24795. <dl compact="compact">
  24796. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24797. <dd><p>Set frequency in Hz. Default is 500.
  24798. </p>
  24799. </dd>
  24800. <dt>&lsquo;<samp>poles, p</samp>&rsquo;</dt>
  24801. <dd><p>Set number of poles. Default is 2.
  24802. </p>
  24803. </dd>
  24804. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24805. <dd><p>Set method to specify band-width of filter.
  24806. </p><dl compact="compact">
  24807. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  24808. <dd><p>Hz
  24809. </p></dd>
  24810. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  24811. <dd><p>Q-Factor
  24812. </p></dd>
  24813. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  24814. <dd><p>octave
  24815. </p></dd>
  24816. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  24817. <dd><p>slope
  24818. </p></dd>
  24819. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  24820. <dd><p>kHz
  24821. </p></dd>
  24822. </dl>
  24823. </dd>
  24824. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24825. <dd><p>Specify the band-width of a filter in width_type units.
  24826. Applies only to double-pole filter.
  24827. The default is 0.707q and gives a Butterworth response.
  24828. </p>
  24829. </dd>
  24830. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24831. <dd><p>How much to use filtered signal in output. Default is 1.
  24832. Range is between 0 and 1.
  24833. </p>
  24834. </dd>
  24835. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  24836. <dd><p>Specify which channels to filter, by default all available are filtered.
  24837. </p>
  24838. </dd>
  24839. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  24840. <dd><p>Normalize biquad coefficients, by default is disabled.
  24841. Enabling it will normalize magnitude response at DC to 0dB.
  24842. </p></dd>
  24843. </dl>
  24844. <a name="Examples-52"></a>
  24845. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-52">36.75.1 Examples</a></h3>
  24846. <ul>
  24847. <li>
  24848. Lowpass only LFE channel, it LFE is not present it does nothing:
  24849. <div class="example">
  24850. <pre class="example">lowpass=c=LFE
  24851. </pre></div>
  24852. </li></ul>
  24853. <a name="Commands-45"></a>
  24854. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-45">36.75.2 Commands</a></h3>
  24855. <p>This filter supports the following commands:
  24856. </p><dl compact="compact">
  24857. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  24858. <dd><p>Change lowpass frequency.
  24859. Syntax for the command is : &quot;<var>frequency</var>&quot;
  24860. </p>
  24861. </dd>
  24862. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  24863. <dd><p>Change lowpass width_type.
  24864. Syntax for the command is : &quot;<var>width_type</var>&quot;
  24865. </p>
  24866. </dd>
  24867. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  24868. <dd><p>Change lowpass width.
  24869. Syntax for the command is : &quot;<var>width</var>&quot;
  24870. </p>
  24871. </dd>
  24872. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  24873. <dd><p>Change lowpass mix.
  24874. Syntax for the command is : &quot;<var>mix</var>&quot;
  24875. </p></dd>
  24876. </dl>
  24877. <a name="lv2"></a>
  24878. <h2 class="section"><a href="ffmpeg-all.html#toc-lv2">36.76 lv2</a></h2>
  24879. <p>Load a LV2 (LADSPA Version 2) plugin.
  24880. </p>
  24881. <p>To enable compilation of this filter you need to configure FFmpeg with
  24882. <code>--enable-lv2</code>.
  24883. </p>
  24884. <dl compact="compact">
  24885. <dt>&lsquo;<samp>plugin, p</samp>&rsquo;</dt>
  24886. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  24887. </p>
  24888. </dd>
  24889. <dt>&lsquo;<samp>controls, c</samp>&rsquo;</dt>
  24890. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  24891. values that determine the behavior of the loaded plugin (for example delay,
  24892. threshold or gain).
  24893. If &lsquo;<samp>controls</samp>&rsquo; is set to <code>help</code>, all available controls and
  24894. their valid ranges are printed.
  24895. </p>
  24896. </dd>
  24897. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  24898. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  24899. zero inputs.
  24900. </p>
  24901. </dd>
  24902. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  24903. <dd><p>Set the number of samples per channel per each output frame, default
  24904. is 1024. Only used if plugin have zero inputs.
  24905. </p>
  24906. </dd>
  24907. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  24908. <dd><p>Set the minimum duration of the sourced audio. See
  24909. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  24910. for the accepted syntax.
  24911. Note that the resulting duration may be greater than the specified duration,
  24912. as the generated audio is always cut at the end of a complete frame.
  24913. If not specified, or the expressed duration is negative, the audio is
  24914. supposed to be generated forever.
  24915. Only used if plugin have zero inputs.
  24916. </p></dd>
  24917. </dl>
  24918. <a name="Examples-121"></a>
  24919. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-121">36.76.1 Examples</a></h3>
  24920. <ul>
  24921. <li>
  24922. Apply bass enhancer plugin from Calf:
  24923. <div class="example">
  24924. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  24925. </pre></div>
  24926. </li><li>
  24927. Apply vinyl plugin from Calf:
  24928. <div class="example">
  24929. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  24930. </pre></div>
  24931. </li><li>
  24932. Apply bit crusher plugin from ArtyFX:
  24933. <div class="example">
  24934. <pre class="example">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  24935. </pre></div>
  24936. </li></ul>
  24937. <a name="mcompand"></a>
  24938. <h2 class="section"><a href="ffmpeg-all.html#toc-mcompand">36.77 mcompand</a></h2>
  24939. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  24940. </p>
  24941. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  24942. This is akin to the crossover of a loudspeaker, and results in flat frequency
  24943. response when absent compander action.
  24944. </p>
  24945. <p>It accepts the following parameters:
  24946. </p>
  24947. <dl compact="compact">
  24948. <dt>&lsquo;<samp>args</samp>&rsquo;</dt>
  24949. <dd><p>This option syntax is:
  24950. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  24951. For explanation of each item refer to compand filter documentation.
  24952. </p></dd>
  24953. </dl>
  24954. <p><a name="pan"></a>
  24955. </p><a name="pan-1"></a>
  24956. <h2 class="section"><a href="ffmpeg-all.html#toc-pan-1">36.78 pan</a></h2>
  24957. <p>Mix channels with specific gain levels. The filter accepts the output
  24958. channel layout followed by a set of channels definitions.
  24959. </p>
  24960. <p>This filter is also designed to efficiently remap the channels of an audio
  24961. stream.
  24962. </p>
  24963. <p>The filter accepts parameters of the form:
  24964. &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
  24965. </p>
  24966. <dl compact="compact">
  24967. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  24968. <dd><p>output channel layout or number of channels
  24969. </p>
  24970. </dd>
  24971. <dt>&lsquo;<samp>outdef</samp>&rsquo;</dt>
  24972. <dd><p>output channel specification, of the form:
  24973. &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[(+-)[<var>gain</var>*]<var>in_name</var>...]&quot;
  24974. </p>
  24975. </dd>
  24976. <dt>&lsquo;<samp>out_name</samp>&rsquo;</dt>
  24977. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  24978. number (c0, c1, etc.)
  24979. </p>
  24980. </dd>
  24981. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  24982. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  24983. </p>
  24984. </dd>
  24985. <dt>&lsquo;<samp>in_name</samp>&rsquo;</dt>
  24986. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  24987. named and numbered input channels
  24988. </p></dd>
  24989. </dl>
  24990. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  24991. that specification will be renormalized so that the total is 1, thus
  24992. avoiding clipping noise.
  24993. </p>
  24994. <a name="Mixing-examples"></a>
  24995. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Mixing-examples">36.78.1 Mixing examples</a></h3>
  24996. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  24997. factor for the left channel:
  24998. </p><div class="example">
  24999. <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
  25000. </pre></div>
  25001. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  25002. 7-channels surround:
  25003. </p><div class="example">
  25004. <pre class="example">pan=stereo| FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL | FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
  25005. </pre></div>
  25006. <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
  25007. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  25008. needs.
  25009. </p>
  25010. <a name="Remapping-examples"></a>
  25011. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Remapping-examples">36.78.2 Remapping examples</a></h3>
  25012. <p>The channel remapping will be effective if, and only if:
  25013. </p>
  25014. <ul>
  25015. <li> gain coefficients are zeroes or ones,
  25016. </li><li> only one input per channel output,
  25017. </li></ul>
  25018. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  25019. channel mapping detected&quot;), and use an optimized and lossless method to do the
  25020. remapping.
  25021. </p>
  25022. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  25023. dropping the extra channels:
  25024. </p><div class="example">
  25025. <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
  25026. </pre></div>
  25027. <p>Given the same source, you can also switch front left and front right channels
  25028. and keep the input channel layout:
  25029. </p><div class="example">
  25030. <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  25031. </pre></div>
  25032. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  25033. still keep the stereo channel layout) with:
  25034. </p><div class="example">
  25035. <pre class="example">pan=&quot;stereo|c1=c1&quot;
  25036. </pre></div>
  25037. <p>Still with a stereo audio stream input, you can copy the right channel in both
  25038. front left and right:
  25039. </p><div class="example">
  25040. <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
  25041. </pre></div>
  25042. <a name="replaygain"></a>
  25043. <h2 class="section"><a href="ffmpeg-all.html#toc-replaygain">36.79 replaygain</a></h2>
  25044. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  25045. outputs it unchanged.
  25046. At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
  25047. </p>
  25048. <a name="resample"></a>
  25049. <h2 class="section"><a href="ffmpeg-all.html#toc-resample">36.80 resample</a></h2>
  25050. <p>Convert the audio sample format, sample rate and channel layout. It is
  25051. not meant to be used directly.
  25052. </p>
  25053. <a name="rubberband"></a>
  25054. <h2 class="section"><a href="ffmpeg-all.html#toc-rubberband">36.81 rubberband</a></h2>
  25055. <p>Apply time-stretching and pitch-shifting with librubberband.
  25056. </p>
  25057. <p>To enable compilation of this filter, you need to configure FFmpeg with
  25058. <code>--enable-librubberband</code>.
  25059. </p>
  25060. <p>The filter accepts the following options:
  25061. </p>
  25062. <dl compact="compact">
  25063. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  25064. <dd><p>Set tempo scale factor.
  25065. </p>
  25066. </dd>
  25067. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  25068. <dd><p>Set pitch scale factor.
  25069. </p>
  25070. </dd>
  25071. <dt>&lsquo;<samp>transients</samp>&rsquo;</dt>
  25072. <dd><p>Set transients detector.
  25073. Possible values are:
  25074. </p><dl compact="compact">
  25075. <dt><var>crisp</var></dt>
  25076. <dt><var>mixed</var></dt>
  25077. <dt><var>smooth</var></dt>
  25078. </dl>
  25079. </dd>
  25080. <dt>&lsquo;<samp>detector</samp>&rsquo;</dt>
  25081. <dd><p>Set detector.
  25082. Possible values are:
  25083. </p><dl compact="compact">
  25084. <dt><var>compound</var></dt>
  25085. <dt><var>percussive</var></dt>
  25086. <dt><var>soft</var></dt>
  25087. </dl>
  25088. </dd>
  25089. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  25090. <dd><p>Set phase.
  25091. Possible values are:
  25092. </p><dl compact="compact">
  25093. <dt><var>laminar</var></dt>
  25094. <dt><var>independent</var></dt>
  25095. </dl>
  25096. </dd>
  25097. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  25098. <dd><p>Set processing window size.
  25099. Possible values are:
  25100. </p><dl compact="compact">
  25101. <dt><var>standard</var></dt>
  25102. <dt><var>short</var></dt>
  25103. <dt><var>long</var></dt>
  25104. </dl>
  25105. </dd>
  25106. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  25107. <dd><p>Set smoothing.
  25108. Possible values are:
  25109. </p><dl compact="compact">
  25110. <dt><var>off</var></dt>
  25111. <dt><var>on</var></dt>
  25112. </dl>
  25113. </dd>
  25114. <dt>&lsquo;<samp>formant</samp>&rsquo;</dt>
  25115. <dd><p>Enable formant preservation when shift pitching.
  25116. Possible values are:
  25117. </p><dl compact="compact">
  25118. <dt><var>shifted</var></dt>
  25119. <dt><var>preserved</var></dt>
  25120. </dl>
  25121. </dd>
  25122. <dt>&lsquo;<samp>pitchq</samp>&rsquo;</dt>
  25123. <dd><p>Set pitch quality.
  25124. Possible values are:
  25125. </p><dl compact="compact">
  25126. <dt><var>quality</var></dt>
  25127. <dt><var>speed</var></dt>
  25128. <dt><var>consistency</var></dt>
  25129. </dl>
  25130. </dd>
  25131. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  25132. <dd><p>Set channels.
  25133. Possible values are:
  25134. </p><dl compact="compact">
  25135. <dt><var>apart</var></dt>
  25136. <dt><var>together</var></dt>
  25137. </dl>
  25138. </dd>
  25139. </dl>
  25140. <a name="Commands-27"></a>
  25141. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-27">36.81.1 Commands</a></h3>
  25142. <p>This filter supports the following commands:
  25143. </p><dl compact="compact">
  25144. <dt>&lsquo;<samp>tempo</samp>&rsquo;</dt>
  25145. <dd><p>Change filter tempo scale factor.
  25146. Syntax for the command is : &quot;<var>tempo</var>&quot;
  25147. </p>
  25148. </dd>
  25149. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  25150. <dd><p>Change filter pitch scale factor.
  25151. Syntax for the command is : &quot;<var>pitch</var>&quot;
  25152. </p></dd>
  25153. </dl>
  25154. <a name="sidechaincompress"></a>
  25155. <h2 class="section"><a href="ffmpeg-all.html#toc-sidechaincompress">36.82 sidechaincompress</a></h2>
  25156. <p>This filter acts like normal compressor but has the ability to compress
  25157. detected signal using second input signal.
  25158. It needs two input streams and returns one output stream.
  25159. First input stream will be processed depending on second stream signal.
  25160. The filtered signal then can be filtered with other filters in later stages of
  25161. processing. See <a href="#pan">pan</a> and <a href="#amerge">amerge</a> filter.
  25162. </p>
  25163. <p>The filter accepts the following options:
  25164. </p>
  25165. <dl compact="compact">
  25166. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25167. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  25168. </p>
  25169. </dd>
  25170. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25171. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  25172. Default is <code>downward</code>.
  25173. </p>
  25174. </dd>
  25175. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  25176. <dd><p>If a signal of second stream raises above this level it will affect the gain
  25177. reduction of first stream.
  25178. By default is 0.125. Range is between 0.00097563 and 1.
  25179. </p>
  25180. </dd>
  25181. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  25182. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  25183. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  25184. Default is 2. Range is between 1 and 20.
  25185. </p>
  25186. </dd>
  25187. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  25188. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  25189. reduction starts. Default is 20. Range is between 0.01 and 2000.
  25190. </p>
  25191. </dd>
  25192. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  25193. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  25194. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  25195. </p>
  25196. </dd>
  25197. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  25198. <dd><p>Set the amount by how much signal will be amplified after processing.
  25199. Default is 1. Range is from 1 to 64.
  25200. </p>
  25201. </dd>
  25202. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  25203. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  25204. Default is 2.82843. Range is between 1 and 8.
  25205. </p>
  25206. </dd>
  25207. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  25208. <dd><p>Choose if the <code>average</code> level between all channels of side-chain stream
  25209. or the louder(<code>maximum</code>) channel of side-chain stream affects the
  25210. reduction. Default is <code>average</code>.
  25211. </p>
  25212. </dd>
  25213. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25214. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  25215. of <code>rms</code>. Default is <code>rms</code> which is mainly smoother.
  25216. </p>
  25217. </dd>
  25218. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  25219. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  25220. </p>
  25221. </dd>
  25222. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  25223. <dd><p>How much to use compressed signal in output. Default is 1.
  25224. Range is between 0 and 1.
  25225. </p></dd>
  25226. </dl>
  25227. <a name="Commands-63"></a>
  25228. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-63">36.82.1 Commands</a></h3>
  25229. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  25230. </p>
  25231. <a name="Examples-54"></a>
  25232. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-54">36.82.2 Examples</a></h3>
  25233. <ul>
  25234. <li>
  25235. Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  25236. depending on the signal of 2nd input and later compressed signal to be
  25237. merged with 2nd input:
  25238. <div class="example">
  25239. <pre class="example">ffmpeg -i main.flac -i sidechain.flac -filter_complex &quot;[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge&quot;
  25240. </pre></div>
  25241. </li></ul>
  25242. <a name="sidechaingate"></a>
  25243. <h2 class="section"><a href="ffmpeg-all.html#toc-sidechaingate">36.83 sidechaingate</a></h2>
  25244. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  25245. filter the detected signal before sending it to the gain reduction stage.
  25246. Normally a gate uses the full range signal to detect a level above the
  25247. threshold.
  25248. For example: If you cut all lower frequencies from your sidechain signal
  25249. the gate will decrease the volume of your track only if not enough highs
  25250. appear. With this technique you are able to reduce the resonation of a
  25251. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  25252. guitar.
  25253. It needs two input streams and returns one output stream.
  25254. First input stream will be processed depending on second stream signal.
  25255. </p>
  25256. <p>The filter accepts the following options:
  25257. </p>
  25258. <dl compact="compact">
  25259. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25260. <dd><p>Set input level before filtering.
  25261. Default is 1. Allowed range is from 0.015625 to 64.
  25262. </p>
  25263. </dd>
  25264. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25265. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  25266. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  25267. will be amplified, expanding dynamic range in upward direction.
  25268. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  25269. </p>
  25270. </dd>
  25271. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  25272. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  25273. Default is 0.06125. Allowed range is from 0 to 1.
  25274. Setting this to 0 disables reduction and then filter behaves like expander.
  25275. </p>
  25276. </dd>
  25277. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  25278. <dd><p>If a signal rises above this level the gain reduction is released.
  25279. Default is 0.125. Allowed range is from 0 to 1.
  25280. </p>
  25281. </dd>
  25282. <dt>&lsquo;<samp>ratio</samp>&rsquo;</dt>
  25283. <dd><p>Set a ratio about which the signal is reduced.
  25284. Default is 2. Allowed range is from 1 to 9000.
  25285. </p>
  25286. </dd>
  25287. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  25288. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  25289. reduction stops.
  25290. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  25291. </p>
  25292. </dd>
  25293. <dt>&lsquo;<samp>release</samp>&rsquo;</dt>
  25294. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  25295. reduction is increased again. Default is 250 milliseconds.
  25296. Allowed range is from 0.01 to 9000.
  25297. </p>
  25298. </dd>
  25299. <dt>&lsquo;<samp>makeup</samp>&rsquo;</dt>
  25300. <dd><p>Set amount of amplification of signal after processing.
  25301. Default is 1. Allowed range is from 1 to 64.
  25302. </p>
  25303. </dd>
  25304. <dt>&lsquo;<samp>knee</samp>&rsquo;</dt>
  25305. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  25306. Default is 2.828427125. Allowed range is from 1 to 8.
  25307. </p>
  25308. </dd>
  25309. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25310. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  25311. Default is rms. Can be peak or rms.
  25312. </p>
  25313. </dd>
  25314. <dt>&lsquo;<samp>link</samp>&rsquo;</dt>
  25315. <dd><p>Choose if the average level between all channels or the louder channel affects
  25316. the reduction.
  25317. Default is average. Can be average or maximum.
  25318. </p>
  25319. </dd>
  25320. <dt>&lsquo;<samp>level_sc</samp>&rsquo;</dt>
  25321. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  25322. </p></dd>
  25323. </dl>
  25324. <a name="silencedetect"></a>
  25325. <h2 class="section"><a href="ffmpeg-all.html#toc-silencedetect">36.84 silencedetect</a></h2>
  25326. <p>Detect silence in an audio stream.
  25327. </p>
  25328. <p>This filter logs a message when it detects that the input audio volume is less
  25329. or equal to a noise tolerance value for a duration greater or equal to the
  25330. minimum detected noise duration.
  25331. </p>
  25332. <p>The printed times and duration are expressed in seconds. The
  25333. <code>lavfi.silence_start</code> or <code>lavfi.silence_start.X</code> metadata key
  25334. is set on the first frame whose timestamp equals or exceeds the detection
  25335. duration and it contains the timestamp of the first frame of the silence.
  25336. </p>
  25337. <p>The <code>lavfi.silence_duration</code> or <code>lavfi.silence_duration.X</code>
  25338. and <code>lavfi.silence_end</code> or <code>lavfi.silence_end.X</code> metadata
  25339. keys are set on the first frame after the silence. If &lsquo;<samp>mono</samp>&rsquo; is
  25340. enabled, and each channel is evaluated separately, the <code>.X</code>
  25341. suffixed keys are used, and <code>X</code> corresponds to the channel number.
  25342. </p>
  25343. <p>The filter accepts the following options:
  25344. </p>
  25345. <dl compact="compact">
  25346. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  25347. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  25348. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  25349. </p>
  25350. </dd>
  25351. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  25352. <dd><p>Set silence duration until notification (default is 2 seconds). See
  25353. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  25354. for the accepted syntax.
  25355. </p>
  25356. </dd>
  25357. <dt>&lsquo;<samp>mono, m</samp>&rsquo;</dt>
  25358. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  25359. </p></dd>
  25360. </dl>
  25361. <a name="Examples-95"></a>
  25362. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-95">36.84.1 Examples</a></h3>
  25363. <ul>
  25364. <li>
  25365. Detect 5 seconds of silence with -50dB noise tolerance:
  25366. <div class="example">
  25367. <pre class="example">silencedetect=n=-50dB:d=5
  25368. </pre></div>
  25369. </li><li>
  25370. Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
  25371. tolerance in &lsquo;<tt>silence.mp3</tt>&rsquo;:
  25372. <div class="example">
  25373. <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  25374. </pre></div>
  25375. </li></ul>
  25376. <a name="silenceremove"></a>
  25377. <h2 class="section"><a href="ffmpeg-all.html#toc-silenceremove">36.85 silenceremove</a></h2>
  25378. <p>Remove silence from the beginning, middle or end of the audio.
  25379. </p>
  25380. <p>The filter accepts the following options:
  25381. </p>
  25382. <dl compact="compact">
  25383. <dt>&lsquo;<samp>start_periods</samp>&rsquo;</dt>
  25384. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  25385. the audio. A value of zero indicates no silence should be trimmed from the
  25386. beginning. When specifying a non-zero value, it trims audio up until it
  25387. finds non-silence. Normally, when trimming silence from beginning of audio
  25388. the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
  25389. values to trim all audio up to specific count of non-silence periods.
  25390. Default value is <code>0</code>.
  25391. </p>
  25392. </dd>
  25393. <dt>&lsquo;<samp>start_duration</samp>&rsquo;</dt>
  25394. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  25395. trimming audio. By increasing the duration, bursts of noises can be treated
  25396. as silence and trimmed off. Default value is <code>0</code>.
  25397. </p>
  25398. </dd>
  25399. <dt>&lsquo;<samp>start_threshold</samp>&rsquo;</dt>
  25400. <dd><p>This indicates what sample value should be treated as silence. For digital
  25401. audio, a value of <code>0</code> may be fine but for audio recorded from analog,
  25402. you may wish to increase the value to account for background noise.
  25403. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  25404. or amplitude ratio. Default value is <code>0</code>.
  25405. </p>
  25406. </dd>
  25407. <dt>&lsquo;<samp>start_silence</samp>&rsquo;</dt>
  25408. <dd><p>Specify max duration of silence at beginning that will be kept after
  25409. trimming. Default is 0, which is equal to trimming all samples detected
  25410. as silence.
  25411. </p>
  25412. </dd>
  25413. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  25414. <dd><p>Specify mode of detection of silence end in start of multi-channel audio.
  25415. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  25416. With <var>any</var>, any sample that is detected as non-silence will cause
  25417. stopped trimming of silence.
  25418. With <var>all</var>, only if all channels are detected as non-silence will cause
  25419. stopped trimming of silence.
  25420. </p>
  25421. </dd>
  25422. <dt>&lsquo;<samp>stop_periods</samp>&rsquo;</dt>
  25423. <dd><p>Set the count for trimming silence from the end of audio.
  25424. To remove silence from the middle of a file, specify a <var>stop_periods</var>
  25425. that is negative. This value is then treated as a positive value and is
  25426. used to indicate the effect should restart processing as specified by
  25427. <var>start_periods</var>, making it suitable for removing periods of silence
  25428. in the middle of the audio.
  25429. Default value is <code>0</code>.
  25430. </p>
  25431. </dd>
  25432. <dt>&lsquo;<samp>stop_duration</samp>&rsquo;</dt>
  25433. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  25434. more. By specifying a higher duration, silence that is wanted can be left in
  25435. the audio.
  25436. Default value is <code>0</code>.
  25437. </p>
  25438. </dd>
  25439. <dt>&lsquo;<samp>stop_threshold</samp>&rsquo;</dt>
  25440. <dd><p>This is the same as &lsquo;<samp>start_threshold</samp>&rsquo; but for trimming silence from
  25441. the end of audio.
  25442. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  25443. or amplitude ratio. Default value is <code>0</code>.
  25444. </p>
  25445. </dd>
  25446. <dt>&lsquo;<samp>stop_silence</samp>&rsquo;</dt>
  25447. <dd><p>Specify max duration of silence at end that will be kept after
  25448. trimming. Default is 0, which is equal to trimming all samples detected
  25449. as silence.
  25450. </p>
  25451. </dd>
  25452. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  25453. <dd><p>Specify mode of detection of silence start in end of multi-channel audio.
  25454. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  25455. With <var>any</var>, any sample that is detected as non-silence will cause
  25456. stopped trimming of silence.
  25457. With <var>all</var>, only if all channels are detected as non-silence will cause
  25458. stopped trimming of silence.
  25459. </p>
  25460. </dd>
  25461. <dt>&lsquo;<samp>detection</samp>&rsquo;</dt>
  25462. <dd><p>Set how is silence detected. Can be <code>rms</code> or <code>peak</code>. Second is faster
  25463. and works better with digital silence which is exactly 0.
  25464. Default value is <code>rms</code>.
  25465. </p>
  25466. </dd>
  25467. <dt>&lsquo;<samp>window</samp>&rsquo;</dt>
  25468. <dd><p>Set duration in number of seconds used to calculate size of window in number
  25469. of samples for detecting silence.
  25470. Default value is <code>0.02</code>. Allowed range is from <code>0</code> to <code>10</code>.
  25471. </p></dd>
  25472. </dl>
  25473. <a name="Examples-147"></a>
  25474. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-147">36.85.1 Examples</a></h3>
  25475. <ul>
  25476. <li>
  25477. The following example shows how this filter can be used to start a recording
  25478. that does not contain the delay at the start which usually occurs between
  25479. pressing the record button and the start of the performance:
  25480. <div class="example">
  25481. <pre class="example">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  25482. </pre></div>
  25483. </li><li>
  25484. Trim all silence encountered from beginning to end where there is more than 1
  25485. second of silence in audio:
  25486. <div class="example">
  25487. <pre class="example">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  25488. </pre></div>
  25489. </li><li>
  25490. Trim all digital silence samples, using peak detection, from beginning to end
  25491. where there is more than 0 samples of digital silence in audio and digital
  25492. silence is detected in all channels at same positions in stream:
  25493. <div class="example">
  25494. <pre class="example">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  25495. </pre></div>
  25496. </li></ul>
  25497. <a name="sofalizer"></a>
  25498. <h2 class="section"><a href="ffmpeg-all.html#toc-sofalizer">36.86 sofalizer</a></h2>
  25499. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  25500. loudspeakers around the user for binaural listening via headphones (audio
  25501. formats up to 9 channels supported).
  25502. The HRTFs are stored in SOFA files (see <a href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  25503. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  25504. Austrian Academy of Sciences.
  25505. </p>
  25506. <p>To enable compilation of this filter you need to configure FFmpeg with
  25507. <code>--enable-libmysofa</code>.
  25508. </p>
  25509. <p>The filter accepts the following options:
  25510. </p>
  25511. <dl compact="compact">
  25512. <dt>&lsquo;<samp>sofa</samp>&rsquo;</dt>
  25513. <dd><p>Set the SOFA file used for rendering.
  25514. </p>
  25515. </dd>
  25516. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  25517. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  25518. </p>
  25519. </dd>
  25520. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  25521. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  25522. </p>
  25523. </dd>
  25524. <dt>&lsquo;<samp>elevation</samp>&rsquo;</dt>
  25525. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  25526. </p>
  25527. </dd>
  25528. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  25529. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  25530. HRTFs. Default is 1.
  25531. </p>
  25532. </dd>
  25533. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  25534. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  25535. processing audio in time domain which is slow.
  25536. <var>freq</var> is processing audio in frequency domain which is fast.
  25537. Default is <var>freq</var>.
  25538. </p>
  25539. </dd>
  25540. <dt>&lsquo;<samp>speakers</samp>&rsquo;</dt>
  25541. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  25542. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  25543. Each virtual loudspeaker is described with short channel name following with
  25544. azimuth and elevation in degrees.
  25545. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  25546. For example to override front left and front right channel positions use:
  25547. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  25548. Descriptions with unrecognised channel names are ignored.
  25549. </p>
  25550. </dd>
  25551. <dt>&lsquo;<samp>lfegain</samp>&rsquo;</dt>
  25552. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  25553. </p>
  25554. </dd>
  25555. <dt>&lsquo;<samp>framesize</samp>&rsquo;</dt>
  25556. <dd><p>Set custom frame size in number of samples. Default is 1024.
  25557. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp>type</samp>&rsquo;
  25558. is set to <var>freq</var>.
  25559. </p>
  25560. </dd>
  25561. <dt>&lsquo;<samp>normalize</samp>&rsquo;</dt>
  25562. <dd><p>Should all IRs be normalized upon importing SOFA file.
  25563. By default is enabled.
  25564. </p>
  25565. </dd>
  25566. <dt>&lsquo;<samp>interpolate</samp>&rsquo;</dt>
  25567. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  25568. does not match. By default is disabled.
  25569. </p>
  25570. </dd>
  25571. <dt>&lsquo;<samp>minphase</samp>&rsquo;</dt>
  25572. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  25573. </p>
  25574. </dd>
  25575. <dt>&lsquo;<samp>anglestep</samp>&rsquo;</dt>
  25576. <dd><p>Set neighbor search angle step. Only used if option <var>interpolate</var> is enabled.
  25577. </p>
  25578. </dd>
  25579. <dt>&lsquo;<samp>radstep</samp>&rsquo;</dt>
  25580. <dd><p>Set neighbor search radius step. Only used if option <var>interpolate</var> is enabled.
  25581. </p></dd>
  25582. </dl>
  25583. <a name="Examples-40"></a>
  25584. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-40">36.86.1 Examples</a></h3>
  25585. <ul>
  25586. <li>
  25587. Using ClubFritz6 sofa file:
  25588. <div class="example">
  25589. <pre class="example">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  25590. </pre></div>
  25591. </li><li>
  25592. Using ClubFritz12 sofa file and bigger radius with small rotation:
  25593. <div class="example">
  25594. <pre class="example">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  25595. </pre></div>
  25596. </li><li>
  25597. Similar as above but with custom speaker positions for front left, front right, back left and back right
  25598. and also with custom gain:
  25599. <div class="example">
  25600. <pre class="example">&quot;sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28&quot;
  25601. </pre></div>
  25602. </li></ul>
  25603. <a name="stereotools"></a>
  25604. <h2 class="section"><a href="ffmpeg-all.html#toc-stereotools">36.87 stereotools</a></h2>
  25605. <p>This filter has some handy utilities to manage stereo signals, for converting
  25606. M/S stereo recordings to L/R signal while having control over the parameters
  25607. or spreading the stereo image of master track.
  25608. </p>
  25609. <p>The filter accepts the following options:
  25610. </p>
  25611. <dl compact="compact">
  25612. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25613. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  25614. Allowed range is from 0.015625 to 64.
  25615. </p>
  25616. </dd>
  25617. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  25618. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  25619. Allowed range is from 0.015625 to 64.
  25620. </p>
  25621. </dd>
  25622. <dt>&lsquo;<samp>balance_in</samp>&rsquo;</dt>
  25623. <dd><p>Set input balance between both channels. Default is 0.
  25624. Allowed range is from -1 to 1.
  25625. </p>
  25626. </dd>
  25627. <dt>&lsquo;<samp>balance_out</samp>&rsquo;</dt>
  25628. <dd><p>Set output balance between both channels. Default is 0.
  25629. Allowed range is from -1 to 1.
  25630. </p>
  25631. </dd>
  25632. <dt>&lsquo;<samp>softclip</samp>&rsquo;</dt>
  25633. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  25634. clipping. Disabled by default.
  25635. </p>
  25636. </dd>
  25637. <dt>&lsquo;<samp>mutel</samp>&rsquo;</dt>
  25638. <dd><p>Mute the left channel. Disabled by default.
  25639. </p>
  25640. </dd>
  25641. <dt>&lsquo;<samp>muter</samp>&rsquo;</dt>
  25642. <dd><p>Mute the right channel. Disabled by default.
  25643. </p>
  25644. </dd>
  25645. <dt>&lsquo;<samp>phasel</samp>&rsquo;</dt>
  25646. <dd><p>Change the phase of the left channel. Disabled by default.
  25647. </p>
  25648. </dd>
  25649. <dt>&lsquo;<samp>phaser</samp>&rsquo;</dt>
  25650. <dd><p>Change the phase of the right channel. Disabled by default.
  25651. </p>
  25652. </dd>
  25653. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  25654. <dd><p>Set stereo mode. Available values are:
  25655. </p>
  25656. <dl compact="compact">
  25657. <dt>&lsquo;<samp>lr&gt;lr</samp>&rsquo;</dt>
  25658. <dd><p>Left/Right to Left/Right, this is default.
  25659. </p>
  25660. </dd>
  25661. <dt>&lsquo;<samp>lr&gt;ms</samp>&rsquo;</dt>
  25662. <dd><p>Left/Right to Mid/Side.
  25663. </p>
  25664. </dd>
  25665. <dt>&lsquo;<samp>ms&gt;lr</samp>&rsquo;</dt>
  25666. <dd><p>Mid/Side to Left/Right.
  25667. </p>
  25668. </dd>
  25669. <dt>&lsquo;<samp>lr&gt;ll</samp>&rsquo;</dt>
  25670. <dd><p>Left/Right to Left/Left.
  25671. </p>
  25672. </dd>
  25673. <dt>&lsquo;<samp>lr&gt;rr</samp>&rsquo;</dt>
  25674. <dd><p>Left/Right to Right/Right.
  25675. </p>
  25676. </dd>
  25677. <dt>&lsquo;<samp>lr&gt;l+r</samp>&rsquo;</dt>
  25678. <dd><p>Left/Right to Left + Right.
  25679. </p>
  25680. </dd>
  25681. <dt>&lsquo;<samp>lr&gt;rl</samp>&rsquo;</dt>
  25682. <dd><p>Left/Right to Right/Left.
  25683. </p>
  25684. </dd>
  25685. <dt>&lsquo;<samp>ms&gt;ll</samp>&rsquo;</dt>
  25686. <dd><p>Mid/Side to Left/Left.
  25687. </p>
  25688. </dd>
  25689. <dt>&lsquo;<samp>ms&gt;rr</samp>&rsquo;</dt>
  25690. <dd><p>Mid/Side to Right/Right.
  25691. </p></dd>
  25692. </dl>
  25693. </dd>
  25694. <dt>&lsquo;<samp>slev</samp>&rsquo;</dt>
  25695. <dd><p>Set level of side signal. Default is 1.
  25696. Allowed range is from 0.015625 to 64.
  25697. </p>
  25698. </dd>
  25699. <dt>&lsquo;<samp>sbal</samp>&rsquo;</dt>
  25700. <dd><p>Set balance of side signal. Default is 0.
  25701. Allowed range is from -1 to 1.
  25702. </p>
  25703. </dd>
  25704. <dt>&lsquo;<samp>mlev</samp>&rsquo;</dt>
  25705. <dd><p>Set level of the middle signal. Default is 1.
  25706. Allowed range is from 0.015625 to 64.
  25707. </p>
  25708. </dd>
  25709. <dt>&lsquo;<samp>mpan</samp>&rsquo;</dt>
  25710. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  25711. </p>
  25712. </dd>
  25713. <dt>&lsquo;<samp>base</samp>&rsquo;</dt>
  25714. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  25715. Allowed range is from -1 to 1.
  25716. </p>
  25717. </dd>
  25718. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  25719. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  25720. vice versa. Default is 0. Allowed range is from -20 to 20.
  25721. </p>
  25722. </dd>
  25723. <dt>&lsquo;<samp>sclevel</samp>&rsquo;</dt>
  25724. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  25725. </p>
  25726. </dd>
  25727. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  25728. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  25729. </p>
  25730. </dd>
  25731. <dt>&lsquo;<samp>bmode_in, bmode_out</samp>&rsquo;</dt>
  25732. <dd><p>Set balance mode for balance_in/balance_out option.
  25733. </p>
  25734. <p>Can be one of the following:
  25735. </p>
  25736. <dl compact="compact">
  25737. <dt>&lsquo;<samp>balance</samp>&rsquo;</dt>
  25738. <dd><p>Classic balance mode. Attenuate one channel at time.
  25739. Gain is raised up to 1.
  25740. </p>
  25741. </dd>
  25742. <dt>&lsquo;<samp>amplitude</samp>&rsquo;</dt>
  25743. <dd><p>Similar as classic mode above but gain is raised up to 2.
  25744. </p>
  25745. </dd>
  25746. <dt>&lsquo;<samp>power</samp>&rsquo;</dt>
  25747. <dd><p>Equal power distribution, from -6dB to +6dB range.
  25748. </p></dd>
  25749. </dl>
  25750. </dd>
  25751. </dl>
  25752. <a name="Examples-148"></a>
  25753. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-148">36.87.1 Examples</a></h3>
  25754. <ul>
  25755. <li>
  25756. Apply karaoke like effect:
  25757. <div class="example">
  25758. <pre class="example">stereotools=mlev=0.015625
  25759. </pre></div>
  25760. </li><li>
  25761. Convert M/S signal to L/R:
  25762. <div class="example">
  25763. <pre class="example">&quot;stereotools=mode=ms&gt;lr&quot;
  25764. </pre></div>
  25765. </li></ul>
  25766. <a name="stereowiden"></a>
  25767. <h2 class="section"><a href="ffmpeg-all.html#toc-stereowiden">36.88 stereowiden</a></h2>
  25768. <p>This filter enhance the stereo effect by suppressing signal common to both
  25769. channels and by delaying the signal of left into right and vice versa,
  25770. thereby widening the stereo effect.
  25771. </p>
  25772. <p>The filter accepts the following options:
  25773. </p>
  25774. <dl compact="compact">
  25775. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  25776. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  25777. Default is 20 milliseconds.
  25778. </p>
  25779. </dd>
  25780. <dt>&lsquo;<samp>feedback</samp>&rsquo;</dt>
  25781. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  25782. effect of left signal in right output and vice versa which gives widening
  25783. effect. Default is 0.3.
  25784. </p>
  25785. </dd>
  25786. <dt>&lsquo;<samp>crossfeed</samp>&rsquo;</dt>
  25787. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  25788. the mono. If the value is 1 it will cancel all the signal common to both
  25789. channels. Default is 0.3.
  25790. </p>
  25791. </dd>
  25792. <dt>&lsquo;<samp>drymix</samp>&rsquo;</dt>
  25793. <dd><p>Set level of input signal of original channel. Default is 0.8.
  25794. </p></dd>
  25795. </dl>
  25796. <a name="Commands-22"></a>
  25797. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-22">36.88.1 Commands</a></h3>
  25798. <p>This filter supports the all above options except <code>delay</code> as <a href="#commands">commands</a>.
  25799. </p>
  25800. <a name="superequalizer"></a>
  25801. <h2 class="section"><a href="ffmpeg-all.html#toc-superequalizer">36.89 superequalizer</a></h2>
  25802. <p>Apply 18 band equalizer.
  25803. </p>
  25804. <p>The filter accepts the following options:
  25805. </p><dl compact="compact">
  25806. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  25807. <dd><p>Set 65Hz band gain.
  25808. </p></dd>
  25809. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  25810. <dd><p>Set 92Hz band gain.
  25811. </p></dd>
  25812. <dt>&lsquo;<samp>3b</samp>&rsquo;</dt>
  25813. <dd><p>Set 131Hz band gain.
  25814. </p></dd>
  25815. <dt>&lsquo;<samp>4b</samp>&rsquo;</dt>
  25816. <dd><p>Set 185Hz band gain.
  25817. </p></dd>
  25818. <dt>&lsquo;<samp>5b</samp>&rsquo;</dt>
  25819. <dd><p>Set 262Hz band gain.
  25820. </p></dd>
  25821. <dt>&lsquo;<samp>6b</samp>&rsquo;</dt>
  25822. <dd><p>Set 370Hz band gain.
  25823. </p></dd>
  25824. <dt>&lsquo;<samp>7b</samp>&rsquo;</dt>
  25825. <dd><p>Set 523Hz band gain.
  25826. </p></dd>
  25827. <dt>&lsquo;<samp>8b</samp>&rsquo;</dt>
  25828. <dd><p>Set 740Hz band gain.
  25829. </p></dd>
  25830. <dt>&lsquo;<samp>9b</samp>&rsquo;</dt>
  25831. <dd><p>Set 1047Hz band gain.
  25832. </p></dd>
  25833. <dt>&lsquo;<samp>10b</samp>&rsquo;</dt>
  25834. <dd><p>Set 1480Hz band gain.
  25835. </p></dd>
  25836. <dt>&lsquo;<samp>11b</samp>&rsquo;</dt>
  25837. <dd><p>Set 2093Hz band gain.
  25838. </p></dd>
  25839. <dt>&lsquo;<samp>12b</samp>&rsquo;</dt>
  25840. <dd><p>Set 2960Hz band gain.
  25841. </p></dd>
  25842. <dt>&lsquo;<samp>13b</samp>&rsquo;</dt>
  25843. <dd><p>Set 4186Hz band gain.
  25844. </p></dd>
  25845. <dt>&lsquo;<samp>14b</samp>&rsquo;</dt>
  25846. <dd><p>Set 5920Hz band gain.
  25847. </p></dd>
  25848. <dt>&lsquo;<samp>15b</samp>&rsquo;</dt>
  25849. <dd><p>Set 8372Hz band gain.
  25850. </p></dd>
  25851. <dt>&lsquo;<samp>16b</samp>&rsquo;</dt>
  25852. <dd><p>Set 11840Hz band gain.
  25853. </p></dd>
  25854. <dt>&lsquo;<samp>17b</samp>&rsquo;</dt>
  25855. <dd><p>Set 16744Hz band gain.
  25856. </p></dd>
  25857. <dt>&lsquo;<samp>18b</samp>&rsquo;</dt>
  25858. <dd><p>Set 20000Hz band gain.
  25859. </p></dd>
  25860. </dl>
  25861. <a name="surround"></a>
  25862. <h2 class="section"><a href="ffmpeg-all.html#toc-surround">36.90 surround</a></h2>
  25863. <p>Apply audio surround upmix filter.
  25864. </p>
  25865. <p>This filter allows to produce multichannel output from audio stream.
  25866. </p>
  25867. <p>The filter accepts the following options:
  25868. </p>
  25869. <dl compact="compact">
  25870. <dt>&lsquo;<samp>chl_out</samp>&rsquo;</dt>
  25871. <dd><p>Set output channel layout. By default, this is <var>5.1</var>.
  25872. </p>
  25873. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  25874. for the required syntax.
  25875. </p>
  25876. </dd>
  25877. <dt>&lsquo;<samp>chl_in</samp>&rsquo;</dt>
  25878. <dd><p>Set input channel layout. By default, this is <var>stereo</var>.
  25879. </p>
  25880. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  25881. for the required syntax.
  25882. </p>
  25883. </dd>
  25884. <dt>&lsquo;<samp>level_in</samp>&rsquo;</dt>
  25885. <dd><p>Set input volume level. By default, this is <var>1</var>.
  25886. </p>
  25887. </dd>
  25888. <dt>&lsquo;<samp>level_out</samp>&rsquo;</dt>
  25889. <dd><p>Set output volume level. By default, this is <var>1</var>.
  25890. </p>
  25891. </dd>
  25892. <dt>&lsquo;<samp>lfe</samp>&rsquo;</dt>
  25893. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  25894. </p>
  25895. </dd>
  25896. <dt>&lsquo;<samp>lfe_low</samp>&rsquo;</dt>
  25897. <dd><p>Set LFE low cut off frequency. By default, this is <var>128</var> Hz.
  25898. </p>
  25899. </dd>
  25900. <dt>&lsquo;<samp>lfe_high</samp>&rsquo;</dt>
  25901. <dd><p>Set LFE high cut off frequency. By default, this is <var>256</var> Hz.
  25902. </p>
  25903. </dd>
  25904. <dt>&lsquo;<samp>lfe_mode</samp>&rsquo;</dt>
  25905. <dd><p>Set LFE mode, can be <var>add</var> or <var>sub</var>. Default is <var>add</var>.
  25906. In <var>add</var> mode, LFE channel is created from input audio and added to output.
  25907. In <var>sub</var> mode, LFE channel is created from input audio and added to output but
  25908. also all non-LFE output channels are subtracted with output LFE channel.
  25909. </p>
  25910. </dd>
  25911. <dt>&lsquo;<samp>angle</samp>&rsquo;</dt>
  25912. <dd><p>Set angle of stereo surround transform, Allowed range is from <var>0</var> to <var>360</var>.
  25913. Default is <var>90</var>.
  25914. </p>
  25915. </dd>
  25916. <dt>&lsquo;<samp>fc_in</samp>&rsquo;</dt>
  25917. <dd><p>Set front center input volume. By default, this is <var>1</var>.
  25918. </p>
  25919. </dd>
  25920. <dt>&lsquo;<samp>fc_out</samp>&rsquo;</dt>
  25921. <dd><p>Set front center output volume. By default, this is <var>1</var>.
  25922. </p>
  25923. </dd>
  25924. <dt>&lsquo;<samp>fl_in</samp>&rsquo;</dt>
  25925. <dd><p>Set front left input volume. By default, this is <var>1</var>.
  25926. </p>
  25927. </dd>
  25928. <dt>&lsquo;<samp>fl_out</samp>&rsquo;</dt>
  25929. <dd><p>Set front left output volume. By default, this is <var>1</var>.
  25930. </p>
  25931. </dd>
  25932. <dt>&lsquo;<samp>fr_in</samp>&rsquo;</dt>
  25933. <dd><p>Set front right input volume. By default, this is <var>1</var>.
  25934. </p>
  25935. </dd>
  25936. <dt>&lsquo;<samp>fr_out</samp>&rsquo;</dt>
  25937. <dd><p>Set front right output volume. By default, this is <var>1</var>.
  25938. </p>
  25939. </dd>
  25940. <dt>&lsquo;<samp>sl_in</samp>&rsquo;</dt>
  25941. <dd><p>Set side left input volume. By default, this is <var>1</var>.
  25942. </p>
  25943. </dd>
  25944. <dt>&lsquo;<samp>sl_out</samp>&rsquo;</dt>
  25945. <dd><p>Set side left output volume. By default, this is <var>1</var>.
  25946. </p>
  25947. </dd>
  25948. <dt>&lsquo;<samp>sr_in</samp>&rsquo;</dt>
  25949. <dd><p>Set side right input volume. By default, this is <var>1</var>.
  25950. </p>
  25951. </dd>
  25952. <dt>&lsquo;<samp>sr_out</samp>&rsquo;</dt>
  25953. <dd><p>Set side right output volume. By default, this is <var>1</var>.
  25954. </p>
  25955. </dd>
  25956. <dt>&lsquo;<samp>bl_in</samp>&rsquo;</dt>
  25957. <dd><p>Set back left input volume. By default, this is <var>1</var>.
  25958. </p>
  25959. </dd>
  25960. <dt>&lsquo;<samp>bl_out</samp>&rsquo;</dt>
  25961. <dd><p>Set back left output volume. By default, this is <var>1</var>.
  25962. </p>
  25963. </dd>
  25964. <dt>&lsquo;<samp>br_in</samp>&rsquo;</dt>
  25965. <dd><p>Set back right input volume. By default, this is <var>1</var>.
  25966. </p>
  25967. </dd>
  25968. <dt>&lsquo;<samp>br_out</samp>&rsquo;</dt>
  25969. <dd><p>Set back right output volume. By default, this is <var>1</var>.
  25970. </p>
  25971. </dd>
  25972. <dt>&lsquo;<samp>bc_in</samp>&rsquo;</dt>
  25973. <dd><p>Set back center input volume. By default, this is <var>1</var>.
  25974. </p>
  25975. </dd>
  25976. <dt>&lsquo;<samp>bc_out</samp>&rsquo;</dt>
  25977. <dd><p>Set back center output volume. By default, this is <var>1</var>.
  25978. </p>
  25979. </dd>
  25980. <dt>&lsquo;<samp>lfe_in</samp>&rsquo;</dt>
  25981. <dd><p>Set LFE input volume. By default, this is <var>1</var>.
  25982. </p>
  25983. </dd>
  25984. <dt>&lsquo;<samp>lfe_out</samp>&rsquo;</dt>
  25985. <dd><p>Set LFE output volume. By default, this is <var>1</var>.
  25986. </p>
  25987. </dd>
  25988. <dt>&lsquo;<samp>allx</samp>&rsquo;</dt>
  25989. <dd><p>Set spread usage of stereo image across X axis for all channels.
  25990. </p>
  25991. </dd>
  25992. <dt>&lsquo;<samp>ally</samp>&rsquo;</dt>
  25993. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  25994. </p>
  25995. </dd>
  25996. <dt>&lsquo;<samp>fcx, flx, frx, blx, brx, slx, srx, bcx</samp>&rsquo;</dt>
  25997. <dd><p>Set spread usage of stereo image across X axis for each channel.
  25998. </p>
  25999. </dd>
  26000. <dt>&lsquo;<samp>fcy, fly, fry, bly, bry, sly, sry, bcy</samp>&rsquo;</dt>
  26001. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  26002. </p>
  26003. </dd>
  26004. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  26005. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  26006. </p>
  26007. </dd>
  26008. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  26009. <dd><p>Set window function.
  26010. </p>
  26011. <p>It accepts the following values:
  26012. </p><dl compact="compact">
  26013. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  26014. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  26015. <dt>&lsquo;<samp>hann, hanning</samp>&rsquo;</dt>
  26016. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  26017. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  26018. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  26019. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  26020. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  26021. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  26022. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  26023. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  26024. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  26025. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  26026. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  26027. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  26028. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  26029. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  26030. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  26031. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  26032. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  26033. </dl>
  26034. <p>Default is <code>hann</code>.
  26035. </p>
  26036. </dd>
  26037. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  26038. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  26039. window function will be picked. Default is <code>0.5</code>.
  26040. </p></dd>
  26041. </dl>
  26042. <a name="treble_002c-highshelf"></a>
  26043. <h2 class="section"><a href="ffmpeg-all.html#toc-treble_002c-highshelf">36.91 treble, highshelf</a></h2>
  26044. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  26045. shelving filter with a response similar to that of a standard
  26046. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  26047. </p>
  26048. <p>The filter accepts the following options:
  26049. </p>
  26050. <dl compact="compact">
  26051. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  26052. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  26053. Nyquist frequency. Its useful range is about -20 (for a large cut)
  26054. to +20 (for a large boost). Beware of clipping when using a positive gain.
  26055. </p>
  26056. </dd>
  26057. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26058. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  26059. to extend or reduce the frequency range to be boosted or cut.
  26060. The default value is <code>3000</code> Hz.
  26061. </p>
  26062. </dd>
  26063. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  26064. <dd><p>Set method to specify band-width of filter.
  26065. </p><dl compact="compact">
  26066. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  26067. <dd><p>Hz
  26068. </p></dd>
  26069. <dt>&lsquo;<samp>q</samp>&rsquo;</dt>
  26070. <dd><p>Q-Factor
  26071. </p></dd>
  26072. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  26073. <dd><p>octave
  26074. </p></dd>
  26075. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  26076. <dd><p>slope
  26077. </p></dd>
  26078. <dt>&lsquo;<samp>k</samp>&rsquo;</dt>
  26079. <dd><p>kHz
  26080. </p></dd>
  26081. </dl>
  26082. </dd>
  26083. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  26084. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  26085. </p>
  26086. </dd>
  26087. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  26088. <dd><p>How much to use filtered signal in output. Default is 1.
  26089. Range is between 0 and 1.
  26090. </p>
  26091. </dd>
  26092. <dt>&lsquo;<samp>channels, c</samp>&rsquo;</dt>
  26093. <dd><p>Specify which channels to filter, by default all available are filtered.
  26094. </p>
  26095. </dd>
  26096. <dt>&lsquo;<samp>normalize, n</samp>&rsquo;</dt>
  26097. <dd><p>Normalize biquad coefficients, by default is disabled.
  26098. Enabling it will normalize magnitude response at DC to 0dB.
  26099. </p></dd>
  26100. </dl>
  26101. <a name="Commands-8"></a>
  26102. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-8">36.91.1 Commands</a></h3>
  26103. <p>This filter supports the following commands:
  26104. </p><dl compact="compact">
  26105. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26106. <dd><p>Change treble frequency.
  26107. Syntax for the command is : &quot;<var>frequency</var>&quot;
  26108. </p>
  26109. </dd>
  26110. <dt>&lsquo;<samp>width_type, t</samp>&rsquo;</dt>
  26111. <dd><p>Change treble width_type.
  26112. Syntax for the command is : &quot;<var>width_type</var>&quot;
  26113. </p>
  26114. </dd>
  26115. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  26116. <dd><p>Change treble width.
  26117. Syntax for the command is : &quot;<var>width</var>&quot;
  26118. </p>
  26119. </dd>
  26120. <dt>&lsquo;<samp>gain, g</samp>&rsquo;</dt>
  26121. <dd><p>Change treble gain.
  26122. Syntax for the command is : &quot;<var>gain</var>&quot;
  26123. </p>
  26124. </dd>
  26125. <dt>&lsquo;<samp>mix, m</samp>&rsquo;</dt>
  26126. <dd><p>Change treble mix.
  26127. Syntax for the command is : &quot;<var>mix</var>&quot;
  26128. </p></dd>
  26129. </dl>
  26130. <a name="tremolo"></a>
  26131. <h2 class="section"><a href="ffmpeg-all.html#toc-tremolo">36.92 tremolo</a></h2>
  26132. <p>Sinusoidal amplitude modulation.
  26133. </p>
  26134. <p>The filter accepts the following options:
  26135. </p>
  26136. <dl compact="compact">
  26137. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  26138. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  26139. (20 Hz or lower) will result in a tremolo effect.
  26140. This filter may also be used as a ring modulator by specifying
  26141. a modulation frequency higher than 20 Hz.
  26142. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  26143. </p>
  26144. </dd>
  26145. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  26146. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  26147. Default value is 0.5.
  26148. </p></dd>
  26149. </dl>
  26150. <a name="vibrato"></a>
  26151. <h2 class="section"><a href="ffmpeg-all.html#toc-vibrato">36.93 vibrato</a></h2>
  26152. <p>Sinusoidal phase modulation.
  26153. </p>
  26154. <p>The filter accepts the following options:
  26155. </p>
  26156. <dl compact="compact">
  26157. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  26158. <dd><p>Modulation frequency in Hertz.
  26159. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  26160. </p>
  26161. </dd>
  26162. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  26163. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  26164. Default value is 0.5.
  26165. </p></dd>
  26166. </dl>
  26167. <a name="volume"></a>
  26168. <h2 class="section"><a href="ffmpeg-all.html#toc-volume">36.94 volume</a></h2>
  26169. <p>Adjust the input audio volume.
  26170. </p>
  26171. <p>It accepts the following parameters:
  26172. </p><dl compact="compact">
  26173. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26174. <dd><p>Set audio volume expression.
  26175. </p>
  26176. <p>Output values are clipped to the maximum value.
  26177. </p>
  26178. <p>The output audio volume is given by the relation:
  26179. </p><div class="example">
  26180. <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
  26181. </pre></div>
  26182. <p>The default value for <var>volume</var> is &quot;1.0&quot;.
  26183. </p>
  26184. </dd>
  26185. <dt>&lsquo;<samp>precision</samp>&rsquo;</dt>
  26186. <dd><p>This parameter represents the mathematical precision.
  26187. </p>
  26188. <p>It determines which input sample formats will be allowed, which affects the
  26189. precision of the volume scaling.
  26190. </p>
  26191. <dl compact="compact">
  26192. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  26193. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  26194. </p></dd>
  26195. <dt>&lsquo;<samp>float</samp>&rsquo;</dt>
  26196. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  26197. </p></dd>
  26198. <dt>&lsquo;<samp>double</samp>&rsquo;</dt>
  26199. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  26200. </p></dd>
  26201. </dl>
  26202. </dd>
  26203. <dt>&lsquo;<samp>replaygain</samp>&rsquo;</dt>
  26204. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  26205. </p>
  26206. <dl compact="compact">
  26207. <dt>&lsquo;<samp>drop</samp>&rsquo;</dt>
  26208. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  26209. </p>
  26210. </dd>
  26211. <dt>&lsquo;<samp>ignore</samp>&rsquo;</dt>
  26212. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  26213. </p>
  26214. </dd>
  26215. <dt>&lsquo;<samp>track</samp>&rsquo;</dt>
  26216. <dd><p>Prefer the track gain, if present.
  26217. </p>
  26218. </dd>
  26219. <dt>&lsquo;<samp>album</samp>&rsquo;</dt>
  26220. <dd><p>Prefer the album gain, if present.
  26221. </p></dd>
  26222. </dl>
  26223. </dd>
  26224. <dt>&lsquo;<samp>replaygain_preamp</samp>&rsquo;</dt>
  26225. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  26226. </p>
  26227. <p>Default value for <var>replaygain_preamp</var> is 0.0.
  26228. </p>
  26229. </dd>
  26230. <dt>&lsquo;<samp>replaygain_noclip</samp>&rsquo;</dt>
  26231. <dd><p>Prevent clipping by limiting the gain applied.
  26232. </p>
  26233. <p>Default value for <var>replaygain_noclip</var> is 1.
  26234. </p>
  26235. </dd>
  26236. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  26237. <dd><p>Set when the volume expression is evaluated.
  26238. </p>
  26239. <p>It accepts the following values:
  26240. </p><dl compact="compact">
  26241. <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
  26242. <dd><p>only evaluate expression once during the filter initialization, or
  26243. when the &lsquo;<samp>volume</samp>&rsquo; command is sent
  26244. </p>
  26245. </dd>
  26246. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  26247. <dd><p>evaluate expression for each incoming frame
  26248. </p></dd>
  26249. </dl>
  26250. <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
  26251. </p></dd>
  26252. </dl>
  26253. <p>The volume expression can contain the following parameters.
  26254. </p>
  26255. <dl compact="compact">
  26256. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26257. <dd><p>frame number (starting at zero)
  26258. </p></dd>
  26259. <dt>&lsquo;<samp>nb_channels</samp>&rsquo;</dt>
  26260. <dd><p>number of channels
  26261. </p></dd>
  26262. <dt>&lsquo;<samp>nb_consumed_samples</samp>&rsquo;</dt>
  26263. <dd><p>number of samples consumed by the filter
  26264. </p></dd>
  26265. <dt>&lsquo;<samp>nb_samples</samp>&rsquo;</dt>
  26266. <dd><p>number of samples in the current frame
  26267. </p></dd>
  26268. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  26269. <dd><p>original frame position in the file
  26270. </p></dd>
  26271. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  26272. <dd><p>frame PTS
  26273. </p></dd>
  26274. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  26275. <dd><p>sample rate
  26276. </p></dd>
  26277. <dt>&lsquo;<samp>startpts</samp>&rsquo;</dt>
  26278. <dd><p>PTS at start of stream
  26279. </p></dd>
  26280. <dt>&lsquo;<samp>startt</samp>&rsquo;</dt>
  26281. <dd><p>time at start of stream
  26282. </p></dd>
  26283. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26284. <dd><p>frame time
  26285. </p></dd>
  26286. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  26287. <dd><p>timestamp timebase
  26288. </p></dd>
  26289. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26290. <dd><p>last set volume value
  26291. </p></dd>
  26292. </dl>
  26293. <p>Note that when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>once</samp>&rsquo; only the
  26294. <var>sample_rate</var> and <var>tb</var> variables are available, all other
  26295. variables will evaluate to NAN.
  26296. </p>
  26297. <a name="Commands-46"></a>
  26298. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-46">36.94.1 Commands</a></h3>
  26299. <p>This filter supports the following commands:
  26300. </p><dl compact="compact">
  26301. <dt>&lsquo;<samp>volume</samp>&rsquo;</dt>
  26302. <dd><p>Modify the volume expression.
  26303. The command accepts the same syntax of the corresponding option.
  26304. </p>
  26305. <p>If the specified expression is not valid, it is kept at its current
  26306. value.
  26307. </p></dd>
  26308. </dl>
  26309. <a name="Examples-152"></a>
  26310. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-152">36.94.2 Examples</a></h3>
  26311. <ul>
  26312. <li>
  26313. Halve the input audio volume:
  26314. <div class="example">
  26315. <pre class="example">volume=volume=0.5
  26316. volume=volume=1/2
  26317. volume=volume=-6.0206dB
  26318. </pre></div>
  26319. <p>In all the above example the named key for &lsquo;<samp>volume</samp>&rsquo; can be
  26320. omitted, for example like in:
  26321. </p><div class="example">
  26322. <pre class="example">volume=0.5
  26323. </pre></div>
  26324. </li><li>
  26325. Increase input audio power by 6 decibels using fixed-point precision:
  26326. <div class="example">
  26327. <pre class="example">volume=volume=6dB:precision=fixed
  26328. </pre></div>
  26329. </li><li>
  26330. Fade volume after time 10 with an annihilation period of 5 seconds:
  26331. <div class="example">
  26332. <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  26333. </pre></div>
  26334. </li></ul>
  26335. <a name="volumedetect"></a>
  26336. <h2 class="section"><a href="ffmpeg-all.html#toc-volumedetect">36.95 volumedetect</a></h2>
  26337. <p>Detect the volume of the input video.
  26338. </p>
  26339. <p>The filter has no parameters. The input is not modified. Statistics about
  26340. the volume will be printed in the log when the input stream end is reached.
  26341. </p>
  26342. <p>In particular it will show the mean volume (root mean square), maximum
  26343. volume (on a per-sample basis), and the beginning of a histogram of the
  26344. registered volume values (from the maximum value to a cumulated 1/1000 of
  26345. the samples).
  26346. </p>
  26347. <p>All volumes are in decibels relative to the maximum PCM value.
  26348. </p>
  26349. <a name="Examples-153"></a>
  26350. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-153">36.95.1 Examples</a></h3>
  26351. <p>Here is an excerpt of the output:
  26352. </p><div class="example">
  26353. <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  26354. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  26355. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  26356. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  26357. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  26358. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  26359. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  26360. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  26361. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  26362. </pre></div>
  26363. <p>It means that:
  26364. </p><ul>
  26365. <li>
  26366. The mean square energy is approximately -27 dB, or 10^-2.7.
  26367. </li><li>
  26368. The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  26369. </li><li>
  26370. There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  26371. </li></ul>
  26372. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  26373. raising it by +5 dB causes clipping for 6 samples, etc.
  26374. </p>
  26375. <a name="Audio-Sources"></a>
  26376. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sources">37 Audio Sources</a></h1>
  26377. <p>Below is a description of the currently available audio sources.
  26378. </p>
  26379. <a name="abuffer"></a>
  26380. <h2 class="section"><a href="ffmpeg-all.html#toc-abuffer">37.1 abuffer</a></h2>
  26381. <p>Buffer audio frames, and make them available to the filter chain.
  26382. </p>
  26383. <p>This source is mainly intended for a programmatic use, in particular
  26384. through the interface defined in &lsquo;<tt>libavfilter/asrc_abuffer.h</tt>&rsquo;.
  26385. </p>
  26386. <p>It accepts the following parameters:
  26387. </p><dl compact="compact">
  26388. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  26389. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  26390. either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
  26391. </p>
  26392. </dd>
  26393. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  26394. <dd><p>The sample rate of the incoming audio buffers.
  26395. </p>
  26396. </dd>
  26397. <dt>&lsquo;<samp>sample_fmt</samp>&rsquo;</dt>
  26398. <dd><p>The sample format of the incoming audio buffers.
  26399. Either a sample format name or its corresponding integer representation from
  26400. the enum AVSampleFormat in &lsquo;<tt>libavutil/samplefmt.h</tt>&rsquo;
  26401. </p>
  26402. </dd>
  26403. <dt>&lsquo;<samp>channel_layout</samp>&rsquo;</dt>
  26404. <dd><p>The channel layout of the incoming audio buffers.
  26405. Either a channel layout name from channel_layout_map in
  26406. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; or its corresponding integer representation
  26407. from the AV_CH_LAYOUT_* macros in &lsquo;<tt>libavutil/channel_layout.h</tt>&rsquo;
  26408. </p>
  26409. </dd>
  26410. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  26411. <dd><p>The number of channels of the incoming audio buffers.
  26412. If both <var>channels</var> and <var>channel_layout</var> are specified, then they
  26413. must be consistent.
  26414. </p>
  26415. </dd>
  26416. </dl>
  26417. <a name="Examples-155"></a>
  26418. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-155">37.1.1 Examples</a></h3>
  26419. <div class="example">
  26420. <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  26421. </pre></div>
  26422. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  26423. Since the sample format with name &quot;s16p&quot; corresponds to the number
  26424. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  26425. equivalent to:
  26426. </p><div class="example">
  26427. <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  26428. </pre></div>
  26429. <a name="aevalsrc"></a>
  26430. <h2 class="section"><a href="ffmpeg-all.html#toc-aevalsrc">37.2 aevalsrc</a></h2>
  26431. <p>Generate an audio signal specified by an expression.
  26432. </p>
  26433. <p>This source accepts in input one or more expressions (one for each
  26434. channel), which are evaluated and used to generate a corresponding
  26435. audio signal.
  26436. </p>
  26437. <p>This source accepts the following options:
  26438. </p>
  26439. <dl compact="compact">
  26440. <dt>&lsquo;<samp>exprs</samp>&rsquo;</dt>
  26441. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  26442. &lsquo;<samp>channel_layout</samp>&rsquo; option is not specified, the selected channel layout
  26443. depends on the number of provided expressions. Otherwise the last
  26444. specified expression is applied to the remaining output channels.
  26445. </p>
  26446. </dd>
  26447. <dt>&lsquo;<samp>channel_layout, c</samp>&rsquo;</dt>
  26448. <dd><p>Set the channel layout. The number of channels in the specified layout
  26449. must be equal to the number of specified expressions.
  26450. </p>
  26451. </dd>
  26452. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  26453. <dd><p>Set the minimum duration of the sourced audio. See
  26454. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26455. for the accepted syntax.
  26456. Note that the resulting duration may be greater than the specified
  26457. duration, as the generated audio is always cut at the end of a
  26458. complete frame.
  26459. </p>
  26460. <p>If not specified, or the expressed duration is negative, the audio is
  26461. supposed to be generated forever.
  26462. </p>
  26463. </dd>
  26464. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26465. <dd><p>Set the number of samples per channel per each output frame,
  26466. default to 1024.
  26467. </p>
  26468. </dd>
  26469. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  26470. <dd><p>Specify the sample rate, default to 44100.
  26471. </p></dd>
  26472. </dl>
  26473. <p>Each expression in <var>exprs</var> can contain the following constants:
  26474. </p>
  26475. <dl compact="compact">
  26476. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26477. <dd><p>number of the evaluated sample, starting from 0
  26478. </p>
  26479. </dd>
  26480. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26481. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  26482. </p>
  26483. </dd>
  26484. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  26485. <dd><p>sample rate
  26486. </p>
  26487. </dd>
  26488. </dl>
  26489. <a name="Examples-47"></a>
  26490. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-47">37.2.1 Examples</a></h3>
  26491. <ul>
  26492. <li>
  26493. Generate silence:
  26494. <div class="example">
  26495. <pre class="example">aevalsrc=0
  26496. </pre></div>
  26497. </li><li>
  26498. Generate a sin signal with frequency of 440 Hz, set sample rate to
  26499. 8000 Hz:
  26500. <div class="example">
  26501. <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  26502. </pre></div>
  26503. </li><li>
  26504. Generate a two channels signal, specify the channel layout (Front
  26505. Center + Back Center) explicitly:
  26506. <div class="example">
  26507. <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  26508. </pre></div>
  26509. </li><li>
  26510. Generate white noise:
  26511. <div class="example">
  26512. <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
  26513. </pre></div>
  26514. </li><li>
  26515. Generate an amplitude modulated signal:
  26516. <div class="example">
  26517. <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  26518. </pre></div>
  26519. </li><li>
  26520. Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  26521. <div class="example">
  26522. <pre class="example">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
  26523. </pre></div>
  26524. </li></ul>
  26525. <a name="afirsrc"></a>
  26526. <h2 class="section"><a href="ffmpeg-all.html#toc-afirsrc">37.3 afirsrc</a></h2>
  26527. <p>Generate a FIR coefficients using frequency sampling method.
  26528. </p>
  26529. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  26530. </p>
  26531. <p>The filter accepts the following options:
  26532. </p>
  26533. <dl compact="compact">
  26534. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  26535. <dd><p>Set number of filter coefficents in output audio stream.
  26536. Default value is 1025.
  26537. </p>
  26538. </dd>
  26539. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26540. <dd><p>Set frequency points from where magnitude and phase are set.
  26541. This must be in non decreasing order, and first element must be 0, while last element
  26542. must be 1. Elements are separated by white spaces.
  26543. </p>
  26544. </dd>
  26545. <dt>&lsquo;<samp>magnitude, m</samp>&rsquo;</dt>
  26546. <dd><p>Set magnitude value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  26547. Number of values must be same as number of frequency points.
  26548. Values are separated by white spaces.
  26549. </p>
  26550. </dd>
  26551. <dt>&lsquo;<samp>phase, p</samp>&rsquo;</dt>
  26552. <dd><p>Set phase value for every frequency point set by &lsquo;<samp>frequency</samp>&rsquo;.
  26553. Number of values must be same as number of frequency points.
  26554. Values are separated by white spaces.
  26555. </p>
  26556. </dd>
  26557. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26558. <dd><p>Set sample rate, default is 44100.
  26559. </p>
  26560. </dd>
  26561. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26562. <dd><p>Set number of samples per each frame. Default is 1024.
  26563. </p>
  26564. </dd>
  26565. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  26566. <dd><p>Set window function. Default is blackman.
  26567. </p></dd>
  26568. </dl>
  26569. <a name="anullsrc"></a>
  26570. <h2 class="section"><a href="ffmpeg-all.html#toc-anullsrc">37.4 anullsrc</a></h2>
  26571. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  26572. as a template and to be employed in analysis / debugging tools, or as
  26573. the source for filters which ignore the input data (for example the sox
  26574. synth filter).
  26575. </p>
  26576. <p>This source accepts the following options:
  26577. </p>
  26578. <dl compact="compact">
  26579. <dt>&lsquo;<samp>channel_layout, cl</samp>&rsquo;</dt>
  26580. <dd>
  26581. <p>Specifies the channel layout, and can be either an integer or a string
  26582. representing a channel layout. The default value of <var>channel_layout</var>
  26583. is &quot;stereo&quot;.
  26584. </p>
  26585. <p>Check the channel_layout_map definition in
  26586. &lsquo;<tt>libavutil/channel_layout.c</tt>&rsquo; for the mapping between strings and
  26587. channel layout values.
  26588. </p>
  26589. </dd>
  26590. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26591. <dd><p>Specifies the sample rate, and defaults to 44100.
  26592. </p>
  26593. </dd>
  26594. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26595. <dd><p>Set the number of samples per requested frames.
  26596. </p>
  26597. </dd>
  26598. </dl>
  26599. <a name="Examples-22"></a>
  26600. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-22">37.4.1 Examples</a></h3>
  26601. <ul>
  26602. <li>
  26603. Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  26604. <div class="example">
  26605. <pre class="example">anullsrc=r=48000:cl=4
  26606. </pre></div>
  26607. </li><li>
  26608. Do the same operation with a more obvious syntax:
  26609. <div class="example">
  26610. <pre class="example">anullsrc=r=48000:cl=mono
  26611. </pre></div>
  26612. </li></ul>
  26613. <p>All the parameters need to be explicitly defined.
  26614. </p>
  26615. <a name="flite"></a>
  26616. <h2 class="section"><a href="ffmpeg-all.html#toc-flite">37.5 flite</a></h2>
  26617. <p>Synthesize a voice utterance using the libflite library.
  26618. </p>
  26619. <p>To enable compilation of this filter you need to configure FFmpeg with
  26620. <code>--enable-libflite</code>.
  26621. </p>
  26622. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  26623. </p>
  26624. <p>The filter accepts the following options:
  26625. </p>
  26626. <dl compact="compact">
  26627. <dt>&lsquo;<samp>list_voices</samp>&rsquo;</dt>
  26628. <dd><p>If set to 1, list the names of the available voices and exit
  26629. immediately. Default value is 0.
  26630. </p>
  26631. </dd>
  26632. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26633. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  26634. </p>
  26635. </dd>
  26636. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  26637. <dd><p>Set the filename containing the text to speak.
  26638. </p>
  26639. </dd>
  26640. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  26641. <dd><p>Set the text to speak.
  26642. </p>
  26643. </dd>
  26644. <dt>&lsquo;<samp>voice, v</samp>&rsquo;</dt>
  26645. <dd><p>Set the voice to use for the speech synthesis. Default value is
  26646. <code>kal</code>. See also the <var>list_voices</var> option.
  26647. </p></dd>
  26648. </dl>
  26649. <a name="Examples-137"></a>
  26650. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-137">37.5.1 Examples</a></h3>
  26651. <ul>
  26652. <li>
  26653. Read from file &lsquo;<tt>speech.txt</tt>&rsquo;, and synthesize the text using the
  26654. standard flite voice:
  26655. <div class="example">
  26656. <pre class="example">flite=textfile=speech.txt
  26657. </pre></div>
  26658. </li><li>
  26659. Read the specified text selecting the <code>slt</code> voice:
  26660. <div class="example">
  26661. <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  26662. </pre></div>
  26663. </li><li>
  26664. Input text to ffmpeg:
  26665. <div class="example">
  26666. <pre class="example">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  26667. </pre></div>
  26668. </li><li>
  26669. Make &lsquo;<tt>ffplay</tt>&rsquo; speak the specified text, using <code>flite</code> and
  26670. the <code>lavfi</code> device:
  26671. <div class="example">
  26672. <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  26673. </pre></div>
  26674. </li></ul>
  26675. <p>For more information about libflite, check:
  26676. <a href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  26677. </p>
  26678. <a name="anoisesrc"></a>
  26679. <h2 class="section"><a href="ffmpeg-all.html#toc-anoisesrc">37.6 anoisesrc</a></h2>
  26680. <p>Generate a noise audio signal.
  26681. </p>
  26682. <p>The filter accepts the following options:
  26683. </p>
  26684. <dl compact="compact">
  26685. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26686. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  26687. </p>
  26688. </dd>
  26689. <dt>&lsquo;<samp>amplitude, a</samp>&rsquo;</dt>
  26690. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  26691. is 1.0.
  26692. </p>
  26693. </dd>
  26694. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  26695. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  26696. results in noise with an infinite length.
  26697. </p>
  26698. </dd>
  26699. <dt>&lsquo;<samp>color, colour, c</samp>&rsquo;</dt>
  26700. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  26701. blue, violet and velvet. Default color is white.
  26702. </p>
  26703. </dd>
  26704. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  26705. <dd><p>Specify a value used to seed the PRNG.
  26706. </p>
  26707. </dd>
  26708. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26709. <dd><p>Set the number of samples per each output frame, default is 1024.
  26710. </p></dd>
  26711. </dl>
  26712. <a name="Examples-163"></a>
  26713. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-163">37.6.1 Examples</a></h3>
  26714. <ul>
  26715. <li>
  26716. Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  26717. <div class="example">
  26718. <pre class="example">anoisesrc=d=60:c=pink:r=44100:a=0.5
  26719. </pre></div>
  26720. </li></ul>
  26721. <a name="hilbert"></a>
  26722. <h2 class="section"><a href="ffmpeg-all.html#toc-hilbert">37.7 hilbert</a></h2>
  26723. <p>Generate odd-tap Hilbert transform FIR coefficients.
  26724. </p>
  26725. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for phase-shifting
  26726. the signal by 90 degrees.
  26727. </p>
  26728. <p>This is used in many matrix coding schemes and for analytic signal generation.
  26729. The process is often written as a multiplication by i (or j), the imaginary unit.
  26730. </p>
  26731. <p>The filter accepts the following options:
  26732. </p>
  26733. <dl compact="compact">
  26734. <dt>&lsquo;<samp>sample_rate, s</samp>&rsquo;</dt>
  26735. <dd><p>Set sample rate, default is 44100.
  26736. </p>
  26737. </dd>
  26738. <dt>&lsquo;<samp>taps, t</samp>&rsquo;</dt>
  26739. <dd><p>Set length of FIR filter, default is 22051.
  26740. </p>
  26741. </dd>
  26742. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26743. <dd><p>Set number of samples per each frame.
  26744. </p>
  26745. </dd>
  26746. <dt>&lsquo;<samp>win_func, w</samp>&rsquo;</dt>
  26747. <dd><p>Set window function to be used when generating FIR coefficients.
  26748. </p></dd>
  26749. </dl>
  26750. <a name="sinc"></a>
  26751. <h2 class="section"><a href="ffmpeg-all.html#toc-sinc">37.8 sinc</a></h2>
  26752. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  26753. </p>
  26754. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  26755. </p>
  26756. <p>The filter accepts the following options:
  26757. </p>
  26758. <dl compact="compact">
  26759. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26760. <dd><p>Set sample rate, default is 44100.
  26761. </p>
  26762. </dd>
  26763. <dt>&lsquo;<samp>nb_samples, n</samp>&rsquo;</dt>
  26764. <dd><p>Set number of samples per each frame. Default is 1024.
  26765. </p>
  26766. </dd>
  26767. <dt>&lsquo;<samp>hp</samp>&rsquo;</dt>
  26768. <dd><p>Set high-pass frequency. Default is 0.
  26769. </p>
  26770. </dd>
  26771. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  26772. <dd><p>Set low-pass frequency. Default is 0.
  26773. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  26774. is higher than 0 then filter will create band-pass filter coefficients,
  26775. otherwise band-reject filter coefficients.
  26776. </p>
  26777. </dd>
  26778. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  26779. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  26780. </p>
  26781. </dd>
  26782. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  26783. <dd><p>Set Kaiser window beta.
  26784. </p>
  26785. </dd>
  26786. <dt>&lsquo;<samp>att</samp>&rsquo;</dt>
  26787. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  26788. </p>
  26789. </dd>
  26790. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  26791. <dd><p>Enable rounding, by default is disabled.
  26792. </p>
  26793. </dd>
  26794. <dt>&lsquo;<samp>hptaps</samp>&rsquo;</dt>
  26795. <dd><p>Set number of taps for high-pass filter.
  26796. </p>
  26797. </dd>
  26798. <dt>&lsquo;<samp>lptaps</samp>&rsquo;</dt>
  26799. <dd><p>Set number of taps for low-pass filter.
  26800. </p></dd>
  26801. </dl>
  26802. <a name="sine"></a>
  26803. <h2 class="section"><a href="ffmpeg-all.html#toc-sine">37.9 sine</a></h2>
  26804. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  26805. </p>
  26806. <p>The audio signal is bit-exact.
  26807. </p>
  26808. <p>The filter accepts the following options:
  26809. </p>
  26810. <dl compact="compact">
  26811. <dt>&lsquo;<samp>frequency, f</samp>&rsquo;</dt>
  26812. <dd><p>Set the carrier frequency. Default is 440 Hz.
  26813. </p>
  26814. </dd>
  26815. <dt>&lsquo;<samp>beep_factor, b</samp>&rsquo;</dt>
  26816. <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
  26817. the carrier frequency. Default is 0, meaning the beep is disabled.
  26818. </p>
  26819. </dd>
  26820. <dt>&lsquo;<samp>sample_rate, r</samp>&rsquo;</dt>
  26821. <dd><p>Specify the sample rate, default is 44100.
  26822. </p>
  26823. </dd>
  26824. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  26825. <dd><p>Specify the duration of the generated audio stream.
  26826. </p>
  26827. </dd>
  26828. <dt>&lsquo;<samp>samples_per_frame</samp>&rsquo;</dt>
  26829. <dd><p>Set the number of samples per output frame.
  26830. </p>
  26831. <p>The expression can contain the following constants:
  26832. </p>
  26833. <dl compact="compact">
  26834. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  26835. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  26836. </p>
  26837. </dd>
  26838. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  26839. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  26840. expressed in <var>TB</var> units.
  26841. </p>
  26842. </dd>
  26843. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  26844. <dd><p>The PTS of the output audio frame, expressed in seconds.
  26845. </p>
  26846. </dd>
  26847. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  26848. <dd><p>The timebase of the output audio frames.
  26849. </p></dd>
  26850. </dl>
  26851. <p>Default is <code>1024</code>.
  26852. </p></dd>
  26853. </dl>
  26854. <a name="Examples-63"></a>
  26855. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-63">37.9.1 Examples</a></h3>
  26856. <ul>
  26857. <li>
  26858. Generate a simple 440 Hz sine wave:
  26859. <div class="example">
  26860. <pre class="example">sine
  26861. </pre></div>
  26862. </li><li>
  26863. Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  26864. <div class="example">
  26865. <pre class="example">sine=220:4:d=5
  26866. sine=f=220:b=4:d=5
  26867. sine=frequency=220:beep_factor=4:duration=5
  26868. </pre></div>
  26869. </li><li>
  26870. Generate a 1 kHz sine wave following <code>1602,1601,1602,1601,1602</code> NTSC
  26871. pattern:
  26872. <div class="example">
  26873. <pre class="example">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  26874. </pre></div>
  26875. </li></ul>
  26876. <a name="Audio-Sinks"></a>
  26877. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Audio-Sinks">38 Audio Sinks</a></h1>
  26878. <p>Below is a description of the currently available audio sinks.
  26879. </p>
  26880. <a name="abuffersink"></a>
  26881. <h2 class="section"><a href="ffmpeg-all.html#toc-abuffersink">38.1 abuffersink</a></h2>
  26882. <p>Buffer audio frames, and make them available to the end of filter chain.
  26883. </p>
  26884. <p>This sink is mainly intended for programmatic use, in particular
  26885. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  26886. or the options system.
  26887. </p>
  26888. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  26889. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  26890. parameter to <code>avfilter_init_filter</code> for initialization.
  26891. </p><a name="anullsink"></a>
  26892. <h2 class="section"><a href="ffmpeg-all.html#toc-anullsink">38.2 anullsink</a></h2>
  26893. <p>Null audio sink; do absolutely nothing with the input audio. It is
  26894. mainly useful as a template and for use in analysis / debugging
  26895. tools.
  26896. </p>
  26897. <a name="Video-Filters"></a>
  26898. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Filters">39 Video Filters</a></h1>
  26899. <p>When you configure your FFmpeg build, you can disable any of the
  26900. existing filters using <code>--disable-filters</code>.
  26901. The configure output will show the video filters included in your
  26902. build.
  26903. </p>
  26904. <p>Below is a description of the currently available video filters.
  26905. </p>
  26906. <a name="addroi"></a>
  26907. <h2 class="section"><a href="ffmpeg-all.html#toc-addroi">39.1 addroi</a></h2>
  26908. <p>Mark a region of interest in a video frame.
  26909. </p>
  26910. <p>The frame data is passed through unchanged, but metadata is attached
  26911. to the frame indicating regions of interest which can affect the
  26912. behaviour of later encoding. Multiple regions can be marked by
  26913. applying the filter multiple times.
  26914. </p>
  26915. <dl compact="compact">
  26916. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  26917. <dd><p>Region distance in pixels from the left edge of the frame.
  26918. </p></dd>
  26919. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  26920. <dd><p>Region distance in pixels from the top edge of the frame.
  26921. </p></dd>
  26922. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  26923. <dd><p>Region width in pixels.
  26924. </p></dd>
  26925. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  26926. <dd><p>Region height in pixels.
  26927. </p>
  26928. <p>The parameters <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are expressions,
  26929. and may contain the following variables:
  26930. </p><dl compact="compact">
  26931. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  26932. <dd><p>Width of the input frame.
  26933. </p></dd>
  26934. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  26935. <dd><p>Height of the input frame.
  26936. </p></dd>
  26937. </dl>
  26938. </dd>
  26939. <dt>&lsquo;<samp>qoffset</samp>&rsquo;</dt>
  26940. <dd><p>Quantisation offset to apply within the region.
  26941. </p>
  26942. <p>This must be a real value in the range -1 to +1. A value of zero
  26943. indicates no quality change. A negative value asks for better quality
  26944. (less quantisation), while a positive value asks for worse quality
  26945. (greater quantisation).
  26946. </p>
  26947. <p>The range is calibrated so that the extreme values indicate the
  26948. largest possible offset - if the rest of the frame is encoded with the
  26949. worst possible quality, an offset of -1 indicates that this region
  26950. should be encoded with the best possible quality anyway. Intermediate
  26951. values are then interpolated in some codec-dependent way.
  26952. </p>
  26953. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  26954. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  26955. this region should be encoded with a QP around one-tenth of the full
  26956. range better than the rest of the frame. So, if most of the frame
  26957. were to be encoded with a QP of around 30, this region would get a QP
  26958. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  26959. An extreme value of -1 would indicate that this region should be
  26960. encoded with the best possible quality regardless of the treatment of
  26961. the rest of the frame - that is, should be encoded at a QP of -12.
  26962. </p></dd>
  26963. <dt>&lsquo;<samp>clear</samp>&rsquo;</dt>
  26964. <dd><p>If set to true, remove any existing regions of interest marked on the
  26965. frame before adding the new one.
  26966. </p></dd>
  26967. </dl>
  26968. <a name="Examples-44"></a>
  26969. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-44">39.1.1 Examples</a></h3>
  26970. <ul>
  26971. <li>
  26972. Mark the centre quarter of the frame as interesting.
  26973. <div class="example">
  26974. <pre class="example">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  26975. </pre></div>
  26976. </li><li>
  26977. Mark the 100-pixel-wide region on the left edge of the frame as very
  26978. uninteresting (to be encoded at much lower quality than the rest of
  26979. the frame).
  26980. <div class="example">
  26981. <pre class="example">addroi=0:0:100:ih:+1/5
  26982. </pre></div>
  26983. </li></ul>
  26984. <a name="alphaextract"></a>
  26985. <h2 class="section"><a href="ffmpeg-all.html#toc-alphaextract">39.2 alphaextract</a></h2>
  26986. <p>Extract the alpha component from the input as a grayscale video. This
  26987. is especially useful with the <var>alphamerge</var> filter.
  26988. </p>
  26989. <a name="alphamerge"></a>
  26990. <h2 class="section"><a href="ffmpeg-all.html#toc-alphamerge">39.3 alphamerge</a></h2>
  26991. <p>Add or replace the alpha component of the primary input with the
  26992. grayscale value of a second input. This is intended for use with
  26993. <var>alphaextract</var> to allow the transmission or storage of frame
  26994. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  26995. channel.
  26996. </p>
  26997. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  26998. and a separate video created with <var>alphaextract</var>, you might use:
  26999. </p><div class="example">
  27000. <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  27001. </pre></div>
  27002. <p>Since this filter is designed for reconstruction, it operates on frame
  27003. sequences without considering timestamps, and terminates when either
  27004. input reaches end of stream. This will cause problems if your encoding
  27005. pipeline drops frames. If you&rsquo;re trying to apply an image as an
  27006. overlay to a video stream, consider the <var>overlay</var> filter instead.
  27007. </p>
  27008. <a name="amplify"></a>
  27009. <h2 class="section"><a href="ffmpeg-all.html#toc-amplify">39.4 amplify</a></h2>
  27010. <p>Amplify differences between current pixel and pixels of adjacent frames in
  27011. same pixel location.
  27012. </p>
  27013. <p>This filter accepts the following options:
  27014. </p>
  27015. <dl compact="compact">
  27016. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  27017. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  27018. For example radius of 3 will instruct filter to calculate average of 7 frames.
  27019. </p>
  27020. </dd>
  27021. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  27022. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  27023. </p>
  27024. </dd>
  27025. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  27026. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  27027. this value will not alter source pixel. Default is 10.
  27028. Allowed range is from 0 to 65535.
  27029. </p>
  27030. </dd>
  27031. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  27032. <dd><p>Set tolerance for difference amplification. Any difference lower to
  27033. this value will not alter source pixel. Default is 0.
  27034. Allowed range is from 0 to 65535.
  27035. </p>
  27036. </dd>
  27037. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  27038. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  27039. This option controls maximum possible value that will decrease source pixel value.
  27040. </p>
  27041. </dd>
  27042. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  27043. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  27044. This option controls maximum possible value that will increase source pixel value.
  27045. </p>
  27046. </dd>
  27047. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27048. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  27049. </p></dd>
  27050. </dl>
  27051. <a name="Commands-43"></a>
  27052. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-43">39.4.1 Commands</a></h3>
  27053. <p>This filter supports the following <a href="#commands">commands</a> that corresponds to option of same name:
  27054. </p><dl compact="compact">
  27055. <dt>&lsquo;<samp>factor</samp>&rsquo;</dt>
  27056. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  27057. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  27058. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  27059. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  27060. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27061. </dl>
  27062. <a name="ass"></a>
  27063. <h2 class="section"><a href="ffmpeg-all.html#toc-ass">39.5 ass</a></h2>
  27064. <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  27065. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  27066. Substation Alpha) subtitles files.
  27067. </p>
  27068. <p>This filter accepts the following option in addition to the common options from
  27069. the <a href="#subtitles">subtitles</a> filter:
  27070. </p>
  27071. <dl compact="compact">
  27072. <dt>&lsquo;<samp>shaping</samp>&rsquo;</dt>
  27073. <dd><p>Set the shaping engine
  27074. </p>
  27075. <p>Available values are:
  27076. </p><dl compact="compact">
  27077. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  27078. <dd><p>The default libass shaping engine, which is the best available.
  27079. </p></dd>
  27080. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  27081. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  27082. </p></dd>
  27083. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  27084. <dd><p>Slower shaper using OpenType for substitutions and positioning
  27085. </p></dd>
  27086. </dl>
  27087. <p>The default is <code>auto</code>.
  27088. </p></dd>
  27089. </dl>
  27090. <a name="atadenoise"></a>
  27091. <h2 class="section"><a href="ffmpeg-all.html#toc-atadenoise">39.6 atadenoise</a></h2>
  27092. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  27093. </p>
  27094. <p>The filter accepts the following options:
  27095. </p>
  27096. <dl compact="compact">
  27097. <dt>&lsquo;<samp>0a</samp>&rsquo;</dt>
  27098. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  27099. Valid range is 0 to 0.3.
  27100. </p>
  27101. </dd>
  27102. <dt>&lsquo;<samp>0b</samp>&rsquo;</dt>
  27103. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  27104. Valid range is 0 to 5.
  27105. </p>
  27106. </dd>
  27107. <dt>&lsquo;<samp>1a</samp>&rsquo;</dt>
  27108. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  27109. Valid range is 0 to 0.3.
  27110. </p>
  27111. </dd>
  27112. <dt>&lsquo;<samp>1b</samp>&rsquo;</dt>
  27113. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  27114. Valid range is 0 to 5.
  27115. </p>
  27116. </dd>
  27117. <dt>&lsquo;<samp>2a</samp>&rsquo;</dt>
  27118. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  27119. Valid range is 0 to 0.3.
  27120. </p>
  27121. </dd>
  27122. <dt>&lsquo;<samp>2b</samp>&rsquo;</dt>
  27123. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  27124. Valid range is 0 to 5.
  27125. </p>
  27126. <p>Threshold A is designed to react on abrupt changes in the input signal and
  27127. threshold B is designed to react on continuous changes in the input signal.
  27128. </p>
  27129. </dd>
  27130. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  27131. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  27132. number in range [5, 129].
  27133. </p>
  27134. </dd>
  27135. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  27136. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  27137. </p>
  27138. </dd>
  27139. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  27140. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code>p</code> parallel.
  27141. Alternatively can be set to <code>s</code> serial.
  27142. </p>
  27143. <p>Parallel can be faster then serial, while other way around is never true.
  27144. Parallel will abort early on first change being greater then thresholds, while serial
  27145. will continue processing other side of frames if they are equal or bellow thresholds.
  27146. </p></dd>
  27147. </dl>
  27148. <a name="Commands-29"></a>
  27149. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-29">39.6.1 Commands</a></h3>
  27150. <p>This filter supports same <a href="#commands">commands</a> as options except option <code>s</code>.
  27151. The command accepts the same syntax of the corresponding option.
  27152. </p>
  27153. <a name="avgblur"></a>
  27154. <h2 class="section"><a href="ffmpeg-all.html#toc-avgblur">39.7 avgblur</a></h2>
  27155. <p>Apply average blur filter.
  27156. </p>
  27157. <p>The filter accepts the following options:
  27158. </p>
  27159. <dl compact="compact">
  27160. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  27161. <dd><p>Set horizontal radius size.
  27162. </p>
  27163. </dd>
  27164. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27165. <dd><p>Set which planes to filter. By default all planes are filtered.
  27166. </p>
  27167. </dd>
  27168. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  27169. <dd><p>Set vertical radius size, if zero it will be same as <code>sizeX</code>.
  27170. Default is <code>0</code>.
  27171. </p></dd>
  27172. </dl>
  27173. <a name="Commands-36"></a>
  27174. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-36">39.7.1 Commands</a></h3>
  27175. <p>This filter supports same commands as options.
  27176. The command accepts the same syntax of the corresponding option.
  27177. </p>
  27178. <p>If the specified expression is not valid, it is kept at its current
  27179. value.
  27180. </p>
  27181. <a name="bbox"></a>
  27182. <h2 class="section"><a href="ffmpeg-all.html#toc-bbox">39.8 bbox</a></h2>
  27183. <p>Compute the bounding box for the non-black pixels in the input frame
  27184. luminance plane.
  27185. </p>
  27186. <p>This filter computes the bounding box containing all the pixels with a
  27187. luminance value greater than the minimum allowed value.
  27188. The parameters describing the bounding box are printed on the filter
  27189. log.
  27190. </p>
  27191. <p>The filter accepts the following option:
  27192. </p>
  27193. <dl compact="compact">
  27194. <dt>&lsquo;<samp>min_val</samp>&rsquo;</dt>
  27195. <dd><p>Set the minimal luminance value. Default is <code>16</code>.
  27196. </p></dd>
  27197. </dl>
  27198. <a name="bilateral"></a>
  27199. <h2 class="section"><a href="ffmpeg-all.html#toc-bilateral">39.9 bilateral</a></h2>
  27200. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  27201. </p>
  27202. <p>The filter accepts the following options:
  27203. </p><dl compact="compact">
  27204. <dt>&lsquo;<samp>sigmaS</samp>&rsquo;</dt>
  27205. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  27206. Allowed range is 0 to 10. Default is 0.1.
  27207. </p>
  27208. </dd>
  27209. <dt>&lsquo;<samp>sigmaR</samp>&rsquo;</dt>
  27210. <dd><p>Set sigma of gaussian function to calculate range weight.
  27211. Allowed range is 0 to 1. Default is 0.1.
  27212. </p>
  27213. </dd>
  27214. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27215. <dd><p>Set planes to filter. Default is first only.
  27216. </p></dd>
  27217. </dl>
  27218. <a name="bitplanenoise"></a>
  27219. <h2 class="section"><a href="ffmpeg-all.html#toc-bitplanenoise">39.10 bitplanenoise</a></h2>
  27220. <p>Show and measure bit plane noise.
  27221. </p>
  27222. <p>The filter accepts the following options:
  27223. </p>
  27224. <dl compact="compact">
  27225. <dt>&lsquo;<samp>bitplane</samp>&rsquo;</dt>
  27226. <dd><p>Set which plane to analyze. Default is <code>1</code>.
  27227. </p>
  27228. </dd>
  27229. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  27230. <dd><p>Filter out noisy pixels from <code>bitplane</code> set above.
  27231. Default is disabled.
  27232. </p></dd>
  27233. </dl>
  27234. <a name="blackdetect"></a>
  27235. <h2 class="section"><a href="ffmpeg-all.html#toc-blackdetect">39.11 blackdetect</a></h2>
  27236. <p>Detect video intervals that are (almost) completely black. Can be
  27237. useful to detect chapter transitions, commercials, or invalid
  27238. recordings. Output lines contains the time for the start, end and
  27239. duration of the detected black interval expressed in seconds.
  27240. </p>
  27241. <p>In order to display the output lines, you need to set the loglevel at
  27242. least to the AV_LOG_INFO value.
  27243. </p>
  27244. <p>The filter accepts the following options:
  27245. </p>
  27246. <dl compact="compact">
  27247. <dt>&lsquo;<samp>black_min_duration, d</samp>&rsquo;</dt>
  27248. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  27249. be a non-negative floating point number.
  27250. </p>
  27251. <p>Default value is 2.0.
  27252. </p>
  27253. </dd>
  27254. <dt>&lsquo;<samp>picture_black_ratio_th, pic_th</samp>&rsquo;</dt>
  27255. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  27256. Express the minimum value for the ratio:
  27257. </p><div class="example">
  27258. <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
  27259. </pre></div>
  27260. <p>for which a picture is considered black.
  27261. Default value is 0.98.
  27262. </p>
  27263. </dd>
  27264. <dt>&lsquo;<samp>pixel_black_th, pix_th</samp>&rsquo;</dt>
  27265. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  27266. </p>
  27267. <p>The threshold expresses the maximum pixel luminance value for which a
  27268. pixel is considered &quot;black&quot;. The provided value is scaled according to
  27269. the following equation:
  27270. </p><div class="example">
  27271. <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
  27272. </pre></div>
  27273. <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
  27274. the input video format, the range is [0-255] for YUV full-range
  27275. formats and [16-235] for YUV non full-range formats.
  27276. </p>
  27277. <p>Default value is 0.10.
  27278. </p></dd>
  27279. </dl>
  27280. <p>The following example sets the maximum pixel threshold to the minimum
  27281. value, and detects only black intervals of 2 or more seconds:
  27282. </p><div class="example">
  27283. <pre class="example">blackdetect=d=2:pix_th=0.00
  27284. </pre></div>
  27285. <a name="blackframe"></a>
  27286. <h2 class="section"><a href="ffmpeg-all.html#toc-blackframe">39.12 blackframe</a></h2>
  27287. <p>Detect frames that are (almost) completely black. Can be useful to
  27288. detect chapter transitions or commercials. Output lines consist of
  27289. the frame number of the detected frame, the percentage of blackness,
  27290. the position in the file if known or -1 and the timestamp in seconds.
  27291. </p>
  27292. <p>In order to display the output lines, you need to set the loglevel at
  27293. least to the AV_LOG_INFO value.
  27294. </p>
  27295. <p>This filter exports frame metadata <code>lavfi.blackframe.pblack</code>.
  27296. The value represents the percentage of pixels in the picture that
  27297. are below the threshold value.
  27298. </p>
  27299. <p>It accepts the following parameters:
  27300. </p>
  27301. <dl compact="compact">
  27302. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  27303. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  27304. <code>98</code>.
  27305. </p>
  27306. </dd>
  27307. <dt>&lsquo;<samp>threshold, thresh</samp>&rsquo;</dt>
  27308. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  27309. <code>32</code>.
  27310. </p>
  27311. </dd>
  27312. </dl>
  27313. <p><a name="blend"></a>
  27314. </p><a name="blend-1"></a>
  27315. <h2 class="section"><a href="ffmpeg-all.html#toc-blend-1">39.13 blend</a></h2>
  27316. <p>Blend two video frames into each other.
  27317. </p>
  27318. <p>The <code>blend</code> filter takes two input streams and outputs one
  27319. stream, the first input is the &quot;top&quot; layer and second input is
  27320. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  27321. </p>
  27322. <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
  27323. from one single stream, and outputs the result obtained by blending
  27324. the new frame on top of the old frame.
  27325. </p>
  27326. <p>A description of the accepted options follows.
  27327. </p>
  27328. <dl compact="compact">
  27329. <dt>&lsquo;<samp>c0_mode</samp>&rsquo;</dt>
  27330. <dt>&lsquo;<samp>c1_mode</samp>&rsquo;</dt>
  27331. <dt>&lsquo;<samp>c2_mode</samp>&rsquo;</dt>
  27332. <dt>&lsquo;<samp>c3_mode</samp>&rsquo;</dt>
  27333. <dt>&lsquo;<samp>all_mode</samp>&rsquo;</dt>
  27334. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  27335. of <var>all_mode</var>. Default value is <code>normal</code>.
  27336. </p>
  27337. <p>Available values for component modes are:
  27338. </p><dl compact="compact">
  27339. <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
  27340. <dt>&lsquo;<samp>grainmerge</samp>&rsquo;</dt>
  27341. <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
  27342. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  27343. <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
  27344. <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
  27345. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  27346. <dt>&lsquo;<samp>grainextract</samp>&rsquo;</dt>
  27347. <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
  27348. <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
  27349. <dt>&lsquo;<samp>freeze</samp>&rsquo;</dt>
  27350. <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
  27351. <dt>&lsquo;<samp>extremity</samp>&rsquo;</dt>
  27352. <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
  27353. <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
  27354. <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
  27355. <dt>&lsquo;<samp>heat</samp>&rsquo;</dt>
  27356. <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
  27357. <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
  27358. <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
  27359. <dt>&lsquo;<samp>multiply128</samp>&rsquo;</dt>
  27360. <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
  27361. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  27362. <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
  27363. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  27364. <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
  27365. <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
  27366. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  27367. <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
  27368. <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
  27369. <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
  27370. <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
  27371. <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
  27372. </dl>
  27373. </dd>
  27374. <dt>&lsquo;<samp>c0_opacity</samp>&rsquo;</dt>
  27375. <dt>&lsquo;<samp>c1_opacity</samp>&rsquo;</dt>
  27376. <dt>&lsquo;<samp>c2_opacity</samp>&rsquo;</dt>
  27377. <dt>&lsquo;<samp>c3_opacity</samp>&rsquo;</dt>
  27378. <dt>&lsquo;<samp>all_opacity</samp>&rsquo;</dt>
  27379. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  27380. of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
  27381. </p>
  27382. </dd>
  27383. <dt>&lsquo;<samp>c0_expr</samp>&rsquo;</dt>
  27384. <dt>&lsquo;<samp>c1_expr</samp>&rsquo;</dt>
  27385. <dt>&lsquo;<samp>c2_expr</samp>&rsquo;</dt>
  27386. <dt>&lsquo;<samp>c3_expr</samp>&rsquo;</dt>
  27387. <dt>&lsquo;<samp>all_expr</samp>&rsquo;</dt>
  27388. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  27389. of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
  27390. </p>
  27391. <p>The expressions can use the following variables:
  27392. </p>
  27393. <dl compact="compact">
  27394. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  27395. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  27396. </p>
  27397. </dd>
  27398. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  27399. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  27400. <dd><p>the coordinates of the current sample
  27401. </p>
  27402. </dd>
  27403. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  27404. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  27405. <dd><p>the width and height of currently filtered plane
  27406. </p>
  27407. </dd>
  27408. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  27409. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  27410. <dd><p>Width and height scale for the plane being filtered. It is the
  27411. ratio between the dimensions of the current plane to the luma plane,
  27412. e.g. for a <code>yuv420p</code> frame, the values are <code>1,1</code> for
  27413. the luma plane and <code>0.5,0.5</code> for the chroma planes.
  27414. </p>
  27415. </dd>
  27416. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  27417. <dd><p>Time of the current frame, expressed in seconds.
  27418. </p>
  27419. </dd>
  27420. <dt>&lsquo;<samp>TOP, A</samp>&rsquo;</dt>
  27421. <dd><p>Value of pixel component at current location for first video frame (top layer).
  27422. </p>
  27423. </dd>
  27424. <dt>&lsquo;<samp>BOTTOM, B</samp>&rsquo;</dt>
  27425. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  27426. </p></dd>
  27427. </dl>
  27428. </dd>
  27429. </dl>
  27430. <p>The <code>blend</code> filter also supports the <a href="#framesync">framesync</a> options.
  27431. </p>
  27432. <a name="Examples-69"></a>
  27433. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-69">39.13.1 Examples</a></h3>
  27434. <ul>
  27435. <li>
  27436. Apply transition from bottom layer to top layer in first 10 seconds:
  27437. <div class="example">
  27438. <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  27439. </pre></div>
  27440. </li><li>
  27441. Apply linear horizontal transition from top layer to bottom layer:
  27442. <div class="example">
  27443. <pre class="example">blend=all_expr='A*(X/W)+B*(1-X/W)'
  27444. </pre></div>
  27445. </li><li>
  27446. Apply 1x1 checkerboard effect:
  27447. <div class="example">
  27448. <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  27449. </pre></div>
  27450. </li><li>
  27451. Apply uncover left effect:
  27452. <div class="example">
  27453. <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  27454. </pre></div>
  27455. </li><li>
  27456. Apply uncover down effect:
  27457. <div class="example">
  27458. <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  27459. </pre></div>
  27460. </li><li>
  27461. Apply uncover up-left effect:
  27462. <div class="example">
  27463. <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  27464. </pre></div>
  27465. </li><li>
  27466. Split diagonally video and shows top and bottom layer on each side:
  27467. <div class="example">
  27468. <pre class="example">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  27469. </pre></div>
  27470. </li><li>
  27471. Display differences between the current and the previous frame:
  27472. <div class="example">
  27473. <pre class="example">tblend=all_mode=grainextract
  27474. </pre></div>
  27475. </li></ul>
  27476. <a name="bm3d"></a>
  27477. <h2 class="section"><a href="ffmpeg-all.html#toc-bm3d">39.14 bm3d</a></h2>
  27478. <p>Denoise frames using Block-Matching 3D algorithm.
  27479. </p>
  27480. <p>The filter accepts the following options.
  27481. </p>
  27482. <dl compact="compact">
  27483. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  27484. <dd><p>Set denoising strength. Default value is 1.
  27485. Allowed range is from 0 to 999.9.
  27486. The denoising algorithm is very sensitive to sigma, so adjust it
  27487. according to the source.
  27488. </p>
  27489. </dd>
  27490. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  27491. <dd><p>Set local patch size. This sets dimensions in 2D.
  27492. </p>
  27493. </dd>
  27494. <dt>&lsquo;<samp>bstep</samp>&rsquo;</dt>
  27495. <dd><p>Set sliding step for processing blocks. Default value is 4.
  27496. Allowed range is from 1 to 64.
  27497. Smaller values allows processing more reference blocks and is slower.
  27498. </p>
  27499. </dd>
  27500. <dt>&lsquo;<samp>group</samp>&rsquo;</dt>
  27501. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  27502. When set to 1, no block matching is done. Larger values allows more blocks
  27503. in single group.
  27504. Allowed range is from 1 to 256.
  27505. </p>
  27506. </dd>
  27507. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  27508. <dd><p>Set radius for search block matching. Default is 9.
  27509. Allowed range is from 1 to INT32_MAX.
  27510. </p>
  27511. </dd>
  27512. <dt>&lsquo;<samp>mstep</samp>&rsquo;</dt>
  27513. <dd><p>Set step between two search locations for block matching. Default is 1.
  27514. Allowed range is from 1 to 64. Smaller is slower.
  27515. </p>
  27516. </dd>
  27517. <dt>&lsquo;<samp>thmse</samp>&rsquo;</dt>
  27518. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  27519. INT32_MAX.
  27520. </p>
  27521. </dd>
  27522. <dt>&lsquo;<samp>hdthr</samp>&rsquo;</dt>
  27523. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  27524. Larger values results in stronger hard-thresholding filtering in frequency
  27525. domain.
  27526. </p>
  27527. </dd>
  27528. <dt>&lsquo;<samp>estim</samp>&rsquo;</dt>
  27529. <dd><p>Set filtering estimation mode. Can be <code>basic</code> or <code>final</code>.
  27530. Default is <code>basic</code>.
  27531. </p>
  27532. </dd>
  27533. <dt>&lsquo;<samp>ref</samp>&rsquo;</dt>
  27534. <dd><p>If enabled, filter will use 2nd stream for block matching.
  27535. Default is disabled for <code>basic</code> value of <var>estim</var> option,
  27536. and always enabled if value of <var>estim</var> is <code>final</code>.
  27537. </p>
  27538. </dd>
  27539. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27540. <dd><p>Set planes to filter. Default is all available except alpha.
  27541. </p></dd>
  27542. </dl>
  27543. <a name="Examples-56"></a>
  27544. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-56">39.14.1 Examples</a></h3>
  27545. <ul>
  27546. <li>
  27547. Basic filtering with bm3d:
  27548. <div class="example">
  27549. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  27550. </pre></div>
  27551. </li><li>
  27552. Same as above, but filtering only luma:
  27553. <div class="example">
  27554. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  27555. </pre></div>
  27556. </li><li>
  27557. Same as above, but with both estimation modes:
  27558. <div class="example">
  27559. <pre class="example">split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  27560. </pre></div>
  27561. </li><li>
  27562. Same as above, but prefilter with <a href="#nlmeans">nlmeans</a> filter instead:
  27563. <div class="example">
  27564. <pre class="example">split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  27565. </pre></div>
  27566. </li></ul>
  27567. <a name="boxblur"></a>
  27568. <h2 class="section"><a href="ffmpeg-all.html#toc-boxblur">39.15 boxblur</a></h2>
  27569. <p>Apply a boxblur algorithm to the input video.
  27570. </p>
  27571. <p>It accepts the following parameters:
  27572. </p>
  27573. <dl compact="compact">
  27574. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  27575. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  27576. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  27577. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  27578. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  27579. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  27580. </dl>
  27581. <p>A description of the accepted options follows.
  27582. </p>
  27583. <dl compact="compact">
  27584. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  27585. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  27586. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  27587. <dd><p>Set an expression for the box radius in pixels used for blurring the
  27588. corresponding input plane.
  27589. </p>
  27590. <p>The radius value must be a non-negative number, and must not be
  27591. greater than the value of the expression <code>min(w,h)/2</code> for the
  27592. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  27593. planes.
  27594. </p>
  27595. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  27596. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  27597. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  27598. </p>
  27599. <p>The expressions can contain the following constants:
  27600. </p><dl compact="compact">
  27601. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  27602. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  27603. <dd><p>The input width and height in pixels.
  27604. </p>
  27605. </dd>
  27606. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  27607. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  27608. <dd><p>The input chroma image width and height in pixels.
  27609. </p>
  27610. </dd>
  27611. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  27612. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  27613. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  27614. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  27615. </p></dd>
  27616. </dl>
  27617. </dd>
  27618. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  27619. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  27620. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  27621. <dd><p>Specify how many times the boxblur filter is applied to the
  27622. corresponding plane.
  27623. </p>
  27624. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  27625. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  27626. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  27627. </p>
  27628. <p>A value of 0 will disable the effect.
  27629. </p></dd>
  27630. </dl>
  27631. <a name="Examples-99"></a>
  27632. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-99">39.15.1 Examples</a></h3>
  27633. <ul>
  27634. <li>
  27635. Apply a boxblur filter with the luma, chroma, and alpha radii
  27636. set to 2:
  27637. <div class="example">
  27638. <pre class="example">boxblur=luma_radius=2:luma_power=1
  27639. boxblur=2:1
  27640. </pre></div>
  27641. </li><li>
  27642. Set the luma radius to 2, and alpha and chroma radius to 0:
  27643. <div class="example">
  27644. <pre class="example">boxblur=2:1:cr=0:ar=0
  27645. </pre></div>
  27646. </li><li>
  27647. Set the luma and chroma radii to a fraction of the video dimension:
  27648. <div class="example">
  27649. <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  27650. </pre></div>
  27651. </li></ul>
  27652. <a name="bwdif"></a>
  27653. <h2 class="section"><a href="ffmpeg-all.html#toc-bwdif">39.16 bwdif</a></h2>
  27654. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  27655. Deinterlacing Filter&quot;).
  27656. </p>
  27657. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  27658. interpolation algorithms.
  27659. It accepts the following parameters:
  27660. </p>
  27661. <dl compact="compact">
  27662. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  27663. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  27664. </p>
  27665. <dl compact="compact">
  27666. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  27667. <dd><p>Output one frame for each frame.
  27668. </p></dd>
  27669. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  27670. <dd><p>Output one frame for each field.
  27671. </p></dd>
  27672. </dl>
  27673. <p>The default value is <code>send_field</code>.
  27674. </p>
  27675. </dd>
  27676. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  27677. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  27678. of the following values:
  27679. </p>
  27680. <dl compact="compact">
  27681. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  27682. <dd><p>Assume the top field is first.
  27683. </p></dd>
  27684. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  27685. <dd><p>Assume the bottom field is first.
  27686. </p></dd>
  27687. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  27688. <dd><p>Enable automatic detection of field parity.
  27689. </p></dd>
  27690. </dl>
  27691. <p>The default value is <code>auto</code>.
  27692. If the interlacing is unknown or the decoder does not export this information,
  27693. top field first will be assumed.
  27694. </p>
  27695. </dd>
  27696. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  27697. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  27698. values:
  27699. </p>
  27700. <dl compact="compact">
  27701. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  27702. <dd><p>Deinterlace all frames.
  27703. </p></dd>
  27704. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  27705. <dd><p>Only deinterlace frames marked as interlaced.
  27706. </p></dd>
  27707. </dl>
  27708. <p>The default value is <code>all</code>.
  27709. </p></dd>
  27710. </dl>
  27711. <a name="cas"></a>
  27712. <h2 class="section"><a href="ffmpeg-all.html#toc-cas">39.17 cas</a></h2>
  27713. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  27714. </p>
  27715. <p>The filter accepts the following options:
  27716. </p>
  27717. <dl compact="compact">
  27718. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  27719. <dd><p>Set the sharpening strength. Default value is 0.
  27720. </p>
  27721. </dd>
  27722. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  27723. <dd><p>Set planes to filter. Default value is to filter all
  27724. planes except alpha plane.
  27725. </p></dd>
  27726. </dl>
  27727. <a name="chromahold"></a>
  27728. <h2 class="section"><a href="ffmpeg-all.html#toc-chromahold">39.18 chromahold</a></h2>
  27729. <p>Remove all color information for all colors except for certain one.
  27730. </p>
  27731. <p>The filter accepts the following options:
  27732. </p>
  27733. <dl compact="compact">
  27734. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  27735. <dd><p>The color which will not be replaced with neutral chroma.
  27736. </p>
  27737. </dd>
  27738. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  27739. <dd><p>Similarity percentage with the above color.
  27740. 0.01 matches only the exact key color, while 1.0 matches everything.
  27741. </p>
  27742. </dd>
  27743. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  27744. <dd><p>Blend percentage.
  27745. 0.0 makes pixels either fully gray, or not gray at all.
  27746. Higher values result in more preserved color.
  27747. </p>
  27748. </dd>
  27749. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  27750. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  27751. </p>
  27752. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  27753. This can be used to pass exact YUV values as hexadecimal numbers.
  27754. </p></dd>
  27755. </dl>
  27756. <a name="Commands-16"></a>
  27757. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-16">39.18.1 Commands</a></h3>
  27758. <p>This filter supports same <a href="#commands">commands</a> as options.
  27759. The command accepts the same syntax of the corresponding option.
  27760. </p>
  27761. <p>If the specified expression is not valid, it is kept at its current
  27762. value.
  27763. </p>
  27764. <a name="chromakey"></a>
  27765. <h2 class="section"><a href="ffmpeg-all.html#toc-chromakey">39.19 chromakey</a></h2>
  27766. <p>YUV colorspace color/chroma keying.
  27767. </p>
  27768. <p>The filter accepts the following options:
  27769. </p>
  27770. <dl compact="compact">
  27771. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  27772. <dd><p>The color which will be replaced with transparency.
  27773. </p>
  27774. </dd>
  27775. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  27776. <dd><p>Similarity percentage with the key color.
  27777. </p>
  27778. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  27779. </p>
  27780. </dd>
  27781. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  27782. <dd><p>Blend percentage.
  27783. </p>
  27784. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  27785. </p>
  27786. <p>Higher values result in semi-transparent pixels, with a higher transparency
  27787. the more similar the pixels color is to the key color.
  27788. </p>
  27789. </dd>
  27790. <dt>&lsquo;<samp>yuv</samp>&rsquo;</dt>
  27791. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  27792. </p>
  27793. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  27794. This can be used to pass exact YUV values as hexadecimal numbers.
  27795. </p></dd>
  27796. </dl>
  27797. <a name="Commands-19"></a>
  27798. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-19">39.19.1 Commands</a></h3>
  27799. <p>This filter supports same <a href="#commands">commands</a> as options.
  27800. The command accepts the same syntax of the corresponding option.
  27801. </p>
  27802. <p>If the specified expression is not valid, it is kept at its current
  27803. value.
  27804. </p>
  27805. <a name="Examples-48"></a>
  27806. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-48">39.19.2 Examples</a></h3>
  27807. <ul>
  27808. <li>
  27809. Make every green pixel in the input image transparent:
  27810. <div class="example">
  27811. <pre class="example">ffmpeg -i input.png -vf chromakey=green out.png
  27812. </pre></div>
  27813. </li><li>
  27814. Overlay a greenscreen-video on top of a static black background.
  27815. <div class="example">
  27816. <pre class="example">ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex &quot;[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.mkv
  27817. </pre></div>
  27818. </li></ul>
  27819. <a name="chromashift"></a>
  27820. <h2 class="section"><a href="ffmpeg-all.html#toc-chromashift">39.20 chromashift</a></h2>
  27821. <p>Shift chroma pixels horizontally and/or vertically.
  27822. </p>
  27823. <p>The filter accepts the following options:
  27824. </p><dl compact="compact">
  27825. <dt>&lsquo;<samp>cbh</samp>&rsquo;</dt>
  27826. <dd><p>Set amount to shift chroma-blue horizontally.
  27827. </p></dd>
  27828. <dt>&lsquo;<samp>cbv</samp>&rsquo;</dt>
  27829. <dd><p>Set amount to shift chroma-blue vertically.
  27830. </p></dd>
  27831. <dt>&lsquo;<samp>crh</samp>&rsquo;</dt>
  27832. <dd><p>Set amount to shift chroma-red horizontally.
  27833. </p></dd>
  27834. <dt>&lsquo;<samp>crv</samp>&rsquo;</dt>
  27835. <dd><p>Set amount to shift chroma-red vertically.
  27836. </p></dd>
  27837. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  27838. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  27839. </p></dd>
  27840. </dl>
  27841. <a name="Commands-56"></a>
  27842. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-56">39.20.1 Commands</a></h3>
  27843. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  27844. </p>
  27845. <a name="ciescope"></a>
  27846. <h2 class="section"><a href="ffmpeg-all.html#toc-ciescope">39.21 ciescope</a></h2>
  27847. <p>Display CIE color diagram with pixels overlaid onto it.
  27848. </p>
  27849. <p>The filter accepts the following options:
  27850. </p>
  27851. <dl compact="compact">
  27852. <dt>&lsquo;<samp>system</samp>&rsquo;</dt>
  27853. <dd><p>Set color system.
  27854. </p>
  27855. <dl compact="compact">
  27856. <dt>&lsquo;<samp>ntsc, 470m</samp>&rsquo;</dt>
  27857. <dt>&lsquo;<samp>ebu, 470bg</samp>&rsquo;</dt>
  27858. <dt>&lsquo;<samp>smpte</samp>&rsquo;</dt>
  27859. <dt>&lsquo;<samp>240m</samp>&rsquo;</dt>
  27860. <dt>&lsquo;<samp>apple</samp>&rsquo;</dt>
  27861. <dt>&lsquo;<samp>widergb</samp>&rsquo;</dt>
  27862. <dt>&lsquo;<samp>cie1931</samp>&rsquo;</dt>
  27863. <dt>&lsquo;<samp>rec709, hdtv</samp>&rsquo;</dt>
  27864. <dt>&lsquo;<samp>uhdtv, rec2020</samp>&rsquo;</dt>
  27865. <dt>&lsquo;<samp>dcip3</samp>&rsquo;</dt>
  27866. </dl>
  27867. </dd>
  27868. <dt>&lsquo;<samp>cie</samp>&rsquo;</dt>
  27869. <dd><p>Set CIE system.
  27870. </p>
  27871. <dl compact="compact">
  27872. <dt>&lsquo;<samp>xyy</samp>&rsquo;</dt>
  27873. <dt>&lsquo;<samp>ucs</samp>&rsquo;</dt>
  27874. <dt>&lsquo;<samp>luv</samp>&rsquo;</dt>
  27875. </dl>
  27876. </dd>
  27877. <dt>&lsquo;<samp>gamuts</samp>&rsquo;</dt>
  27878. <dd><p>Set what gamuts to draw.
  27879. </p>
  27880. <p>See <code>system</code> option for available values.
  27881. </p>
  27882. </dd>
  27883. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  27884. <dd><p>Set ciescope size, by default set to 512.
  27885. </p>
  27886. </dd>
  27887. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  27888. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  27889. </p>
  27890. </dd>
  27891. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  27892. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  27893. </p>
  27894. </dd>
  27895. <dt>&lsquo;<samp>corrgamma</samp>&rsquo;</dt>
  27896. <dd><p>Correct gamma displayed on scope, by default enabled.
  27897. </p>
  27898. </dd>
  27899. <dt>&lsquo;<samp>showwhite</samp>&rsquo;</dt>
  27900. <dd><p>Show white point on CIE diagram, by default disabled.
  27901. </p>
  27902. </dd>
  27903. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  27904. <dd><p>Set input gamma. Used only with XYZ input color space.
  27905. </p></dd>
  27906. </dl>
  27907. <a name="codecview"></a>
  27908. <h2 class="section"><a href="ffmpeg-all.html#toc-codecview">39.22 codecview</a></h2>
  27909. <p>Visualize information exported by some codecs.
  27910. </p>
  27911. <p>Some codecs can export information through frames using side-data or other
  27912. means. For example, some MPEG based codecs export motion vectors through the
  27913. <var>export_mvs</var> flag in the codec &lsquo;<samp>flags2</samp>&rsquo; option.
  27914. </p>
  27915. <p>The filter accepts the following option:
  27916. </p>
  27917. <dl compact="compact">
  27918. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  27919. <dd><p>Set motion vectors to visualize.
  27920. </p>
  27921. <p>Available flags for <var>mv</var> are:
  27922. </p>
  27923. <dl compact="compact">
  27924. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  27925. <dd><p>forward predicted MVs of P-frames
  27926. </p></dd>
  27927. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  27928. <dd><p>forward predicted MVs of B-frames
  27929. </p></dd>
  27930. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  27931. <dd><p>backward predicted MVs of B-frames
  27932. </p></dd>
  27933. </dl>
  27934. </dd>
  27935. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  27936. <dd><p>Display quantization parameters using the chroma planes.
  27937. </p>
  27938. </dd>
  27939. <dt>&lsquo;<samp>mv_type, mvt</samp>&rsquo;</dt>
  27940. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var>frame_type</var> option.
  27941. </p>
  27942. <p>Available flags for <var>mv_type</var> are:
  27943. </p>
  27944. <dl compact="compact">
  27945. <dt>&lsquo;<samp>fp</samp>&rsquo;</dt>
  27946. <dd><p>forward predicted MVs
  27947. </p></dd>
  27948. <dt>&lsquo;<samp>bp</samp>&rsquo;</dt>
  27949. <dd><p>backward predicted MVs
  27950. </p></dd>
  27951. </dl>
  27952. </dd>
  27953. <dt>&lsquo;<samp>frame_type, ft</samp>&rsquo;</dt>
  27954. <dd><p>Set frame type to visualize motion vectors of.
  27955. </p>
  27956. <p>Available flags for <var>frame_type</var> are:
  27957. </p>
  27958. <dl compact="compact">
  27959. <dt>&lsquo;<samp>if</samp>&rsquo;</dt>
  27960. <dd><p>intra-coded frames (I-frames)
  27961. </p></dd>
  27962. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  27963. <dd><p>predicted frames (P-frames)
  27964. </p></dd>
  27965. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  27966. <dd><p>bi-directionally predicted frames (B-frames)
  27967. </p></dd>
  27968. </dl>
  27969. </dd>
  27970. </dl>
  27971. <a name="Examples-94"></a>
  27972. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-94">39.22.1 Examples</a></h3>
  27973. <ul>
  27974. <li>
  27975. Visualize forward predicted MVs of all frames using <code>ffplay</code>:
  27976. <div class="example">
  27977. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  27978. </pre></div>
  27979. </li><li>
  27980. Visualize multi-directionals MVs of P and B-Frames using <code>ffplay</code>:
  27981. <div class="example">
  27982. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  27983. </pre></div>
  27984. </li></ul>
  27985. <a name="colorbalance"></a>
  27986. <h2 class="section"><a href="ffmpeg-all.html#toc-colorbalance">39.23 colorbalance</a></h2>
  27987. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  27988. </p>
  27989. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  27990. regions for the red-cyan, green-magenta or blue-yellow balance.
  27991. </p>
  27992. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  27993. value towards the complementary color.
  27994. </p>
  27995. <p>The filter accepts the following options:
  27996. </p>
  27997. <dl compact="compact">
  27998. <dt>&lsquo;<samp>rs</samp>&rsquo;</dt>
  27999. <dt>&lsquo;<samp>gs</samp>&rsquo;</dt>
  28000. <dt>&lsquo;<samp>bs</samp>&rsquo;</dt>
  28001. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  28002. </p>
  28003. </dd>
  28004. <dt>&lsquo;<samp>rm</samp>&rsquo;</dt>
  28005. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  28006. <dt>&lsquo;<samp>bm</samp>&rsquo;</dt>
  28007. <dd><p>Adjust red, green and blue midtones (medium pixels).
  28008. </p>
  28009. </dd>
  28010. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  28011. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  28012. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  28013. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  28014. </p>
  28015. <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  28016. </p>
  28017. </dd>
  28018. <dt>&lsquo;<samp>pl</samp>&rsquo;</dt>
  28019. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  28020. </p></dd>
  28021. </dl>
  28022. <a name="Examples-167"></a>
  28023. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-167">39.23.1 Examples</a></h3>
  28024. <ul>
  28025. <li>
  28026. Add red color cast to shadows:
  28027. <div class="example">
  28028. <pre class="example">colorbalance=rs=.3
  28029. </pre></div>
  28030. </li></ul>
  28031. <a name="Commands-20"></a>
  28032. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-20">39.23.2 Commands</a></h3>
  28033. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28034. </p>
  28035. <a name="colorchannelmixer"></a>
  28036. <h2 class="section"><a href="ffmpeg-all.html#toc-colorchannelmixer">39.24 colorchannelmixer</a></h2>
  28037. <p>Adjust video input frames by re-mixing color channels.
  28038. </p>
  28039. <p>This filter modifies a color channel by adding the values associated to
  28040. the other channels of the same pixels. For example if the value to
  28041. modify is red, the output value will be:
  28042. </p><div class="example">
  28043. <pre class="example"><var>red</var>=<var>red</var>*<var>rr</var> + <var>blue</var>*<var>rb</var> + <var>green</var>*<var>rg</var> + <var>alpha</var>*<var>ra</var>
  28044. </pre></div>
  28045. <p>The filter accepts the following options:
  28046. </p>
  28047. <dl compact="compact">
  28048. <dt>&lsquo;<samp>rr</samp>&rsquo;</dt>
  28049. <dt>&lsquo;<samp>rg</samp>&rsquo;</dt>
  28050. <dt>&lsquo;<samp>rb</samp>&rsquo;</dt>
  28051. <dt>&lsquo;<samp>ra</samp>&rsquo;</dt>
  28052. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  28053. Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
  28054. </p>
  28055. </dd>
  28056. <dt>&lsquo;<samp>gr</samp>&rsquo;</dt>
  28057. <dt>&lsquo;<samp>gg</samp>&rsquo;</dt>
  28058. <dt>&lsquo;<samp>gb</samp>&rsquo;</dt>
  28059. <dt>&lsquo;<samp>ga</samp>&rsquo;</dt>
  28060. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  28061. Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
  28062. </p>
  28063. </dd>
  28064. <dt>&lsquo;<samp>br</samp>&rsquo;</dt>
  28065. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  28066. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  28067. <dt>&lsquo;<samp>ba</samp>&rsquo;</dt>
  28068. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  28069. Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
  28070. </p>
  28071. </dd>
  28072. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  28073. <dt>&lsquo;<samp>ag</samp>&rsquo;</dt>
  28074. <dt>&lsquo;<samp>ab</samp>&rsquo;</dt>
  28075. <dt>&lsquo;<samp>aa</samp>&rsquo;</dt>
  28076. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  28077. Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
  28078. </p>
  28079. <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
  28080. </p></dd>
  28081. </dl>
  28082. <a name="Examples-88"></a>
  28083. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-88">39.24.1 Examples</a></h3>
  28084. <ul>
  28085. <li>
  28086. Convert source to grayscale:
  28087. <div class="example">
  28088. <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  28089. </pre></div>
  28090. </li><li>
  28091. Simulate sepia tones:
  28092. <div class="example">
  28093. <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  28094. </pre></div>
  28095. </li></ul>
  28096. <a name="Commands-21"></a>
  28097. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-21">39.24.2 Commands</a></h3>
  28098. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28099. </p>
  28100. <a name="colorkey"></a>
  28101. <h2 class="section"><a href="ffmpeg-all.html#toc-colorkey">39.25 colorkey</a></h2>
  28102. <p>RGB colorspace color keying.
  28103. </p>
  28104. <p>The filter accepts the following options:
  28105. </p>
  28106. <dl compact="compact">
  28107. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28108. <dd><p>The color which will be replaced with transparency.
  28109. </p>
  28110. </dd>
  28111. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28112. <dd><p>Similarity percentage with the key color.
  28113. </p>
  28114. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  28115. </p>
  28116. </dd>
  28117. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28118. <dd><p>Blend percentage.
  28119. </p>
  28120. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  28121. </p>
  28122. <p>Higher values result in semi-transparent pixels, with a higher transparency
  28123. the more similar the pixels color is to the key color.
  28124. </p></dd>
  28125. </dl>
  28126. <a name="Examples-186"></a>
  28127. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-186">39.25.1 Examples</a></h3>
  28128. <ul>
  28129. <li>
  28130. Make every green pixel in the input image transparent:
  28131. <div class="example">
  28132. <pre class="example">ffmpeg -i input.png -vf colorkey=green out.png
  28133. </pre></div>
  28134. </li><li>
  28135. Overlay a greenscreen-video on top of a static background image.
  28136. <div class="example">
  28137. <pre class="example">ffmpeg -i background.png -i video.mp4 -filter_complex &quot;[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.flv
  28138. </pre></div>
  28139. </li></ul>
  28140. <a name="Commands-41"></a>
  28141. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-41">39.25.2 Commands</a></h3>
  28142. <p>This filter supports same <a href="#commands">commands</a> as options.
  28143. The command accepts the same syntax of the corresponding option.
  28144. </p>
  28145. <p>If the specified expression is not valid, it is kept at its current
  28146. value.
  28147. </p>
  28148. <a name="colorhold"></a>
  28149. <h2 class="section"><a href="ffmpeg-all.html#toc-colorhold">39.26 colorhold</a></h2>
  28150. <p>Remove all color information for all RGB colors except for certain one.
  28151. </p>
  28152. <p>The filter accepts the following options:
  28153. </p>
  28154. <dl compact="compact">
  28155. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  28156. <dd><p>The color which will not be replaced with neutral gray.
  28157. </p>
  28158. </dd>
  28159. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  28160. <dd><p>Similarity percentage with the above color.
  28161. 0.01 matches only the exact key color, while 1.0 matches everything.
  28162. </p>
  28163. </dd>
  28164. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  28165. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  28166. Higher values result in more preserved color.
  28167. </p></dd>
  28168. </dl>
  28169. <a name="Commands-53"></a>
  28170. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-53">39.26.1 Commands</a></h3>
  28171. <p>This filter supports same <a href="#commands">commands</a> as options.
  28172. The command accepts the same syntax of the corresponding option.
  28173. </p>
  28174. <p>If the specified expression is not valid, it is kept at its current
  28175. value.
  28176. </p>
  28177. <a name="colorlevels"></a>
  28178. <h2 class="section"><a href="ffmpeg-all.html#toc-colorlevels">39.27 colorlevels</a></h2>
  28179. <p>Adjust video input frames using levels.
  28180. </p>
  28181. <p>The filter accepts the following options:
  28182. </p>
  28183. <dl compact="compact">
  28184. <dt>&lsquo;<samp>rimin</samp>&rsquo;</dt>
  28185. <dt>&lsquo;<samp>gimin</samp>&rsquo;</dt>
  28186. <dt>&lsquo;<samp>bimin</samp>&rsquo;</dt>
  28187. <dt>&lsquo;<samp>aimin</samp>&rsquo;</dt>
  28188. <dd><p>Adjust red, green, blue and alpha input black point.
  28189. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  28190. </p>
  28191. </dd>
  28192. <dt>&lsquo;<samp>rimax</samp>&rsquo;</dt>
  28193. <dt>&lsquo;<samp>gimax</samp>&rsquo;</dt>
  28194. <dt>&lsquo;<samp>bimax</samp>&rsquo;</dt>
  28195. <dt>&lsquo;<samp>aimax</samp>&rsquo;</dt>
  28196. <dd><p>Adjust red, green, blue and alpha input white point.
  28197. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
  28198. </p>
  28199. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  28200. (dark tones), change the balance of bright and dark tones.
  28201. </p>
  28202. </dd>
  28203. <dt>&lsquo;<samp>romin</samp>&rsquo;</dt>
  28204. <dt>&lsquo;<samp>gomin</samp>&rsquo;</dt>
  28205. <dt>&lsquo;<samp>bomin</samp>&rsquo;</dt>
  28206. <dt>&lsquo;<samp>aomin</samp>&rsquo;</dt>
  28207. <dd><p>Adjust red, green, blue and alpha output black point.
  28208. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
  28209. </p>
  28210. </dd>
  28211. <dt>&lsquo;<samp>romax</samp>&rsquo;</dt>
  28212. <dt>&lsquo;<samp>gomax</samp>&rsquo;</dt>
  28213. <dt>&lsquo;<samp>bomax</samp>&rsquo;</dt>
  28214. <dt>&lsquo;<samp>aomax</samp>&rsquo;</dt>
  28215. <dd><p>Adjust red, green, blue and alpha output white point.
  28216. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
  28217. </p>
  28218. <p>Output levels allows manual selection of a constrained output level range.
  28219. </p></dd>
  28220. </dl>
  28221. <a name="Examples-10"></a>
  28222. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-10">39.27.1 Examples</a></h3>
  28223. <ul>
  28224. <li>
  28225. Make video output darker:
  28226. <div class="example">
  28227. <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  28228. </pre></div>
  28229. </li><li>
  28230. Increase contrast:
  28231. <div class="example">
  28232. <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  28233. </pre></div>
  28234. </li><li>
  28235. Make video output lighter:
  28236. <div class="example">
  28237. <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  28238. </pre></div>
  28239. </li><li>
  28240. Increase brightness:
  28241. <div class="example">
  28242. <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  28243. </pre></div>
  28244. </li></ul>
  28245. <a name="Commands-40"></a>
  28246. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-40">39.27.2 Commands</a></h3>
  28247. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  28248. </p>
  28249. <a name="colormatrix"></a>
  28250. <h2 class="section"><a href="ffmpeg-all.html#toc-colormatrix">39.28 colormatrix</a></h2>
  28251. <p>Convert color matrix.
  28252. </p>
  28253. <p>The filter accepts the following options:
  28254. </p>
  28255. <dl compact="compact">
  28256. <dt>&lsquo;<samp>src</samp>&rsquo;</dt>
  28257. <dt>&lsquo;<samp>dst</samp>&rsquo;</dt>
  28258. <dd><p>Specify the source and destination color matrix. Both values must be
  28259. specified.
  28260. </p>
  28261. <p>The accepted values are:
  28262. </p><dl compact="compact">
  28263. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28264. <dd><p>BT.709
  28265. </p>
  28266. </dd>
  28267. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  28268. <dd><p>FCC
  28269. </p>
  28270. </dd>
  28271. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  28272. <dd><p>BT.601
  28273. </p>
  28274. </dd>
  28275. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  28276. <dd><p>BT.470
  28277. </p>
  28278. </dd>
  28279. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28280. <dd><p>BT.470BG
  28281. </p>
  28282. </dd>
  28283. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28284. <dd><p>SMPTE-170M
  28285. </p>
  28286. </dd>
  28287. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28288. <dd><p>SMPTE-240M
  28289. </p>
  28290. </dd>
  28291. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28292. <dd><p>BT.2020
  28293. </p></dd>
  28294. </dl>
  28295. </dd>
  28296. </dl>
  28297. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  28298. </p><div class="example">
  28299. <pre class="example">colormatrix=bt601:smpte240m
  28300. </pre></div>
  28301. <a name="colorspace"></a>
  28302. <h2 class="section"><a href="ffmpeg-all.html#toc-colorspace">39.29 colorspace</a></h2>
  28303. <p>Convert colorspace, transfer characteristics or color primaries.
  28304. Input video needs to have an even size.
  28305. </p>
  28306. <p>The filter accepts the following options:
  28307. </p>
  28308. <dl compact="compact">
  28309. <dd><p><a name="all"></a>
  28310. </p></dd>
  28311. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  28312. <dd><p>Specify all color properties at once.
  28313. </p>
  28314. <p>The accepted values are:
  28315. </p><dl compact="compact">
  28316. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28317. <dd><p>BT.470M
  28318. </p>
  28319. </dd>
  28320. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28321. <dd><p>BT.470BG
  28322. </p>
  28323. </dd>
  28324. <dt>&lsquo;<samp>bt601-6-525</samp>&rsquo;</dt>
  28325. <dd><p>BT.601-6 525
  28326. </p>
  28327. </dd>
  28328. <dt>&lsquo;<samp>bt601-6-625</samp>&rsquo;</dt>
  28329. <dd><p>BT.601-6 625
  28330. </p>
  28331. </dd>
  28332. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28333. <dd><p>BT.709
  28334. </p>
  28335. </dd>
  28336. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28337. <dd><p>SMPTE-170M
  28338. </p>
  28339. </dd>
  28340. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28341. <dd><p>SMPTE-240M
  28342. </p>
  28343. </dd>
  28344. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28345. <dd><p>BT.2020
  28346. </p>
  28347. </dd>
  28348. </dl>
  28349. <p><a name="space"></a>
  28350. </p></dd>
  28351. <dt>&lsquo;<samp>space</samp>&rsquo;</dt>
  28352. <dd><p>Specify output colorspace.
  28353. </p>
  28354. <p>The accepted values are:
  28355. </p><dl compact="compact">
  28356. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28357. <dd><p>BT.709
  28358. </p>
  28359. </dd>
  28360. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  28361. <dd><p>FCC
  28362. </p>
  28363. </dd>
  28364. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28365. <dd><p>BT.470BG or BT.601-6 625
  28366. </p>
  28367. </dd>
  28368. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28369. <dd><p>SMPTE-170M or BT.601-6 525
  28370. </p>
  28371. </dd>
  28372. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28373. <dd><p>SMPTE-240M
  28374. </p>
  28375. </dd>
  28376. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  28377. <dd><p>YCgCo
  28378. </p>
  28379. </dd>
  28380. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  28381. <dd><p>BT.2020 with non-constant luminance
  28382. </p>
  28383. </dd>
  28384. </dl>
  28385. <p><a name="trc"></a>
  28386. </p></dd>
  28387. <dt>&lsquo;<samp>trc</samp>&rsquo;</dt>
  28388. <dd><p>Specify output transfer characteristics.
  28389. </p>
  28390. <p>The accepted values are:
  28391. </p><dl compact="compact">
  28392. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28393. <dd><p>BT.709
  28394. </p>
  28395. </dd>
  28396. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28397. <dd><p>BT.470M
  28398. </p>
  28399. </dd>
  28400. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28401. <dd><p>BT.470BG
  28402. </p>
  28403. </dd>
  28404. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  28405. <dd><p>Constant gamma of 2.2
  28406. </p>
  28407. </dd>
  28408. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  28409. <dd><p>Constant gamma of 2.8
  28410. </p>
  28411. </dd>
  28412. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28413. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  28414. </p>
  28415. </dd>
  28416. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28417. <dd><p>SMPTE-240M
  28418. </p>
  28419. </dd>
  28420. <dt>&lsquo;<samp>srgb</samp>&rsquo;</dt>
  28421. <dd><p>SRGB
  28422. </p>
  28423. </dd>
  28424. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  28425. <dd><p>iec61966-2-1
  28426. </p>
  28427. </dd>
  28428. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  28429. <dd><p>iec61966-2-4
  28430. </p>
  28431. </dd>
  28432. <dt>&lsquo;<samp>xvycc</samp>&rsquo;</dt>
  28433. <dd><p>xvycc
  28434. </p>
  28435. </dd>
  28436. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  28437. <dd><p>BT.2020 for 10-bits content
  28438. </p>
  28439. </dd>
  28440. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  28441. <dd><p>BT.2020 for 12-bits content
  28442. </p>
  28443. </dd>
  28444. </dl>
  28445. <p><a name="primaries"></a>
  28446. </p></dd>
  28447. <dt>&lsquo;<samp>primaries</samp>&rsquo;</dt>
  28448. <dd><p>Specify output color primaries.
  28449. </p>
  28450. <p>The accepted values are:
  28451. </p><dl compact="compact">
  28452. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28453. <dd><p>BT.709
  28454. </p>
  28455. </dd>
  28456. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  28457. <dd><p>BT.470M
  28458. </p>
  28459. </dd>
  28460. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28461. <dd><p>BT.470BG or BT.601-6 625
  28462. </p>
  28463. </dd>
  28464. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28465. <dd><p>SMPTE-170M or BT.601-6 525
  28466. </p>
  28467. </dd>
  28468. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28469. <dd><p>SMPTE-240M
  28470. </p>
  28471. </dd>
  28472. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  28473. <dd><p>film
  28474. </p>
  28475. </dd>
  28476. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  28477. <dd><p>SMPTE-431
  28478. </p>
  28479. </dd>
  28480. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  28481. <dd><p>SMPTE-432
  28482. </p>
  28483. </dd>
  28484. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  28485. <dd><p>BT.2020
  28486. </p>
  28487. </dd>
  28488. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  28489. <dd><p>JEDEC P22 phosphors
  28490. </p>
  28491. </dd>
  28492. </dl>
  28493. <p><a name="range"></a>
  28494. </p></dd>
  28495. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  28496. <dd><p>Specify output color range.
  28497. </p>
  28498. <p>The accepted values are:
  28499. </p><dl compact="compact">
  28500. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  28501. <dd><p>TV (restricted) range
  28502. </p>
  28503. </dd>
  28504. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  28505. <dd><p>MPEG (restricted) range
  28506. </p>
  28507. </dd>
  28508. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  28509. <dd><p>PC (full) range
  28510. </p>
  28511. </dd>
  28512. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  28513. <dd><p>JPEG (full) range
  28514. </p>
  28515. </dd>
  28516. </dl>
  28517. </dd>
  28518. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  28519. <dd><p>Specify output color format.
  28520. </p>
  28521. <p>The accepted values are:
  28522. </p><dl compact="compact">
  28523. <dt>&lsquo;<samp>yuv420p</samp>&rsquo;</dt>
  28524. <dd><p>YUV 4:2:0 planar 8-bits
  28525. </p>
  28526. </dd>
  28527. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  28528. <dd><p>YUV 4:2:0 planar 10-bits
  28529. </p>
  28530. </dd>
  28531. <dt>&lsquo;<samp>yuv420p12</samp>&rsquo;</dt>
  28532. <dd><p>YUV 4:2:0 planar 12-bits
  28533. </p>
  28534. </dd>
  28535. <dt>&lsquo;<samp>yuv422p</samp>&rsquo;</dt>
  28536. <dd><p>YUV 4:2:2 planar 8-bits
  28537. </p>
  28538. </dd>
  28539. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  28540. <dd><p>YUV 4:2:2 planar 10-bits
  28541. </p>
  28542. </dd>
  28543. <dt>&lsquo;<samp>yuv422p12</samp>&rsquo;</dt>
  28544. <dd><p>YUV 4:2:2 planar 12-bits
  28545. </p>
  28546. </dd>
  28547. <dt>&lsquo;<samp>yuv444p</samp>&rsquo;</dt>
  28548. <dd><p>YUV 4:4:4 planar 8-bits
  28549. </p>
  28550. </dd>
  28551. <dt>&lsquo;<samp>yuv444p10</samp>&rsquo;</dt>
  28552. <dd><p>YUV 4:4:4 planar 10-bits
  28553. </p>
  28554. </dd>
  28555. <dt>&lsquo;<samp>yuv444p12</samp>&rsquo;</dt>
  28556. <dd><p>YUV 4:4:4 planar 12-bits
  28557. </p>
  28558. </dd>
  28559. </dl>
  28560. </dd>
  28561. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  28562. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  28563. significantly less CPU, but will be mathematically incorrect. To get output
  28564. compatible with that produced by the colormatrix filter, use fast=1.
  28565. </p>
  28566. </dd>
  28567. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  28568. <dd><p>Specify dithering mode.
  28569. </p>
  28570. <p>The accepted values are:
  28571. </p><dl compact="compact">
  28572. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  28573. <dd><p>No dithering
  28574. </p>
  28575. </dd>
  28576. <dt>&lsquo;<samp>fsb</samp>&rsquo;</dt>
  28577. <dd><p>Floyd-Steinberg dithering
  28578. </p></dd>
  28579. </dl>
  28580. </dd>
  28581. <dt>&lsquo;<samp>wpadapt</samp>&rsquo;</dt>
  28582. <dd><p>Whitepoint adaptation mode.
  28583. </p>
  28584. <p>The accepted values are:
  28585. </p><dl compact="compact">
  28586. <dt>&lsquo;<samp>bradford</samp>&rsquo;</dt>
  28587. <dd><p>Bradford whitepoint adaptation
  28588. </p>
  28589. </dd>
  28590. <dt>&lsquo;<samp>vonkries</samp>&rsquo;</dt>
  28591. <dd><p>von Kries whitepoint adaptation
  28592. </p>
  28593. </dd>
  28594. <dt>&lsquo;<samp>identity</samp>&rsquo;</dt>
  28595. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  28596. </p></dd>
  28597. </dl>
  28598. </dd>
  28599. <dt>&lsquo;<samp>iall</samp>&rsquo;</dt>
  28600. <dd><p>Override all input properties at once. Same accepted values as <a href="#all">all</a>.
  28601. </p>
  28602. </dd>
  28603. <dt>&lsquo;<samp>ispace</samp>&rsquo;</dt>
  28604. <dd><p>Override input colorspace. Same accepted values as <a href="#space">space</a>.
  28605. </p>
  28606. </dd>
  28607. <dt>&lsquo;<samp>iprimaries</samp>&rsquo;</dt>
  28608. <dd><p>Override input color primaries. Same accepted values as <a href="#primaries">primaries</a>.
  28609. </p>
  28610. </dd>
  28611. <dt>&lsquo;<samp>itrc</samp>&rsquo;</dt>
  28612. <dd><p>Override input transfer characteristics. Same accepted values as <a href="#trc">trc</a>.
  28613. </p>
  28614. </dd>
  28615. <dt>&lsquo;<samp>irange</samp>&rsquo;</dt>
  28616. <dd><p>Override input color range. Same accepted values as <a href="#range">range</a>.
  28617. </p>
  28618. </dd>
  28619. </dl>
  28620. <p>The filter converts the transfer characteristics, color space and color
  28621. primaries to the specified user values. The output value, if not specified,
  28622. is set to a default value based on the &quot;all&quot; property. If that property is
  28623. also not specified, the filter will log an error. The output color range and
  28624. format default to the same value as the input color range and format. The
  28625. input transfer characteristics, color space, color primaries and color range
  28626. should be set on the input data. If any of these are missing, the filter will
  28627. log an error and no conversion will take place.
  28628. </p>
  28629. <p>For example to convert the input to SMPTE-240M, use the command:
  28630. </p><div class="example">
  28631. <pre class="example">colorspace=smpte240m
  28632. </pre></div>
  28633. <a name="convolution"></a>
  28634. <h2 class="section"><a href="ffmpeg-all.html#toc-convolution">39.30 convolution</a></h2>
  28635. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  28636. </p>
  28637. <p>The filter accepts the following options:
  28638. </p>
  28639. <dl compact="compact">
  28640. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  28641. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  28642. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  28643. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  28644. <dd><p>Set matrix for each plane.
  28645. Matrix is sequence of 9, 25 or 49 signed integers in <var>square</var> mode,
  28646. and from 1 to 49 odd number of signed integers in <var>row</var> mode.
  28647. </p>
  28648. </dd>
  28649. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  28650. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  28651. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  28652. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  28653. <dd><p>Set multiplier for calculated value for each plane.
  28654. If unset or 0, it will be sum of all matrix elements.
  28655. </p>
  28656. </dd>
  28657. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  28658. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  28659. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  28660. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  28661. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  28662. Useful for making the overall image brighter or darker. Default is 0.0.
  28663. </p>
  28664. </dd>
  28665. <dt>&lsquo;<samp>0mode</samp>&rsquo;</dt>
  28666. <dt>&lsquo;<samp>1mode</samp>&rsquo;</dt>
  28667. <dt>&lsquo;<samp>2mode</samp>&rsquo;</dt>
  28668. <dt>&lsquo;<samp>3mode</samp>&rsquo;</dt>
  28669. <dd><p>Set matrix mode for each plane. Can be <var>square</var>, <var>row</var> or <var>column</var>.
  28670. Default is <var>square</var>.
  28671. </p></dd>
  28672. </dl>
  28673. <a name="Examples-39"></a>
  28674. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-39">39.30.1 Examples</a></h3>
  28675. <ul>
  28676. <li>
  28677. Apply sharpen:
  28678. <div class="example">
  28679. <pre class="example">convolution=&quot;0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0&quot;
  28680. </pre></div>
  28681. </li><li>
  28682. Apply blur:
  28683. <div class="example">
  28684. <pre class="example">convolution=&quot;1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9&quot;
  28685. </pre></div>
  28686. </li><li>
  28687. Apply edge enhance:
  28688. <div class="example">
  28689. <pre class="example">convolution=&quot;0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128&quot;
  28690. </pre></div>
  28691. </li><li>
  28692. Apply edge detect:
  28693. <div class="example">
  28694. <pre class="example">convolution=&quot;0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128&quot;
  28695. </pre></div>
  28696. </li><li>
  28697. Apply laplacian edge detector which includes diagonals:
  28698. <div class="example">
  28699. <pre class="example">convolution=&quot;1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0&quot;
  28700. </pre></div>
  28701. </li><li>
  28702. Apply emboss:
  28703. <div class="example">
  28704. <pre class="example">convolution=&quot;-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2&quot;
  28705. </pre></div>
  28706. </li></ul>
  28707. <a name="convolve"></a>
  28708. <h2 class="section"><a href="ffmpeg-all.html#toc-convolve">39.31 convolve</a></h2>
  28709. <p>Apply 2D convolution of video stream in frequency domain using second stream
  28710. as impulse.
  28711. </p>
  28712. <p>The filter accepts the following options:
  28713. </p>
  28714. <dl compact="compact">
  28715. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  28716. <dd><p>Set which planes to process.
  28717. </p>
  28718. </dd>
  28719. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  28720. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  28721. or <var>all</var>. Default is <var>all</var>.
  28722. </p></dd>
  28723. </dl>
  28724. <p>The <code>convolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  28725. </p>
  28726. <a name="copy"></a>
  28727. <h2 class="section"><a href="ffmpeg-all.html#toc-copy">39.32 copy</a></h2>
  28728. <p>Copy the input video source unchanged to the output. This is mainly useful for
  28729. testing purposes.
  28730. </p>
  28731. <p><a name="coreimage"></a>
  28732. </p><a name="coreimage-1"></a>
  28733. <h2 class="section"><a href="ffmpeg-all.html#toc-coreimage-1">39.33 coreimage</a></h2>
  28734. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  28735. </p>
  28736. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  28737. processed by video hardware. However, software-based OpenGL implementations
  28738. exist which means there is no guarantee for hardware processing. It depends on
  28739. the respective OSX.
  28740. </p>
  28741. <p>There are many filters and image generators provided by Apple that come with a
  28742. large variety of options. The filter has to be referenced by its name along
  28743. with its options.
  28744. </p>
  28745. <p>The coreimage filter accepts the following options:
  28746. </p><dl compact="compact">
  28747. <dt>&lsquo;<samp>list_filters</samp>&rsquo;</dt>
  28748. <dd><p>List all available filters and generators along with all their respective
  28749. options as well as possible minimum and maximum values along with the default
  28750. values.
  28751. </p><div class="example">
  28752. <pre class="example">list_filters=true
  28753. </pre></div>
  28754. </dd>
  28755. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  28756. <dd><p>Specify all filters by their respective name and options.
  28757. Use <var>list_filters</var> to determine all valid filter names and options.
  28758. Numerical options are specified by a float value and are automatically clamped
  28759. to their respective value range. Vector and color options have to be specified
  28760. by a list of space separated float values. Character escaping has to be done.
  28761. A special option name <code>default</code> is available to use default options for a
  28762. filter.
  28763. </p>
  28764. <p>It is required to specify either <code>default</code> or at least one of the filter options.
  28765. All omitted options are used with their default values.
  28766. The syntax of the filter string is as follows:
  28767. </p><div class="example">
  28768. <pre class="example">filter=&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...][#&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...]][#...]
  28769. </pre></div>
  28770. </dd>
  28771. <dt>&lsquo;<samp>output_rect</samp>&rsquo;</dt>
  28772. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  28773. input image. It is given by a list of space separated float values:
  28774. </p><div class="example">
  28775. <pre class="example">output_rect=x\ y\ width\ height
  28776. </pre></div>
  28777. <p>If not given, the output rectangle equals the dimensions of the input image.
  28778. The output rectangle is automatically cropped at the borders of the input
  28779. image. Negative values are valid for each component.
  28780. </p><div class="example">
  28781. <pre class="example">output_rect=25\ 25\ 100\ 100
  28782. </pre></div>
  28783. </dd>
  28784. </dl>
  28785. <p>Several filters can be chained for successive processing without GPU-HOST
  28786. transfers allowing for fast processing of complex filter chains.
  28787. Currently, only filters with zero (generators) or exactly one (filters) input
  28788. image and one output image are supported. Also, transition filters are not yet
  28789. usable as intended.
  28790. </p>
  28791. <p>Some filters generate output images with additional padding depending on the
  28792. respective filter kernel. The padding is automatically removed to ensure the
  28793. filter output has the same size as the input image.
  28794. </p>
  28795. <p>For image generators, the size of the output image is determined by the
  28796. previous output image of the filter chain or the input image of the whole
  28797. filterchain, respectively. The generators do not use the pixel information of
  28798. this image to generate their output. However, the generated output is
  28799. blended onto this image, resulting in partial or complete coverage of the
  28800. output image.
  28801. </p>
  28802. <p>The <a href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  28803. which are directly fed into the filter chain. By using it, providing input
  28804. images by another video source or an input video is not required.
  28805. </p>
  28806. <a name="Examples-24"></a>
  28807. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-24">39.33.1 Examples</a></h3>
  28808. <ul>
  28809. <li>
  28810. List all filters available:
  28811. <div class="example">
  28812. <pre class="example">coreimage=list_filters=true
  28813. </pre></div>
  28814. </li><li>
  28815. Use the CIBoxBlur filter with default options to blur an image:
  28816. <div class="example">
  28817. <pre class="example">coreimage=filter=CIBoxBlur@default
  28818. </pre></div>
  28819. </li><li>
  28820. Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  28821. its center at 100x100 and a radius of 50 pixels:
  28822. <div class="example">
  28823. <pre class="example">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  28824. </pre></div>
  28825. </li><li>
  28826. Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  28827. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  28828. <div class="example">
  28829. <pre class="example">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  28830. </pre></div>
  28831. </li></ul>
  28832. <a name="cover_005frect"></a>
  28833. <h2 class="section"><a href="ffmpeg-all.html#toc-cover_005frect">39.34 cover_rect</a></h2>
  28834. <p>Cover a rectangular object
  28835. </p>
  28836. <p>It accepts the following options:
  28837. </p>
  28838. <dl compact="compact">
  28839. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  28840. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  28841. </p>
  28842. </dd>
  28843. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  28844. <dd><p>Set covering mode.
  28845. </p>
  28846. <p>It accepts the following values:
  28847. </p><dl compact="compact">
  28848. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  28849. <dd><p>cover it by the supplied image
  28850. </p></dd>
  28851. <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
  28852. <dd><p>cover it by interpolating the surrounding pixels
  28853. </p></dd>
  28854. </dl>
  28855. <p>Default value is <var>blur</var>.
  28856. </p></dd>
  28857. </dl>
  28858. <a name="Examples-43"></a>
  28859. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-43">39.34.1 Examples</a></h3>
  28860. <ul>
  28861. <li>
  28862. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  28863. <div class="example">
  28864. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  28865. </pre></div>
  28866. </li></ul>
  28867. <a name="crop"></a>
  28868. <h2 class="section"><a href="ffmpeg-all.html#toc-crop">39.35 crop</a></h2>
  28869. <p>Crop the input video to given dimensions.
  28870. </p>
  28871. <p>It accepts the following parameters:
  28872. </p>
  28873. <dl compact="compact">
  28874. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  28875. <dd><p>The width of the output video. It defaults to <code>iw</code>.
  28876. This expression is evaluated only once during the filter
  28877. configuration, or when the &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>out_w</samp>&rsquo; command is sent.
  28878. </p>
  28879. </dd>
  28880. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  28881. <dd><p>The height of the output video. It defaults to <code>ih</code>.
  28882. This expression is evaluated only once during the filter
  28883. configuration, or when the &lsquo;<samp>h</samp>&rsquo; or &lsquo;<samp>out_h</samp>&rsquo; command is sent.
  28884. </p>
  28885. </dd>
  28886. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  28887. <dd><p>The horizontal position, in the input video, of the left edge of the output
  28888. video. It defaults to <code>(in_w-out_w)/2</code>.
  28889. This expression is evaluated per-frame.
  28890. </p>
  28891. </dd>
  28892. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  28893. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  28894. It defaults to <code>(in_h-out_h)/2</code>.
  28895. This expression is evaluated per-frame.
  28896. </p>
  28897. </dd>
  28898. <dt>&lsquo;<samp>keep_aspect</samp>&rsquo;</dt>
  28899. <dd><p>If set to 1 will force the output display aspect ratio
  28900. to be the same of the input, by changing the output sample aspect
  28901. ratio. It defaults to 0.
  28902. </p>
  28903. </dd>
  28904. <dt>&lsquo;<samp>exact</samp>&rsquo;</dt>
  28905. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  28906. width/height/x/y as specified and will not be rounded to nearest smaller value.
  28907. It defaults to 0.
  28908. </p></dd>
  28909. </dl>
  28910. <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
  28911. expressions containing the following constants:
  28912. </p>
  28913. <dl compact="compact">
  28914. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  28915. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  28916. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  28917. each new frame.
  28918. </p>
  28919. </dd>
  28920. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  28921. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  28922. <dd><p>The input width and height.
  28923. </p>
  28924. </dd>
  28925. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  28926. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  28927. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  28928. </p>
  28929. </dd>
  28930. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  28931. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  28932. <dd><p>The output (cropped) width and height.
  28933. </p>
  28934. </dd>
  28935. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  28936. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  28937. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  28938. </p>
  28939. </dd>
  28940. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  28941. <dd><p>same as <var>iw</var> / <var>ih</var>
  28942. </p>
  28943. </dd>
  28944. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  28945. <dd><p>input sample aspect ratio
  28946. </p>
  28947. </dd>
  28948. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  28949. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  28950. </p>
  28951. </dd>
  28952. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  28953. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  28954. <dd><p>horizontal and vertical chroma subsample values. For example for the
  28955. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  28956. </p>
  28957. </dd>
  28958. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  28959. <dd><p>The number of the input frame, starting from 0.
  28960. </p>
  28961. </dd>
  28962. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  28963. <dd><p>the position in the file of the input frame, NAN if unknown
  28964. </p>
  28965. </dd>
  28966. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  28967. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  28968. </p>
  28969. </dd>
  28970. </dl>
  28971. <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
  28972. and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
  28973. cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
  28974. evaluated after <var>out_w</var> and <var>out_h</var>.
  28975. </p>
  28976. <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
  28977. position of the top-left corner of the output (non-cropped) area. They
  28978. are evaluated for each frame. If the evaluated value is not valid, it
  28979. is approximated to the nearest valid value.
  28980. </p>
  28981. <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
  28982. for <var>y</var> may depend on <var>x</var>.
  28983. </p>
  28984. <a name="Examples-30"></a>
  28985. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-30">39.35.1 Examples</a></h3>
  28986. <ul>
  28987. <li>
  28988. Crop area with size 100x100 at position (12,34).
  28989. <div class="example">
  28990. <pre class="example">crop=100:100:12:34
  28991. </pre></div>
  28992. <p>Using named options, the example above becomes:
  28993. </p><div class="example">
  28994. <pre class="example">crop=w=100:h=100:x=12:y=34
  28995. </pre></div>
  28996. </li><li>
  28997. Crop the central input area with size 100x100:
  28998. <div class="example">
  28999. <pre class="example">crop=100:100
  29000. </pre></div>
  29001. </li><li>
  29002. Crop the central input area with size 2/3 of the input video:
  29003. <div class="example">
  29004. <pre class="example">crop=2/3*in_w:2/3*in_h
  29005. </pre></div>
  29006. </li><li>
  29007. Crop the input video central square:
  29008. <div class="example">
  29009. <pre class="example">crop=out_w=in_h
  29010. crop=in_h
  29011. </pre></div>
  29012. </li><li>
  29013. Delimit the rectangle with the top-left corner placed at position
  29014. 100:100 and the right-bottom corner corresponding to the right-bottom
  29015. corner of the input image.
  29016. <div class="example">
  29017. <pre class="example">crop=in_w-100:in_h-100:100:100
  29018. </pre></div>
  29019. </li><li>
  29020. Crop 10 pixels from the left and right borders, and 20 pixels from
  29021. the top and bottom borders
  29022. <div class="example">
  29023. <pre class="example">crop=in_w-2*10:in_h-2*20
  29024. </pre></div>
  29025. </li><li>
  29026. Keep only the bottom right quarter of the input image:
  29027. <div class="example">
  29028. <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
  29029. </pre></div>
  29030. </li><li>
  29031. Crop height for getting Greek harmony:
  29032. <div class="example">
  29033. <pre class="example">crop=in_w:1/PHI*in_w
  29034. </pre></div>
  29035. </li><li>
  29036. Apply trembling effect:
  29037. <div class="example">
  29038. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
  29039. </pre></div>
  29040. </li><li>
  29041. Apply erratic camera effect depending on timestamp:
  29042. <div class="example">
  29043. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
  29044. </pre></div>
  29045. </li><li>
  29046. Set x depending on the value of y:
  29047. <div class="example">
  29048. <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  29049. </pre></div>
  29050. </li></ul>
  29051. <a name="Commands-12"></a>
  29052. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-12">39.35.2 Commands</a></h3>
  29053. <p>This filter supports the following commands:
  29054. </p><dl compact="compact">
  29055. <dt>&lsquo;<samp>w, out_w</samp>&rsquo;</dt>
  29056. <dt>&lsquo;<samp>h, out_h</samp>&rsquo;</dt>
  29057. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29058. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29059. <dd><p>Set width/height of the output video and the horizontal/vertical position
  29060. in the input video.
  29061. The command accepts the same syntax of the corresponding option.
  29062. </p>
  29063. <p>If the specified expression is not valid, it is kept at its current
  29064. value.
  29065. </p></dd>
  29066. </dl>
  29067. <a name="cropdetect"></a>
  29068. <h2 class="section"><a href="ffmpeg-all.html#toc-cropdetect">39.36 cropdetect</a></h2>
  29069. <p>Auto-detect the crop size.
  29070. </p>
  29071. <p>It calculates the necessary cropping parameters and prints the
  29072. recommended parameters via the logging system. The detected dimensions
  29073. correspond to the non-black area of the input video.
  29074. </p>
  29075. <p>It accepts the following parameters:
  29076. </p>
  29077. <dl compact="compact">
  29078. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  29079. <dd><p>Set higher black value threshold, which can be optionally specified
  29080. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  29081. value greater to the set value is considered non-black. It defaults to 24.
  29082. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  29083. on the bitdepth of the pixel format.
  29084. </p>
  29085. </dd>
  29086. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  29087. <dd><p>The value which the width/height should be divisible by. It defaults to
  29088. 16. The offset is automatically adjusted to center the video. Use 2 to
  29089. get only even dimensions (needed for 4:2:2 video). 16 is best when
  29090. encoding to most video codecs.
  29091. </p>
  29092. </dd>
  29093. <dt>&lsquo;<samp>reset_count, reset</samp>&rsquo;</dt>
  29094. <dd><p>Set the counter that determines after how many frames cropdetect will
  29095. reset the previously detected largest video area and start over to
  29096. detect the current optimal crop area. Default value is 0.
  29097. </p>
  29098. <p>This can be useful when channel logos distort the video area. 0
  29099. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  29100. playback.
  29101. </p></dd>
  29102. </dl>
  29103. <p><a name="cue"></a>
  29104. </p><a name="cue-1"></a>
  29105. <h2 class="section"><a href="ffmpeg-all.html#toc-cue-1">39.37 cue</a></h2>
  29106. <p>Delay video filtering until a given wallclock timestamp. The filter first
  29107. passes on &lsquo;<samp>preroll</samp>&rsquo; amount of frames, then it buffers at most
  29108. &lsquo;<samp>buffer</samp>&rsquo; amount of frames and waits for the cue. After reaching the cue
  29109. it forwards the buffered frames and also any subsequent frames coming in its
  29110. input.
  29111. </p>
  29112. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  29113. realtime output devices like decklink. By putting the delay in the filtering
  29114. chain and pre-buffering frames the process can pass on data to output almost
  29115. immediately after the target wallclock timestamp is reached.
  29116. </p>
  29117. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  29118. some use cases.
  29119. </p>
  29120. <dl compact="compact">
  29121. <dt>&lsquo;<samp>cue</samp>&rsquo;</dt>
  29122. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  29123. </p>
  29124. </dd>
  29125. <dt>&lsquo;<samp>preroll</samp>&rsquo;</dt>
  29126. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  29127. </p>
  29128. </dd>
  29129. <dt>&lsquo;<samp>buffer</samp>&rsquo;</dt>
  29130. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  29131. in seconds. Default is 0.
  29132. </p>
  29133. </dd>
  29134. </dl>
  29135. <p><a name="curves"></a>
  29136. </p><a name="curves-1"></a>
  29137. <h2 class="section"><a href="ffmpeg-all.html#toc-curves-1">39.38 curves</a></h2>
  29138. <p>Apply color adjustments using curves.
  29139. </p>
  29140. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  29141. component (red, green and blue) has its values defined by <var>N</var> key points
  29142. tied from each other using a smooth curve. The x-axis represents the pixel
  29143. values from the input frame, and the y-axis the new pixel values to be set for
  29144. the output frame.
  29145. </p>
  29146. <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
  29147. <var>(1;1)</var>. This creates a straight line where each original pixel value is
  29148. &quot;adjusted&quot; to its own value, which means no change to the image.
  29149. </p>
  29150. <p>The filter allows you to redefine these two points and add some more. A new
  29151. curve (using a natural cubic spline interpolation) will be define to pass
  29152. smoothly through all these new coordinates. The new defined points needs to be
  29153. strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
  29154. be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
  29155. the vector spaces, the values will be clipped accordingly.
  29156. </p>
  29157. <p>The filter accepts the following options:
  29158. </p>
  29159. <dl compact="compact">
  29160. <dt>&lsquo;<samp>preset</samp>&rsquo;</dt>
  29161. <dd><p>Select one of the available color presets. This option can be used in addition
  29162. to the &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; parameters; in this case, the later
  29163. options takes priority on the preset values.
  29164. Available presets are:
  29165. </p><dl compact="compact">
  29166. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  29167. <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
  29168. <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
  29169. <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
  29170. <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
  29171. <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
  29172. <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
  29173. <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
  29174. <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
  29175. <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
  29176. <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
  29177. </dl>
  29178. <p>Default is <code>none</code>.
  29179. </p></dd>
  29180. <dt>&lsquo;<samp>master, m</samp>&rsquo;</dt>
  29181. <dd><p>Set the master key points. These points will define a second pass mapping. It
  29182. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  29183. &lsquo;<samp>r</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; or &lsquo;<samp>all</samp>&rsquo; since it acts like a
  29184. post-processing LUT.
  29185. </p></dd>
  29186. <dt>&lsquo;<samp>red, r</samp>&rsquo;</dt>
  29187. <dd><p>Set the key points for the red component.
  29188. </p></dd>
  29189. <dt>&lsquo;<samp>green, g</samp>&rsquo;</dt>
  29190. <dd><p>Set the key points for the green component.
  29191. </p></dd>
  29192. <dt>&lsquo;<samp>blue, b</samp>&rsquo;</dt>
  29193. <dd><p>Set the key points for the blue component.
  29194. </p></dd>
  29195. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  29196. <dd><p>Set the key points for all components (not including master).
  29197. Can be used in addition to the other key points component
  29198. options. In this case, the unset component(s) will fallback on this
  29199. &lsquo;<samp>all</samp>&rsquo; setting.
  29200. </p></dd>
  29201. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  29202. <dd><p>Specify a Photoshop curves file (<code>.acv</code>) to import the settings from.
  29203. </p></dd>
  29204. <dt>&lsquo;<samp>plot</samp>&rsquo;</dt>
  29205. <dd><p>Save Gnuplot script of the curves in specified file.
  29206. </p></dd>
  29207. </dl>
  29208. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  29209. defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
  29210. </p>
  29211. <a name="Examples-16"></a>
  29212. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-16">39.38.1 Examples</a></h3>
  29213. <ul>
  29214. <li>
  29215. Increase slightly the middle level of blue:
  29216. <div class="example">
  29217. <pre class="example">curves=blue='0/0 0.5/0.58 1/1'
  29218. </pre></div>
  29219. </li><li>
  29220. Vintage effect:
  29221. <div class="example">
  29222. <pre class="example">curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
  29223. </pre></div>
  29224. <p>Here we obtain the following coordinates for each components:
  29225. </p><dl compact="compact">
  29226. <dt><var>red</var></dt>
  29227. <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
  29228. </p></dd>
  29229. <dt><var>green</var></dt>
  29230. <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
  29231. </p></dd>
  29232. <dt><var>blue</var></dt>
  29233. <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
  29234. </p></dd>
  29235. </dl>
  29236. </li><li>
  29237. The previous example can also be achieved with the associated built-in preset:
  29238. <div class="example">
  29239. <pre class="example">curves=preset=vintage
  29240. </pre></div>
  29241. </li><li>
  29242. Or simply:
  29243. <div class="example">
  29244. <pre class="example">curves=vintage
  29245. </pre></div>
  29246. </li><li>
  29247. Use a Photoshop preset and redefine the points of the green component:
  29248. <div class="example">
  29249. <pre class="example">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  29250. </pre></div>
  29251. </li><li>
  29252. Check out the curves of the <code>cross_process</code> profile using <code>ffmpeg</code>
  29253. and <code>gnuplot</code>:
  29254. <div class="example">
  29255. <pre class="example">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  29256. gnuplot -p /tmp/curves.plt
  29257. </pre></div>
  29258. </li></ul>
  29259. <a name="datascope"></a>
  29260. <h2 class="section"><a href="ffmpeg-all.html#toc-datascope">39.39 datascope</a></h2>
  29261. <p>Video data analysis filter.
  29262. </p>
  29263. <p>This filter shows hexadecimal pixel values of part of video.
  29264. </p>
  29265. <p>The filter accepts the following options:
  29266. </p>
  29267. <dl compact="compact">
  29268. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  29269. <dd><p>Set output video size.
  29270. </p>
  29271. </dd>
  29272. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29273. <dd><p>Set x offset from where to pick pixels.
  29274. </p>
  29275. </dd>
  29276. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29277. <dd><p>Set y offset from where to pick pixels.
  29278. </p>
  29279. </dd>
  29280. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  29281. <dd><p>Set scope mode, can be one of the following:
  29282. </p><dl compact="compact">
  29283. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  29284. <dd><p>Draw hexadecimal pixel values with white color on black background.
  29285. </p>
  29286. </dd>
  29287. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  29288. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  29289. background.
  29290. </p>
  29291. </dd>
  29292. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  29293. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  29294. the text color is picked in such way so its always visible.
  29295. </p></dd>
  29296. </dl>
  29297. </dd>
  29298. <dt>&lsquo;<samp>axis</samp>&rsquo;</dt>
  29299. <dd><p>Draw rows and columns numbers on left and top of video.
  29300. </p>
  29301. </dd>
  29302. <dt>&lsquo;<samp>opacity</samp>&rsquo;</dt>
  29303. <dd><p>Set background opacity.
  29304. </p>
  29305. </dd>
  29306. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  29307. <dd><p>Set display number format. Can be <code>hex</code>, or <code>dec</code>. Default is <code>hex</code>.
  29308. </p></dd>
  29309. </dl>
  29310. <a name="dctdnoiz"></a>
  29311. <h2 class="section"><a href="ffmpeg-all.html#toc-dctdnoiz">39.40 dctdnoiz</a></h2>
  29312. <p>Denoise frames using 2D DCT (frequency domain filtering).
  29313. </p>
  29314. <p>This filter is not designed for real time.
  29315. </p>
  29316. <p>The filter accepts the following options:
  29317. </p>
  29318. <dl compact="compact">
  29319. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  29320. <dd><p>Set the noise sigma constant.
  29321. </p>
  29322. <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
  29323. coefficient (absolute value) below this threshold with be dropped.
  29324. </p>
  29325. <p>If you need a more advanced filtering, see &lsquo;<samp>expr</samp>&rsquo;.
  29326. </p>
  29327. <p>Default is <code>0</code>.
  29328. </p>
  29329. </dd>
  29330. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  29331. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  29332. may want to reduce this value, at the cost of a less effective filter and the
  29333. risk of various artefacts.
  29334. </p>
  29335. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  29336. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  29337. </p>
  29338. <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
  29339. </p>
  29340. </dd>
  29341. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  29342. <dd><p>Set the coefficient factor expression.
  29343. </p>
  29344. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  29345. multiplier value for the coefficient.
  29346. </p>
  29347. <p>If this is option is set, the &lsquo;<samp>sigma</samp>&rsquo; option will be ignored.
  29348. </p>
  29349. <p>The absolute value of the coefficient can be accessed through the <var>c</var>
  29350. variable.
  29351. </p>
  29352. </dd>
  29353. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  29354. <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
  29355. <var>blocksize</var>, which is the width and height of the processed blocks.
  29356. </p>
  29357. <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
  29358. <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
  29359. on the speed processing. Also, a larger block size does not necessarily means a
  29360. better de-noising.
  29361. </p></dd>
  29362. </dl>
  29363. <a name="Examples-108"></a>
  29364. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-108">39.40.1 Examples</a></h3>
  29365. <p>Apply a denoise with a &lsquo;<samp>sigma</samp>&rsquo; of <code>4.5</code>:
  29366. </p><div class="example">
  29367. <pre class="example">dctdnoiz=4.5
  29368. </pre></div>
  29369. <p>The same operation can be achieved using the expression system:
  29370. </p><div class="example">
  29371. <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
  29372. </pre></div>
  29373. <p>Violent denoise using a block size of <code>16x16</code>:
  29374. </p><div class="example">
  29375. <pre class="example">dctdnoiz=15:n=4
  29376. </pre></div>
  29377. <a name="deband"></a>
  29378. <h2 class="section"><a href="ffmpeg-all.html#toc-deband">39.41 deband</a></h2>
  29379. <p>Remove banding artifacts from input video.
  29380. It works by replacing banded pixels with average value of referenced pixels.
  29381. </p>
  29382. <p>The filter accepts the following options:
  29383. </p>
  29384. <dl compact="compact">
  29385. <dt>&lsquo;<samp>1thr</samp>&rsquo;</dt>
  29386. <dt>&lsquo;<samp>2thr</samp>&rsquo;</dt>
  29387. <dt>&lsquo;<samp>3thr</samp>&rsquo;</dt>
  29388. <dt>&lsquo;<samp>4thr</samp>&rsquo;</dt>
  29389. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  29390. Valid range is 0.00003 to 0.5.
  29391. If difference between current pixel and reference pixel is less than threshold,
  29392. it will be considered as banded.
  29393. </p>
  29394. </dd>
  29395. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  29396. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  29397. in range 0 to set value will be used. If negative, exact absolute value
  29398. will be used.
  29399. The range defines square of four pixels around current pixel.
  29400. </p>
  29401. </dd>
  29402. <dt>&lsquo;<samp>direction, d</samp>&rsquo;</dt>
  29403. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  29404. random direction from 0 to set direction will be picked. If negative, exact of
  29405. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  29406. will pick only pixels on same row and -PI/2 will pick only pixels on same
  29407. column.
  29408. </p>
  29409. </dd>
  29410. <dt>&lsquo;<samp>blur, b</samp>&rsquo;</dt>
  29411. <dd><p>If enabled, current pixel is compared with average value of all four
  29412. surrounding pixels. The default is enabled. If disabled current pixel is
  29413. compared with all four surrounding pixels. The pixel is considered banded
  29414. if only all four differences with surrounding pixels are less than threshold.
  29415. </p>
  29416. </dd>
  29417. <dt>&lsquo;<samp>coupling, c</samp>&rsquo;</dt>
  29418. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  29419. e.g. banding detection threshold is triggered for all color components.
  29420. The default is disabled.
  29421. </p></dd>
  29422. </dl>
  29423. <a name="deblock"></a>
  29424. <h2 class="section"><a href="ffmpeg-all.html#toc-deblock">39.42 deblock</a></h2>
  29425. <p>Remove blocking artifacts from input video.
  29426. </p>
  29427. <p>The filter accepts the following options:
  29428. </p>
  29429. <dl compact="compact">
  29430. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  29431. <dd><p>Set filter type, can be <var>weak</var> or <var>strong</var>. Default is <var>strong</var>.
  29432. This controls what kind of deblocking is applied.
  29433. </p>
  29434. </dd>
  29435. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  29436. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var>8</var>.
  29437. </p>
  29438. </dd>
  29439. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  29440. <dt>&lsquo;<samp>beta</samp>&rsquo;</dt>
  29441. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  29442. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  29443. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  29444. Defaults are: <var>0.098</var> for <var>alpha</var> and <var>0.05</var> for the rest.
  29445. Using higher threshold gives more deblocking strength.
  29446. Setting <var>alpha</var> controls threshold detection at exact edge of block.
  29447. Remaining options controls threshold detection near the edge. Each one for
  29448. below/above or left/right. Setting any of those to <var>0</var> disables
  29449. deblocking.
  29450. </p>
  29451. </dd>
  29452. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29453. <dd><p>Set planes to filter. Default is to filter all available planes.
  29454. </p></dd>
  29455. </dl>
  29456. <a name="Examples-178"></a>
  29457. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-178">39.42.1 Examples</a></h3>
  29458. <ul>
  29459. <li>
  29460. Deblock using weak filter and block size of 4 pixels.
  29461. <div class="example">
  29462. <pre class="example">deblock=filter=weak:block=4
  29463. </pre></div>
  29464. </li><li>
  29465. Deblock using strong filter, block size of 4 pixels and custom thresholds for
  29466. deblocking more edges.
  29467. <div class="example">
  29468. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  29469. </pre></div>
  29470. </li><li>
  29471. Similar as above, but filter only first plane.
  29472. <div class="example">
  29473. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  29474. </pre></div>
  29475. </li><li>
  29476. Similar as above, but filter only second and third plane.
  29477. <div class="example">
  29478. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  29479. </pre></div>
  29480. </li></ul>
  29481. <p><a name="decimate"></a>
  29482. </p><a name="decimate-1"></a>
  29483. <h2 class="section"><a href="ffmpeg-all.html#toc-decimate-1">39.43 decimate</a></h2>
  29484. <p>Drop duplicated frames at regular intervals.
  29485. </p>
  29486. <p>The filter accepts the following options:
  29487. </p>
  29488. <dl compact="compact">
  29489. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  29490. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  29491. <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
  29492. Default is <code>5</code>.
  29493. </p>
  29494. </dd>
  29495. <dt>&lsquo;<samp>dupthresh</samp>&rsquo;</dt>
  29496. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  29497. is less than or equal to this value, then it is declared as duplicate. Default
  29498. is <code>1.1</code>
  29499. </p>
  29500. </dd>
  29501. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  29502. <dd><p>Set scene change threshold. Default is <code>15</code>.
  29503. </p>
  29504. </dd>
  29505. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  29506. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  29507. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  29508. Larger blocks give better noise suppression, but also give worse detection of
  29509. small movements. Must be a power of two. Default is <code>32</code>.
  29510. </p>
  29511. </dd>
  29512. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  29513. <dd><p>Mark main input as a pre-processed input and activate clean source input
  29514. stream. This allows the input to be pre-processed with various filters to help
  29515. the metrics calculation while keeping the frame selection lossless. When set to
  29516. <code>1</code>, the first stream is for the pre-processed input, and the second
  29517. stream is the clean source from where the kept frames are chosen. Default is
  29518. <code>0</code>.
  29519. </p>
  29520. </dd>
  29521. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  29522. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  29523. <code>1</code>.
  29524. </p></dd>
  29525. </dl>
  29526. <a name="deconvolve"></a>
  29527. <h2 class="section"><a href="ffmpeg-all.html#toc-deconvolve">39.44 deconvolve</a></h2>
  29528. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  29529. as impulse.
  29530. </p>
  29531. <p>The filter accepts the following options:
  29532. </p>
  29533. <dl compact="compact">
  29534. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  29535. <dd><p>Set which planes to process.
  29536. </p>
  29537. </dd>
  29538. <dt>&lsquo;<samp>impulse</samp>&rsquo;</dt>
  29539. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  29540. or <var>all</var>. Default is <var>all</var>.
  29541. </p>
  29542. </dd>
  29543. <dt>&lsquo;<samp>noise</samp>&rsquo;</dt>
  29544. <dd><p>Set noise when doing divisions. Default is <var>0.0000001</var>. Useful when width
  29545. and height are not same and not power of 2 or if stream prior to convolving
  29546. had noise.
  29547. </p></dd>
  29548. </dl>
  29549. <p>The <code>deconvolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  29550. </p>
  29551. <a name="dedot"></a>
  29552. <h2 class="section"><a href="ffmpeg-all.html#toc-dedot">39.45 dedot</a></h2>
  29553. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  29554. </p>
  29555. <p>It accepts the following options:
  29556. </p>
  29557. <dl compact="compact">
  29558. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  29559. <dd><p>Set mode of operation. Can be combination of <var>dotcrawl</var> for cross-luminance reduction and/or
  29560. <var>rainbows</var> for cross-color reduction.
  29561. </p>
  29562. </dd>
  29563. <dt>&lsquo;<samp>lt</samp>&rsquo;</dt>
  29564. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  29565. </p>
  29566. </dd>
  29567. <dt>&lsquo;<samp>tl</samp>&rsquo;</dt>
  29568. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  29569. </p>
  29570. </dd>
  29571. <dt>&lsquo;<samp>tc</samp>&rsquo;</dt>
  29572. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  29573. </p>
  29574. </dd>
  29575. <dt>&lsquo;<samp>ct</samp>&rsquo;</dt>
  29576. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  29577. </p></dd>
  29578. </dl>
  29579. <a name="deflate"></a>
  29580. <h2 class="section"><a href="ffmpeg-all.html#toc-deflate">39.46 deflate</a></h2>
  29581. <p>Apply deflate effect to the video.
  29582. </p>
  29583. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  29584. only values lower than the pixel.
  29585. </p>
  29586. <p>It accepts the following options:
  29587. </p>
  29588. <dl compact="compact">
  29589. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  29590. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  29591. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  29592. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  29593. <dd><p>Limit the maximum change for each plane, default is 65535.
  29594. If 0, plane will remain unchanged.
  29595. </p></dd>
  29596. </dl>
  29597. <a name="Commands-2"></a>
  29598. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-2">39.46.1 Commands</a></h3>
  29599. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29600. </p>
  29601. <a name="deflicker"></a>
  29602. <h2 class="section"><a href="ffmpeg-all.html#toc-deflicker">39.47 deflicker</a></h2>
  29603. <p>Remove temporal frame luminance variations.
  29604. </p>
  29605. <p>It accepts the following options:
  29606. </p>
  29607. <dl compact="compact">
  29608. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  29609. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  29610. </p>
  29611. </dd>
  29612. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  29613. <dd><p>Set averaging mode to smooth temporal luminance variations.
  29614. </p>
  29615. <p>Available values are:
  29616. </p><dl compact="compact">
  29617. <dt>&lsquo;<samp>am</samp>&rsquo;</dt>
  29618. <dd><p>Arithmetic mean
  29619. </p>
  29620. </dd>
  29621. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  29622. <dd><p>Geometric mean
  29623. </p>
  29624. </dd>
  29625. <dt>&lsquo;<samp>hm</samp>&rsquo;</dt>
  29626. <dd><p>Harmonic mean
  29627. </p>
  29628. </dd>
  29629. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  29630. <dd><p>Quadratic mean
  29631. </p>
  29632. </dd>
  29633. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  29634. <dd><p>Cubic mean
  29635. </p>
  29636. </dd>
  29637. <dt>&lsquo;<samp>pm</samp>&rsquo;</dt>
  29638. <dd><p>Power mean
  29639. </p>
  29640. </dd>
  29641. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  29642. <dd><p>Median
  29643. </p></dd>
  29644. </dl>
  29645. </dd>
  29646. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  29647. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  29648. </p></dd>
  29649. </dl>
  29650. <a name="dejudder"></a>
  29651. <h2 class="section"><a href="ffmpeg-all.html#toc-dejudder">39.48 dejudder</a></h2>
  29652. <p>Remove judder produced by partially interlaced telecined content.
  29653. </p>
  29654. <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
  29655. source was partially telecined content then the output of <code>pullup,dejudder</code>
  29656. will have a variable frame rate. May change the recorded frame rate of the
  29657. container. Aside from that change, this filter will not affect constant frame
  29658. rate video.
  29659. </p>
  29660. <p>The option available in this filter is:
  29661. </p><dl compact="compact">
  29662. <dt>&lsquo;<samp>cycle</samp>&rsquo;</dt>
  29663. <dd><p>Specify the length of the window over which the judder repeats.
  29664. </p>
  29665. <p>Accepts any integer greater than 1. Useful values are:
  29666. </p><dl compact="compact">
  29667. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  29668. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  29669. </p>
  29670. </dd>
  29671. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  29672. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  29673. </p>
  29674. </dd>
  29675. <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
  29676. <dd><p>If a mixture of the two.
  29677. </p></dd>
  29678. </dl>
  29679. <p>The default is &lsquo;<samp>4</samp>&rsquo;.
  29680. </p></dd>
  29681. </dl>
  29682. <a name="delogo"></a>
  29683. <h2 class="section"><a href="ffmpeg-all.html#toc-delogo">39.49 delogo</a></h2>
  29684. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  29685. pixels. Just set a rectangle covering the logo and watch it disappear
  29686. (and sometimes something even uglier appear - your mileage may vary).
  29687. </p>
  29688. <p>It accepts the following parameters:
  29689. </p><dl compact="compact">
  29690. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29691. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29692. <dd><p>Specify the top left corner coordinates of the logo. They must be
  29693. specified.
  29694. </p>
  29695. </dd>
  29696. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  29697. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  29698. <dd><p>Specify the width and height of the logo to clear. They must be
  29699. specified.
  29700. </p>
  29701. </dd>
  29702. <dt>&lsquo;<samp>band, t</samp>&rsquo;</dt>
  29703. <dd><p>Specify the thickness of the fuzzy edge of the rectangle (added to
  29704. <var>w</var> and <var>h</var>). The default value is 1. This option is
  29705. deprecated, setting higher values should no longer be necessary and
  29706. is not recommended.
  29707. </p>
  29708. </dd>
  29709. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  29710. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  29711. finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
  29712. The default value is 0.
  29713. </p>
  29714. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  29715. replaced with interpolated values. The values of the next pixels
  29716. immediately outside this rectangle in each direction will be used to
  29717. compute the interpolated pixel values inside the rectangle.
  29718. </p>
  29719. </dd>
  29720. </dl>
  29721. <a name="Examples-53"></a>
  29722. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-53">39.49.1 Examples</a></h3>
  29723. <ul>
  29724. <li>
  29725. Set a rectangle covering the area with top left corner coordinates 0,0
  29726. and size 100x77, and a band of size 10:
  29727. <div class="example">
  29728. <pre class="example">delogo=x=0:y=0:w=100:h=77:band=10
  29729. </pre></div>
  29730. </li></ul>
  29731. <a name="derain"></a>
  29732. <h2 class="section"><a href="ffmpeg-all.html#toc-derain">39.50 derain</a></h2>
  29733. <p>Remove the rain in the input image/video by applying the derain methods based on
  29734. convolutional neural networks. Supported models:
  29735. </p>
  29736. <ul>
  29737. <li>
  29738. Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  29739. See <a href="http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf">http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf</a>.
  29740. </li></ul>
  29741. <p>Training as well as model generation scripts are provided in
  29742. the repository at <a href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  29743. </p>
  29744. <p>Native model files (.model) can be generated from TensorFlow model
  29745. files (.pb) by using tools/python/convert.py
  29746. </p>
  29747. <p>The filter accepts the following options:
  29748. </p>
  29749. <dl compact="compact">
  29750. <dt>&lsquo;<samp>filter_type</samp>&rsquo;</dt>
  29751. <dd><p>Specify which filter to use. This option accepts the following values:
  29752. </p>
  29753. <dl compact="compact">
  29754. <dt>&lsquo;<samp>derain</samp>&rsquo;</dt>
  29755. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  29756. </p>
  29757. </dd>
  29758. <dt>&lsquo;<samp>dehaze</samp>&rsquo;</dt>
  29759. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  29760. </p></dd>
  29761. </dl>
  29762. <p>Default value is &lsquo;<samp>derain</samp>&rsquo;.
  29763. </p>
  29764. </dd>
  29765. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  29766. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  29767. the following values:
  29768. </p>
  29769. <dl compact="compact">
  29770. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  29771. <dd><p>Native implementation of DNN loading and execution.
  29772. </p>
  29773. </dd>
  29774. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  29775. <dd><p>TensorFlow backend. To enable this backend you
  29776. need to install the TensorFlow for C library (see
  29777. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  29778. <code>--enable-libtensorflow</code>
  29779. </p></dd>
  29780. </dl>
  29781. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  29782. </p>
  29783. </dd>
  29784. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  29785. <dd><p>Set path to model file specifying network architecture and its parameters.
  29786. Note that different backends use different file formats. TensorFlow and native
  29787. backend can load files for only its format.
  29788. </p></dd>
  29789. </dl>
  29790. <a name="deshake"></a>
  29791. <h2 class="section"><a href="ffmpeg-all.html#toc-deshake">39.51 deshake</a></h2>
  29792. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  29793. filter helps remove camera shake from hand-holding a camera, bumping a
  29794. tripod, moving on a vehicle, etc.
  29795. </p>
  29796. <p>The filter accepts the following options:
  29797. </p>
  29798. <dl compact="compact">
  29799. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  29800. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  29801. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  29802. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  29803. <dd><p>Specify a rectangular area where to limit the search for motion
  29804. vectors.
  29805. If desired the search for motion vectors can be limited to a
  29806. rectangular area of the frame defined by its top left corner, width
  29807. and height. These parameters have the same meaning as the drawbox
  29808. filter which can be used to visualise the position of the bounding
  29809. box.
  29810. </p>
  29811. <p>This is useful when simultaneous movement of subjects within the frame
  29812. might be confused for camera motion by the motion vector search.
  29813. </p>
  29814. <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
  29815. then the full frame is used. This allows later options to be set
  29816. without specifying the bounding box for the motion vector search.
  29817. </p>
  29818. <p>Default - search the whole frame.
  29819. </p>
  29820. </dd>
  29821. <dt>&lsquo;<samp>rx</samp>&rsquo;</dt>
  29822. <dt>&lsquo;<samp>ry</samp>&rsquo;</dt>
  29823. <dd><p>Specify the maximum extent of movement in x and y directions in the
  29824. range 0-64 pixels. Default 16.
  29825. </p>
  29826. </dd>
  29827. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  29828. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  29829. frame. Available values are:
  29830. </p><dl compact="compact">
  29831. <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
  29832. <dd><p>Fill zeroes at blank locations
  29833. </p></dd>
  29834. <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
  29835. <dd><p>Original image at blank locations
  29836. </p></dd>
  29837. <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
  29838. <dd><p>Extruded edge value at blank locations
  29839. </p></dd>
  29840. <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
  29841. <dd><p>Mirrored edge at blank locations
  29842. </p></dd>
  29843. </dl>
  29844. <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
  29845. </p>
  29846. </dd>
  29847. <dt>&lsquo;<samp>blocksize</samp>&rsquo;</dt>
  29848. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  29849. default 8.
  29850. </p>
  29851. </dd>
  29852. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  29853. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  29854. the specified contrast (difference between darkest and lightest
  29855. pixels) will be considered. Range 1-255, default 125.
  29856. </p>
  29857. </dd>
  29858. <dt>&lsquo;<samp>search</samp>&rsquo;</dt>
  29859. <dd><p>Specify the search strategy. Available values are:
  29860. </p><dl compact="compact">
  29861. <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
  29862. <dd><p>Set exhaustive search
  29863. </p></dd>
  29864. <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
  29865. <dd><p>Set less exhaustive search.
  29866. </p></dd>
  29867. </dl>
  29868. <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
  29869. </p>
  29870. </dd>
  29871. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  29872. <dd><p>If set then a detailed log of the motion search is written to the
  29873. specified file.
  29874. </p>
  29875. </dd>
  29876. </dl>
  29877. <a name="despill"></a>
  29878. <h2 class="section"><a href="ffmpeg-all.html#toc-despill">39.52 despill</a></h2>
  29879. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  29880. greenscreen or bluescreen.
  29881. </p>
  29882. <p>This filter accepts the following options:
  29883. </p>
  29884. <dl compact="compact">
  29885. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  29886. <dd><p>Set what type of despill to use.
  29887. </p>
  29888. </dd>
  29889. <dt>&lsquo;<samp>mix</samp>&rsquo;</dt>
  29890. <dd><p>Set how spillmap will be generated.
  29891. </p>
  29892. </dd>
  29893. <dt>&lsquo;<samp>expand</samp>&rsquo;</dt>
  29894. <dd><p>Set how much to get rid of still remaining spill.
  29895. </p>
  29896. </dd>
  29897. <dt>&lsquo;<samp>red</samp>&rsquo;</dt>
  29898. <dd><p>Controls amount of red in spill area.
  29899. </p>
  29900. </dd>
  29901. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  29902. <dd><p>Controls amount of green in spill area.
  29903. Should be -1 for greenscreen.
  29904. </p>
  29905. </dd>
  29906. <dt>&lsquo;<samp>blue</samp>&rsquo;</dt>
  29907. <dd><p>Controls amount of blue in spill area.
  29908. Should be -1 for bluescreen.
  29909. </p>
  29910. </dd>
  29911. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  29912. <dd><p>Controls brightness of spill area, preserving colors.
  29913. </p>
  29914. </dd>
  29915. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  29916. <dd><p>Modify alpha from generated spillmap.
  29917. </p></dd>
  29918. </dl>
  29919. <a name="detelecine"></a>
  29920. <h2 class="section"><a href="ffmpeg-all.html#toc-detelecine">39.53 detelecine</a></h2>
  29921. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  29922. pattern specified using the pattern option which must be the same as that passed
  29923. to the telecine filter.
  29924. </p>
  29925. <p>This filter accepts the following options:
  29926. </p>
  29927. <dl compact="compact">
  29928. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  29929. <dd><dl compact="compact">
  29930. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  29931. <dd><p>top field first
  29932. </p></dd>
  29933. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  29934. <dd><p>bottom field first
  29935. The default value is <code>top</code>.
  29936. </p></dd>
  29937. </dl>
  29938. </dd>
  29939. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  29940. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  29941. The default value is <code>23</code>.
  29942. </p>
  29943. </dd>
  29944. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  29945. <dd><p>A number representing position of the first frame with respect to the telecine
  29946. pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
  29947. </p></dd>
  29948. </dl>
  29949. <a name="dilation"></a>
  29950. <h2 class="section"><a href="ffmpeg-all.html#toc-dilation">39.54 dilation</a></h2>
  29951. <p>Apply dilation effect to the video.
  29952. </p>
  29953. <p>This filter replaces the pixel by the local(3x3) maximum.
  29954. </p>
  29955. <p>It accepts the following options:
  29956. </p>
  29957. <dl compact="compact">
  29958. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  29959. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  29960. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  29961. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  29962. <dd><p>Limit the maximum change for each plane, default is 65535.
  29963. If 0, plane will remain unchanged.
  29964. </p>
  29965. </dd>
  29966. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  29967. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  29968. pixels are used.
  29969. </p>
  29970. <p>Flags to local 3x3 coordinates maps like this:
  29971. </p>
  29972. <p> 1 2 3
  29973. 4 5
  29974. 6 7 8
  29975. </p></dd>
  29976. </dl>
  29977. <a name="Commands-23"></a>
  29978. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-23">39.54.1 Commands</a></h3>
  29979. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  29980. </p>
  29981. <a name="displace"></a>
  29982. <h2 class="section"><a href="ffmpeg-all.html#toc-displace">39.55 displace</a></h2>
  29983. <p>Displace pixels as indicated by second and third input stream.
  29984. </p>
  29985. <p>It takes three input streams and outputs one stream, the first input is the
  29986. source, and second and third input are displacement maps.
  29987. </p>
  29988. <p>The second input specifies how much to displace pixels along the
  29989. x-axis, while the third input specifies how much to displace pixels
  29990. along the y-axis.
  29991. If one of displacement map streams terminates, last frame from that
  29992. displacement map will be used.
  29993. </p>
  29994. <p>Note that once generated, displacements maps can be reused over and over again.
  29995. </p>
  29996. <p>A description of the accepted options follows.
  29997. </p>
  29998. <dl compact="compact">
  29999. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  30000. <dd><p>Set displace behavior for pixels that are out of range.
  30001. </p>
  30002. <p>Available values are:
  30003. </p><dl compact="compact">
  30004. <dt>&lsquo;<samp>blank</samp>&rsquo;</dt>
  30005. <dd><p>Missing pixels are replaced by black pixels.
  30006. </p>
  30007. </dd>
  30008. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  30009. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  30010. </p>
  30011. </dd>
  30012. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  30013. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  30014. </p>
  30015. </dd>
  30016. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  30017. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  30018. </p></dd>
  30019. </dl>
  30020. <p>Default is &lsquo;<samp>smear</samp>&rsquo;.
  30021. </p>
  30022. </dd>
  30023. </dl>
  30024. <a name="Examples-77"></a>
  30025. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-77">39.55.1 Examples</a></h3>
  30026. <ul>
  30027. <li>
  30028. Add ripple effect to rgb input of video size hd720:
  30029. <div class="example">
  30030. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
  30031. </pre></div>
  30032. </li><li>
  30033. Add wave effect to rgb input of video size hd720:
  30034. <div class="example">
  30035. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
  30036. </pre></div>
  30037. </li></ul>
  30038. <a name="dnn_005fprocessing"></a>
  30039. <h2 class="section"><a href="ffmpeg-all.html#toc-dnn_005fprocessing">39.56 dnn_processing</a></h2>
  30040. <p>Do image processing with deep neural networks. It works together with another filter
  30041. which converts the pixel format of the Frame to what the dnn network requires.
  30042. </p>
  30043. <p>The filter accepts the following options:
  30044. </p>
  30045. <dl compact="compact">
  30046. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  30047. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  30048. the following values:
  30049. </p>
  30050. <dl compact="compact">
  30051. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  30052. <dd><p>Native implementation of DNN loading and execution.
  30053. </p>
  30054. </dd>
  30055. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  30056. <dd><p>TensorFlow backend. To enable this backend you
  30057. need to install the TensorFlow for C library (see
  30058. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  30059. <code>--enable-libtensorflow</code>
  30060. </p></dd>
  30061. </dl>
  30062. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  30063. </p>
  30064. </dd>
  30065. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  30066. <dd><p>Set path to model file specifying network architecture and its parameters.
  30067. Note that different backends use different file formats. TensorFlow and native
  30068. backend can load files for only its format.
  30069. </p>
  30070. <p>Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
  30071. </p>
  30072. </dd>
  30073. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  30074. <dd><p>Set the input name of the dnn network.
  30075. </p>
  30076. </dd>
  30077. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  30078. <dd><p>Set the output name of the dnn network.
  30079. </p>
  30080. </dd>
  30081. </dl>
  30082. <ul>
  30083. <li>
  30084. Halve the red channle of the frame with format rgb24:
  30085. <div class="example">
  30086. <pre class="example">ffmpeg -i input.jpg -vf format=rgb24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native out.native.png
  30087. </pre></div>
  30088. </li><li>
  30089. Halve the pixel value of the frame with format gray32f:
  30090. <div class="example">
  30091. <pre class="example">ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
  30092. </pre></div>
  30093. </li></ul>
  30094. <a name="drawbox"></a>
  30095. <h2 class="section"><a href="ffmpeg-all.html#toc-drawbox">39.57 drawbox</a></h2>
  30096. <p>Draw a colored box on the input image.
  30097. </p>
  30098. <p>It accepts the following parameters:
  30099. </p>
  30100. <dl compact="compact">
  30101. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30102. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30103. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  30104. </p>
  30105. </dd>
  30106. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  30107. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  30108. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  30109. the input width and height. It defaults to 0.
  30110. </p>
  30111. </dd>
  30112. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  30113. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  30114. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  30115. value <code>invert</code> is used, the box edge color is the same as the
  30116. video with inverted luma.
  30117. </p>
  30118. </dd>
  30119. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  30120. <dd><p>The expression which sets the thickness of the box edge.
  30121. A value of <code>fill</code> will create a filled box. Default value is <code>3</code>.
  30122. </p>
  30123. <p>See below for the list of accepted constants.
  30124. </p>
  30125. </dd>
  30126. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30127. <dd><p>Applicable if the input has alpha. With value <code>1</code>, the pixels of the painted box
  30128. will overwrite the video&rsquo;s color and alpha pixels.
  30129. Default is <code>0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  30130. </p></dd>
  30131. </dl>
  30132. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  30133. following constants:
  30134. </p>
  30135. <dl compact="compact">
  30136. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  30137. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  30138. </p>
  30139. </dd>
  30140. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  30141. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  30142. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30143. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30144. </p>
  30145. </dd>
  30146. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  30147. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  30148. <dd><p>The input width and height.
  30149. </p>
  30150. </dd>
  30151. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  30152. <dd><p>The input sample aspect ratio.
  30153. </p>
  30154. </dd>
  30155. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30156. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30157. <dd><p>The x and y offset coordinates where the box is drawn.
  30158. </p>
  30159. </dd>
  30160. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30161. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30162. <dd><p>The width and height of the drawn box.
  30163. </p>
  30164. </dd>
  30165. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  30166. <dd><p>The thickness of the drawn box.
  30167. </p>
  30168. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  30169. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  30170. </p>
  30171. </dd>
  30172. </dl>
  30173. <a name="Examples-166"></a>
  30174. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-166">39.57.1 Examples</a></h3>
  30175. <ul>
  30176. <li>
  30177. Draw a black box around the edge of the input image:
  30178. <div class="example">
  30179. <pre class="example">drawbox
  30180. </pre></div>
  30181. </li><li>
  30182. Draw a box with color red and an opacity of 50%:
  30183. <div class="example">
  30184. <pre class="example">drawbox=10:20:200:60:red@0.5
  30185. </pre></div>
  30186. <p>The previous example can be specified as:
  30187. </p><div class="example">
  30188. <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  30189. </pre></div>
  30190. </li><li>
  30191. Fill the box with pink color:
  30192. <div class="example">
  30193. <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  30194. </pre></div>
  30195. </li><li>
  30196. Draw a 2-pixel red 2.40:1 mask:
  30197. <div class="example">
  30198. <pre class="example">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
  30199. </pre></div>
  30200. </li></ul>
  30201. <a name="Commands-1"></a>
  30202. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-1">39.57.2 Commands</a></h3>
  30203. <p>This filter supports same commands as options.
  30204. The command accepts the same syntax of the corresponding option.
  30205. </p>
  30206. <p>If the specified expression is not valid, it is kept at its current
  30207. value.
  30208. </p>
  30209. <p><a name="drawgraph"></a>
  30210. </p><a name="drawgraph-1"></a>
  30211. <h2 class="section"><a href="ffmpeg-all.html#toc-drawgraph-1">39.58 drawgraph</a></h2>
  30212. <p>Draw a graph using input video metadata.
  30213. </p>
  30214. <p>It accepts the following parameters:
  30215. </p>
  30216. <dl compact="compact">
  30217. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  30218. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  30219. </p>
  30220. </dd>
  30221. <dt>&lsquo;<samp>fg1</samp>&rsquo;</dt>
  30222. <dd><p>Set 1st foreground color expression.
  30223. </p>
  30224. </dd>
  30225. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  30226. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  30227. </p>
  30228. </dd>
  30229. <dt>&lsquo;<samp>fg2</samp>&rsquo;</dt>
  30230. <dd><p>Set 2nd foreground color expression.
  30231. </p>
  30232. </dd>
  30233. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  30234. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  30235. </p>
  30236. </dd>
  30237. <dt>&lsquo;<samp>fg3</samp>&rsquo;</dt>
  30238. <dd><p>Set 3rd foreground color expression.
  30239. </p>
  30240. </dd>
  30241. <dt>&lsquo;<samp>m4</samp>&rsquo;</dt>
  30242. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  30243. </p>
  30244. </dd>
  30245. <dt>&lsquo;<samp>fg4</samp>&rsquo;</dt>
  30246. <dd><p>Set 4th foreground color expression.
  30247. </p>
  30248. </dd>
  30249. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  30250. <dd><p>Set minimal value of metadata value.
  30251. </p>
  30252. </dd>
  30253. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  30254. <dd><p>Set maximal value of metadata value.
  30255. </p>
  30256. </dd>
  30257. <dt>&lsquo;<samp>bg</samp>&rsquo;</dt>
  30258. <dd><p>Set graph background color. Default is white.
  30259. </p>
  30260. </dd>
  30261. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  30262. <dd><p>Set graph mode.
  30263. </p>
  30264. <p>Available values for mode is:
  30265. </p><dl compact="compact">
  30266. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  30267. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  30268. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  30269. </dl>
  30270. <p>Default is <code>line</code>.
  30271. </p>
  30272. </dd>
  30273. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  30274. <dd><p>Set slide mode.
  30275. </p>
  30276. <p>Available values for slide is:
  30277. </p><dl compact="compact">
  30278. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  30279. <dd><p>Draw new frame when right border is reached.
  30280. </p>
  30281. </dd>
  30282. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30283. <dd><p>Replace old columns with new ones.
  30284. </p>
  30285. </dd>
  30286. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  30287. <dd><p>Scroll from right to left.
  30288. </p>
  30289. </dd>
  30290. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  30291. <dd><p>Scroll from left to right.
  30292. </p>
  30293. </dd>
  30294. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  30295. <dd><p>Draw single picture.
  30296. </p></dd>
  30297. </dl>
  30298. <p>Default is <code>frame</code>.
  30299. </p>
  30300. </dd>
  30301. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  30302. <dd><p>Set size of graph video. For the syntax of this option, check the
  30303. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  30304. The default value is <code>900x256</code>.
  30305. </p>
  30306. </dd>
  30307. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  30308. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  30309. </p>
  30310. <p>The foreground color expressions can use the following variables:
  30311. </p><dl compact="compact">
  30312. <dt>&lsquo;<samp>MIN</samp>&rsquo;</dt>
  30313. <dd><p>Minimal value of metadata value.
  30314. </p>
  30315. </dd>
  30316. <dt>&lsquo;<samp>MAX</samp>&rsquo;</dt>
  30317. <dd><p>Maximal value of metadata value.
  30318. </p>
  30319. </dd>
  30320. <dt>&lsquo;<samp>VAL</samp>&rsquo;</dt>
  30321. <dd><p>Current metadata key value.
  30322. </p></dd>
  30323. </dl>
  30324. <p>The color is defined as 0xAABBGGRR.
  30325. </p></dd>
  30326. </dl>
  30327. <p>Example using metadata from <a href="#signalstats">signalstats</a> filter:
  30328. </p><div class="example">
  30329. <pre class="example">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  30330. </pre></div>
  30331. <p>Example using metadata from <a href="#ebur128">ebur128</a> filter:
  30332. </p><div class="example">
  30333. <pre class="example">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  30334. </pre></div>
  30335. <a name="drawgrid"></a>
  30336. <h2 class="section"><a href="ffmpeg-all.html#toc-drawgrid">39.59 drawgrid</a></h2>
  30337. <p>Draw a grid on the input image.
  30338. </p>
  30339. <p>It accepts the following parameters:
  30340. </p>
  30341. <dl compact="compact">
  30342. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30343. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30344. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  30345. </p>
  30346. </dd>
  30347. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  30348. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  30349. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  30350. input width and height, respectively, minus <code>thickness</code>, so image gets
  30351. framed. Default to 0.
  30352. </p>
  30353. </dd>
  30354. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  30355. <dd><p>Specify the color of the grid. For the general syntax of this option,
  30356. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  30357. value <code>invert</code> is used, the grid color is the same as the
  30358. video with inverted luma.
  30359. </p>
  30360. </dd>
  30361. <dt>&lsquo;<samp>thickness, t</samp>&rsquo;</dt>
  30362. <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
  30363. </p>
  30364. <p>See below for the list of accepted constants.
  30365. </p>
  30366. </dd>
  30367. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  30368. <dd><p>Applicable if the input has alpha. With <code>1</code> the pixels of the painted grid
  30369. will overwrite the video&rsquo;s color and alpha pixels.
  30370. Default is <code>0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  30371. </p></dd>
  30372. </dl>
  30373. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  30374. following constants:
  30375. </p>
  30376. <dl compact="compact">
  30377. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  30378. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  30379. </p>
  30380. </dd>
  30381. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  30382. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  30383. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30384. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30385. </p>
  30386. </dd>
  30387. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  30388. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  30389. <dd><p>The input grid cell width and height.
  30390. </p>
  30391. </dd>
  30392. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  30393. <dd><p>The input sample aspect ratio.
  30394. </p>
  30395. </dd>
  30396. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30397. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30398. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  30399. </p>
  30400. </dd>
  30401. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  30402. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  30403. <dd><p>The width and height of the drawn cell.
  30404. </p>
  30405. </dd>
  30406. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  30407. <dd><p>The thickness of the drawn cell.
  30408. </p>
  30409. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  30410. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  30411. </p>
  30412. </dd>
  30413. </dl>
  30414. <a name="Examples-78"></a>
  30415. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-78">39.59.1 Examples</a></h3>
  30416. <ul>
  30417. <li>
  30418. Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  30419. <div class="example">
  30420. <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  30421. </pre></div>
  30422. </li><li>
  30423. Draw a white 3x3 grid with an opacity of 50%:
  30424. <div class="example">
  30425. <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  30426. </pre></div>
  30427. </li></ul>
  30428. <a name="Commands-18"></a>
  30429. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-18">39.59.2 Commands</a></h3>
  30430. <p>This filter supports same commands as options.
  30431. The command accepts the same syntax of the corresponding option.
  30432. </p>
  30433. <p>If the specified expression is not valid, it is kept at its current
  30434. value.
  30435. </p>
  30436. <p><a name="drawtext"></a>
  30437. </p><a name="drawtext-1"></a>
  30438. <h2 class="section"><a href="ffmpeg-all.html#toc-drawtext-1">39.60 drawtext</a></h2>
  30439. <p>Draw a text string or text from a specified file on top of a video, using the
  30440. libfreetype library.
  30441. </p>
  30442. <p>To enable compilation of this filter, you need to configure FFmpeg with
  30443. <code>--enable-libfreetype</code>.
  30444. To enable default font fallback and the <var>font</var> option you need to
  30445. configure FFmpeg with <code>--enable-libfontconfig</code>.
  30446. To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
  30447. <code>--enable-libfribidi</code>.
  30448. </p>
  30449. <a name="Syntax"></a>
  30450. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Syntax">39.60.1 Syntax</a></h3>
  30451. <p>It accepts the following parameters:
  30452. </p>
  30453. <dl compact="compact">
  30454. <dt>&lsquo;<samp>box</samp>&rsquo;</dt>
  30455. <dd><p>Used to draw a box around text using the background color.
  30456. The value must be either 1 (enable) or 0 (disable).
  30457. The default value of <var>box</var> is 0.
  30458. </p>
  30459. </dd>
  30460. <dt>&lsquo;<samp>boxborderw</samp>&rsquo;</dt>
  30461. <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
  30462. The default value of <var>boxborderw</var> is 0.
  30463. </p>
  30464. </dd>
  30465. <dt>&lsquo;<samp>boxcolor</samp>&rsquo;</dt>
  30466. <dd><p>The color to be used for drawing box around text. For the syntax of this
  30467. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30468. </p>
  30469. <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
  30470. </p>
  30471. </dd>
  30472. <dt>&lsquo;<samp>line_spacing</samp>&rsquo;</dt>
  30473. <dd><p>Set the line spacing in pixels of the border to be drawn around the box using <var>box</var>.
  30474. The default value of <var>line_spacing</var> is 0.
  30475. </p>
  30476. </dd>
  30477. <dt>&lsquo;<samp>borderw</samp>&rsquo;</dt>
  30478. <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
  30479. The default value of <var>borderw</var> is 0.
  30480. </p>
  30481. </dd>
  30482. <dt>&lsquo;<samp>bordercolor</samp>&rsquo;</dt>
  30483. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  30484. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30485. </p>
  30486. <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
  30487. </p>
  30488. </dd>
  30489. <dt>&lsquo;<samp>expansion</samp>&rsquo;</dt>
  30490. <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
  30491. <code>strftime</code> (deprecated) or
  30492. <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
  30493. below for details.
  30494. </p>
  30495. </dd>
  30496. <dt>&lsquo;<samp>basetime</samp>&rsquo;</dt>
  30497. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  30498. in the deprecated strftime expansion mode. To emulate in normal expansion
  30499. mode use the <code>pts</code> function, supplying the start time (in seconds)
  30500. as the second argument.
  30501. </p>
  30502. </dd>
  30503. <dt>&lsquo;<samp>fix_bounds</samp>&rsquo;</dt>
  30504. <dd><p>If true, check and fix text coords to avoid clipping.
  30505. </p>
  30506. </dd>
  30507. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  30508. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  30509. the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30510. </p>
  30511. <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
  30512. </p>
  30513. </dd>
  30514. <dt>&lsquo;<samp>fontcolor_expr</samp>&rsquo;</dt>
  30515. <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
  30516. <var>fontcolor</var> value. By default this option has empty value and is not
  30517. processed. When this option is set, it overrides <var>fontcolor</var> option.
  30518. </p>
  30519. </dd>
  30520. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  30521. <dd><p>The font family to be used for drawing text. By default Sans.
  30522. </p>
  30523. </dd>
  30524. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  30525. <dd><p>The font file to be used for drawing text. The path must be included.
  30526. This parameter is mandatory if the fontconfig support is disabled.
  30527. </p>
  30528. </dd>
  30529. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  30530. <dd><p>Draw the text applying alpha blending. The value can
  30531. be a number between 0.0 and 1.0.
  30532. The expression accepts the same variables <var>x, y</var> as well.
  30533. The default value is 1.
  30534. Please see <var>fontcolor_expr</var>.
  30535. </p>
  30536. </dd>
  30537. <dt>&lsquo;<samp>fontsize</samp>&rsquo;</dt>
  30538. <dd><p>The font size to be used for drawing text.
  30539. The default value of <var>fontsize</var> is 16.
  30540. </p>
  30541. </dd>
  30542. <dt>&lsquo;<samp>text_shaping</samp>&rsquo;</dt>
  30543. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  30544. right-to-left text and join Arabic characters) before drawing it.
  30545. Otherwise, just draw the text exactly as given.
  30546. By default 1 (if supported).
  30547. </p>
  30548. </dd>
  30549. <dt>&lsquo;<samp>ft_load_flags</samp>&rsquo;</dt>
  30550. <dd><p>The flags to be used for loading the fonts.
  30551. </p>
  30552. <p>The flags map the corresponding flags supported by libfreetype, and are
  30553. a combination of the following values:
  30554. </p><dl compact="compact">
  30555. <dt><var>default</var></dt>
  30556. <dt><var>no_scale</var></dt>
  30557. <dt><var>no_hinting</var></dt>
  30558. <dt><var>render</var></dt>
  30559. <dt><var>no_bitmap</var></dt>
  30560. <dt><var>vertical_layout</var></dt>
  30561. <dt><var>force_autohint</var></dt>
  30562. <dt><var>crop_bitmap</var></dt>
  30563. <dt><var>pedantic</var></dt>
  30564. <dt><var>ignore_global_advance_width</var></dt>
  30565. <dt><var>no_recurse</var></dt>
  30566. <dt><var>ignore_transform</var></dt>
  30567. <dt><var>monochrome</var></dt>
  30568. <dt><var>linear_design</var></dt>
  30569. <dt><var>no_autohint</var></dt>
  30570. </dl>
  30571. <p>Default value is &quot;default&quot;.
  30572. </p>
  30573. <p>For more information consult the documentation for the FT_LOAD_*
  30574. libfreetype flags.
  30575. </p>
  30576. </dd>
  30577. <dt>&lsquo;<samp>shadowcolor</samp>&rsquo;</dt>
  30578. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  30579. syntax of this option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  30580. </p>
  30581. <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
  30582. </p>
  30583. </dd>
  30584. <dt>&lsquo;<samp>shadowx</samp>&rsquo;</dt>
  30585. <dt>&lsquo;<samp>shadowy</samp>&rsquo;</dt>
  30586. <dd><p>The x and y offsets for the text shadow position with respect to the
  30587. position of the text. They can be either positive or negative
  30588. values. The default value for both is &quot;0&quot;.
  30589. </p>
  30590. </dd>
  30591. <dt>&lsquo;<samp>start_number</samp>&rsquo;</dt>
  30592. <dd><p>The starting frame number for the n/frame_num variable. The default value
  30593. is &quot;0&quot;.
  30594. </p>
  30595. </dd>
  30596. <dt>&lsquo;<samp>tabsize</samp>&rsquo;</dt>
  30597. <dd><p>The size in number of spaces to use for rendering the tab.
  30598. Default value is 4.
  30599. </p>
  30600. </dd>
  30601. <dt>&lsquo;<samp>timecode</samp>&rsquo;</dt>
  30602. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  30603. format. It can be used with or without text parameter. <var>timecode_rate</var>
  30604. option must be specified.
  30605. </p>
  30606. </dd>
  30607. <dt>&lsquo;<samp>timecode_rate, rate, r</samp>&rsquo;</dt>
  30608. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  30609. integer. Minimum value is &quot;1&quot;.
  30610. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  30611. </p>
  30612. </dd>
  30613. <dt>&lsquo;<samp>tc24hmax</samp>&rsquo;</dt>
  30614. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  30615. Default is 0 (disabled).
  30616. </p>
  30617. </dd>
  30618. <dt>&lsquo;<samp>text</samp>&rsquo;</dt>
  30619. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  30620. encoded characters.
  30621. This parameter is mandatory if no file is specified with the parameter
  30622. <var>textfile</var>.
  30623. </p>
  30624. </dd>
  30625. <dt>&lsquo;<samp>textfile</samp>&rsquo;</dt>
  30626. <dd><p>A text file containing text to be drawn. The text must be a sequence
  30627. of UTF-8 encoded characters.
  30628. </p>
  30629. <p>This parameter is mandatory if no text string is specified with the
  30630. parameter <var>text</var>.
  30631. </p>
  30632. <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
  30633. </p>
  30634. </dd>
  30635. <dt>&lsquo;<samp>reload</samp>&rsquo;</dt>
  30636. <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
  30637. Be sure to update it atomically, or it may be read partially, or even fail.
  30638. </p>
  30639. </dd>
  30640. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30641. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30642. <dd><p>The expressions which specify the offsets where text will be drawn
  30643. within the video frame. They are relative to the top/left border of the
  30644. output image.
  30645. </p>
  30646. <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
  30647. </p>
  30648. <p>See below for the list of accepted constants and functions.
  30649. </p></dd>
  30650. </dl>
  30651. <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
  30652. following constants and functions:
  30653. </p>
  30654. <dl compact="compact">
  30655. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  30656. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  30657. </p>
  30658. </dd>
  30659. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  30660. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  30661. <dd><p>horizontal and vertical chroma subsample values. For example for the
  30662. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  30663. </p>
  30664. </dd>
  30665. <dt>&lsquo;<samp>line_h, lh</samp>&rsquo;</dt>
  30666. <dd><p>the height of each text line
  30667. </p>
  30668. </dd>
  30669. <dt>&lsquo;<samp>main_h, h, H</samp>&rsquo;</dt>
  30670. <dd><p>the input height
  30671. </p>
  30672. </dd>
  30673. <dt>&lsquo;<samp>main_w, w, W</samp>&rsquo;</dt>
  30674. <dd><p>the input width
  30675. </p>
  30676. </dd>
  30677. <dt>&lsquo;<samp>max_glyph_a, ascent</samp>&rsquo;</dt>
  30678. <dd><p>the maximum distance from the baseline to the highest/upper grid
  30679. coordinate used to place a glyph outline point, for all the rendered
  30680. glyphs.
  30681. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  30682. upwards.
  30683. </p>
  30684. </dd>
  30685. <dt>&lsquo;<samp>max_glyph_d, descent</samp>&rsquo;</dt>
  30686. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  30687. used to place a glyph outline point, for all the rendered glyphs.
  30688. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  30689. upwards.
  30690. </p>
  30691. </dd>
  30692. <dt>&lsquo;<samp>max_glyph_h</samp>&rsquo;</dt>
  30693. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  30694. contained in the rendered text, it is equivalent to <var>ascent</var> -
  30695. <var>descent</var>.
  30696. </p>
  30697. </dd>
  30698. <dt>&lsquo;<samp>max_glyph_w</samp>&rsquo;</dt>
  30699. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  30700. contained in the rendered text
  30701. </p>
  30702. </dd>
  30703. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  30704. <dd><p>the number of input frame, starting from 0
  30705. </p>
  30706. </dd>
  30707. <dt>&lsquo;<samp>rand(min, max)</samp>&rsquo;</dt>
  30708. <dd><p>return a random number included between <var>min</var> and <var>max</var>
  30709. </p>
  30710. </dd>
  30711. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  30712. <dd><p>The input sample aspect ratio.
  30713. </p>
  30714. </dd>
  30715. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  30716. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  30717. </p>
  30718. </dd>
  30719. <dt>&lsquo;<samp>text_h, th</samp>&rsquo;</dt>
  30720. <dd><p>the height of the rendered text
  30721. </p>
  30722. </dd>
  30723. <dt>&lsquo;<samp>text_w, tw</samp>&rsquo;</dt>
  30724. <dd><p>the width of the rendered text
  30725. </p>
  30726. </dd>
  30727. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  30728. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  30729. <dd><p>the x and y offset coordinates where the text is drawn.
  30730. </p>
  30731. <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
  30732. to each other, so you can for example specify <code>y=x/dar</code>.
  30733. </p>
  30734. </dd>
  30735. <dt>&lsquo;<samp>pict_type</samp>&rsquo;</dt>
  30736. <dd><p>A one character description of the current frame&rsquo;s picture type.
  30737. </p>
  30738. </dd>
  30739. <dt>&lsquo;<samp>pkt_pos</samp>&rsquo;</dt>
  30740. <dd><p>The current packet&rsquo;s position in the input file or stream
  30741. (in bytes, from the start of the input). A value of -1 indicates
  30742. this info is not available.
  30743. </p>
  30744. </dd>
  30745. <dt>&lsquo;<samp>pkt_duration</samp>&rsquo;</dt>
  30746. <dd><p>The current packet&rsquo;s duration, in seconds.
  30747. </p>
  30748. </dd>
  30749. <dt>&lsquo;<samp>pkt_size</samp>&rsquo;</dt>
  30750. <dd><p>The current packet&rsquo;s size (in bytes).
  30751. </p></dd>
  30752. </dl>
  30753. <p><a name="drawtext_005fexpansion"></a>
  30754. </p><a name="Text-expansion"></a>
  30755. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Text-expansion">39.60.2 Text expansion</a></h3>
  30756. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>strftime</code>,
  30757. the filter recognizes strftime() sequences in the provided text and
  30758. expands them accordingly. Check the documentation of strftime(). This
  30759. feature is deprecated.
  30760. </p>
  30761. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>none</code>, the text is printed verbatim.
  30762. </p>
  30763. <p>If &lsquo;<samp>expansion</samp>&rsquo; is set to <code>normal</code> (which is the default),
  30764. the following expansion mechanism is used.
  30765. </p>
  30766. <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
  30767. the second character.
  30768. </p>
  30769. <p>Sequences of the form <code>%{...}</code> are expanded. The text between the
  30770. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  30771. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  30772. they should be escaped.
  30773. </p>
  30774. <p>Note that they probably must also be escaped as the value for the
  30775. &lsquo;<samp>text</samp>&rsquo; option in the filter argument string and as the filter
  30776. argument in the filtergraph description, and possibly also for the shell,
  30777. that makes up to four levels of escaping; using a text file avoids these
  30778. problems.
  30779. </p>
  30780. <p>The following functions are available:
  30781. </p>
  30782. <dl compact="compact">
  30783. <dt><code>expr, e</code></dt>
  30784. <dd><p>The expression evaluation result.
  30785. </p>
  30786. <p>It must take one argument specifying the expression to be evaluated,
  30787. which accepts the same constants and functions as the <var>x</var> and
  30788. <var>y</var> values. Note that not all constants should be used, for
  30789. example the text size is not known when evaluating the expression, so
  30790. the constants <var>text_w</var> and <var>text_h</var> will have an undefined
  30791. value.
  30792. </p>
  30793. </dd>
  30794. <dt><code>expr_int_format, eif</code></dt>
  30795. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  30796. </p>
  30797. <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
  30798. The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
  30799. &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
  30800. <code>printf</code> function.
  30801. The third parameter is optional and sets the number of positions taken by the output.
  30802. It can be used to add padding with zeros from the left.
  30803. </p>
  30804. </dd>
  30805. <dt><code>gmtime</code></dt>
  30806. <dd><p>The time at which the filter is running, expressed in UTC.
  30807. It can accept an argument: a strftime() format string.
  30808. </p>
  30809. </dd>
  30810. <dt><code>localtime</code></dt>
  30811. <dd><p>The time at which the filter is running, expressed in the local time zone.
  30812. It can accept an argument: a strftime() format string.
  30813. </p>
  30814. </dd>
  30815. <dt><code>metadata</code></dt>
  30816. <dd><p>Frame metadata. Takes one or two arguments.
  30817. </p>
  30818. <p>The first argument is mandatory and specifies the metadata key.
  30819. </p>
  30820. <p>The second argument is optional and specifies a default value, used when the
  30821. metadata key is not found or empty.
  30822. </p>
  30823. <p>Available metadata can be identified by inspecting entries
  30824. starting with TAG included within each frame section
  30825. printed by running <code>ffprobe -show_frames</code>.
  30826. </p>
  30827. <p>String metadata generated in filters leading to
  30828. the drawtext filter are also available.
  30829. </p>
  30830. </dd>
  30831. <dt><code>n, frame_num</code></dt>
  30832. <dd><p>The frame number, starting from 0.
  30833. </p>
  30834. </dd>
  30835. <dt><code>pict_type</code></dt>
  30836. <dd><p>A one character description of the current picture type.
  30837. </p>
  30838. </dd>
  30839. <dt><code>pts</code></dt>
  30840. <dd><p>The timestamp of the current frame.
  30841. It can take up to three arguments.
  30842. </p>
  30843. <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
  30844. for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
  30845. for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  30846. <code>gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  30847. <code>localtime</code> stands for the timestamp of the frame formatted as
  30848. local time zone time.
  30849. </p>
  30850. <p>The second argument is an offset added to the timestamp.
  30851. </p>
  30852. <p>If the format is set to <code>hms</code>, a third argument <code>24HH</code> may be
  30853. supplied to present the hour part of the formatted timestamp in 24h format
  30854. (00-23).
  30855. </p>
  30856. <p>If the format is set to <code>localtime</code> or <code>gmtime</code>,
  30857. a third argument may be supplied: a strftime() format string.
  30858. By default, <var>YYYY-MM-DD HH:MM:SS</var> format will be used.
  30859. </p></dd>
  30860. </dl>
  30861. <a name="Commands-31"></a>
  30862. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-31">39.60.3 Commands</a></h3>
  30863. <p>This filter supports altering parameters via commands:
  30864. </p><dl compact="compact">
  30865. <dt>&lsquo;<samp>reinit</samp>&rsquo;</dt>
  30866. <dd><p>Alter existing filter parameters.
  30867. </p>
  30868. <p>Syntax for the argument is the same as for filter invocation, e.g.
  30869. </p>
  30870. <div class="example">
  30871. <pre class="example">fontsize=56:fontcolor=green:text='Hello World'
  30872. </pre></div>
  30873. <p>Full filter invocation with sendcmd would look like this:
  30874. </p>
  30875. <div class="example">
  30876. <pre class="example">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  30877. </pre></div>
  30878. </dd>
  30879. </dl>
  30880. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  30881. continue with its existing parameters.
  30882. </p>
  30883. <a name="Examples-3"></a>
  30884. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-3">39.60.4 Examples</a></h3>
  30885. <ul>
  30886. <li>
  30887. Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  30888. optional parameters.
  30889. <div class="example">
  30890. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  30891. </pre></div>
  30892. </li><li>
  30893. Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  30894. and y=50 (counting from the top-left corner of the screen), text is
  30895. yellow with a red box around it. Both the text and the box have an
  30896. opacity of 20%.
  30897. <div class="example">
  30898. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  30899. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  30900. </pre></div>
  30901. <p>Note that the double quotes are not necessary if spaces are not used
  30902. within the parameter list.
  30903. </p>
  30904. </li><li>
  30905. Show the text at the center of the video frame:
  30906. <div class="example">
  30907. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  30908. </pre></div>
  30909. </li><li>
  30910. Show the text at a random position, switching to a new position every 30 seconds:
  30911. <div class="example">
  30912. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)&quot;
  30913. </pre></div>
  30914. </li><li>
  30915. Show a text line sliding from right to left in the last row of the video
  30916. frame. The file &lsquo;<tt>LONG_LINE</tt>&rsquo; is assumed to contain a single line
  30917. with no newlines.
  30918. <div class="example">
  30919. <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  30920. </pre></div>
  30921. </li><li>
  30922. Show the content of file &lsquo;<tt>CREDITS</tt>&rsquo; off the bottom of the frame and scroll up.
  30923. <div class="example">
  30924. <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  30925. </pre></div>
  30926. </li><li>
  30927. Draw a single green letter &quot;g&quot;, at the center of the input video.
  30928. The glyph baseline is placed at half screen height.
  30929. <div class="example">
  30930. <pre class="example">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
  30931. </pre></div>
  30932. </li><li>
  30933. Show text for 1 second every 3 seconds:
  30934. <div class="example">
  30935. <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  30936. </pre></div>
  30937. </li><li>
  30938. Use fontconfig to set the font. Note that the colons need to be escaped.
  30939. <div class="example">
  30940. <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
  30941. </pre></div>
  30942. </li><li>
  30943. Print the date of a real-time encoding (see strftime(3)):
  30944. <div class="example">
  30945. <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  30946. </pre></div>
  30947. </li><li>
  30948. Show text fading in and out (appearing/disappearing):
  30949. <div class="example">
  30950. <pre class="example">#!/bin/sh
  30951. DS=1.0 # display start
  30952. DE=10.0 # display end
  30953. FID=1.5 # fade in duration
  30954. FOD=5 # fade out duration
  30955. ffplay -f lavfi &quot;color,drawtext=text=TEST:fontsize=50:fontfile=FreeSerif.ttf:fontcolor_expr=ff0000%{eif\\\\: clip(255*(1*between(t\\, $DS + $FID\\, $DE - $FOD) + ((t - $DS)/$FID)*between(t\\, $DS\\, $DS + $FID) + (-(t - $DE)/$FOD)*between(t\\, $DE - $FOD\\, $DE) )\\, 0\\, 255) \\\\: x\\\\: 2 }&quot;
  30956. </pre></div>
  30957. </li><li>
  30958. Horizontally align multiple separate texts. Note that &lsquo;<samp>max_glyph_a</samp>&rsquo;
  30959. and the &lsquo;<samp>fontsize</samp>&rsquo; value are included in the &lsquo;<samp>y</samp>&rsquo; offset.
  30960. <div class="example">
  30961. <pre class="example">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  30962. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  30963. </pre></div>
  30964. </li><li>
  30965. Plot special <var>lavf.image2dec.source_basename</var> metadata onto each frame if
  30966. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  30967. must have option &lsquo;<samp>-export_path_metadata 1</samp>&rsquo; for the special metadata fields
  30968. to be available for filters.
  30969. <div class="example">
  30970. <pre class="example">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  30971. </pre></div>
  30972. </li></ul>
  30973. <p>For more information about libfreetype, check:
  30974. <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
  30975. </p>
  30976. <p>For more information about fontconfig, check:
  30977. <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  30978. </p>
  30979. <p>For more information about libfribidi, check:
  30980. <a href="http://fribidi.org/">http://fribidi.org/</a>.
  30981. </p>
  30982. <a name="edgedetect"></a>
  30983. <h2 class="section"><a href="ffmpeg-all.html#toc-edgedetect">39.61 edgedetect</a></h2>
  30984. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  30985. </p>
  30986. <p>The filter accepts the following options:
  30987. </p>
  30988. <dl compact="compact">
  30989. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  30990. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  30991. <dd><p>Set low and high threshold values used by the Canny thresholding
  30992. algorithm.
  30993. </p>
  30994. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  30995. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  30996. by the low threshold.
  30997. </p>
  30998. <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
  30999. [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
  31000. </p>
  31001. <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
  31002. is <code>50/255</code>.
  31003. </p>
  31004. </dd>
  31005. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31006. <dd><p>Define the drawing mode.
  31007. </p>
  31008. <dl compact="compact">
  31009. <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
  31010. <dd><p>Draw white/gray wires on black background.
  31011. </p>
  31012. </dd>
  31013. <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
  31014. <dd><p>Mix the colors to create a paint/cartoon effect.
  31015. </p>
  31016. </dd>
  31017. <dt>&lsquo;<samp>canny</samp>&rsquo;</dt>
  31018. <dd><p>Apply Canny edge detector on all selected planes.
  31019. </p></dd>
  31020. </dl>
  31021. <p>Default value is <var>wires</var>.
  31022. </p>
  31023. </dd>
  31024. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31025. <dd><p>Select planes for filtering. By default all available planes are filtered.
  31026. </p></dd>
  31027. </dl>
  31028. <a name="Examples-172"></a>
  31029. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-172">39.61.1 Examples</a></h3>
  31030. <ul>
  31031. <li>
  31032. Standard edge detection with custom values for the hysteresis thresholding:
  31033. <div class="example">
  31034. <pre class="example">edgedetect=low=0.1:high=0.4
  31035. </pre></div>
  31036. </li><li>
  31037. Painting effect without thresholding:
  31038. <div class="example">
  31039. <pre class="example">edgedetect=mode=colormix:high=0
  31040. </pre></div>
  31041. </li></ul>
  31042. <a name="elbg"></a>
  31043. <h2 class="section"><a href="ffmpeg-all.html#toc-elbg">39.62 elbg</a></h2>
  31044. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  31045. </p>
  31046. <p>For each input image, the filter will compute the optimal mapping from
  31047. the input to the output given the codebook length, that is the number
  31048. of distinct output colors.
  31049. </p>
  31050. <p>This filter accepts the following options.
  31051. </p>
  31052. <dl compact="compact">
  31053. <dt>&lsquo;<samp>codebook_length, l</samp>&rsquo;</dt>
  31054. <dd><p>Set codebook length. The value must be a positive integer, and
  31055. represents the number of distinct output colors. Default value is 256.
  31056. </p>
  31057. </dd>
  31058. <dt>&lsquo;<samp>nb_steps, n</samp>&rsquo;</dt>
  31059. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  31060. mapping. The higher the value the better the result and the higher the
  31061. computation time. Default value is 1.
  31062. </p>
  31063. </dd>
  31064. <dt>&lsquo;<samp>seed, s</samp>&rsquo;</dt>
  31065. <dd><p>Set a random seed, must be an integer included between 0 and
  31066. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  31067. will try to use a good random seed on a best effort basis.
  31068. </p>
  31069. </dd>
  31070. <dt>&lsquo;<samp>pal8</samp>&rsquo;</dt>
  31071. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  31072. length greater than 256.
  31073. </p></dd>
  31074. </dl>
  31075. <a name="entropy"></a>
  31076. <h2 class="section"><a href="ffmpeg-all.html#toc-entropy">39.63 entropy</a></h2>
  31077. <p>Measure graylevel entropy in histogram of color channels of video frames.
  31078. </p>
  31079. <p>It accepts the following parameters:
  31080. </p>
  31081. <dl compact="compact">
  31082. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31083. <dd><p>Can be either <var>normal</var> or <var>diff</var>. Default is <var>normal</var>.
  31084. </p>
  31085. <p><var>diff</var> mode measures entropy of histogram delta values, absolute differences
  31086. between neighbour histogram values.
  31087. </p></dd>
  31088. </dl>
  31089. <a name="eq"></a>
  31090. <h2 class="section"><a href="ffmpeg-all.html#toc-eq">39.64 eq</a></h2>
  31091. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  31092. </p>
  31093. <p>The filter accepts the following options:
  31094. </p>
  31095. <dl compact="compact">
  31096. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  31097. <dd><p>Set the contrast expression. The value must be a float value in range
  31098. <code>-1000.0</code> to <code>1000.0</code>. The default value is &quot;1&quot;.
  31099. </p>
  31100. </dd>
  31101. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  31102. <dd><p>Set the brightness expression. The value must be a float value in
  31103. range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
  31104. </p>
  31105. </dd>
  31106. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  31107. <dd><p>Set the saturation expression. The value must be a float in
  31108. range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
  31109. </p>
  31110. </dd>
  31111. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  31112. <dd><p>Set the gamma expression. The value must be a float in range
  31113. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31114. </p>
  31115. </dd>
  31116. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  31117. <dd><p>Set the gamma expression for red. The value must be a float in
  31118. range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31119. </p>
  31120. </dd>
  31121. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  31122. <dd><p>Set the gamma expression for green. The value must be a float in range
  31123. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31124. </p>
  31125. </dd>
  31126. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  31127. <dd><p>Set the gamma expression for blue. The value must be a float in range
  31128. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  31129. </p>
  31130. </dd>
  31131. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  31132. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  31133. of a high gamma value on bright image areas, e.g. keep them from
  31134. getting overamplified and just plain white. The value must be a float
  31135. in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
  31136. gamma correction all the way down while <code>1.0</code> leaves it at its
  31137. full strength. Default is &quot;1&quot;.
  31138. </p>
  31139. </dd>
  31140. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  31141. <dd><p>Set when the expressions for brightness, contrast, saturation and
  31142. gamma expressions are evaluated.
  31143. </p>
  31144. <p>It accepts the following values:
  31145. </p><dl compact="compact">
  31146. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  31147. <dd><p>only evaluate expressions once during the filter initialization or
  31148. when a command is processed
  31149. </p>
  31150. </dd>
  31151. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  31152. <dd><p>evaluate expressions for each incoming frame
  31153. </p></dd>
  31154. </dl>
  31155. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  31156. </p></dd>
  31157. </dl>
  31158. <p>The expressions accept the following parameters:
  31159. </p><dl compact="compact">
  31160. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  31161. <dd><p>frame count of the input frame starting from 0
  31162. </p>
  31163. </dd>
  31164. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  31165. <dd><p>byte position of the corresponding packet in the input file, NAN if
  31166. unspecified
  31167. </p>
  31168. </dd>
  31169. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  31170. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  31171. </p>
  31172. </dd>
  31173. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  31174. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  31175. </p></dd>
  31176. </dl>
  31177. <a name="Commands-52"></a>
  31178. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-52">39.64.1 Commands</a></h3>
  31179. <p>The filter supports the following commands:
  31180. </p>
  31181. <dl compact="compact">
  31182. <dt>&lsquo;<samp>contrast</samp>&rsquo;</dt>
  31183. <dd><p>Set the contrast expression.
  31184. </p>
  31185. </dd>
  31186. <dt>&lsquo;<samp>brightness</samp>&rsquo;</dt>
  31187. <dd><p>Set the brightness expression.
  31188. </p>
  31189. </dd>
  31190. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  31191. <dd><p>Set the saturation expression.
  31192. </p>
  31193. </dd>
  31194. <dt>&lsquo;<samp>gamma</samp>&rsquo;</dt>
  31195. <dd><p>Set the gamma expression.
  31196. </p>
  31197. </dd>
  31198. <dt>&lsquo;<samp>gamma_r</samp>&rsquo;</dt>
  31199. <dd><p>Set the gamma_r expression.
  31200. </p>
  31201. </dd>
  31202. <dt>&lsquo;<samp>gamma_g</samp>&rsquo;</dt>
  31203. <dd><p>Set gamma_g expression.
  31204. </p>
  31205. </dd>
  31206. <dt>&lsquo;<samp>gamma_b</samp>&rsquo;</dt>
  31207. <dd><p>Set gamma_b expression.
  31208. </p>
  31209. </dd>
  31210. <dt>&lsquo;<samp>gamma_weight</samp>&rsquo;</dt>
  31211. <dd><p>Set gamma_weight expression.
  31212. </p>
  31213. <p>The command accepts the same syntax of the corresponding option.
  31214. </p>
  31215. <p>If the specified expression is not valid, it is kept at its current
  31216. value.
  31217. </p>
  31218. </dd>
  31219. </dl>
  31220. <a name="erosion"></a>
  31221. <h2 class="section"><a href="ffmpeg-all.html#toc-erosion">39.65 erosion</a></h2>
  31222. <p>Apply erosion effect to the video.
  31223. </p>
  31224. <p>This filter replaces the pixel by the local(3x3) minimum.
  31225. </p>
  31226. <p>It accepts the following options:
  31227. </p>
  31228. <dl compact="compact">
  31229. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  31230. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  31231. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  31232. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  31233. <dd><p>Limit the maximum change for each plane, default is 65535.
  31234. If 0, plane will remain unchanged.
  31235. </p>
  31236. </dd>
  31237. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  31238. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  31239. pixels are used.
  31240. </p>
  31241. <p>Flags to local 3x3 coordinates maps like this:
  31242. </p>
  31243. <p> 1 2 3
  31244. 4 5
  31245. 6 7 8
  31246. </p></dd>
  31247. </dl>
  31248. <a name="Commands-64"></a>
  31249. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-64">39.65.1 Commands</a></h3>
  31250. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  31251. </p>
  31252. <a name="extractplanes"></a>
  31253. <h2 class="section"><a href="ffmpeg-all.html#toc-extractplanes">39.66 extractplanes</a></h2>
  31254. <p>Extract color channel components from input video stream into
  31255. separate grayscale video streams.
  31256. </p>
  31257. <p>The filter accepts the following option:
  31258. </p>
  31259. <dl compact="compact">
  31260. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31261. <dd><p>Set plane(s) to extract.
  31262. </p>
  31263. <p>Available values for planes are:
  31264. </p><dl compact="compact">
  31265. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  31266. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  31267. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  31268. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  31269. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  31270. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  31271. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  31272. </dl>
  31273. <p>Choosing planes not available in the input will result in an error.
  31274. That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
  31275. with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
  31276. </p></dd>
  31277. </dl>
  31278. <a name="Examples-133"></a>
  31279. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-133">39.66.1 Examples</a></h3>
  31280. <ul>
  31281. <li>
  31282. Extract luma, u and v color channel component from input video frame
  31283. into 3 grayscale outputs:
  31284. <div class="example">
  31285. <pre class="example">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
  31286. </pre></div>
  31287. </li></ul>
  31288. <a name="fade"></a>
  31289. <h2 class="section"><a href="ffmpeg-all.html#toc-fade">39.67 fade</a></h2>
  31290. <p>Apply a fade-in/out effect to the input video.
  31291. </p>
  31292. <p>It accepts the following parameters:
  31293. </p>
  31294. <dl compact="compact">
  31295. <dt>&lsquo;<samp>type, t</samp>&rsquo;</dt>
  31296. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  31297. effect.
  31298. Default is <code>in</code>.
  31299. </p>
  31300. </dd>
  31301. <dt>&lsquo;<samp>start_frame, s</samp>&rsquo;</dt>
  31302. <dd><p>Specify the number of the frame to start applying the fade
  31303. effect at. Default is 0.
  31304. </p>
  31305. </dd>
  31306. <dt>&lsquo;<samp>nb_frames, n</samp>&rsquo;</dt>
  31307. <dd><p>The number of frames that the fade effect lasts. At the end of the
  31308. fade-in effect, the output video will have the same intensity as the input video.
  31309. At the end of the fade-out transition, the output video will be filled with the
  31310. selected &lsquo;<samp>color</samp>&rsquo;.
  31311. Default is 25.
  31312. </p>
  31313. </dd>
  31314. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  31315. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  31316. Default value is 0.
  31317. </p>
  31318. </dd>
  31319. <dt>&lsquo;<samp>start_time, st</samp>&rsquo;</dt>
  31320. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  31321. effect. If both start_frame and start_time are specified, the fade will start at
  31322. whichever comes last. Default is 0.
  31323. </p>
  31324. </dd>
  31325. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  31326. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  31327. fade-in effect the output video will have the same intensity as the input video,
  31328. at the end of the fade-out transition the output video will be filled with the
  31329. selected &lsquo;<samp>color</samp>&rsquo;.
  31330. If both duration and nb_frames are specified, duration is used. Default is 0
  31331. (nb_frames is used by default).
  31332. </p>
  31333. </dd>
  31334. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  31335. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  31336. </p></dd>
  31337. </dl>
  31338. <a name="Examples-180"></a>
  31339. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-180">39.67.1 Examples</a></h3>
  31340. <ul>
  31341. <li>
  31342. Fade in the first 30 frames of video:
  31343. <div class="example">
  31344. <pre class="example">fade=in:0:30
  31345. </pre></div>
  31346. <p>The command above is equivalent to:
  31347. </p><div class="example">
  31348. <pre class="example">fade=t=in:s=0:n=30
  31349. </pre></div>
  31350. </li><li>
  31351. Fade out the last 45 frames of a 200-frame video:
  31352. <div class="example">
  31353. <pre class="example">fade=out:155:45
  31354. fade=type=out:start_frame=155:nb_frames=45
  31355. </pre></div>
  31356. </li><li>
  31357. Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  31358. <div class="example">
  31359. <pre class="example">fade=in:0:25, fade=out:975:25
  31360. </pre></div>
  31361. </li><li>
  31362. Make the first 5 frames yellow, then fade in from frame 5-24:
  31363. <div class="example">
  31364. <pre class="example">fade=in:5:20:color=yellow
  31365. </pre></div>
  31366. </li><li>
  31367. Fade in alpha over first 25 frames of video:
  31368. <div class="example">
  31369. <pre class="example">fade=in:0:25:alpha=1
  31370. </pre></div>
  31371. </li><li>
  31372. Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  31373. <div class="example">
  31374. <pre class="example">fade=t=in:st=5.5:d=0.5
  31375. </pre></div>
  31376. </li></ul>
  31377. <a name="fftdnoiz"></a>
  31378. <h2 class="section"><a href="ffmpeg-all.html#toc-fftdnoiz">39.68 fftdnoiz</a></h2>
  31379. <p>Denoise frames using 3D FFT (frequency domain filtering).
  31380. </p>
  31381. <p>The filter accepts the following options:
  31382. </p>
  31383. <dl compact="compact">
  31384. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  31385. <dd><p>Set the noise sigma constant. This sets denoising strength.
  31386. Default value is 1. Allowed range is from 0 to 30.
  31387. Using very high sigma with low overlap may give blocking artifacts.
  31388. </p>
  31389. </dd>
  31390. <dt>&lsquo;<samp>amount</samp>&rsquo;</dt>
  31391. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  31392. Default value is 1. Allowed range is from 0 to 1.
  31393. </p>
  31394. </dd>
  31395. <dt>&lsquo;<samp>block</samp>&rsquo;</dt>
  31396. <dd><p>Set size of block, Default is 4, can be 3, 4, 5 or 6.
  31397. Actual size of block in pixels is 2 to power of <var>block</var>, so by default
  31398. block size in pixels is 2^4 which is 16.
  31399. </p>
  31400. </dd>
  31401. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  31402. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  31403. </p>
  31404. </dd>
  31405. <dt>&lsquo;<samp>prev</samp>&rsquo;</dt>
  31406. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  31407. </p>
  31408. </dd>
  31409. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  31410. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  31411. </p>
  31412. </dd>
  31413. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  31414. <dd><p>Set planes which will be filtered, by default are all available filtered
  31415. except alpha.
  31416. </p></dd>
  31417. </dl>
  31418. <a name="fftfilt"></a>
  31419. <h2 class="section"><a href="ffmpeg-all.html#toc-fftfilt">39.69 fftfilt</a></h2>
  31420. <p>Apply arbitrary expressions to samples in frequency domain
  31421. </p>
  31422. <dl compact="compact">
  31423. <dt>&lsquo;<samp>dc_Y</samp>&rsquo;</dt>
  31424. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  31425. accepts an integer value in range <code>0</code> to <code>1000</code>. The default
  31426. value is set to <code>0</code>.
  31427. </p>
  31428. </dd>
  31429. <dt>&lsquo;<samp>dc_U</samp>&rsquo;</dt>
  31430. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  31431. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  31432. default value is set to <code>0</code>.
  31433. </p>
  31434. </dd>
  31435. <dt>&lsquo;<samp>dc_V</samp>&rsquo;</dt>
  31436. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  31437. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  31438. default value is set to <code>0</code>.
  31439. </p>
  31440. </dd>
  31441. <dt>&lsquo;<samp>weight_Y</samp>&rsquo;</dt>
  31442. <dd><p>Set the frequency domain weight expression for the luma plane.
  31443. </p>
  31444. </dd>
  31445. <dt>&lsquo;<samp>weight_U</samp>&rsquo;</dt>
  31446. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  31447. </p>
  31448. </dd>
  31449. <dt>&lsquo;<samp>weight_V</samp>&rsquo;</dt>
  31450. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  31451. </p>
  31452. </dd>
  31453. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  31454. <dd><p>Set when the expressions are evaluated.
  31455. </p>
  31456. <p>It accepts the following values:
  31457. </p><dl compact="compact">
  31458. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  31459. <dd><p>Only evaluate expressions once during the filter initialization.
  31460. </p>
  31461. </dd>
  31462. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  31463. <dd><p>Evaluate expressions for each incoming frame.
  31464. </p></dd>
  31465. </dl>
  31466. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  31467. </p>
  31468. <p>The filter accepts the following variables:
  31469. </p></dd>
  31470. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  31471. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  31472. <dd><p>The coordinates of the current sample.
  31473. </p>
  31474. </dd>
  31475. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  31476. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  31477. <dd><p>The width and height of the image.
  31478. </p>
  31479. </dd>
  31480. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  31481. <dd><p>The number of input frame, starting from 0.
  31482. </p></dd>
  31483. </dl>
  31484. <a name="Examples-45"></a>
  31485. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-45">39.69.1 Examples</a></h3>
  31486. <ul>
  31487. <li>
  31488. High-pass:
  31489. <div class="example">
  31490. <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  31491. </pre></div>
  31492. </li><li>
  31493. Low-pass:
  31494. <div class="example">
  31495. <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  31496. </pre></div>
  31497. </li><li>
  31498. Sharpen:
  31499. <div class="example">
  31500. <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  31501. </pre></div>
  31502. </li><li>
  31503. Blur:
  31504. <div class="example">
  31505. <pre class="example">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  31506. </pre></div>
  31507. </li></ul>
  31508. <a name="field"></a>
  31509. <h2 class="section"><a href="ffmpeg-all.html#toc-field">39.70 field</a></h2>
  31510. <p>Extract a single field from an interlaced image using stride
  31511. arithmetic to avoid wasting CPU time. The output frames are marked as
  31512. non-interlaced.
  31513. </p>
  31514. <p>The filter accepts the following options:
  31515. </p>
  31516. <dl compact="compact">
  31517. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  31518. <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
  31519. <code>top</code>) or the bottom field (if the value is <code>1</code> or
  31520. <code>bottom</code>).
  31521. </p></dd>
  31522. </dl>
  31523. <a name="fieldhint"></a>
  31524. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldhint">39.71 fieldhint</a></h2>
  31525. <p>Create new frames by copying the top and bottom fields from surrounding frames
  31526. supplied as numbers by the hint file.
  31527. </p>
  31528. <dl compact="compact">
  31529. <dt>&lsquo;<samp>hint</samp>&rsquo;</dt>
  31530. <dd><p>Set file containing hints: absolute/relative frame numbers.
  31531. </p>
  31532. <p>There must be one line for each frame in a clip. Each line must contain two
  31533. numbers separated by the comma, optionally followed by <code>-</code> or <code>+</code>.
  31534. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  31535. is current frame number for <code>absolute</code> mode or out of [-1, 1] range
  31536. for <code>relative</code> mode. First number tells from which frame to pick up top
  31537. field and second number tells from which frame to pick up bottom field.
  31538. </p>
  31539. <p>If optionally followed by <code>+</code> output frame will be marked as interlaced,
  31540. else if followed by <code>-</code> output frame will be marked as progressive, else
  31541. it will be marked same as input frame.
  31542. If optionally followed by <code>t</code> output frame will use only top field, or in
  31543. case of <code>b</code> it will use only bottom field.
  31544. If line starts with <code>#</code> or <code>;</code> that line is skipped.
  31545. </p>
  31546. </dd>
  31547. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31548. <dd><p>Can be item <code>absolute</code> or <code>relative</code>. Default is <code>absolute</code>.
  31549. </p></dd>
  31550. </dl>
  31551. <p>Example of first several lines of <code>hint</code> file for <code>relative</code> mode:
  31552. </p><div class="example">
  31553. <pre class="example">0,0 - # first frame
  31554. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  31555. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  31556. 1,0 -
  31557. 0,0 -
  31558. 0,0 -
  31559. 1,0 -
  31560. 1,0 -
  31561. 1,0 -
  31562. 0,0 -
  31563. 0,0 -
  31564. 1,0 -
  31565. 1,0 -
  31566. 1,0 -
  31567. 0,0 -
  31568. </pre></div>
  31569. <a name="fieldmatch"></a>
  31570. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldmatch">39.72 fieldmatch</a></h2>
  31571. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  31572. progressive frames from a telecined stream. The filter does not drop duplicated
  31573. frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
  31574. followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
  31575. </p>
  31576. <p>The separation of the field matching and the decimation is notably motivated by
  31577. the possibility of inserting a de-interlacing filter fallback between the two.
  31578. If the source has mixed telecined and real interlaced content,
  31579. <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
  31580. But these remaining combed frames will be marked as interlaced, and thus can be
  31581. de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
  31582. </p>
  31583. <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
  31584. optional second stream, activated through the &lsquo;<samp>ppsrc</samp>&rsquo; option. If
  31585. enabled, the frames reconstruction will be based on the fields and frames from
  31586. this second stream. This allows the first input to be pre-processed in order to
  31587. help the various algorithms of the filter, while keeping the output lossless
  31588. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  31589. or brightness/contrast adjustments can help.
  31590. </p>
  31591. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  31592. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  31593. which <code>fieldmatch</code> is based on. While the semantic and usage are very
  31594. close, some behaviour and options names can differ.
  31595. </p>
  31596. <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  31597. If your input has mixed telecined (30fps) and progressive content with a lower
  31598. framerate like 24fps use the following filterchain to produce the necessary cfr
  31599. stream: <code>dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  31600. </p>
  31601. <p>The filter accepts the following options:
  31602. </p>
  31603. <dl compact="compact">
  31604. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  31605. <dd><p>Specify the assumed field order of the input stream. Available values are:
  31606. </p>
  31607. <dl compact="compact">
  31608. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  31609. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  31610. </p></dd>
  31611. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  31612. <dd><p>Assume bottom field first.
  31613. </p></dd>
  31614. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  31615. <dd><p>Assume top field first.
  31616. </p></dd>
  31617. </dl>
  31618. <p>Note that it is sometimes recommended not to trust the parity announced by the
  31619. stream.
  31620. </p>
  31621. <p>Default value is <var>auto</var>.
  31622. </p>
  31623. </dd>
  31624. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31625. <dd><p>Set the matching mode or strategy to use. &lsquo;<samp>pc</samp>&rsquo; mode is the safest in the
  31626. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  31627. possible, but if there are bad edits or blended fields it will end up
  31628. outputting combed frames when a good match might actually exist. On the other
  31629. hand, &lsquo;<samp>pcn_ub</samp>&rsquo; mode is the most risky in terms of creating jerkiness,
  31630. but will almost always find a good frame if there is one. The other values are
  31631. all somewhere in between &lsquo;<samp>pc</samp>&rsquo; and &lsquo;<samp>pcn_ub</samp>&rsquo; in terms of risking
  31632. jerkiness and creating duplicate frames versus finding good matches in sections
  31633. with bad edits, orphaned fields, blended fields, etc.
  31634. </p>
  31635. <p>More details about p/c/n/u/b are available in <a href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
  31636. </p>
  31637. <p>Available values are:
  31638. </p>
  31639. <dl compact="compact">
  31640. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  31641. <dd><p>2-way matching (p/c)
  31642. </p></dd>
  31643. <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
  31644. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  31645. </p></dd>
  31646. <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
  31647. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  31648. </p></dd>
  31649. <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
  31650. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  31651. still combed (p/c + n + u/b)
  31652. </p></dd>
  31653. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  31654. <dd><p>3-way matching (p/c/n)
  31655. </p></dd>
  31656. <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
  31657. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  31658. detected as combed (p/c/n + u/b)
  31659. </p></dd>
  31660. </dl>
  31661. <p>The parenthesis at the end indicate the matches that would be used for that
  31662. mode assuming &lsquo;<samp>order</samp>&rsquo;=<var>tff</var> (and &lsquo;<samp>field</samp>&rsquo; on <var>auto</var> or
  31663. <var>top</var>).
  31664. </p>
  31665. <p>In terms of speed &lsquo;<samp>pc</samp>&rsquo; mode is by far the fastest and &lsquo;<samp>pcn_ub</samp>&rsquo; is
  31666. the slowest.
  31667. </p>
  31668. <p>Default value is <var>pc_n</var>.
  31669. </p>
  31670. </dd>
  31671. <dt>&lsquo;<samp>ppsrc</samp>&rsquo;</dt>
  31672. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  31673. input stream as the clean source to pick the fields from. See the filter
  31674. introduction for more details. It is similar to the &lsquo;<samp>clip2</samp>&rsquo; feature from
  31675. VFM/TFM.
  31676. </p>
  31677. <p>Default value is <code>0</code> (disabled).
  31678. </p>
  31679. </dd>
  31680. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  31681. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  31682. &lsquo;<samp>order</samp>&rsquo; unless you experience matching failures with that setting. In
  31683. certain circumstances changing the field that is used to match from can have a
  31684. large impact on matching performance. Available values are:
  31685. </p>
  31686. <dl compact="compact">
  31687. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  31688. <dd><p>Automatic (same value as &lsquo;<samp>order</samp>&rsquo;).
  31689. </p></dd>
  31690. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  31691. <dd><p>Match from the bottom field.
  31692. </p></dd>
  31693. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  31694. <dd><p>Match from the top field.
  31695. </p></dd>
  31696. </dl>
  31697. <p>Default value is <var>auto</var>.
  31698. </p>
  31699. </dd>
  31700. <dt>&lsquo;<samp>mchroma</samp>&rsquo;</dt>
  31701. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  31702. cases it is recommended to leave this enabled. You should set this to <code>0</code>
  31703. only if your clip has bad chroma problems such as heavy rainbowing or other
  31704. artifacts. Setting this to <code>0</code> could also be used to speed things up at
  31705. the cost of some accuracy.
  31706. </p>
  31707. <p>Default value is <code>1</code>.
  31708. </p>
  31709. </dd>
  31710. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  31711. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  31712. <dd><p>These define an exclusion band which excludes the lines between &lsquo;<samp>y0</samp>&rsquo; and
  31713. &lsquo;<samp>y1</samp>&rsquo; from being included in the field matching decision. An exclusion
  31714. band can be used to ignore subtitles, a logo, or other things that may
  31715. interfere with the matching. &lsquo;<samp>y0</samp>&rsquo; sets the starting scan line and
  31716. &lsquo;<samp>y1</samp>&rsquo; sets the ending line; all lines in between &lsquo;<samp>y0</samp>&rsquo; and
  31717. &lsquo;<samp>y1</samp>&rsquo; (including &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo;) will be ignored. Setting
  31718. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; to the same value will disable the feature.
  31719. &lsquo;<samp>y0</samp>&rsquo; and &lsquo;<samp>y1</samp>&rsquo; defaults to <code>0</code>.
  31720. </p>
  31721. </dd>
  31722. <dt>&lsquo;<samp>scthresh</samp>&rsquo;</dt>
  31723. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  31724. the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
  31725. detection is only relevant in case &lsquo;<samp>combmatch</samp>&rsquo;=<var>sc</var>. The range for
  31726. &lsquo;<samp>scthresh</samp>&rsquo; is <code>[0.0, 100.0]</code>.
  31727. </p>
  31728. <p>Default value is <code>12.0</code>.
  31729. </p>
  31730. </dd>
  31731. <dt>&lsquo;<samp>combmatch</samp>&rsquo;</dt>
  31732. <dd><p>When &lsquo;<samp>combatch</samp>&rsquo; is not <var>none</var>, <code>fieldmatch</code> will take into
  31733. account the combed scores of matches when deciding what match to use as the
  31734. final match. Available values are:
  31735. </p>
  31736. <dl compact="compact">
  31737. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  31738. <dd><p>No final matching based on combed scores.
  31739. </p></dd>
  31740. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  31741. <dd><p>Combed scores are only used when a scene change is detected.
  31742. </p></dd>
  31743. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  31744. <dd><p>Use combed scores all the time.
  31745. </p></dd>
  31746. </dl>
  31747. <p>Default is <var>sc</var>.
  31748. </p>
  31749. </dd>
  31750. <dt>&lsquo;<samp>combdbg</samp>&rsquo;</dt>
  31751. <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
  31752. print them. This setting is known as &lsquo;<samp>micout</samp>&rsquo; in TFM/VFM vocabulary.
  31753. Available values are:
  31754. </p>
  31755. <dl compact="compact">
  31756. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  31757. <dd><p>No forced calculation.
  31758. </p></dd>
  31759. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  31760. <dd><p>Force p/c/n calculations.
  31761. </p></dd>
  31762. <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
  31763. <dd><p>Force p/c/n/u/b calculations.
  31764. </p></dd>
  31765. </dl>
  31766. <p>Default value is <var>none</var>.
  31767. </p>
  31768. </dd>
  31769. <dt>&lsquo;<samp>cthresh</samp>&rsquo;</dt>
  31770. <dd><p>This is the area combing threshold used for combed frame detection. This
  31771. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  31772. Larger values mean combing must be more visible and smaller values mean combing
  31773. can be less visible or strong and still be detected. Valid settings are from
  31774. <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
  31775. be detected as combed). This is basically a pixel difference value. A good
  31776. range is <code>[8, 12]</code>.
  31777. </p>
  31778. <p>Default value is <code>9</code>.
  31779. </p>
  31780. </dd>
  31781. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  31782. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  31783. disable this if your source has chroma problems (rainbowing, etc.) that are
  31784. causing problems for the combed frame detection with chroma enabled. Actually,
  31785. using &lsquo;<samp>chroma</samp>&rsquo;=<var>0</var> is usually more reliable, except for the case
  31786. where there is chroma only combing in the source.
  31787. </p>
  31788. <p>Default value is <code>0</code>.
  31789. </p>
  31790. </dd>
  31791. <dt>&lsquo;<samp>blockx</samp>&rsquo;</dt>
  31792. <dt>&lsquo;<samp>blocky</samp>&rsquo;</dt>
  31793. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  31794. frame detection. This has to do with the size of the area in which
  31795. &lsquo;<samp>combpel</samp>&rsquo; pixels are required to be detected as combed for a frame to be
  31796. declared combed. See the &lsquo;<samp>combpel</samp>&rsquo; parameter description for more info.
  31797. Possible values are any number that is a power of 2 starting at 4 and going up
  31798. to 512.
  31799. </p>
  31800. <p>Default value is <code>16</code>.
  31801. </p>
  31802. </dd>
  31803. <dt>&lsquo;<samp>combpel</samp>&rsquo;</dt>
  31804. <dd><p>The number of combed pixels inside any of the &lsquo;<samp>blocky</samp>&rsquo; by
  31805. &lsquo;<samp>blockx</samp>&rsquo; size blocks on the frame for the frame to be detected as
  31806. combed. While &lsquo;<samp>cthresh</samp>&rsquo; controls how &quot;visible&quot; the combing must be, this
  31807. setting controls &quot;how much&quot; combing there must be in any localized area (a
  31808. window defined by the &lsquo;<samp>blockx</samp>&rsquo; and &lsquo;<samp>blocky</samp>&rsquo; settings) on the
  31809. frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
  31810. which point no frames will ever be detected as combed). This setting is known
  31811. as &lsquo;<samp>MI</samp>&rsquo; in TFM/VFM vocabulary.
  31812. </p>
  31813. <p>Default value is <code>80</code>.
  31814. </p></dd>
  31815. </dl>
  31816. <p><a name="p_002fc_002fn_002fu_002fb-meaning"></a>
  31817. </p><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  31818. <h3 class="subsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn_002fu_002fb-meaning-1">39.72.1 p/c/n/u/b meaning</a></h3>
  31819. <a name="p_002fc_002fn"></a>
  31820. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-p_002fc_002fn">39.72.1.1 p/c/n</a></h4>
  31821. <p>We assume the following telecined stream:
  31822. </p>
  31823. <div class="example">
  31824. <pre class="example">Top fields: 1 2 2 3 4
  31825. Bottom fields: 1 2 3 4 4
  31826. </pre></div>
  31827. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  31828. first two frames are progressive, the 3rd and 4th are combed, and so on.
  31829. </p>
  31830. <p>When <code>fieldmatch</code> is configured to run a matching from bottom
  31831. (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>) this is how this input stream get transformed:
  31832. </p>
  31833. <div class="example">
  31834. <pre class="example">Input stream:
  31835. T 1 2 2 3 4
  31836. B 1 2 3 4 4 &lt;-- matching reference
  31837. Matches: c c n n c
  31838. Output stream:
  31839. T 1 2 3 4 4
  31840. B 1 2 3 4 4
  31841. </pre></div>
  31842. <p>As a result of the field matching, we can see that some frames get duplicated.
  31843. To perform a complete inverse telecine, you need to rely on a decimation filter
  31844. after this operation. See for instance the <a href="#decimate">decimate</a> filter.
  31845. </p>
  31846. <p>The same operation now matching from top fields (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>)
  31847. looks like this:
  31848. </p>
  31849. <div class="example">
  31850. <pre class="example">Input stream:
  31851. T 1 2 2 3 4 &lt;-- matching reference
  31852. B 1 2 3 4 4
  31853. Matches: c c p p c
  31854. Output stream:
  31855. T 1 2 2 3 4
  31856. B 1 2 2 3 4
  31857. </pre></div>
  31858. <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
  31859. basically, they refer to the frame and field of the opposite parity:
  31860. </p>
  31861. <ul>
  31862. <li> <var>p</var> matches the field of the opposite parity in the previous frame
  31863. </li><li> <var>c</var> matches the field of the opposite parity in the current frame
  31864. </li><li> <var>n</var> matches the field of the opposite parity in the next frame
  31865. </li></ul>
  31866. <a name="u_002fb"></a>
  31867. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-u_002fb">39.72.1.2 u/b</a></h4>
  31868. <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
  31869. from the opposite parity flag. In the following examples, we assume that we are
  31870. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  31871. &rsquo;x&rsquo; is placed above and below each matched fields.
  31872. </p>
  31873. <p>With bottom matching (&lsquo;<samp>field</samp>&rsquo;=<var>bottom</var>):
  31874. </p><div class="example">
  31875. <pre class="example">Match: c p n b u
  31876. x x x x x
  31877. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  31878. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  31879. x x x x x
  31880. Output frames:
  31881. 2 1 2 2 2
  31882. 2 2 2 1 3
  31883. </pre></div>
  31884. <p>With top matching (&lsquo;<samp>field</samp>&rsquo;=<var>top</var>):
  31885. </p><div class="example">
  31886. <pre class="example">Match: c p n b u
  31887. x x x x x
  31888. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  31889. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  31890. x x x x x
  31891. Output frames:
  31892. 2 2 2 1 2
  31893. 2 1 3 2 2
  31894. </pre></div>
  31895. <a name="Examples-149"></a>
  31896. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-149">39.72.2 Examples</a></h3>
  31897. <p>Simple IVTC of a top field first telecined stream:
  31898. </p><div class="example">
  31899. <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
  31900. </pre></div>
  31901. <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
  31902. </p><div class="example">
  31903. <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  31904. </pre></div>
  31905. <a name="fieldorder"></a>
  31906. <h2 class="section"><a href="ffmpeg-all.html#toc-fieldorder">39.73 fieldorder</a></h2>
  31907. <p>Transform the field order of the input video.
  31908. </p>
  31909. <p>It accepts the following parameters:
  31910. </p>
  31911. <dl compact="compact">
  31912. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  31913. <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
  31914. for bottom field first.
  31915. </p></dd>
  31916. </dl>
  31917. <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
  31918. </p>
  31919. <p>The transformation is done by shifting the picture content up or down
  31920. by one line, and filling the remaining line with appropriate picture content.
  31921. This method is consistent with most broadcast field order converters.
  31922. </p>
  31923. <p>If the input video is not flagged as being interlaced, or it is already
  31924. flagged as being of the required output field order, then this filter does
  31925. not alter the incoming video.
  31926. </p>
  31927. <p>It is very useful when converting to or from PAL DV material,
  31928. which is bottom field first.
  31929. </p>
  31930. <p>For example:
  31931. </p><div class="example">
  31932. <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  31933. </pre></div>
  31934. <a name="fifo_002c-afifo"></a>
  31935. <h2 class="section"><a href="ffmpeg-all.html#toc-fifo_002c-afifo">39.74 fifo, afifo</a></h2>
  31936. <p>Buffer input images and send them when they are requested.
  31937. </p>
  31938. <p>It is mainly useful when auto-inserted by the libavfilter
  31939. framework.
  31940. </p>
  31941. <p>It does not take parameters.
  31942. </p>
  31943. <a name="fillborders"></a>
  31944. <h2 class="section"><a href="ffmpeg-all.html#toc-fillborders">39.75 fillborders</a></h2>
  31945. <p>Fill borders of the input video, without changing video stream dimensions.
  31946. Sometimes video can have garbage at the four edges and you may not want to
  31947. crop video input to keep size multiple of some number.
  31948. </p>
  31949. <p>This filter accepts the following options:
  31950. </p>
  31951. <dl compact="compact">
  31952. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  31953. <dd><p>Number of pixels to fill from left border.
  31954. </p>
  31955. </dd>
  31956. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  31957. <dd><p>Number of pixels to fill from right border.
  31958. </p>
  31959. </dd>
  31960. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  31961. <dd><p>Number of pixels to fill from top border.
  31962. </p>
  31963. </dd>
  31964. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  31965. <dd><p>Number of pixels to fill from bottom border.
  31966. </p>
  31967. </dd>
  31968. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  31969. <dd><p>Set fill mode.
  31970. </p>
  31971. <p>It accepts the following values:
  31972. </p><dl compact="compact">
  31973. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  31974. <dd><p>fill pixels using outermost pixels
  31975. </p>
  31976. </dd>
  31977. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  31978. <dd><p>fill pixels using mirroring
  31979. </p>
  31980. </dd>
  31981. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  31982. <dd><p>fill pixels with constant value
  31983. </p></dd>
  31984. </dl>
  31985. <p>Default is <var>smear</var>.
  31986. </p>
  31987. </dd>
  31988. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  31989. <dd><p>Set color for pixels in fixed mode. Default is <var>black</var>.
  31990. </p></dd>
  31991. </dl>
  31992. <a name="Commands-57"></a>
  31993. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-57">39.75.1 Commands</a></h3>
  31994. <p>This filter supports same <a href="#commands">commands</a> as options.
  31995. The command accepts the same syntax of the corresponding option.
  31996. </p>
  31997. <p>If the specified expression is not valid, it is kept at its current
  31998. value.
  31999. </p>
  32000. <a name="find_005frect"></a>
  32001. <h2 class="section"><a href="ffmpeg-all.html#toc-find_005frect">39.76 find_rect</a></h2>
  32002. <p>Find a rectangular object
  32003. </p>
  32004. <p>It accepts the following options:
  32005. </p>
  32006. <dl compact="compact">
  32007. <dt>&lsquo;<samp>object</samp>&rsquo;</dt>
  32008. <dd><p>Filepath of the object image, needs to be in gray8.
  32009. </p>
  32010. </dd>
  32011. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  32012. <dd><p>Detection threshold, default is 0.5.
  32013. </p>
  32014. </dd>
  32015. <dt>&lsquo;<samp>mipmaps</samp>&rsquo;</dt>
  32016. <dd><p>Number of mipmaps, default is 3.
  32017. </p>
  32018. </dd>
  32019. <dt>&lsquo;<samp>xmin, ymin, xmax, ymax</samp>&rsquo;</dt>
  32020. <dd><p>Specifies the rectangle in which to search.
  32021. </p></dd>
  32022. </dl>
  32023. <a name="Examples-11"></a>
  32024. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-11">39.76.1 Examples</a></h3>
  32025. <ul>
  32026. <li>
  32027. Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  32028. <div class="example">
  32029. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  32030. </pre></div>
  32031. </li></ul>
  32032. <a name="floodfill"></a>
  32033. <h2 class="section"><a href="ffmpeg-all.html#toc-floodfill">39.77 floodfill</a></h2>
  32034. <p>Flood area with values of same pixel components with another values.
  32035. </p>
  32036. <p>It accepts the following options:
  32037. </p><dl compact="compact">
  32038. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  32039. <dd><p>Set pixel x coordinate.
  32040. </p>
  32041. </dd>
  32042. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  32043. <dd><p>Set pixel y coordinate.
  32044. </p>
  32045. </dd>
  32046. <dt>&lsquo;<samp>s0</samp>&rsquo;</dt>
  32047. <dd><p>Set source #0 component value.
  32048. </p>
  32049. </dd>
  32050. <dt>&lsquo;<samp>s1</samp>&rsquo;</dt>
  32051. <dd><p>Set source #1 component value.
  32052. </p>
  32053. </dd>
  32054. <dt>&lsquo;<samp>s2</samp>&rsquo;</dt>
  32055. <dd><p>Set source #2 component value.
  32056. </p>
  32057. </dd>
  32058. <dt>&lsquo;<samp>s3</samp>&rsquo;</dt>
  32059. <dd><p>Set source #3 component value.
  32060. </p>
  32061. </dd>
  32062. <dt>&lsquo;<samp>d0</samp>&rsquo;</dt>
  32063. <dd><p>Set destination #0 component value.
  32064. </p>
  32065. </dd>
  32066. <dt>&lsquo;<samp>d1</samp>&rsquo;</dt>
  32067. <dd><p>Set destination #1 component value.
  32068. </p>
  32069. </dd>
  32070. <dt>&lsquo;<samp>d2</samp>&rsquo;</dt>
  32071. <dd><p>Set destination #2 component value.
  32072. </p>
  32073. </dd>
  32074. <dt>&lsquo;<samp>d3</samp>&rsquo;</dt>
  32075. <dd><p>Set destination #3 component value.
  32076. </p></dd>
  32077. </dl>
  32078. <p><a name="format"></a>
  32079. </p><a name="format-1"></a>
  32080. <h2 class="section"><a href="ffmpeg-all.html#toc-format-1">39.78 format</a></h2>
  32081. <p>Convert the input video to one of the specified pixel formats.
  32082. Libavfilter will try to pick one that is suitable as input to
  32083. the next filter.
  32084. </p>
  32085. <p>It accepts the following parameters:
  32086. </p><dl compact="compact">
  32087. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  32088. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  32089. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  32090. </p>
  32091. </dd>
  32092. </dl>
  32093. <a name="Examples-13"></a>
  32094. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-13">39.78.1 Examples</a></h3>
  32095. <ul>
  32096. <li>
  32097. Convert the input video to the <var>yuv420p</var> format
  32098. <div class="example">
  32099. <pre class="example">format=pix_fmts=yuv420p
  32100. </pre></div>
  32101. <p>Convert the input video to any of the formats in the list
  32102. </p><div class="example">
  32103. <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
  32104. </pre></div>
  32105. </li></ul>
  32106. <p><a name="fps"></a>
  32107. </p><a name="fps-1"></a>
  32108. <h2 class="section"><a href="ffmpeg-all.html#toc-fps-1">39.79 fps</a></h2>
  32109. <p>Convert the video to specified constant frame rate by duplicating or dropping
  32110. frames as necessary.
  32111. </p>
  32112. <p>It accepts the following parameters:
  32113. </p><dl compact="compact">
  32114. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  32115. <dd><p>The desired output frame rate. The default is <code>25</code>.
  32116. </p>
  32117. </dd>
  32118. <dt>&lsquo;<samp>start_time</samp>&rsquo;</dt>
  32119. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  32120. padding/trimming at the start of stream. By default, no assumption is made
  32121. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  32122. For example, this could be set to 0 to pad the beginning with duplicates of
  32123. the first frame if a video stream starts after the audio stream or to trim any
  32124. frames with a negative PTS.
  32125. </p>
  32126. </dd>
  32127. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  32128. <dd><p>Timestamp (PTS) rounding method.
  32129. </p>
  32130. <p>Possible values are:
  32131. </p><dl compact="compact">
  32132. <dt>&lsquo;<samp>zero</samp>&rsquo;</dt>
  32133. <dd><p>round towards 0
  32134. </p></dd>
  32135. <dt>&lsquo;<samp>inf</samp>&rsquo;</dt>
  32136. <dd><p>round away from 0
  32137. </p></dd>
  32138. <dt>&lsquo;<samp>down</samp>&rsquo;</dt>
  32139. <dd><p>round towards -infinity
  32140. </p></dd>
  32141. <dt>&lsquo;<samp>up</samp>&rsquo;</dt>
  32142. <dd><p>round towards +infinity
  32143. </p></dd>
  32144. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  32145. <dd><p>round to nearest
  32146. </p></dd>
  32147. </dl>
  32148. <p>The default is <code>near</code>.
  32149. </p>
  32150. </dd>
  32151. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  32152. <dd><p>Action performed when reading the last frame.
  32153. </p>
  32154. <p>Possible values are:
  32155. </p><dl compact="compact">
  32156. <dt>&lsquo;<samp>round</samp>&rsquo;</dt>
  32157. <dd><p>Use same timestamp rounding method as used for other frames.
  32158. </p></dd>
  32159. <dt>&lsquo;<samp>pass</samp>&rsquo;</dt>
  32160. <dd><p>Pass through last frame if input duration has not been reached yet.
  32161. </p></dd>
  32162. </dl>
  32163. <p>The default is <code>round</code>.
  32164. </p>
  32165. </dd>
  32166. </dl>
  32167. <p>Alternatively, the options can be specified as a flat string:
  32168. <var>fps</var>[:<var>start_time</var>[:<var>round</var>]].
  32169. </p>
  32170. <p>See also the <a href="#setpts">setpts</a> filter.
  32171. </p>
  32172. <a name="Examples-28"></a>
  32173. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-28">39.79.1 Examples</a></h3>
  32174. <ul>
  32175. <li>
  32176. A typical usage in order to set the fps to 25:
  32177. <div class="example">
  32178. <pre class="example">fps=fps=25
  32179. </pre></div>
  32180. </li><li>
  32181. Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  32182. <div class="example">
  32183. <pre class="example">fps=fps=film:round=near
  32184. </pre></div>
  32185. </li></ul>
  32186. <a name="framepack"></a>
  32187. <h2 class="section"><a href="ffmpeg-all.html#toc-framepack">39.80 framepack</a></h2>
  32188. <p>Pack two different video streams into a stereoscopic video, setting proper
  32189. metadata on supported codecs. The two views should have the same size and
  32190. framerate and processing will stop when the shorter video ends. Please note
  32191. that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
  32192. <a href="#fps">fps</a> filters.
  32193. </p>
  32194. <p>It accepts the following parameters:
  32195. </p><dl compact="compact">
  32196. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  32197. <dd><p>The desired packing format. Supported values are:
  32198. </p>
  32199. <dl compact="compact">
  32200. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  32201. <dd><p>The views are next to each other (default).
  32202. </p>
  32203. </dd>
  32204. <dt>&lsquo;<samp>tab</samp>&rsquo;</dt>
  32205. <dd><p>The views are on top of each other.
  32206. </p>
  32207. </dd>
  32208. <dt>&lsquo;<samp>lines</samp>&rsquo;</dt>
  32209. <dd><p>The views are packed by line.
  32210. </p>
  32211. </dd>
  32212. <dt>&lsquo;<samp>columns</samp>&rsquo;</dt>
  32213. <dd><p>The views are packed by column.
  32214. </p>
  32215. </dd>
  32216. <dt>&lsquo;<samp>frameseq</samp>&rsquo;</dt>
  32217. <dd><p>The views are temporally interleaved.
  32218. </p>
  32219. </dd>
  32220. </dl>
  32221. </dd>
  32222. </dl>
  32223. <p>Some examples:
  32224. </p>
  32225. <div class="example">
  32226. <pre class="example"># Convert left and right views into a frame-sequential video
  32227. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  32228. # Convert views into a side-by-side video with the same output resolution as the input
  32229. ffmpeg -i LEFT -i RIGHT -filter_complex [0:v]scale=w=iw/2[left],[1:v]scale=w=iw/2[right],[left][right]framepack=sbs OUTPUT
  32230. </pre></div>
  32231. <a name="framerate"></a>
  32232. <h2 class="section"><a href="ffmpeg-all.html#toc-framerate">39.81 framerate</a></h2>
  32233. <p>Change the frame rate by interpolating new video output frames from the source
  32234. frames.
  32235. </p>
  32236. <p>This filter is not designed to function correctly with interlaced media. If
  32237. you wish to change the frame rate of interlaced media then you are required
  32238. to deinterlace before this filter and re-interlace after this filter.
  32239. </p>
  32240. <p>A description of the accepted options follows.
  32241. </p>
  32242. <dl compact="compact">
  32243. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  32244. <dd><p>Specify the output frames per second. This option can also be specified
  32245. as a value alone. The default is <code>50</code>.
  32246. </p>
  32247. </dd>
  32248. <dt>&lsquo;<samp>interp_start</samp>&rsquo;</dt>
  32249. <dd><p>Specify the start of a range where the output frame will be created as a
  32250. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  32251. the default is <code>15</code>.
  32252. </p>
  32253. </dd>
  32254. <dt>&lsquo;<samp>interp_end</samp>&rsquo;</dt>
  32255. <dd><p>Specify the end of a range where the output frame will be created as a
  32256. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  32257. the default is <code>240</code>.
  32258. </p>
  32259. </dd>
  32260. <dt>&lsquo;<samp>scene</samp>&rsquo;</dt>
  32261. <dd><p>Specify the level at which a scene change is detected as a value between
  32262. 0 and 100 to indicate a new scene; a low value reflects a low
  32263. probability for the current frame to introduce a new scene, while a higher
  32264. value means the current frame is more likely to be one.
  32265. The default is <code>8.2</code>.
  32266. </p>
  32267. </dd>
  32268. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  32269. <dd><p>Specify flags influencing the filter process.
  32270. </p>
  32271. <p>Available value for <var>flags</var> is:
  32272. </p>
  32273. <dl compact="compact">
  32274. <dt>&lsquo;<samp>scene_change_detect, scd</samp>&rsquo;</dt>
  32275. <dd><p>Enable scene change detection using the value of the option <var>scene</var>.
  32276. This flag is enabled by default.
  32277. </p></dd>
  32278. </dl>
  32279. </dd>
  32280. </dl>
  32281. <a name="framestep"></a>
  32282. <h2 class="section"><a href="ffmpeg-all.html#toc-framestep">39.82 framestep</a></h2>
  32283. <p>Select one frame every N-th frame.
  32284. </p>
  32285. <p>This filter accepts the following option:
  32286. </p><dl compact="compact">
  32287. <dt>&lsquo;<samp>step</samp>&rsquo;</dt>
  32288. <dd><p>Select frame after every <code>step</code> frames.
  32289. Allowed values are positive integers higher than 0. Default value is <code>1</code>.
  32290. </p></dd>
  32291. </dl>
  32292. <a name="freezedetect"></a>
  32293. <h2 class="section"><a href="ffmpeg-all.html#toc-freezedetect">39.83 freezedetect</a></h2>
  32294. <p>Detect frozen video.
  32295. </p>
  32296. <p>This filter logs a message and sets frame metadata when it detects that the
  32297. input video has no significant change in content during a specified duration.
  32298. Video freeze detection calculates the mean average absolute difference of all
  32299. the components of video frames and compares it to a noise floor.
  32300. </p>
  32301. <p>The printed times and duration are expressed in seconds. The
  32302. <code>lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  32303. whose timestamp equals or exceeds the detection duration and it contains the
  32304. timestamp of the first frame of the freeze. The
  32305. <code>lavfi.freezedetect.freeze_duration</code> and
  32306. <code>lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  32307. after the freeze.
  32308. </p>
  32309. <p>The filter accepts the following options:
  32310. </p>
  32311. <dl compact="compact">
  32312. <dt>&lsquo;<samp>noise, n</samp>&rsquo;</dt>
  32313. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  32314. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  32315. 0.001.
  32316. </p>
  32317. </dd>
  32318. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  32319. <dd><p>Set freeze duration until notification (default is 2 seconds).
  32320. </p></dd>
  32321. </dl>
  32322. <a name="freezeframes"></a>
  32323. <h2 class="section"><a href="ffmpeg-all.html#toc-freezeframes">39.84 freezeframes</a></h2>
  32324. <p>Freeze video frames.
  32325. </p>
  32326. <p>This filter freezes video frames using frame from 2nd input.
  32327. </p>
  32328. <p>The filter accepts the following options:
  32329. </p>
  32330. <dl compact="compact">
  32331. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  32332. <dd><p>Set number of first frame from which to start freeze.
  32333. </p>
  32334. </dd>
  32335. <dt>&lsquo;<samp>last</samp>&rsquo;</dt>
  32336. <dd><p>Set number of last frame from which to end freeze.
  32337. </p>
  32338. </dd>
  32339. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  32340. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  32341. </p></dd>
  32342. </dl>
  32343. <p><a name="frei0r"></a>
  32344. </p><a name="frei0r-1"></a>
  32345. <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r-1">39.85 frei0r</a></h2>
  32346. <p>Apply a frei0r effect to the input video.
  32347. </p>
  32348. <p>To enable the compilation of this filter, you need to install the frei0r
  32349. header and configure FFmpeg with <code>--enable-frei0r</code>.
  32350. </p>
  32351. <p>It accepts the following parameters:
  32352. </p>
  32353. <dl compact="compact">
  32354. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  32355. <dd><p>The name of the frei0r effect to load. If the environment variable
  32356. <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  32357. directories specified by the colon-separated list in <code>FREI0R_PATH</code>.
  32358. Otherwise, the standard frei0r paths are searched, in this order:
  32359. &lsquo;<tt>HOME/.frei0r-1/lib/</tt>&rsquo;, &lsquo;<tt>/usr/local/lib/frei0r-1/</tt>&rsquo;,
  32360. &lsquo;<tt>/usr/lib/frei0r-1/</tt>&rsquo;.
  32361. </p>
  32362. </dd>
  32363. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  32364. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  32365. </p>
  32366. </dd>
  32367. </dl>
  32368. <p>A frei0r effect parameter can be a boolean (its value is either
  32369. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  32370. <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
  32371. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  32372. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  32373. a position (specified as <var>X</var>/<var>Y</var>, where
  32374. <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
  32375. </p>
  32376. <p>The number and types of parameters depend on the loaded effect. If an
  32377. effect parameter is not specified, the default value is set.
  32378. </p>
  32379. <a name="Examples-102"></a>
  32380. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-102">39.85.1 Examples</a></h3>
  32381. <ul>
  32382. <li>
  32383. Apply the distort0r effect, setting the first two double parameters:
  32384. <div class="example">
  32385. <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  32386. </pre></div>
  32387. </li><li>
  32388. Apply the colordistance effect, taking a color as the first parameter:
  32389. <div class="example">
  32390. <pre class="example">frei0r=colordistance:0.2/0.3/0.4
  32391. frei0r=colordistance:violet
  32392. frei0r=colordistance:0x112233
  32393. </pre></div>
  32394. </li><li>
  32395. Apply the perspective effect, specifying the top left and top right image
  32396. positions:
  32397. <div class="example">
  32398. <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
  32399. </pre></div>
  32400. </li></ul>
  32401. <p>For more information, see
  32402. <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  32403. </p>
  32404. <a name="fspp"></a>
  32405. <h2 class="section"><a href="ffmpeg-all.html#toc-fspp">39.86 fspp</a></h2>
  32406. <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
  32407. </p>
  32408. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  32409. processing filter, one of them is performed once per block, not per pixel.
  32410. This allows for much higher speed.
  32411. </p>
  32412. <p>The filter accepts the following options:
  32413. </p>
  32414. <dl compact="compact">
  32415. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  32416. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  32417. an integer in the range 4-5. Default value is <code>4</code>.
  32418. </p>
  32419. </dd>
  32420. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  32421. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  32422. If not set, the filter will use the QP from the video stream (if available).
  32423. </p>
  32424. </dd>
  32425. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  32426. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  32427. more details but also more artifacts, while higher values make the image smoother
  32428. but also blurrier. Default value is <code>0</code> − PSNR optimal.
  32429. </p>
  32430. </dd>
  32431. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  32432. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  32433. option may cause flicker since the B-Frames have often larger QP. Default is
  32434. <code>0</code> (not enabled).
  32435. </p>
  32436. </dd>
  32437. </dl>
  32438. <a name="gblur"></a>
  32439. <h2 class="section"><a href="ffmpeg-all.html#toc-gblur">39.87 gblur</a></h2>
  32440. <p>Apply Gaussian blur filter.
  32441. </p>
  32442. <p>The filter accepts the following options:
  32443. </p>
  32444. <dl compact="compact">
  32445. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  32446. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code>0.5</code>.
  32447. </p>
  32448. </dd>
  32449. <dt>&lsquo;<samp>steps</samp>&rsquo;</dt>
  32450. <dd><p>Set number of steps for Gaussian approximation. Default is <code>1</code>.
  32451. </p>
  32452. </dd>
  32453. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  32454. <dd><p>Set which planes to filter. By default all planes are filtered.
  32455. </p>
  32456. </dd>
  32457. <dt>&lsquo;<samp>sigmaV</samp>&rsquo;</dt>
  32458. <dd><p>Set vertical sigma, if negative it will be same as <code>sigma</code>.
  32459. Default is <code>-1</code>.
  32460. </p></dd>
  32461. </dl>
  32462. <a name="Commands-67"></a>
  32463. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-67">39.87.1 Commands</a></h3>
  32464. <p>This filter supports same commands as options.
  32465. The command accepts the same syntax of the corresponding option.
  32466. </p>
  32467. <p>If the specified expression is not valid, it is kept at its current
  32468. value.
  32469. </p>
  32470. <a name="geq"></a>
  32471. <h2 class="section"><a href="ffmpeg-all.html#toc-geq">39.88 geq</a></h2>
  32472. <p>Apply generic equation to each pixel.
  32473. </p>
  32474. <p>The filter accepts the following options:
  32475. </p>
  32476. <dl compact="compact">
  32477. <dt>&lsquo;<samp>lum_expr, lum</samp>&rsquo;</dt>
  32478. <dd><p>Set the luminance expression.
  32479. </p></dd>
  32480. <dt>&lsquo;<samp>cb_expr, cb</samp>&rsquo;</dt>
  32481. <dd><p>Set the chrominance blue expression.
  32482. </p></dd>
  32483. <dt>&lsquo;<samp>cr_expr, cr</samp>&rsquo;</dt>
  32484. <dd><p>Set the chrominance red expression.
  32485. </p></dd>
  32486. <dt>&lsquo;<samp>alpha_expr, a</samp>&rsquo;</dt>
  32487. <dd><p>Set the alpha expression.
  32488. </p></dd>
  32489. <dt>&lsquo;<samp>red_expr, r</samp>&rsquo;</dt>
  32490. <dd><p>Set the red expression.
  32491. </p></dd>
  32492. <dt>&lsquo;<samp>green_expr, g</samp>&rsquo;</dt>
  32493. <dd><p>Set the green expression.
  32494. </p></dd>
  32495. <dt>&lsquo;<samp>blue_expr, b</samp>&rsquo;</dt>
  32496. <dd><p>Set the blue expression.
  32497. </p></dd>
  32498. </dl>
  32499. <p>The colorspace is selected according to the specified options. If one
  32500. of the &lsquo;<samp>lum_expr</samp>&rsquo;, &lsquo;<samp>cb_expr</samp>&rsquo;, or &lsquo;<samp>cr_expr</samp>&rsquo;
  32501. options is specified, the filter will automatically select a YCbCr
  32502. colorspace. If one of the &lsquo;<samp>red_expr</samp>&rsquo;, &lsquo;<samp>green_expr</samp>&rsquo;, or
  32503. &lsquo;<samp>blue_expr</samp>&rsquo; options is specified, it will select an RGB
  32504. colorspace.
  32505. </p>
  32506. <p>If one of the chrominance expression is not defined, it falls back on the other
  32507. one. If no alpha expression is specified it will evaluate to opaque value.
  32508. If none of chrominance expressions are specified, they will evaluate
  32509. to the luminance expression.
  32510. </p>
  32511. <p>The expressions can use the following variables and functions:
  32512. </p>
  32513. <dl compact="compact">
  32514. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  32515. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  32516. </p>
  32517. </dd>
  32518. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  32519. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  32520. <dd><p>The coordinates of the current sample.
  32521. </p>
  32522. </dd>
  32523. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  32524. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  32525. <dd><p>The width and height of the image.
  32526. </p>
  32527. </dd>
  32528. <dt>&lsquo;<samp>SW</samp>&rsquo;</dt>
  32529. <dt>&lsquo;<samp>SH</samp>&rsquo;</dt>
  32530. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  32531. ratio between the corresponding luma plane number of pixels and the current
  32532. plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
  32533. <code>0.5,0.5</code> for chroma planes.
  32534. </p>
  32535. </dd>
  32536. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  32537. <dd><p>Time of the current frame, expressed in seconds.
  32538. </p>
  32539. </dd>
  32540. <dt>&lsquo;<samp>p(x, y)</samp>&rsquo;</dt>
  32541. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
  32542. plane.
  32543. </p>
  32544. </dd>
  32545. <dt>&lsquo;<samp>lum(x, y)</samp>&rsquo;</dt>
  32546. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
  32547. plane.
  32548. </p>
  32549. </dd>
  32550. <dt>&lsquo;<samp>cb(x, y)</samp>&rsquo;</dt>
  32551. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32552. blue-difference chroma plane. Return 0 if there is no such plane.
  32553. </p>
  32554. </dd>
  32555. <dt>&lsquo;<samp>cr(x, y)</samp>&rsquo;</dt>
  32556. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32557. red-difference chroma plane. Return 0 if there is no such plane.
  32558. </p>
  32559. </dd>
  32560. <dt>&lsquo;<samp>r(x, y)</samp>&rsquo;</dt>
  32561. <dt>&lsquo;<samp>g(x, y)</samp>&rsquo;</dt>
  32562. <dt>&lsquo;<samp>b(x, y)</samp>&rsquo;</dt>
  32563. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  32564. red/green/blue component. Return 0 if there is no such component.
  32565. </p>
  32566. </dd>
  32567. <dt>&lsquo;<samp>alpha(x, y)</samp>&rsquo;</dt>
  32568. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
  32569. plane. Return 0 if there is no such plane.
  32570. </p>
  32571. </dd>
  32572. <dt>&lsquo;<samp>psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)</samp>&rsquo;</dt>
  32573. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  32574. sums of samples within a rectangle. See the functions without the sum postfix.
  32575. </p>
  32576. </dd>
  32577. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  32578. <dd><p>Set one of interpolation methods:
  32579. </p><dl compact="compact">
  32580. <dt>&lsquo;<samp>nearest, n</samp>&rsquo;</dt>
  32581. <dt>&lsquo;<samp>bilinear, b</samp>&rsquo;</dt>
  32582. </dl>
  32583. <p>Default is bilinear.
  32584. </p></dd>
  32585. </dl>
  32586. <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
  32587. automatically clipped to the closer edge.
  32588. </p>
  32589. <p>Please note that this filter can use multiple threads in which case each slice
  32590. will have its own expression state. If you want to use only a single expression
  32591. state because your expressions depend on previous state then you should limit
  32592. the number of filter threads to 1.
  32593. </p>
  32594. <a name="Examples-9"></a>
  32595. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-9">39.88.1 Examples</a></h3>
  32596. <ul>
  32597. <li>
  32598. Flip the image horizontally:
  32599. <div class="example">
  32600. <pre class="example">geq=p(W-X\,Y)
  32601. </pre></div>
  32602. </li><li>
  32603. Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
  32604. wavelength of 100 pixels:
  32605. <div class="example">
  32606. <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  32607. </pre></div>
  32608. </li><li>
  32609. Generate a fancy enigmatic moving light:
  32610. <div class="example">
  32611. <pre class="example">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
  32612. </pre></div>
  32613. </li><li>
  32614. Generate a quick emboss effect:
  32615. <div class="example">
  32616. <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  32617. </pre></div>
  32618. </li><li>
  32619. Modify RGB components depending on pixel position:
  32620. <div class="example">
  32621. <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  32622. </pre></div>
  32623. </li><li>
  32624. Create a radial gradient that is the same size as the input (also see
  32625. the <a href="#vignette">vignette</a> filter):
  32626. <div class="example">
  32627. <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  32628. </pre></div>
  32629. </li></ul>
  32630. <a name="gradfun"></a>
  32631. <h2 class="section"><a href="ffmpeg-all.html#toc-gradfun">39.89 gradfun</a></h2>
  32632. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  32633. regions by truncation to 8-bit color depth.
  32634. Interpolate the gradients that should go where the bands are, and
  32635. dither them.
  32636. </p>
  32637. <p>It is designed for playback only. Do not use it prior to
  32638. lossy compression, because compression tends to lose the dither and
  32639. bring back the bands.
  32640. </p>
  32641. <p>It accepts the following parameters:
  32642. </p>
  32643. <dl compact="compact">
  32644. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  32645. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  32646. the threshold for detecting nearly flat regions. Acceptable values range from
  32647. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  32648. valid range.
  32649. </p>
  32650. </dd>
  32651. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  32652. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  32653. gradients, but also prevents the filter from modifying the pixels near detailed
  32654. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  32655. values will be clipped to the valid range.
  32656. </p>
  32657. </dd>
  32658. </dl>
  32659. <p>Alternatively, the options can be specified as a flat string:
  32660. <var>strength</var>[:<var>radius</var>]
  32661. </p>
  32662. <a name="Examples-169"></a>
  32663. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-169">39.89.1 Examples</a></h3>
  32664. <ul>
  32665. <li>
  32666. Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
  32667. <div class="example">
  32668. <pre class="example">gradfun=3.5:8
  32669. </pre></div>
  32670. </li><li>
  32671. Specify radius, omitting the strength (which will fall-back to the default
  32672. value):
  32673. <div class="example">
  32674. <pre class="example">gradfun=radius=8
  32675. </pre></div>
  32676. </li></ul>
  32677. <p><a name="graphmonitor"></a>
  32678. </p><a name="graphmonitor-1"></a>
  32679. <h2 class="section"><a href="ffmpeg-all.html#toc-graphmonitor-1">39.90 graphmonitor</a></h2>
  32680. <p>Show various filtergraph stats.
  32681. </p>
  32682. <p>With this filter one can debug complete filtergraph.
  32683. Especially issues with links filling with queued frames.
  32684. </p>
  32685. <p>The filter accepts the following options:
  32686. </p>
  32687. <dl compact="compact">
  32688. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  32689. <dd><p>Set video output size. Default is <var>hd720</var>.
  32690. </p>
  32691. </dd>
  32692. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  32693. <dd><p>Set video opacity. Default is <var>0.9</var>. Allowed range is from <var>0</var> to <var>1</var>.
  32694. </p>
  32695. </dd>
  32696. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  32697. <dd><p>Set output mode, can be <var>fulll</var> or <var>compact</var>.
  32698. In <var>compact</var> mode only filters with some queued frames have displayed stats.
  32699. </p>
  32700. </dd>
  32701. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  32702. <dd><p>Set flags which enable which stats are shown in video.
  32703. </p>
  32704. <p>Available values for flags are:
  32705. </p><dl compact="compact">
  32706. <dt>&lsquo;<samp>queue</samp>&rsquo;</dt>
  32707. <dd><p>Display number of queued frames in each link.
  32708. </p>
  32709. </dd>
  32710. <dt>&lsquo;<samp>frame_count_in</samp>&rsquo;</dt>
  32711. <dd><p>Display number of frames taken from filter.
  32712. </p>
  32713. </dd>
  32714. <dt>&lsquo;<samp>frame_count_out</samp>&rsquo;</dt>
  32715. <dd><p>Display number of frames given out from filter.
  32716. </p>
  32717. </dd>
  32718. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  32719. <dd><p>Display current filtered frame pts.
  32720. </p>
  32721. </dd>
  32722. <dt>&lsquo;<samp>time</samp>&rsquo;</dt>
  32723. <dd><p>Display current filtered frame time.
  32724. </p>
  32725. </dd>
  32726. <dt>&lsquo;<samp>timebase</samp>&rsquo;</dt>
  32727. <dd><p>Display time base for filter link.
  32728. </p>
  32729. </dd>
  32730. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  32731. <dd><p>Display used format for filter link.
  32732. </p>
  32733. </dd>
  32734. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  32735. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  32736. </p>
  32737. </dd>
  32738. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  32739. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  32740. </p></dd>
  32741. </dl>
  32742. </dd>
  32743. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  32744. <dd><p>Set upper limit for video rate of output stream, Default value is <var>25</var>.
  32745. This guarantee that output video frame rate will not be higher than this value.
  32746. </p></dd>
  32747. </dl>
  32748. <a name="greyedge"></a>
  32749. <h2 class="section"><a href="ffmpeg-all.html#toc-greyedge">39.91 greyedge</a></h2>
  32750. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  32751. and corrects the scene colors accordingly.
  32752. </p>
  32753. <p>See: <a href="https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf">https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf</a>
  32754. </p>
  32755. <p>The filter accepts the following options:
  32756. </p>
  32757. <dl compact="compact">
  32758. <dt>&lsquo;<samp>difford</samp>&rsquo;</dt>
  32759. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  32760. [0,2] and default value is 1.
  32761. </p>
  32762. </dd>
  32763. <dt>&lsquo;<samp>minknorm</samp>&rsquo;</dt>
  32764. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  32765. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  32766. max value instead of calculating Minkowski distance.
  32767. </p>
  32768. </dd>
  32769. <dt>&lsquo;<samp>sigma</samp>&rsquo;</dt>
  32770. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  32771. chosen in the range [0,1024.0] and default value = 1. floor( <var>sigma</var> * break_off_sigma(3) )
  32772. can&rsquo;t be equal to 0 if <var>difford</var> is greater than 0.
  32773. </p></dd>
  32774. </dl>
  32775. <a name="Examples-123"></a>
  32776. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-123">39.91.1 Examples</a></h3>
  32777. <ul>
  32778. <li>
  32779. Grey Edge:
  32780. <div class="example">
  32781. <pre class="example">greyedge=difford=1:minknorm=5:sigma=2
  32782. </pre></div>
  32783. </li><li>
  32784. Max Edge:
  32785. <div class="example">
  32786. <pre class="example">greyedge=difford=1:minknorm=0:sigma=2
  32787. </pre></div>
  32788. </li></ul>
  32789. <p><a name="haldclut"></a>
  32790. </p><a name="haldclut-1"></a>
  32791. <h2 class="section"><a href="ffmpeg-all.html#toc-haldclut-1">39.92 haldclut</a></h2>
  32792. <p>Apply a Hald CLUT to a video stream.
  32793. </p>
  32794. <p>First input is the video stream to process, and second one is the Hald CLUT.
  32795. The Hald CLUT input can be a simple picture or a complete video stream.
  32796. </p>
  32797. <p>The filter accepts the following options:
  32798. </p>
  32799. <dl compact="compact">
  32800. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  32801. <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
  32802. </p></dd>
  32803. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  32804. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  32805. <code>0</code> disable the filter after the last frame of the CLUT is reached.
  32806. Default is <code>1</code>.
  32807. </p></dd>
  32808. </dl>
  32809. <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
  32810. filters share the same internals).
  32811. </p>
  32812. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  32813. </p>
  32814. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  32815. (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  32816. </p>
  32817. <a name="Workflow-examples"></a>
  32818. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Workflow-examples">39.92.1 Workflow examples</a></h3>
  32819. <a name="Hald-CLUT-video-stream"></a>
  32820. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-video-stream">39.92.1.1 Hald CLUT video stream</a></h4>
  32821. <p>Generate an identity Hald CLUT stream altered with various effects:
  32822. </p><div class="example">
  32823. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
  32824. </pre></div>
  32825. <p>Note: make sure you use a lossless codec.
  32826. </p>
  32827. <p>Then use it with <code>haldclut</code> to apply it on some random stream:
  32828. </p><div class="example">
  32829. <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  32830. </pre></div>
  32831. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  32832. &lsquo;<tt>clut.nut</tt>&rsquo;), then the latest picture of that CLUT stream will be applied
  32833. to the remaining frames of the <code>mandelbrot</code> stream.
  32834. </p>
  32835. <a name="Hald-CLUT-with-preview"></a>
  32836. <h4 class="subsubsection"><a href="ffmpeg-all.html#toc-Hald-CLUT-with-preview">39.92.1.2 Hald CLUT with preview</a></h4>
  32837. <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
  32838. <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  32839. biggest possible square starting at the top left of the picture. The remaining
  32840. padding pixels (bottom or right) will be ignored. This area can be used to add
  32841. a preview of the Hald CLUT.
  32842. </p>
  32843. <p>Typically, the following generated Hald CLUT will be supported by the
  32844. <code>haldclut</code> filter:
  32845. </p>
  32846. <div class="example">
  32847. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  32848. pad=iw+320 [padded_clut];
  32849. smptebars=s=320x256, split [a][b];
  32850. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  32851. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  32852. </pre></div>
  32853. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  32854. bars are displayed on the right-top, and below the same color bars processed by
  32855. the color changes.
  32856. </p>
  32857. <p>Then, the effect of this Hald CLUT can be visualized with:
  32858. </p><div class="example">
  32859. <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  32860. </pre></div>
  32861. <a name="hflip"></a>
  32862. <h2 class="section"><a href="ffmpeg-all.html#toc-hflip">39.93 hflip</a></h2>
  32863. <p>Flip the input video horizontally.
  32864. </p>
  32865. <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
  32866. </p><div class="example">
  32867. <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  32868. </pre></div>
  32869. <a name="histeq"></a>
  32870. <h2 class="section"><a href="ffmpeg-all.html#toc-histeq">39.94 histeq</a></h2>
  32871. <p>This filter applies a global color histogram equalization on a
  32872. per-frame basis.
  32873. </p>
  32874. <p>It can be used to correct video that has a compressed range of pixel
  32875. intensities. The filter redistributes the pixel intensities to
  32876. equalize their distribution across the intensity range. It may be
  32877. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  32878. useful only for correcting degraded or poorly captured source
  32879. video.
  32880. </p>
  32881. <p>The filter accepts the following options:
  32882. </p>
  32883. <dl compact="compact">
  32884. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  32885. <dd><p>Determine the amount of equalization to be applied. As the strength
  32886. is reduced, the distribution of pixel intensities more-and-more
  32887. approaches that of the input frame. The value must be a float number
  32888. in the range [0,1] and defaults to 0.200.
  32889. </p>
  32890. </dd>
  32891. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  32892. <dd><p>Set the maximum intensity that can generated and scale the output
  32893. values appropriately. The strength should be set as desired and then
  32894. the intensity can be limited if needed to avoid washing-out. The value
  32895. must be a float number in the range [0,1] and defaults to 0.210.
  32896. </p>
  32897. </dd>
  32898. <dt>&lsquo;<samp>antibanding</samp>&rsquo;</dt>
  32899. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  32900. the luminance of output pixels by a small amount to avoid banding of
  32901. the histogram. Possible values are <code>none</code>, <code>weak</code> or
  32902. <code>strong</code>. It defaults to <code>none</code>.
  32903. </p></dd>
  32904. </dl>
  32905. <p><a name="histogram"></a>
  32906. </p><a name="histogram-1"></a>
  32907. <h2 class="section"><a href="ffmpeg-all.html#toc-histogram-1">39.95 histogram</a></h2>
  32908. <p>Compute and draw a color distribution histogram for the input video.
  32909. </p>
  32910. <p>The computed histogram is a representation of the color component
  32911. distribution in an image.
  32912. </p>
  32913. <p>Standard histogram displays the color components distribution in an image.
  32914. Displays color graph for each color component. Shows distribution of
  32915. the Y, U, V, A or R, G, B components, depending on input format, in the
  32916. current frame. Below each graph a color component scale meter is shown.
  32917. </p>
  32918. <p>The filter accepts the following options:
  32919. </p>
  32920. <dl compact="compact">
  32921. <dt>&lsquo;<samp>level_height</samp>&rsquo;</dt>
  32922. <dd><p>Set height of level. Default value is <code>200</code>.
  32923. Allowed range is [50, 2048].
  32924. </p>
  32925. </dd>
  32926. <dt>&lsquo;<samp>scale_height</samp>&rsquo;</dt>
  32927. <dd><p>Set height of color scale. Default value is <code>12</code>.
  32928. Allowed range is [0, 40].
  32929. </p>
  32930. </dd>
  32931. <dt>&lsquo;<samp>display_mode</samp>&rsquo;</dt>
  32932. <dd><p>Set display mode.
  32933. It accepts the following values:
  32934. </p><dl compact="compact">
  32935. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  32936. <dd><p>Per color component graphs are placed below each other.
  32937. </p>
  32938. </dd>
  32939. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  32940. <dd><p>Per color component graphs are placed side by side.
  32941. </p>
  32942. </dd>
  32943. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  32944. <dd><p>Presents information identical to that in the <code>parade</code>, except
  32945. that the graphs representing color components are superimposed directly
  32946. over one another.
  32947. </p></dd>
  32948. </dl>
  32949. <p>Default is <code>stack</code>.
  32950. </p>
  32951. </dd>
  32952. <dt>&lsquo;<samp>levels_mode</samp>&rsquo;</dt>
  32953. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  32954. Default is <code>linear</code>.
  32955. </p>
  32956. </dd>
  32957. <dt>&lsquo;<samp>components</samp>&rsquo;</dt>
  32958. <dd><p>Set what color components to display.
  32959. Default is <code>7</code>.
  32960. </p>
  32961. </dd>
  32962. <dt>&lsquo;<samp>fgopacity</samp>&rsquo;</dt>
  32963. <dd><p>Set foreground opacity. Default is <code>0.7</code>.
  32964. </p>
  32965. </dd>
  32966. <dt>&lsquo;<samp>bgopacity</samp>&rsquo;</dt>
  32967. <dd><p>Set background opacity. Default is <code>0.5</code>.
  32968. </p></dd>
  32969. </dl>
  32970. <a name="Examples-128"></a>
  32971. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-128">39.95.1 Examples</a></h3>
  32972. <ul>
  32973. <li>
  32974. Calculate and draw histogram:
  32975. <div class="example">
  32976. <pre class="example">ffplay -i input -vf histogram
  32977. </pre></div>
  32978. </li></ul>
  32979. <p><a name="hqdn3d"></a>
  32980. </p><a name="hqdn3d-1"></a>
  32981. <h2 class="section"><a href="ffmpeg-all.html#toc-hqdn3d-1">39.96 hqdn3d</a></h2>
  32982. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  32983. image noise, producing smooth images and making still images really
  32984. still. It should enhance compressibility.
  32985. </p>
  32986. <p>It accepts the following optional parameters:
  32987. </p>
  32988. <dl compact="compact">
  32989. <dt>&lsquo;<samp>luma_spatial</samp>&rsquo;</dt>
  32990. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  32991. It defaults to 4.0.
  32992. </p>
  32993. </dd>
  32994. <dt>&lsquo;<samp>chroma_spatial</samp>&rsquo;</dt>
  32995. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  32996. It defaults to 3.0*<var>luma_spatial</var>/4.0.
  32997. </p>
  32998. </dd>
  32999. <dt>&lsquo;<samp>luma_tmp</samp>&rsquo;</dt>
  33000. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  33001. 6.0*<var>luma_spatial</var>/4.0.
  33002. </p>
  33003. </dd>
  33004. <dt>&lsquo;<samp>chroma_tmp</samp>&rsquo;</dt>
  33005. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  33006. <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
  33007. </p></dd>
  33008. </dl>
  33009. <a name="Commands-9"></a>
  33010. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-9">39.96.1 Commands</a></h3>
  33011. <p>This filter supports same <a href="#commands">commands</a> as options.
  33012. The command accepts the same syntax of the corresponding option.
  33013. </p>
  33014. <p>If the specified expression is not valid, it is kept at its current
  33015. value.
  33016. </p>
  33017. <p><a name="hwdownload"></a>
  33018. </p><a name="hwdownload-1"></a>
  33019. <h2 class="section"><a href="ffmpeg-all.html#toc-hwdownload-1">39.97 hwdownload</a></h2>
  33020. <p>Download hardware frames to system memory.
  33021. </p>
  33022. <p>The input must be in hardware frames, and the output a non-hardware format.
  33023. Not all formats will be supported on the output - it may be necessary to insert
  33024. an additional &lsquo;<samp>format</samp>&rsquo; filter immediately following in the graph to get
  33025. the output in a supported format.
  33026. </p>
  33027. <a name="hwmap"></a>
  33028. <h2 class="section"><a href="ffmpeg-all.html#toc-hwmap">39.98 hwmap</a></h2>
  33029. <p>Map hardware frames to system memory or to another device.
  33030. </p>
  33031. <p>This filter has several different modes of operation; which one is used depends
  33032. on the input and output formats:
  33033. </p><ul>
  33034. <li>
  33035. Hardware frame input, normal frame output
  33036. <p>Map the input frames to system memory and pass them to the output. If the
  33037. original hardware frame is later required (for example, after overlaying
  33038. something else on part of it), the &lsquo;<samp>hwmap</samp>&rsquo; filter can be used again
  33039. in the next mode to retrieve it.
  33040. </p></li><li>
  33041. Normal frame input, hardware frame output
  33042. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  33043. that is, return the original hardware frame.
  33044. </p>
  33045. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  33046. device for the output, then map them back to the software format at the input
  33047. and give those frames to the preceding filter. This will then act like the
  33048. &lsquo;<samp>hwupload</samp>&rsquo; filter, but may be able to avoid an additional copy when
  33049. the input is already in a compatible format.
  33050. </p></li><li>
  33051. Hardware frame input and output
  33052. <p>A device must be supplied for the output, either directly or with the
  33053. &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices must be of
  33054. different types and compatible - the exact meaning of this is
  33055. system-dependent, but typically it means that they must refer to the same
  33056. underlying hardware context (for example, refer to the same graphics card).
  33057. </p>
  33058. <p>If the input frames were originally created on the output device, then unmap
  33059. to retrieve the original frames.
  33060. </p>
  33061. <p>Otherwise, map the frames to the output device - create new hardware frames
  33062. on the output corresponding to the frames on the input.
  33063. </p></li></ul>
  33064. <p>The following additional parameters are accepted:
  33065. </p>
  33066. <dl compact="compact">
  33067. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  33068. <dd><p>Set the frame mapping mode. Some combination of:
  33069. </p><dl compact="compact">
  33070. <dt><var>read</var></dt>
  33071. <dd><p>The mapped frame should be readable.
  33072. </p></dd>
  33073. <dt><var>write</var></dt>
  33074. <dd><p>The mapped frame should be writeable.
  33075. </p></dd>
  33076. <dt><var>overwrite</var></dt>
  33077. <dd><p>The mapping will always overwrite the entire frame.
  33078. </p>
  33079. <p>This may improve performance in some cases, as the original contents of the
  33080. frame need not be loaded.
  33081. </p></dd>
  33082. <dt><var>direct</var></dt>
  33083. <dd><p>The mapping must not involve any copying.
  33084. </p>
  33085. <p>Indirect mappings to copies of frames are created in some cases where either
  33086. direct mapping is not possible or it would have unexpected properties.
  33087. Setting this flag ensures that the mapping is direct and will fail if that is
  33088. not possible.
  33089. </p></dd>
  33090. </dl>
  33091. <p>Defaults to <var>read+write</var> if not specified.
  33092. </p>
  33093. </dd>
  33094. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  33095. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  33096. device of type <var>type</var> from the device the input frames exist on.
  33097. </p>
  33098. </dd>
  33099. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  33100. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  33101. and map them back to the source. This may be necessary in some cases where
  33102. a mapping in one direction is required but only the opposite direction is
  33103. supported by the devices being used.
  33104. </p>
  33105. <p>This option is dangerous - it may break the preceding filter in undefined
  33106. ways if there are any additional constraints on that filter&rsquo;s output.
  33107. Do not use it without fully understanding the implications of its use.
  33108. </p></dd>
  33109. </dl>
  33110. <p><a name="hwupload"></a>
  33111. </p><a name="hwupload-1"></a>
  33112. <h2 class="section"><a href="ffmpeg-all.html#toc-hwupload-1">39.99 hwupload</a></h2>
  33113. <p>Upload system memory frames to hardware surfaces.
  33114. </p>
  33115. <p>The device to upload to must be supplied when the filter is initialised. If
  33116. using ffmpeg, select the appropriate device with the &lsquo;<samp>-filter_hw_device</samp>&rsquo;
  33117. option or with the &lsquo;<samp>derive_device</samp>&rsquo; option. The input and output devices
  33118. must be of different types and compatible - the exact meaning of this is
  33119. system-dependent, but typically it means that they must refer to the same
  33120. underlying hardware context (for example, refer to the same graphics card).
  33121. </p>
  33122. <p>The following additional parameters are accepted:
  33123. </p>
  33124. <dl compact="compact">
  33125. <dt>&lsquo;<samp>derive_device <var>type</var></samp>&rsquo;</dt>
  33126. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  33127. device of type <var>type</var> from the device the input frames exist on.
  33128. </p></dd>
  33129. </dl>
  33130. <p><a name="hwupload_005fcuda"></a>
  33131. </p><a name="hwupload_005fcuda-1"></a>
  33132. <h2 class="section"><a href="ffmpeg-all.html#toc-hwupload_005fcuda-1">39.100 hwupload_cuda</a></h2>
  33133. <p>Upload system memory frames to a CUDA device.
  33134. </p>
  33135. <p>It accepts the following optional parameters:
  33136. </p>
  33137. <dl compact="compact">
  33138. <dt>&lsquo;<samp>device</samp>&rsquo;</dt>
  33139. <dd><p>The number of the CUDA device to use
  33140. </p></dd>
  33141. </dl>
  33142. <a name="hqx"></a>
  33143. <h2 class="section"><a href="ffmpeg-all.html#toc-hqx">39.101 hqx</a></h2>
  33144. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  33145. was originally created by Maxim Stepin.
  33146. </p>
  33147. <p>It accepts the following option:
  33148. </p>
  33149. <dl compact="compact">
  33150. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  33151. <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
  33152. <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
  33153. Default is <code>3</code>.
  33154. </p></dd>
  33155. </dl>
  33156. <a name="hstack"></a>
  33157. <h2 class="section"><a href="ffmpeg-all.html#toc-hstack">39.102 hstack</a></h2>
  33158. <p>Stack input videos horizontally.
  33159. </p>
  33160. <p>All streams must be of same pixel format and of same height.
  33161. </p>
  33162. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  33163. to create same output.
  33164. </p>
  33165. <p>The filter accepts the following option:
  33166. </p>
  33167. <dl compact="compact">
  33168. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  33169. <dd><p>Set number of input streams. Default is 2.
  33170. </p>
  33171. </dd>
  33172. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  33173. <dd><p>If set to 1, force the output to terminate when the shortest input
  33174. terminates. Default value is 0.
  33175. </p></dd>
  33176. </dl>
  33177. <a name="hue"></a>
  33178. <h2 class="section"><a href="ffmpeg-all.html#toc-hue">39.103 hue</a></h2>
  33179. <p>Modify the hue and/or the saturation of the input.
  33180. </p>
  33181. <p>It accepts the following parameters:
  33182. </p>
  33183. <dl compact="compact">
  33184. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  33185. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  33186. and defaults to &quot;0&quot;.
  33187. </p>
  33188. </dd>
  33189. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  33190. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  33191. defaults to &quot;1&quot;.
  33192. </p>
  33193. </dd>
  33194. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  33195. <dd><p>Specify the hue angle as a number of radians. It accepts an
  33196. expression, and defaults to &quot;0&quot;.
  33197. </p>
  33198. </dd>
  33199. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  33200. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  33201. defaults to &quot;0&quot;.
  33202. </p></dd>
  33203. </dl>
  33204. <p>&lsquo;<samp>h</samp>&rsquo; and &lsquo;<samp>H</samp>&rsquo; are mutually exclusive, and can&rsquo;t be
  33205. specified at the same time.
  33206. </p>
  33207. <p>The &lsquo;<samp>b</samp>&rsquo;, &lsquo;<samp>h</samp>&rsquo;, &lsquo;<samp>H</samp>&rsquo; and &lsquo;<samp>s</samp>&rsquo; option values are
  33208. expressions containing the following constants:
  33209. </p>
  33210. <dl compact="compact">
  33211. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  33212. <dd><p>frame count of the input frame starting from 0
  33213. </p>
  33214. </dd>
  33215. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  33216. <dd><p>presentation timestamp of the input frame expressed in time base units
  33217. </p>
  33218. </dd>
  33219. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  33220. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  33221. </p>
  33222. </dd>
  33223. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  33224. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  33225. </p>
  33226. </dd>
  33227. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  33228. <dd><p>time base of the input video
  33229. </p></dd>
  33230. </dl>
  33231. <a name="Examples-111"></a>
  33232. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-111">39.103.1 Examples</a></h3>
  33233. <ul>
  33234. <li>
  33235. Set the hue to 90 degrees and the saturation to 1.0:
  33236. <div class="example">
  33237. <pre class="example">hue=h=90:s=1
  33238. </pre></div>
  33239. </li><li>
  33240. Same command but expressing the hue in radians:
  33241. <div class="example">
  33242. <pre class="example">hue=H=PI/2:s=1
  33243. </pre></div>
  33244. </li><li>
  33245. Rotate hue and make the saturation swing between 0
  33246. and 2 over a period of 1 second:
  33247. <div class="example">
  33248. <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  33249. </pre></div>
  33250. </li><li>
  33251. Apply a 3 seconds saturation fade-in effect starting at 0:
  33252. <div class="example">
  33253. <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
  33254. </pre></div>
  33255. <p>The general fade-in expression can be written as:
  33256. </p><div class="example">
  33257. <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  33258. </pre></div>
  33259. </li><li>
  33260. Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  33261. <div class="example">
  33262. <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  33263. </pre></div>
  33264. <p>The general fade-out expression can be written as:
  33265. </p><div class="example">
  33266. <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  33267. </pre></div>
  33268. </li></ul>
  33269. <a name="Commands-28"></a>
  33270. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-28">39.103.2 Commands</a></h3>
  33271. <p>This filter supports the following commands:
  33272. </p><dl compact="compact">
  33273. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  33274. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  33275. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  33276. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  33277. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  33278. The command accepts the same syntax of the corresponding option.
  33279. </p>
  33280. <p>If the specified expression is not valid, it is kept at its current
  33281. value.
  33282. </p></dd>
  33283. </dl>
  33284. <a name="hysteresis"></a>
  33285. <h2 class="section"><a href="ffmpeg-all.html#toc-hysteresis">39.104 hysteresis</a></h2>
  33286. <p>Grow first stream into second stream by connecting components.
  33287. This makes it possible to build more robust edge masks.
  33288. </p>
  33289. <p>This filter accepts the following options:
  33290. </p>
  33291. <dl compact="compact">
  33292. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  33293. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  33294. copied from first stream.
  33295. By default value 0xf, all planes will be processed.
  33296. </p>
  33297. </dd>
  33298. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  33299. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  33300. this value filter algorithm for connecting components is activated.
  33301. By default value is 0.
  33302. </p></dd>
  33303. </dl>
  33304. <p>The <code>hysteresis</code> filter also supports the <a href="#framesync">framesync</a> options.
  33305. </p>
  33306. <a name="idet"></a>
  33307. <h2 class="section"><a href="ffmpeg-all.html#toc-idet">39.105 idet</a></h2>
  33308. <p>Detect video interlacing type.
  33309. </p>
  33310. <p>This filter tries to detect if the input frames are interlaced, progressive,
  33311. top or bottom field first. It will also try to detect fields that are
  33312. repeated between adjacent frames (a sign of telecine).
  33313. </p>
  33314. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  33315. Multiple frame detection incorporates the classification history of previous frames.
  33316. </p>
  33317. <p>The filter will log these metadata values:
  33318. </p>
  33319. <dl compact="compact">
  33320. <dt>&lsquo;<samp>single.current_frame</samp>&rsquo;</dt>
  33321. <dd><p>Detected type of current frame using single-frame detection. One of:
  33322. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  33323. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  33324. </p>
  33325. </dd>
  33326. <dt>&lsquo;<samp>single.tff</samp>&rsquo;</dt>
  33327. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  33328. </p>
  33329. </dd>
  33330. <dt>&lsquo;<samp>multiple.tff</samp>&rsquo;</dt>
  33331. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  33332. </p>
  33333. </dd>
  33334. <dt>&lsquo;<samp>single.bff</samp>&rsquo;</dt>
  33335. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  33336. </p>
  33337. </dd>
  33338. <dt>&lsquo;<samp>multiple.current_frame</samp>&rsquo;</dt>
  33339. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  33340. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  33341. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  33342. </p>
  33343. </dd>
  33344. <dt>&lsquo;<samp>multiple.bff</samp>&rsquo;</dt>
  33345. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  33346. </p>
  33347. </dd>
  33348. <dt>&lsquo;<samp>single.progressive</samp>&rsquo;</dt>
  33349. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  33350. </p>
  33351. </dd>
  33352. <dt>&lsquo;<samp>multiple.progressive</samp>&rsquo;</dt>
  33353. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  33354. </p>
  33355. </dd>
  33356. <dt>&lsquo;<samp>single.undetermined</samp>&rsquo;</dt>
  33357. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  33358. </p>
  33359. </dd>
  33360. <dt>&lsquo;<samp>multiple.undetermined</samp>&rsquo;</dt>
  33361. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  33362. </p>
  33363. </dd>
  33364. <dt>&lsquo;<samp>repeated.current_frame</samp>&rsquo;</dt>
  33365. <dd><p>Which field in the current frame is repeated from the last. One of &ldquo;neither&rdquo;, &ldquo;top&rdquo;, or &ldquo;bottom&rdquo;.
  33366. </p>
  33367. </dd>
  33368. <dt>&lsquo;<samp>repeated.neither</samp>&rsquo;</dt>
  33369. <dd><p>Cumulative number of frames with no repeated field.
  33370. </p>
  33371. </dd>
  33372. <dt>&lsquo;<samp>repeated.top</samp>&rsquo;</dt>
  33373. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  33374. </p>
  33375. </dd>
  33376. <dt>&lsquo;<samp>repeated.bottom</samp>&rsquo;</dt>
  33377. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  33378. </p></dd>
  33379. </dl>
  33380. <p>The filter accepts the following options:
  33381. </p>
  33382. <dl compact="compact">
  33383. <dt>&lsquo;<samp>intl_thres</samp>&rsquo;</dt>
  33384. <dd><p>Set interlacing threshold.
  33385. </p></dd>
  33386. <dt>&lsquo;<samp>prog_thres</samp>&rsquo;</dt>
  33387. <dd><p>Set progressive threshold.
  33388. </p></dd>
  33389. <dt>&lsquo;<samp>rep_thres</samp>&rsquo;</dt>
  33390. <dd><p>Threshold for repeated field detection.
  33391. </p></dd>
  33392. <dt>&lsquo;<samp>half_life</samp>&rsquo;</dt>
  33393. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  33394. statistics is halved (i.e., it contributes only 0.5 to its
  33395. classification). The default of 0 means that all frames seen are given
  33396. full weight of 1.0 forever.
  33397. </p></dd>
  33398. <dt>&lsquo;<samp>analyze_interlaced_flag</samp>&rsquo;</dt>
  33399. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  33400. if the interlaced flag is accurate, it will not count undetermined frames.
  33401. If the flag is found to be accurate it will be used without any further
  33402. computations, if it is found to be inaccurate it will be cleared without any
  33403. further computations. This allows inserting the idet filter as a low computational
  33404. method to clean up the interlaced flag
  33405. </p></dd>
  33406. </dl>
  33407. <a name="il"></a>
  33408. <h2 class="section"><a href="ffmpeg-all.html#toc-il">39.106 il</a></h2>
  33409. <p>Deinterleave or interleave fields.
  33410. </p>
  33411. <p>This filter allows one to process interlaced images fields without
  33412. deinterlacing them. Deinterleaving splits the input frame into 2
  33413. fields (so called half pictures). Odd lines are moved to the top
  33414. half of the output image, even lines to the bottom half.
  33415. You can process (filter) them independently and then re-interleave them.
  33416. </p>
  33417. <p>The filter accepts the following options:
  33418. </p>
  33419. <dl compact="compact">
  33420. <dt>&lsquo;<samp>luma_mode, l</samp>&rsquo;</dt>
  33421. <dt>&lsquo;<samp>chroma_mode, c</samp>&rsquo;</dt>
  33422. <dt>&lsquo;<samp>alpha_mode, a</samp>&rsquo;</dt>
  33423. <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
  33424. <var>alpha_mode</var> are:
  33425. </p>
  33426. <dl compact="compact">
  33427. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  33428. <dd><p>Do nothing.
  33429. </p>
  33430. </dd>
  33431. <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
  33432. <dd><p>Deinterleave fields, placing one above the other.
  33433. </p>
  33434. </dd>
  33435. <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
  33436. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  33437. </p></dd>
  33438. </dl>
  33439. <p>Default value is <code>none</code>.
  33440. </p>
  33441. </dd>
  33442. <dt>&lsquo;<samp>luma_swap, ls</samp>&rsquo;</dt>
  33443. <dt>&lsquo;<samp>chroma_swap, cs</samp>&rsquo;</dt>
  33444. <dt>&lsquo;<samp>alpha_swap, as</samp>&rsquo;</dt>
  33445. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
  33446. </p></dd>
  33447. </dl>
  33448. <a name="Commands-60"></a>
  33449. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-60">39.106.1 Commands</a></h3>
  33450. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  33451. </p>
  33452. <a name="inflate"></a>
  33453. <h2 class="section"><a href="ffmpeg-all.html#toc-inflate">39.107 inflate</a></h2>
  33454. <p>Apply inflate effect to the video.
  33455. </p>
  33456. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  33457. only values higher than the pixel.
  33458. </p>
  33459. <p>It accepts the following options:
  33460. </p>
  33461. <dl compact="compact">
  33462. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  33463. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  33464. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  33465. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  33466. <dd><p>Limit the maximum change for each plane, default is 65535.
  33467. If 0, plane will remain unchanged.
  33468. </p></dd>
  33469. </dl>
  33470. <a name="Commands-11"></a>
  33471. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-11">39.107.1 Commands</a></h3>
  33472. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  33473. </p>
  33474. <a name="interlace"></a>
  33475. <h2 class="section"><a href="ffmpeg-all.html#toc-interlace">39.108 interlace</a></h2>
  33476. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  33477. lower) lines from odd frames with lower (or upper) lines from even frames,
  33478. halving the frame rate and preserving image height.
  33479. </p>
  33480. <div class="example">
  33481. <pre class="example"> Original Original New Frame
  33482. Frame 'j' Frame 'j+1' (tff)
  33483. ========== =========== ==================
  33484. Line 0 --------------------&gt; Frame 'j' Line 0
  33485. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  33486. Line 2 ---------------------&gt; Frame 'j' Line 2
  33487. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  33488. ... ... ...
  33489. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  33490. </pre></div>
  33491. <p>It accepts the following optional parameters:
  33492. </p>
  33493. <dl compact="compact">
  33494. <dt>&lsquo;<samp>scan</samp>&rsquo;</dt>
  33495. <dd><p>This determines whether the interlaced frame is taken from the even
  33496. (tff - default) or odd (bff) lines of the progressive frame.
  33497. </p>
  33498. </dd>
  33499. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  33500. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  33501. reduce moire patterns.
  33502. </p>
  33503. <dl compact="compact">
  33504. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  33505. <dd><p>Disable vertical lowpass filter
  33506. </p>
  33507. </dd>
  33508. <dt>&lsquo;<samp>1, linear</samp>&rsquo;</dt>
  33509. <dd><p>Enable linear filter (default)
  33510. </p>
  33511. </dd>
  33512. <dt>&lsquo;<samp>2, complex</samp>&rsquo;</dt>
  33513. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  33514. but better retain detail and subjective sharpness impression.
  33515. </p>
  33516. </dd>
  33517. </dl>
  33518. </dd>
  33519. </dl>
  33520. <a name="kerndeint"></a>
  33521. <h2 class="section"><a href="ffmpeg-all.html#toc-kerndeint">39.109 kerndeint</a></h2>
  33522. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  33523. deinterling. Work on interlaced parts of a video to produce
  33524. progressive frames.
  33525. </p>
  33526. <p>The description of the accepted parameters follows.
  33527. </p>
  33528. <dl compact="compact">
  33529. <dt>&lsquo;<samp>thresh</samp>&rsquo;</dt>
  33530. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  33531. determining if a pixel line must be processed. It must be an integer
  33532. in the range [0,255] and defaults to 10. A value of 0 will result in
  33533. applying the process on every pixels.
  33534. </p>
  33535. </dd>
  33536. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  33537. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  33538. Default is 0.
  33539. </p>
  33540. </dd>
  33541. <dt>&lsquo;<samp>order</samp>&rsquo;</dt>
  33542. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  33543. 0. Default is 0.
  33544. </p>
  33545. </dd>
  33546. <dt>&lsquo;<samp>sharp</samp>&rsquo;</dt>
  33547. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  33548. </p>
  33549. </dd>
  33550. <dt>&lsquo;<samp>twoway</samp>&rsquo;</dt>
  33551. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  33552. </p></dd>
  33553. </dl>
  33554. <a name="Examples-61"></a>
  33555. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-61">39.109.1 Examples</a></h3>
  33556. <ul>
  33557. <li>
  33558. Apply default values:
  33559. <div class="example">
  33560. <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  33561. </pre></div>
  33562. </li><li>
  33563. Enable additional sharpening:
  33564. <div class="example">
  33565. <pre class="example">kerndeint=sharp=1
  33566. </pre></div>
  33567. </li><li>
  33568. Paint processed pixels in white:
  33569. <div class="example">
  33570. <pre class="example">kerndeint=map=1
  33571. </pre></div>
  33572. </li></ul>
  33573. <a name="lagfun"></a>
  33574. <h2 class="section"><a href="ffmpeg-all.html#toc-lagfun">39.110 lagfun</a></h2>
  33575. <p>Slowly update darker pixels.
  33576. </p>
  33577. <p>This filter makes short flashes of light appear longer.
  33578. This filter accepts the following options:
  33579. </p>
  33580. <dl compact="compact">
  33581. <dt>&lsquo;<samp>decay</samp>&rsquo;</dt>
  33582. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  33583. </p>
  33584. </dd>
  33585. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  33586. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  33587. </p></dd>
  33588. </dl>
  33589. <a name="lenscorrection"></a>
  33590. <h2 class="section"><a href="ffmpeg-all.html#toc-lenscorrection">39.111 lenscorrection</a></h2>
  33591. <p>Correct radial lens distortion
  33592. </p>
  33593. <p>This filter can be used to correct for radial distortion as can result from the use
  33594. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  33595. one can use tools available for example as part of opencv or simply trial-and-error.
  33596. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  33597. and extract the k1 and k2 coefficients from the resulting matrix.
  33598. </p>
  33599. <p>Note that effectively the same filter is available in the open-source tools Krita and
  33600. Digikam from the KDE project.
  33601. </p>
  33602. <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  33603. this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
  33604. brightness distribution, so you may want to use both filters together in certain
  33605. cases, though you will have to take care of ordering, i.e. whether vignetting should
  33606. be applied before or after lens correction.
  33607. </p>
  33608. <a name="Options-28"></a>
  33609. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-28">39.111.1 Options</a></h3>
  33610. <p>The filter accepts the following options:
  33611. </p>
  33612. <dl compact="compact">
  33613. <dt>&lsquo;<samp>cx</samp>&rsquo;</dt>
  33614. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  33615. distortion. This value has a range [0,1] and is expressed as fractions of the image
  33616. width. Default is 0.5.
  33617. </p></dd>
  33618. <dt>&lsquo;<samp>cy</samp>&rsquo;</dt>
  33619. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  33620. distortion. This value has a range [0,1] and is expressed as fractions of the image
  33621. height. Default is 0.5.
  33622. </p></dd>
  33623. <dt>&lsquo;<samp>k1</samp>&rsquo;</dt>
  33624. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  33625. no correction. Default is 0.
  33626. </p></dd>
  33627. <dt>&lsquo;<samp>k2</samp>&rsquo;</dt>
  33628. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  33629. 0 means no correction. Default is 0.
  33630. </p></dd>
  33631. </dl>
  33632. <p>The formula that generates the correction is:
  33633. </p>
  33634. <p><var>r_src</var> = <var>r_tgt</var> * (1 + <var>k1</var> * (<var>r_tgt</var> / <var>r_0</var>)^2 + <var>k2</var> * (<var>r_tgt</var> / <var>r_0</var>)^4)
  33635. </p>
  33636. <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
  33637. distances from the focal point in the source and target images, respectively.
  33638. </p>
  33639. <a name="lensfun"></a>
  33640. <h2 class="section"><a href="ffmpeg-all.html#toc-lensfun">39.112 lensfun</a></h2>
  33641. <p>Apply lens correction via the lensfun library (<a href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  33642. </p>
  33643. <p>The <code>lensfun</code> filter requires the camera make, camera model, and lens model
  33644. to apply the lens correction. The filter will load the lensfun database and
  33645. query it to find the corresponding camera and lens entries in the database. As
  33646. long as these entries can be found with the given options, the filter can
  33647. perform corrections on frames. Note that incomplete strings will result in the
  33648. filter choosing the best match with the given options, and the filter will
  33649. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  33650. provide the make, camera model, and lens model as they are required.
  33651. </p>
  33652. <p>The filter accepts the following options:
  33653. </p>
  33654. <dl compact="compact">
  33655. <dt>&lsquo;<samp>make</samp>&rsquo;</dt>
  33656. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  33657. </p>
  33658. </dd>
  33659. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  33660. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  33661. required.
  33662. </p>
  33663. </dd>
  33664. <dt>&lsquo;<samp>lens_model</samp>&rsquo;</dt>
  33665. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  33666. option is required.
  33667. </p>
  33668. </dd>
  33669. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  33670. <dd><p>The type of correction to apply. The following values are valid options:
  33671. </p>
  33672. <dl compact="compact">
  33673. <dt>&lsquo;<samp>vignetting</samp>&rsquo;</dt>
  33674. <dd><p>Enables fixing lens vignetting.
  33675. </p>
  33676. </dd>
  33677. <dt>&lsquo;<samp>geometry</samp>&rsquo;</dt>
  33678. <dd><p>Enables fixing lens geometry. This is the default.
  33679. </p>
  33680. </dd>
  33681. <dt>&lsquo;<samp>subpixel</samp>&rsquo;</dt>
  33682. <dd><p>Enables fixing chromatic aberrations.
  33683. </p>
  33684. </dd>
  33685. <dt>&lsquo;<samp>vig_geo</samp>&rsquo;</dt>
  33686. <dd><p>Enables fixing lens vignetting and lens geometry.
  33687. </p>
  33688. </dd>
  33689. <dt>&lsquo;<samp>vig_subpixel</samp>&rsquo;</dt>
  33690. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  33691. </p>
  33692. </dd>
  33693. <dt>&lsquo;<samp>distortion</samp>&rsquo;</dt>
  33694. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  33695. </p>
  33696. </dd>
  33697. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  33698. <dd><p>Enables all possible corrections.
  33699. </p>
  33700. </dd>
  33701. </dl>
  33702. </dd>
  33703. <dt>&lsquo;<samp>focal_length</samp>&rsquo;</dt>
  33704. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  33705. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  33706. range should be chosen when using that lens. Default 18.
  33707. </p>
  33708. </dd>
  33709. <dt>&lsquo;<samp>aperture</samp>&rsquo;</dt>
  33710. <dd><p>The aperture of the image/video (expected constant for video). Note that
  33711. aperture is only used for vignetting correction. Default 3.5.
  33712. </p>
  33713. </dd>
  33714. <dt>&lsquo;<samp>focus_distance</samp>&rsquo;</dt>
  33715. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  33716. focus distance is only used for vignetting and only slightly affects the
  33717. vignetting correction process. If unknown, leave it at the default value (which
  33718. is 1000).
  33719. </p>
  33720. </dd>
  33721. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  33722. <dd><p>The scale factor which is applied after transformation. After correction the
  33723. video is no longer necessarily rectangular. This parameter controls how much of
  33724. the resulting image is visible. The value 0 means that a value will be chosen
  33725. automatically such that there is little or no unmapped area in the output
  33726. image. 1.0 means that no additional scaling is done. Lower values may result
  33727. in more of the corrected image being visible, while higher values may avoid
  33728. unmapped areas in the output.
  33729. </p>
  33730. </dd>
  33731. <dt>&lsquo;<samp>target_geometry</samp>&rsquo;</dt>
  33732. <dd><p>The target geometry of the output image/video. The following values are valid
  33733. options:
  33734. </p>
  33735. <dl compact="compact">
  33736. <dt>&lsquo;<samp>rectilinear (default)</samp>&rsquo;</dt>
  33737. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  33738. <dt>&lsquo;<samp>panoramic</samp>&rsquo;</dt>
  33739. <dt>&lsquo;<samp>equirectangular</samp>&rsquo;</dt>
  33740. <dt>&lsquo;<samp>fisheye_orthographic</samp>&rsquo;</dt>
  33741. <dt>&lsquo;<samp>fisheye_stereographic</samp>&rsquo;</dt>
  33742. <dt>&lsquo;<samp>fisheye_equisolid</samp>&rsquo;</dt>
  33743. <dt>&lsquo;<samp>fisheye_thoby</samp>&rsquo;</dt>
  33744. </dl>
  33745. </dd>
  33746. <dt>&lsquo;<samp>reverse</samp>&rsquo;</dt>
  33747. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  33748. it).
  33749. </p>
  33750. </dd>
  33751. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  33752. <dd><p>The type of interpolation used when correcting distortion. The following values
  33753. are valid options:
  33754. </p>
  33755. <dl compact="compact">
  33756. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  33757. <dt>&lsquo;<samp>linear (default)</samp>&rsquo;</dt>
  33758. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  33759. </dl>
  33760. </dd>
  33761. </dl>
  33762. <a name="Examples-58"></a>
  33763. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-58">39.112.1 Examples</a></h3>
  33764. <ul>
  33765. <li>
  33766. Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  33767. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  33768. aperture of &quot;8.0&quot;.
  33769. <div class="example">
  33770. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
  33771. </pre></div>
  33772. </li><li>
  33773. Apply the same as before, but only for the first 5 seconds of video.
  33774. <div class="example">
  33775. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
  33776. </pre></div>
  33777. </li></ul>
  33778. <a name="libvmaf"></a>
  33779. <h2 class="section"><a href="ffmpeg-all.html#toc-libvmaf">39.113 libvmaf</a></h2>
  33780. <p>Obtain the VMAF (Video Multi-Method Assessment Fusion)
  33781. score between two input videos.
  33782. </p>
  33783. <p>The obtained VMAF score is printed through the logging system.
  33784. </p>
  33785. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  33786. After installing the library it can be enabled using:
  33787. <code>./configure --enable-libvmaf --enable-version3</code>.
  33788. If no model path is specified it uses the default model: <code>vmaf_v0.6.1.pkl</code>.
  33789. </p>
  33790. <p>The filter has following options:
  33791. </p>
  33792. <dl compact="compact">
  33793. <dt>&lsquo;<samp>model_path</samp>&rsquo;</dt>
  33794. <dd><p>Set the model path which is to be used for SVM.
  33795. Default value: <code>&quot;/usr/local/share/model/vmaf_v0.6.1.pkl&quot;</code>
  33796. </p>
  33797. </dd>
  33798. <dt>&lsquo;<samp>log_path</samp>&rsquo;</dt>
  33799. <dd><p>Set the file path to be used to store logs.
  33800. </p>
  33801. </dd>
  33802. <dt>&lsquo;<samp>log_fmt</samp>&rsquo;</dt>
  33803. <dd><p>Set the format of the log file (xml or json).
  33804. </p>
  33805. </dd>
  33806. <dt>&lsquo;<samp>enable_transform</samp>&rsquo;</dt>
  33807. <dd><p>This option can enable/disable the <code>score_transform</code> applied to the final predicted VMAF score,
  33808. if you have specified score_transform option in the input parameter file passed to <code>run_vmaf_training.py</code>
  33809. Default value: <code>false</code>
  33810. </p>
  33811. </dd>
  33812. <dt>&lsquo;<samp>phone_model</samp>&rsquo;</dt>
  33813. <dd><p>Invokes the phone model which will generate VMAF scores higher than in the
  33814. regular model, which is more suitable for laptop, TV, etc. viewing conditions.
  33815. Default value: <code>false</code>
  33816. </p>
  33817. </dd>
  33818. <dt>&lsquo;<samp>psnr</samp>&rsquo;</dt>
  33819. <dd><p>Enables computing psnr along with vmaf.
  33820. Default value: <code>false</code>
  33821. </p>
  33822. </dd>
  33823. <dt>&lsquo;<samp>ssim</samp>&rsquo;</dt>
  33824. <dd><p>Enables computing ssim along with vmaf.
  33825. Default value: <code>false</code>
  33826. </p>
  33827. </dd>
  33828. <dt>&lsquo;<samp>ms_ssim</samp>&rsquo;</dt>
  33829. <dd><p>Enables computing ms_ssim along with vmaf.
  33830. Default value: <code>false</code>
  33831. </p>
  33832. </dd>
  33833. <dt>&lsquo;<samp>pool</samp>&rsquo;</dt>
  33834. <dd><p>Set the pool method to be used for computing vmaf.
  33835. Options are <code>min</code>, <code>harmonic_mean</code> or <code>mean</code> (default).
  33836. </p>
  33837. </dd>
  33838. <dt>&lsquo;<samp>n_threads</samp>&rsquo;</dt>
  33839. <dd><p>Set number of threads to be used when computing vmaf.
  33840. Default value: <code>0</code>, which makes use of all available logical processors.
  33841. </p>
  33842. </dd>
  33843. <dt>&lsquo;<samp>n_subsample</samp>&rsquo;</dt>
  33844. <dd><p>Set interval for frame subsampling used when computing vmaf.
  33845. Default value: <code>1</code>
  33846. </p>
  33847. </dd>
  33848. <dt>&lsquo;<samp>enable_conf_interval</samp>&rsquo;</dt>
  33849. <dd><p>Enables confidence interval.
  33850. Default value: <code>false</code>
  33851. </p></dd>
  33852. </dl>
  33853. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  33854. </p>
  33855. <a name="Examples-173"></a>
  33856. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-173">39.113.1 Examples</a></h3>
  33857. <ul>
  33858. <li>
  33859. On the below examples the input file &lsquo;<tt>main.mpg</tt>&rsquo; being processed is
  33860. compared with the reference file &lsquo;<tt>ref.mpg</tt>&rsquo;.
  33861. <div class="example">
  33862. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
  33863. </pre></div>
  33864. </li><li>
  33865. Example with options:
  33866. <div class="example">
  33867. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf=&quot;psnr=1:log_fmt=json&quot; -f null -
  33868. </pre></div>
  33869. </li><li>
  33870. Example with options and different containers:
  33871. <div class="example">
  33872. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=psnr=1:log_fmt=json&quot; -f null -
  33873. </pre></div>
  33874. </li></ul>
  33875. <a name="limiter"></a>
  33876. <h2 class="section"><a href="ffmpeg-all.html#toc-limiter">39.114 limiter</a></h2>
  33877. <p>Limits the pixel components values to the specified range [min, max].
  33878. </p>
  33879. <p>The filter accepts the following options:
  33880. </p>
  33881. <dl compact="compact">
  33882. <dt>&lsquo;<samp>min</samp>&rsquo;</dt>
  33883. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  33884. </p>
  33885. </dd>
  33886. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  33887. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  33888. </p>
  33889. </dd>
  33890. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  33891. <dd><p>Specify which planes will be processed. Defaults to all available.
  33892. </p></dd>
  33893. </dl>
  33894. <a name="loop"></a>
  33895. <h2 class="section"><a href="ffmpeg-all.html#toc-loop">39.115 loop</a></h2>
  33896. <p>Loop video frames.
  33897. </p>
  33898. <p>The filter accepts the following options:
  33899. </p>
  33900. <dl compact="compact">
  33901. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  33902. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  33903. Default is 0.
  33904. </p>
  33905. </dd>
  33906. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  33907. <dd><p>Set maximal size in number of frames. Default is 0.
  33908. </p>
  33909. </dd>
  33910. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  33911. <dd><p>Set first frame of loop. Default is 0.
  33912. </p></dd>
  33913. </dl>
  33914. <a name="Examples-31"></a>
  33915. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-31">39.115.1 Examples</a></h3>
  33916. <ul>
  33917. <li>
  33918. Loop single first frame infinitely:
  33919. <div class="example">
  33920. <pre class="example">loop=loop=-1:size=1:start=0
  33921. </pre></div>
  33922. </li><li>
  33923. Loop single first frame 10 times:
  33924. <div class="example">
  33925. <pre class="example">loop=loop=10:size=1:start=0
  33926. </pre></div>
  33927. </li><li>
  33928. Loop 10 first frames 5 times:
  33929. <div class="example">
  33930. <pre class="example">loop=loop=5:size=10:start=0
  33931. </pre></div>
  33932. </li></ul>
  33933. <a name="lut1d"></a>
  33934. <h2 class="section"><a href="ffmpeg-all.html#toc-lut1d">39.116 lut1d</a></h2>
  33935. <p>Apply a 1D LUT to an input video.
  33936. </p>
  33937. <p>The filter accepts the following options:
  33938. </p>
  33939. <dl compact="compact">
  33940. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  33941. <dd><p>Set the 1D LUT file name.
  33942. </p>
  33943. <p>Currently supported formats:
  33944. </p><dl compact="compact">
  33945. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  33946. <dd><p>Iridas
  33947. </p></dd>
  33948. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  33949. <dd><p>cineSpace
  33950. </p></dd>
  33951. </dl>
  33952. </dd>
  33953. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  33954. <dd><p>Select interpolation mode.
  33955. </p>
  33956. <p>Available values are:
  33957. </p>
  33958. <dl compact="compact">
  33959. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  33960. <dd><p>Use values from the nearest defined point.
  33961. </p></dd>
  33962. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  33963. <dd><p>Interpolate values using the linear interpolation.
  33964. </p></dd>
  33965. <dt>&lsquo;<samp>cosine</samp>&rsquo;</dt>
  33966. <dd><p>Interpolate values using the cosine interpolation.
  33967. </p></dd>
  33968. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  33969. <dd><p>Interpolate values using the cubic interpolation.
  33970. </p></dd>
  33971. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  33972. <dd><p>Interpolate values using the spline interpolation.
  33973. </p></dd>
  33974. </dl>
  33975. </dd>
  33976. </dl>
  33977. <p><a name="lut3d"></a>
  33978. </p><a name="lut3d-1"></a>
  33979. <h2 class="section"><a href="ffmpeg-all.html#toc-lut3d-1">39.117 lut3d</a></h2>
  33980. <p>Apply a 3D LUT to an input video.
  33981. </p>
  33982. <p>The filter accepts the following options:
  33983. </p>
  33984. <dl compact="compact">
  33985. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  33986. <dd><p>Set the 3D LUT file name.
  33987. </p>
  33988. <p>Currently supported formats:
  33989. </p><dl compact="compact">
  33990. <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
  33991. <dd><p>AfterEffects
  33992. </p></dd>
  33993. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  33994. <dd><p>Iridas
  33995. </p></dd>
  33996. <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
  33997. <dd><p>DaVinci
  33998. </p></dd>
  33999. <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
  34000. <dd><p>Pandora
  34001. </p></dd>
  34002. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  34003. <dd><p>cineSpace
  34004. </p></dd>
  34005. </dl>
  34006. </dd>
  34007. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  34008. <dd><p>Select interpolation mode.
  34009. </p>
  34010. <p>Available values are:
  34011. </p>
  34012. <dl compact="compact">
  34013. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  34014. <dd><p>Use values from the nearest defined point.
  34015. </p></dd>
  34016. <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
  34017. <dd><p>Interpolate values using the 8 points defining a cube.
  34018. </p></dd>
  34019. <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
  34020. <dd><p>Interpolate values using a tetrahedron.
  34021. </p></dd>
  34022. </dl>
  34023. </dd>
  34024. </dl>
  34025. <a name="lumakey"></a>
  34026. <h2 class="section"><a href="ffmpeg-all.html#toc-lumakey">39.118 lumakey</a></h2>
  34027. <p>Turn certain luma values into transparency.
  34028. </p>
  34029. <p>The filter accepts the following options:
  34030. </p>
  34031. <dl compact="compact">
  34032. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  34033. <dd><p>Set the luma which will be used as base for transparency.
  34034. Default value is <code>0</code>.
  34035. </p>
  34036. </dd>
  34037. <dt>&lsquo;<samp>tolerance</samp>&rsquo;</dt>
  34038. <dd><p>Set the range of luma values to be keyed out.
  34039. Default value is <code>0.01</code>.
  34040. </p>
  34041. </dd>
  34042. <dt>&lsquo;<samp>softness</samp>&rsquo;</dt>
  34043. <dd><p>Set the range of softness. Default value is <code>0</code>.
  34044. Use this to control gradual transition from zero to full transparency.
  34045. </p></dd>
  34046. </dl>
  34047. <a name="Commands-48"></a>
  34048. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-48">39.118.1 Commands</a></h3>
  34049. <p>This filter supports same <a href="#commands">commands</a> as options.
  34050. The command accepts the same syntax of the corresponding option.
  34051. </p>
  34052. <p>If the specified expression is not valid, it is kept at its current
  34053. value.
  34054. </p>
  34055. <a name="lut_002c-lutrgb_002c-lutyuv"></a>
  34056. <h2 class="section"><a href="ffmpeg-all.html#toc-lut_002c-lutrgb_002c-lutyuv">39.119 lut, lutrgb, lutyuv</a></h2>
  34057. <p>Compute a look-up table for binding each pixel component input value
  34058. to an output value, and apply it to the input video.
  34059. </p>
  34060. <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
  34061. to an RGB input video.
  34062. </p>
  34063. <p>These filters accept the following parameters:
  34064. </p><dl compact="compact">
  34065. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  34066. <dd><p>set first pixel component expression
  34067. </p></dd>
  34068. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  34069. <dd><p>set second pixel component expression
  34070. </p></dd>
  34071. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  34072. <dd><p>set third pixel component expression
  34073. </p></dd>
  34074. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  34075. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  34076. </p>
  34077. </dd>
  34078. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  34079. <dd><p>set red component expression
  34080. </p></dd>
  34081. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  34082. <dd><p>set green component expression
  34083. </p></dd>
  34084. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  34085. <dd><p>set blue component expression
  34086. </p></dd>
  34087. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  34088. <dd><p>alpha component expression
  34089. </p>
  34090. </dd>
  34091. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  34092. <dd><p>set Y/luminance component expression
  34093. </p></dd>
  34094. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  34095. <dd><p>set U/Cb component expression
  34096. </p></dd>
  34097. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  34098. <dd><p>set V/Cr component expression
  34099. </p></dd>
  34100. </dl>
  34101. <p>Each of them specifies the expression to use for computing the lookup table for
  34102. the corresponding pixel component values.
  34103. </p>
  34104. <p>The exact component associated to each of the <var>c*</var> options depends on the
  34105. format in input.
  34106. </p>
  34107. <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
  34108. <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
  34109. </p>
  34110. <p>The expressions can contain the following constants and functions:
  34111. </p>
  34112. <dl compact="compact">
  34113. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  34114. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  34115. <dd><p>The input width and height.
  34116. </p>
  34117. </dd>
  34118. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  34119. <dd><p>The input value for the pixel component.
  34120. </p>
  34121. </dd>
  34122. <dt>&lsquo;<samp>clipval</samp>&rsquo;</dt>
  34123. <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
  34124. </p>
  34125. </dd>
  34126. <dt>&lsquo;<samp>maxval</samp>&rsquo;</dt>
  34127. <dd><p>The maximum value for the pixel component.
  34128. </p>
  34129. </dd>
  34130. <dt>&lsquo;<samp>minval</samp>&rsquo;</dt>
  34131. <dd><p>The minimum value for the pixel component.
  34132. </p>
  34133. </dd>
  34134. <dt>&lsquo;<samp>negval</samp>&rsquo;</dt>
  34135. <dd><p>The negated value for the pixel component value, clipped to the
  34136. <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
  34137. &quot;maxval-clipval+minval&quot;.
  34138. </p>
  34139. </dd>
  34140. <dt>&lsquo;<samp>clip(val)</samp>&rsquo;</dt>
  34141. <dd><p>The computed value in <var>val</var>, clipped to the
  34142. <var>minval</var>-<var>maxval</var> range.
  34143. </p>
  34144. </dd>
  34145. <dt>&lsquo;<samp>gammaval(gamma)</samp>&rsquo;</dt>
  34146. <dd><p>The computed gamma correction value of the pixel component value,
  34147. clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
  34148. expression
  34149. &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
  34150. </p>
  34151. </dd>
  34152. </dl>
  34153. <p>All expressions default to &quot;val&quot;.
  34154. </p>
  34155. <a name="Examples-14"></a>
  34156. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-14">39.119.1 Examples</a></h3>
  34157. <ul>
  34158. <li>
  34159. Negate input video:
  34160. <div class="example">
  34161. <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  34162. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  34163. </pre></div>
  34164. <p>The above is the same as:
  34165. </p><div class="example">
  34166. <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  34167. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  34168. </pre></div>
  34169. </li><li>
  34170. Negate luminance:
  34171. <div class="example">
  34172. <pre class="example">lutyuv=y=negval
  34173. </pre></div>
  34174. </li><li>
  34175. Remove chroma components, turning the video into a graytone image:
  34176. <div class="example">
  34177. <pre class="example">lutyuv=&quot;u=128:v=128&quot;
  34178. </pre></div>
  34179. </li><li>
  34180. Apply a luma burning effect:
  34181. <div class="example">
  34182. <pre class="example">lutyuv=&quot;y=2*val&quot;
  34183. </pre></div>
  34184. </li><li>
  34185. Remove green and blue components:
  34186. <div class="example">
  34187. <pre class="example">lutrgb=&quot;g=0:b=0&quot;
  34188. </pre></div>
  34189. </li><li>
  34190. Set a constant alpha channel value on input:
  34191. <div class="example">
  34192. <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  34193. </pre></div>
  34194. </li><li>
  34195. Correct luminance gamma by a factor of 0.5:
  34196. <div class="example">
  34197. <pre class="example">lutyuv=y=gammaval(0.5)
  34198. </pre></div>
  34199. </li><li>
  34200. Discard least significant bits of luma:
  34201. <div class="example">
  34202. <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
  34203. </pre></div>
  34204. </li><li>
  34205. Technicolor like effect:
  34206. <div class="example">
  34207. <pre class="example">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  34208. </pre></div>
  34209. </li></ul>
  34210. <a name="lut2_002c-tlut2"></a>
  34211. <h2 class="section"><a href="ffmpeg-all.html#toc-lut2_002c-tlut2">39.120 lut2, tlut2</a></h2>
  34212. <p>The <code>lut2</code> filter takes two input streams and outputs one
  34213. stream.
  34214. </p>
  34215. <p>The <code>tlut2</code> (time lut2) filter takes two consecutive frames
  34216. from one single stream.
  34217. </p>
  34218. <p>This filter accepts the following parameters:
  34219. </p><dl compact="compact">
  34220. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  34221. <dd><p>set first pixel component expression
  34222. </p></dd>
  34223. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  34224. <dd><p>set second pixel component expression
  34225. </p></dd>
  34226. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  34227. <dd><p>set third pixel component expression
  34228. </p></dd>
  34229. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  34230. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  34231. </p>
  34232. </dd>
  34233. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  34234. <dd><p>set output bit depth, only available for <code>lut2</code> filter. By default is 0,
  34235. which means bit depth is automatically picked from first input format.
  34236. </p></dd>
  34237. </dl>
  34238. <p>The <code>lut2</code> filter also supports the <a href="#framesync">framesync</a> options.
  34239. </p>
  34240. <p>Each of them specifies the expression to use for computing the lookup table for
  34241. the corresponding pixel component values.
  34242. </p>
  34243. <p>The exact component associated to each of the <var>c*</var> options depends on the
  34244. format in inputs.
  34245. </p>
  34246. <p>The expressions can contain the following constants:
  34247. </p>
  34248. <dl compact="compact">
  34249. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  34250. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  34251. <dd><p>The input width and height.
  34252. </p>
  34253. </dd>
  34254. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  34255. <dd><p>The first input value for the pixel component.
  34256. </p>
  34257. </dd>
  34258. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  34259. <dd><p>The second input value for the pixel component.
  34260. </p>
  34261. </dd>
  34262. <dt>&lsquo;<samp>bdx</samp>&rsquo;</dt>
  34263. <dd><p>The first input video bit depth.
  34264. </p>
  34265. </dd>
  34266. <dt>&lsquo;<samp>bdy</samp>&rsquo;</dt>
  34267. <dd><p>The second input video bit depth.
  34268. </p></dd>
  34269. </dl>
  34270. <p>All expressions default to &quot;x&quot;.
  34271. </p>
  34272. <a name="Examples-136"></a>
  34273. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-136">39.120.1 Examples</a></h3>
  34274. <ul>
  34275. <li>
  34276. Highlight differences between two RGB video streams:
  34277. <div class="example">
  34278. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
  34279. </pre></div>
  34280. </li><li>
  34281. Highlight differences between two YUV video streams:
  34282. <div class="example">
  34283. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
  34284. </pre></div>
  34285. </li><li>
  34286. Show max difference between two video streams:
  34287. <div class="example">
  34288. <pre class="example">lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
  34289. </pre></div>
  34290. </li></ul>
  34291. <a name="maskedclamp"></a>
  34292. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedclamp">39.121 maskedclamp</a></h2>
  34293. <p>Clamp the first input stream with the second input and third input stream.
  34294. </p>
  34295. <p>Returns the value of first stream to be between second input
  34296. stream - <code>undershoot</code> and third input stream + <code>overshoot</code>.
  34297. </p>
  34298. <p>This filter accepts the following options:
  34299. </p><dl compact="compact">
  34300. <dt>&lsquo;<samp>undershoot</samp>&rsquo;</dt>
  34301. <dd><p>Default value is <code>0</code>.
  34302. </p>
  34303. </dd>
  34304. <dt>&lsquo;<samp>overshoot</samp>&rsquo;</dt>
  34305. <dd><p>Default value is <code>0</code>.
  34306. </p>
  34307. </dd>
  34308. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34309. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34310. copied from first stream.
  34311. By default value 0xf, all planes will be processed.
  34312. </p></dd>
  34313. </dl>
  34314. <a name="maskedmax"></a>
  34315. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmax">39.122 maskedmax</a></h2>
  34316. <p>Merge the second and third input stream into output stream using absolute differences
  34317. between second input stream and first input stream and absolute difference between
  34318. third input stream and first input stream. The picked value will be from second input
  34319. stream if second absolute difference is greater than first one or from third input stream
  34320. otherwise.
  34321. </p>
  34322. <p>This filter accepts the following options:
  34323. </p><dl compact="compact">
  34324. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34325. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34326. copied from first stream.
  34327. By default value 0xf, all planes will be processed.
  34328. </p></dd>
  34329. </dl>
  34330. <a name="maskedmerge"></a>
  34331. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmerge">39.123 maskedmerge</a></h2>
  34332. <p>Merge the first input stream with the second input stream using per pixel
  34333. weights in the third input stream.
  34334. </p>
  34335. <p>A value of 0 in the third stream pixel component means that pixel component
  34336. from first stream is returned unchanged, while maximum value (eg. 255 for
  34337. 8-bit videos) means that pixel component from second stream is returned
  34338. unchanged. Intermediate values define the amount of merging between both
  34339. input stream&rsquo;s pixel components.
  34340. </p>
  34341. <p>This filter accepts the following options:
  34342. </p><dl compact="compact">
  34343. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34344. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34345. copied from first stream.
  34346. By default value 0xf, all planes will be processed.
  34347. </p></dd>
  34348. </dl>
  34349. <a name="maskedmin"></a>
  34350. <h2 class="section"><a href="ffmpeg-all.html#toc-maskedmin">39.124 maskedmin</a></h2>
  34351. <p>Merge the second and third input stream into output stream using absolute differences
  34352. between second input stream and first input stream and absolute difference between
  34353. third input stream and first input stream. The picked value will be from second input
  34354. stream if second absolute difference is less than first one or from third input stream
  34355. otherwise.
  34356. </p>
  34357. <p>This filter accepts the following options:
  34358. </p><dl compact="compact">
  34359. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34360. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  34361. copied from first stream.
  34362. By default value 0xf, all planes will be processed.
  34363. </p></dd>
  34364. </dl>
  34365. <a name="maskfun"></a>
  34366. <h2 class="section"><a href="ffmpeg-all.html#toc-maskfun">39.125 maskfun</a></h2>
  34367. <p>Create mask from input video.
  34368. </p>
  34369. <p>For example it is useful to create motion masks after <code>tblend</code> filter.
  34370. </p>
  34371. <p>This filter accepts the following options:
  34372. </p>
  34373. <dl compact="compact">
  34374. <dt>&lsquo;<samp>low</samp>&rsquo;</dt>
  34375. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  34376. </p>
  34377. </dd>
  34378. <dt>&lsquo;<samp>high</samp>&rsquo;</dt>
  34379. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  34380. allowed for current pixel format.
  34381. </p>
  34382. </dd>
  34383. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34384. <dd><p>Set planes to filter, by default all available planes are filtered.
  34385. </p>
  34386. </dd>
  34387. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  34388. <dd><p>Fill all frame pixels with this value.
  34389. </p>
  34390. </dd>
  34391. <dt>&lsquo;<samp>sum</samp>&rsquo;</dt>
  34392. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  34393. average, output frame will be completely filled with value set by <var>fill</var> option.
  34394. Typically useful for scene changes when used in combination with <code>tblend</code> filter.
  34395. </p></dd>
  34396. </dl>
  34397. <a name="mcdeint"></a>
  34398. <h2 class="section"><a href="ffmpeg-all.html#toc-mcdeint">39.126 mcdeint</a></h2>
  34399. <p>Apply motion-compensation deinterlacing.
  34400. </p>
  34401. <p>It needs one field per frame as input and must thus be used together
  34402. with yadif=1/3 or equivalent.
  34403. </p>
  34404. <p>This filter accepts the following options:
  34405. </p><dl compact="compact">
  34406. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  34407. <dd><p>Set the deinterlacing mode.
  34408. </p>
  34409. <p>It accepts one of the following values:
  34410. </p><dl compact="compact">
  34411. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  34412. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  34413. <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
  34414. <dd><p>use iterative motion estimation
  34415. </p></dd>
  34416. <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
  34417. <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
  34418. </p></dd>
  34419. </dl>
  34420. <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
  34421. </p>
  34422. </dd>
  34423. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  34424. <dd><p>Set the picture field parity assumed for the input video. It must be
  34425. one of the following values:
  34426. </p>
  34427. <dl compact="compact">
  34428. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  34429. <dd><p>assume top field first
  34430. </p></dd>
  34431. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  34432. <dd><p>assume bottom field first
  34433. </p></dd>
  34434. </dl>
  34435. <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
  34436. </p>
  34437. </dd>
  34438. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  34439. <dd><p>Set per-block quantization parameter (QP) used by the internal
  34440. encoder.
  34441. </p>
  34442. <p>Higher values should result in a smoother motion vector field but less
  34443. optimal individual vectors. Default value is 1.
  34444. </p></dd>
  34445. </dl>
  34446. <a name="median"></a>
  34447. <h2 class="section"><a href="ffmpeg-all.html#toc-median">39.127 median</a></h2>
  34448. <p>Pick median pixel from certain rectangle defined by radius.
  34449. </p>
  34450. <p>This filter accepts the following options:
  34451. </p>
  34452. <dl compact="compact">
  34453. <dt>&lsquo;<samp>radius</samp>&rsquo;</dt>
  34454. <dd><p>Set horizontal radius size. Default value is <code>1</code>.
  34455. Allowed range is integer from 1 to 127.
  34456. </p>
  34457. </dd>
  34458. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34459. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  34460. </p>
  34461. </dd>
  34462. <dt>&lsquo;<samp>radiusV</samp>&rsquo;</dt>
  34463. <dd><p>Set vertical radius size. Default value is <code>0</code>.
  34464. Allowed range is integer from 0 to 127.
  34465. If it is 0, value will be picked from horizontal <code>radius</code> option.
  34466. </p>
  34467. </dd>
  34468. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  34469. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  34470. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  34471. minimum values, and <code>1</code> maximum values.
  34472. </p></dd>
  34473. </dl>
  34474. <a name="Commands-58"></a>
  34475. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-58">39.127.1 Commands</a></h3>
  34476. <p>This filter supports same <a href="#commands">commands</a> as options.
  34477. The command accepts the same syntax of the corresponding option.
  34478. </p>
  34479. <p>If the specified expression is not valid, it is kept at its current
  34480. value.
  34481. </p>
  34482. <a name="mergeplanes"></a>
  34483. <h2 class="section"><a href="ffmpeg-all.html#toc-mergeplanes">39.128 mergeplanes</a></h2>
  34484. <p>Merge color channel components from several video streams.
  34485. </p>
  34486. <p>The filter accepts up to 4 input streams, and merge selected input
  34487. planes to the output video.
  34488. </p>
  34489. <p>This filter accepts the following options:
  34490. </p><dl compact="compact">
  34491. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  34492. <dd><p>Set input to output plane mapping. Default is <code>0</code>.
  34493. </p>
  34494. <p>The mappings is specified as a bitmap. It should be specified as a
  34495. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  34496. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  34497. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  34498. corresponding input to use (from 0 to 3). The rest of the mappings is
  34499. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  34500. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  34501. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  34502. </p>
  34503. </dd>
  34504. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  34505. <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
  34506. </p></dd>
  34507. </dl>
  34508. <a name="Examples-27"></a>
  34509. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-27">39.128.1 Examples</a></h3>
  34510. <ul>
  34511. <li>
  34512. Merge three gray video streams of same width and height into single video stream:
  34513. <div class="example">
  34514. <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  34515. </pre></div>
  34516. </li><li>
  34517. Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  34518. <div class="example">
  34519. <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
  34520. </pre></div>
  34521. </li><li>
  34522. Swap Y and A plane in yuva444p stream:
  34523. <div class="example">
  34524. <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
  34525. </pre></div>
  34526. </li><li>
  34527. Swap U and V plane in yuv420p stream:
  34528. <div class="example">
  34529. <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
  34530. </pre></div>
  34531. </li><li>
  34532. Cast a rgb24 clip to yuv444p:
  34533. <div class="example">
  34534. <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
  34535. </pre></div>
  34536. </li></ul>
  34537. <a name="mestimate"></a>
  34538. <h2 class="section"><a href="ffmpeg-all.html#toc-mestimate">39.129 mestimate</a></h2>
  34539. <p>Estimate and export motion vectors using block matching algorithms.
  34540. Motion vectors are stored in frame side data to be used by other filters.
  34541. </p>
  34542. <p>This filter accepts the following options:
  34543. </p><dl compact="compact">
  34544. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  34545. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  34546. </p>
  34547. <dl compact="compact">
  34548. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  34549. <dd><p>Exhaustive search algorithm.
  34550. </p></dd>
  34551. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  34552. <dd><p>Three step search algorithm.
  34553. </p></dd>
  34554. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  34555. <dd><p>Two dimensional logarithmic search algorithm.
  34556. </p></dd>
  34557. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  34558. <dd><p>New three step search algorithm.
  34559. </p></dd>
  34560. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  34561. <dd><p>Four step search algorithm.
  34562. </p></dd>
  34563. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  34564. <dd><p>Diamond search algorithm.
  34565. </p></dd>
  34566. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  34567. <dd><p>Hexagon-based search algorithm.
  34568. </p></dd>
  34569. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  34570. <dd><p>Enhanced predictive zonal search algorithm.
  34571. </p></dd>
  34572. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  34573. <dd><p>Uneven multi-hexagon search algorithm.
  34574. </p></dd>
  34575. </dl>
  34576. <p>Default value is &lsquo;<samp>esa</samp>&rsquo;.
  34577. </p>
  34578. </dd>
  34579. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  34580. <dd><p>Macroblock size. Default <code>16</code>.
  34581. </p>
  34582. </dd>
  34583. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  34584. <dd><p>Search parameter. Default <code>7</code>.
  34585. </p></dd>
  34586. </dl>
  34587. <a name="midequalizer"></a>
  34588. <h2 class="section"><a href="ffmpeg-all.html#toc-midequalizer">39.130 midequalizer</a></h2>
  34589. <p>Apply Midway Image Equalization effect using two video streams.
  34590. </p>
  34591. <p>Midway Image Equalization adjusts a pair of images to have the same
  34592. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  34593. useful for e.g. matching exposures from a pair of stereo cameras.
  34594. </p>
  34595. <p>This filter has two inputs and one output, which must be of same pixel format, but
  34596. may be of different sizes. The output of filter is first input adjusted with
  34597. midway histogram of both inputs.
  34598. </p>
  34599. <p>This filter accepts the following option:
  34600. </p>
  34601. <dl compact="compact">
  34602. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34603. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  34604. </p></dd>
  34605. </dl>
  34606. <a name="minterpolate"></a>
  34607. <h2 class="section"><a href="ffmpeg-all.html#toc-minterpolate">39.131 minterpolate</a></h2>
  34608. <p>Convert the video to specified frame rate using motion interpolation.
  34609. </p>
  34610. <p>This filter accepts the following options:
  34611. </p><dl compact="compact">
  34612. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  34613. <dd><p>Specify the output frame rate. This can be rational e.g. <code>60000/1001</code>. Frames are dropped if <var>fps</var> is lower than source fps. Default <code>60</code>.
  34614. </p>
  34615. </dd>
  34616. <dt>&lsquo;<samp>mi_mode</samp>&rsquo;</dt>
  34617. <dd><p>Motion interpolation mode. Following values are accepted:
  34618. </p><dl compact="compact">
  34619. <dt>&lsquo;<samp>dup</samp>&rsquo;</dt>
  34620. <dd><p>Duplicate previous or next frame for interpolating new ones.
  34621. </p></dd>
  34622. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  34623. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  34624. </p></dd>
  34625. <dt>&lsquo;<samp>mci</samp>&rsquo;</dt>
  34626. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  34627. </p>
  34628. <dl compact="compact">
  34629. <dt>&lsquo;<samp>mc_mode</samp>&rsquo;</dt>
  34630. <dd><p>Motion compensation mode. Following values are accepted:
  34631. </p><dl compact="compact">
  34632. <dt>&lsquo;<samp>obmc</samp>&rsquo;</dt>
  34633. <dd><p>Overlapped block motion compensation.
  34634. </p></dd>
  34635. <dt>&lsquo;<samp>aobmc</samp>&rsquo;</dt>
  34636. <dd><p>Adaptive overlapped block motion compensation. Window weighting coefficients are controlled adaptively according to the reliabilities of the neighboring motion vectors to reduce oversmoothing.
  34637. </p></dd>
  34638. </dl>
  34639. <p>Default mode is &lsquo;<samp>obmc</samp>&rsquo;.
  34640. </p>
  34641. </dd>
  34642. <dt>&lsquo;<samp>me_mode</samp>&rsquo;</dt>
  34643. <dd><p>Motion estimation mode. Following values are accepted:
  34644. </p><dl compact="compact">
  34645. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  34646. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  34647. </p></dd>
  34648. <dt>&lsquo;<samp>bilat</samp>&rsquo;</dt>
  34649. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  34650. </p></dd>
  34651. </dl>
  34652. <p>Default mode is &lsquo;<samp>bilat</samp>&rsquo;.
  34653. </p>
  34654. </dd>
  34655. <dt>&lsquo;<samp>me</samp>&rsquo;</dt>
  34656. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  34657. </p><dl compact="compact">
  34658. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  34659. <dd><p>Exhaustive search algorithm.
  34660. </p></dd>
  34661. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  34662. <dd><p>Three step search algorithm.
  34663. </p></dd>
  34664. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  34665. <dd><p>Two dimensional logarithmic search algorithm.
  34666. </p></dd>
  34667. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  34668. <dd><p>New three step search algorithm.
  34669. </p></dd>
  34670. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  34671. <dd><p>Four step search algorithm.
  34672. </p></dd>
  34673. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  34674. <dd><p>Diamond search algorithm.
  34675. </p></dd>
  34676. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  34677. <dd><p>Hexagon-based search algorithm.
  34678. </p></dd>
  34679. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  34680. <dd><p>Enhanced predictive zonal search algorithm.
  34681. </p></dd>
  34682. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  34683. <dd><p>Uneven multi-hexagon search algorithm.
  34684. </p></dd>
  34685. </dl>
  34686. <p>Default algorithm is &lsquo;<samp>epzs</samp>&rsquo;.
  34687. </p>
  34688. </dd>
  34689. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  34690. <dd><p>Macroblock size. Default <code>16</code>.
  34691. </p>
  34692. </dd>
  34693. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  34694. <dd><p>Motion estimation search parameter. Default <code>32</code>.
  34695. </p>
  34696. </dd>
  34697. <dt>&lsquo;<samp>vsbmc</samp>&rsquo;</dt>
  34698. <dd><p>Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is <code>0</code> (disabled).
  34699. </p></dd>
  34700. </dl>
  34701. </dd>
  34702. </dl>
  34703. </dd>
  34704. <dt>&lsquo;<samp>scd</samp>&rsquo;</dt>
  34705. <dd><p>Scene change detection method. Scene change leads motion vectors to be in random direction. Scene change detection replace interpolated frames by duplicate ones. May not be needed for other modes. Following values are accepted:
  34706. </p><dl compact="compact">
  34707. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  34708. <dd><p>Disable scene change detection.
  34709. </p></dd>
  34710. <dt>&lsquo;<samp>fdiff</samp>&rsquo;</dt>
  34711. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var>scd_threshold</var> scene change is detected.
  34712. </p></dd>
  34713. </dl>
  34714. <p>Default method is &lsquo;<samp>fdiff</samp>&rsquo;.
  34715. </p>
  34716. </dd>
  34717. <dt>&lsquo;<samp>scd_threshold</samp>&rsquo;</dt>
  34718. <dd><p>Scene change detection threshold. Default is <code>5.0</code>.
  34719. </p></dd>
  34720. </dl>
  34721. <a name="mix"></a>
  34722. <h2 class="section"><a href="ffmpeg-all.html#toc-mix">39.132 mix</a></h2>
  34723. <p>Mix several video input streams into one video stream.
  34724. </p>
  34725. <p>A description of the accepted options follows.
  34726. </p>
  34727. <dl compact="compact">
  34728. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  34729. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  34730. </p>
  34731. </dd>
  34732. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  34733. <dd><p>Specify weight of each input video stream as sequence.
  34734. Each weight is separated by space. If number of weights
  34735. is smaller than number of <var>frames</var> last specified
  34736. weight will be used for all remaining unset weights.
  34737. </p>
  34738. </dd>
  34739. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  34740. <dd><p>Specify scale, if it is set it will be multiplied with sum
  34741. of each weight multiplied with pixel values to give final destination
  34742. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  34743. </p>
  34744. </dd>
  34745. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  34746. <dd><p>Specify how end of stream is determined.
  34747. </p><dl compact="compact">
  34748. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  34749. <dd><p>The duration of the longest input. (default)
  34750. </p>
  34751. </dd>
  34752. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  34753. <dd><p>The duration of the shortest input.
  34754. </p>
  34755. </dd>
  34756. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  34757. <dd><p>The duration of the first input.
  34758. </p></dd>
  34759. </dl>
  34760. </dd>
  34761. </dl>
  34762. <a name="mpdecimate"></a>
  34763. <h2 class="section"><a href="ffmpeg-all.html#toc-mpdecimate">39.133 mpdecimate</a></h2>
  34764. <p>Drop frames that do not differ greatly from the previous frame in
  34765. order to reduce frame rate.
  34766. </p>
  34767. <p>The main use of this filter is for very-low-bitrate encoding
  34768. (e.g. streaming over dialup modem), but it could in theory be used for
  34769. fixing movies that were inverse-telecined incorrectly.
  34770. </p>
  34771. <p>A description of the accepted options follows.
  34772. </p>
  34773. <dl compact="compact">
  34774. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  34775. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  34776. positive), or the minimum interval between dropped frames (if
  34777. negative). If the value is 0, the frame is dropped disregarding the
  34778. number of previous sequentially dropped frames.
  34779. </p>
  34780. <p>Default value is 0.
  34781. </p>
  34782. </dd>
  34783. <dt>&lsquo;<samp>hi</samp>&rsquo;</dt>
  34784. <dt>&lsquo;<samp>lo</samp>&rsquo;</dt>
  34785. <dt>&lsquo;<samp>frac</samp>&rsquo;</dt>
  34786. <dd><p>Set the dropping threshold values.
  34787. </p>
  34788. <p>Values for &lsquo;<samp>hi</samp>&rsquo; and &lsquo;<samp>lo</samp>&rsquo; are for 8x8 pixel blocks and
  34789. represent actual pixel value differences, so a threshold of 64
  34790. corresponds to 1 unit of difference for each pixel, or the same spread
  34791. out differently over the block.
  34792. </p>
  34793. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  34794. than a threshold of &lsquo;<samp>hi</samp>&rsquo;, and if no more than &lsquo;<samp>frac</samp>&rsquo; blocks (1
  34795. meaning the whole image) differ by more than a threshold of &lsquo;<samp>lo</samp>&rsquo;.
  34796. </p>
  34797. <p>Default value for &lsquo;<samp>hi</samp>&rsquo; is 64*12, default value for &lsquo;<samp>lo</samp>&rsquo; is
  34798. 64*5, and default value for &lsquo;<samp>frac</samp>&rsquo; is 0.33.
  34799. </p></dd>
  34800. </dl>
  34801. <a name="negate"></a>
  34802. <h2 class="section"><a href="ffmpeg-all.html#toc-negate">39.134 negate</a></h2>
  34803. <p>Negate (invert) the input video.
  34804. </p>
  34805. <p>It accepts the following option:
  34806. </p>
  34807. <dl compact="compact">
  34808. <dt>&lsquo;<samp>negate_alpha</samp>&rsquo;</dt>
  34809. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  34810. </p></dd>
  34811. </dl>
  34812. <p><a name="nlmeans"></a>
  34813. </p><a name="nlmeans-1"></a>
  34814. <h2 class="section"><a href="ffmpeg-all.html#toc-nlmeans-1">39.135 nlmeans</a></h2>
  34815. <p>Denoise frames using Non-Local Means algorithm.
  34816. </p>
  34817. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  34818. context similarity is defined by comparing their surrounding patches of size
  34819. &lsquo;<samp>p</samp>&rsquo;x&lsquo;<samp>p</samp>&rsquo;. Patches are searched in an area of &lsquo;<samp>r</samp>&rsquo;x&lsquo;<samp>r</samp>&rsquo;
  34820. around the pixel.
  34821. </p>
  34822. <p>Note that the research area defines centers for patches, which means some
  34823. patches will be made of pixels outside that research area.
  34824. </p>
  34825. <p>The filter accepts the following options.
  34826. </p>
  34827. <dl compact="compact">
  34828. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  34829. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  34830. </p>
  34831. </dd>
  34832. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  34833. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  34834. </p>
  34835. </dd>
  34836. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  34837. <dd><p>Same as &lsquo;<samp>p</samp>&rsquo; but for chroma planes.
  34838. </p>
  34839. <p>The default value is <var>0</var> and means automatic.
  34840. </p>
  34841. </dd>
  34842. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  34843. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  34844. </p>
  34845. </dd>
  34846. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  34847. <dd><p>Same as &lsquo;<samp>r</samp>&rsquo; but for chroma planes.
  34848. </p>
  34849. <p>The default value is <var>0</var> and means automatic.
  34850. </p></dd>
  34851. </dl>
  34852. <a name="nnedi"></a>
  34853. <h2 class="section"><a href="ffmpeg-all.html#toc-nnedi">39.136 nnedi</a></h2>
  34854. <p>Deinterlace video using neural network edge directed interpolation.
  34855. </p>
  34856. <p>This filter accepts the following options:
  34857. </p>
  34858. <dl compact="compact">
  34859. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  34860. <dd><p>Mandatory option, without binary file filter can not work.
  34861. Currently file can be found here:
  34862. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  34863. </p>
  34864. </dd>
  34865. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  34866. <dd><p>Set which frames to deinterlace, by default it is <code>all</code>.
  34867. Can be <code>all</code> or <code>interlaced</code>.
  34868. </p>
  34869. </dd>
  34870. <dt>&lsquo;<samp>field</samp>&rsquo;</dt>
  34871. <dd><p>Set mode of operation.
  34872. </p>
  34873. <p>Can be one of the following:
  34874. </p>
  34875. <dl compact="compact">
  34876. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  34877. <dd><p>Use frame flags, both fields.
  34878. </p></dd>
  34879. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  34880. <dd><p>Use frame flags, single field.
  34881. </p></dd>
  34882. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  34883. <dd><p>Use top field only.
  34884. </p></dd>
  34885. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  34886. <dd><p>Use bottom field only.
  34887. </p></dd>
  34888. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  34889. <dd><p>Use both fields, top first.
  34890. </p></dd>
  34891. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  34892. <dd><p>Use both fields, bottom first.
  34893. </p></dd>
  34894. </dl>
  34895. </dd>
  34896. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  34897. <dd><p>Set which planes to process, by default filter process all frames.
  34898. </p>
  34899. </dd>
  34900. <dt>&lsquo;<samp>nsize</samp>&rsquo;</dt>
  34901. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  34902. network.
  34903. </p>
  34904. <p>Can be one of the following:
  34905. </p>
  34906. <dl compact="compact">
  34907. <dt>&lsquo;<samp>s8x6</samp>&rsquo;</dt>
  34908. <dt>&lsquo;<samp>s16x6</samp>&rsquo;</dt>
  34909. <dt>&lsquo;<samp>s32x6</samp>&rsquo;</dt>
  34910. <dt>&lsquo;<samp>s48x6</samp>&rsquo;</dt>
  34911. <dt>&lsquo;<samp>s8x4</samp>&rsquo;</dt>
  34912. <dt>&lsquo;<samp>s16x4</samp>&rsquo;</dt>
  34913. <dt>&lsquo;<samp>s32x4</samp>&rsquo;</dt>
  34914. </dl>
  34915. </dd>
  34916. <dt>&lsquo;<samp>nns</samp>&rsquo;</dt>
  34917. <dd><p>Set the number of neurons in predictor neural network.
  34918. Can be one of the following:
  34919. </p>
  34920. <dl compact="compact">
  34921. <dt>&lsquo;<samp>n16</samp>&rsquo;</dt>
  34922. <dt>&lsquo;<samp>n32</samp>&rsquo;</dt>
  34923. <dt>&lsquo;<samp>n64</samp>&rsquo;</dt>
  34924. <dt>&lsquo;<samp>n128</samp>&rsquo;</dt>
  34925. <dt>&lsquo;<samp>n256</samp>&rsquo;</dt>
  34926. </dl>
  34927. </dd>
  34928. <dt>&lsquo;<samp>qual</samp>&rsquo;</dt>
  34929. <dd><p>Controls the number of different neural network predictions that are blended
  34930. together to compute the final output value. Can be <code>fast</code>, default or
  34931. <code>slow</code>.
  34932. </p>
  34933. </dd>
  34934. <dt>&lsquo;<samp>etype</samp>&rsquo;</dt>
  34935. <dd><p>Set which set of weights to use in the predictor.
  34936. Can be one of the following:
  34937. </p>
  34938. <dl compact="compact">
  34939. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  34940. <dd><p>weights trained to minimize absolute error
  34941. </p></dd>
  34942. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  34943. <dd><p>weights trained to minimize squared error
  34944. </p></dd>
  34945. </dl>
  34946. </dd>
  34947. <dt>&lsquo;<samp>pscrn</samp>&rsquo;</dt>
  34948. <dd><p>Controls whether or not the prescreener neural network is used to decide
  34949. which pixels should be processed by the predictor neural network and which
  34950. can be handled by simple cubic interpolation.
  34951. The prescreener is trained to know whether cubic interpolation will be
  34952. sufficient for a pixel or whether it should be predicted by the predictor nn.
  34953. The computational complexity of the prescreener nn is much less than that of
  34954. the predictor nn. Since most pixels can be handled by cubic interpolation,
  34955. using the prescreener generally results in much faster processing.
  34956. The prescreener is pretty accurate, so the difference between using it and not
  34957. using it is almost always unnoticeable.
  34958. </p>
  34959. <p>Can be one of the following:
  34960. </p>
  34961. <dl compact="compact">
  34962. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  34963. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  34964. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  34965. </dl>
  34966. <p>Default is <code>new</code>.
  34967. </p>
  34968. </dd>
  34969. <dt>&lsquo;<samp>fapprox</samp>&rsquo;</dt>
  34970. <dd><p>Set various debugging flags.
  34971. </p></dd>
  34972. </dl>
  34973. <a name="noformat"></a>
  34974. <h2 class="section"><a href="ffmpeg-all.html#toc-noformat">39.137 noformat</a></h2>
  34975. <p>Force libavfilter not to use any of the specified pixel formats for the
  34976. input to the next filter.
  34977. </p>
  34978. <p>It accepts the following parameters:
  34979. </p><dl compact="compact">
  34980. <dt>&lsquo;<samp>pix_fmts</samp>&rsquo;</dt>
  34981. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  34982. pix_fmts=yuv420p|monow|rgb24&quot;.
  34983. </p>
  34984. </dd>
  34985. </dl>
  34986. <a name="Examples-129"></a>
  34987. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-129">39.137.1 Examples</a></h3>
  34988. <ul>
  34989. <li>
  34990. Force libavfilter to use a format different from <var>yuv420p</var> for the
  34991. input to the vflip filter:
  34992. <div class="example">
  34993. <pre class="example">noformat=pix_fmts=yuv420p,vflip
  34994. </pre></div>
  34995. </li><li>
  34996. Convert the input video to any of the formats not contained in the list:
  34997. <div class="example">
  34998. <pre class="example">noformat=yuv420p|yuv444p|yuv410p
  34999. </pre></div>
  35000. </li></ul>
  35001. <a name="noise-1"></a>
  35002. <h2 class="section"><a href="ffmpeg-all.html#toc-noise-1">39.138 noise</a></h2>
  35003. <p>Add noise on video input frame.
  35004. </p>
  35005. <p>The filter accepts the following options:
  35006. </p>
  35007. <dl compact="compact">
  35008. <dt>&lsquo;<samp>all_seed</samp>&rsquo;</dt>
  35009. <dt>&lsquo;<samp>c0_seed</samp>&rsquo;</dt>
  35010. <dt>&lsquo;<samp>c1_seed</samp>&rsquo;</dt>
  35011. <dt>&lsquo;<samp>c2_seed</samp>&rsquo;</dt>
  35012. <dt>&lsquo;<samp>c3_seed</samp>&rsquo;</dt>
  35013. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  35014. of <var>all_seed</var>. Default value is <code>123457</code>.
  35015. </p>
  35016. </dd>
  35017. <dt>&lsquo;<samp>all_strength, alls</samp>&rsquo;</dt>
  35018. <dt>&lsquo;<samp>c0_strength, c0s</samp>&rsquo;</dt>
  35019. <dt>&lsquo;<samp>c1_strength, c1s</samp>&rsquo;</dt>
  35020. <dt>&lsquo;<samp>c2_strength, c2s</samp>&rsquo;</dt>
  35021. <dt>&lsquo;<samp>c3_strength, c3s</samp>&rsquo;</dt>
  35022. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  35023. <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
  35024. </p>
  35025. </dd>
  35026. <dt>&lsquo;<samp>all_flags, allf</samp>&rsquo;</dt>
  35027. <dt>&lsquo;<samp>c0_flags, c0f</samp>&rsquo;</dt>
  35028. <dt>&lsquo;<samp>c1_flags, c1f</samp>&rsquo;</dt>
  35029. <dt>&lsquo;<samp>c2_flags, c2f</samp>&rsquo;</dt>
  35030. <dt>&lsquo;<samp>c3_flags, c3f</samp>&rsquo;</dt>
  35031. <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
  35032. Available values for component flags are:
  35033. </p><dl compact="compact">
  35034. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  35035. <dd><p>averaged temporal noise (smoother)
  35036. </p></dd>
  35037. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  35038. <dd><p>mix random noise with a (semi)regular pattern
  35039. </p></dd>
  35040. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35041. <dd><p>temporal noise (noise pattern changes between frames)
  35042. </p></dd>
  35043. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  35044. <dd><p>uniform noise (gaussian otherwise)
  35045. </p></dd>
  35046. </dl>
  35047. </dd>
  35048. </dl>
  35049. <a name="Examples-65"></a>
  35050. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-65">39.138.1 Examples</a></h3>
  35051. <p>Add temporal and uniform noise to input video:
  35052. </p><div class="example">
  35053. <pre class="example">noise=alls=20:allf=t+u
  35054. </pre></div>
  35055. <a name="normalize"></a>
  35056. <h2 class="section"><a href="ffmpeg-all.html#toc-normalize">39.139 normalize</a></h2>
  35057. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  35058. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  35059. </p>
  35060. <p>For each channel of each frame, the filter computes the input range and maps
  35061. it linearly to the user-specified output range. The output range defaults
  35062. to the full dynamic range from pure black to pure white.
  35063. </p>
  35064. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  35065. changes in brightness) caused when small dark or bright objects enter or leave
  35066. the scene. This is similar to the auto-exposure (automatic gain control) on a
  35067. video camera, and, like a video camera, it may cause a period of over- or
  35068. under-exposure of the video.
  35069. </p>
  35070. <p>The R,G,B channels can be normalized independently, which may cause some
  35071. color shifting, or linked together as a single channel, which prevents
  35072. color shifting. Linked normalization preserves hue. Independent normalization
  35073. does not, so it can be used to remove some color casts. Independent and linked
  35074. normalization can be combined in any ratio.
  35075. </p>
  35076. <p>The normalize filter accepts the following options:
  35077. </p>
  35078. <dl compact="compact">
  35079. <dt>&lsquo;<samp>blackpt</samp>&rsquo;</dt>
  35080. <dt>&lsquo;<samp>whitept</samp>&rsquo;</dt>
  35081. <dd><p>Colors which define the output range. The minimum input value is mapped to
  35082. the <var>blackpt</var>. The maximum input value is mapped to the <var>whitept</var>.
  35083. The defaults are black and white respectively. Specifying white for
  35084. <var>blackpt</var> and black for <var>whitept</var> will give color-inverted,
  35085. normalized video. Shades of grey can be used to reduce the dynamic range
  35086. (contrast). Specifying saturated colors here can create some interesting
  35087. effects.
  35088. </p>
  35089. </dd>
  35090. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  35091. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  35092. of each channel is smoothed using a rolling average over the current frame
  35093. and the <var>smoothing</var> previous frames. The default is 0 (no temporal
  35094. smoothing).
  35095. </p>
  35096. </dd>
  35097. <dt>&lsquo;<samp>independence</samp>&rsquo;</dt>
  35098. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  35099. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  35100. independent. Defaults to 1.0 (fully independent).
  35101. </p>
  35102. </dd>
  35103. <dt>&lsquo;<samp>strength</samp>&rsquo;</dt>
  35104. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  35105. expensive no-op. Defaults to 1.0 (full strength).
  35106. </p>
  35107. </dd>
  35108. </dl>
  35109. <a name="Commands-51"></a>
  35110. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-51">39.139.1 Commands</a></h3>
  35111. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>smoothing</var> option.
  35112. The command accepts the same syntax of the corresponding option.
  35113. </p>
  35114. <p>If the specified expression is not valid, it is kept at its current
  35115. value.
  35116. </p>
  35117. <a name="Examples-150"></a>
  35118. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-150">39.139.2 Examples</a></h3>
  35119. <p>Stretch video contrast to use the full dynamic range, with no temporal
  35120. smoothing; may flicker depending on the source content:
  35121. </p><div class="example">
  35122. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=0
  35123. </pre></div>
  35124. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  35125. reduced, depending on the source content:
  35126. </p><div class="example">
  35127. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50
  35128. </pre></div>
  35129. <p>As above, but with hue-preserving linked channel normalization:
  35130. </p><div class="example">
  35131. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  35132. </pre></div>
  35133. <p>As above, but with half strength:
  35134. </p><div class="example">
  35135. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  35136. </pre></div>
  35137. <p>Map the darkest input color to red, the brightest input color to cyan:
  35138. </p><div class="example">
  35139. <pre class="example">normalize=blackpt=red:whitept=cyan
  35140. </pre></div>
  35141. <a name="null-1"></a>
  35142. <h2 class="section"><a href="ffmpeg-all.html#toc-null-1">39.140 null</a></h2>
  35143. <p>Pass the video source unchanged to the output.
  35144. </p>
  35145. <a name="ocr"></a>
  35146. <h2 class="section"><a href="ffmpeg-all.html#toc-ocr">39.141 ocr</a></h2>
  35147. <p>Optical Character Recognition
  35148. </p>
  35149. <p>This filter uses Tesseract for optical character recognition. To enable
  35150. compilation of this filter, you need to configure FFmpeg with
  35151. <code>--enable-libtesseract</code>.
  35152. </p>
  35153. <p>It accepts the following options:
  35154. </p>
  35155. <dl compact="compact">
  35156. <dt>&lsquo;<samp>datapath</samp>&rsquo;</dt>
  35157. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  35158. set at installation.
  35159. </p>
  35160. </dd>
  35161. <dt>&lsquo;<samp>language</samp>&rsquo;</dt>
  35162. <dd><p>Set language, default is &quot;eng&quot;.
  35163. </p>
  35164. </dd>
  35165. <dt>&lsquo;<samp>whitelist</samp>&rsquo;</dt>
  35166. <dd><p>Set character whitelist.
  35167. </p>
  35168. </dd>
  35169. <dt>&lsquo;<samp>blacklist</samp>&rsquo;</dt>
  35170. <dd><p>Set character blacklist.
  35171. </p></dd>
  35172. </dl>
  35173. <p>The filter exports recognized text as the frame metadata <code>lavfi.ocr.text</code>.
  35174. The filter exports confidence of recognized words as the frame metadata <code>lavfi.ocr.confidence</code>.
  35175. </p>
  35176. <a name="ocv"></a>
  35177. <h2 class="section"><a href="ffmpeg-all.html#toc-ocv">39.142 ocv</a></h2>
  35178. <p>Apply a video transform using libopencv.
  35179. </p>
  35180. <p>To enable this filter, install the libopencv library and headers and
  35181. configure FFmpeg with <code>--enable-libopencv</code>.
  35182. </p>
  35183. <p>It accepts the following parameters:
  35184. </p>
  35185. <dl compact="compact">
  35186. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  35187. <dd><p>The name of the libopencv filter to apply.
  35188. </p>
  35189. </dd>
  35190. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  35191. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  35192. values are assumed.
  35193. </p>
  35194. </dd>
  35195. </dl>
  35196. <p>Refer to the official libopencv documentation for more precise
  35197. information:
  35198. <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  35199. </p>
  35200. <p>Several libopencv filters are supported; see the following subsections.
  35201. </p>
  35202. <p><a name="dilate"></a>
  35203. </p><a name="dilate-1"></a>
  35204. <h3 class="subsection"><a href="ffmpeg-all.html#toc-dilate-1">39.142.1 dilate</a></h3>
  35205. <p>Dilate an image by using a specific structuring element.
  35206. It corresponds to the libopencv function <code>cvDilate</code>.
  35207. </p>
  35208. <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
  35209. </p>
  35210. <p><var>struct_el</var> represents a structuring element, and has the syntax:
  35211. <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
  35212. </p>
  35213. <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
  35214. the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
  35215. point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
  35216. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  35217. </p>
  35218. <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
  35219. string of the form &quot;=<var>filename</var>&quot;. The file with name
  35220. <var>filename</var> is assumed to represent a binary image, with each
  35221. printable character corresponding to a bright pixel. When a custom
  35222. <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
  35223. or columns and rows of the read file are assumed instead.
  35224. </p>
  35225. <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
  35226. </p>
  35227. <p><var>nb_iterations</var> specifies the number of times the transform is
  35228. applied to the image, and defaults to 1.
  35229. </p>
  35230. <p>Some examples:
  35231. </p><div class="example">
  35232. <pre class="example"># Use the default values
  35233. ocv=dilate
  35234. # Dilate using a structuring element with a 5x5 cross, iterating two times
  35235. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  35236. # Read the shape from the file diamond.shape, iterating two times.
  35237. # The file diamond.shape may contain a pattern of characters like this
  35238. # *
  35239. # ***
  35240. # *****
  35241. # ***
  35242. # *
  35243. # The specified columns and rows are ignored
  35244. # but the anchor point coordinates are not
  35245. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  35246. </pre></div>
  35247. <a name="erode"></a>
  35248. <h3 class="subsection"><a href="ffmpeg-all.html#toc-erode">39.142.2 erode</a></h3>
  35249. <p>Erode an image by using a specific structuring element.
  35250. It corresponds to the libopencv function <code>cvErode</code>.
  35251. </p>
  35252. <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
  35253. with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
  35254. </p>
  35255. <a name="smooth"></a>
  35256. <h3 class="subsection"><a href="ffmpeg-all.html#toc-smooth">39.142.3 smooth</a></h3>
  35257. <p>Smooth the input video.
  35258. </p>
  35259. <p>The filter takes the following parameters:
  35260. <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
  35261. </p>
  35262. <p><var>type</var> is the type of smooth filter to apply, and must be one of
  35263. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  35264. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  35265. </p>
  35266. <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
  35267. depends on the smooth type. <var>param1</var> and
  35268. <var>param2</var> accept integer positive values or 0. <var>param3</var> and
  35269. <var>param4</var> accept floating point values.
  35270. </p>
  35271. <p>The default value for <var>param1</var> is 3. The default value for the
  35272. other parameters is 0.
  35273. </p>
  35274. <p>These parameters correspond to the parameters assigned to the
  35275. libopencv function <code>cvSmooth</code>.
  35276. </p>
  35277. <a name="oscilloscope"></a>
  35278. <h2 class="section"><a href="ffmpeg-all.html#toc-oscilloscope">39.143 oscilloscope</a></h2>
  35279. <p>2D Video Oscilloscope.
  35280. </p>
  35281. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  35282. </p>
  35283. <p>It accepts the following parameters:
  35284. </p>
  35285. <dl compact="compact">
  35286. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35287. <dd><p>Set scope center x position.
  35288. </p>
  35289. </dd>
  35290. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35291. <dd><p>Set scope center y position.
  35292. </p>
  35293. </dd>
  35294. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  35295. <dd><p>Set scope size, relative to frame diagonal.
  35296. </p>
  35297. </dd>
  35298. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35299. <dd><p>Set scope tilt/rotation.
  35300. </p>
  35301. </dd>
  35302. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  35303. <dd><p>Set trace opacity.
  35304. </p>
  35305. </dd>
  35306. <dt>&lsquo;<samp>tx</samp>&rsquo;</dt>
  35307. <dd><p>Set trace center x position.
  35308. </p>
  35309. </dd>
  35310. <dt>&lsquo;<samp>ty</samp>&rsquo;</dt>
  35311. <dd><p>Set trace center y position.
  35312. </p>
  35313. </dd>
  35314. <dt>&lsquo;<samp>tw</samp>&rsquo;</dt>
  35315. <dd><p>Set trace width, relative to width of frame.
  35316. </p>
  35317. </dd>
  35318. <dt>&lsquo;<samp>th</samp>&rsquo;</dt>
  35319. <dd><p>Set trace height, relative to height of frame.
  35320. </p>
  35321. </dd>
  35322. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  35323. <dd><p>Set which components to trace. By default it traces first three components.
  35324. </p>
  35325. </dd>
  35326. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  35327. <dd><p>Draw trace grid. By default is enabled.
  35328. </p>
  35329. </dd>
  35330. <dt>&lsquo;<samp>st</samp>&rsquo;</dt>
  35331. <dd><p>Draw some statistics. By default is enabled.
  35332. </p>
  35333. </dd>
  35334. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  35335. <dd><p>Draw scope. By default is enabled.
  35336. </p></dd>
  35337. </dl>
  35338. <a name="Commands-65"></a>
  35339. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-65">39.143.1 Commands</a></h3>
  35340. <p>This filter supports same <a href="#commands">commands</a> as options.
  35341. The command accepts the same syntax of the corresponding option.
  35342. </p>
  35343. <p>If the specified expression is not valid, it is kept at its current
  35344. value.
  35345. </p>
  35346. <a name="Examples-103"></a>
  35347. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-103">39.143.2 Examples</a></h3>
  35348. <ul>
  35349. <li>
  35350. Inspect full first row of video frame.
  35351. <div class="example">
  35352. <pre class="example">oscilloscope=x=0.5:y=0:s=1
  35353. </pre></div>
  35354. </li><li>
  35355. Inspect full last row of video frame.
  35356. <div class="example">
  35357. <pre class="example">oscilloscope=x=0.5:y=1:s=1
  35358. </pre></div>
  35359. </li><li>
  35360. Inspect full 5th line of video frame of height 1080.
  35361. <div class="example">
  35362. <pre class="example">oscilloscope=x=0.5:y=5/1080:s=1
  35363. </pre></div>
  35364. </li><li>
  35365. Inspect full last column of video frame.
  35366. <div class="example">
  35367. <pre class="example">oscilloscope=x=1:y=0.5:s=1:t=1
  35368. </pre></div>
  35369. </li></ul>
  35370. <p><a name="overlay"></a>
  35371. </p><a name="overlay-1"></a>
  35372. <h2 class="section"><a href="ffmpeg-all.html#toc-overlay-1">39.144 overlay</a></h2>
  35373. <p>Overlay one video on top of another.
  35374. </p>
  35375. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  35376. video on which the second input is overlaid.
  35377. </p>
  35378. <p>It accepts the following parameters:
  35379. </p>
  35380. <p>A description of the accepted options follows.
  35381. </p>
  35382. <dl compact="compact">
  35383. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35384. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35385. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  35386. on the main video. Default value is &quot;0&quot; for both expressions. In case
  35387. the expression is invalid, it is set to a huge value (meaning that the
  35388. overlay will not be displayed within the output visible area).
  35389. </p>
  35390. </dd>
  35391. <dt>&lsquo;<samp>eof_action</samp>&rsquo;</dt>
  35392. <dd><p>See <a href="#framesync">framesync</a>.
  35393. </p>
  35394. </dd>
  35395. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  35396. <dd><p>Set when the expressions for &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; are evaluated.
  35397. </p>
  35398. <p>It accepts the following values:
  35399. </p><dl compact="compact">
  35400. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  35401. <dd><p>only evaluate expressions once during the filter initialization or
  35402. when a command is processed
  35403. </p>
  35404. </dd>
  35405. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  35406. <dd><p>evaluate expressions for each incoming frame
  35407. </p></dd>
  35408. </dl>
  35409. <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
  35410. </p>
  35411. </dd>
  35412. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  35413. <dd><p>See <a href="#framesync">framesync</a>.
  35414. </p>
  35415. </dd>
  35416. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  35417. <dd><p>Set the format for the output video.
  35418. </p>
  35419. <p>It accepts the following values:
  35420. </p><dl compact="compact">
  35421. <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
  35422. <dd><p>force YUV420 output
  35423. </p>
  35424. </dd>
  35425. <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
  35426. <dd><p>force YUV422 output
  35427. </p>
  35428. </dd>
  35429. <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
  35430. <dd><p>force YUV444 output
  35431. </p>
  35432. </dd>
  35433. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  35434. <dd><p>force packed RGB output
  35435. </p>
  35436. </dd>
  35437. <dt>&lsquo;<samp>gbrp</samp>&rsquo;</dt>
  35438. <dd><p>force planar RGB output
  35439. </p>
  35440. </dd>
  35441. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  35442. <dd><p>automatically pick format
  35443. </p></dd>
  35444. </dl>
  35445. <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
  35446. </p>
  35447. </dd>
  35448. <dt>&lsquo;<samp>repeatlast</samp>&rsquo;</dt>
  35449. <dd><p>See <a href="#framesync">framesync</a>.
  35450. </p>
  35451. </dd>
  35452. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  35453. <dd><p>Set format of alpha of the overlaid video, it can be <var>straight</var> or
  35454. <var>premultiplied</var>. Default is <var>straight</var>.
  35455. </p></dd>
  35456. </dl>
  35457. <p>The &lsquo;<samp>x</samp>&rsquo;, and &lsquo;<samp>y</samp>&rsquo; expressions can contain the following
  35458. parameters.
  35459. </p>
  35460. <dl compact="compact">
  35461. <dt>&lsquo;<samp>main_w, W</samp>&rsquo;</dt>
  35462. <dt>&lsquo;<samp>main_h, H</samp>&rsquo;</dt>
  35463. <dd><p>The main input width and height.
  35464. </p>
  35465. </dd>
  35466. <dt>&lsquo;<samp>overlay_w, w</samp>&rsquo;</dt>
  35467. <dt>&lsquo;<samp>overlay_h, h</samp>&rsquo;</dt>
  35468. <dd><p>The overlay input width and height.
  35469. </p>
  35470. </dd>
  35471. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35472. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35473. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  35474. each new frame.
  35475. </p>
  35476. </dd>
  35477. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  35478. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  35479. <dd><p>horizontal and vertical chroma subsample values of the output
  35480. format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
  35481. <var>vsub</var> is 1.
  35482. </p>
  35483. </dd>
  35484. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  35485. <dd><p>the number of input frame, starting from 0
  35486. </p>
  35487. </dd>
  35488. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  35489. <dd><p>the position in the file of the input frame, NAN if unknown
  35490. </p>
  35491. </dd>
  35492. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  35493. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  35494. </p>
  35495. </dd>
  35496. </dl>
  35497. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  35498. </p>
  35499. <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
  35500. when evaluation is done <em>per frame</em>, and will evaluate to NAN
  35501. when &lsquo;<samp>eval</samp>&rsquo; is set to &lsquo;<samp>init</samp>&rsquo;.
  35502. </p>
  35503. <p>Be aware that frames are taken from each input video in timestamp
  35504. order, hence, if their initial timestamps differ, it is a good idea
  35505. to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
  35506. have them begin in the same zero timestamp, as the example for
  35507. the <var>movie</var> filter does.
  35508. </p>
  35509. <p>You can chain together more overlays but you should test the
  35510. efficiency of such approach.
  35511. </p>
  35512. <a name="Commands-59"></a>
  35513. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-59">39.144.1 Commands</a></h3>
  35514. <p>This filter supports the following commands:
  35515. </p><dl compact="compact">
  35516. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35517. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35518. <dd><p>Modify the x and y of the overlay input.
  35519. The command accepts the same syntax of the corresponding option.
  35520. </p>
  35521. <p>If the specified expression is not valid, it is kept at its current
  35522. value.
  35523. </p></dd>
  35524. </dl>
  35525. <a name="Examples-92"></a>
  35526. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-92">39.144.2 Examples</a></h3>
  35527. <ul>
  35528. <li>
  35529. Draw the overlay at 10 pixels from the bottom right corner of the main
  35530. video:
  35531. <div class="example">
  35532. <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  35533. </pre></div>
  35534. <p>Using named options the example above becomes:
  35535. </p><div class="example">
  35536. <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  35537. </pre></div>
  35538. </li><li>
  35539. Insert a transparent PNG logo in the bottom left corner of the input,
  35540. using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
  35541. <div class="example">
  35542. <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  35543. </pre></div>
  35544. </li><li>
  35545. Insert 2 different transparent PNG logos (second logo on bottom
  35546. right corner) using the <code>ffmpeg</code> tool:
  35547. <div class="example">
  35548. <pre class="example">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
  35549. </pre></div>
  35550. </li><li>
  35551. Add a transparent color layer on top of the main video; <code>WxH</code>
  35552. must specify the size of the main input to the overlay filter:
  35553. <div class="example">
  35554. <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  35555. </pre></div>
  35556. </li><li>
  35557. Play an original video and a filtered version (here with the deshake
  35558. filter) side by side using the <code>ffplay</code> tool:
  35559. <div class="example">
  35560. <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  35561. </pre></div>
  35562. <p>The above command is the same as:
  35563. </p><div class="example">
  35564. <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  35565. </pre></div>
  35566. </li><li>
  35567. Make a sliding overlay appearing from the left to the right top part of the
  35568. screen starting since time 2:
  35569. <div class="example">
  35570. <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  35571. </pre></div>
  35572. </li><li>
  35573. Compose output by putting two input videos side to side:
  35574. <div class="example">
  35575. <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  35576. nullsrc=size=200x100 [background];
  35577. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  35578. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  35579. [background][left] overlay=shortest=1 [background+left];
  35580. [background+left][right] overlay=shortest=1:x=100 [left+right]
  35581. &quot;
  35582. </pre></div>
  35583. </li><li>
  35584. Mask 10-20 seconds of a video by applying the delogo filter to a section
  35585. <div class="example">
  35586. <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  35587. -vf '[in]split[split_main][split_delogo];[split_delogo]trim=start=360:end=371,delogo=0:0:640:480[delogoed];[split_main][delogoed]overlay=eof_action=pass[out]'
  35588. masked.avi
  35589. </pre></div>
  35590. </li><li>
  35591. Chain several overlays in cascade:
  35592. <div class="example">
  35593. <pre class="example">nullsrc=s=200x200 [bg];
  35594. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  35595. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  35596. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  35597. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  35598. [in3] null, [mid2] overlay=100:100 [out0]
  35599. </pre></div>
  35600. </li></ul>
  35601. <a name="owdenoise"></a>
  35602. <h2 class="section"><a href="ffmpeg-all.html#toc-owdenoise">39.145 owdenoise</a></h2>
  35603. <p>Apply Overcomplete Wavelet denoiser.
  35604. </p>
  35605. <p>The filter accepts the following options:
  35606. </p>
  35607. <dl compact="compact">
  35608. <dt>&lsquo;<samp>depth</samp>&rsquo;</dt>
  35609. <dd><p>Set depth.
  35610. </p>
  35611. <p>Larger depth values will denoise lower frequency components more, but
  35612. slow down filtering.
  35613. </p>
  35614. <p>Must be an int in the range 8-16, default is <code>8</code>.
  35615. </p>
  35616. </dd>
  35617. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  35618. <dd><p>Set luma strength.
  35619. </p>
  35620. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  35621. </p>
  35622. </dd>
  35623. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  35624. <dd><p>Set chroma strength.
  35625. </p>
  35626. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  35627. </p></dd>
  35628. </dl>
  35629. <p><a name="pad"></a>
  35630. </p><a name="pad-1"></a>
  35631. <h2 class="section"><a href="ffmpeg-all.html#toc-pad-1">39.146 pad</a></h2>
  35632. <p>Add paddings to the input image, and place the original input at the
  35633. provided <var>x</var>, <var>y</var> coordinates.
  35634. </p>
  35635. <p>It accepts the following parameters:
  35636. </p>
  35637. <dl compact="compact">
  35638. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  35639. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  35640. <dd><p>Specify an expression for the size of the output image with the
  35641. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  35642. corresponding input size is used for the output.
  35643. </p>
  35644. <p>The <var>width</var> expression can reference the value set by the
  35645. <var>height</var> expression, and vice versa.
  35646. </p>
  35647. <p>The default value of <var>width</var> and <var>height</var> is 0.
  35648. </p>
  35649. </dd>
  35650. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35651. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35652. <dd><p>Specify the offsets to place the input image at within the padded area,
  35653. with respect to the top/left border of the output image.
  35654. </p>
  35655. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  35656. expression, and vice versa.
  35657. </p>
  35658. <p>The default value of <var>x</var> and <var>y</var> is 0.
  35659. </p>
  35660. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  35661. so the input image is centered on the padded area.
  35662. </p>
  35663. </dd>
  35664. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  35665. <dd><p>Specify the color of the padded area. For the syntax of this option,
  35666. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  35667. </p>
  35668. <p>The default value of <var>color</var> is &quot;black&quot;.
  35669. </p>
  35670. </dd>
  35671. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  35672. <dd><p>Specify when to evaluate <var>width</var>, <var>height</var>, <var>x</var> and <var>y</var> expression.
  35673. </p>
  35674. <p>It accepts the following values:
  35675. </p>
  35676. <dl compact="compact">
  35677. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  35678. <dd><p>Only evaluate expressions once during the filter initialization or when
  35679. a command is processed.
  35680. </p>
  35681. </dd>
  35682. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  35683. <dd><p>Evaluate expressions for each incoming frame.
  35684. </p>
  35685. </dd>
  35686. </dl>
  35687. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  35688. </p>
  35689. </dd>
  35690. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  35691. <dd><p>Pad to aspect instead to a resolution.
  35692. </p>
  35693. </dd>
  35694. </dl>
  35695. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  35696. options are expressions containing the following constants:
  35697. </p>
  35698. <dl compact="compact">
  35699. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  35700. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  35701. <dd><p>The input video width and height.
  35702. </p>
  35703. </dd>
  35704. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  35705. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  35706. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  35707. </p>
  35708. </dd>
  35709. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  35710. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  35711. <dd><p>The output width and height (the size of the padded area), as
  35712. specified by the <var>width</var> and <var>height</var> expressions.
  35713. </p>
  35714. </dd>
  35715. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  35716. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  35717. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  35718. </p>
  35719. </dd>
  35720. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  35721. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  35722. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  35723. expressions, or NAN if not yet specified.
  35724. </p>
  35725. </dd>
  35726. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  35727. <dd><p>same as <var>iw</var> / <var>ih</var>
  35728. </p>
  35729. </dd>
  35730. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  35731. <dd><p>input sample aspect ratio
  35732. </p>
  35733. </dd>
  35734. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  35735. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  35736. </p>
  35737. </dd>
  35738. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  35739. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  35740. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  35741. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  35742. </p></dd>
  35743. </dl>
  35744. <a name="Examples-29"></a>
  35745. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-29">39.146.1 Examples</a></h3>
  35746. <ul>
  35747. <li>
  35748. Add paddings with the color &quot;violet&quot; to the input video. The output video
  35749. size is 640x480, and the top-left corner of the input video is placed at
  35750. column 0, row 40
  35751. <div class="example">
  35752. <pre class="example">pad=640:480:0:40:violet
  35753. </pre></div>
  35754. <p>The example above is equivalent to the following command:
  35755. </p><div class="example">
  35756. <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
  35757. </pre></div>
  35758. </li><li>
  35759. Pad the input to get an output with dimensions increased by 3/2,
  35760. and put the input video at the center of the padded area:
  35761. <div class="example">
  35762. <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  35763. </pre></div>
  35764. </li><li>
  35765. Pad the input to get a squared output with size equal to the maximum
  35766. value between the input width and height, and put the input video at
  35767. the center of the padded area:
  35768. <div class="example">
  35769. <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  35770. </pre></div>
  35771. </li><li>
  35772. Pad the input to get a final w/h ratio of 16:9:
  35773. <div class="example">
  35774. <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  35775. </pre></div>
  35776. </li><li>
  35777. In case of anamorphic video, in order to set the output display aspect
  35778. correctly, it is necessary to use <var>sar</var> in the expression,
  35779. according to the relation:
  35780. <div class="example">
  35781. <pre class="example">(ih * X / ih) * sar = output_dar
  35782. X = output_dar / sar
  35783. </pre></div>
  35784. <p>Thus the previous example needs to be modified to:
  35785. </p><div class="example">
  35786. <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  35787. </pre></div>
  35788. </li><li>
  35789. Double the output size and put the input video in the bottom-right
  35790. corner of the output padded area:
  35791. <div class="example">
  35792. <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  35793. </pre></div>
  35794. </li></ul>
  35795. <p><a name="palettegen"></a>
  35796. </p><a name="palettegen-1"></a>
  35797. <h2 class="section"><a href="ffmpeg-all.html#toc-palettegen-1">39.147 palettegen</a></h2>
  35798. <p>Generate one palette for a whole video stream.
  35799. </p>
  35800. <p>It accepts the following options:
  35801. </p>
  35802. <dl compact="compact">
  35803. <dt>&lsquo;<samp>max_colors</samp>&rsquo;</dt>
  35804. <dd><p>Set the maximum number of colors to quantize in the palette.
  35805. Note: the palette will still contain 256 colors; the unused palette entries
  35806. will be black.
  35807. </p>
  35808. </dd>
  35809. <dt>&lsquo;<samp>reserve_transparent</samp>&rsquo;</dt>
  35810. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  35811. transparency. Reserving the transparency color is useful for GIF optimization.
  35812. If not set, the maximum of colors in the palette will be 256. You probably want
  35813. to disable this option for a standalone image.
  35814. Set by default.
  35815. </p>
  35816. </dd>
  35817. <dt>&lsquo;<samp>transparency_color</samp>&rsquo;</dt>
  35818. <dd><p>Set the color that will be used as background for transparency.
  35819. </p>
  35820. </dd>
  35821. <dt>&lsquo;<samp>stats_mode</samp>&rsquo;</dt>
  35822. <dd><p>Set statistics mode.
  35823. </p>
  35824. <p>It accepts the following values:
  35825. </p><dl compact="compact">
  35826. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  35827. <dd><p>Compute full frame histograms.
  35828. </p></dd>
  35829. <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
  35830. <dd><p>Compute histograms only for the part that differs from previous frame. This
  35831. might be relevant to give more importance to the moving part of your input if
  35832. the background is static.
  35833. </p></dd>
  35834. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  35835. <dd><p>Compute new histogram for each frame.
  35836. </p></dd>
  35837. </dl>
  35838. <p>Default value is <var>full</var>.
  35839. </p></dd>
  35840. </dl>
  35841. <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
  35842. (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  35843. color quantization of the palette. This information is also visible at
  35844. <var>info</var> logging level.
  35845. </p>
  35846. <a name="Examples-25"></a>
  35847. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-25">39.147.1 Examples</a></h3>
  35848. <ul>
  35849. <li>
  35850. Generate a representative palette of a given video using <code>ffmpeg</code>:
  35851. <div class="example">
  35852. <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
  35853. </pre></div>
  35854. </li></ul>
  35855. <a name="paletteuse"></a>
  35856. <h2 class="section"><a href="ffmpeg-all.html#toc-paletteuse">39.148 paletteuse</a></h2>
  35857. <p>Use a palette to downsample an input video stream.
  35858. </p>
  35859. <p>The filter takes two inputs: one video stream and a palette. The palette must
  35860. be a 256 pixels image.
  35861. </p>
  35862. <p>It accepts the following options:
  35863. </p>
  35864. <dl compact="compact">
  35865. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  35866. <dd><p>Select dithering mode. Available algorithms are:
  35867. </p><dl compact="compact">
  35868. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  35869. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  35870. </p></dd>
  35871. <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
  35872. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  35873. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  35874. reference.
  35875. </p></dd>
  35876. <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
  35877. <dd><p>Floyd and Steingberg dithering (error diffusion)
  35878. </p></dd>
  35879. <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
  35880. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  35881. </p></dd>
  35882. <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
  35883. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  35884. </p></dd>
  35885. </dl>
  35886. <p>Default is <var>sierra2_4a</var>.
  35887. </p>
  35888. </dd>
  35889. <dt>&lsquo;<samp>bayer_scale</samp>&rsquo;</dt>
  35890. <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
  35891. pattern (how much the crosshatch pattern is visible). A low value means more
  35892. visible pattern for less banding, and higher value means less visible pattern
  35893. at the cost of more banding.
  35894. </p>
  35895. <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
  35896. </p>
  35897. </dd>
  35898. <dt>&lsquo;<samp>diff_mode</samp>&rsquo;</dt>
  35899. <dd><p>If set, define the zone to process
  35900. </p>
  35901. <dl compact="compact">
  35902. <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
  35903. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  35904. cropping/offsetting compression mechanism. This option can be useful for speed
  35905. if only a part of the image is changing, and has use cases such as limiting the
  35906. scope of the error diffusal &lsquo;<samp>dither</samp>&rsquo; to the rectangle that bounds the
  35907. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  35908. much, and as a result less moving noise and better GIF compression).
  35909. </p></dd>
  35910. </dl>
  35911. <p>Default is <var>none</var>.
  35912. </p>
  35913. </dd>
  35914. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  35915. <dd><p>Take new palette for each output frame.
  35916. </p>
  35917. </dd>
  35918. <dt>&lsquo;<samp>alpha_threshold</samp>&rsquo;</dt>
  35919. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  35920. will be treated as completely opaque, and values below this threshold will be
  35921. treated as completely transparent.
  35922. </p>
  35923. <p>The option must be an integer value in the range [0,255]. Default is <var>128</var>.
  35924. </p></dd>
  35925. </dl>
  35926. <a name="Examples-32"></a>
  35927. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-32">39.148.1 Examples</a></h3>
  35928. <ul>
  35929. <li>
  35930. Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
  35931. using <code>ffmpeg</code>:
  35932. <div class="example">
  35933. <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  35934. </pre></div>
  35935. </li></ul>
  35936. <a name="perspective"></a>
  35937. <h2 class="section"><a href="ffmpeg-all.html#toc-perspective">39.149 perspective</a></h2>
  35938. <p>Correct perspective of video not recorded perpendicular to the screen.
  35939. </p>
  35940. <p>A description of the accepted parameters follows.
  35941. </p>
  35942. <dl compact="compact">
  35943. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  35944. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  35945. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  35946. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  35947. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  35948. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  35949. <dt>&lsquo;<samp>x3</samp>&rsquo;</dt>
  35950. <dt>&lsquo;<samp>y3</samp>&rsquo;</dt>
  35951. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  35952. Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  35953. If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
  35954. to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
  35955. then the corners of the source will be sent to the specified coordinates.
  35956. </p>
  35957. <p>The expressions can use the following variables:
  35958. </p>
  35959. <dl compact="compact">
  35960. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  35961. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  35962. <dd><p>the width and height of video frame.
  35963. </p></dd>
  35964. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  35965. <dd><p>Input frame count.
  35966. </p></dd>
  35967. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  35968. <dd><p>Output frame count.
  35969. </p></dd>
  35970. </dl>
  35971. </dd>
  35972. <dt>&lsquo;<samp>interpolation</samp>&rsquo;</dt>
  35973. <dd><p>Set interpolation for perspective correction.
  35974. </p>
  35975. <p>It accepts the following values:
  35976. </p><dl compact="compact">
  35977. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  35978. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  35979. </dl>
  35980. <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
  35981. </p>
  35982. </dd>
  35983. <dt>&lsquo;<samp>sense</samp>&rsquo;</dt>
  35984. <dd><p>Set interpretation of coordinate options.
  35985. </p>
  35986. <p>It accepts the following values:
  35987. </p><dl compact="compact">
  35988. <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
  35989. <dd>
  35990. <p>Send point in the source specified by the given coordinates to
  35991. the corners of the destination.
  35992. </p>
  35993. </dd>
  35994. <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
  35995. <dd>
  35996. <p>Send the corners of the source to the point in the destination specified
  35997. by the given coordinates.
  35998. </p>
  35999. <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
  36000. </p></dd>
  36001. </dl>
  36002. </dd>
  36003. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  36004. <dd><p>Set when the expressions for coordinates &lsquo;<samp>x0,y0,...x3,y3</samp>&rsquo; are evaluated.
  36005. </p>
  36006. <p>It accepts the following values:
  36007. </p><dl compact="compact">
  36008. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  36009. <dd><p>only evaluate expressions once during the filter initialization or
  36010. when a command is processed
  36011. </p>
  36012. </dd>
  36013. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  36014. <dd><p>evaluate expressions for each incoming frame
  36015. </p></dd>
  36016. </dl>
  36017. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  36018. </p></dd>
  36019. </dl>
  36020. <a name="phase"></a>
  36021. <h2 class="section"><a href="ffmpeg-all.html#toc-phase">39.150 phase</a></h2>
  36022. <p>Delay interlaced video by one field time so that the field order changes.
  36023. </p>
  36024. <p>The intended use is to fix PAL movies that have been captured with the
  36025. opposite field order to the film-to-video transfer.
  36026. </p>
  36027. <p>A description of the accepted parameters follows.
  36028. </p>
  36029. <dl compact="compact">
  36030. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  36031. <dd><p>Set phase mode.
  36032. </p>
  36033. <p>It accepts the following values:
  36034. </p><dl compact="compact">
  36035. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  36036. <dd><p>Capture field order top-first, transfer bottom-first.
  36037. Filter will delay the bottom field.
  36038. </p>
  36039. </dd>
  36040. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  36041. <dd><p>Capture field order bottom-first, transfer top-first.
  36042. Filter will delay the top field.
  36043. </p>
  36044. </dd>
  36045. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  36046. <dd><p>Capture and transfer with the same field order. This mode only exists
  36047. for the documentation of the other options to refer to, but if you
  36048. actually select it, the filter will faithfully do nothing.
  36049. </p>
  36050. </dd>
  36051. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  36052. <dd><p>Capture field order determined automatically by field flags, transfer
  36053. opposite.
  36054. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
  36055. basis using field flags. If no field information is available,
  36056. then this works just like &lsquo;<samp>u</samp>&rsquo;.
  36057. </p>
  36058. </dd>
  36059. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  36060. <dd><p>Capture unknown or varying, transfer opposite.
  36061. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
  36062. analyzing the images and selecting the alternative that produces best
  36063. match between the fields.
  36064. </p>
  36065. </dd>
  36066. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  36067. <dd><p>Capture top-first, transfer unknown or varying.
  36068. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  36069. </p>
  36070. </dd>
  36071. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  36072. <dd><p>Capture bottom-first, transfer unknown or varying.
  36073. Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  36074. </p>
  36075. </dd>
  36076. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  36077. <dd><p>Capture determined by field flags, transfer unknown or varying.
  36078. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
  36079. image analysis. If no field information is available, then this works just
  36080. like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
  36081. </p>
  36082. </dd>
  36083. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  36084. <dd><p>Both capture and transfer unknown or varying.
  36085. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
  36086. </p></dd>
  36087. </dl>
  36088. </dd>
  36089. </dl>
  36090. <a name="photosensitivity"></a>
  36091. <h2 class="section"><a href="ffmpeg-all.html#toc-photosensitivity">39.151 photosensitivity</a></h2>
  36092. <p>Reduce various flashes in video, so to help users with epilepsy.
  36093. </p>
  36094. <p>It accepts the following options:
  36095. </p><dl compact="compact">
  36096. <dt>&lsquo;<samp>frames, f</samp>&rsquo;</dt>
  36097. <dd><p>Set how many frames to use when filtering. Default is 30.
  36098. </p>
  36099. </dd>
  36100. <dt>&lsquo;<samp>threshold, t</samp>&rsquo;</dt>
  36101. <dd><p>Set detection threshold factor. Default is 1.
  36102. Lower is stricter.
  36103. </p>
  36104. </dd>
  36105. <dt>&lsquo;<samp>skip</samp>&rsquo;</dt>
  36106. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  36107. Allowed range is from 1 to 1024.
  36108. </p>
  36109. </dd>
  36110. <dt>&lsquo;<samp>bypass</samp>&rsquo;</dt>
  36111. <dd><p>Leave frames unchanged. Default is disabled.
  36112. </p></dd>
  36113. </dl>
  36114. <a name="pixdesctest"></a>
  36115. <h2 class="section"><a href="ffmpeg-all.html#toc-pixdesctest">39.152 pixdesctest</a></h2>
  36116. <p>Pixel format descriptor test filter, mainly useful for internal
  36117. testing. The output video should be equal to the input video.
  36118. </p>
  36119. <p>For example:
  36120. </p><div class="example">
  36121. <pre class="example">format=monow, pixdesctest
  36122. </pre></div>
  36123. <p>can be used to test the monowhite pixel format descriptor definition.
  36124. </p>
  36125. <a name="pixscope"></a>
  36126. <h2 class="section"><a href="ffmpeg-all.html#toc-pixscope">39.153 pixscope</a></h2>
  36127. <p>Display sample values of color channels. Mainly useful for checking color
  36128. and levels. Minimum supported resolution is 640x480.
  36129. </p>
  36130. <p>The filters accept the following options:
  36131. </p>
  36132. <dl compact="compact">
  36133. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  36134. <dd><p>Set scope X position, relative offset on X axis.
  36135. </p>
  36136. </dd>
  36137. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  36138. <dd><p>Set scope Y position, relative offset on Y axis.
  36139. </p>
  36140. </dd>
  36141. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  36142. <dd><p>Set scope width.
  36143. </p>
  36144. </dd>
  36145. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  36146. <dd><p>Set scope height.
  36147. </p>
  36148. </dd>
  36149. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  36150. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  36151. </p>
  36152. </dd>
  36153. <dt>&lsquo;<samp>wx</samp>&rsquo;</dt>
  36154. <dd><p>Set window X position, relative offset on X axis.
  36155. </p>
  36156. </dd>
  36157. <dt>&lsquo;<samp>wy</samp>&rsquo;</dt>
  36158. <dd><p>Set window Y position, relative offset on Y axis.
  36159. </p></dd>
  36160. </dl>
  36161. <a name="pp"></a>
  36162. <h2 class="section"><a href="ffmpeg-all.html#toc-pp">39.154 pp</a></h2>
  36163. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  36164. library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
  36165. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  36166. Each subfilter and some options have a short and a long name that can be used
  36167. interchangeably, i.e. dr/dering are the same.
  36168. </p>
  36169. <p>The filters accept the following options:
  36170. </p>
  36171. <dl compact="compact">
  36172. <dt>&lsquo;<samp>subfilters</samp>&rsquo;</dt>
  36173. <dd><p>Set postprocessing subfilters string.
  36174. </p></dd>
  36175. </dl>
  36176. <p>All subfilters share common options to determine their scope:
  36177. </p>
  36178. <dl compact="compact">
  36179. <dt>&lsquo;<samp>a/autoq</samp>&rsquo;</dt>
  36180. <dd><p>Honor the quality commands for this subfilter.
  36181. </p>
  36182. </dd>
  36183. <dt>&lsquo;<samp>c/chrom</samp>&rsquo;</dt>
  36184. <dd><p>Do chrominance filtering, too (default).
  36185. </p>
  36186. </dd>
  36187. <dt>&lsquo;<samp>y/nochrom</samp>&rsquo;</dt>
  36188. <dd><p>Do luminance filtering only (no chrominance).
  36189. </p>
  36190. </dd>
  36191. <dt>&lsquo;<samp>n/noluma</samp>&rsquo;</dt>
  36192. <dd><p>Do chrominance filtering only (no luminance).
  36193. </p></dd>
  36194. </dl>
  36195. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  36196. </p>
  36197. <p>Available subfilters are:
  36198. </p>
  36199. <dl compact="compact">
  36200. <dt>&lsquo;<samp>hb/hdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36201. <dd><p>Horizontal deblocking filter
  36202. </p><dl compact="compact">
  36203. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36204. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36205. </p></dd>
  36206. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36207. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36208. </p></dd>
  36209. </dl>
  36210. </dd>
  36211. <dt>&lsquo;<samp>vb/vdeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36212. <dd><p>Vertical deblocking filter
  36213. </p><dl compact="compact">
  36214. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36215. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36216. </p></dd>
  36217. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36218. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36219. </p></dd>
  36220. </dl>
  36221. </dd>
  36222. <dt>&lsquo;<samp>ha/hadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36223. <dd><p>Accurate horizontal deblocking filter
  36224. </p><dl compact="compact">
  36225. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36226. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36227. </p></dd>
  36228. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36229. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36230. </p></dd>
  36231. </dl>
  36232. </dd>
  36233. <dt>&lsquo;<samp>va/vadeblock[|difference[|flatness]]</samp>&rsquo;</dt>
  36234. <dd><p>Accurate vertical deblocking filter
  36235. </p><dl compact="compact">
  36236. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  36237. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  36238. </p></dd>
  36239. <dt>&lsquo;<samp>flatness</samp>&rsquo;</dt>
  36240. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  36241. </p></dd>
  36242. </dl>
  36243. </dd>
  36244. </dl>
  36245. <p>The horizontal and vertical deblocking filters share the difference and
  36246. flatness values so you cannot set different horizontal and vertical
  36247. thresholds.
  36248. </p>
  36249. <dl compact="compact">
  36250. <dt>&lsquo;<samp>h1/x1hdeblock</samp>&rsquo;</dt>
  36251. <dd><p>Experimental horizontal deblocking filter
  36252. </p>
  36253. </dd>
  36254. <dt>&lsquo;<samp>v1/x1vdeblock</samp>&rsquo;</dt>
  36255. <dd><p>Experimental vertical deblocking filter
  36256. </p>
  36257. </dd>
  36258. <dt>&lsquo;<samp>dr/dering</samp>&rsquo;</dt>
  36259. <dd><p>Deringing filter
  36260. </p>
  36261. </dd>
  36262. <dt>&lsquo;<samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp>&rsquo;</dt>
  36263. <dd><dl compact="compact">
  36264. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  36265. <dd><p>larger -&gt; stronger filtering
  36266. </p></dd>
  36267. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  36268. <dd><p>larger -&gt; stronger filtering
  36269. </p></dd>
  36270. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  36271. <dd><p>larger -&gt; stronger filtering
  36272. </p></dd>
  36273. </dl>
  36274. </dd>
  36275. <dt>&lsquo;<samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp>&rsquo;</dt>
  36276. <dd><dl compact="compact">
  36277. <dt>&lsquo;<samp>f/fullyrange</samp>&rsquo;</dt>
  36278. <dd><p>Stretch luminance to <code>0-255</code>.
  36279. </p></dd>
  36280. </dl>
  36281. </dd>
  36282. <dt>&lsquo;<samp>lb/linblenddeint</samp>&rsquo;</dt>
  36283. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  36284. filtering all lines with a <code>(1 2 1)</code> filter.
  36285. </p>
  36286. </dd>
  36287. <dt>&lsquo;<samp>li/linipoldeint</samp>&rsquo;</dt>
  36288. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  36289. linearly interpolating every second line.
  36290. </p>
  36291. </dd>
  36292. <dt>&lsquo;<samp>ci/cubicipoldeint</samp>&rsquo;</dt>
  36293. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  36294. cubically interpolating every second line.
  36295. </p>
  36296. </dd>
  36297. <dt>&lsquo;<samp>md/mediandeint</samp>&rsquo;</dt>
  36298. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  36299. median filter to every second line.
  36300. </p>
  36301. </dd>
  36302. <dt>&lsquo;<samp>fd/ffmpegdeint</samp>&rsquo;</dt>
  36303. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  36304. second line with a <code>(-1 4 2 4 -1)</code> filter.
  36305. </p>
  36306. </dd>
  36307. <dt>&lsquo;<samp>l5/lowpass5</samp>&rsquo;</dt>
  36308. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  36309. block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
  36310. </p>
  36311. </dd>
  36312. <dt>&lsquo;<samp>fq/forceQuant[|quantizer]</samp>&rsquo;</dt>
  36313. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  36314. specify.
  36315. </p><dl compact="compact">
  36316. <dt>&lsquo;<samp>quantizer</samp>&rsquo;</dt>
  36317. <dd><p>Quantizer to use
  36318. </p></dd>
  36319. </dl>
  36320. </dd>
  36321. <dt>&lsquo;<samp>de/default</samp>&rsquo;</dt>
  36322. <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
  36323. </p>
  36324. </dd>
  36325. <dt>&lsquo;<samp>fa/fast</samp>&rsquo;</dt>
  36326. <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
  36327. </p>
  36328. </dd>
  36329. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  36330. <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
  36331. </p></dd>
  36332. </dl>
  36333. <a name="Examples-18"></a>
  36334. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-18">39.154.1 Examples</a></h3>
  36335. <ul>
  36336. <li>
  36337. Apply horizontal and vertical deblocking, deringing and automatic
  36338. brightness/contrast:
  36339. <div class="example">
  36340. <pre class="example">pp=hb/vb/dr/al
  36341. </pre></div>
  36342. </li><li>
  36343. Apply default filters without brightness/contrast correction:
  36344. <div class="example">
  36345. <pre class="example">pp=de/-al
  36346. </pre></div>
  36347. </li><li>
  36348. Apply default filters and temporal denoiser:
  36349. <div class="example">
  36350. <pre class="example">pp=default/tmpnoise|1|2|3
  36351. </pre></div>
  36352. </li><li>
  36353. Apply deblocking on luminance only, and switch vertical deblocking on or off
  36354. automatically depending on available CPU time:
  36355. <div class="example">
  36356. <pre class="example">pp=hb|y/vb|a
  36357. </pre></div>
  36358. </li></ul>
  36359. <a name="pp7"></a>
  36360. <h2 class="section"><a href="ffmpeg-all.html#toc-pp7">39.155 pp7</a></h2>
  36361. <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
  36362. similar to spp = 6 with 7 point DCT, where only the center sample is
  36363. used after IDCT.
  36364. </p>
  36365. <p>The filter accepts the following options:
  36366. </p>
  36367. <dl compact="compact">
  36368. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  36369. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  36370. 0 to 63. If not set, the filter will use the QP from the video stream
  36371. (if available).
  36372. </p>
  36373. </dd>
  36374. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  36375. <dd><p>Set thresholding mode. Available modes are:
  36376. </p>
  36377. <dl compact="compact">
  36378. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  36379. <dd><p>Set hard thresholding.
  36380. </p></dd>
  36381. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  36382. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  36383. </p></dd>
  36384. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  36385. <dd><p>Set medium thresholding (good results, default).
  36386. </p></dd>
  36387. </dl>
  36388. </dd>
  36389. </dl>
  36390. <a name="premultiply"></a>
  36391. <h2 class="section"><a href="ffmpeg-all.html#toc-premultiply">39.156 premultiply</a></h2>
  36392. <p>Apply alpha premultiply effect to input video stream using first plane
  36393. of second stream as alpha.
  36394. </p>
  36395. <p>Both streams must have same dimensions and same pixel format.
  36396. </p>
  36397. <p>The filter accepts the following option:
  36398. </p>
  36399. <dl compact="compact">
  36400. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  36401. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36402. By default value 0xf, all planes will be processed.
  36403. </p>
  36404. </dd>
  36405. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  36406. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  36407. </p></dd>
  36408. </dl>
  36409. <a name="prewitt"></a>
  36410. <h2 class="section"><a href="ffmpeg-all.html#toc-prewitt">39.157 prewitt</a></h2>
  36411. <p>Apply prewitt operator to input video stream.
  36412. </p>
  36413. <p>The filter accepts the following option:
  36414. </p>
  36415. <dl compact="compact">
  36416. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  36417. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  36418. By default value 0xf, all planes will be processed.
  36419. </p>
  36420. </dd>
  36421. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  36422. <dd><p>Set value which will be multiplied with filtered result.
  36423. </p>
  36424. </dd>
  36425. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  36426. <dd><p>Set value which will be added to filtered result.
  36427. </p></dd>
  36428. </dl>
  36429. <a name="pseudocolor"></a>
  36430. <h2 class="section"><a href="ffmpeg-all.html#toc-pseudocolor">39.158 pseudocolor</a></h2>
  36431. <p>Alter frame colors in video with pseudocolors.
  36432. </p>
  36433. <p>This filter accepts the following options:
  36434. </p>
  36435. <dl compact="compact">
  36436. <dt>&lsquo;<samp>c0</samp>&rsquo;</dt>
  36437. <dd><p>set pixel first component expression
  36438. </p>
  36439. </dd>
  36440. <dt>&lsquo;<samp>c1</samp>&rsquo;</dt>
  36441. <dd><p>set pixel second component expression
  36442. </p>
  36443. </dd>
  36444. <dt>&lsquo;<samp>c2</samp>&rsquo;</dt>
  36445. <dd><p>set pixel third component expression
  36446. </p>
  36447. </dd>
  36448. <dt>&lsquo;<samp>c3</samp>&rsquo;</dt>
  36449. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  36450. </p>
  36451. </dd>
  36452. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  36453. <dd><p>set component to use as base for altering colors
  36454. </p></dd>
  36455. </dl>
  36456. <p>Each of them specifies the expression to use for computing the lookup table for
  36457. the corresponding pixel component values.
  36458. </p>
  36459. <p>The expressions can contain the following constants and functions:
  36460. </p>
  36461. <dl compact="compact">
  36462. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  36463. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  36464. <dd><p>The input width and height.
  36465. </p>
  36466. </dd>
  36467. <dt>&lsquo;<samp>val</samp>&rsquo;</dt>
  36468. <dd><p>The input value for the pixel component.
  36469. </p>
  36470. </dd>
  36471. <dt>&lsquo;<samp>ymin, umin, vmin, amin</samp>&rsquo;</dt>
  36472. <dd><p>The minimum allowed component value.
  36473. </p>
  36474. </dd>
  36475. <dt>&lsquo;<samp>ymax, umax, vmax, amax</samp>&rsquo;</dt>
  36476. <dd><p>The maximum allowed component value.
  36477. </p></dd>
  36478. </dl>
  36479. <p>All expressions default to &quot;val&quot;.
  36480. </p>
  36481. <a name="Examples-151"></a>
  36482. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-151">39.158.1 Examples</a></h3>
  36483. <ul>
  36484. <li>
  36485. Change too high luma values to gradient:
  36486. <div class="example">
  36487. <pre class="example">pseudocolor=&quot;'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'&quot;
  36488. </pre></div>
  36489. </li></ul>
  36490. <a name="psnr"></a>
  36491. <h2 class="section"><a href="ffmpeg-all.html#toc-psnr">39.159 psnr</a></h2>
  36492. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  36493. Ratio) between two input videos.
  36494. </p>
  36495. <p>This filter takes in input two input videos, the first input is
  36496. considered the &quot;main&quot; source and is passed unchanged to the
  36497. output. The second input is used as a &quot;reference&quot; video for computing
  36498. the PSNR.
  36499. </p>
  36500. <p>Both video inputs must have the same resolution and pixel format for
  36501. this filter to work correctly. Also it assumes that both inputs
  36502. have the same number of frames, which are compared one by one.
  36503. </p>
  36504. <p>The obtained average PSNR is printed through the logging system.
  36505. </p>
  36506. <p>The filter stores the accumulated MSE (mean squared error) of each
  36507. frame, and at the end of the processing it is averaged across all frames
  36508. equally, and the following formula is applied to obtain the PSNR:
  36509. </p>
  36510. <div class="example">
  36511. <pre class="example">PSNR = 10*log10(MAX^2/MSE)
  36512. </pre></div>
  36513. <p>Where MAX is the average of the maximum values of each component of the
  36514. image.
  36515. </p>
  36516. <p>The description of the accepted parameters follows.
  36517. </p>
  36518. <dl compact="compact">
  36519. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  36520. <dd><p>If specified the filter will use the named file to save the PSNR of
  36521. each individual frame. When filename equals &quot;-&quot; the data is sent to
  36522. standard output.
  36523. </p>
  36524. </dd>
  36525. <dt>&lsquo;<samp>stats_version</samp>&rsquo;</dt>
  36526. <dd><p>Specifies which version of the stats file format to use. Details of
  36527. each format are written below.
  36528. Default value is 1.
  36529. </p>
  36530. </dd>
  36531. <dt>&lsquo;<samp>stats_add_max</samp>&rsquo;</dt>
  36532. <dd><p>Determines whether the max value is output to the stats log.
  36533. Default value is 0.
  36534. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  36535. the filter will return an error.
  36536. </p></dd>
  36537. </dl>
  36538. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  36539. </p>
  36540. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  36541. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  36542. couple of frames.
  36543. </p>
  36544. <p>If a <var>stats_version</var> greater than 1 is specified, a header line precedes
  36545. the list of per-frame-pair stats, with key value pairs following the frame
  36546. format with the following parameters:
  36547. </p>
  36548. <dl compact="compact">
  36549. <dt>&lsquo;<samp>psnr_log_version</samp>&rsquo;</dt>
  36550. <dd><p>The version of the log file format. Will match <var>stats_version</var>.
  36551. </p>
  36552. </dd>
  36553. <dt>&lsquo;<samp>fields</samp>&rsquo;</dt>
  36554. <dd><p>A comma separated list of the per-frame-pair parameters included in
  36555. the log.
  36556. </p></dd>
  36557. </dl>
  36558. <p>A description of each shown per-frame-pair parameter follows:
  36559. </p>
  36560. <dl compact="compact">
  36561. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  36562. <dd><p>sequential number of the input frame, starting from 1
  36563. </p>
  36564. </dd>
  36565. <dt>&lsquo;<samp>mse_avg</samp>&rsquo;</dt>
  36566. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  36567. frames, averaged over all the image components.
  36568. </p>
  36569. </dd>
  36570. <dt>&lsquo;<samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp>&rsquo;</dt>
  36571. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  36572. frames for the component specified by the suffix.
  36573. </p>
  36574. </dd>
  36575. <dt>&lsquo;<samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp>&rsquo;</dt>
  36576. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  36577. specified by the suffix.
  36578. </p>
  36579. </dd>
  36580. <dt>&lsquo;<samp>max_avg, max_y, max_u, max_v</samp>&rsquo;</dt>
  36581. <dd><p>Maximum allowed value for each channel, and average over all
  36582. channels.
  36583. </p></dd>
  36584. </dl>
  36585. <a name="Examples"></a>
  36586. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples">39.159.1 Examples</a></h3>
  36587. <ul>
  36588. <li>
  36589. For example:
  36590. <div class="example">
  36591. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  36592. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  36593. </pre></div>
  36594. <p>On this example the input file being processed is compared with the
  36595. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The PSNR of each individual frame
  36596. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  36597. </p>
  36598. </li><li>
  36599. Another example with different containers:
  36600. <div class="example">
  36601. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr&quot; -f null -
  36602. </pre></div>
  36603. </li></ul>
  36604. <p><a name="pullup"></a>
  36605. </p><a name="pullup-1"></a>
  36606. <h2 class="section"><a href="ffmpeg-all.html#toc-pullup-1">39.160 pullup</a></h2>
  36607. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  36608. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  36609. content.
  36610. </p>
  36611. <p>The pullup filter is designed to take advantage of future context in making
  36612. its decisions. This filter is stateless in the sense that it does not lock
  36613. onto a pattern to follow, but it instead looks forward to the following
  36614. fields in order to identify matches and rebuild progressive frames.
  36615. </p>
  36616. <p>To produce content with an even framerate, insert the fps filter after
  36617. pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
  36618. <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
  36619. </p>
  36620. <p>The filter accepts the following options:
  36621. </p>
  36622. <dl compact="compact">
  36623. <dt>&lsquo;<samp>jl</samp>&rsquo;</dt>
  36624. <dt>&lsquo;<samp>jr</samp>&rsquo;</dt>
  36625. <dt>&lsquo;<samp>jt</samp>&rsquo;</dt>
  36626. <dt>&lsquo;<samp>jb</samp>&rsquo;</dt>
  36627. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  36628. bottom of the image, respectively. Left and right are in units of 8 pixels,
  36629. while top and bottom are in units of 2 lines.
  36630. The default is 8 pixels on each side.
  36631. </p>
  36632. </dd>
  36633. <dt>&lsquo;<samp>sb</samp>&rsquo;</dt>
  36634. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  36635. filter generating an occasional mismatched frame, but it may also cause an
  36636. excessive number of frames to be dropped during high motion sequences.
  36637. Conversely, setting it to -1 will make filter match fields more easily.
  36638. This may help processing of video where there is slight blurring between
  36639. the fields, but may also cause there to be interlaced frames in the output.
  36640. Default value is <code>0</code>.
  36641. </p>
  36642. </dd>
  36643. <dt>&lsquo;<samp>mp</samp>&rsquo;</dt>
  36644. <dd><p>Set the metric plane to use. It accepts the following values:
  36645. </p><dl compact="compact">
  36646. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  36647. <dd><p>Use luma plane.
  36648. </p>
  36649. </dd>
  36650. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  36651. <dd><p>Use chroma blue plane.
  36652. </p>
  36653. </dd>
  36654. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  36655. <dd><p>Use chroma red plane.
  36656. </p></dd>
  36657. </dl>
  36658. <p>This option may be set to use chroma plane instead of the default luma plane
  36659. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  36660. source material, but more likely will decrease accuracy, especially if there
  36661. is chroma noise (rainbow effect) or any grayscale video.
  36662. The main purpose of setting &lsquo;<samp>mp</samp>&rsquo; to a chroma plane is to reduce CPU
  36663. load and make pullup usable in realtime on slow machines.
  36664. </p></dd>
  36665. </dl>
  36666. <p>For best results (without duplicated frames in the output file) it is
  36667. necessary to change the output frame rate. For example, to inverse
  36668. telecine NTSC input:
  36669. </p><div class="example">
  36670. <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
  36671. </pre></div>
  36672. <a name="qp"></a>
  36673. <h2 class="section"><a href="ffmpeg-all.html#toc-qp">39.161 qp</a></h2>
  36674. <p>Change video quantization parameters (QP).
  36675. </p>
  36676. <p>The filter accepts the following option:
  36677. </p>
  36678. <dl compact="compact">
  36679. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  36680. <dd><p>Set expression for quantization parameter.
  36681. </p></dd>
  36682. </dl>
  36683. <p>The expression is evaluated through the eval API and can contain, among others,
  36684. the following constants:
  36685. </p>
  36686. <dl compact="compact">
  36687. <dt><var>known</var></dt>
  36688. <dd><p>1 if index is not 129, 0 otherwise.
  36689. </p>
  36690. </dd>
  36691. <dt><var>qp</var></dt>
  36692. <dd><p>Sequential index starting from -129 to 128.
  36693. </p></dd>
  36694. </dl>
  36695. <a name="Examples-177"></a>
  36696. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-177">39.161.1 Examples</a></h3>
  36697. <ul>
  36698. <li>
  36699. Some equation like:
  36700. <div class="example">
  36701. <pre class="example">qp=2+2*sin(PI*qp)
  36702. </pre></div>
  36703. </li></ul>
  36704. <a name="random"></a>
  36705. <h2 class="section"><a href="ffmpeg-all.html#toc-random">39.162 random</a></h2>
  36706. <p>Flush video frames from internal cache of frames into a random order.
  36707. No frame is discarded.
  36708. Inspired by <a href="#frei0r">frei0r</a> nervous filter.
  36709. </p>
  36710. <dl compact="compact">
  36711. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  36712. <dd><p>Set size in number of frames of internal cache, in range from <code>2</code> to
  36713. <code>512</code>. Default is <code>30</code>.
  36714. </p>
  36715. </dd>
  36716. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  36717. <dd><p>Set seed for random number generator, must be an integer included between
  36718. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  36719. less than <code>0</code>, the filter will try to use a good random seed on a
  36720. best effort basis.
  36721. </p></dd>
  36722. </dl>
  36723. <a name="readeia608"></a>
  36724. <h2 class="section"><a href="ffmpeg-all.html#toc-readeia608">39.163 readeia608</a></h2>
  36725. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  36726. </p>
  36727. <p>This filter adds frame metadata for <code>lavfi.readeia608.X.cc</code> and
  36728. <code>lavfi.readeia608.X.line</code>, where <code>X</code> is the number of the identified line
  36729. with EIA-608 data (starting from 0). A description of each metadata value follows:
  36730. </p>
  36731. <dl compact="compact">
  36732. <dt>&lsquo;<samp>lavfi.readeia608.X.cc</samp>&rsquo;</dt>
  36733. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  36734. </p>
  36735. </dd>
  36736. <dt>&lsquo;<samp>lavfi.readeia608.X.line</samp>&rsquo;</dt>
  36737. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  36738. </p></dd>
  36739. </dl>
  36740. <p>This filter accepts the following options:
  36741. </p>
  36742. <dl compact="compact">
  36743. <dt>&lsquo;<samp>scan_min</samp>&rsquo;</dt>
  36744. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code>0</code>.
  36745. </p>
  36746. </dd>
  36747. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  36748. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code>29</code>.
  36749. </p>
  36750. </dd>
  36751. <dt>&lsquo;<samp>spw</samp>&rsquo;</dt>
  36752. <dd><p>Set the ratio of width reserved for sync code detection.
  36753. Default is <code>0.27</code>. Allowed range is <code>[0.1 - 0.7]</code>.
  36754. </p>
  36755. </dd>
  36756. <dt>&lsquo;<samp>chp</samp>&rsquo;</dt>
  36757. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  36758. <code>0x00</code> for that character. Default is false.
  36759. </p>
  36760. </dd>
  36761. <dt>&lsquo;<samp>lp</samp>&rsquo;</dt>
  36762. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  36763. </p></dd>
  36764. </dl>
  36765. <a name="Examples-89"></a>
  36766. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-89">39.163.1 Examples</a></h3>
  36767. <ul>
  36768. <li>
  36769. Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  36770. <div class="example">
  36771. <pre class="example">ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pkt_pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
  36772. </pre></div>
  36773. </li></ul>
  36774. <a name="readvitc"></a>
  36775. <h2 class="section"><a href="ffmpeg-all.html#toc-readvitc">39.164 readvitc</a></h2>
  36776. <p>Read vertical interval timecode (VITC) information from the top lines of a
  36777. video frame.
  36778. </p>
  36779. <p>The filter adds frame metadata key <code>lavfi.readvitc.tc_str</code> with the
  36780. timecode value, if a valid timecode has been detected. Further metadata key
  36781. <code>lavfi.readvitc.found</code> is set to 0/1 depending on whether
  36782. timecode data has been found or not.
  36783. </p>
  36784. <p>This filter accepts the following options:
  36785. </p>
  36786. <dl compact="compact">
  36787. <dt>&lsquo;<samp>scan_max</samp>&rsquo;</dt>
  36788. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  36789. <code>-1</code> the full video frame is scanned. Default is <code>45</code>.
  36790. </p>
  36791. </dd>
  36792. <dt>&lsquo;<samp>thr_b</samp>&rsquo;</dt>
  36793. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  36794. default value is <code>0.2</code>. The value must be equal or less than <code>thr_w</code>.
  36795. </p>
  36796. </dd>
  36797. <dt>&lsquo;<samp>thr_w</samp>&rsquo;</dt>
  36798. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  36799. default value is <code>0.6</code>. The value must be equal or greater than <code>thr_b</code>.
  36800. </p></dd>
  36801. </dl>
  36802. <a name="Examples-139"></a>
  36803. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-139">39.164.1 Examples</a></h3>
  36804. <ul>
  36805. <li>
  36806. Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  36807. draw <code>--:--:--:--</code> as a placeholder:
  36808. <div class="example">
  36809. <pre class="example">ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
  36810. </pre></div>
  36811. </li></ul>
  36812. <a name="remap"></a>
  36813. <h2 class="section"><a href="ffmpeg-all.html#toc-remap">39.165 remap</a></h2>
  36814. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  36815. </p>
  36816. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  36817. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  36818. value for pixel will be used for destination pixel.
  36819. </p>
  36820. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  36821. will have Xmap/Ymap video stream dimensions.
  36822. Xmap and Ymap input video streams are 16bit depth, single channel.
  36823. </p>
  36824. <dl compact="compact">
  36825. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  36826. <dd><p>Specify pixel format of output from this filter. Can be <code>color</code> or <code>gray</code>.
  36827. Default is <code>color</code>.
  36828. </p>
  36829. </dd>
  36830. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  36831. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  36832. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. Default color is <code>black</code>.
  36833. </p></dd>
  36834. </dl>
  36835. <a name="removegrain"></a>
  36836. <h2 class="section"><a href="ffmpeg-all.html#toc-removegrain">39.166 removegrain</a></h2>
  36837. <p>The removegrain filter is a spatial denoiser for progressive video.
  36838. </p>
  36839. <dl compact="compact">
  36840. <dt>&lsquo;<samp>m0</samp>&rsquo;</dt>
  36841. <dd><p>Set mode for the first plane.
  36842. </p>
  36843. </dd>
  36844. <dt>&lsquo;<samp>m1</samp>&rsquo;</dt>
  36845. <dd><p>Set mode for the second plane.
  36846. </p>
  36847. </dd>
  36848. <dt>&lsquo;<samp>m2</samp>&rsquo;</dt>
  36849. <dd><p>Set mode for the third plane.
  36850. </p>
  36851. </dd>
  36852. <dt>&lsquo;<samp>m3</samp>&rsquo;</dt>
  36853. <dd><p>Set mode for the fourth plane.
  36854. </p></dd>
  36855. </dl>
  36856. <p>Range of mode is from 0 to 24. Description of each mode follows:
  36857. </p>
  36858. <dl compact="compact">
  36859. <dt><var>0</var></dt>
  36860. <dd><p>Leave input plane unchanged. Default.
  36861. </p>
  36862. </dd>
  36863. <dt><var>1</var></dt>
  36864. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  36865. </p>
  36866. </dd>
  36867. <dt><var>2</var></dt>
  36868. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  36869. </p>
  36870. </dd>
  36871. <dt><var>3</var></dt>
  36872. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  36873. </p>
  36874. </dd>
  36875. <dt><var>4</var></dt>
  36876. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  36877. This is equivalent to a median filter.
  36878. </p>
  36879. </dd>
  36880. <dt><var>5</var></dt>
  36881. <dd><p>Line-sensitive clipping giving the minimal change.
  36882. </p>
  36883. </dd>
  36884. <dt><var>6</var></dt>
  36885. <dd><p>Line-sensitive clipping, intermediate.
  36886. </p>
  36887. </dd>
  36888. <dt><var>7</var></dt>
  36889. <dd><p>Line-sensitive clipping, intermediate.
  36890. </p>
  36891. </dd>
  36892. <dt><var>8</var></dt>
  36893. <dd><p>Line-sensitive clipping, intermediate.
  36894. </p>
  36895. </dd>
  36896. <dt><var>9</var></dt>
  36897. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  36898. </p>
  36899. </dd>
  36900. <dt><var>10</var></dt>
  36901. <dd><p>Replaces the target pixel with the closest neighbour.
  36902. </p>
  36903. </dd>
  36904. <dt><var>11</var></dt>
  36905. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  36906. </p>
  36907. </dd>
  36908. <dt><var>12</var></dt>
  36909. <dd><p>Same as mode 11.
  36910. </p>
  36911. </dd>
  36912. <dt><var>13</var></dt>
  36913. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  36914. pixels are the closest.
  36915. </p>
  36916. </dd>
  36917. <dt><var>14</var></dt>
  36918. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  36919. pixels are the closest.
  36920. </p>
  36921. </dd>
  36922. <dt><var>15</var></dt>
  36923. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  36924. interpolation formula.
  36925. </p>
  36926. </dd>
  36927. <dt><var>16</var></dt>
  36928. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  36929. interpolation formula.
  36930. </p>
  36931. </dd>
  36932. <dt><var>17</var></dt>
  36933. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  36934. minimum of each pair of opposite neighbour pixels.
  36935. </p>
  36936. </dd>
  36937. <dt><var>18</var></dt>
  36938. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  36939. the current pixel is minimal.
  36940. </p>
  36941. </dd>
  36942. <dt><var>19</var></dt>
  36943. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  36944. </p>
  36945. </dd>
  36946. <dt><var>20</var></dt>
  36947. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  36948. </p>
  36949. </dd>
  36950. <dt><var>21</var></dt>
  36951. <dd><p>Clips pixels using the averages of opposite neighbour.
  36952. </p>
  36953. </dd>
  36954. <dt><var>22</var></dt>
  36955. <dd><p>Same as mode 21 but simpler and faster.
  36956. </p>
  36957. </dd>
  36958. <dt><var>23</var></dt>
  36959. <dd><p>Small edge and halo removal, but reputed useless.
  36960. </p>
  36961. </dd>
  36962. <dt><var>24</var></dt>
  36963. <dd><p>Similar as 23.
  36964. </p></dd>
  36965. </dl>
  36966. <a name="removelogo"></a>
  36967. <h2 class="section"><a href="ffmpeg-all.html#toc-removelogo">39.167 removelogo</a></h2>
  36968. <p>Suppress a TV station logo, using an image file to determine which
  36969. pixels comprise the logo. It works by filling in the pixels that
  36970. comprise the logo with neighboring pixels.
  36971. </p>
  36972. <p>The filter accepts the following options:
  36973. </p>
  36974. <dl compact="compact">
  36975. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  36976. <dd><p>Set the filter bitmap file, which can be any image format supported by
  36977. libavformat. The width and height of the image file must match those of the
  36978. video stream being processed.
  36979. </p></dd>
  36980. </dl>
  36981. <p>Pixels in the provided bitmap image with a value of zero are not
  36982. considered part of the logo, non-zero pixels are considered part of
  36983. the logo. If you use white (255) for the logo and black (0) for the
  36984. rest, you will be safe. For making the filter bitmap, it is
  36985. recommended to take a screen capture of a black frame with the logo
  36986. visible, and then using a threshold filter followed by the erode
  36987. filter once or twice.
  36988. </p>
  36989. <p>If needed, little splotches can be fixed manually. Remember that if
  36990. logo pixels are not covered, the filter quality will be much
  36991. reduced. Marking too many pixels as part of the logo does not hurt as
  36992. much, but it will increase the amount of blurring needed to cover over
  36993. the image and will destroy more information than necessary, and extra
  36994. pixels will slow things down on a large logo.
  36995. </p>
  36996. <a name="repeatfields"></a>
  36997. <h2 class="section"><a href="ffmpeg-all.html#toc-repeatfields">39.168 repeatfields</a></h2>
  36998. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  36999. fields based on its value.
  37000. </p>
  37001. <a name="reverse"></a>
  37002. <h2 class="section"><a href="ffmpeg-all.html#toc-reverse">39.169 reverse</a></h2>
  37003. <p>Reverse a video clip.
  37004. </p>
  37005. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  37006. is suggested.
  37007. </p>
  37008. <a name="Examples-118"></a>
  37009. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-118">39.169.1 Examples</a></h3>
  37010. <ul>
  37011. <li>
  37012. Take the first 5 seconds of a clip, and reverse it.
  37013. <div class="example">
  37014. <pre class="example">trim=end=5,reverse
  37015. </pre></div>
  37016. </li></ul>
  37017. <a name="rgbashift"></a>
  37018. <h2 class="section"><a href="ffmpeg-all.html#toc-rgbashift">39.170 rgbashift</a></h2>
  37019. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  37020. </p>
  37021. <p>The filter accepts the following options:
  37022. </p><dl compact="compact">
  37023. <dt>&lsquo;<samp>rh</samp>&rsquo;</dt>
  37024. <dd><p>Set amount to shift red horizontally.
  37025. </p></dd>
  37026. <dt>&lsquo;<samp>rv</samp>&rsquo;</dt>
  37027. <dd><p>Set amount to shift red vertically.
  37028. </p></dd>
  37029. <dt>&lsquo;<samp>gh</samp>&rsquo;</dt>
  37030. <dd><p>Set amount to shift green horizontally.
  37031. </p></dd>
  37032. <dt>&lsquo;<samp>gv</samp>&rsquo;</dt>
  37033. <dd><p>Set amount to shift green vertically.
  37034. </p></dd>
  37035. <dt>&lsquo;<samp>bh</samp>&rsquo;</dt>
  37036. <dd><p>Set amount to shift blue horizontally.
  37037. </p></dd>
  37038. <dt>&lsquo;<samp>bv</samp>&rsquo;</dt>
  37039. <dd><p>Set amount to shift blue vertically.
  37040. </p></dd>
  37041. <dt>&lsquo;<samp>ah</samp>&rsquo;</dt>
  37042. <dd><p>Set amount to shift alpha horizontally.
  37043. </p></dd>
  37044. <dt>&lsquo;<samp>av</samp>&rsquo;</dt>
  37045. <dd><p>Set amount to shift alpha vertically.
  37046. </p></dd>
  37047. <dt>&lsquo;<samp>edge</samp>&rsquo;</dt>
  37048. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  37049. </p></dd>
  37050. </dl>
  37051. <a name="Commands-50"></a>
  37052. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-50">39.170.1 Commands</a></h3>
  37053. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  37054. </p>
  37055. <a name="roberts"></a>
  37056. <h2 class="section"><a href="ffmpeg-all.html#toc-roberts">39.171 roberts</a></h2>
  37057. <p>Apply roberts cross operator to input video stream.
  37058. </p>
  37059. <p>The filter accepts the following option:
  37060. </p>
  37061. <dl compact="compact">
  37062. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  37063. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  37064. By default value 0xf, all planes will be processed.
  37065. </p>
  37066. </dd>
  37067. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  37068. <dd><p>Set value which will be multiplied with filtered result.
  37069. </p>
  37070. </dd>
  37071. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  37072. <dd><p>Set value which will be added to filtered result.
  37073. </p></dd>
  37074. </dl>
  37075. <a name="rotate"></a>
  37076. <h2 class="section"><a href="ffmpeg-all.html#toc-rotate">39.172 rotate</a></h2>
  37077. <p>Rotate video by an arbitrary angle expressed in radians.
  37078. </p>
  37079. <p>The filter accepts the following options:
  37080. </p>
  37081. <p>A description of the optional parameters follows.
  37082. </p><dl compact="compact">
  37083. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  37084. <dd><p>Set an expression for the angle by which to rotate the input video
  37085. clockwise, expressed as a number of radians. A negative value will
  37086. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  37087. </p>
  37088. <p>This expression is evaluated for each frame.
  37089. </p>
  37090. </dd>
  37091. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  37092. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  37093. This expression is evaluated just once during configuration.
  37094. </p>
  37095. </dd>
  37096. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  37097. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  37098. This expression is evaluated just once during configuration.
  37099. </p>
  37100. </dd>
  37101. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  37102. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  37103. it. Default value is 1.
  37104. </p>
  37105. </dd>
  37106. <dt>&lsquo;<samp>fillcolor, c</samp>&rsquo;</dt>
  37107. <dd><p>Set the color used to fill the output area not covered by the rotated
  37108. image. For the general syntax of this option, check the
  37109. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  37110. If the special value &quot;none&quot; is selected then no
  37111. background is printed (useful for example if the background is never shown).
  37112. </p>
  37113. <p>Default value is &quot;black&quot;.
  37114. </p></dd>
  37115. </dl>
  37116. <p>The expressions for the angle and the output size can contain the
  37117. following constants and functions:
  37118. </p>
  37119. <dl compact="compact">
  37120. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  37121. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  37122. before the first frame is filtered.
  37123. </p>
  37124. </dd>
  37125. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  37126. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  37127. configured. It is always NAN before the first frame is filtered.
  37128. </p>
  37129. </dd>
  37130. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  37131. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  37132. <dd><p>horizontal and vertical chroma subsample values. For example for the
  37133. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37134. </p>
  37135. </dd>
  37136. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  37137. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  37138. <dd><p>the input video width and height
  37139. </p>
  37140. </dd>
  37141. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  37142. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  37143. <dd><p>the output width and height, that is the size of the padded area as
  37144. specified by the <var>width</var> and <var>height</var> expressions
  37145. </p>
  37146. </dd>
  37147. <dt>&lsquo;<samp>rotw(a)</samp>&rsquo;</dt>
  37148. <dt>&lsquo;<samp>roth(a)</samp>&rsquo;</dt>
  37149. <dd><p>the minimal width/height required for completely containing the input
  37150. video rotated by <var>a</var> radians.
  37151. </p>
  37152. <p>These are only available when computing the &lsquo;<samp>out_w</samp>&rsquo; and
  37153. &lsquo;<samp>out_h</samp>&rsquo; expressions.
  37154. </p></dd>
  37155. </dl>
  37156. <a name="Examples-143"></a>
  37157. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-143">39.172.1 Examples</a></h3>
  37158. <ul>
  37159. <li>
  37160. Rotate the input by PI/6 radians clockwise:
  37161. <div class="example">
  37162. <pre class="example">rotate=PI/6
  37163. </pre></div>
  37164. </li><li>
  37165. Rotate the input by PI/6 radians counter-clockwise:
  37166. <div class="example">
  37167. <pre class="example">rotate=-PI/6
  37168. </pre></div>
  37169. </li><li>
  37170. Rotate the input by 45 degrees clockwise:
  37171. <div class="example">
  37172. <pre class="example">rotate=45*PI/180
  37173. </pre></div>
  37174. </li><li>
  37175. Apply a constant rotation with period T, starting from an angle of PI/3:
  37176. <div class="example">
  37177. <pre class="example">rotate=PI/3+2*PI*t/T
  37178. </pre></div>
  37179. </li><li>
  37180. Make the input video rotation oscillating with a period of T
  37181. seconds and an amplitude of A radians:
  37182. <div class="example">
  37183. <pre class="example">rotate=A*sin(2*PI/T*t)
  37184. </pre></div>
  37185. </li><li>
  37186. Rotate the video, output size is chosen so that the whole rotating
  37187. input video is always completely contained in the output:
  37188. <div class="example">
  37189. <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  37190. </pre></div>
  37191. </li><li>
  37192. Rotate the video, reduce the output size so that no background is ever
  37193. shown:
  37194. <div class="example">
  37195. <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  37196. </pre></div>
  37197. </li></ul>
  37198. <a name="Commands-3"></a>
  37199. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-3">39.172.2 Commands</a></h3>
  37200. <p>The filter supports the following commands:
  37201. </p>
  37202. <dl compact="compact">
  37203. <dt>&lsquo;<samp>a, angle</samp>&rsquo;</dt>
  37204. <dd><p>Set the angle expression.
  37205. The command accepts the same syntax of the corresponding option.
  37206. </p>
  37207. <p>If the specified expression is not valid, it is kept at its current
  37208. value.
  37209. </p></dd>
  37210. </dl>
  37211. <a name="sab"></a>
  37212. <h2 class="section"><a href="ffmpeg-all.html#toc-sab">39.173 sab</a></h2>
  37213. <p>Apply Shape Adaptive Blur.
  37214. </p>
  37215. <p>The filter accepts the following options:
  37216. </p>
  37217. <dl compact="compact">
  37218. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  37219. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  37220. value is 1.0. A greater value will result in a more blurred image, and
  37221. in slower processing.
  37222. </p>
  37223. </dd>
  37224. <dt>&lsquo;<samp>luma_pre_filter_radius, lpfr</samp>&rsquo;</dt>
  37225. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  37226. value is 1.0.
  37227. </p>
  37228. </dd>
  37229. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  37230. <dd><p>Set luma maximum difference between pixels to still be considered, must
  37231. be a value in the 0.1-100.0 range, default value is 1.0.
  37232. </p>
  37233. </dd>
  37234. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  37235. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  37236. greater value will result in a more blurred image, and in slower
  37237. processing.
  37238. </p>
  37239. </dd>
  37240. <dt>&lsquo;<samp>chroma_pre_filter_radius, cpfr</samp>&rsquo;</dt>
  37241. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  37242. </p>
  37243. </dd>
  37244. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  37245. <dd><p>Set chroma maximum difference between pixels to still be considered,
  37246. must be a value in the -0.9-100.0 range.
  37247. </p></dd>
  37248. </dl>
  37249. <p>Each chroma option value, if not explicitly specified, is set to the
  37250. corresponding luma option value.
  37251. </p>
  37252. <p><a name="scale"></a>
  37253. </p><a name="scale-1"></a>
  37254. <h2 class="section"><a href="ffmpeg-all.html#toc-scale-1">39.174 scale</a></h2>
  37255. <p>Scale (resize) the input video, using the libswscale library.
  37256. </p>
  37257. <p>The scale filter forces the output display aspect ratio to be the same
  37258. of the input, by changing the output sample aspect ratio.
  37259. </p>
  37260. <p>If the input image format is different from the format requested by
  37261. the next filter, the scale filter will convert the input to the
  37262. requested format.
  37263. </p>
  37264. <a name="Options-22"></a>
  37265. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-22">39.174.1 Options</a></h3>
  37266. <p>The filter accepts the following options, or any of the options
  37267. supported by the libswscale scaler.
  37268. </p>
  37269. <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
  37270. the complete list of scaler options.
  37271. </p>
  37272. <dl compact="compact">
  37273. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  37274. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  37275. <dd><p>Set the output video dimension expression. Default value is the input
  37276. dimension.
  37277. </p>
  37278. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  37279. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  37280. is used for the output.
  37281. </p>
  37282. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  37283. will use a value that maintains the aspect ratio of the input image,
  37284. calculated from the other specified dimension. After that it will,
  37285. however, make sure that the calculated dimension is divisible by n and
  37286. adjust the value if necessary.
  37287. </p>
  37288. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  37289. both values being set to 0 as previously detailed.
  37290. </p>
  37291. <p>See below for the list of accepted constants for use in the dimension
  37292. expression.
  37293. </p>
  37294. </dd>
  37295. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  37296. <dd><p>Specify when to evaluate <var>width</var> and <var>height</var> expression. It accepts the following values:
  37297. </p>
  37298. <dl compact="compact">
  37299. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  37300. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  37301. </p>
  37302. </dd>
  37303. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  37304. <dd><p>Evaluate expressions for each incoming frame.
  37305. </p>
  37306. </dd>
  37307. </dl>
  37308. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  37309. </p>
  37310. </dd>
  37311. <dt>&lsquo;<samp>interl</samp>&rsquo;</dt>
  37312. <dd><p>Set the interlacing mode. It accepts the following values:
  37313. </p>
  37314. <dl compact="compact">
  37315. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  37316. <dd><p>Force interlaced aware scaling.
  37317. </p>
  37318. </dd>
  37319. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  37320. <dd><p>Do not apply interlaced scaling.
  37321. </p>
  37322. </dd>
  37323. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  37324. <dd><p>Select interlaced aware scaling depending on whether the source frames
  37325. are flagged as interlaced or not.
  37326. </p></dd>
  37327. </dl>
  37328. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  37329. </p>
  37330. </dd>
  37331. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  37332. <dd><p>Set libswscale scaling flags. See
  37333. <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  37334. complete list of values. If not explicitly specified the filter applies
  37335. the default flags.
  37336. </p>
  37337. </dd>
  37338. <dt>&lsquo;<samp>param0, param1</samp>&rsquo;</dt>
  37339. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  37340. <a href="ffmpeg-scaler.html#sws_005fparams">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  37341. complete documentation. If not explicitly specified the filter applies
  37342. empty parameters.
  37343. </p>
  37344. </dd>
  37345. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  37346. <dd><p>Set the video size. For the syntax of this option, check the
  37347. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37348. </p>
  37349. </dd>
  37350. <dt>&lsquo;<samp>in_color_matrix</samp>&rsquo;</dt>
  37351. <dt>&lsquo;<samp>out_color_matrix</samp>&rsquo;</dt>
  37352. <dd><p>Set in/output YCbCr color space type.
  37353. </p>
  37354. <p>This allows the autodetected value to be overridden as well as allows forcing
  37355. a specific value used for the output and encoder.
  37356. </p>
  37357. <p>If not specified, the color space type depends on the pixel format.
  37358. </p>
  37359. <p>Possible values:
  37360. </p>
  37361. <dl compact="compact">
  37362. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  37363. <dd><p>Choose automatically.
  37364. </p>
  37365. </dd>
  37366. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  37367. <dd><p>Format conforming to International Telecommunication Union (ITU)
  37368. Recommendation BT.709.
  37369. </p>
  37370. </dd>
  37371. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  37372. <dd><p>Set color space conforming to the United States Federal Communications
  37373. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  37374. </p>
  37375. </dd>
  37376. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  37377. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  37378. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  37379. <dd><p>Set color space conforming to:
  37380. </p>
  37381. <ul>
  37382. <li>
  37383. ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  37384. </li><li>
  37385. ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  37386. </li><li>
  37387. Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  37388. </li></ul>
  37389. </dd>
  37390. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  37391. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  37392. </p>
  37393. </dd>
  37394. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  37395. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  37396. </p></dd>
  37397. </dl>
  37398. </dd>
  37399. <dt>&lsquo;<samp>in_range</samp>&rsquo;</dt>
  37400. <dt>&lsquo;<samp>out_range</samp>&rsquo;</dt>
  37401. <dd><p>Set in/output YCbCr sample range.
  37402. </p>
  37403. <p>This allows the autodetected value to be overridden as well as allows forcing
  37404. a specific value used for the output and encoder. If not specified, the
  37405. range depends on the pixel format. Possible values:
  37406. </p>
  37407. <dl compact="compact">
  37408. <dt>&lsquo;<samp>auto/unknown</samp>&rsquo;</dt>
  37409. <dd><p>Choose automatically.
  37410. </p>
  37411. </dd>
  37412. <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
  37413. <dd><p>Set full range (0-255 in case of 8-bit luma).
  37414. </p>
  37415. </dd>
  37416. <dt>&lsquo;<samp>mpeg/limited/tv</samp>&rsquo;</dt>
  37417. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  37418. </p></dd>
  37419. </dl>
  37420. </dd>
  37421. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  37422. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  37423. keep the original aspect ratio. Possible values:
  37424. </p>
  37425. <dl compact="compact">
  37426. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  37427. <dd><p>Scale the video as specified and disable this feature.
  37428. </p>
  37429. </dd>
  37430. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  37431. <dd><p>The output video dimensions will automatically be decreased if needed.
  37432. </p>
  37433. </dd>
  37434. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  37435. <dd><p>The output video dimensions will automatically be increased if needed.
  37436. </p>
  37437. </dd>
  37438. </dl>
  37439. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  37440. maximum allowed resolution, you can use this to limit the output video to
  37441. that, while retaining the aspect ratio. For example, device A allows
  37442. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  37443. decrease) and specifying 1280x720 to the command line makes the output
  37444. 1280x533.
  37445. </p>
  37446. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  37447. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  37448. to work.
  37449. </p>
  37450. </dd>
  37451. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  37452. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  37453. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  37454. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  37455. </p>
  37456. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  37457. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  37458. may be slightly modified.
  37459. </p>
  37460. <p>This option can be handy if you need to have a video fit within or exceed
  37461. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  37462. encoder restrictions on width or height divisibility.
  37463. </p>
  37464. </dd>
  37465. </dl>
  37466. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  37467. containing the following constants:
  37468. </p>
  37469. <dl compact="compact">
  37470. <dt><var>in_w</var></dt>
  37471. <dt><var>in_h</var></dt>
  37472. <dd><p>The input width and height
  37473. </p>
  37474. </dd>
  37475. <dt><var>iw</var></dt>
  37476. <dt><var>ih</var></dt>
  37477. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  37478. </p>
  37479. </dd>
  37480. <dt><var>out_w</var></dt>
  37481. <dt><var>out_h</var></dt>
  37482. <dd><p>The output (scaled) width and height
  37483. </p>
  37484. </dd>
  37485. <dt><var>ow</var></dt>
  37486. <dt><var>oh</var></dt>
  37487. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  37488. </p>
  37489. </dd>
  37490. <dt><var>a</var></dt>
  37491. <dd><p>The same as <var>iw</var> / <var>ih</var>
  37492. </p>
  37493. </dd>
  37494. <dt><var>sar</var></dt>
  37495. <dd><p>input sample aspect ratio
  37496. </p>
  37497. </dd>
  37498. <dt><var>dar</var></dt>
  37499. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  37500. </p>
  37501. </dd>
  37502. <dt><var>hsub</var></dt>
  37503. <dt><var>vsub</var></dt>
  37504. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  37505. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37506. </p>
  37507. </dd>
  37508. <dt><var>ohsub</var></dt>
  37509. <dt><var>ovsub</var></dt>
  37510. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  37511. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37512. </p>
  37513. </dd>
  37514. <dt><var>n</var></dt>
  37515. <dd><p>The (sequential) number of the input frame, starting from 0.
  37516. Only available with <code>eval=frame</code>.
  37517. </p>
  37518. </dd>
  37519. <dt><var>t</var></dt>
  37520. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  37521. seconds. Only available with <code>eval=frame</code>.
  37522. </p>
  37523. </dd>
  37524. <dt><var>pos</var></dt>
  37525. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  37526. this information is unavailable and/or meaningless (for example in case of synthetic video).
  37527. Only available with <code>eval=frame</code>.
  37528. </p></dd>
  37529. </dl>
  37530. <a name="Examples-154"></a>
  37531. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-154">39.174.2 Examples</a></h3>
  37532. <ul>
  37533. <li>
  37534. Scale the input video to a size of 200x100
  37535. <div class="example">
  37536. <pre class="example">scale=w=200:h=100
  37537. </pre></div>
  37538. <p>This is equivalent to:
  37539. </p><div class="example">
  37540. <pre class="example">scale=200:100
  37541. </pre></div>
  37542. <p>or:
  37543. </p><div class="example">
  37544. <pre class="example">scale=200x100
  37545. </pre></div>
  37546. </li><li>
  37547. Specify a size abbreviation for the output size:
  37548. <div class="example">
  37549. <pre class="example">scale=qcif
  37550. </pre></div>
  37551. <p>which can also be written as:
  37552. </p><div class="example">
  37553. <pre class="example">scale=size=qcif
  37554. </pre></div>
  37555. </li><li>
  37556. Scale the input to 2x:
  37557. <div class="example">
  37558. <pre class="example">scale=w=2*iw:h=2*ih
  37559. </pre></div>
  37560. </li><li>
  37561. The above is the same as:
  37562. <div class="example">
  37563. <pre class="example">scale=2*in_w:2*in_h
  37564. </pre></div>
  37565. </li><li>
  37566. Scale the input to 2x with forced interlaced scaling:
  37567. <div class="example">
  37568. <pre class="example">scale=2*iw:2*ih:interl=1
  37569. </pre></div>
  37570. </li><li>
  37571. Scale the input to half size:
  37572. <div class="example">
  37573. <pre class="example">scale=w=iw/2:h=ih/2
  37574. </pre></div>
  37575. </li><li>
  37576. Increase the width, and set the height to the same size:
  37577. <div class="example">
  37578. <pre class="example">scale=3/2*iw:ow
  37579. </pre></div>
  37580. </li><li>
  37581. Seek Greek harmony:
  37582. <div class="example">
  37583. <pre class="example">scale=iw:1/PHI*iw
  37584. scale=ih*PHI:ih
  37585. </pre></div>
  37586. </li><li>
  37587. Increase the height, and set the width to 3/2 of the height:
  37588. <div class="example">
  37589. <pre class="example">scale=w=3/2*oh:h=3/5*ih
  37590. </pre></div>
  37591. </li><li>
  37592. Increase the size, making the size a multiple of the chroma
  37593. subsample values:
  37594. <div class="example">
  37595. <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  37596. </pre></div>
  37597. </li><li>
  37598. Increase the width to a maximum of 500 pixels,
  37599. keeping the same aspect ratio as the input:
  37600. <div class="example">
  37601. <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
  37602. </pre></div>
  37603. </li><li>
  37604. Make pixels square by combining scale and setsar:
  37605. <div class="example">
  37606. <pre class="example">scale='trunc(ih*dar):ih',setsar=1/1
  37607. </pre></div>
  37608. </li><li>
  37609. Make pixels square by combining scale and setsar,
  37610. making sure the resulting resolution is even (required by some codecs):
  37611. <div class="example">
  37612. <pre class="example">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  37613. </pre></div>
  37614. </li></ul>
  37615. <a name="Commands-54"></a>
  37616. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-54">39.174.3 Commands</a></h3>
  37617. <p>This filter supports the following commands:
  37618. </p><dl compact="compact">
  37619. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  37620. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  37621. <dd><p>Set the output video dimension expression.
  37622. The command accepts the same syntax of the corresponding option.
  37623. </p>
  37624. <p>If the specified expression is not valid, it is kept at its current
  37625. value.
  37626. </p></dd>
  37627. </dl>
  37628. <a name="scale_005fnpp"></a>
  37629. <h2 class="section"><a href="ffmpeg-all.html#toc-scale_005fnpp">39.175 scale_npp</a></h2>
  37630. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  37631. format conversion on CUDA video frames. Setting the output width and height
  37632. works in the same way as for the <var>scale</var> filter.
  37633. </p>
  37634. <p>The following additional options are accepted:
  37635. </p><dl compact="compact">
  37636. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  37637. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  37638. default), the input format will be kept. Note that automatic format negotiation
  37639. and conversion is not yet supported for hardware frames
  37640. </p>
  37641. </dd>
  37642. <dt>&lsquo;<samp>interp_algo</samp>&rsquo;</dt>
  37643. <dd><p>The interpolation algorithm used for resizing. One of the following:
  37644. </p><dl compact="compact">
  37645. <dt>&lsquo;<samp>nn</samp>&rsquo;</dt>
  37646. <dd><p>Nearest neighbour.
  37647. </p>
  37648. </dd>
  37649. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  37650. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  37651. <dt>&lsquo;<samp>cubic2p_bspline</samp>&rsquo;</dt>
  37652. <dd><p>2-parameter cubic (B=1, C=0)
  37653. </p>
  37654. </dd>
  37655. <dt>&lsquo;<samp>cubic2p_catmullrom</samp>&rsquo;</dt>
  37656. <dd><p>2-parameter cubic (B=0, C=1/2)
  37657. </p>
  37658. </dd>
  37659. <dt>&lsquo;<samp>cubic2p_b05c03</samp>&rsquo;</dt>
  37660. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  37661. </p>
  37662. </dd>
  37663. <dt>&lsquo;<samp>super</samp>&rsquo;</dt>
  37664. <dd><p>Supersampling
  37665. </p>
  37666. </dd>
  37667. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  37668. </dl>
  37669. </dd>
  37670. <dt>&lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;</dt>
  37671. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  37672. keep the original aspect ratio. Possible values:
  37673. </p>
  37674. <dl compact="compact">
  37675. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  37676. <dd><p>Scale the video as specified and disable this feature.
  37677. </p>
  37678. </dd>
  37679. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  37680. <dd><p>The output video dimensions will automatically be decreased if needed.
  37681. </p>
  37682. </dd>
  37683. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  37684. <dd><p>The output video dimensions will automatically be increased if needed.
  37685. </p>
  37686. </dd>
  37687. </dl>
  37688. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  37689. maximum allowed resolution, you can use this to limit the output video to
  37690. that, while retaining the aspect ratio. For example, device A allows
  37691. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  37692. decrease) and specifying 1280x720 to the command line makes the output
  37693. 1280x533.
  37694. </p>
  37695. <p>Please note that this is a different thing than specifying -1 for &lsquo;<samp>w</samp>&rsquo;
  37696. or &lsquo;<samp>h</samp>&rsquo;, you still need to specify the output resolution for this option
  37697. to work.
  37698. </p>
  37699. </dd>
  37700. <dt>&lsquo;<samp>force_divisible_by</samp>&rsquo;</dt>
  37701. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  37702. given integer when used together with &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;. This
  37703. works similar to using <code>-n</code> in the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options.
  37704. </p>
  37705. <p>This option respects the value set for &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo;,
  37706. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  37707. may be slightly modified.
  37708. </p>
  37709. <p>This option can be handy if you need to have a video fit within or exceed
  37710. a defined resolution using &lsquo;<samp>force_original_aspect_ratio</samp>&rsquo; but also have
  37711. encoder restrictions on width or height divisibility.
  37712. </p>
  37713. </dd>
  37714. </dl>
  37715. <a name="scale2ref"></a>
  37716. <h2 class="section"><a href="ffmpeg-all.html#toc-scale2ref">39.176 scale2ref</a></h2>
  37717. <p>Scale (resize) the input video, based on a reference video.
  37718. </p>
  37719. <p>See the scale filter for available options, scale2ref supports the same but
  37720. uses the reference video instead of the main input as basis. scale2ref also
  37721. supports the following additional constants for the &lsquo;<samp>w</samp>&rsquo; and
  37722. &lsquo;<samp>h</samp>&rsquo; options:
  37723. </p>
  37724. <dl compact="compact">
  37725. <dt><var>main_w</var></dt>
  37726. <dt><var>main_h</var></dt>
  37727. <dd><p>The main input video&rsquo;s width and height
  37728. </p>
  37729. </dd>
  37730. <dt><var>main_a</var></dt>
  37731. <dd><p>The same as <var>main_w</var> / <var>main_h</var>
  37732. </p>
  37733. </dd>
  37734. <dt><var>main_sar</var></dt>
  37735. <dd><p>The main input video&rsquo;s sample aspect ratio
  37736. </p>
  37737. </dd>
  37738. <dt><var>main_dar, mdar</var></dt>
  37739. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  37740. <code>(main_w / main_h) * main_sar</code>.
  37741. </p>
  37742. </dd>
  37743. <dt><var>main_hsub</var></dt>
  37744. <dt><var>main_vsub</var></dt>
  37745. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  37746. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var>
  37747. is 1.
  37748. </p>
  37749. </dd>
  37750. <dt><var>main_n</var></dt>
  37751. <dd><p>The (sequential) number of the main input frame, starting from 0.
  37752. Only available with <code>eval=frame</code>.
  37753. </p>
  37754. </dd>
  37755. <dt><var>main_t</var></dt>
  37756. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  37757. seconds. Only available with <code>eval=frame</code>.
  37758. </p>
  37759. </dd>
  37760. <dt><var>main_pos</var></dt>
  37761. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  37762. this information is unavailable and/or meaningless (for example in case of synthetic video).
  37763. Only available with <code>eval=frame</code>.
  37764. </p></dd>
  37765. </dl>
  37766. <a name="Examples-75"></a>
  37767. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-75">39.176.1 Examples</a></h3>
  37768. <ul>
  37769. <li>
  37770. Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  37771. <div class="example">
  37772. <pre class="example">'scale2ref[b][a];[a][b]overlay'
  37773. </pre></div>
  37774. </li><li>
  37775. Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  37776. <div class="example">
  37777. <pre class="example">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  37778. </pre></div>
  37779. </li></ul>
  37780. <a name="Commands-7"></a>
  37781. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-7">39.176.2 Commands</a></h3>
  37782. <p>This filter supports the following commands:
  37783. </p><dl compact="compact">
  37784. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  37785. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  37786. <dd><p>Set the output video dimension expression.
  37787. The command accepts the same syntax of the corresponding option.
  37788. </p>
  37789. <p>If the specified expression is not valid, it is kept at its current
  37790. value.
  37791. </p></dd>
  37792. </dl>
  37793. <a name="scroll"></a>
  37794. <h2 class="section"><a href="ffmpeg-all.html#toc-scroll">39.177 scroll</a></h2>
  37795. <p>Scroll input video horizontally and/or vertically by constant speed.
  37796. </p>
  37797. <p>The filter accepts the following options:
  37798. </p><dl compact="compact">
  37799. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  37800. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  37801. Negative values changes scrolling direction.
  37802. </p>
  37803. </dd>
  37804. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  37805. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  37806. Negative values changes scrolling direction.
  37807. </p>
  37808. </dd>
  37809. <dt>&lsquo;<samp>hpos</samp>&rsquo;</dt>
  37810. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  37811. </p>
  37812. </dd>
  37813. <dt>&lsquo;<samp>vpos</samp>&rsquo;</dt>
  37814. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  37815. </p></dd>
  37816. </dl>
  37817. <a name="Commands-55"></a>
  37818. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-55">39.177.1 Commands</a></h3>
  37819. <p>This filter supports the following <a href="#commands">commands</a>:
  37820. </p><dl compact="compact">
  37821. <dt>&lsquo;<samp>horizontal, h</samp>&rsquo;</dt>
  37822. <dd><p>Set the horizontal scrolling speed.
  37823. </p></dd>
  37824. <dt>&lsquo;<samp>vertical, v</samp>&rsquo;</dt>
  37825. <dd><p>Set the vertical scrolling speed.
  37826. </p></dd>
  37827. </dl>
  37828. <p><a name="selectivecolor"></a>
  37829. </p><a name="selectivecolor-1"></a>
  37830. <h2 class="section"><a href="ffmpeg-all.html#toc-selectivecolor-1">39.178 selectivecolor</a></h2>
  37831. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  37832. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  37833. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  37834. </p>
  37835. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  37836. </p>
  37837. <p>The filter accepts the following options:
  37838. </p>
  37839. <dl compact="compact">
  37840. <dt>&lsquo;<samp>correction_method</samp>&rsquo;</dt>
  37841. <dd><p>Select color correction method.
  37842. </p>
  37843. <p>Available values are:
  37844. </p><dl compact="compact">
  37845. <dt>&lsquo;<samp>absolute</samp>&rsquo;</dt>
  37846. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  37847. component value).
  37848. </p></dd>
  37849. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  37850. <dd><p>Specified adjustments are relative to the original component value.
  37851. </p></dd>
  37852. </dl>
  37853. <p>Default is <code>absolute</code>.
  37854. </p></dd>
  37855. <dt>&lsquo;<samp>reds</samp>&rsquo;</dt>
  37856. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  37857. </p></dd>
  37858. <dt>&lsquo;<samp>yellows</samp>&rsquo;</dt>
  37859. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  37860. </p></dd>
  37861. <dt>&lsquo;<samp>greens</samp>&rsquo;</dt>
  37862. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  37863. </p></dd>
  37864. <dt>&lsquo;<samp>cyans</samp>&rsquo;</dt>
  37865. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  37866. </p></dd>
  37867. <dt>&lsquo;<samp>blues</samp>&rsquo;</dt>
  37868. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  37869. </p></dd>
  37870. <dt>&lsquo;<samp>magentas</samp>&rsquo;</dt>
  37871. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  37872. </p></dd>
  37873. <dt>&lsquo;<samp>whites</samp>&rsquo;</dt>
  37874. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  37875. </p></dd>
  37876. <dt>&lsquo;<samp>neutrals</samp>&rsquo;</dt>
  37877. <dd><p>Adjustments for all pixels except pure black and pure white
  37878. </p></dd>
  37879. <dt>&lsquo;<samp>blacks</samp>&rsquo;</dt>
  37880. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  37881. </p></dd>
  37882. <dt>&lsquo;<samp>psfile</samp>&rsquo;</dt>
  37883. <dd><p>Specify a Photoshop selective color file (<code>.asv</code>) to import the settings from.
  37884. </p></dd>
  37885. </dl>
  37886. <p>All the adjustment settings (&lsquo;<samp>reds</samp>&rsquo;, &lsquo;<samp>yellows</samp>&rsquo;, ...) accept up to
  37887. 4 space separated floating point adjustment values in the [-1,1] range,
  37888. respectively to adjust the amount of cyan, magenta, yellow and black for the
  37889. pixels of its range.
  37890. </p>
  37891. <a name="Examples-185"></a>
  37892. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-185">39.178.1 Examples</a></h3>
  37893. <ul>
  37894. <li>
  37895. Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  37896. increase magenta by 27% in blue areas:
  37897. <div class="example">
  37898. <pre class="example">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  37899. </pre></div>
  37900. </li><li>
  37901. Use a Photoshop selective color preset:
  37902. <div class="example">
  37903. <pre class="example">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  37904. </pre></div>
  37905. </li></ul>
  37906. <p><a name="separatefields"></a>
  37907. </p><a name="separatefields-1"></a>
  37908. <h2 class="section"><a href="ffmpeg-all.html#toc-separatefields-1">39.179 separatefields</a></h2>
  37909. <p>The <code>separatefields</code> takes a frame-based video input and splits
  37910. each frame into its components fields, producing a new half height clip
  37911. with twice the frame rate and twice the frame count.
  37912. </p>
  37913. <p>This filter use field-dominance information in frame to decide which
  37914. of each pair of fields to place first in the output.
  37915. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
  37916. </p>
  37917. <a name="setdar_002c-setsar"></a>
  37918. <h2 class="section"><a href="ffmpeg-all.html#toc-setdar_002c-setsar">39.180 setdar, setsar</a></h2>
  37919. <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
  37920. output video.
  37921. </p>
  37922. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  37923. Ratio, according to the following equation:
  37924. </p><div class="example">
  37925. <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
  37926. </pre></div>
  37927. <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
  37928. dimensions of the video frame. Also, the display aspect ratio set by
  37929. this filter may be changed by later filters in the filterchain,
  37930. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  37931. applied.
  37932. </p>
  37933. <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  37934. the filter output video.
  37935. </p>
  37936. <p>Note that as a consequence of the application of this filter, the
  37937. output display aspect ratio will change according to the equation
  37938. above.
  37939. </p>
  37940. <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
  37941. filter may be changed by later filters in the filterchain, e.g. if
  37942. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  37943. </p>
  37944. <p>It accepts the following parameters:
  37945. </p>
  37946. <dl compact="compact">
  37947. <dt>&lsquo;<samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp>&rsquo;</dt>
  37948. <dd><p>Set the aspect ratio used by the filter.
  37949. </p>
  37950. <p>The parameter can be a floating point number string, an expression, or
  37951. a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
  37952. <var>den</var> are the numerator and denominator of the aspect ratio. If
  37953. the parameter is not specified, it is assumed the value &quot;0&quot;.
  37954. In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
  37955. should be escaped.
  37956. </p>
  37957. </dd>
  37958. <dt>&lsquo;<samp>max</samp>&rsquo;</dt>
  37959. <dd><p>Set the maximum integer value to use for expressing numerator and
  37960. denominator when reducing the expressed aspect ratio to a rational.
  37961. Default value is <code>100</code>.
  37962. </p>
  37963. </dd>
  37964. </dl>
  37965. <p>The parameter <var>sar</var> is an expression containing
  37966. the following constants:
  37967. </p>
  37968. <dl compact="compact">
  37969. <dt>&lsquo;<samp>E, PI, PHI</samp>&rsquo;</dt>
  37970. <dd><p>These are approximated values for the mathematical constants e
  37971. (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
  37972. </p>
  37973. </dd>
  37974. <dt>&lsquo;<samp>w, h</samp>&rsquo;</dt>
  37975. <dd><p>The input width and height.
  37976. </p>
  37977. </dd>
  37978. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  37979. <dd><p>These are the same as <var>w</var> / <var>h</var>.
  37980. </p>
  37981. </dd>
  37982. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  37983. <dd><p>The input sample aspect ratio.
  37984. </p>
  37985. </dd>
  37986. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  37987. <dd><p>The input display aspect ratio. It is the same as
  37988. (<var>w</var> / <var>h</var>) * <var>sar</var>.
  37989. </p>
  37990. </dd>
  37991. <dt>&lsquo;<samp>hsub, vsub</samp>&rsquo;</dt>
  37992. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  37993. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  37994. </p></dd>
  37995. </dl>
  37996. <a name="Examples-62"></a>
  37997. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-62">39.180.1 Examples</a></h3>
  37998. <ul>
  37999. <li>
  38000. To change the display aspect ratio to 16:9, specify one of the following:
  38001. <div class="example">
  38002. <pre class="example">setdar=dar=1.77777
  38003. setdar=dar=16/9
  38004. </pre></div>
  38005. </li><li>
  38006. To change the sample aspect ratio to 10:11, specify:
  38007. <div class="example">
  38008. <pre class="example">setsar=sar=10/11
  38009. </pre></div>
  38010. </li><li>
  38011. To set a display aspect ratio of 16:9, and specify a maximum integer value of
  38012. 1000 in the aspect ratio reduction, use the command:
  38013. <div class="example">
  38014. <pre class="example">setdar=ratio=16/9:max=1000
  38015. </pre></div>
  38016. </li></ul>
  38017. <p><a name="setfield"></a>
  38018. </p><a name="setfield-1"></a>
  38019. <h2 class="section"><a href="ffmpeg-all.html#toc-setfield-1">39.181 setfield</a></h2>
  38020. <p>Force field for the output video frame.
  38021. </p>
  38022. <p>The <code>setfield</code> filter marks the interlace type field for the
  38023. output frames. It does not change the input frame, but only sets the
  38024. corresponding property, which affects how the frame is treated by
  38025. following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
  38026. </p>
  38027. <p>The filter accepts the following options:
  38028. </p>
  38029. <dl compact="compact">
  38030. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  38031. <dd><p>Available values are:
  38032. </p>
  38033. <dl compact="compact">
  38034. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38035. <dd><p>Keep the same field property.
  38036. </p>
  38037. </dd>
  38038. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  38039. <dd><p>Mark the frame as bottom-field-first.
  38040. </p>
  38041. </dd>
  38042. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  38043. <dd><p>Mark the frame as top-field-first.
  38044. </p>
  38045. </dd>
  38046. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  38047. <dd><p>Mark the frame as progressive.
  38048. </p></dd>
  38049. </dl>
  38050. </dd>
  38051. </dl>
  38052. <p><a name="setparams"></a>
  38053. </p><a name="setparams-1"></a>
  38054. <h2 class="section"><a href="ffmpeg-all.html#toc-setparams-1">39.182 setparams</a></h2>
  38055. <p>Force frame parameter for the output video frame.
  38056. </p>
  38057. <p>The <code>setparams</code> filter marks interlace and color range for the
  38058. output frames. It does not change the input frame, but only sets the
  38059. corresponding property, which affects how the frame is treated by
  38060. filters/encoders.
  38061. </p>
  38062. <dl compact="compact">
  38063. <dt>&lsquo;<samp>field_mode</samp>&rsquo;</dt>
  38064. <dd><p>Available values are:
  38065. </p>
  38066. <dl compact="compact">
  38067. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38068. <dd><p>Keep the same field property (default).
  38069. </p>
  38070. </dd>
  38071. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  38072. <dd><p>Mark the frame as bottom-field-first.
  38073. </p>
  38074. </dd>
  38075. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  38076. <dd><p>Mark the frame as top-field-first.
  38077. </p>
  38078. </dd>
  38079. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  38080. <dd><p>Mark the frame as progressive.
  38081. </p></dd>
  38082. </dl>
  38083. </dd>
  38084. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  38085. <dd><p>Available values are:
  38086. </p>
  38087. <dl compact="compact">
  38088. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38089. <dd><p>Keep the same color range property (default).
  38090. </p>
  38091. </dd>
  38092. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  38093. <dd><p>Mark the frame as unspecified color range.
  38094. </p>
  38095. </dd>
  38096. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  38097. <dd><p>Mark the frame as limited range.
  38098. </p>
  38099. </dd>
  38100. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  38101. <dd><p>Mark the frame as full range.
  38102. </p></dd>
  38103. </dl>
  38104. </dd>
  38105. <dt>&lsquo;<samp>color_primaries</samp>&rsquo;</dt>
  38106. <dd><p>Set the color primaries.
  38107. Available values are:
  38108. </p>
  38109. <dl compact="compact">
  38110. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38111. <dd><p>Keep the same color primaries property (default).
  38112. </p>
  38113. </dd>
  38114. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38115. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38116. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  38117. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38118. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38119. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38120. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  38121. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  38122. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  38123. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  38124. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  38125. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  38126. </dl>
  38127. </dd>
  38128. <dt>&lsquo;<samp>color_trc</samp>&rsquo;</dt>
  38129. <dd><p>Set the color transfer.
  38130. Available values are:
  38131. </p>
  38132. <dl compact="compact">
  38133. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38134. <dd><p>Keep the same color trc property (default).
  38135. </p>
  38136. </dd>
  38137. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38138. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38139. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  38140. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38141. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38142. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38143. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  38144. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  38145. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  38146. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  38147. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  38148. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  38149. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  38150. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  38151. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  38152. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  38153. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  38154. </dl>
  38155. </dd>
  38156. <dt>&lsquo;<samp>colorspace</samp>&rsquo;</dt>
  38157. <dd><p>Set the colorspace.
  38158. Available values are:
  38159. </p>
  38160. <dl compact="compact">
  38161. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  38162. <dd><p>Keep the same colorspace property (default).
  38163. </p>
  38164. </dd>
  38165. <dt>&lsquo;<samp>gbr</samp>&rsquo;</dt>
  38166. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  38167. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  38168. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  38169. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  38170. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  38171. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  38172. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  38173. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  38174. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  38175. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  38176. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  38177. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  38178. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  38179. </dl>
  38180. </dd>
  38181. </dl>
  38182. <a name="showinfo"></a>
  38183. <h2 class="section"><a href="ffmpeg-all.html#toc-showinfo">39.183 showinfo</a></h2>
  38184. <p>Show a line containing various information for each input video frame.
  38185. The input video is not modified.
  38186. </p>
  38187. <p>This filter supports the following options:
  38188. </p>
  38189. <dl compact="compact">
  38190. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  38191. <dd><p>Calculate checksums of each plane. By default enabled.
  38192. </p></dd>
  38193. </dl>
  38194. <p>The shown line contains a sequence of key/value pairs of the form
  38195. <var>key</var>:<var>value</var>.
  38196. </p>
  38197. <p>The following values are shown in the output:
  38198. </p>
  38199. <dl compact="compact">
  38200. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  38201. <dd><p>The (sequential) number of the input frame, starting from 0.
  38202. </p>
  38203. </dd>
  38204. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  38205. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  38206. time base units. The time base unit depends on the filter input pad.
  38207. </p>
  38208. </dd>
  38209. <dt>&lsquo;<samp>pts_time</samp>&rsquo;</dt>
  38210. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  38211. seconds.
  38212. </p>
  38213. </dd>
  38214. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  38215. <dd><p>The position of the frame in the input stream, or -1 if this information is
  38216. unavailable and/or meaningless (for example in case of synthetic video).
  38217. </p>
  38218. </dd>
  38219. <dt>&lsquo;<samp>fmt</samp>&rsquo;</dt>
  38220. <dd><p>The pixel format name.
  38221. </p>
  38222. </dd>
  38223. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  38224. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  38225. <var>num</var>/<var>den</var>.
  38226. </p>
  38227. </dd>
  38228. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  38229. <dd><p>The size of the input frame. For the syntax of this option, check the
  38230. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  38231. </p>
  38232. </dd>
  38233. <dt>&lsquo;<samp>i</samp>&rsquo;</dt>
  38234. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  38235. for bottom field first).
  38236. </p>
  38237. </dd>
  38238. <dt>&lsquo;<samp>iskey</samp>&rsquo;</dt>
  38239. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  38240. </p>
  38241. </dd>
  38242. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  38243. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  38244. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  38245. Also refer to the documentation of the <code>AVPictureType</code> enum and of
  38246. the <code>av_get_picture_type_char</code> function defined in
  38247. &lsquo;<tt>libavutil/avutil.h</tt>&rsquo;.
  38248. </p>
  38249. </dd>
  38250. <dt>&lsquo;<samp>checksum</samp>&rsquo;</dt>
  38251. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  38252. </p>
  38253. </dd>
  38254. <dt>&lsquo;<samp>plane_checksum</samp>&rsquo;</dt>
  38255. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  38256. expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
  38257. </p>
  38258. </dd>
  38259. <dt>&lsquo;<samp>mean</samp>&rsquo;</dt>
  38260. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  38261. &quot;[<var>mean0</var> <var>mean1</var> <var>mean2</var> <var>mean3</var>]&quot;.
  38262. </p>
  38263. </dd>
  38264. <dt>&lsquo;<samp>stdev</samp>&rsquo;</dt>
  38265. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  38266. in the form &quot;[<var>stdev0</var> <var>stdev1</var> <var>stdev2</var> <var>stdev3</var>]&quot;.
  38267. </p>
  38268. </dd>
  38269. </dl>
  38270. <a name="showpalette"></a>
  38271. <h2 class="section"><a href="ffmpeg-all.html#toc-showpalette">39.184 showpalette</a></h2>
  38272. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  38273. <var>pal8</var> pixel format frames.
  38274. </p>
  38275. <p>It accepts the following option:
  38276. </p>
  38277. <dl compact="compact">
  38278. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  38279. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  38280. <code>30</code> (for a <code>30x30</code> pixel box).
  38281. </p></dd>
  38282. </dl>
  38283. <a name="shuffleframes"></a>
  38284. <h2 class="section"><a href="ffmpeg-all.html#toc-shuffleframes">39.185 shuffleframes</a></h2>
  38285. <p>Reorder and/or duplicate and/or drop video frames.
  38286. </p>
  38287. <p>It accepts the following parameters:
  38288. </p>
  38289. <dl compact="compact">
  38290. <dt>&lsquo;<samp>mapping</samp>&rsquo;</dt>
  38291. <dd><p>Set the destination indexes of input frames.
  38292. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  38293. frames. Number of indexes also sets maximal value that each index may have.
  38294. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  38295. </p></dd>
  38296. </dl>
  38297. <p>The first frame has the index 0. The default is to keep the input unchanged.
  38298. </p>
  38299. <a name="Examples-80"></a>
  38300. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-80">39.185.1 Examples</a></h3>
  38301. <ul>
  38302. <li>
  38303. Swap second and third frame of every three frames of the input:
  38304. <div class="example">
  38305. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  38306. </pre></div>
  38307. </li><li>
  38308. Swap 10th and 1st frame of every ten frames of the input:
  38309. <div class="example">
  38310. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  38311. </pre></div>
  38312. </li></ul>
  38313. <a name="shuffleplanes"></a>
  38314. <h2 class="section"><a href="ffmpeg-all.html#toc-shuffleplanes">39.186 shuffleplanes</a></h2>
  38315. <p>Reorder and/or duplicate video planes.
  38316. </p>
  38317. <p>It accepts the following parameters:
  38318. </p>
  38319. <dl compact="compact">
  38320. <dt>&lsquo;<samp>map0</samp>&rsquo;</dt>
  38321. <dd><p>The index of the input plane to be used as the first output plane.
  38322. </p>
  38323. </dd>
  38324. <dt>&lsquo;<samp>map1</samp>&rsquo;</dt>
  38325. <dd><p>The index of the input plane to be used as the second output plane.
  38326. </p>
  38327. </dd>
  38328. <dt>&lsquo;<samp>map2</samp>&rsquo;</dt>
  38329. <dd><p>The index of the input plane to be used as the third output plane.
  38330. </p>
  38331. </dd>
  38332. <dt>&lsquo;<samp>map3</samp>&rsquo;</dt>
  38333. <dd><p>The index of the input plane to be used as the fourth output plane.
  38334. </p>
  38335. </dd>
  38336. </dl>
  38337. <p>The first plane has the index 0. The default is to keep the input unchanged.
  38338. </p>
  38339. <a name="Examples-176"></a>
  38340. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-176">39.186.1 Examples</a></h3>
  38341. <ul>
  38342. <li>
  38343. Swap the second and third planes of the input:
  38344. <div class="example">
  38345. <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  38346. </pre></div>
  38347. </li></ul>
  38348. <p><a name="signalstats"></a>
  38349. </p><a name="signalstats-1"></a>
  38350. <h2 class="section"><a href="ffmpeg-all.html#toc-signalstats-1">39.187 signalstats</a></h2>
  38351. <p>Evaluate various visual metrics that assist in determining issues associated
  38352. with the digitization of analog video media.
  38353. </p>
  38354. <p>By default the filter will log these metadata values:
  38355. </p>
  38356. <dl compact="compact">
  38357. <dt>&lsquo;<samp>YMIN</samp>&rsquo;</dt>
  38358. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  38359. range of [0-255].
  38360. </p>
  38361. </dd>
  38362. <dt>&lsquo;<samp>YLOW</samp>&rsquo;</dt>
  38363. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  38364. range of [0-255].
  38365. </p>
  38366. </dd>
  38367. <dt>&lsquo;<samp>YAVG</samp>&rsquo;</dt>
  38368. <dd><p>Display the average Y value within the input frame. Expressed in range of
  38369. [0-255].
  38370. </p>
  38371. </dd>
  38372. <dt>&lsquo;<samp>YHIGH</samp>&rsquo;</dt>
  38373. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  38374. range of [0-255].
  38375. </p>
  38376. </dd>
  38377. <dt>&lsquo;<samp>YMAX</samp>&rsquo;</dt>
  38378. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  38379. range of [0-255].
  38380. </p>
  38381. </dd>
  38382. <dt>&lsquo;<samp>UMIN</samp>&rsquo;</dt>
  38383. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  38384. range of [0-255].
  38385. </p>
  38386. </dd>
  38387. <dt>&lsquo;<samp>ULOW</samp>&rsquo;</dt>
  38388. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  38389. range of [0-255].
  38390. </p>
  38391. </dd>
  38392. <dt>&lsquo;<samp>UAVG</samp>&rsquo;</dt>
  38393. <dd><p>Display the average U value within the input frame. Expressed in range of
  38394. [0-255].
  38395. </p>
  38396. </dd>
  38397. <dt>&lsquo;<samp>UHIGH</samp>&rsquo;</dt>
  38398. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  38399. range of [0-255].
  38400. </p>
  38401. </dd>
  38402. <dt>&lsquo;<samp>UMAX</samp>&rsquo;</dt>
  38403. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  38404. range of [0-255].
  38405. </p>
  38406. </dd>
  38407. <dt>&lsquo;<samp>VMIN</samp>&rsquo;</dt>
  38408. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  38409. range of [0-255].
  38410. </p>
  38411. </dd>
  38412. <dt>&lsquo;<samp>VLOW</samp>&rsquo;</dt>
  38413. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  38414. range of [0-255].
  38415. </p>
  38416. </dd>
  38417. <dt>&lsquo;<samp>VAVG</samp>&rsquo;</dt>
  38418. <dd><p>Display the average V value within the input frame. Expressed in range of
  38419. [0-255].
  38420. </p>
  38421. </dd>
  38422. <dt>&lsquo;<samp>VHIGH</samp>&rsquo;</dt>
  38423. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  38424. range of [0-255].
  38425. </p>
  38426. </dd>
  38427. <dt>&lsquo;<samp>VMAX</samp>&rsquo;</dt>
  38428. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  38429. range of [0-255].
  38430. </p>
  38431. </dd>
  38432. <dt>&lsquo;<samp>SATMIN</samp>&rsquo;</dt>
  38433. <dd><p>Display the minimal saturation value contained within the input frame.
  38434. Expressed in range of [0-~181.02].
  38435. </p>
  38436. </dd>
  38437. <dt>&lsquo;<samp>SATLOW</samp>&rsquo;</dt>
  38438. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  38439. Expressed in range of [0-~181.02].
  38440. </p>
  38441. </dd>
  38442. <dt>&lsquo;<samp>SATAVG</samp>&rsquo;</dt>
  38443. <dd><p>Display the average saturation value within the input frame. Expressed in range
  38444. of [0-~181.02].
  38445. </p>
  38446. </dd>
  38447. <dt>&lsquo;<samp>SATHIGH</samp>&rsquo;</dt>
  38448. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  38449. Expressed in range of [0-~181.02].
  38450. </p>
  38451. </dd>
  38452. <dt>&lsquo;<samp>SATMAX</samp>&rsquo;</dt>
  38453. <dd><p>Display the maximum saturation value contained within the input frame.
  38454. Expressed in range of [0-~181.02].
  38455. </p>
  38456. </dd>
  38457. <dt>&lsquo;<samp>HUEMED</samp>&rsquo;</dt>
  38458. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  38459. [0-360].
  38460. </p>
  38461. </dd>
  38462. <dt>&lsquo;<samp>HUEAVG</samp>&rsquo;</dt>
  38463. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  38464. [0-360].
  38465. </p>
  38466. </dd>
  38467. <dt>&lsquo;<samp>YDIF</samp>&rsquo;</dt>
  38468. <dd><p>Display the average of sample value difference between all values of the Y
  38469. plane in the current frame and corresponding values of the previous input frame.
  38470. Expressed in range of [0-255].
  38471. </p>
  38472. </dd>
  38473. <dt>&lsquo;<samp>UDIF</samp>&rsquo;</dt>
  38474. <dd><p>Display the average of sample value difference between all values of the U
  38475. plane in the current frame and corresponding values of the previous input frame.
  38476. Expressed in range of [0-255].
  38477. </p>
  38478. </dd>
  38479. <dt>&lsquo;<samp>VDIF</samp>&rsquo;</dt>
  38480. <dd><p>Display the average of sample value difference between all values of the V
  38481. plane in the current frame and corresponding values of the previous input frame.
  38482. Expressed in range of [0-255].
  38483. </p>
  38484. </dd>
  38485. <dt>&lsquo;<samp>YBITDEPTH</samp>&rsquo;</dt>
  38486. <dd><p>Display bit depth of Y plane in current frame.
  38487. Expressed in range of [0-16].
  38488. </p>
  38489. </dd>
  38490. <dt>&lsquo;<samp>UBITDEPTH</samp>&rsquo;</dt>
  38491. <dd><p>Display bit depth of U plane in current frame.
  38492. Expressed in range of [0-16].
  38493. </p>
  38494. </dd>
  38495. <dt>&lsquo;<samp>VBITDEPTH</samp>&rsquo;</dt>
  38496. <dd><p>Display bit depth of V plane in current frame.
  38497. Expressed in range of [0-16].
  38498. </p></dd>
  38499. </dl>
  38500. <p>The filter accepts the following options:
  38501. </p>
  38502. <dl compact="compact">
  38503. <dt>&lsquo;<samp>stat</samp>&rsquo;</dt>
  38504. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  38505. <dd>
  38506. <p>&lsquo;<samp>stat</samp>&rsquo; specify an additional form of image analysis.
  38507. &lsquo;<samp>out</samp>&rsquo; output video with the specified type of pixel highlighted.
  38508. </p>
  38509. <p>Both options accept the following values:
  38510. </p>
  38511. <dl compact="compact">
  38512. <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
  38513. <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
  38514. unlike the neighboring pixels of the same field. Examples of temporal outliers
  38515. include the results of video dropouts, head clogs, or tape tracking issues.
  38516. </p>
  38517. </dd>
  38518. <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
  38519. <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
  38520. similar rows of pixels within a frame. In born-digital video vertical line
  38521. repetition is common, but this pattern is uncommon in video digitized from an
  38522. analog source. When it occurs in video that results from the digitization of an
  38523. analog source it can indicate concealment from a dropout compensator.
  38524. </p>
  38525. </dd>
  38526. <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
  38527. <dd><p>Identify pixels that fall outside of legal broadcast range.
  38528. </p></dd>
  38529. </dl>
  38530. </dd>
  38531. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  38532. <dd><p>Set the highlight color for the &lsquo;<samp>out</samp>&rsquo; option. The default color is
  38533. yellow.
  38534. </p></dd>
  38535. </dl>
  38536. <a name="Examples-82"></a>
  38537. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-82">39.187.1 Examples</a></h3>
  38538. <ul>
  38539. <li>
  38540. Output data of various video metrics:
  38541. <div class="example">
  38542. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  38543. </pre></div>
  38544. </li><li>
  38545. Output specific data about the minimum and maximum values of the Y plane per frame:
  38546. <div class="example">
  38547. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  38548. </pre></div>
  38549. </li><li>
  38550. Playback video while highlighting pixels that are outside of broadcast range in red.
  38551. <div class="example">
  38552. <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  38553. </pre></div>
  38554. </li><li>
  38555. Playback video with signalstats metadata drawn over the frame.
  38556. <div class="example">
  38557. <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  38558. </pre></div>
  38559. <p>The contents of signalstat_drawtext.txt used in the command are:
  38560. </p><div class="example">
  38561. <pre class="example">time %{pts:hms}
  38562. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  38563. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  38564. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  38565. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  38566. </pre></div>
  38567. </li></ul>
  38568. <p><a name="signature"></a>
  38569. </p><a name="signature-1"></a>
  38570. <h2 class="section"><a href="ffmpeg-all.html#toc-signature-1">39.188 signature</a></h2>
  38571. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  38572. input. In this case the matching between the inputs can be calculated additionally.
  38573. The filter always passes through the first input. The signature of each stream can
  38574. be written into a file.
  38575. </p>
  38576. <p>It accepts the following options:
  38577. </p>
  38578. <dl compact="compact">
  38579. <dt>&lsquo;<samp>detectmode</samp>&rsquo;</dt>
  38580. <dd><p>Enable or disable the matching process.
  38581. </p>
  38582. <p>Available values are:
  38583. </p>
  38584. <dl compact="compact">
  38585. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  38586. <dd><p>Disable the calculation of a matching (default).
  38587. </p></dd>
  38588. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  38589. <dd><p>Calculate the matching for the whole video and output whether the whole video
  38590. matches or only parts.
  38591. </p></dd>
  38592. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  38593. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  38594. some cases.
  38595. </p></dd>
  38596. </dl>
  38597. </dd>
  38598. <dt>&lsquo;<samp>nb_inputs</samp>&rsquo;</dt>
  38599. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  38600. Default value is 1.
  38601. </p>
  38602. </dd>
  38603. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  38604. <dd><p>Set the path to which the output is written. If there is more than one input,
  38605. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  38606. integer), that will be replaced with the input number. If no filename is
  38607. specified, no output will be written. This is the default.
  38608. </p>
  38609. </dd>
  38610. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  38611. <dd><p>Choose the output format.
  38612. </p>
  38613. <p>Available values are:
  38614. </p>
  38615. <dl compact="compact">
  38616. <dt>&lsquo;<samp>binary</samp>&rsquo;</dt>
  38617. <dd><p>Use the specified binary representation (default).
  38618. </p></dd>
  38619. <dt>&lsquo;<samp>xml</samp>&rsquo;</dt>
  38620. <dd><p>Use the specified xml representation.
  38621. </p></dd>
  38622. </dl>
  38623. </dd>
  38624. <dt>&lsquo;<samp>th_d</samp>&rsquo;</dt>
  38625. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  38626. greater than zero. The default value is 9000.
  38627. </p>
  38628. </dd>
  38629. <dt>&lsquo;<samp>th_dc</samp>&rsquo;</dt>
  38630. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  38631. greater than zero. The default value is 60000.
  38632. </p>
  38633. </dd>
  38634. <dt>&lsquo;<samp>th_xh</samp>&rsquo;</dt>
  38635. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  38636. greater than zero. The default value is 116.
  38637. </p>
  38638. </dd>
  38639. <dt>&lsquo;<samp>th_di</samp>&rsquo;</dt>
  38640. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  38641. sequence. The option value must be a non negative integer value.
  38642. The default value is 0.
  38643. </p>
  38644. </dd>
  38645. <dt>&lsquo;<samp>th_it</samp>&rsquo;</dt>
  38646. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  38647. The option value must be a double value between 0 and 1. The default value is 0.5.
  38648. </p></dd>
  38649. </dl>
  38650. <a name="Examples-51"></a>
  38651. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-51">39.188.1 Examples</a></h3>
  38652. <ul>
  38653. <li>
  38654. To calculate the signature of an input video and store it in signature.bin:
  38655. <div class="example">
  38656. <pre class="example">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  38657. </pre></div>
  38658. </li><li>
  38659. To detect whether two videos match and store the signatures in XML format in
  38660. signature0.xml and signature1.xml:
  38661. <div class="example">
  38662. <pre class="example">ffmpeg -i input1.mkv -i input2.mkv -filter_complex &quot;[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml&quot; -map :v -f null -
  38663. </pre></div>
  38664. </li></ul>
  38665. <p><a name="smartblur"></a>
  38666. </p><a name="smartblur-1"></a>
  38667. <h2 class="section"><a href="ffmpeg-all.html#toc-smartblur-1">39.189 smartblur</a></h2>
  38668. <p>Blur the input video without impacting the outlines.
  38669. </p>
  38670. <p>It accepts the following options:
  38671. </p>
  38672. <dl compact="compact">
  38673. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  38674. <dd><p>Set the luma radius. The option value must be a float number in
  38675. the range [0.1,5.0] that specifies the variance of the gaussian filter
  38676. used to blur the image (slower if larger). Default value is 1.0.
  38677. </p>
  38678. </dd>
  38679. <dt>&lsquo;<samp>luma_strength, ls</samp>&rsquo;</dt>
  38680. <dd><p>Set the luma strength. The option value must be a float number
  38681. in the range [-1.0,1.0] that configures the blurring. A value included
  38682. in [0.0,1.0] will blur the image whereas a value included in
  38683. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  38684. </p>
  38685. </dd>
  38686. <dt>&lsquo;<samp>luma_threshold, lt</samp>&rsquo;</dt>
  38687. <dd><p>Set the luma threshold used as a coefficient to determine
  38688. whether a pixel should be blurred or not. The option value must be an
  38689. integer in the range [-30,30]. A value of 0 will filter all the image,
  38690. a value included in [0,30] will filter flat areas and a value included
  38691. in [-30,0] will filter edges. Default value is 0.
  38692. </p>
  38693. </dd>
  38694. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  38695. <dd><p>Set the chroma radius. The option value must be a float number in
  38696. the range [0.1,5.0] that specifies the variance of the gaussian filter
  38697. used to blur the image (slower if larger). Default value is &lsquo;<samp>luma_radius</samp>&rsquo;.
  38698. </p>
  38699. </dd>
  38700. <dt>&lsquo;<samp>chroma_strength, cs</samp>&rsquo;</dt>
  38701. <dd><p>Set the chroma strength. The option value must be a float number
  38702. in the range [-1.0,1.0] that configures the blurring. A value included
  38703. in [0.0,1.0] will blur the image whereas a value included in
  38704. [-1.0,0.0] will sharpen the image. Default value is &lsquo;<samp>luma_strength</samp>&rsquo;.
  38705. </p>
  38706. </dd>
  38707. <dt>&lsquo;<samp>chroma_threshold, ct</samp>&rsquo;</dt>
  38708. <dd><p>Set the chroma threshold used as a coefficient to determine
  38709. whether a pixel should be blurred or not. The option value must be an
  38710. integer in the range [-30,30]. A value of 0 will filter all the image,
  38711. a value included in [0,30] will filter flat areas and a value included
  38712. in [-30,0] will filter edges. Default value is &lsquo;<samp>luma_threshold</samp>&rsquo;.
  38713. </p></dd>
  38714. </dl>
  38715. <p>If a chroma option is not explicitly set, the corresponding luma value
  38716. is set.
  38717. </p>
  38718. <a name="sobel"></a>
  38719. <h2 class="section"><a href="ffmpeg-all.html#toc-sobel">39.190 sobel</a></h2>
  38720. <p>Apply sobel operator to input video stream.
  38721. </p>
  38722. <p>The filter accepts the following option:
  38723. </p>
  38724. <dl compact="compact">
  38725. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  38726. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  38727. By default value 0xf, all planes will be processed.
  38728. </p>
  38729. </dd>
  38730. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  38731. <dd><p>Set value which will be multiplied with filtered result.
  38732. </p>
  38733. </dd>
  38734. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  38735. <dd><p>Set value which will be added to filtered result.
  38736. </p></dd>
  38737. </dl>
  38738. <p><a name="spp"></a>
  38739. </p><a name="spp-1"></a>
  38740. <h2 class="section"><a href="ffmpeg-all.html#toc-spp-1">39.191 spp</a></h2>
  38741. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  38742. at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>6</code> - all) shifts
  38743. and average the results.
  38744. </p>
  38745. <p>The filter accepts the following options:
  38746. </p>
  38747. <dl compact="compact">
  38748. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  38749. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  38750. an integer in the range 0-6. If set to <code>0</code>, the filter will have no
  38751. effect. A value of <code>6</code> means the higher quality. For each increment of
  38752. that value the speed drops by a factor of approximately 2. Default value is
  38753. <code>3</code>.
  38754. </p>
  38755. </dd>
  38756. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  38757. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  38758. from the video stream (if available).
  38759. </p>
  38760. </dd>
  38761. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  38762. <dd><p>Set thresholding mode. Available modes are:
  38763. </p>
  38764. <dl compact="compact">
  38765. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  38766. <dd><p>Set hard thresholding (default).
  38767. </p></dd>
  38768. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  38769. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  38770. </p></dd>
  38771. </dl>
  38772. </dd>
  38773. <dt>&lsquo;<samp>use_bframe_qp</samp>&rsquo;</dt>
  38774. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  38775. option may cause flicker since the B-Frames have often larger QP. Default is
  38776. <code>0</code> (not enabled).
  38777. </p></dd>
  38778. </dl>
  38779. <a name="Commands-13"></a>
  38780. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-13">39.191.1 Commands</a></h3>
  38781. <p>This filter supports the following commands:
  38782. </p><dl compact="compact">
  38783. <dt>&lsquo;<samp>quality, level</samp>&rsquo;</dt>
  38784. <dd><p>Set quality level. The value <code>max</code> can be used to set the maximum level,
  38785. currently <code>6</code>.
  38786. </p></dd>
  38787. </dl>
  38788. <a name="sr"></a>
  38789. <h2 class="section"><a href="ffmpeg-all.html#toc-sr">39.192 sr</a></h2>
  38790. <p>Scale the input by applying one of the super-resolution methods based on
  38791. convolutional neural networks. Supported models:
  38792. </p>
  38793. <ul>
  38794. <li>
  38795. Super-Resolution Convolutional Neural Network model (SRCNN).
  38796. See <a href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  38797. </li><li>
  38798. Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  38799. See <a href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  38800. </li></ul>
  38801. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  38802. <a href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  38803. is at <a href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  38804. </p>
  38805. <p>Native model files (.model) can be generated from TensorFlow model
  38806. files (.pb) by using tools/python/convert.py
  38807. </p>
  38808. <p>The filter accepts the following options:
  38809. </p>
  38810. <dl compact="compact">
  38811. <dt>&lsquo;<samp>dnn_backend</samp>&rsquo;</dt>
  38812. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  38813. the following values:
  38814. </p>
  38815. <dl compact="compact">
  38816. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  38817. <dd><p>Native implementation of DNN loading and execution.
  38818. </p>
  38819. </dd>
  38820. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  38821. <dd><p>TensorFlow backend. To enable this backend you
  38822. need to install the TensorFlow for C library (see
  38823. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  38824. <code>--enable-libtensorflow</code>
  38825. </p></dd>
  38826. </dl>
  38827. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  38828. </p>
  38829. </dd>
  38830. <dt>&lsquo;<samp>model</samp>&rsquo;</dt>
  38831. <dd><p>Set path to model file specifying network architecture and its parameters.
  38832. Note that different backends use different file formats. TensorFlow backend
  38833. can load files for both formats, while native backend can load files for only
  38834. its format.
  38835. </p>
  38836. </dd>
  38837. <dt>&lsquo;<samp>scale_factor</samp>&rsquo;</dt>
  38838. <dd><p>Set scale factor for SRCNN model. Allowed values are <code>2</code>, <code>3</code> and <code>4</code>.
  38839. Default value is <code>2</code>. Scale factor is necessary for SRCNN model, because it accepts
  38840. input upscaled using bicubic upscaling with proper scale factor.
  38841. </p></dd>
  38842. </dl>
  38843. <a name="ssim"></a>
  38844. <h2 class="section"><a href="ffmpeg-all.html#toc-ssim">39.193 ssim</a></h2>
  38845. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  38846. </p>
  38847. <p>This filter takes in input two input videos, the first input is
  38848. considered the &quot;main&quot; source and is passed unchanged to the
  38849. output. The second input is used as a &quot;reference&quot; video for computing
  38850. the SSIM.
  38851. </p>
  38852. <p>Both video inputs must have the same resolution and pixel format for
  38853. this filter to work correctly. Also it assumes that both inputs
  38854. have the same number of frames, which are compared one by one.
  38855. </p>
  38856. <p>The filter stores the calculated SSIM of each frame.
  38857. </p>
  38858. <p>The description of the accepted parameters follows.
  38859. </p>
  38860. <dl compact="compact">
  38861. <dt>&lsquo;<samp>stats_file, f</samp>&rsquo;</dt>
  38862. <dd><p>If specified the filter will use the named file to save the SSIM of
  38863. each individual frame. When filename equals &quot;-&quot; the data is sent to
  38864. standard output.
  38865. </p></dd>
  38866. </dl>
  38867. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  38868. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  38869. couple of frames.
  38870. </p>
  38871. <p>A description of each shown parameter follows:
  38872. </p>
  38873. <dl compact="compact">
  38874. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  38875. <dd><p>sequential number of the input frame, starting from 1
  38876. </p>
  38877. </dd>
  38878. <dt>&lsquo;<samp>Y, U, V, R, G, B</samp>&rsquo;</dt>
  38879. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  38880. </p>
  38881. </dd>
  38882. <dt>&lsquo;<samp>All</samp>&rsquo;</dt>
  38883. <dd><p>SSIM of the compared frames for the whole frame.
  38884. </p>
  38885. </dd>
  38886. <dt>&lsquo;<samp>dB</samp>&rsquo;</dt>
  38887. <dd><p>Same as above but in dB representation.
  38888. </p></dd>
  38889. </dl>
  38890. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  38891. </p>
  38892. <a name="Examples-114"></a>
  38893. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-114">39.193.1 Examples</a></h3>
  38894. <ul>
  38895. <li>
  38896. For example:
  38897. <div class="example">
  38898. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  38899. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  38900. </pre></div>
  38901. <p>On this example the input file being processed is compared with the
  38902. reference file &lsquo;<tt>ref_movie.mpg</tt>&rsquo;. The SSIM of each individual frame
  38903. is stored in &lsquo;<tt>stats.log</tt>&rsquo;.
  38904. </p>
  38905. </li><li>
  38906. Another example with both psnr and ssim at same time:
  38907. <div class="example">
  38908. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  38909. </pre></div>
  38910. </li><li>
  38911. Another example with different containers:
  38912. <div class="example">
  38913. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim&quot; -f null -
  38914. </pre></div>
  38915. </li></ul>
  38916. <a name="stereo3d"></a>
  38917. <h2 class="section"><a href="ffmpeg-all.html#toc-stereo3d">39.194 stereo3d</a></h2>
  38918. <p>Convert between different stereoscopic image formats.
  38919. </p>
  38920. <p>The filters accept the following options:
  38921. </p>
  38922. <dl compact="compact">
  38923. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  38924. <dd><p>Set stereoscopic image format of input.
  38925. </p>
  38926. <p>Available values for input image formats are:
  38927. </p><dl compact="compact">
  38928. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  38929. <dd><p>side by side parallel (left eye left, right eye right)
  38930. </p>
  38931. </dd>
  38932. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  38933. <dd><p>side by side crosseye (right eye left, left eye right)
  38934. </p>
  38935. </dd>
  38936. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  38937. <dd><p>side by side parallel with half width resolution
  38938. (left eye left, right eye right)
  38939. </p>
  38940. </dd>
  38941. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  38942. <dd><p>side by side crosseye with half width resolution
  38943. (right eye left, left eye right)
  38944. </p>
  38945. </dd>
  38946. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  38947. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  38948. <dd><p>above-below (left eye above, right eye below)
  38949. </p>
  38950. </dd>
  38951. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  38952. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  38953. <dd><p>above-below (right eye above, left eye below)
  38954. </p>
  38955. </dd>
  38956. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  38957. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  38958. <dd><p>above-below with half height resolution
  38959. (left eye above, right eye below)
  38960. </p>
  38961. </dd>
  38962. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  38963. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  38964. <dd><p>above-below with half height resolution
  38965. (right eye above, left eye below)
  38966. </p>
  38967. </dd>
  38968. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  38969. <dd><p>alternating frames (left eye first, right eye second)
  38970. </p>
  38971. </dd>
  38972. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  38973. <dd><p>alternating frames (right eye first, left eye second)
  38974. </p>
  38975. </dd>
  38976. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  38977. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  38978. </p>
  38979. </dd>
  38980. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  38981. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  38982. </p>
  38983. </dd>
  38984. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  38985. <dd><p>interleaved columns, left eye first
  38986. </p>
  38987. </dd>
  38988. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  38989. <dd><p>interleaved columns, right eye first
  38990. </p>
  38991. <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
  38992. </p></dd>
  38993. </dl>
  38994. </dd>
  38995. <dt>&lsquo;<samp>out</samp>&rsquo;</dt>
  38996. <dd><p>Set stereoscopic image format of output.
  38997. </p>
  38998. <dl compact="compact">
  38999. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  39000. <dd><p>side by side parallel (left eye left, right eye right)
  39001. </p>
  39002. </dd>
  39003. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  39004. <dd><p>side by side crosseye (right eye left, left eye right)
  39005. </p>
  39006. </dd>
  39007. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  39008. <dd><p>side by side parallel with half width resolution
  39009. (left eye left, right eye right)
  39010. </p>
  39011. </dd>
  39012. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  39013. <dd><p>side by side crosseye with half width resolution
  39014. (right eye left, left eye right)
  39015. </p>
  39016. </dd>
  39017. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  39018. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  39019. <dd><p>above-below (left eye above, right eye below)
  39020. </p>
  39021. </dd>
  39022. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  39023. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  39024. <dd><p>above-below (right eye above, left eye below)
  39025. </p>
  39026. </dd>
  39027. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  39028. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  39029. <dd><p>above-below with half height resolution
  39030. (left eye above, right eye below)
  39031. </p>
  39032. </dd>
  39033. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  39034. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  39035. <dd><p>above-below with half height resolution
  39036. (right eye above, left eye below)
  39037. </p>
  39038. </dd>
  39039. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  39040. <dd><p>alternating frames (left eye first, right eye second)
  39041. </p>
  39042. </dd>
  39043. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  39044. <dd><p>alternating frames (right eye first, left eye second)
  39045. </p>
  39046. </dd>
  39047. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  39048. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  39049. </p>
  39050. </dd>
  39051. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  39052. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  39053. </p>
  39054. </dd>
  39055. <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
  39056. <dd><p>anaglyph red/blue gray
  39057. (red filter on left eye, blue filter on right eye)
  39058. </p>
  39059. </dd>
  39060. <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
  39061. <dd><p>anaglyph red/green gray
  39062. (red filter on left eye, green filter on right eye)
  39063. </p>
  39064. </dd>
  39065. <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
  39066. <dd><p>anaglyph red/cyan gray
  39067. (red filter on left eye, cyan filter on right eye)
  39068. </p>
  39069. </dd>
  39070. <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
  39071. <dd><p>anaglyph red/cyan half colored
  39072. (red filter on left eye, cyan filter on right eye)
  39073. </p>
  39074. </dd>
  39075. <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
  39076. <dd><p>anaglyph red/cyan color
  39077. (red filter on left eye, cyan filter on right eye)
  39078. </p>
  39079. </dd>
  39080. <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
  39081. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  39082. (red filter on left eye, cyan filter on right eye)
  39083. </p>
  39084. </dd>
  39085. <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
  39086. <dd><p>anaglyph green/magenta gray
  39087. (green filter on left eye, magenta filter on right eye)
  39088. </p>
  39089. </dd>
  39090. <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
  39091. <dd><p>anaglyph green/magenta half colored
  39092. (green filter on left eye, magenta filter on right eye)
  39093. </p>
  39094. </dd>
  39095. <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
  39096. <dd><p>anaglyph green/magenta colored
  39097. (green filter on left eye, magenta filter on right eye)
  39098. </p>
  39099. </dd>
  39100. <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
  39101. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  39102. (green filter on left eye, magenta filter on right eye)
  39103. </p>
  39104. </dd>
  39105. <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
  39106. <dd><p>anaglyph yellow/blue gray
  39107. (yellow filter on left eye, blue filter on right eye)
  39108. </p>
  39109. </dd>
  39110. <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
  39111. <dd><p>anaglyph yellow/blue half colored
  39112. (yellow filter on left eye, blue filter on right eye)
  39113. </p>
  39114. </dd>
  39115. <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
  39116. <dd><p>anaglyph yellow/blue colored
  39117. (yellow filter on left eye, blue filter on right eye)
  39118. </p>
  39119. </dd>
  39120. <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
  39121. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  39122. (yellow filter on left eye, blue filter on right eye)
  39123. </p>
  39124. </dd>
  39125. <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
  39126. <dd><p>mono output (left eye only)
  39127. </p>
  39128. </dd>
  39129. <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
  39130. <dd><p>mono output (right eye only)
  39131. </p>
  39132. </dd>
  39133. <dt>&lsquo;<samp>chl</samp>&rsquo;</dt>
  39134. <dd><p>checkerboard, left eye first
  39135. </p>
  39136. </dd>
  39137. <dt>&lsquo;<samp>chr</samp>&rsquo;</dt>
  39138. <dd><p>checkerboard, right eye first
  39139. </p>
  39140. </dd>
  39141. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  39142. <dd><p>interleaved columns, left eye first
  39143. </p>
  39144. </dd>
  39145. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  39146. <dd><p>interleaved columns, right eye first
  39147. </p>
  39148. </dd>
  39149. <dt>&lsquo;<samp>hdmi</samp>&rsquo;</dt>
  39150. <dd><p>HDMI frame pack
  39151. </p></dd>
  39152. </dl>
  39153. <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
  39154. </p></dd>
  39155. </dl>
  39156. <a name="Examples-117"></a>
  39157. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-117">39.194.1 Examples</a></h3>
  39158. <ul>
  39159. <li>
  39160. Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  39161. <div class="example">
  39162. <pre class="example">stereo3d=sbsl:aybd
  39163. </pre></div>
  39164. </li><li>
  39165. Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  39166. <div class="example">
  39167. <pre class="example">stereo3d=abl:sbsr
  39168. </pre></div>
  39169. </li></ul>
  39170. <a name="streamselect_002c-astreamselect"></a>
  39171. <h2 class="section"><a href="ffmpeg-all.html#toc-streamselect_002c-astreamselect">39.195 streamselect, astreamselect</a></h2>
  39172. <p>Select video or audio streams.
  39173. </p>
  39174. <p>The filter accepts the following options:
  39175. </p>
  39176. <dl compact="compact">
  39177. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  39178. <dd><p>Set number of inputs. Default is 2.
  39179. </p>
  39180. </dd>
  39181. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  39182. <dd><p>Set input indexes to remap to outputs.
  39183. </p></dd>
  39184. </dl>
  39185. <a name="Commands-25"></a>
  39186. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-25">39.195.1 Commands</a></h3>
  39187. <p>The <code>streamselect</code> and <code>astreamselect</code> filter supports the following
  39188. commands:
  39189. </p>
  39190. <dl compact="compact">
  39191. <dt>&lsquo;<samp>map</samp>&rsquo;</dt>
  39192. <dd><p>Set input indexes to remap to outputs.
  39193. </p></dd>
  39194. </dl>
  39195. <a name="Examples-84"></a>
  39196. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-84">39.195.2 Examples</a></h3>
  39197. <ul>
  39198. <li>
  39199. Select first 5 seconds 1st stream and rest of time 2nd stream:
  39200. <div class="example">
  39201. <pre class="example">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  39202. </pre></div>
  39203. </li><li>
  39204. Same as above, but for audio:
  39205. <div class="example">
  39206. <pre class="example">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  39207. </pre></div>
  39208. </li></ul>
  39209. <p><a name="subtitles"></a>
  39210. </p><a name="subtitles-1"></a>
  39211. <h2 class="section"><a href="ffmpeg-all.html#toc-subtitles-1">39.196 subtitles</a></h2>
  39212. <p>Draw subtitles on top of input video using the libass library.
  39213. </p>
  39214. <p>To enable compilation of this filter you need to configure FFmpeg with
  39215. <code>--enable-libass</code>. This filter also requires a build with libavcodec and
  39216. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  39217. Alpha) subtitles format.
  39218. </p>
  39219. <p>The filter accepts the following options:
  39220. </p>
  39221. <dl compact="compact">
  39222. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  39223. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  39224. </p>
  39225. </dd>
  39226. <dt>&lsquo;<samp>original_size</samp>&rsquo;</dt>
  39227. <dd><p>Specify the size of the original video, the video for which the ASS file
  39228. was composed. For the syntax of this option, check the
  39229. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39230. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  39231. correctly scale the fonts if the aspect ratio has been changed.
  39232. </p>
  39233. </dd>
  39234. <dt>&lsquo;<samp>fontsdir</samp>&rsquo;</dt>
  39235. <dd><p>Set a directory path containing fonts that can be used by the filter.
  39236. These fonts will be used in addition to whatever the font provider uses.
  39237. </p>
  39238. </dd>
  39239. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  39240. <dd><p>Process alpha channel, by default alpha channel is untouched.
  39241. </p>
  39242. </dd>
  39243. <dt>&lsquo;<samp>charenc</samp>&rsquo;</dt>
  39244. <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
  39245. useful if not UTF-8.
  39246. </p>
  39247. </dd>
  39248. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  39249. <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
  39250. </p>
  39251. </dd>
  39252. <dt>&lsquo;<samp>force_style</samp>&rsquo;</dt>
  39253. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  39254. string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
  39255. </p></dd>
  39256. </dl>
  39257. <p>If the first key is not specified, it is assumed that the first value
  39258. specifies the &lsquo;<samp>filename</samp>&rsquo;.
  39259. </p>
  39260. <p>For example, to render the file &lsquo;<tt>sub.srt</tt>&rsquo; on top of the input
  39261. video, use the command:
  39262. </p><div class="example">
  39263. <pre class="example">subtitles=sub.srt
  39264. </pre></div>
  39265. <p>which is equivalent to:
  39266. </p><div class="example">
  39267. <pre class="example">subtitles=filename=sub.srt
  39268. </pre></div>
  39269. <p>To render the default subtitles stream from file &lsquo;<tt>video.mkv</tt>&rsquo;, use:
  39270. </p><div class="example">
  39271. <pre class="example">subtitles=video.mkv
  39272. </pre></div>
  39273. <p>To render the second subtitles stream from that file, use:
  39274. </p><div class="example">
  39275. <pre class="example">subtitles=video.mkv:si=1
  39276. </pre></div>
  39277. <p>To make the subtitles stream from &lsquo;<tt>sub.srt</tt>&rsquo; appear in 80% transparent blue
  39278. <code>DejaVu Serif</code>, use:
  39279. </p><div class="example">
  39280. <pre class="example">subtitles=sub.srt:force_style='FontName=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  39281. </pre></div>
  39282. <a name="super2xsai"></a>
  39283. <h2 class="section"><a href="ffmpeg-all.html#toc-super2xsai">39.197 super2xsai</a></h2>
  39284. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  39285. Interpolate) pixel art scaling algorithm.
  39286. </p>
  39287. <p>Useful for enlarging pixel art images without reducing sharpness.
  39288. </p>
  39289. <a name="swaprect"></a>
  39290. <h2 class="section"><a href="ffmpeg-all.html#toc-swaprect">39.198 swaprect</a></h2>
  39291. <p>Swap two rectangular objects in video.
  39292. </p>
  39293. <p>This filter accepts the following options:
  39294. </p>
  39295. <dl compact="compact">
  39296. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  39297. <dd><p>Set object width.
  39298. </p>
  39299. </dd>
  39300. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  39301. <dd><p>Set object height.
  39302. </p>
  39303. </dd>
  39304. <dt>&lsquo;<samp>x1</samp>&rsquo;</dt>
  39305. <dd><p>Set 1st rect x coordinate.
  39306. </p>
  39307. </dd>
  39308. <dt>&lsquo;<samp>y1</samp>&rsquo;</dt>
  39309. <dd><p>Set 1st rect y coordinate.
  39310. </p>
  39311. </dd>
  39312. <dt>&lsquo;<samp>x2</samp>&rsquo;</dt>
  39313. <dd><p>Set 2nd rect x coordinate.
  39314. </p>
  39315. </dd>
  39316. <dt>&lsquo;<samp>y2</samp>&rsquo;</dt>
  39317. <dd><p>Set 2nd rect y coordinate.
  39318. </p>
  39319. <p>All expressions are evaluated once for each frame.
  39320. </p></dd>
  39321. </dl>
  39322. <p>The all options are expressions containing the following constants:
  39323. </p>
  39324. <dl compact="compact">
  39325. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  39326. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  39327. <dd><p>The input width and height.
  39328. </p>
  39329. </dd>
  39330. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  39331. <dd><p>same as <var>w</var> / <var>h</var>
  39332. </p>
  39333. </dd>
  39334. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  39335. <dd><p>input sample aspect ratio
  39336. </p>
  39337. </dd>
  39338. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  39339. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  39340. </p>
  39341. </dd>
  39342. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  39343. <dd><p>The number of the input frame, starting from 0.
  39344. </p>
  39345. </dd>
  39346. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  39347. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  39348. </p>
  39349. </dd>
  39350. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  39351. <dd><p>the position in the file of the input frame, NAN if unknown
  39352. </p></dd>
  39353. </dl>
  39354. <a name="swapuv"></a>
  39355. <h2 class="section"><a href="ffmpeg-all.html#toc-swapuv">39.199 swapuv</a></h2>
  39356. <p>Swap U &amp; V plane.
  39357. </p>
  39358. <a name="tblend"></a>
  39359. <h2 class="section"><a href="ffmpeg-all.html#toc-tblend">39.200 tblend</a></h2>
  39360. <p>Blend successive video frames.
  39361. </p>
  39362. <p>See <a href="#blend">blend</a>
  39363. </p>
  39364. <a name="telecine"></a>
  39365. <h2 class="section"><a href="ffmpeg-all.html#toc-telecine">39.201 telecine</a></h2>
  39366. <p>Apply telecine process to the video.
  39367. </p>
  39368. <p>This filter accepts the following options:
  39369. </p>
  39370. <dl compact="compact">
  39371. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  39372. <dd><dl compact="compact">
  39373. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  39374. <dd><p>top field first
  39375. </p></dd>
  39376. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  39377. <dd><p>bottom field first
  39378. The default value is <code>top</code>.
  39379. </p></dd>
  39380. </dl>
  39381. </dd>
  39382. <dt>&lsquo;<samp>pattern</samp>&rsquo;</dt>
  39383. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  39384. The default value is <code>23</code>.
  39385. </p></dd>
  39386. </dl>
  39387. <div class="example">
  39388. <pre class="example">Some typical patterns:
  39389. NTSC output (30i):
  39390. 27.5p: 32222
  39391. 24p: 23 (classic)
  39392. 24p: 2332 (preferred)
  39393. 20p: 33
  39394. 18p: 334
  39395. 16p: 3444
  39396. PAL output (25i):
  39397. 27.5p: 12222
  39398. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  39399. 16.67p: 33
  39400. 16p: 33333334
  39401. </pre></div>
  39402. <a name="thistogram"></a>
  39403. <h2 class="section"><a href="ffmpeg-all.html#toc-thistogram">39.202 thistogram</a></h2>
  39404. <p>Compute and draw a color distribution histogram for the input video across time.
  39405. </p>
  39406. <p>Unlike <a href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  39407. at certain time, this filter shows also past histograms of number of frames defined
  39408. by <code>width</code> option.
  39409. </p>
  39410. <p>The computed histogram is a representation of the color component
  39411. distribution in an image.
  39412. </p>
  39413. <p>The filter accepts the following options:
  39414. </p>
  39415. <dl compact="compact">
  39416. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  39417. <dd><p>Set width of single color component output. Default value is <code>0</code>.
  39418. Value of <code>0</code> means width will be picked from input video.
  39419. This also set number of passed histograms to keep.
  39420. Allowed range is [0, 8192].
  39421. </p>
  39422. </dd>
  39423. <dt>&lsquo;<samp>display_mode, d</samp>&rsquo;</dt>
  39424. <dd><p>Set display mode.
  39425. It accepts the following values:
  39426. </p><dl compact="compact">
  39427. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  39428. <dd><p>Per color component graphs are placed below each other.
  39429. </p>
  39430. </dd>
  39431. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  39432. <dd><p>Per color component graphs are placed side by side.
  39433. </p>
  39434. </dd>
  39435. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  39436. <dd><p>Presents information identical to that in the <code>parade</code>, except
  39437. that the graphs representing color components are superimposed directly
  39438. over one another.
  39439. </p></dd>
  39440. </dl>
  39441. <p>Default is <code>stack</code>.
  39442. </p>
  39443. </dd>
  39444. <dt>&lsquo;<samp>levels_mode, m</samp>&rsquo;</dt>
  39445. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  39446. Default is <code>linear</code>.
  39447. </p>
  39448. </dd>
  39449. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  39450. <dd><p>Set what color components to display.
  39451. Default is <code>7</code>.
  39452. </p>
  39453. </dd>
  39454. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  39455. <dd><p>Set background opacity. Default is <code>0.9</code>.
  39456. </p>
  39457. </dd>
  39458. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  39459. <dd><p>Show envelope. Default is disabled.
  39460. </p>
  39461. </dd>
  39462. <dt>&lsquo;<samp>ecolor, ec</samp>&rsquo;</dt>
  39463. <dd><p>Set envelope color. Default is <code>gold</code>.
  39464. </p></dd>
  39465. </dl>
  39466. <a name="threshold"></a>
  39467. <h2 class="section"><a href="ffmpeg-all.html#toc-threshold">39.203 threshold</a></h2>
  39468. <p>Apply threshold effect to video stream.
  39469. </p>
  39470. <p>This filter needs four video streams to perform thresholding.
  39471. First stream is stream we are filtering.
  39472. Second stream is holding threshold values, third stream is holding min values,
  39473. and last, fourth stream is holding max values.
  39474. </p>
  39475. <p>The filter accepts the following option:
  39476. </p>
  39477. <dl compact="compact">
  39478. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  39479. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  39480. By default value 0xf, all planes will be processed.
  39481. </p></dd>
  39482. </dl>
  39483. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  39484. of pixel component from 2nd threshold stream, third stream value will picked,
  39485. otherwise fourth stream pixel component value will be picked.
  39486. </p>
  39487. <p>Using color source filter one can perform various types of thresholding:
  39488. </p>
  39489. <a name="Examples-21"></a>
  39490. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-21">39.203.1 Examples</a></h3>
  39491. <ul>
  39492. <li>
  39493. Binary threshold, using gray color as threshold:
  39494. <div class="example">
  39495. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
  39496. </pre></div>
  39497. </li><li>
  39498. Inverted binary threshold, using gray color as threshold:
  39499. <div class="example">
  39500. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
  39501. </pre></div>
  39502. </li><li>
  39503. Truncate binary threshold, using gray color as threshold:
  39504. <div class="example">
  39505. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  39506. </pre></div>
  39507. </li><li>
  39508. Threshold to zero, using gray color as threshold:
  39509. <div class="example">
  39510. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  39511. </pre></div>
  39512. </li><li>
  39513. Inverted threshold to zero, using gray color as threshold:
  39514. <div class="example">
  39515. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  39516. </pre></div>
  39517. </li></ul>
  39518. <a name="thumbnail"></a>
  39519. <h2 class="section"><a href="ffmpeg-all.html#toc-thumbnail">39.204 thumbnail</a></h2>
  39520. <p>Select the most representative frame in a given sequence of consecutive frames.
  39521. </p>
  39522. <p>The filter accepts the following options:
  39523. </p>
  39524. <dl compact="compact">
  39525. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  39526. <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
  39527. will pick one of them, and then handle the next batch of <var>n</var> frames until
  39528. the end. Default is <code>100</code>.
  39529. </p></dd>
  39530. </dl>
  39531. <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
  39532. value will result in a higher memory usage, so a high value is not recommended.
  39533. </p>
  39534. <a name="Examples-79"></a>
  39535. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-79">39.204.1 Examples</a></h3>
  39536. <ul>
  39537. <li>
  39538. Extract one picture each 50 frames:
  39539. <div class="example">
  39540. <pre class="example">thumbnail=50
  39541. </pre></div>
  39542. </li><li>
  39543. Complete example of a thumbnail creation with <code>ffmpeg</code>:
  39544. <div class="example">
  39545. <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  39546. </pre></div>
  39547. </li></ul>
  39548. <a name="tile"></a>
  39549. <h2 class="section"><a href="ffmpeg-all.html#toc-tile">39.205 tile</a></h2>
  39550. <p>Tile several successive frames together.
  39551. </p>
  39552. <p>The filter accepts the following options:
  39553. </p>
  39554. <dl compact="compact">
  39555. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  39556. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  39557. this option, check the
  39558. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  39559. </p>
  39560. </dd>
  39561. <dt>&lsquo;<samp>nb_frames</samp>&rsquo;</dt>
  39562. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  39563. than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
  39564. the area will be used.
  39565. </p>
  39566. </dd>
  39567. <dt>&lsquo;<samp>margin</samp>&rsquo;</dt>
  39568. <dd><p>Set the outer border margin in pixels.
  39569. </p>
  39570. </dd>
  39571. <dt>&lsquo;<samp>padding</samp>&rsquo;</dt>
  39572. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  39573. more advanced padding options (such as having different values for the edges),
  39574. refer to the pad video filter.
  39575. </p>
  39576. </dd>
  39577. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  39578. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  39579. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  39580. The default value of <var>color</var> is &quot;black&quot;.
  39581. </p>
  39582. </dd>
  39583. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  39584. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  39585. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  39586. </p>
  39587. </dd>
  39588. <dt>&lsquo;<samp>init_padding</samp>&rsquo;</dt>
  39589. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  39590. This controls how soon will one get first output frame.
  39591. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  39592. </p></dd>
  39593. </dl>
  39594. <a name="Examples-175"></a>
  39595. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-175">39.205.1 Examples</a></h3>
  39596. <ul>
  39597. <li>
  39598. Produce 8x8 PNG tiles of all keyframes (&lsquo;<samp>-skip_frame nokey</samp>&rsquo;) in a movie:
  39599. <div class="example">
  39600. <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  39601. </pre></div>
  39602. <p>The &lsquo;<samp>-vsync 0</samp>&rsquo; is necessary to prevent <code>ffmpeg</code> from
  39603. duplicating each output frame to accommodate the originally detected frame
  39604. rate.
  39605. </p>
  39606. </li><li>
  39607. Display <code>5</code> pictures in an area of <code>3x2</code> frames,
  39608. with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
  39609. mixed flat and named options:
  39610. <div class="example">
  39611. <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
  39612. </pre></div>
  39613. </li></ul>
  39614. <a name="tinterlace"></a>
  39615. <h2 class="section"><a href="ffmpeg-all.html#toc-tinterlace">39.206 tinterlace</a></h2>
  39616. <p>Perform various types of temporal field interlacing.
  39617. </p>
  39618. <p>Frames are counted starting from 1, so the first input frame is
  39619. considered odd.
  39620. </p>
  39621. <p>The filter accepts the following options:
  39622. </p>
  39623. <dl compact="compact">
  39624. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  39625. <dd><p>Specify the mode of the interlacing. This option can also be specified
  39626. as a value alone. See below for a list of values for this option.
  39627. </p>
  39628. <p>Available values are:
  39629. </p>
  39630. <dl compact="compact">
  39631. <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
  39632. <dd><p>Move odd frames into the upper field, even into the lower field,
  39633. generating a double height frame at half frame rate.
  39634. </p><div class="example">
  39635. <pre class="example"> ------&gt; time
  39636. Input:
  39637. Frame 1 Frame 2 Frame 3 Frame 4
  39638. 11111 22222 33333 44444
  39639. 11111 22222 33333 44444
  39640. 11111 22222 33333 44444
  39641. 11111 22222 33333 44444
  39642. Output:
  39643. 11111 33333
  39644. 22222 44444
  39645. 11111 33333
  39646. 22222 44444
  39647. 11111 33333
  39648. 22222 44444
  39649. 11111 33333
  39650. 22222 44444
  39651. </pre></div>
  39652. </dd>
  39653. <dt>&lsquo;<samp>drop_even, 1</samp>&rsquo;</dt>
  39654. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  39655. unchanged height at half frame rate.
  39656. </p>
  39657. <div class="example">
  39658. <pre class="example"> ------&gt; time
  39659. Input:
  39660. Frame 1 Frame 2 Frame 3 Frame 4
  39661. 11111 22222 33333 44444
  39662. 11111 22222 33333 44444
  39663. 11111 22222 33333 44444
  39664. 11111 22222 33333 44444
  39665. Output:
  39666. 11111 33333
  39667. 11111 33333
  39668. 11111 33333
  39669. 11111 33333
  39670. </pre></div>
  39671. </dd>
  39672. <dt>&lsquo;<samp>drop_odd, 2</samp>&rsquo;</dt>
  39673. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  39674. unchanged height at half frame rate.
  39675. </p>
  39676. <div class="example">
  39677. <pre class="example"> ------&gt; time
  39678. Input:
  39679. Frame 1 Frame 2 Frame 3 Frame 4
  39680. 11111 22222 33333 44444
  39681. 11111 22222 33333 44444
  39682. 11111 22222 33333 44444
  39683. 11111 22222 33333 44444
  39684. Output:
  39685. 22222 44444
  39686. 22222 44444
  39687. 22222 44444
  39688. 22222 44444
  39689. </pre></div>
  39690. </dd>
  39691. <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
  39692. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  39693. generating a frame with double height at the same input frame rate.
  39694. </p>
  39695. <div class="example">
  39696. <pre class="example"> ------&gt; time
  39697. Input:
  39698. Frame 1 Frame 2 Frame 3 Frame 4
  39699. 11111 22222 33333 44444
  39700. 11111 22222 33333 44444
  39701. 11111 22222 33333 44444
  39702. 11111 22222 33333 44444
  39703. Output:
  39704. 11111 ..... 33333 .....
  39705. ..... 22222 ..... 44444
  39706. 11111 ..... 33333 .....
  39707. ..... 22222 ..... 44444
  39708. 11111 ..... 33333 .....
  39709. ..... 22222 ..... 44444
  39710. 11111 ..... 33333 .....
  39711. ..... 22222 ..... 44444
  39712. </pre></div>
  39713. </dd>
  39714. <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
  39715. <dd><p>Interleave the upper field from odd frames with the lower field from
  39716. even frames, generating a frame with unchanged height at half frame rate.
  39717. </p>
  39718. <div class="example">
  39719. <pre class="example"> ------&gt; time
  39720. Input:
  39721. Frame 1 Frame 2 Frame 3 Frame 4
  39722. 11111&lt;- 22222 33333&lt;- 44444
  39723. 11111 22222&lt;- 33333 44444&lt;-
  39724. 11111&lt;- 22222 33333&lt;- 44444
  39725. 11111 22222&lt;- 33333 44444&lt;-
  39726. Output:
  39727. 11111 33333
  39728. 22222 44444
  39729. 11111 33333
  39730. 22222 44444
  39731. </pre></div>
  39732. </dd>
  39733. <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
  39734. <dd><p>Interleave the lower field from odd frames with the upper field from
  39735. even frames, generating a frame with unchanged height at half frame rate.
  39736. </p>
  39737. <div class="example">
  39738. <pre class="example"> ------&gt; time
  39739. Input:
  39740. Frame 1 Frame 2 Frame 3 Frame 4
  39741. 11111 22222&lt;- 33333 44444&lt;-
  39742. 11111&lt;- 22222 33333&lt;- 44444
  39743. 11111 22222&lt;- 33333 44444&lt;-
  39744. 11111&lt;- 22222 33333&lt;- 44444
  39745. Output:
  39746. 22222 44444
  39747. 11111 33333
  39748. 22222 44444
  39749. 11111 33333
  39750. </pre></div>
  39751. </dd>
  39752. <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
  39753. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  39754. containing the second temporal field from the previous input frame and
  39755. the first temporal field from the next input frame. This mode relies on
  39756. the top_field_first flag. Useful for interlaced video displays with no
  39757. field synchronisation.
  39758. </p>
  39759. <div class="example">
  39760. <pre class="example"> ------&gt; time
  39761. Input:
  39762. Frame 1 Frame 2 Frame 3 Frame 4
  39763. 11111 22222 33333 44444
  39764. 11111 22222 33333 44444
  39765. 11111 22222 33333 44444
  39766. 11111 22222 33333 44444
  39767. Output:
  39768. 11111 22222 22222 33333 33333 44444 44444
  39769. 11111 11111 22222 22222 33333 33333 44444
  39770. 11111 22222 22222 33333 33333 44444 44444
  39771. 11111 11111 22222 22222 33333 33333 44444
  39772. </pre></div>
  39773. </dd>
  39774. <dt>&lsquo;<samp>mergex2, 7</samp>&rsquo;</dt>
  39775. <dd><p>Move odd frames into the upper field, even into the lower field,
  39776. generating a double height frame at same frame rate.
  39777. </p>
  39778. <div class="example">
  39779. <pre class="example"> ------&gt; time
  39780. Input:
  39781. Frame 1 Frame 2 Frame 3 Frame 4
  39782. 11111 22222 33333 44444
  39783. 11111 22222 33333 44444
  39784. 11111 22222 33333 44444
  39785. 11111 22222 33333 44444
  39786. Output:
  39787. 11111 33333 33333 55555
  39788. 22222 22222 44444 44444
  39789. 11111 33333 33333 55555
  39790. 22222 22222 44444 44444
  39791. 11111 33333 33333 55555
  39792. 22222 22222 44444 44444
  39793. 11111 33333 33333 55555
  39794. 22222 22222 44444 44444
  39795. </pre></div>
  39796. </dd>
  39797. </dl>
  39798. <p>Numeric values are deprecated but are accepted for backward
  39799. compatibility reasons.
  39800. </p>
  39801. <p>Default mode is <code>merge</code>.
  39802. </p>
  39803. </dd>
  39804. <dt>&lsquo;<samp>flags</samp>&rsquo;</dt>
  39805. <dd><p>Specify flags influencing the filter process.
  39806. </p>
  39807. <p>Available value for <var>flags</var> is:
  39808. </p>
  39809. <dl compact="compact">
  39810. <dt>&lsquo;<samp>low_pass_filter, vlpf</samp>&rsquo;</dt>
  39811. <dd><p>Enable linear vertical low-pass filtering in the filter.
  39812. Vertical low-pass filtering is required when creating an interlaced
  39813. destination from a progressive source which contains high-frequency
  39814. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  39815. patterning.
  39816. </p>
  39817. </dd>
  39818. <dt>&lsquo;<samp>complex_filter, cvlpf</samp>&rsquo;</dt>
  39819. <dd><p>Enable complex vertical low-pass filtering.
  39820. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  39821. patterning but better retain detail and subjective sharpness impression.
  39822. </p>
  39823. </dd>
  39824. <dt>&lsquo;<samp>bypass_il</samp>&rsquo;</dt>
  39825. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  39826. </p></dd>
  39827. </dl>
  39828. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  39829. enabled for &lsquo;<samp>mode</samp>&rsquo; <var>interleave_top</var> and <var>interleave_bottom</var>.
  39830. </p>
  39831. </dd>
  39832. </dl>
  39833. <a name="tmix"></a>
  39834. <h2 class="section"><a href="ffmpeg-all.html#toc-tmix">39.207 tmix</a></h2>
  39835. <p>Mix successive video frames.
  39836. </p>
  39837. <p>A description of the accepted options follows.
  39838. </p>
  39839. <dl compact="compact">
  39840. <dt>&lsquo;<samp>frames</samp>&rsquo;</dt>
  39841. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  39842. </p>
  39843. </dd>
  39844. <dt>&lsquo;<samp>weights</samp>&rsquo;</dt>
  39845. <dd><p>Specify weight of each input video frame.
  39846. Each weight is separated by space. If number of weights is smaller than
  39847. number of <var>frames</var> last specified weight will be used for all remaining
  39848. unset weights.
  39849. </p>
  39850. </dd>
  39851. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  39852. <dd><p>Specify scale, if it is set it will be multiplied with sum
  39853. of each weight multiplied with pixel values to give final destination
  39854. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  39855. </p></dd>
  39856. </dl>
  39857. <a name="Examples-73"></a>
  39858. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-73">39.207.1 Examples</a></h3>
  39859. <ul>
  39860. <li>
  39861. Average 7 successive frames:
  39862. <div class="example">
  39863. <pre class="example">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  39864. </pre></div>
  39865. </li><li>
  39866. Apply simple temporal convolution:
  39867. <div class="example">
  39868. <pre class="example">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  39869. </pre></div>
  39870. </li><li>
  39871. Similar as above but only showing temporal differences:
  39872. <div class="example">
  39873. <pre class="example">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  39874. </pre></div>
  39875. </li></ul>
  39876. <p><a name="tonemap"></a>
  39877. </p><a name="tonemap-1"></a>
  39878. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap-1">39.208 tonemap</a></h2>
  39879. <p>Tone map colors from different dynamic ranges.
  39880. </p>
  39881. <p>This filter expects data in single precision floating point, as it needs to
  39882. operate on (and can output) out-of-range values. Another filter, such as
  39883. <a href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  39884. </p>
  39885. <p>The tonemapping algorithms implemented only work on linear light, so input
  39886. data should be linearized beforehand (and possibly correctly tagged).
  39887. </p>
  39888. <div class="example">
  39889. <pre class="example">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  39890. </pre></div>
  39891. <a name="Options-55"></a>
  39892. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-55">39.208.1 Options</a></h3>
  39893. <p>The filter accepts the following options.
  39894. </p>
  39895. <dl compact="compact">
  39896. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  39897. <dd><p>Set the tone map algorithm to use.
  39898. </p>
  39899. <p>Possible values are:
  39900. </p><dl compact="compact">
  39901. <dt><var>none</var></dt>
  39902. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  39903. </p>
  39904. </dd>
  39905. <dt><var>clip</var></dt>
  39906. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  39907. in-range values, while distorting out-of-range values.
  39908. </p>
  39909. </dd>
  39910. <dt><var>linear</var></dt>
  39911. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  39912. </p>
  39913. </dd>
  39914. <dt><var>gamma</var></dt>
  39915. <dd><p>Fit a logarithmic transfer between the tone curves.
  39916. </p>
  39917. </dd>
  39918. <dt><var>reinhard</var></dt>
  39919. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  39920. contrast, which results in flattening details and degrading color accuracy.
  39921. </p>
  39922. </dd>
  39923. <dt><var>hable</var></dt>
  39924. <dd><p>Preserve both dark and bright details better than <var>reinhard</var>, at the cost
  39925. of slightly darkening everything. Use it when detail preservation is more
  39926. important than color and brightness accuracy.
  39927. </p>
  39928. </dd>
  39929. <dt><var>mobius</var></dt>
  39930. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  39931. in-range material as much as possible. Use it when color accuracy is more
  39932. important than detail preservation.
  39933. </p></dd>
  39934. </dl>
  39935. <p>Default is none.
  39936. </p>
  39937. </dd>
  39938. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  39939. <dd><p>Tune the tone mapping algorithm.
  39940. </p>
  39941. <p>This affects the following algorithms:
  39942. </p><dl compact="compact">
  39943. <dt><var>none</var></dt>
  39944. <dd><p>Ignored.
  39945. </p>
  39946. </dd>
  39947. <dt><var>linear</var></dt>
  39948. <dd><p>Specifies the scale factor to use while stretching.
  39949. Default to 1.0.
  39950. </p>
  39951. </dd>
  39952. <dt><var>gamma</var></dt>
  39953. <dd><p>Specifies the exponent of the function.
  39954. Default to 1.8.
  39955. </p>
  39956. </dd>
  39957. <dt><var>clip</var></dt>
  39958. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  39959. Default to 1.0.
  39960. </p>
  39961. </dd>
  39962. <dt><var>reinhard</var></dt>
  39963. <dd><p>Specify the local contrast coefficient at the display peak.
  39964. Default to 0.5, which means that in-gamut values will be about half as bright
  39965. as when clipping.
  39966. </p>
  39967. </dd>
  39968. <dt><var>hable</var></dt>
  39969. <dd><p>Ignored.
  39970. </p>
  39971. </dd>
  39972. <dt><var>mobius</var></dt>
  39973. <dd><p>Specify the transition point from linear to mobius transform. Every value
  39974. below this point is guaranteed to be mapped 1:1. The higher the value, the
  39975. more accurate the result will be, at the cost of losing bright details.
  39976. Default to 0.3, which due to the steep initial slope still preserves in-range
  39977. colors fairly accurately.
  39978. </p></dd>
  39979. </dl>
  39980. </dd>
  39981. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  39982. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  39983. higher the parameter, the more color information will be preserved. This
  39984. setting helps prevent unnaturally blown-out colors for super-highlights, by
  39985. (smoothly) turning into white instead. This makes images feel more natural,
  39986. at the cost of reducing information about out-of-range colors.
  39987. </p>
  39988. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  39989. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  39990. </p>
  39991. <p>This option works only if the input frame has a supported color tag.
  39992. </p>
  39993. </dd>
  39994. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  39995. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  39996. embedded peak information in display metadata is not reliable or when tone
  39997. mapping from a lower range to a higher range.
  39998. </p></dd>
  39999. </dl>
  40000. <a name="tpad"></a>
  40001. <h2 class="section"><a href="ffmpeg-all.html#toc-tpad">39.209 tpad</a></h2>
  40002. <p>Temporarily pad video frames.
  40003. </p>
  40004. <p>The filter accepts the following options:
  40005. </p>
  40006. <dl compact="compact">
  40007. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  40008. <dd><p>Specify number of delay frames before input video stream.
  40009. </p>
  40010. </dd>
  40011. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  40012. <dd><p>Specify number of padding frames after input video stream.
  40013. Set to -1 to pad indefinitely.
  40014. </p>
  40015. </dd>
  40016. <dt>&lsquo;<samp>start_mode</samp>&rsquo;</dt>
  40017. <dd><p>Set kind of frames added to beginning of stream.
  40018. Can be either <var>add</var> or <var>clone</var>.
  40019. With <var>add</var> frames of solid-color are added.
  40020. With <var>clone</var> frames are clones of first frame.
  40021. </p>
  40022. </dd>
  40023. <dt>&lsquo;<samp>stop_mode</samp>&rsquo;</dt>
  40024. <dd><p>Set kind of frames added to end of stream.
  40025. Can be either <var>add</var> or <var>clone</var>.
  40026. With <var>add</var> frames of solid-color are added.
  40027. With <var>clone</var> frames are clones of last frame.
  40028. </p>
  40029. </dd>
  40030. <dt>&lsquo;<samp>start_duration, stop_duration</samp>&rsquo;</dt>
  40031. <dd><p>Specify the duration of the start/stop delay. See
  40032. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  40033. for the accepted syntax.
  40034. These options override <var>start</var> and <var>stop</var>.
  40035. </p>
  40036. </dd>
  40037. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  40038. <dd><p>Specify the color of the padded area. For the syntax of this option,
  40039. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  40040. </p>
  40041. <p>The default value of <var>color</var> is &quot;black&quot;.
  40042. </p></dd>
  40043. </dl>
  40044. <p><a name="transpose"></a>
  40045. </p><a name="transpose-1"></a>
  40046. <h2 class="section"><a href="ffmpeg-all.html#toc-transpose-1">39.210 transpose</a></h2>
  40047. <p>Transpose rows with columns in the input video and optionally flip it.
  40048. </p>
  40049. <p>It accepts the following parameters:
  40050. </p>
  40051. <dl compact="compact">
  40052. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  40053. <dd><p>Specify the transposition direction.
  40054. </p>
  40055. <p>Can assume the following values:
  40056. </p><dl compact="compact">
  40057. <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
  40058. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  40059. </p><div class="example">
  40060. <pre class="example">L.R L.l
  40061. . . -&gt; . .
  40062. l.r R.r
  40063. </pre></div>
  40064. </dd>
  40065. <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
  40066. <dd><p>Rotate by 90 degrees clockwise, that is:
  40067. </p><div class="example">
  40068. <pre class="example">L.R l.L
  40069. . . -&gt; . .
  40070. l.r r.R
  40071. </pre></div>
  40072. </dd>
  40073. <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
  40074. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  40075. </p><div class="example">
  40076. <pre class="example">L.R R.r
  40077. . . -&gt; . .
  40078. l.r L.l
  40079. </pre></div>
  40080. </dd>
  40081. <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
  40082. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  40083. </p><div class="example">
  40084. <pre class="example">L.R r.R
  40085. . . -&gt; . .
  40086. l.r l.L
  40087. </pre></div>
  40088. </dd>
  40089. </dl>
  40090. <p>For values between 4-7, the transposition is only done if the input
  40091. video geometry is portrait and not landscape. These values are
  40092. deprecated, the <code>passthrough</code> option should be used instead.
  40093. </p>
  40094. <p>Numerical values are deprecated, and should be dropped in favor of
  40095. symbolic constants.
  40096. </p>
  40097. </dd>
  40098. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  40099. <dd><p>Do not apply the transposition if the input geometry matches the one
  40100. specified by the specified value. It accepts the following values:
  40101. </p><dl compact="compact">
  40102. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40103. <dd><p>Always apply transposition.
  40104. </p></dd>
  40105. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  40106. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  40107. </p></dd>
  40108. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  40109. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  40110. </p></dd>
  40111. </dl>
  40112. <p>Default value is <code>none</code>.
  40113. </p></dd>
  40114. </dl>
  40115. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  40116. layout:
  40117. </p><div class="example">
  40118. <pre class="example">transpose=dir=1:passthrough=portrait
  40119. </pre></div>
  40120. <p>The command above can also be specified as:
  40121. </p><div class="example">
  40122. <pre class="example">transpose=1:portrait
  40123. </pre></div>
  40124. <a name="transpose_005fnpp"></a>
  40125. <h2 class="section"><a href="ffmpeg-all.html#toc-transpose_005fnpp">39.211 transpose_npp</a></h2>
  40126. <p>Transpose rows with columns in the input video and optionally flip it.
  40127. For more in depth examples see the <a href="#transpose">transpose</a> video filter, which shares mostly the same options.
  40128. </p>
  40129. <p>It accepts the following parameters:
  40130. </p>
  40131. <dl compact="compact">
  40132. <dt>&lsquo;<samp>dir</samp>&rsquo;</dt>
  40133. <dd><p>Specify the transposition direction.
  40134. </p>
  40135. <p>Can assume the following values:
  40136. </p><dl compact="compact">
  40137. <dt>&lsquo;<samp>cclock_flip</samp>&rsquo;</dt>
  40138. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  40139. </p>
  40140. </dd>
  40141. <dt>&lsquo;<samp>clock</samp>&rsquo;</dt>
  40142. <dd><p>Rotate by 90 degrees clockwise.
  40143. </p>
  40144. </dd>
  40145. <dt>&lsquo;<samp>cclock</samp>&rsquo;</dt>
  40146. <dd><p>Rotate by 90 degrees counterclockwise.
  40147. </p>
  40148. </dd>
  40149. <dt>&lsquo;<samp>clock_flip</samp>&rsquo;</dt>
  40150. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  40151. </p></dd>
  40152. </dl>
  40153. </dd>
  40154. <dt>&lsquo;<samp>passthrough</samp>&rsquo;</dt>
  40155. <dd><p>Do not apply the transposition if the input geometry matches the one
  40156. specified by the specified value. It accepts the following values:
  40157. </p><dl compact="compact">
  40158. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40159. <dd><p>Always apply transposition. (default)
  40160. </p></dd>
  40161. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  40162. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  40163. </p></dd>
  40164. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  40165. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  40166. </p></dd>
  40167. </dl>
  40168. </dd>
  40169. </dl>
  40170. <a name="trim"></a>
  40171. <h2 class="section"><a href="ffmpeg-all.html#toc-trim">39.212 trim</a></h2>
  40172. <p>Trim the input so that the output contains one continuous subpart of the input.
  40173. </p>
  40174. <p>It accepts the following parameters:
  40175. </p><dl compact="compact">
  40176. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  40177. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  40178. timestamp <var>start</var> will be the first frame in the output.
  40179. </p>
  40180. </dd>
  40181. <dt>&lsquo;<samp>end</samp>&rsquo;</dt>
  40182. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  40183. immediately preceding the one with the timestamp <var>end</var> will be the last
  40184. frame in the output.
  40185. </p>
  40186. </dd>
  40187. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  40188. <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
  40189. in timebase units instead of seconds.
  40190. </p>
  40191. </dd>
  40192. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  40193. <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
  40194. in timebase units instead of seconds.
  40195. </p>
  40196. </dd>
  40197. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  40198. <dd><p>The maximum duration of the output in seconds.
  40199. </p>
  40200. </dd>
  40201. <dt>&lsquo;<samp>start_frame</samp>&rsquo;</dt>
  40202. <dd><p>The number of the first frame that should be passed to the output.
  40203. </p>
  40204. </dd>
  40205. <dt>&lsquo;<samp>end_frame</samp>&rsquo;</dt>
  40206. <dd><p>The number of the first frame that should be dropped.
  40207. </p></dd>
  40208. </dl>
  40209. <p>&lsquo;<samp>start</samp>&rsquo;, &lsquo;<samp>end</samp>&rsquo;, and &lsquo;<samp>duration</samp>&rsquo; are expressed as time
  40210. duration specifications; see
  40211. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  40212. for the accepted syntax.
  40213. </p>
  40214. <p>Note that the first two sets of the start/end options and the &lsquo;<samp>duration</samp>&rsquo;
  40215. option look at the frame timestamp, while the _frame variants simply count the
  40216. frames that pass through the filter. Also note that this filter does not modify
  40217. the timestamps. If you wish for the output timestamps to start at zero, insert a
  40218. setpts filter after the trim filter.
  40219. </p>
  40220. <p>If multiple start or end options are set, this filter tries to be greedy and
  40221. keep all the frames that match at least one of the specified constraints. To keep
  40222. only the part that matches all the constraints at once, chain multiple trim
  40223. filters.
  40224. </p>
  40225. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  40226. just the end values to keep everything before the specified time.
  40227. </p>
  40228. <p>Examples:
  40229. </p><ul>
  40230. <li>
  40231. Drop everything except the second minute of input:
  40232. <div class="example">
  40233. <pre class="example">ffmpeg -i INPUT -vf trim=60:120
  40234. </pre></div>
  40235. </li><li>
  40236. Keep only the first second:
  40237. <div class="example">
  40238. <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
  40239. </pre></div>
  40240. </li></ul>
  40241. <a name="unpremultiply"></a>
  40242. <h2 class="section"><a href="ffmpeg-all.html#toc-unpremultiply">39.213 unpremultiply</a></h2>
  40243. <p>Apply alpha unpremultiply effect to input video stream using first plane
  40244. of second stream as alpha.
  40245. </p>
  40246. <p>Both streams must have same dimensions and same pixel format.
  40247. </p>
  40248. <p>The filter accepts the following option:
  40249. </p>
  40250. <dl compact="compact">
  40251. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  40252. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  40253. By default value 0xf, all planes will be processed.
  40254. </p>
  40255. <p>If the format has 1 or 2 components, then luma is bit 0.
  40256. If the format has 3 or 4 components:
  40257. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  40258. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  40259. If present, the alpha channel is always the last bit.
  40260. </p>
  40261. </dd>
  40262. <dt>&lsquo;<samp>inplace</samp>&rsquo;</dt>
  40263. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  40264. </p></dd>
  40265. </dl>
  40266. <p><a name="unsharp"></a>
  40267. </p><a name="unsharp-1"></a>
  40268. <h2 class="section"><a href="ffmpeg-all.html#toc-unsharp-1">39.214 unsharp</a></h2>
  40269. <p>Sharpen or blur the input video.
  40270. </p>
  40271. <p>It accepts the following parameters:
  40272. </p>
  40273. <dl compact="compact">
  40274. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  40275. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  40276. 3 and 23. The default value is 5.
  40277. </p>
  40278. </dd>
  40279. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  40280. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  40281. and 23. The default value is 5.
  40282. </p>
  40283. </dd>
  40284. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  40285. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  40286. values lay between -1.5 and 1.5.
  40287. </p>
  40288. <p>Negative values will blur the input video, while positive values will
  40289. sharpen it, a value of zero will disable the effect.
  40290. </p>
  40291. <p>Default value is 1.0.
  40292. </p>
  40293. </dd>
  40294. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  40295. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  40296. between 3 and 23. The default value is 5.
  40297. </p>
  40298. </dd>
  40299. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  40300. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  40301. between 3 and 23. The default value is 5.
  40302. </p>
  40303. </dd>
  40304. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  40305. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  40306. values lay between -1.5 and 1.5.
  40307. </p>
  40308. <p>Negative values will blur the input video, while positive values will
  40309. sharpen it, a value of zero will disable the effect.
  40310. </p>
  40311. <p>Default value is 0.0.
  40312. </p>
  40313. </dd>
  40314. </dl>
  40315. <p>All parameters are optional and default to the equivalent of the
  40316. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  40317. </p>
  40318. <a name="Examples-125"></a>
  40319. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-125">39.214.1 Examples</a></h3>
  40320. <ul>
  40321. <li>
  40322. Apply strong luma sharpen effect:
  40323. <div class="example">
  40324. <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  40325. </pre></div>
  40326. </li><li>
  40327. Apply a strong blur of both luma and chroma parameters:
  40328. <div class="example">
  40329. <pre class="example">unsharp=7:7:-2:7:7:-2
  40330. </pre></div>
  40331. </li></ul>
  40332. <a name="uspp"></a>
  40333. <h2 class="section"><a href="ffmpeg-all.html#toc-uspp">39.215 uspp</a></h2>
  40334. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  40335. the image at several (or - in the case of &lsquo;<samp>quality</samp>&rsquo; level <code>8</code> - all)
  40336. shifts and average the results.
  40337. </p>
  40338. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  40339. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  40340. DCT similar to MJPEG.
  40341. </p>
  40342. <p>The filter accepts the following options:
  40343. </p>
  40344. <dl compact="compact">
  40345. <dt>&lsquo;<samp>quality</samp>&rsquo;</dt>
  40346. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  40347. an integer in the range 0-8. If set to <code>0</code>, the filter will have no
  40348. effect. A value of <code>8</code> means the higher quality. For each increment of
  40349. that value the speed drops by a factor of approximately 2. Default value is
  40350. <code>3</code>.
  40351. </p>
  40352. </dd>
  40353. <dt>&lsquo;<samp>qp</samp>&rsquo;</dt>
  40354. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  40355. from the video stream (if available).
  40356. </p></dd>
  40357. </dl>
  40358. <a name="v360"></a>
  40359. <h2 class="section"><a href="ffmpeg-all.html#toc-v360">39.216 v360</a></h2>
  40360. <p>Convert 360 videos between various formats.
  40361. </p>
  40362. <p>The filter accepts the following options:
  40363. </p>
  40364. <dl compact="compact">
  40365. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  40366. <dt>&lsquo;<samp>output</samp>&rsquo;</dt>
  40367. <dd><p>Set format of the input/output video.
  40368. </p>
  40369. <p>Available formats:
  40370. </p>
  40371. <dl compact="compact">
  40372. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  40373. <dt>&lsquo;<samp>equirect</samp>&rsquo;</dt>
  40374. <dd><p>Equirectangular projection.
  40375. </p>
  40376. </dd>
  40377. <dt>&lsquo;<samp>c3x2</samp>&rsquo;</dt>
  40378. <dt>&lsquo;<samp>c6x1</samp>&rsquo;</dt>
  40379. <dt>&lsquo;<samp>c1x6</samp>&rsquo;</dt>
  40380. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  40381. </p>
  40382. <p>Format specific options:
  40383. </p>
  40384. <dl compact="compact">
  40385. <dt>&lsquo;<samp>in_pad</samp>&rsquo;</dt>
  40386. <dt>&lsquo;<samp>out_pad</samp>&rsquo;</dt>
  40387. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  40388. </p>
  40389. <p>Example values:
  40390. </p><dl compact="compact">
  40391. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  40392. <dd><p>No padding.
  40393. </p></dd>
  40394. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  40395. <dd><p>1% of face is padding. For example, with 1920x1280 resolution face size would be 640x640 and padding would be 3 pixels from each side. (640 * 0.01 = 6 pixels)
  40396. </p></dd>
  40397. </dl>
  40398. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  40399. </p>
  40400. </dd>
  40401. <dt>&lsquo;<samp>fin_pad</samp>&rsquo;</dt>
  40402. <dt>&lsquo;<samp>fout_pad</samp>&rsquo;</dt>
  40403. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  40404. </p>
  40405. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  40406. </p>
  40407. </dd>
  40408. <dt>&lsquo;<samp>in_forder</samp>&rsquo;</dt>
  40409. <dt>&lsquo;<samp>out_forder</samp>&rsquo;</dt>
  40410. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  40411. </p>
  40412. <p>Designation of directions:
  40413. </p><dl compact="compact">
  40414. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  40415. <dd><p>right
  40416. </p></dd>
  40417. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  40418. <dd><p>left
  40419. </p></dd>
  40420. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  40421. <dd><p>up
  40422. </p></dd>
  40423. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  40424. <dd><p>down
  40425. </p></dd>
  40426. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  40427. <dd><p>forward
  40428. </p></dd>
  40429. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  40430. <dd><p>back
  40431. </p></dd>
  40432. </dl>
  40433. <p>Default value is <b>&lsquo;<samp>rludfb</samp>&rsquo;</b>.
  40434. </p>
  40435. </dd>
  40436. <dt>&lsquo;<samp>in_frot</samp>&rsquo;</dt>
  40437. <dt>&lsquo;<samp>out_frot</samp>&rsquo;</dt>
  40438. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  40439. </p>
  40440. <p>Designation of angles:
  40441. </p><dl compact="compact">
  40442. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  40443. <dd><p>0 degrees clockwise
  40444. </p></dd>
  40445. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  40446. <dd><p>90 degrees clockwise
  40447. </p></dd>
  40448. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  40449. <dd><p>180 degrees clockwise
  40450. </p></dd>
  40451. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  40452. <dd><p>270 degrees clockwise
  40453. </p></dd>
  40454. </dl>
  40455. <p>Default value is <b>&lsquo;<samp>000000</samp>&rsquo;</b>.
  40456. </p></dd>
  40457. </dl>
  40458. </dd>
  40459. <dt>&lsquo;<samp>eac</samp>&rsquo;</dt>
  40460. <dd><p>Equi-Angular Cubemap.
  40461. </p>
  40462. </dd>
  40463. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  40464. <dt>&lsquo;<samp>gnomonic</samp>&rsquo;</dt>
  40465. <dt>&lsquo;<samp>rectilinear</samp>&rsquo;</dt>
  40466. <dd><p>Regular video.
  40467. </p>
  40468. <p>Format specific options:
  40469. </p><dl compact="compact">
  40470. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  40471. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  40472. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  40473. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40474. </p>
  40475. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40476. </p>
  40477. </dd>
  40478. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  40479. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  40480. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  40481. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40482. </p>
  40483. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40484. </p></dd>
  40485. </dl>
  40486. </dd>
  40487. <dt>&lsquo;<samp>dfisheye</samp>&rsquo;</dt>
  40488. <dd><p>Dual fisheye.
  40489. </p>
  40490. <p>Format specific options:
  40491. </p><dl compact="compact">
  40492. <dt>&lsquo;<samp>in_pad</samp>&rsquo;</dt>
  40493. <dt>&lsquo;<samp>out_pad</samp>&rsquo;</dt>
  40494. <dd><p>Set padding proportion. Values in decimals.
  40495. </p>
  40496. <p>Example values:
  40497. </p><dl compact="compact">
  40498. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  40499. <dd><p>No padding.
  40500. </p></dd>
  40501. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  40502. <dd><p>1% padding.
  40503. </p></dd>
  40504. </dl>
  40505. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  40506. </p></dd>
  40507. </dl>
  40508. </dd>
  40509. <dt>&lsquo;<samp>barrel</samp>&rsquo;</dt>
  40510. <dt>&lsquo;<samp>fb</samp>&rsquo;</dt>
  40511. <dt>&lsquo;<samp>barrelsplit</samp>&rsquo;</dt>
  40512. <dd><p>Facebook&rsquo;s 360 formats.
  40513. </p>
  40514. </dd>
  40515. <dt>&lsquo;<samp>sg</samp>&rsquo;</dt>
  40516. <dd><p>Stereographic format.
  40517. </p>
  40518. <p>Format specific options:
  40519. </p><dl compact="compact">
  40520. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  40521. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  40522. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  40523. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40524. </p>
  40525. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40526. </p>
  40527. </dd>
  40528. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  40529. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  40530. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  40531. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40532. </p>
  40533. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40534. </p></dd>
  40535. </dl>
  40536. </dd>
  40537. <dt>&lsquo;<samp>mercator</samp>&rsquo;</dt>
  40538. <dd><p>Mercator format.
  40539. </p>
  40540. </dd>
  40541. <dt>&lsquo;<samp>ball</samp>&rsquo;</dt>
  40542. <dd><p>Ball format, gives significant distortion toward the back.
  40543. </p>
  40544. </dd>
  40545. <dt>&lsquo;<samp>hammer</samp>&rsquo;</dt>
  40546. <dd><p>Hammer-Aitoff map projection format.
  40547. </p>
  40548. </dd>
  40549. <dt>&lsquo;<samp>sinusoidal</samp>&rsquo;</dt>
  40550. <dd><p>Sinusoidal map projection format.
  40551. </p>
  40552. </dd>
  40553. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  40554. <dd><p>Fisheye projection.
  40555. </p>
  40556. <p>Format specific options:
  40557. </p><dl compact="compact">
  40558. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  40559. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  40560. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  40561. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40562. </p>
  40563. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40564. </p>
  40565. </dd>
  40566. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  40567. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  40568. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  40569. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40570. </p>
  40571. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40572. </p></dd>
  40573. </dl>
  40574. </dd>
  40575. <dt>&lsquo;<samp>pannini</samp>&rsquo;</dt>
  40576. <dd><p>Pannini projection. <i>(output only)</i>
  40577. </p>
  40578. <p>Format specific options:
  40579. </p><dl compact="compact">
  40580. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  40581. <dd><p>Set pannini parameter.
  40582. </p></dd>
  40583. </dl>
  40584. </dd>
  40585. <dt>&lsquo;<samp>cylindrical</samp>&rsquo;</dt>
  40586. <dd><p>Cylindrical projection.
  40587. </p>
  40588. <p>Format specific options:
  40589. </p><dl compact="compact">
  40590. <dt>&lsquo;<samp>h_fov</samp>&rsquo;</dt>
  40591. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  40592. <dt>&lsquo;<samp>d_fov</samp>&rsquo;</dt>
  40593. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  40594. </p>
  40595. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40596. </p>
  40597. </dd>
  40598. <dt>&lsquo;<samp>ih_fov</samp>&rsquo;</dt>
  40599. <dt>&lsquo;<samp>iv_fov</samp>&rsquo;</dt>
  40600. <dt>&lsquo;<samp>id_fov</samp>&rsquo;</dt>
  40601. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  40602. </p>
  40603. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  40604. </p></dd>
  40605. </dl>
  40606. </dd>
  40607. <dt>&lsquo;<samp>perspective</samp>&rsquo;</dt>
  40608. <dd><p>Perspective projection. <i>(output only)</i>
  40609. </p>
  40610. <p>Format specific options:
  40611. </p><dl compact="compact">
  40612. <dt>&lsquo;<samp>v_fov</samp>&rsquo;</dt>
  40613. <dd><p>Set perspective parameter.
  40614. </p></dd>
  40615. </dl>
  40616. </dd>
  40617. <dt>&lsquo;<samp>tetrahedron</samp>&rsquo;</dt>
  40618. <dd><p>Tetrahedron projection.
  40619. </p>
  40620. </dd>
  40621. <dt>&lsquo;<samp>tsp</samp>&rsquo;</dt>
  40622. <dd><p>Truncated square pyramid projection.
  40623. </p>
  40624. </dd>
  40625. <dt>&lsquo;<samp>he</samp>&rsquo;</dt>
  40626. <dt>&lsquo;<samp>hequirect</samp>&rsquo;</dt>
  40627. <dd><p>Half equirectangular projection.
  40628. </p></dd>
  40629. </dl>
  40630. </dd>
  40631. <dt>&lsquo;<samp>interp</samp>&rsquo;</dt>
  40632. <dd><p>Set interpolation method.<br>
  40633. <i>Note: more complex interpolation methods require much more memory to run.</i>
  40634. </p>
  40635. <p>Available methods:
  40636. </p>
  40637. <dl compact="compact">
  40638. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  40639. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  40640. <dd><p>Nearest neighbour.
  40641. </p></dd>
  40642. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  40643. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  40644. <dd><p>Bilinear interpolation.
  40645. </p></dd>
  40646. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  40647. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  40648. <dd><p>Bicubic interpolation.
  40649. </p></dd>
  40650. <dt>&lsquo;<samp>lanc</samp>&rsquo;</dt>
  40651. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  40652. <dd><p>Lanczos interpolation.
  40653. </p></dd>
  40654. <dt>&lsquo;<samp>sp16</samp>&rsquo;</dt>
  40655. <dt>&lsquo;<samp>spline16</samp>&rsquo;</dt>
  40656. <dd><p>Spline16 interpolation.
  40657. </p></dd>
  40658. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  40659. <dt>&lsquo;<samp>gaussian</samp>&rsquo;</dt>
  40660. <dd><p>Gaussian interpolation.
  40661. </p></dd>
  40662. </dl>
  40663. <p>Default value is <b>&lsquo;<samp>line</samp>&rsquo;</b>.
  40664. </p>
  40665. </dd>
  40666. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  40667. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  40668. <dd><p>Set the output video resolution.
  40669. </p>
  40670. <p>Default resolution depends on formats.
  40671. </p>
  40672. </dd>
  40673. <dt>&lsquo;<samp>in_stereo</samp>&rsquo;</dt>
  40674. <dt>&lsquo;<samp>out_stereo</samp>&rsquo;</dt>
  40675. <dd><p>Set the input/output stereo format.
  40676. </p>
  40677. <dl compact="compact">
  40678. <dt>&lsquo;<samp>2d</samp>&rsquo;</dt>
  40679. <dd><p>2D mono
  40680. </p></dd>
  40681. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  40682. <dd><p>Side by side
  40683. </p></dd>
  40684. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  40685. <dd><p>Top bottom
  40686. </p></dd>
  40687. </dl>
  40688. <p>Default value is <b>&lsquo;<samp>2d</samp>&rsquo;</b> for input and output format.
  40689. </p>
  40690. </dd>
  40691. <dt>&lsquo;<samp>yaw</samp>&rsquo;</dt>
  40692. <dt>&lsquo;<samp>pitch</samp>&rsquo;</dt>
  40693. <dt>&lsquo;<samp>roll</samp>&rsquo;</dt>
  40694. <dd><p>Set rotation for the output video. Values in degrees.
  40695. </p>
  40696. </dd>
  40697. <dt>&lsquo;<samp>rorder</samp>&rsquo;</dt>
  40698. <dd><p>Set rotation order for the output video. Choose one item for each position.
  40699. </p>
  40700. <dl compact="compact">
  40701. <dt>&lsquo;<samp>y, Y</samp>&rsquo;</dt>
  40702. <dd><p>yaw
  40703. </p></dd>
  40704. <dt>&lsquo;<samp>p, P</samp>&rsquo;</dt>
  40705. <dd><p>pitch
  40706. </p></dd>
  40707. <dt>&lsquo;<samp>r, R</samp>&rsquo;</dt>
  40708. <dd><p>roll
  40709. </p></dd>
  40710. </dl>
  40711. <p>Default value is <b>&lsquo;<samp>ypr</samp>&rsquo;</b>.
  40712. </p>
  40713. </dd>
  40714. <dt>&lsquo;<samp>h_flip</samp>&rsquo;</dt>
  40715. <dt>&lsquo;<samp>v_flip</samp>&rsquo;</dt>
  40716. <dt>&lsquo;<samp>d_flip</samp>&rsquo;</dt>
  40717. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  40718. </p>
  40719. </dd>
  40720. <dt>&lsquo;<samp>ih_flip</samp>&rsquo;</dt>
  40721. <dt>&lsquo;<samp>iv_flip</samp>&rsquo;</dt>
  40722. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  40723. </p>
  40724. </dd>
  40725. <dt>&lsquo;<samp>in_trans</samp>&rsquo;</dt>
  40726. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  40727. </p>
  40728. </dd>
  40729. <dt>&lsquo;<samp>out_trans</samp>&rsquo;</dt>
  40730. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  40731. </p>
  40732. </dd>
  40733. <dt>&lsquo;<samp>alpha_mask</samp>&rsquo;</dt>
  40734. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  40735. </p></dd>
  40736. </dl>
  40737. <a name="Examples-67"></a>
  40738. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-67">39.216.1 Examples</a></h3>
  40739. <ul>
  40740. <li>
  40741. Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  40742. <div class="example">
  40743. <pre class="example">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  40744. </pre></div>
  40745. </li><li>
  40746. Extract back view of Equi-Angular Cubemap:
  40747. <div class="example">
  40748. <pre class="example">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  40749. </pre></div>
  40750. </li><li>
  40751. Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  40752. <div class="example">
  40753. <pre class="example">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  40754. </pre></div>
  40755. </li></ul>
  40756. <a name="Commands-66"></a>
  40757. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-66">39.216.2 Commands</a></h3>
  40758. <p>This filter supports subset of above options as <a href="#commands">commands</a>.
  40759. </p>
  40760. <a name="vaguedenoiser"></a>
  40761. <h2 class="section"><a href="ffmpeg-all.html#toc-vaguedenoiser">39.217 vaguedenoiser</a></h2>
  40762. <p>Apply a wavelet based denoiser.
  40763. </p>
  40764. <p>It transforms each frame from the video input into the wavelet domain,
  40765. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  40766. the obtained coefficients. It does an inverse wavelet transform after.
  40767. Due to wavelet properties, it should give a nice smoothed result, and
  40768. reduced noise, without blurring picture features.
  40769. </p>
  40770. <p>This filter accepts the following options:
  40771. </p>
  40772. <dl compact="compact">
  40773. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  40774. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  40775. Hard thresholding can use a higher threshold than soft thresholding
  40776. before the video looks overfiltered. Default value is 2.
  40777. </p>
  40778. </dd>
  40779. <dt>&lsquo;<samp>method</samp>&rsquo;</dt>
  40780. <dd><p>The filtering method the filter will use.
  40781. </p>
  40782. <p>It accepts the following values:
  40783. </p><dl compact="compact">
  40784. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  40785. <dd><p>All values under the threshold will be zeroed.
  40786. </p>
  40787. </dd>
  40788. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  40789. <dd><p>All values under the threshold will be zeroed. All values above will be
  40790. reduced by the threshold.
  40791. </p>
  40792. </dd>
  40793. <dt>&lsquo;<samp>garrote</samp>&rsquo;</dt>
  40794. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  40795. (less) hard thresholding.
  40796. </p></dd>
  40797. </dl>
  40798. <p>Default is garrote.
  40799. </p>
  40800. </dd>
  40801. <dt>&lsquo;<samp>nsteps</samp>&rsquo;</dt>
  40802. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  40803. be decomposed beyond a particular point (typically, 8 for a 640x480
  40804. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  40805. </p>
  40806. </dd>
  40807. <dt>&lsquo;<samp>percent</samp>&rsquo;</dt>
  40808. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  40809. </p>
  40810. </dd>
  40811. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  40812. <dd><p>A list of the planes to process. By default all planes are processed.
  40813. </p></dd>
  40814. </dl>
  40815. <a name="vectorscope"></a>
  40816. <h2 class="section"><a href="ffmpeg-all.html#toc-vectorscope">39.218 vectorscope</a></h2>
  40817. <p>Display 2 color component values in the two dimensional graph (which is called
  40818. a vectorscope).
  40819. </p>
  40820. <p>This filter accepts the following options:
  40821. </p>
  40822. <dl compact="compact">
  40823. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  40824. <dd><p>Set vectorscope mode.
  40825. </p>
  40826. <p>It accepts the following values:
  40827. </p><dl compact="compact">
  40828. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  40829. <dt>&lsquo;<samp>tint</samp>&rsquo;</dt>
  40830. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  40831. same component color value on location in graph. This is the default mode.
  40832. </p>
  40833. </dd>
  40834. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  40835. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  40836. present in video frame are drawn in gradient of 2 color components which are
  40837. set by option <code>x</code> and <code>y</code>. The 3rd color component is static.
  40838. </p>
  40839. </dd>
  40840. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  40841. <dd><p>Actual color components values present in video frame are displayed on graph.
  40842. </p>
  40843. </dd>
  40844. <dt>&lsquo;<samp>color3</samp>&rsquo;</dt>
  40845. <dd><p>Similar as color2 but higher frequency of same values <code>x</code> and <code>y</code>
  40846. on graph increases value of another color component, which is luminance by
  40847. default values of <code>x</code> and <code>y</code>.
  40848. </p>
  40849. </dd>
  40850. <dt>&lsquo;<samp>color4</samp>&rsquo;</dt>
  40851. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  40852. colors map to same position on graph then color with higher value of component
  40853. not present in graph is picked.
  40854. </p>
  40855. </dd>
  40856. <dt>&lsquo;<samp>color5</samp>&rsquo;</dt>
  40857. <dd><p>Gray values are displayed on graph. Similar to <code>color</code> but with 3rd color
  40858. component picked from radial gradient.
  40859. </p></dd>
  40860. </dl>
  40861. </dd>
  40862. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  40863. <dd><p>Set which color component will be represented on X-axis. Default is <code>1</code>.
  40864. </p>
  40865. </dd>
  40866. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  40867. <dd><p>Set which color component will be represented on Y-axis. Default is <code>2</code>.
  40868. </p>
  40869. </dd>
  40870. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  40871. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  40872. of color component which represents frequency of (X, Y) location in graph.
  40873. </p>
  40874. </dd>
  40875. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  40876. <dd><dl compact="compact">
  40877. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40878. <dd><p>No envelope, this is default.
  40879. </p>
  40880. </dd>
  40881. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  40882. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  40883. </p>
  40884. </dd>
  40885. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  40886. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  40887. can still spot out of range values without constantly looking at vectorscope.
  40888. </p>
  40889. </dd>
  40890. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  40891. <dd><p>Peak and instant envelope combined together.
  40892. </p></dd>
  40893. </dl>
  40894. </dd>
  40895. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  40896. <dd><p>Set what kind of graticule to draw.
  40897. </p><dl compact="compact">
  40898. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  40899. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  40900. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  40901. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  40902. </dl>
  40903. </dd>
  40904. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  40905. <dd><p>Set graticule opacity.
  40906. </p>
  40907. </dd>
  40908. <dt>&lsquo;<samp>flags, f</samp>&rsquo;</dt>
  40909. <dd><p>Set graticule flags.
  40910. </p>
  40911. <dl compact="compact">
  40912. <dt>&lsquo;<samp>white</samp>&rsquo;</dt>
  40913. <dd><p>Draw graticule for white point.
  40914. </p>
  40915. </dd>
  40916. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  40917. <dd><p>Draw graticule for black point.
  40918. </p>
  40919. </dd>
  40920. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  40921. <dd><p>Draw color points short names.
  40922. </p></dd>
  40923. </dl>
  40924. </dd>
  40925. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  40926. <dd><p>Set background opacity.
  40927. </p>
  40928. </dd>
  40929. <dt>&lsquo;<samp>lthreshold, l</samp>&rsquo;</dt>
  40930. <dd><p>Set low threshold for color component not represented on X or Y axis.
  40931. Values lower than this value will be ignored. Default is 0.
  40932. Note this value is multiplied with actual max possible value one pixel component
  40933. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  40934. is 0.1 * 255 = 25.
  40935. </p>
  40936. </dd>
  40937. <dt>&lsquo;<samp>hthreshold, h</samp>&rsquo;</dt>
  40938. <dd><p>Set high threshold for color component not represented on X or Y axis.
  40939. Values higher than this value will be ignored. Default is 1.
  40940. Note this value is multiplied with actual max possible value one pixel component
  40941. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  40942. is 0.9 * 255 = 230.
  40943. </p>
  40944. </dd>
  40945. <dt>&lsquo;<samp>colorspace, c</samp>&rsquo;</dt>
  40946. <dd><p>Set what kind of colorspace to use when drawing graticule.
  40947. </p><dl compact="compact">
  40948. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  40949. <dt>&lsquo;<samp>601</samp>&rsquo;</dt>
  40950. <dt>&lsquo;<samp>709</samp>&rsquo;</dt>
  40951. </dl>
  40952. <p>Default is auto.
  40953. </p>
  40954. </dd>
  40955. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  40956. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  40957. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  40958. This means no tint, and output will remain gray.
  40959. </p></dd>
  40960. </dl>
  40961. <p><a name="vidstabdetect"></a>
  40962. </p><a name="vidstabdetect-1"></a>
  40963. <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabdetect-1">39.219 vidstabdetect</a></h2>
  40964. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  40965. <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
  40966. </p>
  40967. <p>This filter generates a file with relative translation and rotation
  40968. transform information about subsequent frames, which is then used by
  40969. the <a href="#vidstabtransform">vidstabtransform</a> filter.
  40970. </p>
  40971. <p>To enable compilation of this filter you need to configure FFmpeg with
  40972. <code>--enable-libvidstab</code>.
  40973. </p>
  40974. <p>This filter accepts the following options:
  40975. </p>
  40976. <dl compact="compact">
  40977. <dt>&lsquo;<samp>result</samp>&rsquo;</dt>
  40978. <dd><p>Set the path to the file used to write the transforms information.
  40979. Default value is &lsquo;<tt>transforms.trf</tt>&rsquo;.
  40980. </p>
  40981. </dd>
  40982. <dt>&lsquo;<samp>shakiness</samp>&rsquo;</dt>
  40983. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  40984. integer in the range 1-10, a value of 1 means little shakiness, a
  40985. value of 10 means strong shakiness. Default value is 5.
  40986. </p>
  40987. </dd>
  40988. <dt>&lsquo;<samp>accuracy</samp>&rsquo;</dt>
  40989. <dd><p>Set the accuracy of the detection process. It must be a value in the
  40990. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  40991. accuracy. Default value is 15.
  40992. </p>
  40993. </dd>
  40994. <dt>&lsquo;<samp>stepsize</samp>&rsquo;</dt>
  40995. <dd><p>Set stepsize of the search process. The region around minimum is
  40996. scanned with 1 pixel resolution. Default value is 6.
  40997. </p>
  40998. </dd>
  40999. <dt>&lsquo;<samp>mincontrast</samp>&rsquo;</dt>
  41000. <dd><p>Set minimum contrast. Below this value a local measurement field is
  41001. discarded. Must be a floating point value in the range 0-1. Default
  41002. value is 0.3.
  41003. </p>
  41004. </dd>
  41005. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  41006. <dd><p>Set reference frame number for tripod mode.
  41007. </p>
  41008. <p>If enabled, the motion of the frames is compared to a reference frame
  41009. in the filtered stream, identified by the specified number. The idea
  41010. is to compensate all movements in a more-or-less static scene and keep
  41011. the camera view absolutely still.
  41012. </p>
  41013. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  41014. </p>
  41015. </dd>
  41016. <dt>&lsquo;<samp>show</samp>&rsquo;</dt>
  41017. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  41018. integer in the range 0-2. Default value is 0, which disables any
  41019. visualization.
  41020. </p></dd>
  41021. </dl>
  41022. <a name="Examples-130"></a>
  41023. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-130">39.219.1 Examples</a></h3>
  41024. <ul>
  41025. <li>
  41026. Use default values:
  41027. <div class="example">
  41028. <pre class="example">vidstabdetect
  41029. </pre></div>
  41030. </li><li>
  41031. Analyze strongly shaky movie and put the results in file
  41032. &lsquo;<tt>mytransforms.trf</tt>&rsquo;:
  41033. <div class="example">
  41034. <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  41035. </pre></div>
  41036. </li><li>
  41037. Visualize the result of internal transformations in the resulting
  41038. video:
  41039. <div class="example">
  41040. <pre class="example">vidstabdetect=show=1
  41041. </pre></div>
  41042. </li><li>
  41043. Analyze a video with medium shakiness using <code>ffmpeg</code>:
  41044. <div class="example">
  41045. <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  41046. </pre></div>
  41047. </li></ul>
  41048. <p><a name="vidstabtransform"></a>
  41049. </p><a name="vidstabtransform-1"></a>
  41050. <h2 class="section"><a href="ffmpeg-all.html#toc-vidstabtransform-1">39.220 vidstabtransform</a></h2>
  41051. <p>Video stabilization/deshaking: pass 2 of 2,
  41052. see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
  41053. </p>
  41054. <p>Read a file with transform information for each frame and
  41055. apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
  41056. filter this can be used to deshake videos. See also
  41057. <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  41058. the <a href="#unsharp">unsharp</a> filter, see below.
  41059. </p>
  41060. <p>To enable compilation of this filter you need to configure FFmpeg with
  41061. <code>--enable-libvidstab</code>.
  41062. </p>
  41063. <a name="Options"></a>
  41064. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options">39.220.1 Options</a></h3>
  41065. <dl compact="compact">
  41066. <dt>&lsquo;<samp>input</samp>&rsquo;</dt>
  41067. <dd><p>Set path to the file used to read the transforms. Default value is
  41068. &lsquo;<tt>transforms.trf</tt>&rsquo;.
  41069. </p>
  41070. </dd>
  41071. <dt>&lsquo;<samp>smoothing</samp>&rsquo;</dt>
  41072. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  41073. camera movements. Default value is 10.
  41074. </p>
  41075. <p>For example a number of 10 means that 21 frames are used (10 in the
  41076. past and 10 in the future) to smoothen the motion in the video. A
  41077. larger value leads to a smoother video, but limits the acceleration of
  41078. the camera (pan/tilt movements). 0 is a special case where a static
  41079. camera is simulated.
  41080. </p>
  41081. </dd>
  41082. <dt>&lsquo;<samp>optalgo</samp>&rsquo;</dt>
  41083. <dd><p>Set the camera path optimization algorithm.
  41084. </p>
  41085. <p>Accepted values are:
  41086. </p><dl compact="compact">
  41087. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  41088. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  41089. </p></dd>
  41090. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  41091. <dd><p>averaging on transformations
  41092. </p></dd>
  41093. </dl>
  41094. </dd>
  41095. <dt>&lsquo;<samp>maxshift</samp>&rsquo;</dt>
  41096. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  41097. meaning no limit.
  41098. </p>
  41099. </dd>
  41100. <dt>&lsquo;<samp>maxangle</samp>&rsquo;</dt>
  41101. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  41102. value is -1, meaning no limit.
  41103. </p>
  41104. </dd>
  41105. <dt>&lsquo;<samp>crop</samp>&rsquo;</dt>
  41106. <dd><p>Specify how to deal with borders that may be visible due to movement
  41107. compensation.
  41108. </p>
  41109. <p>Available values are:
  41110. </p><dl compact="compact">
  41111. <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
  41112. <dd><p>keep image information from previous frame (default)
  41113. </p></dd>
  41114. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  41115. <dd><p>fill the border black
  41116. </p></dd>
  41117. </dl>
  41118. </dd>
  41119. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  41120. <dd><p>Invert transforms if set to 1. Default value is 0.
  41121. </p>
  41122. </dd>
  41123. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  41124. <dd><p>Consider transforms as relative to previous frame if set to 1,
  41125. absolute if set to 0. Default value is 0.
  41126. </p>
  41127. </dd>
  41128. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  41129. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  41130. effect, a negative value in a zoom-out effect. Default value is 0 (no
  41131. zoom).
  41132. </p>
  41133. </dd>
  41134. <dt>&lsquo;<samp>optzoom</samp>&rsquo;</dt>
  41135. <dd><p>Set optimal zooming to avoid borders.
  41136. </p>
  41137. <p>Accepted values are:
  41138. </p><dl compact="compact">
  41139. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  41140. <dd><p>disabled
  41141. </p></dd>
  41142. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  41143. <dd><p>optimal static zoom value is determined (only very strong movements
  41144. will lead to visible borders) (default)
  41145. </p></dd>
  41146. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  41147. <dd><p>optimal adaptive zoom value is determined (no borders will be
  41148. visible), see &lsquo;<samp>zoomspeed</samp>&rsquo;
  41149. </p></dd>
  41150. </dl>
  41151. <p>Note that the value given at zoom is added to the one calculated here.
  41152. </p>
  41153. </dd>
  41154. <dt>&lsquo;<samp>zoomspeed</samp>&rsquo;</dt>
  41155. <dd><p>Set percent to zoom maximally each frame (enabled when
  41156. &lsquo;<samp>optzoom</samp>&rsquo; is set to 2). Range is from 0 to 5, default value is
  41157. 0.25.
  41158. </p>
  41159. </dd>
  41160. <dt>&lsquo;<samp>interpol</samp>&rsquo;</dt>
  41161. <dd><p>Specify type of interpolation.
  41162. </p>
  41163. <p>Available values are:
  41164. </p><dl compact="compact">
  41165. <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
  41166. <dd><p>no interpolation
  41167. </p></dd>
  41168. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  41169. <dd><p>linear only horizontal
  41170. </p></dd>
  41171. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  41172. <dd><p>linear in both directions (default)
  41173. </p></dd>
  41174. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  41175. <dd><p>cubic in both directions (slow)
  41176. </p></dd>
  41177. </dl>
  41178. </dd>
  41179. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  41180. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  41181. <code>relative=0:smoothing=0</code>. Default value is 0.
  41182. </p>
  41183. <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
  41184. </p>
  41185. </dd>
  41186. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  41187. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  41188. are written to the temporary file &lsquo;<tt>global_motions.trf</tt>&rsquo;. Default
  41189. value is 0.
  41190. </p></dd>
  41191. </dl>
  41192. <a name="Examples-135"></a>
  41193. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-135">39.220.2 Examples</a></h3>
  41194. <ul>
  41195. <li>
  41196. Use <code>ffmpeg</code> for a typical stabilization with default values:
  41197. <div class="example">
  41198. <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  41199. </pre></div>
  41200. <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
  41201. </p>
  41202. </li><li>
  41203. Zoom in a bit more and load transform data from a given file:
  41204. <div class="example">
  41205. <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  41206. </pre></div>
  41207. </li><li>
  41208. Smoothen the video even more:
  41209. <div class="example">
  41210. <pre class="example">vidstabtransform=smoothing=30
  41211. </pre></div>
  41212. </li></ul>
  41213. <a name="vflip"></a>
  41214. <h2 class="section"><a href="ffmpeg-all.html#toc-vflip">39.221 vflip</a></h2>
  41215. <p>Flip the input video vertically.
  41216. </p>
  41217. <p>For example, to vertically flip a video with <code>ffmpeg</code>:
  41218. </p><div class="example">
  41219. <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  41220. </pre></div>
  41221. <a name="vfrdet"></a>
  41222. <h2 class="section"><a href="ffmpeg-all.html#toc-vfrdet">39.222 vfrdet</a></h2>
  41223. <p>Detect variable frame rate video.
  41224. </p>
  41225. <p>This filter tries to detect if the input is variable or constant frame rate.
  41226. </p>
  41227. <p>At end it will output number of frames detected as having variable delta pts,
  41228. and ones with constant delta pts.
  41229. If there was frames with variable delta, than it will also show min, max and
  41230. average delta encountered.
  41231. </p>
  41232. <a name="vibrance"></a>
  41233. <h2 class="section"><a href="ffmpeg-all.html#toc-vibrance">39.223 vibrance</a></h2>
  41234. <p>Boost or alter saturation.
  41235. </p>
  41236. <p>The filter accepts the following options:
  41237. </p><dl compact="compact">
  41238. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  41239. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  41240. Default is 0. Allowed range is from -2 to 2.
  41241. </p>
  41242. </dd>
  41243. <dt>&lsquo;<samp>rbal</samp>&rsquo;</dt>
  41244. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  41245. </p>
  41246. </dd>
  41247. <dt>&lsquo;<samp>gbal</samp>&rsquo;</dt>
  41248. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  41249. </p>
  41250. </dd>
  41251. <dt>&lsquo;<samp>bbal</samp>&rsquo;</dt>
  41252. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  41253. </p>
  41254. </dd>
  41255. <dt>&lsquo;<samp>rlum</samp>&rsquo;</dt>
  41256. <dd><p>Set the red luma coefficient.
  41257. </p>
  41258. </dd>
  41259. <dt>&lsquo;<samp>glum</samp>&rsquo;</dt>
  41260. <dd><p>Set the green luma coefficient.
  41261. </p>
  41262. </dd>
  41263. <dt>&lsquo;<samp>blum</samp>&rsquo;</dt>
  41264. <dd><p>Set the blue luma coefficient.
  41265. </p>
  41266. </dd>
  41267. <dt>&lsquo;<samp>alternate</samp>&rsquo;</dt>
  41268. <dd><p>If <code>intensity</code> is negative and this is set to 1, colors will change,
  41269. otherwise colors will be less saturated, more towards gray.
  41270. </p></dd>
  41271. </dl>
  41272. <a name="Commands-4"></a>
  41273. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-4">39.223.1 Commands</a></h3>
  41274. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  41275. </p>
  41276. <p><a name="vignette"></a>
  41277. </p><a name="vignette-1"></a>
  41278. <h2 class="section"><a href="ffmpeg-all.html#toc-vignette-1">39.224 vignette</a></h2>
  41279. <p>Make or reverse a natural vignetting effect.
  41280. </p>
  41281. <p>The filter accepts the following options:
  41282. </p>
  41283. <dl compact="compact">
  41284. <dt>&lsquo;<samp>angle, a</samp>&rsquo;</dt>
  41285. <dd><p>Set lens angle expression as a number of radians.
  41286. </p>
  41287. <p>The value is clipped in the <code>[0,PI/2]</code> range.
  41288. </p>
  41289. <p>Default value: <code>&quot;PI/5&quot;</code>
  41290. </p>
  41291. </dd>
  41292. <dt>&lsquo;<samp>x0</samp>&rsquo;</dt>
  41293. <dt>&lsquo;<samp>y0</samp>&rsquo;</dt>
  41294. <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
  41295. by default.
  41296. </p>
  41297. </dd>
  41298. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  41299. <dd><p>Set forward/backward mode.
  41300. </p>
  41301. <p>Available modes are:
  41302. </p><dl compact="compact">
  41303. <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
  41304. <dd><p>The larger the distance from the central point, the darker the image becomes.
  41305. </p>
  41306. </dd>
  41307. <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
  41308. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  41309. This can be used to reverse a vignette effect, though there is no automatic
  41310. detection to extract the lens &lsquo;<samp>angle</samp>&rsquo; and other settings (yet). It can
  41311. also be used to create a burning effect.
  41312. </p></dd>
  41313. </dl>
  41314. <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
  41315. </p>
  41316. </dd>
  41317. <dt>&lsquo;<samp>eval</samp>&rsquo;</dt>
  41318. <dd><p>Set evaluation mode for the expressions (&lsquo;<samp>angle</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo;, &lsquo;<samp>y0</samp>&rsquo;).
  41319. </p>
  41320. <p>It accepts the following values:
  41321. </p><dl compact="compact">
  41322. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  41323. <dd><p>Evaluate expressions only once during the filter initialization.
  41324. </p>
  41325. </dd>
  41326. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  41327. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  41328. &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  41329. allows advanced dynamic expressions.
  41330. </p></dd>
  41331. </dl>
  41332. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  41333. </p>
  41334. </dd>
  41335. <dt>&lsquo;<samp>dither</samp>&rsquo;</dt>
  41336. <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
  41337. (enabled).
  41338. </p>
  41339. </dd>
  41340. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  41341. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  41342. Setting this value to the SAR of the input will make a rectangular vignetting
  41343. following the dimensions of the video.
  41344. </p>
  41345. <p>Default is <code>1/1</code>.
  41346. </p></dd>
  41347. </dl>
  41348. <a name="Expressions"></a>
  41349. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Expressions">39.224.1 Expressions</a></h3>
  41350. <p>The &lsquo;<samp>alpha</samp>&rsquo;, &lsquo;<samp>x0</samp>&rsquo; and &lsquo;<samp>y0</samp>&rsquo; expressions can contain the
  41351. following parameters.
  41352. </p>
  41353. <dl compact="compact">
  41354. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  41355. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  41356. <dd><p>input width and height
  41357. </p>
  41358. </dd>
  41359. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  41360. <dd><p>the number of input frame, starting from 0
  41361. </p>
  41362. </dd>
  41363. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  41364. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  41365. <var>TB</var> units, NAN if undefined
  41366. </p>
  41367. </dd>
  41368. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  41369. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  41370. </p>
  41371. </dd>
  41372. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  41373. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  41374. expressed in seconds, NAN if undefined
  41375. </p>
  41376. </dd>
  41377. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  41378. <dd><p>time base of the input video
  41379. </p></dd>
  41380. </dl>
  41381. <a name="Examples-57"></a>
  41382. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-57">39.224.2 Examples</a></h3>
  41383. <ul>
  41384. <li>
  41385. Apply simple strong vignetting effect:
  41386. <div class="example">
  41387. <pre class="example">vignette=PI/4
  41388. </pre></div>
  41389. </li><li>
  41390. Make a flickering vignetting:
  41391. <div class="example">
  41392. <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
  41393. </pre></div>
  41394. </li></ul>
  41395. <a name="vmafmotion"></a>
  41396. <h2 class="section"><a href="ffmpeg-all.html#toc-vmafmotion">39.225 vmafmotion</a></h2>
  41397. <p>Obtain the average VMAF motion score of a video.
  41398. It is one of the component metrics of VMAF.
  41399. </p>
  41400. <p>The obtained average motion score is printed through the logging system.
  41401. </p>
  41402. <p>The filter accepts the following options:
  41403. </p>
  41404. <dl compact="compact">
  41405. <dt>&lsquo;<samp>stats_file</samp>&rsquo;</dt>
  41406. <dd><p>If specified, the filter will use the named file to save the motion score of
  41407. each frame with respect to the previous frame.
  41408. When filename equals &quot;-&quot; the data is sent to standard output.
  41409. </p></dd>
  41410. </dl>
  41411. <p>Example:
  41412. </p><div class="example">
  41413. <pre class="example">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  41414. </pre></div>
  41415. <a name="vstack"></a>
  41416. <h2 class="section"><a href="ffmpeg-all.html#toc-vstack">39.226 vstack</a></h2>
  41417. <p>Stack input videos vertically.
  41418. </p>
  41419. <p>All streams must be of same pixel format and of same width.
  41420. </p>
  41421. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  41422. to create same output.
  41423. </p>
  41424. <p>The filter accepts the following options:
  41425. </p>
  41426. <dl compact="compact">
  41427. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  41428. <dd><p>Set number of input streams. Default is 2.
  41429. </p>
  41430. </dd>
  41431. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  41432. <dd><p>If set to 1, force the output to terminate when the shortest input
  41433. terminates. Default value is 0.
  41434. </p></dd>
  41435. </dl>
  41436. <a name="w3fdif"></a>
  41437. <h2 class="section"><a href="ffmpeg-all.html#toc-w3fdif">39.227 w3fdif</a></h2>
  41438. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  41439. Deinterlacing Filter&quot;).
  41440. </p>
  41441. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  41442. implemented based on the de-interlace algorithm written by Jim
  41443. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  41444. uses filter coefficients calculated by BBC R&amp;D.
  41445. </p>
  41446. <p>This filter uses field-dominance information in frame to decide which
  41447. of each pair of fields to place first in the output.
  41448. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>w3fdif</code> filter.
  41449. </p>
  41450. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  41451. and &quot;complex&quot;. Which set of filter coefficients is used can
  41452. be set by passing an optional parameter:
  41453. </p>
  41454. <dl compact="compact">
  41455. <dt>&lsquo;<samp>filter</samp>&rsquo;</dt>
  41456. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  41457. </p>
  41458. <dl compact="compact">
  41459. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  41460. <dd><p>Simple filter coefficient set.
  41461. </p></dd>
  41462. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  41463. <dd><p>More-complex filter coefficient set.
  41464. </p></dd>
  41465. </dl>
  41466. <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
  41467. </p>
  41468. </dd>
  41469. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  41470. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  41471. </p>
  41472. <dl compact="compact">
  41473. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  41474. <dd><p>Deinterlace all frames,
  41475. </p></dd>
  41476. <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
  41477. <dd><p>Only deinterlace frames marked as interlaced.
  41478. </p></dd>
  41479. </dl>
  41480. <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
  41481. </p></dd>
  41482. </dl>
  41483. <a name="waveform"></a>
  41484. <h2 class="section"><a href="ffmpeg-all.html#toc-waveform">39.228 waveform</a></h2>
  41485. <p>Video waveform monitor.
  41486. </p>
  41487. <p>The waveform monitor plots color component intensity. By default luminance
  41488. only. Each column of the waveform corresponds to a column of pixels in the
  41489. source video.
  41490. </p>
  41491. <p>It accepts the following options:
  41492. </p>
  41493. <dl compact="compact">
  41494. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  41495. <dd><p>Can be either <code>row</code>, or <code>column</code>. Default is <code>column</code>.
  41496. In row mode, the graph on the left side represents color component value 0 and
  41497. the right side represents value = 255. In column mode, the top side represents
  41498. color component value = 0 and bottom side represents value = 255.
  41499. </p>
  41500. </dd>
  41501. <dt>&lsquo;<samp>intensity, i</samp>&rsquo;</dt>
  41502. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  41503. luminance are distributed across input rows/columns.
  41504. Default value is <code>0.04</code>. Allowed range is [0, 1].
  41505. </p>
  41506. </dd>
  41507. <dt>&lsquo;<samp>mirror, r</samp>&rsquo;</dt>
  41508. <dd><p>Set mirroring mode. <code>0</code> means unmirrored, <code>1</code> means mirrored.
  41509. In mirrored mode, higher values will be represented on the left
  41510. side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
  41511. <code>1</code> (mirrored).
  41512. </p>
  41513. </dd>
  41514. <dt>&lsquo;<samp>display, d</samp>&rsquo;</dt>
  41515. <dd><p>Set display mode.
  41516. It accepts the following values:
  41517. </p><dl compact="compact">
  41518. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  41519. <dd><p>Presents information identical to that in the <code>parade</code>, except
  41520. that the graphs representing color components are superimposed directly
  41521. over one another.
  41522. </p>
  41523. <p>This display mode makes it easier to spot relative differences or similarities
  41524. in overlapping areas of the color components that are supposed to be identical,
  41525. such as neutral whites, grays, or blacks.
  41526. </p>
  41527. </dd>
  41528. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  41529. <dd><p>Display separate graph for the color components side by side in
  41530. <code>row</code> mode or one below the other in <code>column</code> mode.
  41531. </p>
  41532. </dd>
  41533. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  41534. <dd><p>Display separate graph for the color components side by side in
  41535. <code>column</code> mode or one below the other in <code>row</code> mode.
  41536. </p>
  41537. <p>Using this display mode makes it easy to spot color casts in the highlights
  41538. and shadows of an image, by comparing the contours of the top and the bottom
  41539. graphs of each waveform. Since whites, grays, and blacks are characterized
  41540. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  41541. should display three waveforms of roughly equal width/height. If not, the
  41542. correction is easy to perform by making level adjustments the three waveforms.
  41543. </p></dd>
  41544. </dl>
  41545. <p>Default is <code>stack</code>.
  41546. </p>
  41547. </dd>
  41548. <dt>&lsquo;<samp>components, c</samp>&rsquo;</dt>
  41549. <dd><p>Set which color components to display. Default is 1, which means only luminance
  41550. or red color component if input is in RGB colorspace. If is set for example to
  41551. 7 it will display all 3 (if) available color components.
  41552. </p>
  41553. </dd>
  41554. <dt>&lsquo;<samp>envelope, e</samp>&rsquo;</dt>
  41555. <dd><dl compact="compact">
  41556. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  41557. <dd><p>No envelope, this is default.
  41558. </p>
  41559. </dd>
  41560. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  41561. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  41562. visible even with small <code>step</code> value.
  41563. </p>
  41564. </dd>
  41565. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  41566. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  41567. can still spot out of range values without constantly looking at waveforms.
  41568. </p>
  41569. </dd>
  41570. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  41571. <dd><p>Peak and instant envelope combined together.
  41572. </p></dd>
  41573. </dl>
  41574. </dd>
  41575. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  41576. <dd><dl compact="compact">
  41577. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  41578. <dd><p>No filtering, this is default.
  41579. </p>
  41580. </dd>
  41581. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  41582. <dd><p>Luma and chroma combined together.
  41583. </p>
  41584. </dd>
  41585. <dt>&lsquo;<samp>aflat</samp>&rsquo;</dt>
  41586. <dd><p>Similar as above, but shows difference between blue and red chroma.
  41587. </p>
  41588. </dd>
  41589. <dt>&lsquo;<samp>xflat</samp>&rsquo;</dt>
  41590. <dd><p>Similar as above, but use different colors.
  41591. </p>
  41592. </dd>
  41593. <dt>&lsquo;<samp>yflat</samp>&rsquo;</dt>
  41594. <dd><p>Similar as above, but again with different colors.
  41595. </p>
  41596. </dd>
  41597. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  41598. <dd><p>Displays only chroma.
  41599. </p>
  41600. </dd>
  41601. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  41602. <dd><p>Displays actual color value on waveform.
  41603. </p>
  41604. </dd>
  41605. <dt>&lsquo;<samp>acolor</samp>&rsquo;</dt>
  41606. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  41607. </p></dd>
  41608. </dl>
  41609. </dd>
  41610. <dt>&lsquo;<samp>graticule, g</samp>&rsquo;</dt>
  41611. <dd><p>Set which graticule to display.
  41612. </p>
  41613. <dl compact="compact">
  41614. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  41615. <dd><p>Do not display graticule.
  41616. </p>
  41617. </dd>
  41618. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  41619. <dd><p>Display green graticule showing legal broadcast ranges.
  41620. </p>
  41621. </dd>
  41622. <dt>&lsquo;<samp>orange</samp>&rsquo;</dt>
  41623. <dd><p>Display orange graticule showing legal broadcast ranges.
  41624. </p>
  41625. </dd>
  41626. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  41627. <dd><p>Display invert graticule showing legal broadcast ranges.
  41628. </p></dd>
  41629. </dl>
  41630. </dd>
  41631. <dt>&lsquo;<samp>opacity, o</samp>&rsquo;</dt>
  41632. <dd><p>Set graticule opacity.
  41633. </p>
  41634. </dd>
  41635. <dt>&lsquo;<samp>flags, fl</samp>&rsquo;</dt>
  41636. <dd><p>Set graticule flags.
  41637. </p>
  41638. <dl compact="compact">
  41639. <dt>&lsquo;<samp>numbers</samp>&rsquo;</dt>
  41640. <dd><p>Draw numbers above lines. By default enabled.
  41641. </p>
  41642. </dd>
  41643. <dt>&lsquo;<samp>dots</samp>&rsquo;</dt>
  41644. <dd><p>Draw dots instead of lines.
  41645. </p></dd>
  41646. </dl>
  41647. </dd>
  41648. <dt>&lsquo;<samp>scale, s</samp>&rsquo;</dt>
  41649. <dd><p>Set scale used for displaying graticule.
  41650. </p>
  41651. <dl compact="compact">
  41652. <dt>&lsquo;<samp>digital</samp>&rsquo;</dt>
  41653. <dt>&lsquo;<samp>millivolts</samp>&rsquo;</dt>
  41654. <dt>&lsquo;<samp>ire</samp>&rsquo;</dt>
  41655. </dl>
  41656. <p>Default is digital.
  41657. </p>
  41658. </dd>
  41659. <dt>&lsquo;<samp>bgopacity, b</samp>&rsquo;</dt>
  41660. <dd><p>Set background opacity.
  41661. </p>
  41662. </dd>
  41663. <dt>&lsquo;<samp>tint0, t0</samp>&rsquo;</dt>
  41664. <dt>&lsquo;<samp>tint1, t1</samp>&rsquo;</dt>
  41665. <dd><p>Set tint for output.
  41666. Only used with lowpass filter and when display is not overlay and input
  41667. pixel formats are not RGB.
  41668. </p></dd>
  41669. </dl>
  41670. <a name="weave_002c-doubleweave"></a>
  41671. <h2 class="section"><a href="ffmpeg-all.html#toc-weave_002c-doubleweave">39.229 weave, doubleweave</a></h2>
  41672. <p>The <code>weave</code> takes a field-based video input and join
  41673. each two sequential fields into single frame, producing a new double
  41674. height clip with half the frame rate and half the frame count.
  41675. </p>
  41676. <p>The <code>doubleweave</code> works same as <code>weave</code> but without
  41677. halving frame rate and frame count.
  41678. </p>
  41679. <p>It accepts the following option:
  41680. </p>
  41681. <dl compact="compact">
  41682. <dt>&lsquo;<samp>first_field</samp>&rsquo;</dt>
  41683. <dd><p>Set first field. Available values are:
  41684. </p>
  41685. <dl compact="compact">
  41686. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  41687. <dd><p>Set the frame as top-field-first.
  41688. </p>
  41689. </dd>
  41690. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  41691. <dd><p>Set the frame as bottom-field-first.
  41692. </p></dd>
  41693. </dl>
  41694. </dd>
  41695. </dl>
  41696. <a name="Examples-60"></a>
  41697. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-60">39.229.1 Examples</a></h3>
  41698. <ul>
  41699. <li>
  41700. Interlace video using <a href="#select">select</a> and <a href="#separatefields">separatefields</a> filter:
  41701. <div class="example">
  41702. <pre class="example">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  41703. </pre></div>
  41704. </li></ul>
  41705. <a name="xbr"></a>
  41706. <h2 class="section"><a href="ffmpeg-all.html#toc-xbr">39.230 xbr</a></h2>
  41707. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  41708. art. It follows a set of edge-detection rules, see
  41709. <a href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  41710. </p>
  41711. <p>It accepts the following option:
  41712. </p>
  41713. <dl compact="compact">
  41714. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  41715. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
  41716. <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
  41717. Default is <code>3</code>.
  41718. </p></dd>
  41719. </dl>
  41720. <a name="xfade"></a>
  41721. <h2 class="section"><a href="ffmpeg-all.html#toc-xfade">39.231 xfade</a></h2>
  41722. <p>Apply cross fade from one input video stream to another input video stream.
  41723. The cross fade is applied for specified duration.
  41724. </p>
  41725. <p>The filter accepts the following options:
  41726. </p>
  41727. <dl compact="compact">
  41728. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  41729. <dd><p>Set one of available transition effects:
  41730. </p>
  41731. <dl compact="compact">
  41732. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  41733. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  41734. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  41735. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  41736. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  41737. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  41738. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  41739. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  41740. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  41741. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  41742. <dt>&lsquo;<samp>circlecrop</samp>&rsquo;</dt>
  41743. <dt>&lsquo;<samp>rectcrop</samp>&rsquo;</dt>
  41744. <dt>&lsquo;<samp>distance</samp>&rsquo;</dt>
  41745. <dt>&lsquo;<samp>fadeblack</samp>&rsquo;</dt>
  41746. <dt>&lsquo;<samp>fadewhite</samp>&rsquo;</dt>
  41747. <dt>&lsquo;<samp>radial</samp>&rsquo;</dt>
  41748. <dt>&lsquo;<samp>smoothleft</samp>&rsquo;</dt>
  41749. <dt>&lsquo;<samp>smoothright</samp>&rsquo;</dt>
  41750. <dt>&lsquo;<samp>smoothup</samp>&rsquo;</dt>
  41751. <dt>&lsquo;<samp>smoothdown</samp>&rsquo;</dt>
  41752. <dt>&lsquo;<samp>circleopen</samp>&rsquo;</dt>
  41753. <dt>&lsquo;<samp>circleclose</samp>&rsquo;</dt>
  41754. <dt>&lsquo;<samp>vertopen</samp>&rsquo;</dt>
  41755. <dt>&lsquo;<samp>vertclose</samp>&rsquo;</dt>
  41756. <dt>&lsquo;<samp>horzopen</samp>&rsquo;</dt>
  41757. <dt>&lsquo;<samp>horzclose</samp>&rsquo;</dt>
  41758. <dt>&lsquo;<samp>dissolve</samp>&rsquo;</dt>
  41759. <dt>&lsquo;<samp>pixelize</samp>&rsquo;</dt>
  41760. <dt>&lsquo;<samp>diagtl</samp>&rsquo;</dt>
  41761. <dt>&lsquo;<samp>diagtr</samp>&rsquo;</dt>
  41762. <dt>&lsquo;<samp>diagbl</samp>&rsquo;</dt>
  41763. <dt>&lsquo;<samp>diagbr</samp>&rsquo;</dt>
  41764. </dl>
  41765. <p>Default transition effect is fade.
  41766. </p>
  41767. </dd>
  41768. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  41769. <dd><p>Set cross fade duration in seconds.
  41770. Default duration is 1 second.
  41771. </p>
  41772. </dd>
  41773. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  41774. <dd><p>Set cross fade start relative to first input stream in seconds.
  41775. Default offset is 0.
  41776. </p>
  41777. </dd>
  41778. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  41779. <dd><p>Set expression for custom transition effect.
  41780. </p>
  41781. <p>The expressions can use the following variables and functions:
  41782. </p>
  41783. <dl compact="compact">
  41784. <dt>&lsquo;<samp>X</samp>&rsquo;</dt>
  41785. <dt>&lsquo;<samp>Y</samp>&rsquo;</dt>
  41786. <dd><p>The coordinates of the current sample.
  41787. </p>
  41788. </dd>
  41789. <dt>&lsquo;<samp>W</samp>&rsquo;</dt>
  41790. <dt>&lsquo;<samp>H</samp>&rsquo;</dt>
  41791. <dd><p>The width and height of the image.
  41792. </p>
  41793. </dd>
  41794. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  41795. <dd><p>Progress of transition effect.
  41796. </p>
  41797. </dd>
  41798. <dt>&lsquo;<samp>PLANE</samp>&rsquo;</dt>
  41799. <dd><p>Currently processed plane.
  41800. </p>
  41801. </dd>
  41802. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  41803. <dd><p>Return value of first input at current location and plane.
  41804. </p>
  41805. </dd>
  41806. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  41807. <dd><p>Return value of second input at current location and plane.
  41808. </p>
  41809. </dd>
  41810. <dt>&lsquo;<samp>a0(x, y)</samp>&rsquo;</dt>
  41811. <dt>&lsquo;<samp>a1(x, y)</samp>&rsquo;</dt>
  41812. <dt>&lsquo;<samp>a2(x, y)</samp>&rsquo;</dt>
  41813. <dt>&lsquo;<samp>a3(x, y)</samp>&rsquo;</dt>
  41814. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  41815. first/second/third/fourth component of first input.
  41816. </p>
  41817. </dd>
  41818. <dt>&lsquo;<samp>b0(x, y)</samp>&rsquo;</dt>
  41819. <dt>&lsquo;<samp>b1(x, y)</samp>&rsquo;</dt>
  41820. <dt>&lsquo;<samp>b2(x, y)</samp>&rsquo;</dt>
  41821. <dt>&lsquo;<samp>b3(x, y)</samp>&rsquo;</dt>
  41822. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  41823. first/second/third/fourth component of second input.
  41824. </p></dd>
  41825. </dl>
  41826. </dd>
  41827. </dl>
  41828. <a name="Examples-81"></a>
  41829. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-81">39.231.1 Examples</a></h3>
  41830. <ul>
  41831. <li>
  41832. Cross fade from one input video to another input video, with fade transition and duration of transition
  41833. of 2 seconds starting at offset of 5 seconds:
  41834. <div class="example">
  41835. <pre class="example">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  41836. </pre></div>
  41837. </li></ul>
  41838. <a name="xmedian"></a>
  41839. <h2 class="section"><a href="ffmpeg-all.html#toc-xmedian">39.232 xmedian</a></h2>
  41840. <p>Pick median pixels from several input videos.
  41841. </p>
  41842. <p>The filter accepts the following options:
  41843. </p>
  41844. <dl compact="compact">
  41845. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  41846. <dd><p>Set number of inputs.
  41847. Default is 3. Allowed range is from 3 to 255.
  41848. If number of inputs is even number, than result will be mean value between two median values.
  41849. </p>
  41850. </dd>
  41851. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  41852. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  41853. </p>
  41854. </dd>
  41855. <dt>&lsquo;<samp>percentile</samp>&rsquo;</dt>
  41856. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  41857. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  41858. minimum values, and <code>1</code> maximum values.
  41859. </p></dd>
  41860. </dl>
  41861. <a name="xstack"></a>
  41862. <h2 class="section"><a href="ffmpeg-all.html#toc-xstack">39.233 xstack</a></h2>
  41863. <p>Stack video inputs into custom layout.
  41864. </p>
  41865. <p>All streams must be of same pixel format.
  41866. </p>
  41867. <p>The filter accepts the following options:
  41868. </p>
  41869. <dl compact="compact">
  41870. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  41871. <dd><p>Set number of input streams. Default is 2.
  41872. </p>
  41873. </dd>
  41874. <dt>&lsquo;<samp>layout</samp>&rsquo;</dt>
  41875. <dd><p>Specify layout of inputs.
  41876. This option requires the desired layout configuration to be explicitly set by the user.
  41877. This sets position of each video input in output. Each input
  41878. is separated by &rsquo;|&rsquo;.
  41879. The first number represents the column, and the second number represents the row.
  41880. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  41881. where X is video input from which to take width or height.
  41882. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  41883. case values are summed together.
  41884. </p>
  41885. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  41886. the output video frame will be filled. Similarly, videos can overlap each
  41887. other if their position doesn&rsquo;t leave enough space for the full frame of
  41888. adjoining videos.
  41889. </p>
  41890. <p>For 2 inputs, a default layout of <code>0_0|w0_0</code> is set. In all other cases,
  41891. a layout must be set by the user.
  41892. </p>
  41893. </dd>
  41894. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  41895. <dd><p>If set to 1, force the output to terminate when the shortest input
  41896. terminates. Default value is 0.
  41897. </p>
  41898. </dd>
  41899. <dt>&lsquo;<samp>fill</samp>&rsquo;</dt>
  41900. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  41901. By default fill is set to none, so it is disabled.
  41902. </p></dd>
  41903. </dl>
  41904. <a name="Examples-64"></a>
  41905. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-64">39.233.1 Examples</a></h3>
  41906. <ul>
  41907. <li>
  41908. Display 4 inputs into 2x2 grid.
  41909. <p>Layout:
  41910. </p><div class="example">
  41911. <pre class="example">input1(0, 0) | input3(w0, 0)
  41912. input2(0, h0) | input4(w0, h0)
  41913. </pre></div>
  41914. <div class="example">
  41915. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  41916. </pre></div>
  41917. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41918. </p>
  41919. </li><li>
  41920. Display 4 inputs into 1x4 grid.
  41921. <p>Layout:
  41922. </p><div class="example">
  41923. <pre class="example">input1(0, 0)
  41924. input2(0, h0)
  41925. input3(0, h0+h1)
  41926. input4(0, h0+h1+h2)
  41927. </pre></div>
  41928. <div class="example">
  41929. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  41930. </pre></div>
  41931. <p>Note that if inputs are of different widths, unused space will appear.
  41932. </p>
  41933. </li><li>
  41934. Display 9 inputs into 3x3 grid.
  41935. <p>Layout:
  41936. </p><div class="example">
  41937. <pre class="example">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  41938. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  41939. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  41940. </pre></div>
  41941. <div class="example">
  41942. <pre class="example">xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
  41943. </pre></div>
  41944. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41945. </p>
  41946. </li><li>
  41947. Display 16 inputs into 4x4 grid.
  41948. <p>Layout:
  41949. </p><div class="example">
  41950. <pre class="example">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  41951. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  41952. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  41953. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  41954. </pre></div>
  41955. <div class="example">
  41956. <pre class="example">xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
  41957. w0+w4_h0|w0+w4_h0+h1|w0+w4_h0+h1+h2|w0+w4+w8_0|w0+w4+w8_h0|w0+w4+w8_h0+h1|w0+w4+w8_h0+h1+h2
  41958. </pre></div>
  41959. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  41960. </p>
  41961. </li></ul>
  41962. <p><a name="yadif"></a>
  41963. </p><a name="yadif-1"></a>
  41964. <h2 class="section"><a href="ffmpeg-all.html#toc-yadif-1">39.234 yadif</a></h2>
  41965. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  41966. filter&quot;).
  41967. </p>
  41968. <p>It accepts the following parameters:
  41969. </p>
  41970. <dl compact="compact">
  41971. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  41972. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  41973. </p>
  41974. <dl compact="compact">
  41975. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  41976. <dd><p>Output one frame for each frame.
  41977. </p></dd>
  41978. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  41979. <dd><p>Output one frame for each field.
  41980. </p></dd>
  41981. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  41982. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  41983. </p></dd>
  41984. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  41985. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  41986. </p></dd>
  41987. </dl>
  41988. <p>The default value is <code>send_frame</code>.
  41989. </p>
  41990. </dd>
  41991. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  41992. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  41993. of the following values:
  41994. </p>
  41995. <dl compact="compact">
  41996. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  41997. <dd><p>Assume the top field is first.
  41998. </p></dd>
  41999. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  42000. <dd><p>Assume the bottom field is first.
  42001. </p></dd>
  42002. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  42003. <dd><p>Enable automatic detection of field parity.
  42004. </p></dd>
  42005. </dl>
  42006. <p>The default value is <code>auto</code>.
  42007. If the interlacing is unknown or the decoder does not export this information,
  42008. top field first will be assumed.
  42009. </p>
  42010. </dd>
  42011. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  42012. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42013. values:
  42014. </p>
  42015. <dl compact="compact">
  42016. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  42017. <dd><p>Deinterlace all frames.
  42018. </p></dd>
  42019. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  42020. <dd><p>Only deinterlace frames marked as interlaced.
  42021. </p></dd>
  42022. </dl>
  42023. <p>The default value is <code>all</code>.
  42024. </p></dd>
  42025. </dl>
  42026. <a name="yadif_005fcuda"></a>
  42027. <h2 class="section"><a href="ffmpeg-all.html#toc-yadif_005fcuda">39.235 yadif_cuda</a></h2>
  42028. <p>Deinterlace the input video using the <a href="#yadif">yadif</a> algorithm, but implemented
  42029. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  42030. and/or nvenc.
  42031. </p>
  42032. <p>It accepts the following parameters:
  42033. </p>
  42034. <dl compact="compact">
  42035. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  42036. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  42037. </p>
  42038. <dl compact="compact">
  42039. <dt>&lsquo;<samp>0, send_frame</samp>&rsquo;</dt>
  42040. <dd><p>Output one frame for each frame.
  42041. </p></dd>
  42042. <dt>&lsquo;<samp>1, send_field</samp>&rsquo;</dt>
  42043. <dd><p>Output one frame for each field.
  42044. </p></dd>
  42045. <dt>&lsquo;<samp>2, send_frame_nospatial</samp>&rsquo;</dt>
  42046. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  42047. </p></dd>
  42048. <dt>&lsquo;<samp>3, send_field_nospatial</samp>&rsquo;</dt>
  42049. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  42050. </p></dd>
  42051. </dl>
  42052. <p>The default value is <code>send_frame</code>.
  42053. </p>
  42054. </dd>
  42055. <dt>&lsquo;<samp>parity</samp>&rsquo;</dt>
  42056. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  42057. of the following values:
  42058. </p>
  42059. <dl compact="compact">
  42060. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  42061. <dd><p>Assume the top field is first.
  42062. </p></dd>
  42063. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  42064. <dd><p>Assume the bottom field is first.
  42065. </p></dd>
  42066. <dt>&lsquo;<samp>-1, auto</samp>&rsquo;</dt>
  42067. <dd><p>Enable automatic detection of field parity.
  42068. </p></dd>
  42069. </dl>
  42070. <p>The default value is <code>auto</code>.
  42071. If the interlacing is unknown or the decoder does not export this information,
  42072. top field first will be assumed.
  42073. </p>
  42074. </dd>
  42075. <dt>&lsquo;<samp>deint</samp>&rsquo;</dt>
  42076. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  42077. values:
  42078. </p>
  42079. <dl compact="compact">
  42080. <dt>&lsquo;<samp>0, all</samp>&rsquo;</dt>
  42081. <dd><p>Deinterlace all frames.
  42082. </p></dd>
  42083. <dt>&lsquo;<samp>1, interlaced</samp>&rsquo;</dt>
  42084. <dd><p>Only deinterlace frames marked as interlaced.
  42085. </p></dd>
  42086. </dl>
  42087. <p>The default value is <code>all</code>.
  42088. </p></dd>
  42089. </dl>
  42090. <a name="yaepblur"></a>
  42091. <h2 class="section"><a href="ffmpeg-all.html#toc-yaepblur">39.236 yaepblur</a></h2>
  42092. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  42093. The algorithm is described in
  42094. &quot;J. S. Lee, Digital image enhancement and noise filtering by use of local statistics, IEEE Trans. Pattern Anal. Mach. Intell. PAMI-2, 1980.&quot;
  42095. </p>
  42096. <p>It accepts the following parameters:
  42097. </p>
  42098. <dl compact="compact">
  42099. <dt>&lsquo;<samp>radius, r</samp>&rsquo;</dt>
  42100. <dd><p>Set the window radius. Default value is 3.
  42101. </p>
  42102. </dd>
  42103. <dt>&lsquo;<samp>planes, p</samp>&rsquo;</dt>
  42104. <dd><p>Set which planes to filter. Default is only the first plane.
  42105. </p>
  42106. </dd>
  42107. <dt>&lsquo;<samp>sigma, s</samp>&rsquo;</dt>
  42108. <dd><p>Set blur strength. Default value is 128.
  42109. </p></dd>
  42110. </dl>
  42111. <a name="Commands-26"></a>
  42112. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-26">39.236.1 Commands</a></h3>
  42113. <p>This filter supports same <a href="#commands">commands</a> as options.
  42114. </p>
  42115. <a name="zoompan"></a>
  42116. <h2 class="section"><a href="ffmpeg-all.html#toc-zoompan">39.237 zoompan</a></h2>
  42117. <p>Apply Zoom &amp; Pan effect.
  42118. </p>
  42119. <p>This filter accepts the following options:
  42120. </p>
  42121. <dl compact="compact">
  42122. <dt>&lsquo;<samp>zoom, z</samp>&rsquo;</dt>
  42123. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  42124. </p>
  42125. </dd>
  42126. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42127. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42128. <dd><p>Set the x and y expression. Default is 0.
  42129. </p>
  42130. </dd>
  42131. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  42132. <dd><p>Set the duration expression in number of frames.
  42133. This sets for how many number of frames effect will last for
  42134. single input image.
  42135. </p>
  42136. </dd>
  42137. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  42138. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  42139. </p>
  42140. </dd>
  42141. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  42142. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  42143. </p></dd>
  42144. </dl>
  42145. <p>Each expression can contain the following constants:
  42146. </p>
  42147. <dl compact="compact">
  42148. <dt>&lsquo;<samp>in_w, iw</samp>&rsquo;</dt>
  42149. <dd><p>Input width.
  42150. </p>
  42151. </dd>
  42152. <dt>&lsquo;<samp>in_h, ih</samp>&rsquo;</dt>
  42153. <dd><p>Input height.
  42154. </p>
  42155. </dd>
  42156. <dt>&lsquo;<samp>out_w, ow</samp>&rsquo;</dt>
  42157. <dd><p>Output width.
  42158. </p>
  42159. </dd>
  42160. <dt>&lsquo;<samp>out_h, oh</samp>&rsquo;</dt>
  42161. <dd><p>Output height.
  42162. </p>
  42163. </dd>
  42164. <dt>&lsquo;<samp>in</samp>&rsquo;</dt>
  42165. <dd><p>Input frame count.
  42166. </p>
  42167. </dd>
  42168. <dt>&lsquo;<samp>on</samp>&rsquo;</dt>
  42169. <dd><p>Output frame count.
  42170. </p>
  42171. </dd>
  42172. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42173. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42174. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  42175. for current input frame.
  42176. </p>
  42177. </dd>
  42178. <dt>&lsquo;<samp>px</samp>&rsquo;</dt>
  42179. <dt>&lsquo;<samp>py</samp>&rsquo;</dt>
  42180. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  42181. not yet such frame (first input frame).
  42182. </p>
  42183. </dd>
  42184. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  42185. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  42186. </p>
  42187. </dd>
  42188. <dt>&lsquo;<samp>pzoom</samp>&rsquo;</dt>
  42189. <dd><p>Last calculated zoom of last output frame of previous input frame.
  42190. </p>
  42191. </dd>
  42192. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  42193. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  42194. for each input frame.
  42195. </p>
  42196. </dd>
  42197. <dt>&lsquo;<samp>pduration</samp>&rsquo;</dt>
  42198. <dd><p>number of output frames created for previous input frame
  42199. </p>
  42200. </dd>
  42201. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  42202. <dd><p>Rational number: input width / input height
  42203. </p>
  42204. </dd>
  42205. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  42206. <dd><p>sample aspect ratio
  42207. </p>
  42208. </dd>
  42209. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  42210. <dd><p>display aspect ratio
  42211. </p>
  42212. </dd>
  42213. </dl>
  42214. <a name="Examples-83"></a>
  42215. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-83">39.237.1 Examples</a></h3>
  42216. <ul>
  42217. <li>
  42218. Zoom-in up to 1.5 and pan at same time to some spot near center of picture:
  42219. <div class="example">
  42220. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
  42221. </pre></div>
  42222. </li><li>
  42223. Zoom-in up to 1.5 and pan always at center of picture:
  42224. <div class="example">
  42225. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  42226. </pre></div>
  42227. </li><li>
  42228. Same as above but without pausing:
  42229. <div class="example">
  42230. <pre class="example">zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  42231. </pre></div>
  42232. </li></ul>
  42233. <p><a name="zscale"></a>
  42234. </p><a name="zscale-1"></a>
  42235. <h2 class="section"><a href="ffmpeg-all.html#toc-zscale-1">39.238 zscale</a></h2>
  42236. <p>Scale (resize) the input video, using the z.lib library:
  42237. <a href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  42238. filter, you need to configure FFmpeg with <code>--enable-libzimg</code>.
  42239. </p>
  42240. <p>The zscale filter forces the output display aspect ratio to be the same
  42241. as the input, by changing the output sample aspect ratio.
  42242. </p>
  42243. <p>If the input image format is different from the format requested by
  42244. the next filter, the zscale filter will convert the input to the
  42245. requested format.
  42246. </p>
  42247. <a name="Options-7"></a>
  42248. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Options-7">39.238.1 Options</a></h3>
  42249. <p>The filter accepts the following options.
  42250. </p>
  42251. <dl compact="compact">
  42252. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  42253. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  42254. <dd><p>Set the output video dimension expression. Default value is the input
  42255. dimension.
  42256. </p>
  42257. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  42258. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  42259. is used for the output.
  42260. </p>
  42261. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  42262. will use a value that maintains the aspect ratio of the input image,
  42263. calculated from the other specified dimension. After that it will,
  42264. however, make sure that the calculated dimension is divisible by n and
  42265. adjust the value if necessary.
  42266. </p>
  42267. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  42268. both values being set to 0 as previously detailed.
  42269. </p>
  42270. <p>See below for the list of accepted constants for use in the dimension
  42271. expression.
  42272. </p>
  42273. </dd>
  42274. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  42275. <dd><p>Set the video size. For the syntax of this option, check the
  42276. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  42277. </p>
  42278. </dd>
  42279. <dt>&lsquo;<samp>dither, d</samp>&rsquo;</dt>
  42280. <dd><p>Set the dither type.
  42281. </p>
  42282. <p>Possible values are:
  42283. </p><dl compact="compact">
  42284. <dt><var>none</var></dt>
  42285. <dt><var>ordered</var></dt>
  42286. <dt><var>random</var></dt>
  42287. <dt><var>error_diffusion</var></dt>
  42288. </dl>
  42289. <p>Default is none.
  42290. </p>
  42291. </dd>
  42292. <dt>&lsquo;<samp>filter, f</samp>&rsquo;</dt>
  42293. <dd><p>Set the resize filter type.
  42294. </p>
  42295. <p>Possible values are:
  42296. </p><dl compact="compact">
  42297. <dt><var>point</var></dt>
  42298. <dt><var>bilinear</var></dt>
  42299. <dt><var>bicubic</var></dt>
  42300. <dt><var>spline16</var></dt>
  42301. <dt><var>spline36</var></dt>
  42302. <dt><var>lanczos</var></dt>
  42303. </dl>
  42304. <p>Default is bilinear.
  42305. </p>
  42306. </dd>
  42307. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  42308. <dd><p>Set the color range.
  42309. </p>
  42310. <p>Possible values are:
  42311. </p><dl compact="compact">
  42312. <dt><var>input</var></dt>
  42313. <dt><var>limited</var></dt>
  42314. <dt><var>full</var></dt>
  42315. </dl>
  42316. <p>Default is same as input.
  42317. </p>
  42318. </dd>
  42319. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  42320. <dd><p>Set the color primaries.
  42321. </p>
  42322. <p>Possible values are:
  42323. </p><dl compact="compact">
  42324. <dt><var>input</var></dt>
  42325. <dt><var>709</var></dt>
  42326. <dt><var>unspecified</var></dt>
  42327. <dt><var>170m</var></dt>
  42328. <dt><var>240m</var></dt>
  42329. <dt><var>2020</var></dt>
  42330. </dl>
  42331. <p>Default is same as input.
  42332. </p>
  42333. </dd>
  42334. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  42335. <dd><p>Set the transfer characteristics.
  42336. </p>
  42337. <p>Possible values are:
  42338. </p><dl compact="compact">
  42339. <dt><var>input</var></dt>
  42340. <dt><var>709</var></dt>
  42341. <dt><var>unspecified</var></dt>
  42342. <dt><var>601</var></dt>
  42343. <dt><var>linear</var></dt>
  42344. <dt><var>2020_10</var></dt>
  42345. <dt><var>2020_12</var></dt>
  42346. <dt><var>smpte2084</var></dt>
  42347. <dt><var>iec61966-2-1</var></dt>
  42348. <dt><var>arib-std-b67</var></dt>
  42349. </dl>
  42350. <p>Default is same as input.
  42351. </p>
  42352. </dd>
  42353. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  42354. <dd><p>Set the colorspace matrix.
  42355. </p>
  42356. <p>Possible value are:
  42357. </p><dl compact="compact">
  42358. <dt><var>input</var></dt>
  42359. <dt><var>709</var></dt>
  42360. <dt><var>unspecified</var></dt>
  42361. <dt><var>470bg</var></dt>
  42362. <dt><var>170m</var></dt>
  42363. <dt><var>2020_ncl</var></dt>
  42364. <dt><var>2020_cl</var></dt>
  42365. </dl>
  42366. <p>Default is same as input.
  42367. </p>
  42368. </dd>
  42369. <dt>&lsquo;<samp>rangein, rin</samp>&rsquo;</dt>
  42370. <dd><p>Set the input color range.
  42371. </p>
  42372. <p>Possible values are:
  42373. </p><dl compact="compact">
  42374. <dt><var>input</var></dt>
  42375. <dt><var>limited</var></dt>
  42376. <dt><var>full</var></dt>
  42377. </dl>
  42378. <p>Default is same as input.
  42379. </p>
  42380. </dd>
  42381. <dt>&lsquo;<samp>primariesin, pin</samp>&rsquo;</dt>
  42382. <dd><p>Set the input color primaries.
  42383. </p>
  42384. <p>Possible values are:
  42385. </p><dl compact="compact">
  42386. <dt><var>input</var></dt>
  42387. <dt><var>709</var></dt>
  42388. <dt><var>unspecified</var></dt>
  42389. <dt><var>170m</var></dt>
  42390. <dt><var>240m</var></dt>
  42391. <dt><var>2020</var></dt>
  42392. </dl>
  42393. <p>Default is same as input.
  42394. </p>
  42395. </dd>
  42396. <dt>&lsquo;<samp>transferin, tin</samp>&rsquo;</dt>
  42397. <dd><p>Set the input transfer characteristics.
  42398. </p>
  42399. <p>Possible values are:
  42400. </p><dl compact="compact">
  42401. <dt><var>input</var></dt>
  42402. <dt><var>709</var></dt>
  42403. <dt><var>unspecified</var></dt>
  42404. <dt><var>601</var></dt>
  42405. <dt><var>linear</var></dt>
  42406. <dt><var>2020_10</var></dt>
  42407. <dt><var>2020_12</var></dt>
  42408. </dl>
  42409. <p>Default is same as input.
  42410. </p>
  42411. </dd>
  42412. <dt>&lsquo;<samp>matrixin, min</samp>&rsquo;</dt>
  42413. <dd><p>Set the input colorspace matrix.
  42414. </p>
  42415. <p>Possible value are:
  42416. </p><dl compact="compact">
  42417. <dt><var>input</var></dt>
  42418. <dt><var>709</var></dt>
  42419. <dt><var>unspecified</var></dt>
  42420. <dt><var>470bg</var></dt>
  42421. <dt><var>170m</var></dt>
  42422. <dt><var>2020_ncl</var></dt>
  42423. <dt><var>2020_cl</var></dt>
  42424. </dl>
  42425. </dd>
  42426. <dt>&lsquo;<samp>chromal, c</samp>&rsquo;</dt>
  42427. <dd><p>Set the output chroma location.
  42428. </p>
  42429. <p>Possible values are:
  42430. </p><dl compact="compact">
  42431. <dt><var>input</var></dt>
  42432. <dt><var>left</var></dt>
  42433. <dt><var>center</var></dt>
  42434. <dt><var>topleft</var></dt>
  42435. <dt><var>top</var></dt>
  42436. <dt><var>bottomleft</var></dt>
  42437. <dt><var>bottom</var></dt>
  42438. </dl>
  42439. </dd>
  42440. <dt>&lsquo;<samp>chromalin, cin</samp>&rsquo;</dt>
  42441. <dd><p>Set the input chroma location.
  42442. </p>
  42443. <p>Possible values are:
  42444. </p><dl compact="compact">
  42445. <dt><var>input</var></dt>
  42446. <dt><var>left</var></dt>
  42447. <dt><var>center</var></dt>
  42448. <dt><var>topleft</var></dt>
  42449. <dt><var>top</var></dt>
  42450. <dt><var>bottomleft</var></dt>
  42451. <dt><var>bottom</var></dt>
  42452. </dl>
  42453. </dd>
  42454. <dt>&lsquo;<samp>npl</samp>&rsquo;</dt>
  42455. <dd><p>Set the nominal peak luminance.
  42456. </p></dd>
  42457. </dl>
  42458. <p>The values of the &lsquo;<samp>w</samp>&rsquo; and &lsquo;<samp>h</samp>&rsquo; options are expressions
  42459. containing the following constants:
  42460. </p>
  42461. <dl compact="compact">
  42462. <dt><var>in_w</var></dt>
  42463. <dt><var>in_h</var></dt>
  42464. <dd><p>The input width and height
  42465. </p>
  42466. </dd>
  42467. <dt><var>iw</var></dt>
  42468. <dt><var>ih</var></dt>
  42469. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  42470. </p>
  42471. </dd>
  42472. <dt><var>out_w</var></dt>
  42473. <dt><var>out_h</var></dt>
  42474. <dd><p>The output (scaled) width and height
  42475. </p>
  42476. </dd>
  42477. <dt><var>ow</var></dt>
  42478. <dt><var>oh</var></dt>
  42479. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  42480. </p>
  42481. </dd>
  42482. <dt><var>a</var></dt>
  42483. <dd><p>The same as <var>iw</var> / <var>ih</var>
  42484. </p>
  42485. </dd>
  42486. <dt><var>sar</var></dt>
  42487. <dd><p>input sample aspect ratio
  42488. </p>
  42489. </dd>
  42490. <dt><var>dar</var></dt>
  42491. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  42492. </p>
  42493. </dd>
  42494. <dt><var>hsub</var></dt>
  42495. <dt><var>vsub</var></dt>
  42496. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  42497. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  42498. </p>
  42499. </dd>
  42500. <dt><var>ohsub</var></dt>
  42501. <dt><var>ovsub</var></dt>
  42502. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  42503. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  42504. </p></dd>
  42505. </dl>
  42506. <a name="Commands-10"></a>
  42507. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-10">39.238.2 Commands</a></h3>
  42508. <p>This filter supports the following commands:
  42509. </p><dl compact="compact">
  42510. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  42511. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  42512. <dd><p>Set the output video dimension expression.
  42513. The command accepts the same syntax of the corresponding option.
  42514. </p>
  42515. <p>If the specified expression is not valid, it is kept at its current
  42516. value.
  42517. </p></dd>
  42518. </dl>
  42519. <a name="OpenCL-Video-Filters"></a>
  42520. <h1 class="chapter"><a href="ffmpeg-all.html#toc-OpenCL-Video-Filters">40 OpenCL Video Filters</a></h1>
  42521. <p>Below is a description of the currently available OpenCL video filters.
  42522. </p>
  42523. <p>To enable compilation of these filters you need to configure FFmpeg with
  42524. <code>--enable-opencl</code>.
  42525. </p>
  42526. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  42527. </p><dl compact="compact">
  42528. <dt>&lsquo;<samp>-init_hw_device opencl[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp>&rsquo;</dt>
  42529. <dd><p>Initialise a new hardware device of type <var>opencl</var> called <var>name</var>, using the
  42530. given device parameters.
  42531. </p>
  42532. </dd>
  42533. <dt>&lsquo;<samp>-filter_hw_device <var>name</var></samp>&rsquo;</dt>
  42534. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  42535. </p>
  42536. </dd>
  42537. </dl>
  42538. <p>For more detailed information see <a href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  42539. </p>
  42540. <ul>
  42541. <li>
  42542. Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  42543. <div class="example">
  42544. <pre class="example">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  42545. </pre></div>
  42546. </li></ul>
  42547. <p>Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(<a href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded(<a href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a href="#hwupload">hwupload</a> will upload to a surface with the same layout as the software frame, so it may be necessary to add a <a href="#format">format</a> filter immediately before to get the input into the right format and <a href="#hwdownload">hwdownload</a> does not support all formats on the output - it may be necessary to insert an additional <a href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  42548. </p>
  42549. <a name="avgblur_005fopencl"></a>
  42550. <h2 class="section"><a href="ffmpeg-all.html#toc-avgblur_005fopencl">40.1 avgblur_opencl</a></h2>
  42551. <p>Apply average blur filter.
  42552. </p>
  42553. <p>The filter accepts the following options:
  42554. </p>
  42555. <dl compact="compact">
  42556. <dt>&lsquo;<samp>sizeX</samp>&rsquo;</dt>
  42557. <dd><p>Set horizontal radius size.
  42558. Range is <code>[1, 1024]</code> and default value is <code>1</code>.
  42559. </p>
  42560. </dd>
  42561. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  42562. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  42563. </p>
  42564. </dd>
  42565. <dt>&lsquo;<samp>sizeY</samp>&rsquo;</dt>
  42566. <dd><p>Set vertical radius size. Range is <code>[1, 1024]</code> and default value is <code>0</code>. If zero, <code>sizeX</code> value will be used.
  42567. </p></dd>
  42568. </dl>
  42569. <a name="Example-6"></a>
  42570. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-6">40.1.1 Example</a></h3>
  42571. <ul>
  42572. <li>
  42573. Apply average blur filter with horizontal and vertical size of 3, setting each pixel of the output to the average value of the 7x7 region centered on it in the input. For pixels on the edges of the image, the region does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  42574. <div class="example">
  42575. <pre class="example">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  42576. </pre></div>
  42577. </li></ul>
  42578. <a name="boxblur_005fopencl"></a>
  42579. <h2 class="section"><a href="ffmpeg-all.html#toc-boxblur_005fopencl">40.2 boxblur_opencl</a></h2>
  42580. <p>Apply a boxblur algorithm to the input video.
  42581. </p>
  42582. <p>It accepts the following parameters:
  42583. </p>
  42584. <dl compact="compact">
  42585. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  42586. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  42587. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  42588. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  42589. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  42590. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  42591. </dl>
  42592. <p>A description of the accepted options follows.
  42593. </p>
  42594. <dl compact="compact">
  42595. <dt>&lsquo;<samp>luma_radius, lr</samp>&rsquo;</dt>
  42596. <dt>&lsquo;<samp>chroma_radius, cr</samp>&rsquo;</dt>
  42597. <dt>&lsquo;<samp>alpha_radius, ar</samp>&rsquo;</dt>
  42598. <dd><p>Set an expression for the box radius in pixels used for blurring the
  42599. corresponding input plane.
  42600. </p>
  42601. <p>The radius value must be a non-negative number, and must not be
  42602. greater than the value of the expression <code>min(w,h)/2</code> for the
  42603. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  42604. planes.
  42605. </p>
  42606. <p>Default value for &lsquo;<samp>luma_radius</samp>&rsquo; is &quot;2&quot;. If not specified,
  42607. &lsquo;<samp>chroma_radius</samp>&rsquo; and &lsquo;<samp>alpha_radius</samp>&rsquo; default to the
  42608. corresponding value set for &lsquo;<samp>luma_radius</samp>&rsquo;.
  42609. </p>
  42610. <p>The expressions can contain the following constants:
  42611. </p><dl compact="compact">
  42612. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  42613. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  42614. <dd><p>The input width and height in pixels.
  42615. </p>
  42616. </dd>
  42617. <dt>&lsquo;<samp>cw</samp>&rsquo;</dt>
  42618. <dt>&lsquo;<samp>ch</samp>&rsquo;</dt>
  42619. <dd><p>The input chroma image width and height in pixels.
  42620. </p>
  42621. </dd>
  42622. <dt>&lsquo;<samp>hsub</samp>&rsquo;</dt>
  42623. <dt>&lsquo;<samp>vsub</samp>&rsquo;</dt>
  42624. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  42625. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  42626. </p></dd>
  42627. </dl>
  42628. </dd>
  42629. <dt>&lsquo;<samp>luma_power, lp</samp>&rsquo;</dt>
  42630. <dt>&lsquo;<samp>chroma_power, cp</samp>&rsquo;</dt>
  42631. <dt>&lsquo;<samp>alpha_power, ap</samp>&rsquo;</dt>
  42632. <dd><p>Specify how many times the boxblur filter is applied to the
  42633. corresponding plane.
  42634. </p>
  42635. <p>Default value for &lsquo;<samp>luma_power</samp>&rsquo; is 2. If not specified,
  42636. &lsquo;<samp>chroma_power</samp>&rsquo; and &lsquo;<samp>alpha_power</samp>&rsquo; default to the
  42637. corresponding value set for &lsquo;<samp>luma_power</samp>&rsquo;.
  42638. </p>
  42639. <p>A value of 0 will disable the effect.
  42640. </p></dd>
  42641. </dl>
  42642. <a name="Examples-170"></a>
  42643. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-170">40.2.1 Examples</a></h3>
  42644. <p>Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses <var>luma_radius</var>, <var>chroma_radius</var>, <var>alpha_radius</var> for each plane respectively. The filter will apply <var>luma_power</var>, <var>chroma_power</var>, <var>alpha_power</var> times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  42645. </p>
  42646. <ul>
  42647. <li>
  42648. Apply a boxblur filter with the luma, chroma, and alpha radius
  42649. set to 2 and luma, chroma, and alpha power set to 3. The filter will run 3 times with box-radius set to 2 for every plane of the image.
  42650. <div class="example">
  42651. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  42652. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  42653. </pre></div>
  42654. </li><li>
  42655. Apply a boxblur filter with luma radius set to 2, luma_power to 1, chroma_radius to 4, chroma_power to 5, alpha_radius to 3 and alpha_power to 7.
  42656. <p>For the luma plane, a 2x2 box radius will be run once.
  42657. </p>
  42658. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  42659. </p>
  42660. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  42661. </p><div class="example">
  42662. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  42663. </pre></div>
  42664. </li></ul>
  42665. <a name="colorkey_005fopencl"></a>
  42666. <h2 class="section"><a href="ffmpeg-all.html#toc-colorkey_005fopencl">40.3 colorkey_opencl</a></h2>
  42667. <p>RGB colorspace color keying.
  42668. </p>
  42669. <p>The filter accepts the following options:
  42670. </p>
  42671. <dl compact="compact">
  42672. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  42673. <dd><p>The color which will be replaced with transparency.
  42674. </p>
  42675. </dd>
  42676. <dt>&lsquo;<samp>similarity</samp>&rsquo;</dt>
  42677. <dd><p>Similarity percentage with the key color.
  42678. </p>
  42679. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  42680. </p>
  42681. </dd>
  42682. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  42683. <dd><p>Blend percentage.
  42684. </p>
  42685. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  42686. </p>
  42687. <p>Higher values result in semi-transparent pixels, with a higher transparency
  42688. the more similar the pixels color is to the key color.
  42689. </p></dd>
  42690. </dl>
  42691. <a name="Examples-23"></a>
  42692. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-23">40.3.1 Examples</a></h3>
  42693. <ul>
  42694. <li>
  42695. Make every semi-green pixel in the input transparent with some slight blending:
  42696. <div class="example">
  42697. <pre class="example">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  42698. </pre></div>
  42699. </li></ul>
  42700. <a name="convolution_005fopencl"></a>
  42701. <h2 class="section"><a href="ffmpeg-all.html#toc-convolution_005fopencl">40.4 convolution_opencl</a></h2>
  42702. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  42703. </p>
  42704. <p>The filter accepts the following options:
  42705. </p>
  42706. <dl compact="compact">
  42707. <dt>&lsquo;<samp>0m</samp>&rsquo;</dt>
  42708. <dt>&lsquo;<samp>1m</samp>&rsquo;</dt>
  42709. <dt>&lsquo;<samp>2m</samp>&rsquo;</dt>
  42710. <dt>&lsquo;<samp>3m</samp>&rsquo;</dt>
  42711. <dd><p>Set matrix for each plane.
  42712. Matrix is sequence of 9, 25 or 49 signed numbers.
  42713. Default value for each plane is <code>0 0 0 0 1 0 0 0 0</code>.
  42714. </p>
  42715. </dd>
  42716. <dt>&lsquo;<samp>0rdiv</samp>&rsquo;</dt>
  42717. <dt>&lsquo;<samp>1rdiv</samp>&rsquo;</dt>
  42718. <dt>&lsquo;<samp>2rdiv</samp>&rsquo;</dt>
  42719. <dt>&lsquo;<samp>3rdiv</samp>&rsquo;</dt>
  42720. <dd><p>Set multiplier for calculated value for each plane.
  42721. If unset or 0, it will be sum of all matrix elements.
  42722. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>1.0</code>.
  42723. </p>
  42724. </dd>
  42725. <dt>&lsquo;<samp>0bias</samp>&rsquo;</dt>
  42726. <dt>&lsquo;<samp>1bias</samp>&rsquo;</dt>
  42727. <dt>&lsquo;<samp>2bias</samp>&rsquo;</dt>
  42728. <dt>&lsquo;<samp>3bias</samp>&rsquo;</dt>
  42729. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  42730. Useful for making the overall image brighter or darker.
  42731. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>0.0</code>.
  42732. </p>
  42733. </dd>
  42734. </dl>
  42735. <a name="Examples-124"></a>
  42736. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-124">40.4.1 Examples</a></h3>
  42737. <ul>
  42738. <li>
  42739. Apply sharpen:
  42740. <div class="example">
  42741. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload&quot; OUTPUT
  42742. </pre></div>
  42743. </li><li>
  42744. Apply blur:
  42745. <div class="example">
  42746. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload&quot; OUTPUT
  42747. </pre></div>
  42748. </li><li>
  42749. Apply edge enhance:
  42750. <div class="example">
  42751. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload&quot; OUTPUT
  42752. </pre></div>
  42753. </li><li>
  42754. Apply edge detect:
  42755. <div class="example">
  42756. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload&quot; OUTPUT
  42757. </pre></div>
  42758. </li><li>
  42759. Apply laplacian edge detector which includes diagonals:
  42760. <div class="example">
  42761. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload&quot; OUTPUT
  42762. </pre></div>
  42763. </li><li>
  42764. Apply emboss:
  42765. <div class="example">
  42766. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload&quot; OUTPUT
  42767. </pre></div>
  42768. </li></ul>
  42769. <a name="erosion_005fopencl"></a>
  42770. <h2 class="section"><a href="ffmpeg-all.html#toc-erosion_005fopencl">40.5 erosion_opencl</a></h2>
  42771. <p>Apply erosion effect to the video.
  42772. </p>
  42773. <p>This filter replaces the pixel by the local(3x3) minimum.
  42774. </p>
  42775. <p>It accepts the following options:
  42776. </p>
  42777. <dl compact="compact">
  42778. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  42779. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  42780. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  42781. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  42782. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  42783. If <code>0</code>, plane will remain unchanged.
  42784. </p>
  42785. </dd>
  42786. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  42787. <dd><p>Flag which specifies the pixel to refer to.
  42788. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  42789. </p>
  42790. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  42791. </p>
  42792. <p> 1 2 3
  42793. </p>
  42794. <p> 4 x 5
  42795. </p>
  42796. <p> 6 7 8
  42797. </p></dd>
  42798. </dl>
  42799. <a name="Example-3"></a>
  42800. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-3">40.5.1 Example</a></h3>
  42801. <ul>
  42802. <li>
  42803. Apply erosion filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local minimum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local minimum is more then threshold of the corresponding plane, output pixel will be set to input pixel - threshold of corresponding plane.
  42804. <div class="example">
  42805. <pre class="example">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  42806. </pre></div>
  42807. </li></ul>
  42808. <a name="deshake_005fopencl"></a>
  42809. <h2 class="section"><a href="ffmpeg-all.html#toc-deshake_005fopencl">40.6 deshake_opencl</a></h2>
  42810. <p>Feature-point based video stabilization filter.
  42811. </p>
  42812. <p>The filter accepts the following options:
  42813. </p>
  42814. <dl compact="compact">
  42815. <dt>&lsquo;<samp>tripod</samp>&rsquo;</dt>
  42816. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code>0</code>.
  42817. </p>
  42818. </dd>
  42819. <dt>&lsquo;<samp>debug</samp>&rsquo;</dt>
  42820. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  42821. </p>
  42822. <p>Note that in order to see console debug output you will also need to pass <code>-v verbose</code> to ffmpeg.
  42823. </p>
  42824. <p>Viewing point matches in the output video is only supported for RGB input.
  42825. </p>
  42826. <p>Defaults to <code>0</code>.
  42827. </p>
  42828. </dd>
  42829. <dt>&lsquo;<samp>adaptive_crop</samp>&rsquo;</dt>
  42830. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  42831. </p>
  42832. <p>Defaults to <code>1</code>.
  42833. </p>
  42834. </dd>
  42835. <dt>&lsquo;<samp>refine_features</samp>&rsquo;</dt>
  42836. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  42837. </p>
  42838. <p>This can be turned off for a slight performance gain at the cost of precision.
  42839. </p>
  42840. <p>Defaults to <code>1</code>.
  42841. </p>
  42842. </dd>
  42843. <dt>&lsquo;<samp>smooth_strength</samp>&rsquo;</dt>
  42844. <dd><p>The strength of the smoothing applied to the camera path from <code>0.0</code> to <code>1.0</code>.
  42845. </p>
  42846. <p><code>1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  42847. </p>
  42848. <p><code>0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  42849. </p>
  42850. <p>Defaults to <code>0.0</code>.
  42851. </p>
  42852. </dd>
  42853. <dt>&lsquo;<samp>smooth_window_multiplier</samp>&rsquo;</dt>
  42854. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  42855. </p>
  42856. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  42857. </p>
  42858. <p>Acceptable values range from <code>0.1</code> to <code>10.0</code>.
  42859. </p>
  42860. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  42861. potentially improving smoothness, but also increase latency and memory usage.
  42862. </p>
  42863. <p>Defaults to <code>2.0</code>.
  42864. </p>
  42865. </dd>
  42866. </dl>
  42867. <a name="Examples-183"></a>
  42868. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-183">40.6.1 Examples</a></h3>
  42869. <ul>
  42870. <li>
  42871. Stabilize a video with a fixed, medium smoothing strength:
  42872. <div class="example">
  42873. <pre class="example">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  42874. </pre></div>
  42875. </li><li>
  42876. Stabilize a video with debugging (both in console and in rendered video):
  42877. <div class="example">
  42878. <pre class="example">-i INPUT -filter_complex &quot;[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p&quot; -v verbose OUTPUT
  42879. </pre></div>
  42880. </li></ul>
  42881. <a name="dilation_005fopencl"></a>
  42882. <h2 class="section"><a href="ffmpeg-all.html#toc-dilation_005fopencl">40.7 dilation_opencl</a></h2>
  42883. <p>Apply dilation effect to the video.
  42884. </p>
  42885. <p>This filter replaces the pixel by the local(3x3) maximum.
  42886. </p>
  42887. <p>It accepts the following options:
  42888. </p>
  42889. <dl compact="compact">
  42890. <dt>&lsquo;<samp>threshold0</samp>&rsquo;</dt>
  42891. <dt>&lsquo;<samp>threshold1</samp>&rsquo;</dt>
  42892. <dt>&lsquo;<samp>threshold2</samp>&rsquo;</dt>
  42893. <dt>&lsquo;<samp>threshold3</samp>&rsquo;</dt>
  42894. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  42895. If <code>0</code>, plane will remain unchanged.
  42896. </p>
  42897. </dd>
  42898. <dt>&lsquo;<samp>coordinates</samp>&rsquo;</dt>
  42899. <dd><p>Flag which specifies the pixel to refer to.
  42900. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  42901. </p>
  42902. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  42903. </p>
  42904. <p> 1 2 3
  42905. </p>
  42906. <p> 4 x 5
  42907. </p>
  42908. <p> 6 7 8
  42909. </p></dd>
  42910. </dl>
  42911. <a name="Example-2"></a>
  42912. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-2">40.7.1 Example</a></h3>
  42913. <ul>
  42914. <li>
  42915. Apply dilation filter with threshold0 set to 30, threshold1 set 40, threshold2 set to 50 and coordinates set to 231, setting each pixel of the output to the local maximum between pixels: 1, 2, 3, 6, 7, 8 of the 3x3 region centered on it in the input. If the difference between input pixel and local maximum is more then threshold of the corresponding plane, output pixel will be set to input pixel + threshold of corresponding plane.
  42916. <div class="example">
  42917. <pre class="example">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  42918. </pre></div>
  42919. </li></ul>
  42920. <a name="nlmeans_005fopencl"></a>
  42921. <h2 class="section"><a href="ffmpeg-all.html#toc-nlmeans_005fopencl">40.8 nlmeans_opencl</a></h2>
  42922. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a href="#nlmeans">nlmeans</a>.
  42923. </p>
  42924. <a name="overlay_005fopencl"></a>
  42925. <h2 class="section"><a href="ffmpeg-all.html#toc-overlay_005fopencl">40.9 overlay_opencl</a></h2>
  42926. <p>Overlay one video on top of another.
  42927. </p>
  42928. <p>It takes two inputs and has one output. The first input is the &quot;main&quot; video on which the second input is overlaid.
  42929. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  42930. </p>
  42931. <p>The filter accepts the following options:
  42932. </p>
  42933. <dl compact="compact">
  42934. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42935. <dd><p>Set the x coordinate of the overlaid video on the main video.
  42936. Default value is <code>0</code>.
  42937. </p>
  42938. </dd>
  42939. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42940. <dd><p>Set the y coordinate of the overlaid video on the main video.
  42941. Default value is <code>0</code>.
  42942. </p>
  42943. </dd>
  42944. </dl>
  42945. <a name="Examples-15"></a>
  42946. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-15">40.9.1 Examples</a></h3>
  42947. <ul>
  42948. <li>
  42949. Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  42950. <div class="example">
  42951. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  42952. </pre></div>
  42953. </li><li>
  42954. The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  42955. <div class="example">
  42956. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  42957. </pre></div>
  42958. </li></ul>
  42959. <a name="pad_005fopencl"></a>
  42960. <h2 class="section"><a href="ffmpeg-all.html#toc-pad_005fopencl">40.10 pad_opencl</a></h2>
  42961. <p>Add paddings to the input image, and place the original input at the
  42962. provided <var>x</var>, <var>y</var> coordinates.
  42963. </p>
  42964. <p>It accepts the following options:
  42965. </p>
  42966. <dl compact="compact">
  42967. <dt>&lsquo;<samp>width, w</samp>&rsquo;</dt>
  42968. <dt>&lsquo;<samp>height, h</samp>&rsquo;</dt>
  42969. <dd><p>Specify an expression for the size of the output image with the
  42970. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  42971. corresponding input size is used for the output.
  42972. </p>
  42973. <p>The <var>width</var> expression can reference the value set by the
  42974. <var>height</var> expression, and vice versa.
  42975. </p>
  42976. <p>The default value of <var>width</var> and <var>height</var> is 0.
  42977. </p>
  42978. </dd>
  42979. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  42980. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  42981. <dd><p>Specify the offsets to place the input image at within the padded area,
  42982. with respect to the top/left border of the output image.
  42983. </p>
  42984. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  42985. expression, and vice versa.
  42986. </p>
  42987. <p>The default value of <var>x</var> and <var>y</var> is 0.
  42988. </p>
  42989. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  42990. so the input image is centered on the padded area.
  42991. </p>
  42992. </dd>
  42993. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  42994. <dd><p>Specify the color of the padded area. For the syntax of this option,
  42995. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  42996. </p>
  42997. </dd>
  42998. <dt>&lsquo;<samp>aspect</samp>&rsquo;</dt>
  42999. <dd><p>Pad to an aspect instead to a resolution.
  43000. </p></dd>
  43001. </dl>
  43002. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  43003. options are expressions containing the following constants:
  43004. </p>
  43005. <dl compact="compact">
  43006. <dt>&lsquo;<samp>in_w</samp>&rsquo;</dt>
  43007. <dt>&lsquo;<samp>in_h</samp>&rsquo;</dt>
  43008. <dd><p>The input video width and height.
  43009. </p>
  43010. </dd>
  43011. <dt>&lsquo;<samp>iw</samp>&rsquo;</dt>
  43012. <dt>&lsquo;<samp>ih</samp>&rsquo;</dt>
  43013. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  43014. </p>
  43015. </dd>
  43016. <dt>&lsquo;<samp>out_w</samp>&rsquo;</dt>
  43017. <dt>&lsquo;<samp>out_h</samp>&rsquo;</dt>
  43018. <dd><p>The output width and height (the size of the padded area), as
  43019. specified by the <var>width</var> and <var>height</var> expressions.
  43020. </p>
  43021. </dd>
  43022. <dt>&lsquo;<samp>ow</samp>&rsquo;</dt>
  43023. <dt>&lsquo;<samp>oh</samp>&rsquo;</dt>
  43024. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  43025. </p>
  43026. </dd>
  43027. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  43028. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  43029. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  43030. expressions, or NAN if not yet specified.
  43031. </p>
  43032. </dd>
  43033. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  43034. <dd><p>same as <var>iw</var> / <var>ih</var>
  43035. </p>
  43036. </dd>
  43037. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  43038. <dd><p>input sample aspect ratio
  43039. </p>
  43040. </dd>
  43041. <dt>&lsquo;<samp>dar</samp>&rsquo;</dt>
  43042. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  43043. </p></dd>
  43044. </dl>
  43045. <a name="prewitt_005fopencl"></a>
  43046. <h2 class="section"><a href="ffmpeg-all.html#toc-prewitt_005fopencl">40.11 prewitt_opencl</a></h2>
  43047. <p>Apply the Prewitt operator (<a href="https://en.wikipedia.org/wiki/Prewitt_operator">https://en.wikipedia.org/wiki/Prewitt_operator</a>) to input video stream.
  43048. </p>
  43049. <p>The filter accepts the following option:
  43050. </p>
  43051. <dl compact="compact">
  43052. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43053. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43054. </p>
  43055. </dd>
  43056. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43057. <dd><p>Set value which will be multiplied with filtered result.
  43058. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43059. </p>
  43060. </dd>
  43061. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43062. <dd><p>Set value which will be added to filtered result.
  43063. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43064. </p></dd>
  43065. </dl>
  43066. <a name="Example-11"></a>
  43067. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-11">40.11.1 Example</a></h3>
  43068. <ul>
  43069. <li>
  43070. Apply the Prewitt operator with scale set to 2 and delta set to 10.
  43071. <div class="example">
  43072. <pre class="example">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43073. </pre></div>
  43074. </li></ul>
  43075. <p><a name="program_005fopencl"></a>
  43076. </p><a name="program_005fopencl-1"></a>
  43077. <h2 class="section"><a href="ffmpeg-all.html#toc-program_005fopencl-1">40.12 program_opencl</a></h2>
  43078. <p>Filter video using an OpenCL program.
  43079. </p>
  43080. <dl compact="compact">
  43081. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  43082. <dd><p>OpenCL program source file.
  43083. </p>
  43084. </dd>
  43085. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  43086. <dd><p>Kernel name in program.
  43087. </p>
  43088. </dd>
  43089. <dt>&lsquo;<samp>inputs</samp>&rsquo;</dt>
  43090. <dd><p>Number of inputs to the filter. Defaults to 1.
  43091. </p>
  43092. </dd>
  43093. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  43094. <dd><p>Size of output frames. Defaults to the same as the first input.
  43095. </p>
  43096. </dd>
  43097. </dl>
  43098. <p>The <code>program_opencl</code> filter also supports the <a href="#framesync">framesync</a> options.
  43099. </p>
  43100. <p>The program source file must contain a kernel function with the given name,
  43101. which will be run once for each plane of the output. Each run on a plane
  43102. gets enqueued as a separate 2D global NDRange with one work-item for each
  43103. pixel to be generated. The global ID offset for each work-item is therefore
  43104. the coordinates of a pixel in the destination image.
  43105. </p>
  43106. <p>The kernel function needs to take the following arguments:
  43107. </p><ul>
  43108. <li>
  43109. Destination image, <var>__write_only image2d_t</var>.
  43110. <p>This image will become the output; the kernel should write all of it.
  43111. </p></li><li>
  43112. Frame index, <var>unsigned int</var>.
  43113. <p>This is a counter starting from zero and increasing by one for each frame.
  43114. </p></li><li>
  43115. Source images, <var>__read_only image2d_t</var>.
  43116. <p>These are the most recent images on each input. The kernel may read from
  43117. them to generate the output, but they can&rsquo;t be written to.
  43118. </p></li></ul>
  43119. <p>Example programs:
  43120. </p>
  43121. <ul>
  43122. <li>
  43123. Copy the input to the output (output must be the same size as the input).
  43124. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  43125. unsigned int index,
  43126. __read_only image2d_t source)
  43127. {
  43128. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  43129. int2 location = (int2)(get_global_id(0), get_global_id(1));
  43130. float4 value = read_imagef(source, sampler, location);
  43131. write_imagef(destination, location, value);
  43132. }
  43133. </pre>
  43134. </li><li>
  43135. Apply a simple transformation, rotating the input by an amount increasing
  43136. with the index counter. Pixel values are linearly interpolated by the
  43137. sampler, and the output need not have the same dimensions as the input.
  43138. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  43139. unsigned int index,
  43140. __read_only image2d_t src)
  43141. {
  43142. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43143. CLK_FILTER_LINEAR);
  43144. float angle = (float)index / 100.0f;
  43145. float2 dst_dim = convert_float2(get_image_dim(dst));
  43146. float2 src_dim = convert_float2(get_image_dim(src));
  43147. float2 dst_cen = dst_dim / 2.0f;
  43148. float2 src_cen = src_dim / 2.0f;
  43149. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43150. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  43151. float2 src_pos = {
  43152. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  43153. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  43154. };
  43155. src_pos = src_pos * src_dim / dst_dim;
  43156. float2 src_loc = src_pos + src_cen;
  43157. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  43158. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  43159. write_imagef(dst, dst_loc, 0.5f);
  43160. else
  43161. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  43162. }
  43163. </pre>
  43164. </li><li>
  43165. Blend two inputs together, with the amount of each input used varying
  43166. with the index counter.
  43167. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  43168. unsigned int index,
  43169. __read_only image2d_t src1,
  43170. __read_only image2d_t src2)
  43171. {
  43172. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43173. CLK_FILTER_LINEAR);
  43174. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  43175. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  43176. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  43177. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  43178. float4 val1 = read_imagef(src1, sampler, src1_loc);
  43179. float4 val2 = read_imagef(src2, sampler, src2_loc);
  43180. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  43181. }
  43182. </pre>
  43183. </li></ul>
  43184. <a name="roberts_005fopencl"></a>
  43185. <h2 class="section"><a href="ffmpeg-all.html#toc-roberts_005fopencl">40.13 roberts_opencl</a></h2>
  43186. <p>Apply the Roberts cross operator (<a href="https://en.wikipedia.org/wiki/Roberts_cross">https://en.wikipedia.org/wiki/Roberts_cross</a>) to input video stream.
  43187. </p>
  43188. <p>The filter accepts the following option:
  43189. </p>
  43190. <dl compact="compact">
  43191. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43192. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43193. </p>
  43194. </dd>
  43195. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43196. <dd><p>Set value which will be multiplied with filtered result.
  43197. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43198. </p>
  43199. </dd>
  43200. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43201. <dd><p>Set value which will be added to filtered result.
  43202. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43203. </p></dd>
  43204. </dl>
  43205. <a name="Example-5"></a>
  43206. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-5">40.13.1 Example</a></h3>
  43207. <ul>
  43208. <li>
  43209. Apply the Roberts cross operator with scale set to 2 and delta set to 10
  43210. <div class="example">
  43211. <pre class="example">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43212. </pre></div>
  43213. </li></ul>
  43214. <a name="sobel_005fopencl"></a>
  43215. <h2 class="section"><a href="ffmpeg-all.html#toc-sobel_005fopencl">40.14 sobel_opencl</a></h2>
  43216. <p>Apply the Sobel operator (<a href="https://en.wikipedia.org/wiki/Sobel_operator">https://en.wikipedia.org/wiki/Sobel_operator</a>) to input video stream.
  43217. </p>
  43218. <p>The filter accepts the following option:
  43219. </p>
  43220. <dl compact="compact">
  43221. <dt>&lsquo;<samp>planes</samp>&rsquo;</dt>
  43222. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  43223. </p>
  43224. </dd>
  43225. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  43226. <dd><p>Set value which will be multiplied with filtered result.
  43227. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  43228. </p>
  43229. </dd>
  43230. <dt>&lsquo;<samp>delta</samp>&rsquo;</dt>
  43231. <dd><p>Set value which will be added to filtered result.
  43232. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  43233. </p></dd>
  43234. </dl>
  43235. <a name="Example-10"></a>
  43236. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-10">40.14.1 Example</a></h3>
  43237. <ul>
  43238. <li>
  43239. Apply sobel operator with scale set to 2 and delta set to 10
  43240. <div class="example">
  43241. <pre class="example">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  43242. </pre></div>
  43243. </li></ul>
  43244. <a name="tonemap_005fopencl"></a>
  43245. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap_005fopencl">40.15 tonemap_opencl</a></h2>
  43246. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  43247. </p>
  43248. <p>It accepts the following parameters:
  43249. </p>
  43250. <dl compact="compact">
  43251. <dt>&lsquo;<samp>tonemap</samp>&rsquo;</dt>
  43252. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a href="#tonemap">tonemap</a>.
  43253. </p>
  43254. </dd>
  43255. <dt>&lsquo;<samp>param</samp>&rsquo;</dt>
  43256. <dd><p>Tune the tone mapping algorithm. same as param option in <a href="#tonemap">tonemap</a>.
  43257. </p>
  43258. </dd>
  43259. <dt>&lsquo;<samp>desat</samp>&rsquo;</dt>
  43260. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  43261. higher the parameter, the more color information will be preserved. This
  43262. setting helps prevent unnaturally blown-out colors for super-highlights, by
  43263. (smoothly) turning into white instead. This makes images feel more natural,
  43264. at the cost of reducing information about out-of-range colors.
  43265. </p>
  43266. <p>The default value is 0.5, and the algorithm here is a little different from
  43267. the cpu version tonemap currently. A setting of 0.0 disables this option.
  43268. </p>
  43269. </dd>
  43270. <dt>&lsquo;<samp>threshold</samp>&rsquo;</dt>
  43271. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  43272. is used to detect whether the scene has changed or not. If the distance between
  43273. the current frame average brightness and the current running average exceeds
  43274. a threshold value, we would re-calculate scene average and peak brightness.
  43275. The default value is 0.2.
  43276. </p>
  43277. </dd>
  43278. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  43279. <dd><p>Specify the output pixel format.
  43280. </p>
  43281. <p>Currently supported formats are:
  43282. </p><dl compact="compact">
  43283. <dt><var>p010</var></dt>
  43284. <dt><var>nv12</var></dt>
  43285. </dl>
  43286. </dd>
  43287. <dt>&lsquo;<samp>range, r</samp>&rsquo;</dt>
  43288. <dd><p>Set the output color range.
  43289. </p>
  43290. <p>Possible values are:
  43291. </p><dl compact="compact">
  43292. <dt><var>tv/mpeg</var></dt>
  43293. <dt><var>pc/jpeg</var></dt>
  43294. </dl>
  43295. <p>Default is same as input.
  43296. </p>
  43297. </dd>
  43298. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  43299. <dd><p>Set the output color primaries.
  43300. </p>
  43301. <p>Possible values are:
  43302. </p><dl compact="compact">
  43303. <dt><var>bt709</var></dt>
  43304. <dt><var>bt2020</var></dt>
  43305. </dl>
  43306. <p>Default is same as input.
  43307. </p>
  43308. </dd>
  43309. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  43310. <dd><p>Set the output transfer characteristics.
  43311. </p>
  43312. <p>Possible values are:
  43313. </p><dl compact="compact">
  43314. <dt><var>bt709</var></dt>
  43315. <dt><var>bt2020</var></dt>
  43316. </dl>
  43317. <p>Default is bt709.
  43318. </p>
  43319. </dd>
  43320. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  43321. <dd><p>Set the output colorspace matrix.
  43322. </p>
  43323. <p>Possible value are:
  43324. </p><dl compact="compact">
  43325. <dt><var>bt709</var></dt>
  43326. <dt><var>bt2020</var></dt>
  43327. </dl>
  43328. <p>Default is same as input.
  43329. </p>
  43330. </dd>
  43331. </dl>
  43332. <a name="Example-7"></a>
  43333. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-7">40.15.1 Example</a></h3>
  43334. <ul>
  43335. <li>
  43336. Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  43337. <div class="example">
  43338. <pre class="example">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  43339. </pre></div>
  43340. </li></ul>
  43341. <a name="unsharp_005fopencl"></a>
  43342. <h2 class="section"><a href="ffmpeg-all.html#toc-unsharp_005fopencl">40.16 unsharp_opencl</a></h2>
  43343. <p>Sharpen or blur the input video.
  43344. </p>
  43345. <p>It accepts the following parameters:
  43346. </p>
  43347. <dl compact="compact">
  43348. <dt>&lsquo;<samp>luma_msize_x, lx</samp>&rsquo;</dt>
  43349. <dd><p>Set the luma matrix horizontal size.
  43350. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43351. </p>
  43352. </dd>
  43353. <dt>&lsquo;<samp>luma_msize_y, ly</samp>&rsquo;</dt>
  43354. <dd><p>Set the luma matrix vertical size.
  43355. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43356. </p>
  43357. </dd>
  43358. <dt>&lsquo;<samp>luma_amount, la</samp>&rsquo;</dt>
  43359. <dd><p>Set the luma effect strength.
  43360. Range is <code>[-10, 10]</code> and default value is <code>1.0</code>.
  43361. </p>
  43362. <p>Negative values will blur the input video, while positive values will
  43363. sharpen it, a value of zero will disable the effect.
  43364. </p>
  43365. </dd>
  43366. <dt>&lsquo;<samp>chroma_msize_x, cx</samp>&rsquo;</dt>
  43367. <dd><p>Set the chroma matrix horizontal size.
  43368. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43369. </p>
  43370. </dd>
  43371. <dt>&lsquo;<samp>chroma_msize_y, cy</samp>&rsquo;</dt>
  43372. <dd><p>Set the chroma matrix vertical size.
  43373. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  43374. </p>
  43375. </dd>
  43376. <dt>&lsquo;<samp>chroma_amount, ca</samp>&rsquo;</dt>
  43377. <dd><p>Set the chroma effect strength.
  43378. Range is <code>[-10, 10]</code> and default value is <code>0.0</code>.
  43379. </p>
  43380. <p>Negative values will blur the input video, while positive values will
  43381. sharpen it, a value of zero will disable the effect.
  43382. </p>
  43383. </dd>
  43384. </dl>
  43385. <p>All parameters are optional and default to the equivalent of the
  43386. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  43387. </p>
  43388. <a name="Examples-93"></a>
  43389. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-93">40.16.1 Examples</a></h3>
  43390. <ul>
  43391. <li>
  43392. Apply strong luma sharpen effect:
  43393. <div class="example">
  43394. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload&quot; OUTPUT
  43395. </pre></div>
  43396. </li><li>
  43397. Apply a strong blur of both luma and chroma parameters:
  43398. <div class="example">
  43399. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  43400. </pre></div>
  43401. </li></ul>
  43402. <a name="xfade_005fopencl"></a>
  43403. <h2 class="section"><a href="ffmpeg-all.html#toc-xfade_005fopencl">40.17 xfade_opencl</a></h2>
  43404. <p>Cross fade two videos with custom transition effect by using OpenCL.
  43405. </p>
  43406. <p>It accepts the following options:
  43407. </p>
  43408. <dl compact="compact">
  43409. <dt>&lsquo;<samp>transition</samp>&rsquo;</dt>
  43410. <dd><p>Set one of possible transition effects.
  43411. </p>
  43412. <dl compact="compact">
  43413. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  43414. <dd><p>Select custom transition effect, the actual transition description
  43415. will be picked from source and kernel options.
  43416. </p>
  43417. </dd>
  43418. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  43419. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  43420. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  43421. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  43422. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  43423. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  43424. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  43425. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  43426. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  43427. <dd>
  43428. <p>Default transition is fade.
  43429. </p></dd>
  43430. </dl>
  43431. </dd>
  43432. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  43433. <dd><p>OpenCL program source file for custom transition.
  43434. </p>
  43435. </dd>
  43436. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  43437. <dd><p>Set name of kernel to use for custom transition from program source file.
  43438. </p>
  43439. </dd>
  43440. <dt>&lsquo;<samp>duration</samp>&rsquo;</dt>
  43441. <dd><p>Set duration of video transition.
  43442. </p>
  43443. </dd>
  43444. <dt>&lsquo;<samp>offset</samp>&rsquo;</dt>
  43445. <dd><p>Set time of start of transition relative to first video.
  43446. </p></dd>
  43447. </dl>
  43448. <p>The program source file must contain a kernel function with the given name,
  43449. which will be run once for each plane of the output. Each run on a plane
  43450. gets enqueued as a separate 2D global NDRange with one work-item for each
  43451. pixel to be generated. The global ID offset for each work-item is therefore
  43452. the coordinates of a pixel in the destination image.
  43453. </p>
  43454. <p>The kernel function needs to take the following arguments:
  43455. </p><ul>
  43456. <li>
  43457. Destination image, <var>__write_only image2d_t</var>.
  43458. <p>This image will become the output; the kernel should write all of it.
  43459. </p>
  43460. </li><li>
  43461. First Source image, <var>__read_only image2d_t</var>.
  43462. Second Source image, <var>__read_only image2d_t</var>.
  43463. <p>These are the most recent images on each input. The kernel may read from
  43464. them to generate the output, but they can&rsquo;t be written to.
  43465. </p>
  43466. </li><li>
  43467. Transition progress, <var>float</var>. This value is always between 0 and 1 inclusive.
  43468. </li></ul>
  43469. <p>Example programs:
  43470. </p>
  43471. <ul>
  43472. <li>
  43473. Apply dots curtain transition effect:
  43474. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  43475. __read_only image2d_t src1,
  43476. __read_only image2d_t src2,
  43477. float progress)
  43478. {
  43479. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  43480. CLK_FILTER_LINEAR);
  43481. int2 p = (int2)(get_global_id(0), get_global_id(1));
  43482. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  43483. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  43484. rp = rp / dim;
  43485. float2 dots = (float2)(20.0, 20.0);
  43486. float2 center = (float2)(0,0);
  43487. float2 unused;
  43488. float4 val1 = read_imagef(src1, sampler, p);
  43489. float4 val2 = read_imagef(src2, sampler, p);
  43490. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  43491. write_imagef(dst, p, next ? val1 : val2);
  43492. }
  43493. </pre>
  43494. </li></ul>
  43495. <a name="VAAPI-Video-Filters"></a>
  43496. <h1 class="chapter"><a href="ffmpeg-all.html#toc-VAAPI-Video-Filters">41 VAAPI Video Filters</a></h1>
  43497. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  43498. </p>
  43499. <p>To enable compilation of these filters you need to configure FFmpeg with
  43500. <code>--enable-vaapi</code>.
  43501. </p>
  43502. <p>To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read <a href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI">https://trac.ffmpeg.org/wiki/Hardware/VAAPI</a>
  43503. </p>
  43504. <a name="tonemap_005fvaapi"></a>
  43505. <h2 class="section"><a href="ffmpeg-all.html#toc-tonemap_005fvaapi">41.1 tonemap_vaapi</a></h2>
  43506. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  43507. It maps the dynamic range of HDR10 content to the SDR content.
  43508. It currently only accepts HDR10 as input.
  43509. </p>
  43510. <p>It accepts the following parameters:
  43511. </p>
  43512. <dl compact="compact">
  43513. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  43514. <dd><p>Specify the output pixel format.
  43515. </p>
  43516. <p>Currently supported formats are:
  43517. </p><dl compact="compact">
  43518. <dt><var>p010</var></dt>
  43519. <dt><var>nv12</var></dt>
  43520. </dl>
  43521. <p>Default is nv12.
  43522. </p>
  43523. </dd>
  43524. <dt>&lsquo;<samp>primaries, p</samp>&rsquo;</dt>
  43525. <dd><p>Set the output color primaries.
  43526. </p>
  43527. <p>Default is same as input.
  43528. </p>
  43529. </dd>
  43530. <dt>&lsquo;<samp>transfer, t</samp>&rsquo;</dt>
  43531. <dd><p>Set the output transfer characteristics.
  43532. </p>
  43533. <p>Default is bt709.
  43534. </p>
  43535. </dd>
  43536. <dt>&lsquo;<samp>matrix, m</samp>&rsquo;</dt>
  43537. <dd><p>Set the output colorspace matrix.
  43538. </p>
  43539. <p>Default is same as input.
  43540. </p>
  43541. </dd>
  43542. </dl>
  43543. <a name="Example-4"></a>
  43544. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Example-4">41.1.1 Example</a></h3>
  43545. <ul>
  43546. <li>
  43547. Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  43548. <div class="example">
  43549. <pre class="example">tonemap_vaapi=format=p010:t=bt2020-10
  43550. </pre></div>
  43551. </li></ul>
  43552. <a name="Video-Sources"></a>
  43553. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sources">42 Video Sources</a></h1>
  43554. <p>Below is a description of the currently available video sources.
  43555. </p>
  43556. <a name="buffer"></a>
  43557. <h2 class="section"><a href="ffmpeg-all.html#toc-buffer">42.1 buffer</a></h2>
  43558. <p>Buffer video frames, and make them available to the filter chain.
  43559. </p>
  43560. <p>This source is mainly intended for a programmatic use, in particular
  43561. through the interface defined in &lsquo;<tt>libavfilter/vsrc_buffer.h</tt>&rsquo;.
  43562. </p>
  43563. <p>It accepts the following parameters:
  43564. </p>
  43565. <dl compact="compact">
  43566. <dt>&lsquo;<samp>video_size</samp>&rsquo;</dt>
  43567. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  43568. syntax of this option, check the
  43569. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  43570. </p>
  43571. </dd>
  43572. <dt>&lsquo;<samp>width</samp>&rsquo;</dt>
  43573. <dd><p>The input video width.
  43574. </p>
  43575. </dd>
  43576. <dt>&lsquo;<samp>height</samp>&rsquo;</dt>
  43577. <dd><p>The input video height.
  43578. </p>
  43579. </dd>
  43580. <dt>&lsquo;<samp>pix_fmt</samp>&rsquo;</dt>
  43581. <dd><p>A string representing the pixel format of the buffered video frames.
  43582. It may be a number corresponding to a pixel format, or a pixel format
  43583. name.
  43584. </p>
  43585. </dd>
  43586. <dt>&lsquo;<samp>time_base</samp>&rsquo;</dt>
  43587. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  43588. </p>
  43589. </dd>
  43590. <dt>&lsquo;<samp>frame_rate</samp>&rsquo;</dt>
  43591. <dd><p>Specify the frame rate expected for the video stream.
  43592. </p>
  43593. </dd>
  43594. <dt>&lsquo;<samp>pixel_aspect, sar</samp>&rsquo;</dt>
  43595. <dd><p>The sample (pixel) aspect ratio of the input video.
  43596. </p>
  43597. </dd>
  43598. <dt>&lsquo;<samp>sws_param</samp>&rsquo;</dt>
  43599. <dd><p>This option is deprecated and ignored. Prepend <code>sws_flags=<var>flags</var>;</code>
  43600. to the filtergraph description to specify swscale flags for automatically
  43601. inserted scalers. See <a href="#Filtergraph-syntax">Filtergraph syntax</a>.
  43602. </p>
  43603. </dd>
  43604. <dt>&lsquo;<samp>hw_frames_ctx</samp>&rsquo;</dt>
  43605. <dd><p>When using a hardware pixel format, this should be a reference to an
  43606. AVHWFramesContext describing input frames.
  43607. </p></dd>
  43608. </dl>
  43609. <p>For example:
  43610. </p><div class="example">
  43611. <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  43612. </pre></div>
  43613. <p>will instruct the source to accept video frames with size 320x240 and
  43614. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  43615. square pixels (1:1 sample aspect ratio).
  43616. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  43617. (check the enum AVPixelFormat definition in &lsquo;<tt>libavutil/pixfmt.h</tt>&rsquo;),
  43618. this example corresponds to:
  43619. </p><div class="example">
  43620. <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  43621. </pre></div>
  43622. <p>Alternatively, the options can be specified as a flat string, but this
  43623. syntax is deprecated:
  43624. </p>
  43625. <p><var>width</var>:<var>height</var>:<var>pix_fmt</var>:<var>time_base.num</var>:<var>time_base.den</var>:<var>pixel_aspect.num</var>:<var>pixel_aspect.den</var>
  43626. </p>
  43627. <a name="cellauto"></a>
  43628. <h2 class="section"><a href="ffmpeg-all.html#toc-cellauto">42.2 cellauto</a></h2>
  43629. <p>Create a pattern generated by an elementary cellular automaton.
  43630. </p>
  43631. <p>The initial state of the cellular automaton can be defined through the
  43632. &lsquo;<samp>filename</samp>&rsquo; and &lsquo;<samp>pattern</samp>&rsquo; options. If such options are
  43633. not specified an initial state is created randomly.
  43634. </p>
  43635. <p>At each new frame a new row in the video is filled with the result of
  43636. the cellular automaton next generation. The behavior when the whole
  43637. frame is filled is defined by the &lsquo;<samp>scroll</samp>&rsquo; option.
  43638. </p>
  43639. <p>This source accepts the following options:
  43640. </p>
  43641. <dl compact="compact">
  43642. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  43643. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  43644. the specified file.
  43645. In the file, each non-whitespace character is considered an alive
  43646. cell, a newline will terminate the row, and further characters in the
  43647. file will be ignored.
  43648. </p>
  43649. </dd>
  43650. <dt>&lsquo;<samp>pattern, p</samp>&rsquo;</dt>
  43651. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  43652. the specified string.
  43653. </p>
  43654. <p>Each non-whitespace character in the string is considered an alive
  43655. cell, a newline will terminate the row, and further characters in the
  43656. string will be ignored.
  43657. </p>
  43658. </dd>
  43659. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  43660. <dd><p>Set the video rate, that is the number of frames generated per second.
  43661. Default is 25.
  43662. </p>
  43663. </dd>
  43664. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  43665. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  43666. is a floating point number value ranging from 0 to 1, defaults to
  43667. 1/PHI.
  43668. </p>
  43669. <p>This option is ignored when a file or a pattern is specified.
  43670. </p>
  43671. </dd>
  43672. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  43673. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  43674. included between 0 and UINT32_MAX. If not specified, or if explicitly
  43675. set to -1, the filter will try to use a good random seed on a best
  43676. effort basis.
  43677. </p>
  43678. </dd>
  43679. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  43680. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  43681. Default value is 110.
  43682. </p>
  43683. </dd>
  43684. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  43685. <dd><p>Set the size of the output video. For the syntax of this option, check the
  43686. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  43687. </p>
  43688. <p>If &lsquo;<samp>filename</samp>&rsquo; or &lsquo;<samp>pattern</samp>&rsquo; is specified, the size is set
  43689. by default to the width of the specified initial state row, and the
  43690. height is set to <var>width</var> * PHI.
  43691. </p>
  43692. <p>If &lsquo;<samp>size</samp>&rsquo; is set, it must contain the width of the specified
  43693. pattern string, and the specified pattern will be centered in the
  43694. larger row.
  43695. </p>
  43696. <p>If a filename or a pattern string is not specified, the size value
  43697. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  43698. </p>
  43699. </dd>
  43700. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  43701. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  43702. have been already filled. If set to 0, the new generated row will be
  43703. written over the top row just after the bottom row is filled.
  43704. Defaults to 1.
  43705. </p>
  43706. </dd>
  43707. <dt>&lsquo;<samp>start_full, full</samp>&rsquo;</dt>
  43708. <dd><p>If set to 1, completely fill the output with generated rows before
  43709. outputting the first frame.
  43710. This is the default behavior, for disabling set the value to 0.
  43711. </p>
  43712. </dd>
  43713. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  43714. <dd><p>If set to 1, stitch the left and right row edges together.
  43715. This is the default behavior, for disabling set the value to 0.
  43716. </p></dd>
  43717. </dl>
  43718. <a name="Examples-159"></a>
  43719. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-159">42.2.1 Examples</a></h3>
  43720. <ul>
  43721. <li>
  43722. Read the initial state from &lsquo;<tt>pattern</tt>&rsquo;, and specify an output of
  43723. size 200x400.
  43724. <div class="example">
  43725. <pre class="example">cellauto=f=pattern:s=200x400
  43726. </pre></div>
  43727. </li><li>
  43728. Generate a random initial row with a width of 200 cells, with a fill
  43729. ratio of 2/3:
  43730. <div class="example">
  43731. <pre class="example">cellauto=ratio=2/3:s=200x200
  43732. </pre></div>
  43733. </li><li>
  43734. Create a pattern generated by rule 18 starting by a single alive cell
  43735. centered on an initial row with width 100:
  43736. <div class="example">
  43737. <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
  43738. </pre></div>
  43739. </li><li>
  43740. Specify a more elaborated initial pattern:
  43741. <div class="example">
  43742. <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  43743. </pre></div>
  43744. </li></ul>
  43745. <p><a name="coreimagesrc"></a>
  43746. </p><a name="coreimagesrc-1"></a>
  43747. <h2 class="section"><a href="ffmpeg-all.html#toc-coreimagesrc-1">42.3 coreimagesrc</a></h2>
  43748. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  43749. </p>
  43750. <p>This video source is a specialized version of the <a href="#coreimage">coreimage</a> video filter.
  43751. Use a core image generator at the beginning of the applied filterchain to
  43752. generate the content.
  43753. </p>
  43754. <p>The coreimagesrc video source accepts the following options:
  43755. </p><dl compact="compact">
  43756. <dt>&lsquo;<samp>list_generators</samp>&rsquo;</dt>
  43757. <dd><p>List all available generators along with all their respective options as well as
  43758. possible minimum and maximum values along with the default values.
  43759. </p><div class="example">
  43760. <pre class="example">list_generators=true
  43761. </pre></div>
  43762. </dd>
  43763. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  43764. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  43765. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  43766. The default value is <code>320x240</code>.
  43767. </p>
  43768. </dd>
  43769. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  43770. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  43771. generated per second. It has to be a string in the format
  43772. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  43773. number or a valid video frame rate abbreviation. The default value is
  43774. &quot;25&quot;.
  43775. </p>
  43776. </dd>
  43777. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  43778. <dd><p>Set the sample aspect ratio of the sourced video.
  43779. </p>
  43780. </dd>
  43781. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  43782. <dd><p>Set the duration of the sourced video. See
  43783. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  43784. for the accepted syntax.
  43785. </p>
  43786. <p>If not specified, or the expressed duration is negative, the video is
  43787. supposed to be generated forever.
  43788. </p></dd>
  43789. </dl>
  43790. <p>Additionally, all options of the <a href="#coreimage">coreimage</a> video filter are accepted.
  43791. A complete filterchain can be used for further processing of the
  43792. generated input without CPU-HOST transfer. See <a href="#coreimage">coreimage</a> documentation
  43793. and examples for details.
  43794. </p>
  43795. <a name="Examples-46"></a>
  43796. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-46">42.3.1 Examples</a></h3>
  43797. <ul>
  43798. <li>
  43799. Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  43800. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  43801. <div class="example">
  43802. <pre class="example">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  43803. </pre></div>
  43804. <p>This example is equivalent to the QRCode example of <a href="#coreimage">coreimage</a> without the
  43805. need for a nullsrc video source.
  43806. </p></li></ul>
  43807. <a name="mandelbrot"></a>
  43808. <h2 class="section"><a href="ffmpeg-all.html#toc-mandelbrot">42.4 mandelbrot</a></h2>
  43809. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  43810. point specified with <var>start_x</var> and <var>start_y</var>.
  43811. </p>
  43812. <p>This source accepts the following options:
  43813. </p>
  43814. <dl compact="compact">
  43815. <dt>&lsquo;<samp>end_pts</samp>&rsquo;</dt>
  43816. <dd><p>Set the terminal pts value. Default value is 400.
  43817. </p>
  43818. </dd>
  43819. <dt>&lsquo;<samp>end_scale</samp>&rsquo;</dt>
  43820. <dd><p>Set the terminal scale value.
  43821. Must be a floating point value. Default value is 0.3.
  43822. </p>
  43823. </dd>
  43824. <dt>&lsquo;<samp>inner</samp>&rsquo;</dt>
  43825. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  43826. Mandelbrot fractal internal region.
  43827. </p>
  43828. <p>It shall assume one of the following values:
  43829. </p><dl compact="compact">
  43830. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  43831. <dd><p>Set black mode.
  43832. </p></dd>
  43833. <dt>&lsquo;<samp>convergence</samp>&rsquo;</dt>
  43834. <dd><p>Show time until convergence.
  43835. </p></dd>
  43836. <dt>&lsquo;<samp>mincol</samp>&rsquo;</dt>
  43837. <dd><p>Set color based on point closest to the origin of the iterations.
  43838. </p></dd>
  43839. <dt>&lsquo;<samp>period</samp>&rsquo;</dt>
  43840. <dd><p>Set period mode.
  43841. </p></dd>
  43842. </dl>
  43843. <p>Default value is <var>mincol</var>.
  43844. </p>
  43845. </dd>
  43846. <dt>&lsquo;<samp>bailout</samp>&rsquo;</dt>
  43847. <dd><p>Set the bailout value. Default value is 10.0.
  43848. </p>
  43849. </dd>
  43850. <dt>&lsquo;<samp>maxiter</samp>&rsquo;</dt>
  43851. <dd><p>Set the maximum of iterations performed by the rendering
  43852. algorithm. Default value is 7189.
  43853. </p>
  43854. </dd>
  43855. <dt>&lsquo;<samp>outer</samp>&rsquo;</dt>
  43856. <dd><p>Set outer coloring mode.
  43857. It shall assume one of following values:
  43858. </p><dl compact="compact">
  43859. <dt>&lsquo;<samp>iteration_count</samp>&rsquo;</dt>
  43860. <dd><p>Set iteration count mode.
  43861. </p></dd>
  43862. <dt>&lsquo;<samp>normalized_iteration_count</samp>&rsquo;</dt>
  43863. <dd><p>set normalized iteration count mode.
  43864. </p></dd>
  43865. </dl>
  43866. <p>Default value is <var>normalized_iteration_count</var>.
  43867. </p>
  43868. </dd>
  43869. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  43870. <dd><p>Set frame rate, expressed as number of frames per second. Default
  43871. value is &quot;25&quot;.
  43872. </p>
  43873. </dd>
  43874. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  43875. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  43876. </p>
  43877. </dd>
  43878. <dt>&lsquo;<samp>start_scale</samp>&rsquo;</dt>
  43879. <dd><p>Set the initial scale value. Default value is 3.0.
  43880. </p>
  43881. </dd>
  43882. <dt>&lsquo;<samp>start_x</samp>&rsquo;</dt>
  43883. <dd><p>Set the initial x position. Must be a floating point value between
  43884. -100 and 100. Default value is -0.743643887037158704752191506114774.
  43885. </p>
  43886. </dd>
  43887. <dt>&lsquo;<samp>start_y</samp>&rsquo;</dt>
  43888. <dd><p>Set the initial y position. Must be a floating point value between
  43889. -100 and 100. Default value is -0.131825904205311970493132056385139.
  43890. </p></dd>
  43891. </dl>
  43892. <a name="mptestsrc"></a>
  43893. <h2 class="section"><a href="ffmpeg-all.html#toc-mptestsrc">42.5 mptestsrc</a></h2>
  43894. <p>Generate various test patterns, as generated by the MPlayer test filter.
  43895. </p>
  43896. <p>The size of the generated video is fixed, and is 256x256.
  43897. This source is useful in particular for testing encoding features.
  43898. </p>
  43899. <p>This source accepts the following options:
  43900. </p>
  43901. <dl compact="compact">
  43902. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  43903. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  43904. generated per second. It has to be a string in the format
  43905. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  43906. number or a valid video frame rate abbreviation. The default value is
  43907. &quot;25&quot;.
  43908. </p>
  43909. </dd>
  43910. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  43911. <dd><p>Set the duration of the sourced video. See
  43912. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  43913. for the accepted syntax.
  43914. </p>
  43915. <p>If not specified, or the expressed duration is negative, the video is
  43916. supposed to be generated forever.
  43917. </p>
  43918. </dd>
  43919. <dt>&lsquo;<samp>test, t</samp>&rsquo;</dt>
  43920. <dd>
  43921. <p>Set the number or the name of the test to perform. Supported tests are:
  43922. </p><dl compact="compact">
  43923. <dt>&lsquo;<samp>dc_luma</samp>&rsquo;</dt>
  43924. <dt>&lsquo;<samp>dc_chroma</samp>&rsquo;</dt>
  43925. <dt>&lsquo;<samp>freq_luma</samp>&rsquo;</dt>
  43926. <dt>&lsquo;<samp>freq_chroma</samp>&rsquo;</dt>
  43927. <dt>&lsquo;<samp>amp_luma</samp>&rsquo;</dt>
  43928. <dt>&lsquo;<samp>amp_chroma</samp>&rsquo;</dt>
  43929. <dt>&lsquo;<samp>cbp</samp>&rsquo;</dt>
  43930. <dt>&lsquo;<samp>mv</samp>&rsquo;</dt>
  43931. <dt>&lsquo;<samp>ring1</samp>&rsquo;</dt>
  43932. <dt>&lsquo;<samp>ring2</samp>&rsquo;</dt>
  43933. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  43934. <dt>&lsquo;<samp>max_frames, m</samp>&rsquo;</dt>
  43935. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  43936. </p>
  43937. </dd>
  43938. </dl>
  43939. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  43940. </p></dd>
  43941. </dl>
  43942. <p>Some examples:
  43943. </p><div class="example">
  43944. <pre class="example">mptestsrc=t=dc_luma
  43945. </pre></div>
  43946. <p>will generate a &quot;dc_luma&quot; test pattern.
  43947. </p>
  43948. <a name="frei0r_005fsrc"></a>
  43949. <h2 class="section"><a href="ffmpeg-all.html#toc-frei0r_005fsrc">42.6 frei0r_src</a></h2>
  43950. <p>Provide a frei0r source.
  43951. </p>
  43952. <p>To enable compilation of this filter you need to install the frei0r
  43953. header and configure FFmpeg with <code>--enable-frei0r</code>.
  43954. </p>
  43955. <p>This source accepts the following parameters:
  43956. </p>
  43957. <dl compact="compact">
  43958. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  43959. <dd><p>The size of the video to generate. For the syntax of this option, check the
  43960. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  43961. </p>
  43962. </dd>
  43963. <dt>&lsquo;<samp>framerate</samp>&rsquo;</dt>
  43964. <dd><p>The framerate of the generated video. It may be a string of the form
  43965. <var>num</var>/<var>den</var> or a frame rate abbreviation.
  43966. </p>
  43967. </dd>
  43968. <dt>&lsquo;<samp>filter_name</samp>&rsquo;</dt>
  43969. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  43970. how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
  43971. documentation.
  43972. </p>
  43973. </dd>
  43974. <dt>&lsquo;<samp>filter_params</samp>&rsquo;</dt>
  43975. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  43976. </p>
  43977. </dd>
  43978. </dl>
  43979. <p>For example, to generate a frei0r partik0l source with size 200x200
  43980. and frame rate 10 which is overlaid on the overlay filter main input:
  43981. </p><div class="example">
  43982. <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  43983. </pre></div>
  43984. <a name="life"></a>
  43985. <h2 class="section"><a href="ffmpeg-all.html#toc-life">42.7 life</a></h2>
  43986. <p>Generate a life pattern.
  43987. </p>
  43988. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  43989. </p>
  43990. <p>The sourced input represents a life grid, each pixel represents a cell
  43991. which can be in one of two possible states, alive or dead. Every cell
  43992. interacts with its eight neighbours, which are the cells that are
  43993. horizontally, vertically, or diagonally adjacent.
  43994. </p>
  43995. <p>At each interaction the grid evolves according to the adopted rule,
  43996. which specifies the number of neighbor alive cells which will make a
  43997. cell stay alive or born. The &lsquo;<samp>rule</samp>&rsquo; option allows one to specify
  43998. the rule to adopt.
  43999. </p>
  44000. <p>This source accepts the following options:
  44001. </p>
  44002. <dl compact="compact">
  44003. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  44004. <dd><p>Set the file from which to read the initial grid state. In the file,
  44005. each non-whitespace character is considered an alive cell, and newline
  44006. is used to delimit the end of each row.
  44007. </p>
  44008. <p>If this option is not specified, the initial grid is generated
  44009. randomly.
  44010. </p>
  44011. </dd>
  44012. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44013. <dd><p>Set the video rate, that is the number of frames generated per second.
  44014. Default is 25.
  44015. </p>
  44016. </dd>
  44017. <dt>&lsquo;<samp>random_fill_ratio, ratio</samp>&rsquo;</dt>
  44018. <dd><p>Set the random fill ratio for the initial random grid. It is a
  44019. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  44020. It is ignored when a file is specified.
  44021. </p>
  44022. </dd>
  44023. <dt>&lsquo;<samp>random_seed, seed</samp>&rsquo;</dt>
  44024. <dd><p>Set the seed for filling the initial random grid, must be an integer
  44025. included between 0 and UINT32_MAX. If not specified, or if explicitly
  44026. set to -1, the filter will try to use a good random seed on a best
  44027. effort basis.
  44028. </p>
  44029. </dd>
  44030. <dt>&lsquo;<samp>rule</samp>&rsquo;</dt>
  44031. <dd><p>Set the life rule.
  44032. </p>
  44033. <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
  44034. where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
  44035. <var>NS</var> specifies the number of alive neighbor cells which make a
  44036. live cell stay alive, and <var>NB</var> the number of alive neighbor cells
  44037. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  44038. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  44039. </p>
  44040. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  44041. high order bits are used to encode the next cell state if it is alive
  44042. for each number of neighbor alive cells, the low order bits specify
  44043. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  44044. higher number of neighbor cells.
  44045. For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
  44046. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  44047. </p>
  44048. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  44049. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  44050. cells, and will born a new cell if there are three alive cells around
  44051. a dead cell.
  44052. </p>
  44053. </dd>
  44054. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44055. <dd><p>Set the size of the output video. For the syntax of this option, check the
  44056. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44057. </p>
  44058. <p>If &lsquo;<samp>filename</samp>&rsquo; is specified, the size is set by default to the
  44059. same size of the input file. If &lsquo;<samp>size</samp>&rsquo; is set, it must contain
  44060. the size specified in the input file, and the initial grid defined in
  44061. that file is centered in the larger resulting area.
  44062. </p>
  44063. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  44064. (used for a randomly generated initial grid).
  44065. </p>
  44066. </dd>
  44067. <dt>&lsquo;<samp>stitch</samp>&rsquo;</dt>
  44068. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  44069. top and bottom edges also. Defaults to 1.
  44070. </p>
  44071. </dd>
  44072. <dt>&lsquo;<samp>mold</samp>&rsquo;</dt>
  44073. <dd><p>Set cell mold speed. If set, a dead cell will go from &lsquo;<samp>death_color</samp>&rsquo; to
  44074. &lsquo;<samp>mold_color</samp>&rsquo; with a step of &lsquo;<samp>mold</samp>&rsquo;. &lsquo;<samp>mold</samp>&rsquo; can have a
  44075. value from 0 to 255.
  44076. </p>
  44077. </dd>
  44078. <dt>&lsquo;<samp>life_color</samp>&rsquo;</dt>
  44079. <dd><p>Set the color of living (or new born) cells.
  44080. </p>
  44081. </dd>
  44082. <dt>&lsquo;<samp>death_color</samp>&rsquo;</dt>
  44083. <dd><p>Set the color of dead cells. If &lsquo;<samp>mold</samp>&rsquo; is set, this is the first color
  44084. used to represent a dead cell.
  44085. </p>
  44086. </dd>
  44087. <dt>&lsquo;<samp>mold_color</samp>&rsquo;</dt>
  44088. <dd><p>Set mold color, for definitely dead and moldy cells.
  44089. </p>
  44090. <p>For the syntax of these 3 color options, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  44091. </p></dd>
  44092. </dl>
  44093. <a name="Examples-87"></a>
  44094. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-87">42.7.1 Examples</a></h3>
  44095. <ul>
  44096. <li>
  44097. Read a grid from &lsquo;<tt>pattern</tt>&rsquo;, and center it on a grid of size
  44098. 300x300 pixels:
  44099. <div class="example">
  44100. <pre class="example">life=f=pattern:s=300x300
  44101. </pre></div>
  44102. </li><li>
  44103. Generate a random grid of size 200x200, with a fill ratio of 2/3:
  44104. <div class="example">
  44105. <pre class="example">life=ratio=2/3:s=200x200
  44106. </pre></div>
  44107. </li><li>
  44108. Specify a custom rule for evolving a randomly generated grid:
  44109. <div class="example">
  44110. <pre class="example">life=rule=S14/B34
  44111. </pre></div>
  44112. </li><li>
  44113. Full example with slow death effect (mold) using <code>ffplay</code>:
  44114. <div class="example">
  44115. <pre class="example">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
  44116. </pre></div>
  44117. </li></ul>
  44118. <p><a name="allrgb"></a>
  44119. <a name="allyuv"></a>
  44120. <a name="color"></a>
  44121. <a name="haldclutsrc"></a>
  44122. <a name="nullsrc"></a>
  44123. <a name="pal75bars"></a>
  44124. <a name="pal100bars"></a>
  44125. <a name="rgbtestsrc"></a>
  44126. <a name="smptebars"></a>
  44127. <a name="smptehdbars"></a>
  44128. <a name="testsrc"></a>
  44129. <a name="testsrc2"></a>
  44130. <a name="yuvtestsrc"></a>
  44131. </p><a name="allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  44132. <h2 class="section"><a href="ffmpeg-all.html#toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">42.8 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a></h2>
  44133. <p>The <code>allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  44134. </p>
  44135. <p>The <code>allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  44136. </p>
  44137. <p>The <code>color</code> source provides an uniformly colored input.
  44138. </p>
  44139. <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
  44140. <a href="#haldclut">haldclut</a> filter.
  44141. </p>
  44142. <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
  44143. mainly useful to be employed in analysis / debugging tools, or as the
  44144. source for filters which ignore the input data.
  44145. </p>
  44146. <p>The <code>pal75bars</code> source generates a color bars pattern, based on
  44147. EBU PAL recommendations with 75% color levels.
  44148. </p>
  44149. <p>The <code>pal100bars</code> source generates a color bars pattern, based on
  44150. EBU PAL recommendations with 100% color levels.
  44151. </p>
  44152. <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
  44153. detecting RGB vs BGR issues. You should see a red, green and blue
  44154. stripe from top to bottom.
  44155. </p>
  44156. <p>The <code>smptebars</code> source generates a color bars pattern, based on
  44157. the SMPTE Engineering Guideline EG 1-1990.
  44158. </p>
  44159. <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
  44160. the SMPTE RP 219-2002.
  44161. </p>
  44162. <p>The <code>testsrc</code> source generates a test video pattern, showing a
  44163. color pattern, a scrolling gradient and a timestamp. This is mainly
  44164. intended for testing purposes.
  44165. </p>
  44166. <p>The <code>testsrc2</code> source is similar to testsrc, but supports more
  44167. pixel formats instead of just <code>rgb24</code>. This allows using it as an
  44168. input for other tests without requiring a format conversion.
  44169. </p>
  44170. <p>The <code>yuvtestsrc</code> source generates an YUV test pattern. You should
  44171. see a y, cb and cr stripe from top to bottom.
  44172. </p>
  44173. <p>The sources accept the following parameters:
  44174. </p>
  44175. <dl compact="compact">
  44176. <dt>&lsquo;<samp>level</samp>&rsquo;</dt>
  44177. <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
  44178. source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
  44179. pixels to be used as identity matrix for 3D lookup tables. Each component is
  44180. coded on a <code>1/(N*N)</code> scale.
  44181. </p>
  44182. </dd>
  44183. <dt>&lsquo;<samp>color, c</samp>&rsquo;</dt>
  44184. <dd><p>Specify the color of the source, only available in the <code>color</code>
  44185. source. For the syntax of this option, check the
  44186. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  44187. </p>
  44188. </dd>
  44189. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44190. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  44191. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44192. The default value is <code>320x240</code>.
  44193. </p>
  44194. <p>This option is not available with the <code>allrgb</code>, <code>allyuv</code>, and
  44195. <code>haldclutsrc</code> filters.
  44196. </p>
  44197. </dd>
  44198. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44199. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  44200. generated per second. It has to be a string in the format
  44201. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  44202. number or a valid video frame rate abbreviation. The default value is
  44203. &quot;25&quot;.
  44204. </p>
  44205. </dd>
  44206. <dt>&lsquo;<samp>duration, d</samp>&rsquo;</dt>
  44207. <dd><p>Set the duration of the sourced video. See
  44208. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  44209. for the accepted syntax.
  44210. </p>
  44211. <p>If not specified, or the expressed duration is negative, the video is
  44212. supposed to be generated forever.
  44213. </p>
  44214. </dd>
  44215. <dt>&lsquo;<samp>sar</samp>&rsquo;</dt>
  44216. <dd><p>Set the sample aspect ratio of the sourced video.
  44217. </p>
  44218. </dd>
  44219. <dt>&lsquo;<samp>alpha</samp>&rsquo;</dt>
  44220. <dd><p>Specify the alpha (opacity) of the background, only available in the
  44221. <code>testsrc2</code> source. The value must be between 0 (fully transparent) and
  44222. 255 (fully opaque, the default).
  44223. </p>
  44224. </dd>
  44225. <dt>&lsquo;<samp>decimals, n</samp>&rsquo;</dt>
  44226. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  44227. <code>testsrc</code> source.
  44228. </p>
  44229. <p>The displayed timestamp value will correspond to the original
  44230. timestamp value multiplied by the power of 10 of the specified
  44231. value. Default value is 0.
  44232. </p></dd>
  44233. </dl>
  44234. <a name="Examples-37"></a>
  44235. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-37">42.8.1 Examples</a></h3>
  44236. <ul>
  44237. <li>
  44238. Generate a video with a duration of 5.3 seconds, with size
  44239. 176x144 and a frame rate of 10 frames per second:
  44240. <div class="example">
  44241. <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
  44242. </pre></div>
  44243. </li><li>
  44244. The following graph description will generate a red source
  44245. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  44246. frames per second:
  44247. <div class="example">
  44248. <pre class="example">color=c=red@0.2:s=qcif:r=10
  44249. </pre></div>
  44250. </li><li>
  44251. If the input content is to be ignored, <code>nullsrc</code> can be used. The
  44252. following command generates noise in the luminance plane by employing
  44253. the <code>geq</code> filter:
  44254. <div class="example">
  44255. <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
  44256. </pre></div>
  44257. </li></ul>
  44258. <a name="Commands-14"></a>
  44259. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-14">42.8.2 Commands</a></h3>
  44260. <p>The <code>color</code> source supports the following commands:
  44261. </p>
  44262. <dl compact="compact">
  44263. <dt>&lsquo;<samp>c, color</samp>&rsquo;</dt>
  44264. <dd><p>Set the color of the created image. Accepts the same syntax of the
  44265. corresponding &lsquo;<samp>color</samp>&rsquo; option.
  44266. </p></dd>
  44267. </dl>
  44268. <a name="openclsrc"></a>
  44269. <h2 class="section"><a href="ffmpeg-all.html#toc-openclsrc">42.9 openclsrc</a></h2>
  44270. <p>Generate video using an OpenCL program.
  44271. </p>
  44272. <dl compact="compact">
  44273. <dt>&lsquo;<samp>source</samp>&rsquo;</dt>
  44274. <dd><p>OpenCL program source file.
  44275. </p>
  44276. </dd>
  44277. <dt>&lsquo;<samp>kernel</samp>&rsquo;</dt>
  44278. <dd><p>Kernel name in program.
  44279. </p>
  44280. </dd>
  44281. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44282. <dd><p>Size of frames to generate. This must be set.
  44283. </p>
  44284. </dd>
  44285. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  44286. <dd><p>Pixel format to use for the generated frames. This must be set.
  44287. </p>
  44288. </dd>
  44289. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44290. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  44291. </p>
  44292. </dd>
  44293. </dl>
  44294. <p>For details of how the program loading works, see the <a href="#program_005fopencl">program_opencl</a>
  44295. filter.
  44296. </p>
  44297. <p>Example programs:
  44298. </p>
  44299. <ul>
  44300. <li>
  44301. Generate a colour ramp by setting pixel values from the position of the pixel
  44302. in the output image. (Note that this will work with all pixel formats, but
  44303. the generated output will not be the same.)
  44304. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  44305. unsigned int index)
  44306. {
  44307. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  44308. float4 val;
  44309. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  44310. write_imagef(dst, loc, val);
  44311. }
  44312. </pre>
  44313. </li><li>
  44314. Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  44315. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  44316. unsigned int index)
  44317. {
  44318. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  44319. float4 value = 0.0f;
  44320. int x = loc.x + index;
  44321. int y = loc.y + index;
  44322. while (x &gt; 0 || y &gt; 0) {
  44323. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  44324. value = 1.0f;
  44325. break;
  44326. }
  44327. x /= 3;
  44328. y /= 3;
  44329. }
  44330. write_imagef(dst, loc, value);
  44331. }
  44332. </pre>
  44333. </li></ul>
  44334. <a name="sierpinski"></a>
  44335. <h2 class="section"><a href="ffmpeg-all.html#toc-sierpinski">42.10 sierpinski</a></h2>
  44336. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  44337. </p>
  44338. <p>This source accepts the following options:
  44339. </p>
  44340. <dl compact="compact">
  44341. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44342. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  44343. </p>
  44344. </dd>
  44345. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44346. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44347. value is &quot;25&quot;.
  44348. </p>
  44349. </dd>
  44350. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  44351. <dd><p>Set seed which is used for random panning.
  44352. </p>
  44353. </dd>
  44354. <dt>&lsquo;<samp>jump</samp>&rsquo;</dt>
  44355. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  44356. </p>
  44357. </dd>
  44358. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  44359. <dd><p>Set fractal type, can be default <code>carpet</code> or <code>triangle</code>.
  44360. </p></dd>
  44361. </dl>
  44362. <a name="Video-Sinks"></a>
  44363. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Video-Sinks">43 Video Sinks</a></h1>
  44364. <p>Below is a description of the currently available video sinks.
  44365. </p>
  44366. <a name="buffersink"></a>
  44367. <h2 class="section"><a href="ffmpeg-all.html#toc-buffersink">43.1 buffersink</a></h2>
  44368. <p>Buffer video frames, and make them available to the end of the filter
  44369. graph.
  44370. </p>
  44371. <p>This sink is mainly intended for programmatic use, in particular
  44372. through the interface defined in &lsquo;<tt>libavfilter/buffersink.h</tt>&rsquo;
  44373. or the options system.
  44374. </p>
  44375. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  44376. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  44377. parameter to <code>avfilter_init_filter</code> for initialization.
  44378. </p>
  44379. <a name="nullsink"></a>
  44380. <h2 class="section"><a href="ffmpeg-all.html#toc-nullsink">43.2 nullsink</a></h2>
  44381. <p>Null video sink: do absolutely nothing with the input video. It is
  44382. mainly useful as a template and for use in analysis / debugging
  44383. tools.
  44384. </p>
  44385. <a name="Multimedia-Filters"></a>
  44386. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Filters">44 Multimedia Filters</a></h1>
  44387. <p>Below is a description of the currently available multimedia filters.
  44388. </p>
  44389. <a name="abitscope"></a>
  44390. <h2 class="section"><a href="ffmpeg-all.html#toc-abitscope">44.1 abitscope</a></h2>
  44391. <p>Convert input audio to a video output, displaying the audio bit scope.
  44392. </p>
  44393. <p>The filter accepts the following options:
  44394. </p>
  44395. <dl compact="compact">
  44396. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44397. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44398. value is &quot;25&quot;.
  44399. </p>
  44400. </dd>
  44401. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44402. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  44403. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44404. Default value is <code>1024x256</code>.
  44405. </p>
  44406. </dd>
  44407. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  44408. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  44409. draw channels. Unrecognized or missing colors will be replaced
  44410. by white color.
  44411. </p></dd>
  44412. </dl>
  44413. <a name="adrawgraph"></a>
  44414. <h2 class="section"><a href="ffmpeg-all.html#toc-adrawgraph">44.2 adrawgraph</a></h2>
  44415. <p>Draw a graph using input audio metadata.
  44416. </p>
  44417. <p>See <a href="#drawgraph">drawgraph</a>
  44418. </p>
  44419. <a name="agraphmonitor"></a>
  44420. <h2 class="section"><a href="ffmpeg-all.html#toc-agraphmonitor">44.3 agraphmonitor</a></h2>
  44421. <p>See <a href="#graphmonitor">graphmonitor</a>.
  44422. </p>
  44423. <a name="ahistogram"></a>
  44424. <h2 class="section"><a href="ffmpeg-all.html#toc-ahistogram">44.4 ahistogram</a></h2>
  44425. <p>Convert input audio to a video output, displaying the volume histogram.
  44426. </p>
  44427. <p>The filter accepts the following options:
  44428. </p>
  44429. <dl compact="compact">
  44430. <dt>&lsquo;<samp>dmode</samp>&rsquo;</dt>
  44431. <dd><p>Specify how histogram is calculated.
  44432. </p>
  44433. <p>It accepts the following values:
  44434. </p><dl compact="compact">
  44435. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  44436. <dd><p>Use single histogram for all channels.
  44437. </p></dd>
  44438. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  44439. <dd><p>Use separate histogram for each channel.
  44440. </p></dd>
  44441. </dl>
  44442. <p>Default is <code>single</code>.
  44443. </p>
  44444. </dd>
  44445. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44446. <dd><p>Set frame rate, expressed as number of frames per second. Default
  44447. value is &quot;25&quot;.
  44448. </p>
  44449. </dd>
  44450. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44451. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  44452. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44453. Default value is <code>hd720</code>.
  44454. </p>
  44455. </dd>
  44456. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  44457. <dd><p>Set display scale.
  44458. </p>
  44459. <p>It accepts the following values:
  44460. </p><dl compact="compact">
  44461. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  44462. <dd><p>logarithmic
  44463. </p></dd>
  44464. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  44465. <dd><p>square root
  44466. </p></dd>
  44467. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  44468. <dd><p>cubic root
  44469. </p></dd>
  44470. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  44471. <dd><p>linear
  44472. </p></dd>
  44473. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  44474. <dd><p>reverse logarithmic
  44475. </p></dd>
  44476. </dl>
  44477. <p>Default is <code>log</code>.
  44478. </p>
  44479. </dd>
  44480. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  44481. <dd><p>Set amplitude scale.
  44482. </p>
  44483. <p>It accepts the following values:
  44484. </p><dl compact="compact">
  44485. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  44486. <dd><p>logarithmic
  44487. </p></dd>
  44488. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  44489. <dd><p>linear
  44490. </p></dd>
  44491. </dl>
  44492. <p>Default is <code>log</code>.
  44493. </p>
  44494. </dd>
  44495. <dt>&lsquo;<samp>acount</samp>&rsquo;</dt>
  44496. <dd><p>Set how much frames to accumulate in histogram.
  44497. Default is 1. Setting this to -1 accumulates all frames.
  44498. </p>
  44499. </dd>
  44500. <dt>&lsquo;<samp>rheight</samp>&rsquo;</dt>
  44501. <dd><p>Set histogram ratio of window height.
  44502. </p>
  44503. </dd>
  44504. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  44505. <dd><p>Set sonogram sliding.
  44506. </p>
  44507. <p>It accepts the following values:
  44508. </p><dl compact="compact">
  44509. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  44510. <dd><p>replace old rows with new ones.
  44511. </p></dd>
  44512. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  44513. <dd><p>scroll from top to bottom.
  44514. </p></dd>
  44515. </dl>
  44516. <p>Default is <code>replace</code>.
  44517. </p></dd>
  44518. </dl>
  44519. <a name="aphasemeter"></a>
  44520. <h2 class="section"><a href="ffmpeg-all.html#toc-aphasemeter">44.5 aphasemeter</a></h2>
  44521. <p>Measures phase of input audio, which is exported as metadata <code>lavfi.aphasemeter.phase</code>,
  44522. representing mean phase of current audio frame. A video output can also be produced and is
  44523. enabled by default. The audio is passed through as first output.
  44524. </p>
  44525. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  44526. range <code>[-1, 1]</code> where <code>-1</code> means left and right channels are completely out of phase
  44527. and <code>1</code> means channels are in phase.
  44528. </p>
  44529. <p>The filter accepts the following options, all related to its video output:
  44530. </p>
  44531. <dl compact="compact">
  44532. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44533. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  44534. </p>
  44535. </dd>
  44536. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44537. <dd><p>Set the video size for the output. For the syntax of this option, check the
  44538. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44539. Default value is <code>800x400</code>.
  44540. </p>
  44541. </dd>
  44542. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  44543. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  44544. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  44545. <dd><p>Specify the red, green, blue contrast. Default values are <code>2</code>,
  44546. <code>7</code> and <code>1</code>.
  44547. Allowed range is <code>[0, 255]</code>.
  44548. </p>
  44549. </dd>
  44550. <dt>&lsquo;<samp>mpc</samp>&rsquo;</dt>
  44551. <dd><p>Set color which will be used for drawing median phase. If color is
  44552. <code>none</code> which is default, no median phase value will be drawn.
  44553. </p>
  44554. </dd>
  44555. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  44556. <dd><p>Enable video output. Default is enabled.
  44557. </p></dd>
  44558. </dl>
  44559. <a name="avectorscope"></a>
  44560. <h2 class="section"><a href="ffmpeg-all.html#toc-avectorscope">44.6 avectorscope</a></h2>
  44561. <p>Convert input audio to a video output, representing the audio vector
  44562. scope.
  44563. </p>
  44564. <p>The filter is used to measure the difference between channels of stereo
  44565. audio stream. A monaural signal, consisting of identical left and right
  44566. signal, results in straight vertical line. Any stereo separation is visible
  44567. as a deviation from this line, creating a Lissajous figure.
  44568. If the straight (or deviation from it) but horizontal line appears this
  44569. indicates that the left and right channels are out of phase.
  44570. </p>
  44571. <p>The filter accepts the following options:
  44572. </p>
  44573. <dl compact="compact">
  44574. <dt>&lsquo;<samp>mode, m</samp>&rsquo;</dt>
  44575. <dd><p>Set the vectorscope mode.
  44576. </p>
  44577. <p>Available values are:
  44578. </p><dl compact="compact">
  44579. <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
  44580. <dd><p>Lissajous rotated by 45 degrees.
  44581. </p>
  44582. </dd>
  44583. <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
  44584. <dd><p>Same as above but not rotated.
  44585. </p>
  44586. </dd>
  44587. <dt>&lsquo;<samp>polar</samp>&rsquo;</dt>
  44588. <dd><p>Shape resembling half of circle.
  44589. </p></dd>
  44590. </dl>
  44591. <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
  44592. </p>
  44593. </dd>
  44594. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  44595. <dd><p>Set the video size for the output. For the syntax of this option, check the
  44596. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44597. Default value is <code>400x400</code>.
  44598. </p>
  44599. </dd>
  44600. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  44601. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  44602. </p>
  44603. </dd>
  44604. <dt>&lsquo;<samp>rc</samp>&rsquo;</dt>
  44605. <dt>&lsquo;<samp>gc</samp>&rsquo;</dt>
  44606. <dt>&lsquo;<samp>bc</samp>&rsquo;</dt>
  44607. <dt>&lsquo;<samp>ac</samp>&rsquo;</dt>
  44608. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code>40</code>,
  44609. <code>160</code>, <code>80</code> and <code>255</code>.
  44610. Allowed range is <code>[0, 255]</code>.
  44611. </p>
  44612. </dd>
  44613. <dt>&lsquo;<samp>rf</samp>&rsquo;</dt>
  44614. <dt>&lsquo;<samp>gf</samp>&rsquo;</dt>
  44615. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  44616. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  44617. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code>15</code>,
  44618. <code>10</code>, <code>5</code> and <code>5</code>.
  44619. Allowed range is <code>[0, 255]</code>.
  44620. </p>
  44621. </dd>
  44622. <dt>&lsquo;<samp>zoom</samp>&rsquo;</dt>
  44623. <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[0, 10]</code>.
  44624. Values lower than <var>1</var> will auto adjust zoom factor to maximal possible value.
  44625. </p>
  44626. </dd>
  44627. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  44628. <dd><p>Set the vectorscope drawing mode.
  44629. </p>
  44630. <p>Available values are:
  44631. </p><dl compact="compact">
  44632. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  44633. <dd><p>Draw dot for each sample.
  44634. </p>
  44635. </dd>
  44636. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  44637. <dd><p>Draw line between previous and current sample.
  44638. </p></dd>
  44639. </dl>
  44640. <p>Default value is &lsquo;<samp>dot</samp>&rsquo;.
  44641. </p>
  44642. </dd>
  44643. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  44644. <dd><p>Specify amplitude scale of audio samples.
  44645. </p>
  44646. <p>Available values are:
  44647. </p><dl compact="compact">
  44648. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  44649. <dd><p>Linear.
  44650. </p>
  44651. </dd>
  44652. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  44653. <dd><p>Square root.
  44654. </p>
  44655. </dd>
  44656. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  44657. <dd><p>Cubic root.
  44658. </p>
  44659. </dd>
  44660. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  44661. <dd><p>Logarithmic.
  44662. </p></dd>
  44663. </dl>
  44664. </dd>
  44665. <dt>&lsquo;<samp>swap</samp>&rsquo;</dt>
  44666. <dd><p>Swap left channel axis with right channel axis.
  44667. </p>
  44668. </dd>
  44669. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  44670. <dd><p>Mirror axis.
  44671. </p>
  44672. <dl compact="compact">
  44673. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  44674. <dd><p>No mirror.
  44675. </p>
  44676. </dd>
  44677. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  44678. <dd><p>Mirror only x axis.
  44679. </p>
  44680. </dd>
  44681. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  44682. <dd><p>Mirror only y axis.
  44683. </p>
  44684. </dd>
  44685. <dt>&lsquo;<samp>xy</samp>&rsquo;</dt>
  44686. <dd><p>Mirror both axis.
  44687. </p></dd>
  44688. </dl>
  44689. </dd>
  44690. </dl>
  44691. <a name="Examples-142"></a>
  44692. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-142">44.6.1 Examples</a></h3>
  44693. <ul>
  44694. <li>
  44695. Complete example using <code>ffplay</code>:
  44696. <div class="example">
  44697. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  44698. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  44699. </pre></div>
  44700. </li></ul>
  44701. <a name="bench_002c-abench"></a>
  44702. <h2 class="section"><a href="ffmpeg-all.html#toc-bench_002c-abench">44.7 bench, abench</a></h2>
  44703. <p>Benchmark part of a filtergraph.
  44704. </p>
  44705. <p>The filter accepts the following options:
  44706. </p>
  44707. <dl compact="compact">
  44708. <dt>&lsquo;<samp>action</samp>&rsquo;</dt>
  44709. <dd><p>Start or stop a timer.
  44710. </p>
  44711. <p>Available values are:
  44712. </p><dl compact="compact">
  44713. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  44714. <dd><p>Get the current time, set it as frame metadata (using the key
  44715. <code>lavfi.bench.start_time</code>), and forward the frame to the next filter.
  44716. </p>
  44717. </dd>
  44718. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  44719. <dd><p>Get the current time and fetch the <code>lavfi.bench.start_time</code> metadata from
  44720. the input frame metadata to get the time difference. Time difference, average,
  44721. maximum and minimum time (respectively <code>t</code>, <code>avg</code>, <code>max</code> and
  44722. <code>min</code>) are then printed. The timestamps are expressed in seconds.
  44723. </p></dd>
  44724. </dl>
  44725. </dd>
  44726. </dl>
  44727. <a name="Examples-70"></a>
  44728. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-70">44.7.1 Examples</a></h3>
  44729. <ul>
  44730. <li>
  44731. Benchmark <a href="#selectivecolor">selectivecolor</a> filter:
  44732. <div class="example">
  44733. <pre class="example">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  44734. </pre></div>
  44735. </li></ul>
  44736. <a name="concat-2"></a>
  44737. <h2 class="section"><a href="ffmpeg-all.html#toc-concat-2">44.8 concat</a></h2>
  44738. <p>Concatenate audio and video streams, joining them together one after the
  44739. other.
  44740. </p>
  44741. <p>The filter works on segments of synchronized video and audio streams. All
  44742. segments must have the same number of streams of each type, and that will
  44743. also be the number of streams at output.
  44744. </p>
  44745. <p>The filter accepts the following options:
  44746. </p>
  44747. <dl compact="compact">
  44748. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  44749. <dd><p>Set the number of segments. Default is 2.
  44750. </p>
  44751. </dd>
  44752. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  44753. <dd><p>Set the number of output video streams, that is also the number of video
  44754. streams in each segment. Default is 1.
  44755. </p>
  44756. </dd>
  44757. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  44758. <dd><p>Set the number of output audio streams, that is also the number of audio
  44759. streams in each segment. Default is 0.
  44760. </p>
  44761. </dd>
  44762. <dt>&lsquo;<samp>unsafe</samp>&rsquo;</dt>
  44763. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  44764. </p>
  44765. </dd>
  44766. </dl>
  44767. <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
  44768. <var>a</var> audio outputs.
  44769. </p>
  44770. <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
  44771. segment, in the same order as the outputs, then the inputs for the second
  44772. segment, etc.
  44773. </p>
  44774. <p>Related streams do not always have exactly the same duration, for various
  44775. reasons including codec frame size or sloppy authoring. For that reason,
  44776. related synchronized streams (e.g. a video and its audio track) should be
  44777. concatenated at once. The concat filter will use the duration of the longest
  44778. stream in each segment (except the last one), and if necessary pad shorter
  44779. audio streams with silence.
  44780. </p>
  44781. <p>For this filter to work correctly, all segments must start at timestamp 0.
  44782. </p>
  44783. <p>All corresponding streams must have the same parameters in all segments; the
  44784. filtering system will automatically select a common pixel format for video
  44785. streams, and a common sample format, sample rate and channel layout for
  44786. audio streams, but other settings, such as resolution, must be converted
  44787. explicitly by the user.
  44788. </p>
  44789. <p>Different frame rates are acceptable but will result in variable frame rate
  44790. at output; be sure to configure the output file to handle it.
  44791. </p>
  44792. <a name="Examples-2"></a>
  44793. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-2">44.8.1 Examples</a></h3>
  44794. <ul>
  44795. <li>
  44796. Concatenate an opening, an episode and an ending, all in bilingual version
  44797. (video in stream 0, audio in streams 1 and 2):
  44798. <div class="example">
  44799. <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  44800. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  44801. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  44802. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  44803. </pre></div>
  44804. </li><li>
  44805. Concatenate two parts, handling audio and video separately, using the
  44806. (a)movie sources, and adjusting the resolution:
  44807. <div class="example">
  44808. <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  44809. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  44810. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  44811. </pre></div>
  44812. <p>Note that a desync will happen at the stitch if the audio and video streams
  44813. do not have exactly the same duration in the first file.
  44814. </p>
  44815. </li></ul>
  44816. <a name="Commands-62"></a>
  44817. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-62">44.8.2 Commands</a></h3>
  44818. <p>This filter supports the following commands:
  44819. </p><dl compact="compact">
  44820. <dt>&lsquo;<samp>next</samp>&rsquo;</dt>
  44821. <dd><p>Close the current segment and step to the next one
  44822. </p></dd>
  44823. </dl>
  44824. <p><a name="ebur128"></a>
  44825. </p><a name="ebur128-1"></a>
  44826. <h2 class="section"><a href="ffmpeg-all.html#toc-ebur128-1">44.9 ebur128</a></h2>
  44827. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  44828. level. By default, it logs a message at a frequency of 10Hz with the
  44829. Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
  44830. Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
  44831. </p>
  44832. <p>The filter can only analyze streams which have a sampling rate of 48000 Hz and whose
  44833. sample format is double-precision floating point. The input stream will be converted to
  44834. this specification, if needed. Users may need to insert aformat and/or aresample filters
  44835. after this filter to obtain the original parameters.
  44836. </p>
  44837. <p>The filter also has a video output (see the <var>video</var> option) with a real
  44838. time graph to observe the loudness evolution. The graphic contains the logged
  44839. message mentioned above, so it is not printed anymore when this option is set,
  44840. unless the verbose logging is set. The main graphing area contains the
  44841. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  44842. the momentary loudness (400 milliseconds), but can optionally be configured
  44843. to instead display short-term loudness (see <var>gauge</var>).
  44844. </p>
  44845. <p>The green area marks a +/- 1LU target range around the target loudness
  44846. (-23LUFS by default, unless modified through <var>target</var>).
  44847. </p>
  44848. <p>More information about the Loudness Recommendation EBU R128 on
  44849. <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  44850. </p>
  44851. <p>The filter accepts the following options:
  44852. </p>
  44853. <dl compact="compact">
  44854. <dt>&lsquo;<samp>video</samp>&rsquo;</dt>
  44855. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  44856. option is set or no. The video stream will be the first output stream if
  44857. activated. Default is <code>0</code>.
  44858. </p>
  44859. </dd>
  44860. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  44861. <dd><p>Set the video size. This option is for video only. For the syntax of this
  44862. option, check the
  44863. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  44864. Default and minimum resolution is <code>640x480</code>.
  44865. </p>
  44866. </dd>
  44867. <dt>&lsquo;<samp>meter</samp>&rsquo;</dt>
  44868. <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
  44869. <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  44870. other integer value between this range is allowed.
  44871. </p>
  44872. </dd>
  44873. <dt>&lsquo;<samp>metadata</samp>&rsquo;</dt>
  44874. <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
  44875. into 100ms output frames, each of them containing various loudness information
  44876. in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
  44877. </p>
  44878. <p>Default is <code>0</code>.
  44879. </p>
  44880. </dd>
  44881. <dt>&lsquo;<samp>framelog</samp>&rsquo;</dt>
  44882. <dd><p>Force the frame logging level.
  44883. </p>
  44884. <p>Available values are:
  44885. </p><dl compact="compact">
  44886. <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
  44887. <dd><p>information logging level
  44888. </p></dd>
  44889. <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
  44890. <dd><p>verbose logging level
  44891. </p></dd>
  44892. </dl>
  44893. <p>By default, the logging level is set to <var>info</var>. If the &lsquo;<samp>video</samp>&rsquo; or
  44894. the &lsquo;<samp>metadata</samp>&rsquo; options are set, it switches to <var>verbose</var>.
  44895. </p>
  44896. </dd>
  44897. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  44898. <dd><p>Set peak mode(s).
  44899. </p>
  44900. <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
  44901. values are:
  44902. </p><dl compact="compact">
  44903. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  44904. <dd><p>Disable any peak mode (default).
  44905. </p></dd>
  44906. <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
  44907. <dd><p>Enable sample-peak mode.
  44908. </p>
  44909. <p>Simple peak mode looking for the higher sample value. It logs a message
  44910. for sample-peak (identified by <code>SPK</code>).
  44911. </p></dd>
  44912. <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
  44913. <dd><p>Enable true-peak mode.
  44914. </p>
  44915. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  44916. stream for better peak accuracy. It logs a message for true-peak.
  44917. (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
  44918. This mode requires a build with <code>libswresample</code>.
  44919. </p></dd>
  44920. </dl>
  44921. </dd>
  44922. <dt>&lsquo;<samp>dualmono</samp>&rsquo;</dt>
  44923. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  44924. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  44925. If set to <code>true</code>, this option will compensate for this effect.
  44926. Multi-channel input files are not affected by this option.
  44927. </p>
  44928. </dd>
  44929. <dt>&lsquo;<samp>panlaw</samp>&rsquo;</dt>
  44930. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  44931. This parameter is optional, and has a default value of -3.01dB.
  44932. </p>
  44933. </dd>
  44934. <dt>&lsquo;<samp>target</samp>&rsquo;</dt>
  44935. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  44936. This parameter is optional and has a default value of -23LUFS as specified
  44937. by EBU R128. However, material published online may prefer a level of -16LUFS
  44938. (e.g. for use with podcasts or video platforms).
  44939. </p>
  44940. </dd>
  44941. <dt>&lsquo;<samp>gauge</samp>&rsquo;</dt>
  44942. <dd><p>Set the value displayed by the gauge. Valid values are <code>momentary</code> and s
  44943. <code>shortterm</code>. By default the momentary value will be used, but in certain
  44944. scenarios it may be more useful to observe the short term value instead (e.g.
  44945. live mixing).
  44946. </p>
  44947. </dd>
  44948. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  44949. <dd><p>Sets the display scale for the loudness. Valid parameters are <code>absolute</code>
  44950. (in LUFS) or <code>relative</code> (LU) relative to the target. This only affects the
  44951. video output, not the summary or continuous log output.
  44952. </p></dd>
  44953. </dl>
  44954. <a name="Examples-19"></a>
  44955. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-19">44.9.1 Examples</a></h3>
  44956. <ul>
  44957. <li>
  44958. Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
  44959. <div class="example">
  44960. <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  44961. </pre></div>
  44962. </li><li>
  44963. Run an analysis with <code>ffmpeg</code>:
  44964. <div class="example">
  44965. <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  44966. </pre></div>
  44967. </li></ul>
  44968. <a name="interleave_002c-ainterleave"></a>
  44969. <h2 class="section"><a href="ffmpeg-all.html#toc-interleave_002c-ainterleave">44.10 interleave, ainterleave</a></h2>
  44970. <p>Temporally interleave frames from several inputs.
  44971. </p>
  44972. <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
  44973. </p>
  44974. <p>These filters read frames from several inputs and send the oldest
  44975. queued frame to the output.
  44976. </p>
  44977. <p>Input streams must have well defined, monotonically increasing frame
  44978. timestamp values.
  44979. </p>
  44980. <p>In order to submit one frame to output, these filters need to enqueue
  44981. at least one frame for each input, so they cannot work in case one
  44982. input is not yet terminated and will not receive incoming frames.
  44983. </p>
  44984. <p>For example consider the case when one input is a <code>select</code> filter
  44985. which always drops input frames. The <code>interleave</code> filter will keep
  44986. reading from that input, but it will never be able to send new frames
  44987. to output until the input sends an end-of-stream signal.
  44988. </p>
  44989. <p>Also, depending on inputs synchronization, the filters will drop
  44990. frames in case one input receives more frames than the other ones, and
  44991. the queue is already filled.
  44992. </p>
  44993. <p>These filters accept the following options:
  44994. </p>
  44995. <dl compact="compact">
  44996. <dt>&lsquo;<samp>nb_inputs, n</samp>&rsquo;</dt>
  44997. <dd><p>Set the number of different inputs, it is 2 by default.
  44998. </p></dd>
  44999. </dl>
  45000. <a name="Examples-74"></a>
  45001. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-74">44.10.1 Examples</a></h3>
  45002. <ul>
  45003. <li>
  45004. Interleave frames belonging to different streams using <code>ffmpeg</code>:
  45005. <div class="example">
  45006. <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  45007. </pre></div>
  45008. </li><li>
  45009. Add flickering blur effect:
  45010. <div class="example">
  45011. <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  45012. </pre></div>
  45013. </li></ul>
  45014. <a name="metadata_002c-ametadata"></a>
  45015. <h2 class="section"><a href="ffmpeg-all.html#toc-metadata_002c-ametadata">44.11 metadata, ametadata</a></h2>
  45016. <p>Manipulate frame metadata.
  45017. </p>
  45018. <p>This filter accepts the following options:
  45019. </p>
  45020. <dl compact="compact">
  45021. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  45022. <dd><p>Set mode of operation of the filter.
  45023. </p>
  45024. <p>Can be one of the following:
  45025. </p>
  45026. <dl compact="compact">
  45027. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  45028. <dd><p>If both <code>value</code> and <code>key</code> is set, select frames
  45029. which have such metadata. If only <code>key</code> is set, select
  45030. every frame that has such key in metadata.
  45031. </p>
  45032. </dd>
  45033. <dt>&lsquo;<samp>add</samp>&rsquo;</dt>
  45034. <dd><p>Add new metadata <code>key</code> and <code>value</code>. If key is already available
  45035. do nothing.
  45036. </p>
  45037. </dd>
  45038. <dt>&lsquo;<samp>modify</samp>&rsquo;</dt>
  45039. <dd><p>Modify value of already present key.
  45040. </p>
  45041. </dd>
  45042. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  45043. <dd><p>If <code>value</code> is set, delete only keys that have such value.
  45044. Otherwise, delete key. If <code>key</code> is not set, delete all metadata values in
  45045. the frame.
  45046. </p>
  45047. </dd>
  45048. <dt>&lsquo;<samp>print</samp>&rsquo;</dt>
  45049. <dd><p>Print key and its value if metadata was found. If <code>key</code> is not set print all
  45050. metadata values available in frame.
  45051. </p></dd>
  45052. </dl>
  45053. </dd>
  45054. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  45055. <dd><p>Set key used with all modes. Must be set for all modes except <code>print</code> and <code>delete</code>.
  45056. </p>
  45057. </dd>
  45058. <dt>&lsquo;<samp>value</samp>&rsquo;</dt>
  45059. <dd><p>Set metadata value which will be used. This option is mandatory for
  45060. <code>modify</code> and <code>add</code> mode.
  45061. </p>
  45062. </dd>
  45063. <dt>&lsquo;<samp>function</samp>&rsquo;</dt>
  45064. <dd><p>Which function to use when comparing metadata value and <code>value</code>.
  45065. </p>
  45066. <p>Can be one of following:
  45067. </p>
  45068. <dl compact="compact">
  45069. <dt>&lsquo;<samp>same_str</samp>&rsquo;</dt>
  45070. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code>value</code>.
  45071. </p>
  45072. </dd>
  45073. <dt>&lsquo;<samp>starts_with</samp>&rsquo;</dt>
  45074. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  45075. the <code>value</code> option string.
  45076. </p>
  45077. </dd>
  45078. <dt>&lsquo;<samp>less</samp>&rsquo;</dt>
  45079. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code>value</code>.
  45080. </p>
  45081. </dd>
  45082. <dt>&lsquo;<samp>equal</samp>&rsquo;</dt>
  45083. <dd><p>Values are interpreted as floats, returns true if <code>value</code> is equal with metadata value.
  45084. </p>
  45085. </dd>
  45086. <dt>&lsquo;<samp>greater</samp>&rsquo;</dt>
  45087. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code>value</code>.
  45088. </p>
  45089. </dd>
  45090. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45091. <dd><p>Values are interpreted as floats, returns true if expression from option <code>expr</code>
  45092. evaluates to true.
  45093. </p>
  45094. </dd>
  45095. <dt>&lsquo;<samp>ends_with</samp>&rsquo;</dt>
  45096. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  45097. the <code>value</code> option string.
  45098. </p></dd>
  45099. </dl>
  45100. </dd>
  45101. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45102. <dd><p>Set expression which is used when <code>function</code> is set to <code>expr</code>.
  45103. The expression is evaluated through the eval API and can contain the following
  45104. constants:
  45105. </p>
  45106. <dl compact="compact">
  45107. <dt>&lsquo;<samp>VALUE1</samp>&rsquo;</dt>
  45108. <dd><p>Float representation of <code>value</code> from metadata key.
  45109. </p>
  45110. </dd>
  45111. <dt>&lsquo;<samp>VALUE2</samp>&rsquo;</dt>
  45112. <dd><p>Float representation of <code>value</code> as supplied by user in <code>value</code> option.
  45113. </p></dd>
  45114. </dl>
  45115. </dd>
  45116. <dt>&lsquo;<samp>file</samp>&rsquo;</dt>
  45117. <dd><p>If specified in <code>print</code> mode, output is written to the named file. Instead of
  45118. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  45119. for standard output. If <code>file</code> option is not set, output is written to the log
  45120. with AV_LOG_INFO loglevel.
  45121. </p>
  45122. </dd>
  45123. <dt>&lsquo;<samp>direct</samp>&rsquo;</dt>
  45124. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var>file</var>.
  45125. </p>
  45126. </dd>
  45127. </dl>
  45128. <a name="Examples-91"></a>
  45129. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-91">44.11.1 Examples</a></h3>
  45130. <ul>
  45131. <li>
  45132. Print all metadata values for frames with key <code>lavfi.signalstats.YDIF</code> with values
  45133. between 0 and 1.
  45134. <div class="example">
  45135. <pre class="example">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  45136. </pre></div>
  45137. </li><li>
  45138. Print silencedetect output to file &lsquo;<tt>metadata.txt</tt>&rsquo;.
  45139. <div class="example">
  45140. <pre class="example">silencedetect,ametadata=mode=print:file=metadata.txt
  45141. </pre></div>
  45142. </li><li>
  45143. Direct all metadata to a pipe with file descriptor 4.
  45144. <div class="example">
  45145. <pre class="example">metadata=mode=print:file='pipe\:4'
  45146. </pre></div>
  45147. </li></ul>
  45148. <a name="perms_002c-aperms"></a>
  45149. <h2 class="section"><a href="ffmpeg-all.html#toc-perms_002c-aperms">44.12 perms, aperms</a></h2>
  45150. <p>Set read/write permissions for the output frames.
  45151. </p>
  45152. <p>These filters are mainly aimed at developers to test direct path in the
  45153. following filter in the filtergraph.
  45154. </p>
  45155. <p>The filters accept the following options:
  45156. </p>
  45157. <dl compact="compact">
  45158. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  45159. <dd><p>Select the permissions mode.
  45160. </p>
  45161. <p>It accepts the following values:
  45162. </p><dl compact="compact">
  45163. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  45164. <dd><p>Do nothing. This is the default.
  45165. </p></dd>
  45166. <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
  45167. <dd><p>Set all the output frames read-only.
  45168. </p></dd>
  45169. <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
  45170. <dd><p>Set all the output frames directly writable.
  45171. </p></dd>
  45172. <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
  45173. <dd><p>Make the frame read-only if writable, and writable if read-only.
  45174. </p></dd>
  45175. <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
  45176. <dd><p>Set each output frame read-only or writable randomly.
  45177. </p></dd>
  45178. </dl>
  45179. </dd>
  45180. <dt>&lsquo;<samp>seed</samp>&rsquo;</dt>
  45181. <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
  45182. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  45183. <code>-1</code>, the filter will try to use a good random seed on a best effort
  45184. basis.
  45185. </p></dd>
  45186. </dl>
  45187. <p>Note: in case of auto-inserted filter between the permission filter and the
  45188. following one, the permission might not be received as expected in that
  45189. following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
  45190. perms/aperms filter can avoid this problem.
  45191. </p>
  45192. <a name="realtime_002c-arealtime"></a>
  45193. <h2 class="section"><a href="ffmpeg-all.html#toc-realtime_002c-arealtime">44.13 realtime, arealtime</a></h2>
  45194. <p>Slow down filtering to match real time approximately.
  45195. </p>
  45196. <p>These filters will pause the filtering for a variable amount of time to
  45197. match the output rate with the input timestamps.
  45198. They are similar to the &lsquo;<samp>re</samp>&rsquo; option to <code>ffmpeg</code>.
  45199. </p>
  45200. <p>They accept the following options:
  45201. </p>
  45202. <dl compact="compact">
  45203. <dt>&lsquo;<samp>limit</samp>&rsquo;</dt>
  45204. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  45205. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  45206. </p></dd>
  45207. <dt>&lsquo;<samp>speed</samp>&rsquo;</dt>
  45208. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  45209. Values larger than 1.0 will result in faster than realtime processing,
  45210. smaller will slow processing down. The <var>limit</var> is automatically adapted
  45211. accordingly. Default is 1.0.
  45212. </p>
  45213. <p>A processing speed faster than what is possible without these filters cannot
  45214. be achieved.
  45215. </p></dd>
  45216. </dl>
  45217. <p><a name="select"></a>
  45218. </p><a name="select_002c-aselect"></a>
  45219. <h2 class="section"><a href="ffmpeg-all.html#toc-select_002c-aselect">44.14 select, aselect</a></h2>
  45220. <p>Select frames to pass in output.
  45221. </p>
  45222. <p>This filter accepts the following options:
  45223. </p>
  45224. <dl compact="compact">
  45225. <dt>&lsquo;<samp>expr, e</samp>&rsquo;</dt>
  45226. <dd><p>Set expression, which is evaluated for each input frame.
  45227. </p>
  45228. <p>If the expression is evaluated to zero, the frame is discarded.
  45229. </p>
  45230. <p>If the evaluation result is negative or NaN, the frame is sent to the
  45231. first output; otherwise it is sent to the output with index
  45232. <code>ceil(val)-1</code>, assuming that the input index starts from 0.
  45233. </p>
  45234. <p>For example a value of <code>1.2</code> corresponds to the output with index
  45235. <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  45236. </p>
  45237. </dd>
  45238. <dt>&lsquo;<samp>outputs, n</samp>&rsquo;</dt>
  45239. <dd><p>Set the number of outputs. The output to which to send the selected
  45240. frame is based on the result of the evaluation. Default value is 1.
  45241. </p></dd>
  45242. </dl>
  45243. <p>The expression can contain the following constants:
  45244. </p>
  45245. <dl compact="compact">
  45246. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  45247. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  45248. </p>
  45249. </dd>
  45250. <dt>&lsquo;<samp>selected_n</samp>&rsquo;</dt>
  45251. <dd><p>The (sequential) number of the selected frame, starting from 0.
  45252. </p>
  45253. </dd>
  45254. <dt>&lsquo;<samp>prev_selected_n</samp>&rsquo;</dt>
  45255. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  45256. </p>
  45257. </dd>
  45258. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  45259. <dd><p>The timebase of the input timestamps.
  45260. </p>
  45261. </dd>
  45262. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  45263. <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
  45264. expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
  45265. </p>
  45266. </dd>
  45267. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  45268. <dd><p>The PTS of the filtered video frame,
  45269. expressed in seconds. It&rsquo;s NAN if undefined.
  45270. </p>
  45271. </dd>
  45272. <dt>&lsquo;<samp>prev_pts</samp>&rsquo;</dt>
  45273. <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
  45274. </p>
  45275. </dd>
  45276. <dt>&lsquo;<samp>prev_selected_pts</samp>&rsquo;</dt>
  45277. <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
  45278. </p>
  45279. </dd>
  45280. <dt>&lsquo;<samp>prev_selected_t</samp>&rsquo;</dt>
  45281. <dd><p>The PTS of the last previously selected video frame, expressed in seconds. It&rsquo;s NAN if undefined.
  45282. </p>
  45283. </dd>
  45284. <dt>&lsquo;<samp>start_pts</samp>&rsquo;</dt>
  45285. <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
  45286. </p>
  45287. </dd>
  45288. <dt>&lsquo;<samp>start_t</samp>&rsquo;</dt>
  45289. <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
  45290. </p>
  45291. </dd>
  45292. <dt>&lsquo;<samp>pict_type <em>(video only)</em></samp>&rsquo;</dt>
  45293. <dd><p>The type of the filtered frame. It can assume one of the following
  45294. values:
  45295. </p><dl compact="compact">
  45296. <dt>&lsquo;<samp>I</samp>&rsquo;</dt>
  45297. <dt>&lsquo;<samp>P</samp>&rsquo;</dt>
  45298. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  45299. <dt>&lsquo;<samp>S</samp>&rsquo;</dt>
  45300. <dt>&lsquo;<samp>SI</samp>&rsquo;</dt>
  45301. <dt>&lsquo;<samp>SP</samp>&rsquo;</dt>
  45302. <dt>&lsquo;<samp>BI</samp>&rsquo;</dt>
  45303. </dl>
  45304. </dd>
  45305. <dt>&lsquo;<samp>interlace_type <em>(video only)</em></samp>&rsquo;</dt>
  45306. <dd><p>The frame interlace type. It can assume one of the following values:
  45307. </p><dl compact="compact">
  45308. <dt>&lsquo;<samp>PROGRESSIVE</samp>&rsquo;</dt>
  45309. <dd><p>The frame is progressive (not interlaced).
  45310. </p></dd>
  45311. <dt>&lsquo;<samp>TOPFIRST</samp>&rsquo;</dt>
  45312. <dd><p>The frame is top-field-first.
  45313. </p></dd>
  45314. <dt>&lsquo;<samp>BOTTOMFIRST</samp>&rsquo;</dt>
  45315. <dd><p>The frame is bottom-field-first.
  45316. </p></dd>
  45317. </dl>
  45318. </dd>
  45319. <dt>&lsquo;<samp>consumed_sample_n <em>(audio only)</em></samp>&rsquo;</dt>
  45320. <dd><p>the number of selected samples before the current frame
  45321. </p>
  45322. </dd>
  45323. <dt>&lsquo;<samp>samples_n <em>(audio only)</em></samp>&rsquo;</dt>
  45324. <dd><p>the number of samples in the current frame
  45325. </p>
  45326. </dd>
  45327. <dt>&lsquo;<samp>sample_rate <em>(audio only)</em></samp>&rsquo;</dt>
  45328. <dd><p>the input sample rate
  45329. </p>
  45330. </dd>
  45331. <dt>&lsquo;<samp>key</samp>&rsquo;</dt>
  45332. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  45333. </p>
  45334. </dd>
  45335. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  45336. <dd><p>the position in the file of the filtered frame, -1 if the information
  45337. is not available (e.g. for synthetic video)
  45338. </p>
  45339. </dd>
  45340. <dt>&lsquo;<samp>scene <em>(video only)</em></samp>&rsquo;</dt>
  45341. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  45342. probability for the current frame to introduce a new scene, while a higher
  45343. value means the current frame is more likely to be one (see the example below)
  45344. </p>
  45345. </dd>
  45346. <dt>&lsquo;<samp>concatdec_select</samp>&rsquo;</dt>
  45347. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  45348. inpoint and an outpoint, but the output packets may not be entirely contained
  45349. in the selected interval. By using this variable, it is possible to skip frames
  45350. generated by the concat demuxer which are not exactly contained in the selected
  45351. interval.
  45352. </p>
  45353. <p>This works by comparing the frame pts against the <var>lavf.concat.start_time</var>
  45354. and the <var>lavf.concat.duration</var> packet metadata values which are also
  45355. present in the decoded frames.
  45356. </p>
  45357. <p>The <var>concatdec_select</var> variable is -1 if the frame pts is at least
  45358. start_time and either the duration metadata is missing or the frame pts is less
  45359. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  45360. missing.
  45361. </p>
  45362. <p>That basically means that an input frame is selected if its pts is within the
  45363. interval set by the concat demuxer.
  45364. </p>
  45365. </dd>
  45366. </dl>
  45367. <p>The default value of the select expression is &quot;1&quot;.
  45368. </p>
  45369. <a name="Examples-113"></a>
  45370. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-113">44.14.1 Examples</a></h3>
  45371. <ul>
  45372. <li>
  45373. Select all frames in input:
  45374. <div class="example">
  45375. <pre class="example">select
  45376. </pre></div>
  45377. <p>The example above is the same as:
  45378. </p><div class="example">
  45379. <pre class="example">select=1
  45380. </pre></div>
  45381. </li><li>
  45382. Skip all frames:
  45383. <div class="example">
  45384. <pre class="example">select=0
  45385. </pre></div>
  45386. </li><li>
  45387. Select only I-frames:
  45388. <div class="example">
  45389. <pre class="example">select='eq(pict_type\,I)'
  45390. </pre></div>
  45391. </li><li>
  45392. Select one frame every 100:
  45393. <div class="example">
  45394. <pre class="example">select='not(mod(n\,100))'
  45395. </pre></div>
  45396. </li><li>
  45397. Select only frames contained in the 10-20 time interval:
  45398. <div class="example">
  45399. <pre class="example">select=between(t\,10\,20)
  45400. </pre></div>
  45401. </li><li>
  45402. Select only I-frames contained in the 10-20 time interval:
  45403. <div class="example">
  45404. <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
  45405. </pre></div>
  45406. </li><li>
  45407. Select frames with a minimum distance of 10 seconds:
  45408. <div class="example">
  45409. <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  45410. </pre></div>
  45411. </li><li>
  45412. Use aselect to select only audio frames with samples number &gt; 100:
  45413. <div class="example">
  45414. <pre class="example">aselect='gt(samples_n\,100)'
  45415. </pre></div>
  45416. </li><li>
  45417. Create a mosaic of the first scenes:
  45418. <div class="example">
  45419. <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  45420. </pre></div>
  45421. <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
  45422. choice.
  45423. </p>
  45424. </li><li>
  45425. Send even and odd frames to separate outputs, and compose them:
  45426. <div class="example">
  45427. <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  45428. </pre></div>
  45429. </li><li>
  45430. Select useful frames from an ffconcat file which is using inpoints and
  45431. outpoints but where the source files are not intra frame only.
  45432. <div class="example">
  45433. <pre class="example">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  45434. </pre></div>
  45435. </li></ul>
  45436. <a name="sendcmd_002c-asendcmd"></a>
  45437. <h2 class="section"><a href="ffmpeg-all.html#toc-sendcmd_002c-asendcmd">44.15 sendcmd, asendcmd</a></h2>
  45438. <p>Send commands to filters in the filtergraph.
  45439. </p>
  45440. <p>These filters read commands to be sent to other filters in the
  45441. filtergraph.
  45442. </p>
  45443. <p><code>sendcmd</code> must be inserted between two video filters,
  45444. <code>asendcmd</code> must be inserted between two audio filters, but apart
  45445. from that they act the same way.
  45446. </p>
  45447. <p>The specification of commands can be provided in the filter arguments
  45448. with the <var>commands</var> option, or in a file specified by the
  45449. <var>filename</var> option.
  45450. </p>
  45451. <p>These filters accept the following options:
  45452. </p><dl compact="compact">
  45453. <dt>&lsquo;<samp>commands, c</samp>&rsquo;</dt>
  45454. <dd><p>Set the commands to be read and sent to the other filters.
  45455. </p></dd>
  45456. <dt>&lsquo;<samp>filename, f</samp>&rsquo;</dt>
  45457. <dd><p>Set the filename of the commands to be read and sent to the other
  45458. filters.
  45459. </p></dd>
  45460. </dl>
  45461. <a name="Commands-syntax"></a>
  45462. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-syntax">44.15.1 Commands syntax</a></h3>
  45463. <p>A commands description consists of a sequence of interval
  45464. specifications, comprising a list of commands to be executed when a
  45465. particular event related to that interval occurs. The occurring event
  45466. is typically the current frame time entering or leaving a given time
  45467. interval.
  45468. </p>
  45469. <p>An interval is specified by the following syntax:
  45470. </p><div class="example">
  45471. <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
  45472. </pre></div>
  45473. <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
  45474. <var>END</var> is optional and defaults to the maximum time.
  45475. </p>
  45476. <p>The current frame time is considered within the specified interval if
  45477. it is included in the interval [<var>START</var>, <var>END</var>), that is when
  45478. the time is greater or equal to <var>START</var> and is lesser than
  45479. <var>END</var>.
  45480. </p>
  45481. <p><var>COMMANDS</var> consists of a sequence of one or more command
  45482. specifications, separated by &quot;,&quot;, relating to that interval. The
  45483. syntax of a command specification is given by:
  45484. </p><div class="example">
  45485. <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
  45486. </pre></div>
  45487. <p><var>FLAGS</var> is optional and specifies the type of events relating to
  45488. the time interval which enable sending the specified command, and must
  45489. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  45490. enclosed between &quot;[&quot; and &quot;]&quot;.
  45491. </p>
  45492. <p>The following flags are recognized:
  45493. </p><dl compact="compact">
  45494. <dt>&lsquo;<samp>enter</samp>&rsquo;</dt>
  45495. <dd><p>The command is sent when the current frame timestamp enters the
  45496. specified interval. In other words, the command is sent when the
  45497. previous frame timestamp was not in the given interval, and the
  45498. current is.
  45499. </p>
  45500. </dd>
  45501. <dt>&lsquo;<samp>leave</samp>&rsquo;</dt>
  45502. <dd><p>The command is sent when the current frame timestamp leaves the
  45503. specified interval. In other words, the command is sent when the
  45504. previous frame timestamp was in the given interval, and the
  45505. current is not.
  45506. </p>
  45507. </dd>
  45508. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45509. <dd><p>The command <var>ARG</var> is interpreted as expression and result of
  45510. expression is passed as <var>ARG</var>.
  45511. </p>
  45512. <p>The expression is evaluated through the eval API and can contain the following
  45513. constants:
  45514. </p>
  45515. <dl compact="compact">
  45516. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  45517. <dd><p>Original position in the file of the frame, or undefined if undefined
  45518. for the current frame.
  45519. </p>
  45520. </dd>
  45521. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  45522. <dd><p>The presentation timestamp in input.
  45523. </p>
  45524. </dd>
  45525. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  45526. <dd><p>The count of the input frame for video or audio, starting from 0.
  45527. </p>
  45528. </dd>
  45529. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  45530. <dd><p>The time in seconds of the current frame.
  45531. </p></dd>
  45532. </dl>
  45533. </dd>
  45534. </dl>
  45535. <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
  45536. assumed.
  45537. </p>
  45538. <p><var>TARGET</var> specifies the target of the command, usually the name of
  45539. the filter class or a specific filter instance name.
  45540. </p>
  45541. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  45542. </p>
  45543. <p><var>ARG</var> is optional and specifies the optional list of argument for
  45544. the given <var>COMMAND</var>.
  45545. </p>
  45546. <p>Between one interval specification and another, whitespaces, or
  45547. sequences of characters starting with <code>#</code> until the end of line,
  45548. are ignored and can be used to annotate comments.
  45549. </p>
  45550. <p>A simplified BNF description of the commands specification syntax
  45551. follows:
  45552. </p><div class="example">
  45553. <pre class="example"><var>COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  45554. <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
  45555. <var>COMMAND</var> ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  45556. <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
  45557. <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
  45558. <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
  45559. </pre></div>
  45560. <a name="Examples-122"></a>
  45561. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-122">44.15.2 Examples</a></h3>
  45562. <ul>
  45563. <li>
  45564. Specify audio tempo change at second 4:
  45565. <div class="example">
  45566. <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
  45567. </pre></div>
  45568. </li><li>
  45569. Target a specific filter instance:
  45570. <div class="example">
  45571. <pre class="example">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  45572. </pre></div>
  45573. </li><li>
  45574. Specify a list of drawtext and hue commands in a file.
  45575. <div class="example">
  45576. <pre class="example"># show text in the interval 5-10
  45577. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  45578. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  45579. # desaturate the image in the interval 15-20
  45580. 15.0-20.0 [enter] hue s 0,
  45581. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  45582. [leave] hue s 1,
  45583. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  45584. # apply an exponential saturation fade-out effect, starting from time 25
  45585. 25 [enter] hue s exp(25-t)
  45586. </pre></div>
  45587. <p>A filtergraph allowing to read and process the above command list
  45588. stored in a file &lsquo;<tt>test.cmd</tt>&rsquo;, can be specified with:
  45589. </p><div class="example">
  45590. <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  45591. </pre></div>
  45592. </li></ul>
  45593. <p><a name="setpts"></a>
  45594. </p><a name="setpts_002c-asetpts"></a>
  45595. <h2 class="section"><a href="ffmpeg-all.html#toc-setpts_002c-asetpts">44.16 setpts, asetpts</a></h2>
  45596. <p>Change the PTS (presentation timestamp) of the input frames.
  45597. </p>
  45598. <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
  45599. </p>
  45600. <p>This filter accepts the following options:
  45601. </p>
  45602. <dl compact="compact">
  45603. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  45604. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  45605. </p>
  45606. </dd>
  45607. </dl>
  45608. <p>The expression is evaluated through the eval API and can contain the following
  45609. constants:
  45610. </p>
  45611. <dl compact="compact">
  45612. <dt>&lsquo;<samp>FRAME_RATE, FR</samp>&rsquo;</dt>
  45613. <dd><p>frame rate, only defined for constant frame-rate video
  45614. </p>
  45615. </dd>
  45616. <dt>&lsquo;<samp>PTS</samp>&rsquo;</dt>
  45617. <dd><p>The presentation timestamp in input
  45618. </p>
  45619. </dd>
  45620. <dt>&lsquo;<samp>N</samp>&rsquo;</dt>
  45621. <dd><p>The count of the input frame for video or the number of consumed samples,
  45622. not including the current frame for audio, starting from 0.
  45623. </p>
  45624. </dd>
  45625. <dt>&lsquo;<samp>NB_CONSUMED_SAMPLES</samp>&rsquo;</dt>
  45626. <dd><p>The number of consumed samples, not including the current frame (only
  45627. audio)
  45628. </p>
  45629. </dd>
  45630. <dt>&lsquo;<samp>NB_SAMPLES, S</samp>&rsquo;</dt>
  45631. <dd><p>The number of samples in the current frame (only audio)
  45632. </p>
  45633. </dd>
  45634. <dt>&lsquo;<samp>SAMPLE_RATE, SR</samp>&rsquo;</dt>
  45635. <dd><p>The audio sample rate.
  45636. </p>
  45637. </dd>
  45638. <dt>&lsquo;<samp>STARTPTS</samp>&rsquo;</dt>
  45639. <dd><p>The PTS of the first frame.
  45640. </p>
  45641. </dd>
  45642. <dt>&lsquo;<samp>STARTT</samp>&rsquo;</dt>
  45643. <dd><p>the time in seconds of the first frame
  45644. </p>
  45645. </dd>
  45646. <dt>&lsquo;<samp>INTERLACED</samp>&rsquo;</dt>
  45647. <dd><p>State whether the current frame is interlaced.
  45648. </p>
  45649. </dd>
  45650. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  45651. <dd><p>the time in seconds of the current frame
  45652. </p>
  45653. </dd>
  45654. <dt>&lsquo;<samp>POS</samp>&rsquo;</dt>
  45655. <dd><p>original position in the file of the frame, or undefined if undefined
  45656. for the current frame
  45657. </p>
  45658. </dd>
  45659. <dt>&lsquo;<samp>PREV_INPTS</samp>&rsquo;</dt>
  45660. <dd><p>The previous input PTS.
  45661. </p>
  45662. </dd>
  45663. <dt>&lsquo;<samp>PREV_INT</samp>&rsquo;</dt>
  45664. <dd><p>previous input time in seconds
  45665. </p>
  45666. </dd>
  45667. <dt>&lsquo;<samp>PREV_OUTPTS</samp>&rsquo;</dt>
  45668. <dd><p>The previous output PTS.
  45669. </p>
  45670. </dd>
  45671. <dt>&lsquo;<samp>PREV_OUTT</samp>&rsquo;</dt>
  45672. <dd><p>previous output time in seconds
  45673. </p>
  45674. </dd>
  45675. <dt>&lsquo;<samp>RTCTIME</samp>&rsquo;</dt>
  45676. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  45677. instead.
  45678. </p>
  45679. </dd>
  45680. <dt>&lsquo;<samp>RTCSTART</samp>&rsquo;</dt>
  45681. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  45682. </p>
  45683. </dd>
  45684. <dt>&lsquo;<samp>TB</samp>&rsquo;</dt>
  45685. <dd><p>The timebase of the input timestamps.
  45686. </p>
  45687. </dd>
  45688. </dl>
  45689. <a name="Examples-68"></a>
  45690. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-68">44.16.1 Examples</a></h3>
  45691. <ul>
  45692. <li>
  45693. Start counting PTS from zero
  45694. <div class="example">
  45695. <pre class="example">setpts=PTS-STARTPTS
  45696. </pre></div>
  45697. </li><li>
  45698. Apply fast motion effect:
  45699. <div class="example">
  45700. <pre class="example">setpts=0.5*PTS
  45701. </pre></div>
  45702. </li><li>
  45703. Apply slow motion effect:
  45704. <div class="example">
  45705. <pre class="example">setpts=2.0*PTS
  45706. </pre></div>
  45707. </li><li>
  45708. Set fixed rate of 25 frames per second:
  45709. <div class="example">
  45710. <pre class="example">setpts=N/(25*TB)
  45711. </pre></div>
  45712. </li><li>
  45713. Set fixed rate 25 fps with some jitter:
  45714. <div class="example">
  45715. <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  45716. </pre></div>
  45717. </li><li>
  45718. Apply an offset of 10 seconds to the input PTS:
  45719. <div class="example">
  45720. <pre class="example">setpts=PTS+10/TB
  45721. </pre></div>
  45722. </li><li>
  45723. Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  45724. <div class="example">
  45725. <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  45726. </pre></div>
  45727. </li><li>
  45728. Generate timestamps by counting samples:
  45729. <div class="example">
  45730. <pre class="example">asetpts=N/SR/TB
  45731. </pre></div>
  45732. </li></ul>
  45733. <a name="setrange"></a>
  45734. <h2 class="section"><a href="ffmpeg-all.html#toc-setrange">44.17 setrange</a></h2>
  45735. <p>Force color range for the output video frame.
  45736. </p>
  45737. <p>The <code>setrange</code> filter marks the color range property for the
  45738. output frames. It does not change the input frame, but only sets the
  45739. corresponding property, which affects how the frame is treated by
  45740. following filters.
  45741. </p>
  45742. <p>The filter accepts the following options:
  45743. </p>
  45744. <dl compact="compact">
  45745. <dt>&lsquo;<samp>range</samp>&rsquo;</dt>
  45746. <dd><p>Available values are:
  45747. </p>
  45748. <dl compact="compact">
  45749. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  45750. <dd><p>Keep the same color range property.
  45751. </p>
  45752. </dd>
  45753. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  45754. <dd><p>Set the color range as unspecified.
  45755. </p>
  45756. </dd>
  45757. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  45758. <dd><p>Set the color range as limited.
  45759. </p>
  45760. </dd>
  45761. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  45762. <dd><p>Set the color range as full.
  45763. </p></dd>
  45764. </dl>
  45765. </dd>
  45766. </dl>
  45767. <a name="settb_002c-asettb"></a>
  45768. <h2 class="section"><a href="ffmpeg-all.html#toc-settb_002c-asettb">44.18 settb, asettb</a></h2>
  45769. <p>Set the timebase to use for the output frames timestamps.
  45770. It is mainly useful for testing timebase configuration.
  45771. </p>
  45772. <p>It accepts the following parameters:
  45773. </p>
  45774. <dl compact="compact">
  45775. <dt>&lsquo;<samp>expr, tb</samp>&rsquo;</dt>
  45776. <dd><p>The expression which is evaluated into the output timebase.
  45777. </p>
  45778. </dd>
  45779. </dl>
  45780. <p>The value for &lsquo;<samp>tb</samp>&rsquo; is an arithmetic expression representing a
  45781. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  45782. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  45783. audio only). Default value is &quot;intb&quot;.
  45784. </p>
  45785. <a name="Examples-157"></a>
  45786. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-157">44.18.1 Examples</a></h3>
  45787. <ul>
  45788. <li>
  45789. Set the timebase to 1/25:
  45790. <div class="example">
  45791. <pre class="example">settb=expr=1/25
  45792. </pre></div>
  45793. </li><li>
  45794. Set the timebase to 1/10:
  45795. <div class="example">
  45796. <pre class="example">settb=expr=0.1
  45797. </pre></div>
  45798. </li><li>
  45799. Set the timebase to 1001/1000:
  45800. <div class="example">
  45801. <pre class="example">settb=1+0.001
  45802. </pre></div>
  45803. </li><li>
  45804. Set the timebase to 2*intb:
  45805. <div class="example">
  45806. <pre class="example">settb=2*intb
  45807. </pre></div>
  45808. </li><li>
  45809. Set the default timebase value:
  45810. <div class="example">
  45811. <pre class="example">settb=AVTB
  45812. </pre></div>
  45813. </li></ul>
  45814. <a name="showcqt"></a>
  45815. <h2 class="section"><a href="ffmpeg-all.html#toc-showcqt">44.19 showcqt</a></h2>
  45816. <p>Convert input audio to a video output representing frequency spectrum
  45817. logarithmically using Brown-Puckette constant Q transform algorithm with
  45818. direct frequency domain coefficient calculation (but the transform itself
  45819. is not really constant Q, instead the Q factor is actually variable/clamped),
  45820. with musical tone scale, from E0 to D#10.
  45821. </p>
  45822. <p>The filter accepts the following options:
  45823. </p>
  45824. <dl compact="compact">
  45825. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  45826. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  45827. check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  45828. Default value is <code>1920x1080</code>.
  45829. </p>
  45830. </dd>
  45831. <dt>&lsquo;<samp>fps, rate, r</samp>&rsquo;</dt>
  45832. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  45833. </p>
  45834. </dd>
  45835. <dt>&lsquo;<samp>bar_h</samp>&rsquo;</dt>
  45836. <dd><p>Set the bargraph height. It must be even. Default value is <code>-1</code> which
  45837. computes the bargraph height automatically.
  45838. </p>
  45839. </dd>
  45840. <dt>&lsquo;<samp>axis_h</samp>&rsquo;</dt>
  45841. <dd><p>Set the axis height. It must be even. Default value is <code>-1</code> which computes
  45842. the axis height automatically.
  45843. </p>
  45844. </dd>
  45845. <dt>&lsquo;<samp>sono_h</samp>&rsquo;</dt>
  45846. <dd><p>Set the sonogram height. It must be even. Default value is <code>-1</code> which
  45847. computes the sonogram height automatically.
  45848. </p>
  45849. </dd>
  45850. <dt>&lsquo;<samp>fullhd</samp>&rsquo;</dt>
  45851. <dd><p>Set the fullhd resolution. This option is deprecated, use <var>size</var>, <var>s</var>
  45852. instead. Default value is <code>1</code>.
  45853. </p>
  45854. </dd>
  45855. <dt>&lsquo;<samp>sono_v, volume</samp>&rsquo;</dt>
  45856. <dd><p>Specify the sonogram volume expression. It can contain variables:
  45857. </p><dl compact="compact">
  45858. <dt>&lsquo;<samp>bar_v</samp>&rsquo;</dt>
  45859. <dd><p>the <var>bar_v</var> evaluated expression
  45860. </p></dd>
  45861. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  45862. <dd><p>the frequency where it is evaluated
  45863. </p></dd>
  45864. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  45865. <dd><p>the value of <var>timeclamp</var> option
  45866. </p></dd>
  45867. </dl>
  45868. <p>and functions:
  45869. </p><dl compact="compact">
  45870. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  45871. <dd><p>A-weighting of equal loudness
  45872. </p></dd>
  45873. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  45874. <dd><p>B-weighting of equal loudness
  45875. </p></dd>
  45876. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  45877. <dd><p>C-weighting of equal loudness.
  45878. </p></dd>
  45879. </dl>
  45880. <p>Default value is <code>16</code>.
  45881. </p>
  45882. </dd>
  45883. <dt>&lsquo;<samp>bar_v, volume2</samp>&rsquo;</dt>
  45884. <dd><p>Specify the bargraph volume expression. It can contain variables:
  45885. </p><dl compact="compact">
  45886. <dt>&lsquo;<samp>sono_v</samp>&rsquo;</dt>
  45887. <dd><p>the <var>sono_v</var> evaluated expression
  45888. </p></dd>
  45889. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  45890. <dd><p>the frequency where it is evaluated
  45891. </p></dd>
  45892. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  45893. <dd><p>the value of <var>timeclamp</var> option
  45894. </p></dd>
  45895. </dl>
  45896. <p>and functions:
  45897. </p><dl compact="compact">
  45898. <dt>&lsquo;<samp>a_weighting(f)</samp>&rsquo;</dt>
  45899. <dd><p>A-weighting of equal loudness
  45900. </p></dd>
  45901. <dt>&lsquo;<samp>b_weighting(f)</samp>&rsquo;</dt>
  45902. <dd><p>B-weighting of equal loudness
  45903. </p></dd>
  45904. <dt>&lsquo;<samp>c_weighting(f)</samp>&rsquo;</dt>
  45905. <dd><p>C-weighting of equal loudness.
  45906. </p></dd>
  45907. </dl>
  45908. <p>Default value is <code>sono_v</code>.
  45909. </p>
  45910. </dd>
  45911. <dt>&lsquo;<samp>sono_g, gamma</samp>&rsquo;</dt>
  45912. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  45913. higher gamma makes the spectrum having more range. Default value is <code>3</code>.
  45914. Acceptable range is <code>[1, 7]</code>.
  45915. </p>
  45916. </dd>
  45917. <dt>&lsquo;<samp>bar_g, gamma2</samp>&rsquo;</dt>
  45918. <dd><p>Specify the bargraph gamma. Default value is <code>1</code>. Acceptable range is
  45919. <code>[1, 7]</code>.
  45920. </p>
  45921. </dd>
  45922. <dt>&lsquo;<samp>bar_t</samp>&rsquo;</dt>
  45923. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  45924. Default value is <code>1</code>. Acceptable range is <code>[0, 1]</code>.
  45925. </p>
  45926. </dd>
  45927. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  45928. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  45929. accuracy in time domain and frequency domain. If timeclamp is lower,
  45930. event in time domain is represented more accurately (such as fast bass drum),
  45931. otherwise event in frequency domain is represented more accurately
  45932. (such as bass guitar). Acceptable range is <code>[0.002, 1]</code>. Default value is <code>0.17</code>.
  45933. </p>
  45934. </dd>
  45935. <dt>&lsquo;<samp>attack</samp>&rsquo;</dt>
  45936. <dd><p>Set attack time in seconds. The default is <code>0</code> (disabled). Otherwise, it
  45937. limits future samples by applying asymmetric windowing in time domain, useful
  45938. when low latency is required. Accepted range is <code>[0, 1]</code>.
  45939. </p>
  45940. </dd>
  45941. <dt>&lsquo;<samp>basefreq</samp>&rsquo;</dt>
  45942. <dd><p>Specify the transform base frequency. Default value is <code>20.01523126408007475</code>,
  45943. which is frequency 50 cents below E0. Acceptable range is <code>[10, 100000]</code>.
  45944. </p>
  45945. </dd>
  45946. <dt>&lsquo;<samp>endfreq</samp>&rsquo;</dt>
  45947. <dd><p>Specify the transform end frequency. Default value is <code>20495.59681441799654</code>,
  45948. which is frequency 50 cents above D#10. Acceptable range is <code>[10, 100000]</code>.
  45949. </p>
  45950. </dd>
  45951. <dt>&lsquo;<samp>coeffclamp</samp>&rsquo;</dt>
  45952. <dd><p>This option is deprecated and ignored.
  45953. </p>
  45954. </dd>
  45955. <dt>&lsquo;<samp>tlength</samp>&rsquo;</dt>
  45956. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  45957. trade-off between time domain and frequency domain at every frequency sample.
  45958. It can contain variables:
  45959. </p><dl compact="compact">
  45960. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  45961. <dd><p>the frequency where it is evaluated
  45962. </p></dd>
  45963. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  45964. <dd><p>the value of <var>timeclamp</var> option.
  45965. </p></dd>
  45966. </dl>
  45967. <p>Default value is <code>384*tc/(384+tc*f)</code>.
  45968. </p>
  45969. </dd>
  45970. <dt>&lsquo;<samp>count</samp>&rsquo;</dt>
  45971. <dd><p>Specify the transform count for every video frame. Default value is <code>6</code>.
  45972. Acceptable range is <code>[1, 30]</code>.
  45973. </p>
  45974. </dd>
  45975. <dt>&lsquo;<samp>fcount</samp>&rsquo;</dt>
  45976. <dd><p>Specify the transform count for every single pixel. Default value is <code>0</code>,
  45977. which makes it computed automatically. Acceptable range is <code>[0, 10]</code>.
  45978. </p>
  45979. </dd>
  45980. <dt>&lsquo;<samp>fontfile</samp>&rsquo;</dt>
  45981. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  45982. use embedded font. Note that drawing with font file or embedded font is not
  45983. implemented with custom <var>basefreq</var> and <var>endfreq</var>, use <var>axisfile</var>
  45984. option instead.
  45985. </p>
  45986. </dd>
  45987. <dt>&lsquo;<samp>font</samp>&rsquo;</dt>
  45988. <dd><p>Specify fontconfig pattern. This has lower priority than <var>fontfile</var>. The
  45989. <code>:</code> in the pattern may be replaced by <code>|</code> to avoid unnecessary
  45990. escaping.
  45991. </p>
  45992. </dd>
  45993. <dt>&lsquo;<samp>fontcolor</samp>&rsquo;</dt>
  45994. <dd><p>Specify font color expression. This is arithmetic expression that should return
  45995. integer value 0xRRGGBB. It can contain variables:
  45996. </p><dl compact="compact">
  45997. <dt>&lsquo;<samp>frequency, freq, f</samp>&rsquo;</dt>
  45998. <dd><p>the frequency where it is evaluated
  45999. </p></dd>
  46000. <dt>&lsquo;<samp>timeclamp, tc</samp>&rsquo;</dt>
  46001. <dd><p>the value of <var>timeclamp</var> option
  46002. </p></dd>
  46003. </dl>
  46004. <p>and functions:
  46005. </p><dl compact="compact">
  46006. <dt>&lsquo;<samp>midi(f)</samp>&rsquo;</dt>
  46007. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  46008. </p></dd>
  46009. <dt>&lsquo;<samp>r(x), g(x), b(x)</samp>&rsquo;</dt>
  46010. <dd><p>red, green, and blue value of intensity x.
  46011. </p></dd>
  46012. </dl>
  46013. <p>Default value is <code>st(0, (midi(f)-59.5)/12);
  46014. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  46015. r(1-ld(1)) + b(ld(1))</code>.
  46016. </p>
  46017. </dd>
  46018. <dt>&lsquo;<samp>axisfile</samp>&rsquo;</dt>
  46019. <dd><p>Specify image file to draw the axis. This option override <var>fontfile</var> and
  46020. <var>fontcolor</var> option.
  46021. </p>
  46022. </dd>
  46023. <dt>&lsquo;<samp>axis, text</samp>&rsquo;</dt>
  46024. <dd><p>Enable/disable drawing text to the axis. If it is set to <code>0</code>, drawing to
  46025. the axis is disabled, ignoring <var>fontfile</var> and <var>axisfile</var> option.
  46026. Default value is <code>1</code>.
  46027. </p>
  46028. </dd>
  46029. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  46030. <dd><p>Set colorspace. The accepted values are:
  46031. </p><dl compact="compact">
  46032. <dt>&lsquo;<samp>unspecified</samp>&rsquo;</dt>
  46033. <dd><p>Unspecified (default)
  46034. </p>
  46035. </dd>
  46036. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  46037. <dd><p>BT.709
  46038. </p>
  46039. </dd>
  46040. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  46041. <dd><p>FCC
  46042. </p>
  46043. </dd>
  46044. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  46045. <dd><p>BT.470BG or BT.601-6 625
  46046. </p>
  46047. </dd>
  46048. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  46049. <dd><p>SMPTE-170M or BT.601-6 525
  46050. </p>
  46051. </dd>
  46052. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  46053. <dd><p>SMPTE-240M
  46054. </p>
  46055. </dd>
  46056. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  46057. <dd><p>BT.2020 with non-constant luminance
  46058. </p>
  46059. </dd>
  46060. </dl>
  46061. </dd>
  46062. <dt>&lsquo;<samp>cscheme</samp>&rsquo;</dt>
  46063. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  46064. <code>left_r|left_g|left_b|right_r|right_g|right_b</code>.
  46065. The default is <code>1|0.5|0|0|0.5|1</code>.
  46066. </p>
  46067. </dd>
  46068. </dl>
  46069. <a name="Examples-49"></a>
  46070. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-49">44.19.1 Examples</a></h3>
  46071. <ul>
  46072. <li>
  46073. Playing audio while showing the spectrum:
  46074. <div class="example">
  46075. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  46076. </pre></div>
  46077. </li><li>
  46078. Same as above, but with frame rate 30 fps:
  46079. <div class="example">
  46080. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  46081. </pre></div>
  46082. </li><li>
  46083. Playing at 1280x720:
  46084. <div class="example">
  46085. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  46086. </pre></div>
  46087. </li><li>
  46088. Disable sonogram display:
  46089. <div class="example">
  46090. <pre class="example">sono_h=0
  46091. </pre></div>
  46092. </li><li>
  46093. A1 and its harmonics: A1, A2, (near)E3, A3:
  46094. <div class="example">
  46095. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  46096. asplit[a][out1]; [a] showcqt [out0]'
  46097. </pre></div>
  46098. </li><li>
  46099. Same as above, but with more accuracy in frequency domain:
  46100. <div class="example">
  46101. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  46102. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  46103. </pre></div>
  46104. </li><li>
  46105. Custom volume:
  46106. <div class="example">
  46107. <pre class="example">bar_v=10:sono_v=bar_v*a_weighting(f)
  46108. </pre></div>
  46109. </li><li>
  46110. Custom gamma, now spectrum is linear to the amplitude.
  46111. <div class="example">
  46112. <pre class="example">bar_g=2:sono_g=2
  46113. </pre></div>
  46114. </li><li>
  46115. Custom tlength equation:
  46116. <div class="example">
  46117. <pre class="example">tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
  46118. </pre></div>
  46119. </li><li>
  46120. Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  46121. <div class="example">
  46122. <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  46123. </pre></div>
  46124. </li><li>
  46125. Custom font using fontconfig:
  46126. <div class="example">
  46127. <pre class="example">font='Courier New,Monospace,mono|bold'
  46128. </pre></div>
  46129. </li><li>
  46130. Custom frequency range with custom axis using image file:
  46131. <div class="example">
  46132. <pre class="example">axisfile=myaxis.png:basefreq=40:endfreq=10000
  46133. </pre></div>
  46134. </li></ul>
  46135. <a name="showfreqs"></a>
  46136. <h2 class="section"><a href="ffmpeg-all.html#toc-showfreqs">44.20 showfreqs</a></h2>
  46137. <p>Convert input audio to video output representing the audio power spectrum.
  46138. Audio amplitude is on Y-axis while frequency is on X-axis.
  46139. </p>
  46140. <p>The filter accepts the following options:
  46141. </p>
  46142. <dl compact="compact">
  46143. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46144. <dd><p>Specify size of video. For the syntax of this option, check the
  46145. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46146. Default is <code>1024x512</code>.
  46147. </p>
  46148. </dd>
  46149. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46150. <dd><p>Set display mode.
  46151. This set how each frequency bin will be represented.
  46152. </p>
  46153. <p>It accepts the following values:
  46154. </p><dl compact="compact">
  46155. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  46156. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  46157. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  46158. </dl>
  46159. <p>Default is <code>bar</code>.
  46160. </p>
  46161. </dd>
  46162. <dt>&lsquo;<samp>ascale</samp>&rsquo;</dt>
  46163. <dd><p>Set amplitude scale.
  46164. </p>
  46165. <p>It accepts the following values:
  46166. </p><dl compact="compact">
  46167. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46168. <dd><p>Linear scale.
  46169. </p>
  46170. </dd>
  46171. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46172. <dd><p>Square root scale.
  46173. </p>
  46174. </dd>
  46175. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46176. <dd><p>Cubic root scale.
  46177. </p>
  46178. </dd>
  46179. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46180. <dd><p>Logarithmic scale.
  46181. </p></dd>
  46182. </dl>
  46183. <p>Default is <code>log</code>.
  46184. </p>
  46185. </dd>
  46186. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  46187. <dd><p>Set frequency scale.
  46188. </p>
  46189. <p>It accepts the following values:
  46190. </p><dl compact="compact">
  46191. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46192. <dd><p>Linear scale.
  46193. </p>
  46194. </dd>
  46195. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46196. <dd><p>Logarithmic scale.
  46197. </p>
  46198. </dd>
  46199. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  46200. <dd><p>Reverse logarithmic scale.
  46201. </p></dd>
  46202. </dl>
  46203. <p>Default is <code>lin</code>.
  46204. </p>
  46205. </dd>
  46206. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  46207. <dd><p>Set window size. Allowed range is from 16 to 65536.
  46208. </p>
  46209. <p>Default is <code>2048</code>
  46210. </p>
  46211. </dd>
  46212. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46213. <dd><p>Set windowing function.
  46214. </p>
  46215. <p>It accepts the following values:
  46216. </p><dl compact="compact">
  46217. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46218. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46219. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46220. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46221. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46222. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46223. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46224. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46225. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46226. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46227. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46228. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46229. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46230. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46231. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46232. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46233. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46234. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46235. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46236. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46237. </dl>
  46238. <p>Default is <code>hanning</code>.
  46239. </p>
  46240. </dd>
  46241. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  46242. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  46243. which means optimal overlap for selected window function will be picked.
  46244. </p>
  46245. </dd>
  46246. <dt>&lsquo;<samp>averaging</samp>&rsquo;</dt>
  46247. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  46248. Default is <code>1</code>, which means time averaging is disabled.
  46249. </p>
  46250. </dd>
  46251. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  46252. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  46253. draw channel frequencies. Unrecognized or missing colors will be replaced
  46254. by white color.
  46255. </p>
  46256. </dd>
  46257. <dt>&lsquo;<samp>cmode</samp>&rsquo;</dt>
  46258. <dd><p>Set channel display mode.
  46259. </p>
  46260. <p>It accepts the following values:
  46261. </p><dl compact="compact">
  46262. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  46263. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  46264. </dl>
  46265. <p>Default is <code>combined</code>.
  46266. </p>
  46267. </dd>
  46268. <dt>&lsquo;<samp>minamp</samp>&rsquo;</dt>
  46269. <dd><p>Set minimum amplitude used in <code>log</code> amplitude scaler.
  46270. </p>
  46271. </dd>
  46272. </dl>
  46273. <a name="showspatial"></a>
  46274. <h2 class="section"><a href="ffmpeg-all.html#toc-showspatial">44.21 showspatial</a></h2>
  46275. <p>Convert stereo input audio to a video output, representing the spatial relationship
  46276. between two channels.
  46277. </p>
  46278. <p>The filter accepts the following options:
  46279. </p>
  46280. <dl compact="compact">
  46281. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46282. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46283. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46284. Default value is <code>512x512</code>.
  46285. </p>
  46286. </dd>
  46287. <dt>&lsquo;<samp>win_size</samp>&rsquo;</dt>
  46288. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  46289. </p>
  46290. </dd>
  46291. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46292. <dd><p>Set window function.
  46293. </p>
  46294. <p>It accepts the following values:
  46295. </p><dl compact="compact">
  46296. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46297. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46298. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  46299. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46300. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46301. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46302. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46303. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46304. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46305. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46306. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46307. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46308. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46309. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46310. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46311. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46312. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46313. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46314. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46315. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46316. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46317. </dl>
  46318. <p>Default value is <code>hann</code>.
  46319. </p>
  46320. </dd>
  46321. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  46322. <dd><p>Set ratio of overlap window. Default value is <code>0.5</code>.
  46323. When value is <code>1</code> overlap is set to recommended size for specific
  46324. window function currently used.
  46325. </p></dd>
  46326. </dl>
  46327. <p><a name="showspectrum"></a>
  46328. </p><a name="showspectrum-1"></a>
  46329. <h2 class="section"><a href="ffmpeg-all.html#toc-showspectrum-1">44.22 showspectrum</a></h2>
  46330. <p>Convert input audio to a video output, representing the audio frequency
  46331. spectrum.
  46332. </p>
  46333. <p>The filter accepts the following options:
  46334. </p>
  46335. <dl compact="compact">
  46336. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46337. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46338. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46339. Default value is <code>640x512</code>.
  46340. </p>
  46341. </dd>
  46342. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  46343. <dd><p>Specify how the spectrum should slide along the window.
  46344. </p>
  46345. <p>It accepts the following values:
  46346. </p><dl compact="compact">
  46347. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  46348. <dd><p>the samples start again on the left when they reach the right
  46349. </p></dd>
  46350. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  46351. <dd><p>the samples scroll from right to left
  46352. </p></dd>
  46353. <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
  46354. <dd><p>frames are only produced when the samples reach the right
  46355. </p></dd>
  46356. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  46357. <dd><p>the samples scroll from left to right
  46358. </p></dd>
  46359. </dl>
  46360. <p>Default value is <code>replace</code>.
  46361. </p>
  46362. </dd>
  46363. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46364. <dd><p>Specify display mode.
  46365. </p>
  46366. <p>It accepts the following values:
  46367. </p><dl compact="compact">
  46368. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  46369. <dd><p>all channels are displayed in the same row
  46370. </p></dd>
  46371. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  46372. <dd><p>all channels are displayed in separate rows
  46373. </p></dd>
  46374. </dl>
  46375. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  46376. </p>
  46377. </dd>
  46378. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  46379. <dd><p>Specify display color mode.
  46380. </p>
  46381. <p>It accepts the following values:
  46382. </p><dl compact="compact">
  46383. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  46384. <dd><p>each channel is displayed in a separate color
  46385. </p></dd>
  46386. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  46387. <dd><p>each channel is displayed using the same color scheme
  46388. </p></dd>
  46389. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  46390. <dd><p>each channel is displayed using the rainbow color scheme
  46391. </p></dd>
  46392. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  46393. <dd><p>each channel is displayed using the moreland color scheme
  46394. </p></dd>
  46395. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  46396. <dd><p>each channel is displayed using the nebulae color scheme
  46397. </p></dd>
  46398. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  46399. <dd><p>each channel is displayed using the fire color scheme
  46400. </p></dd>
  46401. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  46402. <dd><p>each channel is displayed using the fiery color scheme
  46403. </p></dd>
  46404. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  46405. <dd><p>each channel is displayed using the fruit color scheme
  46406. </p></dd>
  46407. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  46408. <dd><p>each channel is displayed using the cool color scheme
  46409. </p></dd>
  46410. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  46411. <dd><p>each channel is displayed using the magma color scheme
  46412. </p></dd>
  46413. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  46414. <dd><p>each channel is displayed using the green color scheme
  46415. </p></dd>
  46416. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  46417. <dd><p>each channel is displayed using the viridis color scheme
  46418. </p></dd>
  46419. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  46420. <dd><p>each channel is displayed using the plasma color scheme
  46421. </p></dd>
  46422. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  46423. <dd><p>each channel is displayed using the cividis color scheme
  46424. </p></dd>
  46425. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  46426. <dd><p>each channel is displayed using the terrain color scheme
  46427. </p></dd>
  46428. </dl>
  46429. <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
  46430. </p>
  46431. </dd>
  46432. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  46433. <dd><p>Specify scale used for calculating intensity color values.
  46434. </p>
  46435. <p>It accepts the following values:
  46436. </p><dl compact="compact">
  46437. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46438. <dd><p>linear
  46439. </p></dd>
  46440. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46441. <dd><p>square root, default
  46442. </p></dd>
  46443. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46444. <dd><p>cubic root
  46445. </p></dd>
  46446. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46447. <dd><p>logarithmic
  46448. </p></dd>
  46449. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  46450. <dd><p>4th root
  46451. </p></dd>
  46452. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  46453. <dd><p>5th root
  46454. </p></dd>
  46455. </dl>
  46456. <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
  46457. </p>
  46458. </dd>
  46459. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  46460. <dd><p>Specify frequency scale.
  46461. </p>
  46462. <p>It accepts the following values:
  46463. </p><dl compact="compact">
  46464. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46465. <dd><p>linear
  46466. </p></dd>
  46467. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46468. <dd><p>logarithmic
  46469. </p></dd>
  46470. </dl>
  46471. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  46472. </p>
  46473. </dd>
  46474. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  46475. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  46476. alternative color scheme. <code>0</code> is no saturation at all.
  46477. Saturation must be in [-10.0, 10.0] range.
  46478. Default value is <code>1</code>.
  46479. </p>
  46480. </dd>
  46481. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46482. <dd><p>Set window function.
  46483. </p>
  46484. <p>It accepts the following values:
  46485. </p><dl compact="compact">
  46486. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46487. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46488. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  46489. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46490. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46491. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46492. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46493. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46494. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46495. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46496. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46497. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46498. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46499. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46500. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46501. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46502. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46503. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46504. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46505. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46506. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46507. </dl>
  46508. <p>Default value is <code>hann</code>.
  46509. </p>
  46510. </dd>
  46511. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  46512. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  46513. <code>horizontal</code>. Default is <code>vertical</code>.
  46514. </p>
  46515. </dd>
  46516. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  46517. <dd><p>Set ratio of overlap window. Default value is <code>0</code>.
  46518. When value is <code>1</code> overlap is set to recommended size for specific
  46519. window function currently used.
  46520. </p>
  46521. </dd>
  46522. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  46523. <dd><p>Set scale gain for calculating intensity color values.
  46524. Default value is <code>1</code>.
  46525. </p>
  46526. </dd>
  46527. <dt>&lsquo;<samp>data</samp>&rsquo;</dt>
  46528. <dd><p>Set which data to display. Can be <code>magnitude</code>, default or <code>phase</code>.
  46529. </p>
  46530. </dd>
  46531. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  46532. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  46533. Default value is <code>0</code>.
  46534. </p>
  46535. </dd>
  46536. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  46537. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  46538. </p>
  46539. </dd>
  46540. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  46541. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  46542. </p>
  46543. </dd>
  46544. <dt>&lsquo;<samp>fps</samp>&rsquo;</dt>
  46545. <dd><p>Set upper frame rate limit. Default is <code>auto</code>, unlimited.
  46546. </p>
  46547. </dd>
  46548. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  46549. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  46550. </p></dd>
  46551. </dl>
  46552. <p>The usage is very similar to the showwaves filter; see the examples in that
  46553. section.
  46554. </p>
  46555. <a name="Examples-4"></a>
  46556. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-4">44.22.1 Examples</a></h3>
  46557. <ul>
  46558. <li>
  46559. Large window with logarithmic color scaling:
  46560. <div class="example">
  46561. <pre class="example">showspectrum=s=1280x480:scale=log
  46562. </pre></div>
  46563. </li><li>
  46564. Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
  46565. <div class="example">
  46566. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  46567. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  46568. </pre></div>
  46569. </li></ul>
  46570. <a name="showspectrumpic"></a>
  46571. <h2 class="section"><a href="ffmpeg-all.html#toc-showspectrumpic">44.23 showspectrumpic</a></h2>
  46572. <p>Convert input audio to a single video frame, representing the audio frequency
  46573. spectrum.
  46574. </p>
  46575. <p>The filter accepts the following options:
  46576. </p>
  46577. <dl compact="compact">
  46578. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46579. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46580. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46581. Default value is <code>4096x2048</code>.
  46582. </p>
  46583. </dd>
  46584. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46585. <dd><p>Specify display mode.
  46586. </p>
  46587. <p>It accepts the following values:
  46588. </p><dl compact="compact">
  46589. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  46590. <dd><p>all channels are displayed in the same row
  46591. </p></dd>
  46592. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  46593. <dd><p>all channels are displayed in separate rows
  46594. </p></dd>
  46595. </dl>
  46596. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  46597. </p>
  46598. </dd>
  46599. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  46600. <dd><p>Specify display color mode.
  46601. </p>
  46602. <p>It accepts the following values:
  46603. </p><dl compact="compact">
  46604. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  46605. <dd><p>each channel is displayed in a separate color
  46606. </p></dd>
  46607. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  46608. <dd><p>each channel is displayed using the same color scheme
  46609. </p></dd>
  46610. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  46611. <dd><p>each channel is displayed using the rainbow color scheme
  46612. </p></dd>
  46613. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  46614. <dd><p>each channel is displayed using the moreland color scheme
  46615. </p></dd>
  46616. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  46617. <dd><p>each channel is displayed using the nebulae color scheme
  46618. </p></dd>
  46619. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  46620. <dd><p>each channel is displayed using the fire color scheme
  46621. </p></dd>
  46622. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  46623. <dd><p>each channel is displayed using the fiery color scheme
  46624. </p></dd>
  46625. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  46626. <dd><p>each channel is displayed using the fruit color scheme
  46627. </p></dd>
  46628. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  46629. <dd><p>each channel is displayed using the cool color scheme
  46630. </p></dd>
  46631. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  46632. <dd><p>each channel is displayed using the magma color scheme
  46633. </p></dd>
  46634. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  46635. <dd><p>each channel is displayed using the green color scheme
  46636. </p></dd>
  46637. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  46638. <dd><p>each channel is displayed using the viridis color scheme
  46639. </p></dd>
  46640. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  46641. <dd><p>each channel is displayed using the plasma color scheme
  46642. </p></dd>
  46643. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  46644. <dd><p>each channel is displayed using the cividis color scheme
  46645. </p></dd>
  46646. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  46647. <dd><p>each channel is displayed using the terrain color scheme
  46648. </p></dd>
  46649. </dl>
  46650. <p>Default value is &lsquo;<samp>intensity</samp>&rsquo;.
  46651. </p>
  46652. </dd>
  46653. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  46654. <dd><p>Specify scale used for calculating intensity color values.
  46655. </p>
  46656. <p>It accepts the following values:
  46657. </p><dl compact="compact">
  46658. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46659. <dd><p>linear
  46660. </p></dd>
  46661. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46662. <dd><p>square root, default
  46663. </p></dd>
  46664. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46665. <dd><p>cubic root
  46666. </p></dd>
  46667. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46668. <dd><p>logarithmic
  46669. </p></dd>
  46670. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  46671. <dd><p>4th root
  46672. </p></dd>
  46673. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  46674. <dd><p>5th root
  46675. </p></dd>
  46676. </dl>
  46677. <p>Default value is &lsquo;<samp>log</samp>&rsquo;.
  46678. </p>
  46679. </dd>
  46680. <dt>&lsquo;<samp>fscale</samp>&rsquo;</dt>
  46681. <dd><p>Specify frequency scale.
  46682. </p>
  46683. <p>It accepts the following values:
  46684. </p><dl compact="compact">
  46685. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46686. <dd><p>linear
  46687. </p></dd>
  46688. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46689. <dd><p>logarithmic
  46690. </p></dd>
  46691. </dl>
  46692. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  46693. </p>
  46694. </dd>
  46695. <dt>&lsquo;<samp>saturation</samp>&rsquo;</dt>
  46696. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  46697. alternative color scheme. <code>0</code> is no saturation at all.
  46698. Saturation must be in [-10.0, 10.0] range.
  46699. Default value is <code>1</code>.
  46700. </p>
  46701. </dd>
  46702. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  46703. <dd><p>Set window function.
  46704. </p>
  46705. <p>It accepts the following values:
  46706. </p><dl compact="compact">
  46707. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  46708. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  46709. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  46710. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  46711. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  46712. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  46713. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  46714. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  46715. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  46716. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  46717. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  46718. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  46719. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  46720. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  46721. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  46722. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  46723. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  46724. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  46725. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  46726. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  46727. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  46728. </dl>
  46729. <p>Default value is <code>hann</code>.
  46730. </p>
  46731. </dd>
  46732. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  46733. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  46734. <code>horizontal</code>. Default is <code>vertical</code>.
  46735. </p>
  46736. </dd>
  46737. <dt>&lsquo;<samp>gain</samp>&rsquo;</dt>
  46738. <dd><p>Set scale gain for calculating intensity color values.
  46739. Default value is <code>1</code>.
  46740. </p>
  46741. </dd>
  46742. <dt>&lsquo;<samp>legend</samp>&rsquo;</dt>
  46743. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  46744. </p>
  46745. </dd>
  46746. <dt>&lsquo;<samp>rotation</samp>&rsquo;</dt>
  46747. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  46748. Default value is <code>0</code>.
  46749. </p>
  46750. </dd>
  46751. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  46752. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  46753. </p>
  46754. </dd>
  46755. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  46756. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  46757. </p></dd>
  46758. </dl>
  46759. <a name="Examples-181"></a>
  46760. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-181">44.23.1 Examples</a></h3>
  46761. <ul>
  46762. <li>
  46763. Extract an audio spectrogram of a whole audio track
  46764. in a 1024x1024 picture using <code>ffmpeg</code>:
  46765. <div class="example">
  46766. <pre class="example">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  46767. </pre></div>
  46768. </li></ul>
  46769. <a name="showvolume"></a>
  46770. <h2 class="section"><a href="ffmpeg-all.html#toc-showvolume">44.24 showvolume</a></h2>
  46771. <p>Convert input audio volume to a video output.
  46772. </p>
  46773. <p>The filter accepts the following options:
  46774. </p>
  46775. <dl compact="compact">
  46776. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  46777. <dd><p>Set video rate.
  46778. </p>
  46779. </dd>
  46780. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  46781. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  46782. </p>
  46783. </dd>
  46784. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  46785. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  46786. </p>
  46787. </dd>
  46788. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  46789. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  46790. </p>
  46791. </dd>
  46792. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  46793. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  46794. </p>
  46795. </dd>
  46796. <dt>&lsquo;<samp>c</samp>&rsquo;</dt>
  46797. <dd><p>Set volume color expression.
  46798. </p>
  46799. <p>The expression can use the following variables:
  46800. </p>
  46801. <dl compact="compact">
  46802. <dt>&lsquo;<samp>VOLUME</samp>&rsquo;</dt>
  46803. <dd><p>Current max volume of channel in dB.
  46804. </p>
  46805. </dd>
  46806. <dt>&lsquo;<samp>PEAK</samp>&rsquo;</dt>
  46807. <dd><p>Current peak.
  46808. </p>
  46809. </dd>
  46810. <dt>&lsquo;<samp>CHANNEL</samp>&rsquo;</dt>
  46811. <dd><p>Current channel number, starting from 0.
  46812. </p></dd>
  46813. </dl>
  46814. </dd>
  46815. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  46816. <dd><p>If set, displays channel names. Default is enabled.
  46817. </p>
  46818. </dd>
  46819. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  46820. <dd><p>If set, displays volume values. Default is enabled.
  46821. </p>
  46822. </dd>
  46823. <dt>&lsquo;<samp>o</samp>&rsquo;</dt>
  46824. <dd><p>Set orientation, can be horizontal: <code>h</code> or vertical: <code>v</code>,
  46825. default is <code>h</code>.
  46826. </p>
  46827. </dd>
  46828. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  46829. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  46830. step is disabled.
  46831. </p>
  46832. </dd>
  46833. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  46834. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  46835. </p>
  46836. </dd>
  46837. <dt>&lsquo;<samp>m</samp>&rsquo;</dt>
  46838. <dd><p>Set metering mode, can be peak: <code>p</code> or rms: <code>r</code>,
  46839. default is <code>p</code>.
  46840. </p>
  46841. </dd>
  46842. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  46843. <dd><p>Set display scale, can be linear: <code>lin</code> or log: <code>log</code>,
  46844. default is <code>lin</code>.
  46845. </p>
  46846. </dd>
  46847. <dt>&lsquo;<samp>dm</samp>&rsquo;</dt>
  46848. <dd><p>In second.
  46849. If set to &gt; 0., display a line for the max level
  46850. in the previous seconds.
  46851. default is disabled: <code>0.</code>
  46852. </p>
  46853. </dd>
  46854. <dt>&lsquo;<samp>dmc</samp>&rsquo;</dt>
  46855. <dd><p>The color of the max line. Use when <code>dm</code> option is set to &gt; 0.
  46856. default is: <code>orange</code>
  46857. </p></dd>
  46858. </dl>
  46859. <a name="showwaves"></a>
  46860. <h2 class="section"><a href="ffmpeg-all.html#toc-showwaves">44.25 showwaves</a></h2>
  46861. <p>Convert input audio to a video output, representing the samples waves.
  46862. </p>
  46863. <p>The filter accepts the following options:
  46864. </p>
  46865. <dl compact="compact">
  46866. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46867. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46868. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46869. Default value is <code>600x240</code>.
  46870. </p>
  46871. </dd>
  46872. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  46873. <dd><p>Set display mode.
  46874. </p>
  46875. <p>Available values are:
  46876. </p><dl compact="compact">
  46877. <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
  46878. <dd><p>Draw a point for each sample.
  46879. </p>
  46880. </dd>
  46881. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  46882. <dd><p>Draw a vertical line for each sample.
  46883. </p>
  46884. </dd>
  46885. <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
  46886. <dd><p>Draw a point for each sample and a line between them.
  46887. </p>
  46888. </dd>
  46889. <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
  46890. <dd><p>Draw a centered vertical line for each sample.
  46891. </p></dd>
  46892. </dl>
  46893. <p>Default value is <code>point</code>.
  46894. </p>
  46895. </dd>
  46896. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  46897. <dd><p>Set the number of samples which are printed on the same column. A
  46898. larger value will decrease the frame rate. Must be a positive
  46899. integer. This option can be set only if the value for <var>rate</var>
  46900. is not explicitly specified.
  46901. </p>
  46902. </dd>
  46903. <dt>&lsquo;<samp>rate, r</samp>&rsquo;</dt>
  46904. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  46905. option <var>n</var>. Default value is &quot;25&quot;.
  46906. </p>
  46907. </dd>
  46908. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  46909. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  46910. </p>
  46911. </dd>
  46912. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  46913. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  46914. </p>
  46915. </dd>
  46916. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  46917. <dd><p>Set amplitude scale.
  46918. </p>
  46919. <p>Available values are:
  46920. </p><dl compact="compact">
  46921. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46922. <dd><p>Linear.
  46923. </p>
  46924. </dd>
  46925. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  46926. <dd><p>Logarithmic.
  46927. </p>
  46928. </dd>
  46929. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  46930. <dd><p>Square root.
  46931. </p>
  46932. </dd>
  46933. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  46934. <dd><p>Cubic root.
  46935. </p></dd>
  46936. </dl>
  46937. <p>Default is linear.
  46938. </p>
  46939. </dd>
  46940. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  46941. <dd><p>Set the draw mode. This is mostly useful to set for high <var>n</var>.
  46942. </p>
  46943. <p>Available values are:
  46944. </p><dl compact="compact">
  46945. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  46946. <dd><p>Scale pixel values for each drawn sample.
  46947. </p>
  46948. </dd>
  46949. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  46950. <dd><p>Draw every sample directly.
  46951. </p></dd>
  46952. </dl>
  46953. <p>Default value is <code>scale</code>.
  46954. </p></dd>
  46955. </dl>
  46956. <a name="Examples-66"></a>
  46957. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-66">44.25.1 Examples</a></h3>
  46958. <ul>
  46959. <li>
  46960. Output the input file audio and the corresponding video representation
  46961. at the same time:
  46962. <div class="example">
  46963. <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
  46964. </pre></div>
  46965. </li><li>
  46966. Create a synthetic signal and show it with showwaves, forcing a
  46967. frame rate of 30 frames per second:
  46968. <div class="example">
  46969. <pre class="example">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
  46970. </pre></div>
  46971. </li></ul>
  46972. <a name="showwavespic"></a>
  46973. <h2 class="section"><a href="ffmpeg-all.html#toc-showwavespic">44.26 showwavespic</a></h2>
  46974. <p>Convert input audio to a single video frame, representing the samples waves.
  46975. </p>
  46976. <p>The filter accepts the following options:
  46977. </p>
  46978. <dl compact="compact">
  46979. <dt>&lsquo;<samp>size, s</samp>&rsquo;</dt>
  46980. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  46981. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  46982. Default value is <code>600x240</code>.
  46983. </p>
  46984. </dd>
  46985. <dt>&lsquo;<samp>split_channels</samp>&rsquo;</dt>
  46986. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  46987. </p>
  46988. </dd>
  46989. <dt>&lsquo;<samp>colors</samp>&rsquo;</dt>
  46990. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  46991. </p>
  46992. </dd>
  46993. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  46994. <dd><p>Set amplitude scale.
  46995. </p>
  46996. <p>Available values are:
  46997. </p><dl compact="compact">
  46998. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  46999. <dd><p>Linear.
  47000. </p>
  47001. </dd>
  47002. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  47003. <dd><p>Logarithmic.
  47004. </p>
  47005. </dd>
  47006. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  47007. <dd><p>Square root.
  47008. </p>
  47009. </dd>
  47010. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  47011. <dd><p>Cubic root.
  47012. </p></dd>
  47013. </dl>
  47014. <p>Default is linear.
  47015. </p>
  47016. </dd>
  47017. <dt>&lsquo;<samp>draw</samp>&rsquo;</dt>
  47018. <dd><p>Set the draw mode.
  47019. </p>
  47020. <p>Available values are:
  47021. </p><dl compact="compact">
  47022. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47023. <dd><p>Scale pixel values for each drawn sample.
  47024. </p>
  47025. </dd>
  47026. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  47027. <dd><p>Draw every sample directly.
  47028. </p></dd>
  47029. </dl>
  47030. <p>Default value is <code>scale</code>.
  47031. </p></dd>
  47032. </dl>
  47033. <a name="Examples-59"></a>
  47034. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-59">44.26.1 Examples</a></h3>
  47035. <ul>
  47036. <li>
  47037. Extract a channel split representation of the wave form of a whole audio track
  47038. in a 1024x800 picture using <code>ffmpeg</code>:
  47039. <div class="example">
  47040. <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  47041. </pre></div>
  47042. </li></ul>
  47043. <a name="sidedata_002c-asidedata"></a>
  47044. <h2 class="section"><a href="ffmpeg-all.html#toc-sidedata_002c-asidedata">44.27 sidedata, asidedata</a></h2>
  47045. <p>Delete frame side data, or select frames based on it.
  47046. </p>
  47047. <p>This filter accepts the following options:
  47048. </p>
  47049. <dl compact="compact">
  47050. <dt>&lsquo;<samp>mode</samp>&rsquo;</dt>
  47051. <dd><p>Set mode of operation of the filter.
  47052. </p>
  47053. <p>Can be one of the following:
  47054. </p>
  47055. <dl compact="compact">
  47056. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  47057. <dd><p>Select every frame with side data of <code>type</code>.
  47058. </p>
  47059. </dd>
  47060. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  47061. <dd><p>Delete side data of <code>type</code>. If <code>type</code> is not set, delete all side
  47062. data in the frame.
  47063. </p>
  47064. </dd>
  47065. </dl>
  47066. </dd>
  47067. <dt>&lsquo;<samp>type</samp>&rsquo;</dt>
  47068. <dd><p>Set side data type used with all modes. Must be set for <code>select</code> mode. For
  47069. the list of frame side data types, refer to the <code>AVFrameSideDataType</code> enum
  47070. in &lsquo;<tt>libavutil/frame.h</tt>&rsquo;. For example, to choose
  47071. <code>AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code>PANSCAN</code>.
  47072. </p>
  47073. </dd>
  47074. </dl>
  47075. <a name="spectrumsynth"></a>
  47076. <h2 class="section"><a href="ffmpeg-all.html#toc-spectrumsynth">44.28 spectrumsynth</a></h2>
  47077. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  47078. magnitude across time and second represents phase across time.
  47079. The filter will transform from frequency domain as displayed in videos back
  47080. to time domain as presented in audio output.
  47081. </p>
  47082. <p>This filter is primarily created for reversing processed <a href="#showspectrum">showspectrum</a>
  47083. filter outputs, but can synthesize sound from other spectrograms too.
  47084. But in such case results are going to be poor if the phase data is not
  47085. available, because in such cases phase data need to be recreated, usually
  47086. it&rsquo;s just recreated from random noise.
  47087. For best results use gray only output (<code>channel</code> color mode in
  47088. <a href="#showspectrum">showspectrum</a> filter) and <code>log</code> scale for magnitude video and
  47089. <code>lin</code> scale for phase video. To produce phase, for 2nd video, use
  47090. <code>data</code> option. Inputs videos should generally use <code>fullframe</code>
  47091. slide mode as that saves resources needed for decoding video.
  47092. </p>
  47093. <p>The filter accepts the following options:
  47094. </p>
  47095. <dl compact="compact">
  47096. <dt>&lsquo;<samp>sample_rate</samp>&rsquo;</dt>
  47097. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  47098. spectrum was generated may differ.
  47099. </p>
  47100. </dd>
  47101. <dt>&lsquo;<samp>channels</samp>&rsquo;</dt>
  47102. <dd><p>Set number of channels represented in input video spectrums.
  47103. </p>
  47104. </dd>
  47105. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  47106. <dd><p>Set scale which was used when generating magnitude input spectrum.
  47107. Can be <code>lin</code> or <code>log</code>. Default is <code>log</code>.
  47108. </p>
  47109. </dd>
  47110. <dt>&lsquo;<samp>slide</samp>&rsquo;</dt>
  47111. <dd><p>Set slide which was used when generating inputs spectrums.
  47112. Can be <code>replace</code>, <code>scroll</code>, <code>fullframe</code> or <code>rscroll</code>.
  47113. Default is <code>fullframe</code>.
  47114. </p>
  47115. </dd>
  47116. <dt>&lsquo;<samp>win_func</samp>&rsquo;</dt>
  47117. <dd><p>Set window function used for resynthesis.
  47118. </p>
  47119. </dd>
  47120. <dt>&lsquo;<samp>overlap</samp>&rsquo;</dt>
  47121. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  47122. which means optimal overlap for selected window function will be picked.
  47123. </p>
  47124. </dd>
  47125. <dt>&lsquo;<samp>orientation</samp>&rsquo;</dt>
  47126. <dd><p>Set orientation of input videos. Can be <code>vertical</code> or <code>horizontal</code>.
  47127. Default is <code>vertical</code>.
  47128. </p></dd>
  47129. </dl>
  47130. <a name="Examples-141"></a>
  47131. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-141">44.28.1 Examples</a></h3>
  47132. <ul>
  47133. <li>
  47134. First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  47135. then resynthesize videos back to audio with spectrumsynth:
  47136. <div class="example">
  47137. <pre class="example">ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
  47138. ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=lin:overlap=0.875:color=channel:slide=fullframe:data=phase -an -c:v rawvideo phase.nut
  47139. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  47140. </pre></div>
  47141. </li></ul>
  47142. <a name="split_002c-asplit"></a>
  47143. <h2 class="section"><a href="ffmpeg-all.html#toc-split_002c-asplit">44.29 split, asplit</a></h2>
  47144. <p>Split input into several identical outputs.
  47145. </p>
  47146. <p><code>asplit</code> works with audio input, <code>split</code> with video.
  47147. </p>
  47148. <p>The filter accepts a single parameter which specifies the number of outputs. If
  47149. unspecified, it defaults to 2.
  47150. </p>
  47151. <a name="Examples-6"></a>
  47152. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-6">44.29.1 Examples</a></h3>
  47153. <ul>
  47154. <li>
  47155. Create two separate outputs from the same input:
  47156. <div class="example">
  47157. <pre class="example">[in] split [out0][out1]
  47158. </pre></div>
  47159. </li><li>
  47160. To create 3 or more outputs, you need to specify the number of
  47161. outputs, like in:
  47162. <div class="example">
  47163. <pre class="example">[in] asplit=3 [out0][out1][out2]
  47164. </pre></div>
  47165. </li><li>
  47166. Create two separate outputs from the same input, one cropped and
  47167. one padded:
  47168. <div class="example">
  47169. <pre class="example">[in] split [splitout1][splitout2];
  47170. [splitout1] crop=100:100:0:0 [cropout];
  47171. [splitout2] pad=200:200:100:100 [padout];
  47172. </pre></div>
  47173. </li><li>
  47174. Create 5 copies of the input audio with <code>ffmpeg</code>:
  47175. <div class="example">
  47176. <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  47177. </pre></div>
  47178. </li></ul>
  47179. <a name="zmq_002c-azmq"></a>
  47180. <h2 class="section"><a href="ffmpeg-all.html#toc-zmq_002c-azmq">44.30 zmq, azmq</a></h2>
  47181. <p>Receive commands sent through a libzmq client, and forward them to
  47182. filters in the filtergraph.
  47183. </p>
  47184. <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
  47185. must be inserted between two video filters, <code>azmq</code> between two
  47186. audio filters. Both are capable to send messages to any filter type.
  47187. </p>
  47188. <p>To enable these filters you need to install the libzmq library and
  47189. headers and configure FFmpeg with <code>--enable-libzmq</code>.
  47190. </p>
  47191. <p>For more information about libzmq see:
  47192. <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  47193. </p>
  47194. <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
  47195. receives messages sent through a network interface defined by the
  47196. &lsquo;<samp>bind_address</samp>&rsquo; (or the abbreviation &quot;&lsquo;<samp>b</samp>&rsquo;&quot;) option.
  47197. Default value of this option is &lsquo;<tt>tcp://localhost:5555</tt>&rsquo;. You may
  47198. want to alter this value to your needs, but do not forget to escape any
  47199. &rsquo;:&rsquo; signs (see <a href="#filtergraph-escaping">filtergraph escaping</a>).
  47200. </p>
  47201. <p>The received message must be in the form:
  47202. </p><div class="example">
  47203. <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  47204. </pre></div>
  47205. <p><var>TARGET</var> specifies the target of the command, usually the name of
  47206. the filter class or a specific filter instance name. The default
  47207. filter instance name uses the pattern &lsquo;<samp>Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  47208. but you can override this by using the &lsquo;<samp>filter_name@id</samp>&rsquo; syntax
  47209. (see <a href="#Filtergraph-syntax">Filtergraph syntax</a>).
  47210. </p>
  47211. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  47212. </p>
  47213. <p><var>ARG</var> is optional and specifies the optional argument list for the
  47214. given <var>COMMAND</var>.
  47215. </p>
  47216. <p>Upon reception, the message is processed and the corresponding command
  47217. is injected into the filtergraph. Depending on the result, the filter
  47218. will send a reply to the client, adopting the format:
  47219. </p><div class="example">
  47220. <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
  47221. <var>MESSAGE</var>
  47222. </pre></div>
  47223. <p><var>MESSAGE</var> is optional.
  47224. </p>
  47225. <a name="Examples-140"></a>
  47226. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-140">44.30.1 Examples</a></h3>
  47227. <p>Look at &lsquo;<tt>tools/zmqsend</tt>&rsquo; for an example of a zmq client which can
  47228. be used to send commands processed by these filters.
  47229. </p>
  47230. <p>Consider the following filtergraph generated by <code>ffplay</code>.
  47231. In this example the last overlay filter has an instance name. All other
  47232. filters will have default instance names.
  47233. </p>
  47234. <div class="example">
  47235. <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
  47236. color=s=100x100:c=red [l];
  47237. color=s=100x100:c=blue [r];
  47238. nullsrc=s=200x100, zmq [bg];
  47239. [bg][l] overlay [bg+l];
  47240. [bg+l][r] overlay@my=x=100 &quot;
  47241. </pre></div>
  47242. <p>To change the color of the left side of the video, the following
  47243. command can be used:
  47244. </p><div class="example">
  47245. <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
  47246. </pre></div>
  47247. <p>To change the right side:
  47248. </p><div class="example">
  47249. <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
  47250. </pre></div>
  47251. <p>To change the position of the right side:
  47252. </p><div class="example">
  47253. <pre class="example">echo overlay@my x 150 | tools/zmqsend
  47254. </pre></div>
  47255. <a name="Multimedia-Sources"></a>
  47256. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Multimedia-Sources">45 Multimedia Sources</a></h1>
  47257. <p>Below is a description of the currently available multimedia sources.
  47258. </p>
  47259. <a name="amovie"></a>
  47260. <h2 class="section"><a href="ffmpeg-all.html#toc-amovie">45.1 amovie</a></h2>
  47261. <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
  47262. stream by default.
  47263. </p>
  47264. <p><a name="movie"></a>
  47265. </p><a name="movie-1"></a>
  47266. <h2 class="section"><a href="ffmpeg-all.html#toc-movie-1">45.2 movie</a></h2>
  47267. <p>Read audio and/or video stream(s) from a movie container.
  47268. </p>
  47269. <p>It accepts the following parameters:
  47270. </p>
  47271. <dl compact="compact">
  47272. <dt>&lsquo;<samp>filename</samp>&rsquo;</dt>
  47273. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  47274. device or a stream accessed through some protocol).
  47275. </p>
  47276. </dd>
  47277. <dt>&lsquo;<samp>format_name, f</samp>&rsquo;</dt>
  47278. <dd><p>Specifies the format assumed for the movie to read, and can be either
  47279. the name of a container or an input device. If not specified, the
  47280. format is guessed from <var>movie_name</var> or by probing.
  47281. </p>
  47282. </dd>
  47283. <dt>&lsquo;<samp>seek_point, sp</samp>&rsquo;</dt>
  47284. <dd><p>Specifies the seek point in seconds. The frames will be output
  47285. starting from this seek point. The parameter is evaluated with
  47286. <code>av_strtod</code>, so the numerical value may be suffixed by an IS
  47287. postfix. The default value is &quot;0&quot;.
  47288. </p>
  47289. </dd>
  47290. <dt>&lsquo;<samp>streams, s</samp>&rsquo;</dt>
  47291. <dd><p>Specifies the streams to read. Several streams can be specified,
  47292. separated by &quot;+&quot;. The source will then have as many outputs, in the
  47293. same order. The syntax is explained in the <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)&quot;Stream specifiers&quot; section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  47294. respectively the default (best suited) video and audio stream. Default
  47295. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  47296. </p>
  47297. </dd>
  47298. <dt>&lsquo;<samp>stream_index, si</samp>&rsquo;</dt>
  47299. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  47300. the most suitable video stream will be automatically selected. The default
  47301. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  47302. audio instead of video.
  47303. </p>
  47304. </dd>
  47305. <dt>&lsquo;<samp>loop</samp>&rsquo;</dt>
  47306. <dd><p>Specifies how many times to read the stream in sequence.
  47307. If the value is 0, the stream will be looped infinitely.
  47308. Default value is &quot;1&quot;.
  47309. </p>
  47310. <p>Note that when the movie is looped the source timestamps are not
  47311. changed, so it will generate non monotonically increasing timestamps.
  47312. </p>
  47313. </dd>
  47314. <dt>&lsquo;<samp>discontinuity</samp>&rsquo;</dt>
  47315. <dd><p>Specifies the time difference between frames above which the point is
  47316. considered a timestamp discontinuity which is removed by adjusting the later
  47317. timestamps.
  47318. </p></dd>
  47319. </dl>
  47320. <p>It allows overlaying a second video on top of the main input of
  47321. a filtergraph, as shown in this graph:
  47322. </p><div class="example">
  47323. <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  47324. ^
  47325. |
  47326. movie --&gt; scale--&gt; deltapts1 -------+
  47327. </pre></div>
  47328. <a name="Examples-160"></a>
  47329. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Examples-160">45.2.1 Examples</a></h3>
  47330. <ul>
  47331. <li>
  47332. Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  47333. on top of the input labelled &quot;in&quot;:
  47334. <div class="example">
  47335. <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  47336. [in] setpts=PTS-STARTPTS [main];
  47337. [main][over] overlay=16:16 [out]
  47338. </pre></div>
  47339. </li><li>
  47340. Read from a video4linux2 device, and overlay it on top of the input
  47341. labelled &quot;in&quot;:
  47342. <div class="example">
  47343. <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  47344. [in] setpts=PTS-STARTPTS [main];
  47345. [main][over] overlay=16:16 [out]
  47346. </pre></div>
  47347. </li><li>
  47348. Read the first video stream and the audio stream with id 0x81 from
  47349. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  47350. connected to the pad named &quot;audio&quot;:
  47351. <div class="example">
  47352. <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  47353. </pre></div>
  47354. </li></ul>
  47355. <a name="Commands-6"></a>
  47356. <h3 class="subsection"><a href="ffmpeg-all.html#toc-Commands-6">45.2.2 Commands</a></h3>
  47357. <p>Both movie and amovie support the following commands:
  47358. </p><dl compact="compact">
  47359. <dt>&lsquo;<samp>seek</samp>&rsquo;</dt>
  47360. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  47361. The syntax is: seek <var>stream_index</var>|<var>timestamp</var>|<var>flags</var>
  47362. </p><ul>
  47363. <li>
  47364. <var>stream_index</var>: If stream_index is -1, a default
  47365. stream is selected, and <var>timestamp</var> is automatically converted
  47366. from AV_TIME_BASE units to the stream specific time_base.
  47367. </li><li>
  47368. <var>timestamp</var>: Timestamp in AVStream.time_base units
  47369. or, if no stream is specified, in AV_TIME_BASE units.
  47370. </li><li>
  47371. <var>flags</var>: Flags which select direction and seeking mode.
  47372. </li></ul>
  47373. </dd>
  47374. <dt>&lsquo;<samp>get_duration</samp>&rsquo;</dt>
  47375. <dd><p>Get movie duration in AV_TIME_BASE units.
  47376. </p>
  47377. </dd>
  47378. </dl>
  47379. <a name="See-Also"></a>
  47380. <h1 class="chapter"><a href="ffmpeg-all.html#toc-See-Also">46 See Also</a></h1>
  47381. <p><a href="ffmpeg.html">ffmpeg</a>
  47382. <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  47383. <a href="ffmpeg-utils.html">ffmpeg-utils</a>,
  47384. <a href="ffmpeg-scaler.html">ffmpeg-scaler</a>,
  47385. <a href="ffmpeg-resampler.html">ffmpeg-resampler</a>,
  47386. <a href="ffmpeg-codecs.html">ffmpeg-codecs</a>,
  47387. <a href="ffmpeg-bitstream-filters.html">ffmpeg-bitstream-filters</a>,
  47388. <a href="ffmpeg-formats.html">ffmpeg-formats</a>,
  47389. <a href="ffmpeg-devices.html">ffmpeg-devices</a>,
  47390. <a href="ffmpeg-protocols.html">ffmpeg-protocols</a>,
  47391. <a href="ffmpeg-filters.html">ffmpeg-filters</a>
  47392. </p>
  47393. <a name="Authors"></a>
  47394. <h1 class="chapter"><a href="ffmpeg-all.html#toc-Authors">47 Authors</a></h1>
  47395. <p>The FFmpeg developers.
  47396. </p>
  47397. <p>For details about the authorship, see the Git history of the project
  47398. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  47399. <code>git log</code> in the FFmpeg source directory, or browsing the
  47400. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  47401. </p>
  47402. <p>Maintainers for the specific components are listed in the file
  47403. &lsquo;<tt>MAINTAINERS</tt>&rsquo; in the source code tree.
  47404. </p>
  47405. </div>
  47406. </body>
  47407. </html>