ffmpeg-filters.html 1.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by , GNU Texinfo 7.1.1 -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg Filters Documentation
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg Filters Documentation
  17. </h1>
  18. <a name="SEC_Top"></a>
  19. <div class="element-contents" id="SEC_Contents">
  20. <h2 class="contents-heading">Table of Contents</h2>
  21. <div class="contents">
  22. <ul class="toc-numbered-mark">
  23. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  24. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">2 Filtering Introduction</a></li>
  25. <li><a id="toc-graph2dot" href="#graph2dot">3 graph2dot</a></li>
  26. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">4 Filtergraph description</a>
  27. <ul class="toc-numbered-mark">
  28. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">4.1 Filtergraph syntax</a></li>
  29. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">4.2 Notes on filtergraph escaping</a></li>
  30. </ul></li>
  31. <li><a id="toc-Timeline-editing" href="#Timeline-editing">5 Timeline editing</a></li>
  32. <li><a id="toc-Changing-options-at-runtime-with-a-command" href="#Changing-options-at-runtime-with-a-command">6 Changing options at runtime with a command</a></li>
  33. <li><a id="toc-Options-for-filters-with-several-inputs-_0028framesync_0029" href="#Options-for-filters-with-several-inputs-_0028framesync_0029">7 Options for filters with several inputs (framesync)</a></li>
  34. <li><a id="toc-Audio-Filters" href="#Audio-Filters">8 Audio Filters</a>
  35. <ul class="toc-numbered-mark">
  36. <li><a id="toc-aap" href="#aap">8.1 aap</a></li>
  37. <li><a id="toc-acompressor" href="#acompressor">8.2 acompressor</a>
  38. <ul class="toc-numbered-mark">
  39. <li><a id="toc-Commands" href="#Commands">8.2.1 Commands</a></li>
  40. </ul></li>
  41. <li><a id="toc-acontrast" href="#acontrast">8.3 acontrast</a></li>
  42. <li><a id="toc-acopy" href="#acopy">8.4 acopy</a></li>
  43. <li><a id="toc-acrossfade" href="#acrossfade">8.5 acrossfade</a>
  44. <ul class="toc-numbered-mark">
  45. <li><a id="toc-Examples" href="#Examples">8.5.1 Examples</a></li>
  46. </ul></li>
  47. <li><a id="toc-acrossover" href="#acrossover">8.6 acrossover</a>
  48. <ul class="toc-numbered-mark">
  49. <li><a id="toc-Examples-1" href="#Examples-1">8.6.1 Examples</a></li>
  50. </ul></li>
  51. <li><a id="toc-acrusher" href="#acrusher">8.7 acrusher</a>
  52. <ul class="toc-numbered-mark">
  53. <li><a id="toc-Commands-1" href="#Commands-1">8.7.1 Commands</a></li>
  54. </ul></li>
  55. <li><a id="toc-acue" href="#acue">8.8 acue</a></li>
  56. <li><a id="toc-adeclick" href="#adeclick">8.9 adeclick</a></li>
  57. <li><a id="toc-adeclip" href="#adeclip">8.10 adeclip</a></li>
  58. <li><a id="toc-adecorrelate" href="#adecorrelate">8.11 adecorrelate</a></li>
  59. <li><a id="toc-adelay" href="#adelay">8.12 adelay</a>
  60. <ul class="toc-numbered-mark">
  61. <li><a id="toc-Examples-2" href="#Examples-2">8.12.1 Examples</a></li>
  62. </ul></li>
  63. <li><a id="toc-adenorm" href="#adenorm">8.13 adenorm</a>
  64. <ul class="toc-numbered-mark">
  65. <li><a id="toc-Commands-2" href="#Commands-2">8.13.1 Commands</a></li>
  66. </ul></li>
  67. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">8.14 aderivative, aintegral</a></li>
  68. <li><a id="toc-adrc" href="#adrc">8.15 adrc</a>
  69. <ul class="toc-numbered-mark">
  70. <li><a id="toc-Commands-3" href="#Commands-3">8.15.1 Commands</a></li>
  71. <li><a id="toc-Examples-3" href="#Examples-3">8.15.2 Examples</a></li>
  72. </ul></li>
  73. <li><a id="toc-adynamicequalizer" href="#adynamicequalizer">8.16 adynamicequalizer</a>
  74. <ul class="toc-numbered-mark">
  75. <li><a id="toc-Commands-4" href="#Commands-4">8.16.1 Commands</a></li>
  76. </ul></li>
  77. <li><a id="toc-adynamicsmooth" href="#adynamicsmooth">8.17 adynamicsmooth</a>
  78. <ul class="toc-numbered-mark">
  79. <li><a id="toc-Commands-5" href="#Commands-5">8.17.1 Commands</a></li>
  80. </ul></li>
  81. <li><a id="toc-aecho" href="#aecho">8.18 aecho</a>
  82. <ul class="toc-numbered-mark">
  83. <li><a id="toc-Examples-4" href="#Examples-4">8.18.1 Examples</a></li>
  84. </ul></li>
  85. <li><a id="toc-aemphasis" href="#aemphasis">8.19 aemphasis</a>
  86. <ul class="toc-numbered-mark">
  87. <li><a id="toc-Commands-6" href="#Commands-6">8.19.1 Commands</a></li>
  88. </ul></li>
  89. <li><a id="toc-aeval" href="#aeval">8.20 aeval</a>
  90. <ul class="toc-numbered-mark">
  91. <li><a id="toc-Examples-5" href="#Examples-5">8.20.1 Examples</a></li>
  92. </ul></li>
  93. <li><a id="toc-aexciter" href="#aexciter">8.21 aexciter</a>
  94. <ul class="toc-numbered-mark">
  95. <li><a id="toc-Commands-7" href="#Commands-7">8.21.1 Commands</a></li>
  96. </ul></li>
  97. <li><a id="toc-afade-1" href="#afade-1">8.22 afade</a>
  98. <ul class="toc-numbered-mark">
  99. <li><a id="toc-Commands-8" href="#Commands-8">8.22.1 Commands</a></li>
  100. <li><a id="toc-Examples-6" href="#Examples-6">8.22.2 Examples</a></li>
  101. </ul></li>
  102. <li><a id="toc-afftdn" href="#afftdn">8.23 afftdn</a>
  103. <ul class="toc-numbered-mark">
  104. <li><a id="toc-Commands-9" href="#Commands-9">8.23.1 Commands</a></li>
  105. <li><a id="toc-Examples-7" href="#Examples-7">8.23.2 Examples</a></li>
  106. </ul></li>
  107. <li><a id="toc-afftfilt" href="#afftfilt">8.24 afftfilt</a>
  108. <ul class="toc-numbered-mark">
  109. <li><a id="toc-Examples-8" href="#Examples-8">8.24.1 Examples</a></li>
  110. </ul></li>
  111. <li><a id="toc-afir-1" href="#afir-1">8.25 afir</a>
  112. <ul class="toc-numbered-mark">
  113. <li><a id="toc-Examples-9" href="#Examples-9">8.25.1 Examples</a></li>
  114. </ul></li>
  115. <li><a id="toc-aformat-1" href="#aformat-1">8.26 aformat</a></li>
  116. <li><a id="toc-afreqshift" href="#afreqshift">8.27 afreqshift</a>
  117. <ul class="toc-numbered-mark">
  118. <li><a id="toc-Commands-10" href="#Commands-10">8.27.1 Commands</a></li>
  119. </ul></li>
  120. <li><a id="toc-afwtdn" href="#afwtdn">8.28 afwtdn</a>
  121. <ul class="toc-numbered-mark">
  122. <li><a id="toc-Commands-11" href="#Commands-11">8.28.1 Commands</a></li>
  123. </ul></li>
  124. <li><a id="toc-agate" href="#agate">8.29 agate</a>
  125. <ul class="toc-numbered-mark">
  126. <li><a id="toc-Commands-12" href="#Commands-12">8.29.1 Commands</a></li>
  127. </ul></li>
  128. <li><a id="toc-aiir" href="#aiir">8.30 aiir</a>
  129. <ul class="toc-numbered-mark">
  130. <li><a id="toc-Examples-10" href="#Examples-10">8.30.1 Examples</a></li>
  131. </ul></li>
  132. <li><a id="toc-alimiter" href="#alimiter">8.31 alimiter</a></li>
  133. <li><a id="toc-allpass" href="#allpass">8.32 allpass</a>
  134. <ul class="toc-numbered-mark">
  135. <li><a id="toc-Commands-13" href="#Commands-13">8.32.1 Commands</a></li>
  136. </ul></li>
  137. <li><a id="toc-aloop" href="#aloop">8.33 aloop</a></li>
  138. <li><a id="toc-amerge-1" href="#amerge-1">8.34 amerge</a>
  139. <ul class="toc-numbered-mark">
  140. <li><a id="toc-Examples-11" href="#Examples-11">8.34.1 Examples</a></li>
  141. </ul></li>
  142. <li><a id="toc-amix" href="#amix">8.35 amix</a>
  143. <ul class="toc-numbered-mark">
  144. <li><a id="toc-Examples-12" href="#Examples-12">8.35.1 Examples</a></li>
  145. <li><a id="toc-Commands-14" href="#Commands-14">8.35.2 Commands</a></li>
  146. </ul></li>
  147. <li><a id="toc-amultiply" href="#amultiply">8.36 amultiply</a></li>
  148. <li><a id="toc-anequalizer" href="#anequalizer">8.37 anequalizer</a>
  149. <ul class="toc-numbered-mark">
  150. <li><a id="toc-Examples-13" href="#Examples-13">8.37.1 Examples</a></li>
  151. <li><a id="toc-Commands-15" href="#Commands-15">8.37.2 Commands</a></li>
  152. </ul></li>
  153. <li><a id="toc-anlmdn" href="#anlmdn">8.38 anlmdn</a>
  154. <ul class="toc-numbered-mark">
  155. <li><a id="toc-Commands-16" href="#Commands-16">8.38.1 Commands</a></li>
  156. </ul></li>
  157. <li><a id="toc-anlmf_002c-anlms" href="#anlmf_002c-anlms">8.39 anlmf, anlms</a>
  158. <ul class="toc-numbered-mark">
  159. <li><a id="toc-Examples-14" href="#Examples-14">8.39.1 Examples</a></li>
  160. <li><a id="toc-Commands-17" href="#Commands-17">8.39.2 Commands</a></li>
  161. </ul></li>
  162. <li><a id="toc-anull" href="#anull">8.40 anull</a></li>
  163. <li><a id="toc-apad" href="#apad">8.41 apad</a>
  164. <ul class="toc-numbered-mark">
  165. <li><a id="toc-Examples-15" href="#Examples-15">8.41.1 Examples</a></li>
  166. </ul></li>
  167. <li><a id="toc-aphaser" href="#aphaser">8.42 aphaser</a></li>
  168. <li><a id="toc-aphaseshift" href="#aphaseshift">8.43 aphaseshift</a>
  169. <ul class="toc-numbered-mark">
  170. <li><a id="toc-Commands-18" href="#Commands-18">8.43.1 Commands</a></li>
  171. </ul></li>
  172. <li><a id="toc-apsnr" href="#apsnr">8.44 apsnr</a></li>
  173. <li><a id="toc-apsyclip" href="#apsyclip">8.45 apsyclip</a>
  174. <ul class="toc-numbered-mark">
  175. <li><a id="toc-Commands-19" href="#Commands-19">8.45.1 Commands</a></li>
  176. </ul></li>
  177. <li><a id="toc-apulsator" href="#apulsator">8.46 apulsator</a></li>
  178. <li><a id="toc-aresample-1" href="#aresample-1">8.47 aresample</a>
  179. <ul class="toc-numbered-mark">
  180. <li><a id="toc-Examples-16" href="#Examples-16">8.47.1 Examples</a></li>
  181. </ul></li>
  182. <li><a id="toc-areverse" href="#areverse">8.48 areverse</a>
  183. <ul class="toc-numbered-mark">
  184. <li><a id="toc-Examples-17" href="#Examples-17">8.48.1 Examples</a></li>
  185. </ul></li>
  186. <li><a id="toc-arls" href="#arls">8.49 arls</a></li>
  187. <li><a id="toc-arnndn" href="#arnndn">8.50 arnndn</a>
  188. <ul class="toc-numbered-mark">
  189. <li><a id="toc-Commands-20" href="#Commands-20">8.50.1 Commands</a></li>
  190. </ul></li>
  191. <li><a id="toc-asdr" href="#asdr">8.51 asdr</a></li>
  192. <li><a id="toc-asetnsamples" href="#asetnsamples">8.52 asetnsamples</a></li>
  193. <li><a id="toc-asetrate" href="#asetrate">8.53 asetrate</a></li>
  194. <li><a id="toc-ashowinfo" href="#ashowinfo">8.54 ashowinfo</a></li>
  195. <li><a id="toc-asisdr" href="#asisdr">8.55 asisdr</a></li>
  196. <li><a id="toc-asoftclip" href="#asoftclip">8.56 asoftclip</a>
  197. <ul class="toc-numbered-mark">
  198. <li><a id="toc-Commands-21" href="#Commands-21">8.56.1 Commands</a></li>
  199. </ul></li>
  200. <li><a id="toc-aspectralstats" href="#aspectralstats">8.57 aspectralstats</a></li>
  201. <li><a id="toc-asr" href="#asr">8.58 asr</a></li>
  202. <li><a id="toc-astats-1" href="#astats-1">8.59 astats</a></li>
  203. <li><a id="toc-asubboost" href="#asubboost">8.60 asubboost</a>
  204. <ul class="toc-numbered-mark">
  205. <li><a id="toc-Commands-22" href="#Commands-22">8.60.1 Commands</a></li>
  206. </ul></li>
  207. <li><a id="toc-asubcut" href="#asubcut">8.61 asubcut</a>
  208. <ul class="toc-numbered-mark">
  209. <li><a id="toc-Commands-23" href="#Commands-23">8.61.1 Commands</a></li>
  210. </ul></li>
  211. <li><a id="toc-asupercut" href="#asupercut">8.62 asupercut</a>
  212. <ul class="toc-numbered-mark">
  213. <li><a id="toc-Commands-24" href="#Commands-24">8.62.1 Commands</a></li>
  214. </ul></li>
  215. <li><a id="toc-asuperpass" href="#asuperpass">8.63 asuperpass</a>
  216. <ul class="toc-numbered-mark">
  217. <li><a id="toc-Commands-25" href="#Commands-25">8.63.1 Commands</a></li>
  218. </ul></li>
  219. <li><a id="toc-asuperstop" href="#asuperstop">8.64 asuperstop</a>
  220. <ul class="toc-numbered-mark">
  221. <li><a id="toc-Commands-26" href="#Commands-26">8.64.1 Commands</a></li>
  222. </ul></li>
  223. <li><a id="toc-atempo" href="#atempo">8.65 atempo</a>
  224. <ul class="toc-numbered-mark">
  225. <li><a id="toc-Examples-18" href="#Examples-18">8.65.1 Examples</a></li>
  226. <li><a id="toc-Commands-27" href="#Commands-27">8.65.2 Commands</a></li>
  227. </ul></li>
  228. <li><a id="toc-atilt" href="#atilt">8.66 atilt</a>
  229. <ul class="toc-numbered-mark">
  230. <li><a id="toc-Commands-28" href="#Commands-28">8.66.1 Commands</a></li>
  231. </ul></li>
  232. <li><a id="toc-atrim" href="#atrim">8.67 atrim</a></li>
  233. <li><a id="toc-axcorrelate" href="#axcorrelate">8.68 axcorrelate</a>
  234. <ul class="toc-numbered-mark">
  235. <li><a id="toc-Examples-19" href="#Examples-19">8.68.1 Examples</a></li>
  236. </ul></li>
  237. <li><a id="toc-bandpass" href="#bandpass">8.69 bandpass</a>
  238. <ul class="toc-numbered-mark">
  239. <li><a id="toc-Commands-29" href="#Commands-29">8.69.1 Commands</a></li>
  240. </ul></li>
  241. <li><a id="toc-bandreject" href="#bandreject">8.70 bandreject</a>
  242. <ul class="toc-numbered-mark">
  243. <li><a id="toc-Commands-30" href="#Commands-30">8.70.1 Commands</a></li>
  244. </ul></li>
  245. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">8.71 bass, lowshelf</a>
  246. <ul class="toc-numbered-mark">
  247. <li><a id="toc-Commands-31" href="#Commands-31">8.71.1 Commands</a></li>
  248. </ul></li>
  249. <li><a id="toc-biquad" href="#biquad">8.72 biquad</a>
  250. <ul class="toc-numbered-mark">
  251. <li><a id="toc-Commands-32" href="#Commands-32">8.72.1 Commands</a></li>
  252. </ul></li>
  253. <li><a id="toc-bs2b" href="#bs2b">8.73 bs2b</a></li>
  254. <li><a id="toc-channelmap" href="#channelmap">8.74 channelmap</a>
  255. <ul class="toc-numbered-mark">
  256. <li><a id="toc-Examples-20" href="#Examples-20">8.74.1 Examples</a></li>
  257. </ul></li>
  258. <li><a id="toc-channelsplit" href="#channelsplit">8.75 channelsplit</a>
  259. <ul class="toc-numbered-mark">
  260. <li><a id="toc-Examples-21" href="#Examples-21">8.75.1 Examples</a></li>
  261. </ul></li>
  262. <li><a id="toc-chorus" href="#chorus">8.76 chorus</a>
  263. <ul class="toc-numbered-mark">
  264. <li><a id="toc-Examples-22" href="#Examples-22">8.76.1 Examples</a></li>
  265. </ul></li>
  266. <li><a id="toc-compand" href="#compand">8.77 compand</a>
  267. <ul class="toc-numbered-mark">
  268. <li><a id="toc-Examples-23" href="#Examples-23">8.77.1 Examples</a></li>
  269. </ul></li>
  270. <li><a id="toc-compensationdelay" href="#compensationdelay">8.78 compensationdelay</a>
  271. <ul class="toc-numbered-mark">
  272. <li><a id="toc-Commands-33" href="#Commands-33">8.78.1 Commands</a></li>
  273. </ul></li>
  274. <li><a id="toc-crossfeed" href="#crossfeed">8.79 crossfeed</a>
  275. <ul class="toc-numbered-mark">
  276. <li><a id="toc-Commands-34" href="#Commands-34">8.79.1 Commands</a></li>
  277. </ul></li>
  278. <li><a id="toc-crystalizer" href="#crystalizer">8.80 crystalizer</a>
  279. <ul class="toc-numbered-mark">
  280. <li><a id="toc-Commands-35" href="#Commands-35">8.80.1 Commands</a></li>
  281. </ul></li>
  282. <li><a id="toc-dcshift" href="#dcshift">8.81 dcshift</a></li>
  283. <li><a id="toc-deesser" href="#deesser">8.82 deesser</a></li>
  284. <li><a id="toc-dialoguenhance" href="#dialoguenhance">8.83 dialoguenhance</a>
  285. <ul class="toc-numbered-mark">
  286. <li><a id="toc-Commands-36" href="#Commands-36">8.83.1 Commands</a></li>
  287. </ul></li>
  288. <li><a id="toc-drmeter" href="#drmeter">8.84 drmeter</a></li>
  289. <li><a id="toc-dynaudnorm" href="#dynaudnorm">8.85 dynaudnorm</a>
  290. <ul class="toc-numbered-mark">
  291. <li><a id="toc-Commands-37" href="#Commands-37">8.85.1 Commands</a></li>
  292. </ul></li>
  293. <li><a id="toc-earwax" href="#earwax">8.86 earwax</a></li>
  294. <li><a id="toc-equalizer" href="#equalizer">8.87 equalizer</a>
  295. <ul class="toc-numbered-mark">
  296. <li><a id="toc-Examples-24" href="#Examples-24">8.87.1 Examples</a></li>
  297. <li><a id="toc-Commands-38" href="#Commands-38">8.87.2 Commands</a></li>
  298. </ul></li>
  299. <li><a id="toc-extrastereo" href="#extrastereo">8.88 extrastereo</a>
  300. <ul class="toc-numbered-mark">
  301. <li><a id="toc-Commands-39" href="#Commands-39">8.88.1 Commands</a></li>
  302. </ul></li>
  303. <li><a id="toc-firequalizer" href="#firequalizer">8.89 firequalizer</a>
  304. <ul class="toc-numbered-mark">
  305. <li><a id="toc-Examples-25" href="#Examples-25">8.89.1 Examples</a></li>
  306. </ul></li>
  307. <li><a id="toc-flanger" href="#flanger">8.90 flanger</a></li>
  308. <li><a id="toc-haas" href="#haas">8.91 haas</a></li>
  309. <li><a id="toc-hdcd" href="#hdcd">8.92 hdcd</a></li>
  310. <li><a id="toc-headphone" href="#headphone">8.93 headphone</a>
  311. <ul class="toc-numbered-mark">
  312. <li><a id="toc-Examples-26" href="#Examples-26">8.93.1 Examples</a></li>
  313. </ul></li>
  314. <li><a id="toc-highpass" href="#highpass">8.94 highpass</a>
  315. <ul class="toc-numbered-mark">
  316. <li><a id="toc-Commands-40" href="#Commands-40">8.94.1 Commands</a></li>
  317. </ul></li>
  318. <li><a id="toc-join" href="#join">8.95 join</a></li>
  319. <li><a id="toc-ladspa" href="#ladspa">8.96 ladspa</a>
  320. <ul class="toc-numbered-mark">
  321. <li><a id="toc-Examples-27" href="#Examples-27">8.96.1 Examples</a></li>
  322. <li><a id="toc-Commands-41" href="#Commands-41">8.96.2 Commands</a></li>
  323. </ul></li>
  324. <li><a id="toc-loudnorm" href="#loudnorm">8.97 loudnorm</a></li>
  325. <li><a id="toc-lowpass" href="#lowpass">8.98 lowpass</a>
  326. <ul class="toc-numbered-mark">
  327. <li><a id="toc-Examples-28" href="#Examples-28">8.98.1 Examples</a></li>
  328. <li><a id="toc-Commands-42" href="#Commands-42">8.98.2 Commands</a></li>
  329. </ul></li>
  330. <li><a id="toc-lv2" href="#lv2">8.99 lv2</a>
  331. <ul class="toc-numbered-mark">
  332. <li><a id="toc-Examples-29" href="#Examples-29">8.99.1 Examples</a></li>
  333. <li><a id="toc-Commands-43" href="#Commands-43">8.99.2 Commands</a></li>
  334. </ul></li>
  335. <li><a id="toc-mcompand" href="#mcompand">8.100 mcompand</a></li>
  336. <li><a id="toc-pan-1" href="#pan-1">8.101 pan</a>
  337. <ul class="toc-numbered-mark">
  338. <li><a id="toc-Mixing-examples" href="#Mixing-examples">8.101.1 Mixing examples</a></li>
  339. <li><a id="toc-Remapping-examples" href="#Remapping-examples">8.101.2 Remapping examples</a></li>
  340. </ul></li>
  341. <li><a id="toc-replaygain" href="#replaygain">8.102 replaygain</a></li>
  342. <li><a id="toc-resample" href="#resample">8.103 resample</a></li>
  343. <li><a id="toc-rubberband" href="#rubberband">8.104 rubberband</a>
  344. <ul class="toc-numbered-mark">
  345. <li><a id="toc-Commands-44" href="#Commands-44">8.104.1 Commands</a></li>
  346. </ul></li>
  347. <li><a id="toc-sidechaincompress" href="#sidechaincompress">8.105 sidechaincompress</a>
  348. <ul class="toc-numbered-mark">
  349. <li><a id="toc-Commands-45" href="#Commands-45">8.105.1 Commands</a></li>
  350. <li><a id="toc-Examples-30" href="#Examples-30">8.105.2 Examples</a></li>
  351. </ul></li>
  352. <li><a id="toc-sidechaingate" href="#sidechaingate">8.106 sidechaingate</a>
  353. <ul class="toc-numbered-mark">
  354. <li><a id="toc-Commands-46" href="#Commands-46">8.106.1 Commands</a></li>
  355. </ul></li>
  356. <li><a id="toc-silencedetect" href="#silencedetect">8.107 silencedetect</a>
  357. <ul class="toc-numbered-mark">
  358. <li><a id="toc-Examples-31" href="#Examples-31">8.107.1 Examples</a></li>
  359. </ul></li>
  360. <li><a id="toc-silenceremove" href="#silenceremove">8.108 silenceremove</a>
  361. <ul class="toc-numbered-mark">
  362. <li><a id="toc-Examples-32" href="#Examples-32">8.108.1 Examples</a></li>
  363. <li><a id="toc-Commands-47" href="#Commands-47">8.108.2 Commands</a></li>
  364. </ul></li>
  365. <li><a id="toc-sofalizer" href="#sofalizer">8.109 sofalizer</a>
  366. <ul class="toc-numbered-mark">
  367. <li><a id="toc-Examples-33" href="#Examples-33">8.109.1 Examples</a></li>
  368. </ul></li>
  369. <li><a id="toc-speechnorm" href="#speechnorm">8.110 speechnorm</a>
  370. <ul class="toc-numbered-mark">
  371. <li><a id="toc-Commands-48" href="#Commands-48">8.110.1 Commands</a></li>
  372. <li><a id="toc-Examples-34" href="#Examples-34">8.110.2 Examples</a></li>
  373. </ul></li>
  374. <li><a id="toc-stereotools" href="#stereotools">8.111 stereotools</a>
  375. <ul class="toc-numbered-mark">
  376. <li><a id="toc-Commands-49" href="#Commands-49">8.111.1 Commands</a></li>
  377. <li><a id="toc-Examples-35" href="#Examples-35">8.111.2 Examples</a></li>
  378. </ul></li>
  379. <li><a id="toc-stereowiden" href="#stereowiden">8.112 stereowiden</a>
  380. <ul class="toc-numbered-mark">
  381. <li><a id="toc-Commands-50" href="#Commands-50">8.112.1 Commands</a></li>
  382. </ul></li>
  383. <li><a id="toc-superequalizer" href="#superequalizer">8.113 superequalizer</a></li>
  384. <li><a id="toc-surround" href="#surround">8.114 surround</a></li>
  385. <li><a id="toc-tiltshelf" href="#tiltshelf">8.115 tiltshelf</a>
  386. <ul class="toc-numbered-mark">
  387. <li><a id="toc-Commands-51" href="#Commands-51">8.115.1 Commands</a></li>
  388. </ul></li>
  389. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">8.116 treble, highshelf</a>
  390. <ul class="toc-numbered-mark">
  391. <li><a id="toc-Commands-52" href="#Commands-52">8.116.1 Commands</a></li>
  392. </ul></li>
  393. <li><a id="toc-tremolo" href="#tremolo">8.117 tremolo</a></li>
  394. <li><a id="toc-vibrato" href="#vibrato">8.118 vibrato</a></li>
  395. <li><a id="toc-virtualbass" href="#virtualbass">8.119 virtualbass</a></li>
  396. <li><a id="toc-volume" href="#volume">8.120 volume</a>
  397. <ul class="toc-numbered-mark">
  398. <li><a id="toc-Commands-53" href="#Commands-53">8.120.1 Commands</a></li>
  399. <li><a id="toc-Examples-36" href="#Examples-36">8.120.2 Examples</a></li>
  400. </ul></li>
  401. <li><a id="toc-volumedetect" href="#volumedetect">8.121 volumedetect</a>
  402. <ul class="toc-numbered-mark">
  403. <li><a id="toc-Examples-37" href="#Examples-37">8.121.1 Examples</a></li>
  404. </ul></li>
  405. <li><a id="toc-whisper-1" href="#whisper-1">8.122 whisper</a>
  406. <ul class="toc-numbered-mark">
  407. <li><a id="toc-Examples-38" href="#Examples-38">8.122.1 Examples</a></li>
  408. </ul></li>
  409. </ul></li>
  410. <li><a id="toc-Audio-Sources" href="#Audio-Sources">9 Audio Sources</a>
  411. <ul class="toc-numbered-mark">
  412. <li><a id="toc-abuffer" href="#abuffer">9.1 abuffer</a>
  413. <ul class="toc-numbered-mark">
  414. <li><a id="toc-Examples-39" href="#Examples-39">9.1.1 Examples</a></li>
  415. </ul></li>
  416. <li><a id="toc-aevalsrc" href="#aevalsrc">9.2 aevalsrc</a>
  417. <ul class="toc-numbered-mark">
  418. <li><a id="toc-Examples-40" href="#Examples-40">9.2.1 Examples</a></li>
  419. </ul></li>
  420. <li><a id="toc-afdelaysrc" href="#afdelaysrc">9.3 afdelaysrc</a></li>
  421. <li><a id="toc-afireqsrc" href="#afireqsrc">9.4 afireqsrc</a></li>
  422. <li><a id="toc-afirsrc" href="#afirsrc">9.5 afirsrc</a></li>
  423. <li><a id="toc-anullsrc" href="#anullsrc">9.6 anullsrc</a>
  424. <ul class="toc-numbered-mark">
  425. <li><a id="toc-Examples-41" href="#Examples-41">9.6.1 Examples</a></li>
  426. </ul></li>
  427. <li><a id="toc-flite" href="#flite">9.7 flite</a>
  428. <ul class="toc-numbered-mark">
  429. <li><a id="toc-Examples-42" href="#Examples-42">9.7.1 Examples</a></li>
  430. </ul></li>
  431. <li><a id="toc-anoisesrc" href="#anoisesrc">9.8 anoisesrc</a>
  432. <ul class="toc-numbered-mark">
  433. <li><a id="toc-Examples-43" href="#Examples-43">9.8.1 Examples</a></li>
  434. </ul></li>
  435. <li><a id="toc-hilbert" href="#hilbert">9.9 hilbert</a></li>
  436. <li><a id="toc-sinc" href="#sinc">9.10 sinc</a></li>
  437. <li><a id="toc-sine" href="#sine">9.11 sine</a>
  438. <ul class="toc-numbered-mark">
  439. <li><a id="toc-Examples-44" href="#Examples-44">9.11.1 Examples</a></li>
  440. </ul></li>
  441. </ul></li>
  442. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">10 Audio Sinks</a>
  443. <ul class="toc-numbered-mark">
  444. <li><a id="toc-abuffersink" href="#abuffersink">10.1 abuffersink</a></li>
  445. <li><a id="toc-anullsink" href="#anullsink">10.2 anullsink</a></li>
  446. </ul></li>
  447. <li><a id="toc-Video-Filters" href="#Video-Filters">11 Video Filters</a>
  448. <ul class="toc-numbered-mark">
  449. <li><a id="toc-addroi" href="#addroi">11.1 addroi</a>
  450. <ul class="toc-numbered-mark">
  451. <li><a id="toc-Examples-45" href="#Examples-45">11.1.1 Examples</a></li>
  452. </ul></li>
  453. <li><a id="toc-alphaextract" href="#alphaextract">11.2 alphaextract</a></li>
  454. <li><a id="toc-alphamerge" href="#alphamerge">11.3 alphamerge</a></li>
  455. <li><a id="toc-amplify" href="#amplify">11.4 amplify</a>
  456. <ul class="toc-numbered-mark">
  457. <li><a id="toc-Commands-54" href="#Commands-54">11.4.1 Commands</a></li>
  458. </ul></li>
  459. <li><a id="toc-ass" href="#ass">11.5 ass</a></li>
  460. <li><a id="toc-atadenoise" href="#atadenoise">11.6 atadenoise</a>
  461. <ul class="toc-numbered-mark">
  462. <li><a id="toc-Commands-55" href="#Commands-55">11.6.1 Commands</a></li>
  463. </ul></li>
  464. <li><a id="toc-avgblur" href="#avgblur">11.7 avgblur</a>
  465. <ul class="toc-numbered-mark">
  466. <li><a id="toc-Commands-56" href="#Commands-56">11.7.1 Commands</a></li>
  467. </ul></li>
  468. <li><a id="toc-backgroundkey" href="#backgroundkey">11.8 backgroundkey</a>
  469. <ul class="toc-numbered-mark">
  470. <li><a id="toc-Commands-57" href="#Commands-57">11.8.1 Commands</a></li>
  471. </ul></li>
  472. <li><a id="toc-bbox" href="#bbox">11.9 bbox</a>
  473. <ul class="toc-numbered-mark">
  474. <li><a id="toc-Commands-58" href="#Commands-58">11.9.1 Commands</a></li>
  475. </ul></li>
  476. <li><a id="toc-bilateral" href="#bilateral">11.10 bilateral</a>
  477. <ul class="toc-numbered-mark">
  478. <li><a id="toc-Commands-59" href="#Commands-59">11.10.1 Commands</a></li>
  479. </ul></li>
  480. <li><a id="toc-bitplanenoise" href="#bitplanenoise">11.11 bitplanenoise</a></li>
  481. <li><a id="toc-blackdetect_002c-blackdetect_005fvulkan" href="#blackdetect_002c-blackdetect_005fvulkan">11.12 blackdetect, blackdetect_vulkan</a></li>
  482. <li><a id="toc-blackframe" href="#blackframe">11.13 blackframe</a></li>
  483. <li><a id="toc-blend-1" href="#blend-1">11.14 blend</a>
  484. <ul class="toc-numbered-mark">
  485. <li><a id="toc-Examples-46" href="#Examples-46">11.14.1 Examples</a></li>
  486. <li><a id="toc-Commands-60" href="#Commands-60">11.14.2 Commands</a></li>
  487. </ul></li>
  488. <li><a id="toc-blockdetect-1" href="#blockdetect-1">11.15 blockdetect</a>
  489. <ul class="toc-numbered-mark">
  490. <li><a id="toc-Examples-47" href="#Examples-47">11.15.1 Examples</a></li>
  491. </ul></li>
  492. <li><a id="toc-blurdetect-1" href="#blurdetect-1">11.16 blurdetect</a>
  493. <ul class="toc-numbered-mark">
  494. <li><a id="toc-Examples-48" href="#Examples-48">11.16.1 Examples</a></li>
  495. </ul></li>
  496. <li><a id="toc-bm3d" href="#bm3d">11.17 bm3d</a>
  497. <ul class="toc-numbered-mark">
  498. <li><a id="toc-Examples-49" href="#Examples-49">11.17.1 Examples</a></li>
  499. </ul></li>
  500. <li><a id="toc-boxblur" href="#boxblur">11.18 boxblur</a>
  501. <ul class="toc-numbered-mark">
  502. <li><a id="toc-Examples-50" href="#Examples-50">11.18.1 Examples</a></li>
  503. </ul></li>
  504. <li><a id="toc-bwdif-1" href="#bwdif-1">11.19 bwdif</a></li>
  505. <li><a id="toc-ccrepack" href="#ccrepack">11.20 ccrepack</a></li>
  506. <li><a id="toc-cas" href="#cas">11.21 cas</a>
  507. <ul class="toc-numbered-mark">
  508. <li><a id="toc-Commands-61" href="#Commands-61">11.21.1 Commands</a></li>
  509. </ul></li>
  510. <li><a id="toc-chromahold" href="#chromahold">11.22 chromahold</a>
  511. <ul class="toc-numbered-mark">
  512. <li><a id="toc-Commands-62" href="#Commands-62">11.22.1 Commands</a></li>
  513. </ul></li>
  514. <li><a id="toc-chromakey-1" href="#chromakey-1">11.23 chromakey</a>
  515. <ul class="toc-numbered-mark">
  516. <li><a id="toc-Commands-63" href="#Commands-63">11.23.1 Commands</a></li>
  517. <li><a id="toc-Examples-51" href="#Examples-51">11.23.2 Examples</a></li>
  518. </ul></li>
  519. <li><a id="toc-chromanr" href="#chromanr">11.24 chromanr</a>
  520. <ul class="toc-numbered-mark">
  521. <li><a id="toc-Commands-64" href="#Commands-64">11.24.1 Commands</a></li>
  522. </ul></li>
  523. <li><a id="toc-chromashift" href="#chromashift">11.25 chromashift</a>
  524. <ul class="toc-numbered-mark">
  525. <li><a id="toc-Commands-65" href="#Commands-65">11.25.1 Commands</a></li>
  526. </ul></li>
  527. <li><a id="toc-ciescope" href="#ciescope">11.26 ciescope</a></li>
  528. <li><a id="toc-codecview" href="#codecview">11.27 codecview</a>
  529. <ul class="toc-numbered-mark">
  530. <li><a id="toc-Examples-52" href="#Examples-52">11.27.1 Examples</a></li>
  531. </ul></li>
  532. <li><a id="toc-colorbalance" href="#colorbalance">11.28 colorbalance</a>
  533. <ul class="toc-numbered-mark">
  534. <li><a id="toc-Examples-53" href="#Examples-53">11.28.1 Examples</a></li>
  535. <li><a id="toc-Commands-66" href="#Commands-66">11.28.2 Commands</a></li>
  536. </ul></li>
  537. <li><a id="toc-colorcontrast" href="#colorcontrast">11.29 colorcontrast</a>
  538. <ul class="toc-numbered-mark">
  539. <li><a id="toc-Commands-67" href="#Commands-67">11.29.1 Commands</a></li>
  540. </ul></li>
  541. <li><a id="toc-colorcorrect" href="#colorcorrect">11.30 colorcorrect</a>
  542. <ul class="toc-numbered-mark">
  543. <li><a id="toc-Commands-68" href="#Commands-68">11.30.1 Commands</a></li>
  544. </ul></li>
  545. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">11.31 colorchannelmixer</a>
  546. <ul class="toc-numbered-mark">
  547. <li><a id="toc-Examples-54" href="#Examples-54">11.31.1 Examples</a></li>
  548. <li><a id="toc-Commands-69" href="#Commands-69">11.31.2 Commands</a></li>
  549. </ul></li>
  550. <li><a id="toc-colordetect" href="#colordetect">11.32 colordetect</a></li>
  551. <li><a id="toc-colorize" href="#colorize">11.33 colorize</a>
  552. <ul class="toc-numbered-mark">
  553. <li><a id="toc-Commands-70" href="#Commands-70">11.33.1 Commands</a></li>
  554. </ul></li>
  555. <li><a id="toc-colorkey" href="#colorkey">11.34 colorkey</a>
  556. <ul class="toc-numbered-mark">
  557. <li><a id="toc-Examples-55" href="#Examples-55">11.34.1 Examples</a></li>
  558. <li><a id="toc-Commands-71" href="#Commands-71">11.34.2 Commands</a></li>
  559. </ul></li>
  560. <li><a id="toc-colorhold" href="#colorhold">11.35 colorhold</a>
  561. <ul class="toc-numbered-mark">
  562. <li><a id="toc-Commands-72" href="#Commands-72">11.35.1 Commands</a></li>
  563. </ul></li>
  564. <li><a id="toc-colorlevels" href="#colorlevels">11.36 colorlevels</a>
  565. <ul class="toc-numbered-mark">
  566. <li><a id="toc-Examples-56" href="#Examples-56">11.36.1 Examples</a></li>
  567. <li><a id="toc-Commands-73" href="#Commands-73">11.36.2 Commands</a></li>
  568. </ul></li>
  569. <li><a id="toc-colormap" href="#colormap">11.37 colormap</a></li>
  570. <li><a id="toc-colormatrix" href="#colormatrix">11.38 colormatrix</a></li>
  571. <li><a id="toc-colorspace" href="#colorspace">11.39 colorspace</a></li>
  572. <li><a id="toc-colortemperature" href="#colortemperature">11.40 colortemperature</a>
  573. <ul class="toc-numbered-mark">
  574. <li><a id="toc-Commands-74" href="#Commands-74">11.40.1 Commands</a></li>
  575. </ul></li>
  576. <li><a id="toc-convolution" href="#convolution">11.41 convolution</a>
  577. <ul class="toc-numbered-mark">
  578. <li><a id="toc-Commands-75" href="#Commands-75">11.41.1 Commands</a></li>
  579. <li><a id="toc-Examples-57" href="#Examples-57">11.41.2 Examples</a></li>
  580. </ul></li>
  581. <li><a id="toc-convolve" href="#convolve">11.42 convolve</a></li>
  582. <li><a id="toc-copy" href="#copy">11.43 copy</a></li>
  583. <li><a id="toc-coreimage-1" href="#coreimage-1">11.44 coreimage</a>
  584. <ul class="toc-numbered-mark">
  585. <li><a id="toc-Examples-58" href="#Examples-58">11.44.1 Examples</a></li>
  586. </ul></li>
  587. <li><a id="toc-corr" href="#corr">11.45 corr</a></li>
  588. <li><a id="toc-cover_005frect" href="#cover_005frect">11.46 cover_rect</a>
  589. <ul class="toc-numbered-mark">
  590. <li><a id="toc-Examples-59" href="#Examples-59">11.46.1 Examples</a></li>
  591. </ul></li>
  592. <li><a id="toc-crop" href="#crop">11.47 crop</a>
  593. <ul class="toc-numbered-mark">
  594. <li><a id="toc-Examples-60" href="#Examples-60">11.47.1 Examples</a></li>
  595. <li><a id="toc-Commands-76" href="#Commands-76">11.47.2 Commands</a></li>
  596. </ul></li>
  597. <li><a id="toc-cropdetect" href="#cropdetect">11.48 cropdetect</a>
  598. <ul class="toc-numbered-mark">
  599. <li><a id="toc-Examples-61" href="#Examples-61">11.48.1 Examples</a></li>
  600. <li><a id="toc-Commands-77" href="#Commands-77">11.48.2 Commands</a></li>
  601. </ul></li>
  602. <li><a id="toc-cue-1" href="#cue-1">11.49 cue</a></li>
  603. <li><a id="toc-curves-1" href="#curves-1">11.50 curves</a>
  604. <ul class="toc-numbered-mark">
  605. <li><a id="toc-Commands-78" href="#Commands-78">11.50.1 Commands</a></li>
  606. <li><a id="toc-Examples-62" href="#Examples-62">11.50.2 Examples</a></li>
  607. </ul></li>
  608. <li><a id="toc-datascope" href="#datascope">11.51 datascope</a>
  609. <ul class="toc-numbered-mark">
  610. <li><a id="toc-Commands-79" href="#Commands-79">11.51.1 Commands</a></li>
  611. </ul></li>
  612. <li><a id="toc-dblur" href="#dblur">11.52 dblur</a>
  613. <ul class="toc-numbered-mark">
  614. <li><a id="toc-Commands-80" href="#Commands-80">11.52.1 Commands</a></li>
  615. </ul></li>
  616. <li><a id="toc-dctdnoiz" href="#dctdnoiz">11.53 dctdnoiz</a>
  617. <ul class="toc-numbered-mark">
  618. <li><a id="toc-Examples-63" href="#Examples-63">11.53.1 Examples</a></li>
  619. </ul></li>
  620. <li><a id="toc-deband" href="#deband">11.54 deband</a>
  621. <ul class="toc-numbered-mark">
  622. <li><a id="toc-Commands-81" href="#Commands-81">11.54.1 Commands</a></li>
  623. </ul></li>
  624. <li><a id="toc-deblock" href="#deblock">11.55 deblock</a>
  625. <ul class="toc-numbered-mark">
  626. <li><a id="toc-Examples-64" href="#Examples-64">11.55.1 Examples</a></li>
  627. <li><a id="toc-Commands-82" href="#Commands-82">11.55.2 Commands</a></li>
  628. </ul></li>
  629. <li><a id="toc-decimate-1" href="#decimate-1">11.56 decimate</a></li>
  630. <li><a id="toc-deconvolve" href="#deconvolve">11.57 deconvolve</a></li>
  631. <li><a id="toc-dedot" href="#dedot">11.58 dedot</a></li>
  632. <li><a id="toc-deflate" href="#deflate">11.59 deflate</a>
  633. <ul class="toc-numbered-mark">
  634. <li><a id="toc-Commands-83" href="#Commands-83">11.59.1 Commands</a></li>
  635. </ul></li>
  636. <li><a id="toc-deflicker" href="#deflicker">11.60 deflicker</a></li>
  637. <li><a id="toc-dejudder" href="#dejudder">11.61 dejudder</a></li>
  638. <li><a id="toc-delogo" href="#delogo">11.62 delogo</a>
  639. <ul class="toc-numbered-mark">
  640. <li><a id="toc-Examples-65" href="#Examples-65">11.62.1 Examples</a></li>
  641. </ul></li>
  642. <li><a id="toc-derain-1" href="#derain-1">11.63 derain</a></li>
  643. <li><a id="toc-deshake" href="#deshake">11.64 deshake</a></li>
  644. <li><a id="toc-despill" href="#despill">11.65 despill</a>
  645. <ul class="toc-numbered-mark">
  646. <li><a id="toc-Commands-84" href="#Commands-84">11.65.1 Commands</a></li>
  647. </ul></li>
  648. <li><a id="toc-detelecine" href="#detelecine">11.66 detelecine</a></li>
  649. <li><a id="toc-dilation-1" href="#dilation-1">11.67 dilation</a>
  650. <ul class="toc-numbered-mark">
  651. <li><a id="toc-Commands-85" href="#Commands-85">11.67.1 Commands</a></li>
  652. </ul></li>
  653. <li><a id="toc-displace" href="#displace">11.68 displace</a>
  654. <ul class="toc-numbered-mark">
  655. <li><a id="toc-Examples-66" href="#Examples-66">11.68.1 Examples</a></li>
  656. </ul></li>
  657. <li><a id="toc-dnn_005fclassify" href="#dnn_005fclassify">11.69 dnn_classify</a></li>
  658. <li><a id="toc-dnn_005fdetect" href="#dnn_005fdetect">11.70 dnn_detect</a></li>
  659. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">11.71 dnn_processing</a>
  660. <ul class="toc-numbered-mark">
  661. <li><a id="toc-Examples-67" href="#Examples-67">11.71.1 Examples</a></li>
  662. </ul></li>
  663. <li><a id="toc-drawbox" href="#drawbox">11.72 drawbox</a>
  664. <ul class="toc-numbered-mark">
  665. <li><a id="toc-Examples-68" href="#Examples-68">11.72.1 Examples</a></li>
  666. <li><a id="toc-Commands-86" href="#Commands-86">11.72.2 Commands</a></li>
  667. </ul></li>
  668. <li><a id="toc-drawgraph-1" href="#drawgraph-1">11.73 drawgraph</a></li>
  669. <li><a id="toc-drawgrid" href="#drawgrid">11.74 drawgrid</a>
  670. <ul class="toc-numbered-mark">
  671. <li><a id="toc-Examples-69" href="#Examples-69">11.74.1 Examples</a></li>
  672. <li><a id="toc-Commands-87" href="#Commands-87">11.74.2 Commands</a></li>
  673. </ul></li>
  674. <li><a id="toc-drawtext-1" href="#drawtext-1">11.75 drawtext</a>
  675. <ul class="toc-numbered-mark">
  676. <li><a id="toc-Syntax" href="#Syntax">11.75.1 Syntax</a></li>
  677. <li><a id="toc-Text-expansion" href="#Text-expansion">11.75.2 Text expansion</a></li>
  678. <li><a id="toc-Commands-88" href="#Commands-88">11.75.3 Commands</a></li>
  679. <li><a id="toc-Examples-70" href="#Examples-70">11.75.4 Examples</a></li>
  680. </ul></li>
  681. <li><a id="toc-drawvg-1" href="#drawvg-1">11.76 drawvg</a>
  682. <ul class="toc-numbered-mark">
  683. <li><a id="toc-Parameters" href="#Parameters">11.76.1 Parameters</a></li>
  684. <li><a id="toc-Pixel-Formats" href="#Pixel-Formats">11.76.2 Pixel Formats</a></li>
  685. <li><a id="toc-Examples-71" href="#Examples-71">11.76.3 Examples</a></li>
  686. </ul></li>
  687. <li><a id="toc-edgedetect" href="#edgedetect">11.77 edgedetect</a>
  688. <ul class="toc-numbered-mark">
  689. <li><a id="toc-Examples-72" href="#Examples-72">11.77.1 Examples</a></li>
  690. </ul></li>
  691. <li><a id="toc-elbg" href="#elbg">11.78 elbg</a></li>
  692. <li><a id="toc-entropy" href="#entropy">11.79 entropy</a></li>
  693. <li><a id="toc-epx" href="#epx">11.80 epx</a></li>
  694. <li><a id="toc-eq" href="#eq">11.81 eq</a>
  695. <ul class="toc-numbered-mark">
  696. <li><a id="toc-Commands-89" href="#Commands-89">11.81.1 Commands</a></li>
  697. </ul></li>
  698. <li><a id="toc-erosion-1" href="#erosion-1">11.82 erosion</a>
  699. <ul class="toc-numbered-mark">
  700. <li><a id="toc-Commands-90" href="#Commands-90">11.82.1 Commands</a></li>
  701. </ul></li>
  702. <li><a id="toc-estdif" href="#estdif">11.83 estdif</a>
  703. <ul class="toc-numbered-mark">
  704. <li><a id="toc-Commands-91" href="#Commands-91">11.83.1 Commands</a></li>
  705. </ul></li>
  706. <li><a id="toc-exposure" href="#exposure">11.84 exposure</a>
  707. <ul class="toc-numbered-mark">
  708. <li><a id="toc-Commands-92" href="#Commands-92">11.84.1 Commands</a></li>
  709. </ul></li>
  710. <li><a id="toc-extractplanes" href="#extractplanes">11.85 extractplanes</a>
  711. <ul class="toc-numbered-mark">
  712. <li><a id="toc-Examples-73" href="#Examples-73">11.85.1 Examples</a></li>
  713. </ul></li>
  714. <li><a id="toc-fade" href="#fade">11.86 fade</a>
  715. <ul class="toc-numbered-mark">
  716. <li><a id="toc-Examples-74" href="#Examples-74">11.86.1 Examples</a></li>
  717. </ul></li>
  718. <li><a id="toc-feedback" href="#feedback">11.87 feedback</a>
  719. <ul class="toc-numbered-mark">
  720. <li><a id="toc-Examples-75" href="#Examples-75">11.87.1 Examples</a></li>
  721. </ul></li>
  722. <li><a id="toc-fftdnoiz" href="#fftdnoiz">11.88 fftdnoiz</a></li>
  723. <li><a id="toc-fftfilt" href="#fftfilt">11.89 fftfilt</a>
  724. <ul class="toc-numbered-mark">
  725. <li><a id="toc-Examples-76" href="#Examples-76">11.89.1 Examples</a></li>
  726. </ul></li>
  727. <li><a id="toc-field" href="#field">11.90 field</a></li>
  728. <li><a id="toc-fieldhint" href="#fieldhint">11.91 fieldhint</a></li>
  729. <li><a id="toc-fieldmatch" href="#fieldmatch">11.92 fieldmatch</a>
  730. <ul class="toc-numbered-mark">
  731. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">11.92.1 p/c/n/u/b meaning</a>
  732. <ul class="toc-numbered-mark">
  733. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">11.92.1.1 p/c/n</a></li>
  734. <li><a id="toc-u_002fb" href="#u_002fb">11.92.1.2 u/b</a></li>
  735. </ul></li>
  736. <li><a id="toc-Examples-77" href="#Examples-77">11.92.2 Examples</a></li>
  737. </ul></li>
  738. <li><a id="toc-fieldorder" href="#fieldorder">11.93 fieldorder</a></li>
  739. <li><a id="toc-fillborders" href="#fillborders">11.94 fillborders</a>
  740. <ul class="toc-numbered-mark">
  741. <li><a id="toc-Commands-93" href="#Commands-93">11.94.1 Commands</a></li>
  742. </ul></li>
  743. <li><a id="toc-find_005frect" href="#find_005frect">11.95 find_rect</a>
  744. <ul class="toc-numbered-mark">
  745. <li><a id="toc-Examples-78" href="#Examples-78">11.95.1 Examples</a></li>
  746. </ul></li>
  747. <li><a id="toc-floodfill" href="#floodfill">11.96 floodfill</a></li>
  748. <li><a id="toc-format-1" href="#format-1">11.97 format</a>
  749. <ul class="toc-numbered-mark">
  750. <li><a id="toc-Examples-79" href="#Examples-79">11.97.1 Examples</a></li>
  751. </ul></li>
  752. <li><a id="toc-fps-1" href="#fps-1">11.98 fps</a>
  753. <ul class="toc-numbered-mark">
  754. <li><a id="toc-Examples-80" href="#Examples-80">11.98.1 Examples</a></li>
  755. </ul></li>
  756. <li><a id="toc-framepack" href="#framepack">11.99 framepack</a></li>
  757. <li><a id="toc-framerate" href="#framerate">11.100 framerate</a></li>
  758. <li><a id="toc-framestep" href="#framestep">11.101 framestep</a></li>
  759. <li><a id="toc-freezedetect" href="#freezedetect">11.102 freezedetect</a></li>
  760. <li><a id="toc-freezeframes" href="#freezeframes">11.103 freezeframes</a></li>
  761. <li><a id="toc-frei0r-1" href="#frei0r-1">11.104 frei0r</a>
  762. <ul class="toc-numbered-mark">
  763. <li><a id="toc-Examples-81" href="#Examples-81">11.104.1 Examples</a></li>
  764. <li><a id="toc-Commands-94" href="#Commands-94">11.104.2 Commands</a></li>
  765. </ul></li>
  766. <li><a id="toc-fspp" href="#fspp">11.105 fspp</a></li>
  767. <li><a id="toc-fsync-1" href="#fsync-1">11.106 fsync</a></li>
  768. <li><a id="toc-gblur" href="#gblur">11.107 gblur</a>
  769. <ul class="toc-numbered-mark">
  770. <li><a id="toc-Commands-95" href="#Commands-95">11.107.1 Commands</a></li>
  771. </ul></li>
  772. <li><a id="toc-geq" href="#geq">11.108 geq</a>
  773. <ul class="toc-numbered-mark">
  774. <li><a id="toc-Examples-82" href="#Examples-82">11.108.1 Examples</a></li>
  775. </ul></li>
  776. <li><a id="toc-gradfun" href="#gradfun">11.109 gradfun</a>
  777. <ul class="toc-numbered-mark">
  778. <li><a id="toc-Examples-83" href="#Examples-83">11.109.1 Examples</a></li>
  779. </ul></li>
  780. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">11.110 graphmonitor</a></li>
  781. <li><a id="toc-grayworld" href="#grayworld">11.111 grayworld</a></li>
  782. <li><a id="toc-greyedge" href="#greyedge">11.112 greyedge</a>
  783. <ul class="toc-numbered-mark">
  784. <li><a id="toc-Examples-84" href="#Examples-84">11.112.1 Examples</a></li>
  785. </ul></li>
  786. <li><a id="toc-guided" href="#guided">11.113 guided</a>
  787. <ul class="toc-numbered-mark">
  788. <li><a id="toc-Commands-96" href="#Commands-96">11.113.1 Commands</a></li>
  789. <li><a id="toc-Examples-85" href="#Examples-85">11.113.2 Examples</a></li>
  790. </ul></li>
  791. <li><a id="toc-haldclut-1" href="#haldclut-1">11.114 haldclut</a>
  792. <ul class="toc-numbered-mark">
  793. <li><a id="toc-Commands-97" href="#Commands-97">11.114.1 Commands</a></li>
  794. <li><a id="toc-Workflow-examples" href="#Workflow-examples">11.114.2 Workflow examples</a>
  795. <ul class="toc-numbered-mark">
  796. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">11.114.2.1 Hald CLUT video stream</a></li>
  797. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">11.114.2.2 Hald CLUT with preview</a></li>
  798. </ul></li>
  799. </ul></li>
  800. <li><a id="toc-hflip" href="#hflip">11.115 hflip</a></li>
  801. <li><a id="toc-histeq" href="#histeq">11.116 histeq</a></li>
  802. <li><a id="toc-histogram-1" href="#histogram-1">11.117 histogram</a>
  803. <ul class="toc-numbered-mark">
  804. <li><a id="toc-Examples-86" href="#Examples-86">11.117.1 Examples</a></li>
  805. </ul></li>
  806. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">11.118 hqdn3d</a>
  807. <ul class="toc-numbered-mark">
  808. <li><a id="toc-Commands-98" href="#Commands-98">11.118.1 Commands</a></li>
  809. </ul></li>
  810. <li><a id="toc-hwdownload-1" href="#hwdownload-1">11.119 hwdownload</a></li>
  811. <li><a id="toc-hwmap" href="#hwmap">11.120 hwmap</a></li>
  812. <li><a id="toc-hwupload-1" href="#hwupload-1">11.121 hwupload</a></li>
  813. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">11.122 hwupload_cuda</a></li>
  814. <li><a id="toc-hqx" href="#hqx">11.123 hqx</a></li>
  815. <li><a id="toc-hstack-1" href="#hstack-1">11.124 hstack</a></li>
  816. <li><a id="toc-hsvhold" href="#hsvhold">11.125 hsvhold</a></li>
  817. <li><a id="toc-hsvkey" href="#hsvkey">11.126 hsvkey</a></li>
  818. <li><a id="toc-hue" href="#hue">11.127 hue</a>
  819. <ul class="toc-numbered-mark">
  820. <li><a id="toc-Examples-87" href="#Examples-87">11.127.1 Examples</a></li>
  821. <li><a id="toc-Commands-99" href="#Commands-99">11.127.2 Commands</a></li>
  822. </ul></li>
  823. <li><a id="toc-huesaturation" href="#huesaturation">11.128 huesaturation</a></li>
  824. <li><a id="toc-hysteresis" href="#hysteresis">11.129 hysteresis</a></li>
  825. <li><a id="toc-iccdetect" href="#iccdetect">11.130 iccdetect</a></li>
  826. <li><a id="toc-iccgen" href="#iccgen">11.131 iccgen</a></li>
  827. <li><a id="toc-identity" href="#identity">11.132 identity</a></li>
  828. <li><a id="toc-idet" href="#idet">11.133 idet</a>
  829. <ul class="toc-numbered-mark">
  830. <li><a id="toc-Examples-88" href="#Examples-88">11.133.1 Examples</a></li>
  831. </ul></li>
  832. <li><a id="toc-il" href="#il">11.134 il</a>
  833. <ul class="toc-numbered-mark">
  834. <li><a id="toc-Commands-100" href="#Commands-100">11.134.1 Commands</a></li>
  835. </ul></li>
  836. <li><a id="toc-inflate" href="#inflate">11.135 inflate</a>
  837. <ul class="toc-numbered-mark">
  838. <li><a id="toc-Commands-101" href="#Commands-101">11.135.1 Commands</a></li>
  839. </ul></li>
  840. <li><a id="toc-interlace_002c-interlace_005fvulkan" href="#interlace_002c-interlace_005fvulkan">11.136 interlace, interlace_vulkan</a></li>
  841. <li><a id="toc-kerndeint" href="#kerndeint">11.137 kerndeint</a>
  842. <ul class="toc-numbered-mark">
  843. <li><a id="toc-Examples-89" href="#Examples-89">11.137.1 Examples</a></li>
  844. </ul></li>
  845. <li><a id="toc-kirsch" href="#kirsch">11.138 kirsch</a>
  846. <ul class="toc-numbered-mark">
  847. <li><a id="toc-Commands-102" href="#Commands-102">11.138.1 Commands</a></li>
  848. </ul></li>
  849. <li><a id="toc-lagfun" href="#lagfun">11.139 lagfun</a>
  850. <ul class="toc-numbered-mark">
  851. <li><a id="toc-Commands-103" href="#Commands-103">11.139.1 Commands</a></li>
  852. </ul></li>
  853. <li><a id="toc-lenscorrection" href="#lenscorrection">11.140 lenscorrection</a>
  854. <ul class="toc-numbered-mark">
  855. <li><a id="toc-Options" href="#Options">11.140.1 Options</a></li>
  856. <li><a id="toc-Commands-104" href="#Commands-104">11.140.2 Commands</a></li>
  857. </ul></li>
  858. <li><a id="toc-lensfun" href="#lensfun">11.141 lensfun</a>
  859. <ul class="toc-numbered-mark">
  860. <li><a id="toc-Examples-90" href="#Examples-90">11.141.1 Examples</a></li>
  861. </ul></li>
  862. <li><a id="toc-lcevc" href="#lcevc">11.142 lcevc</a></li>
  863. <li><a id="toc-libplacebo" href="#libplacebo">11.143 libplacebo</a>
  864. <ul class="toc-numbered-mark">
  865. <li><a id="toc-Options-1" href="#Options-1">11.143.1 Options</a>
  866. <ul class="toc-numbered-mark">
  867. <li><a id="toc-Output-mode" href="#Output-mode">11.143.1.1 Output mode</a></li>
  868. <li><a id="toc-Scaling" href="#Scaling">11.143.1.2 Scaling</a></li>
  869. <li><a id="toc-Deinterlacing" href="#Deinterlacing">11.143.1.3 Deinterlacing</a></li>
  870. <li><a id="toc-Debanding" href="#Debanding">11.143.1.4 Debanding</a></li>
  871. <li><a id="toc-Color-adjustment" href="#Color-adjustment">11.143.1.5 Color adjustment</a></li>
  872. <li><a id="toc-Peak-detection" href="#Peak-detection">11.143.1.6 Peak detection</a></li>
  873. <li><a id="toc-Tone-mapping" href="#Tone-mapping">11.143.1.7 Tone mapping</a></li>
  874. <li><a id="toc-Dithering" href="#Dithering">11.143.1.8 Dithering</a></li>
  875. <li><a id="toc-Custom-shaders" href="#Custom-shaders">11.143.1.9 Custom shaders</a></li>
  876. <li><a id="toc-Debugging-_002f-performance" href="#Debugging-_002f-performance">11.143.1.10 Debugging / performance</a></li>
  877. </ul></li>
  878. <li><a id="toc-Commands-105" href="#Commands-105">11.143.2 Commands</a></li>
  879. <li><a id="toc-Examples-91" href="#Examples-91">11.143.3 Examples</a></li>
  880. </ul></li>
  881. <li><a id="toc-libvmaf-1" href="#libvmaf-1">11.144 libvmaf</a>
  882. <ul class="toc-numbered-mark">
  883. <li><a id="toc-Examples-92" href="#Examples-92">11.144.1 Examples</a></li>
  884. </ul></li>
  885. <li><a id="toc-libvmaf_005fcuda" href="#libvmaf_005fcuda">11.145 libvmaf_cuda</a>
  886. <ul class="toc-numbered-mark">
  887. <li><a id="toc-Examples-93" href="#Examples-93">11.145.1 Examples</a></li>
  888. </ul></li>
  889. <li><a id="toc-limitdiff" href="#limitdiff">11.146 limitdiff</a>
  890. <ul class="toc-numbered-mark">
  891. <li><a id="toc-Commands-106" href="#Commands-106">11.146.1 Commands</a></li>
  892. </ul></li>
  893. <li><a id="toc-limiter" href="#limiter">11.147 limiter</a>
  894. <ul class="toc-numbered-mark">
  895. <li><a id="toc-Commands-107" href="#Commands-107">11.147.1 Commands</a></li>
  896. </ul></li>
  897. <li><a id="toc-loop" href="#loop">11.148 loop</a>
  898. <ul class="toc-numbered-mark">
  899. <li><a id="toc-Examples-94" href="#Examples-94">11.148.1 Examples</a></li>
  900. </ul></li>
  901. <li><a id="toc-lut1d" href="#lut1d">11.149 lut1d</a>
  902. <ul class="toc-numbered-mark">
  903. <li><a id="toc-Commands-108" href="#Commands-108">11.149.1 Commands</a></li>
  904. </ul></li>
  905. <li><a id="toc-lut3d-1" href="#lut3d-1">11.150 lut3d</a>
  906. <ul class="toc-numbered-mark">
  907. <li><a id="toc-Commands-109" href="#Commands-109">11.150.1 Commands</a></li>
  908. </ul></li>
  909. <li><a id="toc-lumakey" href="#lumakey">11.151 lumakey</a>
  910. <ul class="toc-numbered-mark">
  911. <li><a id="toc-Commands-110" href="#Commands-110">11.151.1 Commands</a></li>
  912. </ul></li>
  913. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">11.152 lut, lutrgb, lutyuv</a>
  914. <ul class="toc-numbered-mark">
  915. <li><a id="toc-Commands-111" href="#Commands-111">11.152.1 Commands</a></li>
  916. <li><a id="toc-Examples-95" href="#Examples-95">11.152.2 Examples</a></li>
  917. </ul></li>
  918. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">11.153 lut2, tlut2</a>
  919. <ul class="toc-numbered-mark">
  920. <li><a id="toc-Commands-112" href="#Commands-112">11.153.1 Commands</a></li>
  921. <li><a id="toc-Examples-96" href="#Examples-96">11.153.2 Examples</a></li>
  922. </ul></li>
  923. <li><a id="toc-maskedclamp" href="#maskedclamp">11.154 maskedclamp</a>
  924. <ul class="toc-numbered-mark">
  925. <li><a id="toc-Commands-113" href="#Commands-113">11.154.1 Commands</a></li>
  926. </ul></li>
  927. <li><a id="toc-maskedmax" href="#maskedmax">11.155 maskedmax</a>
  928. <ul class="toc-numbered-mark">
  929. <li><a id="toc-Commands-114" href="#Commands-114">11.155.1 Commands</a></li>
  930. </ul></li>
  931. <li><a id="toc-maskedmerge" href="#maskedmerge">11.156 maskedmerge</a>
  932. <ul class="toc-numbered-mark">
  933. <li><a id="toc-Commands-115" href="#Commands-115">11.156.1 Commands</a></li>
  934. </ul></li>
  935. <li><a id="toc-maskedmin" href="#maskedmin">11.157 maskedmin</a>
  936. <ul class="toc-numbered-mark">
  937. <li><a id="toc-Commands-116" href="#Commands-116">11.157.1 Commands</a></li>
  938. </ul></li>
  939. <li><a id="toc-maskedthreshold" href="#maskedthreshold">11.158 maskedthreshold</a>
  940. <ul class="toc-numbered-mark">
  941. <li><a id="toc-Commands-117" href="#Commands-117">11.158.1 Commands</a></li>
  942. </ul></li>
  943. <li><a id="toc-maskfun" href="#maskfun">11.159 maskfun</a>
  944. <ul class="toc-numbered-mark">
  945. <li><a id="toc-Commands-118" href="#Commands-118">11.159.1 Commands</a></li>
  946. </ul></li>
  947. <li><a id="toc-mcdeint" href="#mcdeint">11.160 mcdeint</a></li>
  948. <li><a id="toc-median" href="#median">11.161 median</a>
  949. <ul class="toc-numbered-mark">
  950. <li><a id="toc-Commands-119" href="#Commands-119">11.161.1 Commands</a></li>
  951. </ul></li>
  952. <li><a id="toc-mergeplanes" href="#mergeplanes">11.162 mergeplanes</a>
  953. <ul class="toc-numbered-mark">
  954. <li><a id="toc-Examples-97" href="#Examples-97">11.162.1 Examples</a></li>
  955. </ul></li>
  956. <li><a id="toc-mestimate" href="#mestimate">11.163 mestimate</a></li>
  957. <li><a id="toc-midequalizer" href="#midequalizer">11.164 midequalizer</a></li>
  958. <li><a id="toc-minterpolate" href="#minterpolate">11.165 minterpolate</a></li>
  959. <li><a id="toc-mix" href="#mix">11.166 mix</a>
  960. <ul class="toc-numbered-mark">
  961. <li><a id="toc-Commands-120" href="#Commands-120">11.166.1 Commands</a></li>
  962. </ul></li>
  963. <li><a id="toc-monochrome" href="#monochrome">11.167 monochrome</a>
  964. <ul class="toc-numbered-mark">
  965. <li><a id="toc-Commands-121" href="#Commands-121">11.167.1 Commands</a></li>
  966. </ul></li>
  967. <li><a id="toc-morpho" href="#morpho">11.168 morpho</a>
  968. <ul class="toc-numbered-mark">
  969. <li><a id="toc-Commands-122" href="#Commands-122">11.168.1 Commands</a></li>
  970. </ul></li>
  971. <li><a id="toc-mpdecimate" href="#mpdecimate">11.169 mpdecimate</a></li>
  972. <li><a id="toc-msad" href="#msad">11.170 msad</a></li>
  973. <li><a id="toc-multiply" href="#multiply">11.171 multiply</a>
  974. <ul class="toc-numbered-mark">
  975. <li><a id="toc-Commands-123" href="#Commands-123">11.171.1 Commands</a></li>
  976. </ul></li>
  977. <li><a id="toc-negate" href="#negate">11.172 negate</a>
  978. <ul class="toc-numbered-mark">
  979. <li><a id="toc-Commands-124" href="#Commands-124">11.172.1 Commands</a></li>
  980. </ul></li>
  981. <li><a id="toc-nlmeans-1" href="#nlmeans-1">11.173 nlmeans</a></li>
  982. <li><a id="toc-nnedi" href="#nnedi">11.174 nnedi</a>
  983. <ul class="toc-numbered-mark">
  984. <li><a id="toc-Commands-125" href="#Commands-125">11.174.1 Commands</a></li>
  985. </ul></li>
  986. <li><a id="toc-noformat" href="#noformat">11.175 noformat</a>
  987. <ul class="toc-numbered-mark">
  988. <li><a id="toc-Examples-98" href="#Examples-98">11.175.1 Examples</a></li>
  989. </ul></li>
  990. <li><a id="toc-noise" href="#noise">11.176 noise</a>
  991. <ul class="toc-numbered-mark">
  992. <li><a id="toc-Examples-99" href="#Examples-99">11.176.1 Examples</a></li>
  993. </ul></li>
  994. <li><a id="toc-normalize" href="#normalize">11.177 normalize</a>
  995. <ul class="toc-numbered-mark">
  996. <li><a id="toc-Commands-126" href="#Commands-126">11.177.1 Commands</a></li>
  997. <li><a id="toc-Examples-100" href="#Examples-100">11.177.2 Examples</a></li>
  998. </ul></li>
  999. <li><a id="toc-null" href="#null">11.178 null</a></li>
  1000. <li><a id="toc-ocr" href="#ocr">11.179 ocr</a></li>
  1001. <li><a id="toc-ocv" href="#ocv">11.180 ocv</a>
  1002. <ul class="toc-numbered-mark">
  1003. <li><a id="toc-dilate-1" href="#dilate-1">11.180.1 dilate</a></li>
  1004. <li><a id="toc-erode" href="#erode">11.180.2 erode</a></li>
  1005. <li><a id="toc-smooth" href="#smooth">11.180.3 smooth</a></li>
  1006. </ul></li>
  1007. <li><a id="toc-oscilloscope" href="#oscilloscope">11.181 oscilloscope</a>
  1008. <ul class="toc-numbered-mark">
  1009. <li><a id="toc-Commands-127" href="#Commands-127">11.181.1 Commands</a></li>
  1010. <li><a id="toc-Examples-101" href="#Examples-101">11.181.2 Examples</a></li>
  1011. </ul></li>
  1012. <li><a id="toc-overlay-1" href="#overlay-1">11.182 overlay</a>
  1013. <ul class="toc-numbered-mark">
  1014. <li><a id="toc-Commands-128" href="#Commands-128">11.182.1 Commands</a></li>
  1015. <li><a id="toc-Examples-102" href="#Examples-102">11.182.2 Examples</a></li>
  1016. </ul></li>
  1017. <li><a id="toc-owdenoise" href="#owdenoise">11.183 owdenoise</a></li>
  1018. <li><a id="toc-pad-1" href="#pad-1">11.184 pad</a>
  1019. <ul class="toc-numbered-mark">
  1020. <li><a id="toc-Examples-103" href="#Examples-103">11.184.1 Examples</a></li>
  1021. </ul></li>
  1022. <li><a id="toc-palettegen-1" href="#palettegen-1">11.185 palettegen</a>
  1023. <ul class="toc-numbered-mark">
  1024. <li><a id="toc-Examples-104" href="#Examples-104">11.185.1 Examples</a></li>
  1025. </ul></li>
  1026. <li><a id="toc-paletteuse" href="#paletteuse">11.186 paletteuse</a>
  1027. <ul class="toc-numbered-mark">
  1028. <li><a id="toc-Examples-105" href="#Examples-105">11.186.1 Examples</a></li>
  1029. </ul></li>
  1030. <li><a id="toc-perspective" href="#perspective">11.187 perspective</a></li>
  1031. <li><a id="toc-phase" href="#phase">11.188 phase</a>
  1032. <ul class="toc-numbered-mark">
  1033. <li><a id="toc-Commands-129" href="#Commands-129">11.188.1 Commands</a></li>
  1034. </ul></li>
  1035. <li><a id="toc-photosensitivity" href="#photosensitivity">11.189 photosensitivity</a></li>
  1036. <li><a id="toc-pixdesctest" href="#pixdesctest">11.190 pixdesctest</a></li>
  1037. <li><a id="toc-pixelize" href="#pixelize">11.191 pixelize</a>
  1038. <ul class="toc-numbered-mark">
  1039. <li><a id="toc-Commands-130" href="#Commands-130">11.191.1 Commands</a></li>
  1040. </ul></li>
  1041. <li><a id="toc-pixscope" href="#pixscope">11.192 pixscope</a>
  1042. <ul class="toc-numbered-mark">
  1043. <li><a id="toc-Commands-131" href="#Commands-131">11.192.1 Commands</a></li>
  1044. </ul></li>
  1045. <li><a id="toc-pp7" href="#pp7">11.193 pp7</a></li>
  1046. <li><a id="toc-premultiply" href="#premultiply">11.194 premultiply</a></li>
  1047. <li><a id="toc-premultiply_005fdynamic" href="#premultiply_005fdynamic">11.195 premultiply_dynamic</a></li>
  1048. <li><a id="toc-prewitt" href="#prewitt">11.196 prewitt</a>
  1049. <ul class="toc-numbered-mark">
  1050. <li><a id="toc-Commands-132" href="#Commands-132">11.196.1 Commands</a></li>
  1051. </ul></li>
  1052. <li><a id="toc-pseudocolor" href="#pseudocolor">11.197 pseudocolor</a>
  1053. <ul class="toc-numbered-mark">
  1054. <li><a id="toc-Commands-133" href="#Commands-133">11.197.1 Commands</a></li>
  1055. <li><a id="toc-Examples-106" href="#Examples-106">11.197.2 Examples</a></li>
  1056. </ul></li>
  1057. <li><a id="toc-psnr-1" href="#psnr-1">11.198 psnr</a>
  1058. <ul class="toc-numbered-mark">
  1059. <li><a id="toc-Examples-107" href="#Examples-107">11.198.1 Examples</a></li>
  1060. </ul></li>
  1061. <li><a id="toc-pullup-1" href="#pullup-1">11.199 pullup</a></li>
  1062. <li><a id="toc-qp" href="#qp">11.200 qp</a>
  1063. <ul class="toc-numbered-mark">
  1064. <li><a id="toc-Examples-108" href="#Examples-108">11.200.1 Examples</a></li>
  1065. </ul></li>
  1066. <li><a id="toc-qrencode" href="#qrencode">11.201 qrencode</a>
  1067. <ul class="toc-numbered-mark">
  1068. <li><a id="toc-qrencode-Expressions" href="#qrencode-Expressions">11.201.1 qrencode Expressions</a></li>
  1069. <li><a id="toc-qrencode-Text-expansion" href="#qrencode-Text-expansion">11.201.2 qrencode Text expansion</a></li>
  1070. <li><a id="toc-Examples-109" href="#Examples-109">11.201.3 Examples</a></li>
  1071. </ul></li>
  1072. <li><a id="toc-quirc" href="#quirc">11.202 quirc</a></li>
  1073. <li><a id="toc-random" href="#random">11.203 random</a></li>
  1074. <li><a id="toc-readeia608" href="#readeia608">11.204 readeia608</a>
  1075. <ul class="toc-numbered-mark">
  1076. <li><a id="toc-Commands-134" href="#Commands-134">11.204.1 Commands</a></li>
  1077. <li><a id="toc-Examples-110" href="#Examples-110">11.204.2 Examples</a></li>
  1078. </ul></li>
  1079. <li><a id="toc-readvitc" href="#readvitc">11.205 readvitc</a>
  1080. <ul class="toc-numbered-mark">
  1081. <li><a id="toc-Examples-111" href="#Examples-111">11.205.1 Examples</a></li>
  1082. </ul></li>
  1083. <li><a id="toc-remap" href="#remap">11.206 remap</a></li>
  1084. <li><a id="toc-removegrain" href="#removegrain">11.207 removegrain</a></li>
  1085. <li><a id="toc-removelogo" href="#removelogo">11.208 removelogo</a></li>
  1086. <li><a id="toc-repeatfields" href="#repeatfields">11.209 repeatfields</a></li>
  1087. <li><a id="toc-reverse" href="#reverse">11.210 reverse</a>
  1088. <ul class="toc-numbered-mark">
  1089. <li><a id="toc-Examples-112" href="#Examples-112">11.210.1 Examples</a></li>
  1090. </ul></li>
  1091. <li><a id="toc-rgbashift" href="#rgbashift">11.211 rgbashift</a>
  1092. <ul class="toc-numbered-mark">
  1093. <li><a id="toc-Commands-135" href="#Commands-135">11.211.1 Commands</a></li>
  1094. </ul></li>
  1095. <li><a id="toc-roberts" href="#roberts">11.212 roberts</a>
  1096. <ul class="toc-numbered-mark">
  1097. <li><a id="toc-Commands-136" href="#Commands-136">11.212.1 Commands</a></li>
  1098. </ul></li>
  1099. <li><a id="toc-rotate" href="#rotate">11.213 rotate</a>
  1100. <ul class="toc-numbered-mark">
  1101. <li><a id="toc-Examples-113" href="#Examples-113">11.213.1 Examples</a></li>
  1102. <li><a id="toc-Commands-137" href="#Commands-137">11.213.2 Commands</a></li>
  1103. </ul></li>
  1104. <li><a id="toc-sab" href="#sab">11.214 sab</a></li>
  1105. <li><a id="toc-scale-1" href="#scale-1">11.215 scale</a>
  1106. <ul class="toc-numbered-mark">
  1107. <li><a id="toc-Options-2" href="#Options-2">11.215.1 Options</a></li>
  1108. <li><a id="toc-Examples-114" href="#Examples-114">11.215.2 Examples</a></li>
  1109. <li><a id="toc-Commands-138" href="#Commands-138">11.215.3 Commands</a></li>
  1110. </ul></li>
  1111. <li><a id="toc-scharr" href="#scharr">11.216 scharr</a>
  1112. <ul class="toc-numbered-mark">
  1113. <li><a id="toc-Commands-139" href="#Commands-139">11.216.1 Commands</a></li>
  1114. </ul></li>
  1115. <li><a id="toc-scroll" href="#scroll">11.217 scroll</a>
  1116. <ul class="toc-numbered-mark">
  1117. <li><a id="toc-Commands-140" href="#Commands-140">11.217.1 Commands</a></li>
  1118. </ul></li>
  1119. <li><a id="toc-scdet-1" href="#scdet-1">11.218 scdet</a></li>
  1120. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">11.219 selectivecolor</a>
  1121. <ul class="toc-numbered-mark">
  1122. <li><a id="toc-Examples-115" href="#Examples-115">11.219.1 Examples</a></li>
  1123. </ul></li>
  1124. <li><a id="toc-separatefields-1" href="#separatefields-1">11.220 separatefields</a></li>
  1125. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">11.221 setdar, setsar</a>
  1126. <ul class="toc-numbered-mark">
  1127. <li><a id="toc-Examples-116" href="#Examples-116">11.221.1 Examples</a></li>
  1128. </ul></li>
  1129. <li><a id="toc-setfield-1" href="#setfield-1">11.222 setfield</a></li>
  1130. <li><a id="toc-setparams-1" href="#setparams-1">11.223 setparams</a></li>
  1131. <li><a id="toc-shear" href="#shear">11.224 shear</a>
  1132. <ul class="toc-numbered-mark">
  1133. <li><a id="toc-Commands-141" href="#Commands-141">11.224.1 Commands</a></li>
  1134. </ul></li>
  1135. <li><a id="toc-showinfo" href="#showinfo">11.225 showinfo</a></li>
  1136. <li><a id="toc-showpalette" href="#showpalette">11.226 showpalette</a></li>
  1137. <li><a id="toc-shuffleframes" href="#shuffleframes">11.227 shuffleframes</a>
  1138. <ul class="toc-numbered-mark">
  1139. <li><a id="toc-Examples-117" href="#Examples-117">11.227.1 Examples</a></li>
  1140. </ul></li>
  1141. <li><a id="toc-shufflepixels" href="#shufflepixels">11.228 shufflepixels</a></li>
  1142. <li><a id="toc-shuffleplanes" href="#shuffleplanes">11.229 shuffleplanes</a>
  1143. <ul class="toc-numbered-mark">
  1144. <li><a id="toc-Examples-118" href="#Examples-118">11.229.1 Examples</a></li>
  1145. </ul></li>
  1146. <li><a id="toc-signalstats-1" href="#signalstats-1">11.230 signalstats</a>
  1147. <ul class="toc-numbered-mark">
  1148. <li><a id="toc-Examples-119" href="#Examples-119">11.230.1 Examples</a></li>
  1149. </ul></li>
  1150. <li><a id="toc-signature-1" href="#signature-1">11.231 signature</a>
  1151. <ul class="toc-numbered-mark">
  1152. <li><a id="toc-Examples-120" href="#Examples-120">11.231.1 Examples</a></li>
  1153. </ul></li>
  1154. <li><a id="toc-siti-1" href="#siti-1">11.232 siti</a>
  1155. <ul class="toc-numbered-mark">
  1156. <li><a id="toc-Examples-121" href="#Examples-121">11.232.1 Examples</a></li>
  1157. </ul></li>
  1158. <li><a id="toc-smartblur-1" href="#smartblur-1">11.233 smartblur</a></li>
  1159. <li><a id="toc-sobel" href="#sobel">11.234 sobel</a>
  1160. <ul class="toc-numbered-mark">
  1161. <li><a id="toc-Commands-142" href="#Commands-142">11.234.1 Commands</a></li>
  1162. </ul></li>
  1163. <li><a id="toc-spp-1" href="#spp-1">11.235 spp</a>
  1164. <ul class="toc-numbered-mark">
  1165. <li><a id="toc-Commands-143" href="#Commands-143">11.235.1 Commands</a></li>
  1166. </ul></li>
  1167. <li><a id="toc-sr-1" href="#sr-1">11.236 sr</a></li>
  1168. <li><a id="toc-sr_005famf-1" href="#sr_005famf-1">11.237 sr_amf</a>
  1169. <ul class="toc-numbered-mark">
  1170. <li><a id="toc-Examples-122" href="#Examples-122">11.237.1 Examples</a></li>
  1171. </ul></li>
  1172. <li><a id="toc-ssim" href="#ssim">11.238 ssim</a>
  1173. <ul class="toc-numbered-mark">
  1174. <li><a id="toc-Examples-123" href="#Examples-123">11.238.1 Examples</a></li>
  1175. </ul></li>
  1176. <li><a id="toc-stereo3d" href="#stereo3d">11.239 stereo3d</a>
  1177. <ul class="toc-numbered-mark">
  1178. <li><a id="toc-Examples-124" href="#Examples-124">11.239.1 Examples</a></li>
  1179. </ul></li>
  1180. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">11.240 streamselect, astreamselect</a>
  1181. <ul class="toc-numbered-mark">
  1182. <li><a id="toc-Commands-144" href="#Commands-144">11.240.1 Commands</a></li>
  1183. <li><a id="toc-Examples-125" href="#Examples-125">11.240.2 Examples</a></li>
  1184. </ul></li>
  1185. <li><a id="toc-subtitles-1" href="#subtitles-1">11.241 subtitles</a></li>
  1186. <li><a id="toc-super2xsai" href="#super2xsai">11.242 super2xsai</a></li>
  1187. <li><a id="toc-swaprect" href="#swaprect">11.243 swaprect</a>
  1188. <ul class="toc-numbered-mark">
  1189. <li><a id="toc-Commands-145" href="#Commands-145">11.243.1 Commands</a></li>
  1190. </ul></li>
  1191. <li><a id="toc-swapuv" href="#swapuv">11.244 swapuv</a></li>
  1192. <li><a id="toc-tblend" href="#tblend">11.245 tblend</a></li>
  1193. <li><a id="toc-telecine" href="#telecine">11.246 telecine</a></li>
  1194. <li><a id="toc-thistogram" href="#thistogram">11.247 thistogram</a></li>
  1195. <li><a id="toc-threshold" href="#threshold">11.248 threshold</a>
  1196. <ul class="toc-numbered-mark">
  1197. <li><a id="toc-Commands-146" href="#Commands-146">11.248.1 Commands</a></li>
  1198. <li><a id="toc-Examples-126" href="#Examples-126">11.248.2 Examples</a></li>
  1199. </ul></li>
  1200. <li><a id="toc-thumbnail" href="#thumbnail">11.249 thumbnail</a>
  1201. <ul class="toc-numbered-mark">
  1202. <li><a id="toc-Examples-127" href="#Examples-127">11.249.1 Examples</a></li>
  1203. </ul></li>
  1204. <li><a id="toc-tile-1" href="#tile-1">11.250 tile</a>
  1205. <ul class="toc-numbered-mark">
  1206. <li><a id="toc-Examples-128" href="#Examples-128">11.250.1 Examples</a></li>
  1207. </ul></li>
  1208. <li><a id="toc-tiltandshift" href="#tiltandshift">11.251 tiltandshift</a></li>
  1209. <li><a id="toc-tinterlace" href="#tinterlace">11.252 tinterlace</a></li>
  1210. <li><a id="toc-tmedian" href="#tmedian">11.253 tmedian</a>
  1211. <ul class="toc-numbered-mark">
  1212. <li><a id="toc-Commands-147" href="#Commands-147">11.253.1 Commands</a></li>
  1213. </ul></li>
  1214. <li><a id="toc-tmidequalizer" href="#tmidequalizer">11.254 tmidequalizer</a></li>
  1215. <li><a id="toc-tmix" href="#tmix">11.255 tmix</a>
  1216. <ul class="toc-numbered-mark">
  1217. <li><a id="toc-Examples-129" href="#Examples-129">11.255.1 Examples</a></li>
  1218. <li><a id="toc-Commands-148" href="#Commands-148">11.255.2 Commands</a></li>
  1219. </ul></li>
  1220. <li><a id="toc-tonemap-1" href="#tonemap-1">11.256 tonemap</a>
  1221. <ul class="toc-numbered-mark">
  1222. <li><a id="toc-Options-3" href="#Options-3">11.256.1 Options</a></li>
  1223. </ul></li>
  1224. <li><a id="toc-tpad" href="#tpad">11.257 tpad</a></li>
  1225. <li><a id="toc-transpose-1" href="#transpose-1">11.258 transpose</a></li>
  1226. <li><a id="toc-trim" href="#trim">11.259 trim</a></li>
  1227. <li><a id="toc-unpremultiply" href="#unpremultiply">11.260 unpremultiply</a></li>
  1228. <li><a id="toc-unsharp-1" href="#unsharp-1">11.261 unsharp</a>
  1229. <ul class="toc-numbered-mark">
  1230. <li><a id="toc-Examples-130" href="#Examples-130">11.261.1 Examples</a></li>
  1231. </ul></li>
  1232. <li><a id="toc-untile-1" href="#untile-1">11.262 untile</a>
  1233. <ul class="toc-numbered-mark">
  1234. <li><a id="toc-Examples-131" href="#Examples-131">11.262.1 Examples</a></li>
  1235. </ul></li>
  1236. <li><a id="toc-uspp" href="#uspp">11.263 uspp</a></li>
  1237. <li><a id="toc-v360" href="#v360">11.264 v360</a>
  1238. <ul class="toc-numbered-mark">
  1239. <li><a id="toc-Examples-132" href="#Examples-132">11.264.1 Examples</a></li>
  1240. <li><a id="toc-Commands-149" href="#Commands-149">11.264.2 Commands</a></li>
  1241. </ul></li>
  1242. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">11.265 vaguedenoiser</a></li>
  1243. <li><a id="toc-varblur" href="#varblur">11.266 varblur</a>
  1244. <ul class="toc-numbered-mark">
  1245. <li><a id="toc-Commands-150" href="#Commands-150">11.266.1 Commands</a></li>
  1246. </ul></li>
  1247. <li><a id="toc-vectorscope" href="#vectorscope">11.267 vectorscope</a></li>
  1248. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">11.268 vidstabdetect</a>
  1249. <ul class="toc-numbered-mark">
  1250. <li><a id="toc-Examples-133" href="#Examples-133">11.268.1 Examples</a></li>
  1251. </ul></li>
  1252. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">11.269 vidstabtransform</a>
  1253. <ul class="toc-numbered-mark">
  1254. <li><a id="toc-Options-4" href="#Options-4">11.269.1 Options</a></li>
  1255. <li><a id="toc-Examples-134" href="#Examples-134">11.269.2 Examples</a></li>
  1256. </ul></li>
  1257. <li><a id="toc-vflip" href="#vflip">11.270 vflip</a></li>
  1258. <li><a id="toc-vfrdet" href="#vfrdet">11.271 vfrdet</a></li>
  1259. <li><a id="toc-vibrance" href="#vibrance">11.272 vibrance</a>
  1260. <ul class="toc-numbered-mark">
  1261. <li><a id="toc-Commands-151" href="#Commands-151">11.272.1 Commands</a></li>
  1262. </ul></li>
  1263. <li><a id="toc-vif" href="#vif">11.273 vif</a></li>
  1264. <li><a id="toc-vignette-1" href="#vignette-1">11.274 vignette</a>
  1265. <ul class="toc-numbered-mark">
  1266. <li><a id="toc-Expressions" href="#Expressions">11.274.1 Expressions</a></li>
  1267. <li><a id="toc-Examples-135" href="#Examples-135">11.274.2 Examples</a></li>
  1268. </ul></li>
  1269. <li><a id="toc-vmafmotion" href="#vmafmotion">11.275 vmafmotion</a></li>
  1270. <li><a id="toc-vpp_005famf-1" href="#vpp_005famf-1">11.276 vpp_amf</a>
  1271. <ul class="toc-numbered-mark">
  1272. <li><a id="toc-Examples-136" href="#Examples-136">11.276.1 Examples</a></li>
  1273. </ul></li>
  1274. <li><a id="toc-vstack-1" href="#vstack-1">11.277 vstack</a></li>
  1275. <li><a id="toc-w3fdif" href="#w3fdif">11.278 w3fdif</a>
  1276. <ul class="toc-numbered-mark">
  1277. <li><a id="toc-Commands-152" href="#Commands-152">11.278.1 Commands</a></li>
  1278. </ul></li>
  1279. <li><a id="toc-waveform" href="#waveform">11.279 waveform</a></li>
  1280. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">11.280 weave, doubleweave</a>
  1281. <ul class="toc-numbered-mark">
  1282. <li><a id="toc-Examples-137" href="#Examples-137">11.280.1 Examples</a></li>
  1283. </ul></li>
  1284. <li><a id="toc-xbr" href="#xbr">11.281 xbr</a></li>
  1285. <li><a id="toc-xcorrelate" href="#xcorrelate">11.282 xcorrelate</a></li>
  1286. <li><a id="toc-xfade" href="#xfade">11.283 xfade</a>
  1287. <ul class="toc-numbered-mark">
  1288. <li><a id="toc-Examples-138" href="#Examples-138">11.283.1 Examples</a></li>
  1289. </ul></li>
  1290. <li><a id="toc-xmedian" href="#xmedian">11.284 xmedian</a>
  1291. <ul class="toc-numbered-mark">
  1292. <li><a id="toc-Commands-153" href="#Commands-153">11.284.1 Commands</a></li>
  1293. </ul></li>
  1294. <li><a id="toc-xpsnr-1" href="#xpsnr-1">11.285 xpsnr</a>
  1295. <ul class="toc-numbered-mark">
  1296. <li><a id="toc-Examples-139" href="#Examples-139">11.285.1 Examples</a></li>
  1297. </ul></li>
  1298. <li><a id="toc-xstack-1" href="#xstack-1">11.286 xstack</a>
  1299. <ul class="toc-numbered-mark">
  1300. <li><a id="toc-Examples-140" href="#Examples-140">11.286.1 Examples</a></li>
  1301. </ul></li>
  1302. <li><a id="toc-yadif-1" href="#yadif-1">11.287 yadif</a></li>
  1303. <li><a id="toc-yaepblur" href="#yaepblur">11.288 yaepblur</a>
  1304. <ul class="toc-numbered-mark">
  1305. <li><a id="toc-Commands-154" href="#Commands-154">11.288.1 Commands</a></li>
  1306. </ul></li>
  1307. <li><a id="toc-zoompan" href="#zoompan">11.289 zoompan</a>
  1308. <ul class="toc-numbered-mark">
  1309. <li><a id="toc-Examples-141" href="#Examples-141">11.289.1 Examples</a></li>
  1310. </ul></li>
  1311. <li><a id="toc-zscale-1" href="#zscale-1">11.290 zscale</a>
  1312. <ul class="toc-numbered-mark">
  1313. <li><a id="toc-Options-5" href="#Options-5">11.290.1 Options</a></li>
  1314. <li><a id="toc-Commands-155" href="#Commands-155">11.290.2 Commands</a></li>
  1315. </ul></li>
  1316. </ul></li>
  1317. <li><a id="toc-CUDA-Video-Filters" href="#CUDA-Video-Filters">12 CUDA Video Filters</a>
  1318. <ul class="toc-numbered-mark">
  1319. <li><a id="toc-CUDA-1" href="#CUDA-1">12.1 CUDA</a>
  1320. <ul class="toc-numbered-mark">
  1321. <li><a id="toc-bilateral_005fcuda" href="#bilateral_005fcuda">12.1.1 bilateral_cuda</a>
  1322. <ul class="toc-numbered-mark">
  1323. <li><a id="toc-Examples-142" href="#Examples-142">12.1.1.1 Examples</a></li>
  1324. </ul></li>
  1325. <li><a id="toc-bwdif_005fcuda" href="#bwdif_005fcuda">12.1.2 bwdif_cuda</a></li>
  1326. <li><a id="toc-chromakey_005fcuda" href="#chromakey_005fcuda">12.1.3 chromakey_cuda</a>
  1327. <ul class="toc-numbered-mark">
  1328. <li><a id="toc-Examples-143" href="#Examples-143">12.1.3.1 Examples</a></li>
  1329. </ul></li>
  1330. <li><a id="toc-colorspace_005fcuda" href="#colorspace_005fcuda">12.1.4 colorspace_cuda</a></li>
  1331. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">12.1.5 overlay_cuda</a></li>
  1332. <li><a id="toc-pad_005fcuda-1" href="#pad_005fcuda-1">12.1.6 pad_cuda</a>
  1333. <ul class="toc-numbered-mark">
  1334. <li><a id="toc-Examples-144" href="#Examples-144">12.1.6.1 Examples</a></li>
  1335. </ul></li>
  1336. <li><a id="toc-scale_005fcuda-1" href="#scale_005fcuda-1">12.1.7 scale_cuda</a>
  1337. <ul class="toc-numbered-mark">
  1338. <li><a id="toc-Examples-145" href="#Examples-145">12.1.7.1 Examples</a></li>
  1339. </ul></li>
  1340. <li><a id="toc-thumbnail_005fcuda" href="#thumbnail_005fcuda">12.1.8 thumbnail_cuda</a>
  1341. <ul class="toc-numbered-mark">
  1342. <li><a id="toc-Example" href="#Example">12.1.8.1 Example</a></li>
  1343. </ul></li>
  1344. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">12.1.9 yadif_cuda</a></li>
  1345. </ul></li>
  1346. <li><a id="toc-CUDA-NPP-1" href="#CUDA-NPP-1">12.2 CUDA NPP</a>
  1347. <ul class="toc-numbered-mark">
  1348. <li><a id="toc-scale_005fnpp-1" href="#scale_005fnpp-1">12.2.1 scale_npp</a></li>
  1349. <li><a id="toc-scale2ref_005fnpp" href="#scale2ref_005fnpp">12.2.2 scale2ref_npp</a>
  1350. <ul class="toc-numbered-mark">
  1351. <li><a id="toc-Examples-146" href="#Examples-146">12.2.2.1 Examples</a></li>
  1352. </ul></li>
  1353. <li><a id="toc-sharpen_005fnpp" href="#sharpen_005fnpp">12.2.3 sharpen_npp</a></li>
  1354. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">12.2.4 transpose_npp</a></li>
  1355. </ul></li>
  1356. </ul></li>
  1357. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">13 OpenCL Video Filters</a>
  1358. <ul class="toc-numbered-mark">
  1359. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">13.1 avgblur_opencl</a>
  1360. <ul class="toc-numbered-mark">
  1361. <li><a id="toc-Example-1" href="#Example-1">13.1.1 Example</a></li>
  1362. </ul></li>
  1363. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">13.2 boxblur_opencl</a>
  1364. <ul class="toc-numbered-mark">
  1365. <li><a id="toc-Examples-147" href="#Examples-147">13.2.1 Examples</a></li>
  1366. </ul></li>
  1367. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">13.3 colorkey_opencl</a>
  1368. <ul class="toc-numbered-mark">
  1369. <li><a id="toc-Examples-148" href="#Examples-148">13.3.1 Examples</a></li>
  1370. </ul></li>
  1371. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">13.4 convolution_opencl</a>
  1372. <ul class="toc-numbered-mark">
  1373. <li><a id="toc-Examples-149" href="#Examples-149">13.4.1 Examples</a></li>
  1374. </ul></li>
  1375. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">13.5 erosion_opencl</a>
  1376. <ul class="toc-numbered-mark">
  1377. <li><a id="toc-Example-2" href="#Example-2">13.5.1 Example</a></li>
  1378. </ul></li>
  1379. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">13.6 deshake_opencl</a>
  1380. <ul class="toc-numbered-mark">
  1381. <li><a id="toc-Examples-150" href="#Examples-150">13.6.1 Examples</a></li>
  1382. </ul></li>
  1383. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">13.7 dilation_opencl</a>
  1384. <ul class="toc-numbered-mark">
  1385. <li><a id="toc-Example-3" href="#Example-3">13.7.1 Example</a></li>
  1386. </ul></li>
  1387. <li><a id="toc-nlmeans_005fopencl-1" href="#nlmeans_005fopencl-1">13.8 nlmeans_opencl</a></li>
  1388. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">13.9 overlay_opencl</a>
  1389. <ul class="toc-numbered-mark">
  1390. <li><a id="toc-Examples-151" href="#Examples-151">13.9.1 Examples</a></li>
  1391. </ul></li>
  1392. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">13.10 pad_opencl</a></li>
  1393. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">13.11 prewitt_opencl</a>
  1394. <ul class="toc-numbered-mark">
  1395. <li><a id="toc-Example-4" href="#Example-4">13.11.1 Example</a></li>
  1396. </ul></li>
  1397. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">13.12 program_opencl</a></li>
  1398. <li><a id="toc-remap_005fopencl" href="#remap_005fopencl">13.13 remap_opencl</a></li>
  1399. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">13.14 roberts_opencl</a>
  1400. <ul class="toc-numbered-mark">
  1401. <li><a id="toc-Example-5" href="#Example-5">13.14.1 Example</a></li>
  1402. </ul></li>
  1403. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">13.15 sobel_opencl</a>
  1404. <ul class="toc-numbered-mark">
  1405. <li><a id="toc-Example-6" href="#Example-6">13.15.1 Example</a></li>
  1406. </ul></li>
  1407. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">13.16 tonemap_opencl</a>
  1408. <ul class="toc-numbered-mark">
  1409. <li><a id="toc-Example-7" href="#Example-7">13.16.1 Example</a></li>
  1410. </ul></li>
  1411. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">13.17 unsharp_opencl</a>
  1412. <ul class="toc-numbered-mark">
  1413. <li><a id="toc-Examples-152" href="#Examples-152">13.17.1 Examples</a></li>
  1414. </ul></li>
  1415. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">13.18 xfade_opencl</a></li>
  1416. </ul></li>
  1417. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">14 VAAPI Video Filters</a>
  1418. <ul class="toc-numbered-mark">
  1419. <li><a id="toc-overlay_005fvaapi" href="#overlay_005fvaapi">14.1 overlay_vaapi</a>
  1420. <ul class="toc-numbered-mark">
  1421. <li><a id="toc-Examples-153" href="#Examples-153">14.1.1 Examples</a></li>
  1422. </ul></li>
  1423. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">14.2 tonemap_vaapi</a>
  1424. <ul class="toc-numbered-mark">
  1425. <li><a id="toc-Example-8" href="#Example-8">14.2.1 Example</a></li>
  1426. </ul></li>
  1427. <li><a id="toc-hstack_005fvaapi" href="#hstack_005fvaapi">14.3 hstack_vaapi</a></li>
  1428. <li><a id="toc-vstack_005fvaapi" href="#vstack_005fvaapi">14.4 vstack_vaapi</a></li>
  1429. <li><a id="toc-xstack_005fvaapi" href="#xstack_005fvaapi">14.5 xstack_vaapi</a></li>
  1430. <li><a id="toc-pad_005fvaapi" href="#pad_005fvaapi">14.6 pad_vaapi</a></li>
  1431. <li><a id="toc-drawbox_005fvaapi" href="#drawbox_005fvaapi">14.7 drawbox_vaapi</a>
  1432. <ul class="toc-numbered-mark">
  1433. <li><a id="toc-Examples-154" href="#Examples-154">14.7.1 Examples</a></li>
  1434. </ul></li>
  1435. </ul></li>
  1436. <li><a id="toc-VideoToolbox-Video-Filters" href="#VideoToolbox-Video-Filters">15 VideoToolbox Video Filters</a>
  1437. <ul class="toc-numbered-mark">
  1438. <li><a id="toc-scale_005fvt" href="#scale_005fvt">15.1 scale_vt</a>
  1439. <ul class="toc-numbered-mark">
  1440. <li><a id="toc-Examples-155" href="#Examples-155">15.1.1 Examples</a></li>
  1441. </ul></li>
  1442. <li><a id="toc-transpose_005fvt" href="#transpose_005fvt">15.2 transpose_vt</a></li>
  1443. </ul></li>
  1444. <li><a id="toc-Vulkan-Video-Filters" href="#Vulkan-Video-Filters">16 Vulkan Video Filters</a>
  1445. <ul class="toc-numbered-mark">
  1446. <li><a id="toc-avgblur_005fvulkan" href="#avgblur_005fvulkan">16.1 avgblur_vulkan</a></li>
  1447. <li><a id="toc-blend_005fvulkan" href="#blend_005fvulkan">16.2 blend_vulkan</a></li>
  1448. <li><a id="toc-bwdif_005fvulkan" href="#bwdif_005fvulkan">16.3 bwdif_vulkan</a></li>
  1449. <li><a id="toc-chromaber_005fvulkan" href="#chromaber_005fvulkan">16.4 chromaber_vulkan</a></li>
  1450. <li><a id="toc-color_005fvulkan" href="#color_005fvulkan">16.5 color_vulkan</a></li>
  1451. <li><a id="toc-vflip_005fvulkan" href="#vflip_005fvulkan">16.6 vflip_vulkan</a></li>
  1452. <li><a id="toc-hflip_005fvulkan" href="#hflip_005fvulkan">16.7 hflip_vulkan</a></li>
  1453. <li><a id="toc-flip_005fvulkan" href="#flip_005fvulkan">16.8 flip_vulkan</a></li>
  1454. <li><a id="toc-gblur_005fvulkan" href="#gblur_005fvulkan">16.9 gblur_vulkan</a></li>
  1455. <li><a id="toc-nlmeans_005fvulkan" href="#nlmeans_005fvulkan">16.10 nlmeans_vulkan</a></li>
  1456. <li><a id="toc-overlay_005fvulkan" href="#overlay_005fvulkan">16.11 overlay_vulkan</a></li>
  1457. <li><a id="toc-transpose_005fvulkan" href="#transpose_005fvulkan">16.12 transpose_vulkan</a></li>
  1458. </ul></li>
  1459. <li><a id="toc-QSV-Video-Filters" href="#QSV-Video-Filters">17 QSV Video Filters</a>
  1460. <ul class="toc-numbered-mark">
  1461. <li><a id="toc-hstack_005fqsv" href="#hstack_005fqsv">17.1 hstack_qsv</a></li>
  1462. <li><a id="toc-vstack_005fqsv" href="#vstack_005fqsv">17.2 vstack_qsv</a></li>
  1463. <li><a id="toc-xstack_005fqsv" href="#xstack_005fqsv">17.3 xstack_qsv</a></li>
  1464. </ul></li>
  1465. <li><a id="toc-Video-Sources" href="#Video-Sources">18 Video Sources</a>
  1466. <ul class="toc-numbered-mark">
  1467. <li><a id="toc-buffer" href="#buffer">18.1 buffer</a></li>
  1468. <li><a id="toc-cellauto" href="#cellauto">18.2 cellauto</a>
  1469. <ul class="toc-numbered-mark">
  1470. <li><a id="toc-Examples-156" href="#Examples-156">18.2.1 Examples</a></li>
  1471. </ul></li>
  1472. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">18.3 coreimagesrc</a>
  1473. <ul class="toc-numbered-mark">
  1474. <li><a id="toc-Examples-157" href="#Examples-157">18.3.1 Examples</a></li>
  1475. </ul></li>
  1476. <li><a id="toc-ddagrab" href="#ddagrab">18.4 ddagrab</a>
  1477. <ul class="toc-numbered-mark">
  1478. <li><a id="toc-Examples-158" href="#Examples-158">18.4.1 Examples</a></li>
  1479. </ul></li>
  1480. <li><a id="toc-gfxcapture" href="#gfxcapture">18.5 gfxcapture</a>
  1481. <ul class="toc-numbered-mark">
  1482. <li><a id="toc-Examples-159" href="#Examples-159">18.5.1 Examples</a></li>
  1483. </ul></li>
  1484. <li><a id="toc-gradients" href="#gradients">18.6 gradients</a>
  1485. <ul class="toc-numbered-mark">
  1486. <li><a id="toc-Commands-156" href="#Commands-156">18.6.1 Commands</a></li>
  1487. </ul></li>
  1488. <li><a id="toc-mandelbrot" href="#mandelbrot">18.7 mandelbrot</a></li>
  1489. <li><a id="toc-mptestsrc" href="#mptestsrc">18.8 mptestsrc</a></li>
  1490. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">18.9 frei0r_src</a></li>
  1491. <li><a id="toc-life" href="#life">18.10 life</a>
  1492. <ul class="toc-numbered-mark">
  1493. <li><a id="toc-Examples-160" href="#Examples-160">18.10.1 Examples</a></li>
  1494. </ul></li>
  1495. <li><a id="toc-perlin" href="#perlin">18.11 perlin</a>
  1496. <ul class="toc-numbered-mark">
  1497. <li><a id="toc-Options-6" href="#Options-6">18.11.1 Options</a></li>
  1498. <li><a id="toc-Examples-161" href="#Examples-161">18.11.2 Examples</a></li>
  1499. </ul></li>
  1500. <li><a id="toc-qrencodesrc" href="#qrencodesrc">18.12 qrencodesrc</a>
  1501. <ul class="toc-numbered-mark">
  1502. <li><a id="toc-Examples-162" href="#Examples-162">18.12.1 Examples</a></li>
  1503. </ul></li>
  1504. <li><a id="toc-allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_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-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">18.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1505. <ul class="toc-numbered-mark">
  1506. <li><a id="toc-Examples-163" href="#Examples-163">18.13.1 Examples</a></li>
  1507. <li><a id="toc-Commands-157" href="#Commands-157">18.13.2 Commands</a></li>
  1508. </ul></li>
  1509. <li><a id="toc-openclsrc" href="#openclsrc">18.14 openclsrc</a></li>
  1510. <li><a id="toc-sierpinski" href="#sierpinski">18.15 sierpinski</a></li>
  1511. <li><a id="toc-zoneplate" href="#zoneplate">18.16 zoneplate</a>
  1512. <ul class="toc-numbered-mark">
  1513. <li><a id="toc-Commands-158" href="#Commands-158">18.16.1 Commands</a></li>
  1514. <li><a id="toc-Examples-164" href="#Examples-164">18.16.2 Examples</a></li>
  1515. </ul></li>
  1516. </ul></li>
  1517. <li><a id="toc-Video-Sinks" href="#Video-Sinks">19 Video Sinks</a>
  1518. <ul class="toc-numbered-mark">
  1519. <li><a id="toc-buffersink" href="#buffersink">19.1 buffersink</a></li>
  1520. <li><a id="toc-nullsink" href="#nullsink">19.2 nullsink</a></li>
  1521. </ul></li>
  1522. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">20 Multimedia Filters</a>
  1523. <ul class="toc-numbered-mark">
  1524. <li><a id="toc-a3dscope" href="#a3dscope">20.1 a3dscope</a>
  1525. <ul class="toc-numbered-mark">
  1526. <li><a id="toc-Commands-159" href="#Commands-159">20.1.1 Commands</a></li>
  1527. </ul></li>
  1528. <li><a id="toc-abitscope" href="#abitscope">20.2 abitscope</a></li>
  1529. <li><a id="toc-adrawgraph" href="#adrawgraph">20.3 adrawgraph</a></li>
  1530. <li><a id="toc-agraphmonitor" href="#agraphmonitor">20.4 agraphmonitor</a></li>
  1531. <li><a id="toc-ahistogram" href="#ahistogram">20.5 ahistogram</a></li>
  1532. <li><a id="toc-aphasemeter" href="#aphasemeter">20.6 aphasemeter</a>
  1533. <ul class="toc-numbered-mark">
  1534. <li><a id="toc-phasing-detection" href="#phasing-detection">20.6.1 phasing detection</a></li>
  1535. <li><a id="toc-Examples-165" href="#Examples-165">20.6.2 Examples</a></li>
  1536. </ul></li>
  1537. <li><a id="toc-avectorscope" href="#avectorscope">20.7 avectorscope</a>
  1538. <ul class="toc-numbered-mark">
  1539. <li><a id="toc-Examples-166" href="#Examples-166">20.7.1 Examples</a></li>
  1540. <li><a id="toc-Commands-160" href="#Commands-160">20.7.2 Commands</a></li>
  1541. </ul></li>
  1542. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">20.8 bench, abench</a>
  1543. <ul class="toc-numbered-mark">
  1544. <li><a id="toc-Examples-167" href="#Examples-167">20.8.1 Examples</a></li>
  1545. </ul></li>
  1546. <li><a id="toc-concat" href="#concat">20.9 concat</a>
  1547. <ul class="toc-numbered-mark">
  1548. <li><a id="toc-Examples-168" href="#Examples-168">20.9.1 Examples</a></li>
  1549. <li><a id="toc-Commands-161" href="#Commands-161">20.9.2 Commands</a></li>
  1550. </ul></li>
  1551. <li><a id="toc-ebur128-1" href="#ebur128-1">20.10 ebur128</a>
  1552. <ul class="toc-numbered-mark">
  1553. <li><a id="toc-Examples-169" href="#Examples-169">20.10.1 Examples</a></li>
  1554. </ul></li>
  1555. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">20.11 interleave, ainterleave</a>
  1556. <ul class="toc-numbered-mark">
  1557. <li><a id="toc-Examples-170" href="#Examples-170">20.11.1 Examples</a></li>
  1558. </ul></li>
  1559. <li><a id="toc-latency_002c-alatency" href="#latency_002c-alatency">20.12 latency, alatency</a></li>
  1560. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">20.13 metadata, ametadata</a>
  1561. <ul class="toc-numbered-mark">
  1562. <li><a id="toc-Examples-171" href="#Examples-171">20.13.1 Examples</a></li>
  1563. </ul></li>
  1564. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">20.14 perms, aperms</a></li>
  1565. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">20.15 realtime, arealtime</a>
  1566. <ul class="toc-numbered-mark">
  1567. <li><a id="toc-Commands-162" href="#Commands-162">20.15.1 Commands</a></li>
  1568. </ul></li>
  1569. <li><a id="toc-segment_002c-asegment" href="#segment_002c-asegment">20.16 segment, asegment</a>
  1570. <ul class="toc-numbered-mark">
  1571. <li><a id="toc-Examples-172" href="#Examples-172">20.16.1 Examples</a></li>
  1572. </ul></li>
  1573. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">20.17 select, aselect</a>
  1574. <ul class="toc-numbered-mark">
  1575. <li><a id="toc-Examples-173" href="#Examples-173">20.17.1 Examples</a></li>
  1576. </ul></li>
  1577. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">20.18 sendcmd, asendcmd</a>
  1578. <ul class="toc-numbered-mark">
  1579. <li><a id="toc-Commands-syntax" href="#Commands-syntax">20.18.1 Commands syntax</a></li>
  1580. <li><a id="toc-Examples-174" href="#Examples-174">20.18.2 Examples</a></li>
  1581. </ul></li>
  1582. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">20.19 setpts, asetpts</a>
  1583. <ul class="toc-numbered-mark">
  1584. <li><a id="toc-Examples-175" href="#Examples-175">20.19.1 Examples</a></li>
  1585. <li><a id="toc-Commands-163" href="#Commands-163">20.19.2 Commands</a></li>
  1586. </ul></li>
  1587. <li><a id="toc-setrange" href="#setrange">20.20 setrange</a></li>
  1588. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">20.21 settb, asettb</a>
  1589. <ul class="toc-numbered-mark">
  1590. <li><a id="toc-Examples-176" href="#Examples-176">20.21.1 Examples</a></li>
  1591. </ul></li>
  1592. <li><a id="toc-showcqt" href="#showcqt">20.22 showcqt</a>
  1593. <ul class="toc-numbered-mark">
  1594. <li><a id="toc-Examples-177" href="#Examples-177">20.22.1 Examples</a></li>
  1595. </ul></li>
  1596. <li><a id="toc-showcwt" href="#showcwt">20.23 showcwt</a></li>
  1597. <li><a id="toc-showfreqs" href="#showfreqs">20.24 showfreqs</a></li>
  1598. <li><a id="toc-showspatial" href="#showspatial">20.25 showspatial</a></li>
  1599. <li><a id="toc-showspectrum-1" href="#showspectrum-1">20.26 showspectrum</a>
  1600. <ul class="toc-numbered-mark">
  1601. <li><a id="toc-Examples-178" href="#Examples-178">20.26.1 Examples</a></li>
  1602. </ul></li>
  1603. <li><a id="toc-showspectrumpic" href="#showspectrumpic">20.27 showspectrumpic</a>
  1604. <ul class="toc-numbered-mark">
  1605. <li><a id="toc-Examples-179" href="#Examples-179">20.27.1 Examples</a></li>
  1606. </ul></li>
  1607. <li><a id="toc-showvolume" href="#showvolume">20.28 showvolume</a></li>
  1608. <li><a id="toc-showwaves" href="#showwaves">20.29 showwaves</a>
  1609. <ul class="toc-numbered-mark">
  1610. <li><a id="toc-Examples-180" href="#Examples-180">20.29.1 Examples</a></li>
  1611. </ul></li>
  1612. <li><a id="toc-showwavespic" href="#showwavespic">20.30 showwavespic</a>
  1613. <ul class="toc-numbered-mark">
  1614. <li><a id="toc-Examples-181" href="#Examples-181">20.30.1 Examples</a></li>
  1615. </ul></li>
  1616. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">20.31 sidedata, asidedata</a></li>
  1617. <li><a id="toc-spectrumsynth" href="#spectrumsynth">20.32 spectrumsynth</a>
  1618. <ul class="toc-numbered-mark">
  1619. <li><a id="toc-Examples-182" href="#Examples-182">20.32.1 Examples</a></li>
  1620. </ul></li>
  1621. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">20.33 split, asplit</a>
  1622. <ul class="toc-numbered-mark">
  1623. <li><a id="toc-Examples-183" href="#Examples-183">20.33.1 Examples</a></li>
  1624. </ul></li>
  1625. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">20.34 zmq, azmq</a>
  1626. <ul class="toc-numbered-mark">
  1627. <li><a id="toc-Examples-184" href="#Examples-184">20.34.1 Examples</a></li>
  1628. </ul></li>
  1629. </ul></li>
  1630. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">21 Multimedia Sources</a>
  1631. <ul class="toc-numbered-mark">
  1632. <li><a id="toc-amovie" href="#amovie">21.1 amovie</a></li>
  1633. <li><a id="toc-avsynctest" href="#avsynctest">21.2 avsynctest</a>
  1634. <ul class="toc-numbered-mark">
  1635. <li><a id="toc-Commands-164" href="#Commands-164">21.2.1 Commands</a></li>
  1636. </ul></li>
  1637. <li><a id="toc-movie-1" href="#movie-1">21.3 movie</a>
  1638. <ul class="toc-numbered-mark">
  1639. <li><a id="toc-Examples-185" href="#Examples-185">21.3.1 Examples</a></li>
  1640. <li><a id="toc-Commands-165" href="#Commands-165">21.3.2 Commands</a></li>
  1641. </ul></li>
  1642. </ul></li>
  1643. <li><a id="toc-See-Also" href="#See-Also">22 See Also</a></li>
  1644. <li><a id="toc-Authors" href="#Authors">23 Authors</a></li>
  1645. </ul>
  1646. </div>
  1647. </div>
  1648. <a name="Description"></a>
  1649. <h2 class="chapter">1 Description<span class="pull-right"><a class="anchor hidden-xs" href="#Description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Description" aria-hidden="true">TOC</a></span></h2>
  1650. <p>This document describes filters, sources, and sinks provided by the
  1651. libavfilter library.
  1652. </p>
  1653. <a name="Filtering-Introduction"></a>
  1654. <h2 class="chapter">2 Filtering Introduction<span class="pull-right"><a class="anchor hidden-xs" href="#Filtering-Introduction" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtering-Introduction" aria-hidden="true">TOC</a></span></h2>
  1655. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  1656. </p>
  1657. <p>In libavfilter, a filter can have multiple inputs and multiple
  1658. outputs.
  1659. To illustrate the sorts of things that are possible, we consider the
  1660. following filtergraph.
  1661. </p>
  1662. <pre class="verbatim"> [main]
  1663. input --&gt; split ---------------------&gt; overlay --&gt; output
  1664. | ^
  1665. |[tmp] [flip]|
  1666. +-----&gt; crop --&gt; vflip -------+
  1667. </pre>
  1668. <p>This filtergraph splits the input stream in two streams, then sends one
  1669. stream through the crop filter and the vflip filter, before merging it
  1670. back with the other stream by overlaying it on top. You can use the
  1671. following command to achieve this:
  1672. </p>
  1673. <div class="example">
  1674. <pre class="example-preformatted">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
  1675. </pre></div>
  1676. <p>The result will be that the top half of the video is mirrored
  1677. onto the bottom half of the output video.
  1678. </p>
  1679. <p>Filters in the same linear chain are separated by commas, and distinct
  1680. linear chains of filters are separated by semicolons. In our example,
  1681. <var class="var">crop,vflip</var> are in one linear chain, <var class="var">split</var> and
  1682. <var class="var">overlay</var> are separately in another. The points where the linear
  1683. chains join are labelled by names enclosed in square brackets. In the
  1684. example, the split filter generates two outputs that are associated to
  1685. the labels <var class="var">[main]</var> and <var class="var">[tmp]</var>.
  1686. </p>
  1687. <p>The stream sent to the second output of <var class="var">split</var>, labelled as
  1688. <var class="var">[tmp]</var>, is processed through the <var class="var">crop</var> filter, which crops
  1689. away the lower half part of the video, and then vertically flipped. The
  1690. <var class="var">overlay</var> filter takes in input the first unchanged output of the
  1691. split filter (which was labelled as <var class="var">[main]</var>), and overlay on its
  1692. lower half the output generated by the <var class="var">crop,vflip</var> filterchain.
  1693. </p>
  1694. <p>Some filters take in input a list of parameters: they are specified
  1695. after the filter name and an equal sign, and are separated from each other
  1696. by a colon.
  1697. </p>
  1698. <p>There exist so-called <var class="var">source filters</var> that do not have an
  1699. audio/video input, and <var class="var">sink filters</var> that will not have audio/video
  1700. output.
  1701. </p>
  1702. <a name="graph2dot"></a>
  1703. <h2 class="chapter">3 graph2dot<span class="pull-right"><a class="anchor hidden-xs" href="#graph2dot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graph2dot" aria-hidden="true">TOC</a></span></h2>
  1704. <p>The <samp class="file">graph2dot</samp> program included in the FFmpeg <samp class="file">tools</samp>
  1705. directory can be used to parse a filtergraph description and issue a
  1706. corresponding textual representation in the dot language.
  1707. </p>
  1708. <p>Invoke the command:
  1709. </p><div class="example">
  1710. <pre class="example-preformatted">graph2dot -h
  1711. </pre></div>
  1712. <p>to see how to use <samp class="file">graph2dot</samp>.
  1713. </p>
  1714. <p>You can then pass the dot description to the <samp class="file">dot</samp> program (from
  1715. the graphviz suite of programs) and obtain a graphical representation
  1716. of the filtergraph.
  1717. </p>
  1718. <p>For example the sequence of commands:
  1719. </p><div class="example">
  1720. <pre class="example-preformatted">echo <var class="var">GRAPH_DESCRIPTION</var> | \
  1721. tools/graph2dot -o graph.tmp &amp;&amp; \
  1722. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  1723. display graph.png
  1724. </pre></div>
  1725. <p>can be used to create and display an image representing the graph
  1726. described by the <var class="var">GRAPH_DESCRIPTION</var> string. Note that this string must be
  1727. a complete self-contained graph, with its inputs and outputs explicitly defined.
  1728. For example if your command line is of the form:
  1729. </p><div class="example">
  1730. <pre class="example-preformatted">ffmpeg -i infile -vf scale=640:360 outfile
  1731. </pre></div>
  1732. <p>your <var class="var">GRAPH_DESCRIPTION</var> string will need to be of the form:
  1733. </p><div class="example">
  1734. <pre class="example-preformatted">nullsrc,scale=640:360,nullsink
  1735. </pre></div>
  1736. <p>you may also need to set the <var class="var">nullsrc</var> parameters and add a <var class="var">format</var>
  1737. filter in order to simulate a specific input file.
  1738. </p>
  1739. <a name="Filtergraph-description"></a>
  1740. <h2 class="chapter">4 Filtergraph description<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-description" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-description" aria-hidden="true">TOC</a></span></h2>
  1741. <p>A filtergraph is a directed graph of connected filters. It can contain
  1742. cycles, and there can be multiple links between a pair of
  1743. filters. Each link has one input pad on one side connecting it to one
  1744. filter from which it takes its input, and one output pad on the other
  1745. side connecting it to one filter accepting its output.
  1746. </p>
  1747. <p>Each filter in a filtergraph is an instance of a filter class
  1748. registered in the application, which defines the features and the
  1749. number of input and output pads of the filter.
  1750. </p>
  1751. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  1752. output pads is called a &quot;sink&quot;.
  1753. </p>
  1754. <a class="anchor" id="Filtergraph-syntax"></a><a name="Filtergraph-syntax-1"></a>
  1755. <h3 class="section">4.1 Filtergraph syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Filtergraph-syntax-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Filtergraph-syntax-1" aria-hidden="true">TOC</a></span></h3>
  1756. <p>A filtergraph has a textual representation, which is recognized by the
  1757. <samp class="option">-filter</samp>/<samp class="option">-vf</samp>/<samp class="option">-af</samp> and
  1758. <samp class="option">-filter_complex</samp> options in <code class="command">ffmpeg</code> and
  1759. <samp class="option">-vf</samp>/<samp class="option">-af</samp> in <code class="command">ffplay</code>, and by the
  1760. <code class="code">avfilter_graph_parse_ptr()</code> function defined in
  1761. <samp class="file">libavfilter/avfilter.h</samp>.
  1762. </p>
  1763. <p>A filterchain consists of a sequence of connected filters, each one
  1764. connected to the previous one in the sequence. A filterchain is
  1765. represented by a list of &quot;,&quot;-separated filter descriptions.
  1766. </p>
  1767. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  1768. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  1769. descriptions.
  1770. </p>
  1771. <p>A filter is represented by a string of the form:
  1772. [<var class="var">in_link_1</var>]...[<var class="var">in_link_N</var>]<var class="var">filter_name</var>@<var class="var">id</var>=<var class="var">arguments</var>[<var class="var">out_link_1</var>]...[<var class="var">out_link_M</var>]
  1773. </p>
  1774. <p><var class="var">filter_name</var> is the name of the filter class of which the
  1775. described filter is an instance of, and has to be the name of one of
  1776. the filter classes registered in the program optionally followed by &quot;@<var class="var">id</var>&quot;.
  1777. The name of the filter class is optionally followed by a string
  1778. &quot;=<var class="var">arguments</var>&quot;.
  1779. </p>
  1780. <p><var class="var">arguments</var> is a string which contains the parameters used to
  1781. initialize the filter instance. It may have one of two forms:
  1782. </p><ul class="itemize mark-bullet">
  1783. <li>A &rsquo;:&rsquo;-separated list of <var class="var">key=value</var> pairs.
  1784. </li><li>A &rsquo;:&rsquo;-separated list of <var class="var">value</var>. In this case, the keys are assumed to be
  1785. the option names in the order they are declared. E.g. the <code class="code">fade</code> filter
  1786. declares three options in this order &ndash; <samp class="option">type</samp>, <samp class="option">start_frame</samp> and
  1787. <samp class="option">nb_frames</samp>. Then the parameter list <var class="var">in:0:30</var> means that the value
  1788. <var class="var">in</var> is assigned to the option <samp class="option">type</samp>, <var class="var">0</var> to
  1789. <samp class="option">start_frame</samp> and <var class="var">30</var> to <samp class="option">nb_frames</samp>.
  1790. </li><li>A &rsquo;:&rsquo;-separated list of mixed direct <var class="var">value</var> and long <var class="var">key=value</var>
  1791. pairs. The direct <var class="var">value</var> must precede the <var class="var">key=value</var> pairs, and
  1792. follow the same constraints order of the previous point. The following
  1793. <var class="var">key=value</var> pairs can be set in any preferred order.
  1794. </li></ul>
  1795. <p>If the option value itself is a list of items (e.g. the <code class="code">format</code> filter
  1796. takes a list of pixel formats), the items in the list are usually separated by
  1797. &lsquo;<samp class="samp">|</samp>&rsquo;.
  1798. </p>
  1799. <p>The list of arguments can be quoted using the character &lsquo;<samp class="samp">'</samp>&rsquo; as initial
  1800. and ending mark, and the character &lsquo;<samp class="samp">\</samp>&rsquo; for escaping the characters
  1801. within the quoted text; otherwise the argument string is considered
  1802. terminated when the next special character (belonging to the set
  1803. &lsquo;<samp class="samp">[]=;,</samp>&rsquo;) is encountered.
  1804. </p>
  1805. <p>A special syntax implemented in the <code class="command">ffmpeg</code> CLI tool allows loading
  1806. option values from files. This is done be prepending a slash &rsquo;/&rsquo; to the option
  1807. name, then the supplied value is interpreted as a path from which the actual
  1808. value is loaded. E.g.
  1809. </p><div class="example">
  1810. <pre class="example-preformatted">ffmpeg -i &lt;INPUT&gt; -vf drawtext=/text=/tmp/some_text &lt;OUTPUT&gt;
  1811. </pre></div>
  1812. <p>will load the text to be drawn from <samp class="file">/tmp/some_text</samp>. API users wishing to
  1813. implement a similar feature should use the <code class="code">avfilter_graph_segment_*()</code>
  1814. functions together with custom IO code.
  1815. </p>
  1816. <p>The name and arguments of the filter are optionally preceded and
  1817. followed by a list of link labels.
  1818. A link label allows one to name a link and associate it to a filter output
  1819. or input pad. The preceding labels <var class="var">in_link_1</var>
  1820. ... <var class="var">in_link_N</var>, are associated to the filter input pads,
  1821. the following labels <var class="var">out_link_1</var> ... <var class="var">out_link_M</var>, are
  1822. associated to the output pads.
  1823. </p>
  1824. <p>When two link labels with the same name are found in the
  1825. filtergraph, a link between the corresponding input and output pad is
  1826. created.
  1827. </p>
  1828. <p>If an output pad is not labelled, it is linked by default to the first
  1829. unlabelled input pad of the next filter in the filterchain.
  1830. For example in the filterchain
  1831. </p><div class="example">
  1832. <pre class="example-preformatted">nullsrc, split[L1], [L2]overlay, nullsink
  1833. </pre></div>
  1834. <p>the split filter instance has two output pads, and the overlay filter
  1835. instance two input pads. The first output pad of split is labelled
  1836. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  1837. output pad of split is linked to the second input pad of overlay,
  1838. which are both unlabelled.
  1839. </p>
  1840. <p>In a filter description, if the input label of the first filter is not
  1841. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  1842. specified, &quot;out&quot; is assumed.
  1843. </p>
  1844. <p>In a complete filterchain all the unlabelled filter input and output
  1845. pads must be connected. A filtergraph is considered valid if all the
  1846. filter input and output pads of all the filterchains are connected.
  1847. </p>
  1848. <p>Leading and trailing whitespaces (space, tabs, or line feeds) separating tokens
  1849. in the filtergraph specification are ignored. This means that the filtergraph
  1850. can be expressed using empty lines and spaces to improve readability.
  1851. </p>
  1852. <p>For example, the filtergraph:
  1853. </p><div class="example">
  1854. <pre class="example-preformatted">testsrc,split[L1],hflip[L2];[L1][L2] hstack
  1855. </pre></div>
  1856. <p>can be represented as:
  1857. </p><div class="example">
  1858. <pre class="example-preformatted">testsrc,
  1859. split [L1], hflip [L2];
  1860. [L1][L2] hstack
  1861. </pre></div>
  1862. <p>Libavfilter will automatically insert <a class="ref" href="#scale">scale</a> filters where format
  1863. conversion is required. It is possible to specify swscale flags
  1864. for those automatically inserted scalers by prepending
  1865. <code class="code">sws_flags=<var class="var">flags</var>;</code>
  1866. to the filtergraph description.
  1867. </p>
  1868. <p>Here is a BNF description of the filtergraph syntax:
  1869. </p><div class="example">
  1870. <pre class="example-preformatted"><var class="var">NAME</var> ::= sequence of alphanumeric characters and '_'
  1871. <var class="var">FILTER_NAME</var> ::= <var class="var">NAME</var>[&quot;@&quot;<var class="var">NAME</var>]
  1872. <var class="var">LINKLABEL</var> ::= &quot;[&quot; <var class="var">NAME</var> &quot;]&quot;
  1873. <var class="var">LINKLABELS</var> ::= <var class="var">LINKLABEL</var> [<var class="var">LINKLABELS</var>]
  1874. <var class="var">FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  1875. <var class="var">FILTER</var> ::= [<var class="var">LINKLABELS</var>] <var class="var">FILTER_NAME</var> [&quot;=&quot; <var class="var">FILTER_ARGUMENTS</var>] [<var class="var">LINKLABELS</var>]
  1876. <var class="var">FILTERCHAIN</var> ::= <var class="var">FILTER</var> [,<var class="var">FILTERCHAIN</var>]
  1877. <var class="var">FILTERGRAPH</var> ::= [sws_flags=<var class="var">flags</var>;] <var class="var">FILTERCHAIN</var> [;<var class="var">FILTERGRAPH</var>]
  1878. </pre></div>
  1879. <a class="anchor" id="filtergraph-escaping"></a><a name="Notes-on-filtergraph-escaping"></a>
  1880. <h3 class="section">4.2 Notes on filtergraph escaping<span class="pull-right"><a class="anchor hidden-xs" href="#Notes-on-filtergraph-escaping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Notes-on-filtergraph-escaping" aria-hidden="true">TOC</a></span></h3>
  1881. <p>Filtergraph description composition entails several levels of
  1882. escaping. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#quoting_005fand_005fescaping">the &quot;Quoting and escaping&quot;
  1883. section in the ffmpeg-utils(1) manual</a> for more
  1884. information about the employed escaping procedure.
  1885. </p>
  1886. <p>A first level escaping affects the content of each filter option
  1887. value, which may contain the special character <code class="code">:</code> used to
  1888. separate values, or one of the escaping characters <code class="code">\'</code>.
  1889. </p>
  1890. <p>A second level escaping affects the whole filter description, which
  1891. may contain the escaping characters <code class="code">\'</code> or the special
  1892. characters <code class="code">[],;</code> used by the filtergraph description.
  1893. </p>
  1894. <p>Finally, when you specify a filtergraph on a shell commandline, you
  1895. need to perform a third level escaping for the shell special
  1896. characters contained within it.
  1897. </p>
  1898. <p>For example, consider the following string to be embedded in
  1899. the <a class="ref" href="#drawtext">drawtext</a> filter description <samp class="option">text</samp> value:
  1900. </p><div class="example">
  1901. <pre class="example-preformatted">this is a 'string': may contain one, or more, special characters
  1902. </pre></div>
  1903. <p>This string contains the <code class="code">'</code> special escaping character, and the
  1904. <code class="code">:</code> special character, so it needs to be escaped in this way:
  1905. </p><div class="example">
  1906. <pre class="example-preformatted">text=this is a \'string\'\: may contain one, or more, special characters
  1907. </pre></div>
  1908. <p>A second level of escaping is required when embedding the filter
  1909. description in a filtergraph description, in order to escape all the
  1910. filtergraph special characters. Thus the example above becomes:
  1911. </p><div class="example">
  1912. <pre class="example-preformatted">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  1913. </pre></div>
  1914. <p>(note that in addition to the <code class="code">\'</code> escaping special characters,
  1915. also <code class="code">,</code> needs to be escaped).
  1916. </p>
  1917. <p>Finally an additional level of escaping is needed when writing the
  1918. filtergraph description in a shell command, which depends on the
  1919. escaping rules of the adopted shell. For example, assuming that
  1920. <code class="code">\</code> is special and needs to be escaped with another <code class="code">\</code>, the
  1921. previous string will finally result in:
  1922. </p><div class="example">
  1923. <pre class="example-preformatted">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  1924. </pre></div>
  1925. <p>In order to avoid cumbersome escaping when using a commandline tool accepting a
  1926. filter specification as input, it is advisable to avoid direct inclusion of the
  1927. filter or options specification in the shell.
  1928. </p>
  1929. <p>For example, in case of the <a class="ref" href="#drawtext">drawtext filter</a>, you might prefer to
  1930. use the <samp class="option">textfile</samp> option in place of <samp class="option">text</samp> to specify the text
  1931. to render.
  1932. </p>
  1933. <a name="Timeline-editing"></a>
  1934. <h2 class="chapter">5 Timeline editing<span class="pull-right"><a class="anchor hidden-xs" href="#Timeline-editing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Timeline-editing" aria-hidden="true">TOC</a></span></h2>
  1935. <p>Some filters support a generic <samp class="option">enable</samp> option. For the filters
  1936. supporting timeline editing, this option can be set to an expression which is
  1937. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  1938. the filter will be enabled, otherwise the frame will be sent unchanged to the
  1939. next filter in the filtergraph.
  1940. </p>
  1941. <p>The expression accepts the following values:
  1942. </p><dl class="table">
  1943. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  1944. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  1945. </p>
  1946. </dd>
  1947. <dt>&lsquo;<samp class="samp">n</samp>&rsquo;</dt>
  1948. <dd><p>sequential number of the input frame, starting from 0
  1949. </p>
  1950. </dd>
  1951. <dt>&lsquo;<samp class="samp">pos</samp>&rsquo;</dt>
  1952. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated, do
  1953. not use
  1954. </p>
  1955. </dd>
  1956. <dt>&lsquo;<samp class="samp">w</samp>&rsquo;</dt>
  1957. <dt>&lsquo;<samp class="samp">h</samp>&rsquo;</dt>
  1958. <dd><p>width and height of the input frame if video
  1959. </p></dd>
  1960. </dl>
  1961. <p>Additionally, these filters support an <samp class="option">enable</samp> command that can be used
  1962. to re-define the expression.
  1963. </p>
  1964. <p>Like any other filtering option, the <samp class="option">enable</samp> option follows the same
  1965. rules.
  1966. </p>
  1967. <p>For example, to enable a blur filter (<a class="ref" href="#smartblur">smartblur</a>) from 10 seconds to 3
  1968. minutes, and a <a class="ref" href="#curves">curves</a> filter starting at 3 seconds:
  1969. </p><div class="example">
  1970. <pre class="example-preformatted">smartblur = enable='between(t,10,3*60)',
  1971. curves = enable='gte(t,3)' : preset=cross_process
  1972. </pre></div>
  1973. <p>See <code class="code">ffmpeg -filters</code> to view which filters have timeline support.
  1974. </p>
  1975. <a class="anchor" id="commands"></a><a name="Changing-options-at-runtime-with-a-command"></a>
  1976. <h2 class="chapter">6 Changing options at runtime with a command<span class="pull-right"><a class="anchor hidden-xs" href="#Changing-options-at-runtime-with-a-command" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Changing-options-at-runtime-with-a-command" aria-hidden="true">TOC</a></span></h2>
  1977. <p>Some options can be changed during the operation of the filter using
  1978. a command. These options are marked &rsquo;T&rsquo; on the output of
  1979. <code class="command">ffmpeg</code> <samp class="option">-h filter=&lt;name of filter&gt;</samp>.
  1980. The name of the command is the name of the option and the argument is
  1981. the new value.
  1982. </p>
  1983. <a class="anchor" id="framesync"></a><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  1984. <h2 class="chapter">7 Options for filters with several inputs (framesync)<span class="pull-right"><a class="anchor hidden-xs" href="#Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-for-filters-with-several-inputs-_0028framesync_0029" aria-hidden="true">TOC</a></span></h2>
  1985. <p>Some filters with several inputs support a common set of options.
  1986. These options can only be set by name, not with the short notation.
  1987. </p>
  1988. <dl class="table">
  1989. <dt><samp class="option">eof_action</samp></dt>
  1990. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  1991. one of the following values:
  1992. </p>
  1993. <dl class="table">
  1994. <dt><samp class="option">repeat</samp></dt>
  1995. <dd><p>Repeat the last frame (the default).
  1996. </p></dd>
  1997. <dt><samp class="option">endall</samp></dt>
  1998. <dd><p>End both streams.
  1999. </p></dd>
  2000. <dt><samp class="option">pass</samp></dt>
  2001. <dd><p>Pass the main input through.
  2002. </p></dd>
  2003. </dl>
  2004. </dd>
  2005. <dt><samp class="option">shortest</samp></dt>
  2006. <dd><p>If set to 1, force the output to terminate when the shortest input
  2007. terminates. Default value is 0.
  2008. </p>
  2009. </dd>
  2010. <dt><samp class="option">repeatlast</samp></dt>
  2011. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  2012. until the end of the primary stream. A value of 0 disables this behavior.
  2013. Default value is 1.
  2014. </p>
  2015. </dd>
  2016. <dt><samp class="option">ts_sync_mode</samp></dt>
  2017. <dd><p>How strictly to sync streams based on secondary input timestamps; it accepts
  2018. one of the following values:
  2019. </p>
  2020. <dl class="table">
  2021. <dt><samp class="option">default</samp></dt>
  2022. <dd><p>Frame from secondary input with the nearest lower or equal timestamp to the
  2023. primary input frame.
  2024. </p></dd>
  2025. <dt><samp class="option">nearest</samp></dt>
  2026. <dd><p>Frame from secondary input with the absolute nearest timestamp to the primary
  2027. input frame.
  2028. </p></dd>
  2029. </dl>
  2030. </dd>
  2031. </dl>
  2032. <a name="Audio-Filters"></a>
  2033. <h2 class="chapter">8 Audio Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Filters" aria-hidden="true">TOC</a></span></h2>
  2034. <p>When you configure your FFmpeg build, you can disable any of the
  2035. existing filters using <code class="code">--disable-filters</code>.
  2036. The configure output will show the audio filters included in your
  2037. build.
  2038. </p>
  2039. <p>Below is a description of the currently available audio filters.
  2040. </p>
  2041. <a name="aap"></a>
  2042. <h3 class="section">8.1 aap<span class="pull-right"><a class="anchor hidden-xs" href="#aap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aap" aria-hidden="true">TOC</a></span></h3>
  2043. <p>Apply Affine Projection algorithm to the first audio stream using the second audio stream.
  2044. </p>
  2045. <p>This adaptive filter is used to estimate unknown audio based on multiple input audio samples.
  2046. Affine projection algorithm can make trade-offs between computation complexity with convergence speed.
  2047. </p>
  2048. <p>A description of the accepted options follows.
  2049. </p>
  2050. <dl class="table">
  2051. <dt><samp class="option">order</samp></dt>
  2052. <dd><p>Set the filter order.
  2053. </p>
  2054. </dd>
  2055. <dt><samp class="option">projection</samp></dt>
  2056. <dd><p>Set the projection order.
  2057. </p>
  2058. </dd>
  2059. <dt><samp class="option">mu</samp></dt>
  2060. <dd><p>Set the filter mu.
  2061. </p>
  2062. </dd>
  2063. <dt><samp class="option">delta</samp></dt>
  2064. <dd><p>Set the coefficient to initialize internal covariance matrix.
  2065. </p>
  2066. </dd>
  2067. <dt><samp class="option">out_mode</samp></dt>
  2068. <dd><p>Set the filter output samples. It accepts the following values:
  2069. </p><dl class="table">
  2070. <dt><samp class="option">i</samp></dt>
  2071. <dd><p>Pass the 1st input.
  2072. </p>
  2073. </dd>
  2074. <dt><samp class="option">d</samp></dt>
  2075. <dd><p>Pass the 2nd input.
  2076. </p>
  2077. </dd>
  2078. <dt><samp class="option">o</samp></dt>
  2079. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  2080. </p>
  2081. </dd>
  2082. <dt><samp class="option">n</samp></dt>
  2083. <dd><p>Pass difference between input, 1st input and error signal estimate.
  2084. </p>
  2085. </dd>
  2086. <dt><samp class="option">e</samp></dt>
  2087. <dd><p>Pass error signal estimated samples.
  2088. </p>
  2089. <p>Default value is <var class="var">o</var>.
  2090. </p></dd>
  2091. </dl>
  2092. </dd>
  2093. <dt><samp class="option">precision</samp></dt>
  2094. <dd><p>Set which precision to use when processing samples.
  2095. </p>
  2096. <dl class="table">
  2097. <dt><samp class="option">auto</samp></dt>
  2098. <dd><p>Auto pick internal sample format depending on other filters.
  2099. </p>
  2100. </dd>
  2101. <dt><samp class="option">float</samp></dt>
  2102. <dd><p>Always use single-floating point precision sample format.
  2103. </p>
  2104. </dd>
  2105. <dt><samp class="option">double</samp></dt>
  2106. <dd><p>Always use double-floating point precision sample format.
  2107. </p></dd>
  2108. </dl>
  2109. </dd>
  2110. </dl>
  2111. <a name="acompressor"></a>
  2112. <h3 class="section">8.2 acompressor<span class="pull-right"><a class="anchor hidden-xs" href="#acompressor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acompressor" aria-hidden="true">TOC</a></span></h3>
  2113. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  2114. Especially modern music is mostly compressed at a high ratio to
  2115. improve the overall loudness. It&rsquo;s done to get the highest attention
  2116. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  2117. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  2118. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  2119. but can also destroy a track completely).
  2120. The right compression is the key to reach a professional sound and is
  2121. the high art of mixing and mastering. Because of its complex settings
  2122. it may take a long time to get the right feeling for this kind of effect.
  2123. </p>
  2124. <p>Compression is done by detecting the volume above a chosen level
  2125. <code class="code">threshold</code> and dividing it by the factor set with <code class="code">ratio</code>.
  2126. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  2127. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  2128. the signal would cause distortion of the waveform the reduction can be
  2129. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  2130. <code class="code">attack</code> determines how long the signal has to rise above the threshold
  2131. before any reduction will occur and <code class="code">release</code> sets the time the signal
  2132. has to fall below the threshold to reduce the reduction again. Shorter signals
  2133. than the chosen attack time will be left untouched.
  2134. The overall reduction of the signal can be made up afterwards with the
  2135. <code class="code">makeup</code> setting. So compressing the peaks of a signal about 6dB and
  2136. raising the makeup to this level results in a signal twice as loud than the
  2137. source. To gain a softer entry in the compression the <code class="code">knee</code> flattens the
  2138. hard edge at the threshold in the range of the chosen decibels.
  2139. </p>
  2140. <p>The filter accepts the following options:
  2141. </p>
  2142. <dl class="table">
  2143. <dt><samp class="option">level_in</samp></dt>
  2144. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  2145. </p>
  2146. </dd>
  2147. <dt><samp class="option">mode</samp></dt>
  2148. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  2149. Default is <code class="code">downward</code>.
  2150. </p>
  2151. </dd>
  2152. <dt><samp class="option">threshold</samp></dt>
  2153. <dd><p>If a signal of stream rises above this level it will affect the gain
  2154. reduction.
  2155. By default it is 0.125. Range is between 0.00097563 and 1.
  2156. </p>
  2157. </dd>
  2158. <dt><samp class="option">ratio</samp></dt>
  2159. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  2160. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  2161. Default is 2. Range is between 1 and 20.
  2162. </p>
  2163. </dd>
  2164. <dt><samp class="option">attack</samp></dt>
  2165. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  2166. reduction starts. Default is 20. Range is between 0.01 and 2000.
  2167. </p>
  2168. </dd>
  2169. <dt><samp class="option">release</samp></dt>
  2170. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  2171. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  2172. </p>
  2173. </dd>
  2174. <dt><samp class="option">makeup</samp></dt>
  2175. <dd><p>Set the amount by how much signal will be amplified after processing.
  2176. Default is 1. Range is from 1 to 64.
  2177. </p>
  2178. </dd>
  2179. <dt><samp class="option">knee</samp></dt>
  2180. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  2181. Default is 2.82843. Range is between 1 and 8.
  2182. </p>
  2183. </dd>
  2184. <dt><samp class="option">link</samp></dt>
  2185. <dd><p>Choose if the <code class="code">average</code> level between all channels of input stream
  2186. or the louder(<code class="code">maximum</code>) channel of input stream affects the
  2187. reduction. Default is <code class="code">average</code>.
  2188. </p>
  2189. </dd>
  2190. <dt><samp class="option">detection</samp></dt>
  2191. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  2192. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mostly smoother.
  2193. </p>
  2194. </dd>
  2195. <dt><samp class="option">mix</samp></dt>
  2196. <dd><p>How much to use compressed signal in output. Default is 1.
  2197. Range is between 0 and 1.
  2198. </p></dd>
  2199. </dl>
  2200. <a name="Commands"></a>
  2201. <h4 class="subsection">8.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands" aria-hidden="true">TOC</a></span></h4>
  2202. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2203. </p>
  2204. <a name="acontrast"></a>
  2205. <h3 class="section">8.3 acontrast<span class="pull-right"><a class="anchor hidden-xs" href="#acontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acontrast" aria-hidden="true">TOC</a></span></h3>
  2206. <p>Simple audio dynamic range compression/expansion filter.
  2207. </p>
  2208. <p>The filter accepts the following options:
  2209. </p>
  2210. <dl class="table">
  2211. <dt><samp class="option">contrast</samp></dt>
  2212. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  2213. </p></dd>
  2214. </dl>
  2215. <a name="acopy"></a>
  2216. <h3 class="section">8.4 acopy<span class="pull-right"><a class="anchor hidden-xs" href="#acopy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acopy" aria-hidden="true">TOC</a></span></h3>
  2217. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  2218. testing purposes.
  2219. </p>
  2220. <a name="acrossfade"></a>
  2221. <h3 class="section">8.5 acrossfade<span class="pull-right"><a class="anchor hidden-xs" href="#acrossfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossfade" aria-hidden="true">TOC</a></span></h3>
  2222. <p>Apply cross fade from one input audio stream to another input audio stream.
  2223. The cross fade is applied for specified duration near the end of first stream.
  2224. </p>
  2225. <p>The filter accepts the following options:
  2226. </p>
  2227. <dl class="table">
  2228. <dt><samp class="option">inputs, n</samp></dt>
  2229. <dd><p>Specify the number of inputs to crossfade. When crossfading multiple inputs,
  2230. each input will be concatenated and crossfaded in sequence, similar to the
  2231. <a class="ref" href="#concat-filter">concat filter</a>. Default is 2.
  2232. </p>
  2233. </dd>
  2234. <dt><samp class="option">nb_samples, ns</samp></dt>
  2235. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  2236. At the end of the cross fade effect the first input audio will be completely
  2237. silent. Default is 44100.
  2238. </p>
  2239. </dd>
  2240. <dt><samp class="option">duration, d</samp></dt>
  2241. <dd><p>Specify the duration of the cross fade effect. See
  2242. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  2243. for the accepted syntax.
  2244. By default the duration is determined by <var class="var">nb_samples</var>.
  2245. If set this option is used instead of <var class="var">nb_samples</var>.
  2246. </p>
  2247. </dd>
  2248. <dt><samp class="option">overlap, o</samp></dt>
  2249. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  2250. </p>
  2251. </dd>
  2252. <dt><samp class="option">curve1</samp></dt>
  2253. <dd><p>Set curve for cross fade transition for first stream.
  2254. </p>
  2255. </dd>
  2256. <dt><samp class="option">curve2</samp></dt>
  2257. <dd><p>Set curve for cross fade transition for second stream.
  2258. </p>
  2259. <p>For description of available curve types see <a class="ref" href="#afade">afade</a> filter description.
  2260. </p></dd>
  2261. </dl>
  2262. <a name="Examples"></a>
  2263. <h4 class="subsection">8.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples" aria-hidden="true">TOC</a></span></h4>
  2264. <ul class="itemize mark-bullet">
  2265. <li>Cross fade from one input to another:
  2266. <div class="example">
  2267. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  2268. </pre></div>
  2269. </li><li>Cross fade from one input to another but without overlapping:
  2270. <div class="example">
  2271. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  2272. </pre></div>
  2273. <p>Concatenate multiple inputs with cross fade between each:
  2274. </p><div class="example">
  2275. <pre class="example-preformatted">ffmpeg -i first.flac -i second.flac -i third.flac -filter_complex acrossfade=n=3 output.flac
  2276. </pre></div>
  2277. </li></ul>
  2278. <a name="acrossover"></a>
  2279. <h3 class="section">8.6 acrossover<span class="pull-right"><a class="anchor hidden-xs" href="#acrossover" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrossover" aria-hidden="true">TOC</a></span></h3>
  2280. <p>Split audio stream into several bands.
  2281. </p>
  2282. <p>This filter splits audio stream into two or more frequency ranges.
  2283. Summing all streams back will give flat output.
  2284. </p>
  2285. <p>The filter accepts the following options:
  2286. </p>
  2287. <dl class="table">
  2288. <dt><samp class="option">split</samp></dt>
  2289. <dd><p>Set split frequencies. Those must be positive and increasing.
  2290. </p>
  2291. </dd>
  2292. <dt><samp class="option">order</samp></dt>
  2293. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  2294. of filter transfer function.
  2295. Available values are:
  2296. </p>
  2297. <dl class="table">
  2298. <dt>&lsquo;<samp class="samp">2nd</samp>&rsquo;</dt>
  2299. <dd><p>12 dB per octave.
  2300. </p></dd>
  2301. <dt>&lsquo;<samp class="samp">4th</samp>&rsquo;</dt>
  2302. <dd><p>24 dB per octave.
  2303. </p></dd>
  2304. <dt>&lsquo;<samp class="samp">6th</samp>&rsquo;</dt>
  2305. <dd><p>36 dB per octave.
  2306. </p></dd>
  2307. <dt>&lsquo;<samp class="samp">8th</samp>&rsquo;</dt>
  2308. <dd><p>48 dB per octave.
  2309. </p></dd>
  2310. <dt>&lsquo;<samp class="samp">10th</samp>&rsquo;</dt>
  2311. <dd><p>60 dB per octave.
  2312. </p></dd>
  2313. <dt>&lsquo;<samp class="samp">12th</samp>&rsquo;</dt>
  2314. <dd><p>72 dB per octave.
  2315. </p></dd>
  2316. <dt>&lsquo;<samp class="samp">14th</samp>&rsquo;</dt>
  2317. <dd><p>84 dB per octave.
  2318. </p></dd>
  2319. <dt>&lsquo;<samp class="samp">16th</samp>&rsquo;</dt>
  2320. <dd><p>96 dB per octave.
  2321. </p></dd>
  2322. <dt>&lsquo;<samp class="samp">18th</samp>&rsquo;</dt>
  2323. <dd><p>108 dB per octave.
  2324. </p></dd>
  2325. <dt>&lsquo;<samp class="samp">20th</samp>&rsquo;</dt>
  2326. <dd><p>120 dB per octave.
  2327. </p></dd>
  2328. </dl>
  2329. <p>Default is <var class="var">4th</var>.
  2330. </p>
  2331. </dd>
  2332. <dt><samp class="option">level</samp></dt>
  2333. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  2334. </p>
  2335. </dd>
  2336. <dt><samp class="option">gains</samp></dt>
  2337. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  2338. </p>
  2339. </dd>
  2340. <dt><samp class="option">precision</samp></dt>
  2341. <dd><p>Set which precision to use when processing samples.
  2342. </p>
  2343. <dl class="table">
  2344. <dt><samp class="option">auto</samp></dt>
  2345. <dd><p>Auto pick internal sample format depending on other filters.
  2346. </p>
  2347. </dd>
  2348. <dt><samp class="option">float</samp></dt>
  2349. <dd><p>Always use single-floating point precision sample format.
  2350. </p>
  2351. </dd>
  2352. <dt><samp class="option">double</samp></dt>
  2353. <dd><p>Always use double-floating point precision sample format.
  2354. </p></dd>
  2355. </dl>
  2356. <p>Default value is <code class="code">auto</code>.
  2357. </p></dd>
  2358. </dl>
  2359. <a name="Examples-1"></a>
  2360. <h4 class="subsection">8.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-1" aria-hidden="true">TOC</a></span></h4>
  2361. <ul class="itemize mark-bullet">
  2362. <li>Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  2363. each band will be in separate stream:
  2364. <div class="example">
  2365. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  2366. </pre></div>
  2367. </li><li>Same as above, but with higher filter order:
  2368. <div class="example">
  2369. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  2370. </pre></div>
  2371. </li><li>Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  2372. <div class="example">
  2373. <pre class="example-preformatted">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500 8000:order=8th[LOW][MID][HIGH]' -map '[LOW]' low.wav -map '[MID]' mid.wav -map '[HIGH]' high.wav
  2374. </pre></div>
  2375. </li></ul>
  2376. <a name="acrusher"></a>
  2377. <h3 class="section">8.7 acrusher<span class="pull-right"><a class="anchor hidden-xs" href="#acrusher" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acrusher" aria-hidden="true">TOC</a></span></h3>
  2378. <p>Reduce audio bit resolution.
  2379. </p>
  2380. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  2381. is used to audibly reduce number of bits an audio signal is sampled
  2382. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  2383. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  2384. This filter is able to even round to continuous values instead of discrete
  2385. bit depths.
  2386. Additionally it has a D/C offset which results in different crushing of
  2387. the lower and the upper half of the signal.
  2388. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  2389. </p>
  2390. <p>Another feature of this filter is the logarithmic mode.
  2391. This setting switches from linear distances between bits to logarithmic ones.
  2392. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  2393. signals for example. The human ear has a logarithmic perception,
  2394. so this kind of crushing is much more pleasant.
  2395. Logarithmic crushing is also able to get anti-aliased.
  2396. </p>
  2397. <p>The filter accepts the following options:
  2398. </p>
  2399. <dl class="table">
  2400. <dt><samp class="option">level_in</samp></dt>
  2401. <dd><p>Set level in.
  2402. </p>
  2403. </dd>
  2404. <dt><samp class="option">level_out</samp></dt>
  2405. <dd><p>Set level out.
  2406. </p>
  2407. </dd>
  2408. <dt><samp class="option">bits</samp></dt>
  2409. <dd><p>Set bit reduction.
  2410. </p>
  2411. </dd>
  2412. <dt><samp class="option">mix</samp></dt>
  2413. <dd><p>Set mixing amount.
  2414. </p>
  2415. </dd>
  2416. <dt><samp class="option">mode</samp></dt>
  2417. <dd><p>Can be linear: <code class="code">lin</code> or logarithmic: <code class="code">log</code>.
  2418. </p>
  2419. </dd>
  2420. <dt><samp class="option">dc</samp></dt>
  2421. <dd><p>Set DC.
  2422. </p>
  2423. </dd>
  2424. <dt><samp class="option">aa</samp></dt>
  2425. <dd><p>Set anti-aliasing.
  2426. </p>
  2427. </dd>
  2428. <dt><samp class="option">samples</samp></dt>
  2429. <dd><p>Set sample reduction.
  2430. </p>
  2431. </dd>
  2432. <dt><samp class="option">lfo</samp></dt>
  2433. <dd><p>Enable LFO. By default disabled.
  2434. </p>
  2435. </dd>
  2436. <dt><samp class="option">lforange</samp></dt>
  2437. <dd><p>Set LFO range.
  2438. </p>
  2439. </dd>
  2440. <dt><samp class="option">lforate</samp></dt>
  2441. <dd><p>Set LFO rate.
  2442. </p></dd>
  2443. </dl>
  2444. <a name="Commands-1"></a>
  2445. <h4 class="subsection">8.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-1" aria-hidden="true">TOC</a></span></h4>
  2446. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2447. </p>
  2448. <a name="acue"></a>
  2449. <h3 class="section">8.8 acue<span class="pull-right"><a class="anchor hidden-xs" href="#acue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-acue" aria-hidden="true">TOC</a></span></h3>
  2450. <p>Delay audio filtering until a given wallclock timestamp. See the <a class="ref" href="#cue">cue</a>
  2451. filter.
  2452. </p>
  2453. <a name="adeclick"></a>
  2454. <h3 class="section">8.9 adeclick<span class="pull-right"><a class="anchor hidden-xs" href="#adeclick" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclick" aria-hidden="true">TOC</a></span></h3>
  2455. <p>Remove impulsive noise from input audio.
  2456. </p>
  2457. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  2458. autoregressive modelling.
  2459. </p>
  2460. <dl class="table">
  2461. <dt><samp class="option">window, w</samp></dt>
  2462. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to
  2463. <code class="code">100</code>. Default value is <code class="code">55</code> milliseconds.
  2464. This sets size of window which will be processed at once.
  2465. </p>
  2466. </dd>
  2467. <dt><samp class="option">overlap, o</samp></dt>
  2468. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  2469. <code class="code">50</code> to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  2470. Setting this to a very high value increases impulsive noise removal but makes
  2471. whole process much slower.
  2472. </p>
  2473. </dd>
  2474. <dt><samp class="option">arorder, a</samp></dt>
  2475. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  2476. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">2</code> percent. This option also
  2477. controls quality of interpolated samples using neighbour good samples.
  2478. </p>
  2479. </dd>
  2480. <dt><samp class="option">threshold, t</samp></dt>
  2481. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  2482. Default value is <code class="code">2</code>.
  2483. This controls the strength of impulsive noise which is going to be removed.
  2484. The lower value, the more samples will be detected as impulsive noise.
  2485. </p>
  2486. </dd>
  2487. <dt><samp class="option">burst, b</samp></dt>
  2488. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code class="code">0</code> to
  2489. <code class="code">10</code>. Default value is <code class="code">2</code>.
  2490. If any two samples detected as noise are spaced less than this value then any
  2491. sample between those two samples will be also detected as noise.
  2492. </p>
  2493. </dd>
  2494. <dt><samp class="option">method, m</samp></dt>
  2495. <dd><p>Set overlap method.
  2496. </p>
  2497. <p>It accepts the following values:
  2498. </p><dl class="table">
  2499. <dt><samp class="option">add, a</samp></dt>
  2500. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  2501. changed with this method.
  2502. </p>
  2503. </dd>
  2504. <dt><samp class="option">save, s</samp></dt>
  2505. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  2506. </p></dd>
  2507. </dl>
  2508. <p>Default value is <code class="code">a</code>.
  2509. </p></dd>
  2510. </dl>
  2511. <a name="adeclip"></a>
  2512. <h3 class="section">8.10 adeclip<span class="pull-right"><a class="anchor hidden-xs" href="#adeclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adeclip" aria-hidden="true">TOC</a></span></h3>
  2513. <p>Remove clipped samples from input audio.
  2514. </p>
  2515. <p>Samples detected as clipped are replaced by interpolated samples using
  2516. autoregressive modelling.
  2517. </p>
  2518. <dl class="table">
  2519. <dt><samp class="option">window, w</samp></dt>
  2520. <dd><p>Set window size, in milliseconds. Allowed range is from <code class="code">10</code> to <code class="code">100</code>.
  2521. Default value is <code class="code">55</code> milliseconds.
  2522. This sets size of window which will be processed at once.
  2523. </p>
  2524. </dd>
  2525. <dt><samp class="option">overlap, o</samp></dt>
  2526. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code class="code">50</code>
  2527. to <code class="code">95</code>. Default value is <code class="code">75</code> percent.
  2528. </p>
  2529. </dd>
  2530. <dt><samp class="option">arorder, a</samp></dt>
  2531. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  2532. <code class="code">0</code> to <code class="code">25</code>. Default value is <code class="code">8</code> percent. This option also controls
  2533. quality of interpolated samples using neighbour good samples.
  2534. </p>
  2535. </dd>
  2536. <dt><samp class="option">threshold, t</samp></dt>
  2537. <dd><p>Set threshold value. Allowed range is from <code class="code">1</code> to <code class="code">100</code>.
  2538. Default value is <code class="code">10</code>. Higher values make clip detection less aggressive.
  2539. </p>
  2540. </dd>
  2541. <dt><samp class="option">hsize, n</samp></dt>
  2542. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code class="code">100</code> to <code class="code">9999</code>.
  2543. Default value is <code class="code">1000</code>. Higher values make clip detection less aggressive.
  2544. </p>
  2545. </dd>
  2546. <dt><samp class="option">method, m</samp></dt>
  2547. <dd><p>Set overlap method.
  2548. </p>
  2549. <p>It accepts the following values:
  2550. </p><dl class="table">
  2551. <dt><samp class="option">add, a</samp></dt>
  2552. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  2553. with this method.
  2554. </p>
  2555. </dd>
  2556. <dt><samp class="option">save, s</samp></dt>
  2557. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  2558. </p></dd>
  2559. </dl>
  2560. <p>Default value is <code class="code">a</code>.
  2561. </p></dd>
  2562. </dl>
  2563. <a name="adecorrelate"></a>
  2564. <h3 class="section">8.11 adecorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#adecorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adecorrelate" aria-hidden="true">TOC</a></span></h3>
  2565. <p>Apply decorrelation to input audio stream.
  2566. </p>
  2567. <p>The filter accepts the following options:
  2568. </p>
  2569. <dl class="table">
  2570. <dt><samp class="option">stages</samp></dt>
  2571. <dd><p>Set decorrelation stages of filtering. Allowed
  2572. range is from 1 to 16. Default value is 6.
  2573. </p>
  2574. </dd>
  2575. <dt><samp class="option">seed</samp></dt>
  2576. <dd><p>Set random seed used for setting delay in samples across channels.
  2577. </p></dd>
  2578. </dl>
  2579. <a name="adelay"></a>
  2580. <h3 class="section">8.12 adelay<span class="pull-right"><a class="anchor hidden-xs" href="#adelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adelay" aria-hidden="true">TOC</a></span></h3>
  2581. <p>Delay one or more audio channels.
  2582. </p>
  2583. <p>Samples in delayed channel are filled with silence.
  2584. </p>
  2585. <p>The filter accepts the following option:
  2586. </p>
  2587. <dl class="table">
  2588. <dt><samp class="option">delays</samp></dt>
  2589. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  2590. Unused delays will be silently ignored. If number of given delays is
  2591. smaller than number of channels all remaining channels will not be delayed.
  2592. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  2593. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  2594. </p>
  2595. </dd>
  2596. <dt><samp class="option">all</samp></dt>
  2597. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  2598. This option if enabled changes how option <code class="code">delays</code> is interpreted.
  2599. </p></dd>
  2600. </dl>
  2601. <a name="Examples-2"></a>
  2602. <h4 class="subsection">8.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-2" aria-hidden="true">TOC</a></span></h4>
  2603. <ul class="itemize mark-bullet">
  2604. <li>Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  2605. the second channel (and any other channels that may be present) unchanged.
  2606. <div class="example">
  2607. <pre class="example-preformatted">adelay=1500|0|500
  2608. </pre></div>
  2609. </li><li>Delay second channel by 500 samples, the third channel by 700 samples and leave
  2610. the first channel (and any other channels that may be present) unchanged.
  2611. <div class="example">
  2612. <pre class="example-preformatted">adelay=0|500S|700S
  2613. </pre></div>
  2614. </li><li>Delay all channels by same number of samples:
  2615. <div class="example">
  2616. <pre class="example-preformatted">adelay=delays=64S:all=1
  2617. </pre></div>
  2618. </li></ul>
  2619. <a name="adenorm"></a>
  2620. <h3 class="section">8.13 adenorm<span class="pull-right"><a class="anchor hidden-xs" href="#adenorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adenorm" aria-hidden="true">TOC</a></span></h3>
  2621. <p>Remedy denormals in audio by adding extremely low-level noise.
  2622. </p>
  2623. <p>This filter shall be placed before any filter that can produce denormals.
  2624. </p>
  2625. <p>A description of the accepted parameters follows.
  2626. </p>
  2627. <dl class="table">
  2628. <dt><samp class="option">level</samp></dt>
  2629. <dd><p>Set level of added noise in dB. Default is <code class="code">-351</code>.
  2630. Allowed range is from -451 to -90.
  2631. </p>
  2632. </dd>
  2633. <dt><samp class="option">type</samp></dt>
  2634. <dd><p>Set type of added noise.
  2635. </p>
  2636. <dl class="table">
  2637. <dt><samp class="option">dc</samp></dt>
  2638. <dd><p>Add DC signal.
  2639. </p></dd>
  2640. <dt><samp class="option">ac</samp></dt>
  2641. <dd><p>Add AC signal.
  2642. </p></dd>
  2643. <dt><samp class="option">square</samp></dt>
  2644. <dd><p>Add square signal.
  2645. </p></dd>
  2646. <dt><samp class="option">pulse</samp></dt>
  2647. <dd><p>Add pulse signal.
  2648. </p></dd>
  2649. </dl>
  2650. <p>Default is <code class="code">dc</code>.
  2651. </p></dd>
  2652. </dl>
  2653. <a name="Commands-2"></a>
  2654. <h4 class="subsection">8.13.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-2" aria-hidden="true">TOC</a></span></h4>
  2655. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2656. </p>
  2657. <a name="aderivative_002c-aintegral"></a>
  2658. <h3 class="section">8.14 aderivative, aintegral<span class="pull-right"><a class="anchor hidden-xs" href="#aderivative_002c-aintegral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aderivative_002c-aintegral" aria-hidden="true">TOC</a></span></h3>
  2659. <p>Compute derivative/integral of audio stream.
  2660. </p>
  2661. <p>Applying both filters one after another produces original audio.
  2662. </p>
  2663. <a name="adrc"></a>
  2664. <h3 class="section">8.15 adrc<span class="pull-right"><a class="anchor hidden-xs" href="#adrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrc" aria-hidden="true">TOC</a></span></h3>
  2665. <p>Apply spectral dynamic range controller filter to input audio stream.
  2666. </p>
  2667. <p>A description of the accepted options follows.
  2668. </p>
  2669. <dl class="table">
  2670. <dt><samp class="option">transfer</samp></dt>
  2671. <dd><p>Set the transfer expression.
  2672. </p>
  2673. <p>The expression can contain the following constants:
  2674. </p>
  2675. <dl class="table">
  2676. <dt><samp class="option">ch</samp></dt>
  2677. <dd><p>current channel number
  2678. </p>
  2679. </dd>
  2680. <dt><samp class="option">sn</samp></dt>
  2681. <dd><p>current sample number
  2682. </p>
  2683. </dd>
  2684. <dt><samp class="option">nb_channels</samp></dt>
  2685. <dd><p>number of channels
  2686. </p>
  2687. </dd>
  2688. <dt><samp class="option">t</samp></dt>
  2689. <dd><p>timestamp expressed in seconds
  2690. </p>
  2691. </dd>
  2692. <dt><samp class="option">sr</samp></dt>
  2693. <dd><p>sample rate
  2694. </p>
  2695. </dd>
  2696. <dt><samp class="option">p</samp></dt>
  2697. <dd><p>current frequency power value, in dB
  2698. </p>
  2699. </dd>
  2700. <dt><samp class="option">f</samp></dt>
  2701. <dd><p>current frequency in Hz
  2702. </p></dd>
  2703. </dl>
  2704. <p>Default value is <code class="code">p</code>.
  2705. </p>
  2706. </dd>
  2707. <dt><samp class="option">attack</samp></dt>
  2708. <dd><p>Set the attack in milliseconds. Default is <code class="code">50</code> milliseconds.
  2709. Allowed range is from 1 to 1000 milliseconds.
  2710. </p></dd>
  2711. <dt><samp class="option">release</samp></dt>
  2712. <dd><p>Set the release in milliseconds. Default is <code class="code">100</code> milliseconds.
  2713. Allowed range is from 5 to 2000 milliseconds.
  2714. </p></dd>
  2715. <dt><samp class="option">channels</samp></dt>
  2716. <dd><p>Set which channels to filter, by default <code class="code">all</code> channels in audio stream are filtered.
  2717. </p></dd>
  2718. </dl>
  2719. <a name="Commands-3"></a>
  2720. <h4 class="subsection">8.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-3" aria-hidden="true">TOC</a></span></h4>
  2721. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2722. </p>
  2723. <a name="Examples-3"></a>
  2724. <h4 class="subsection">8.15.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-3" aria-hidden="true">TOC</a></span></h4>
  2725. <ul class="itemize mark-bullet">
  2726. <li>Apply spectral compression to all frequencies with threshold of -50 dB and 1:6 ratio:
  2727. <div class="example">
  2728. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/6,p)':attack=50:release=100
  2729. </pre></div>
  2730. </li><li>Similar to above but with 1:2 ratio and filtering only front center channel:
  2731. <div class="example">
  2732. <pre class="example-preformatted">adrc=transfer='if(gt(p,-50),-50+(p-(-50))/2,p)':attack=50:release=100:channels=FC
  2733. </pre></div>
  2734. </li><li>Apply spectral noise gate to all frequencies with threshold of -85 dB and with short attack time and short release time:
  2735. <div class="example">
  2736. <pre class="example-preformatted">adrc=transfer='if(lte(p,-85),p-800,p)':attack=1:release=5
  2737. </pre></div>
  2738. </li><li>Apply spectral expansion to all frequencies with threshold of -10 dB and 1:2 ratio:
  2739. <div class="example">
  2740. <pre class="example-preformatted">adrc=transfer='if(lt(p,-10),-10+(p-(-10))*2,p)':attack=50:release=100
  2741. </pre></div>
  2742. </li><li>Apply limiter to max -60 dB to all frequencies, with attack of 2 ms and release of 10 ms:
  2743. <div class="example">
  2744. <pre class="example-preformatted">adrc=transfer='min(p,-60)':attack=2:release=10
  2745. </pre></div>
  2746. </li></ul>
  2747. <a name="adynamicequalizer"></a>
  2748. <h3 class="section">8.16 adynamicequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicequalizer" aria-hidden="true">TOC</a></span></h3>
  2749. <p>Apply dynamic equalization to input audio stream.
  2750. </p>
  2751. <p>A description of the accepted options follows.
  2752. </p>
  2753. <dl class="table">
  2754. <dt><samp class="option">threshold</samp></dt>
  2755. <dd><p>Set the detection threshold used to trigger equalization.
  2756. Threshold detection is using detection filter.
  2757. Default value is 0. Allowed range is from 0 to 100.
  2758. </p>
  2759. </dd>
  2760. <dt><samp class="option">dfrequency</samp></dt>
  2761. <dd><p>Set the detection frequency in Hz used for detection filter used to trigger equalization.
  2762. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  2763. </p>
  2764. </dd>
  2765. <dt><samp class="option">dqfactor</samp></dt>
  2766. <dd><p>Set the detection resonance factor for detection filter used to trigger equalization.
  2767. Default value is 1. Allowed range is from 0.001 to 1000.
  2768. </p>
  2769. </dd>
  2770. <dt><samp class="option">tfrequency</samp></dt>
  2771. <dd><p>Set the target frequency of equalization filter.
  2772. Default value is 1000 Hz. Allowed range is between 2 and 1000000 Hz.
  2773. </p>
  2774. </dd>
  2775. <dt><samp class="option">tqfactor</samp></dt>
  2776. <dd><p>Set the target resonance factor for target equalization filter.
  2777. Default value is 1. Allowed range is from 0.001 to 1000.
  2778. </p>
  2779. </dd>
  2780. <dt><samp class="option">attack</samp></dt>
  2781. <dd><p>Set the amount of milliseconds the signal from detection has to rise above
  2782. the detection threshold before equalization starts.
  2783. Default is 20. Allowed range is between 1 and 2000.
  2784. </p>
  2785. </dd>
  2786. <dt><samp class="option">release</samp></dt>
  2787. <dd><p>Set the amount of milliseconds the signal from detection has to fall below the
  2788. detection threshold before equalization ends.
  2789. Default is 200. Allowed range is between 1 and 2000.
  2790. </p>
  2791. </dd>
  2792. <dt><samp class="option">ratio</samp></dt>
  2793. <dd><p>Set the ratio by which the equalization gain is raised.
  2794. Default is 1. Allowed range is between 0 and 30.
  2795. </p>
  2796. </dd>
  2797. <dt><samp class="option">makeup</samp></dt>
  2798. <dd><p>Set the makeup offset by which the equalization gain is raised.
  2799. Default is 0. Allowed range is between 0 and 100.
  2800. </p>
  2801. </dd>
  2802. <dt><samp class="option">range</samp></dt>
  2803. <dd><p>Set the max allowed cut/boost amount. Default is 50.
  2804. Allowed range is from 1 to 200.
  2805. </p>
  2806. </dd>
  2807. <dt><samp class="option">mode</samp></dt>
  2808. <dd><p>Set the mode of filter operation, can be one of the following:
  2809. </p>
  2810. <dl class="table">
  2811. <dt>&lsquo;<samp class="samp">listen</samp>&rsquo;</dt>
  2812. <dd><p>Output only isolated detection signal.
  2813. </p></dd>
  2814. <dt>&lsquo;<samp class="samp">cutbelow</samp>&rsquo;</dt>
  2815. <dd><p>Cut frequencies below detection threshold.
  2816. </p></dd>
  2817. <dt>&lsquo;<samp class="samp">cutabove</samp>&rsquo;</dt>
  2818. <dd><p>Cut frequencies above detection threshold.
  2819. </p></dd>
  2820. <dt>&lsquo;<samp class="samp">boostbelow</samp>&rsquo;</dt>
  2821. <dd><p>Boost frequencies below detection threshold.
  2822. </p></dd>
  2823. <dt>&lsquo;<samp class="samp">boostabove</samp>&rsquo;</dt>
  2824. <dd><p>Boost frequencies above detection threshold.
  2825. </p></dd>
  2826. </dl>
  2827. <p>Default mode is &lsquo;<samp class="samp">cutbelow</samp>&rsquo;.
  2828. </p>
  2829. </dd>
  2830. <dt><samp class="option">dftype</samp></dt>
  2831. <dd><p>Set the type of detection filter, can be one of the following:
  2832. </p>
  2833. <dl class="table">
  2834. <dt>&lsquo;<samp class="samp">bandpass</samp>&rsquo;</dt>
  2835. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  2836. <dt>&lsquo;<samp class="samp">highpass</samp>&rsquo;</dt>
  2837. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  2838. </dl>
  2839. <p>Default type is &lsquo;<samp class="samp">bandpass</samp>&rsquo;.
  2840. </p>
  2841. </dd>
  2842. <dt><samp class="option">tftype</samp></dt>
  2843. <dd><p>Set the type of target filter, can be one of the following:
  2844. </p>
  2845. <dl class="table">
  2846. <dt>&lsquo;<samp class="samp">bell</samp>&rsquo;</dt>
  2847. <dt>&lsquo;<samp class="samp">lowshelf</samp>&rsquo;</dt>
  2848. <dt>&lsquo;<samp class="samp">highshelf</samp>&rsquo;</dt>
  2849. </dl>
  2850. <p>Default type is &lsquo;<samp class="samp">bell</samp>&rsquo;.
  2851. </p>
  2852. </dd>
  2853. <dt><samp class="option">auto</samp></dt>
  2854. <dd><p>Automatically gather threshold from detection filter. By default
  2855. is &lsquo;<samp class="samp">disabled</samp>&rsquo;.
  2856. This option is useful to detect threshold in certain time frame of
  2857. input audio stream, in such case option value is changed at runtime.
  2858. </p>
  2859. <p>Available values are:
  2860. </p><dl class="table">
  2861. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  2862. <dd><p>Disable using automatically gathered threshold value.
  2863. </p></dd>
  2864. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  2865. <dd><p>Stop picking threshold value.
  2866. </p></dd>
  2867. <dt>&lsquo;<samp class="samp">on</samp>&rsquo;</dt>
  2868. <dd><p>Start picking threshold value.
  2869. </p></dd>
  2870. <dt>&lsquo;<samp class="samp">adaptive</samp>&rsquo;</dt>
  2871. <dd><p>Adaptively pick threshold value, by calculating sliding window entropy.
  2872. </p></dd>
  2873. </dl>
  2874. </dd>
  2875. <dt><samp class="option">precision</samp></dt>
  2876. <dd><p>Set which precision to use when processing samples.
  2877. </p>
  2878. <dl class="table">
  2879. <dt><samp class="option">auto</samp></dt>
  2880. <dd><p>Auto pick internal sample format depending on other filters.
  2881. </p>
  2882. </dd>
  2883. <dt><samp class="option">float</samp></dt>
  2884. <dd><p>Always use single-floating point precision sample format.
  2885. </p>
  2886. </dd>
  2887. <dt><samp class="option">double</samp></dt>
  2888. <dd><p>Always use double-floating point precision sample format.
  2889. </p></dd>
  2890. </dl>
  2891. </dd>
  2892. </dl>
  2893. <a name="Commands-4"></a>
  2894. <h4 class="subsection">8.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-4" aria-hidden="true">TOC</a></span></h4>
  2895. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2896. </p>
  2897. <a name="adynamicsmooth"></a>
  2898. <h3 class="section">8.17 adynamicsmooth<span class="pull-right"><a class="anchor hidden-xs" href="#adynamicsmooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adynamicsmooth" aria-hidden="true">TOC</a></span></h3>
  2899. <p>Apply dynamic smoothing to input audio stream.
  2900. </p>
  2901. <p>A description of the accepted options follows.
  2902. </p>
  2903. <dl class="table">
  2904. <dt><samp class="option">sensitivity</samp></dt>
  2905. <dd><p>Set an amount of sensitivity to frequency fluctations. Default is 2.
  2906. Allowed range is from 0 to 1e+06.
  2907. </p>
  2908. </dd>
  2909. <dt><samp class="option">basefreq</samp></dt>
  2910. <dd><p>Set a base frequency for smoothing. Default value is 22050.
  2911. Allowed range is from 2 to 1e+06.
  2912. </p></dd>
  2913. </dl>
  2914. <a name="Commands-5"></a>
  2915. <h4 class="subsection">8.17.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-5" aria-hidden="true">TOC</a></span></h4>
  2916. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  2917. </p>
  2918. <a name="aecho"></a>
  2919. <h3 class="section">8.18 aecho<span class="pull-right"><a class="anchor hidden-xs" href="#aecho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aecho" aria-hidden="true">TOC</a></span></h3>
  2920. <p>Apply echoing to the input audio.
  2921. </p>
  2922. <p>Echoes are reflected sound and can occur naturally amongst mountains
  2923. (and sometimes large buildings) when talking or shouting; digital echo
  2924. effects emulate this behaviour and are often used to help fill out the
  2925. sound of a single instrument or vocal. The time difference between the
  2926. original signal and the reflection is the <code class="code">delay</code>, and the
  2927. loudness of the reflected signal is the <code class="code">decay</code>.
  2928. Multiple echoes can have different delays and decays.
  2929. </p>
  2930. <p>A description of the accepted parameters follows.
  2931. </p>
  2932. <dl class="table">
  2933. <dt><samp class="option">in_gain</samp></dt>
  2934. <dd><p>Set input gain of reflected signal. Default is <code class="code">0.6</code>.
  2935. </p>
  2936. </dd>
  2937. <dt><samp class="option">out_gain</samp></dt>
  2938. <dd><p>Set output gain of reflected signal. Default is <code class="code">0.3</code>.
  2939. </p>
  2940. </dd>
  2941. <dt><samp class="option">delays</samp></dt>
  2942. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  2943. separated by &rsquo;|&rsquo;. Allowed range for each <code class="code">delay</code> is <code class="code">(0 - 90000.0]</code>.
  2944. Default is <code class="code">1000</code>.
  2945. </p>
  2946. </dd>
  2947. <dt><samp class="option">decays</samp></dt>
  2948. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  2949. Allowed range for each <code class="code">decay</code> is <code class="code">(0 - 1.0]</code>.
  2950. Default is <code class="code">0.5</code>.
  2951. </p></dd>
  2952. </dl>
  2953. <a name="Examples-4"></a>
  2954. <h4 class="subsection">8.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-4" aria-hidden="true">TOC</a></span></h4>
  2955. <ul class="itemize mark-bullet">
  2956. <li>Make it sound as if there are twice as many instruments as are actually playing:
  2957. <div class="example">
  2958. <pre class="example-preformatted">aecho=0.8:0.88:60:0.4
  2959. </pre></div>
  2960. </li><li>If delay is very short, then it sounds like a (metallic) robot playing music:
  2961. <div class="example">
  2962. <pre class="example-preformatted">aecho=0.8:0.88:6:0.4
  2963. </pre></div>
  2964. </li><li>A longer delay will sound like an open air concert in the mountains:
  2965. <div class="example">
  2966. <pre class="example-preformatted">aecho=0.8:0.9:1000:0.3
  2967. </pre></div>
  2968. </li><li>Same as above but with one more mountain:
  2969. <div class="example">
  2970. <pre class="example-preformatted">aecho=0.8:0.9:1000|1800:0.3|0.25
  2971. </pre></div>
  2972. </li></ul>
  2973. <a name="aemphasis"></a>
  2974. <h3 class="section">8.19 aemphasis<span class="pull-right"><a class="anchor hidden-xs" href="#aemphasis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aemphasis" aria-hidden="true">TOC</a></span></h3>
  2975. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  2976. emphased CDs with different filter curves. E.g. to store music on vinyl the
  2977. signal has to be altered by a filter first to even out the disadvantages of
  2978. this recording medium.
  2979. Once the material is played back the inverse filter has to be applied to
  2980. restore the distortion of the frequency response.
  2981. </p>
  2982. <p>The filter accepts the following options:
  2983. </p>
  2984. <dl class="table">
  2985. <dt><samp class="option">level_in</samp></dt>
  2986. <dd><p>Set input gain.
  2987. </p>
  2988. </dd>
  2989. <dt><samp class="option">level_out</samp></dt>
  2990. <dd><p>Set output gain.
  2991. </p>
  2992. </dd>
  2993. <dt><samp class="option">mode</samp></dt>
  2994. <dd><p>Set filter mode. For restoring material use <code class="code">reproduction</code> mode, otherwise
  2995. use <code class="code">production</code> mode. Default is <code class="code">reproduction</code> mode.
  2996. </p>
  2997. </dd>
  2998. <dt><samp class="option">type</samp></dt>
  2999. <dd><p>Set filter type. Selects medium. Can be one of the following:
  3000. </p>
  3001. <dl class="table">
  3002. <dt><samp class="option">col</samp></dt>
  3003. <dd><p>select Columbia.
  3004. </p></dd>
  3005. <dt><samp class="option">emi</samp></dt>
  3006. <dd><p>select EMI.
  3007. </p></dd>
  3008. <dt><samp class="option">bsi</samp></dt>
  3009. <dd><p>select BSI (78RPM).
  3010. </p></dd>
  3011. <dt><samp class="option">riaa</samp></dt>
  3012. <dd><p>select RIAA.
  3013. </p></dd>
  3014. <dt><samp class="option">cd</samp></dt>
  3015. <dd><p>select Compact Disc (CD).
  3016. </p></dd>
  3017. <dt><samp class="option">50fm</samp></dt>
  3018. <dd><p>select 50µs (FM).
  3019. </p></dd>
  3020. <dt><samp class="option">75fm</samp></dt>
  3021. <dd><p>select 75µs (FM).
  3022. </p></dd>
  3023. <dt><samp class="option">50kf</samp></dt>
  3024. <dd><p>select 50µs (FM-KF).
  3025. </p></dd>
  3026. <dt><samp class="option">75kf</samp></dt>
  3027. <dd><p>select 75µs (FM-KF).
  3028. </p></dd>
  3029. </dl>
  3030. </dd>
  3031. </dl>
  3032. <a name="Commands-6"></a>
  3033. <h4 class="subsection">8.19.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-6" aria-hidden="true">TOC</a></span></h4>
  3034. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3035. </p>
  3036. <a name="aeval"></a>
  3037. <h3 class="section">8.20 aeval<span class="pull-right"><a class="anchor hidden-xs" href="#aeval" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aeval" aria-hidden="true">TOC</a></span></h3>
  3038. <p>Modify an audio signal according to the specified expressions.
  3039. </p>
  3040. <p>This filter accepts one or more expressions (one for each channel),
  3041. which are evaluated and used to modify a corresponding audio signal.
  3042. </p>
  3043. <p>It accepts the following parameters:
  3044. </p>
  3045. <dl class="table">
  3046. <dt><samp class="option">exprs</samp></dt>
  3047. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  3048. the number of input channels is greater than the number of
  3049. expressions, the last specified expression is used for the remaining
  3050. output channels.
  3051. </p>
  3052. </dd>
  3053. <dt><samp class="option">channel_layout, c</samp></dt>
  3054. <dd><p>Set output channel layout. If not specified, the channel layout is
  3055. specified by the number of expressions. If set to &lsquo;<samp class="samp">same</samp>&rsquo;, it will
  3056. use by default the same input channel layout.
  3057. </p></dd>
  3058. </dl>
  3059. <p>Each expression in <var class="var">exprs</var> can contain the following constants and functions:
  3060. </p>
  3061. <dl class="table">
  3062. <dt><samp class="option">ch</samp></dt>
  3063. <dd><p>channel number of the current expression
  3064. </p>
  3065. </dd>
  3066. <dt><samp class="option">n</samp></dt>
  3067. <dd><p>number of the evaluated sample, starting from 0
  3068. </p>
  3069. </dd>
  3070. <dt><samp class="option">s</samp></dt>
  3071. <dd><p>sample rate
  3072. </p>
  3073. </dd>
  3074. <dt><samp class="option">t</samp></dt>
  3075. <dd><p>time of the evaluated sample expressed in seconds
  3076. </p>
  3077. </dd>
  3078. <dt><samp class="option">nb_in_channels</samp></dt>
  3079. <dt><samp class="option">nb_out_channels</samp></dt>
  3080. <dd><p>input and output number of channels
  3081. </p>
  3082. </dd>
  3083. <dt><samp class="option">val(CH)</samp></dt>
  3084. <dd><p>the value of input channel with number <var class="var">CH</var>
  3085. </p></dd>
  3086. </dl>
  3087. <p>Note: this filter is slow. For faster processing you should use a
  3088. dedicated filter.
  3089. </p>
  3090. <a name="Examples-5"></a>
  3091. <h4 class="subsection">8.20.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-5" aria-hidden="true">TOC</a></span></h4>
  3092. <ul class="itemize mark-bullet">
  3093. <li>Half volume:
  3094. <div class="example">
  3095. <pre class="example-preformatted">aeval=val(ch)/2:c=same
  3096. </pre></div>
  3097. </li><li>Invert phase of the second channel:
  3098. <div class="example">
  3099. <pre class="example-preformatted">aeval=val(0)|-val(1)
  3100. </pre></div>
  3101. </li></ul>
  3102. <a name="aexciter"></a>
  3103. <h3 class="section">8.21 aexciter<span class="pull-right"><a class="anchor hidden-xs" href="#aexciter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aexciter" aria-hidden="true">TOC</a></span></h3>
  3104. <p>An exciter is used to produce high sound that is not present in the
  3105. original signal. This is done by creating harmonic distortions of the
  3106. signal which are restricted in range and added to the original signal.
  3107. An Exciter raises the upper end of an audio signal without simply raising
  3108. the higher frequencies like an equalizer would do to create a more
  3109. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  3110. </p>
  3111. <p>The filter accepts the following options:
  3112. </p>
  3113. <dl class="table">
  3114. <dt><samp class="option">level_in</samp></dt>
  3115. <dd><p>Set input level prior processing of signal.
  3116. Allowed range is from 0 to 64.
  3117. Default value is 1.
  3118. </p>
  3119. </dd>
  3120. <dt><samp class="option">level_out</samp></dt>
  3121. <dd><p>Set output level after processing of signal.
  3122. Allowed range is from 0 to 64.
  3123. Default value is 1.
  3124. </p>
  3125. </dd>
  3126. <dt><samp class="option">amount</samp></dt>
  3127. <dd><p>Set the amount of harmonics added to original signal.
  3128. Allowed range is from 0 to 64.
  3129. Default value is 1.
  3130. </p>
  3131. </dd>
  3132. <dt><samp class="option">drive</samp></dt>
  3133. <dd><p>Set the amount of newly created harmonics.
  3134. Allowed range is from 0.1 to 10.
  3135. Default value is 8.5.
  3136. </p>
  3137. </dd>
  3138. <dt><samp class="option">blend</samp></dt>
  3139. <dd><p>Set the octave of newly created harmonics.
  3140. Allowed range is from -10 to 10.
  3141. Default value is 0.
  3142. </p>
  3143. </dd>
  3144. <dt><samp class="option">freq</samp></dt>
  3145. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  3146. Allowed range is from 2000 to 12000 Hz.
  3147. Default is 7500 Hz.
  3148. </p>
  3149. </dd>
  3150. <dt><samp class="option">ceil</samp></dt>
  3151. <dd><p>Set the upper frequency limit of producing harmonics.
  3152. Allowed range is from 9999 to 20000 Hz.
  3153. If value is lower than 10000 Hz no limit is applied.
  3154. </p>
  3155. </dd>
  3156. <dt><samp class="option">listen</samp></dt>
  3157. <dd><p>Mute the original signal and output only added harmonics.
  3158. By default is disabled.
  3159. </p></dd>
  3160. </dl>
  3161. <a name="Commands-7"></a>
  3162. <h4 class="subsection">8.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-7" aria-hidden="true">TOC</a></span></h4>
  3163. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3164. </p>
  3165. <a class="anchor" id="afade"></a><a name="afade-1"></a>
  3166. <h3 class="section">8.22 afade<span class="pull-right"><a class="anchor hidden-xs" href="#afade-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afade-1" aria-hidden="true">TOC</a></span></h3>
  3167. <p>Apply fade-in/out effect to input audio.
  3168. </p>
  3169. <p>A description of the accepted parameters follows.
  3170. </p>
  3171. <dl class="table">
  3172. <dt><samp class="option">type, t</samp></dt>
  3173. <dd><p>Specify the effect type, can be either <code class="code">in</code> for fade-in, or
  3174. <code class="code">out</code> for a fade-out effect. Default is <code class="code">in</code>.
  3175. </p>
  3176. </dd>
  3177. <dt><samp class="option">start_sample, ss</samp></dt>
  3178. <dd><p>Specify the number of the start sample for starting to apply the fade
  3179. effect. Default is 0.
  3180. </p>
  3181. </dd>
  3182. <dt><samp class="option">nb_samples, ns</samp></dt>
  3183. <dd><p>Specify the number of samples for which the fade effect has to last. At
  3184. the end of the fade-in effect the output audio will have the same
  3185. volume as the input audio, at the end of the fade-out transition
  3186. the output audio will be silence. Default is 44100.
  3187. </p>
  3188. </dd>
  3189. <dt><samp class="option">start_time, st</samp></dt>
  3190. <dd><p>Specify the start time of the fade effect. Default is 0.
  3191. The value must be specified as a time duration; see
  3192. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  3193. for the accepted syntax.
  3194. If set this option is used instead of <var class="var">start_sample</var>.
  3195. </p>
  3196. </dd>
  3197. <dt><samp class="option">duration, d</samp></dt>
  3198. <dd><p>Specify the duration of the fade effect. See
  3199. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  3200. for the accepted syntax.
  3201. At the end of the fade-in effect the output audio will have the same
  3202. volume as the input audio, at the end of the fade-out transition
  3203. the output audio will be silence.
  3204. By default the duration is determined by <var class="var">nb_samples</var>.
  3205. If set this option is used instead of <var class="var">nb_samples</var>.
  3206. </p>
  3207. </dd>
  3208. <dt><samp class="option">curve</samp></dt>
  3209. <dd><p>Set curve for fade transition.
  3210. </p>
  3211. <p>It accepts the following values:
  3212. </p><dl class="table">
  3213. <dt><samp class="option">tri</samp></dt>
  3214. <dd><p>select triangular, linear slope (default)
  3215. </p></dd>
  3216. <dt><samp class="option">qsin</samp></dt>
  3217. <dd><p>select quarter of sine wave
  3218. </p></dd>
  3219. <dt><samp class="option">hsin</samp></dt>
  3220. <dd><p>select half of sine wave
  3221. </p></dd>
  3222. <dt><samp class="option">esin</samp></dt>
  3223. <dd><p>select exponential sine wave
  3224. </p></dd>
  3225. <dt><samp class="option">log</samp></dt>
  3226. <dd><p>select logarithmic
  3227. </p></dd>
  3228. <dt><samp class="option">ipar</samp></dt>
  3229. <dd><p>select inverted parabola
  3230. </p></dd>
  3231. <dt><samp class="option">qua</samp></dt>
  3232. <dd><p>select quadratic
  3233. </p></dd>
  3234. <dt><samp class="option">cub</samp></dt>
  3235. <dd><p>select cubic
  3236. </p></dd>
  3237. <dt><samp class="option">squ</samp></dt>
  3238. <dd><p>select square root
  3239. </p></dd>
  3240. <dt><samp class="option">cbr</samp></dt>
  3241. <dd><p>select cubic root
  3242. </p></dd>
  3243. <dt><samp class="option">par</samp></dt>
  3244. <dd><p>select parabola
  3245. </p></dd>
  3246. <dt><samp class="option">exp</samp></dt>
  3247. <dd><p>select exponential
  3248. </p></dd>
  3249. <dt><samp class="option">iqsin</samp></dt>
  3250. <dd><p>select inverted quarter of sine wave
  3251. </p></dd>
  3252. <dt><samp class="option">ihsin</samp></dt>
  3253. <dd><p>select inverted half of sine wave
  3254. </p></dd>
  3255. <dt><samp class="option">dese</samp></dt>
  3256. <dd><p>select double-exponential seat
  3257. </p></dd>
  3258. <dt><samp class="option">desi</samp></dt>
  3259. <dd><p>select double-exponential sigmoid
  3260. </p></dd>
  3261. <dt><samp class="option">losi</samp></dt>
  3262. <dd><p>select logistic sigmoid
  3263. </p></dd>
  3264. <dt><samp class="option">sinc</samp></dt>
  3265. <dd><p>select sine cardinal function
  3266. </p></dd>
  3267. <dt><samp class="option">isinc</samp></dt>
  3268. <dd><p>select inverted sine cardinal function
  3269. </p></dd>
  3270. <dt><samp class="option">quat</samp></dt>
  3271. <dd><p>select quartic
  3272. </p></dd>
  3273. <dt><samp class="option">quatr</samp></dt>
  3274. <dd><p>select quartic root
  3275. </p></dd>
  3276. <dt><samp class="option">qsin2</samp></dt>
  3277. <dd><p>select squared quarter of sine wave
  3278. </p></dd>
  3279. <dt><samp class="option">hsin2</samp></dt>
  3280. <dd><p>select squared half of sine wave
  3281. </p></dd>
  3282. <dt><samp class="option">nofade</samp></dt>
  3283. <dd><p>no fade applied
  3284. </p></dd>
  3285. </dl>
  3286. </dd>
  3287. <dt><samp class="option">silence</samp></dt>
  3288. <dd><p>Set the initial gain for fade-in or final gain for fade-out.
  3289. Default value is <code class="code">0.0</code>.
  3290. </p>
  3291. </dd>
  3292. <dt><samp class="option">unity</samp></dt>
  3293. <dd><p>Set the initial gain for fade-out or final gain for fade-in.
  3294. Default value is <code class="code">1.0</code>.
  3295. </p></dd>
  3296. </dl>
  3297. <a name="Commands-8"></a>
  3298. <h4 class="subsection">8.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-8" aria-hidden="true">TOC</a></span></h4>
  3299. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3300. </p>
  3301. <a name="Examples-6"></a>
  3302. <h4 class="subsection">8.22.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-6" aria-hidden="true">TOC</a></span></h4>
  3303. <ul class="itemize mark-bullet">
  3304. <li>Fade in first 15 seconds of audio:
  3305. <div class="example">
  3306. <pre class="example-preformatted">afade=t=in:ss=0:d=15
  3307. </pre></div>
  3308. </li><li>Fade out last 25 seconds of a 900 seconds audio:
  3309. <div class="example">
  3310. <pre class="example-preformatted">afade=t=out:st=875:d=25
  3311. </pre></div>
  3312. </li></ul>
  3313. <a name="afftdn"></a>
  3314. <h3 class="section">8.23 afftdn<span class="pull-right"><a class="anchor hidden-xs" href="#afftdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftdn" aria-hidden="true">TOC</a></span></h3>
  3315. <p>Denoise audio samples with FFT.
  3316. </p>
  3317. <p>A description of the accepted parameters follows.
  3318. </p>
  3319. <dl class="table">
  3320. <dt><samp class="option">noise_reduction, nr</samp></dt>
  3321. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  3322. Default value is 12 dB.
  3323. </p>
  3324. </dd>
  3325. <dt><samp class="option">noise_floor, nf</samp></dt>
  3326. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  3327. Default value is -50 dB.
  3328. </p>
  3329. </dd>
  3330. <dt><samp class="option">noise_type, nt</samp></dt>
  3331. <dd><p>Set the noise type.
  3332. </p>
  3333. <p>It accepts the following values:
  3334. </p><dl class="table">
  3335. <dt><samp class="option">white, w</samp></dt>
  3336. <dd><p>Select white noise.
  3337. </p>
  3338. </dd>
  3339. <dt><samp class="option">vinyl, v</samp></dt>
  3340. <dd><p>Select vinyl noise.
  3341. </p>
  3342. </dd>
  3343. <dt><samp class="option">shellac, s</samp></dt>
  3344. <dd><p>Select shellac noise.
  3345. </p>
  3346. </dd>
  3347. <dt><samp class="option">custom, c</samp></dt>
  3348. <dd><p>Select custom noise, defined in <code class="code">bn</code> option.
  3349. </p>
  3350. <p>Default value is white noise.
  3351. </p></dd>
  3352. </dl>
  3353. </dd>
  3354. <dt><samp class="option">band_noise, bn</samp></dt>
  3355. <dd><p>Set custom band noise profile for every one of 15 bands.
  3356. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  3357. </p>
  3358. </dd>
  3359. <dt><samp class="option">residual_floor, rf</samp></dt>
  3360. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  3361. Default value is -38 dB.
  3362. </p>
  3363. </dd>
  3364. <dt><samp class="option">track_noise, tn</samp></dt>
  3365. <dd><p>Enable noise floor tracking. By default is disabled.
  3366. With this enabled, noise floor is automatically adjusted.
  3367. </p>
  3368. </dd>
  3369. <dt><samp class="option">track_residual, tr</samp></dt>
  3370. <dd><p>Enable residual tracking. By default is disabled.
  3371. </p>
  3372. </dd>
  3373. <dt><samp class="option">output_mode, om</samp></dt>
  3374. <dd><p>Set the output mode.
  3375. </p>
  3376. <p>It accepts the following values:
  3377. </p><dl class="table">
  3378. <dt><samp class="option">input, i</samp></dt>
  3379. <dd><p>Pass input unchanged.
  3380. </p>
  3381. </dd>
  3382. <dt><samp class="option">output, o</samp></dt>
  3383. <dd><p>Pass noise filtered out.
  3384. </p>
  3385. </dd>
  3386. <dt><samp class="option">noise, n</samp></dt>
  3387. <dd><p>Pass only noise.
  3388. </p>
  3389. <p>Default value is <var class="var">output</var>.
  3390. </p></dd>
  3391. </dl>
  3392. </dd>
  3393. <dt><samp class="option">adaptivity, ad</samp></dt>
  3394. <dd><p>Set the adaptivity factor, used how fast to adapt gains adjustments per
  3395. each frequency bin. Value <var class="var">0</var> enables instant adaptation, while higher values
  3396. react much slower.
  3397. Allowed range is from <var class="var">0</var> to <var class="var">1</var>. Default value is <var class="var">0.5</var>.
  3398. </p>
  3399. </dd>
  3400. <dt><samp class="option">floor_offset, fo</samp></dt>
  3401. <dd><p>Set the noise floor offset factor. This option is used to adjust offset applied to measured
  3402. noise floor. It is only effective when noise floor tracking is enabled.
  3403. Allowed range is from <var class="var">-2.0</var> to <var class="var">2.0</var>. Default value is <var class="var">1.0</var>.
  3404. </p>
  3405. </dd>
  3406. <dt><samp class="option">noise_link, nl</samp></dt>
  3407. <dd><p>Set the noise link used for multichannel audio.
  3408. </p>
  3409. <p>It accepts the following values:
  3410. </p><dl class="table">
  3411. <dt><samp class="option">none</samp></dt>
  3412. <dd><p>Use unchanged channel&rsquo;s noise floor.
  3413. </p>
  3414. </dd>
  3415. <dt><samp class="option">min</samp></dt>
  3416. <dd><p>Use measured min noise floor of all channels.
  3417. </p>
  3418. </dd>
  3419. <dt><samp class="option">max</samp></dt>
  3420. <dd><p>Use measured max noise floor of all channels.
  3421. </p>
  3422. </dd>
  3423. <dt><samp class="option">average</samp></dt>
  3424. <dd><p>Use measured average noise floor of all channels.
  3425. </p>
  3426. <p>Default value is <var class="var">min</var>.
  3427. </p></dd>
  3428. </dl>
  3429. </dd>
  3430. <dt><samp class="option">band_multiplier, bm</samp></dt>
  3431. <dd><p>Set the band multiplier factor, used how much to spread bands across frequency bins.
  3432. Allowed range is from <var class="var">0.2</var> to <var class="var">5</var>. Default value is <var class="var">1.25</var>.
  3433. </p>
  3434. </dd>
  3435. <dt><samp class="option">sample_noise, sn</samp></dt>
  3436. <dd><p>Toggle capturing and measurement of noise profile from input audio.
  3437. </p>
  3438. <p>It accepts the following values:
  3439. </p><dl class="table">
  3440. <dt><samp class="option">start, begin</samp></dt>
  3441. <dd><p>Start sample noise capture.
  3442. </p>
  3443. </dd>
  3444. <dt><samp class="option">stop, end</samp></dt>
  3445. <dd><p>Stop sample noise capture and measure new noise band profile.
  3446. </p>
  3447. <p>Default value is <code class="code">none</code>.
  3448. </p></dd>
  3449. </dl>
  3450. </dd>
  3451. <dt><samp class="option">gain_smooth, gs</samp></dt>
  3452. <dd><p>Set gain smooth spatial radius, used to smooth gains applied to each frequency bin.
  3453. Useful to reduce random music noise artefacts.
  3454. Higher values increases smoothing of gains.
  3455. Allowed range is from <code class="code">0</code> to <code class="code">50</code>.
  3456. Default value is <code class="code">0</code>.
  3457. </p></dd>
  3458. </dl>
  3459. <a name="Commands-9"></a>
  3460. <h4 class="subsection">8.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-9" aria-hidden="true">TOC</a></span></h4>
  3461. <p>This filter supports the some above mentioned options as <a class="ref" href="#commands">commands</a>.
  3462. </p>
  3463. <a name="Examples-7"></a>
  3464. <h4 class="subsection">8.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-7" aria-hidden="true">TOC</a></span></h4>
  3465. <ul class="itemize mark-bullet">
  3466. <li>Reduce white noise by 10dB, and use previously measured noise floor of -40dB:
  3467. <div class="example">
  3468. <pre class="example-preformatted">afftdn=nr=10:nf=-40
  3469. </pre></div>
  3470. </li><li>Reduce white noise by 10dB, also set initial noise floor to -80dB and enable automatic
  3471. tracking of noise floor so noise floor will gradually change during processing:
  3472. <div class="example">
  3473. <pre class="example-preformatted">afftdn=nr=10:nf=-80:tn=1
  3474. </pre></div>
  3475. </li><li>Reduce noise by 20dB, using noise floor of -40dB and using commands to take noise profile
  3476. of first 0.4 seconds of input audio:
  3477. <div class="example">
  3478. <pre class="example-preformatted">asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40
  3479. </pre></div>
  3480. </li></ul>
  3481. <a name="afftfilt"></a>
  3482. <h3 class="section">8.24 afftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#afftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afftfilt" aria-hidden="true">TOC</a></span></h3>
  3483. <p>Apply arbitrary expressions to samples in frequency domain.
  3484. </p>
  3485. <dl class="table">
  3486. <dt><samp class="option">real</samp></dt>
  3487. <dd><p>Set frequency domain real expression for each separate channel separated
  3488. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  3489. If the number of input channels is greater than the number of
  3490. expressions, the last specified expression is used for the remaining
  3491. output channels.
  3492. </p>
  3493. </dd>
  3494. <dt><samp class="option">imag</samp></dt>
  3495. <dd><p>Set frequency domain imaginary expression for each separate channel
  3496. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  3497. </p>
  3498. <p>Each expression in <var class="var">real</var> and <var class="var">imag</var> can contain the following
  3499. constants and functions:
  3500. </p>
  3501. <dl class="table">
  3502. <dt><samp class="option">sr</samp></dt>
  3503. <dd><p>sample rate
  3504. </p>
  3505. </dd>
  3506. <dt><samp class="option">b</samp></dt>
  3507. <dd><p>current frequency bin number
  3508. </p>
  3509. </dd>
  3510. <dt><samp class="option">nb</samp></dt>
  3511. <dd><p>number of available bins
  3512. </p>
  3513. </dd>
  3514. <dt><samp class="option">ch</samp></dt>
  3515. <dd><p>channel number of the current expression
  3516. </p>
  3517. </dd>
  3518. <dt><samp class="option">chs</samp></dt>
  3519. <dd><p>number of channels
  3520. </p>
  3521. </dd>
  3522. <dt><samp class="option">pts</samp></dt>
  3523. <dd><p>current frame pts
  3524. </p>
  3525. </dd>
  3526. <dt><samp class="option">re</samp></dt>
  3527. <dd><p>current real part of frequency bin of current channel
  3528. </p>
  3529. </dd>
  3530. <dt><samp class="option">im</samp></dt>
  3531. <dd><p>current imaginary part of frequency bin of current channel
  3532. </p>
  3533. </dd>
  3534. <dt><samp class="option">real(b, ch)</samp></dt>
  3535. <dd><p>Return the value of real part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  3536. </p>
  3537. </dd>
  3538. <dt><samp class="option">imag(b, ch)</samp></dt>
  3539. <dd><p>Return the value of imaginary part of frequency bin at location (<var class="var">bin</var>,<var class="var">channel</var>)
  3540. </p></dd>
  3541. </dl>
  3542. </dd>
  3543. <dt><samp class="option">win_size</samp></dt>
  3544. <dd><p>Set window size. Allowed range is from 16 to 131072.
  3545. Default is <code class="code">4096</code>
  3546. </p>
  3547. </dd>
  3548. <dt><samp class="option">win_func</samp></dt>
  3549. <dd><p>Set window function.
  3550. </p>
  3551. <p>It accepts the following values:
  3552. </p><dl class="table">
  3553. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  3554. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  3555. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  3556. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  3557. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  3558. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  3559. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  3560. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  3561. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  3562. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  3563. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  3564. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  3565. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  3566. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  3567. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  3568. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  3569. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  3570. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  3571. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  3572. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  3573. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  3574. </dl>
  3575. <p>Default is <code class="code">hann</code>.
  3576. </p>
  3577. </dd>
  3578. <dt><samp class="option">overlap</samp></dt>
  3579. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  3580. window function will be picked. Default is <code class="code">0.75</code>.
  3581. </p></dd>
  3582. </dl>
  3583. <a name="Examples-8"></a>
  3584. <h4 class="subsection">8.24.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-8" aria-hidden="true">TOC</a></span></h4>
  3585. <ul class="itemize mark-bullet">
  3586. <li>Leave almost only low frequencies in audio:
  3587. <div class="example">
  3588. <pre class="example-preformatted">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  3589. </pre></div>
  3590. </li><li>Apply robotize effect:
  3591. <div class="example">
  3592. <pre class="example-preformatted">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  3593. </pre></div>
  3594. </li><li>Apply whisper effect:
  3595. <div class="example">
  3596. <pre class="example-preformatted">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;
  3597. </pre></div>
  3598. </li><li>Apply phase shift:
  3599. <div class="example">
  3600. <pre class="example-preformatted">afftfilt=&quot;real=re*cos(1)-im*sin(1):imag=re*sin(1)+im*cos(1)&quot;
  3601. </pre></div>
  3602. </li></ul>
  3603. <a class="anchor" id="afir"></a><a name="afir-1"></a>
  3604. <h3 class="section">8.25 afir<span class="pull-right"><a class="anchor hidden-xs" href="#afir-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afir-1" aria-hidden="true">TOC</a></span></h3>
  3605. <p>Apply an arbitrary Finite Impulse Response filter.
  3606. </p>
  3607. <p>This filter is designed for applying long FIR filters,
  3608. up to 60 seconds long.
  3609. </p>
  3610. <p>It can be used as component for digital crossover filters,
  3611. room equalization, cross talk cancellation, wavefield synthesis,
  3612. auralization, ambiophonics, ambisonics and spatialization.
  3613. </p>
  3614. <p>This filter uses the streams higher than first one as FIR coefficients.
  3615. If the non-first stream holds a single channel, it will be used
  3616. for all input channels in the first stream, otherwise
  3617. the number of channels in the non-first stream must be same as
  3618. the number of channels in the first stream.
  3619. </p>
  3620. <p>It accepts the following parameters:
  3621. </p>
  3622. <dl class="table">
  3623. <dt><samp class="option">dry</samp></dt>
  3624. <dd><p>Set dry gain. This sets input gain.
  3625. </p>
  3626. </dd>
  3627. <dt><samp class="option">wet</samp></dt>
  3628. <dd><p>Set wet gain. This sets final output gain.
  3629. </p>
  3630. </dd>
  3631. <dt><samp class="option">length</samp></dt>
  3632. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  3633. </p>
  3634. </dd>
  3635. <dt><samp class="option">gtype</samp></dt>
  3636. <dd><p>This option is deprecated, and does nothing.
  3637. </p>
  3638. </dd>
  3639. <dt><samp class="option">irnorm</samp></dt>
  3640. <dd><p>Set norm to be applied to IR coefficients before filtering.
  3641. Allowed range is from <var class="var">-1</var> to <var class="var">2</var>.
  3642. IR coefficients are normalized with calculated vector norm set by this option.
  3643. For negative values, no norm is calculated, and IR coefficients are not modified at all.
  3644. Default is <var class="var">1</var>.
  3645. </p>
  3646. </dd>
  3647. <dt><samp class="option">irlink</samp></dt>
  3648. <dd><p>For multichannel IR if this option is set to <var class="var">true</var>, all IR channels will be
  3649. normalized with maximal measured gain of all IR channels coefficients as set by <code class="code">irnorm</code> option.
  3650. When disabled, all IR coefficients in each IR channel will be normalized independently.
  3651. Default is <var class="var">true</var>.
  3652. </p>
  3653. </dd>
  3654. <dt><samp class="option">irgain</samp></dt>
  3655. <dd><p>Set gain to be applied to IR coefficients before filtering.
  3656. Allowed range is 0 to 1. This gain is applied after any gain applied with <var class="var">irnorm</var> option.
  3657. </p>
  3658. </dd>
  3659. <dt><samp class="option">irfmt</samp></dt>
  3660. <dd><p>Set format of IR stream. Can be <code class="code">mono</code> or <code class="code">input</code>.
  3661. Default is <code class="code">input</code>.
  3662. </p>
  3663. </dd>
  3664. <dt><samp class="option">maxir</samp></dt>
  3665. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  3666. Allowed range is 0.1 to 60 seconds.
  3667. </p>
  3668. </dd>
  3669. <dt><samp class="option">response</samp></dt>
  3670. <dd><p>This option is deprecated, and does nothing.
  3671. </p>
  3672. </dd>
  3673. <dt><samp class="option">channel</samp></dt>
  3674. <dd><p>This option is deprecated, and does nothing.
  3675. </p>
  3676. </dd>
  3677. <dt><samp class="option">size</samp></dt>
  3678. <dd><p>This option is deprecated, and does nothing.
  3679. </p>
  3680. </dd>
  3681. <dt><samp class="option">rate</samp></dt>
  3682. <dd><p>This option is deprecated, and does nothing.
  3683. </p>
  3684. </dd>
  3685. <dt><samp class="option">minp</samp></dt>
  3686. <dd><p>Set minimal partition size used for convolution. Default is <var class="var">8192</var>.
  3687. Allowed range is from <var class="var">1</var> to <var class="var">65536</var>.
  3688. Lower values decreases latency at cost of higher CPU usage.
  3689. </p>
  3690. </dd>
  3691. <dt><samp class="option">maxp</samp></dt>
  3692. <dd><p>Set maximal partition size used for convolution. Default is <var class="var">8192</var>.
  3693. Allowed range is from <var class="var">8</var> to <var class="var">65536</var>.
  3694. Lower values may increase CPU usage.
  3695. </p>
  3696. </dd>
  3697. <dt><samp class="option">nbirs</samp></dt>
  3698. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  3699. Allowed range is from <var class="var">1</var> to <var class="var">32</var>. Default is <var class="var">1</var>.
  3700. </p>
  3701. </dd>
  3702. <dt><samp class="option">ir</samp></dt>
  3703. <dd><p>Set IR stream which will be used for convolution, starting from <var class="var">0</var>, should always be
  3704. lower than supplied value by <code class="code">nbirs</code> option. Default is <var class="var">0</var>.
  3705. This option can be changed at runtime via <a class="ref" href="#commands">commands</a>.
  3706. </p>
  3707. </dd>
  3708. <dt><samp class="option">precision</samp></dt>
  3709. <dd><p>Set which precision to use when processing samples.
  3710. </p>
  3711. <dl class="table">
  3712. <dt><samp class="option">auto</samp></dt>
  3713. <dd><p>Auto pick internal sample format depending on other filters.
  3714. </p>
  3715. </dd>
  3716. <dt><samp class="option">float</samp></dt>
  3717. <dd><p>Always use single-floating point precision sample format.
  3718. </p>
  3719. </dd>
  3720. <dt><samp class="option">double</samp></dt>
  3721. <dd><p>Always use double-floating point precision sample format.
  3722. </p></dd>
  3723. </dl>
  3724. <p>Default value is auto.
  3725. </p>
  3726. </dd>
  3727. <dt><samp class="option">irload</samp></dt>
  3728. <dd><p>Set when to load IR stream. Can be <code class="code">init</code> or <code class="code">access</code>.
  3729. First one load and prepares all IRs on initialization, second one
  3730. once on first access of specific IR.
  3731. Default is <code class="code">init</code>.
  3732. </p></dd>
  3733. </dl>
  3734. <a name="Examples-9"></a>
  3735. <h4 class="subsection">8.25.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-9" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-9" aria-hidden="true">TOC</a></span></h4>
  3736. <ul class="itemize mark-bullet">
  3737. <li>Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  3738. <div class="example">
  3739. <pre class="example-preformatted">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  3740. </pre></div>
  3741. </li><li>Apply true stereo processing given input stereo stream, and two stereo impulse responses for left and right channel,
  3742. the impulse response files are files with names l_ir.wav and r_ir.wav, and setting irnorm option value:
  3743. <div class="example">
  3744. <pre class="example-preformatted">&quot;pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:irnorm=1.2,pan=stereo|FL&lt;c0+c2|FR&lt;c1+c3&quot;
  3745. </pre></div>
  3746. </li><li>Similar to above example, but with <code class="code">irgain</code> explicitly set to estimated value and with <code class="code">irnorm</code> disabled:
  3747. <div class="example">
  3748. <pre class="example-preformatted">&quot;pan=4C|c0=FL|c1=FL|c2=FR|c3=FR[a];amovie=l_ir.wav[LIR];amovie=r_ir.wav[RIR];[LIR][RIR]amerge[ir];[a][ir]afir=irfmt=input:irgain=-5dB:irnom=-1,pan=stereo|FL&lt;c0+c2|FR&lt;c1+c3&quot;
  3749. </pre></div>
  3750. </li></ul>
  3751. <a class="anchor" id="aformat"></a><a name="aformat-1"></a>
  3752. <h3 class="section">8.26 aformat<span class="pull-right"><a class="anchor hidden-xs" href="#aformat-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aformat-1" aria-hidden="true">TOC</a></span></h3>
  3753. <p>Set output format constraints for the input audio. The framework will
  3754. negotiate the most appropriate format to minimize conversions.
  3755. </p>
  3756. <p>It accepts the following parameters:
  3757. </p><dl class="table">
  3758. <dt><samp class="option">sample_fmts, f</samp></dt>
  3759. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  3760. </p>
  3761. </dd>
  3762. <dt><samp class="option">sample_rates, r</samp></dt>
  3763. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  3764. </p>
  3765. </dd>
  3766. <dt><samp class="option">channel_layouts, cl</samp></dt>
  3767. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  3768. </p>
  3769. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  3770. for the required syntax.
  3771. </p></dd>
  3772. </dl>
  3773. <p>If a parameter is omitted, all values are allowed.
  3774. </p>
  3775. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  3776. </p><div class="example">
  3777. <pre class="example-preformatted">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  3778. </pre></div>
  3779. <a name="afreqshift"></a>
  3780. <h3 class="section">8.27 afreqshift<span class="pull-right"><a class="anchor hidden-xs" href="#afreqshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afreqshift" aria-hidden="true">TOC</a></span></h3>
  3781. <p>Apply frequency shift to input audio samples.
  3782. </p>
  3783. <p>The filter accepts the following options:
  3784. </p>
  3785. <dl class="table">
  3786. <dt><samp class="option">shift</samp></dt>
  3787. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  3788. Default value is 0.0.
  3789. </p>
  3790. </dd>
  3791. <dt><samp class="option">level</samp></dt>
  3792. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  3793. Default value is 1.0.
  3794. </p>
  3795. </dd>
  3796. <dt><samp class="option">order</samp></dt>
  3797. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  3798. Default value is 8.
  3799. </p></dd>
  3800. </dl>
  3801. <a name="Commands-10"></a>
  3802. <h4 class="subsection">8.27.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-10" aria-hidden="true">TOC</a></span></h4>
  3803. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3804. </p>
  3805. <a name="afwtdn"></a>
  3806. <h3 class="section">8.28 afwtdn<span class="pull-right"><a class="anchor hidden-xs" href="#afwtdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afwtdn" aria-hidden="true">TOC</a></span></h3>
  3807. <p>Reduce broadband noise from input samples using Wavelets.
  3808. </p>
  3809. <p>A description of the accepted options follows.
  3810. </p>
  3811. <dl class="table">
  3812. <dt><samp class="option">sigma</samp></dt>
  3813. <dd><p>Set the noise sigma, allowed range is from 0 to 1.
  3814. Default value is 0.
  3815. This option controls strength of denoising applied to input samples.
  3816. Most useful way to set this option is via decibels, eg. -45dB.
  3817. </p>
  3818. </dd>
  3819. <dt><samp class="option">levels</samp></dt>
  3820. <dd><p>Set the number of wavelet levels of decomposition.
  3821. Allowed range is from 1 to 12.
  3822. Default value is 10.
  3823. Setting this too low make denoising performance very poor.
  3824. </p>
  3825. </dd>
  3826. <dt><samp class="option">wavet</samp></dt>
  3827. <dd><p>Set wavelet type for decomposition of input frame.
  3828. They are sorted by number of coefficients, from lowest to highest.
  3829. More coefficients means worse filtering speed, but overall better quality.
  3830. Available wavelets are:
  3831. </p>
  3832. <dl class="table">
  3833. <dt>&lsquo;<samp class="samp">sym2</samp>&rsquo;</dt>
  3834. <dt>&lsquo;<samp class="samp">sym4</samp>&rsquo;</dt>
  3835. <dt>&lsquo;<samp class="samp">rbior68</samp>&rsquo;</dt>
  3836. <dt>&lsquo;<samp class="samp">deb10</samp>&rsquo;</dt>
  3837. <dt>&lsquo;<samp class="samp">sym10</samp>&rsquo;</dt>
  3838. <dt>&lsquo;<samp class="samp">coif5</samp>&rsquo;</dt>
  3839. <dt>&lsquo;<samp class="samp">bl3</samp>&rsquo;</dt>
  3840. </dl>
  3841. </dd>
  3842. <dt><samp class="option">percent</samp></dt>
  3843. <dd><p>Set percent of full denoising. Allowed range is from 0 to 100 percent.
  3844. Default value is 85 percent or partial denoising.
  3845. </p>
  3846. </dd>
  3847. <dt><samp class="option">profile</samp></dt>
  3848. <dd><p>If enabled, first input frame will be used as noise profile.
  3849. If first frame samples contain non-noise performance will be very poor.
  3850. </p>
  3851. </dd>
  3852. <dt><samp class="option">adaptive</samp></dt>
  3853. <dd><p>If enabled, input frames are analyzed for presence of noise.
  3854. If noise is detected with high possibility then input frame profile will be
  3855. used for processing following frames, until new noise frame is detected.
  3856. </p>
  3857. </dd>
  3858. <dt><samp class="option">samples</samp></dt>
  3859. <dd><p>Set size of single frame in number of samples. Allowed range is from 512 to
  3860. 65536. Default frame size is 8192 samples.
  3861. </p>
  3862. </dd>
  3863. <dt><samp class="option">softness</samp></dt>
  3864. <dd><p>Set softness applied inside thresholding function. Allowed range is from 0 to
  3865. 10. Default softness is 1.
  3866. </p></dd>
  3867. </dl>
  3868. <a name="Commands-11"></a>
  3869. <h4 class="subsection">8.28.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-11" aria-hidden="true">TOC</a></span></h4>
  3870. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3871. </p>
  3872. <a name="agate"></a>
  3873. <h3 class="section">8.29 agate<span class="pull-right"><a class="anchor hidden-xs" href="#agate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agate" aria-hidden="true">TOC</a></span></h3>
  3874. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  3875. processing reduces disturbing noise between useful signals.
  3876. </p>
  3877. <p>Gating is done by detecting the volume below a chosen level <var class="var">threshold</var>
  3878. and dividing it by the factor set with <var class="var">ratio</var>. The bottom of the noise
  3879. floor is set via <var class="var">range</var>. Because an exact manipulation of the signal
  3880. would cause distortion of the waveform the reduction can be levelled over
  3881. time. This is done by setting <var class="var">attack</var> and <var class="var">release</var>.
  3882. </p>
  3883. <p><var class="var">attack</var> determines how long the signal has to fall below the threshold
  3884. before any reduction will occur and <var class="var">release</var> sets the time the signal
  3885. has to rise above the threshold to reduce the reduction again.
  3886. Shorter signals than the chosen attack time will be left untouched.
  3887. </p>
  3888. <dl class="table">
  3889. <dt><samp class="option">level_in</samp></dt>
  3890. <dd><p>Set input level before filtering.
  3891. Default is 1. Allowed range is from 0.015625 to 64.
  3892. </p>
  3893. </dd>
  3894. <dt><samp class="option">mode</samp></dt>
  3895. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  3896. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  3897. will be amplified, expanding dynamic range in upward direction.
  3898. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  3899. </p>
  3900. </dd>
  3901. <dt><samp class="option">range</samp></dt>
  3902. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  3903. Default is 0.06125. Allowed range is from 0 to 1.
  3904. Setting this to 0 disables reduction and then filter behaves like expander.
  3905. </p>
  3906. </dd>
  3907. <dt><samp class="option">threshold</samp></dt>
  3908. <dd><p>If a signal rises above this level the gain reduction is released.
  3909. Default is 0.125. Allowed range is from 0 to 1.
  3910. </p>
  3911. </dd>
  3912. <dt><samp class="option">ratio</samp></dt>
  3913. <dd><p>Set a ratio by which the signal is reduced.
  3914. Default is 2. Allowed range is from 1 to 9000.
  3915. </p>
  3916. </dd>
  3917. <dt><samp class="option">attack</samp></dt>
  3918. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  3919. reduction stops.
  3920. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  3921. </p>
  3922. </dd>
  3923. <dt><samp class="option">release</samp></dt>
  3924. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  3925. reduction is increased again. Default is 250 milliseconds.
  3926. Allowed range is from 0.01 to 9000.
  3927. </p>
  3928. </dd>
  3929. <dt><samp class="option">makeup</samp></dt>
  3930. <dd><p>Set amount of amplification of signal after processing.
  3931. Default is 1. Allowed range is from 1 to 64.
  3932. </p>
  3933. </dd>
  3934. <dt><samp class="option">knee</samp></dt>
  3935. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  3936. Default is 2.828427125. Allowed range is from 1 to 8.
  3937. </p>
  3938. </dd>
  3939. <dt><samp class="option">detection</samp></dt>
  3940. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  3941. Default is <code class="code">rms</code>. Can be <code class="code">peak</code> or <code class="code">rms</code>.
  3942. </p>
  3943. </dd>
  3944. <dt><samp class="option">link</samp></dt>
  3945. <dd><p>Choose if the average level between all channels or the louder channel affects
  3946. the reduction.
  3947. Default is <code class="code">average</code>. Can be <code class="code">average</code> or <code class="code">maximum</code>.
  3948. </p></dd>
  3949. </dl>
  3950. <a name="Commands-12"></a>
  3951. <h4 class="subsection">8.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-12" aria-hidden="true">TOC</a></span></h4>
  3952. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  3953. </p>
  3954. <a name="aiir"></a>
  3955. <h3 class="section">8.30 aiir<span class="pull-right"><a class="anchor hidden-xs" href="#aiir" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aiir" aria-hidden="true">TOC</a></span></h3>
  3956. <p>Apply an arbitrary Infinite Impulse Response filter.
  3957. </p>
  3958. <p>It accepts the following parameters:
  3959. </p>
  3960. <dl class="table">
  3961. <dt><samp class="option">zeros, z</samp></dt>
  3962. <dd><p>Set B/numerator/zeros/reflection coefficients.
  3963. </p>
  3964. </dd>
  3965. <dt><samp class="option">poles, p</samp></dt>
  3966. <dd><p>Set A/denominator/poles/ladder coefficients.
  3967. </p>
  3968. </dd>
  3969. <dt><samp class="option">gains, k</samp></dt>
  3970. <dd><p>Set channels gains.
  3971. </p>
  3972. </dd>
  3973. <dt><samp class="option">dry_gain</samp></dt>
  3974. <dd><p>Set input gain.
  3975. </p>
  3976. </dd>
  3977. <dt><samp class="option">wet_gain</samp></dt>
  3978. <dd><p>Set output gain.
  3979. </p>
  3980. </dd>
  3981. <dt><samp class="option">format, f</samp></dt>
  3982. <dd><p>Set coefficients format.
  3983. </p>
  3984. <dl class="table">
  3985. <dt>&lsquo;<samp class="samp">ll</samp>&rsquo;</dt>
  3986. <dd><p>lattice-ladder function
  3987. </p></dd>
  3988. <dt>&lsquo;<samp class="samp">sf</samp>&rsquo;</dt>
  3989. <dd><p>analog transfer function
  3990. </p></dd>
  3991. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  3992. <dd><p>digital transfer function
  3993. </p></dd>
  3994. <dt>&lsquo;<samp class="samp">zp</samp>&rsquo;</dt>
  3995. <dd><p>Z-plane zeros/poles, cartesian (default)
  3996. </p></dd>
  3997. <dt>&lsquo;<samp class="samp">pr</samp>&rsquo;</dt>
  3998. <dd><p>Z-plane zeros/poles, polar radians
  3999. </p></dd>
  4000. <dt>&lsquo;<samp class="samp">pd</samp>&rsquo;</dt>
  4001. <dd><p>Z-plane zeros/poles, polar degrees
  4002. </p></dd>
  4003. <dt>&lsquo;<samp class="samp">sp</samp>&rsquo;</dt>
  4004. <dd><p>S-plane zeros/poles
  4005. </p></dd>
  4006. </dl>
  4007. </dd>
  4008. <dt><samp class="option">process, r</samp></dt>
  4009. <dd><p>Set type of processing.
  4010. </p>
  4011. <dl class="table">
  4012. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  4013. <dd><p>direct processing
  4014. </p></dd>
  4015. <dt>&lsquo;<samp class="samp">s</samp>&rsquo;</dt>
  4016. <dd><p>serial processing
  4017. </p></dd>
  4018. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  4019. <dd><p>parallel processing
  4020. </p></dd>
  4021. </dl>
  4022. </dd>
  4023. <dt><samp class="option">precision, e</samp></dt>
  4024. <dd><p>Set filtering precision.
  4025. </p>
  4026. <dl class="table">
  4027. <dt>&lsquo;<samp class="samp">dbl</samp>&rsquo;</dt>
  4028. <dd><p>double-precision floating-point (default)
  4029. </p></dd>
  4030. <dt>&lsquo;<samp class="samp">flt</samp>&rsquo;</dt>
  4031. <dd><p>single-precision floating-point
  4032. </p></dd>
  4033. <dt>&lsquo;<samp class="samp">i32</samp>&rsquo;</dt>
  4034. <dd><p>32-bit integers
  4035. </p></dd>
  4036. <dt>&lsquo;<samp class="samp">i16</samp>&rsquo;</dt>
  4037. <dd><p>16-bit integers
  4038. </p></dd>
  4039. </dl>
  4040. </dd>
  4041. <dt><samp class="option">normalize, n</samp></dt>
  4042. <dd><p>Normalize filter coefficients, by default is enabled.
  4043. Enabling it will normalize magnitude response at DC to 0dB.
  4044. </p>
  4045. </dd>
  4046. <dt><samp class="option">mix</samp></dt>
  4047. <dd><p>How much to use filtered signal in output. Default is 1.
  4048. Range is between 0 and 1.
  4049. </p>
  4050. </dd>
  4051. <dt><samp class="option">response</samp></dt>
  4052. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  4053. By default it is disabled.
  4054. </p>
  4055. </dd>
  4056. <dt><samp class="option">channel</samp></dt>
  4057. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  4058. displayed. This option is used only when <var class="var">response</var> is enabled.
  4059. </p>
  4060. </dd>
  4061. <dt><samp class="option">size</samp></dt>
  4062. <dd><p>Set video stream size. This option is used only when <var class="var">response</var> is enabled.
  4063. </p></dd>
  4064. </dl>
  4065. <p>Coefficients in <code class="code">tf</code> and <code class="code">sf</code> format are separated by spaces and are in ascending
  4066. order.
  4067. </p>
  4068. <p>Coefficients in <code class="code">zp</code> format are separated by spaces and order of coefficients
  4069. doesn&rsquo;t matter. Coefficients in <code class="code">zp</code> format are complex numbers with <var class="var">i</var>
  4070. imaginary unit.
  4071. </p>
  4072. <p>Different coefficients and gains can be provided for every channel, in such case
  4073. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  4074. used for all remaining channels.
  4075. </p>
  4076. <a name="Examples-10"></a>
  4077. <h4 class="subsection">8.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-10" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-10" aria-hidden="true">TOC</a></span></h4>
  4078. <ul class="itemize mark-bullet">
  4079. <li>Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  4080. <div class="example">
  4081. <pre class="example-preformatted">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
  4082. </pre></div>
  4083. </li><li>Same as above but in <code class="code">zp</code> format:
  4084. <div class="example">
  4085. <pre class="example-preformatted">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
  4086. </pre></div>
  4087. </li><li>Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  4088. <div class="example">
  4089. <pre class="example-preformatted">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  4090. </pre></div>
  4091. </li></ul>
  4092. <a name="alimiter"></a>
  4093. <h3 class="section">8.31 alimiter<span class="pull-right"><a class="anchor hidden-xs" href="#alimiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alimiter" aria-hidden="true">TOC</a></span></h3>
  4094. <p>The limiter prevents an input signal from rising over a desired threshold.
  4095. This limiter uses lookahead technology to prevent your signal from distorting.
  4096. It means that there is a small delay after the signal is processed. Keep in mind
  4097. that the delay it produces is the attack time you set.
  4098. </p>
  4099. <p>The filter accepts the following options:
  4100. </p>
  4101. <dl class="table">
  4102. <dt><samp class="option">level_in</samp></dt>
  4103. <dd><p>Set input gain. Default is 1.
  4104. </p>
  4105. </dd>
  4106. <dt><samp class="option">level_out</samp></dt>
  4107. <dd><p>Set output gain. Default is 1.
  4108. </p>
  4109. </dd>
  4110. <dt><samp class="option">limit</samp></dt>
  4111. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  4112. </p>
  4113. </dd>
  4114. <dt><samp class="option">attack</samp></dt>
  4115. <dd><p>The limiter will reach its attenuation level in this amount of time in
  4116. milliseconds. Default is 5 milliseconds.
  4117. </p>
  4118. </dd>
  4119. <dt><samp class="option">release</samp></dt>
  4120. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  4121. Default is 50 milliseconds.
  4122. </p>
  4123. </dd>
  4124. <dt><samp class="option">asc</samp></dt>
  4125. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  4126. average reduction level rather than reaching a reduction of 0 in the release
  4127. time.
  4128. </p>
  4129. </dd>
  4130. <dt><samp class="option">asc_level</samp></dt>
  4131. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  4132. in release time while 1 produces higher release times.
  4133. </p>
  4134. </dd>
  4135. <dt><samp class="option">level</samp></dt>
  4136. <dd><p>Auto level output signal. Default is enabled.
  4137. This normalizes audio back to 0dB if enabled.
  4138. </p>
  4139. </dd>
  4140. <dt><samp class="option">latency</samp></dt>
  4141. <dd><p>Compensate the delay introduced by using the lookahead buffer set with attack
  4142. parameter. Also flush the valid audio data in the lookahead buffer when the
  4143. stream hits EOF.
  4144. </p></dd>
  4145. </dl>
  4146. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  4147. with <a class="ref" href="#aresample">aresample</a> before applying this filter.
  4148. </p>
  4149. <a name="allpass"></a>
  4150. <h3 class="section">8.32 allpass<span class="pull-right"><a class="anchor hidden-xs" href="#allpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allpass" aria-hidden="true">TOC</a></span></h3>
  4151. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  4152. <var class="var">frequency</var>, and filter-width <var class="var">width</var>.
  4153. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  4154. without changing its frequency to amplitude relationship.
  4155. </p>
  4156. <p>The filter accepts the following options:
  4157. </p>
  4158. <dl class="table">
  4159. <dt><samp class="option">frequency, f</samp></dt>
  4160. <dd><p>Set frequency in Hz.
  4161. </p>
  4162. </dd>
  4163. <dt><samp class="option">width_type, t</samp></dt>
  4164. <dd><p>Set method to specify band-width of filter.
  4165. </p><dl class="table">
  4166. <dt><samp class="option">h</samp></dt>
  4167. <dd><p>Hz
  4168. </p></dd>
  4169. <dt><samp class="option">q</samp></dt>
  4170. <dd><p>Q-Factor
  4171. </p></dd>
  4172. <dt><samp class="option">o</samp></dt>
  4173. <dd><p>octave
  4174. </p></dd>
  4175. <dt><samp class="option">s</samp></dt>
  4176. <dd><p>slope
  4177. </p></dd>
  4178. <dt><samp class="option">k</samp></dt>
  4179. <dd><p>kHz
  4180. </p></dd>
  4181. </dl>
  4182. </dd>
  4183. <dt><samp class="option">width, w</samp></dt>
  4184. <dd><p>Specify the band-width of a filter in width_type units.
  4185. </p>
  4186. </dd>
  4187. <dt><samp class="option">mix, m</samp></dt>
  4188. <dd><p>How much to use filtered signal in output. Default is 1.
  4189. Range is between 0 and 1.
  4190. </p>
  4191. </dd>
  4192. <dt><samp class="option">channels, c</samp></dt>
  4193. <dd><p>Specify which channels to filter, by default all available are filtered.
  4194. </p>
  4195. </dd>
  4196. <dt><samp class="option">normalize, n</samp></dt>
  4197. <dd><p>Normalize biquad coefficients, by default is disabled.
  4198. Enabling it will normalize magnitude response at DC to 0dB.
  4199. </p>
  4200. </dd>
  4201. <dt><samp class="option">order, o</samp></dt>
  4202. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  4203. </p>
  4204. </dd>
  4205. <dt><samp class="option">transform, a</samp></dt>
  4206. <dd><p>Set transform type of IIR filter.
  4207. </p><dl class="table">
  4208. <dt><samp class="option">di</samp></dt>
  4209. <dt><samp class="option">dii</samp></dt>
  4210. <dt><samp class="option">tdi</samp></dt>
  4211. <dt><samp class="option">tdii</samp></dt>
  4212. <dt><samp class="option">latt</samp></dt>
  4213. <dt><samp class="option">svf</samp></dt>
  4214. <dt><samp class="option">zdf</samp></dt>
  4215. </dl>
  4216. </dd>
  4217. <dt><samp class="option">precision, r</samp></dt>
  4218. <dd><p>Set precision of filtering.
  4219. </p><dl class="table">
  4220. <dt><samp class="option">auto</samp></dt>
  4221. <dd><p>Pick automatic sample format depending on surround filters.
  4222. </p></dd>
  4223. <dt><samp class="option">s16</samp></dt>
  4224. <dd><p>Always use signed 16-bit.
  4225. </p></dd>
  4226. <dt><samp class="option">s32</samp></dt>
  4227. <dd><p>Always use signed 32-bit.
  4228. </p></dd>
  4229. <dt><samp class="option">f32</samp></dt>
  4230. <dd><p>Always use float 32-bit.
  4231. </p></dd>
  4232. <dt><samp class="option">f64</samp></dt>
  4233. <dd><p>Always use float 64-bit.
  4234. </p></dd>
  4235. </dl>
  4236. </dd>
  4237. </dl>
  4238. <a name="Commands-13"></a>
  4239. <h4 class="subsection">8.32.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-13" aria-hidden="true">TOC</a></span></h4>
  4240. <p>This filter supports the following commands:
  4241. </p><dl class="table">
  4242. <dt><samp class="option">frequency, f</samp></dt>
  4243. <dd><p>Change allpass frequency.
  4244. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  4245. </p>
  4246. </dd>
  4247. <dt><samp class="option">width_type, t</samp></dt>
  4248. <dd><p>Change allpass width_type.
  4249. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  4250. </p>
  4251. </dd>
  4252. <dt><samp class="option">width, w</samp></dt>
  4253. <dd><p>Change allpass width.
  4254. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  4255. </p>
  4256. </dd>
  4257. <dt><samp class="option">mix, m</samp></dt>
  4258. <dd><p>Change allpass mix.
  4259. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  4260. </p></dd>
  4261. </dl>
  4262. <a name="aloop"></a>
  4263. <h3 class="section">8.33 aloop<span class="pull-right"><a class="anchor hidden-xs" href="#aloop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aloop" aria-hidden="true">TOC</a></span></h3>
  4264. <p>Loop audio samples.
  4265. </p>
  4266. <p>The filter accepts the following options:
  4267. </p>
  4268. <dl class="table">
  4269. <dt><samp class="option">loop</samp></dt>
  4270. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  4271. Default is 0.
  4272. </p>
  4273. </dd>
  4274. <dt><samp class="option">size</samp></dt>
  4275. <dd><p>Set maximal number of samples. Default is 0.
  4276. </p>
  4277. </dd>
  4278. <dt><samp class="option">start</samp></dt>
  4279. <dd><p>Set first sample of loop. Default is 0.
  4280. </p>
  4281. </dd>
  4282. <dt><samp class="option">time</samp></dt>
  4283. <dd><p>Set the time of loop start in seconds.
  4284. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  4285. </p></dd>
  4286. </dl>
  4287. <a class="anchor" id="amerge"></a><a name="amerge-1"></a>
  4288. <h3 class="section">8.34 amerge<span class="pull-right"><a class="anchor hidden-xs" href="#amerge-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amerge-1" aria-hidden="true">TOC</a></span></h3>
  4289. <p>Merge two or more audio streams into a single multi-channel stream.
  4290. </p>
  4291. <p>All inputs must have the same sample rate, and format.
  4292. </p>
  4293. <p>If inputs do not have the same duration, the output will stop with the
  4294. shortest.
  4295. </p>
  4296. <p>The filter accepts the following options:
  4297. </p>
  4298. <dl class="table">
  4299. <dt><samp class="option">inputs</samp></dt>
  4300. <dd><p>Set the number of inputs. Default is 2.
  4301. </p>
  4302. </dd>
  4303. <dt><samp class="option">layout_mode</samp></dt>
  4304. <dd>
  4305. <p>This option controls how the output channel layout is determined and if the
  4306. audio channels are reordered during merge.
  4307. </p>
  4308. <dl class="table">
  4309. <dt><samp class="option">legacy</samp></dt>
  4310. <dd>
  4311. <p>This is the mode how the filter behaved historically so it is the default.
  4312. </p>
  4313. <p>If the channel layouts of the inputs are known and disjoint, and therefore
  4314. compatible, the channel layout of the output will be set accordingly and the
  4315. channels will be reordered as necessary. If the channel layouts of the inputs
  4316. are not disjoint, some of them are unknown, or they are using special channel
  4317. layouts, such as ambisonics, the output will have all the channels of the first
  4318. input then all the channels of the second input, in that order, and the channel
  4319. layout of the output will be the default value corresponding to the total
  4320. number of channels.
  4321. </p>
  4322. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  4323. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  4324. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  4325. first input, b1 is the first channel of the second input).
  4326. </p>
  4327. <p>On the other hand, if both input are in stereo, the output channels will be
  4328. in the default order: a1, a2, b1, b2, and the channel layout will be
  4329. arbitrarily set to 4.0, which may or may not be the expected value.
  4330. </p>
  4331. </dd>
  4332. <dt><samp class="option">reset</samp></dt>
  4333. <dd><p>This mode ignores the input channel layouts and does no channel reordering.
  4334. The output will have all the channels of the first input, then all the channels
  4335. of the second input, in that order, and so on.
  4336. </p>
  4337. <p>The output channel layout will only specify the total channel count.
  4338. </p>
  4339. </dd>
  4340. <dt><samp class="option">normal</samp></dt>
  4341. <dd><p>This mode keeps channel name and designation information from the input
  4342. channels and does no channel reordering. The output will have all the channels
  4343. of the first input, then all the channels of the second input, in that order,
  4344. and so on.
  4345. </p>
  4346. </dd>
  4347. </dl>
  4348. </dd>
  4349. </dl>
  4350. <a name="Examples-11"></a>
  4351. <h4 class="subsection">8.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-11" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-11" aria-hidden="true">TOC</a></span></h4>
  4352. <ul class="itemize mark-bullet">
  4353. <li>Merge two mono files into a stereo stream:
  4354. <div class="example">
  4355. <pre class="example-preformatted">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  4356. </pre></div>
  4357. </li><li>Multiple merges assuming 1 video stream and 6 audio streams in <samp class="file">input.mkv</samp>:
  4358. <div class="example">
  4359. <pre class="example-preformatted">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
  4360. </pre></div>
  4361. </li></ul>
  4362. <a name="amix"></a>
  4363. <h3 class="section">8.35 amix<span class="pull-right"><a class="anchor hidden-xs" href="#amix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amix" aria-hidden="true">TOC</a></span></h3>
  4364. <p>Mixes multiple audio inputs into a single output.
  4365. </p>
  4366. <p>Note that this filter only supports float samples (the <var class="var">amerge</var>
  4367. and <var class="var">pan</var> audio filters support many formats). If the <var class="var">amix</var>
  4368. input has integer samples then <a class="ref" href="#aresample">aresample</a> will be automatically
  4369. inserted to perform the conversion to float samples.
  4370. </p>
  4371. <p>It accepts the following parameters:
  4372. </p><dl class="table">
  4373. <dt><samp class="option">inputs</samp></dt>
  4374. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  4375. </p>
  4376. </dd>
  4377. <dt><samp class="option">duration</samp></dt>
  4378. <dd><p>How to determine the end-of-stream.
  4379. </p><dl class="table">
  4380. <dt><samp class="option">longest</samp></dt>
  4381. <dd><p>The duration of the longest input. (default)
  4382. </p>
  4383. </dd>
  4384. <dt><samp class="option">shortest</samp></dt>
  4385. <dd><p>The duration of the shortest input.
  4386. </p>
  4387. </dd>
  4388. <dt><samp class="option">first</samp></dt>
  4389. <dd><p>The duration of the first input.
  4390. </p>
  4391. </dd>
  4392. </dl>
  4393. </dd>
  4394. <dt><samp class="option">dropout_transition</samp></dt>
  4395. <dd><p>The transition time, in seconds, for volume renormalization when an input
  4396. stream ends. The default value is 2 seconds.
  4397. </p>
  4398. </dd>
  4399. <dt><samp class="option">weights</samp></dt>
  4400. <dd><p>Specify weight of each input audio stream as a sequence of numbers separated
  4401. by a space. If fewer weights are specified compared to number of inputs, the
  4402. last weight is assigned to the remaining inputs.
  4403. Default weight for each input is 1.
  4404. </p>
  4405. </dd>
  4406. <dt><samp class="option">normalize</samp></dt>
  4407. <dd><p>Always scale inputs instead of only doing summation of samples.
  4408. Beware of heavy clipping if inputs are not normalized prior or after filtering
  4409. by this filter if this option is disabled. By default is enabled.
  4410. </p></dd>
  4411. </dl>
  4412. <a name="Examples-12"></a>
  4413. <h4 class="subsection">8.35.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-12" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-12" aria-hidden="true">TOC</a></span></h4>
  4414. <ul class="itemize mark-bullet">
  4415. <li>This will mix 3 input audio streams to a single output with the same duration as the
  4416. first input and a dropout transition time of 3 seconds:
  4417. <div class="example">
  4418. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  4419. </pre></div>
  4420. </li><li>This will mix one vocal and one music input audio stream to a single output with the same duration as the
  4421. longest input. The music will have quarter the weight as the vocals, and the inputs are not normalized:
  4422. <div class="example">
  4423. <pre class="example-preformatted">ffmpeg -i VOCALS -i MUSIC -filter_complex amix=inputs=2:duration=longest:dropout_transition=0:weights=&quot;1 0.25&quot;:normalize=0 OUTPUT
  4424. </pre></div>
  4425. </li></ul>
  4426. <a name="Commands-14"></a>
  4427. <h4 class="subsection">8.35.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-14" aria-hidden="true">TOC</a></span></h4>
  4428. <p>This filter supports the following commands:
  4429. </p><dl class="table">
  4430. <dt><samp class="option">weights</samp></dt>
  4431. <dt><samp class="option">normalize</samp></dt>
  4432. <dd><p>Syntax is same as option with same name.
  4433. </p></dd>
  4434. </dl>
  4435. <a name="amultiply"></a>
  4436. <h3 class="section">8.36 amultiply<span class="pull-right"><a class="anchor hidden-xs" href="#amultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amultiply" aria-hidden="true">TOC</a></span></h3>
  4437. <p>Multiply first audio stream with second audio stream and store result
  4438. in output audio stream. Multiplication is done by multiplying each
  4439. sample from first stream with sample at same position from second stream.
  4440. </p>
  4441. <p>With this element-wise multiplication one can create amplitude fades and
  4442. amplitude modulations.
  4443. </p>
  4444. <a name="anequalizer"></a>
  4445. <h3 class="section">8.37 anequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#anequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anequalizer" aria-hidden="true">TOC</a></span></h3>
  4446. <p>High-order parametric multiband equalizer for each channel.
  4447. </p>
  4448. <p>It accepts the following parameters:
  4449. </p><dl class="table">
  4450. <dt><samp class="option">params</samp></dt>
  4451. <dd>
  4452. <p>This option string is in format:
  4453. &quot;c<var class="var">chn</var> f=<var class="var">cf</var> w=<var class="var">w</var> g=<var class="var">g</var> t=<var class="var">f</var> | ...&quot;
  4454. Each equalizer band is separated by &rsquo;|&rsquo;.
  4455. </p>
  4456. <dl class="table">
  4457. <dt><samp class="option">chn</samp></dt>
  4458. <dd><p>Set channel number to which equalization will be applied.
  4459. If input doesn&rsquo;t have that channel the entry is ignored.
  4460. </p>
  4461. </dd>
  4462. <dt><samp class="option">f</samp></dt>
  4463. <dd><p>Set central frequency for band.
  4464. If input doesn&rsquo;t have that frequency the entry is ignored.
  4465. </p>
  4466. </dd>
  4467. <dt><samp class="option">w</samp></dt>
  4468. <dd><p>Set band width in Hertz.
  4469. </p>
  4470. </dd>
  4471. <dt><samp class="option">g</samp></dt>
  4472. <dd><p>Set band gain in dB.
  4473. </p>
  4474. </dd>
  4475. <dt><samp class="option">t</samp></dt>
  4476. <dd><p>Set filter type for band, optional, can be:
  4477. </p>
  4478. <dl class="table">
  4479. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  4480. <dd><p>Butterworth, this is default.
  4481. </p>
  4482. </dd>
  4483. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  4484. <dd><p>Chebyshev type 1.
  4485. </p>
  4486. </dd>
  4487. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  4488. <dd><p>Chebyshev type 2.
  4489. </p></dd>
  4490. </dl>
  4491. </dd>
  4492. </dl>
  4493. </dd>
  4494. <dt><samp class="option">curves</samp></dt>
  4495. <dd><p>With this option activated frequency response of anequalizer is displayed
  4496. in video stream.
  4497. </p>
  4498. </dd>
  4499. <dt><samp class="option">size</samp></dt>
  4500. <dd><p>Set video stream size. Only useful if curves option is activated.
  4501. </p>
  4502. </dd>
  4503. <dt><samp class="option">mgain</samp></dt>
  4504. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  4505. Setting this to a reasonable value makes it possible to display gain which is derived from
  4506. neighbour bands which are too close to each other and thus produce higher gain
  4507. when both are activated.
  4508. </p>
  4509. </dd>
  4510. <dt><samp class="option">fscale</samp></dt>
  4511. <dd><p>Set frequency scale used to draw frequency response in video output.
  4512. Can be linear or logarithmic. Default is logarithmic.
  4513. </p>
  4514. </dd>
  4515. <dt><samp class="option">colors</samp></dt>
  4516. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  4517. This is list of color names separated by space or by &rsquo;|&rsquo;.
  4518. Unrecognised or missing colors will be replaced by white color.
  4519. </p></dd>
  4520. </dl>
  4521. <a name="Examples-13"></a>
  4522. <h4 class="subsection">8.37.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-13" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-13" aria-hidden="true">TOC</a></span></h4>
  4523. <ul class="itemize mark-bullet">
  4524. <li>Lower gain by 10 of central frequency 200Hz and width 100 Hz
  4525. for first 2 channels using Chebyshev type 1 filter:
  4526. <div class="example">
  4527. <pre class="example-preformatted">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  4528. </pre></div>
  4529. </li></ul>
  4530. <a name="Commands-15"></a>
  4531. <h4 class="subsection">8.37.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-15" aria-hidden="true">TOC</a></span></h4>
  4532. <p>This filter supports the following commands:
  4533. </p><dl class="table">
  4534. <dt><samp class="option">change</samp></dt>
  4535. <dd><p>Alter existing filter parameters.
  4536. Syntax for the commands is : &quot;<var class="var">fN</var>|f=<var class="var">freq</var>|w=<var class="var">width</var>|g=<var class="var">gain</var>&quot;
  4537. </p>
  4538. <p><var class="var">fN</var> is existing filter number, starting from 0, if no such filter is available
  4539. error is returned.
  4540. <var class="var">freq</var> set new frequency parameter.
  4541. <var class="var">width</var> set new width parameter in Hertz.
  4542. <var class="var">gain</var> set new gain parameter in dB.
  4543. </p>
  4544. <p>Full filter invocation with asendcmd may look like this:
  4545. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  4546. </p></dd>
  4547. </dl>
  4548. <a name="anlmdn"></a>
  4549. <h3 class="section">8.38 anlmdn<span class="pull-right"><a class="anchor hidden-xs" href="#anlmdn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmdn" aria-hidden="true">TOC</a></span></h3>
  4550. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  4551. </p>
  4552. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  4553. context similarity is defined by comparing their surrounding patches of size
  4554. <samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp> around the sample.
  4555. </p>
  4556. <p>The filter accepts the following options:
  4557. </p>
  4558. <dl class="table">
  4559. <dt><samp class="option">strength, s</samp></dt>
  4560. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10000. Default value is 0.00001.
  4561. </p>
  4562. </dd>
  4563. <dt><samp class="option">patch, p</samp></dt>
  4564. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  4565. Default value is 2 milliseconds.
  4566. </p>
  4567. </dd>
  4568. <dt><samp class="option">research, r</samp></dt>
  4569. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  4570. Default value is 6 milliseconds.
  4571. </p>
  4572. </dd>
  4573. <dt><samp class="option">output, o</samp></dt>
  4574. <dd><p>Set the output mode.
  4575. </p>
  4576. <p>It accepts the following values:
  4577. </p><dl class="table">
  4578. <dt><samp class="option">i</samp></dt>
  4579. <dd><p>Pass input unchanged.
  4580. </p>
  4581. </dd>
  4582. <dt><samp class="option">o</samp></dt>
  4583. <dd><p>Pass noise filtered out.
  4584. </p>
  4585. </dd>
  4586. <dt><samp class="option">n</samp></dt>
  4587. <dd><p>Pass only noise.
  4588. </p>
  4589. <p>Default value is <var class="var">o</var>.
  4590. </p></dd>
  4591. </dl>
  4592. </dd>
  4593. <dt><samp class="option">smooth, m</samp></dt>
  4594. <dd><p>Set smooth factor. Default value is <var class="var">11</var>. Allowed range is from <var class="var">1</var> to <var class="var">1000</var>.
  4595. </p></dd>
  4596. </dl>
  4597. <a name="Commands-16"></a>
  4598. <h4 class="subsection">8.38.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-16" aria-hidden="true">TOC</a></span></h4>
  4599. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  4600. </p>
  4601. <a name="anlmf_002c-anlms"></a>
  4602. <h3 class="section">8.39 anlmf, anlms<span class="pull-right"><a class="anchor hidden-xs" href="#anlmf_002c-anlms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlmf_002c-anlms" aria-hidden="true">TOC</a></span></h3>
  4603. <p>Apply Normalized Least-Mean-(Squares|Fourth) algorithm to the first audio stream using the second audio stream.
  4604. </p>
  4605. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  4606. relate to producing the least mean square of the error signal (difference between the desired,
  4607. 2nd input audio stream and the actual signal, the 1st input audio stream).
  4608. </p>
  4609. <p>A description of the accepted options follows.
  4610. </p>
  4611. <dl class="table">
  4612. <dt><samp class="option">order</samp></dt>
  4613. <dd><p>Set filter order.
  4614. </p>
  4615. </dd>
  4616. <dt><samp class="option">mu</samp></dt>
  4617. <dd><p>Set filter mu.
  4618. </p>
  4619. </dd>
  4620. <dt><samp class="option">eps</samp></dt>
  4621. <dd><p>Set the filter eps.
  4622. </p>
  4623. </dd>
  4624. <dt><samp class="option">leakage</samp></dt>
  4625. <dd><p>Set the filter leakage.
  4626. </p>
  4627. </dd>
  4628. <dt><samp class="option">out_mode</samp></dt>
  4629. <dd><p>It accepts the following values:
  4630. </p><dl class="table">
  4631. <dt><samp class="option">i</samp></dt>
  4632. <dd><p>Pass the 1st input.
  4633. </p>
  4634. </dd>
  4635. <dt><samp class="option">d</samp></dt>
  4636. <dd><p>Pass the 2nd input.
  4637. </p>
  4638. </dd>
  4639. <dt><samp class="option">o</samp></dt>
  4640. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  4641. </p>
  4642. </dd>
  4643. <dt><samp class="option">n</samp></dt>
  4644. <dd><p>Pass difference between input, 1st input and error signal estimate.
  4645. </p>
  4646. </dd>
  4647. <dt><samp class="option">e</samp></dt>
  4648. <dd><p>Pass error signal estimated samples.
  4649. </p>
  4650. <p>Default value is <var class="var">o</var>.
  4651. </p></dd>
  4652. </dl>
  4653. </dd>
  4654. <dt><samp class="option">precision</samp></dt>
  4655. <dd><p>Set which precision to use when processing samples.
  4656. </p>
  4657. <dl class="table">
  4658. <dt><samp class="option">auto</samp></dt>
  4659. <dd><p>Auto pick internal sample format depending on other filters.
  4660. </p>
  4661. </dd>
  4662. <dt><samp class="option">float</samp></dt>
  4663. <dd><p>Always use single-floating point precision sample format.
  4664. </p>
  4665. </dd>
  4666. <dt><samp class="option">double</samp></dt>
  4667. <dd><p>Always use double-floating point precision sample format.
  4668. </p></dd>
  4669. </dl>
  4670. </dd>
  4671. </dl>
  4672. <a name="Examples-14"></a>
  4673. <h4 class="subsection">8.39.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-14" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-14" aria-hidden="true">TOC</a></span></h4>
  4674. <ul class="itemize mark-bullet">
  4675. <li>One of many usages of this filter is noise reduction, input audio is filtered
  4676. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  4677. <div class="example">
  4678. <pre class="example-preformatted">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  4679. </pre></div>
  4680. </li></ul>
  4681. <a name="Commands-17"></a>
  4682. <h4 class="subsection">8.39.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-17" aria-hidden="true">TOC</a></span></h4>
  4683. <p>This filter supports the same commands as options, excluding option <code class="code">order</code>.
  4684. </p>
  4685. <a name="anull"></a>
  4686. <h3 class="section">8.40 anull<span class="pull-right"><a class="anchor hidden-xs" href="#anull" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anull" aria-hidden="true">TOC</a></span></h3>
  4687. <p>Pass the audio source unchanged to the output.
  4688. </p>
  4689. <a name="apad"></a>
  4690. <h3 class="section">8.41 apad<span class="pull-right"><a class="anchor hidden-xs" href="#apad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apad" aria-hidden="true">TOC</a></span></h3>
  4691. <p>Pad the end of an audio stream with silence.
  4692. </p>
  4693. <p>This can be used together with <code class="command">ffmpeg</code> <samp class="option">-shortest</samp> to
  4694. extend audio streams to the same length as the video stream.
  4695. </p>
  4696. <p>A description of the accepted options follows.
  4697. </p>
  4698. <dl class="table">
  4699. <dt><samp class="option">packet_size</samp></dt>
  4700. <dd><p>Set silence packet size. Default value is 4096.
  4701. </p>
  4702. </dd>
  4703. <dt><samp class="option">pad_len</samp></dt>
  4704. <dd><p>Set the number of samples of silence to add to the end. After the
  4705. value is reached, the stream is terminated. This option is mutually
  4706. exclusive with <samp class="option">whole_len</samp>.
  4707. </p>
  4708. </dd>
  4709. <dt><samp class="option">whole_len</samp></dt>
  4710. <dd><p>Set the minimum total number of samples in the output audio stream. If
  4711. the value is longer than the input audio length, silence is added to
  4712. the end, until the value is reached. This option is mutually exclusive
  4713. with <samp class="option">pad_len</samp>.
  4714. </p>
  4715. </dd>
  4716. <dt><samp class="option">pad_dur</samp></dt>
  4717. <dd><p>Specify the duration of samples of silence to add. See
  4718. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  4719. for the accepted syntax. Used only if set to non-negative value.
  4720. </p>
  4721. </dd>
  4722. <dt><samp class="option">whole_dur</samp></dt>
  4723. <dd><p>Specify the minimum total duration in the output audio stream. See
  4724. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  4725. for the accepted syntax. Used only if set to non-negative value. If the value is longer than
  4726. the input audio length, silence is added to the end, until the value is reached.
  4727. This option is mutually exclusive with <samp class="option">pad_dur</samp>
  4728. </p></dd>
  4729. </dl>
  4730. <p>If neither the <samp class="option">pad_len</samp> nor the <samp class="option">whole_len</samp> nor <samp class="option">pad_dur</samp>
  4731. nor <samp class="option">whole_dur</samp> option is set, the filter will add silence to the end of
  4732. the input stream indefinitely.
  4733. </p>
  4734. <p>Note that for ffmpeg 4.4 and earlier a zero <samp class="option">pad_dur</samp> or
  4735. <samp class="option">whole_dur</samp> also caused the filter to add silence indefinitely.
  4736. </p>
  4737. <a name="Examples-15"></a>
  4738. <h4 class="subsection">8.41.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-15" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-15" aria-hidden="true">TOC</a></span></h4>
  4739. <ul class="itemize mark-bullet">
  4740. <li>Add 1024 samples of silence to the end of the input:
  4741. <div class="example">
  4742. <pre class="example-preformatted">apad=pad_len=1024
  4743. </pre></div>
  4744. </li><li>Make sure the audio output will contain at least 10000 samples, pad
  4745. the input with silence if required:
  4746. <div class="example">
  4747. <pre class="example-preformatted">apad=whole_len=10000
  4748. </pre></div>
  4749. </li><li>Use <code class="command">ffmpeg</code> to pad the audio input with silence, so that the
  4750. video stream will always result the shortest and will be converted
  4751. until the end in the output file when using the <samp class="option">shortest</samp>
  4752. option:
  4753. <div class="example">
  4754. <pre class="example-preformatted">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  4755. </pre></div>
  4756. </li></ul>
  4757. <a name="aphaser"></a>
  4758. <h3 class="section">8.42 aphaser<span class="pull-right"><a class="anchor hidden-xs" href="#aphaser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaser" aria-hidden="true">TOC</a></span></h3>
  4759. <p>Add a phasing effect to the input audio.
  4760. </p>
  4761. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  4762. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  4763. </p>
  4764. <p>A description of the accepted parameters follows.
  4765. </p>
  4766. <dl class="table">
  4767. <dt><samp class="option">in_gain</samp></dt>
  4768. <dd><p>Set input gain. Default is 0.4.
  4769. </p>
  4770. </dd>
  4771. <dt><samp class="option">out_gain</samp></dt>
  4772. <dd><p>Set output gain. Default is 0.74
  4773. </p>
  4774. </dd>
  4775. <dt><samp class="option">delay</samp></dt>
  4776. <dd><p>Set delay in milliseconds. Default is 3.0.
  4777. </p>
  4778. </dd>
  4779. <dt><samp class="option">decay</samp></dt>
  4780. <dd><p>Set decay. Default is 0.4.
  4781. </p>
  4782. </dd>
  4783. <dt><samp class="option">speed</samp></dt>
  4784. <dd><p>Set modulation speed in Hz. Default is 0.5.
  4785. </p>
  4786. </dd>
  4787. <dt><samp class="option">type</samp></dt>
  4788. <dd><p>Set modulation type. Default is triangular.
  4789. </p>
  4790. <p>It accepts the following values:
  4791. </p><dl class="table">
  4792. <dt>&lsquo;<samp class="samp">triangular, t</samp>&rsquo;</dt>
  4793. <dt>&lsquo;<samp class="samp">sinusoidal, s</samp>&rsquo;</dt>
  4794. </dl>
  4795. </dd>
  4796. </dl>
  4797. <a name="aphaseshift"></a>
  4798. <h3 class="section">8.43 aphaseshift<span class="pull-right"><a class="anchor hidden-xs" href="#aphaseshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphaseshift" aria-hidden="true">TOC</a></span></h3>
  4799. <p>Apply phase shift to input audio samples.
  4800. </p>
  4801. <p>The filter accepts the following options:
  4802. </p>
  4803. <dl class="table">
  4804. <dt><samp class="option">shift</samp></dt>
  4805. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  4806. Default value is 0.0.
  4807. </p>
  4808. </dd>
  4809. <dt><samp class="option">level</samp></dt>
  4810. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  4811. Default value is 1.0.
  4812. </p>
  4813. </dd>
  4814. <dt><samp class="option">order</samp></dt>
  4815. <dd><p>Set filter order used for filtering. Allowed range is from 1 to 16.
  4816. Default value is 8.
  4817. </p></dd>
  4818. </dl>
  4819. <a name="Commands-18"></a>
  4820. <h4 class="subsection">8.43.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-18" aria-hidden="true">TOC</a></span></h4>
  4821. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  4822. </p>
  4823. <a name="apsnr"></a>
  4824. <h3 class="section">8.44 apsnr<span class="pull-right"><a class="anchor hidden-xs" href="#apsnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsnr" aria-hidden="true">TOC</a></span></h3>
  4825. <p>Measure Audio Peak Signal-to-Noise Ratio.
  4826. </p>
  4827. <p>This filter takes two audio streams for input, and outputs first
  4828. audio stream.
  4829. Results are in dB per channel at end of either input.
  4830. </p>
  4831. <a name="apsyclip"></a>
  4832. <h3 class="section">8.45 apsyclip<span class="pull-right"><a class="anchor hidden-xs" href="#apsyclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apsyclip" aria-hidden="true">TOC</a></span></h3>
  4833. <p>Apply Psychoacoustic clipper to input audio stream.
  4834. </p>
  4835. <p>The filter accepts the following options:
  4836. </p>
  4837. <dl class="table">
  4838. <dt><samp class="option">level_in</samp></dt>
  4839. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  4840. </p>
  4841. </dd>
  4842. <dt><samp class="option">level_out</samp></dt>
  4843. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  4844. </p>
  4845. </dd>
  4846. <dt><samp class="option">clip</samp></dt>
  4847. <dd><p>Set the clipping start value. Default value is 0dBFS or 1.
  4848. </p>
  4849. </dd>
  4850. <dt><samp class="option">diff</samp></dt>
  4851. <dd><p>Output only difference samples, useful to hear introduced distortions.
  4852. By default is disabled.
  4853. </p>
  4854. </dd>
  4855. <dt><samp class="option">adaptive</samp></dt>
  4856. <dd><p>Set strength of adaptive distortion applied. Default value is 0.5.
  4857. Allowed range is from 0 to 1.
  4858. </p>
  4859. </dd>
  4860. <dt><samp class="option">iterations</samp></dt>
  4861. <dd><p>Set number of iterations of psychoacoustic clipper.
  4862. Allowed range is from 1 to 20. Default value is 10.
  4863. </p>
  4864. </dd>
  4865. <dt><samp class="option">level</samp></dt>
  4866. <dd><p>Auto level output signal. Default is disabled.
  4867. This normalizes audio back to 0dBFS if enabled.
  4868. </p></dd>
  4869. </dl>
  4870. <a name="Commands-19"></a>
  4871. <h4 class="subsection">8.45.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-19" aria-hidden="true">TOC</a></span></h4>
  4872. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  4873. </p>
  4874. <a name="apulsator"></a>
  4875. <h3 class="section">8.46 apulsator<span class="pull-right"><a class="anchor hidden-xs" href="#apulsator" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-apulsator" aria-hidden="true">TOC</a></span></h3>
  4876. <p>Audio pulsator is something between an autopanner and a tremolo.
  4877. But it can produce funny stereo effects as well. Pulsator changes the volume
  4878. of the left and right channel based on a LFO (low frequency oscillator) with
  4879. different waveforms and shifted phases.
  4880. This filter have the ability to define an offset between left and right
  4881. channel. An offset of 0 means that both LFO shapes match each other.
  4882. The left and right channel are altered equally - a conventional tremolo.
  4883. An offset of 50% means that the shape of the right channel is exactly shifted
  4884. in phase (or moved backwards about half of the frequency) - pulsator acts as
  4885. an autopanner. At 1 both curves match again. Every setting in between moves the
  4886. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  4887. sine and triangle waveforms. The more you set the offset near 1 (starting from
  4888. the 0.5) the faster the signal passes from the left to the right speaker.
  4889. </p>
  4890. <p>The filter accepts the following options:
  4891. </p>
  4892. <dl class="table">
  4893. <dt><samp class="option">level_in</samp></dt>
  4894. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  4895. </p>
  4896. </dd>
  4897. <dt><samp class="option">level_out</samp></dt>
  4898. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  4899. </p>
  4900. </dd>
  4901. <dt><samp class="option">mode</samp></dt>
  4902. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  4903. sawup or sawdown. Default is sine.
  4904. </p>
  4905. </dd>
  4906. <dt><samp class="option">amount</samp></dt>
  4907. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  4908. </p>
  4909. </dd>
  4910. <dt><samp class="option">offset_l</samp></dt>
  4911. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  4912. </p>
  4913. </dd>
  4914. <dt><samp class="option">offset_r</samp></dt>
  4915. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  4916. </p>
  4917. </dd>
  4918. <dt><samp class="option">width</samp></dt>
  4919. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  4920. </p>
  4921. </dd>
  4922. <dt><samp class="option">timing</samp></dt>
  4923. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  4924. </p>
  4925. </dd>
  4926. <dt><samp class="option">bpm</samp></dt>
  4927. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  4928. is set to bpm.
  4929. </p>
  4930. </dd>
  4931. <dt><samp class="option">ms</samp></dt>
  4932. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  4933. is set to ms.
  4934. </p>
  4935. </dd>
  4936. <dt><samp class="option">hz</samp></dt>
  4937. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  4938. if timing is set to hz.
  4939. </p></dd>
  4940. </dl>
  4941. <a class="anchor" id="aresample"></a><a name="aresample-1"></a>
  4942. <h3 class="section">8.47 aresample<span class="pull-right"><a class="anchor hidden-xs" href="#aresample-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aresample-1" aria-hidden="true">TOC</a></span></h3>
  4943. <p>Resample the input audio to the specified parameters, using the
  4944. libswresample library. If none are specified then the filter will
  4945. automatically convert between its input and output.
  4946. </p>
  4947. <p>This filter is also able to stretch/squeeze the audio data to make it match
  4948. the timestamps or to inject silence / cut out audio to make it match the
  4949. timestamps, do a combination of both or do neither.
  4950. </p>
  4951. <p>The filter accepts the syntax
  4952. [<var class="var">sample_rate</var>:]<var class="var">resampler_options</var>, where <var class="var">sample_rate</var>
  4953. expresses a sample rate and <var class="var">resampler_options</var> is a list of
  4954. <var class="var">key</var>=<var class="var">value</var> pairs, separated by &quot;:&quot;. See the
  4955. <a data-manual="ffmpeg-resampler" href="ffmpeg-resampler.html#Resampler-Options">&quot;Resampler Options&quot; section in the
  4956. ffmpeg-resampler(1) manual</a>
  4957. for the complete list of supported options.
  4958. </p>
  4959. <a name="Examples-16"></a>
  4960. <h4 class="subsection">8.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-16" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-16" aria-hidden="true">TOC</a></span></h4>
  4961. <ul class="itemize mark-bullet">
  4962. <li>Resample the input audio to 44100Hz:
  4963. <div class="example">
  4964. <pre class="example-preformatted">aresample=44100
  4965. </pre></div>
  4966. </li><li>Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  4967. samples per second compensation:
  4968. <div class="example">
  4969. <pre class="example-preformatted">aresample=async=1000
  4970. </pre></div>
  4971. </li></ul>
  4972. <a name="areverse"></a>
  4973. <h3 class="section">8.48 areverse<span class="pull-right"><a class="anchor hidden-xs" href="#areverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-areverse" aria-hidden="true">TOC</a></span></h3>
  4974. <p>Reverse an audio clip.
  4975. </p>
  4976. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  4977. is suggested.
  4978. </p>
  4979. <a name="Examples-17"></a>
  4980. <h4 class="subsection">8.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-17" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-17" aria-hidden="true">TOC</a></span></h4>
  4981. <ul class="itemize mark-bullet">
  4982. <li>Take the first 5 seconds of a clip, and reverse it.
  4983. <div class="example">
  4984. <pre class="example-preformatted">atrim=end=5,areverse
  4985. </pre></div>
  4986. </li></ul>
  4987. <a name="arls"></a>
  4988. <h3 class="section">8.49 arls<span class="pull-right"><a class="anchor hidden-xs" href="#arls" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arls" aria-hidden="true">TOC</a></span></h3>
  4989. <p>Apply Recursive Least Squares algorithm to the first audio stream using the second audio stream.
  4990. </p>
  4991. <p>This adaptive filter is used to mimic a desired filter by recursively finding the filter coefficients that
  4992. relate to producing the minimal weighted linear least squares cost function of the error signal (difference
  4993. between the desired, 2nd input audio stream and the actual signal, the 1st input audio stream).
  4994. </p>
  4995. <p>A description of the accepted options follows.
  4996. </p>
  4997. <dl class="table">
  4998. <dt><samp class="option">order</samp></dt>
  4999. <dd><p>Set the filter order.
  5000. </p>
  5001. </dd>
  5002. <dt><samp class="option">lambda</samp></dt>
  5003. <dd><p>Set the forgetting factor.
  5004. </p>
  5005. </dd>
  5006. <dt><samp class="option">delta</samp></dt>
  5007. <dd><p>Set the coefficient to initialize internal covariance matrix.
  5008. </p>
  5009. </dd>
  5010. <dt><samp class="option">out_mode</samp></dt>
  5011. <dd><p>Set the filter output samples. It accepts the following values:
  5012. </p><dl class="table">
  5013. <dt><samp class="option">i</samp></dt>
  5014. <dd><p>Pass the 1st input.
  5015. </p>
  5016. </dd>
  5017. <dt><samp class="option">d</samp></dt>
  5018. <dd><p>Pass the 2nd input.
  5019. </p>
  5020. </dd>
  5021. <dt><samp class="option">o</samp></dt>
  5022. <dd><p>Pass difference between desired, 2nd input and error signal estimate.
  5023. </p>
  5024. </dd>
  5025. <dt><samp class="option">n</samp></dt>
  5026. <dd><p>Pass difference between input, 1st input and error signal estimate.
  5027. </p>
  5028. </dd>
  5029. <dt><samp class="option">e</samp></dt>
  5030. <dd><p>Pass error signal estimated samples.
  5031. </p>
  5032. <p>Default value is <var class="var">o</var>.
  5033. </p></dd>
  5034. </dl>
  5035. </dd>
  5036. <dt><samp class="option">precision</samp></dt>
  5037. <dd><p>Set which precision to use when processing samples.
  5038. </p>
  5039. <dl class="table">
  5040. <dt><samp class="option">auto</samp></dt>
  5041. <dd><p>Auto pick internal sample format depending on other filters.
  5042. </p>
  5043. </dd>
  5044. <dt><samp class="option">float</samp></dt>
  5045. <dd><p>Always use single-floating point precision sample format.
  5046. </p>
  5047. </dd>
  5048. <dt><samp class="option">double</samp></dt>
  5049. <dd><p>Always use double-floating point precision sample format.
  5050. </p></dd>
  5051. </dl>
  5052. </dd>
  5053. </dl>
  5054. <a name="arnndn"></a>
  5055. <h3 class="section">8.50 arnndn<span class="pull-right"><a class="anchor hidden-xs" href="#arnndn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-arnndn" aria-hidden="true">TOC</a></span></h3>
  5056. <p>Reduce noise from speech using Recurrent Neural Networks.
  5057. </p>
  5058. <p>This filter accepts the following options:
  5059. </p>
  5060. <dl class="table">
  5061. <dt><samp class="option">model, m</samp></dt>
  5062. <dd><p>Set train model file to load. This option is always required.
  5063. </p>
  5064. </dd>
  5065. <dt><samp class="option">mix</samp></dt>
  5066. <dd><p>Set how much to mix filtered samples into final output.
  5067. Allowed range is from -1 to 1. Default value is 1.
  5068. Negative values are special, they set how much to keep filtered noise
  5069. in the final filter output. Set this option to -1 to hear actual
  5070. noise removed from input signal.
  5071. </p></dd>
  5072. </dl>
  5073. <a name="Commands-20"></a>
  5074. <h4 class="subsection">8.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-20" aria-hidden="true">TOC</a></span></h4>
  5075. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5076. </p>
  5077. <a name="asdr"></a>
  5078. <h3 class="section">8.51 asdr<span class="pull-right"><a class="anchor hidden-xs" href="#asdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asdr" aria-hidden="true">TOC</a></span></h3>
  5079. <p>Measure Audio Signal-to-Distortion Ratio.
  5080. </p>
  5081. <p>This filter takes two audio streams for input, and outputs first
  5082. audio stream.
  5083. Results are in dB per channel at end of either input.
  5084. </p>
  5085. <a name="asetnsamples"></a>
  5086. <h3 class="section">8.52 asetnsamples<span class="pull-right"><a class="anchor hidden-xs" href="#asetnsamples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetnsamples" aria-hidden="true">TOC</a></span></h3>
  5087. <p>Set the number of samples per each output audio frame.
  5088. </p>
  5089. <p>The last output packet may contain a different number of samples, as
  5090. the filter will flush all the remaining samples when the input audio
  5091. signals its end.
  5092. </p>
  5093. <p>The filter accepts the following options:
  5094. </p>
  5095. <dl class="table">
  5096. <dt><samp class="option">nb_out_samples, n</samp></dt>
  5097. <dd><p>Set the number of frames per each output audio frame. The number is
  5098. intended as the number of samples <em class="emph">per each channel</em>.
  5099. Default value is 1024.
  5100. </p>
  5101. </dd>
  5102. <dt><samp class="option">pad, p</samp></dt>
  5103. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  5104. that the last frame will contain the same number of samples as the
  5105. previous ones. Default value is 1.
  5106. </p></dd>
  5107. </dl>
  5108. <p>For example, to set the number of per-frame samples to 1234 and
  5109. disable padding for the last frame, use:
  5110. </p><div class="example">
  5111. <pre class="example-preformatted">asetnsamples=n=1234:p=0
  5112. </pre></div>
  5113. <a name="asetrate"></a>
  5114. <h3 class="section">8.53 asetrate<span class="pull-right"><a class="anchor hidden-xs" href="#asetrate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asetrate" aria-hidden="true">TOC</a></span></h3>
  5115. <p>Set the sample rate without altering the PCM data.
  5116. This will result in a change of speed and pitch.
  5117. </p>
  5118. <p>The filter accepts the following options:
  5119. </p>
  5120. <dl class="table">
  5121. <dt><samp class="option">sample_rate, r</samp></dt>
  5122. <dd><p>Set the output sample rate. Default is 44100 Hz.
  5123. </p></dd>
  5124. </dl>
  5125. <a name="ashowinfo"></a>
  5126. <h3 class="section">8.54 ashowinfo<span class="pull-right"><a class="anchor hidden-xs" href="#ashowinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ashowinfo" aria-hidden="true">TOC</a></span></h3>
  5127. <p>Show a line containing various information for each input audio frame.
  5128. The input audio is not modified.
  5129. </p>
  5130. <p>The shown line contains a sequence of key/value pairs of the form
  5131. <var class="var">key</var>:<var class="var">value</var>.
  5132. </p>
  5133. <p>The following values are shown in the output:
  5134. </p>
  5135. <dl class="table">
  5136. <dt><samp class="option">n</samp></dt>
  5137. <dd><p>The (sequential) number of the input frame, starting from 0.
  5138. </p>
  5139. </dd>
  5140. <dt><samp class="option">pts</samp></dt>
  5141. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  5142. depends on the filter input pad, and is usually 1/<var class="var">sample_rate</var>.
  5143. </p>
  5144. </dd>
  5145. <dt><samp class="option">pts_time</samp></dt>
  5146. <dd><p>The presentation timestamp of the input frame in seconds.
  5147. </p>
  5148. </dd>
  5149. <dt><samp class="option">fmt</samp></dt>
  5150. <dd><p>The sample format.
  5151. </p>
  5152. </dd>
  5153. <dt><samp class="option">chlayout</samp></dt>
  5154. <dd><p>The channel layout.
  5155. </p>
  5156. </dd>
  5157. <dt><samp class="option">rate</samp></dt>
  5158. <dd><p>The sample rate for the audio frame.
  5159. </p>
  5160. </dd>
  5161. <dt><samp class="option">nb_samples</samp></dt>
  5162. <dd><p>The number of samples (per channel) in the frame.
  5163. </p>
  5164. </dd>
  5165. <dt><samp class="option">checksum</samp></dt>
  5166. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  5167. audio, the data is treated as if all the planes were concatenated.
  5168. </p>
  5169. </dd>
  5170. <dt><samp class="option">plane_checksums</samp></dt>
  5171. <dd><p>A list of Adler-32 checksums for each data plane.
  5172. </p></dd>
  5173. </dl>
  5174. <a name="asisdr"></a>
  5175. <h3 class="section">8.55 asisdr<span class="pull-right"><a class="anchor hidden-xs" href="#asisdr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asisdr" aria-hidden="true">TOC</a></span></h3>
  5176. <p>Measure Audio Scaled-Invariant Signal-to-Distortion Ratio.
  5177. </p>
  5178. <p>This filter takes two audio streams for input, and outputs first
  5179. audio stream.
  5180. Results are in dB per channel at end of either input.
  5181. </p>
  5182. <a name="asoftclip"></a>
  5183. <h3 class="section">8.56 asoftclip<span class="pull-right"><a class="anchor hidden-xs" href="#asoftclip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asoftclip" aria-hidden="true">TOC</a></span></h3>
  5184. <p>Apply audio soft clipping.
  5185. </p>
  5186. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  5187. along a smooth curve, rather than the abrupt shape of hard-clipping.
  5188. </p>
  5189. <p>This filter accepts the following options:
  5190. </p>
  5191. <dl class="table">
  5192. <dt><samp class="option">type</samp></dt>
  5193. <dd><p>Set type of soft-clipping.
  5194. </p>
  5195. <p>It accepts the following values:
  5196. </p><dl class="table">
  5197. <dt><samp class="option">hard</samp></dt>
  5198. <dt><samp class="option">tanh</samp></dt>
  5199. <dt><samp class="option">atan</samp></dt>
  5200. <dt><samp class="option">cubic</samp></dt>
  5201. <dt><samp class="option">exp</samp></dt>
  5202. <dt><samp class="option">alg</samp></dt>
  5203. <dt><samp class="option">quintic</samp></dt>
  5204. <dt><samp class="option">sin</samp></dt>
  5205. <dt><samp class="option">erf</samp></dt>
  5206. </dl>
  5207. </dd>
  5208. <dt><samp class="option">threshold</samp></dt>
  5209. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  5210. </p>
  5211. </dd>
  5212. <dt><samp class="option">output</samp></dt>
  5213. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  5214. </p>
  5215. </dd>
  5216. <dt><samp class="option">param</samp></dt>
  5217. <dd><p>Set additional parameter which controls sigmoid function.
  5218. </p>
  5219. </dd>
  5220. <dt><samp class="option">oversample</samp></dt>
  5221. <dd><p>Set oversampling factor.
  5222. </p></dd>
  5223. </dl>
  5224. <a name="Commands-21"></a>
  5225. <h4 class="subsection">8.56.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-21" aria-hidden="true">TOC</a></span></h4>
  5226. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5227. </p>
  5228. <a name="aspectralstats"></a>
  5229. <h3 class="section">8.57 aspectralstats<span class="pull-right"><a class="anchor hidden-xs" href="#aspectralstats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aspectralstats" aria-hidden="true">TOC</a></span></h3>
  5230. <p>Display frequency domain statistical information about the audio channels.
  5231. Statistics are calculated and stored as metadata for each audio channel and for each audio frame.
  5232. </p>
  5233. <p>It accepts the following option:
  5234. </p><dl class="table">
  5235. <dt><samp class="option">win_size</samp></dt>
  5236. <dd><p>Set the window length in samples. Default value is 2048.
  5237. Allowed range is from 32 to 65536.
  5238. </p>
  5239. </dd>
  5240. <dt><samp class="option">win_func</samp></dt>
  5241. <dd><p>Set window function.
  5242. </p>
  5243. <p>It accepts the following values:
  5244. </p><dl class="table">
  5245. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  5246. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  5247. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  5248. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  5249. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  5250. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  5251. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  5252. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  5253. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  5254. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  5255. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  5256. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  5257. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  5258. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  5259. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  5260. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  5261. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  5262. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  5263. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  5264. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  5265. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  5266. </dl>
  5267. <p>Default is <code class="code">hann</code>.
  5268. </p>
  5269. </dd>
  5270. <dt><samp class="option">overlap</samp></dt>
  5271. <dd><p>Set window overlap. Allowed range is from <code class="code">0</code>
  5272. to <code class="code">1</code>. Default value is <code class="code">0.5</code>.
  5273. </p>
  5274. </dd>
  5275. <dt><samp class="option">measure</samp></dt>
  5276. <dd><p>Select the parameters which are measured. The metadata keys can
  5277. be used as flags, default is <samp class="option">all</samp> which measures everything.
  5278. <samp class="option">none</samp> disables all measurement.
  5279. </p></dd>
  5280. </dl>
  5281. <p>A list of each metadata key follows:
  5282. </p>
  5283. <dl class="table">
  5284. <dt><samp class="option">mean</samp></dt>
  5285. <dt><samp class="option">variance</samp></dt>
  5286. <dt><samp class="option">centroid</samp></dt>
  5287. <dt><samp class="option">spread</samp></dt>
  5288. <dt><samp class="option">skewness</samp></dt>
  5289. <dt><samp class="option">kurtosis</samp></dt>
  5290. <dt><samp class="option">entropy</samp></dt>
  5291. <dt><samp class="option">flatness</samp></dt>
  5292. <dt><samp class="option">crest</samp></dt>
  5293. <dt><samp class="option">flux</samp></dt>
  5294. <dt><samp class="option">slope</samp></dt>
  5295. <dt><samp class="option">decrease</samp></dt>
  5296. <dt><samp class="option">rolloff</samp></dt>
  5297. </dl>
  5298. <a name="asr"></a>
  5299. <h3 class="section">8.58 asr<span class="pull-right"><a class="anchor hidden-xs" href="#asr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asr" aria-hidden="true">TOC</a></span></h3>
  5300. <p>Automatic Speech Recognition
  5301. </p>
  5302. <p>This filter uses PocketSphinx for speech recognition. To enable
  5303. compilation of this filter, you need to configure FFmpeg with
  5304. <code class="code">--enable-pocketsphinx</code>.
  5305. </p>
  5306. <p>It accepts the following options:
  5307. </p>
  5308. <dl class="table">
  5309. <dt><samp class="option">rate</samp></dt>
  5310. <dd><p>Set sampling rate of input audio. Defaults is <code class="code">16000</code>.
  5311. This need to match speech models, otherwise one will get poor results.
  5312. </p>
  5313. </dd>
  5314. <dt><samp class="option">hmm</samp></dt>
  5315. <dd><p>Set dictionary containing acoustic model files.
  5316. </p>
  5317. </dd>
  5318. <dt><samp class="option">dict</samp></dt>
  5319. <dd><p>Set pronunciation dictionary.
  5320. </p>
  5321. </dd>
  5322. <dt><samp class="option">lm</samp></dt>
  5323. <dd><p>Set language model file.
  5324. </p>
  5325. </dd>
  5326. <dt><samp class="option">lmctl</samp></dt>
  5327. <dd><p>Set language model set.
  5328. </p>
  5329. </dd>
  5330. <dt><samp class="option">lmname</samp></dt>
  5331. <dd><p>Set which language model to use.
  5332. </p>
  5333. </dd>
  5334. <dt><samp class="option">logfn</samp></dt>
  5335. <dd><p>Set output for log messages.
  5336. </p></dd>
  5337. </dl>
  5338. <p>The filter exports recognized speech as the frame metadata <code class="code">lavfi.asr.text</code>.
  5339. </p>
  5340. <a class="anchor" id="astats"></a><a name="astats-1"></a>
  5341. <h3 class="section">8.59 astats<span class="pull-right"><a class="anchor hidden-xs" href="#astats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-astats-1" aria-hidden="true">TOC</a></span></h3>
  5342. <p>Display time domain statistical information about the audio channels.
  5343. Statistics are calculated and displayed for each audio channel and,
  5344. where applicable, an overall figure is also given.
  5345. </p>
  5346. <p>It accepts the following option:
  5347. </p><dl class="table">
  5348. <dt><samp class="option">length</samp></dt>
  5349. <dd><p>Short window length in seconds, used for peak and through RMS measurement.
  5350. Default is <code class="code">0.05</code> (50 milliseconds). Allowed range is <code class="code">[0 - 10]</code>.
  5351. </p>
  5352. </dd>
  5353. <dt><samp class="option">metadata</samp></dt>
  5354. <dd>
  5355. <p>Set metadata injection. All the metadata keys are prefixed with <code class="code">lavfi.astats.X</code>,
  5356. where <code class="code">X</code> is channel number starting from 1 or string <code class="code">Overall</code>. Default is
  5357. disabled.
  5358. </p>
  5359. <p>Available keys for each channel are:
  5360. <var class="var">Bit_depth</var>
  5361. <var class="var">Crest_factor</var>
  5362. <var class="var">DC_offset</var>
  5363. <var class="var">Dynamic_range</var>
  5364. <var class="var">Entropy</var>
  5365. <var class="var">Flat_factor</var>
  5366. <var class="var">Max_difference</var>
  5367. <var class="var">Max_level</var>
  5368. <var class="var">Mean_difference</var>
  5369. <var class="var">Min_difference</var>
  5370. <var class="var">Min_level</var>
  5371. <var class="var">Noise_floor</var>
  5372. <var class="var">Noise_floor_count</var>
  5373. <var class="var">Number_of_Infs</var>
  5374. <var class="var">Number_of_NaNs</var>
  5375. <var class="var">Number_of_denormals</var>
  5376. <var class="var">Peak_count</var>
  5377. <var class="var">Abs_Peak_count</var>
  5378. <var class="var">Peak_level</var>
  5379. <var class="var">RMS_difference</var>
  5380. <var class="var">RMS_peak</var>
  5381. <var class="var">RMS_trough</var>
  5382. <var class="var">Zero_crossings</var>
  5383. <var class="var">Zero_crossings_rate</var>
  5384. </p>
  5385. <p>and for <code class="code">Overall</code>:
  5386. <var class="var">Bit_depth</var>
  5387. <var class="var">DC_offset</var>
  5388. <var class="var">Entropy</var>
  5389. <var class="var">Flat_factor</var>
  5390. <var class="var">Max_difference</var>
  5391. <var class="var">Max_level</var>
  5392. <var class="var">Mean_difference</var>
  5393. <var class="var">Min_difference</var>
  5394. <var class="var">Min_level</var>
  5395. <var class="var">Noise_floor</var>
  5396. <var class="var">Noise_floor_count</var>
  5397. <var class="var">Number_of_Infs</var>
  5398. <var class="var">Number_of_NaNs</var>
  5399. <var class="var">Number_of_denormals</var>
  5400. <var class="var">Number_of_samples</var>
  5401. <var class="var">Peak_count</var>
  5402. <var class="var">Abs_Peak_count</var>
  5403. <var class="var">Peak_level</var>
  5404. <var class="var">RMS_difference</var>
  5405. <var class="var">RMS_level</var>
  5406. <var class="var">RMS_peak</var>
  5407. <var class="var">RMS_trough</var>
  5408. </p>
  5409. <p>For example, a full key looks like <code class="code">lavfi.astats.1.DC_offset</code> or
  5410. <code class="code">lavfi.astats.Overall.Peak_count</code>.
  5411. </p>
  5412. <p>Read below for the description of the keys.
  5413. </p>
  5414. </dd>
  5415. <dt><samp class="option">reset</samp></dt>
  5416. <dd><p>Set the number of frames over which cumulative stats are calculated before
  5417. being reset. Default is disabled.
  5418. </p>
  5419. </dd>
  5420. <dt><samp class="option">measure_perchannel</samp></dt>
  5421. <dd><p>Select the parameters which are measured per channel. The metadata keys can
  5422. be used as flags, default is <samp class="option">all</samp> which measures everything.
  5423. <samp class="option">none</samp> disables all per channel measurement.
  5424. </p>
  5425. </dd>
  5426. <dt><samp class="option">measure_overall</samp></dt>
  5427. <dd><p>Select the parameters which are measured overall. The metadata keys can
  5428. be used as flags, default is <samp class="option">all</samp> which measures everything.
  5429. <samp class="option">none</samp> disables all overall measurement.
  5430. </p>
  5431. </dd>
  5432. </dl>
  5433. <p>A description of the measure keys follow:
  5434. </p>
  5435. <dl class="table">
  5436. <dt><samp class="option">none</samp></dt>
  5437. <dd><p>no measures
  5438. </p>
  5439. </dd>
  5440. <dt><samp class="option">all</samp></dt>
  5441. <dd><p>all measures
  5442. </p>
  5443. </dd>
  5444. <dt><samp class="option">Bit_depth</samp></dt>
  5445. <dd><p>overall bit depth of audio, i.e. number of bits used for each sample
  5446. </p>
  5447. </dd>
  5448. <dt><samp class="option">Crest_factor</samp></dt>
  5449. <dd><p>standard ratio of peak to RMS level (note: not in dB)
  5450. </p>
  5451. </dd>
  5452. <dt><samp class="option">DC_offset</samp></dt>
  5453. <dd><p>mean amplitude displacement from zero
  5454. </p>
  5455. </dd>
  5456. <dt><samp class="option">Dynamic_range</samp></dt>
  5457. <dd><p>measured dynamic range of audio in dB
  5458. </p>
  5459. </dd>
  5460. <dt><samp class="option">Entropy</samp></dt>
  5461. <dd><p>entropy measured across whole audio, entropy of value near 1.0 is typically measured for white noise
  5462. </p>
  5463. </dd>
  5464. <dt><samp class="option">Flat_factor</samp></dt>
  5465. <dd><p>flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  5466. (i.e. either <var class="var">Min_level</var> or <var class="var">Max_level</var>)
  5467. </p>
  5468. </dd>
  5469. <dt><samp class="option">Max_difference</samp></dt>
  5470. <dd><p>maximal difference between two consecutive samples
  5471. </p>
  5472. </dd>
  5473. <dt><samp class="option">Max_level</samp></dt>
  5474. <dd><p>maximal sample level
  5475. </p>
  5476. </dd>
  5477. <dt><samp class="option">Mean_difference</samp></dt>
  5478. <dd><p>mean difference between two consecutive samples, i.e. the average of each difference between two consecutive samples
  5479. </p>
  5480. </dd>
  5481. <dt><samp class="option">Min_difference</samp></dt>
  5482. <dd><p>minimal difference between two consecutive samples
  5483. </p>
  5484. </dd>
  5485. <dt><samp class="option">Min_level</samp></dt>
  5486. <dd><p>minimal sample level
  5487. </p>
  5488. </dd>
  5489. <dt><samp class="option">Noise_floor</samp></dt>
  5490. <dd><p>minimum local peak measured in dBFS over a short window
  5491. </p>
  5492. </dd>
  5493. <dt><samp class="option">Noise_floor_count</samp></dt>
  5494. <dd><p>number of occasions (not the number of samples) that the signal attained
  5495. <var class="var">Noise floor</var>
  5496. </p>
  5497. </dd>
  5498. <dt><samp class="option">Number_of_Infs</samp></dt>
  5499. <dd><p>number of samples with an infinite value
  5500. </p>
  5501. </dd>
  5502. <dt><samp class="option">Number_of_NaNs</samp></dt>
  5503. <dd><p>number of samples with a NaN (not a number) value
  5504. </p>
  5505. </dd>
  5506. <dt><samp class="option">Number_of_denormals</samp></dt>
  5507. <dd><p>number of samples with a subnormal value
  5508. </p>
  5509. </dd>
  5510. <dt><samp class="option">Number_of_samples</samp></dt>
  5511. <dd><p>number of samples
  5512. </p>
  5513. </dd>
  5514. <dt><samp class="option">Peak_count</samp></dt>
  5515. <dd><p>number of occasions (not the number of samples) that the signal attained either
  5516. <var class="var">Min_level</var> or <var class="var">Max_level</var>
  5517. </p>
  5518. </dd>
  5519. <dt><samp class="option">Abs_Peak_count</samp></dt>
  5520. <dd><p>number of occasions that the absolute samples taken from the signal attained
  5521. max absolute value of <var class="var">Min_level</var> and <var class="var">Max_level</var>
  5522. </p>
  5523. </dd>
  5524. <dt><samp class="option">Peak_level</samp></dt>
  5525. <dd><p>standard peak level measured in dBFS
  5526. </p>
  5527. </dd>
  5528. <dt><samp class="option">RMS_difference</samp></dt>
  5529. <dd><p>Root Mean Square difference between two consecutive samples
  5530. </p>
  5531. </dd>
  5532. <dt><samp class="option">RMS_level</samp></dt>
  5533. <dd><p>standard RMS level measured in dBFS
  5534. </p>
  5535. </dd>
  5536. <dt><samp class="option">RMS_peak</samp></dt>
  5537. <dt><samp class="option">RMS_trough</samp></dt>
  5538. <dd><p>peak and through values for RMS level measured over a short window,
  5539. measured in dBFS.
  5540. </p>
  5541. </dd>
  5542. <dt><samp class="option">Zero crossings</samp></dt>
  5543. <dd><p>number of points where the waveform crosses the zero level axis
  5544. </p>
  5545. </dd>
  5546. <dt><samp class="option">Zero crossings rate</samp></dt>
  5547. <dd><p>rate of Zero crossings and number of audio samples
  5548. </p></dd>
  5549. </dl>
  5550. <a name="asubboost"></a>
  5551. <h3 class="section">8.60 asubboost<span class="pull-right"><a class="anchor hidden-xs" href="#asubboost" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubboost" aria-hidden="true">TOC</a></span></h3>
  5552. <p>Boost subwoofer frequencies.
  5553. </p>
  5554. <p>The filter accepts the following options:
  5555. </p>
  5556. <dl class="table">
  5557. <dt><samp class="option">dry</samp></dt>
  5558. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  5559. Default value is 1.0.
  5560. </p>
  5561. </dd>
  5562. <dt><samp class="option">wet</samp></dt>
  5563. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  5564. Default value is 1.0.
  5565. </p>
  5566. </dd>
  5567. <dt><samp class="option">boost</samp></dt>
  5568. <dd><p>Set max boost factor. Allowed range is from 1 to 12. Default value is 2.
  5569. </p>
  5570. </dd>
  5571. <dt><samp class="option">decay</samp></dt>
  5572. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  5573. Default value is 0.0.
  5574. </p>
  5575. </dd>
  5576. <dt><samp class="option">feedback</samp></dt>
  5577. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  5578. Default value is 0.9.
  5579. </p>
  5580. </dd>
  5581. <dt><samp class="option">cutoff</samp></dt>
  5582. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  5583. Default value is 100.
  5584. </p>
  5585. </dd>
  5586. <dt><samp class="option">slope</samp></dt>
  5587. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  5588. Default value is 0.5.
  5589. </p>
  5590. </dd>
  5591. <dt><samp class="option">delay</samp></dt>
  5592. <dd><p>Set delay. Allowed range is from 1 to 100.
  5593. Default value is 20.
  5594. </p>
  5595. </dd>
  5596. <dt><samp class="option">channels</samp></dt>
  5597. <dd><p>Set the channels to process. Default value is all available.
  5598. </p></dd>
  5599. </dl>
  5600. <a name="Commands-22"></a>
  5601. <h4 class="subsection">8.60.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-22" aria-hidden="true">TOC</a></span></h4>
  5602. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5603. </p>
  5604. <a name="asubcut"></a>
  5605. <h3 class="section">8.61 asubcut<span class="pull-right"><a class="anchor hidden-xs" href="#asubcut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asubcut" aria-hidden="true">TOC</a></span></h3>
  5606. <p>Cut subwoofer frequencies.
  5607. </p>
  5608. <p>This filter allows to set custom, steeper
  5609. roll off than highpass filter, and thus is able to more attenuate
  5610. frequency content in stop-band.
  5611. </p>
  5612. <p>The filter accepts the following options:
  5613. </p>
  5614. <dl class="table">
  5615. <dt><samp class="option">cutoff</samp></dt>
  5616. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  5617. Default value is 20.
  5618. </p>
  5619. </dd>
  5620. <dt><samp class="option">order</samp></dt>
  5621. <dd><p>Set filter order. Available values are from 3 to 20.
  5622. Default value is 10.
  5623. </p>
  5624. </dd>
  5625. <dt><samp class="option">level</samp></dt>
  5626. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  5627. </p></dd>
  5628. </dl>
  5629. <a name="Commands-23"></a>
  5630. <h4 class="subsection">8.61.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-23" aria-hidden="true">TOC</a></span></h4>
  5631. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5632. </p>
  5633. <a name="asupercut"></a>
  5634. <h3 class="section">8.62 asupercut<span class="pull-right"><a class="anchor hidden-xs" href="#asupercut" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asupercut" aria-hidden="true">TOC</a></span></h3>
  5635. <p>Cut super frequencies.
  5636. </p>
  5637. <p>The filter accepts the following options:
  5638. </p>
  5639. <dl class="table">
  5640. <dt><samp class="option">cutoff</samp></dt>
  5641. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  5642. Default value is 20000.
  5643. </p>
  5644. </dd>
  5645. <dt><samp class="option">order</samp></dt>
  5646. <dd><p>Set filter order. Available values are from 3 to 20.
  5647. Default value is 10.
  5648. </p>
  5649. </dd>
  5650. <dt><samp class="option">level</samp></dt>
  5651. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  5652. </p></dd>
  5653. </dl>
  5654. <a name="Commands-24"></a>
  5655. <h4 class="subsection">8.62.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-24" aria-hidden="true">TOC</a></span></h4>
  5656. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5657. </p>
  5658. <a name="asuperpass"></a>
  5659. <h3 class="section">8.63 asuperpass<span class="pull-right"><a class="anchor hidden-xs" href="#asuperpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperpass" aria-hidden="true">TOC</a></span></h3>
  5660. <p>Apply high order Butterworth band-pass filter.
  5661. </p>
  5662. <p>The filter accepts the following options:
  5663. </p>
  5664. <dl class="table">
  5665. <dt><samp class="option">centerf</samp></dt>
  5666. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  5667. Default value is 1000.
  5668. </p>
  5669. </dd>
  5670. <dt><samp class="option">order</samp></dt>
  5671. <dd><p>Set filter order. Available values are from 4 to 20.
  5672. Default value is 4.
  5673. </p>
  5674. </dd>
  5675. <dt><samp class="option">qfactor</samp></dt>
  5676. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  5677. </p>
  5678. </dd>
  5679. <dt><samp class="option">level</samp></dt>
  5680. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  5681. </p></dd>
  5682. </dl>
  5683. <a name="Commands-25"></a>
  5684. <h4 class="subsection">8.63.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-25" aria-hidden="true">TOC</a></span></h4>
  5685. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5686. </p>
  5687. <a name="asuperstop"></a>
  5688. <h3 class="section">8.64 asuperstop<span class="pull-right"><a class="anchor hidden-xs" href="#asuperstop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-asuperstop" aria-hidden="true">TOC</a></span></h3>
  5689. <p>Apply high order Butterworth band-stop filter.
  5690. </p>
  5691. <p>The filter accepts the following options:
  5692. </p>
  5693. <dl class="table">
  5694. <dt><samp class="option">centerf</samp></dt>
  5695. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  5696. Default value is 1000.
  5697. </p>
  5698. </dd>
  5699. <dt><samp class="option">order</samp></dt>
  5700. <dd><p>Set filter order. Available values are from 4 to 20.
  5701. Default value is 4.
  5702. </p>
  5703. </dd>
  5704. <dt><samp class="option">qfactor</samp></dt>
  5705. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  5706. </p>
  5707. </dd>
  5708. <dt><samp class="option">level</samp></dt>
  5709. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  5710. </p></dd>
  5711. </dl>
  5712. <a name="Commands-26"></a>
  5713. <h4 class="subsection">8.64.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-26" aria-hidden="true">TOC</a></span></h4>
  5714. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5715. </p>
  5716. <a name="atempo"></a>
  5717. <h3 class="section">8.65 atempo<span class="pull-right"><a class="anchor hidden-xs" href="#atempo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atempo" aria-hidden="true">TOC</a></span></h3>
  5718. <p>Adjust audio tempo.
  5719. </p>
  5720. <p>The filter accepts exactly one parameter, the audio tempo. If not
  5721. specified then the filter will assume nominal 1.0 tempo. Tempo must
  5722. be in the [0.5, 100.0] range.
  5723. </p>
  5724. <p>Note that tempo greater than 2 will skip some samples rather than
  5725. blend them in. If for any reason this is a concern it is always
  5726. possible to daisy-chain several instances of atempo to achieve the
  5727. desired product tempo.
  5728. </p>
  5729. <a name="Examples-18"></a>
  5730. <h4 class="subsection">8.65.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-18" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-18" aria-hidden="true">TOC</a></span></h4>
  5731. <ul class="itemize mark-bullet">
  5732. <li>Slow down audio to 80% tempo:
  5733. <div class="example">
  5734. <pre class="example-preformatted">atempo=0.8
  5735. </pre></div>
  5736. </li><li>To speed up audio to 300% tempo:
  5737. <div class="example">
  5738. <pre class="example-preformatted">atempo=3
  5739. </pre></div>
  5740. </li><li>To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  5741. <div class="example">
  5742. <pre class="example-preformatted">atempo=sqrt(3),atempo=sqrt(3)
  5743. </pre></div>
  5744. </li></ul>
  5745. <a name="Commands-27"></a>
  5746. <h4 class="subsection">8.65.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-27" aria-hidden="true">TOC</a></span></h4>
  5747. <p>This filter supports the following commands:
  5748. </p><dl class="table">
  5749. <dt><samp class="option">tempo</samp></dt>
  5750. <dd><p>Change filter tempo scale factor.
  5751. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  5752. </p></dd>
  5753. </dl>
  5754. <a name="atilt"></a>
  5755. <h3 class="section">8.66 atilt<span class="pull-right"><a class="anchor hidden-xs" href="#atilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atilt" aria-hidden="true">TOC</a></span></h3>
  5756. <p>Apply spectral tilt filter to audio stream.
  5757. </p>
  5758. <p>This filter apply any spectral roll-off slope over any specified frequency band.
  5759. </p>
  5760. <p>The filter accepts the following options:
  5761. </p>
  5762. <dl class="table">
  5763. <dt><samp class="option">freq</samp></dt>
  5764. <dd><p>Set central frequency of tilt in Hz. Default is 10000 Hz.
  5765. </p>
  5766. </dd>
  5767. <dt><samp class="option">slope</samp></dt>
  5768. <dd><p>Set slope direction of tilt. Default is 0. Allowed range is from -1 to 1.
  5769. </p>
  5770. </dd>
  5771. <dt><samp class="option">width</samp></dt>
  5772. <dd><p>Set width of tilt. Default is 1000. Allowed range is from 100 to 10000.
  5773. </p>
  5774. </dd>
  5775. <dt><samp class="option">order</samp></dt>
  5776. <dd><p>Set order of tilt filter.
  5777. </p>
  5778. </dd>
  5779. <dt><samp class="option">level</samp></dt>
  5780. <dd><p>Set input volume level. Allowed range is from 0 to 4.
  5781. Default is 1.
  5782. </p></dd>
  5783. </dl>
  5784. <a name="Commands-28"></a>
  5785. <h4 class="subsection">8.66.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-28" aria-hidden="true">TOC</a></span></h4>
  5786. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  5787. </p>
  5788. <a name="atrim"></a>
  5789. <h3 class="section">8.67 atrim<span class="pull-right"><a class="anchor hidden-xs" href="#atrim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atrim" aria-hidden="true">TOC</a></span></h3>
  5790. <p>Trim the input so that the output contains one continuous subpart of the input.
  5791. </p>
  5792. <p>It accepts the following parameters:
  5793. </p><dl class="table">
  5794. <dt><samp class="option">start</samp></dt>
  5795. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  5796. sample with the timestamp <var class="var">start</var> will be the first sample in the output.
  5797. </p>
  5798. </dd>
  5799. <dt><samp class="option">end</samp></dt>
  5800. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  5801. audio sample immediately preceding the one with the timestamp <var class="var">end</var> will be
  5802. the last sample in the output.
  5803. </p>
  5804. </dd>
  5805. <dt><samp class="option">start_pts</samp></dt>
  5806. <dd><p>Same as <var class="var">start</var>, except this option sets the start timestamp in samples
  5807. instead of seconds.
  5808. </p>
  5809. </dd>
  5810. <dt><samp class="option">end_pts</samp></dt>
  5811. <dd><p>Same as <var class="var">end</var>, except this option sets the end timestamp in samples instead
  5812. of seconds.
  5813. </p>
  5814. </dd>
  5815. <dt><samp class="option">duration</samp></dt>
  5816. <dd><p>The maximum duration of the output in seconds.
  5817. </p>
  5818. </dd>
  5819. <dt><samp class="option">start_sample</samp></dt>
  5820. <dd><p>The number of the first sample that should be output.
  5821. </p>
  5822. </dd>
  5823. <dt><samp class="option">end_sample</samp></dt>
  5824. <dd><p>The number of the first sample that should be dropped.
  5825. </p></dd>
  5826. </dl>
  5827. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  5828. duration specifications; see
  5829. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>.
  5830. </p>
  5831. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  5832. option look at the frame timestamp, while the _sample options simply count the
  5833. samples that pass through the filter. So start/end_pts and start/end_sample will
  5834. give different results when the timestamps are wrong, inexact or do not start at
  5835. zero. Also note that this filter does not modify the timestamps. If you wish
  5836. to have the output timestamps start at zero, insert the asetpts filter after the
  5837. atrim filter.
  5838. </p>
  5839. <p>If multiple start or end options are set, this filter tries to be greedy and
  5840. keep all samples that match at least one of the specified constraints. To keep
  5841. only the part that matches all the constraints at once, chain multiple atrim
  5842. filters.
  5843. </p>
  5844. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  5845. just the end values to keep everything before the specified time.
  5846. </p>
  5847. <p>Examples:
  5848. </p><ul class="itemize mark-bullet">
  5849. <li>Drop everything except the second minute of input:
  5850. <div class="example">
  5851. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=60:120
  5852. </pre></div>
  5853. </li><li>Keep only the first 1000 samples:
  5854. <div class="example">
  5855. <pre class="example-preformatted">ffmpeg -i INPUT -af atrim=end_sample=1000
  5856. </pre></div>
  5857. </li></ul>
  5858. <a name="axcorrelate"></a>
  5859. <h3 class="section">8.68 axcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#axcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-axcorrelate" aria-hidden="true">TOC</a></span></h3>
  5860. <p>Calculate normalized windowed cross-correlation between two input audio streams.
  5861. </p>
  5862. <p>Resulted samples are always between -1 and 1 inclusive.
  5863. If result is 1 it means two input samples are highly correlated in that selected segment.
  5864. Result 0 means they are not correlated at all.
  5865. If result is -1 it means two input samples are out of phase, which means they cancel each
  5866. other.
  5867. </p>
  5868. <p>The filter accepts the following options:
  5869. </p>
  5870. <dl class="table">
  5871. <dt><samp class="option">size</samp></dt>
  5872. <dd><p>Set size of segment over which cross-correlation is calculated.
  5873. Default is 256. Allowed range is from 2 to 131072.
  5874. </p>
  5875. </dd>
  5876. <dt><samp class="option">algo</samp></dt>
  5877. <dd><p>Set algorithm for cross-correlation. Can be <code class="code">slow</code> or <code class="code">fast</code> or <code class="code">best</code>.
  5878. Default is <code class="code">best</code>. Fast algorithm assumes mean values over any given segment
  5879. are always zero and thus need much less calculations to make.
  5880. This is generally not true, but is valid for typical audio streams.
  5881. </p></dd>
  5882. </dl>
  5883. <a name="Examples-19"></a>
  5884. <h4 class="subsection">8.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-19" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-19" aria-hidden="true">TOC</a></span></h4>
  5885. <ul class="itemize mark-bullet">
  5886. <li>Calculate correlation between channels in stereo audio stream:
  5887. <div class="example">
  5888. <pre class="example-preformatted">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  5889. </pre></div>
  5890. </li></ul>
  5891. <a name="bandpass"></a>
  5892. <h3 class="section">8.69 bandpass<span class="pull-right"><a class="anchor hidden-xs" href="#bandpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandpass" aria-hidden="true">TOC</a></span></h3>
  5893. <p>Apply a two-pole Butterworth band-pass filter with central
  5894. frequency <var class="var">frequency</var>, and (3dB-point) band-width width.
  5895. The <var class="var">csg</var> option selects a constant skirt gain (peak gain = Q)
  5896. instead of the default: constant 0dB peak gain.
  5897. The filter roll off at 6dB per octave (20dB per decade).
  5898. </p>
  5899. <p>The filter accepts the following options:
  5900. </p>
  5901. <dl class="table">
  5902. <dt><samp class="option">frequency, f</samp></dt>
  5903. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  5904. </p>
  5905. </dd>
  5906. <dt><samp class="option">csg</samp></dt>
  5907. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  5908. </p>
  5909. </dd>
  5910. <dt><samp class="option">width_type, t</samp></dt>
  5911. <dd><p>Set method to specify band-width of filter.
  5912. </p><dl class="table">
  5913. <dt><samp class="option">h</samp></dt>
  5914. <dd><p>Hz
  5915. </p></dd>
  5916. <dt><samp class="option">q</samp></dt>
  5917. <dd><p>Q-Factor
  5918. </p></dd>
  5919. <dt><samp class="option">o</samp></dt>
  5920. <dd><p>octave
  5921. </p></dd>
  5922. <dt><samp class="option">s</samp></dt>
  5923. <dd><p>slope
  5924. </p></dd>
  5925. <dt><samp class="option">k</samp></dt>
  5926. <dd><p>kHz
  5927. </p></dd>
  5928. </dl>
  5929. </dd>
  5930. <dt><samp class="option">width, w</samp></dt>
  5931. <dd><p>Specify the band-width of a filter in width_type units.
  5932. </p>
  5933. </dd>
  5934. <dt><samp class="option">mix, m</samp></dt>
  5935. <dd><p>How much to use filtered signal in output. Default is 1.
  5936. Range is between 0 and 1.
  5937. </p>
  5938. </dd>
  5939. <dt><samp class="option">channels, c</samp></dt>
  5940. <dd><p>Specify which channels to filter, by default all available are filtered.
  5941. </p>
  5942. </dd>
  5943. <dt><samp class="option">normalize, n</samp></dt>
  5944. <dd><p>Normalize biquad coefficients, by default is disabled.
  5945. Enabling it will normalize magnitude response at DC to 0dB.
  5946. </p>
  5947. </dd>
  5948. <dt><samp class="option">transform, a</samp></dt>
  5949. <dd><p>Set transform type of IIR filter.
  5950. </p><dl class="table">
  5951. <dt><samp class="option">di</samp></dt>
  5952. <dt><samp class="option">dii</samp></dt>
  5953. <dt><samp class="option">tdi</samp></dt>
  5954. <dt><samp class="option">tdii</samp></dt>
  5955. <dt><samp class="option">latt</samp></dt>
  5956. <dt><samp class="option">svf</samp></dt>
  5957. <dt><samp class="option">zdf</samp></dt>
  5958. </dl>
  5959. </dd>
  5960. <dt><samp class="option">precision, r</samp></dt>
  5961. <dd><p>Set precision of filtering.
  5962. </p><dl class="table">
  5963. <dt><samp class="option">auto</samp></dt>
  5964. <dd><p>Pick automatic sample format depending on surround filters.
  5965. </p></dd>
  5966. <dt><samp class="option">s16</samp></dt>
  5967. <dd><p>Always use signed 16-bit.
  5968. </p></dd>
  5969. <dt><samp class="option">s32</samp></dt>
  5970. <dd><p>Always use signed 32-bit.
  5971. </p></dd>
  5972. <dt><samp class="option">f32</samp></dt>
  5973. <dd><p>Always use float 32-bit.
  5974. </p></dd>
  5975. <dt><samp class="option">f64</samp></dt>
  5976. <dd><p>Always use float 64-bit.
  5977. </p></dd>
  5978. </dl>
  5979. </dd>
  5980. <dt><samp class="option">block_size, b</samp></dt>
  5981. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  5982. value (higher than impulse response length truncated when reaches near zero values) filtering
  5983. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  5984. </p>
  5985. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  5986. </p></dd>
  5987. </dl>
  5988. <a name="Commands-29"></a>
  5989. <h4 class="subsection">8.69.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-29" aria-hidden="true">TOC</a></span></h4>
  5990. <p>This filter supports the following commands:
  5991. </p><dl class="table">
  5992. <dt><samp class="option">frequency, f</samp></dt>
  5993. <dd><p>Change bandpass frequency.
  5994. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  5995. </p>
  5996. </dd>
  5997. <dt><samp class="option">width_type, t</samp></dt>
  5998. <dd><p>Change bandpass width_type.
  5999. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  6000. </p>
  6001. </dd>
  6002. <dt><samp class="option">width, w</samp></dt>
  6003. <dd><p>Change bandpass width.
  6004. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  6005. </p>
  6006. </dd>
  6007. <dt><samp class="option">mix, m</samp></dt>
  6008. <dd><p>Change bandpass mix.
  6009. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  6010. </p></dd>
  6011. </dl>
  6012. <a name="bandreject"></a>
  6013. <h3 class="section">8.70 bandreject<span class="pull-right"><a class="anchor hidden-xs" href="#bandreject" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bandreject" aria-hidden="true">TOC</a></span></h3>
  6014. <p>Apply a two-pole Butterworth band-reject filter with central
  6015. frequency <var class="var">frequency</var>, and (3dB-point) band-width <var class="var">width</var>.
  6016. The filter roll off at 6dB per octave (20dB per decade).
  6017. </p>
  6018. <p>The filter accepts the following options:
  6019. </p>
  6020. <dl class="table">
  6021. <dt><samp class="option">frequency, f</samp></dt>
  6022. <dd><p>Set the filter&rsquo;s central frequency. Default is <code class="code">3000</code>.
  6023. </p>
  6024. </dd>
  6025. <dt><samp class="option">width_type, t</samp></dt>
  6026. <dd><p>Set method to specify band-width of filter.
  6027. </p><dl class="table">
  6028. <dt><samp class="option">h</samp></dt>
  6029. <dd><p>Hz
  6030. </p></dd>
  6031. <dt><samp class="option">q</samp></dt>
  6032. <dd><p>Q-Factor
  6033. </p></dd>
  6034. <dt><samp class="option">o</samp></dt>
  6035. <dd><p>octave
  6036. </p></dd>
  6037. <dt><samp class="option">s</samp></dt>
  6038. <dd><p>slope
  6039. </p></dd>
  6040. <dt><samp class="option">k</samp></dt>
  6041. <dd><p>kHz
  6042. </p></dd>
  6043. </dl>
  6044. </dd>
  6045. <dt><samp class="option">width, w</samp></dt>
  6046. <dd><p>Specify the band-width of a filter in width_type units.
  6047. </p>
  6048. </dd>
  6049. <dt><samp class="option">mix, m</samp></dt>
  6050. <dd><p>How much to use filtered signal in output. Default is 1.
  6051. Range is between 0 and 1.
  6052. </p>
  6053. </dd>
  6054. <dt><samp class="option">channels, c</samp></dt>
  6055. <dd><p>Specify which channels to filter, by default all available are filtered.
  6056. </p>
  6057. </dd>
  6058. <dt><samp class="option">normalize, n</samp></dt>
  6059. <dd><p>Normalize biquad coefficients, by default is disabled.
  6060. Enabling it will normalize magnitude response at DC to 0dB.
  6061. </p>
  6062. </dd>
  6063. <dt><samp class="option">transform, a</samp></dt>
  6064. <dd><p>Set transform type of IIR filter.
  6065. </p><dl class="table">
  6066. <dt><samp class="option">di</samp></dt>
  6067. <dt><samp class="option">dii</samp></dt>
  6068. <dt><samp class="option">tdi</samp></dt>
  6069. <dt><samp class="option">tdii</samp></dt>
  6070. <dt><samp class="option">latt</samp></dt>
  6071. <dt><samp class="option">svf</samp></dt>
  6072. <dt><samp class="option">zdf</samp></dt>
  6073. </dl>
  6074. </dd>
  6075. <dt><samp class="option">precision, r</samp></dt>
  6076. <dd><p>Set precision of filtering.
  6077. </p><dl class="table">
  6078. <dt><samp class="option">auto</samp></dt>
  6079. <dd><p>Pick automatic sample format depending on surround filters.
  6080. </p></dd>
  6081. <dt><samp class="option">s16</samp></dt>
  6082. <dd><p>Always use signed 16-bit.
  6083. </p></dd>
  6084. <dt><samp class="option">s32</samp></dt>
  6085. <dd><p>Always use signed 32-bit.
  6086. </p></dd>
  6087. <dt><samp class="option">f32</samp></dt>
  6088. <dd><p>Always use float 32-bit.
  6089. </p></dd>
  6090. <dt><samp class="option">f64</samp></dt>
  6091. <dd><p>Always use float 64-bit.
  6092. </p></dd>
  6093. </dl>
  6094. </dd>
  6095. <dt><samp class="option">block_size, b</samp></dt>
  6096. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  6097. value (higher than impulse response length truncated when reaches near zero values) filtering
  6098. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  6099. </p>
  6100. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  6101. </p></dd>
  6102. </dl>
  6103. <a name="Commands-30"></a>
  6104. <h4 class="subsection">8.70.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-30" aria-hidden="true">TOC</a></span></h4>
  6105. <p>This filter supports the following commands:
  6106. </p><dl class="table">
  6107. <dt><samp class="option">frequency, f</samp></dt>
  6108. <dd><p>Change bandreject frequency.
  6109. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  6110. </p>
  6111. </dd>
  6112. <dt><samp class="option">width_type, t</samp></dt>
  6113. <dd><p>Change bandreject width_type.
  6114. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  6115. </p>
  6116. </dd>
  6117. <dt><samp class="option">width, w</samp></dt>
  6118. <dd><p>Change bandreject width.
  6119. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  6120. </p>
  6121. </dd>
  6122. <dt><samp class="option">mix, m</samp></dt>
  6123. <dd><p>Change bandreject mix.
  6124. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  6125. </p></dd>
  6126. </dl>
  6127. <a name="bass_002c-lowshelf"></a>
  6128. <h3 class="section">8.71 bass, lowshelf<span class="pull-right"><a class="anchor hidden-xs" href="#bass_002c-lowshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bass_002c-lowshelf" aria-hidden="true">TOC</a></span></h3>
  6129. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  6130. shelving filter with a response similar to that of a standard
  6131. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  6132. </p>
  6133. <p>The filter accepts the following options:
  6134. </p>
  6135. <dl class="table">
  6136. <dt><samp class="option">gain, g</samp></dt>
  6137. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  6138. (for a large cut) to +20 (for a large boost).
  6139. Beware of clipping when using a positive gain.
  6140. </p>
  6141. </dd>
  6142. <dt><samp class="option">frequency, f</samp></dt>
  6143. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  6144. to extend or reduce the frequency range to be boosted or cut.
  6145. The default value is <code class="code">100</code> Hz.
  6146. </p>
  6147. </dd>
  6148. <dt><samp class="option">width_type, t</samp></dt>
  6149. <dd><p>Set method to specify band-width of filter.
  6150. </p><dl class="table">
  6151. <dt><samp class="option">h</samp></dt>
  6152. <dd><p>Hz
  6153. </p></dd>
  6154. <dt><samp class="option">q</samp></dt>
  6155. <dd><p>Q-Factor
  6156. </p></dd>
  6157. <dt><samp class="option">o</samp></dt>
  6158. <dd><p>octave
  6159. </p></dd>
  6160. <dt><samp class="option">s</samp></dt>
  6161. <dd><p>slope
  6162. </p></dd>
  6163. <dt><samp class="option">k</samp></dt>
  6164. <dd><p>kHz
  6165. </p></dd>
  6166. </dl>
  6167. </dd>
  6168. <dt><samp class="option">width, w</samp></dt>
  6169. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  6170. </p>
  6171. </dd>
  6172. <dt><samp class="option">poles, p</samp></dt>
  6173. <dd><p>Set number of poles. Default is 2.
  6174. </p>
  6175. </dd>
  6176. <dt><samp class="option">mix, m</samp></dt>
  6177. <dd><p>How much to use filtered signal in output. Default is 1.
  6178. Range is between 0 and 1.
  6179. </p>
  6180. </dd>
  6181. <dt><samp class="option">channels, c</samp></dt>
  6182. <dd><p>Specify which channels to filter, by default all available are filtered.
  6183. </p>
  6184. </dd>
  6185. <dt><samp class="option">normalize, n</samp></dt>
  6186. <dd><p>Normalize biquad coefficients, by default is disabled.
  6187. Enabling it will normalize magnitude response at DC to 0dB.
  6188. </p>
  6189. </dd>
  6190. <dt><samp class="option">transform, a</samp></dt>
  6191. <dd><p>Set transform type of IIR filter.
  6192. </p><dl class="table">
  6193. <dt><samp class="option">di</samp></dt>
  6194. <dt><samp class="option">dii</samp></dt>
  6195. <dt><samp class="option">tdi</samp></dt>
  6196. <dt><samp class="option">tdii</samp></dt>
  6197. <dt><samp class="option">latt</samp></dt>
  6198. <dt><samp class="option">svf</samp></dt>
  6199. <dt><samp class="option">zdf</samp></dt>
  6200. </dl>
  6201. </dd>
  6202. <dt><samp class="option">precision, r</samp></dt>
  6203. <dd><p>Set precision of filtering.
  6204. </p><dl class="table">
  6205. <dt><samp class="option">auto</samp></dt>
  6206. <dd><p>Pick automatic sample format depending on surround filters.
  6207. </p></dd>
  6208. <dt><samp class="option">s16</samp></dt>
  6209. <dd><p>Always use signed 16-bit.
  6210. </p></dd>
  6211. <dt><samp class="option">s32</samp></dt>
  6212. <dd><p>Always use signed 32-bit.
  6213. </p></dd>
  6214. <dt><samp class="option">f32</samp></dt>
  6215. <dd><p>Always use float 32-bit.
  6216. </p></dd>
  6217. <dt><samp class="option">f64</samp></dt>
  6218. <dd><p>Always use float 64-bit.
  6219. </p></dd>
  6220. </dl>
  6221. </dd>
  6222. <dt><samp class="option">block_size, b</samp></dt>
  6223. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  6224. value (higher than impulse response length truncated when reaches near zero values) filtering
  6225. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  6226. </p>
  6227. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  6228. </p></dd>
  6229. </dl>
  6230. <a name="Commands-31"></a>
  6231. <h4 class="subsection">8.71.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-31" aria-hidden="true">TOC</a></span></h4>
  6232. <p>This filter supports the following commands:
  6233. </p><dl class="table">
  6234. <dt><samp class="option">frequency, f</samp></dt>
  6235. <dd><p>Change bass frequency.
  6236. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  6237. </p>
  6238. </dd>
  6239. <dt><samp class="option">width_type, t</samp></dt>
  6240. <dd><p>Change bass width_type.
  6241. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  6242. </p>
  6243. </dd>
  6244. <dt><samp class="option">width, w</samp></dt>
  6245. <dd><p>Change bass width.
  6246. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  6247. </p>
  6248. </dd>
  6249. <dt><samp class="option">gain, g</samp></dt>
  6250. <dd><p>Change bass gain.
  6251. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  6252. </p>
  6253. </dd>
  6254. <dt><samp class="option">mix, m</samp></dt>
  6255. <dd><p>Change bass mix.
  6256. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  6257. </p></dd>
  6258. </dl>
  6259. <a name="biquad"></a>
  6260. <h3 class="section">8.72 biquad<span class="pull-right"><a class="anchor hidden-xs" href="#biquad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-biquad" aria-hidden="true">TOC</a></span></h3>
  6261. <p>Apply a biquad IIR filter with the given coefficients.
  6262. Where <var class="var">b0</var>, <var class="var">b1</var>, <var class="var">b2</var> and <var class="var">a0</var>, <var class="var">a1</var>, <var class="var">a2</var>
  6263. are the numerator and denominator coefficients respectively.
  6264. and <var class="var">channels</var>, <var class="var">c</var> specify which channels to filter, by default all
  6265. available are filtered.
  6266. </p>
  6267. <a name="Commands-32"></a>
  6268. <h4 class="subsection">8.72.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-32" aria-hidden="true">TOC</a></span></h4>
  6269. <p>This filter supports the following commands:
  6270. </p><dl class="table">
  6271. <dt><samp class="option">a0</samp></dt>
  6272. <dt><samp class="option">a1</samp></dt>
  6273. <dt><samp class="option">a2</samp></dt>
  6274. <dt><samp class="option">b0</samp></dt>
  6275. <dt><samp class="option">b1</samp></dt>
  6276. <dt><samp class="option">b2</samp></dt>
  6277. <dd><p>Change biquad parameter.
  6278. Syntax for the command is : &quot;<var class="var">value</var>&quot;
  6279. </p>
  6280. </dd>
  6281. <dt><samp class="option">mix, m</samp></dt>
  6282. <dd><p>How much to use filtered signal in output. Default is 1.
  6283. Range is between 0 and 1.
  6284. </p>
  6285. </dd>
  6286. <dt><samp class="option">channels, c</samp></dt>
  6287. <dd><p>Specify which channels to filter, by default all available are filtered.
  6288. </p>
  6289. </dd>
  6290. <dt><samp class="option">normalize, n</samp></dt>
  6291. <dd><p>Normalize biquad coefficients, by default is disabled.
  6292. Enabling it will normalize magnitude response at DC to 0dB.
  6293. </p>
  6294. </dd>
  6295. <dt><samp class="option">transform, a</samp></dt>
  6296. <dd><p>Set transform type of IIR filter.
  6297. </p><dl class="table">
  6298. <dt><samp class="option">di</samp></dt>
  6299. <dt><samp class="option">dii</samp></dt>
  6300. <dt><samp class="option">tdi</samp></dt>
  6301. <dt><samp class="option">tdii</samp></dt>
  6302. <dt><samp class="option">latt</samp></dt>
  6303. <dt><samp class="option">svf</samp></dt>
  6304. <dt><samp class="option">zdf</samp></dt>
  6305. </dl>
  6306. </dd>
  6307. <dt><samp class="option">precision, r</samp></dt>
  6308. <dd><p>Set precision of filtering.
  6309. </p><dl class="table">
  6310. <dt><samp class="option">auto</samp></dt>
  6311. <dd><p>Pick automatic sample format depending on surround filters.
  6312. </p></dd>
  6313. <dt><samp class="option">s16</samp></dt>
  6314. <dd><p>Always use signed 16-bit.
  6315. </p></dd>
  6316. <dt><samp class="option">s32</samp></dt>
  6317. <dd><p>Always use signed 32-bit.
  6318. </p></dd>
  6319. <dt><samp class="option">f32</samp></dt>
  6320. <dd><p>Always use float 32-bit.
  6321. </p></dd>
  6322. <dt><samp class="option">f64</samp></dt>
  6323. <dd><p>Always use float 64-bit.
  6324. </p></dd>
  6325. </dl>
  6326. </dd>
  6327. <dt><samp class="option">block_size, b</samp></dt>
  6328. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  6329. value (higher than impulse response length truncated when reaches near zero values) filtering
  6330. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  6331. </p>
  6332. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  6333. </p></dd>
  6334. </dl>
  6335. <a name="bs2b"></a>
  6336. <h3 class="section">8.73 bs2b<span class="pull-right"><a class="anchor hidden-xs" href="#bs2b" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bs2b" aria-hidden="true">TOC</a></span></h3>
  6337. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  6338. stereo audio records.
  6339. </p>
  6340. <p>To enable compilation of this filter you need to configure FFmpeg with
  6341. <code class="code">--enable-libbs2b</code>.
  6342. </p>
  6343. <p>It accepts the following parameters:
  6344. </p><dl class="table">
  6345. <dt><samp class="option">profile</samp></dt>
  6346. <dd><p>Pre-defined crossfeed level.
  6347. </p><dl class="table">
  6348. <dt><samp class="option">default</samp></dt>
  6349. <dd><p>Default level (fcut=700, feed=50).
  6350. </p>
  6351. </dd>
  6352. <dt><samp class="option">cmoy</samp></dt>
  6353. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  6354. </p>
  6355. </dd>
  6356. <dt><samp class="option">jmeier</samp></dt>
  6357. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  6358. </p>
  6359. </dd>
  6360. </dl>
  6361. </dd>
  6362. <dt><samp class="option">fcut</samp></dt>
  6363. <dd><p>Cut frequency (in Hz).
  6364. </p>
  6365. </dd>
  6366. <dt><samp class="option">feed</samp></dt>
  6367. <dd><p>Feed level (in Hz).
  6368. </p>
  6369. </dd>
  6370. </dl>
  6371. <a name="channelmap"></a>
  6372. <h3 class="section">8.74 channelmap<span class="pull-right"><a class="anchor hidden-xs" href="#channelmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelmap" aria-hidden="true">TOC</a></span></h3>
  6373. <p>Remap input channels to new locations.
  6374. </p>
  6375. <p>It accepts the following parameters:
  6376. </p><dl class="table">
  6377. <dt><samp class="option">map</samp></dt>
  6378. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  6379. mappings, each in the <code class="code"><var class="var">in_channel</var>-<var class="var">out_channel</var></code> or
  6380. <code class="code"><var class="var">in_channel</var></code> form. <var class="var">in_channel</var> can be either the name of the
  6381. input channel (e.g. FL for front left) or its index in the input channel
  6382. layout. <var class="var">out_channel</var> is the name of the output channel or its index in the
  6383. output channel layout. If <var class="var">out_channel</var> is not given then it is implicitly
  6384. an index, starting with zero and increasing by one for each mapping. Mixing
  6385. different types of mappings is not allowed and will result in a parse error.
  6386. </p>
  6387. </dd>
  6388. <dt><samp class="option">channel_layout</samp></dt>
  6389. <dd><p>The channel layout of the output stream. If not specified, then filter will
  6390. guess it based on the <var class="var">out_channel</var> names or the number of mappings.
  6391. Guessed layouts will not necessarily contain channels in the order of the
  6392. mappings.
  6393. </p></dd>
  6394. </dl>
  6395. <p>If no mapping is present, the filter will implicitly map input channels to
  6396. output channels, preserving indices.
  6397. </p>
  6398. <a name="Examples-20"></a>
  6399. <h4 class="subsection">8.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-20" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-20" aria-hidden="true">TOC</a></span></h4>
  6400. <ul class="itemize mark-bullet">
  6401. <li>For example, assuming a 5.1+downmix input MOV file,
  6402. <div class="example">
  6403. <pre class="example-preformatted">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  6404. </pre></div>
  6405. <p>will create an output WAV file tagged as stereo from the downmix channels of
  6406. the input.
  6407. </p>
  6408. </li><li>To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  6409. <div class="example">
  6410. <pre class="example-preformatted">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  6411. </pre></div>
  6412. </li></ul>
  6413. <a name="channelsplit"></a>
  6414. <h3 class="section">8.75 channelsplit<span class="pull-right"><a class="anchor hidden-xs" href="#channelsplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-channelsplit" aria-hidden="true">TOC</a></span></h3>
  6415. <p>Split each channel from an input audio stream into a separate output stream.
  6416. </p>
  6417. <p>It accepts the following parameters:
  6418. </p><dl class="table">
  6419. <dt><samp class="option">channel_layout</samp></dt>
  6420. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  6421. </p></dd>
  6422. <dt><samp class="option">channels</samp></dt>
  6423. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  6424. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  6425. </p>
  6426. <p>Choosing channels not present in channel layout in the input will result in an error.
  6427. </p></dd>
  6428. </dl>
  6429. <a name="Examples-21"></a>
  6430. <h4 class="subsection">8.75.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-21" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-21" aria-hidden="true">TOC</a></span></h4>
  6431. <ul class="itemize mark-bullet">
  6432. <li>For example, assuming a stereo input MP3 file,
  6433. <div class="example">
  6434. <pre class="example-preformatted">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  6435. </pre></div>
  6436. <p>will create an output Matroska file with two audio streams, one containing only
  6437. the left channel and the other the right channel.
  6438. </p>
  6439. </li><li>Split a 5.1 WAV file into per-channel files:
  6440. <div class="example">
  6441. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex
  6442. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  6443. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  6444. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  6445. side_right.wav
  6446. </pre></div>
  6447. </li><li>Extract only LFE from a 5.1 WAV file:
  6448. <div class="example">
  6449. <pre class="example-preformatted">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  6450. -map '[LFE]' lfe.wav
  6451. </pre></div>
  6452. </li></ul>
  6453. <a name="chorus"></a>
  6454. <h3 class="section">8.76 chorus<span class="pull-right"><a class="anchor hidden-xs" href="#chorus" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chorus" aria-hidden="true">TOC</a></span></h3>
  6455. <p>Add a chorus effect to the audio.
  6456. </p>
  6457. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  6458. </p>
  6459. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  6460. constant, with chorus, it is varied using sinusoidal or triangular modulation.
  6461. The modulation depth defines the range the modulated delay is played before or after
  6462. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  6463. sound tuned around the original one, like in a chorus where some vocals are slightly
  6464. off key.
  6465. </p>
  6466. <p>It accepts the following parameters:
  6467. </p><dl class="table">
  6468. <dt><samp class="option">in_gain</samp></dt>
  6469. <dd><p>Set input gain. Default is 0.4.
  6470. </p>
  6471. </dd>
  6472. <dt><samp class="option">out_gain</samp></dt>
  6473. <dd><p>Set output gain. Default is 0.4.
  6474. </p>
  6475. </dd>
  6476. <dt><samp class="option">delays</samp></dt>
  6477. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  6478. </p>
  6479. </dd>
  6480. <dt><samp class="option">decays</samp></dt>
  6481. <dd><p>Set decays.
  6482. </p>
  6483. </dd>
  6484. <dt><samp class="option">speeds</samp></dt>
  6485. <dd><p>Set speeds.
  6486. </p>
  6487. </dd>
  6488. <dt><samp class="option">depths</samp></dt>
  6489. <dd><p>Set depths.
  6490. </p></dd>
  6491. </dl>
  6492. <a name="Examples-22"></a>
  6493. <h4 class="subsection">8.76.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-22" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-22" aria-hidden="true">TOC</a></span></h4>
  6494. <ul class="itemize mark-bullet">
  6495. <li>A single delay:
  6496. <div class="example">
  6497. <pre class="example-preformatted">chorus=0.7:0.9:55:0.4:0.25:2
  6498. </pre></div>
  6499. </li><li>Two delays:
  6500. <div class="example">
  6501. <pre class="example-preformatted">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  6502. </pre></div>
  6503. </li><li>Fuller sounding chorus with three delays:
  6504. <div class="example">
  6505. <pre class="example-preformatted">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
  6506. </pre></div>
  6507. </li></ul>
  6508. <a name="compand"></a>
  6509. <h3 class="section">8.77 compand<span class="pull-right"><a class="anchor hidden-xs" href="#compand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compand" aria-hidden="true">TOC</a></span></h3>
  6510. <p>Compress or expand the audio&rsquo;s dynamic range.
  6511. </p>
  6512. <p>It accepts the following parameters:
  6513. </p>
  6514. <dl class="table">
  6515. <dt><samp class="option">attacks</samp></dt>
  6516. <dt><samp class="option">decays</samp></dt>
  6517. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  6518. of the input signal is averaged to determine its volume. <var class="var">attacks</var> refers to
  6519. increase of volume and <var class="var">decays</var> refers to decrease of volume. For most
  6520. situations, the attack time (response to the audio getting louder) should be
  6521. shorter than the decay time, because the human ear is more sensitive to sudden
  6522. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  6523. a typical value for decay is 0.8 seconds.
  6524. If specified number of attacks &amp; decays is lower than number of channels, the last
  6525. set attack/decay will be used for all remaining channels.
  6526. </p>
  6527. </dd>
  6528. <dt><samp class="option">points</samp></dt>
  6529. <dd><p>A list of points for the transfer function, specified in dB relative to the
  6530. maximum possible signal amplitude. Each key points list must be defined using
  6531. the following syntax: <code class="code">x0/y0|x1/y1|x2/y2|....</code> or
  6532. <code class="code">x0/y0 x1/y1 x2/y2 ....</code>
  6533. </p>
  6534. <p>The input values must be in strictly increasing order but the transfer function
  6535. does not have to be monotonically rising. The point <code class="code">0/0</code> is assumed but
  6536. may be overridden (by <code class="code">0/out-dBn</code>). Typical values for the transfer
  6537. function are <code class="code">-70/-70|-60/-20|1/0</code>.
  6538. </p>
  6539. </dd>
  6540. <dt><samp class="option">soft-knee</samp></dt>
  6541. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  6542. </p>
  6543. </dd>
  6544. <dt><samp class="option">gain</samp></dt>
  6545. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  6546. function. This allows for easy adjustment of the overall gain.
  6547. It defaults to 0.
  6548. </p>
  6549. </dd>
  6550. <dt><samp class="option">volume</samp></dt>
  6551. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  6552. starts. This permits the user to supply a nominal level initially, so that, for
  6553. example, a very large gain is not applied to initial signal levels before the
  6554. companding has begun to operate. A typical value for audio which is initially
  6555. quiet is -90 dB. It defaults to 0.
  6556. </p>
  6557. </dd>
  6558. <dt><samp class="option">delay</samp></dt>
  6559. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  6560. delayed before being fed to the volume adjuster. Specifying a delay
  6561. approximately equal to the attack/decay times allows the filter to effectively
  6562. operate in predictive rather than reactive mode. It defaults to 0.
  6563. </p>
  6564. </dd>
  6565. </dl>
  6566. <a name="Examples-23"></a>
  6567. <h4 class="subsection">8.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-23" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-23" aria-hidden="true">TOC</a></span></h4>
  6568. <ul class="itemize mark-bullet">
  6569. <li>Make music with both quiet and loud passages suitable for listening to in a
  6570. noisy environment:
  6571. <div class="example">
  6572. <pre class="example-preformatted">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  6573. </pre></div>
  6574. <p>Another example for audio with whisper and explosion parts:
  6575. </p><div class="example">
  6576. <pre class="example-preformatted">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  6577. </pre></div>
  6578. </li><li>A noise gate for when the noise is at a lower level than the signal:
  6579. <div class="example">
  6580. <pre class="example-preformatted">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  6581. </pre></div>
  6582. </li><li>Here is another noise gate, this time for when the noise is at a higher level
  6583. than the signal (making it, in some ways, similar to squelch):
  6584. <div class="example">
  6585. <pre class="example-preformatted">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  6586. </pre></div>
  6587. </li><li>2:1 compression starting at -6dB:
  6588. <div class="example">
  6589. <pre class="example-preformatted">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  6590. </pre></div>
  6591. </li><li>2:1 compression starting at -9dB:
  6592. <div class="example">
  6593. <pre class="example-preformatted">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  6594. </pre></div>
  6595. </li><li>2:1 compression starting at -12dB:
  6596. <div class="example">
  6597. <pre class="example-preformatted">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  6598. </pre></div>
  6599. </li><li>2:1 compression starting at -18dB:
  6600. <div class="example">
  6601. <pre class="example-preformatted">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  6602. </pre></div>
  6603. </li><li>3:1 compression starting at -15dB:
  6604. <div class="example">
  6605. <pre class="example-preformatted">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  6606. </pre></div>
  6607. </li><li>Compressor/Gate:
  6608. <div class="example">
  6609. <pre class="example-preformatted">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  6610. </pre></div>
  6611. </li><li>Expander:
  6612. <div class="example">
  6613. <pre class="example-preformatted">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
  6614. </pre></div>
  6615. </li><li>Hard limiter at -6dB:
  6616. <div class="example">
  6617. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  6618. </pre></div>
  6619. </li><li>Hard limiter at -12dB:
  6620. <div class="example">
  6621. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  6622. </pre></div>
  6623. </li><li>Hard noise gate at -35 dB:
  6624. <div class="example">
  6625. <pre class="example-preformatted">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  6626. </pre></div>
  6627. </li><li>Soft limiter:
  6628. <div class="example">
  6629. <pre class="example-preformatted">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  6630. </pre></div>
  6631. </li></ul>
  6632. <a name="compensationdelay"></a>
  6633. <h3 class="section">8.78 compensationdelay<span class="pull-right"><a class="anchor hidden-xs" href="#compensationdelay" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-compensationdelay" aria-hidden="true">TOC</a></span></h3>
  6634. <p>Compensation Delay Line is a metric based delay to compensate differing
  6635. positions of microphones or speakers.
  6636. </p>
  6637. <p>For example, you have recorded guitar with two microphones placed in
  6638. different locations. Because the front of sound wave has fixed speed in
  6639. normal conditions, the phasing of microphones can vary and depends on
  6640. their location and interposition. The best sound mix can be achieved when
  6641. these microphones are in phase (synchronized). Note that a distance of
  6642. ~30 cm between microphones makes one microphone capture the signal in
  6643. antiphase to the other microphone. That makes the final mix sound moody.
  6644. This filter helps to solve phasing problems by adding different delays
  6645. to each microphone track and make them synchronized.
  6646. </p>
  6647. <p>The best result can be reached when you take one track as base and
  6648. synchronize other tracks one by one with it.
  6649. Remember that synchronization/delay tolerance depends on sample rate, too.
  6650. Higher sample rates will give more tolerance.
  6651. </p>
  6652. <p>The filter accepts the following parameters:
  6653. </p>
  6654. <dl class="table">
  6655. <dt><samp class="option">mm</samp></dt>
  6656. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  6657. Default is 0.
  6658. </p>
  6659. </dd>
  6660. <dt><samp class="option">cm</samp></dt>
  6661. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  6662. Default is 0.
  6663. </p>
  6664. </dd>
  6665. <dt><samp class="option">m</samp></dt>
  6666. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  6667. Default is 0.
  6668. </p>
  6669. </dd>
  6670. <dt><samp class="option">dry</samp></dt>
  6671. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  6672. Default is 0.
  6673. </p>
  6674. </dd>
  6675. <dt><samp class="option">wet</samp></dt>
  6676. <dd><p>Set wet amount. Amount of processed (wet) signal.
  6677. Default is 1.
  6678. </p>
  6679. </dd>
  6680. <dt><samp class="option">temp</samp></dt>
  6681. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  6682. Default is 20.
  6683. </p></dd>
  6684. </dl>
  6685. <a name="Commands-33"></a>
  6686. <h4 class="subsection">8.78.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-33" aria-hidden="true">TOC</a></span></h4>
  6687. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  6688. </p>
  6689. <a name="crossfeed"></a>
  6690. <h3 class="section">8.79 crossfeed<span class="pull-right"><a class="anchor hidden-xs" href="#crossfeed" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crossfeed" aria-hidden="true">TOC</a></span></h3>
  6691. <p>Apply headphone crossfeed filter.
  6692. </p>
  6693. <p>Crossfeed is the process of blending the left and right channels of stereo
  6694. audio recording.
  6695. It is mainly used to reduce extreme stereo separation of low frequencies.
  6696. </p>
  6697. <p>The intent is to produce more speaker like sound to the listener.
  6698. </p>
  6699. <p>The filter accepts the following options:
  6700. </p>
  6701. <dl class="table">
  6702. <dt><samp class="option">strength</samp></dt>
  6703. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  6704. This sets gain of low shelf filter for side part of stereo image.
  6705. Default is -6dB. Max allowed is -30db when strength is set to 1.
  6706. </p>
  6707. </dd>
  6708. <dt><samp class="option">range</samp></dt>
  6709. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  6710. This sets cut off frequency of low shelf filter. Default is cut off near
  6711. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  6712. </p>
  6713. </dd>
  6714. <dt><samp class="option">slope</samp></dt>
  6715. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  6716. Allowed range is from 0.01 to 1.
  6717. </p>
  6718. </dd>
  6719. <dt><samp class="option">level_in</samp></dt>
  6720. <dd><p>Set input gain. Default is 0.9.
  6721. </p>
  6722. </dd>
  6723. <dt><samp class="option">level_out</samp></dt>
  6724. <dd><p>Set output gain. Default is 1.
  6725. </p>
  6726. </dd>
  6727. <dt><samp class="option">block_size</samp></dt>
  6728. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  6729. value (higher than impulse response length truncated when reaches near zero values) filtering
  6730. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  6731. </p>
  6732. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  6733. </p></dd>
  6734. </dl>
  6735. <a name="Commands-34"></a>
  6736. <h4 class="subsection">8.79.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-34" aria-hidden="true">TOC</a></span></h4>
  6737. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  6738. </p>
  6739. <a name="crystalizer"></a>
  6740. <h3 class="section">8.80 crystalizer<span class="pull-right"><a class="anchor hidden-xs" href="#crystalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crystalizer" aria-hidden="true">TOC</a></span></h3>
  6741. <p>Simple algorithm for audio noise sharpening.
  6742. </p>
  6743. <p>This filter linearly increases differences between each audio sample.
  6744. </p>
  6745. <p>The filter accepts the following options:
  6746. </p>
  6747. <dl class="table">
  6748. <dt><samp class="option">i</samp></dt>
  6749. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  6750. (unchanged sound) to 10.0 (maximum effect).
  6751. To inverse filtering use negative value.
  6752. </p>
  6753. </dd>
  6754. <dt><samp class="option">c</samp></dt>
  6755. <dd><p>Enable clipping. By default is enabled.
  6756. </p></dd>
  6757. </dl>
  6758. <a name="Commands-35"></a>
  6759. <h4 class="subsection">8.80.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-35" aria-hidden="true">TOC</a></span></h4>
  6760. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  6761. </p>
  6762. <a name="dcshift"></a>
  6763. <h3 class="section">8.81 dcshift<span class="pull-right"><a class="anchor hidden-xs" href="#dcshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dcshift" aria-hidden="true">TOC</a></span></h3>
  6764. <p>Apply a DC shift to the audio.
  6765. </p>
  6766. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  6767. in the recording chain) from the audio. The effect of a DC offset is reduced
  6768. headroom and hence volume. The <a class="ref" href="#astats">astats</a> filter can be used to determine if
  6769. a signal has a DC offset.
  6770. </p>
  6771. <dl class="table">
  6772. <dt><samp class="option">shift</samp></dt>
  6773. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  6774. the audio.
  6775. </p>
  6776. </dd>
  6777. <dt><samp class="option">limitergain</samp></dt>
  6778. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  6779. used to prevent clipping.
  6780. </p></dd>
  6781. </dl>
  6782. <a name="deesser"></a>
  6783. <h3 class="section">8.82 deesser<span class="pull-right"><a class="anchor hidden-xs" href="#deesser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deesser" aria-hidden="true">TOC</a></span></h3>
  6784. <p>Apply de-essing to the audio samples.
  6785. </p>
  6786. <dl class="table">
  6787. <dt><samp class="option">i</samp></dt>
  6788. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  6789. Default is 0.
  6790. </p>
  6791. </dd>
  6792. <dt><samp class="option">m</samp></dt>
  6793. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  6794. Default is 0.5.
  6795. </p>
  6796. </dd>
  6797. <dt><samp class="option">f</samp></dt>
  6798. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  6799. Default is 0.5.
  6800. </p>
  6801. </dd>
  6802. <dt><samp class="option">s</samp></dt>
  6803. <dd><p>Set the output mode.
  6804. </p>
  6805. <p>It accepts the following values:
  6806. </p><dl class="table">
  6807. <dt><samp class="option">i</samp></dt>
  6808. <dd><p>Pass input unchanged.
  6809. </p>
  6810. </dd>
  6811. <dt><samp class="option">o</samp></dt>
  6812. <dd><p>Pass ess filtered out.
  6813. </p>
  6814. </dd>
  6815. <dt><samp class="option">e</samp></dt>
  6816. <dd><p>Pass only ess.
  6817. </p>
  6818. <p>Default value is <var class="var">o</var>.
  6819. </p></dd>
  6820. </dl>
  6821. </dd>
  6822. </dl>
  6823. <a name="dialoguenhance"></a>
  6824. <h3 class="section">8.83 dialoguenhance<span class="pull-right"><a class="anchor hidden-xs" href="#dialoguenhance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dialoguenhance" aria-hidden="true">TOC</a></span></h3>
  6825. <p>Enhance dialogue in stereo audio.
  6826. </p>
  6827. <p>This filter accepts stereo input and produce surround (3.0) channels output.
  6828. The newly produced front center channel have enhanced speech dialogue originally
  6829. available in both stereo channels.
  6830. This filter outputs front left and front right channels same as available in stereo input.
  6831. </p>
  6832. <p>The filter accepts the following options:
  6833. </p>
  6834. <dl class="table">
  6835. <dt><samp class="option">original</samp></dt>
  6836. <dd><p>Set the original center factor to keep in front center channel output.
  6837. Allowed range is from 0 to 1. Default value is 1.
  6838. </p>
  6839. </dd>
  6840. <dt><samp class="option">enhance</samp></dt>
  6841. <dd><p>Set the dialogue enhance factor to put in front center channel output.
  6842. Allowed range is from 0 to 3. Default value is 1.
  6843. </p>
  6844. </dd>
  6845. <dt><samp class="option">voice</samp></dt>
  6846. <dd><p>Set the voice detection factor.
  6847. Allowed range is from 2 to 32. Default value is 2.
  6848. </p></dd>
  6849. </dl>
  6850. <a name="Commands-36"></a>
  6851. <h4 class="subsection">8.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-36" aria-hidden="true">TOC</a></span></h4>
  6852. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  6853. </p>
  6854. <a name="drmeter"></a>
  6855. <h3 class="section">8.84 drmeter<span class="pull-right"><a class="anchor hidden-xs" href="#drmeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drmeter" aria-hidden="true">TOC</a></span></h3>
  6856. <p>Measure audio dynamic range.
  6857. </p>
  6858. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  6859. is found in transition material. And anything less that 8 have very poor dynamics
  6860. and is very compressed.
  6861. </p>
  6862. <p>The filter accepts the following options:
  6863. </p>
  6864. <dl class="table">
  6865. <dt><samp class="option">length</samp></dt>
  6866. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  6867. Default is 3 seconds.
  6868. </p></dd>
  6869. </dl>
  6870. <a name="dynaudnorm"></a>
  6871. <h3 class="section">8.85 dynaudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#dynaudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dynaudnorm" aria-hidden="true">TOC</a></span></h3>
  6872. <p>Dynamic Audio Normalizer.
  6873. </p>
  6874. <p>This filter applies a certain amount of gain to the input audio in order
  6875. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  6876. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  6877. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  6878. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  6879. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  6880. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  6881. sections, in the sense that the volume of each section is brought to the
  6882. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  6883. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  6884. of the dynamic range *within* each section of the audio file.
  6885. </p>
  6886. <dl class="table">
  6887. <dt><samp class="option">framelen, f</samp></dt>
  6888. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  6889. Default is 500 milliseconds.
  6890. The Dynamic Audio Normalizer processes the input audio in small chunks,
  6891. referred to as frames. This is required, because a peak magnitude has no
  6892. meaning for just a single sample value. Instead, we need to determine the
  6893. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  6894. normalizer would simply use the peak magnitude of the complete file, the
  6895. Dynamic Audio Normalizer determines the peak magnitude individually for each
  6896. frame. The length of a frame is specified in milliseconds. By default, the
  6897. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  6898. been found to give good results with most files.
  6899. Note that the exact frame length, in number of samples, will be determined
  6900. automatically, based on the sampling rate of the individual input audio file.
  6901. </p>
  6902. </dd>
  6903. <dt><samp class="option">gausssize, g</samp></dt>
  6904. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  6905. number. Default is 31.
  6906. Probably the most important parameter of the Dynamic Audio Normalizer is the
  6907. <code class="code">window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  6908. is specified in frames, centered around the current frame. For the sake of
  6909. simplicity, this must be an odd number. Consequently, the default value of 31
  6910. takes into account the current frame, as well as the 15 preceding frames and
  6911. the 15 subsequent frames. Using a larger window results in a stronger
  6912. smoothing effect and thus in less gain variation, i.e. slower gain
  6913. adaptation. Conversely, using a smaller window results in a weaker smoothing
  6914. effect and thus in more gain variation, i.e. faster gain adaptation.
  6915. In other words, the more you increase this value, the more the Dynamic Audio
  6916. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  6917. contrary, the more you decrease this value, the more the Dynamic Audio
  6918. Normalizer will behave like a dynamic range compressor.
  6919. </p>
  6920. </dd>
  6921. <dt><samp class="option">peak, p</samp></dt>
  6922. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  6923. level for the normalized audio input. This filter will try to approach the
  6924. target peak magnitude as closely as possible, but at the same time it also
  6925. makes sure that the normalized signal will never exceed the peak magnitude.
  6926. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  6927. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  6928. It is not recommended to go above this value.
  6929. </p>
  6930. </dd>
  6931. <dt><samp class="option">maxgain, m</samp></dt>
  6932. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  6933. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  6934. factor for each input frame, i.e. the maximum gain factor that does not
  6935. result in clipping or distortion. The maximum gain factor is determined by
  6936. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  6937. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  6938. (global) maximum gain factor. This is done in order to avoid excessive gain
  6939. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  6940. factor is 10.0, For most inputs the default value should be sufficient and
  6941. it usually is not recommended to increase this value. Though, for input
  6942. with an extremely low overall volume level, it may be necessary to allow even
  6943. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  6944. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  6945. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  6946. gain factors will smoothly approach the threshold value, but never exceed that
  6947. value.
  6948. </p>
  6949. </dd>
  6950. <dt><samp class="option">targetrms, r</samp></dt>
  6951. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  6952. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  6953. This means that the maximum local gain factor for each frame is defined
  6954. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  6955. be amplified as much as possible without exceeding the maximum signal
  6956. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  6957. Normalizer can also take into account the frame&rsquo;s root mean square,
  6958. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  6959. determine the power of a time-varying signal. It is therefore considered
  6960. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  6961. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  6962. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  6963. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  6964. factor is defined as the factor that would result in exactly that RMS value.
  6965. Note, however, that the maximum local gain factor is still restricted by the
  6966. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  6967. </p>
  6968. </dd>
  6969. <dt><samp class="option">coupling, n</samp></dt>
  6970. <dd><p>Enable channels coupling. By default is enabled.
  6971. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  6972. amount. This means the same gain factor will be applied to all channels, i.e.
  6973. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  6974. However, in some recordings, it may happen that the volume of the different
  6975. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  6976. In this case, this option can be used to disable the channel coupling. This way,
  6977. the gain factor will be determined independently for each channel, depending
  6978. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  6979. harmonizing the volume of the different channels.
  6980. </p>
  6981. </dd>
  6982. <dt><samp class="option">correctdc, c</samp></dt>
  6983. <dd><p>Enable DC bias correction. By default is disabled.
  6984. An audio signal (in the time domain) is a sequence of sample values.
  6985. In the Dynamic Audio Normalizer these sample values are represented in the
  6986. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  6987. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  6988. That means if we calculate the mean value of all samples in a file, or in a
  6989. single frame, then the result should be 0.0 or at least very close to that
  6990. value. If, however, there is a significant deviation of the mean value from
  6991. 0.0, in either positive or negative direction, this is referred to as a
  6992. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  6993. Audio Normalizer provides optional DC bias correction.
  6994. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  6995. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  6996. that value from all of the frame&rsquo;s sample values which ensures those samples
  6997. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  6998. boundaries, the DC correction offset values will be interpolated smoothly
  6999. between neighbouring frames.
  7000. </p>
  7001. </dd>
  7002. <dt><samp class="option">altboundary, b</samp></dt>
  7003. <dd><p>Enable alternative boundary mode. By default is disabled.
  7004. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  7005. around each frame. This includes the preceding frames as well as the
  7006. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  7007. beginning and at the very end of the audio file, not all neighbouring
  7008. frames are available. In particular, for the first few frames in the audio
  7009. file, the preceding frames are not known. And, similarly, for the last few
  7010. frames in the audio file, the subsequent frames are not known. Thus, the
  7011. question arises which gain factors should be assumed for the missing frames
  7012. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  7013. to deal with this situation. The default boundary mode assumes a gain factor
  7014. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  7015. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  7016. </p>
  7017. </dd>
  7018. <dt><samp class="option">compress, s</samp></dt>
  7019. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  7020. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  7021. compression. This means that signal peaks will not be pruned and thus the
  7022. full dynamic range will be retained within each local neighbourhood. However,
  7023. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  7024. normalization algorithm with a more &quot;traditional&quot; compression.
  7025. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  7026. (thresholding) function. If (and only if) the compression feature is enabled,
  7027. all input frames will be processed by a soft knee thresholding function prior
  7028. to the actual normalization process. Put simply, the thresholding function is
  7029. going to prune all samples whose magnitude exceeds a certain threshold value.
  7030. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  7031. value. Instead, the threshold value will be adjusted for each individual
  7032. frame.
  7033. In general, smaller parameters result in stronger compression, and vice versa.
  7034. Values below 3.0 are not recommended, because audible distortion may appear.
  7035. </p>
  7036. </dd>
  7037. <dt><samp class="option">threshold, t</samp></dt>
  7038. <dd><p>Set the target threshold value. This specifies the lowest permissible
  7039. magnitude level for the audio input which will be normalized.
  7040. If input frame volume is above this value frame will be normalized.
  7041. Otherwise frame may not be normalized at all. The default value is set
  7042. to 0, which means all input frames will be normalized.
  7043. This option is mostly useful if digital noise is not wanted to be amplified.
  7044. </p>
  7045. </dd>
  7046. <dt><samp class="option">channels, h</samp></dt>
  7047. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  7048. </p>
  7049. </dd>
  7050. <dt><samp class="option">overlap, o</samp></dt>
  7051. <dd><p>Specify overlap for frames. If set to 0 (default) no frame overlapping is done.
  7052. Using &gt;0 and &lt;1 values will make less conservative gain adjustments, like
  7053. when framelen option is set to smaller value, if framelen option value is
  7054. compensated for non-zero overlap then gain adjustments will be smoother across time
  7055. compared to zero overlap case.
  7056. </p>
  7057. </dd>
  7058. <dt><samp class="option">curve, v</samp></dt>
  7059. <dd><p>Specify the peak mapping curve expression which is going to be used when calculating
  7060. gain applied to frames. The max output frame gain will still be limited by other
  7061. options mentioned previously for this filter.
  7062. </p>
  7063. <p>The expression can contain the following constants:
  7064. </p>
  7065. <dl class="table">
  7066. <dt><samp class="option">ch</samp></dt>
  7067. <dd><p>current channel number
  7068. </p>
  7069. </dd>
  7070. <dt><samp class="option">sn</samp></dt>
  7071. <dd><p>current sample number
  7072. </p>
  7073. </dd>
  7074. <dt><samp class="option">nb_channels</samp></dt>
  7075. <dd><p>number of channels
  7076. </p>
  7077. </dd>
  7078. <dt><samp class="option">t</samp></dt>
  7079. <dd><p>timestamp expressed in seconds
  7080. </p>
  7081. </dd>
  7082. <dt><samp class="option">sr</samp></dt>
  7083. <dd><p>sample rate
  7084. </p>
  7085. </dd>
  7086. <dt><samp class="option">p</samp></dt>
  7087. <dd><p>current frame peak value
  7088. </p></dd>
  7089. </dl>
  7090. </dd>
  7091. </dl>
  7092. <a name="Commands-37"></a>
  7093. <h4 class="subsection">8.85.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-37" aria-hidden="true">TOC</a></span></h4>
  7094. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  7095. </p>
  7096. <a name="earwax"></a>
  7097. <h3 class="section">8.86 earwax<span class="pull-right"><a class="anchor hidden-xs" href="#earwax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-earwax" aria-hidden="true">TOC</a></span></h3>
  7098. <p>Make audio easier to listen to on headphones.
  7099. </p>
  7100. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  7101. so that when listened to on headphones the stereo image is moved from
  7102. inside your head (standard for headphones) to outside and in front of
  7103. the listener (standard for speakers).
  7104. </p>
  7105. <p>Ported from SoX.
  7106. </p>
  7107. <a name="equalizer"></a>
  7108. <h3 class="section">8.87 equalizer<span class="pull-right"><a class="anchor hidden-xs" href="#equalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-equalizer" aria-hidden="true">TOC</a></span></h3>
  7109. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  7110. filter, the signal-level at and around a selected frequency can
  7111. be increased or decreased, whilst (unlike bandpass and bandreject
  7112. filters) that at all other frequencies is unchanged.
  7113. </p>
  7114. <p>In order to produce complex equalisation curves, this filter can
  7115. be given several times, each with a different central frequency.
  7116. </p>
  7117. <p>The filter accepts the following options:
  7118. </p>
  7119. <dl class="table">
  7120. <dt><samp class="option">frequency, f</samp></dt>
  7121. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  7122. </p>
  7123. </dd>
  7124. <dt><samp class="option">width_type, t</samp></dt>
  7125. <dd><p>Set method to specify band-width of filter.
  7126. </p><dl class="table">
  7127. <dt><samp class="option">h</samp></dt>
  7128. <dd><p>Hz
  7129. </p></dd>
  7130. <dt><samp class="option">q</samp></dt>
  7131. <dd><p>Q-Factor
  7132. </p></dd>
  7133. <dt><samp class="option">o</samp></dt>
  7134. <dd><p>octave
  7135. </p></dd>
  7136. <dt><samp class="option">s</samp></dt>
  7137. <dd><p>slope
  7138. </p></dd>
  7139. <dt><samp class="option">k</samp></dt>
  7140. <dd><p>kHz
  7141. </p></dd>
  7142. </dl>
  7143. </dd>
  7144. <dt><samp class="option">width, w</samp></dt>
  7145. <dd><p>Specify the band-width of a filter in width_type units.
  7146. </p>
  7147. </dd>
  7148. <dt><samp class="option">gain, g</samp></dt>
  7149. <dd><p>Set the required gain or attenuation in dB.
  7150. Beware of clipping when using a positive gain.
  7151. </p>
  7152. </dd>
  7153. <dt><samp class="option">mix, m</samp></dt>
  7154. <dd><p>How much to use filtered signal in output. Default is 1.
  7155. Range is between 0 and 1.
  7156. </p>
  7157. </dd>
  7158. <dt><samp class="option">channels, c</samp></dt>
  7159. <dd><p>Specify which channels to filter, by default all available are filtered.
  7160. </p>
  7161. </dd>
  7162. <dt><samp class="option">normalize, n</samp></dt>
  7163. <dd><p>Normalize biquad coefficients, by default is disabled.
  7164. Enabling it will normalize magnitude response at DC to 0dB.
  7165. </p>
  7166. </dd>
  7167. <dt><samp class="option">transform, a</samp></dt>
  7168. <dd><p>Set transform type of IIR filter.
  7169. </p><dl class="table">
  7170. <dt><samp class="option">di</samp></dt>
  7171. <dt><samp class="option">dii</samp></dt>
  7172. <dt><samp class="option">tdi</samp></dt>
  7173. <dt><samp class="option">tdii</samp></dt>
  7174. <dt><samp class="option">latt</samp></dt>
  7175. <dt><samp class="option">svf</samp></dt>
  7176. <dt><samp class="option">zdf</samp></dt>
  7177. </dl>
  7178. </dd>
  7179. <dt><samp class="option">precision, r</samp></dt>
  7180. <dd><p>Set precision of filtering.
  7181. </p><dl class="table">
  7182. <dt><samp class="option">auto</samp></dt>
  7183. <dd><p>Pick automatic sample format depending on surround filters.
  7184. </p></dd>
  7185. <dt><samp class="option">s16</samp></dt>
  7186. <dd><p>Always use signed 16-bit.
  7187. </p></dd>
  7188. <dt><samp class="option">s32</samp></dt>
  7189. <dd><p>Always use signed 32-bit.
  7190. </p></dd>
  7191. <dt><samp class="option">f32</samp></dt>
  7192. <dd><p>Always use float 32-bit.
  7193. </p></dd>
  7194. <dt><samp class="option">f64</samp></dt>
  7195. <dd><p>Always use float 64-bit.
  7196. </p></dd>
  7197. </dl>
  7198. </dd>
  7199. <dt><samp class="option">block_size, b</samp></dt>
  7200. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  7201. value (higher than impulse response length truncated when reaches near zero values) filtering
  7202. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  7203. </p>
  7204. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  7205. </p></dd>
  7206. </dl>
  7207. <a name="Examples-24"></a>
  7208. <h4 class="subsection">8.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-24" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-24" aria-hidden="true">TOC</a></span></h4>
  7209. <ul class="itemize mark-bullet">
  7210. <li>Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  7211. <div class="example">
  7212. <pre class="example-preformatted">equalizer=f=1000:t=h:width=200:g=-10
  7213. </pre></div>
  7214. </li><li>Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  7215. <div class="example">
  7216. <pre class="example-preformatted">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  7217. </pre></div>
  7218. </li></ul>
  7219. <a name="Commands-38"></a>
  7220. <h4 class="subsection">8.87.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-38" aria-hidden="true">TOC</a></span></h4>
  7221. <p>This filter supports the following commands:
  7222. </p><dl class="table">
  7223. <dt><samp class="option">frequency, f</samp></dt>
  7224. <dd><p>Change equalizer frequency.
  7225. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  7226. </p>
  7227. </dd>
  7228. <dt><samp class="option">width_type, t</samp></dt>
  7229. <dd><p>Change equalizer width_type.
  7230. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  7231. </p>
  7232. </dd>
  7233. <dt><samp class="option">width, w</samp></dt>
  7234. <dd><p>Change equalizer width.
  7235. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  7236. </p>
  7237. </dd>
  7238. <dt><samp class="option">gain, g</samp></dt>
  7239. <dd><p>Change equalizer gain.
  7240. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  7241. </p>
  7242. </dd>
  7243. <dt><samp class="option">mix, m</samp></dt>
  7244. <dd><p>Change equalizer mix.
  7245. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  7246. </p></dd>
  7247. </dl>
  7248. <a name="extrastereo"></a>
  7249. <h3 class="section">8.88 extrastereo<span class="pull-right"><a class="anchor hidden-xs" href="#extrastereo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extrastereo" aria-hidden="true">TOC</a></span></h3>
  7250. <p>Linearly increases the difference between left and right channels which
  7251. adds some sort of &quot;live&quot; effect to playback.
  7252. </p>
  7253. <p>The filter accepts the following options:
  7254. </p>
  7255. <dl class="table">
  7256. <dt><samp class="option">m</samp></dt>
  7257. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  7258. (average of both channels), with 1.0 sound will be unchanged, with
  7259. -1.0 left and right channels will be swapped.
  7260. </p>
  7261. </dd>
  7262. <dt><samp class="option">c</samp></dt>
  7263. <dd><p>Enable clipping. By default is enabled.
  7264. </p></dd>
  7265. </dl>
  7266. <a name="Commands-39"></a>
  7267. <h4 class="subsection">8.88.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-39" aria-hidden="true">TOC</a></span></h4>
  7268. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  7269. </p>
  7270. <a name="firequalizer"></a>
  7271. <h3 class="section">8.89 firequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#firequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-firequalizer" aria-hidden="true">TOC</a></span></h3>
  7272. <p>Apply FIR Equalization using arbitrary frequency response.
  7273. </p>
  7274. <p>The filter accepts the following option:
  7275. </p>
  7276. <dl class="table">
  7277. <dt><samp class="option">gain</samp></dt>
  7278. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  7279. </p><dl class="table">
  7280. <dt><samp class="option">f</samp></dt>
  7281. <dd><p>the evaluated frequency
  7282. </p></dd>
  7283. <dt><samp class="option">sr</samp></dt>
  7284. <dd><p>sample rate
  7285. </p></dd>
  7286. <dt><samp class="option">ch</samp></dt>
  7287. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  7288. </p></dd>
  7289. <dt><samp class="option">chid</samp></dt>
  7290. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  7291. multichannels evaluation is disabled
  7292. </p></dd>
  7293. <dt><samp class="option">chs</samp></dt>
  7294. <dd><p>number of channels
  7295. </p></dd>
  7296. <dt><samp class="option">chlayout</samp></dt>
  7297. <dd><p>channel_layout, see libavutil/channel_layout.h
  7298. </p>
  7299. </dd>
  7300. </dl>
  7301. <p>and functions:
  7302. </p><dl class="table">
  7303. <dt><samp class="option">gain_interpolate(f)</samp></dt>
  7304. <dd><p>interpolate gain on frequency f based on gain_entry
  7305. </p></dd>
  7306. <dt><samp class="option">cubic_interpolate(f)</samp></dt>
  7307. <dd><p>same as gain_interpolate, but smoother
  7308. </p></dd>
  7309. </dl>
  7310. <p>This option is also available as command. Default is <code class="code">gain_interpolate(f)</code>.
  7311. </p>
  7312. </dd>
  7313. <dt><samp class="option">gain_entry</samp></dt>
  7314. <dd><p>Set gain entry for gain_interpolate function. The expression can
  7315. contain functions:
  7316. </p><dl class="table">
  7317. <dt><samp class="option">entry(f, g)</samp></dt>
  7318. <dd><p>store gain entry at frequency f with value g
  7319. </p></dd>
  7320. </dl>
  7321. <p>This option is also available as command.
  7322. </p>
  7323. </dd>
  7324. <dt><samp class="option">delay</samp></dt>
  7325. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  7326. Default is <code class="code">0.01</code>.
  7327. </p>
  7328. </dd>
  7329. <dt><samp class="option">accuracy</samp></dt>
  7330. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  7331. Default is <code class="code">5</code>.
  7332. </p>
  7333. </dd>
  7334. <dt><samp class="option">wfunc</samp></dt>
  7335. <dd><p>Set window function. Acceptable values are:
  7336. </p><dl class="table">
  7337. <dt><samp class="option">rectangular</samp></dt>
  7338. <dd><p>rectangular window, useful when gain curve is already smooth
  7339. </p></dd>
  7340. <dt><samp class="option">hann</samp></dt>
  7341. <dd><p>hann window (default)
  7342. </p></dd>
  7343. <dt><samp class="option">hamming</samp></dt>
  7344. <dd><p>hamming window
  7345. </p></dd>
  7346. <dt><samp class="option">blackman</samp></dt>
  7347. <dd><p>blackman window
  7348. </p></dd>
  7349. <dt><samp class="option">nuttall3</samp></dt>
  7350. <dd><p>3-terms continuous 1st derivative nuttall window
  7351. </p></dd>
  7352. <dt><samp class="option">mnuttall3</samp></dt>
  7353. <dd><p>minimum 3-terms discontinuous nuttall window
  7354. </p></dd>
  7355. <dt><samp class="option">nuttall</samp></dt>
  7356. <dd><p>4-terms continuous 1st derivative nuttall window
  7357. </p></dd>
  7358. <dt><samp class="option">bnuttall</samp></dt>
  7359. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  7360. </p></dd>
  7361. <dt><samp class="option">bharris</samp></dt>
  7362. <dd><p>blackman-harris window
  7363. </p></dd>
  7364. <dt><samp class="option">tukey</samp></dt>
  7365. <dd><p>tukey window
  7366. </p></dd>
  7367. </dl>
  7368. </dd>
  7369. <dt><samp class="option">fixed</samp></dt>
  7370. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  7371. filtering with large delay. Default is disabled.
  7372. </p>
  7373. </dd>
  7374. <dt><samp class="option">multi</samp></dt>
  7375. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  7376. </p>
  7377. </dd>
  7378. <dt><samp class="option">zero_phase</samp></dt>
  7379. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  7380. Default is disabled.
  7381. </p>
  7382. </dd>
  7383. <dt><samp class="option">scale</samp></dt>
  7384. <dd><p>Set scale used by gain. Acceptable values are:
  7385. </p><dl class="table">
  7386. <dt><samp class="option">linlin</samp></dt>
  7387. <dd><p>linear frequency, linear gain
  7388. </p></dd>
  7389. <dt><samp class="option">linlog</samp></dt>
  7390. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  7391. </p></dd>
  7392. <dt><samp class="option">loglin</samp></dt>
  7393. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  7394. </p></dd>
  7395. <dt><samp class="option">loglog</samp></dt>
  7396. <dd><p>logarithmic frequency, logarithmic gain
  7397. </p></dd>
  7398. </dl>
  7399. </dd>
  7400. <dt><samp class="option">dumpfile</samp></dt>
  7401. <dd><p>Set file for dumping, suitable for gnuplot.
  7402. </p>
  7403. </dd>
  7404. <dt><samp class="option">dumpscale</samp></dt>
  7405. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  7406. Default is linlog.
  7407. </p>
  7408. </dd>
  7409. <dt><samp class="option">fft2</samp></dt>
  7410. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  7411. Default is disabled.
  7412. </p>
  7413. </dd>
  7414. <dt><samp class="option">min_phase</samp></dt>
  7415. <dd><p>Enable minimum phase impulse response. Default is disabled.
  7416. </p></dd>
  7417. </dl>
  7418. <a name="Examples-25"></a>
  7419. <h4 class="subsection">8.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-25" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-25" aria-hidden="true">TOC</a></span></h4>
  7420. <ul class="itemize mark-bullet">
  7421. <li>lowpass at 1000 Hz:
  7422. <div class="example">
  7423. <pre class="example-preformatted">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  7424. </pre></div>
  7425. </li><li>lowpass at 1000 Hz with gain_entry:
  7426. <div class="example">
  7427. <pre class="example-preformatted">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  7428. </pre></div>
  7429. </li><li>custom equalization:
  7430. <div class="example">
  7431. <pre class="example-preformatted">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  7432. </pre></div>
  7433. </li><li>higher delay with zero phase to compensate delay:
  7434. <div class="example">
  7435. <pre class="example-preformatted">firequalizer=delay=0.1:fixed=on:zero_phase=on
  7436. </pre></div>
  7437. </li><li>lowpass on left channel, highpass on right channel:
  7438. <div class="example">
  7439. <pre class="example-preformatted">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  7440. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  7441. </pre></div>
  7442. </li></ul>
  7443. <a name="flanger"></a>
  7444. <h3 class="section">8.90 flanger<span class="pull-right"><a class="anchor hidden-xs" href="#flanger" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flanger" aria-hidden="true">TOC</a></span></h3>
  7445. <p>Apply a flanging effect to the audio.
  7446. </p>
  7447. <p>The filter accepts the following options:
  7448. </p>
  7449. <dl class="table">
  7450. <dt><samp class="option">delay</samp></dt>
  7451. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  7452. </p>
  7453. </dd>
  7454. <dt><samp class="option">depth</samp></dt>
  7455. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  7456. </p>
  7457. </dd>
  7458. <dt><samp class="option">regen</samp></dt>
  7459. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  7460. Default value is 0.
  7461. </p>
  7462. </dd>
  7463. <dt><samp class="option">width</samp></dt>
  7464. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  7465. Default value is 71.
  7466. </p>
  7467. </dd>
  7468. <dt><samp class="option">speed</samp></dt>
  7469. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  7470. </p>
  7471. </dd>
  7472. <dt><samp class="option">shape</samp></dt>
  7473. <dd><p>Set swept wave shape, can be <var class="var">triangular</var> or <var class="var">sinusoidal</var>.
  7474. Default value is <var class="var">sinusoidal</var>.
  7475. </p>
  7476. </dd>
  7477. <dt><samp class="option">phase</samp></dt>
  7478. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  7479. Default value is 25.
  7480. </p>
  7481. </dd>
  7482. <dt><samp class="option">interp</samp></dt>
  7483. <dd><p>Set delay-line interpolation, <var class="var">linear</var> or <var class="var">quadratic</var>.
  7484. Default is <var class="var">linear</var>.
  7485. </p></dd>
  7486. </dl>
  7487. <a name="haas"></a>
  7488. <h3 class="section">8.91 haas<span class="pull-right"><a class="anchor hidden-xs" href="#haas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haas" aria-hidden="true">TOC</a></span></h3>
  7489. <p>Apply Haas effect to audio.
  7490. </p>
  7491. <p>Note that this makes most sense to apply on mono signals.
  7492. With this filter applied to mono signals it give some directionality and
  7493. stretches its stereo image.
  7494. </p>
  7495. <p>The filter accepts the following options:
  7496. </p>
  7497. <dl class="table">
  7498. <dt><samp class="option">level_in</samp></dt>
  7499. <dd><p>Set input level. By default is <var class="var">1</var>, or 0dB
  7500. </p>
  7501. </dd>
  7502. <dt><samp class="option">level_out</samp></dt>
  7503. <dd><p>Set output level. By default is <var class="var">1</var>, or 0dB.
  7504. </p>
  7505. </dd>
  7506. <dt><samp class="option">side_gain</samp></dt>
  7507. <dd><p>Set gain applied to side part of signal. By default is <var class="var">1</var>.
  7508. </p>
  7509. </dd>
  7510. <dt><samp class="option">middle_source</samp></dt>
  7511. <dd><p>Set kind of middle source. Can be one of the following:
  7512. </p>
  7513. <dl class="table">
  7514. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  7515. <dd><p>Pick left channel.
  7516. </p>
  7517. </dd>
  7518. <dt>&lsquo;<samp class="samp">right</samp>&rsquo;</dt>
  7519. <dd><p>Pick right channel.
  7520. </p>
  7521. </dd>
  7522. <dt>&lsquo;<samp class="samp">mid</samp>&rsquo;</dt>
  7523. <dd><p>Pick middle part signal of stereo image.
  7524. </p>
  7525. </dd>
  7526. <dt>&lsquo;<samp class="samp">side</samp>&rsquo;</dt>
  7527. <dd><p>Pick side part signal of stereo image.
  7528. </p></dd>
  7529. </dl>
  7530. </dd>
  7531. <dt><samp class="option">middle_phase</samp></dt>
  7532. <dd><p>Change middle phase. By default is disabled.
  7533. </p>
  7534. </dd>
  7535. <dt><samp class="option">left_delay</samp></dt>
  7536. <dd><p>Set left channel delay. By default is <var class="var">2.05</var> milliseconds.
  7537. </p>
  7538. </dd>
  7539. <dt><samp class="option">left_balance</samp></dt>
  7540. <dd><p>Set left channel balance. By default is <var class="var">-1</var>.
  7541. </p>
  7542. </dd>
  7543. <dt><samp class="option">left_gain</samp></dt>
  7544. <dd><p>Set left channel gain. By default is <var class="var">1</var>.
  7545. </p>
  7546. </dd>
  7547. <dt><samp class="option">left_phase</samp></dt>
  7548. <dd><p>Change left phase. By default is disabled.
  7549. </p>
  7550. </dd>
  7551. <dt><samp class="option">right_delay</samp></dt>
  7552. <dd><p>Set right channel delay. By defaults is <var class="var">2.12</var> milliseconds.
  7553. </p>
  7554. </dd>
  7555. <dt><samp class="option">right_balance</samp></dt>
  7556. <dd><p>Set right channel balance. By default is <var class="var">1</var>.
  7557. </p>
  7558. </dd>
  7559. <dt><samp class="option">right_gain</samp></dt>
  7560. <dd><p>Set right channel gain. By default is <var class="var">1</var>.
  7561. </p>
  7562. </dd>
  7563. <dt><samp class="option">right_phase</samp></dt>
  7564. <dd><p>Change right phase. By default is enabled.
  7565. </p></dd>
  7566. </dl>
  7567. <a name="hdcd"></a>
  7568. <h3 class="section">8.92 hdcd<span class="pull-right"><a class="anchor hidden-xs" href="#hdcd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hdcd" aria-hidden="true">TOC</a></span></h3>
  7569. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  7570. embedded HDCD codes is expanded into a 20-bit PCM stream.
  7571. </p>
  7572. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  7573. of HDCD, and detects the Transient Filter flag.
  7574. </p>
  7575. <div class="example">
  7576. <pre class="example-preformatted">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  7577. </pre></div>
  7578. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  7579. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  7580. like <code class="command">-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  7581. </p><div class="example">
  7582. <pre class="example-preformatted">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  7583. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  7584. </pre></div>
  7585. <p>The filter accepts the following options:
  7586. </p>
  7587. <dl class="table">
  7588. <dt><samp class="option">disable_autoconvert</samp></dt>
  7589. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  7590. </p>
  7591. </dd>
  7592. <dt><samp class="option">process_stereo</samp></dt>
  7593. <dd><p>Process the stereo channels together. If target_gain does not match between
  7594. channels, consider it invalid and use the last valid target_gain.
  7595. </p>
  7596. </dd>
  7597. <dt><samp class="option">cdt_ms</samp></dt>
  7598. <dd><p>Set the code detect timer period in ms.
  7599. </p>
  7600. </dd>
  7601. <dt><samp class="option">force_pe</samp></dt>
  7602. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  7603. </p>
  7604. </dd>
  7605. <dt><samp class="option">analyze_mode</samp></dt>
  7606. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  7607. specific aspect of the decoding process. The output file can be loaded in
  7608. an audio editor alongside the original to aid analysis.
  7609. </p>
  7610. <p><code class="code">analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  7611. </p>
  7612. <p>Modes are:
  7613. </p><dl class="table">
  7614. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  7615. <dd><p>Disabled
  7616. </p></dd>
  7617. <dt>&lsquo;<samp class="samp">1, lle</samp>&rsquo;</dt>
  7618. <dd><p>Gain adjustment level at each sample
  7619. </p></dd>
  7620. <dt>&lsquo;<samp class="samp">2, pe</samp>&rsquo;</dt>
  7621. <dd><p>Samples where peak extend occurs
  7622. </p></dd>
  7623. <dt>&lsquo;<samp class="samp">3, cdt</samp>&rsquo;</dt>
  7624. <dd><p>Samples where the code detect timer is active
  7625. </p></dd>
  7626. <dt>&lsquo;<samp class="samp">4, tgm</samp>&rsquo;</dt>
  7627. <dd><p>Samples where the target gain does not match between channels
  7628. </p></dd>
  7629. </dl>
  7630. </dd>
  7631. </dl>
  7632. <a name="headphone"></a>
  7633. <h3 class="section">8.93 headphone<span class="pull-right"><a class="anchor hidden-xs" href="#headphone" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-headphone" aria-hidden="true">TOC</a></span></h3>
  7634. <p>Apply head-related transfer functions (HRTFs) to create virtual
  7635. loudspeakers around the user for binaural listening via headphones.
  7636. The HRIRs are provided via additional streams, for each channel
  7637. one stereo input stream is needed.
  7638. </p>
  7639. <p>The filter accepts the following options:
  7640. </p>
  7641. <dl class="table">
  7642. <dt><samp class="option">map</samp></dt>
  7643. <dd><p>Set mapping of input streams for convolution.
  7644. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  7645. are given as additional stream inputs for filter.
  7646. This also specify number of input streams. Number of input streams
  7647. must be not less than number of channels in first stream plus one.
  7648. </p>
  7649. </dd>
  7650. <dt><samp class="option">gain</samp></dt>
  7651. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  7652. </p>
  7653. </dd>
  7654. <dt><samp class="option">type</samp></dt>
  7655. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  7656. processing audio in time domain which is slow.
  7657. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  7658. Default is <var class="var">freq</var>.
  7659. </p>
  7660. </dd>
  7661. <dt><samp class="option">lfe</samp></dt>
  7662. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  7663. </p>
  7664. </dd>
  7665. <dt><samp class="option">size</samp></dt>
  7666. <dd><p>Set size of frame in number of samples which will be processed at once.
  7667. Default value is <var class="var">1024</var>. Allowed range is from 1024 to 96000.
  7668. </p>
  7669. </dd>
  7670. <dt><samp class="option">hrir</samp></dt>
  7671. <dd><p>Set format of hrir stream.
  7672. Default value is <var class="var">stereo</var>. Alternative value is <var class="var">multich</var>.
  7673. If value is set to <var class="var">stereo</var>, number of additional streams should
  7674. be greater or equal to number of input channels in first input stream.
  7675. Also each additional stream should have stereo number of channels.
  7676. If value is set to <var class="var">multich</var>, number of additional streams should
  7677. be exactly one. Also number of input channels of additional stream
  7678. should be equal or greater than twice number of channels of first input
  7679. stream.
  7680. </p></dd>
  7681. </dl>
  7682. <a name="Examples-26"></a>
  7683. <h4 class="subsection">8.93.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-26" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-26" aria-hidden="true">TOC</a></span></h4>
  7684. <ul class="itemize mark-bullet">
  7685. <li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  7686. each amovie filter use stereo file with IR coefficients as input.
  7687. The files give coefficients for each position of virtual loudspeaker:
  7688. <div class="example">
  7689. <pre class="example-preformatted">ffmpeg -i input.wav
  7690. -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;
  7691. output.wav
  7692. </pre></div>
  7693. </li><li>Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  7694. but now in <var class="var">multich</var> <var class="var">hrir</var> format.
  7695. <div class="example">
  7696. <pre class="example-preformatted">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;
  7697. output.wav
  7698. </pre></div>
  7699. </li></ul>
  7700. <a name="highpass"></a>
  7701. <h3 class="section">8.94 highpass<span class="pull-right"><a class="anchor hidden-xs" href="#highpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-highpass" aria-hidden="true">TOC</a></span></h3>
  7702. <p>Apply a high-pass filter with 3dB point frequency.
  7703. The filter can be either single-pole, or double-pole (the default).
  7704. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  7705. </p>
  7706. <p>The filter accepts the following options:
  7707. </p>
  7708. <dl class="table">
  7709. <dt><samp class="option">frequency, f</samp></dt>
  7710. <dd><p>Set frequency in Hz. Default is 3000.
  7711. </p>
  7712. </dd>
  7713. <dt><samp class="option">poles, p</samp></dt>
  7714. <dd><p>Set number of poles. Default is 2.
  7715. </p>
  7716. </dd>
  7717. <dt><samp class="option">width_type, t</samp></dt>
  7718. <dd><p>Set method to specify band-width of filter.
  7719. </p><dl class="table">
  7720. <dt><samp class="option">h</samp></dt>
  7721. <dd><p>Hz
  7722. </p></dd>
  7723. <dt><samp class="option">q</samp></dt>
  7724. <dd><p>Q-Factor
  7725. </p></dd>
  7726. <dt><samp class="option">o</samp></dt>
  7727. <dd><p>octave
  7728. </p></dd>
  7729. <dt><samp class="option">s</samp></dt>
  7730. <dd><p>slope
  7731. </p></dd>
  7732. <dt><samp class="option">k</samp></dt>
  7733. <dd><p>kHz
  7734. </p></dd>
  7735. </dl>
  7736. </dd>
  7737. <dt><samp class="option">width, w</samp></dt>
  7738. <dd><p>Specify the band-width of a filter in width_type units.
  7739. Applies only to double-pole filter.
  7740. The default is 0.707q and gives a Butterworth response.
  7741. </p>
  7742. </dd>
  7743. <dt><samp class="option">mix, m</samp></dt>
  7744. <dd><p>How much to use filtered signal in output. Default is 1.
  7745. Range is between 0 and 1.
  7746. </p>
  7747. </dd>
  7748. <dt><samp class="option">channels, c</samp></dt>
  7749. <dd><p>Specify which channels to filter, by default all available are filtered.
  7750. </p>
  7751. </dd>
  7752. <dt><samp class="option">normalize, n</samp></dt>
  7753. <dd><p>Normalize biquad coefficients, by default is disabled.
  7754. Enabling it will normalize magnitude response at DC to 0dB.
  7755. </p>
  7756. </dd>
  7757. <dt><samp class="option">transform, a</samp></dt>
  7758. <dd><p>Set transform type of IIR filter.
  7759. </p><dl class="table">
  7760. <dt><samp class="option">di</samp></dt>
  7761. <dt><samp class="option">dii</samp></dt>
  7762. <dt><samp class="option">tdi</samp></dt>
  7763. <dt><samp class="option">tdii</samp></dt>
  7764. <dt><samp class="option">latt</samp></dt>
  7765. <dt><samp class="option">svf</samp></dt>
  7766. <dt><samp class="option">zdf</samp></dt>
  7767. </dl>
  7768. </dd>
  7769. <dt><samp class="option">precision, r</samp></dt>
  7770. <dd><p>Set precision of filtering.
  7771. </p><dl class="table">
  7772. <dt><samp class="option">auto</samp></dt>
  7773. <dd><p>Pick automatic sample format depending on surround filters.
  7774. </p></dd>
  7775. <dt><samp class="option">s16</samp></dt>
  7776. <dd><p>Always use signed 16-bit.
  7777. </p></dd>
  7778. <dt><samp class="option">s32</samp></dt>
  7779. <dd><p>Always use signed 32-bit.
  7780. </p></dd>
  7781. <dt><samp class="option">f32</samp></dt>
  7782. <dd><p>Always use float 32-bit.
  7783. </p></dd>
  7784. <dt><samp class="option">f64</samp></dt>
  7785. <dd><p>Always use float 64-bit.
  7786. </p></dd>
  7787. </dl>
  7788. </dd>
  7789. <dt><samp class="option">block_size, b</samp></dt>
  7790. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  7791. value (higher than impulse response length truncated when reaches near zero values) filtering
  7792. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  7793. </p>
  7794. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  7795. </p></dd>
  7796. </dl>
  7797. <a name="Commands-40"></a>
  7798. <h4 class="subsection">8.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-40" aria-hidden="true">TOC</a></span></h4>
  7799. <p>This filter supports the following commands:
  7800. </p><dl class="table">
  7801. <dt><samp class="option">frequency, f</samp></dt>
  7802. <dd><p>Change highpass frequency.
  7803. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  7804. </p>
  7805. </dd>
  7806. <dt><samp class="option">width_type, t</samp></dt>
  7807. <dd><p>Change highpass width_type.
  7808. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  7809. </p>
  7810. </dd>
  7811. <dt><samp class="option">width, w</samp></dt>
  7812. <dd><p>Change highpass width.
  7813. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  7814. </p>
  7815. </dd>
  7816. <dt><samp class="option">mix, m</samp></dt>
  7817. <dd><p>Change highpass mix.
  7818. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  7819. </p></dd>
  7820. </dl>
  7821. <a name="join"></a>
  7822. <h3 class="section">8.95 join<span class="pull-right"><a class="anchor hidden-xs" href="#join" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-join" aria-hidden="true">TOC</a></span></h3>
  7823. <p>Join multiple input streams into one multi-channel stream.
  7824. </p>
  7825. <p>It accepts the following parameters:
  7826. </p><dl class="table">
  7827. <dt><samp class="option">inputs</samp></dt>
  7828. <dd><p>The number of input streams. It defaults to 2.
  7829. </p>
  7830. </dd>
  7831. <dt><samp class="option">channel_layout</samp></dt>
  7832. <dd><p>The desired output channel layout. It defaults to stereo.
  7833. </p>
  7834. </dd>
  7835. <dt><samp class="option">map</samp></dt>
  7836. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  7837. mappings, each in the <code class="code"><var class="var">input_idx</var>.<var class="var">in_channel</var>-<var class="var">out_channel</var></code>
  7838. form. <var class="var">input_idx</var> is the 0-based index of the input stream. <var class="var">in_channel</var>
  7839. can be either the name of the input channel (e.g. FL for front left) or its
  7840. index in the specified input stream. <var class="var">out_channel</var> is the name of the output
  7841. channel.
  7842. </p></dd>
  7843. </dl>
  7844. <p>The filter will attempt to guess the mappings when they are not specified
  7845. explicitly. It does so by first trying to find an unused matching input channel
  7846. and if that fails it picks the first unused input channel.
  7847. </p>
  7848. <p>Join 3 inputs (with properly set channel layouts):
  7849. </p><div class="example">
  7850. <pre class="example-preformatted">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  7851. </pre></div>
  7852. <p>Build a 5.1 output from 6 single-channel streams:
  7853. </p><div class="example">
  7854. <pre class="example-preformatted">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  7855. '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'
  7856. out
  7857. </pre></div>
  7858. <a name="ladspa"></a>
  7859. <h3 class="section">8.96 ladspa<span class="pull-right"><a class="anchor hidden-xs" href="#ladspa" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ladspa" aria-hidden="true">TOC</a></span></h3>
  7860. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  7861. </p>
  7862. <p>To enable compilation of this filter you need to configure FFmpeg with
  7863. <code class="code">--enable-ladspa</code>.
  7864. </p>
  7865. <dl class="table">
  7866. <dt><samp class="option">file, f</samp></dt>
  7867. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  7868. variable <code class="env">LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  7869. each one of the directories specified by the colon separated list in
  7870. <code class="env">LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  7871. this order: <samp class="file">HOME/.ladspa/lib/</samp>, <samp class="file">/usr/local/lib/ladspa/</samp>,
  7872. <samp class="file">/usr/lib/ladspa/</samp>.
  7873. </p>
  7874. </dd>
  7875. <dt><samp class="option">plugin, p</samp></dt>
  7876. <dd><p>Specifies the plugin within the library. Some libraries contain only
  7877. one plugin, but others contain many of them. If this is not set filter
  7878. will list all available plugins within the specified library.
  7879. </p>
  7880. </dd>
  7881. <dt><samp class="option">controls, c</samp></dt>
  7882. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  7883. values that determine the behavior of the loaded plugin (for example delay,
  7884. threshold or gain).
  7885. Controls need to be defined using the following syntax:
  7886. c0=<var class="var">value0</var>|c1=<var class="var">value1</var>|c2=<var class="var">value2</var>|..., where
  7887. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  7888. Alternatively they can be also defined using the following syntax:
  7889. <var class="var">value0</var>|<var class="var">value1</var>|<var class="var">value2</var>|..., where
  7890. <var class="var">valuei</var> is the value set on the <var class="var">i</var>-th control.
  7891. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  7892. their valid ranges are printed.
  7893. </p>
  7894. </dd>
  7895. <dt><samp class="option">sample_rate, s</samp></dt>
  7896. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  7897. zero inputs.
  7898. </p>
  7899. </dd>
  7900. <dt><samp class="option">nb_samples, n</samp></dt>
  7901. <dd><p>Set the number of samples per channel per each output frame, default
  7902. is 1024. Only used if plugin have zero inputs.
  7903. </p>
  7904. </dd>
  7905. <dt><samp class="option">duration, d</samp></dt>
  7906. <dd><p>Set the minimum duration of the sourced audio. See
  7907. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  7908. for the accepted syntax.
  7909. Note that the resulting duration may be greater than the specified duration,
  7910. as the generated audio is always cut at the end of a complete frame.
  7911. If not specified, or the expressed duration is negative, the audio is
  7912. supposed to be generated forever.
  7913. Only used if plugin have zero inputs.
  7914. </p>
  7915. </dd>
  7916. <dt><samp class="option">latency, l</samp></dt>
  7917. <dd><p>Enable latency compensation, by default is disabled.
  7918. Only used if plugin have inputs.
  7919. </p></dd>
  7920. </dl>
  7921. <a name="Examples-27"></a>
  7922. <h4 class="subsection">8.96.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-27" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-27" aria-hidden="true">TOC</a></span></h4>
  7923. <ul class="itemize mark-bullet">
  7924. <li>List all available plugins within amp (LADSPA example plugin) library:
  7925. <div class="example">
  7926. <pre class="example-preformatted">ladspa=file=amp
  7927. </pre></div>
  7928. </li><li>List all available controls and their valid ranges for <code class="code">vcf_notch</code>
  7929. plugin from <code class="code">VCF</code> library:
  7930. <div class="example">
  7931. <pre class="example-preformatted">ladspa=f=vcf:p=vcf_notch:c=help
  7932. </pre></div>
  7933. </li><li>Simulate low quality audio equipment using <code class="code">Computer Music Toolkit</code> (CMT)
  7934. plugin library:
  7935. <div class="example">
  7936. <pre class="example-preformatted">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  7937. </pre></div>
  7938. </li><li>Add reverberation to the audio using TAP-plugins
  7939. (Tom&rsquo;s Audio Processing plugins):
  7940. <div class="example">
  7941. <pre class="example-preformatted">ladspa=file=tap_reverb:tap_reverb
  7942. </pre></div>
  7943. </li><li>Generate white noise, with 0.2 amplitude:
  7944. <div class="example">
  7945. <pre class="example-preformatted">ladspa=file=cmt:noise_source_white:c=c0=.2
  7946. </pre></div>
  7947. </li><li>Generate 20 bpm clicks using plugin <code class="code">C* Click - Metronome</code> from the
  7948. <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  7949. <div class="example">
  7950. <pre class="example-preformatted">ladspa=file=caps:Click:c=c1=20'
  7951. </pre></div>
  7952. </li><li>Apply <code class="code">C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  7953. <div class="example">
  7954. <pre class="example-preformatted">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  7955. </pre></div>
  7956. </li><li>Increase volume by 20dB using fast lookahead limiter from Steve Harris
  7957. <code class="code">SWH Plugins</code> collection:
  7958. <div class="example">
  7959. <pre class="example-preformatted">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  7960. </pre></div>
  7961. </li><li>Attenuate low frequencies using Multiband EQ from Steve Harris
  7962. <code class="code">SWH Plugins</code> collection:
  7963. <div class="example">
  7964. <pre class="example-preformatted">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  7965. </pre></div>
  7966. </li><li>Reduce stereo image using <code class="code">Narrower</code> from the <code class="code">C* Audio Plugin Suite</code>
  7967. (CAPS) library:
  7968. <div class="example">
  7969. <pre class="example-preformatted">ladspa=caps:Narrower
  7970. </pre></div>
  7971. </li><li>Another white noise, now using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  7972. <div class="example">
  7973. <pre class="example-preformatted">ladspa=caps:White:.2
  7974. </pre></div>
  7975. </li><li>Some fractal noise, using <code class="code">C* Audio Plugin Suite</code> (CAPS) library:
  7976. <div class="example">
  7977. <pre class="example-preformatted">ladspa=caps:Fractal:c=c1=1
  7978. </pre></div>
  7979. </li><li>Dynamic volume normalization using <code class="code">VLevel</code> plugin:
  7980. <div class="example">
  7981. <pre class="example-preformatted">ladspa=vlevel-ladspa:vlevel_mono
  7982. </pre></div>
  7983. </li></ul>
  7984. <a name="Commands-41"></a>
  7985. <h4 class="subsection">8.96.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-41" aria-hidden="true">TOC</a></span></h4>
  7986. <p>This filter supports the following commands:
  7987. </p><dl class="table">
  7988. <dt><samp class="option">cN</samp></dt>
  7989. <dd><p>Modify the <var class="var">N</var>-th control value.
  7990. </p>
  7991. <p>If the specified value is not valid, it is ignored and prior one is kept.
  7992. </p></dd>
  7993. </dl>
  7994. <a name="loudnorm"></a>
  7995. <h3 class="section">8.97 loudnorm<span class="pull-right"><a class="anchor hidden-xs" href="#loudnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loudnorm" aria-hidden="true">TOC</a></span></h3>
  7996. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  7997. Support for both single pass (livestreams, files) and double pass (files) modes.
  7998. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  7999. detect true peaks, the audio stream will be upsampled to 192 kHz.
  8000. Use the <code class="code">-ar</code> option or <code class="code">aresample</code> filter to explicitly set an output sample rate.
  8001. </p>
  8002. <p>The filter accepts the following options:
  8003. </p>
  8004. <dl class="table">
  8005. <dt><samp class="option">I, i</samp></dt>
  8006. <dd><p>Set integrated loudness target.
  8007. Range is -70.0 - -5.0. Default value is -24.0.
  8008. </p>
  8009. </dd>
  8010. <dt><samp class="option">LRA, lra</samp></dt>
  8011. <dd><p>Set loudness range target.
  8012. Range is 1.0 - 50.0. Default value is 7.0.
  8013. </p>
  8014. </dd>
  8015. <dt><samp class="option">TP, tp</samp></dt>
  8016. <dd><p>Set maximum true peak.
  8017. Range is -9.0 - +0.0. Default value is -2.0.
  8018. </p>
  8019. </dd>
  8020. <dt><samp class="option">measured_I, measured_i</samp></dt>
  8021. <dd><p>Measured IL of input file.
  8022. Range is -99.0 - +0.0.
  8023. </p>
  8024. </dd>
  8025. <dt><samp class="option">measured_LRA, measured_lra</samp></dt>
  8026. <dd><p>Measured LRA of input file.
  8027. Range is 0.0 - 99.0.
  8028. </p>
  8029. </dd>
  8030. <dt><samp class="option">measured_TP, measured_tp</samp></dt>
  8031. <dd><p>Measured true peak of input file.
  8032. Range is -99.0 - +99.0.
  8033. </p>
  8034. </dd>
  8035. <dt><samp class="option">measured_thresh</samp></dt>
  8036. <dd><p>Measured threshold of input file.
  8037. Range is -99.0 - +0.0.
  8038. </p>
  8039. </dd>
  8040. <dt><samp class="option">offset</samp></dt>
  8041. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  8042. Range is -99.0 - +99.0. Default is +0.0.
  8043. </p>
  8044. </dd>
  8045. <dt><samp class="option">linear</samp></dt>
  8046. <dd><p>Normalize by linearly scaling the source audio.
  8047. <code class="code">measured_I</code>, <code class="code">measured_LRA</code>, <code class="code">measured_TP</code>,
  8048. and <code class="code">measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  8049. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  8050. result in a true peak which exceeds the target TP. If any of these
  8051. conditions aren&rsquo;t met, normalization mode will revert to <var class="var">dynamic</var>.
  8052. Options are <code class="code">true</code> or <code class="code">false</code>. Default is <code class="code">true</code>.
  8053. </p>
  8054. </dd>
  8055. <dt><samp class="option">dual_mono</samp></dt>
  8056. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  8057. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  8058. If set to <code class="code">true</code>, this option will compensate for this effect.
  8059. Multi-channel input files are not affected by this option.
  8060. Options are true or false. Default is false.
  8061. </p>
  8062. </dd>
  8063. <dt><samp class="option">print_format</samp></dt>
  8064. <dd><p>Set print format for stats. Options are summary, json, or none.
  8065. Default value is none.
  8066. </p></dd>
  8067. </dl>
  8068. <a name="lowpass"></a>
  8069. <h3 class="section">8.98 lowpass<span class="pull-right"><a class="anchor hidden-xs" href="#lowpass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lowpass" aria-hidden="true">TOC</a></span></h3>
  8070. <p>Apply a low-pass filter with 3dB point frequency.
  8071. The filter can be either single-pole or double-pole (the default).
  8072. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  8073. </p>
  8074. <p>The filter accepts the following options:
  8075. </p>
  8076. <dl class="table">
  8077. <dt><samp class="option">frequency, f</samp></dt>
  8078. <dd><p>Set frequency in Hz. Default is 500.
  8079. </p>
  8080. </dd>
  8081. <dt><samp class="option">poles, p</samp></dt>
  8082. <dd><p>Set number of poles. Default is 2.
  8083. </p>
  8084. </dd>
  8085. <dt><samp class="option">width_type, t</samp></dt>
  8086. <dd><p>Set method to specify band-width of filter.
  8087. </p><dl class="table">
  8088. <dt><samp class="option">h</samp></dt>
  8089. <dd><p>Hz
  8090. </p></dd>
  8091. <dt><samp class="option">q</samp></dt>
  8092. <dd><p>Q-Factor
  8093. </p></dd>
  8094. <dt><samp class="option">o</samp></dt>
  8095. <dd><p>octave
  8096. </p></dd>
  8097. <dt><samp class="option">s</samp></dt>
  8098. <dd><p>slope
  8099. </p></dd>
  8100. <dt><samp class="option">k</samp></dt>
  8101. <dd><p>kHz
  8102. </p></dd>
  8103. </dl>
  8104. </dd>
  8105. <dt><samp class="option">width, w</samp></dt>
  8106. <dd><p>Specify the band-width of a filter in width_type units.
  8107. Applies only to double-pole filter.
  8108. The default is 0.707q and gives a Butterworth response.
  8109. </p>
  8110. </dd>
  8111. <dt><samp class="option">mix, m</samp></dt>
  8112. <dd><p>How much to use filtered signal in output. Default is 1.
  8113. Range is between 0 and 1.
  8114. </p>
  8115. </dd>
  8116. <dt><samp class="option">channels, c</samp></dt>
  8117. <dd><p>Specify which channels to filter, by default all available are filtered.
  8118. </p>
  8119. </dd>
  8120. <dt><samp class="option">normalize, n</samp></dt>
  8121. <dd><p>Normalize biquad coefficients, by default is disabled.
  8122. Enabling it will normalize magnitude response at DC to 0dB.
  8123. </p>
  8124. </dd>
  8125. <dt><samp class="option">transform, a</samp></dt>
  8126. <dd><p>Set transform type of IIR filter.
  8127. </p><dl class="table">
  8128. <dt><samp class="option">di</samp></dt>
  8129. <dt><samp class="option">dii</samp></dt>
  8130. <dt><samp class="option">tdi</samp></dt>
  8131. <dt><samp class="option">tdii</samp></dt>
  8132. <dt><samp class="option">latt</samp></dt>
  8133. <dt><samp class="option">svf</samp></dt>
  8134. <dt><samp class="option">zdf</samp></dt>
  8135. </dl>
  8136. </dd>
  8137. <dt><samp class="option">precision, r</samp></dt>
  8138. <dd><p>Set precision of filtering.
  8139. </p><dl class="table">
  8140. <dt><samp class="option">auto</samp></dt>
  8141. <dd><p>Pick automatic sample format depending on surround filters.
  8142. </p></dd>
  8143. <dt><samp class="option">s16</samp></dt>
  8144. <dd><p>Always use signed 16-bit.
  8145. </p></dd>
  8146. <dt><samp class="option">s32</samp></dt>
  8147. <dd><p>Always use signed 32-bit.
  8148. </p></dd>
  8149. <dt><samp class="option">f32</samp></dt>
  8150. <dd><p>Always use float 32-bit.
  8151. </p></dd>
  8152. <dt><samp class="option">f64</samp></dt>
  8153. <dd><p>Always use float 64-bit.
  8154. </p></dd>
  8155. </dl>
  8156. </dd>
  8157. <dt><samp class="option">block_size, b</samp></dt>
  8158. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  8159. value (higher than impulse response length truncated when reaches near zero values) filtering
  8160. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  8161. </p>
  8162. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  8163. </p></dd>
  8164. </dl>
  8165. <a name="Examples-28"></a>
  8166. <h4 class="subsection">8.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-28" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-28" aria-hidden="true">TOC</a></span></h4>
  8167. <ul class="itemize mark-bullet">
  8168. <li>Lowpass only LFE channel, it LFE is not present it does nothing:
  8169. <div class="example">
  8170. <pre class="example-preformatted">lowpass=c=LFE
  8171. </pre></div>
  8172. </li></ul>
  8173. <a name="Commands-42"></a>
  8174. <h4 class="subsection">8.98.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-42" aria-hidden="true">TOC</a></span></h4>
  8175. <p>This filter supports the following commands:
  8176. </p><dl class="table">
  8177. <dt><samp class="option">frequency, f</samp></dt>
  8178. <dd><p>Change lowpass frequency.
  8179. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  8180. </p>
  8181. </dd>
  8182. <dt><samp class="option">width_type, t</samp></dt>
  8183. <dd><p>Change lowpass width_type.
  8184. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  8185. </p>
  8186. </dd>
  8187. <dt><samp class="option">width, w</samp></dt>
  8188. <dd><p>Change lowpass width.
  8189. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  8190. </p>
  8191. </dd>
  8192. <dt><samp class="option">mix, m</samp></dt>
  8193. <dd><p>Change lowpass mix.
  8194. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  8195. </p></dd>
  8196. </dl>
  8197. <a name="lv2"></a>
  8198. <h3 class="section">8.99 lv2<span class="pull-right"><a class="anchor hidden-xs" href="#lv2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lv2" aria-hidden="true">TOC</a></span></h3>
  8199. <p>Load a LV2 (LADSPA Version 2) plugin.
  8200. </p>
  8201. <p>To enable compilation of this filter you need to configure FFmpeg with
  8202. <code class="code">--enable-lv2</code>.
  8203. </p>
  8204. <dl class="table">
  8205. <dt><samp class="option">plugin, p</samp></dt>
  8206. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  8207. </p>
  8208. </dd>
  8209. <dt><samp class="option">controls, c</samp></dt>
  8210. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  8211. values that determine the behavior of the loaded plugin (for example delay,
  8212. threshold or gain).
  8213. If <samp class="option">controls</samp> is set to <code class="code">help</code>, all available controls and
  8214. their valid ranges are printed.
  8215. </p>
  8216. </dd>
  8217. <dt><samp class="option">sample_rate, s</samp></dt>
  8218. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  8219. zero inputs.
  8220. </p>
  8221. </dd>
  8222. <dt><samp class="option">nb_samples, n</samp></dt>
  8223. <dd><p>Set the number of samples per channel per each output frame, default
  8224. is 1024. Only used if plugin have zero inputs.
  8225. </p>
  8226. </dd>
  8227. <dt><samp class="option">duration, d</samp></dt>
  8228. <dd><p>Set the minimum duration of the sourced audio. See
  8229. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  8230. for the accepted syntax.
  8231. Note that the resulting duration may be greater than the specified duration,
  8232. as the generated audio is always cut at the end of a complete frame.
  8233. If not specified, or the expressed duration is negative, the audio is
  8234. supposed to be generated forever.
  8235. Only used if plugin have zero inputs.
  8236. </p></dd>
  8237. </dl>
  8238. <a name="Examples-29"></a>
  8239. <h4 class="subsection">8.99.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-29" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-29" aria-hidden="true">TOC</a></span></h4>
  8240. <ul class="itemize mark-bullet">
  8241. <li>Apply bass enhancer plugin from Calf:
  8242. <div class="example">
  8243. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  8244. </pre></div>
  8245. </li><li>Apply vinyl plugin from Calf:
  8246. <div class="example">
  8247. <pre class="example-preformatted">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  8248. </pre></div>
  8249. </li><li>Apply bit crusher plugin from ArtyFX:
  8250. <div class="example">
  8251. <pre class="example-preformatted">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  8252. </pre></div>
  8253. </li></ul>
  8254. <a name="Commands-43"></a>
  8255. <h4 class="subsection">8.99.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-43" aria-hidden="true">TOC</a></span></h4>
  8256. <p>This filter supports all options that are exported by plugin as commands.
  8257. </p>
  8258. <a name="mcompand"></a>
  8259. <h3 class="section">8.100 mcompand<span class="pull-right"><a class="anchor hidden-xs" href="#mcompand" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcompand" aria-hidden="true">TOC</a></span></h3>
  8260. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  8261. </p>
  8262. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  8263. This is akin to the crossover of a loudspeaker, and results in flat frequency
  8264. response when absent compander action.
  8265. </p>
  8266. <p>It accepts the following parameters:
  8267. </p>
  8268. <dl class="table">
  8269. <dt><samp class="option">args</samp></dt>
  8270. <dd><p>This option syntax is:
  8271. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  8272. For explanation of each item refer to compand filter documentation.
  8273. </p></dd>
  8274. </dl>
  8275. <a class="anchor" id="pan"></a><a name="pan-1"></a>
  8276. <h3 class="section">8.101 pan<span class="pull-right"><a class="anchor hidden-xs" href="#pan-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pan-1" aria-hidden="true">TOC</a></span></h3>
  8277. <p>Mix channels with specific gain levels. The filter accepts the output
  8278. channel layout followed by a set of channels definitions.
  8279. </p>
  8280. <p>This filter is also designed to efficiently remap the channels of an audio
  8281. stream.
  8282. </p>
  8283. <p>The filter accepts parameters of the form:
  8284. &quot;<var class="var">l</var>|<var class="var">outdef</var>|<var class="var">outdef</var>|...&quot;
  8285. </p>
  8286. <dl class="table">
  8287. <dt><samp class="option">l</samp></dt>
  8288. <dd><p>output channel layout or number of channels
  8289. </p>
  8290. </dd>
  8291. <dt><samp class="option">outdef</samp></dt>
  8292. <dd><p>output channel specification, of the form:
  8293. &quot;<var class="var">out_name</var>=[<var class="var">gain</var>*]<var class="var">in_name</var>[(+-)[<var class="var">gain</var>*]<var class="var">in_name</var>...]&quot;
  8294. </p>
  8295. </dd>
  8296. <dt><samp class="option">out_name</samp></dt>
  8297. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  8298. number (c0, c1, etc.)
  8299. </p>
  8300. </dd>
  8301. <dt><samp class="option">gain</samp></dt>
  8302. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  8303. </p>
  8304. </dd>
  8305. <dt><samp class="option">in_name</samp></dt>
  8306. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  8307. named and numbered input channels
  8308. </p></dd>
  8309. </dl>
  8310. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  8311. that specification will be renormalized so that the total is 1, thus
  8312. avoiding clipping noise.
  8313. </p>
  8314. <a name="Mixing-examples"></a>
  8315. <h4 class="subsection">8.101.1 Mixing examples<span class="pull-right"><a class="anchor hidden-xs" href="#Mixing-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Mixing-examples" aria-hidden="true">TOC</a></span></h4>
  8316. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  8317. factor for the left channel:
  8318. </p><div class="example">
  8319. <pre class="example-preformatted">pan=1c|c0=0.9*c0+0.1*c1
  8320. </pre></div>
  8321. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  8322. 7-channels surround:
  8323. </p><div class="example">
  8324. <pre class="example-preformatted">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
  8325. </pre></div>
  8326. <p>Note that <code class="command">ffmpeg</code> integrates a default down-mix (and up-mix) system
  8327. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  8328. needs.
  8329. </p>
  8330. <a name="Remapping-examples"></a>
  8331. <h4 class="subsection">8.101.2 Remapping examples<span class="pull-right"><a class="anchor hidden-xs" href="#Remapping-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Remapping-examples" aria-hidden="true">TOC</a></span></h4>
  8332. <p>The channel remapping will be effective if, and only if:
  8333. </p>
  8334. <ul class="itemize mark-bullet">
  8335. <li>gain coefficients are zeroes or ones,
  8336. </li><li>only one input per channel output,
  8337. </li></ul>
  8338. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  8339. channel mapping detected&quot;), and use an optimized and lossless method to do the
  8340. remapping.
  8341. </p>
  8342. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  8343. dropping the extra channels:
  8344. </p><div class="example">
  8345. <pre class="example-preformatted">pan=&quot;stereo| c0=FL | c1=FR&quot;
  8346. </pre></div>
  8347. <p>Given the same source, you can also switch front left and front right channels
  8348. and keep the input channel layout:
  8349. </p><div class="example">
  8350. <pre class="example-preformatted">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  8351. </pre></div>
  8352. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  8353. still keep the stereo channel layout) with:
  8354. </p><div class="example">
  8355. <pre class="example-preformatted">pan=&quot;stereo|c1=c1&quot;
  8356. </pre></div>
  8357. <p>Still with a stereo audio stream input, you can copy the right channel in both
  8358. front left and right:
  8359. </p><div class="example">
  8360. <pre class="example-preformatted">pan=&quot;stereo| c0=FR | c1=FR&quot;
  8361. </pre></div>
  8362. <a name="replaygain"></a>
  8363. <h3 class="section">8.102 replaygain<span class="pull-right"><a class="anchor hidden-xs" href="#replaygain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-replaygain" aria-hidden="true">TOC</a></span></h3>
  8364. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  8365. outputs it unchanged.
  8366. At end of filtering it displays <code class="code">track_gain</code> and <code class="code">track_peak</code>.
  8367. </p>
  8368. <p>The filter accepts the following exported read-only options:
  8369. </p>
  8370. <dl class="table">
  8371. <dt><samp class="option">track_gain</samp></dt>
  8372. <dd><p>Exported track gain in dB at end of stream.
  8373. </p>
  8374. </dd>
  8375. <dt><samp class="option">track_peak</samp></dt>
  8376. <dd><p>Exported track peak at end of stream.
  8377. </p></dd>
  8378. </dl>
  8379. <a name="resample"></a>
  8380. <h3 class="section">8.103 resample<span class="pull-right"><a class="anchor hidden-xs" href="#resample" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-resample" aria-hidden="true">TOC</a></span></h3>
  8381. <p>Convert the audio sample format, sample rate and channel layout. It is
  8382. not meant to be used directly.
  8383. </p>
  8384. <a name="rubberband"></a>
  8385. <h3 class="section">8.104 rubberband<span class="pull-right"><a class="anchor hidden-xs" href="#rubberband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rubberband" aria-hidden="true">TOC</a></span></h3>
  8386. <p>Apply time-stretching and pitch-shifting with librubberband.
  8387. </p>
  8388. <p>To enable compilation of this filter, you need to configure FFmpeg with
  8389. <code class="code">--enable-librubberband</code>.
  8390. </p>
  8391. <p>The filter accepts the following options:
  8392. </p>
  8393. <dl class="table">
  8394. <dt><samp class="option">tempo</samp></dt>
  8395. <dd><p>Set tempo scale factor.
  8396. </p>
  8397. </dd>
  8398. <dt><samp class="option">pitch</samp></dt>
  8399. <dd><p>Set pitch scale factor.
  8400. </p>
  8401. </dd>
  8402. <dt><samp class="option">transients</samp></dt>
  8403. <dd><p>Set transients detector.
  8404. Possible values are:
  8405. </p><dl class="table">
  8406. <dt><var class="var">crisp</var></dt>
  8407. <dt><var class="var">mixed</var></dt>
  8408. <dt><var class="var">smooth</var></dt>
  8409. </dl>
  8410. </dd>
  8411. <dt><samp class="option">detector</samp></dt>
  8412. <dd><p>Set detector.
  8413. Possible values are:
  8414. </p><dl class="table">
  8415. <dt><var class="var">compound</var></dt>
  8416. <dt><var class="var">percussive</var></dt>
  8417. <dt><var class="var">soft</var></dt>
  8418. </dl>
  8419. </dd>
  8420. <dt><samp class="option">phase</samp></dt>
  8421. <dd><p>Set phase.
  8422. Possible values are:
  8423. </p><dl class="table">
  8424. <dt><var class="var">laminar</var></dt>
  8425. <dt><var class="var">independent</var></dt>
  8426. </dl>
  8427. </dd>
  8428. <dt><samp class="option">window</samp></dt>
  8429. <dd><p>Set processing window size.
  8430. Possible values are:
  8431. </p><dl class="table">
  8432. <dt><var class="var">standard</var></dt>
  8433. <dt><var class="var">short</var></dt>
  8434. <dt><var class="var">long</var></dt>
  8435. </dl>
  8436. </dd>
  8437. <dt><samp class="option">smoothing</samp></dt>
  8438. <dd><p>Set smoothing.
  8439. Possible values are:
  8440. </p><dl class="table">
  8441. <dt><var class="var">off</var></dt>
  8442. <dt><var class="var">on</var></dt>
  8443. </dl>
  8444. </dd>
  8445. <dt><samp class="option">formant</samp></dt>
  8446. <dd><p>Enable formant preservation when shift pitching.
  8447. Possible values are:
  8448. </p><dl class="table">
  8449. <dt><var class="var">shifted</var></dt>
  8450. <dt><var class="var">preserved</var></dt>
  8451. </dl>
  8452. </dd>
  8453. <dt><samp class="option">pitchq</samp></dt>
  8454. <dd><p>Set pitch quality.
  8455. Possible values are:
  8456. </p><dl class="table">
  8457. <dt><var class="var">quality</var></dt>
  8458. <dt><var class="var">speed</var></dt>
  8459. <dt><var class="var">consistency</var></dt>
  8460. </dl>
  8461. </dd>
  8462. <dt><samp class="option">channels</samp></dt>
  8463. <dd><p>Set channels.
  8464. Possible values are:
  8465. </p><dl class="table">
  8466. <dt><var class="var">apart</var></dt>
  8467. <dt><var class="var">together</var></dt>
  8468. </dl>
  8469. </dd>
  8470. </dl>
  8471. <a name="Commands-44"></a>
  8472. <h4 class="subsection">8.104.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-44" aria-hidden="true">TOC</a></span></h4>
  8473. <p>This filter supports the following commands:
  8474. </p><dl class="table">
  8475. <dt><samp class="option">tempo</samp></dt>
  8476. <dd><p>Change filter tempo scale factor.
  8477. Syntax for the command is : &quot;<var class="var">tempo</var>&quot;
  8478. </p>
  8479. </dd>
  8480. <dt><samp class="option">pitch</samp></dt>
  8481. <dd><p>Change filter pitch scale factor.
  8482. Syntax for the command is : &quot;<var class="var">pitch</var>&quot;
  8483. </p></dd>
  8484. </dl>
  8485. <a name="sidechaincompress"></a>
  8486. <h3 class="section">8.105 sidechaincompress<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaincompress" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaincompress" aria-hidden="true">TOC</a></span></h3>
  8487. <p>This filter acts like normal compressor but has the ability to compress
  8488. detected signal using second input signal.
  8489. It needs two input streams and returns one output stream.
  8490. First input stream will be processed depending on second stream signal.
  8491. The filtered signal then can be filtered with other filters in later stages of
  8492. processing. See <a class="ref" href="#pan">pan</a> and <a class="ref" href="#amerge">amerge</a> filter.
  8493. </p>
  8494. <p>The filter accepts the following options:
  8495. </p>
  8496. <dl class="table">
  8497. <dt><samp class="option">level_in</samp></dt>
  8498. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  8499. </p>
  8500. </dd>
  8501. <dt><samp class="option">mode</samp></dt>
  8502. <dd><p>Set mode of compressor operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  8503. Default is <code class="code">downward</code>.
  8504. </p>
  8505. </dd>
  8506. <dt><samp class="option">threshold</samp></dt>
  8507. <dd><p>If a signal of second stream raises above this level it will affect the gain
  8508. reduction of first stream.
  8509. By default is 0.125. Range is between 0.00097563 and 1.
  8510. </p>
  8511. </dd>
  8512. <dt><samp class="option">ratio</samp></dt>
  8513. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  8514. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  8515. Default is 2. Range is between 1 and 20.
  8516. </p>
  8517. </dd>
  8518. <dt><samp class="option">attack</samp></dt>
  8519. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  8520. reduction starts. Default is 20. Range is between 0.01 and 2000.
  8521. </p>
  8522. </dd>
  8523. <dt><samp class="option">release</samp></dt>
  8524. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  8525. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  8526. </p>
  8527. </dd>
  8528. <dt><samp class="option">makeup</samp></dt>
  8529. <dd><p>Set the amount by how much signal will be amplified after processing.
  8530. Default is 1. Range is from 1 to 64.
  8531. </p>
  8532. </dd>
  8533. <dt><samp class="option">knee</samp></dt>
  8534. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  8535. Default is 2.82843. Range is between 1 and 8.
  8536. </p>
  8537. </dd>
  8538. <dt><samp class="option">link</samp></dt>
  8539. <dd><p>Choose if the <code class="code">average</code> level between all channels of side-chain stream
  8540. or the louder(<code class="code">maximum</code>) channel of side-chain stream affects the
  8541. reduction. Default is <code class="code">average</code>.
  8542. </p>
  8543. </dd>
  8544. <dt><samp class="option">detection</samp></dt>
  8545. <dd><p>Should the exact signal be taken in case of <code class="code">peak</code> or an RMS one in case
  8546. of <code class="code">rms</code>. Default is <code class="code">rms</code> which is mainly smoother.
  8547. </p>
  8548. </dd>
  8549. <dt><samp class="option">level_sc</samp></dt>
  8550. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  8551. </p>
  8552. </dd>
  8553. <dt><samp class="option">mix</samp></dt>
  8554. <dd><p>How much to use compressed signal in output. Default is 1.
  8555. Range is between 0 and 1.
  8556. </p></dd>
  8557. </dl>
  8558. <a name="Commands-45"></a>
  8559. <h4 class="subsection">8.105.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-45" aria-hidden="true">TOC</a></span></h4>
  8560. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  8561. </p>
  8562. <a name="Examples-30"></a>
  8563. <h4 class="subsection">8.105.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-30" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-30" aria-hidden="true">TOC</a></span></h4>
  8564. <ul class="itemize mark-bullet">
  8565. <li>Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  8566. depending on the signal of 2nd input and later compressed signal to be
  8567. merged with 2nd input:
  8568. <div class="example">
  8569. <pre class="example-preformatted">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;
  8570. </pre></div>
  8571. </li></ul>
  8572. <a name="sidechaingate"></a>
  8573. <h3 class="section">8.106 sidechaingate<span class="pull-right"><a class="anchor hidden-xs" href="#sidechaingate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidechaingate" aria-hidden="true">TOC</a></span></h3>
  8574. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  8575. filter the detected signal before sending it to the gain reduction stage.
  8576. Normally a gate uses the full range signal to detect a level above the
  8577. threshold.
  8578. For example: If you cut all lower frequencies from your sidechain signal
  8579. the gate will decrease the volume of your track only if not enough highs
  8580. appear. With this technique you are able to reduce the resonation of a
  8581. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  8582. guitar.
  8583. It needs two input streams and returns one output stream.
  8584. First input stream will be processed depending on second stream signal.
  8585. </p>
  8586. <p>The filter accepts the following options:
  8587. </p>
  8588. <dl class="table">
  8589. <dt><samp class="option">level_in</samp></dt>
  8590. <dd><p>Set input level before filtering.
  8591. Default is 1. Allowed range is from 0.015625 to 64.
  8592. </p>
  8593. </dd>
  8594. <dt><samp class="option">mode</samp></dt>
  8595. <dd><p>Set the mode of operation. Can be <code class="code">upward</code> or <code class="code">downward</code>.
  8596. Default is <code class="code">downward</code>. If set to <code class="code">upward</code> mode, higher parts of signal
  8597. will be amplified, expanding dynamic range in upward direction.
  8598. Otherwise, in case of <code class="code">downward</code> lower parts of signal will be reduced.
  8599. </p>
  8600. </dd>
  8601. <dt><samp class="option">range</samp></dt>
  8602. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  8603. Default is 0.06125. Allowed range is from 0 to 1.
  8604. Setting this to 0 disables reduction and then filter behaves like expander.
  8605. </p>
  8606. </dd>
  8607. <dt><samp class="option">threshold</samp></dt>
  8608. <dd><p>If a signal rises above this level the gain reduction is released.
  8609. Default is 0.125. Allowed range is from 0 to 1.
  8610. </p>
  8611. </dd>
  8612. <dt><samp class="option">ratio</samp></dt>
  8613. <dd><p>Set a ratio about which the signal is reduced.
  8614. Default is 2. Allowed range is from 1 to 9000.
  8615. </p>
  8616. </dd>
  8617. <dt><samp class="option">attack</samp></dt>
  8618. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  8619. reduction stops.
  8620. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  8621. </p>
  8622. </dd>
  8623. <dt><samp class="option">release</samp></dt>
  8624. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  8625. reduction is increased again. Default is 250 milliseconds.
  8626. Allowed range is from 0.01 to 9000.
  8627. </p>
  8628. </dd>
  8629. <dt><samp class="option">makeup</samp></dt>
  8630. <dd><p>Set amount of amplification of signal after processing.
  8631. Default is 1. Allowed range is from 1 to 64.
  8632. </p>
  8633. </dd>
  8634. <dt><samp class="option">knee</samp></dt>
  8635. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  8636. Default is 2.828427125. Allowed range is from 1 to 8.
  8637. </p>
  8638. </dd>
  8639. <dt><samp class="option">detection</samp></dt>
  8640. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  8641. Default is rms. Can be peak or rms.
  8642. </p>
  8643. </dd>
  8644. <dt><samp class="option">link</samp></dt>
  8645. <dd><p>Choose if the average level between all channels or the louder channel affects
  8646. the reduction.
  8647. Default is average. Can be average or maximum.
  8648. </p>
  8649. </dd>
  8650. <dt><samp class="option">level_sc</samp></dt>
  8651. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  8652. </p></dd>
  8653. </dl>
  8654. <a name="Commands-46"></a>
  8655. <h4 class="subsection">8.106.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-46" aria-hidden="true">TOC</a></span></h4>
  8656. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  8657. </p>
  8658. <a name="silencedetect"></a>
  8659. <h3 class="section">8.107 silencedetect<span class="pull-right"><a class="anchor hidden-xs" href="#silencedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silencedetect" aria-hidden="true">TOC</a></span></h3>
  8660. <p>Detect silence in an audio stream.
  8661. </p>
  8662. <p>This filter logs a message when it detects that the input audio volume is less
  8663. or equal to a noise tolerance value for a duration greater or equal to the
  8664. minimum detected noise duration.
  8665. </p>
  8666. <p>The printed times and duration are expressed in seconds. The
  8667. <code class="code">lavfi.silence_start</code> or <code class="code">lavfi.silence_start.X</code> metadata key
  8668. is set on the first frame whose timestamp equals or exceeds the detection
  8669. duration and it contains the timestamp of the first frame of the silence.
  8670. </p>
  8671. <p>The <code class="code">lavfi.silence_duration</code> or <code class="code">lavfi.silence_duration.X</code>
  8672. and <code class="code">lavfi.silence_end</code> or <code class="code">lavfi.silence_end.X</code> metadata
  8673. keys are set on the first frame after the silence. If <samp class="option">mono</samp> is
  8674. enabled, and each channel is evaluated separately, the <code class="code">.X</code>
  8675. suffixed keys are used, and <code class="code">X</code> corresponds to the channel number.
  8676. </p>
  8677. <p>The filter accepts the following options:
  8678. </p>
  8679. <dl class="table">
  8680. <dt><samp class="option">noise, n</samp></dt>
  8681. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  8682. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  8683. </p>
  8684. </dd>
  8685. <dt><samp class="option">duration, d</samp></dt>
  8686. <dd><p>Set silence duration until notification (default is 2 seconds). See
  8687. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  8688. for the accepted syntax.
  8689. </p>
  8690. </dd>
  8691. <dt><samp class="option">mono, m</samp></dt>
  8692. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  8693. </p></dd>
  8694. </dl>
  8695. <a name="Examples-31"></a>
  8696. <h4 class="subsection">8.107.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-31" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-31" aria-hidden="true">TOC</a></span></h4>
  8697. <ul class="itemize mark-bullet">
  8698. <li>Detect 5 seconds of silence with -50dB noise tolerance:
  8699. <div class="example">
  8700. <pre class="example-preformatted">silencedetect=n=-50dB:d=5
  8701. </pre></div>
  8702. </li><li>Complete example with <code class="command">ffmpeg</code> to detect silence with 0.0001 noise
  8703. tolerance in <samp class="file">silence.mp3</samp>:
  8704. <div class="example">
  8705. <pre class="example-preformatted">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  8706. </pre></div>
  8707. </li></ul>
  8708. <a name="silenceremove"></a>
  8709. <h3 class="section">8.108 silenceremove<span class="pull-right"><a class="anchor hidden-xs" href="#silenceremove" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-silenceremove" aria-hidden="true">TOC</a></span></h3>
  8710. <p>Remove silence from the beginning, middle or end of the audio.
  8711. </p>
  8712. <p>The filter accepts the following options:
  8713. </p>
  8714. <dl class="table">
  8715. <dt><samp class="option">start_periods</samp></dt>
  8716. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  8717. the audio. A value of zero indicates no silence should be trimmed from the
  8718. beginning. When specifying a non-zero value, it trims audio up until it
  8719. finds non-silence. Normally, when trimming silence from beginning of audio
  8720. the <var class="var">start_periods</var> will be <code class="code">1</code> but it can be increased to higher
  8721. values to trim all audio up to specific count of non-silence periods.
  8722. Default value is <code class="code">0</code>.
  8723. </p>
  8724. </dd>
  8725. <dt><samp class="option">start_duration</samp></dt>
  8726. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  8727. trimming audio. By increasing the duration, bursts of noises can be treated
  8728. as silence and trimmed off. Default value is <code class="code">0</code>.
  8729. </p>
  8730. </dd>
  8731. <dt><samp class="option">start_threshold</samp></dt>
  8732. <dd><p>This indicates what sample value should be treated as silence. For digital
  8733. audio, a value of <code class="code">0</code> may be fine but for audio recorded from analog,
  8734. you may wish to increase the value to account for background noise.
  8735. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  8736. or amplitude ratio. Default value is <code class="code">0</code>.
  8737. </p>
  8738. </dd>
  8739. <dt><samp class="option">start_silence</samp></dt>
  8740. <dd><p>Specify max duration of silence at beginning that will be kept after
  8741. trimming. Default is 0, which is equal to trimming all samples detected
  8742. as silence.
  8743. </p>
  8744. </dd>
  8745. <dt><samp class="option">start_mode</samp></dt>
  8746. <dd><p>Specify mode of detection of silence end at start of multi-channel audio.
  8747. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">any</var>.
  8748. With <var class="var">any</var>, any sample from any channel that is detected as non-silence
  8749. will trigger end of silence trimming at start of audio stream.
  8750. With <var class="var">all</var>, only if every sample from every channel is detected as non-silence
  8751. will trigger end of silence trimming at start of audio stream, limited usage.
  8752. </p>
  8753. </dd>
  8754. <dt><samp class="option">stop_periods</samp></dt>
  8755. <dd><p>Set the count for trimming silence from the end of audio. When specifying a
  8756. positive value, it trims audio after it finds specified silence period.
  8757. To remove silence from the middle of a file, specify a <var class="var">stop_periods</var>
  8758. that is negative. This value is then treated as a positive value and is
  8759. used to indicate the effect should restart processing as specified by
  8760. <var class="var">stop_periods</var>, making it suitable for removing periods of silence
  8761. in the middle of the audio.
  8762. Default value is <code class="code">0</code>.
  8763. </p>
  8764. </dd>
  8765. <dt><samp class="option">stop_duration</samp></dt>
  8766. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  8767. more. By specifying a higher duration, silence that is wanted can be left in
  8768. the audio.
  8769. Default value is <code class="code">0</code>.
  8770. </p>
  8771. </dd>
  8772. <dt><samp class="option">stop_threshold</samp></dt>
  8773. <dd><p>This is the same as <samp class="option">start_threshold</samp> but for trimming silence from
  8774. the end of audio.
  8775. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  8776. or amplitude ratio. Default value is <code class="code">0</code>.
  8777. </p>
  8778. </dd>
  8779. <dt><samp class="option">stop_silence</samp></dt>
  8780. <dd><p>Specify max duration of silence at end that will be kept after
  8781. trimming. Default is 0, which is equal to trimming all samples detected
  8782. as silence.
  8783. </p>
  8784. </dd>
  8785. <dt><samp class="option">stop_mode</samp></dt>
  8786. <dd><p>Specify mode of detection of silence start after start of multi-channel audio.
  8787. Can be <var class="var">any</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  8788. With <var class="var">any</var>, any sample from any channel that is detected as silence
  8789. will trigger start of silence trimming after start of audio stream, limited usage.
  8790. With <var class="var">all</var>, only if every sample from every channel is detected as silence
  8791. will trigger start of silence trimming after start of audio stream.
  8792. </p>
  8793. </dd>
  8794. <dt><samp class="option">detection</samp></dt>
  8795. <dd><p>Set how is silence detected.
  8796. </p><dl class="table">
  8797. <dt><samp class="option">avg</samp></dt>
  8798. <dd><p>Mean of absolute values of samples in moving window.
  8799. </p></dd>
  8800. <dt><samp class="option">rms</samp></dt>
  8801. <dd><p>Root squared mean of absolute values of samples in moving window.
  8802. </p></dd>
  8803. <dt><samp class="option">peak</samp></dt>
  8804. <dd><p>Maximum of absolute values of samples in moving window.
  8805. </p></dd>
  8806. <dt><samp class="option">median</samp></dt>
  8807. <dd><p>Median of absolute values of samples in moving window.
  8808. </p></dd>
  8809. <dt><samp class="option">ptp</samp></dt>
  8810. <dd><p>Absolute of max peak to min peak difference of samples in moving window.
  8811. </p></dd>
  8812. <dt><samp class="option">dev</samp></dt>
  8813. <dd><p>Standard deviation of values of samples in moving window.
  8814. </p></dd>
  8815. </dl>
  8816. <p>Default value is <code class="code">rms</code>.
  8817. </p>
  8818. </dd>
  8819. <dt><samp class="option">window</samp></dt>
  8820. <dd><p>Set duration in number of seconds used to calculate size of window in number
  8821. of samples for detecting silence. Using <code class="code">0</code> will effectively disable
  8822. any windowing and use only single sample per channel for silence detection.
  8823. In that case it may be needed to also set <samp class="option">start_silence</samp> and/or
  8824. <samp class="option">stop_silence</samp> to nonzero values with also <samp class="option">start_duration</samp> and/or
  8825. <samp class="option">stop_duration</samp> to nonzero values.
  8826. Default value is <code class="code">0.02</code>. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  8827. </p>
  8828. </dd>
  8829. <dt><samp class="option">timestamp</samp></dt>
  8830. <dd><p>Set processing mode of every audio frame output timestamp.
  8831. </p><dl class="table">
  8832. <dt><samp class="option">write</samp></dt>
  8833. <dd><p>Full timestamps rewrite, keep only the start time for the first output frame.
  8834. </p></dd>
  8835. <dt><samp class="option">copy</samp></dt>
  8836. <dd><p>Non-dropped frames are left with same timestamp as input audio frame.
  8837. </p></dd>
  8838. </dl>
  8839. <p>Defaults value is <code class="code">write</code>.
  8840. </p></dd>
  8841. </dl>
  8842. <a name="Examples-32"></a>
  8843. <h4 class="subsection">8.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-32" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-32" aria-hidden="true">TOC</a></span></h4>
  8844. <ul class="itemize mark-bullet">
  8845. <li>The following example shows how this filter can be used to start a recording
  8846. that does not contain the delay at the start which usually occurs between
  8847. pressing the record button and the start of the performance:
  8848. <div class="example">
  8849. <pre class="example-preformatted">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  8850. </pre></div>
  8851. </li><li>Trim all silence encountered from beginning to end where there is more than 1
  8852. second of silence in audio:
  8853. <div class="example">
  8854. <pre class="example-preformatted">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  8855. </pre></div>
  8856. </li><li>Trim all digital silence samples, using peak detection, from beginning to end
  8857. where there is more than 0 samples of digital silence in audio and digital
  8858. silence is detected in all channels at same positions in stream:
  8859. <div class="example">
  8860. <pre class="example-preformatted">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  8861. </pre></div>
  8862. </li><li>Trim every 2nd encountered silence period from beginning to end where there is
  8863. more than 1 second of silence per silence period in audio:
  8864. <div class="example">
  8865. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB
  8866. </pre></div>
  8867. </li><li>Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period:
  8868. <div class="example">
  8869. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5
  8870. </pre></div>
  8871. </li><li>Similar as above, but keep maximum of 1.5 seconds of silence from start of audio:
  8872. <div class="example">
  8873. <pre class="example-preformatted">silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5:start_periods=1:start_duration=1:start_silence=1.5:stop_threshold=-90dB
  8874. </pre></div>
  8875. </li></ul>
  8876. <a name="Commands-47"></a>
  8877. <h4 class="subsection">8.108.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-47" aria-hidden="true">TOC</a></span></h4>
  8878. <p>This filter supports some above options as <a class="ref" href="#commands">commands</a>.
  8879. </p>
  8880. <a name="sofalizer"></a>
  8881. <h3 class="section">8.109 sofalizer<span class="pull-right"><a class="anchor hidden-xs" href="#sofalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sofalizer" aria-hidden="true">TOC</a></span></h3>
  8882. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  8883. loudspeakers around the user for binaural listening via headphones (audio
  8884. formats up to 9 channels supported).
  8885. The HRTFs are stored in SOFA files (see <a class="url" href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  8886. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  8887. Austrian Academy of Sciences.
  8888. </p>
  8889. <p>To enable compilation of this filter you need to configure FFmpeg with
  8890. <code class="code">--enable-libmysofa</code>.
  8891. </p>
  8892. <p>The filter accepts the following options:
  8893. </p>
  8894. <dl class="table">
  8895. <dt><samp class="option">sofa</samp></dt>
  8896. <dd><p>Set the SOFA file used for rendering.
  8897. </p>
  8898. </dd>
  8899. <dt><samp class="option">gain</samp></dt>
  8900. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  8901. </p>
  8902. </dd>
  8903. <dt><samp class="option">rotation</samp></dt>
  8904. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  8905. </p>
  8906. </dd>
  8907. <dt><samp class="option">elevation</samp></dt>
  8908. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  8909. </p>
  8910. </dd>
  8911. <dt><samp class="option">radius</samp></dt>
  8912. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  8913. HRTFs. Default is 1.
  8914. </p>
  8915. </dd>
  8916. <dt><samp class="option">type</samp></dt>
  8917. <dd><p>Set processing type. Can be <var class="var">time</var> or <var class="var">freq</var>. <var class="var">time</var> is
  8918. processing audio in time domain which is slow.
  8919. <var class="var">freq</var> is processing audio in frequency domain which is fast.
  8920. Default is <var class="var">freq</var>.
  8921. </p>
  8922. </dd>
  8923. <dt><samp class="option">speakers</samp></dt>
  8924. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  8925. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  8926. Each virtual loudspeaker is described with short channel name following with
  8927. azimuth and elevation in degrees.
  8928. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  8929. For example to override front left and front right channel positions use:
  8930. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  8931. Descriptions with unrecognised channel names are ignored.
  8932. </p>
  8933. </dd>
  8934. <dt><samp class="option">lfegain</samp></dt>
  8935. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  8936. </p>
  8937. </dd>
  8938. <dt><samp class="option">framesize</samp></dt>
  8939. <dd><p>Set custom frame size in number of samples. Default is 1024.
  8940. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp class="samp">type</samp>&rsquo;
  8941. is set to <var class="var">freq</var>.
  8942. </p>
  8943. </dd>
  8944. <dt><samp class="option">normalize</samp></dt>
  8945. <dd><p>Should all IRs be normalized upon importing SOFA file.
  8946. By default is enabled.
  8947. </p>
  8948. </dd>
  8949. <dt><samp class="option">interpolate</samp></dt>
  8950. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  8951. does not match. By default is disabled.
  8952. </p>
  8953. </dd>
  8954. <dt><samp class="option">minphase</samp></dt>
  8955. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  8956. </p>
  8957. </dd>
  8958. <dt><samp class="option">anglestep</samp></dt>
  8959. <dd><p>Set neighbor search angle step. Only used if option <var class="var">interpolate</var> is enabled.
  8960. </p>
  8961. </dd>
  8962. <dt><samp class="option">radstep</samp></dt>
  8963. <dd><p>Set neighbor search radius step. Only used if option <var class="var">interpolate</var> is enabled.
  8964. </p></dd>
  8965. </dl>
  8966. <a name="Examples-33"></a>
  8967. <h4 class="subsection">8.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-33" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-33" aria-hidden="true">TOC</a></span></h4>
  8968. <ul class="itemize mark-bullet">
  8969. <li>Using ClubFritz6 sofa file:
  8970. <div class="example">
  8971. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  8972. </pre></div>
  8973. </li><li>Using ClubFritz12 sofa file and bigger radius with small rotation:
  8974. <div class="example">
  8975. <pre class="example-preformatted">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  8976. </pre></div>
  8977. </li><li>Similar as above but with custom speaker positions for front left, front right, back left and back right
  8978. and also with custom gain:
  8979. <div class="example">
  8980. <pre class="example-preformatted">&quot;sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28&quot;
  8981. </pre></div>
  8982. </li></ul>
  8983. <a name="speechnorm"></a>
  8984. <h3 class="section">8.110 speechnorm<span class="pull-right"><a class="anchor hidden-xs" href="#speechnorm" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-speechnorm" aria-hidden="true">TOC</a></span></h3>
  8985. <p>Speech Normalizer.
  8986. </p>
  8987. <p>This filter expands or compresses each half-cycle of audio samples
  8988. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  8989. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  8990. </p>
  8991. <p>The filter accepts the following options:
  8992. </p>
  8993. <dl class="table">
  8994. <dt><samp class="option">peak, p</samp></dt>
  8995. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  8996. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  8997. </p>
  8998. </dd>
  8999. <dt><samp class="option">expansion, e</samp></dt>
  9000. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  9001. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  9002. would be such that local peak value reaches target peak value but never to surpass it and that
  9003. ratio between new and previous peak value does not surpass this option value.
  9004. </p>
  9005. </dd>
  9006. <dt><samp class="option">compression, c</samp></dt>
  9007. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  9008. This option controls maximum local half-cycle of samples compression. This option is used
  9009. only if <samp class="option">threshold</samp> option is set to value greater than 0.0, then in such cases
  9010. when local peak is lower or same as value set by <samp class="option">threshold</samp> all samples belonging to
  9011. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  9012. </p>
  9013. </dd>
  9014. <dt><samp class="option">threshold, t</samp></dt>
  9015. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  9016. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  9017. Any half-cycle samples with their local peak value below or same as this option value will be
  9018. compressed by current compression factor, otherwise, if greater than threshold value they will be
  9019. expanded with expansion factor so that it could reach peak target value but never surpass it.
  9020. </p>
  9021. </dd>
  9022. <dt><samp class="option">raise, r</samp></dt>
  9023. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  9024. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  9025. each new half-cycle until it reaches <samp class="option">expansion</samp> value.
  9026. Setting this options too high may lead to distortions.
  9027. </p>
  9028. </dd>
  9029. <dt><samp class="option">fall, f</samp></dt>
  9030. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  9031. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  9032. each new half-cycle until it reaches <samp class="option">compression</samp> value.
  9033. </p>
  9034. </dd>
  9035. <dt><samp class="option">channels, h</samp></dt>
  9036. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  9037. </p>
  9038. </dd>
  9039. <dt><samp class="option">invert, i</samp></dt>
  9040. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp class="option">threshold</samp>
  9041. option. When enabled any half-cycle of samples with their local peak value below or same as
  9042. <samp class="option">threshold</samp> option will be expanded otherwise it will be compressed.
  9043. </p>
  9044. </dd>
  9045. <dt><samp class="option">link, l</samp></dt>
  9046. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  9047. When disabled each filtered channel gain calculation is independent, otherwise when this option
  9048. is enabled the minimum of all possible gains for each filtered channel is used.
  9049. </p>
  9050. </dd>
  9051. <dt><samp class="option">rms, m</samp></dt>
  9052. <dd><p>Set the expansion target RMS value. This specifies the highest allowed RMS level for the normalized
  9053. audio input. Default value is 0.0, thus disabled. Allowed range is from 0.0 to 1.0.
  9054. </p></dd>
  9055. </dl>
  9056. <a name="Commands-48"></a>
  9057. <h4 class="subsection">8.110.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-48" aria-hidden="true">TOC</a></span></h4>
  9058. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  9059. </p>
  9060. <a name="Examples-34"></a>
  9061. <h4 class="subsection">8.110.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-34" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-34" aria-hidden="true">TOC</a></span></h4>
  9062. <ul class="itemize mark-bullet">
  9063. <li>Weak and slow amplification:
  9064. <div class="example">
  9065. <pre class="example-preformatted">speechnorm=e=3:r=0.00001:l=1
  9066. </pre></div>
  9067. </li><li>Moderate and slow amplification:
  9068. <div class="example">
  9069. <pre class="example-preformatted">speechnorm=e=6.25:r=0.00001:l=1
  9070. </pre></div>
  9071. </li><li>Strong and fast amplification:
  9072. <div class="example">
  9073. <pre class="example-preformatted">speechnorm=e=12.5:r=0.0001:l=1
  9074. </pre></div>
  9075. </li><li>Very strong and fast amplification:
  9076. <div class="example">
  9077. <pre class="example-preformatted">speechnorm=e=25:r=0.0001:l=1
  9078. </pre></div>
  9079. </li><li>Extreme and fast amplification:
  9080. <div class="example">
  9081. <pre class="example-preformatted">speechnorm=e=50:r=0.0001:l=1
  9082. </pre></div>
  9083. </li></ul>
  9084. <a name="stereotools"></a>
  9085. <h3 class="section">8.111 stereotools<span class="pull-right"><a class="anchor hidden-xs" href="#stereotools" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereotools" aria-hidden="true">TOC</a></span></h3>
  9086. <p>This filter has some handy utilities to manage stereo signals, for converting
  9087. M/S stereo recordings to L/R signal while having control over the parameters
  9088. or spreading the stereo image of master track.
  9089. </p>
  9090. <p>The filter accepts the following options:
  9091. </p>
  9092. <dl class="table">
  9093. <dt><samp class="option">level_in</samp></dt>
  9094. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  9095. Allowed range is from 0.015625 to 64.
  9096. </p>
  9097. </dd>
  9098. <dt><samp class="option">level_out</samp></dt>
  9099. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  9100. Allowed range is from 0.015625 to 64.
  9101. </p>
  9102. </dd>
  9103. <dt><samp class="option">balance_in</samp></dt>
  9104. <dd><p>Set input balance between both channels. Default is 0.
  9105. Allowed range is from -1 to 1.
  9106. </p>
  9107. </dd>
  9108. <dt><samp class="option">balance_out</samp></dt>
  9109. <dd><p>Set output balance between both channels. Default is 0.
  9110. Allowed range is from -1 to 1.
  9111. </p>
  9112. </dd>
  9113. <dt><samp class="option">softclip</samp></dt>
  9114. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  9115. clipping. Disabled by default.
  9116. </p>
  9117. </dd>
  9118. <dt><samp class="option">mutel</samp></dt>
  9119. <dd><p>Mute the left channel. Disabled by default.
  9120. </p>
  9121. </dd>
  9122. <dt><samp class="option">muter</samp></dt>
  9123. <dd><p>Mute the right channel. Disabled by default.
  9124. </p>
  9125. </dd>
  9126. <dt><samp class="option">phasel</samp></dt>
  9127. <dd><p>Change the phase of the left channel. Disabled by default.
  9128. </p>
  9129. </dd>
  9130. <dt><samp class="option">phaser</samp></dt>
  9131. <dd><p>Change the phase of the right channel. Disabled by default.
  9132. </p>
  9133. </dd>
  9134. <dt><samp class="option">mode</samp></dt>
  9135. <dd><p>Set stereo mode. Available values are:
  9136. </p>
  9137. <dl class="table">
  9138. <dt>&lsquo;<samp class="samp">lr&gt;lr</samp>&rsquo;</dt>
  9139. <dd><p>Left/Right to Left/Right, this is default.
  9140. </p>
  9141. </dd>
  9142. <dt>&lsquo;<samp class="samp">lr&gt;ms</samp>&rsquo;</dt>
  9143. <dd><p>Left/Right to Mid/Side.
  9144. </p>
  9145. </dd>
  9146. <dt>&lsquo;<samp class="samp">ms&gt;lr</samp>&rsquo;</dt>
  9147. <dd><p>Mid/Side to Left/Right.
  9148. </p>
  9149. </dd>
  9150. <dt>&lsquo;<samp class="samp">lr&gt;ll</samp>&rsquo;</dt>
  9151. <dd><p>Left/Right to Left/Left.
  9152. </p>
  9153. </dd>
  9154. <dt>&lsquo;<samp class="samp">lr&gt;rr</samp>&rsquo;</dt>
  9155. <dd><p>Left/Right to Right/Right.
  9156. </p>
  9157. </dd>
  9158. <dt>&lsquo;<samp class="samp">lr&gt;l+r</samp>&rsquo;</dt>
  9159. <dd><p>Left/Right to Left + Right.
  9160. </p>
  9161. </dd>
  9162. <dt>&lsquo;<samp class="samp">lr&gt;rl</samp>&rsquo;</dt>
  9163. <dd><p>Left/Right to Right/Left.
  9164. </p>
  9165. </dd>
  9166. <dt>&lsquo;<samp class="samp">ms&gt;ll</samp>&rsquo;</dt>
  9167. <dd><p>Mid/Side to Left/Left.
  9168. </p>
  9169. </dd>
  9170. <dt>&lsquo;<samp class="samp">ms&gt;rr</samp>&rsquo;</dt>
  9171. <dd><p>Mid/Side to Right/Right.
  9172. </p>
  9173. </dd>
  9174. <dt>&lsquo;<samp class="samp">ms&gt;rl</samp>&rsquo;</dt>
  9175. <dd><p>Mid/Side to Right/Left.
  9176. </p>
  9177. </dd>
  9178. <dt>&lsquo;<samp class="samp">lr&gt;l-r</samp>&rsquo;</dt>
  9179. <dd><p>Left/Right to Left - Right.
  9180. </p></dd>
  9181. </dl>
  9182. </dd>
  9183. <dt><samp class="option">slev</samp></dt>
  9184. <dd><p>Set level of side signal. Default is 1.
  9185. Allowed range is from 0.015625 to 64.
  9186. </p>
  9187. </dd>
  9188. <dt><samp class="option">sbal</samp></dt>
  9189. <dd><p>Set balance of side signal. Default is 0.
  9190. Allowed range is from -1 to 1.
  9191. </p>
  9192. </dd>
  9193. <dt><samp class="option">mlev</samp></dt>
  9194. <dd><p>Set level of the middle signal. Default is 1.
  9195. Allowed range is from 0.015625 to 64.
  9196. </p>
  9197. </dd>
  9198. <dt><samp class="option">mpan</samp></dt>
  9199. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  9200. </p>
  9201. </dd>
  9202. <dt><samp class="option">base</samp></dt>
  9203. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  9204. Allowed range is from -1 to 1.
  9205. </p>
  9206. </dd>
  9207. <dt><samp class="option">delay</samp></dt>
  9208. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  9209. vice versa. Default is 0. Allowed range is from -20 to 20.
  9210. </p>
  9211. </dd>
  9212. <dt><samp class="option">sclevel</samp></dt>
  9213. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  9214. </p>
  9215. </dd>
  9216. <dt><samp class="option">phase</samp></dt>
  9217. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  9218. </p>
  9219. </dd>
  9220. <dt><samp class="option">bmode_in, bmode_out</samp></dt>
  9221. <dd><p>Set balance mode for balance_in/balance_out option.
  9222. </p>
  9223. <p>Can be one of the following:
  9224. </p>
  9225. <dl class="table">
  9226. <dt>&lsquo;<samp class="samp">balance</samp>&rsquo;</dt>
  9227. <dd><p>Classic balance mode. Attenuate one channel at time.
  9228. Gain is raised up to 1.
  9229. </p>
  9230. </dd>
  9231. <dt>&lsquo;<samp class="samp">amplitude</samp>&rsquo;</dt>
  9232. <dd><p>Similar as classic mode above but gain is raised up to 2.
  9233. </p>
  9234. </dd>
  9235. <dt>&lsquo;<samp class="samp">power</samp>&rsquo;</dt>
  9236. <dd><p>Equal power distribution, from -6dB to +6dB range.
  9237. </p></dd>
  9238. </dl>
  9239. </dd>
  9240. </dl>
  9241. <a name="Commands-49"></a>
  9242. <h4 class="subsection">8.111.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-49" aria-hidden="true">TOC</a></span></h4>
  9243. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  9244. </p>
  9245. <a name="Examples-35"></a>
  9246. <h4 class="subsection">8.111.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-35" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-35" aria-hidden="true">TOC</a></span></h4>
  9247. <ul class="itemize mark-bullet">
  9248. <li>Apply karaoke like effect:
  9249. <div class="example">
  9250. <pre class="example-preformatted">stereotools=mlev=0.015625
  9251. </pre></div>
  9252. </li><li>Convert M/S signal to L/R:
  9253. <div class="example">
  9254. <pre class="example-preformatted">&quot;stereotools=mode=ms&gt;lr&quot;
  9255. </pre></div>
  9256. </li></ul>
  9257. <a name="stereowiden"></a>
  9258. <h3 class="section">8.112 stereowiden<span class="pull-right"><a class="anchor hidden-xs" href="#stereowiden" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereowiden" aria-hidden="true">TOC</a></span></h3>
  9259. <p>This filter enhance the stereo effect by suppressing signal common to both
  9260. channels and by delaying the signal of left into right and vice versa,
  9261. thereby widening the stereo effect.
  9262. </p>
  9263. <p>The filter accepts the following options:
  9264. </p>
  9265. <dl class="table">
  9266. <dt><samp class="option">delay</samp></dt>
  9267. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  9268. Default is 20 milliseconds.
  9269. </p>
  9270. </dd>
  9271. <dt><samp class="option">feedback</samp></dt>
  9272. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  9273. effect of left signal in right output and vice versa which gives widening
  9274. effect. Default is 0.3.
  9275. </p>
  9276. </dd>
  9277. <dt><samp class="option">crossfeed</samp></dt>
  9278. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  9279. the mono. If the value is 1 it will cancel all the signal common to both
  9280. channels. Default is 0.3.
  9281. </p>
  9282. </dd>
  9283. <dt><samp class="option">drymix</samp></dt>
  9284. <dd><p>Set level of input signal of original channel. Default is 0.8.
  9285. </p></dd>
  9286. </dl>
  9287. <a name="Commands-50"></a>
  9288. <h4 class="subsection">8.112.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-50" aria-hidden="true">TOC</a></span></h4>
  9289. <p>This filter supports the all above options except <code class="code">delay</code> as <a class="ref" href="#commands">commands</a>.
  9290. </p>
  9291. <a name="superequalizer"></a>
  9292. <h3 class="section">8.113 superequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#superequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-superequalizer" aria-hidden="true">TOC</a></span></h3>
  9293. <p>Apply 18 band equalizer.
  9294. </p>
  9295. <p>The filter accepts the following options:
  9296. </p><dl class="table">
  9297. <dt><samp class="option">1b</samp></dt>
  9298. <dd><p>Set 65Hz band gain.
  9299. </p></dd>
  9300. <dt><samp class="option">2b</samp></dt>
  9301. <dd><p>Set 92Hz band gain.
  9302. </p></dd>
  9303. <dt><samp class="option">3b</samp></dt>
  9304. <dd><p>Set 131Hz band gain.
  9305. </p></dd>
  9306. <dt><samp class="option">4b</samp></dt>
  9307. <dd><p>Set 185Hz band gain.
  9308. </p></dd>
  9309. <dt><samp class="option">5b</samp></dt>
  9310. <dd><p>Set 262Hz band gain.
  9311. </p></dd>
  9312. <dt><samp class="option">6b</samp></dt>
  9313. <dd><p>Set 370Hz band gain.
  9314. </p></dd>
  9315. <dt><samp class="option">7b</samp></dt>
  9316. <dd><p>Set 523Hz band gain.
  9317. </p></dd>
  9318. <dt><samp class="option">8b</samp></dt>
  9319. <dd><p>Set 740Hz band gain.
  9320. </p></dd>
  9321. <dt><samp class="option">9b</samp></dt>
  9322. <dd><p>Set 1047Hz band gain.
  9323. </p></dd>
  9324. <dt><samp class="option">10b</samp></dt>
  9325. <dd><p>Set 1480Hz band gain.
  9326. </p></dd>
  9327. <dt><samp class="option">11b</samp></dt>
  9328. <dd><p>Set 2093Hz band gain.
  9329. </p></dd>
  9330. <dt><samp class="option">12b</samp></dt>
  9331. <dd><p>Set 2960Hz band gain.
  9332. </p></dd>
  9333. <dt><samp class="option">13b</samp></dt>
  9334. <dd><p>Set 4186Hz band gain.
  9335. </p></dd>
  9336. <dt><samp class="option">14b</samp></dt>
  9337. <dd><p>Set 5920Hz band gain.
  9338. </p></dd>
  9339. <dt><samp class="option">15b</samp></dt>
  9340. <dd><p>Set 8372Hz band gain.
  9341. </p></dd>
  9342. <dt><samp class="option">16b</samp></dt>
  9343. <dd><p>Set 11840Hz band gain.
  9344. </p></dd>
  9345. <dt><samp class="option">17b</samp></dt>
  9346. <dd><p>Set 16744Hz band gain.
  9347. </p></dd>
  9348. <dt><samp class="option">18b</samp></dt>
  9349. <dd><p>Set 20000Hz band gain.
  9350. </p></dd>
  9351. </dl>
  9352. <a name="surround"></a>
  9353. <h3 class="section">8.114 surround<span class="pull-right"><a class="anchor hidden-xs" href="#surround" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-surround" aria-hidden="true">TOC</a></span></h3>
  9354. <p>Apply audio surround upmix filter.
  9355. </p>
  9356. <p>This filter allows to produce multichannel output from audio stream.
  9357. </p>
  9358. <p>The filter accepts the following options:
  9359. </p>
  9360. <dl class="table">
  9361. <dt><samp class="option">chl_out</samp></dt>
  9362. <dd><p>Set output channel layout. By default, this is <var class="var">5.1</var>.
  9363. </p>
  9364. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  9365. for the required syntax.
  9366. </p>
  9367. </dd>
  9368. <dt><samp class="option">chl_in</samp></dt>
  9369. <dd><p>Set input channel layout. By default, this is <var class="var">stereo</var>.
  9370. </p>
  9371. <p>See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#channel-layout-syntax">the Channel Layout section in the ffmpeg-utils(1) manual</a>
  9372. for the required syntax.
  9373. </p>
  9374. </dd>
  9375. <dt><samp class="option">level_in</samp></dt>
  9376. <dd><p>Set input volume level. By default, this is <var class="var">1</var>.
  9377. </p>
  9378. </dd>
  9379. <dt><samp class="option">level_out</samp></dt>
  9380. <dd><p>Set output volume level. By default, this is <var class="var">1</var>.
  9381. </p>
  9382. </dd>
  9383. <dt><samp class="option">lfe</samp></dt>
  9384. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  9385. </p>
  9386. </dd>
  9387. <dt><samp class="option">lfe_low</samp></dt>
  9388. <dd><p>Set LFE low cut off frequency. By default, this is <var class="var">128</var> Hz.
  9389. </p>
  9390. </dd>
  9391. <dt><samp class="option">lfe_high</samp></dt>
  9392. <dd><p>Set LFE high cut off frequency. By default, this is <var class="var">256</var> Hz.
  9393. </p>
  9394. </dd>
  9395. <dt><samp class="option">lfe_mode</samp></dt>
  9396. <dd><p>Set LFE mode, can be <var class="var">add</var> or <var class="var">sub</var>. Default is <var class="var">add</var>.
  9397. In <var class="var">add</var> mode, LFE channel is created from input audio and added to output.
  9398. In <var class="var">sub</var> mode, LFE channel is created from input audio and added to output but
  9399. also all non-LFE output channels are subtracted with output LFE channel.
  9400. </p>
  9401. </dd>
  9402. <dt><samp class="option">smooth</samp></dt>
  9403. <dd><p>Set temporal smoothness strength, used to gradually change factors when transforming
  9404. stereo sound in time. Allowed range is from <var class="var">0.0</var> to <var class="var">1.0</var>.
  9405. Useful to improve output quality with <var class="var">focus</var> option values greater than <var class="var">0.0</var>.
  9406. Default is <var class="var">0.0</var>. Only values inside this range and without edges are effective.
  9407. </p>
  9408. </dd>
  9409. <dt><samp class="option">angle</samp></dt>
  9410. <dd><p>Set angle of stereo surround transform, Allowed range is from <var class="var">0</var> to <var class="var">360</var>.
  9411. Default is <var class="var">90</var>.
  9412. </p>
  9413. </dd>
  9414. <dt><samp class="option">focus</samp></dt>
  9415. <dd><p>Set focus of stereo surround transform, Allowed range is from <var class="var">-1</var> to <var class="var">1</var>.
  9416. Default is <var class="var">0</var>.
  9417. </p>
  9418. </dd>
  9419. <dt><samp class="option">fc_in</samp></dt>
  9420. <dd><p>Set front center input volume. By default, this is <var class="var">1</var>.
  9421. </p>
  9422. </dd>
  9423. <dt><samp class="option">fc_out</samp></dt>
  9424. <dd><p>Set front center output volume. By default, this is <var class="var">1</var>.
  9425. </p>
  9426. </dd>
  9427. <dt><samp class="option">fl_in</samp></dt>
  9428. <dd><p>Set front left input volume. By default, this is <var class="var">1</var>.
  9429. </p>
  9430. </dd>
  9431. <dt><samp class="option">fl_out</samp></dt>
  9432. <dd><p>Set front left output volume. By default, this is <var class="var">1</var>.
  9433. </p>
  9434. </dd>
  9435. <dt><samp class="option">fr_in</samp></dt>
  9436. <dd><p>Set front right input volume. By default, this is <var class="var">1</var>.
  9437. </p>
  9438. </dd>
  9439. <dt><samp class="option">fr_out</samp></dt>
  9440. <dd><p>Set front right output volume. By default, this is <var class="var">1</var>.
  9441. </p>
  9442. </dd>
  9443. <dt><samp class="option">sl_in</samp></dt>
  9444. <dd><p>Set side left input volume. By default, this is <var class="var">1</var>.
  9445. </p>
  9446. </dd>
  9447. <dt><samp class="option">sl_out</samp></dt>
  9448. <dd><p>Set side left output volume. By default, this is <var class="var">1</var>.
  9449. </p>
  9450. </dd>
  9451. <dt><samp class="option">sr_in</samp></dt>
  9452. <dd><p>Set side right input volume. By default, this is <var class="var">1</var>.
  9453. </p>
  9454. </dd>
  9455. <dt><samp class="option">sr_out</samp></dt>
  9456. <dd><p>Set side right output volume. By default, this is <var class="var">1</var>.
  9457. </p>
  9458. </dd>
  9459. <dt><samp class="option">bl_in</samp></dt>
  9460. <dd><p>Set back left input volume. By default, this is <var class="var">1</var>.
  9461. </p>
  9462. </dd>
  9463. <dt><samp class="option">bl_out</samp></dt>
  9464. <dd><p>Set back left output volume. By default, this is <var class="var">1</var>.
  9465. </p>
  9466. </dd>
  9467. <dt><samp class="option">br_in</samp></dt>
  9468. <dd><p>Set back right input volume. By default, this is <var class="var">1</var>.
  9469. </p>
  9470. </dd>
  9471. <dt><samp class="option">br_out</samp></dt>
  9472. <dd><p>Set back right output volume. By default, this is <var class="var">1</var>.
  9473. </p>
  9474. </dd>
  9475. <dt><samp class="option">bc_in</samp></dt>
  9476. <dd><p>Set back center input volume. By default, this is <var class="var">1</var>.
  9477. </p>
  9478. </dd>
  9479. <dt><samp class="option">bc_out</samp></dt>
  9480. <dd><p>Set back center output volume. By default, this is <var class="var">1</var>.
  9481. </p>
  9482. </dd>
  9483. <dt><samp class="option">lfe_in</samp></dt>
  9484. <dd><p>Set LFE input volume. By default, this is <var class="var">1</var>.
  9485. </p>
  9486. </dd>
  9487. <dt><samp class="option">lfe_out</samp></dt>
  9488. <dd><p>Set LFE output volume. By default, this is <var class="var">1</var>.
  9489. </p>
  9490. </dd>
  9491. <dt><samp class="option">allx</samp></dt>
  9492. <dd><p>Set spread usage of stereo image across X axis for all channels.
  9493. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  9494. By default this value is negative <var class="var">-1</var>, and thus unused.
  9495. </p>
  9496. </dd>
  9497. <dt><samp class="option">ally</samp></dt>
  9498. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  9499. Allowed range is from <var class="var">-1</var> to <var class="var">15</var>.
  9500. By default this value is negative <var class="var">-1</var>, and thus unused.
  9501. </p>
  9502. </dd>
  9503. <dt><samp class="option">fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  9504. <dd><p>Set spread usage of stereo image across X axis for each channel.
  9505. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  9506. By default this value is <var class="var">0.5</var>.
  9507. </p>
  9508. </dd>
  9509. <dt><samp class="option">fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  9510. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  9511. Allowed range is from <var class="var">0.06</var> to <var class="var">15</var>.
  9512. By default this value is <var class="var">0.5</var>.
  9513. </p>
  9514. </dd>
  9515. <dt><samp class="option">win_size</samp></dt>
  9516. <dd><p>Set window size. Allowed range is from <var class="var">1024</var> to <var class="var">65536</var>. Default size is <var class="var">4096</var>.
  9517. </p>
  9518. </dd>
  9519. <dt><samp class="option">win_func</samp></dt>
  9520. <dd><p>Set window function.
  9521. </p>
  9522. <p>It accepts the following values:
  9523. </p><dl class="table">
  9524. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  9525. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  9526. <dt>&lsquo;<samp class="samp">hann, hanning</samp>&rsquo;</dt>
  9527. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  9528. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  9529. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  9530. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  9531. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  9532. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  9533. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  9534. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  9535. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  9536. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  9537. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  9538. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  9539. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  9540. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  9541. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  9542. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  9543. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  9544. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  9545. </dl>
  9546. <p>Default is <code class="code">hann</code>.
  9547. </p>
  9548. </dd>
  9549. <dt><samp class="option">overlap</samp></dt>
  9550. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  9551. window function will be picked. Default is <code class="code">0.5</code>.
  9552. </p></dd>
  9553. </dl>
  9554. <a name="tiltshelf"></a>
  9555. <h3 class="section">8.115 tiltshelf<span class="pull-right"><a class="anchor hidden-xs" href="#tiltshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltshelf" aria-hidden="true">TOC</a></span></h3>
  9556. <p>Boost or cut the lower frequencies and cut or boost higher frequencies
  9557. of the audio using a two-pole shelving filter with a response similar to
  9558. that of a standard hi-fi&rsquo;s tone-controls.
  9559. This is also known as shelving equalisation (EQ).
  9560. </p>
  9561. <p>The filter accepts the following options:
  9562. </p>
  9563. <dl class="table">
  9564. <dt><samp class="option">gain, g</samp></dt>
  9565. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  9566. (for a large cut) to +20 (for a large boost).
  9567. Beware of clipping when using a positive gain.
  9568. </p>
  9569. </dd>
  9570. <dt><samp class="option">frequency, f</samp></dt>
  9571. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  9572. to extend or reduce the frequency range to be boosted or cut.
  9573. The default value is <code class="code">3000</code> Hz.
  9574. </p>
  9575. </dd>
  9576. <dt><samp class="option">width_type, t</samp></dt>
  9577. <dd><p>Set method to specify band-width of filter.
  9578. </p><dl class="table">
  9579. <dt><samp class="option">h</samp></dt>
  9580. <dd><p>Hz
  9581. </p></dd>
  9582. <dt><samp class="option">q</samp></dt>
  9583. <dd><p>Q-Factor
  9584. </p></dd>
  9585. <dt><samp class="option">o</samp></dt>
  9586. <dd><p>octave
  9587. </p></dd>
  9588. <dt><samp class="option">s</samp></dt>
  9589. <dd><p>slope
  9590. </p></dd>
  9591. <dt><samp class="option">k</samp></dt>
  9592. <dd><p>kHz
  9593. </p></dd>
  9594. </dl>
  9595. </dd>
  9596. <dt><samp class="option">width, w</samp></dt>
  9597. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  9598. </p>
  9599. </dd>
  9600. <dt><samp class="option">poles, p</samp></dt>
  9601. <dd><p>Set number of poles. Default is 2.
  9602. </p>
  9603. </dd>
  9604. <dt><samp class="option">mix, m</samp></dt>
  9605. <dd><p>How much to use filtered signal in output. Default is 1.
  9606. Range is between 0 and 1.
  9607. </p>
  9608. </dd>
  9609. <dt><samp class="option">channels, c</samp></dt>
  9610. <dd><p>Specify which channels to filter, by default all available are filtered.
  9611. </p>
  9612. </dd>
  9613. <dt><samp class="option">normalize, n</samp></dt>
  9614. <dd><p>Normalize biquad coefficients, by default is disabled.
  9615. Enabling it will normalize magnitude response at DC to 0dB.
  9616. </p>
  9617. </dd>
  9618. <dt><samp class="option">transform, a</samp></dt>
  9619. <dd><p>Set transform type of IIR filter.
  9620. </p><dl class="table">
  9621. <dt><samp class="option">di</samp></dt>
  9622. <dt><samp class="option">dii</samp></dt>
  9623. <dt><samp class="option">tdi</samp></dt>
  9624. <dt><samp class="option">tdii</samp></dt>
  9625. <dt><samp class="option">latt</samp></dt>
  9626. <dt><samp class="option">svf</samp></dt>
  9627. <dt><samp class="option">zdf</samp></dt>
  9628. </dl>
  9629. </dd>
  9630. <dt><samp class="option">precision, r</samp></dt>
  9631. <dd><p>Set precision of filtering.
  9632. </p><dl class="table">
  9633. <dt><samp class="option">auto</samp></dt>
  9634. <dd><p>Pick automatic sample format depending on surround filters.
  9635. </p></dd>
  9636. <dt><samp class="option">s16</samp></dt>
  9637. <dd><p>Always use signed 16-bit.
  9638. </p></dd>
  9639. <dt><samp class="option">s32</samp></dt>
  9640. <dd><p>Always use signed 32-bit.
  9641. </p></dd>
  9642. <dt><samp class="option">f32</samp></dt>
  9643. <dd><p>Always use float 32-bit.
  9644. </p></dd>
  9645. <dt><samp class="option">f64</samp></dt>
  9646. <dd><p>Always use float 64-bit.
  9647. </p></dd>
  9648. </dl>
  9649. </dd>
  9650. <dt><samp class="option">block_size, b</samp></dt>
  9651. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  9652. value (higher than impulse response length truncated when reaches near zero values) filtering
  9653. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  9654. </p>
  9655. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  9656. </p></dd>
  9657. </dl>
  9658. <a name="Commands-51"></a>
  9659. <h4 class="subsection">8.115.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-51" aria-hidden="true">TOC</a></span></h4>
  9660. <p>This filter supports some options as <a class="ref" href="#commands">commands</a>.
  9661. </p>
  9662. <a name="treble_002c-highshelf"></a>
  9663. <h3 class="section">8.116 treble, highshelf<span class="pull-right"><a class="anchor hidden-xs" href="#treble_002c-highshelf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-treble_002c-highshelf" aria-hidden="true">TOC</a></span></h3>
  9664. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  9665. shelving filter with a response similar to that of a standard
  9666. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  9667. </p>
  9668. <p>The filter accepts the following options:
  9669. </p>
  9670. <dl class="table">
  9671. <dt><samp class="option">gain, g</samp></dt>
  9672. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  9673. Nyquist frequency. Its useful range is about -20 (for a large cut)
  9674. to +20 (for a large boost). Beware of clipping when using a positive gain.
  9675. </p>
  9676. </dd>
  9677. <dt><samp class="option">frequency, f</samp></dt>
  9678. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  9679. to extend or reduce the frequency range to be boosted or cut.
  9680. The default value is <code class="code">3000</code> Hz.
  9681. </p>
  9682. </dd>
  9683. <dt><samp class="option">width_type, t</samp></dt>
  9684. <dd><p>Set method to specify band-width of filter.
  9685. </p><dl class="table">
  9686. <dt><samp class="option">h</samp></dt>
  9687. <dd><p>Hz
  9688. </p></dd>
  9689. <dt><samp class="option">q</samp></dt>
  9690. <dd><p>Q-Factor
  9691. </p></dd>
  9692. <dt><samp class="option">o</samp></dt>
  9693. <dd><p>octave
  9694. </p></dd>
  9695. <dt><samp class="option">s</samp></dt>
  9696. <dd><p>slope
  9697. </p></dd>
  9698. <dt><samp class="option">k</samp></dt>
  9699. <dd><p>kHz
  9700. </p></dd>
  9701. </dl>
  9702. </dd>
  9703. <dt><samp class="option">width, w</samp></dt>
  9704. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  9705. </p>
  9706. </dd>
  9707. <dt><samp class="option">poles, p</samp></dt>
  9708. <dd><p>Set number of poles. Default is 2.
  9709. </p>
  9710. </dd>
  9711. <dt><samp class="option">mix, m</samp></dt>
  9712. <dd><p>How much to use filtered signal in output. Default is 1.
  9713. Range is between 0 and 1.
  9714. </p>
  9715. </dd>
  9716. <dt><samp class="option">channels, c</samp></dt>
  9717. <dd><p>Specify which channels to filter, by default all available are filtered.
  9718. </p>
  9719. </dd>
  9720. <dt><samp class="option">normalize, n</samp></dt>
  9721. <dd><p>Normalize biquad coefficients, by default is disabled.
  9722. Enabling it will normalize magnitude response at DC to 0dB.
  9723. </p>
  9724. </dd>
  9725. <dt><samp class="option">transform, a</samp></dt>
  9726. <dd><p>Set transform type of IIR filter.
  9727. </p><dl class="table">
  9728. <dt><samp class="option">di</samp></dt>
  9729. <dt><samp class="option">dii</samp></dt>
  9730. <dt><samp class="option">tdi</samp></dt>
  9731. <dt><samp class="option">tdii</samp></dt>
  9732. <dt><samp class="option">latt</samp></dt>
  9733. <dt><samp class="option">svf</samp></dt>
  9734. <dt><samp class="option">zdf</samp></dt>
  9735. </dl>
  9736. </dd>
  9737. <dt><samp class="option">precision, r</samp></dt>
  9738. <dd><p>Set precision of filtering.
  9739. </p><dl class="table">
  9740. <dt><samp class="option">auto</samp></dt>
  9741. <dd><p>Pick automatic sample format depending on surround filters.
  9742. </p></dd>
  9743. <dt><samp class="option">s16</samp></dt>
  9744. <dd><p>Always use signed 16-bit.
  9745. </p></dd>
  9746. <dt><samp class="option">s32</samp></dt>
  9747. <dd><p>Always use signed 32-bit.
  9748. </p></dd>
  9749. <dt><samp class="option">f32</samp></dt>
  9750. <dd><p>Always use float 32-bit.
  9751. </p></dd>
  9752. <dt><samp class="option">f64</samp></dt>
  9753. <dd><p>Always use float 64-bit.
  9754. </p></dd>
  9755. </dl>
  9756. </dd>
  9757. <dt><samp class="option">block_size, b</samp></dt>
  9758. <dd><p>Set block size used for reverse IIR processing. If this value is set to high enough
  9759. value (higher than impulse response length truncated when reaches near zero values) filtering
  9760. will become linear phase otherwise if not big enough it will just produce nasty artifacts.
  9761. </p>
  9762. <p>Note that filter delay will be exactly this many samples when set to non-zero value.
  9763. </p></dd>
  9764. </dl>
  9765. <a name="Commands-52"></a>
  9766. <h4 class="subsection">8.116.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-52" aria-hidden="true">TOC</a></span></h4>
  9767. <p>This filter supports the following commands:
  9768. </p><dl class="table">
  9769. <dt><samp class="option">frequency, f</samp></dt>
  9770. <dd><p>Change treble frequency.
  9771. Syntax for the command is : &quot;<var class="var">frequency</var>&quot;
  9772. </p>
  9773. </dd>
  9774. <dt><samp class="option">width_type, t</samp></dt>
  9775. <dd><p>Change treble width_type.
  9776. Syntax for the command is : &quot;<var class="var">width_type</var>&quot;
  9777. </p>
  9778. </dd>
  9779. <dt><samp class="option">width, w</samp></dt>
  9780. <dd><p>Change treble width.
  9781. Syntax for the command is : &quot;<var class="var">width</var>&quot;
  9782. </p>
  9783. </dd>
  9784. <dt><samp class="option">gain, g</samp></dt>
  9785. <dd><p>Change treble gain.
  9786. Syntax for the command is : &quot;<var class="var">gain</var>&quot;
  9787. </p>
  9788. </dd>
  9789. <dt><samp class="option">mix, m</samp></dt>
  9790. <dd><p>Change treble mix.
  9791. Syntax for the command is : &quot;<var class="var">mix</var>&quot;
  9792. </p></dd>
  9793. </dl>
  9794. <a name="tremolo"></a>
  9795. <h3 class="section">8.117 tremolo<span class="pull-right"><a class="anchor hidden-xs" href="#tremolo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tremolo" aria-hidden="true">TOC</a></span></h3>
  9796. <p>Sinusoidal amplitude modulation.
  9797. </p>
  9798. <p>The filter accepts the following options:
  9799. </p>
  9800. <dl class="table">
  9801. <dt><samp class="option">f</samp></dt>
  9802. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  9803. (20 Hz or lower) will result in a tremolo effect.
  9804. This filter may also be used as a ring modulator by specifying
  9805. a modulation frequency higher than 20 Hz.
  9806. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  9807. </p>
  9808. </dd>
  9809. <dt><samp class="option">d</samp></dt>
  9810. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  9811. Default value is 0.5.
  9812. </p></dd>
  9813. </dl>
  9814. <a name="vibrato"></a>
  9815. <h3 class="section">8.118 vibrato<span class="pull-right"><a class="anchor hidden-xs" href="#vibrato" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrato" aria-hidden="true">TOC</a></span></h3>
  9816. <p>Sinusoidal phase modulation.
  9817. </p>
  9818. <p>The filter accepts the following options:
  9819. </p>
  9820. <dl class="table">
  9821. <dt><samp class="option">f</samp></dt>
  9822. <dd><p>Modulation frequency in Hertz.
  9823. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  9824. </p>
  9825. </dd>
  9826. <dt><samp class="option">d</samp></dt>
  9827. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  9828. Default value is 0.5.
  9829. </p></dd>
  9830. </dl>
  9831. <a name="virtualbass"></a>
  9832. <h3 class="section">8.119 virtualbass<span class="pull-right"><a class="anchor hidden-xs" href="#virtualbass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-virtualbass" aria-hidden="true">TOC</a></span></h3>
  9833. <p>Apply audio Virtual Bass filter.
  9834. </p>
  9835. <p>This filter accepts stereo input and produce stereo with LFE (2.1) channels output.
  9836. The newly produced LFE channel have enhanced virtual bass originally obtained from both stereo channels.
  9837. This filter outputs front left and front right channels unchanged as available in stereo input.
  9838. </p>
  9839. <p>The filter accepts the following options:
  9840. </p>
  9841. <dl class="table">
  9842. <dt><samp class="option">cutoff</samp></dt>
  9843. <dd><p>Set the virtual bass cutoff frequency. Default value is 250 Hz.
  9844. Allowed range is from 100 to 500 Hz.
  9845. </p>
  9846. </dd>
  9847. <dt><samp class="option">strength</samp></dt>
  9848. <dd><p>Set the virtual bass strength. Allowed range is from 0.5 to 3.
  9849. Default value is 3.
  9850. </p></dd>
  9851. </dl>
  9852. <a name="volume"></a>
  9853. <h3 class="section">8.120 volume<span class="pull-right"><a class="anchor hidden-xs" href="#volume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volume" aria-hidden="true">TOC</a></span></h3>
  9854. <p>Adjust the input audio volume.
  9855. </p>
  9856. <p>It accepts the following parameters:
  9857. </p><dl class="table">
  9858. <dt><samp class="option">volume</samp></dt>
  9859. <dd><p>Set audio volume expression.
  9860. </p>
  9861. <p>Output values are clipped to the maximum value.
  9862. </p>
  9863. <p>The output audio volume is given by the relation:
  9864. </p><div class="example">
  9865. <pre class="example-preformatted"><var class="var">output_volume</var> = <var class="var">volume</var> * <var class="var">input_volume</var>
  9866. </pre></div>
  9867. <p>The default value for <var class="var">volume</var> is &quot;1.0&quot;.
  9868. </p>
  9869. </dd>
  9870. <dt><samp class="option">precision</samp></dt>
  9871. <dd><p>This parameter represents the mathematical precision.
  9872. </p>
  9873. <p>It determines which input sample formats will be allowed, which affects the
  9874. precision of the volume scaling.
  9875. </p>
  9876. <dl class="table">
  9877. <dt><samp class="option">fixed</samp></dt>
  9878. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  9879. </p></dd>
  9880. <dt><samp class="option">float</samp></dt>
  9881. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  9882. </p></dd>
  9883. <dt><samp class="option">double</samp></dt>
  9884. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  9885. </p></dd>
  9886. </dl>
  9887. </dd>
  9888. <dt><samp class="option">replaygain</samp></dt>
  9889. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  9890. </p>
  9891. <dl class="table">
  9892. <dt><samp class="option">drop</samp></dt>
  9893. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  9894. </p>
  9895. </dd>
  9896. <dt><samp class="option">ignore</samp></dt>
  9897. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  9898. </p>
  9899. </dd>
  9900. <dt><samp class="option">track</samp></dt>
  9901. <dd><p>Prefer the track gain, if present.
  9902. </p>
  9903. </dd>
  9904. <dt><samp class="option">album</samp></dt>
  9905. <dd><p>Prefer the album gain, if present.
  9906. </p></dd>
  9907. </dl>
  9908. </dd>
  9909. <dt><samp class="option">replaygain_preamp</samp></dt>
  9910. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  9911. </p>
  9912. <p>Default value for <var class="var">replaygain_preamp</var> is 0.0.
  9913. </p>
  9914. </dd>
  9915. <dt><samp class="option">replaygain_noclip</samp></dt>
  9916. <dd><p>Prevent clipping by limiting the gain applied.
  9917. </p>
  9918. <p>Default value for <var class="var">replaygain_noclip</var> is 1.
  9919. </p>
  9920. </dd>
  9921. <dt><samp class="option">eval</samp></dt>
  9922. <dd><p>Set when the volume expression is evaluated.
  9923. </p>
  9924. <p>It accepts the following values:
  9925. </p><dl class="table">
  9926. <dt>&lsquo;<samp class="samp">once</samp>&rsquo;</dt>
  9927. <dd><p>only evaluate expression once during the filter initialization, or
  9928. when the &lsquo;<samp class="samp">volume</samp>&rsquo; command is sent
  9929. </p>
  9930. </dd>
  9931. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  9932. <dd><p>evaluate expression for each incoming frame
  9933. </p></dd>
  9934. </dl>
  9935. <p>Default value is &lsquo;<samp class="samp">once</samp>&rsquo;.
  9936. </p></dd>
  9937. </dl>
  9938. <p>The volume expression can contain the following parameters.
  9939. </p>
  9940. <dl class="table">
  9941. <dt><samp class="option">n</samp></dt>
  9942. <dd><p>frame number (starting at zero)
  9943. </p></dd>
  9944. <dt><samp class="option">nb_channels</samp></dt>
  9945. <dd><p>number of channels
  9946. </p></dd>
  9947. <dt><samp class="option">nb_consumed_samples</samp></dt>
  9948. <dd><p>number of samples consumed by the filter
  9949. </p></dd>
  9950. <dt><samp class="option">nb_samples</samp></dt>
  9951. <dd><p>number of samples in the current frame
  9952. </p></dd>
  9953. <dt><samp class="option">pos</samp></dt>
  9954. <dd><p>original frame position in the file; deprecated, do not use
  9955. </p></dd>
  9956. <dt><samp class="option">pts</samp></dt>
  9957. <dd><p>frame PTS
  9958. </p></dd>
  9959. <dt><samp class="option">sample_rate</samp></dt>
  9960. <dd><p>sample rate
  9961. </p></dd>
  9962. <dt><samp class="option">startpts</samp></dt>
  9963. <dd><p>PTS at start of stream
  9964. </p></dd>
  9965. <dt><samp class="option">startt</samp></dt>
  9966. <dd><p>time at start of stream
  9967. </p></dd>
  9968. <dt><samp class="option">t</samp></dt>
  9969. <dd><p>frame time
  9970. </p></dd>
  9971. <dt><samp class="option">tb</samp></dt>
  9972. <dd><p>timestamp timebase
  9973. </p></dd>
  9974. <dt><samp class="option">volume</samp></dt>
  9975. <dd><p>last set volume value
  9976. </p></dd>
  9977. </dl>
  9978. <p>Note that when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">once</samp>&rsquo; only the
  9979. <var class="var">sample_rate</var> and <var class="var">tb</var> variables are available, all other
  9980. variables will evaluate to NAN.
  9981. </p>
  9982. <a name="Commands-53"></a>
  9983. <h4 class="subsection">8.120.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-53" aria-hidden="true">TOC</a></span></h4>
  9984. <p>This filter supports the following commands:
  9985. </p><dl class="table">
  9986. <dt><samp class="option">volume</samp></dt>
  9987. <dd><p>Modify the volume expression.
  9988. The command accepts the same syntax of the corresponding option.
  9989. </p>
  9990. <p>If the specified expression is not valid, it is kept at its current
  9991. value.
  9992. </p></dd>
  9993. </dl>
  9994. <a name="Examples-36"></a>
  9995. <h4 class="subsection">8.120.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-36" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-36" aria-hidden="true">TOC</a></span></h4>
  9996. <ul class="itemize mark-bullet">
  9997. <li>Halve the input audio volume:
  9998. <div class="example">
  9999. <pre class="example-preformatted">volume=volume=0.5
  10000. volume=volume=1/2
  10001. volume=volume=-6.0206dB
  10002. </pre></div>
  10003. <p>In all the above example the named key for <samp class="option">volume</samp> can be
  10004. omitted, for example like in:
  10005. </p><div class="example">
  10006. <pre class="example-preformatted">volume=0.5
  10007. </pre></div>
  10008. </li><li>Increase input audio power by 6 decibels using fixed-point precision:
  10009. <div class="example">
  10010. <pre class="example-preformatted">volume=volume=6dB:precision=fixed
  10011. </pre></div>
  10012. </li><li>Fade volume after time 10 with an annihilation period of 5 seconds:
  10013. <div class="example">
  10014. <pre class="example-preformatted">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  10015. </pre></div>
  10016. </li></ul>
  10017. <a name="volumedetect"></a>
  10018. <h3 class="section">8.121 volumedetect<span class="pull-right"><a class="anchor hidden-xs" href="#volumedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-volumedetect" aria-hidden="true">TOC</a></span></h3>
  10019. <p>Detect the volume of the input video.
  10020. </p>
  10021. <p>The filter has no parameters. It supports only 16-bit signed integer samples,
  10022. so the input will be converted when needed. Statistics about the volume will
  10023. be printed in the log when the input stream end is reached.
  10024. </p>
  10025. <p>In particular it will show the mean volume (root mean square), maximum
  10026. volume (on a per-sample basis), and the beginning of a histogram of the
  10027. registered volume values (from the maximum value to a cumulated 1/1000 of
  10028. the samples).
  10029. </p>
  10030. <p>All volumes are in decibels relative to the maximum PCM value.
  10031. </p>
  10032. <a name="Examples-37"></a>
  10033. <h4 class="subsection">8.121.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-37" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-37" aria-hidden="true">TOC</a></span></h4>
  10034. <p>Here is an excerpt of the output:
  10035. </p><div class="example">
  10036. <pre class="example-preformatted">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  10037. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  10038. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  10039. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  10040. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  10041. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  10042. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  10043. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  10044. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  10045. </pre></div>
  10046. <p>It means that:
  10047. </p><ul class="itemize mark-bullet">
  10048. <li>The mean square energy is approximately -27 dB, or 10^-2.7.
  10049. </li><li>The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  10050. </li><li>There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  10051. </li></ul>
  10052. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  10053. raising it by +5 dB causes clipping for 6 samples, etc.
  10054. </p>
  10055. <a class="anchor" id="whisper"></a><a name="whisper-1"></a>
  10056. <h3 class="section">8.122 whisper<span class="pull-right"><a class="anchor hidden-xs" href="#whisper-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-whisper-1" aria-hidden="true">TOC</a></span></h3>
  10057. <p>It runs automatic speech recognition using the OpenAI&rsquo;s Whisper model.
  10058. </p>
  10059. <p>It requires the whisper.cpp library (https://github.com/ggml-org/whisper.cpp)
  10060. as a prerequisite. After installing the library it can be enabled using:
  10061. <code class="code">./configure --enable-whisper</code>.
  10062. </p>
  10063. <p>The filter has following options:
  10064. </p>
  10065. <dl class="table">
  10066. <dt><samp class="option">model</samp></dt>
  10067. <dd><p>The file path of the downloaded whisper.cpp model (mandatory).
  10068. </p>
  10069. </dd>
  10070. <dt><samp class="option">language</samp></dt>
  10071. <dd><p>The language to use for transcription (&rsquo;auto&rsquo; for auto-detect).
  10072. Default value: <code class="code">&quot;auto&quot;</code>
  10073. </p>
  10074. </dd>
  10075. <dt><samp class="option">queue</samp></dt>
  10076. <dd><p>The maximum size that will be queued into the filter before processing the audio
  10077. with whisper. Using a small value the audio stream will be processed more often,
  10078. but the transcription quality will be lower and the required processing power
  10079. will be higher. Using a large value (e.g. 10-20s) will produce more accurate
  10080. results using less CPU (as using the whisper-cli tool), but the transcription
  10081. latency will be higher, thus not useful to process real-time streams.
  10082. Consider using the vad_model option associated with a large queue value.
  10083. Default value: <code class="code">&quot;3&quot;</code>
  10084. </p>
  10085. </dd>
  10086. <dt><samp class="option">use_gpu</samp></dt>
  10087. <dd><p>If the GPU support should be enabled.
  10088. Default value: <code class="code">&quot;true&quot;</code>
  10089. </p>
  10090. </dd>
  10091. <dt><samp class="option">gpu_device</samp></dt>
  10092. <dd><p>The GPU device index to use.
  10093. Default value: <code class="code">&quot;0&quot;</code>
  10094. </p>
  10095. </dd>
  10096. <dt><samp class="option">destination</samp></dt>
  10097. <dd><p>If set, the transcription output will be sent to the specified file or URL
  10098. (use one of the FFmpeg AVIO protocols); otherwise, the output will be logged as
  10099. info messages.
  10100. The output will also be set in the &quot;lavfi.whisper.text&quot; frame metadata.
  10101. If the destination is a file and it already exists, it will be overwritten.
  10102. </p>
  10103. </dd>
  10104. <dt><samp class="option">format</samp></dt>
  10105. <dd><p>The destination format string; it could be &quot;text&quot; (only the transcribed text
  10106. will be sent to the destination), &quot;srt&quot; (subtitle format) or &quot;json&quot;.
  10107. Default value: <code class="code">&quot;text&quot;</code>
  10108. </p>
  10109. </dd>
  10110. <dt><samp class="option">vad_model</samp></dt>
  10111. <dd><p>Path to the VAD model file. If set, the filter will load an additional voice
  10112. activity detection module (https://github.com/snakers4/silero-vad) that will be
  10113. used to fragment the audio queue; use this option setting a valid path obtained
  10114. from the whisper.cpp repository (e.g. &quot;../whisper.cpp/models/ggml-silero-v5.1.2.bin&quot;)
  10115. and increase the queue parameter to a higher value (e.g. 20).
  10116. </p>
  10117. </dd>
  10118. <dt><samp class="option">vad_threshold</samp></dt>
  10119. <dd><p>The VAD threshold to use.
  10120. Default value: <code class="code">&quot;0.5&quot;</code>
  10121. </p>
  10122. </dd>
  10123. <dt><samp class="option">vad_min_speech_duration</samp></dt>
  10124. <dd><p>The minimum VAD speaking duration.
  10125. Default value: <code class="code">&quot;0.1&quot;</code>
  10126. </p>
  10127. </dd>
  10128. <dt><samp class="option">vad_min_silence_duration</samp></dt>
  10129. <dd><p>The minimum VAD silence duration.
  10130. Default value: <code class="code">&quot;0.5&quot;</code>
  10131. </p>
  10132. </dd>
  10133. </dl>
  10134. <a name="Examples-38"></a>
  10135. <h4 class="subsection">8.122.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-38" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-38" aria-hidden="true">TOC</a></span></h4>
  10136. <ul class="itemize mark-bullet">
  10137. <li>Run a transcription with srt file generation:
  10138. <div class="example">
  10139. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  10140. :language=en\
  10141. :queue=3\
  10142. :destination=output.srt\
  10143. :format=srt&quot; -f null -
  10144. </pre></div>
  10145. </li><li>Run a transcription and send the output in JSON format to an HTTP service:
  10146. <div class="example">
  10147. <pre class="example-preformatted">ffmpeg -i input.mp4 -vn -af &quot;whisper=model=../whisper.cpp/models/ggml-base.en.bin\
  10148. :language=en\
  10149. :queue=3\
  10150. :destination=http\\://localhost\\:3000\
  10151. :format=json' -f null -
  10152. </pre></div>
  10153. </li><li>Transcribe the microphone input using the VAD option:
  10154. <div class="example">
  10155. <pre class="example-preformatted">ffmpeg -loglevel warning -f pulse -i default \
  10156. -af 'highpass=f=200,lowpass=f=3000,whisper=model=../whisper.cpp/models/ggml-medium.bin\
  10157. :language=en\
  10158. :queue=10\
  10159. :destination=-\
  10160. :format=json\
  10161. :vad_model=../whisper.cpp/models/ggml-silero-v5.1.2.bin' -f null -
  10162. </pre></div>
  10163. </li></ul>
  10164. <a name="Audio-Sources"></a>
  10165. <h2 class="chapter">9 Audio Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sources" aria-hidden="true">TOC</a></span></h2>
  10166. <p>Below is a description of the currently available audio sources.
  10167. </p>
  10168. <a name="abuffer"></a>
  10169. <h3 class="section">9.1 abuffer<span class="pull-right"><a class="anchor hidden-xs" href="#abuffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffer" aria-hidden="true">TOC</a></span></h3>
  10170. <p>Buffer audio frames, and make them available to the filter chain.
  10171. </p>
  10172. <p>This source is mainly intended for a programmatic use, in particular
  10173. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  10174. </p>
  10175. <p>It accepts the following parameters:
  10176. </p><dl class="table">
  10177. <dt><samp class="option">time_base</samp></dt>
  10178. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  10179. either a floating-point number or in <var class="var">numerator</var>/<var class="var">denominator</var> form.
  10180. </p>
  10181. </dd>
  10182. <dt><samp class="option">sample_rate</samp></dt>
  10183. <dd><p>The sample rate of the incoming audio buffers.
  10184. </p>
  10185. </dd>
  10186. <dt><samp class="option">sample_fmt</samp></dt>
  10187. <dd><p>The sample format of the incoming audio buffers.
  10188. Either a sample format name or its corresponding integer representation from
  10189. the enum AVSampleFormat in <samp class="file">libavutil/samplefmt.h</samp>
  10190. </p>
  10191. </dd>
  10192. <dt><samp class="option">channel_layout</samp></dt>
  10193. <dd><p>The channel layout of the incoming audio buffers.
  10194. Either a channel layout name from channel_layout_map in
  10195. <samp class="file">libavutil/channel_layout.c</samp> or its corresponding integer representation
  10196. from the AV_CH_LAYOUT_* macros in <samp class="file">libavutil/channel_layout.h</samp>
  10197. </p>
  10198. </dd>
  10199. <dt><samp class="option">channels</samp></dt>
  10200. <dd><p>The number of channels of the incoming audio buffers.
  10201. If both <var class="var">channels</var> and <var class="var">channel_layout</var> are specified, then they
  10202. must be consistent.
  10203. </p>
  10204. </dd>
  10205. </dl>
  10206. <a name="Examples-39"></a>
  10207. <h4 class="subsection">9.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-39" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-39" aria-hidden="true">TOC</a></span></h4>
  10208. <div class="example">
  10209. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  10210. </pre></div>
  10211. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  10212. Since the sample format with name &quot;s16p&quot; corresponds to the number
  10213. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  10214. equivalent to:
  10215. </p><div class="example">
  10216. <pre class="example-preformatted">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  10217. </pre></div>
  10218. <a name="aevalsrc"></a>
  10219. <h3 class="section">9.2 aevalsrc<span class="pull-right"><a class="anchor hidden-xs" href="#aevalsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aevalsrc" aria-hidden="true">TOC</a></span></h3>
  10220. <p>Generate an audio signal specified by an expression.
  10221. </p>
  10222. <p>This source accepts in input one or more expressions (one for each
  10223. channel), which are evaluated and used to generate a corresponding
  10224. audio signal.
  10225. </p>
  10226. <p>This source accepts the following options:
  10227. </p>
  10228. <dl class="table">
  10229. <dt><samp class="option">exprs</samp></dt>
  10230. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  10231. <samp class="option">channel_layout</samp> option is not specified, the selected channel layout
  10232. depends on the number of provided expressions. Otherwise the last
  10233. specified expression is applied to the remaining output channels.
  10234. </p>
  10235. </dd>
  10236. <dt><samp class="option">channel_layout, c</samp></dt>
  10237. <dd><p>Set the channel layout. The number of channels in the specified layout
  10238. must be equal to the number of specified expressions.
  10239. </p>
  10240. </dd>
  10241. <dt><samp class="option">duration, d</samp></dt>
  10242. <dd><p>Set the minimum duration of the sourced audio. See
  10243. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  10244. for the accepted syntax.
  10245. Note that the resulting duration may be greater than the specified
  10246. duration, as the generated audio is always cut at the end of a
  10247. complete frame.
  10248. </p>
  10249. <p>If not specified, or the expressed duration is negative, the audio is
  10250. supposed to be generated forever.
  10251. </p>
  10252. </dd>
  10253. <dt><samp class="option">nb_samples, n</samp></dt>
  10254. <dd><p>Set the number of samples per channel per each output frame,
  10255. default to 1024.
  10256. </p>
  10257. </dd>
  10258. <dt><samp class="option">sample_rate, s</samp></dt>
  10259. <dd><p>Specify the sample rate, default to 44100.
  10260. </p></dd>
  10261. </dl>
  10262. <p>Each expression in <var class="var">exprs</var> can contain the following constants:
  10263. </p>
  10264. <dl class="table">
  10265. <dt><samp class="option">n</samp></dt>
  10266. <dd><p>number of the evaluated sample, starting from 0
  10267. </p>
  10268. </dd>
  10269. <dt><samp class="option">t</samp></dt>
  10270. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  10271. </p>
  10272. </dd>
  10273. <dt><samp class="option">s</samp></dt>
  10274. <dd><p>sample rate
  10275. </p>
  10276. </dd>
  10277. </dl>
  10278. <a name="Examples-40"></a>
  10279. <h4 class="subsection">9.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-40" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-40" aria-hidden="true">TOC</a></span></h4>
  10280. <ul class="itemize mark-bullet">
  10281. <li>Generate silence:
  10282. <div class="example">
  10283. <pre class="example-preformatted">aevalsrc=0
  10284. </pre></div>
  10285. </li><li>Generate a sin signal with frequency of 440 Hz, set sample rate to
  10286. 8000 Hz:
  10287. <div class="example">
  10288. <pre class="example-preformatted">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  10289. </pre></div>
  10290. </li><li>Generate a two channels signal, specify the channel layout (Front
  10291. Center + Back Center) explicitly:
  10292. <div class="example">
  10293. <pre class="example-preformatted">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  10294. </pre></div>
  10295. </li><li>Generate white noise:
  10296. <div class="example">
  10297. <pre class="example-preformatted">aevalsrc=&quot;-2+random(0)&quot;
  10298. </pre></div>
  10299. </li><li>Generate an amplitude modulated signal:
  10300. <div class="example">
  10301. <pre class="example-preformatted">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  10302. </pre></div>
  10303. </li><li>Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  10304. <div class="example">
  10305. <pre class="example-preformatted">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
  10306. </pre></div>
  10307. </li></ul>
  10308. <a name="afdelaysrc"></a>
  10309. <h3 class="section">9.3 afdelaysrc<span class="pull-right"><a class="anchor hidden-xs" href="#afdelaysrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afdelaysrc" aria-hidden="true">TOC</a></span></h3>
  10310. <p>Generate a fractional delay FIR coefficients.
  10311. </p>
  10312. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  10313. </p>
  10314. <p>The filter accepts the following options:
  10315. </p>
  10316. <dl class="table">
  10317. <dt><samp class="option">delay, d</samp></dt>
  10318. <dd><p>Set the fractional delay. Default is 0.
  10319. </p>
  10320. </dd>
  10321. <dt><samp class="option">sample_rate, r</samp></dt>
  10322. <dd><p>Set the sample rate, default is 44100.
  10323. </p>
  10324. </dd>
  10325. <dt><samp class="option">nb_samples, n</samp></dt>
  10326. <dd><p>Set the number of samples per each frame. Default is 1024.
  10327. </p>
  10328. </dd>
  10329. <dt><samp class="option">taps, t</samp></dt>
  10330. <dd><p>Set the number of filter coefficients in output audio stream.
  10331. Default value is 0.
  10332. </p>
  10333. </dd>
  10334. <dt><samp class="option">channel_layout, c</samp></dt>
  10335. <dd><p>Specifies the channel layout, and can be a string representing a channel layout.
  10336. The default value of <var class="var">channel_layout</var> is &quot;stereo&quot;.
  10337. </p></dd>
  10338. </dl>
  10339. <a name="afireqsrc"></a>
  10340. <h3 class="section">9.4 afireqsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afireqsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afireqsrc" aria-hidden="true">TOC</a></span></h3>
  10341. <p>Generate a FIR equalizer coefficients.
  10342. </p>
  10343. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  10344. </p>
  10345. <p>The filter accepts the following options:
  10346. </p>
  10347. <dl class="table">
  10348. <dt><samp class="option">preset, p</samp></dt>
  10349. <dd><p>Set equalizer preset.
  10350. Default preset is <code class="code">flat</code>.
  10351. </p>
  10352. <p>Available presets are:
  10353. </p><dl class="table">
  10354. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  10355. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  10356. <dt>&lsquo;<samp class="samp">acoustic</samp>&rsquo;</dt>
  10357. <dt>&lsquo;<samp class="samp">bass</samp>&rsquo;</dt>
  10358. <dt>&lsquo;<samp class="samp">beats</samp>&rsquo;</dt>
  10359. <dt>&lsquo;<samp class="samp">classic</samp>&rsquo;</dt>
  10360. <dt>&lsquo;<samp class="samp">clear</samp>&rsquo;</dt>
  10361. <dt>&lsquo;<samp class="samp">deep bass</samp>&rsquo;</dt>
  10362. <dt>&lsquo;<samp class="samp">dubstep</samp>&rsquo;</dt>
  10363. <dt>&lsquo;<samp class="samp">electronic</samp>&rsquo;</dt>
  10364. <dt>&lsquo;<samp class="samp">hard-style</samp>&rsquo;</dt>
  10365. <dt>&lsquo;<samp class="samp">hip-hop</samp>&rsquo;</dt>
  10366. <dt>&lsquo;<samp class="samp">jazz</samp>&rsquo;</dt>
  10367. <dt>&lsquo;<samp class="samp">metal</samp>&rsquo;</dt>
  10368. <dt>&lsquo;<samp class="samp">movie</samp>&rsquo;</dt>
  10369. <dt>&lsquo;<samp class="samp">pop</samp>&rsquo;</dt>
  10370. <dt>&lsquo;<samp class="samp">r&amp;b</samp>&rsquo;</dt>
  10371. <dt>&lsquo;<samp class="samp">rock</samp>&rsquo;</dt>
  10372. <dt>&lsquo;<samp class="samp">vocal booster</samp>&rsquo;</dt>
  10373. </dl>
  10374. </dd>
  10375. <dt><samp class="option">gains, g</samp></dt>
  10376. <dd><p>Set custom gains for each band. Only used if the preset option is set to <code class="code">custom</code>.
  10377. Gains are separated by white spaces and each gain is set in dBFS.
  10378. Default is <code class="code">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</code>.
  10379. </p>
  10380. </dd>
  10381. <dt><samp class="option">bands, b</samp></dt>
  10382. <dd><p>Set the custom bands from where custom equalizer gains are set.
  10383. This must be in strictly increasing order. Only used if the preset option is set to <code class="code">custom</code>.
  10384. Bands are separated by white spaces and each band represent frequency in Hz.
  10385. Default is <code class="code">25 40 63 100 160 250 400 630 1000 1600 2500 4000 6300 10000 16000 24000</code>.
  10386. </p>
  10387. </dd>
  10388. <dt><samp class="option">taps, t</samp></dt>
  10389. <dd><p>Set number of filter coefficients in output audio stream.
  10390. Default value is <code class="code">4096</code>.
  10391. </p>
  10392. </dd>
  10393. <dt><samp class="option">sample_rate, r</samp></dt>
  10394. <dd><p>Set sample rate of output audio stream, default is <code class="code">44100</code>.
  10395. </p>
  10396. </dd>
  10397. <dt><samp class="option">nb_samples, n</samp></dt>
  10398. <dd><p>Set number of samples per each frame in output audio stream. Default is <code class="code">1024</code>.
  10399. </p>
  10400. </dd>
  10401. <dt><samp class="option">interp, i</samp></dt>
  10402. <dd><p>Set interpolation method for FIR equalizer coefficients. Can be <code class="code">linear</code> or <code class="code">cubic</code>.
  10403. </p>
  10404. </dd>
  10405. <dt><samp class="option">phase, h</samp></dt>
  10406. <dd><p>Set phase type of FIR filter. Can be <code class="code">linear</code> or <code class="code">min</code>: minimum-phase.
  10407. Default is minimum-phase filter.
  10408. </p></dd>
  10409. </dl>
  10410. <a name="afirsrc"></a>
  10411. <h3 class="section">9.5 afirsrc<span class="pull-right"><a class="anchor hidden-xs" href="#afirsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-afirsrc" aria-hidden="true">TOC</a></span></h3>
  10412. <p>Generate a FIR coefficients using frequency sampling method.
  10413. </p>
  10414. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  10415. </p>
  10416. <p>The filter accepts the following options:
  10417. </p>
  10418. <dl class="table">
  10419. <dt><samp class="option">taps, t</samp></dt>
  10420. <dd><p>Set number of filter coefficients in output audio stream.
  10421. Default value is 1025.
  10422. </p>
  10423. </dd>
  10424. <dt><samp class="option">frequency, f</samp></dt>
  10425. <dd><p>Set frequency points from where magnitude and phase are set.
  10426. This must be in non decreasing order, and first element must be 0, while last element
  10427. must be 1. Elements are separated by white spaces.
  10428. </p>
  10429. </dd>
  10430. <dt><samp class="option">magnitude, m</samp></dt>
  10431. <dd><p>Set magnitude value for every frequency point set by <samp class="option">frequency</samp>.
  10432. Number of values must be same as number of frequency points.
  10433. Values are separated by white spaces.
  10434. </p>
  10435. </dd>
  10436. <dt><samp class="option">phase, p</samp></dt>
  10437. <dd><p>Set phase value for every frequency point set by <samp class="option">frequency</samp>.
  10438. Number of values must be same as number of frequency points.
  10439. Values are separated by white spaces.
  10440. </p>
  10441. </dd>
  10442. <dt><samp class="option">sample_rate, r</samp></dt>
  10443. <dd><p>Set sample rate, default is 44100.
  10444. </p>
  10445. </dd>
  10446. <dt><samp class="option">nb_samples, n</samp></dt>
  10447. <dd><p>Set number of samples per each frame. Default is 1024.
  10448. </p>
  10449. </dd>
  10450. <dt><samp class="option">win_func, w</samp></dt>
  10451. <dd><p>Set window function. Default is blackman.
  10452. </p></dd>
  10453. </dl>
  10454. <a name="anullsrc"></a>
  10455. <h3 class="section">9.6 anullsrc<span class="pull-right"><a class="anchor hidden-xs" href="#anullsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsrc" aria-hidden="true">TOC</a></span></h3>
  10456. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  10457. as a template and to be employed in analysis / debugging tools, or as
  10458. the source for filters which ignore the input data (for example the sox
  10459. synth filter).
  10460. </p>
  10461. <p>This source accepts the following options:
  10462. </p>
  10463. <dl class="table">
  10464. <dt><samp class="option">channel_layout, cl</samp></dt>
  10465. <dd>
  10466. <p>Specifies the channel layout, and can be either an integer or a string
  10467. representing a channel layout. The default value of <var class="var">channel_layout</var>
  10468. is &quot;stereo&quot;.
  10469. </p>
  10470. <p>Check the channel_layout_map definition in
  10471. <samp class="file">libavutil/channel_layout.c</samp> for the mapping between strings and
  10472. channel layout values.
  10473. </p>
  10474. </dd>
  10475. <dt><samp class="option">sample_rate, r</samp></dt>
  10476. <dd><p>Specifies the sample rate, and defaults to 44100.
  10477. </p>
  10478. </dd>
  10479. <dt><samp class="option">nb_samples, n</samp></dt>
  10480. <dd><p>Set the number of samples per requested frames.
  10481. </p>
  10482. </dd>
  10483. <dt><samp class="option">duration, d</samp></dt>
  10484. <dd><p>Set the duration of the sourced audio. See
  10485. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  10486. for the accepted syntax.
  10487. </p>
  10488. <p>If not specified, or the expressed duration is negative, the audio is
  10489. supposed to be generated forever.
  10490. </p></dd>
  10491. </dl>
  10492. <a name="Examples-41"></a>
  10493. <h4 class="subsection">9.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-41" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-41" aria-hidden="true">TOC</a></span></h4>
  10494. <ul class="itemize mark-bullet">
  10495. <li>Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  10496. <div class="example">
  10497. <pre class="example-preformatted">anullsrc=r=48000:cl=4
  10498. </pre></div>
  10499. </li><li>Do the same operation with a more obvious syntax:
  10500. <div class="example">
  10501. <pre class="example-preformatted">anullsrc=r=48000:cl=mono
  10502. </pre></div>
  10503. </li></ul>
  10504. <p>All the parameters need to be explicitly defined.
  10505. </p>
  10506. <a name="flite"></a>
  10507. <h3 class="section">9.7 flite<span class="pull-right"><a class="anchor hidden-xs" href="#flite" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flite" aria-hidden="true">TOC</a></span></h3>
  10508. <p>Synthesize a voice utterance using the libflite library.
  10509. </p>
  10510. <p>To enable compilation of this filter you need to configure FFmpeg with
  10511. <code class="code">--enable-libflite</code>.
  10512. </p>
  10513. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  10514. </p>
  10515. <p>The filter accepts the following options:
  10516. </p>
  10517. <dl class="table">
  10518. <dt><samp class="option">list_voices</samp></dt>
  10519. <dd><p>If set to 1, list the names of the available voices and exit
  10520. immediately. Default value is 0.
  10521. </p>
  10522. </dd>
  10523. <dt><samp class="option">nb_samples, n</samp></dt>
  10524. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  10525. </p>
  10526. </dd>
  10527. <dt><samp class="option">textfile</samp></dt>
  10528. <dd><p>Set the filename containing the text to speak.
  10529. </p>
  10530. </dd>
  10531. <dt><samp class="option">text</samp></dt>
  10532. <dd><p>Set the text to speak.
  10533. </p>
  10534. </dd>
  10535. <dt><samp class="option">voice, v</samp></dt>
  10536. <dd><p>Set the voice to use for the speech synthesis. Default value is
  10537. <code class="code">kal</code>. See also the <var class="var">list_voices</var> option.
  10538. </p></dd>
  10539. </dl>
  10540. <a name="Examples-42"></a>
  10541. <h4 class="subsection">9.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-42" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-42" aria-hidden="true">TOC</a></span></h4>
  10542. <ul class="itemize mark-bullet">
  10543. <li>Read from file <samp class="file">speech.txt</samp>, and synthesize the text using the
  10544. standard flite voice:
  10545. <div class="example">
  10546. <pre class="example-preformatted">flite=textfile=speech.txt
  10547. </pre></div>
  10548. </li><li>Read the specified text selecting the <code class="code">slt</code> voice:
  10549. <div class="example">
  10550. <pre class="example-preformatted">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  10551. </pre></div>
  10552. </li><li>Input text to ffmpeg:
  10553. <div class="example">
  10554. <pre class="example-preformatted">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  10555. </pre></div>
  10556. </li><li>Make <samp class="file">ffplay</samp> speak the specified text, using <code class="code">flite</code> and
  10557. the <code class="code">lavfi</code> device:
  10558. <div class="example">
  10559. <pre class="example-preformatted">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  10560. </pre></div>
  10561. </li></ul>
  10562. <p>For more information about libflite, check:
  10563. <a class="url" href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  10564. </p>
  10565. <a name="anoisesrc"></a>
  10566. <h3 class="section">9.8 anoisesrc<span class="pull-right"><a class="anchor hidden-xs" href="#anoisesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anoisesrc" aria-hidden="true">TOC</a></span></h3>
  10567. <p>Generate a noise audio signal.
  10568. </p>
  10569. <p>The filter accepts the following options:
  10570. </p>
  10571. <dl class="table">
  10572. <dt><samp class="option">sample_rate, r</samp></dt>
  10573. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  10574. </p>
  10575. </dd>
  10576. <dt><samp class="option">amplitude, a</samp></dt>
  10577. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  10578. is 1.0.
  10579. </p>
  10580. </dd>
  10581. <dt><samp class="option">duration, d</samp></dt>
  10582. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  10583. results in noise with an infinite length.
  10584. </p>
  10585. </dd>
  10586. <dt><samp class="option">color, colour, c</samp></dt>
  10587. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  10588. blue, violet and velvet. Default color is white.
  10589. </p>
  10590. </dd>
  10591. <dt><samp class="option">seed, s</samp></dt>
  10592. <dd><p>Specify a value used to seed the PRNG.
  10593. </p>
  10594. </dd>
  10595. <dt><samp class="option">nb_samples, n</samp></dt>
  10596. <dd><p>Set the number of samples per each output frame, default is 1024.
  10597. </p>
  10598. </dd>
  10599. <dt><samp class="option">density</samp></dt>
  10600. <dd><p>Set the density (0.0 - 1.0) for the velvet noise generator, default is 0.05.
  10601. </p></dd>
  10602. </dl>
  10603. <a name="Examples-43"></a>
  10604. <h4 class="subsection">9.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-43" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-43" aria-hidden="true">TOC</a></span></h4>
  10605. <ul class="itemize mark-bullet">
  10606. <li>Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  10607. <div class="example">
  10608. <pre class="example-preformatted">anoisesrc=d=60:c=pink:r=44100:a=0.5
  10609. </pre></div>
  10610. </li></ul>
  10611. <a name="hilbert"></a>
  10612. <h3 class="section">9.9 hilbert<span class="pull-right"><a class="anchor hidden-xs" href="#hilbert" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hilbert" aria-hidden="true">TOC</a></span></h3>
  10613. <p>Generate odd-tap Hilbert transform FIR coefficients.
  10614. </p>
  10615. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for phase-shifting
  10616. the signal by 90 degrees.
  10617. </p>
  10618. <p>This is used in many matrix coding schemes and for analytic signal generation.
  10619. The process is often written as a multiplication by i (or j), the imaginary unit.
  10620. </p>
  10621. <p>The filter accepts the following options:
  10622. </p>
  10623. <dl class="table">
  10624. <dt><samp class="option">sample_rate, s</samp></dt>
  10625. <dd><p>Set sample rate, default is 44100.
  10626. </p>
  10627. </dd>
  10628. <dt><samp class="option">taps, t</samp></dt>
  10629. <dd><p>Set length of FIR filter, default is 22051.
  10630. </p>
  10631. </dd>
  10632. <dt><samp class="option">nb_samples, n</samp></dt>
  10633. <dd><p>Set number of samples per each frame.
  10634. </p>
  10635. </dd>
  10636. <dt><samp class="option">win_func, w</samp></dt>
  10637. <dd><p>Set window function to be used when generating FIR coefficients.
  10638. </p></dd>
  10639. </dl>
  10640. <a name="sinc"></a>
  10641. <h3 class="section">9.10 sinc<span class="pull-right"><a class="anchor hidden-xs" href="#sinc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sinc" aria-hidden="true">TOC</a></span></h3>
  10642. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  10643. </p>
  10644. <p>The resulting stream can be used with <a class="ref" href="#afir">afir</a> filter for filtering the audio signal.
  10645. </p>
  10646. <p>The filter accepts the following options:
  10647. </p>
  10648. <dl class="table">
  10649. <dt><samp class="option">sample_rate, r</samp></dt>
  10650. <dd><p>Set sample rate, default is 44100.
  10651. </p>
  10652. </dd>
  10653. <dt><samp class="option">nb_samples, n</samp></dt>
  10654. <dd><p>Set number of samples per each frame. Default is 1024.
  10655. </p>
  10656. </dd>
  10657. <dt><samp class="option">hp</samp></dt>
  10658. <dd><p>Set high-pass frequency. Default is 0.
  10659. </p>
  10660. </dd>
  10661. <dt><samp class="option">lp</samp></dt>
  10662. <dd><p>Set low-pass frequency. Default is 0.
  10663. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  10664. is higher than 0 then filter will create band-pass filter coefficients,
  10665. otherwise band-reject filter coefficients.
  10666. </p>
  10667. </dd>
  10668. <dt><samp class="option">phase</samp></dt>
  10669. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  10670. </p>
  10671. </dd>
  10672. <dt><samp class="option">beta</samp></dt>
  10673. <dd><p>Set Kaiser window beta.
  10674. </p>
  10675. </dd>
  10676. <dt><samp class="option">att</samp></dt>
  10677. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  10678. </p>
  10679. </dd>
  10680. <dt><samp class="option">round</samp></dt>
  10681. <dd><p>Enable rounding, by default is disabled.
  10682. </p>
  10683. </dd>
  10684. <dt><samp class="option">hptaps</samp></dt>
  10685. <dd><p>Set number of taps for high-pass filter.
  10686. </p>
  10687. </dd>
  10688. <dt><samp class="option">lptaps</samp></dt>
  10689. <dd><p>Set number of taps for low-pass filter.
  10690. </p></dd>
  10691. </dl>
  10692. <a name="sine"></a>
  10693. <h3 class="section">9.11 sine<span class="pull-right"><a class="anchor hidden-xs" href="#sine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sine" aria-hidden="true">TOC</a></span></h3>
  10694. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  10695. </p>
  10696. <p>The audio signal is bit-exact.
  10697. </p>
  10698. <p>The filter accepts the following options:
  10699. </p>
  10700. <dl class="table">
  10701. <dt><samp class="option">frequency, f</samp></dt>
  10702. <dd><p>Set the carrier frequency. Default is 440 Hz.
  10703. </p>
  10704. </dd>
  10705. <dt><samp class="option">beep_factor, b</samp></dt>
  10706. <dd><p>Enable a periodic beep every second with frequency <var class="var">beep_factor</var> times
  10707. the carrier frequency. Default is 0, meaning the beep is disabled.
  10708. </p>
  10709. </dd>
  10710. <dt><samp class="option">sample_rate, r</samp></dt>
  10711. <dd><p>Specify the sample rate, default is 44100.
  10712. </p>
  10713. </dd>
  10714. <dt><samp class="option">duration, d</samp></dt>
  10715. <dd><p>Specify the duration of the generated audio stream.
  10716. </p>
  10717. </dd>
  10718. <dt><samp class="option">samples_per_frame</samp></dt>
  10719. <dd><p>Set the number of samples per output frame.
  10720. </p>
  10721. <p>The expression can contain the following constants:
  10722. </p>
  10723. <dl class="table">
  10724. <dt><samp class="option">n</samp></dt>
  10725. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  10726. </p>
  10727. </dd>
  10728. <dt><samp class="option">pts</samp></dt>
  10729. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  10730. expressed in <var class="var">TB</var> units.
  10731. </p>
  10732. </dd>
  10733. <dt><samp class="option">t</samp></dt>
  10734. <dd><p>The PTS of the output audio frame, expressed in seconds.
  10735. </p>
  10736. </dd>
  10737. <dt><samp class="option">TB</samp></dt>
  10738. <dd><p>The timebase of the output audio frames.
  10739. </p></dd>
  10740. </dl>
  10741. <p>Default is <code class="code">1024</code>.
  10742. </p></dd>
  10743. </dl>
  10744. <a name="Examples-44"></a>
  10745. <h4 class="subsection">9.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-44" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-44" aria-hidden="true">TOC</a></span></h4>
  10746. <ul class="itemize mark-bullet">
  10747. <li>Generate a simple 440 Hz sine wave:
  10748. <div class="example">
  10749. <pre class="example-preformatted">sine
  10750. </pre></div>
  10751. </li><li>Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  10752. <div class="example">
  10753. <pre class="example-preformatted">sine=220:4:d=5
  10754. sine=f=220:b=4:d=5
  10755. sine=frequency=220:beep_factor=4:duration=5
  10756. </pre></div>
  10757. </li><li>Generate a 1 kHz sine wave following <code class="code">1602,1601,1602,1601,1602</code> NTSC
  10758. pattern:
  10759. <div class="example">
  10760. <pre class="example-preformatted">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  10761. </pre></div>
  10762. </li></ul>
  10763. <a name="Audio-Sinks"></a>
  10764. <h2 class="chapter">10 Audio Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Audio-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Audio-Sinks" aria-hidden="true">TOC</a></span></h2>
  10765. <p>Below is a description of the currently available audio sinks.
  10766. </p>
  10767. <a name="abuffersink"></a>
  10768. <h3 class="section">10.1 abuffersink<span class="pull-right"><a class="anchor hidden-xs" href="#abuffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abuffersink" aria-hidden="true">TOC</a></span></h3>
  10769. <p>Buffer audio frames, and make them available to the end of filter chain.
  10770. </p>
  10771. <p>This sink is mainly intended for programmatic use, in particular
  10772. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  10773. or the options system.
  10774. </p>
  10775. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  10776. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  10777. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  10778. </p><a name="anullsink"></a>
  10779. <h3 class="section">10.2 anullsink<span class="pull-right"><a class="anchor hidden-xs" href="#anullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anullsink" aria-hidden="true">TOC</a></span></h3>
  10780. <p>Null audio sink; do absolutely nothing with the input audio. It is
  10781. mainly useful as a template and for use in analysis / debugging
  10782. tools.
  10783. </p>
  10784. <a name="Video-Filters"></a>
  10785. <h2 class="chapter">11 Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  10786. <p>When you configure your FFmpeg build, you can disable any of the
  10787. existing filters using <code class="code">--disable-filters</code>.
  10788. The configure output will show the video filters included in your
  10789. build.
  10790. </p>
  10791. <p>Below is a description of the currently available video filters.
  10792. </p>
  10793. <a name="addroi"></a>
  10794. <h3 class="section">11.1 addroi<span class="pull-right"><a class="anchor hidden-xs" href="#addroi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-addroi" aria-hidden="true">TOC</a></span></h3>
  10795. <p>Mark a region of interest in a video frame.
  10796. </p>
  10797. <p>The frame data is passed through unchanged, but metadata is attached
  10798. to the frame indicating regions of interest which can affect the
  10799. behaviour of later encoding. Multiple regions can be marked by
  10800. applying the filter multiple times.
  10801. </p>
  10802. <dl class="table">
  10803. <dt><samp class="option">x</samp></dt>
  10804. <dd><p>Region distance in pixels from the left edge of the frame.
  10805. </p></dd>
  10806. <dt><samp class="option">y</samp></dt>
  10807. <dd><p>Region distance in pixels from the top edge of the frame.
  10808. </p></dd>
  10809. <dt><samp class="option">w</samp></dt>
  10810. <dd><p>Region width in pixels.
  10811. </p></dd>
  10812. <dt><samp class="option">h</samp></dt>
  10813. <dd><p>Region height in pixels.
  10814. </p>
  10815. <p>The parameters <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> are expressions,
  10816. and may contain the following variables:
  10817. </p><dl class="table">
  10818. <dt><samp class="option">iw</samp></dt>
  10819. <dd><p>Width of the input frame.
  10820. </p></dd>
  10821. <dt><samp class="option">ih</samp></dt>
  10822. <dd><p>Height of the input frame.
  10823. </p></dd>
  10824. </dl>
  10825. </dd>
  10826. <dt><samp class="option">qoffset</samp></dt>
  10827. <dd><p>Quantisation offset to apply within the region.
  10828. </p>
  10829. <p>This must be a real value in the range -1 to +1. A value of zero
  10830. indicates no quality change. A negative value asks for better quality
  10831. (less quantisation), while a positive value asks for worse quality
  10832. (greater quantisation).
  10833. </p>
  10834. <p>The range is calibrated so that the extreme values indicate the
  10835. largest possible offset - if the rest of the frame is encoded with the
  10836. worst possible quality, an offset of -1 indicates that this region
  10837. should be encoded with the best possible quality anyway. Intermediate
  10838. values are then interpolated in some codec-dependent way.
  10839. </p>
  10840. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  10841. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  10842. this region should be encoded with a QP around one-tenth of the full
  10843. range better than the rest of the frame. So, if most of the frame
  10844. were to be encoded with a QP of around 30, this region would get a QP
  10845. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  10846. An extreme value of -1 would indicate that this region should be
  10847. encoded with the best possible quality regardless of the treatment of
  10848. the rest of the frame - that is, should be encoded at a QP of -12.
  10849. </p></dd>
  10850. <dt><samp class="option">clear</samp></dt>
  10851. <dd><p>If set to true, remove any existing regions of interest marked on the
  10852. frame before adding the new one.
  10853. </p></dd>
  10854. </dl>
  10855. <a name="Examples-45"></a>
  10856. <h4 class="subsection">11.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-45" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-45" aria-hidden="true">TOC</a></span></h4>
  10857. <ul class="itemize mark-bullet">
  10858. <li>Mark the centre quarter of the frame as interesting.
  10859. <div class="example">
  10860. <pre class="example-preformatted">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  10861. </pre></div>
  10862. </li><li>Mark the 100-pixel-wide region on the left edge of the frame as very
  10863. uninteresting (to be encoded at much lower quality than the rest of
  10864. the frame).
  10865. <div class="example">
  10866. <pre class="example-preformatted">addroi=0:0:100:ih:+1/5
  10867. </pre></div>
  10868. </li></ul>
  10869. <a name="alphaextract"></a>
  10870. <h3 class="section">11.2 alphaextract<span class="pull-right"><a class="anchor hidden-xs" href="#alphaextract" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphaextract" aria-hidden="true">TOC</a></span></h3>
  10871. <p>Extract the alpha component from the input as a grayscale video. This
  10872. is especially useful with the <var class="var">alphamerge</var> filter.
  10873. </p>
  10874. <a name="alphamerge"></a>
  10875. <h3 class="section">11.3 alphamerge<span class="pull-right"><a class="anchor hidden-xs" href="#alphamerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-alphamerge" aria-hidden="true">TOC</a></span></h3>
  10876. <p>Add or replace the alpha component of the primary input with the
  10877. grayscale value of a second input. This is intended for use with
  10878. <var class="var">alphaextract</var> to allow the transmission or storage of frame
  10879. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  10880. channel.
  10881. </p>
  10882. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  10883. and a separate video created with <var class="var">alphaextract</var>, you might use:
  10884. </p><div class="example">
  10885. <pre class="example-preformatted">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  10886. </pre></div>
  10887. <a name="amplify"></a>
  10888. <h3 class="section">11.4 amplify<span class="pull-right"><a class="anchor hidden-xs" href="#amplify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amplify" aria-hidden="true">TOC</a></span></h3>
  10889. <p>Amplify differences between current pixel and pixels of adjacent frames in
  10890. same pixel location.
  10891. </p>
  10892. <p>This filter accepts the following options:
  10893. </p>
  10894. <dl class="table">
  10895. <dt><samp class="option">radius</samp></dt>
  10896. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  10897. For example radius of 3 will instruct filter to calculate average of 7 frames.
  10898. </p>
  10899. </dd>
  10900. <dt><samp class="option">factor</samp></dt>
  10901. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  10902. </p>
  10903. </dd>
  10904. <dt><samp class="option">threshold</samp></dt>
  10905. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  10906. this value will not alter source pixel. Default is 10.
  10907. Allowed range is from 0 to 65535.
  10908. </p>
  10909. </dd>
  10910. <dt><samp class="option">tolerance</samp></dt>
  10911. <dd><p>Set tolerance for difference amplification. Any difference lower to
  10912. this value will not alter source pixel. Default is 0.
  10913. Allowed range is from 0 to 65535.
  10914. </p>
  10915. </dd>
  10916. <dt><samp class="option">low</samp></dt>
  10917. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  10918. This option controls maximum possible value that will decrease source pixel value.
  10919. </p>
  10920. </dd>
  10921. <dt><samp class="option">high</samp></dt>
  10922. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  10923. This option controls maximum possible value that will increase source pixel value.
  10924. </p>
  10925. </dd>
  10926. <dt><samp class="option">planes</samp></dt>
  10927. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  10928. </p></dd>
  10929. </dl>
  10930. <a name="Commands-54"></a>
  10931. <h4 class="subsection">11.4.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-54" aria-hidden="true">TOC</a></span></h4>
  10932. <p>This filter supports the following <a class="ref" href="#commands">commands</a> that corresponds to option of same name:
  10933. </p><dl class="table">
  10934. <dt><samp class="option">factor</samp></dt>
  10935. <dt><samp class="option">threshold</samp></dt>
  10936. <dt><samp class="option">tolerance</samp></dt>
  10937. <dt><samp class="option">low</samp></dt>
  10938. <dt><samp class="option">high</samp></dt>
  10939. <dt><samp class="option">planes</samp></dt>
  10940. </dl>
  10941. <a name="ass"></a>
  10942. <h3 class="section">11.5 ass<span class="pull-right"><a class="anchor hidden-xs" href="#ass" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ass" aria-hidden="true">TOC</a></span></h3>
  10943. <p>Same as the <a class="ref" href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  10944. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  10945. Substation Alpha) subtitles files.
  10946. </p>
  10947. <p>This filter accepts the following option in addition to the common options from
  10948. the <a class="ref" href="#subtitles">subtitles</a> filter:
  10949. </p>
  10950. <dl class="table">
  10951. <dt><samp class="option">shaping</samp></dt>
  10952. <dd><p>Set the shaping engine
  10953. </p>
  10954. <p>Available values are:
  10955. </p><dl class="table">
  10956. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  10957. <dd><p>The default libass shaping engine, which is the best available.
  10958. </p></dd>
  10959. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  10960. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  10961. </p></dd>
  10962. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  10963. <dd><p>Slower shaper using OpenType for substitutions and positioning
  10964. </p></dd>
  10965. </dl>
  10966. <p>The default is <code class="code">auto</code>.
  10967. </p></dd>
  10968. </dl>
  10969. <a name="atadenoise"></a>
  10970. <h3 class="section">11.6 atadenoise<span class="pull-right"><a class="anchor hidden-xs" href="#atadenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-atadenoise" aria-hidden="true">TOC</a></span></h3>
  10971. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  10972. </p>
  10973. <p>The filter accepts the following options:
  10974. </p>
  10975. <dl class="table">
  10976. <dt><samp class="option">0a</samp></dt>
  10977. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  10978. Valid range is 0 to 0.3.
  10979. </p>
  10980. </dd>
  10981. <dt><samp class="option">0b</samp></dt>
  10982. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  10983. Valid range is 0 to 5.
  10984. </p>
  10985. </dd>
  10986. <dt><samp class="option">1a</samp></dt>
  10987. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  10988. Valid range is 0 to 0.3.
  10989. </p>
  10990. </dd>
  10991. <dt><samp class="option">1b</samp></dt>
  10992. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  10993. Valid range is 0 to 5.
  10994. </p>
  10995. </dd>
  10996. <dt><samp class="option">2a</samp></dt>
  10997. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  10998. Valid range is 0 to 0.3.
  10999. </p>
  11000. </dd>
  11001. <dt><samp class="option">2b</samp></dt>
  11002. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  11003. Valid range is 0 to 5.
  11004. </p>
  11005. <p>Threshold A is designed to react on abrupt changes in the input signal and
  11006. threshold B is designed to react on continuous changes in the input signal.
  11007. </p>
  11008. </dd>
  11009. <dt><samp class="option">s</samp></dt>
  11010. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  11011. number in range [5, 129].
  11012. </p>
  11013. </dd>
  11014. <dt><samp class="option">p</samp></dt>
  11015. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  11016. </p>
  11017. </dd>
  11018. <dt><samp class="option">a</samp></dt>
  11019. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code class="code">p</code> parallel.
  11020. Alternatively can be set to <code class="code">s</code> serial.
  11021. </p>
  11022. <p>Parallel can be faster then serial, while other way around is never true.
  11023. Parallel will abort early on first change being greater then thresholds, while serial
  11024. will continue processing other side of frames if they are equal or below thresholds.
  11025. </p>
  11026. </dd>
  11027. <dt><samp class="option">0s</samp></dt>
  11028. <dt><samp class="option">1s</samp></dt>
  11029. <dt><samp class="option">2s</samp></dt>
  11030. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  11031. Valid range is from 0 to 32767.
  11032. This options controls weight for each pixel in radius defined by size.
  11033. Default value means every pixel have same weight.
  11034. Setting this option to 0 effectively disables filtering.
  11035. </p></dd>
  11036. </dl>
  11037. <a name="Commands-55"></a>
  11038. <h4 class="subsection">11.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-55" aria-hidden="true">TOC</a></span></h4>
  11039. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options except option <code class="code">s</code>.
  11040. The command accepts the same syntax of the corresponding option.
  11041. </p>
  11042. <a name="avgblur"></a>
  11043. <h3 class="section">11.7 avgblur<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur" aria-hidden="true">TOC</a></span></h3>
  11044. <p>Apply average blur filter.
  11045. </p>
  11046. <p>The filter accepts the following options:
  11047. </p>
  11048. <dl class="table">
  11049. <dt><samp class="option">sizeX</samp></dt>
  11050. <dd><p>Set horizontal radius size.
  11051. </p>
  11052. </dd>
  11053. <dt><samp class="option">planes</samp></dt>
  11054. <dd><p>Set which planes to filter. By default all planes are filtered.
  11055. </p>
  11056. </dd>
  11057. <dt><samp class="option">sizeY</samp></dt>
  11058. <dd><p>Set vertical radius size, if zero it will be same as <code class="code">sizeX</code>.
  11059. Default is <code class="code">0</code>.
  11060. </p></dd>
  11061. </dl>
  11062. <a name="Commands-56"></a>
  11063. <h4 class="subsection">11.7.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-56" aria-hidden="true">TOC</a></span></h4>
  11064. <p>This filter supports same commands as options.
  11065. The command accepts the same syntax of the corresponding option.
  11066. </p>
  11067. <p>If the specified expression is not valid, it is kept at its current
  11068. value.
  11069. </p>
  11070. <a name="backgroundkey"></a>
  11071. <h3 class="section">11.8 backgroundkey<span class="pull-right"><a class="anchor hidden-xs" href="#backgroundkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-backgroundkey" aria-hidden="true">TOC</a></span></h3>
  11072. <p>Turns a static background into transparency.
  11073. </p>
  11074. <p>The filter accepts the following option:
  11075. </p>
  11076. <dl class="table">
  11077. <dt><samp class="option">threshold</samp></dt>
  11078. <dd><p>Threshold for scene change detection.
  11079. </p></dd>
  11080. <dt><samp class="option">similarity</samp></dt>
  11081. <dd><p>Similarity percentage with the background.
  11082. </p></dd>
  11083. <dt><samp class="option">blend</samp></dt>
  11084. <dd><p>Set the blend amount for pixels that are not similar.
  11085. </p></dd>
  11086. </dl>
  11087. <a name="Commands-57"></a>
  11088. <h4 class="subsection">11.8.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-57" aria-hidden="true">TOC</a></span></h4>
  11089. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  11090. </p>
  11091. <a name="bbox"></a>
  11092. <h3 class="section">11.9 bbox<span class="pull-right"><a class="anchor hidden-xs" href="#bbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bbox" aria-hidden="true">TOC</a></span></h3>
  11093. <p>Compute the bounding box for the non-black pixels in the input frame
  11094. luma plane.
  11095. </p>
  11096. <p>This filter computes the bounding box containing all the pixels with a
  11097. luma value greater than the minimum allowed value.
  11098. The parameters describing the bounding box are printed on the filter
  11099. log.
  11100. </p>
  11101. <p>The filter accepts the following option:
  11102. </p>
  11103. <dl class="table">
  11104. <dt><samp class="option">min_val</samp></dt>
  11105. <dd><p>Set the minimal luma value. Default is <code class="code">16</code>.
  11106. </p></dd>
  11107. </dl>
  11108. <a name="Commands-58"></a>
  11109. <h4 class="subsection">11.9.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-58" aria-hidden="true">TOC</a></span></h4>
  11110. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  11111. </p>
  11112. <a name="bilateral"></a>
  11113. <h3 class="section">11.10 bilateral<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral" aria-hidden="true">TOC</a></span></h3>
  11114. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  11115. </p>
  11116. <p>The filter accepts the following options:
  11117. </p><dl class="table">
  11118. <dt><samp class="option">sigmaS</samp></dt>
  11119. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  11120. Allowed range is 0 to 512. Default is 0.1.
  11121. </p>
  11122. </dd>
  11123. <dt><samp class="option">sigmaR</samp></dt>
  11124. <dd><p>Set sigma of gaussian function to calculate range weight.
  11125. Allowed range is 0 to 1. Default is 0.1.
  11126. </p>
  11127. </dd>
  11128. <dt><samp class="option">planes</samp></dt>
  11129. <dd><p>Set planes to filter. Default is first only.
  11130. </p></dd>
  11131. </dl>
  11132. <a name="Commands-59"></a>
  11133. <h4 class="subsection">11.10.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-59" aria-hidden="true">TOC</a></span></h4>
  11134. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  11135. </p>
  11136. <a name="bitplanenoise"></a>
  11137. <h3 class="section">11.11 bitplanenoise<span class="pull-right"><a class="anchor hidden-xs" href="#bitplanenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bitplanenoise" aria-hidden="true">TOC</a></span></h3>
  11138. <p>Show and measure bit plane noise.
  11139. </p>
  11140. <p>The filter accepts the following options:
  11141. </p>
  11142. <dl class="table">
  11143. <dt><samp class="option">bitplane</samp></dt>
  11144. <dd><p>Set which plane to analyze. Default is <code class="code">1</code>.
  11145. </p>
  11146. </dd>
  11147. <dt><samp class="option">filter</samp></dt>
  11148. <dd><p>Filter out noisy pixels from <code class="code">bitplane</code> set above.
  11149. Default is disabled.
  11150. </p></dd>
  11151. </dl>
  11152. <a name="blackdetect_002c-blackdetect_005fvulkan"></a>
  11153. <h3 class="section">11.12 blackdetect, blackdetect_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect_002c-blackdetect_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  11154. <p>Detect video intervals that are (almost) completely black. Can be
  11155. useful to detect chapter transitions, commercials, or invalid
  11156. recordings.
  11157. </p>
  11158. <p>The filter outputs its detection analysis to both the log as well as
  11159. frame metadata. If a black segment of at least the specified minimum
  11160. duration is found, a line with the start and end timestamps as well
  11161. as duration is printed to the log with level <code class="code">info</code>. In addition,
  11162. a log line with level <code class="code">debug</code> is printed per frame showing the
  11163. black amount detected for that frame.
  11164. </p>
  11165. <p>The filter also attaches metadata to the first frame of a black
  11166. segment with key <code class="code">lavfi.black_start</code> and to the first frame
  11167. after the black segment ends with key <code class="code">lavfi.black_end</code>. The
  11168. value is the frame&rsquo;s timestamp. This metadata is added regardless
  11169. of the minimum duration specified.
  11170. </p>
  11171. <p>The filter accepts the following options:
  11172. </p>
  11173. <dl class="table">
  11174. <dt><samp class="option">black_min_duration, d</samp></dt>
  11175. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  11176. be a non-negative floating point number.
  11177. </p>
  11178. <p>Default value is 2.0.
  11179. </p>
  11180. </dd>
  11181. <dt><samp class="option">picture_black_ratio_th, pic_th</samp></dt>
  11182. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  11183. Express the minimum value for the ratio:
  11184. </p><div class="example">
  11185. <pre class="example-preformatted"><var class="var">nb_black_pixels</var> / <var class="var">nb_pixels</var>
  11186. </pre></div>
  11187. <p>for which a picture is considered black.
  11188. Default value is 0.98.
  11189. </p>
  11190. </dd>
  11191. <dt><samp class="option">pixel_black_th, pix_th</samp></dt>
  11192. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  11193. </p>
  11194. <p>The threshold expresses the maximum pixel luma value for which a
  11195. pixel is considered &quot;black&quot;. The provided value is scaled according to
  11196. the following equation:
  11197. </p><div class="example">
  11198. <pre class="example-preformatted"><var class="var">absolute_threshold</var> = <var class="var">luma_minimum_value</var> + <var class="var">pixel_black_th</var> * <var class="var">luma_range_size</var>
  11199. </pre></div>
  11200. <p><var class="var">luma_range_size</var> and <var class="var">luma_minimum_value</var> depend on
  11201. the input video format, the range is [0-255] for YUV full-range
  11202. formats and [16-235] for YUV non full-range formats.
  11203. </p>
  11204. <p>Default value is 0.10.
  11205. </p>
  11206. </dd>
  11207. <dt><samp class="option">alpha</samp></dt>
  11208. <dd><p>If true, check the alpha channel instead of the luma channel. Detects frames
  11209. which are (almost) transparent, instead of frames which are almost black.
  11210. </p>
  11211. <p>Default value is disabled.
  11212. </p></dd>
  11213. </dl>
  11214. <p>The following example sets the maximum pixel threshold to the minimum
  11215. value, and detects only black intervals of 2 or more seconds:
  11216. </p><div class="example">
  11217. <pre class="example-preformatted">blackdetect=d=2:pix_th=0.00
  11218. </pre></div>
  11219. <a name="blackframe"></a>
  11220. <h3 class="section">11.13 blackframe<span class="pull-right"><a class="anchor hidden-xs" href="#blackframe" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackframe" aria-hidden="true">TOC</a></span></h3>
  11221. <p>Detect frames that are (almost) completely black. Can be useful to
  11222. detect chapter transitions or commercials. Output lines consist of
  11223. the frame number of the detected frame, the percentage of blackness,
  11224. the position in the file if known or -1 and the timestamp in seconds.
  11225. </p>
  11226. <p>In order to display the output lines, you need to set the loglevel at
  11227. least to the AV_LOG_INFO value.
  11228. </p>
  11229. <p>This filter exports frame metadata <code class="code">lavfi.blackframe.pblack</code>.
  11230. The value represents the percentage of pixels in the picture that
  11231. are below the threshold value.
  11232. </p>
  11233. <p>It accepts the following parameters:
  11234. </p>
  11235. <dl class="table">
  11236. <dt><samp class="option">amount</samp></dt>
  11237. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  11238. <code class="code">98</code>.
  11239. </p>
  11240. </dd>
  11241. <dt><samp class="option">threshold, thresh</samp></dt>
  11242. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  11243. <code class="code">32</code>.
  11244. </p>
  11245. </dd>
  11246. </dl>
  11247. <a class="anchor" id="blend"></a><a name="blend-1"></a>
  11248. <h3 class="section">11.14 blend<span class="pull-right"><a class="anchor hidden-xs" href="#blend-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend-1" aria-hidden="true">TOC</a></span></h3>
  11249. <p>Blend two video frames into each other.
  11250. </p>
  11251. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  11252. stream, the first input is the &quot;top&quot; layer and second input is
  11253. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  11254. </p>
  11255. <p>The <code class="code">tblend</code> (time blend) filter takes two consecutive frames
  11256. from one single stream, and outputs the result obtained by blending
  11257. the new frame on top of the old frame.
  11258. </p>
  11259. <p>A description of the accepted options follows.
  11260. </p>
  11261. <dl class="table">
  11262. <dt><samp class="option">c0_mode</samp></dt>
  11263. <dt><samp class="option">c1_mode</samp></dt>
  11264. <dt><samp class="option">c2_mode</samp></dt>
  11265. <dt><samp class="option">c3_mode</samp></dt>
  11266. <dt><samp class="option">all_mode</samp></dt>
  11267. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  11268. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  11269. </p>
  11270. <p>Available values for component modes are:
  11271. </p><dl class="table">
  11272. <dt>&lsquo;<samp class="samp">addition</samp>&rsquo;</dt>
  11273. <dt>&lsquo;<samp class="samp">and</samp>&rsquo;</dt>
  11274. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  11275. <dt>&lsquo;<samp class="samp">bleach</samp>&rsquo;</dt>
  11276. <dt>&lsquo;<samp class="samp">burn</samp>&rsquo;</dt>
  11277. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  11278. <dt>&lsquo;<samp class="samp">difference</samp>&rsquo;</dt>
  11279. <dt>&lsquo;<samp class="samp">divide</samp>&rsquo;</dt>
  11280. <dt>&lsquo;<samp class="samp">dodge</samp>&rsquo;</dt>
  11281. <dt>&lsquo;<samp class="samp">exclusion</samp>&rsquo;</dt>
  11282. <dt>&lsquo;<samp class="samp">extremity</samp>&rsquo;</dt>
  11283. <dt>&lsquo;<samp class="samp">freeze</samp>&rsquo;</dt>
  11284. <dt>&lsquo;<samp class="samp">geometric</samp>&rsquo;</dt>
  11285. <dt>&lsquo;<samp class="samp">glow</samp>&rsquo;</dt>
  11286. <dt>&lsquo;<samp class="samp">grainextract</samp>&rsquo;</dt>
  11287. <dt>&lsquo;<samp class="samp">grainmerge</samp>&rsquo;</dt>
  11288. <dt>&lsquo;<samp class="samp">hardlight</samp>&rsquo;</dt>
  11289. <dt>&lsquo;<samp class="samp">hardmix</samp>&rsquo;</dt>
  11290. <dt>&lsquo;<samp class="samp">hardoverlay</samp>&rsquo;</dt>
  11291. <dt>&lsquo;<samp class="samp">harmonic</samp>&rsquo;</dt>
  11292. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  11293. <dt>&lsquo;<samp class="samp">interpolate</samp>&rsquo;</dt>
  11294. <dt>&lsquo;<samp class="samp">lighten</samp>&rsquo;</dt>
  11295. <dt>&lsquo;<samp class="samp">linearlight</samp>&rsquo;</dt>
  11296. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  11297. <dt>&lsquo;<samp class="samp">multiply128</samp>&rsquo;</dt>
  11298. <dt>&lsquo;<samp class="samp">negation</samp>&rsquo;</dt>
  11299. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  11300. <dt>&lsquo;<samp class="samp">or</samp>&rsquo;</dt>
  11301. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  11302. <dt>&lsquo;<samp class="samp">phoenix</samp>&rsquo;</dt>
  11303. <dt>&lsquo;<samp class="samp">pinlight</samp>&rsquo;</dt>
  11304. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  11305. <dt>&lsquo;<samp class="samp">screen</samp>&rsquo;</dt>
  11306. <dt>&lsquo;<samp class="samp">softdifference</samp>&rsquo;</dt>
  11307. <dt>&lsquo;<samp class="samp">softlight</samp>&rsquo;</dt>
  11308. <dt>&lsquo;<samp class="samp">stain</samp>&rsquo;</dt>
  11309. <dt>&lsquo;<samp class="samp">subtract</samp>&rsquo;</dt>
  11310. <dt>&lsquo;<samp class="samp">vividlight</samp>&rsquo;</dt>
  11311. <dt>&lsquo;<samp class="samp">xor</samp>&rsquo;</dt>
  11312. </dl>
  11313. </dd>
  11314. <dt><samp class="option">c0_opacity</samp></dt>
  11315. <dt><samp class="option">c1_opacity</samp></dt>
  11316. <dt><samp class="option">c2_opacity</samp></dt>
  11317. <dt><samp class="option">c3_opacity</samp></dt>
  11318. <dt><samp class="option">all_opacity</samp></dt>
  11319. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  11320. of <var class="var">all_opacity</var>. Only used in combination with pixel component blend modes.
  11321. </p>
  11322. </dd>
  11323. <dt><samp class="option">c0_expr</samp></dt>
  11324. <dt><samp class="option">c1_expr</samp></dt>
  11325. <dt><samp class="option">c2_expr</samp></dt>
  11326. <dt><samp class="option">c3_expr</samp></dt>
  11327. <dt><samp class="option">all_expr</samp></dt>
  11328. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  11329. of <var class="var">all_expr</var>. Note that related mode options will be ignored if those are set.
  11330. </p>
  11331. <p>The expressions can use the following variables:
  11332. </p>
  11333. <dl class="table">
  11334. <dt><samp class="option">N</samp></dt>
  11335. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  11336. </p>
  11337. </dd>
  11338. <dt><samp class="option">X</samp></dt>
  11339. <dt><samp class="option">Y</samp></dt>
  11340. <dd><p>the coordinates of the current sample
  11341. </p>
  11342. </dd>
  11343. <dt><samp class="option">W</samp></dt>
  11344. <dt><samp class="option">H</samp></dt>
  11345. <dd><p>the width and height of currently filtered plane
  11346. </p>
  11347. </dd>
  11348. <dt><samp class="option">SW</samp></dt>
  11349. <dt><samp class="option">SH</samp></dt>
  11350. <dd><p>Width and height scale for the plane being filtered. It is the
  11351. ratio between the dimensions of the current plane to the luma plane,
  11352. e.g. for a <code class="code">yuv420p</code> frame, the values are <code class="code">1,1</code> for
  11353. the luma plane and <code class="code">0.5,0.5</code> for the chroma planes.
  11354. </p>
  11355. </dd>
  11356. <dt><samp class="option">T</samp></dt>
  11357. <dd><p>Time of the current frame, expressed in seconds.
  11358. </p>
  11359. </dd>
  11360. <dt><samp class="option">TOP, A</samp></dt>
  11361. <dd><p>Value of pixel component at current location for first video frame (top layer).
  11362. </p>
  11363. </dd>
  11364. <dt><samp class="option">BOTTOM, B</samp></dt>
  11365. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  11366. </p></dd>
  11367. </dl>
  11368. </dd>
  11369. </dl>
  11370. <p>The <code class="code">blend</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  11371. </p>
  11372. <a name="Examples-46"></a>
  11373. <h4 class="subsection">11.14.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-46" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-46" aria-hidden="true">TOC</a></span></h4>
  11374. <ul class="itemize mark-bullet">
  11375. <li>Apply transition from bottom layer to top layer in first 10 seconds:
  11376. <div class="example">
  11377. <pre class="example-preformatted">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  11378. </pre></div>
  11379. </li><li>Apply linear horizontal transition from top layer to bottom layer:
  11380. <div class="example">
  11381. <pre class="example-preformatted">blend=all_expr='A*(X/W)+B*(1-X/W)'
  11382. </pre></div>
  11383. </li><li>Apply 1x1 checkerboard effect:
  11384. <div class="example">
  11385. <pre class="example-preformatted">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  11386. </pre></div>
  11387. </li><li>Apply uncover left effect:
  11388. <div class="example">
  11389. <pre class="example-preformatted">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  11390. </pre></div>
  11391. </li><li>Apply uncover down effect:
  11392. <div class="example">
  11393. <pre class="example-preformatted">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  11394. </pre></div>
  11395. </li><li>Apply uncover up-left effect:
  11396. <div class="example">
  11397. <pre class="example-preformatted">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  11398. </pre></div>
  11399. </li><li>Split diagonally video and shows top and bottom layer on each side:
  11400. <div class="example">
  11401. <pre class="example-preformatted">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  11402. </pre></div>
  11403. </li><li>Display differences between the current and the previous frame:
  11404. <div class="example">
  11405. <pre class="example-preformatted">tblend=all_mode=grainextract
  11406. </pre></div>
  11407. </li></ul>
  11408. <a name="Commands-60"></a>
  11409. <h4 class="subsection">11.14.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-60" aria-hidden="true">TOC</a></span></h4>
  11410. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  11411. </p>
  11412. <a class="anchor" id="blockdetect"></a><a name="blockdetect-1"></a>
  11413. <h3 class="section">11.15 blockdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blockdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blockdetect-1" aria-hidden="true">TOC</a></span></h3>
  11414. <p>Determines blockiness of frames without altering the input frames.
  11415. </p>
  11416. <p>Based on Remco Muijs and Ihor Kirenko: &quot;A no-reference blocking artifact measure for adaptive video processing.&quot; 2005 13th European signal processing conference.
  11417. </p>
  11418. <p>The filter accepts the following options:
  11419. </p>
  11420. <dl class="table">
  11421. <dt><samp class="option">period_min</samp></dt>
  11422. <dt><samp class="option">period_max</samp></dt>
  11423. <dd><p>Set minimum and maximum values for determining pixel grids (periods).
  11424. Default values are [3,24].
  11425. </p>
  11426. </dd>
  11427. <dt><samp class="option">planes</samp></dt>
  11428. <dd><p>Set planes to filter. Default is first only.
  11429. </p></dd>
  11430. </dl>
  11431. <a name="Examples-47"></a>
  11432. <h4 class="subsection">11.15.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-47" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-47" aria-hidden="true">TOC</a></span></h4>
  11433. <ul class="itemize mark-bullet">
  11434. <li>Determine blockiness for the first plane and search for periods within [8,32]:
  11435. <div class="example">
  11436. <pre class="example-preformatted">blockdetect=period_min=8:period_max=32:planes=1
  11437. </pre></div>
  11438. </li></ul>
  11439. <a class="anchor" id="blurdetect"></a><a name="blurdetect-1"></a>
  11440. <h3 class="section">11.16 blurdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blurdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blurdetect-1" aria-hidden="true">TOC</a></span></h3>
  11441. <p>Determines blurriness of frames without altering the input frames.
  11442. </p>
  11443. <p>Based on Marziliano, Pina, et al. &quot;A no-reference perceptual blur metric.&quot;
  11444. Allows for a block-based abbreviation.
  11445. </p>
  11446. <p>The filter accepts the following options:
  11447. </p>
  11448. <dl class="table">
  11449. <dt><samp class="option">low</samp></dt>
  11450. <dt><samp class="option">high</samp></dt>
  11451. <dd><p>Set low and high threshold values used by the Canny thresholding
  11452. algorithm.
  11453. </p>
  11454. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  11455. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  11456. by the low threshold.
  11457. </p>
  11458. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  11459. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  11460. </p>
  11461. <p>Default value for <var class="var">low</var> is <code class="code">20/255</code>, and default value for <var class="var">high</var>
  11462. is <code class="code">50/255</code>.
  11463. </p>
  11464. </dd>
  11465. <dt><samp class="option">radius</samp></dt>
  11466. <dd><p>Define the radius to search around an edge pixel for local maxima.
  11467. </p>
  11468. </dd>
  11469. <dt><samp class="option">block_pct</samp></dt>
  11470. <dd><p>Determine blurriness only for the most significant blocks, given in percentage.
  11471. </p>
  11472. </dd>
  11473. <dt><samp class="option">block_width</samp></dt>
  11474. <dd><p>Determine blurriness for blocks of width <var class="var">block_width</var>. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of <var class="var">block_height</var>.
  11475. </p>
  11476. </dd>
  11477. <dt><samp class="option">block_height</samp></dt>
  11478. <dd><p>Determine blurriness for blocks of height <var class="var">block_height</var>. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of <var class="var">block_width</var>.
  11479. </p>
  11480. </dd>
  11481. <dt><samp class="option">planes</samp></dt>
  11482. <dd><p>Set planes to filter. Default is first only.
  11483. </p></dd>
  11484. </dl>
  11485. <a name="Examples-48"></a>
  11486. <h4 class="subsection">11.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-48" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-48" aria-hidden="true">TOC</a></span></h4>
  11487. <ul class="itemize mark-bullet">
  11488. <li>Determine blur for 80% of most significant 32x32 blocks:
  11489. <div class="example">
  11490. <pre class="example-preformatted">blurdetect=block_width=32:block_height=32:block_pct=80
  11491. </pre></div>
  11492. </li></ul>
  11493. <a name="bm3d"></a>
  11494. <h3 class="section">11.17 bm3d<span class="pull-right"><a class="anchor hidden-xs" href="#bm3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bm3d" aria-hidden="true">TOC</a></span></h3>
  11495. <p>Denoise frames using Block-Matching 3D algorithm.
  11496. </p>
  11497. <p>The filter accepts the following options.
  11498. </p>
  11499. <dl class="table">
  11500. <dt><samp class="option">sigma</samp></dt>
  11501. <dd><p>Set denoising strength. Default value is 1.
  11502. Allowed range is from 0 to 999.9.
  11503. The denoising algorithm is very sensitive to sigma, so adjust it
  11504. according to the source.
  11505. </p>
  11506. </dd>
  11507. <dt><samp class="option">block</samp></dt>
  11508. <dd><p>Set local patch size. This sets dimensions in 2D.
  11509. </p>
  11510. </dd>
  11511. <dt><samp class="option">bstep</samp></dt>
  11512. <dd><p>Set sliding step for processing blocks. Default value is 4.
  11513. Allowed range is from 1 to 64.
  11514. Smaller values allows processing more reference blocks and is slower.
  11515. </p>
  11516. </dd>
  11517. <dt><samp class="option">group</samp></dt>
  11518. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  11519. When set to 1, no block matching is done. Larger values allows more blocks
  11520. in single group.
  11521. Allowed range is from 1 to 256.
  11522. </p>
  11523. </dd>
  11524. <dt><samp class="option">range</samp></dt>
  11525. <dd><p>Set radius for search block matching. Default is 9.
  11526. Allowed range is from 1 to INT32_MAX.
  11527. </p>
  11528. </dd>
  11529. <dt><samp class="option">mstep</samp></dt>
  11530. <dd><p>Set step between two search locations for block matching. Default is 1.
  11531. Allowed range is from 1 to 64. Smaller is slower.
  11532. </p>
  11533. </dd>
  11534. <dt><samp class="option">thmse</samp></dt>
  11535. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  11536. INT32_MAX.
  11537. </p>
  11538. </dd>
  11539. <dt><samp class="option">hdthr</samp></dt>
  11540. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  11541. Larger values results in stronger hard-thresholding filtering in frequency
  11542. domain.
  11543. </p>
  11544. </dd>
  11545. <dt><samp class="option">estim</samp></dt>
  11546. <dd><p>Set filtering estimation mode. Can be <code class="code">basic</code> or <code class="code">final</code>.
  11547. Default is <code class="code">basic</code>.
  11548. </p>
  11549. </dd>
  11550. <dt><samp class="option">ref</samp></dt>
  11551. <dd><p>If enabled, filter will use 2nd stream for block matching.
  11552. Default is disabled for <code class="code">basic</code> value of <var class="var">estim</var> option,
  11553. and always enabled if value of <var class="var">estim</var> is <code class="code">final</code>.
  11554. </p>
  11555. </dd>
  11556. <dt><samp class="option">planes</samp></dt>
  11557. <dd><p>Set planes to filter. Default is all available except alpha.
  11558. </p></dd>
  11559. </dl>
  11560. <a name="Examples-49"></a>
  11561. <h4 class="subsection">11.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-49" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-49" aria-hidden="true">TOC</a></span></h4>
  11562. <ul class="itemize mark-bullet">
  11563. <li>Basic filtering with bm3d:
  11564. <div class="example">
  11565. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  11566. </pre></div>
  11567. </li><li>Same as above, but filtering only luma:
  11568. <div class="example">
  11569. <pre class="example-preformatted">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  11570. </pre></div>
  11571. </li><li>Same as above, but with both estimation modes:
  11572. <div class="example">
  11573. <pre class="example-preformatted">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
  11574. </pre></div>
  11575. </li><li>Same as above, but prefilter with <a class="ref" href="#nlmeans">nlmeans</a> filter instead:
  11576. <div class="example">
  11577. <pre class="example-preformatted">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
  11578. </pre></div>
  11579. </li></ul>
  11580. <a name="boxblur"></a>
  11581. <h3 class="section">11.18 boxblur<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur" aria-hidden="true">TOC</a></span></h3>
  11582. <p>Apply a boxblur algorithm to the input video.
  11583. </p>
  11584. <p>It accepts the following parameters:
  11585. </p>
  11586. <dl class="table">
  11587. <dt><samp class="option">luma_radius, lr</samp></dt>
  11588. <dt><samp class="option">luma_power, lp</samp></dt>
  11589. <dt><samp class="option">chroma_radius, cr</samp></dt>
  11590. <dt><samp class="option">chroma_power, cp</samp></dt>
  11591. <dt><samp class="option">alpha_radius, ar</samp></dt>
  11592. <dt><samp class="option">alpha_power, ap</samp></dt>
  11593. </dl>
  11594. <p>A description of the accepted options follows.
  11595. </p>
  11596. <dl class="table">
  11597. <dt><samp class="option">luma_radius, lr</samp></dt>
  11598. <dt><samp class="option">chroma_radius, cr</samp></dt>
  11599. <dt><samp class="option">alpha_radius, ar</samp></dt>
  11600. <dd><p>Set an expression for the box radius in pixels used for blurring the
  11601. corresponding input plane.
  11602. </p>
  11603. <p>The radius value must be a non-negative number, and must not be
  11604. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  11605. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  11606. planes.
  11607. </p>
  11608. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  11609. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  11610. corresponding value set for <samp class="option">luma_radius</samp>.
  11611. </p>
  11612. <p>The expressions can contain the following constants:
  11613. </p><dl class="table">
  11614. <dt><samp class="option">w</samp></dt>
  11615. <dt><samp class="option">h</samp></dt>
  11616. <dd><p>The input width and height in pixels.
  11617. </p>
  11618. </dd>
  11619. <dt><samp class="option">cw</samp></dt>
  11620. <dt><samp class="option">ch</samp></dt>
  11621. <dd><p>The input chroma image width and height in pixels.
  11622. </p>
  11623. </dd>
  11624. <dt><samp class="option">hsub</samp></dt>
  11625. <dt><samp class="option">vsub</samp></dt>
  11626. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  11627. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  11628. </p></dd>
  11629. </dl>
  11630. </dd>
  11631. <dt><samp class="option">luma_power, lp</samp></dt>
  11632. <dt><samp class="option">chroma_power, cp</samp></dt>
  11633. <dt><samp class="option">alpha_power, ap</samp></dt>
  11634. <dd><p>Specify how many times the boxblur filter is applied to the
  11635. corresponding plane.
  11636. </p>
  11637. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  11638. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  11639. corresponding value set for <samp class="option">luma_power</samp>.
  11640. </p>
  11641. <p>A value of 0 will disable the effect.
  11642. </p></dd>
  11643. </dl>
  11644. <a name="Examples-50"></a>
  11645. <h4 class="subsection">11.18.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-50" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-50" aria-hidden="true">TOC</a></span></h4>
  11646. <ul class="itemize mark-bullet">
  11647. <li>Apply a boxblur filter with the luma, chroma, and alpha radii
  11648. set to 2:
  11649. <div class="example">
  11650. <pre class="example-preformatted">boxblur=luma_radius=2:luma_power=1
  11651. boxblur=2:1
  11652. </pre></div>
  11653. </li><li>Set the luma radius to 2, and alpha and chroma radius to 0:
  11654. <div class="example">
  11655. <pre class="example-preformatted">boxblur=2:1:cr=0:ar=0
  11656. </pre></div>
  11657. </li><li>Set the luma and chroma radii to a fraction of the video dimension:
  11658. <div class="example">
  11659. <pre class="example-preformatted">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  11660. </pre></div>
  11661. </li></ul>
  11662. <a class="anchor" id="bwdif"></a><a name="bwdif-1"></a>
  11663. <h3 class="section">11.19 bwdif<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif-1" aria-hidden="true">TOC</a></span></h3>
  11664. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  11665. Deinterlacing Filter&quot;).
  11666. </p>
  11667. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  11668. interpolation algorithms.
  11669. It accepts the following parameters:
  11670. </p>
  11671. <dl class="table">
  11672. <dt><samp class="option">mode</samp></dt>
  11673. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  11674. </p>
  11675. <dl class="table">
  11676. <dt><samp class="option">0, send_frame</samp></dt>
  11677. <dd><p>Output one frame for each frame.
  11678. </p></dd>
  11679. <dt><samp class="option">1, send_field</samp></dt>
  11680. <dd><p>Output one frame for each field.
  11681. </p></dd>
  11682. </dl>
  11683. <p>The default value is <code class="code">send_field</code>.
  11684. </p>
  11685. </dd>
  11686. <dt><samp class="option">parity</samp></dt>
  11687. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  11688. of the following values:
  11689. </p>
  11690. <dl class="table">
  11691. <dt><samp class="option">0, tff</samp></dt>
  11692. <dd><p>Assume the top field is first.
  11693. </p></dd>
  11694. <dt><samp class="option">1, bff</samp></dt>
  11695. <dd><p>Assume the bottom field is first.
  11696. </p></dd>
  11697. <dt><samp class="option">-1, auto</samp></dt>
  11698. <dd><p>Enable automatic detection of field parity.
  11699. </p></dd>
  11700. </dl>
  11701. <p>The default value is <code class="code">auto</code>.
  11702. If the interlacing is unknown or the decoder does not export this information,
  11703. top field first will be assumed.
  11704. </p>
  11705. </dd>
  11706. <dt><samp class="option">deint</samp></dt>
  11707. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  11708. values:
  11709. </p>
  11710. <dl class="table">
  11711. <dt><samp class="option">0, all</samp></dt>
  11712. <dd><p>Deinterlace all frames.
  11713. </p></dd>
  11714. <dt><samp class="option">1, interlaced</samp></dt>
  11715. <dd><p>Only deinterlace frames marked as interlaced.
  11716. </p></dd>
  11717. </dl>
  11718. <p>The default value is <code class="code">all</code>.
  11719. </p></dd>
  11720. </dl>
  11721. <a name="ccrepack"></a>
  11722. <h3 class="section">11.20 ccrepack<span class="pull-right"><a class="anchor hidden-xs" href="#ccrepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ccrepack" aria-hidden="true">TOC</a></span></h3>
  11723. <p>Repack CEA-708 closed captioning side data
  11724. </p>
  11725. <p>This filter fixes various issues seen with commercial encoders
  11726. related to upstream malformed CEA-708 payloads, specifically
  11727. incorrect number of tuples (wrong cc_count for the target FPS),
  11728. and incorrect ordering of tuples (i.e. the CEA-608 tuples are not at
  11729. the first entries in the payload).
  11730. </p>
  11731. <a name="cas"></a>
  11732. <h3 class="section">11.21 cas<span class="pull-right"><a class="anchor hidden-xs" href="#cas" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cas" aria-hidden="true">TOC</a></span></h3>
  11733. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  11734. </p>
  11735. <p>The filter accepts the following options:
  11736. </p>
  11737. <dl class="table">
  11738. <dt><samp class="option">strength</samp></dt>
  11739. <dd><p>Set the sharpening strength. Default value is 0.
  11740. </p>
  11741. </dd>
  11742. <dt><samp class="option">planes</samp></dt>
  11743. <dd><p>Set planes to filter. Default value is to filter all
  11744. planes except alpha plane.
  11745. </p></dd>
  11746. </dl>
  11747. <a name="Commands-61"></a>
  11748. <h4 class="subsection">11.21.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-61" aria-hidden="true">TOC</a></span></h4>
  11749. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  11750. </p>
  11751. <a name="chromahold"></a>
  11752. <h3 class="section">11.22 chromahold<span class="pull-right"><a class="anchor hidden-xs" href="#chromahold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromahold" aria-hidden="true">TOC</a></span></h3>
  11753. <p>Remove all color information for all colors except for certain one.
  11754. </p>
  11755. <p>The filter accepts the following options:
  11756. </p>
  11757. <dl class="table">
  11758. <dt><samp class="option">color</samp></dt>
  11759. <dd><p>The color which will not be replaced with neutral chroma.
  11760. </p>
  11761. </dd>
  11762. <dt><samp class="option">similarity</samp></dt>
  11763. <dd><p>Similarity percentage with the above color.
  11764. 0.01 matches only the exact key color, while 1.0 matches everything.
  11765. </p>
  11766. </dd>
  11767. <dt><samp class="option">blend</samp></dt>
  11768. <dd><p>Blend percentage.
  11769. 0.0 makes pixels either fully gray, or not gray at all.
  11770. Higher values result in more preserved color.
  11771. </p>
  11772. </dd>
  11773. <dt><samp class="option">yuv</samp></dt>
  11774. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  11775. </p>
  11776. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  11777. This can be used to pass exact YUV values as hexadecimal numbers.
  11778. </p></dd>
  11779. </dl>
  11780. <a name="Commands-62"></a>
  11781. <h4 class="subsection">11.22.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-62" aria-hidden="true">TOC</a></span></h4>
  11782. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  11783. The command accepts the same syntax of the corresponding option.
  11784. </p>
  11785. <p>If the specified expression is not valid, it is kept at its current
  11786. value.
  11787. </p>
  11788. <a class="anchor" id="chromakey"></a><a name="chromakey-1"></a>
  11789. <h3 class="section">11.23 chromakey<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey-1" aria-hidden="true">TOC</a></span></h3>
  11790. <p>YUV colorspace color/chroma keying.
  11791. </p>
  11792. <p>The filter accepts the following options:
  11793. </p>
  11794. <dl class="table">
  11795. <dt><samp class="option">color</samp></dt>
  11796. <dd><p>The color which will be replaced with transparency.
  11797. </p>
  11798. </dd>
  11799. <dt><samp class="option">similarity</samp></dt>
  11800. <dd><p>Similarity percentage with the key color.
  11801. </p>
  11802. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  11803. </p>
  11804. </dd>
  11805. <dt><samp class="option">blend</samp></dt>
  11806. <dd><p>Blend percentage.
  11807. </p>
  11808. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  11809. </p>
  11810. <p>Higher values result in semi-transparent pixels, with a higher transparency
  11811. the more similar the pixels color is to the key color.
  11812. </p>
  11813. </dd>
  11814. <dt><samp class="option">yuv</samp></dt>
  11815. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  11816. </p>
  11817. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  11818. This can be used to pass exact YUV values as hexadecimal numbers.
  11819. </p></dd>
  11820. </dl>
  11821. <a name="Commands-63"></a>
  11822. <h4 class="subsection">11.23.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-63" aria-hidden="true">TOC</a></span></h4>
  11823. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  11824. The command accepts the same syntax of the corresponding option.
  11825. </p>
  11826. <p>If the specified expression is not valid, it is kept at its current
  11827. value.
  11828. </p>
  11829. <a name="Examples-51"></a>
  11830. <h4 class="subsection">11.23.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-51" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-51" aria-hidden="true">TOC</a></span></h4>
  11831. <ul class="itemize mark-bullet">
  11832. <li>Make every green pixel in the input image transparent:
  11833. <div class="example">
  11834. <pre class="example-preformatted">ffmpeg -i input.png -vf chromakey=green out.png
  11835. </pre></div>
  11836. </li><li>Overlay a greenscreen-video on top of a static black background.
  11837. <div class="example">
  11838. <pre class="example-preformatted">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
  11839. </pre></div>
  11840. </li></ul>
  11841. <a name="chromanr"></a>
  11842. <h3 class="section">11.24 chromanr<span class="pull-right"><a class="anchor hidden-xs" href="#chromanr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromanr" aria-hidden="true">TOC</a></span></h3>
  11843. <p>Reduce chrominance noise.
  11844. </p>
  11845. <p>The filter accepts the following options:
  11846. </p>
  11847. <dl class="table">
  11848. <dt><samp class="option">thres</samp></dt>
  11849. <dd><p>Set threshold for averaging chrominance values.
  11850. Sum of absolute difference of Y, U and V pixel components of current
  11851. pixel and neighbour pixels lower than this threshold will be used in
  11852. averaging. Luma component is left unchanged and is copied to output.
  11853. Default value is 30. Allowed range is from 1 to 200.
  11854. </p>
  11855. </dd>
  11856. <dt><samp class="option">sizew</samp></dt>
  11857. <dd><p>Set horizontal radius of rectangle used for averaging.
  11858. Allowed range is from 1 to 100. Default value is 5.
  11859. </p>
  11860. </dd>
  11861. <dt><samp class="option">sizeh</samp></dt>
  11862. <dd><p>Set vertical radius of rectangle used for averaging.
  11863. Allowed range is from 1 to 100. Default value is 5.
  11864. </p>
  11865. </dd>
  11866. <dt><samp class="option">stepw</samp></dt>
  11867. <dd><p>Set horizontal step when averaging. Default value is 1.
  11868. Allowed range is from 1 to 50.
  11869. Mostly useful to speed-up filtering.
  11870. </p>
  11871. </dd>
  11872. <dt><samp class="option">steph</samp></dt>
  11873. <dd><p>Set vertical step when averaging. Default value is 1.
  11874. Allowed range is from 1 to 50.
  11875. Mostly useful to speed-up filtering.
  11876. </p>
  11877. </dd>
  11878. <dt><samp class="option">threy</samp></dt>
  11879. <dd><p>Set Y threshold for averaging chrominance values.
  11880. Set finer control for max allowed difference between Y components
  11881. of current pixel and neighbour pixels.
  11882. Default value is 200. Allowed range is from 1 to 200.
  11883. </p>
  11884. </dd>
  11885. <dt><samp class="option">threu</samp></dt>
  11886. <dd><p>Set U threshold for averaging chrominance values.
  11887. Set finer control for max allowed difference between U components
  11888. of current pixel and neighbour pixels.
  11889. Default value is 200. Allowed range is from 1 to 200.
  11890. </p>
  11891. </dd>
  11892. <dt><samp class="option">threv</samp></dt>
  11893. <dd><p>Set V threshold for averaging chrominance values.
  11894. Set finer control for max allowed difference between V components
  11895. of current pixel and neighbour pixels.
  11896. Default value is 200. Allowed range is from 1 to 200.
  11897. </p>
  11898. </dd>
  11899. <dt><samp class="option">distance</samp></dt>
  11900. <dd><p>Set distance type used in calculations.
  11901. </p>
  11902. <dl class="table">
  11903. <dt>&lsquo;<samp class="samp">manhattan</samp>&rsquo;</dt>
  11904. <dd><p>Absolute difference.
  11905. </p></dd>
  11906. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  11907. <dd><p>Difference squared.
  11908. </p></dd>
  11909. </dl>
  11910. <p>Default distance type is manhattan.
  11911. </p></dd>
  11912. </dl>
  11913. <a name="Commands-64"></a>
  11914. <h4 class="subsection">11.24.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-64" aria-hidden="true">TOC</a></span></h4>
  11915. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  11916. The command accepts the same syntax of the corresponding option.
  11917. </p>
  11918. <a name="chromashift"></a>
  11919. <h3 class="section">11.25 chromashift<span class="pull-right"><a class="anchor hidden-xs" href="#chromashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromashift" aria-hidden="true">TOC</a></span></h3>
  11920. <p>Shift chroma pixels horizontally and/or vertically.
  11921. </p>
  11922. <p>The filter accepts the following options:
  11923. </p><dl class="table">
  11924. <dt><samp class="option">cbh</samp></dt>
  11925. <dd><p>Set amount to shift chroma-blue horizontally.
  11926. </p></dd>
  11927. <dt><samp class="option">cbv</samp></dt>
  11928. <dd><p>Set amount to shift chroma-blue vertically.
  11929. </p></dd>
  11930. <dt><samp class="option">crh</samp></dt>
  11931. <dd><p>Set amount to shift chroma-red horizontally.
  11932. </p></dd>
  11933. <dt><samp class="option">crv</samp></dt>
  11934. <dd><p>Set amount to shift chroma-red vertically.
  11935. </p></dd>
  11936. <dt><samp class="option">edge</samp></dt>
  11937. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  11938. </p></dd>
  11939. </dl>
  11940. <a name="Commands-65"></a>
  11941. <h4 class="subsection">11.25.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-65" aria-hidden="true">TOC</a></span></h4>
  11942. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  11943. </p>
  11944. <a name="ciescope"></a>
  11945. <h3 class="section">11.26 ciescope<span class="pull-right"><a class="anchor hidden-xs" href="#ciescope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ciescope" aria-hidden="true">TOC</a></span></h3>
  11946. <p>Display CIE color diagram with pixels overlaid onto it.
  11947. </p>
  11948. <p>The filter accepts the following options:
  11949. </p>
  11950. <dl class="table">
  11951. <dt><samp class="option">system</samp></dt>
  11952. <dd><p>Set color system.
  11953. </p>
  11954. <dl class="table">
  11955. <dt>&lsquo;<samp class="samp">ntsc, 470m</samp>&rsquo;</dt>
  11956. <dt>&lsquo;<samp class="samp">ebu, 470bg</samp>&rsquo;</dt>
  11957. <dt>&lsquo;<samp class="samp">smpte</samp>&rsquo;</dt>
  11958. <dt>&lsquo;<samp class="samp">240m</samp>&rsquo;</dt>
  11959. <dt>&lsquo;<samp class="samp">apple</samp>&rsquo;</dt>
  11960. <dt>&lsquo;<samp class="samp">widergb</samp>&rsquo;</dt>
  11961. <dt>&lsquo;<samp class="samp">cie1931</samp>&rsquo;</dt>
  11962. <dt>&lsquo;<samp class="samp">rec709, hdtv</samp>&rsquo;</dt>
  11963. <dt>&lsquo;<samp class="samp">uhdtv, rec2020</samp>&rsquo;</dt>
  11964. <dt>&lsquo;<samp class="samp">dcip3</samp>&rsquo;</dt>
  11965. </dl>
  11966. </dd>
  11967. <dt><samp class="option">cie</samp></dt>
  11968. <dd><p>Set CIE system.
  11969. </p>
  11970. <dl class="table">
  11971. <dt>&lsquo;<samp class="samp">xyy</samp>&rsquo;</dt>
  11972. <dt>&lsquo;<samp class="samp">ucs</samp>&rsquo;</dt>
  11973. <dt>&lsquo;<samp class="samp">luv</samp>&rsquo;</dt>
  11974. </dl>
  11975. </dd>
  11976. <dt><samp class="option">gamuts</samp></dt>
  11977. <dd><p>Set what gamuts to draw.
  11978. </p>
  11979. <p>See <code class="code">system</code> option for available values.
  11980. </p>
  11981. </dd>
  11982. <dt><samp class="option">size, s</samp></dt>
  11983. <dd><p>Set ciescope size, by default set to 512.
  11984. </p>
  11985. </dd>
  11986. <dt><samp class="option">intensity, i</samp></dt>
  11987. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  11988. </p>
  11989. </dd>
  11990. <dt><samp class="option">contrast</samp></dt>
  11991. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  11992. </p>
  11993. </dd>
  11994. <dt><samp class="option">corrgamma</samp></dt>
  11995. <dd><p>Correct gamma displayed on scope, by default enabled.
  11996. </p>
  11997. </dd>
  11998. <dt><samp class="option">showwhite</samp></dt>
  11999. <dd><p>Show white point on CIE diagram, by default disabled.
  12000. </p>
  12001. </dd>
  12002. <dt><samp class="option">gamma</samp></dt>
  12003. <dd><p>Set input gamma. Used only with XYZ input color space.
  12004. </p>
  12005. </dd>
  12006. <dt><samp class="option">fill</samp></dt>
  12007. <dd><p>Fill with CIE colors. By default is enabled.
  12008. </p></dd>
  12009. </dl>
  12010. <a name="codecview"></a>
  12011. <h3 class="section">11.27 codecview<span class="pull-right"><a class="anchor hidden-xs" href="#codecview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-codecview" aria-hidden="true">TOC</a></span></h3>
  12012. <p>Visualize information exported by some codecs.
  12013. </p>
  12014. <p>Some codecs can export information through frames using side-data or other
  12015. means. For example, some MPEG based codecs export motion vectors through the
  12016. <var class="var">export_mvs</var> flag in the codec <samp class="option">flags2</samp> option.
  12017. </p>
  12018. <p>The filter accepts the following option:
  12019. </p>
  12020. <dl class="table">
  12021. <dt><samp class="option">block</samp></dt>
  12022. <dd><p>Display block partition structure using the luma plane.
  12023. </p>
  12024. </dd>
  12025. <dt><samp class="option">mv</samp></dt>
  12026. <dd><p>Set motion vectors to visualize.
  12027. </p>
  12028. <p>Available flags for <var class="var">mv</var> are:
  12029. </p>
  12030. <dl class="table">
  12031. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  12032. <dd><p>forward predicted MVs of P-frames
  12033. </p></dd>
  12034. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  12035. <dd><p>forward predicted MVs of B-frames
  12036. </p></dd>
  12037. <dt>&lsquo;<samp class="samp">bb</samp>&rsquo;</dt>
  12038. <dd><p>backward predicted MVs of B-frames
  12039. </p></dd>
  12040. </dl>
  12041. </dd>
  12042. <dt><samp class="option">qp</samp></dt>
  12043. <dd><p>Display quantization parameters using the chroma planes.
  12044. </p>
  12045. </dd>
  12046. <dt><samp class="option">mv_type, mvt</samp></dt>
  12047. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var class="var">frame_type</var> option.
  12048. </p>
  12049. <p>Available flags for <var class="var">mv_type</var> are:
  12050. </p>
  12051. <dl class="table">
  12052. <dt>&lsquo;<samp class="samp">fp</samp>&rsquo;</dt>
  12053. <dd><p>forward predicted MVs
  12054. </p></dd>
  12055. <dt>&lsquo;<samp class="samp">bp</samp>&rsquo;</dt>
  12056. <dd><p>backward predicted MVs
  12057. </p></dd>
  12058. </dl>
  12059. </dd>
  12060. <dt><samp class="option">frame_type, ft</samp></dt>
  12061. <dd><p>Set frame type to visualize motion vectors of.
  12062. </p>
  12063. <p>Available flags for <var class="var">frame_type</var> are:
  12064. </p>
  12065. <dl class="table">
  12066. <dt>&lsquo;<samp class="samp">if</samp>&rsquo;</dt>
  12067. <dd><p>intra-coded frames (I-frames)
  12068. </p></dd>
  12069. <dt>&lsquo;<samp class="samp">pf</samp>&rsquo;</dt>
  12070. <dd><p>predicted frames (P-frames)
  12071. </p></dd>
  12072. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  12073. <dd><p>bi-directionally predicted frames (B-frames)
  12074. </p></dd>
  12075. </dl>
  12076. </dd>
  12077. </dl>
  12078. <a name="Examples-52"></a>
  12079. <h4 class="subsection">11.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-52" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-52" aria-hidden="true">TOC</a></span></h4>
  12080. <ul class="itemize mark-bullet">
  12081. <li>Visualize forward predicted MVs of all frames using <code class="command">ffplay</code>:
  12082. <div class="example">
  12083. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  12084. </pre></div>
  12085. </li><li>Visualize multi-directionals MVs of P and B-Frames using <code class="command">ffplay</code>:
  12086. <div class="example">
  12087. <pre class="example-preformatted">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  12088. </pre></div>
  12089. </li></ul>
  12090. <a name="colorbalance"></a>
  12091. <h3 class="section">11.28 colorbalance<span class="pull-right"><a class="anchor hidden-xs" href="#colorbalance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorbalance" aria-hidden="true">TOC</a></span></h3>
  12092. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  12093. </p>
  12094. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  12095. regions for the red-cyan, green-magenta or blue-yellow balance.
  12096. </p>
  12097. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  12098. value towards the complementary color.
  12099. </p>
  12100. <p>The filter accepts the following options:
  12101. </p>
  12102. <dl class="table">
  12103. <dt><samp class="option">rs</samp></dt>
  12104. <dt><samp class="option">gs</samp></dt>
  12105. <dt><samp class="option">bs</samp></dt>
  12106. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  12107. </p>
  12108. </dd>
  12109. <dt><samp class="option">rm</samp></dt>
  12110. <dt><samp class="option">gm</samp></dt>
  12111. <dt><samp class="option">bm</samp></dt>
  12112. <dd><p>Adjust red, green and blue midtones (medium pixels).
  12113. </p>
  12114. </dd>
  12115. <dt><samp class="option">rh</samp></dt>
  12116. <dt><samp class="option">gh</samp></dt>
  12117. <dt><samp class="option">bh</samp></dt>
  12118. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  12119. </p>
  12120. <p>Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  12121. </p>
  12122. </dd>
  12123. <dt><samp class="option">pl</samp></dt>
  12124. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  12125. </p></dd>
  12126. </dl>
  12127. <a name="Examples-53"></a>
  12128. <h4 class="subsection">11.28.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-53" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-53" aria-hidden="true">TOC</a></span></h4>
  12129. <ul class="itemize mark-bullet">
  12130. <li>Add red color cast to shadows:
  12131. <div class="example">
  12132. <pre class="example-preformatted">colorbalance=rs=.3
  12133. </pre></div>
  12134. </li></ul>
  12135. <a name="Commands-66"></a>
  12136. <h4 class="subsection">11.28.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-66" aria-hidden="true">TOC</a></span></h4>
  12137. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12138. </p>
  12139. <a name="colorcontrast"></a>
  12140. <h3 class="section">11.29 colorcontrast<span class="pull-right"><a class="anchor hidden-xs" href="#colorcontrast" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcontrast" aria-hidden="true">TOC</a></span></h3>
  12141. <p>Adjust color contrast between RGB components.
  12142. </p>
  12143. <p>The filter accepts the following options:
  12144. </p>
  12145. <dl class="table">
  12146. <dt><samp class="option">rc</samp></dt>
  12147. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  12148. </p>
  12149. </dd>
  12150. <dt><samp class="option">gm</samp></dt>
  12151. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  12152. </p>
  12153. </dd>
  12154. <dt><samp class="option">by</samp></dt>
  12155. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  12156. </p>
  12157. </dd>
  12158. <dt><samp class="option">rcw</samp></dt>
  12159. <dt><samp class="option">gmw</samp></dt>
  12160. <dt><samp class="option">byw</samp></dt>
  12161. <dd><p>Set the weight of each <code class="code">rc</code>, <code class="code">gm</code>, <code class="code">by</code> option value. Default value is 0.0.
  12162. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  12163. </p>
  12164. </dd>
  12165. <dt><samp class="option">pl</samp></dt>
  12166. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  12167. </p></dd>
  12168. </dl>
  12169. <a name="Commands-67"></a>
  12170. <h4 class="subsection">11.29.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-67" aria-hidden="true">TOC</a></span></h4>
  12171. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12172. </p>
  12173. <a name="colorcorrect"></a>
  12174. <h3 class="section">11.30 colorcorrect<span class="pull-right"><a class="anchor hidden-xs" href="#colorcorrect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorcorrect" aria-hidden="true">TOC</a></span></h3>
  12175. <p>Adjust color white balance selectively for blacks and whites.
  12176. This filter operates in YUV colorspace.
  12177. </p>
  12178. <p>The filter accepts the following options:
  12179. </p>
  12180. <dl class="table">
  12181. <dt><samp class="option">rl</samp></dt>
  12182. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  12183. Default value is 0.
  12184. </p>
  12185. </dd>
  12186. <dt><samp class="option">bl</samp></dt>
  12187. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  12188. Default value is 0.
  12189. </p>
  12190. </dd>
  12191. <dt><samp class="option">rh</samp></dt>
  12192. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  12193. Default value is 0.
  12194. </p>
  12195. </dd>
  12196. <dt><samp class="option">bh</samp></dt>
  12197. <dd><p>Set the blue highlight spot. Allowed range is from -1.0 to 1.0.
  12198. Default value is 0.
  12199. </p>
  12200. </dd>
  12201. <dt><samp class="option">saturation</samp></dt>
  12202. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  12203. Default value is 1.
  12204. </p>
  12205. </dd>
  12206. <dt><samp class="option">analyze</samp></dt>
  12207. <dd><p>If set to anything other than <code class="code">manual</code> it will analyze every frame and use derived
  12208. parameters for filtering output frame.
  12209. </p>
  12210. <p>Possible values are:
  12211. </p><dl class="table">
  12212. <dt>&lsquo;<samp class="samp">manual</samp>&rsquo;</dt>
  12213. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  12214. <dt>&lsquo;<samp class="samp">minmax</samp>&rsquo;</dt>
  12215. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  12216. </dl>
  12217. <p>Default value is <code class="code">manual</code>.
  12218. </p></dd>
  12219. </dl>
  12220. <a name="Commands-68"></a>
  12221. <h4 class="subsection">11.30.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-68" aria-hidden="true">TOC</a></span></h4>
  12222. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12223. </p>
  12224. <a name="colorchannelmixer"></a>
  12225. <h3 class="section">11.31 colorchannelmixer<span class="pull-right"><a class="anchor hidden-xs" href="#colorchannelmixer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorchannelmixer" aria-hidden="true">TOC</a></span></h3>
  12226. <p>Adjust video input frames by re-mixing color channels.
  12227. </p>
  12228. <p>This filter modifies a color channel by adding the values associated to
  12229. the other channels of the same pixels. For example if the value to
  12230. modify is red, the output value will be:
  12231. </p><div class="example">
  12232. <pre class="example-preformatted"><var class="var">red</var>=<var class="var">red</var>*<var class="var">rr</var> + <var class="var">blue</var>*<var class="var">rb</var> + <var class="var">green</var>*<var class="var">rg</var> + <var class="var">alpha</var>*<var class="var">ra</var>
  12233. </pre></div>
  12234. <p>The filter accepts the following options:
  12235. </p>
  12236. <dl class="table">
  12237. <dt><samp class="option">rr</samp></dt>
  12238. <dt><samp class="option">rg</samp></dt>
  12239. <dt><samp class="option">rb</samp></dt>
  12240. <dt><samp class="option">ra</samp></dt>
  12241. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  12242. Default is <code class="code">1</code> for <var class="var">rr</var>, and <code class="code">0</code> for <var class="var">rg</var>, <var class="var">rb</var> and <var class="var">ra</var>.
  12243. </p>
  12244. </dd>
  12245. <dt><samp class="option">gr</samp></dt>
  12246. <dt><samp class="option">gg</samp></dt>
  12247. <dt><samp class="option">gb</samp></dt>
  12248. <dt><samp class="option">ga</samp></dt>
  12249. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  12250. Default is <code class="code">1</code> for <var class="var">gg</var>, and <code class="code">0</code> for <var class="var">gr</var>, <var class="var">gb</var> and <var class="var">ga</var>.
  12251. </p>
  12252. </dd>
  12253. <dt><samp class="option">br</samp></dt>
  12254. <dt><samp class="option">bg</samp></dt>
  12255. <dt><samp class="option">bb</samp></dt>
  12256. <dt><samp class="option">ba</samp></dt>
  12257. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  12258. Default is <code class="code">1</code> for <var class="var">bb</var>, and <code class="code">0</code> for <var class="var">br</var>, <var class="var">bg</var> and <var class="var">ba</var>.
  12259. </p>
  12260. </dd>
  12261. <dt><samp class="option">ar</samp></dt>
  12262. <dt><samp class="option">ag</samp></dt>
  12263. <dt><samp class="option">ab</samp></dt>
  12264. <dt><samp class="option">aa</samp></dt>
  12265. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  12266. Default is <code class="code">1</code> for <var class="var">aa</var>, and <code class="code">0</code> for <var class="var">ar</var>, <var class="var">ag</var> and <var class="var">ab</var>.
  12267. </p>
  12268. <p>Allowed ranges for options are <code class="code">[-2.0, 2.0]</code>.
  12269. </p>
  12270. </dd>
  12271. <dt><samp class="option">pc</samp></dt>
  12272. <dd><p>Set preserve color mode. The accepted values are:
  12273. </p><dl class="table">
  12274. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  12275. <dd><p>Disable color preserving, this is default.
  12276. </p></dd>
  12277. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  12278. <dd><p>Preserve luminance.
  12279. </p></dd>
  12280. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  12281. <dd><p>Preserve max value of RGB triplet.
  12282. </p></dd>
  12283. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  12284. <dd><p>Preserve average value of RGB triplet.
  12285. </p></dd>
  12286. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  12287. <dd><p>Preserve sum value of RGB triplet.
  12288. </p></dd>
  12289. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  12290. <dd><p>Preserve normalized value of RGB triplet.
  12291. </p></dd>
  12292. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  12293. <dd><p>Preserve power value of RGB triplet.
  12294. </p></dd>
  12295. </dl>
  12296. </dd>
  12297. <dt><samp class="option">pa</samp></dt>
  12298. <dd><p>Set the preserve color amount when changing colors. Allowed range is from <code class="code">[0.0, 1.0]</code>.
  12299. Default is <code class="code">0.0</code>, thus disabled.
  12300. </p></dd>
  12301. </dl>
  12302. <a name="Examples-54"></a>
  12303. <h4 class="subsection">11.31.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-54" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-54" aria-hidden="true">TOC</a></span></h4>
  12304. <ul class="itemize mark-bullet">
  12305. <li>Convert source to grayscale:
  12306. <div class="example">
  12307. <pre class="example-preformatted">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  12308. </pre></div>
  12309. </li><li>Simulate sepia tones:
  12310. <div class="example">
  12311. <pre class="example-preformatted">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  12312. </pre></div>
  12313. </li></ul>
  12314. <a name="Commands-69"></a>
  12315. <h4 class="subsection">11.31.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-69" aria-hidden="true">TOC</a></span></h4>
  12316. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12317. </p>
  12318. <a name="colordetect"></a>
  12319. <h3 class="section">11.32 colordetect<span class="pull-right"><a class="anchor hidden-xs" href="#colordetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colordetect" aria-hidden="true">TOC</a></span></h3>
  12320. <p>Analyze the video frames to determine the effective value range and alpha
  12321. mode.
  12322. </p>
  12323. <p>The filter accepts the following options:
  12324. </p>
  12325. <dl class="table">
  12326. <dt><samp class="option">mode</samp></dt>
  12327. <dd><p>Set of properties to detect. Unavailable properties, such as alpha mode for
  12328. an input image without an alpha channel, will be ignored automatically.
  12329. </p>
  12330. <p>Accepts a combination of the following flags:
  12331. </p>
  12332. <dl class="table">
  12333. <dt>&lsquo;<samp class="samp">color_range</samp>&rsquo;</dt>
  12334. <dd><p>Detect if the source contains luma pixels outside the limited (MPEG) range,
  12335. which indicates that this is a full range YUV source.
  12336. </p></dd>
  12337. <dt>&lsquo;<samp class="samp">alpha_mode</samp>&rsquo;</dt>
  12338. <dd><p>Detect if the source contains color values above the alpha channel, which
  12339. indicates that the alpha channel is independent (straight), rather than
  12340. premultiplied. Also detects if the alpha plane is fully opaque or not.
  12341. </p></dd>
  12342. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  12343. <dd><p>Enable detection of all of the above properties. This is the default.
  12344. </p></dd>
  12345. </dl>
  12346. </dd>
  12347. </dl>
  12348. <a name="colorize"></a>
  12349. <h3 class="section">11.33 colorize<span class="pull-right"><a class="anchor hidden-xs" href="#colorize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorize" aria-hidden="true">TOC</a></span></h3>
  12350. <p>Overlay a solid color on the video stream.
  12351. </p>
  12352. <p>The filter accepts the following options:
  12353. </p>
  12354. <dl class="table">
  12355. <dt><samp class="option">hue</samp></dt>
  12356. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  12357. Default value is 0.
  12358. </p>
  12359. </dd>
  12360. <dt><samp class="option">saturation</samp></dt>
  12361. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  12362. Default value is 0.5.
  12363. </p>
  12364. </dd>
  12365. <dt><samp class="option">lightness</samp></dt>
  12366. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  12367. Default value is 0.5.
  12368. </p>
  12369. </dd>
  12370. <dt><samp class="option">mix</samp></dt>
  12371. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  12372. Allowed range is from 0.0 to 1.0.
  12373. </p></dd>
  12374. </dl>
  12375. <a name="Commands-70"></a>
  12376. <h4 class="subsection">11.33.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-70" aria-hidden="true">TOC</a></span></h4>
  12377. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12378. </p>
  12379. <a name="colorkey"></a>
  12380. <h3 class="section">11.34 colorkey<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey" aria-hidden="true">TOC</a></span></h3>
  12381. <p>RGB colorspace color keying.
  12382. This filter operates on 8-bit RGB format frames by setting the alpha component of each pixel
  12383. which falls within the similarity radius of the key color to 0. The alpha value for pixels outside
  12384. the similarity radius depends on the value of the blend option.
  12385. </p>
  12386. <p>The filter accepts the following options:
  12387. </p>
  12388. <dl class="table">
  12389. <dt><samp class="option">color</samp></dt>
  12390. <dd><p>Set the color for which alpha will be set to 0 (full transparency).
  12391. See <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  12392. Default is <code class="code">black</code>.
  12393. </p>
  12394. </dd>
  12395. <dt><samp class="option">similarity</samp></dt>
  12396. <dd><p>Set the radius from the key color within which other colors also have full transparency.
  12397. The computed distance is related to the unit fractional distance in 3D space between the RGB values
  12398. of the key color and the pixel&rsquo;s color. Range is 0.01 to 1.0. 0.01 matches within a very small radius
  12399. around the exact key color, while 1.0 matches everything.
  12400. Default is <code class="code">0.01</code>.
  12401. </p>
  12402. </dd>
  12403. <dt><samp class="option">blend</samp></dt>
  12404. <dd><p>Set how the alpha value for pixels that fall outside the similarity radius is computed.
  12405. 0.0 makes pixels either fully transparent or fully opaque.
  12406. Higher values result in semi-transparent pixels, with greater transparency
  12407. the more similar the pixel color is to the key color.
  12408. Range is 0.0 to 1.0. Default is <code class="code">0.0</code>.
  12409. </p></dd>
  12410. </dl>
  12411. <a name="Examples-55"></a>
  12412. <h4 class="subsection">11.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-55" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-55" aria-hidden="true">TOC</a></span></h4>
  12413. <ul class="itemize mark-bullet">
  12414. <li>Make every green pixel in the input image transparent:
  12415. <div class="example">
  12416. <pre class="example-preformatted">ffmpeg -i input.png -vf colorkey=green out.png
  12417. </pre></div>
  12418. </li><li>Overlay a greenscreen-video on top of a static background image.
  12419. <div class="example">
  12420. <pre class="example-preformatted">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
  12421. </pre></div>
  12422. </li></ul>
  12423. <a name="Commands-71"></a>
  12424. <h4 class="subsection">11.34.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-71" aria-hidden="true">TOC</a></span></h4>
  12425. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  12426. The command accepts the same syntax of the corresponding option.
  12427. </p>
  12428. <p>If the specified expression is not valid, it is kept at its current
  12429. value.
  12430. </p>
  12431. <a name="colorhold"></a>
  12432. <h3 class="section">11.35 colorhold<span class="pull-right"><a class="anchor hidden-xs" href="#colorhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorhold" aria-hidden="true">TOC</a></span></h3>
  12433. <p>Remove all color information for all RGB colors except for certain one.
  12434. </p>
  12435. <p>The filter accepts the following options:
  12436. </p>
  12437. <dl class="table">
  12438. <dt><samp class="option">color</samp></dt>
  12439. <dd><p>The color which will not be replaced with neutral gray.
  12440. </p>
  12441. </dd>
  12442. <dt><samp class="option">similarity</samp></dt>
  12443. <dd><p>Similarity percentage with the above color.
  12444. 0.01 matches only the exact key color, while 1.0 matches everything.
  12445. </p>
  12446. </dd>
  12447. <dt><samp class="option">blend</samp></dt>
  12448. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  12449. Higher values result in more preserved color.
  12450. </p></dd>
  12451. </dl>
  12452. <a name="Commands-72"></a>
  12453. <h4 class="subsection">11.35.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-72" aria-hidden="true">TOC</a></span></h4>
  12454. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  12455. The command accepts the same syntax of the corresponding option.
  12456. </p>
  12457. <p>If the specified expression is not valid, it is kept at its current
  12458. value.
  12459. </p>
  12460. <a name="colorlevels"></a>
  12461. <h3 class="section">11.36 colorlevels<span class="pull-right"><a class="anchor hidden-xs" href="#colorlevels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorlevels" aria-hidden="true">TOC</a></span></h3>
  12462. <p>Adjust video input frames using levels.
  12463. </p>
  12464. <p>The filter accepts the following options:
  12465. </p>
  12466. <dl class="table">
  12467. <dt><samp class="option">rimin</samp></dt>
  12468. <dt><samp class="option">gimin</samp></dt>
  12469. <dt><samp class="option">bimin</samp></dt>
  12470. <dt><samp class="option">aimin</samp></dt>
  12471. <dd><p>Adjust red, green, blue and alpha input black point.
  12472. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">0</code>.
  12473. </p>
  12474. </dd>
  12475. <dt><samp class="option">rimax</samp></dt>
  12476. <dt><samp class="option">gimax</samp></dt>
  12477. <dt><samp class="option">bimax</samp></dt>
  12478. <dt><samp class="option">aimax</samp></dt>
  12479. <dd><p>Adjust red, green, blue and alpha input white point.
  12480. Allowed ranges for options are <code class="code">[-1.0, 1.0]</code>. Defaults are <code class="code">1</code>.
  12481. </p>
  12482. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  12483. (dark tones), change the balance of bright and dark tones.
  12484. </p>
  12485. </dd>
  12486. <dt><samp class="option">romin</samp></dt>
  12487. <dt><samp class="option">gomin</samp></dt>
  12488. <dt><samp class="option">bomin</samp></dt>
  12489. <dt><samp class="option">aomin</samp></dt>
  12490. <dd><p>Adjust red, green, blue and alpha output black point.
  12491. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">0</code>.
  12492. </p>
  12493. </dd>
  12494. <dt><samp class="option">romax</samp></dt>
  12495. <dt><samp class="option">gomax</samp></dt>
  12496. <dt><samp class="option">bomax</samp></dt>
  12497. <dt><samp class="option">aomax</samp></dt>
  12498. <dd><p>Adjust red, green, blue and alpha output white point.
  12499. Allowed ranges for options are <code class="code">[0, 1.0]</code>. Defaults are <code class="code">1</code>.
  12500. </p>
  12501. <p>Output levels allows manual selection of a constrained output level range.
  12502. </p>
  12503. </dd>
  12504. <dt><samp class="option">preserve</samp></dt>
  12505. <dd><p>Set preserve color mode. The accepted values are:
  12506. </p><dl class="table">
  12507. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  12508. <dd><p>Disable color preserving, this is default.
  12509. </p></dd>
  12510. <dt>&lsquo;<samp class="samp">lum</samp>&rsquo;</dt>
  12511. <dd><p>Preserve luminance.
  12512. </p></dd>
  12513. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  12514. <dd><p>Preserve max value of RGB triplet.
  12515. </p></dd>
  12516. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  12517. <dd><p>Preserve average value of RGB triplet.
  12518. </p></dd>
  12519. <dt>&lsquo;<samp class="samp">sum</samp>&rsquo;</dt>
  12520. <dd><p>Preserve sum value of RGB triplet.
  12521. </p></dd>
  12522. <dt>&lsquo;<samp class="samp">nrm</samp>&rsquo;</dt>
  12523. <dd><p>Preserve normalized value of RGB triplet.
  12524. </p></dd>
  12525. <dt>&lsquo;<samp class="samp">pwr</samp>&rsquo;</dt>
  12526. <dd><p>Preserve power value of RGB triplet.
  12527. </p></dd>
  12528. </dl>
  12529. </dd>
  12530. </dl>
  12531. <a name="Examples-56"></a>
  12532. <h4 class="subsection">11.36.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-56" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-56" aria-hidden="true">TOC</a></span></h4>
  12533. <ul class="itemize mark-bullet">
  12534. <li>Make video output darker:
  12535. <div class="example">
  12536. <pre class="example-preformatted">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  12537. </pre></div>
  12538. </li><li>Increase contrast:
  12539. <div class="example">
  12540. <pre class="example-preformatted">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  12541. </pre></div>
  12542. </li><li>Make video output lighter:
  12543. <div class="example">
  12544. <pre class="example-preformatted">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  12545. </pre></div>
  12546. </li><li>Increase brightness:
  12547. <div class="example">
  12548. <pre class="example-preformatted">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  12549. </pre></div>
  12550. </li></ul>
  12551. <a name="Commands-73"></a>
  12552. <h4 class="subsection">11.36.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-73" aria-hidden="true">TOC</a></span></h4>
  12553. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  12554. </p>
  12555. <a name="colormap"></a>
  12556. <h3 class="section">11.37 colormap<span class="pull-right"><a class="anchor hidden-xs" href="#colormap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormap" aria-hidden="true">TOC</a></span></h3>
  12557. <p>Apply custom color maps to video stream.
  12558. </p>
  12559. <p>This filter needs three input video streams.
  12560. First stream is video stream that is going to be filtered out.
  12561. Second and third video stream specify color patches for source
  12562. color to target color mapping.
  12563. </p>
  12564. <p>The filter accepts the following options:
  12565. </p>
  12566. <dl class="table">
  12567. <dt><samp class="option">patch_size</samp></dt>
  12568. <dd><p>Set the source and target video stream patch size in pixels.
  12569. </p>
  12570. </dd>
  12571. <dt><samp class="option">nb_patches</samp></dt>
  12572. <dd><p>Set the max number of used patches from source and target video stream.
  12573. Default value is number of patches available in additional video streams.
  12574. Max allowed number of patches is <code class="code">64</code>.
  12575. </p>
  12576. </dd>
  12577. <dt><samp class="option">type</samp></dt>
  12578. <dd><p>Set the adjustments used for target colors. Can be <code class="code">relative</code> or <code class="code">absolute</code>.
  12579. Defaults is <code class="code">absolute</code>.
  12580. </p>
  12581. </dd>
  12582. <dt><samp class="option">kernel</samp></dt>
  12583. <dd><p>Set the kernel used to measure color differences between mapped colors.
  12584. </p>
  12585. <p>The accepted values are:
  12586. </p><dl class="table">
  12587. <dt>&lsquo;<samp class="samp">euclidean</samp>&rsquo;</dt>
  12588. <dt>&lsquo;<samp class="samp">weuclidean</samp>&rsquo;</dt>
  12589. </dl>
  12590. <p>Default is <code class="code">euclidean</code>.
  12591. </p></dd>
  12592. </dl>
  12593. <a name="colormatrix"></a>
  12594. <h3 class="section">11.38 colormatrix<span class="pull-right"><a class="anchor hidden-xs" href="#colormatrix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colormatrix" aria-hidden="true">TOC</a></span></h3>
  12595. <p>Convert color matrix.
  12596. </p>
  12597. <p>The filter accepts the following options:
  12598. </p>
  12599. <dl class="table">
  12600. <dt><samp class="option">src</samp></dt>
  12601. <dt><samp class="option">dst</samp></dt>
  12602. <dd><p>Specify the source and destination color matrix. Both values must be
  12603. specified.
  12604. </p>
  12605. <p>The accepted values are:
  12606. </p><dl class="table">
  12607. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  12608. <dd><p>BT.709
  12609. </p>
  12610. </dd>
  12611. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  12612. <dd><p>FCC
  12613. </p>
  12614. </dd>
  12615. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  12616. <dd><p>BT.601
  12617. </p>
  12618. </dd>
  12619. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  12620. <dd><p>BT.470
  12621. </p>
  12622. </dd>
  12623. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  12624. <dd><p>BT.470BG
  12625. </p>
  12626. </dd>
  12627. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  12628. <dd><p>SMPTE-170M
  12629. </p>
  12630. </dd>
  12631. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  12632. <dd><p>SMPTE-240M
  12633. </p>
  12634. </dd>
  12635. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  12636. <dd><p>BT.2020
  12637. </p></dd>
  12638. </dl>
  12639. </dd>
  12640. </dl>
  12641. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  12642. </p><div class="example">
  12643. <pre class="example-preformatted">colormatrix=bt601:smpte240m
  12644. </pre></div>
  12645. <a name="colorspace"></a>
  12646. <h3 class="section">11.39 colorspace<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace" aria-hidden="true">TOC</a></span></h3>
  12647. <p>Convert colorspace, transfer characteristics or color primaries.
  12648. Input video needs to have an even size.
  12649. </p>
  12650. <p>The filter accepts the following options:
  12651. </p>
  12652. <dl class="table">
  12653. <dd><a class="anchor" id="all"></a></dd>
  12654. <dt><samp class="option">all</samp></dt>
  12655. <dd><p>Specify all color properties at once.
  12656. </p>
  12657. <p>The accepted values are:
  12658. </p><dl class="table">
  12659. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  12660. <dd><p>BT.470M
  12661. </p>
  12662. </dd>
  12663. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  12664. <dd><p>BT.470BG
  12665. </p>
  12666. </dd>
  12667. <dt>&lsquo;<samp class="samp">bt601-6-525</samp>&rsquo;</dt>
  12668. <dd><p>BT.601-6 525
  12669. </p>
  12670. </dd>
  12671. <dt>&lsquo;<samp class="samp">bt601-6-625</samp>&rsquo;</dt>
  12672. <dd><p>BT.601-6 625
  12673. </p>
  12674. </dd>
  12675. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  12676. <dd><p>BT.709
  12677. </p>
  12678. </dd>
  12679. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  12680. <dd><p>SMPTE-170M
  12681. </p>
  12682. </dd>
  12683. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  12684. <dd><p>SMPTE-240M
  12685. </p>
  12686. </dd>
  12687. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  12688. <dd><p>BT.2020
  12689. </p>
  12690. </dd>
  12691. </dl>
  12692. <a class="anchor" id="space"></a></dd>
  12693. <dt><samp class="option">space</samp></dt>
  12694. <dd><p>Specify output colorspace.
  12695. </p>
  12696. <p>The accepted values are:
  12697. </p><dl class="table">
  12698. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  12699. <dd><p>BT.709
  12700. </p>
  12701. </dd>
  12702. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  12703. <dd><p>FCC
  12704. </p>
  12705. </dd>
  12706. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  12707. <dd><p>BT.470BG or BT.601-6 625
  12708. </p>
  12709. </dd>
  12710. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  12711. <dd><p>SMPTE-170M or BT.601-6 525
  12712. </p>
  12713. </dd>
  12714. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  12715. <dd><p>SMPTE-240M
  12716. </p>
  12717. </dd>
  12718. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  12719. <dd><p>YCgCo
  12720. </p>
  12721. </dd>
  12722. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  12723. <dd><p>BT.2020 with non-constant luminance
  12724. </p>
  12725. </dd>
  12726. </dl>
  12727. <a class="anchor" id="trc"></a></dd>
  12728. <dt><samp class="option">trc</samp></dt>
  12729. <dd><p>Specify output transfer characteristics.
  12730. </p>
  12731. <p>The accepted values are:
  12732. </p><dl class="table">
  12733. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  12734. <dd><p>BT.709
  12735. </p>
  12736. </dd>
  12737. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  12738. <dd><p>BT.470M
  12739. </p>
  12740. </dd>
  12741. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  12742. <dd><p>BT.470BG
  12743. </p>
  12744. </dd>
  12745. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  12746. <dd><p>Constant gamma of 2.2
  12747. </p>
  12748. </dd>
  12749. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  12750. <dd><p>Constant gamma of 2.8
  12751. </p>
  12752. </dd>
  12753. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  12754. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  12755. </p>
  12756. </dd>
  12757. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  12758. <dd><p>SMPTE-240M
  12759. </p>
  12760. </dd>
  12761. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  12762. <dd><p>SRGB
  12763. </p>
  12764. </dd>
  12765. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  12766. <dd><p>iec61966-2-1
  12767. </p>
  12768. </dd>
  12769. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  12770. <dd><p>iec61966-2-4
  12771. </p>
  12772. </dd>
  12773. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  12774. <dd><p>xvycc
  12775. </p>
  12776. </dd>
  12777. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  12778. <dd><p>BT.2020 for 10-bits content
  12779. </p>
  12780. </dd>
  12781. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  12782. <dd><p>BT.2020 for 12-bits content
  12783. </p>
  12784. </dd>
  12785. </dl>
  12786. <a class="anchor" id="primaries"></a></dd>
  12787. <dt><samp class="option">primaries</samp></dt>
  12788. <dd><p>Specify output color primaries.
  12789. </p>
  12790. <p>The accepted values are:
  12791. </p><dl class="table">
  12792. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  12793. <dd><p>BT.709
  12794. </p>
  12795. </dd>
  12796. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  12797. <dd><p>BT.470M
  12798. </p>
  12799. </dd>
  12800. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  12801. <dd><p>BT.470BG or BT.601-6 625
  12802. </p>
  12803. </dd>
  12804. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  12805. <dd><p>SMPTE-170M or BT.601-6 525
  12806. </p>
  12807. </dd>
  12808. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  12809. <dd><p>SMPTE-240M
  12810. </p>
  12811. </dd>
  12812. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  12813. <dd><p>film
  12814. </p>
  12815. </dd>
  12816. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  12817. <dd><p>SMPTE-431
  12818. </p>
  12819. </dd>
  12820. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  12821. <dd><p>SMPTE-432
  12822. </p>
  12823. </dd>
  12824. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  12825. <dd><p>BT.2020
  12826. </p>
  12827. </dd>
  12828. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  12829. <dd><p>JEDEC P22 phosphors
  12830. </p>
  12831. </dd>
  12832. </dl>
  12833. <a class="anchor" id="range"></a></dd>
  12834. <dt><samp class="option">range</samp></dt>
  12835. <dd><p>Specify output color range.
  12836. </p>
  12837. <p>The accepted values are:
  12838. </p><dl class="table">
  12839. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  12840. <dd><p>TV (restricted) range
  12841. </p>
  12842. </dd>
  12843. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  12844. <dd><p>MPEG (restricted) range
  12845. </p>
  12846. </dd>
  12847. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  12848. <dd><p>PC (full) range
  12849. </p>
  12850. </dd>
  12851. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  12852. <dd><p>JPEG (full) range
  12853. </p>
  12854. </dd>
  12855. </dl>
  12856. </dd>
  12857. <dt><samp class="option">format</samp></dt>
  12858. <dd><p>Specify output color format.
  12859. </p>
  12860. <p>The accepted values are:
  12861. </p><dl class="table">
  12862. <dt>&lsquo;<samp class="samp">yuv420p</samp>&rsquo;</dt>
  12863. <dd><p>YUV 4:2:0 planar 8-bits
  12864. </p>
  12865. </dd>
  12866. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  12867. <dd><p>YUV 4:2:0 planar 10-bits
  12868. </p>
  12869. </dd>
  12870. <dt>&lsquo;<samp class="samp">yuv420p12</samp>&rsquo;</dt>
  12871. <dd><p>YUV 4:2:0 planar 12-bits
  12872. </p>
  12873. </dd>
  12874. <dt>&lsquo;<samp class="samp">yuv422p</samp>&rsquo;</dt>
  12875. <dd><p>YUV 4:2:2 planar 8-bits
  12876. </p>
  12877. </dd>
  12878. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  12879. <dd><p>YUV 4:2:2 planar 10-bits
  12880. </p>
  12881. </dd>
  12882. <dt>&lsquo;<samp class="samp">yuv422p12</samp>&rsquo;</dt>
  12883. <dd><p>YUV 4:2:2 planar 12-bits
  12884. </p>
  12885. </dd>
  12886. <dt>&lsquo;<samp class="samp">yuv444p</samp>&rsquo;</dt>
  12887. <dd><p>YUV 4:4:4 planar 8-bits
  12888. </p>
  12889. </dd>
  12890. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  12891. <dd><p>YUV 4:4:4 planar 10-bits
  12892. </p>
  12893. </dd>
  12894. <dt>&lsquo;<samp class="samp">yuv444p12</samp>&rsquo;</dt>
  12895. <dd><p>YUV 4:4:4 planar 12-bits
  12896. </p>
  12897. </dd>
  12898. </dl>
  12899. </dd>
  12900. <dt><samp class="option">fast</samp></dt>
  12901. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  12902. significantly less CPU, but will be mathematically incorrect. To get output
  12903. compatible with that produced by the colormatrix filter, use fast=1.
  12904. </p>
  12905. </dd>
  12906. <dt><samp class="option">dither</samp></dt>
  12907. <dd><p>Specify dithering mode.
  12908. </p>
  12909. <p>The accepted values are:
  12910. </p><dl class="table">
  12911. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  12912. <dd><p>No dithering
  12913. </p>
  12914. </dd>
  12915. <dt>&lsquo;<samp class="samp">fsb</samp>&rsquo;</dt>
  12916. <dd><p>Floyd-Steinberg dithering
  12917. </p></dd>
  12918. </dl>
  12919. </dd>
  12920. <dt><samp class="option">wpadapt</samp></dt>
  12921. <dd><p>Whitepoint adaptation mode.
  12922. </p>
  12923. <p>The accepted values are:
  12924. </p><dl class="table">
  12925. <dt>&lsquo;<samp class="samp">bradford</samp>&rsquo;</dt>
  12926. <dd><p>Bradford whitepoint adaptation
  12927. </p>
  12928. </dd>
  12929. <dt>&lsquo;<samp class="samp">vonkries</samp>&rsquo;</dt>
  12930. <dd><p>von Kries whitepoint adaptation
  12931. </p>
  12932. </dd>
  12933. <dt>&lsquo;<samp class="samp">identity</samp>&rsquo;</dt>
  12934. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  12935. </p></dd>
  12936. </dl>
  12937. </dd>
  12938. <dt><samp class="option">clipgamut</samp></dt>
  12939. <dd><p>Controls how to clip out-of-gamut colors that arise as a result of colorspace conversion.
  12940. </p>
  12941. <p>The accepted values are:
  12942. </p><dl class="table">
  12943. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  12944. <dd><p>No clipping of out of gamut colors.
  12945. </p>
  12946. </dd>
  12947. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  12948. <dd><p>Clips the RGB values to the [0, 1] range when building the gamma transfer LUTs.
  12949. </p></dd>
  12950. </dl>
  12951. </dd>
  12952. <dt><samp class="option">iall</samp></dt>
  12953. <dd><p>Override all input properties at once. Same accepted values as <a class="ref" href="#all">all</a>.
  12954. </p>
  12955. </dd>
  12956. <dt><samp class="option">ispace</samp></dt>
  12957. <dd><p>Override input colorspace. Same accepted values as <a class="ref" href="#space">space</a>.
  12958. </p>
  12959. </dd>
  12960. <dt><samp class="option">iprimaries</samp></dt>
  12961. <dd><p>Override input color primaries. Same accepted values as <a class="ref" href="#primaries">primaries</a>.
  12962. </p>
  12963. </dd>
  12964. <dt><samp class="option">itrc</samp></dt>
  12965. <dd><p>Override input transfer characteristics. Same accepted values as <a class="ref" href="#trc">trc</a>.
  12966. </p>
  12967. </dd>
  12968. <dt><samp class="option">irange</samp></dt>
  12969. <dd><p>Override input color range. Same accepted values as <a class="ref" href="#range">range</a>.
  12970. </p>
  12971. </dd>
  12972. </dl>
  12973. <p>The filter converts the transfer characteristics, color space and color
  12974. primaries to the specified user values. The output value, if not specified,
  12975. is set to a default value based on the &quot;all&quot; property. If that property is
  12976. also not specified, the filter will log an error. The output color range and
  12977. format default to the same value as the input color range and format. The
  12978. input transfer characteristics, color space, color primaries and color range
  12979. should be set on the input data. If any of these are missing, the filter will
  12980. log an error and no conversion will take place.
  12981. </p>
  12982. <p>For example to convert the input to SMPTE-240M, use the command:
  12983. </p><div class="example">
  12984. <pre class="example-preformatted">colorspace=smpte240m
  12985. </pre></div>
  12986. <a name="colortemperature"></a>
  12987. <h3 class="section">11.40 colortemperature<span class="pull-right"><a class="anchor hidden-xs" href="#colortemperature" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colortemperature" aria-hidden="true">TOC</a></span></h3>
  12988. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  12989. </p>
  12990. <p>The filter accepts the following options:
  12991. </p>
  12992. <dl class="table">
  12993. <dt><samp class="option">temperature</samp></dt>
  12994. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  12995. Default value is 6500 K.
  12996. </p>
  12997. </dd>
  12998. <dt><samp class="option">mix</samp></dt>
  12999. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  13000. Default value is 1.
  13001. </p>
  13002. </dd>
  13003. <dt><samp class="option">pl</samp></dt>
  13004. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  13005. Default value is 0.
  13006. </p></dd>
  13007. </dl>
  13008. <a name="Commands-74"></a>
  13009. <h4 class="subsection">11.40.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-74" aria-hidden="true">TOC</a></span></h4>
  13010. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  13011. </p>
  13012. <a name="convolution"></a>
  13013. <h3 class="section">11.41 convolution<span class="pull-right"><a class="anchor hidden-xs" href="#convolution" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution" aria-hidden="true">TOC</a></span></h3>
  13014. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  13015. </p>
  13016. <p>The filter accepts the following options:
  13017. </p>
  13018. <dl class="table">
  13019. <dt><samp class="option">0m</samp></dt>
  13020. <dt><samp class="option">1m</samp></dt>
  13021. <dt><samp class="option">2m</samp></dt>
  13022. <dt><samp class="option">3m</samp></dt>
  13023. <dd><p>Set matrix for each plane.
  13024. Matrix is sequence of 9, 25 or 49 signed integers in <var class="var">square</var> mode,
  13025. and from 1 to 49 odd number of signed integers in <var class="var">row</var> mode.
  13026. </p>
  13027. </dd>
  13028. <dt><samp class="option">0rdiv</samp></dt>
  13029. <dt><samp class="option">1rdiv</samp></dt>
  13030. <dt><samp class="option">2rdiv</samp></dt>
  13031. <dt><samp class="option">3rdiv</samp></dt>
  13032. <dd><p>Set multiplier for calculated value for each plane.
  13033. If unset or 0, it will be 1/sum of all matrix elements.
  13034. </p>
  13035. </dd>
  13036. <dt><samp class="option">0bias</samp></dt>
  13037. <dt><samp class="option">1bias</samp></dt>
  13038. <dt><samp class="option">2bias</samp></dt>
  13039. <dt><samp class="option">3bias</samp></dt>
  13040. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  13041. Useful for making the overall image brighter or darker. Default is 0.0.
  13042. </p>
  13043. </dd>
  13044. <dt><samp class="option">0mode</samp></dt>
  13045. <dt><samp class="option">1mode</samp></dt>
  13046. <dt><samp class="option">2mode</samp></dt>
  13047. <dt><samp class="option">3mode</samp></dt>
  13048. <dd><p>Set matrix mode for each plane. Can be <var class="var">square</var>, <var class="var">row</var> or <var class="var">column</var>.
  13049. Default is <var class="var">square</var>.
  13050. </p></dd>
  13051. </dl>
  13052. <a name="Commands-75"></a>
  13053. <h4 class="subsection">11.41.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-75" aria-hidden="true">TOC</a></span></h4>
  13054. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  13055. </p>
  13056. <a name="Examples-57"></a>
  13057. <h4 class="subsection">11.41.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-57" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-57" aria-hidden="true">TOC</a></span></h4>
  13058. <ul class="itemize mark-bullet">
  13059. <li>Apply sharpen:
  13060. <div class="example">
  13061. <pre class="example-preformatted">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;
  13062. </pre></div>
  13063. </li><li>Apply blur:
  13064. <div class="example">
  13065. <pre class="example-preformatted">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;
  13066. </pre></div>
  13067. </li><li>Apply edge enhance:
  13068. <div class="example">
  13069. <pre class="example-preformatted">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;
  13070. </pre></div>
  13071. </li><li>Apply edge detect:
  13072. <div class="example">
  13073. <pre class="example-preformatted">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;
  13074. </pre></div>
  13075. </li><li>Apply laplacian edge detector which includes diagonals:
  13076. <div class="example">
  13077. <pre class="example-preformatted">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;
  13078. </pre></div>
  13079. </li><li>Apply emboss:
  13080. <div class="example">
  13081. <pre class="example-preformatted">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;
  13082. </pre></div>
  13083. </li></ul>
  13084. <a name="convolve"></a>
  13085. <h3 class="section">11.42 convolve<span class="pull-right"><a class="anchor hidden-xs" href="#convolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolve" aria-hidden="true">TOC</a></span></h3>
  13086. <p>Apply 2D convolution of video stream in frequency domain using second stream
  13087. as impulse.
  13088. </p>
  13089. <p>The filter accepts the following options:
  13090. </p>
  13091. <dl class="table">
  13092. <dt><samp class="option">planes</samp></dt>
  13093. <dd><p>Set which planes to process.
  13094. </p>
  13095. </dd>
  13096. <dt><samp class="option">impulse</samp></dt>
  13097. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  13098. or <var class="var">all</var>. Default is <var class="var">all</var>.
  13099. </p></dd>
  13100. </dl>
  13101. <p>The <code class="code">convolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  13102. </p>
  13103. <a name="copy"></a>
  13104. <h3 class="section">11.43 copy<span class="pull-right"><a class="anchor hidden-xs" href="#copy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-copy" aria-hidden="true">TOC</a></span></h3>
  13105. <p>Copy the input video source unchanged to the output. This is mainly useful for
  13106. testing purposes.
  13107. </p>
  13108. <a class="anchor" id="coreimage"></a><a name="coreimage-1"></a>
  13109. <h3 class="section">11.44 coreimage<span class="pull-right"><a class="anchor hidden-xs" href="#coreimage-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimage-1" aria-hidden="true">TOC</a></span></h3>
  13110. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  13111. </p>
  13112. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  13113. processed by video hardware. However, software-based OpenGL implementations
  13114. exist which means there is no guarantee for hardware processing. It depends on
  13115. the respective OSX.
  13116. </p>
  13117. <p>There are many filters and image generators provided by Apple that come with a
  13118. large variety of options. The filter has to be referenced by its name along
  13119. with its options.
  13120. </p>
  13121. <p>The coreimage filter accepts the following options:
  13122. </p><dl class="table">
  13123. <dt><samp class="option">list_filters</samp></dt>
  13124. <dd><p>List all available filters and generators along with all their respective
  13125. options as well as possible minimum and maximum values along with the default
  13126. values.
  13127. </p><div class="example">
  13128. <pre class="example-preformatted">list_filters=true
  13129. </pre></div>
  13130. </dd>
  13131. <dt><samp class="option">filter</samp></dt>
  13132. <dd><p>Specify all filters by their respective name and options.
  13133. Use <var class="var">list_filters</var> to determine all valid filter names and options.
  13134. Numerical options are specified by a float value and are automatically clamped
  13135. to their respective value range. Vector and color options have to be specified
  13136. by a list of space separated float values. Character escaping has to be done.
  13137. A special option name <code class="code">default</code> is available to use default options for a
  13138. filter.
  13139. </p>
  13140. <p>It is required to specify either <code class="code">default</code> or at least one of the filter options.
  13141. All omitted options are used with their default values.
  13142. The syntax of the filter string is as follows:
  13143. </p><div class="example">
  13144. <pre class="example-preformatted">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;][@...]][#...]
  13145. </pre></div>
  13146. </dd>
  13147. <dt><samp class="option">output_rect</samp></dt>
  13148. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  13149. input image. It is given by a list of space separated float values:
  13150. </p><div class="example">
  13151. <pre class="example-preformatted">output_rect=x\ y\ width\ height
  13152. </pre></div>
  13153. <p>If not given, the output rectangle equals the dimensions of the input image.
  13154. The output rectangle is automatically cropped at the borders of the input
  13155. image. Negative values are valid for each component.
  13156. </p><div class="example">
  13157. <pre class="example-preformatted">output_rect=25\ 25\ 100\ 100
  13158. </pre></div>
  13159. </dd>
  13160. </dl>
  13161. <p>Several filters can be chained for successive processing without GPU-HOST
  13162. transfers allowing for fast processing of complex filter chains.
  13163. Currently, only filters with zero (generators) or exactly one (filters) input
  13164. image and one output image are supported. Also, transition filters are not yet
  13165. usable as intended.
  13166. </p>
  13167. <p>Some filters generate output images with additional padding depending on the
  13168. respective filter kernel. The padding is automatically removed to ensure the
  13169. filter output has the same size as the input image.
  13170. </p>
  13171. <p>For image generators, the size of the output image is determined by the
  13172. previous output image of the filter chain or the input image of the whole
  13173. filterchain, respectively. The generators do not use the pixel information of
  13174. this image to generate their output. However, the generated output is
  13175. blended onto this image, resulting in partial or complete coverage of the
  13176. output image.
  13177. </p>
  13178. <p>The <a class="ref" href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  13179. which are directly fed into the filter chain. By using it, providing input
  13180. images by another video source or an input video is not required.
  13181. </p>
  13182. <a name="Examples-58"></a>
  13183. <h4 class="subsection">11.44.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-58" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-58" aria-hidden="true">TOC</a></span></h4>
  13184. <ul class="itemize mark-bullet">
  13185. <li>List all filters available:
  13186. <div class="example">
  13187. <pre class="example-preformatted">coreimage=list_filters=true
  13188. </pre></div>
  13189. </li><li>Use the CIBoxBlur filter with default options to blur an image:
  13190. <div class="example">
  13191. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default
  13192. </pre></div>
  13193. </li><li>Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  13194. its center at 100x100 and a radius of 50 pixels:
  13195. <div class="example">
  13196. <pre class="example-preformatted">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  13197. </pre></div>
  13198. </li><li>Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  13199. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  13200. <div class="example">
  13201. <pre class="example-preformatted">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  13202. </pre></div>
  13203. </li></ul>
  13204. <a name="corr"></a>
  13205. <h3 class="section">11.45 corr<span class="pull-right"><a class="anchor hidden-xs" href="#corr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-corr" aria-hidden="true">TOC</a></span></h3>
  13206. <p>Obtain the correlation between two input videos.
  13207. </p>
  13208. <p>This filter takes two input videos.
  13209. </p>
  13210. <p>Both input videos must have the same resolution and pixel format for
  13211. this filter to work correctly. Also it assumes that both inputs
  13212. have the same number of frames, which are compared one by one.
  13213. </p>
  13214. <p>The obtained per component, average, min and max correlation is printed through
  13215. the logging system.
  13216. </p>
  13217. <p>The filter stores the calculated correlation of each frame in frame metadata.
  13218. </p>
  13219. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  13220. </p>
  13221. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  13222. with the reference file <samp class="file">ref.mpg</samp>.
  13223. </p>
  13224. <div class="example">
  13225. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi corr -f null -
  13226. </pre></div>
  13227. <a name="cover_005frect"></a>
  13228. <h3 class="section">11.46 cover_rect<span class="pull-right"><a class="anchor hidden-xs" href="#cover_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cover_005frect" aria-hidden="true">TOC</a></span></h3>
  13229. <p>Cover a rectangular object
  13230. </p>
  13231. <p>It accepts the following options:
  13232. </p>
  13233. <dl class="table">
  13234. <dt><samp class="option">cover</samp></dt>
  13235. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  13236. </p>
  13237. </dd>
  13238. <dt><samp class="option">mode</samp></dt>
  13239. <dd><p>Set covering mode.
  13240. </p>
  13241. <p>It accepts the following values:
  13242. </p><dl class="table">
  13243. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  13244. <dd><p>cover it by the supplied image
  13245. </p></dd>
  13246. <dt>&lsquo;<samp class="samp">blur</samp>&rsquo;</dt>
  13247. <dd><p>cover it by interpolating the surrounding pixels
  13248. </p></dd>
  13249. </dl>
  13250. <p>Default value is <var class="var">blur</var>.
  13251. </p></dd>
  13252. </dl>
  13253. <a name="Examples-59"></a>
  13254. <h4 class="subsection">11.46.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-59" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-59" aria-hidden="true">TOC</a></span></h4>
  13255. <ul class="itemize mark-bullet">
  13256. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  13257. <div class="example">
  13258. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  13259. </pre></div>
  13260. </li></ul>
  13261. <a name="crop"></a>
  13262. <h3 class="section">11.47 crop<span class="pull-right"><a class="anchor hidden-xs" href="#crop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-crop" aria-hidden="true">TOC</a></span></h3>
  13263. <p>Crop the input video to given dimensions.
  13264. </p>
  13265. <p>It accepts the following parameters:
  13266. </p>
  13267. <dl class="table">
  13268. <dt><samp class="option">w, out_w</samp></dt>
  13269. <dd><p>The width of the output video. It defaults to <code class="code">iw</code>.
  13270. This expression is evaluated only once during the filter
  13271. configuration, or when the &lsquo;<samp class="samp">w</samp>&rsquo; or &lsquo;<samp class="samp">out_w</samp>&rsquo; command is sent.
  13272. </p>
  13273. </dd>
  13274. <dt><samp class="option">h, out_h</samp></dt>
  13275. <dd><p>The height of the output video. It defaults to <code class="code">ih</code>.
  13276. This expression is evaluated only once during the filter
  13277. configuration, or when the &lsquo;<samp class="samp">h</samp>&rsquo; or &lsquo;<samp class="samp">out_h</samp>&rsquo; command is sent.
  13278. </p>
  13279. </dd>
  13280. <dt><samp class="option">x</samp></dt>
  13281. <dd><p>The horizontal position, in the input video, of the left edge of the output
  13282. video. It defaults to <code class="code">(in_w-out_w)/2</code>.
  13283. This expression is evaluated per-frame.
  13284. </p>
  13285. </dd>
  13286. <dt><samp class="option">y</samp></dt>
  13287. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  13288. It defaults to <code class="code">(in_h-out_h)/2</code>.
  13289. This expression is evaluated per-frame.
  13290. </p>
  13291. </dd>
  13292. <dt><samp class="option">keep_aspect</samp></dt>
  13293. <dd><p>If set to 1 will force the output display aspect ratio
  13294. to be the same of the input, by changing the output sample aspect
  13295. ratio. It defaults to 0.
  13296. </p>
  13297. </dd>
  13298. <dt><samp class="option">exact</samp></dt>
  13299. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  13300. width/height/x/y as specified and will not be rounded to nearest smaller value.
  13301. It defaults to 0.
  13302. </p></dd>
  13303. </dl>
  13304. <p>The <var class="var">out_w</var>, <var class="var">out_h</var>, <var class="var">x</var>, <var class="var">y</var> parameters are
  13305. expressions containing the following constants:
  13306. </p>
  13307. <dl class="table">
  13308. <dt><samp class="option">x</samp></dt>
  13309. <dt><samp class="option">y</samp></dt>
  13310. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  13311. each new frame.
  13312. </p>
  13313. </dd>
  13314. <dt><samp class="option">in_w</samp></dt>
  13315. <dt><samp class="option">in_h</samp></dt>
  13316. <dd><p>The input width and height.
  13317. </p>
  13318. </dd>
  13319. <dt><samp class="option">iw</samp></dt>
  13320. <dt><samp class="option">ih</samp></dt>
  13321. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  13322. </p>
  13323. </dd>
  13324. <dt><samp class="option">out_w</samp></dt>
  13325. <dt><samp class="option">out_h</samp></dt>
  13326. <dd><p>The output (cropped) width and height.
  13327. </p>
  13328. </dd>
  13329. <dt><samp class="option">ow</samp></dt>
  13330. <dt><samp class="option">oh</samp></dt>
  13331. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  13332. </p>
  13333. </dd>
  13334. <dt><samp class="option">a</samp></dt>
  13335. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  13336. </p>
  13337. </dd>
  13338. <dt><samp class="option">sar</samp></dt>
  13339. <dd><p>input sample aspect ratio
  13340. </p>
  13341. </dd>
  13342. <dt><samp class="option">dar</samp></dt>
  13343. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  13344. </p>
  13345. </dd>
  13346. <dt><samp class="option">hsub</samp></dt>
  13347. <dt><samp class="option">vsub</samp></dt>
  13348. <dd><p>horizontal and vertical chroma subsample values. For example for the
  13349. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  13350. </p>
  13351. </dd>
  13352. <dt><samp class="option">n</samp></dt>
  13353. <dd><p>The number of the input frame, starting from 0.
  13354. </p>
  13355. </dd>
  13356. <dt><samp class="option">pos</samp></dt>
  13357. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  13358. do not use
  13359. </p>
  13360. </dd>
  13361. <dt><samp class="option">t</samp></dt>
  13362. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  13363. </p>
  13364. </dd>
  13365. </dl>
  13366. <p>The expression for <var class="var">out_w</var> may depend on the value of <var class="var">out_h</var>,
  13367. and the expression for <var class="var">out_h</var> may depend on <var class="var">out_w</var>, but they
  13368. cannot depend on <var class="var">x</var> and <var class="var">y</var>, as <var class="var">x</var> and <var class="var">y</var> are
  13369. evaluated after <var class="var">out_w</var> and <var class="var">out_h</var>.
  13370. </p>
  13371. <p>The <var class="var">x</var> and <var class="var">y</var> parameters specify the expressions for the
  13372. position of the top-left corner of the output (non-cropped) area. They
  13373. are evaluated for each frame. If the evaluated value is not valid, it
  13374. is approximated to the nearest valid value.
  13375. </p>
  13376. <p>The expression for <var class="var">x</var> may depend on <var class="var">y</var>, and the expression
  13377. for <var class="var">y</var> may depend on <var class="var">x</var>.
  13378. </p>
  13379. <a name="Examples-60"></a>
  13380. <h4 class="subsection">11.47.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-60" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-60" aria-hidden="true">TOC</a></span></h4>
  13381. <ul class="itemize mark-bullet">
  13382. <li>Crop area with size 100x100 at position (12,34).
  13383. <div class="example">
  13384. <pre class="example-preformatted">crop=100:100:12:34
  13385. </pre></div>
  13386. <p>Using named options, the example above becomes:
  13387. </p><div class="example">
  13388. <pre class="example-preformatted">crop=w=100:h=100:x=12:y=34
  13389. </pre></div>
  13390. </li><li>Crop the central input area with size 100x100:
  13391. <div class="example">
  13392. <pre class="example-preformatted">crop=100:100
  13393. </pre></div>
  13394. </li><li>Crop the central input area with size 2/3 of the input video:
  13395. <div class="example">
  13396. <pre class="example-preformatted">crop=2/3*in_w:2/3*in_h
  13397. </pre></div>
  13398. </li><li>Crop the input video central square:
  13399. <div class="example">
  13400. <pre class="example-preformatted">crop=out_w=in_h
  13401. crop=in_h
  13402. </pre></div>
  13403. </li><li>Delimit the rectangle with the top-left corner placed at position
  13404. 100:100 and the right-bottom corner corresponding to the right-bottom
  13405. corner of the input image.
  13406. <div class="example">
  13407. <pre class="example-preformatted">crop=in_w-100:in_h-100:100:100
  13408. </pre></div>
  13409. </li><li>Crop 10 pixels from the left and right borders, and 20 pixels from
  13410. the top and bottom borders
  13411. <div class="example">
  13412. <pre class="example-preformatted">crop=in_w-2*10:in_h-2*20
  13413. </pre></div>
  13414. </li><li>Keep only the bottom right quarter of the input image:
  13415. <div class="example">
  13416. <pre class="example-preformatted">crop=in_w/2:in_h/2:in_w/2:in_h/2
  13417. </pre></div>
  13418. </li><li>Crop height for getting Greek harmony:
  13419. <div class="example">
  13420. <pre class="example-preformatted">crop=in_w:1/PHI*in_w
  13421. </pre></div>
  13422. </li><li>Apply trembling effect:
  13423. <div class="example">
  13424. <pre class="example-preformatted">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)
  13425. </pre></div>
  13426. </li><li>Apply erratic camera effect depending on timestamp:
  13427. <div class="example">
  13428. <pre class="example-preformatted">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)
  13429. </pre></div>
  13430. </li><li>Set x depending on the value of y:
  13431. <div class="example">
  13432. <pre class="example-preformatted">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  13433. </pre></div>
  13434. </li></ul>
  13435. <a name="Commands-76"></a>
  13436. <h4 class="subsection">11.47.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-76" aria-hidden="true">TOC</a></span></h4>
  13437. <p>This filter supports the following commands:
  13438. </p><dl class="table">
  13439. <dt><samp class="option">w, out_w</samp></dt>
  13440. <dt><samp class="option">h, out_h</samp></dt>
  13441. <dt><samp class="option">x</samp></dt>
  13442. <dt><samp class="option">y</samp></dt>
  13443. <dd><p>Set width/height of the output video and the horizontal/vertical position
  13444. in the input video.
  13445. The command accepts the same syntax of the corresponding option.
  13446. </p>
  13447. <p>If the specified expression is not valid, it is kept at its current
  13448. value.
  13449. </p></dd>
  13450. </dl>
  13451. <a name="cropdetect"></a>
  13452. <h3 class="section">11.48 cropdetect<span class="pull-right"><a class="anchor hidden-xs" href="#cropdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cropdetect" aria-hidden="true">TOC</a></span></h3>
  13453. <p>Auto-detect the crop size.
  13454. </p>
  13455. <p>It calculates the necessary cropping parameters and prints the
  13456. recommended parameters via the logging system. The detected dimensions
  13457. correspond to the non-black or video area of the input video according to <var class="var">mode</var>.
  13458. </p>
  13459. <p>It accepts the following parameters:
  13460. </p>
  13461. <dl class="table">
  13462. <dt><samp class="option">mode</samp></dt>
  13463. <dd><p>Depending on <var class="var">mode</var> crop detection is based on either the mere black value of surrounding pixels or a combination of motion vectors and edge pixels.
  13464. </p>
  13465. <dl class="table">
  13466. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  13467. <dd><p>Detect black pixels surrounding the playing video. For fine control use option <var class="var">limit</var>.
  13468. </p>
  13469. </dd>
  13470. <dt>&lsquo;<samp class="samp">mvedges</samp>&rsquo;</dt>
  13471. <dd><p>Detect the playing video by the motion vectors inside the video and scanning for edge pixels typically forming the border of a playing video.
  13472. </p></dd>
  13473. </dl>
  13474. </dd>
  13475. <dt><samp class="option">limit</samp></dt>
  13476. <dd><p>Set higher black value threshold, which can be optionally specified
  13477. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  13478. value greater to the set value is considered non-black. It defaults to 24.
  13479. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  13480. on the bitdepth of the pixel format.
  13481. </p>
  13482. </dd>
  13483. <dt><samp class="option">round</samp></dt>
  13484. <dd><p>The value which the width/height should be divisible by. It defaults to
  13485. 16. The offset is automatically adjusted to center the video. Use 2 to
  13486. get only even dimensions (needed for 4:2:2 video). 16 is best when
  13487. encoding to most video codecs.
  13488. </p>
  13489. </dd>
  13490. <dt><samp class="option">skip</samp></dt>
  13491. <dd><p>Set the number of initial frames for which evaluation is skipped.
  13492. Default is 2. Range is 0 to INT_MAX.
  13493. </p>
  13494. </dd>
  13495. <dt><samp class="option">reset_count, reset</samp></dt>
  13496. <dd><p>Set the counter that determines after how many frames cropdetect will
  13497. reset the previously detected largest video area and start over to
  13498. detect the current optimal crop area. Default value is 0.
  13499. </p>
  13500. <p>This can be useful when channel logos distort the video area. 0
  13501. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  13502. playback.
  13503. </p>
  13504. </dd>
  13505. <dt><samp class="option">mv_threshold</samp></dt>
  13506. <dd><p>Set motion in pixel units as threshold for motion detection. It defaults to 8.
  13507. </p>
  13508. </dd>
  13509. <dt><samp class="option">low</samp></dt>
  13510. <dt><samp class="option">high</samp></dt>
  13511. <dd><p>Set low and high threshold values used by the Canny thresholding
  13512. algorithm.
  13513. </p>
  13514. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  13515. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  13516. by the low threshold.
  13517. </p>
  13518. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  13519. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  13520. </p>
  13521. <p>Default value for <var class="var">low</var> is <code class="code">5/255</code>, and default value for <var class="var">high</var>
  13522. is <code class="code">15/255</code>.
  13523. </p></dd>
  13524. </dl>
  13525. <a name="Examples-61"></a>
  13526. <h4 class="subsection">11.48.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-61" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-61" aria-hidden="true">TOC</a></span></h4>
  13527. <ul class="itemize mark-bullet">
  13528. <li>Find video area surrounded by black borders:
  13529. <div class="example">
  13530. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf cropdetect,metadata=mode=print -f null -
  13531. </pre></div>
  13532. </li><li>Find an embedded video area, generate motion vectors beforehand:
  13533. <div class="example">
  13534. <pre class="example-preformatted">ffmpeg -i file.mp4 -vf mestimate,cropdetect=mode=mvedges,metadata=mode=print -f null -
  13535. </pre></div>
  13536. </li><li>Find an embedded video area, use motion vectors from decoder:
  13537. <div class="example">
  13538. <pre class="example-preformatted">ffmpeg -flags2 +export_mvs -i file.mp4 -vf cropdetect=mode=mvedges,metadata=mode=print -f null -
  13539. </pre></div>
  13540. </li></ul>
  13541. <a name="Commands-77"></a>
  13542. <h4 class="subsection">11.48.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-77" aria-hidden="true">TOC</a></span></h4>
  13543. <p>This filter supports the following commands:
  13544. </p>
  13545. <dl class="table">
  13546. <dt><samp class="option">limit</samp></dt>
  13547. <dd><p>The command accepts the same syntax of the corresponding option.
  13548. If the specified expression is not valid, it is kept at its current value.
  13549. </p></dd>
  13550. </dl>
  13551. <a class="anchor" id="cue"></a><a name="cue-1"></a>
  13552. <h3 class="section">11.49 cue<span class="pull-right"><a class="anchor hidden-xs" href="#cue-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cue-1" aria-hidden="true">TOC</a></span></h3>
  13553. <p>Delay video filtering until a given wallclock timestamp. The filter first
  13554. passes on <samp class="option">preroll</samp> amount of frames, then it buffers at most
  13555. <samp class="option">buffer</samp> amount of frames and waits for the cue. After reaching the cue
  13556. it forwards the buffered frames and also any subsequent frames coming in its
  13557. input.
  13558. </p>
  13559. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  13560. realtime output devices like decklink. By putting the delay in the filtering
  13561. chain and pre-buffering frames the process can pass on data to output almost
  13562. immediately after the target wallclock timestamp is reached.
  13563. </p>
  13564. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  13565. some use cases.
  13566. </p>
  13567. <dl class="table">
  13568. <dt><samp class="option">cue</samp></dt>
  13569. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  13570. </p>
  13571. </dd>
  13572. <dt><samp class="option">preroll</samp></dt>
  13573. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  13574. </p>
  13575. </dd>
  13576. <dt><samp class="option">buffer</samp></dt>
  13577. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  13578. in seconds. Default is 0.
  13579. </p>
  13580. </dd>
  13581. </dl>
  13582. <a class="anchor" id="curves"></a><a name="curves-1"></a>
  13583. <h3 class="section">11.50 curves<span class="pull-right"><a class="anchor hidden-xs" href="#curves-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-curves-1" aria-hidden="true">TOC</a></span></h3>
  13584. <p>Apply color adjustments using curves.
  13585. </p>
  13586. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  13587. component (red, green and blue) has its values defined by <var class="var">N</var> key points
  13588. tied from each other using a smooth curve. The x-axis represents the pixel
  13589. values from the input frame, and the y-axis the new pixel values to be set for
  13590. the output frame.
  13591. </p>
  13592. <p>By default, a component curve is defined by the two points <var class="var">(0;0)</var> and
  13593. <var class="var">(1;1)</var>. This creates a straight line where each original pixel value is
  13594. &quot;adjusted&quot; to its own value, which means no change to the image.
  13595. </p>
  13596. <p>The filter allows you to redefine these two points and add some more. A new
  13597. curve will be defined to pass smoothly through all these new coordinates. The
  13598. new defined points need to be strictly increasing over the x-axis, and their
  13599. <var class="var">x</var> and <var class="var">y</var> values must be in the <var class="var">[0;1]</var> interval. The curve is
  13600. formed by using a natural or monotonic cubic spline interpolation, depending
  13601. on the <var class="var">interp</var> option (default: <code class="code">natural</code>). The <code class="code">natural</code>
  13602. spline produces a smoother curve in general while the monotonic (<code class="code">pchip</code>)
  13603. spline guarantees the transitions between the specified points to be
  13604. monotonic. If the computed curves happened to go outside the vector spaces,
  13605. the values will be clipped accordingly.
  13606. </p>
  13607. <p>The filter accepts the following options:
  13608. </p>
  13609. <dl class="table">
  13610. <dt><samp class="option">preset</samp></dt>
  13611. <dd><p>Select one of the available color presets. This option can be used in addition
  13612. to the <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> parameters; in this case, the later
  13613. options takes priority on the preset values.
  13614. Available presets are:
  13615. </p><dl class="table">
  13616. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  13617. <dt>&lsquo;<samp class="samp">color_negative</samp>&rsquo;</dt>
  13618. <dt>&lsquo;<samp class="samp">cross_process</samp>&rsquo;</dt>
  13619. <dt>&lsquo;<samp class="samp">darker</samp>&rsquo;</dt>
  13620. <dt>&lsquo;<samp class="samp">increase_contrast</samp>&rsquo;</dt>
  13621. <dt>&lsquo;<samp class="samp">lighter</samp>&rsquo;</dt>
  13622. <dt>&lsquo;<samp class="samp">linear_contrast</samp>&rsquo;</dt>
  13623. <dt>&lsquo;<samp class="samp">medium_contrast</samp>&rsquo;</dt>
  13624. <dt>&lsquo;<samp class="samp">negative</samp>&rsquo;</dt>
  13625. <dt>&lsquo;<samp class="samp">strong_contrast</samp>&rsquo;</dt>
  13626. <dt>&lsquo;<samp class="samp">vintage</samp>&rsquo;</dt>
  13627. </dl>
  13628. <p>Default is <code class="code">none</code>.
  13629. </p></dd>
  13630. <dt><samp class="option">master, m</samp></dt>
  13631. <dd><p>Set the master key points. These points will define a second pass mapping. It
  13632. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  13633. <samp class="option">r</samp>, <samp class="option">g</samp>, <samp class="option">b</samp> or <samp class="option">all</samp> since it acts like a
  13634. post-processing LUT.
  13635. </p></dd>
  13636. <dt><samp class="option">red, r</samp></dt>
  13637. <dd><p>Set the key points for the red component.
  13638. </p></dd>
  13639. <dt><samp class="option">green, g</samp></dt>
  13640. <dd><p>Set the key points for the green component.
  13641. </p></dd>
  13642. <dt><samp class="option">blue, b</samp></dt>
  13643. <dd><p>Set the key points for the blue component.
  13644. </p></dd>
  13645. <dt><samp class="option">all</samp></dt>
  13646. <dd><p>Set the key points for all components (not including master).
  13647. Can be used in addition to the other key points component
  13648. options. In this case, the unset component(s) will fallback on this
  13649. <samp class="option">all</samp> setting.
  13650. </p></dd>
  13651. <dt><samp class="option">psfile</samp></dt>
  13652. <dd><p>Specify a Photoshop curves file (<code class="code">.acv</code>) to import the settings from.
  13653. </p></dd>
  13654. <dt><samp class="option">plot</samp></dt>
  13655. <dd><p>Save Gnuplot script of the curves in specified file.
  13656. </p></dd>
  13657. <dt><samp class="option">interp</samp></dt>
  13658. <dd><p>Specify the kind of interpolation. Available algorithms are:
  13659. </p><dl class="table">
  13660. <dt>&lsquo;<samp class="samp">natural</samp>&rsquo;</dt>
  13661. <dd><p>Natural cubic spline using a piece-wise cubic polynomial that is twice continuously differentiable.
  13662. </p></dd>
  13663. <dt>&lsquo;<samp class="samp">pchip</samp>&rsquo;</dt>
  13664. <dd><p>Monotonic cubic spline using a piecewise cubic Hermite interpolating polynomial (PCHIP).
  13665. </p></dd>
  13666. </dl>
  13667. </dd>
  13668. </dl>
  13669. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  13670. defined using the following syntax: <code class="code">x0/y0 x1/y1 x2/y2 ...</code>.
  13671. </p>
  13672. <a name="Commands-78"></a>
  13673. <h4 class="subsection">11.50.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-78" aria-hidden="true">TOC</a></span></h4>
  13674. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  13675. </p>
  13676. <a name="Examples-62"></a>
  13677. <h4 class="subsection">11.50.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-62" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-62" aria-hidden="true">TOC</a></span></h4>
  13678. <ul class="itemize mark-bullet">
  13679. <li>Increase slightly the middle level of blue:
  13680. <div class="example">
  13681. <pre class="example-preformatted">curves=blue='0/0 0.5/0.58 1/1'
  13682. </pre></div>
  13683. </li><li>Vintage effect:
  13684. <div class="example">
  13685. <pre class="example-preformatted">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'
  13686. </pre></div>
  13687. <p>Here we obtain the following coordinates for each components:
  13688. </p><dl class="table">
  13689. <dt><var class="var">red</var></dt>
  13690. <dd><p><code class="code">(0;0.11) (0.42;0.51) (1;0.95)</code>
  13691. </p></dd>
  13692. <dt><var class="var">green</var></dt>
  13693. <dd><p><code class="code">(0;0) (0.50;0.48) (1;1)</code>
  13694. </p></dd>
  13695. <dt><var class="var">blue</var></dt>
  13696. <dd><p><code class="code">(0;0.22) (0.49;0.44) (1;0.80)</code>
  13697. </p></dd>
  13698. </dl>
  13699. </li><li>The previous example can also be achieved with the associated built-in preset:
  13700. <div class="example">
  13701. <pre class="example-preformatted">curves=preset=vintage
  13702. </pre></div>
  13703. </li><li>Or simply:
  13704. <div class="example">
  13705. <pre class="example-preformatted">curves=vintage
  13706. </pre></div>
  13707. </li><li>Use a Photoshop preset and redefine the points of the green component:
  13708. <div class="example">
  13709. <pre class="example-preformatted">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  13710. </pre></div>
  13711. </li><li>Check out the curves of the <code class="code">cross_process</code> profile using <code class="command">ffmpeg</code>
  13712. and <code class="command">gnuplot</code>:
  13713. <div class="example">
  13714. <pre class="example-preformatted">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  13715. gnuplot -p /tmp/curves.plt
  13716. </pre></div>
  13717. </li></ul>
  13718. <a name="datascope"></a>
  13719. <h3 class="section">11.51 datascope<span class="pull-right"><a class="anchor hidden-xs" href="#datascope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-datascope" aria-hidden="true">TOC</a></span></h3>
  13720. <p>Video data analysis filter.
  13721. </p>
  13722. <p>This filter shows hexadecimal pixel values of part of video.
  13723. </p>
  13724. <p>The filter accepts the following options:
  13725. </p>
  13726. <dl class="table">
  13727. <dt><samp class="option">size, s</samp></dt>
  13728. <dd><p>Set output video size.
  13729. </p>
  13730. </dd>
  13731. <dt><samp class="option">x</samp></dt>
  13732. <dd><p>Set x offset from where to pick pixels.
  13733. </p>
  13734. </dd>
  13735. <dt><samp class="option">y</samp></dt>
  13736. <dd><p>Set y offset from where to pick pixels.
  13737. </p>
  13738. </dd>
  13739. <dt><samp class="option">mode</samp></dt>
  13740. <dd><p>Set scope mode, can be one of the following:
  13741. </p><dl class="table">
  13742. <dt>&lsquo;<samp class="samp">mono</samp>&rsquo;</dt>
  13743. <dd><p>Draw hexadecimal pixel values with white color on black background.
  13744. </p>
  13745. </dd>
  13746. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  13747. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  13748. background.
  13749. </p>
  13750. </dd>
  13751. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  13752. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  13753. the text color is picked in such way so its always visible.
  13754. </p></dd>
  13755. </dl>
  13756. </dd>
  13757. <dt><samp class="option">axis</samp></dt>
  13758. <dd><p>Draw rows and columns numbers on left and top of video.
  13759. </p>
  13760. </dd>
  13761. <dt><samp class="option">opacity</samp></dt>
  13762. <dd><p>Set background opacity.
  13763. </p>
  13764. </dd>
  13765. <dt><samp class="option">format</samp></dt>
  13766. <dd><p>Set display number format. Can be <code class="code">hex</code>, or <code class="code">dec</code>. Default is <code class="code">hex</code>.
  13767. </p>
  13768. </dd>
  13769. <dt><samp class="option">components</samp></dt>
  13770. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  13771. </p></dd>
  13772. </dl>
  13773. <a name="Commands-79"></a>
  13774. <h4 class="subsection">11.51.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-79" aria-hidden="true">TOC</a></span></h4>
  13775. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options excluding <code class="code">size</code> option.
  13776. </p>
  13777. <a name="dblur"></a>
  13778. <h3 class="section">11.52 dblur<span class="pull-right"><a class="anchor hidden-xs" href="#dblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dblur" aria-hidden="true">TOC</a></span></h3>
  13779. <p>Apply Directional blur filter.
  13780. </p>
  13781. <p>The filter accepts the following options:
  13782. </p>
  13783. <dl class="table">
  13784. <dt><samp class="option">angle</samp></dt>
  13785. <dd><p>Set angle of directional blur. Default is <code class="code">45</code>.
  13786. </p>
  13787. </dd>
  13788. <dt><samp class="option">radius</samp></dt>
  13789. <dd><p>Set radius of directional blur. Default is <code class="code">5</code>.
  13790. </p>
  13791. </dd>
  13792. <dt><samp class="option">planes</samp></dt>
  13793. <dd><p>Set which planes to filter. By default all planes are filtered.
  13794. </p></dd>
  13795. </dl>
  13796. <a name="Commands-80"></a>
  13797. <h4 class="subsection">11.52.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-80" aria-hidden="true">TOC</a></span></h4>
  13798. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  13799. The command accepts the same syntax of the corresponding option.
  13800. </p>
  13801. <p>If the specified expression is not valid, it is kept at its current
  13802. value.
  13803. </p>
  13804. <a name="dctdnoiz"></a>
  13805. <h3 class="section">11.53 dctdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#dctdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dctdnoiz" aria-hidden="true">TOC</a></span></h3>
  13806. <p>Denoise frames using 2D DCT (frequency domain filtering).
  13807. </p>
  13808. <p>This filter is not designed for real time.
  13809. </p>
  13810. <p>The filter accepts the following options:
  13811. </p>
  13812. <dl class="table">
  13813. <dt><samp class="option">sigma, s</samp></dt>
  13814. <dd><p>Set the noise sigma constant.
  13815. </p>
  13816. <p>This <var class="var">sigma</var> defines a hard threshold of <code class="code">3 * sigma</code>; every DCT
  13817. coefficient (absolute value) below this threshold with be dropped.
  13818. </p>
  13819. <p>If you need a more advanced filtering, see <samp class="option">expr</samp>.
  13820. </p>
  13821. <p>Default is <code class="code">0</code>.
  13822. </p>
  13823. </dd>
  13824. <dt><samp class="option">overlap</samp></dt>
  13825. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  13826. may want to reduce this value, at the cost of a less effective filter and the
  13827. risk of various artefacts.
  13828. </p>
  13829. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  13830. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  13831. </p>
  13832. <p>Default value is <var class="var">blocksize</var>-1, which is the best possible setting.
  13833. </p>
  13834. </dd>
  13835. <dt><samp class="option">expr, e</samp></dt>
  13836. <dd><p>Set the coefficient factor expression.
  13837. </p>
  13838. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  13839. multiplier value for the coefficient.
  13840. </p>
  13841. <p>If this is option is set, the <samp class="option">sigma</samp> option will be ignored.
  13842. </p>
  13843. <p>The absolute value of the coefficient can be accessed through the <var class="var">c</var>
  13844. variable.
  13845. </p>
  13846. </dd>
  13847. <dt><samp class="option">n</samp></dt>
  13848. <dd><p>Set the <var class="var">blocksize</var> using the number of bits. <code class="code">1&lt;&lt;<var class="var">n</var></code> defines the
  13849. <var class="var">blocksize</var>, which is the width and height of the processed blocks.
  13850. </p>
  13851. <p>The default value is <var class="var">3</var> (8x8) and can be raised to <var class="var">4</var> for a
  13852. <var class="var">blocksize</var> of 16x16. Note that changing this setting has huge consequences
  13853. on the speed processing. Also, a larger block size does not necessarily means a
  13854. better de-noising.
  13855. </p></dd>
  13856. </dl>
  13857. <a name="Examples-63"></a>
  13858. <h4 class="subsection">11.53.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-63" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-63" aria-hidden="true">TOC</a></span></h4>
  13859. <p>Apply a denoise with a <samp class="option">sigma</samp> of <code class="code">4.5</code>:
  13860. </p><div class="example">
  13861. <pre class="example-preformatted">dctdnoiz=4.5
  13862. </pre></div>
  13863. <p>The same operation can be achieved using the expression system:
  13864. </p><div class="example">
  13865. <pre class="example-preformatted">dctdnoiz=e='gte(c, 4.5*3)'
  13866. </pre></div>
  13867. <p>Violent denoise using a block size of <code class="code">16x16</code>:
  13868. </p><div class="example">
  13869. <pre class="example-preformatted">dctdnoiz=15:n=4
  13870. </pre></div>
  13871. <a name="deband"></a>
  13872. <h3 class="section">11.54 deband<span class="pull-right"><a class="anchor hidden-xs" href="#deband" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deband" aria-hidden="true">TOC</a></span></h3>
  13873. <p>Remove banding artifacts from input video.
  13874. It works by replacing banded pixels with average value of referenced pixels.
  13875. </p>
  13876. <p>The filter accepts the following options:
  13877. </p>
  13878. <dl class="table">
  13879. <dt><samp class="option">1thr</samp></dt>
  13880. <dt><samp class="option">2thr</samp></dt>
  13881. <dt><samp class="option">3thr</samp></dt>
  13882. <dt><samp class="option">4thr</samp></dt>
  13883. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  13884. Valid range is 0.00003 to 0.5.
  13885. If difference between current pixel and reference pixel is less than threshold,
  13886. it will be considered as banded.
  13887. </p>
  13888. </dd>
  13889. <dt><samp class="option">range, r</samp></dt>
  13890. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  13891. in range 0 to set value will be used. If negative, exact absolute value
  13892. will be used.
  13893. The range defines square of four pixels around current pixel.
  13894. </p>
  13895. </dd>
  13896. <dt><samp class="option">direction, d</samp></dt>
  13897. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  13898. random direction from 0 to set direction will be picked. If negative, exact of
  13899. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  13900. will pick only pixels on same row and -PI/2 will pick only pixels on same
  13901. column.
  13902. </p>
  13903. </dd>
  13904. <dt><samp class="option">blur, b</samp></dt>
  13905. <dd><p>If enabled, current pixel is compared with average value of all four
  13906. surrounding pixels. The default is enabled. If disabled current pixel is
  13907. compared with all four surrounding pixels. The pixel is considered banded
  13908. if only all four differences with surrounding pixels are less than threshold.
  13909. </p>
  13910. </dd>
  13911. <dt><samp class="option">coupling, c</samp></dt>
  13912. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  13913. e.g. banding detection threshold is triggered for all color components.
  13914. The default is disabled.
  13915. </p></dd>
  13916. </dl>
  13917. <a name="Commands-81"></a>
  13918. <h4 class="subsection">11.54.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-81" aria-hidden="true">TOC</a></span></h4>
  13919. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  13920. </p>
  13921. <a name="deblock"></a>
  13922. <h3 class="section">11.55 deblock<span class="pull-right"><a class="anchor hidden-xs" href="#deblock" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deblock" aria-hidden="true">TOC</a></span></h3>
  13923. <p>Remove blocking artifacts from input video.
  13924. </p>
  13925. <p>The filter accepts the following options:
  13926. </p>
  13927. <dl class="table">
  13928. <dt><samp class="option">filter</samp></dt>
  13929. <dd><p>Set filter type, can be <var class="var">weak</var> or <var class="var">strong</var>. Default is <var class="var">strong</var>.
  13930. This controls what kind of deblocking is applied.
  13931. </p>
  13932. </dd>
  13933. <dt><samp class="option">block</samp></dt>
  13934. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var class="var">8</var>.
  13935. </p>
  13936. </dd>
  13937. <dt><samp class="option">alpha</samp></dt>
  13938. <dt><samp class="option">beta</samp></dt>
  13939. <dt><samp class="option">gamma</samp></dt>
  13940. <dt><samp class="option">delta</samp></dt>
  13941. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  13942. Defaults are: <var class="var">0.098</var> for <var class="var">alpha</var> and <var class="var">0.05</var> for the rest.
  13943. Using higher threshold gives more deblocking strength.
  13944. Setting <var class="var">alpha</var> controls threshold detection at exact edge of block.
  13945. Remaining options controls threshold detection near the edge. Each one for
  13946. below/above or left/right. Setting any of those to <var class="var">0</var> disables
  13947. deblocking.
  13948. </p>
  13949. </dd>
  13950. <dt><samp class="option">planes</samp></dt>
  13951. <dd><p>Set planes to filter. Default is to filter all available planes.
  13952. </p></dd>
  13953. </dl>
  13954. <a name="Examples-64"></a>
  13955. <h4 class="subsection">11.55.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-64" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-64" aria-hidden="true">TOC</a></span></h4>
  13956. <ul class="itemize mark-bullet">
  13957. <li>Deblock using weak filter and block size of 4 pixels.
  13958. <div class="example">
  13959. <pre class="example-preformatted">deblock=filter=weak:block=4
  13960. </pre></div>
  13961. </li><li>Deblock using strong filter, block size of 4 pixels and custom thresholds for
  13962. deblocking more edges.
  13963. <div class="example">
  13964. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  13965. </pre></div>
  13966. </li><li>Similar as above, but filter only first plane.
  13967. <div class="example">
  13968. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  13969. </pre></div>
  13970. </li><li>Similar as above, but filter only second and third plane.
  13971. <div class="example">
  13972. <pre class="example-preformatted">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  13973. </pre></div>
  13974. </li></ul>
  13975. <a name="Commands-82"></a>
  13976. <h4 class="subsection">11.55.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-82" aria-hidden="true">TOC</a></span></h4>
  13977. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  13978. </p>
  13979. <a class="anchor" id="decimate"></a><a name="decimate-1"></a>
  13980. <h3 class="section">11.56 decimate<span class="pull-right"><a class="anchor hidden-xs" href="#decimate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-decimate-1" aria-hidden="true">TOC</a></span></h3>
  13981. <p>Drop duplicated frames at regular intervals.
  13982. </p>
  13983. <p>The filter accepts the following options:
  13984. </p>
  13985. <dl class="table">
  13986. <dt><samp class="option">cycle</samp></dt>
  13987. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  13988. <var class="var">N</var> means one frame in every batch of <var class="var">N</var> frames will be dropped.
  13989. Default is <code class="code">5</code>.
  13990. </p>
  13991. </dd>
  13992. <dt><samp class="option">dupthresh</samp></dt>
  13993. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  13994. is less than or equal to this value, then it is declared as duplicate. Default
  13995. is <code class="code">1.1</code>
  13996. </p>
  13997. </dd>
  13998. <dt><samp class="option">scthresh</samp></dt>
  13999. <dd><p>Set scene change threshold. Default is <code class="code">15</code>.
  14000. </p>
  14001. </dd>
  14002. <dt><samp class="option">blockx</samp></dt>
  14003. <dt><samp class="option">blocky</samp></dt>
  14004. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  14005. Larger blocks give better noise suppression, but also give worse detection of
  14006. small movements. Must be a power of two. Default is <code class="code">32</code>.
  14007. </p>
  14008. </dd>
  14009. <dt><samp class="option">ppsrc</samp></dt>
  14010. <dd><p>Mark main input as a pre-processed input and activate clean source input
  14011. stream. This allows the input to be pre-processed with various filters to help
  14012. the metrics calculation while keeping the frame selection lossless. When set to
  14013. <code class="code">1</code>, the first stream is for the pre-processed input, and the second
  14014. stream is the clean source from where the kept frames are chosen. Default is
  14015. <code class="code">0</code>.
  14016. </p>
  14017. </dd>
  14018. <dt><samp class="option">chroma</samp></dt>
  14019. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  14020. <code class="code">1</code>.
  14021. </p>
  14022. </dd>
  14023. <dt><samp class="option">mixed</samp></dt>
  14024. <dd><p>Set whether or not the input only partially contains content to be decimated.
  14025. Default is <code class="code">false</code>.
  14026. If enabled video output stream will be in variable frame rate.
  14027. </p></dd>
  14028. </dl>
  14029. <a name="deconvolve"></a>
  14030. <h3 class="section">11.57 deconvolve<span class="pull-right"><a class="anchor hidden-xs" href="#deconvolve" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deconvolve" aria-hidden="true">TOC</a></span></h3>
  14031. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  14032. as impulse.
  14033. </p>
  14034. <p>The filter accepts the following options:
  14035. </p>
  14036. <dl class="table">
  14037. <dt><samp class="option">planes</samp></dt>
  14038. <dd><p>Set which planes to process.
  14039. </p>
  14040. </dd>
  14041. <dt><samp class="option">impulse</samp></dt>
  14042. <dd><p>Set which impulse video frames will be processed, can be <var class="var">first</var>
  14043. or <var class="var">all</var>. Default is <var class="var">all</var>.
  14044. </p>
  14045. </dd>
  14046. <dt><samp class="option">noise</samp></dt>
  14047. <dd><p>Set noise when doing divisions. Default is <var class="var">0.0000001</var>. Useful when width
  14048. and height are not same and not power of 2 or if stream prior to convolving
  14049. had noise.
  14050. </p></dd>
  14051. </dl>
  14052. <p>The <code class="code">deconvolve</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  14053. </p>
  14054. <a name="dedot"></a>
  14055. <h3 class="section">11.58 dedot<span class="pull-right"><a class="anchor hidden-xs" href="#dedot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dedot" aria-hidden="true">TOC</a></span></h3>
  14056. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  14057. </p>
  14058. <p>It accepts the following options:
  14059. </p>
  14060. <dl class="table">
  14061. <dt><samp class="option">m</samp></dt>
  14062. <dd><p>Set mode of operation. Can be combination of <var class="var">dotcrawl</var> for cross-luminance reduction and/or
  14063. <var class="var">rainbows</var> for cross-color reduction.
  14064. </p>
  14065. </dd>
  14066. <dt><samp class="option">lt</samp></dt>
  14067. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  14068. </p>
  14069. </dd>
  14070. <dt><samp class="option">tl</samp></dt>
  14071. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  14072. </p>
  14073. </dd>
  14074. <dt><samp class="option">tc</samp></dt>
  14075. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  14076. </p>
  14077. </dd>
  14078. <dt><samp class="option">ct</samp></dt>
  14079. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  14080. </p></dd>
  14081. </dl>
  14082. <a name="deflate"></a>
  14083. <h3 class="section">11.59 deflate<span class="pull-right"><a class="anchor hidden-xs" href="#deflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflate" aria-hidden="true">TOC</a></span></h3>
  14084. <p>Apply deflate effect to the video.
  14085. </p>
  14086. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  14087. only values lower than the pixel.
  14088. </p>
  14089. <p>It accepts the following options:
  14090. </p>
  14091. <dl class="table">
  14092. <dt><samp class="option">threshold0</samp></dt>
  14093. <dt><samp class="option">threshold1</samp></dt>
  14094. <dt><samp class="option">threshold2</samp></dt>
  14095. <dt><samp class="option">threshold3</samp></dt>
  14096. <dd><p>Limit the maximum change for each plane, default is 65535.
  14097. If 0, plane will remain unchanged.
  14098. </p></dd>
  14099. </dl>
  14100. <a name="Commands-83"></a>
  14101. <h4 class="subsection">11.59.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-83" aria-hidden="true">TOC</a></span></h4>
  14102. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14103. </p>
  14104. <a name="deflicker"></a>
  14105. <h3 class="section">11.60 deflicker<span class="pull-right"><a class="anchor hidden-xs" href="#deflicker" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deflicker" aria-hidden="true">TOC</a></span></h3>
  14106. <p>Remove temporal frame luminance variations.
  14107. </p>
  14108. <p>It accepts the following options:
  14109. </p>
  14110. <dl class="table">
  14111. <dt><samp class="option">size, s</samp></dt>
  14112. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  14113. </p>
  14114. </dd>
  14115. <dt><samp class="option">mode, m</samp></dt>
  14116. <dd><p>Set averaging mode to smooth temporal luminance variations.
  14117. </p>
  14118. <p>Available values are:
  14119. </p><dl class="table">
  14120. <dt>&lsquo;<samp class="samp">am</samp>&rsquo;</dt>
  14121. <dd><p>Arithmetic mean
  14122. </p>
  14123. </dd>
  14124. <dt>&lsquo;<samp class="samp">gm</samp>&rsquo;</dt>
  14125. <dd><p>Geometric mean
  14126. </p>
  14127. </dd>
  14128. <dt>&lsquo;<samp class="samp">hm</samp>&rsquo;</dt>
  14129. <dd><p>Harmonic mean
  14130. </p>
  14131. </dd>
  14132. <dt>&lsquo;<samp class="samp">qm</samp>&rsquo;</dt>
  14133. <dd><p>Quadratic mean
  14134. </p>
  14135. </dd>
  14136. <dt>&lsquo;<samp class="samp">cm</samp>&rsquo;</dt>
  14137. <dd><p>Cubic mean
  14138. </p>
  14139. </dd>
  14140. <dt>&lsquo;<samp class="samp">pm</samp>&rsquo;</dt>
  14141. <dd><p>Power mean
  14142. </p>
  14143. </dd>
  14144. <dt>&lsquo;<samp class="samp">median</samp>&rsquo;</dt>
  14145. <dd><p>Median
  14146. </p></dd>
  14147. </dl>
  14148. </dd>
  14149. <dt><samp class="option">bypass</samp></dt>
  14150. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  14151. </p></dd>
  14152. </dl>
  14153. <a name="dejudder"></a>
  14154. <h3 class="section">11.61 dejudder<span class="pull-right"><a class="anchor hidden-xs" href="#dejudder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dejudder" aria-hidden="true">TOC</a></span></h3>
  14155. <p>Remove judder produced by partially interlaced telecined content.
  14156. </p>
  14157. <p>Judder can be introduced, for instance, by <a class="ref" href="#pullup">pullup</a> filter. If the original
  14158. source was partially telecined content then the output of <code class="code">pullup,dejudder</code>
  14159. will have a variable frame rate. May change the recorded frame rate of the
  14160. container. Aside from that change, this filter will not affect constant frame
  14161. rate video.
  14162. </p>
  14163. <p>The option available in this filter is:
  14164. </p><dl class="table">
  14165. <dt><samp class="option">cycle</samp></dt>
  14166. <dd><p>Specify the length of the window over which the judder repeats.
  14167. </p>
  14168. <p>Accepts any integer greater than 1. Useful values are:
  14169. </p><dl class="table">
  14170. <dt>&lsquo;<samp class="samp">4</samp>&rsquo;</dt>
  14171. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  14172. </p>
  14173. </dd>
  14174. <dt>&lsquo;<samp class="samp">5</samp>&rsquo;</dt>
  14175. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  14176. </p>
  14177. </dd>
  14178. <dt>&lsquo;<samp class="samp">20</samp>&rsquo;</dt>
  14179. <dd><p>If a mixture of the two.
  14180. </p></dd>
  14181. </dl>
  14182. <p>The default is &lsquo;<samp class="samp">4</samp>&rsquo;.
  14183. </p></dd>
  14184. </dl>
  14185. <a name="delogo"></a>
  14186. <h3 class="section">11.62 delogo<span class="pull-right"><a class="anchor hidden-xs" href="#delogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-delogo" aria-hidden="true">TOC</a></span></h3>
  14187. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  14188. pixels. Just set a rectangle covering the logo and watch it disappear
  14189. (and sometimes something even uglier appear - your mileage may vary).
  14190. </p>
  14191. <p>It accepts the following parameters:
  14192. </p><dl class="table">
  14193. <dt><samp class="option">x</samp></dt>
  14194. <dt><samp class="option">y</samp></dt>
  14195. <dd><p>Specify the top left corner coordinates of the logo. They must be
  14196. specified.
  14197. </p>
  14198. </dd>
  14199. <dt><samp class="option">w</samp></dt>
  14200. <dt><samp class="option">h</samp></dt>
  14201. <dd><p>Specify the width and height of the logo to clear. They must be
  14202. specified.
  14203. </p>
  14204. </dd>
  14205. <dt><samp class="option">show</samp></dt>
  14206. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  14207. finding the right <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, and <var class="var">h</var> parameters.
  14208. The default value is 0.
  14209. </p>
  14210. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  14211. replaced with interpolated values. The values of the next pixels
  14212. immediately outside this rectangle in each direction will be used to
  14213. compute the interpolated pixel values inside the rectangle.
  14214. </p>
  14215. </dd>
  14216. </dl>
  14217. <a name="Examples-65"></a>
  14218. <h4 class="subsection">11.62.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-65" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-65" aria-hidden="true">TOC</a></span></h4>
  14219. <ul class="itemize mark-bullet">
  14220. <li>Set a rectangle covering the area with top left corner coordinates 0,0
  14221. and size 100x77:
  14222. <div class="example">
  14223. <pre class="example-preformatted">delogo=x=0:y=0:w=100:h=77
  14224. </pre></div>
  14225. </li></ul>
  14226. <a class="anchor" id="derain"></a><a name="derain-1"></a>
  14227. <h3 class="section">11.63 derain<span class="pull-right"><a class="anchor hidden-xs" href="#derain-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-derain-1" aria-hidden="true">TOC</a></span></h3>
  14228. <p>Remove the rain in the input image/video by applying the derain methods based on
  14229. convolutional neural networks. Supported models:
  14230. </p>
  14231. <ul class="itemize mark-bullet">
  14232. <li>Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  14233. See <a class="url" 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>.
  14234. </li></ul>
  14235. <p>Training as well as model generation scripts are provided in
  14236. the repository at <a class="url" href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  14237. </p>
  14238. <p>The filter accepts the following options:
  14239. </p>
  14240. <dl class="table">
  14241. <dt><samp class="option">filter_type</samp></dt>
  14242. <dd><p>Specify which filter to use. This option accepts the following values:
  14243. </p>
  14244. <dl class="table">
  14245. <dt>&lsquo;<samp class="samp">derain</samp>&rsquo;</dt>
  14246. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  14247. </p>
  14248. </dd>
  14249. <dt>&lsquo;<samp class="samp">dehaze</samp>&rsquo;</dt>
  14250. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  14251. </p></dd>
  14252. </dl>
  14253. <p>Default value is &lsquo;<samp class="samp">derain</samp>&rsquo;.
  14254. </p>
  14255. </dd>
  14256. <dt><samp class="option">dnn_backend</samp></dt>
  14257. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  14258. the following values:
  14259. </p>
  14260. <dl class="table">
  14261. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  14262. <dd><p>TensorFlow backend. To enable this backend you
  14263. need to install the TensorFlow for C library (see
  14264. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  14265. <code class="code">--enable-libtensorflow</code>
  14266. </p></dd>
  14267. </dl>
  14268. </dd>
  14269. <dt><samp class="option">model</samp></dt>
  14270. <dd><p>Set path to model file specifying network architecture and its parameters.
  14271. Note that different backends use different file formats. TensorFlow can load files for only its format.
  14272. </p></dd>
  14273. </dl>
  14274. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  14275. </p>
  14276. <a name="deshake"></a>
  14277. <h3 class="section">11.64 deshake<span class="pull-right"><a class="anchor hidden-xs" href="#deshake" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake" aria-hidden="true">TOC</a></span></h3>
  14278. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  14279. filter helps remove camera shake from hand-holding a camera, bumping a
  14280. tripod, moving on a vehicle, etc.
  14281. </p>
  14282. <p>The filter accepts the following options:
  14283. </p>
  14284. <dl class="table">
  14285. <dt><samp class="option">x</samp></dt>
  14286. <dt><samp class="option">y</samp></dt>
  14287. <dt><samp class="option">w</samp></dt>
  14288. <dt><samp class="option">h</samp></dt>
  14289. <dd><p>Specify a rectangular area where to limit the search for motion
  14290. vectors.
  14291. If desired the search for motion vectors can be limited to a
  14292. rectangular area of the frame defined by its top left corner, width
  14293. and height. These parameters have the same meaning as the drawbox
  14294. filter which can be used to visualise the position of the bounding
  14295. box.
  14296. </p>
  14297. <p>This is useful when simultaneous movement of subjects within the frame
  14298. might be confused for camera motion by the motion vector search.
  14299. </p>
  14300. <p>If any or all of <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> are set to -1
  14301. then the full frame is used. This allows later options to be set
  14302. without specifying the bounding box for the motion vector search.
  14303. </p>
  14304. <p>Default - search the whole frame.
  14305. </p>
  14306. </dd>
  14307. <dt><samp class="option">rx</samp></dt>
  14308. <dt><samp class="option">ry</samp></dt>
  14309. <dd><p>Specify the maximum extent of movement in x and y directions in the
  14310. range 0-64 pixels. Default 16.
  14311. </p>
  14312. </dd>
  14313. <dt><samp class="option">edge</samp></dt>
  14314. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  14315. frame. Available values are:
  14316. </p><dl class="table">
  14317. <dt>&lsquo;<samp class="samp">blank, 0</samp>&rsquo;</dt>
  14318. <dd><p>Fill zeroes at blank locations
  14319. </p></dd>
  14320. <dt>&lsquo;<samp class="samp">original, 1</samp>&rsquo;</dt>
  14321. <dd><p>Original image at blank locations
  14322. </p></dd>
  14323. <dt>&lsquo;<samp class="samp">clamp, 2</samp>&rsquo;</dt>
  14324. <dd><p>Extruded edge value at blank locations
  14325. </p></dd>
  14326. <dt>&lsquo;<samp class="samp">mirror, 3</samp>&rsquo;</dt>
  14327. <dd><p>Mirrored edge at blank locations
  14328. </p></dd>
  14329. </dl>
  14330. <p>Default value is &lsquo;<samp class="samp">mirror</samp>&rsquo;.
  14331. </p>
  14332. </dd>
  14333. <dt><samp class="option">blocksize</samp></dt>
  14334. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  14335. default 8.
  14336. </p>
  14337. </dd>
  14338. <dt><samp class="option">contrast</samp></dt>
  14339. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  14340. the specified contrast (difference between darkest and lightest
  14341. pixels) will be considered. Range 1-255, default 125.
  14342. </p>
  14343. </dd>
  14344. <dt><samp class="option">search</samp></dt>
  14345. <dd><p>Specify the search strategy. Available values are:
  14346. </p><dl class="table">
  14347. <dt>&lsquo;<samp class="samp">exhaustive, 0</samp>&rsquo;</dt>
  14348. <dd><p>Set exhaustive search
  14349. </p></dd>
  14350. <dt>&lsquo;<samp class="samp">less, 1</samp>&rsquo;</dt>
  14351. <dd><p>Set less exhaustive search.
  14352. </p></dd>
  14353. </dl>
  14354. <p>Default value is &lsquo;<samp class="samp">exhaustive</samp>&rsquo;.
  14355. </p>
  14356. </dd>
  14357. <dt><samp class="option">filename</samp></dt>
  14358. <dd><p>If set then a detailed log of the motion search is written to the
  14359. specified file.
  14360. </p>
  14361. </dd>
  14362. </dl>
  14363. <a name="despill"></a>
  14364. <h3 class="section">11.65 despill<span class="pull-right"><a class="anchor hidden-xs" href="#despill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-despill" aria-hidden="true">TOC</a></span></h3>
  14365. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  14366. greenscreen or bluescreen.
  14367. </p>
  14368. <p>This filter accepts the following options:
  14369. </p>
  14370. <dl class="table">
  14371. <dt><samp class="option">type</samp></dt>
  14372. <dd><p>Set what type of despill to use.
  14373. </p>
  14374. </dd>
  14375. <dt><samp class="option">mix</samp></dt>
  14376. <dd><p>Set how spillmap will be generated.
  14377. </p>
  14378. </dd>
  14379. <dt><samp class="option">expand</samp></dt>
  14380. <dd><p>Set how much to get rid of still remaining spill.
  14381. </p>
  14382. </dd>
  14383. <dt><samp class="option">red</samp></dt>
  14384. <dd><p>Controls amount of red in spill area.
  14385. </p>
  14386. </dd>
  14387. <dt><samp class="option">green</samp></dt>
  14388. <dd><p>Controls amount of green in spill area.
  14389. Should be -1 for greenscreen.
  14390. </p>
  14391. </dd>
  14392. <dt><samp class="option">blue</samp></dt>
  14393. <dd><p>Controls amount of blue in spill area.
  14394. Should be -1 for bluescreen.
  14395. </p>
  14396. </dd>
  14397. <dt><samp class="option">brightness</samp></dt>
  14398. <dd><p>Controls brightness of spill area, preserving colors.
  14399. </p>
  14400. </dd>
  14401. <dt><samp class="option">alpha</samp></dt>
  14402. <dd><p>Modify alpha from generated spillmap.
  14403. </p></dd>
  14404. </dl>
  14405. <a name="Commands-84"></a>
  14406. <h4 class="subsection">11.65.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-84" aria-hidden="true">TOC</a></span></h4>
  14407. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14408. </p>
  14409. <a name="detelecine"></a>
  14410. <h3 class="section">11.66 detelecine<span class="pull-right"><a class="anchor hidden-xs" href="#detelecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-detelecine" aria-hidden="true">TOC</a></span></h3>
  14411. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  14412. pattern specified using the pattern option which must be the same as that passed
  14413. to the telecine filter.
  14414. </p>
  14415. <p>This filter accepts the following options:
  14416. </p>
  14417. <dl class="table">
  14418. <dt><samp class="option">first_field</samp></dt>
  14419. <dd><dl class="table">
  14420. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  14421. <dd><p>top field first
  14422. </p></dd>
  14423. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  14424. <dd><p>bottom field first
  14425. The default value is <code class="code">top</code>.
  14426. </p></dd>
  14427. </dl>
  14428. </dd>
  14429. <dt><samp class="option">pattern</samp></dt>
  14430. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  14431. The default value is <code class="code">23</code>.
  14432. </p>
  14433. </dd>
  14434. <dt><samp class="option">start_frame</samp></dt>
  14435. <dd><p>A number representing position of the first frame with respect to the telecine
  14436. pattern. This is to be used if the stream is cut. The default value is <code class="code">0</code>.
  14437. </p></dd>
  14438. </dl>
  14439. <a class="anchor" id="dilation"></a><a name="dilation-1"></a>
  14440. <h3 class="section">11.67 dilation<span class="pull-right"><a class="anchor hidden-xs" href="#dilation-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation-1" aria-hidden="true">TOC</a></span></h3>
  14441. <p>Apply dilation effect to the video.
  14442. </p>
  14443. <p>This filter replaces the pixel by the local(3x3) maximum.
  14444. </p>
  14445. <p>It accepts the following options:
  14446. </p>
  14447. <dl class="table">
  14448. <dt><samp class="option">threshold0</samp></dt>
  14449. <dt><samp class="option">threshold1</samp></dt>
  14450. <dt><samp class="option">threshold2</samp></dt>
  14451. <dt><samp class="option">threshold3</samp></dt>
  14452. <dd><p>Limit the maximum change for each plane, default is 65535.
  14453. If 0, plane will remain unchanged.
  14454. </p>
  14455. </dd>
  14456. <dt><samp class="option">coordinates</samp></dt>
  14457. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  14458. pixels are used.
  14459. </p>
  14460. <p>Flags to local 3x3 coordinates maps like this:
  14461. </p>
  14462. <p>1 2 3
  14463. 4 5
  14464. 6 7 8
  14465. </p></dd>
  14466. </dl>
  14467. <a name="Commands-85"></a>
  14468. <h4 class="subsection">11.67.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-85" aria-hidden="true">TOC</a></span></h4>
  14469. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  14470. </p>
  14471. <a name="displace"></a>
  14472. <h3 class="section">11.68 displace<span class="pull-right"><a class="anchor hidden-xs" href="#displace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-displace" aria-hidden="true">TOC</a></span></h3>
  14473. <p>Displace pixels as indicated by second and third input stream.
  14474. </p>
  14475. <p>It takes three input streams and outputs one stream, the first input is the
  14476. source, and second and third input are displacement maps.
  14477. </p>
  14478. <p>The second input specifies how much to displace pixels along the
  14479. x-axis, while the third input specifies how much to displace pixels
  14480. along the y-axis.
  14481. If one of displacement map streams terminates, last frame from that
  14482. displacement map will be used.
  14483. </p>
  14484. <p>Note that once generated, displacements maps can be reused over and over again.
  14485. </p>
  14486. <p>A description of the accepted options follows.
  14487. </p>
  14488. <dl class="table">
  14489. <dt><samp class="option">edge</samp></dt>
  14490. <dd><p>Set displace behavior for pixels that are out of range.
  14491. </p>
  14492. <p>Available values are:
  14493. </p><dl class="table">
  14494. <dt>&lsquo;<samp class="samp">blank</samp>&rsquo;</dt>
  14495. <dd><p>Missing pixels are replaced by black pixels.
  14496. </p>
  14497. </dd>
  14498. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  14499. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  14500. </p>
  14501. </dd>
  14502. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  14503. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  14504. </p>
  14505. </dd>
  14506. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  14507. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  14508. </p></dd>
  14509. </dl>
  14510. <p>Default is &lsquo;<samp class="samp">smear</samp>&rsquo;.
  14511. </p>
  14512. </dd>
  14513. </dl>
  14514. <a name="Examples-66"></a>
  14515. <h4 class="subsection">11.68.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-66" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-66" aria-hidden="true">TOC</a></span></h4>
  14516. <ul class="itemize mark-bullet">
  14517. <li>Add ripple effect to rgb input of video size hd720:
  14518. <div class="example">
  14519. <pre class="example-preformatted">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
  14520. </pre></div>
  14521. </li><li>Add wave effect to rgb input of video size hd720:
  14522. <div class="example">
  14523. <pre class="example-preformatted">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
  14524. </pre></div>
  14525. </li></ul>
  14526. <a name="dnn_005fclassify"></a>
  14527. <h3 class="section">11.69 dnn_classify<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fclassify" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fclassify" aria-hidden="true">TOC</a></span></h3>
  14528. <p>Do classification with deep neural networks based on bounding boxes.
  14529. </p>
  14530. <p>The filter accepts the following options:
  14531. </p>
  14532. <dl class="table">
  14533. <dt><samp class="option">dnn_backend</samp></dt>
  14534. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  14535. only openvino now, tensorflow backends will be added.
  14536. </p>
  14537. </dd>
  14538. <dt><samp class="option">model</samp></dt>
  14539. <dd><p>Set path to model file specifying network architecture and its parameters.
  14540. Note that different backends use different file formats.
  14541. </p>
  14542. </dd>
  14543. <dt><samp class="option">input</samp></dt>
  14544. <dd><p>Set the input name of the dnn network.
  14545. </p>
  14546. </dd>
  14547. <dt><samp class="option">output</samp></dt>
  14548. <dd><p>Set the output name of the dnn network.
  14549. </p>
  14550. </dd>
  14551. <dt><samp class="option">confidence</samp></dt>
  14552. <dd><p>Set the confidence threshold (default: 0.5).
  14553. </p>
  14554. </dd>
  14555. <dt><samp class="option">labels</samp></dt>
  14556. <dd><p>Set path to label file specifying the mapping between label id and name.
  14557. Each label name is written in one line, tailing spaces and empty lines are skipped.
  14558. The first line is the name of label id 0,
  14559. and the second line is the name of label id 1, etc.
  14560. The label id is considered as name if the label file is not provided.
  14561. </p>
  14562. </dd>
  14563. <dt><samp class="option">backend_configs</samp></dt>
  14564. <dd><p>Set the configs to be passed into backend
  14565. </p>
  14566. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  14567. please use tools/python/tf_sess_config.py to get the configs for your system.
  14568. </p>
  14569. </dd>
  14570. </dl>
  14571. <a name="dnn_005fdetect"></a>
  14572. <h3 class="section">11.70 dnn_detect<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fdetect" aria-hidden="true">TOC</a></span></h3>
  14573. <p>Do object detection with deep neural networks.
  14574. </p>
  14575. <p>The filter accepts the following options:
  14576. </p>
  14577. <dl class="table">
  14578. <dt><samp class="option">dnn_backend</samp></dt>
  14579. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  14580. only openvino now, tensorflow backends will be added.
  14581. </p>
  14582. </dd>
  14583. <dt><samp class="option">model</samp></dt>
  14584. <dd><p>Set path to model file specifying network architecture and its parameters.
  14585. Note that different backends use different file formats.
  14586. </p>
  14587. </dd>
  14588. <dt><samp class="option">input</samp></dt>
  14589. <dd><p>Set the input name of the dnn network.
  14590. </p>
  14591. </dd>
  14592. <dt><samp class="option">output</samp></dt>
  14593. <dd><p>Set the output name of the dnn network.
  14594. </p>
  14595. </dd>
  14596. <dt><samp class="option">confidence</samp></dt>
  14597. <dd><p>Set the confidence threshold (default: 0.5).
  14598. </p>
  14599. </dd>
  14600. <dt><samp class="option">labels</samp></dt>
  14601. <dd><p>Set path to label file specifying the mapping between label id and name.
  14602. Each label name is written in one line, tailing spaces and empty lines are skipped.
  14603. The first line is the name of label id 0 (usually it is &rsquo;background&rsquo;),
  14604. and the second line is the name of label id 1, etc.
  14605. The label id is considered as name if the label file is not provided.
  14606. </p>
  14607. </dd>
  14608. <dt><samp class="option">backend_configs</samp></dt>
  14609. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  14610. Roll back to sync execution if the backend does not support async.
  14611. </p>
  14612. </dd>
  14613. </dl>
  14614. <a class="anchor" id="dnn_005fprocessing"></a><a name="dnn_005fprocessing-1"></a>
  14615. <h3 class="section">11.71 dnn_processing<span class="pull-right"><a class="anchor hidden-xs" href="#dnn_005fprocessing-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dnn_005fprocessing-1" aria-hidden="true">TOC</a></span></h3>
  14616. <p>Do image processing with deep neural networks. It works together with another filter
  14617. which converts the pixel format of the Frame to what the dnn network requires.
  14618. </p>
  14619. <p>The filter accepts the following options:
  14620. </p>
  14621. <dl class="table">
  14622. <dt><samp class="option">dnn_backend</samp></dt>
  14623. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  14624. the following values:
  14625. </p>
  14626. <dl class="table">
  14627. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  14628. <dd><p>TensorFlow backend. To enable this backend you
  14629. need to install the TensorFlow for C library (see
  14630. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  14631. <code class="code">--enable-libtensorflow</code>
  14632. </p>
  14633. </dd>
  14634. <dt>&lsquo;<samp class="samp">openvino</samp>&rsquo;</dt>
  14635. <dd><p>OpenVINO backend. To enable this backend you
  14636. need to build and install the OpenVINO for C library (see
  14637. <a class="url" href="https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md">https://github.com/openvinotoolkit/openvino/blob/master/build-instruction.md</a>) and configure FFmpeg with
  14638. <code class="code">--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  14639. be needed if the header files and libraries are not installed into system path)
  14640. </p>
  14641. </dd>
  14642. <dt>&lsquo;<samp class="samp">torch</samp>&rsquo;</dt>
  14643. <dd><p>Libtorch backend. To enable this backend you need to build and install Libtroch
  14644. for C++ library. Please download cxx11 ABI version (see
  14645. <a class="url" href="https://pytorch.org/get-started/locally">https://pytorch.org/get-started/locally</a>)
  14646. and configure FFmpeg with <code class="code">--enable-libtorch
  14647. --extra-cflags=-I/libtorch_root/libtorch/include
  14648. --extra-cflags=-I/libtorch_root/libtorch/include/torch/csrc/api/include
  14649. --extra-ldflags=-L/libtorch_root/libtorch/lib/</code>
  14650. </p>
  14651. </dd>
  14652. </dl>
  14653. </dd>
  14654. <dt><samp class="option">model</samp></dt>
  14655. <dd><p>Set path to model file specifying network architecture and its parameters.
  14656. Note that different backends use different file formats. TensorFlow, OpenVINO
  14657. and Libtorch backend can load files for only its format.
  14658. </p>
  14659. </dd>
  14660. <dt><samp class="option">input</samp></dt>
  14661. <dd><p>Set the input name of the dnn network.
  14662. </p>
  14663. </dd>
  14664. <dt><samp class="option">output</samp></dt>
  14665. <dd><p>Set the output name of the dnn network.
  14666. </p>
  14667. </dd>
  14668. <dt><samp class="option">backend_configs</samp></dt>
  14669. <dd><p>Set the configs to be passed into backend. To use async execution, set async (default: set).
  14670. Roll back to sync execution if the backend does not support async.
  14671. </p>
  14672. <p>For tensorflow backend, you can set its configs with <samp class="option">sess_config</samp> options,
  14673. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  14674. </p>
  14675. </dd>
  14676. </dl>
  14677. <a name="Examples-67"></a>
  14678. <h4 class="subsection">11.71.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-67" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-67" aria-hidden="true">TOC</a></span></h4>
  14679. <ul class="itemize mark-bullet">
  14680. <li>Remove rain in rgb24 frame with can.pb (see <a class="ref" href="#derain">derain</a> filter):
  14681. <div class="example">
  14682. <pre class="example-preformatted">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  14683. </pre></div>
  14684. </li><li>Handle the Y channel with srcnn.pb (see <a class="ref" href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  14685. <div class="example">
  14686. <pre class="example-preformatted">./ffmpeg -i 480p.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.jpg
  14687. </pre></div>
  14688. </li><li>Handle the Y channel with espcn.pb (see <a class="ref" href="#sr">sr</a> filter), which changes frame size, for format yuv420p (planar YUV formats supported),
  14689. please use tools/python/tf_sess_config.py to get the configs of TensorFlow backend for your system.
  14690. <div class="example">
  14691. <pre class="example-preformatted">./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y:backend_configs=sess_config=0x10022805320e09cdccccccccccec3f20012a01303801 -y tmp.espcn.jpg
  14692. </pre></div>
  14693. </li></ul>
  14694. <a name="drawbox"></a>
  14695. <h3 class="section">11.72 drawbox<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox" aria-hidden="true">TOC</a></span></h3>
  14696. <p>Draw a colored box on the input image.
  14697. </p>
  14698. <p>It accepts the following parameters:
  14699. </p>
  14700. <dl class="table">
  14701. <dt><samp class="option">x</samp></dt>
  14702. <dt><samp class="option">y</samp></dt>
  14703. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  14704. </p>
  14705. </dd>
  14706. <dt><samp class="option">width, w</samp></dt>
  14707. <dt><samp class="option">height, h</samp></dt>
  14708. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  14709. the input width and height. It defaults to 0.
  14710. </p>
  14711. </dd>
  14712. <dt><samp class="option">color, c</samp></dt>
  14713. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  14714. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  14715. value <code class="code">invert</code> is used, the box edge color is the same as the
  14716. video with inverted luma.
  14717. </p>
  14718. </dd>
  14719. <dt><samp class="option">thickness, t</samp></dt>
  14720. <dd><p>The expression which sets the thickness of the box edge.
  14721. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  14722. </p>
  14723. <p>See below for the list of accepted constants.
  14724. </p>
  14725. </dd>
  14726. <dt><samp class="option">replace</samp></dt>
  14727. <dd><p>Applicable if the input has alpha. With value <code class="code">1</code>, the pixels of the painted box
  14728. will overwrite the video&rsquo;s color and alpha pixels.
  14729. Default is <code class="code">0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  14730. </p></dd>
  14731. </dl>
  14732. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  14733. following constants:
  14734. </p>
  14735. <dl class="table">
  14736. <dt><samp class="option">dar</samp></dt>
  14737. <dd><p>The input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  14738. </p>
  14739. </dd>
  14740. <dt><samp class="option">hsub</samp></dt>
  14741. <dt><samp class="option">vsub</samp></dt>
  14742. <dd><p>horizontal and vertical chroma subsample values. For example for the
  14743. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  14744. </p>
  14745. </dd>
  14746. <dt><samp class="option">in_h, ih</samp></dt>
  14747. <dt><samp class="option">in_w, iw</samp></dt>
  14748. <dd><p>The input width and height.
  14749. </p>
  14750. </dd>
  14751. <dt><samp class="option">sar</samp></dt>
  14752. <dd><p>The input sample aspect ratio.
  14753. </p>
  14754. </dd>
  14755. <dt><samp class="option">x</samp></dt>
  14756. <dt><samp class="option">y</samp></dt>
  14757. <dd><p>The x and y offset coordinates where the box is drawn.
  14758. </p>
  14759. </dd>
  14760. <dt><samp class="option">w</samp></dt>
  14761. <dt><samp class="option">h</samp></dt>
  14762. <dd><p>The width and height of the drawn box.
  14763. </p>
  14764. </dd>
  14765. <dt><samp class="option">box_source</samp></dt>
  14766. <dd><p>Box source can be set as side_data_detection_bboxes if you want to use box data in
  14767. detection bboxes of side data.
  14768. </p>
  14769. <p>If <var class="var">box_source</var> is set, the <var class="var">x</var>, <var class="var">y</var>, <var class="var">width</var> and <var class="var">height</var> will be ignored and
  14770. still use box data in detection bboxes of side data. So please do not use this parameter if you were
  14771. not sure about the box source.
  14772. </p>
  14773. </dd>
  14774. <dt><samp class="option">t</samp></dt>
  14775. <dd><p>The thickness of the drawn box.
  14776. </p>
  14777. <p>These constants allow the <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, <var class="var">h</var> and <var class="var">t</var> expressions to refer to
  14778. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  14779. </p>
  14780. </dd>
  14781. </dl>
  14782. <a name="Examples-68"></a>
  14783. <h4 class="subsection">11.72.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-68" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-68" aria-hidden="true">TOC</a></span></h4>
  14784. <ul class="itemize mark-bullet">
  14785. <li>Draw a black box around the edge of the input image:
  14786. <div class="example">
  14787. <pre class="example-preformatted">drawbox
  14788. </pre></div>
  14789. </li><li>Draw a box with color red and an opacity of 50%:
  14790. <div class="example">
  14791. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  14792. </pre></div>
  14793. <p>The previous example can be specified as:
  14794. </p><div class="example">
  14795. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  14796. </pre></div>
  14797. </li><li>Fill the box with pink color:
  14798. <div class="example">
  14799. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  14800. </pre></div>
  14801. </li><li>Draw a 2-pixel red 2.40:1 mask:
  14802. <div class="example">
  14803. <pre class="example-preformatted">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
  14804. </pre></div>
  14805. </li></ul>
  14806. <a name="Commands-86"></a>
  14807. <h4 class="subsection">11.72.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-86" aria-hidden="true">TOC</a></span></h4>
  14808. <p>This filter supports same commands as options.
  14809. The command accepts the same syntax of the corresponding option.
  14810. </p>
  14811. <p>If the specified expression is not valid, it is kept at its current
  14812. value.
  14813. </p>
  14814. <a class="anchor" id="drawgraph"></a><a name="drawgraph-1"></a>
  14815. <h3 class="section">11.73 drawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#drawgraph-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgraph-1" aria-hidden="true">TOC</a></span></h3>
  14816. <p>Draw a graph using input video metadata.
  14817. </p>
  14818. <p>It accepts the following parameters:
  14819. </p>
  14820. <dl class="table">
  14821. <dt><samp class="option">m1</samp></dt>
  14822. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  14823. </p>
  14824. </dd>
  14825. <dt><samp class="option">fg1</samp></dt>
  14826. <dd><p>Set 1st foreground color expression.
  14827. </p>
  14828. </dd>
  14829. <dt><samp class="option">m2</samp></dt>
  14830. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  14831. </p>
  14832. </dd>
  14833. <dt><samp class="option">fg2</samp></dt>
  14834. <dd><p>Set 2nd foreground color expression.
  14835. </p>
  14836. </dd>
  14837. <dt><samp class="option">m3</samp></dt>
  14838. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  14839. </p>
  14840. </dd>
  14841. <dt><samp class="option">fg3</samp></dt>
  14842. <dd><p>Set 3rd foreground color expression.
  14843. </p>
  14844. </dd>
  14845. <dt><samp class="option">m4</samp></dt>
  14846. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  14847. </p>
  14848. </dd>
  14849. <dt><samp class="option">fg4</samp></dt>
  14850. <dd><p>Set 4th foreground color expression.
  14851. </p>
  14852. </dd>
  14853. <dt><samp class="option">min</samp></dt>
  14854. <dd><p>Set minimal value of metadata value.
  14855. </p>
  14856. </dd>
  14857. <dt><samp class="option">max</samp></dt>
  14858. <dd><p>Set maximal value of metadata value.
  14859. </p>
  14860. </dd>
  14861. <dt><samp class="option">bg</samp></dt>
  14862. <dd><p>Set graph background color. Default is white.
  14863. </p>
  14864. </dd>
  14865. <dt><samp class="option">mode</samp></dt>
  14866. <dd><p>Set graph mode.
  14867. </p>
  14868. <p>Available values for mode is:
  14869. </p><dl class="table">
  14870. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  14871. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  14872. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  14873. </dl>
  14874. <p>Default is <code class="code">line</code>.
  14875. </p>
  14876. </dd>
  14877. <dt><samp class="option">slide</samp></dt>
  14878. <dd><p>Set slide mode.
  14879. </p>
  14880. <p>Available values for slide is:
  14881. </p><dl class="table">
  14882. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  14883. <dd><p>Draw new frame when right border is reached.
  14884. </p>
  14885. </dd>
  14886. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  14887. <dd><p>Replace old columns with new ones.
  14888. </p>
  14889. </dd>
  14890. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  14891. <dd><p>Scroll from right to left.
  14892. </p>
  14893. </dd>
  14894. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  14895. <dd><p>Scroll from left to right.
  14896. </p>
  14897. </dd>
  14898. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  14899. <dd><p>Draw single picture.
  14900. </p></dd>
  14901. </dl>
  14902. <p>Default is <code class="code">frame</code>.
  14903. </p>
  14904. </dd>
  14905. <dt><samp class="option">size</samp></dt>
  14906. <dd><p>Set size of graph video. For the syntax of this option, check the
  14907. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  14908. The default value is <code class="code">900x256</code>.
  14909. </p>
  14910. </dd>
  14911. <dt><samp class="option">rate, r</samp></dt>
  14912. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  14913. </p>
  14914. <p>The foreground color expressions can use the following variables:
  14915. </p><dl class="table">
  14916. <dt><samp class="option">MIN</samp></dt>
  14917. <dd><p>Minimal value of metadata value.
  14918. </p>
  14919. </dd>
  14920. <dt><samp class="option">MAX</samp></dt>
  14921. <dd><p>Maximal value of metadata value.
  14922. </p>
  14923. </dd>
  14924. <dt><samp class="option">VAL</samp></dt>
  14925. <dd><p>Current metadata key value.
  14926. </p></dd>
  14927. </dl>
  14928. <p>The color is defined as 0xAABBGGRR.
  14929. </p></dd>
  14930. </dl>
  14931. <p>Example using metadata from <a class="ref" href="#signalstats">signalstats</a> filter:
  14932. </p><div class="example">
  14933. <pre class="example-preformatted">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  14934. </pre></div>
  14935. <p>Example using metadata from <a class="ref" href="#ebur128">ebur128</a> filter:
  14936. </p><div class="example">
  14937. <pre class="example-preformatted">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  14938. </pre></div>
  14939. <a name="drawgrid"></a>
  14940. <h3 class="section">11.74 drawgrid<span class="pull-right"><a class="anchor hidden-xs" href="#drawgrid" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawgrid" aria-hidden="true">TOC</a></span></h3>
  14941. <p>Draw a grid on the input image.
  14942. </p>
  14943. <p>It accepts the following parameters:
  14944. </p>
  14945. <dl class="table">
  14946. <dt><samp class="option">x</samp></dt>
  14947. <dt><samp class="option">y</samp></dt>
  14948. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  14949. </p>
  14950. </dd>
  14951. <dt><samp class="option">width, w</samp></dt>
  14952. <dt><samp class="option">height, h</samp></dt>
  14953. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  14954. input width and height, respectively, minus <code class="code">thickness</code>, so image gets
  14955. framed. Default to 0.
  14956. </p>
  14957. </dd>
  14958. <dt><samp class="option">color, c</samp></dt>
  14959. <dd><p>Specify the color of the grid. For the general syntax of this option,
  14960. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  14961. value <code class="code">invert</code> is used, the grid color is the same as the
  14962. video with inverted luma.
  14963. </p>
  14964. </dd>
  14965. <dt><samp class="option">thickness, t</samp></dt>
  14966. <dd><p>The expression which sets the thickness of the grid line. Default value is <code class="code">1</code>.
  14967. </p>
  14968. <p>See below for the list of accepted constants.
  14969. </p>
  14970. </dd>
  14971. <dt><samp class="option">replace</samp></dt>
  14972. <dd><p>Applicable if the input has alpha. With <code class="code">1</code> the pixels of the painted grid
  14973. will overwrite the video&rsquo;s color and alpha pixels.
  14974. Default is <code class="code">0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  14975. </p></dd>
  14976. </dl>
  14977. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  14978. following constants:
  14979. </p>
  14980. <dl class="table">
  14981. <dt><samp class="option">dar</samp></dt>
  14982. <dd><p>The input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  14983. </p>
  14984. </dd>
  14985. <dt><samp class="option">hsub</samp></dt>
  14986. <dt><samp class="option">vsub</samp></dt>
  14987. <dd><p>horizontal and vertical chroma subsample values. For example for the
  14988. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  14989. </p>
  14990. </dd>
  14991. <dt><samp class="option">in_h, ih</samp></dt>
  14992. <dt><samp class="option">in_w, iw</samp></dt>
  14993. <dd><p>The input grid cell width and height.
  14994. </p>
  14995. </dd>
  14996. <dt><samp class="option">sar</samp></dt>
  14997. <dd><p>The input sample aspect ratio.
  14998. </p>
  14999. </dd>
  15000. <dt><samp class="option">x</samp></dt>
  15001. <dt><samp class="option">y</samp></dt>
  15002. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  15003. </p>
  15004. </dd>
  15005. <dt><samp class="option">w</samp></dt>
  15006. <dt><samp class="option">h</samp></dt>
  15007. <dd><p>The width and height of the drawn cell.
  15008. </p>
  15009. </dd>
  15010. <dt><samp class="option">t</samp></dt>
  15011. <dd><p>The thickness of the drawn cell.
  15012. </p>
  15013. <p>These constants allow the <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var>, <var class="var">h</var> and <var class="var">t</var> expressions to refer to
  15014. each other, so you may for example specify <code class="code">y=x/dar</code> or <code class="code">h=w/dar</code>.
  15015. </p>
  15016. </dd>
  15017. </dl>
  15018. <a name="Examples-69"></a>
  15019. <h4 class="subsection">11.74.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-69" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-69" aria-hidden="true">TOC</a></span></h4>
  15020. <ul class="itemize mark-bullet">
  15021. <li>Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  15022. <div class="example">
  15023. <pre class="example-preformatted">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  15024. </pre></div>
  15025. </li><li>Draw a white 3x3 grid with an opacity of 50%:
  15026. <div class="example">
  15027. <pre class="example-preformatted">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  15028. </pre></div>
  15029. </li></ul>
  15030. <a name="Commands-87"></a>
  15031. <h4 class="subsection">11.74.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-87" aria-hidden="true">TOC</a></span></h4>
  15032. <p>This filter supports same commands as options.
  15033. The command accepts the same syntax of the corresponding option.
  15034. </p>
  15035. <p>If the specified expression is not valid, it is kept at its current
  15036. value.
  15037. </p>
  15038. <a class="anchor" id="drawtext"></a><a name="drawtext-1"></a>
  15039. <h3 class="section">11.75 drawtext<span class="pull-right"><a class="anchor hidden-xs" href="#drawtext-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawtext-1" aria-hidden="true">TOC</a></span></h3>
  15040. <p>Draw a text string or text from a specified file on top of a video, using the
  15041. libfreetype library.
  15042. </p>
  15043. <p>To enable compilation of this filter, you need to configure FFmpeg with
  15044. <code class="code">--enable-libfreetype</code> and <code class="code">--enable-libharfbuzz</code>.
  15045. To enable default font fallback and the <var class="var">font</var> option you need to
  15046. configure FFmpeg with <code class="code">--enable-libfontconfig</code>.
  15047. To enable the <var class="var">text_shaping</var> option, you need to configure FFmpeg with
  15048. <code class="code">--enable-libfribidi</code>.
  15049. </p>
  15050. <a name="Syntax"></a>
  15051. <h4 class="subsection">11.75.1 Syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Syntax" aria-hidden="true">TOC</a></span></h4>
  15052. <p>It accepts the following parameters:
  15053. </p>
  15054. <dl class="table">
  15055. <dt><samp class="option">box</samp></dt>
  15056. <dd><p>Used to draw a box around text using the background color.
  15057. The value must be either 1 (enable) or 0 (disable).
  15058. The default value of <var class="var">box</var> is 0.
  15059. </p>
  15060. </dd>
  15061. <dt><samp class="option">boxborderw</samp></dt>
  15062. <dd><p>Set the width of the border to be drawn around the box using <var class="var">boxcolor</var>.
  15063. The value must be specified using one of the following formats:
  15064. </p><ul class="itemize mark-bullet">
  15065. <li><code class="code">boxborderw=10</code> set the width of all the borders to 10
  15066. </li><li><code class="code">boxborderw=10|20</code> set the width of the top and bottom borders to 10
  15067. and the width of the left and right borders to 20
  15068. </li><li><code class="code">boxborderw=10|20|30</code> set the width of the top border to 10, the width
  15069. of the bottom border to 30 and the width of the left and right borders to 20
  15070. </li><li><code class="code">boxborderw=10|20|30|40</code> set the borders width to 10 (top), 20 (right),
  15071. 30 (bottom), 40 (left)
  15072. </li></ul>
  15073. <p>The default value of <var class="var">boxborderw</var> is &quot;0&quot;.
  15074. </p>
  15075. </dd>
  15076. <dt><samp class="option">boxcolor</samp></dt>
  15077. <dd><p>The color to be used for drawing box around text. For the syntax of this
  15078. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  15079. </p>
  15080. <p>The default value of <var class="var">boxcolor</var> is &quot;white&quot;.
  15081. </p>
  15082. </dd>
  15083. <dt><samp class="option">line_spacing</samp></dt>
  15084. <dd><p>Set the line spacing in pixels. The default value of <var class="var">line_spacing</var> is 0.
  15085. </p>
  15086. </dd>
  15087. <dt><samp class="option">text_align</samp></dt>
  15088. <dd><p>Set the vertical and horizontal alignment of the text with respect to the box boundaries.
  15089. The value is combination of flags, one for the vertical alignment (T=top,
  15090. M=middle, B=bottom) and one for the horizontal alignment (L=left, C=center, R=right).
  15091. Please note that tab characters are only supported with the left horizontal alignment.
  15092. </p>
  15093. </dd>
  15094. <dt><samp class="option">y_align</samp></dt>
  15095. <dd><p>Specify what the <var class="var">y</var> value is referred to. Possible values are:
  15096. </p><ul class="itemize mark-bullet">
  15097. <li><code class="code">text</code> the top of the highest glyph of the first text line is placed at <var class="var">y</var>
  15098. </li><li><code class="code">baseline</code> the baseline of the first text line is placed at <var class="var">y</var>
  15099. </li><li><code class="code">font</code> the baseline of the first text line is placed at <var class="var">y</var> plus the
  15100. ascent (in pixels) defined in the font metrics
  15101. </li></ul>
  15102. <p>The default value of <var class="var">y_align</var> is &quot;text&quot; for backward compatibility.
  15103. </p>
  15104. </dd>
  15105. <dt><samp class="option">borderw</samp></dt>
  15106. <dd><p>Set the width of the border to be drawn around the text using <var class="var">bordercolor</var>.
  15107. The default value of <var class="var">borderw</var> is 0.
  15108. </p>
  15109. </dd>
  15110. <dt><samp class="option">bordercolor</samp></dt>
  15111. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  15112. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  15113. </p>
  15114. <p>The default value of <var class="var">bordercolor</var> is &quot;black&quot;.
  15115. </p>
  15116. </dd>
  15117. <dt><samp class="option">expansion</samp></dt>
  15118. <dd><p>Select how the <var class="var">text</var> is expanded. Can be either <code class="code">none</code>,
  15119. <code class="code">strftime</code> (deprecated) or <code class="code">normal</code> (default). See the
  15120. <a class="ref" href="#drawtext_005fexpansion">Text expansion</a> section below for details.
  15121. </p>
  15122. </dd>
  15123. <dt><samp class="option">basetime</samp></dt>
  15124. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  15125. in the deprecated <code class="code">strftime</code> expansion mode. To emulate in normal expansion
  15126. mode use the <code class="code">pts</code> function, supplying the start time (in seconds)
  15127. as the second argument.
  15128. </p>
  15129. </dd>
  15130. <dt><samp class="option">fix_bounds</samp></dt>
  15131. <dd><p>If true, check and fix text coords to avoid clipping.
  15132. </p>
  15133. </dd>
  15134. <dt><samp class="option">fontcolor</samp></dt>
  15135. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  15136. the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  15137. </p>
  15138. <p>The default value of <var class="var">fontcolor</var> is &quot;black&quot;.
  15139. </p>
  15140. </dd>
  15141. <dt><samp class="option">fontcolor_expr</samp></dt>
  15142. <dd><p>String which is expanded the same way as <var class="var">text</var> to obtain dynamic
  15143. <var class="var">fontcolor</var> value. By default this option has empty value and is not
  15144. processed. When this option is set, it overrides <var class="var">fontcolor</var> option.
  15145. </p>
  15146. </dd>
  15147. <dt><samp class="option">font</samp></dt>
  15148. <dd><p>The font family to be used for drawing text. By default Sans.
  15149. </p>
  15150. </dd>
  15151. <dt><samp class="option">fontfile</samp></dt>
  15152. <dd><p>The font file to be used for drawing text. The path must be included.
  15153. This parameter is mandatory if the fontconfig support is disabled.
  15154. </p>
  15155. </dd>
  15156. <dt><samp class="option">alpha</samp></dt>
  15157. <dd><p>Draw the text applying alpha blending. The value can
  15158. be a number between 0.0 and 1.0.
  15159. The expression accepts the same variables <var class="var">x, y</var> as well.
  15160. The default value is 1.
  15161. Please see <var class="var">fontcolor_expr</var>.
  15162. </p>
  15163. </dd>
  15164. <dt><samp class="option">fontsize</samp></dt>
  15165. <dd><p>The font size to be used for drawing text.
  15166. The default value of <var class="var">fontsize</var> is 16.
  15167. </p>
  15168. </dd>
  15169. <dt><samp class="option">text_shaping</samp></dt>
  15170. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  15171. right-to-left text and join Arabic characters) before drawing it.
  15172. Otherwise, just draw the text exactly as given.
  15173. By default 1 (if supported).
  15174. </p>
  15175. </dd>
  15176. <dt><samp class="option">ft_load_flags</samp></dt>
  15177. <dd><p>The flags to be used for loading the fonts.
  15178. </p>
  15179. <p>The flags map the corresponding flags supported by libfreetype, and are
  15180. a combination of the following values:
  15181. </p><dl class="table">
  15182. <dt><var class="var">default</var></dt>
  15183. <dt><var class="var">no_scale</var></dt>
  15184. <dt><var class="var">no_hinting</var></dt>
  15185. <dt><var class="var">render</var></dt>
  15186. <dt><var class="var">no_bitmap</var></dt>
  15187. <dt><var class="var">vertical_layout</var></dt>
  15188. <dt><var class="var">force_autohint</var></dt>
  15189. <dt><var class="var">crop_bitmap</var></dt>
  15190. <dt><var class="var">pedantic</var></dt>
  15191. <dt><var class="var">ignore_global_advance_width</var></dt>
  15192. <dt><var class="var">no_recurse</var></dt>
  15193. <dt><var class="var">ignore_transform</var></dt>
  15194. <dt><var class="var">monochrome</var></dt>
  15195. <dt><var class="var">linear_design</var></dt>
  15196. <dt><var class="var">no_autohint</var></dt>
  15197. </dl>
  15198. <p>Default value is &quot;default&quot;.
  15199. </p>
  15200. <p>For more information consult the documentation for the FT_LOAD_*
  15201. libfreetype flags.
  15202. </p>
  15203. </dd>
  15204. <dt><samp class="option">shadowcolor</samp></dt>
  15205. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  15206. syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  15207. ffmpeg-utils manual</a>.
  15208. </p>
  15209. <p>The default value of <var class="var">shadowcolor</var> is &quot;black&quot;.
  15210. </p>
  15211. </dd>
  15212. <dt><samp class="option">boxw</samp></dt>
  15213. <dd><p>Set the width of the box to be drawn around text.
  15214. The default value of <var class="var">boxw</var> is computed automatically to match the text width
  15215. </p>
  15216. </dd>
  15217. <dt><samp class="option">boxh</samp></dt>
  15218. <dd><p>Set the height of the box to be drawn around text.
  15219. The default value of <var class="var">boxh</var> is computed automatically to match the text height
  15220. </p>
  15221. </dd>
  15222. <dt><samp class="option">shadowx</samp></dt>
  15223. <dt><samp class="option">shadowy</samp></dt>
  15224. <dd><p>The x and y offsets for the text shadow position with respect to the
  15225. position of the text. They can be either positive or negative
  15226. values. The default value for both is &quot;0&quot;.
  15227. </p>
  15228. </dd>
  15229. <dt><samp class="option">start_number</samp></dt>
  15230. <dd><p>The starting frame number for the n/frame_num variable. The default value
  15231. is &quot;0&quot;.
  15232. </p>
  15233. </dd>
  15234. <dt><samp class="option">tabsize</samp></dt>
  15235. <dd><p>The size in number of spaces to use for rendering the tab.
  15236. Default value is 4.
  15237. </p>
  15238. </dd>
  15239. <dt><samp class="option">timecode</samp></dt>
  15240. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  15241. format. It can be used with or without text parameter. <var class="var">timecode_rate</var>
  15242. option must be specified.
  15243. </p>
  15244. </dd>
  15245. <dt><samp class="option">timecode_rate, rate, r</samp></dt>
  15246. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  15247. integer. Minimum value is &quot;1&quot;.
  15248. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  15249. </p>
  15250. </dd>
  15251. <dt><samp class="option">tc24hmax</samp></dt>
  15252. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  15253. Default is 0 (disabled).
  15254. </p>
  15255. </dd>
  15256. <dt><samp class="option">text</samp></dt>
  15257. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  15258. encoded characters.
  15259. This parameter is mandatory if no file is specified with the parameter
  15260. <var class="var">textfile</var>.
  15261. </p>
  15262. </dd>
  15263. <dt><samp class="option">textfile</samp></dt>
  15264. <dd><p>A text file containing text to be drawn. The text must be a sequence
  15265. of UTF-8 encoded characters.
  15266. </p>
  15267. <p>This parameter is mandatory if no text string is specified with the
  15268. parameter <var class="var">text</var>.
  15269. </p>
  15270. <p>If both <var class="var">text</var> and <var class="var">textfile</var> are specified, an error is thrown.
  15271. </p>
  15272. </dd>
  15273. <dt><samp class="option">text_source</samp></dt>
  15274. <dd><p>Text source should be set as side_data_detection_bboxes if you want to use text data in
  15275. detection bboxes of side data.
  15276. </p>
  15277. <p>If text source is set, <var class="var">text</var> and <var class="var">textfile</var> will be ignored and still use
  15278. text data in detection bboxes of side data. So please do not use this parameter
  15279. if you are not sure about the text source.
  15280. </p>
  15281. </dd>
  15282. <dt><samp class="option">reload</samp></dt>
  15283. <dd><p>The <var class="var">textfile</var> will be reloaded at specified frame interval.
  15284. Be sure to update <var class="var">textfile</var> atomically, or it may be read partially,
  15285. or even fail.
  15286. Range is 0 to INT_MAX. Default is 0.
  15287. </p>
  15288. </dd>
  15289. <dt><samp class="option">x</samp></dt>
  15290. <dt><samp class="option">y</samp></dt>
  15291. <dd><p>The expressions which specify the offsets where text will be drawn
  15292. within the video frame. They are relative to the top/left border of the
  15293. output image.
  15294. </p>
  15295. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is &quot;0&quot;.
  15296. </p>
  15297. <p>See below for the list of accepted constants and functions.
  15298. </p></dd>
  15299. </dl>
  15300. <p>The parameters for <var class="var">x</var> and <var class="var">y</var> are expressions containing the
  15301. following constants and functions:
  15302. </p>
  15303. <dl class="table">
  15304. <dt><samp class="option">dar</samp></dt>
  15305. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  15306. </p>
  15307. </dd>
  15308. <dt><samp class="option">hsub</samp></dt>
  15309. <dt><samp class="option">vsub</samp></dt>
  15310. <dd><p>horizontal and vertical chroma subsample values. For example for the
  15311. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  15312. </p>
  15313. </dd>
  15314. <dt><samp class="option">line_h, lh</samp></dt>
  15315. <dd><p>the height of each text line
  15316. </p>
  15317. </dd>
  15318. <dt><samp class="option">main_h, h, H</samp></dt>
  15319. <dd><p>the input height
  15320. </p>
  15321. </dd>
  15322. <dt><samp class="option">main_w, w, W</samp></dt>
  15323. <dd><p>the input width
  15324. </p>
  15325. </dd>
  15326. <dt><samp class="option">max_glyph_a, ascent</samp></dt>
  15327. <dd><p>the maximum distance from the baseline to the highest/upper grid
  15328. coordinate used to place a glyph outline point, for all the rendered
  15329. glyphs.
  15330. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  15331. upwards.
  15332. </p>
  15333. </dd>
  15334. <dt><samp class="option">max_glyph_d, descent</samp></dt>
  15335. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  15336. used to place a glyph outline point, for all the rendered glyphs.
  15337. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  15338. upwards.
  15339. </p>
  15340. </dd>
  15341. <dt><samp class="option">max_glyph_h</samp></dt>
  15342. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  15343. contained in the rendered text, it is equivalent to <var class="var">ascent</var> -
  15344. <var class="var">descent</var>.
  15345. </p>
  15346. </dd>
  15347. <dt><samp class="option">max_glyph_w</samp></dt>
  15348. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  15349. contained in the rendered text
  15350. </p>
  15351. </dd>
  15352. <dt><samp class="option">font_a</samp></dt>
  15353. <dd><p>the ascent size defined in the font metrics
  15354. </p>
  15355. </dd>
  15356. <dt><samp class="option">font_d</samp></dt>
  15357. <dd><p>the descent size defined in the font metrics
  15358. </p>
  15359. </dd>
  15360. <dt><samp class="option">top_a</samp></dt>
  15361. <dd><p>the maximum ascender of the glyphs of the first text line
  15362. </p>
  15363. </dd>
  15364. <dt><samp class="option">bottom_d</samp></dt>
  15365. <dd><p>the maximum descender of the glyphs of the last text line
  15366. </p>
  15367. </dd>
  15368. <dt><samp class="option">n</samp></dt>
  15369. <dd><p>the number of input frame, starting from 0
  15370. </p>
  15371. </dd>
  15372. <dt><samp class="option">rand(min, max)</samp></dt>
  15373. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  15374. </p>
  15375. </dd>
  15376. <dt><samp class="option">sar</samp></dt>
  15377. <dd><p>The input sample aspect ratio.
  15378. </p>
  15379. </dd>
  15380. <dt><samp class="option">t</samp></dt>
  15381. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  15382. </p>
  15383. </dd>
  15384. <dt><samp class="option">text_h, th</samp></dt>
  15385. <dd><p>the height of the rendered text
  15386. </p>
  15387. </dd>
  15388. <dt><samp class="option">text_w, tw</samp></dt>
  15389. <dd><p>the width of the rendered text
  15390. </p>
  15391. </dd>
  15392. <dt><samp class="option">x</samp></dt>
  15393. <dt><samp class="option">y</samp></dt>
  15394. <dd><p>the x and y offset coordinates where the text is drawn.
  15395. </p>
  15396. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer
  15397. to each other, so you can for example specify <code class="code">y=x/dar</code>.
  15398. </p>
  15399. </dd>
  15400. <dt><samp class="option">pict_type</samp></dt>
  15401. <dd><p>A one character description of the current frame&rsquo;s picture type.
  15402. </p>
  15403. </dd>
  15404. <dt><samp class="option">pkt_pos</samp></dt>
  15405. <dd><p>The current packet&rsquo;s position in the input file or stream
  15406. (in bytes, from the start of the input). A value of -1 indicates
  15407. this info is not available.
  15408. </p>
  15409. </dd>
  15410. <dt><samp class="option">duration</samp></dt>
  15411. <dd><p>The current packet&rsquo;s duration, in seconds.
  15412. </p>
  15413. </dd>
  15414. <dt><samp class="option">pkt_size</samp></dt>
  15415. <dd><p>The current packet&rsquo;s size (in bytes).
  15416. </p></dd>
  15417. </dl>
  15418. <a class="anchor" id="drawtext_005fexpansion"></a><a name="Text-expansion"></a>
  15419. <h4 class="subsection">11.75.2 Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  15420. <p>If <samp class="option">expansion</samp> is set to <code class="code">strftime</code>, the filter recognizes
  15421. sequences accepted by the <code class="code">strftime</code> C function in the provided
  15422. text and expands them accordingly. Check the documentation of
  15423. <code class="code">strftime</code>. This feature is deprecated in favor of <code class="code">normal</code>
  15424. expansion with the <code class="code">gmtime</code> or <code class="code">localtime</code> expansion
  15425. functions.
  15426. </p>
  15427. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  15428. </p>
  15429. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  15430. the following expansion mechanism is used.
  15431. </p>
  15432. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  15433. the second character.
  15434. </p>
  15435. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  15436. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  15437. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  15438. they should be escaped.
  15439. </p>
  15440. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  15441. option in the filter argument string and as the filter argument in the
  15442. filtergraph description, and possibly also for the shell, that makes up to four
  15443. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  15444. these problems.
  15445. </p>
  15446. <p>The following functions are available:
  15447. </p>
  15448. <dl class="table">
  15449. <dt><code class="command">expr, e</code></dt>
  15450. <dd><p>The expression evaluation result.
  15451. </p>
  15452. <p>It must take one argument specifying the expression to be evaluated,
  15453. which accepts the same constants and functions as the <var class="var">x</var> and
  15454. <var class="var">y</var> values. Note that not all constants should be used, for
  15455. example the text size is not known when evaluating the expression, so
  15456. the constants <var class="var">text_w</var> and <var class="var">text_h</var> will have an undefined
  15457. value.
  15458. </p>
  15459. </dd>
  15460. <dt><code class="command">expr_int_format, eif</code></dt>
  15461. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  15462. </p>
  15463. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  15464. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  15465. &lsquo;<samp class="samp">X</samp>&rsquo;, &lsquo;<samp class="samp">d</samp>&rsquo; and &lsquo;<samp class="samp">u</samp>&rsquo;. They are treated exactly as in the
  15466. <code class="code">printf</code> function.
  15467. The third parameter is optional and sets the number of positions taken by the output.
  15468. It can be used to add padding with zeros from the left.
  15469. </p>
  15470. </dd>
  15471. <dt><code class="command">gmtime</code></dt>
  15472. <dd><p>The time at which the filter is running, expressed in UTC.
  15473. It can accept an argument: a <code class="code">strftime</code> C function format string.
  15474. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  15475. which prints fractions of the second with optionally specified number of digits.
  15476. </p>
  15477. </dd>
  15478. <dt><code class="command">localtime</code></dt>
  15479. <dd><p>The time at which the filter is running, expressed in the local time zone.
  15480. It can accept an argument: a <code class="code">strftime</code> C function format string.
  15481. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  15482. which prints fractions of the second with optionally specified number of digits.
  15483. </p>
  15484. </dd>
  15485. <dt><code class="command">metadata</code></dt>
  15486. <dd><p>Frame metadata. Takes one or two arguments.
  15487. </p>
  15488. <p>The first argument is mandatory and specifies the metadata key.
  15489. </p>
  15490. <p>The second argument is optional and specifies a default value, used when the
  15491. metadata key is not found or empty.
  15492. </p>
  15493. <p>Available metadata can be identified by inspecting entries
  15494. starting with TAG included within each frame section
  15495. printed by running <code class="code">ffprobe -show_frames</code>.
  15496. </p>
  15497. <p>String metadata generated in filters leading to
  15498. the drawtext filter are also available.
  15499. </p>
  15500. </dd>
  15501. <dt><code class="command">n, frame_num</code></dt>
  15502. <dd><p>The frame number, starting from 0.
  15503. </p>
  15504. </dd>
  15505. <dt><code class="command">pict_type</code></dt>
  15506. <dd><p>A one character description of the current picture type.
  15507. </p>
  15508. </dd>
  15509. <dt><code class="command">pts</code></dt>
  15510. <dd><p>The timestamp of the current frame.
  15511. It can take up to three arguments.
  15512. </p>
  15513. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code>
  15514. for seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands
  15515. for a formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  15516. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  15517. <code class="code">localtime</code> stands for the timestamp of the frame formatted as
  15518. local time zone time.
  15519. </p>
  15520. <p>The second argument is an offset added to the timestamp.
  15521. </p>
  15522. <p>If the format is set to <code class="code">hms</code>, a third argument <code class="code">24HH</code> may be
  15523. supplied to present the hour part of the formatted timestamp in 24h format
  15524. (00-23).
  15525. </p>
  15526. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third
  15527. argument may be supplied: a <code class="code">strftime</code> C function format string.
  15528. By default, <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  15529. </p></dd>
  15530. </dl>
  15531. <a name="Commands-88"></a>
  15532. <h4 class="subsection">11.75.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-88" aria-hidden="true">TOC</a></span></h4>
  15533. <p>This filter supports altering parameters via commands:
  15534. </p><dl class="table">
  15535. <dt><samp class="option">reinit</samp></dt>
  15536. <dd><p>Alter existing filter parameters.
  15537. </p>
  15538. <p>Syntax for the argument is the same as for filter invocation, e.g.
  15539. </p>
  15540. <div class="example">
  15541. <pre class="example-preformatted">fontsize=56:fontcolor=green:text='Hello World'
  15542. </pre></div>
  15543. <p>Full filter invocation with sendcmd would look like this:
  15544. </p>
  15545. <div class="example">
  15546. <pre class="example-preformatted">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  15547. </pre></div>
  15548. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  15549. continue with its existing parameters.
  15550. </p>
  15551. </dd>
  15552. </dl>
  15553. <p>The following options are also supported as <a class="ref" href="#commands">commands</a>:
  15554. </p>
  15555. <ul class="itemize mark-bullet">
  15556. <li>x
  15557. </li><li>y
  15558. </li><li>alpha
  15559. </li><li>fontsize
  15560. </li><li>fontcolor
  15561. </li><li>boxcolor
  15562. </li><li>bordercolor
  15563. </li><li>shadowcolor
  15564. </li><li>box
  15565. </li><li>boxw
  15566. </li><li>boxh
  15567. </li><li>boxborderw
  15568. </li><li>line_spacing
  15569. </li><li>text_align
  15570. </li><li>shadowx
  15571. </li><li>shadowy
  15572. </li><li>borderw
  15573. </li></ul>
  15574. <a name="Examples-70"></a>
  15575. <h4 class="subsection">11.75.4 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-70" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-70" aria-hidden="true">TOC</a></span></h4>
  15576. <ul class="itemize mark-bullet">
  15577. <li>Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  15578. optional parameters.
  15579. <div class="example">
  15580. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  15581. </pre></div>
  15582. </li><li>Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  15583. and y=50 (counting from the top-left corner of the screen), text is
  15584. yellow with a red box around it. Both the text and the box have an
  15585. opacity of 20%.
  15586. <div class="example">
  15587. <pre class="example-preformatted">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  15588. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  15589. </pre></div>
  15590. <p>Note that the double quotes are not necessary if spaces are not used
  15591. within the parameter list.
  15592. </p>
  15593. </li><li>Show the text at the center of the video frame:
  15594. <div class="example">
  15595. <pre class="example-preformatted">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  15596. </pre></div>
  15597. </li><li>Show the text at a random position, switching to a new position every 30 seconds:
  15598. <div class="example">
  15599. <pre class="example-preformatted">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;
  15600. </pre></div>
  15601. </li><li>Show a text line sliding from right to left in the last row of the video
  15602. frame. The file <samp class="file">LONG_LINE</samp> is assumed to contain a single line
  15603. with no newlines.
  15604. <div class="example">
  15605. <pre class="example-preformatted">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  15606. </pre></div>
  15607. </li><li>Show the content of file <samp class="file">CREDITS</samp> off the bottom of the frame and scroll up.
  15608. <div class="example">
  15609. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  15610. </pre></div>
  15611. </li><li>Draw a single green letter &quot;g&quot;, at the center of the input video.
  15612. The glyph baseline is placed at half screen height.
  15613. <div class="example">
  15614. <pre class="example-preformatted">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
  15615. </pre></div>
  15616. </li><li>Show text for 1 second every 3 seconds:
  15617. <div class="example">
  15618. <pre class="example-preformatted">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  15619. </pre></div>
  15620. </li><li>Use fontconfig to set the font. Note that the colons need to be escaped.
  15621. <div class="example">
  15622. <pre class="example-preformatted">drawtext='fontfile=Linux Libertine O-40\\:style=Semibold:text=FFmpeg'
  15623. </pre></div>
  15624. </li><li>Draw &quot;Test Text&quot; with font size dependent on height of the video.
  15625. <div class="example">
  15626. <pre class="example-preformatted">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  15627. </pre></div>
  15628. </li><li>Print the date of a real-time encoding (see documentation for the
  15629. <code class="code">strftime</code> C function):
  15630. <div class="example">
  15631. <pre class="example-preformatted">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  15632. </pre></div>
  15633. </li><li>Show text fading in and out (appearing/disappearing):
  15634. <div class="example">
  15635. <pre class="example-preformatted">#!/bin/sh
  15636. DS=1.0 # display start
  15637. DE=10.0 # display end
  15638. FID=1.5 # fade in duration
  15639. FOD=5 # fade out duration
  15640. 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;
  15641. </pre></div>
  15642. </li><li>Horizontally align multiple separate texts. Note that <samp class="option">max_glyph_a</samp>
  15643. and the <samp class="option">fontsize</samp> value are included in the <samp class="option">y</samp> offset.
  15644. <div class="example">
  15645. <pre class="example-preformatted">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  15646. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  15647. </pre></div>
  15648. </li><li>Plot special <var class="var">lavf.image2dec.source_basename</var> metadata onto each frame if
  15649. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  15650. must have option <samp class="option">-export_path_metadata 1</samp> for the special metadata fields
  15651. to be available for filters.
  15652. <div class="example">
  15653. <pre class="example-preformatted">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  15654. </pre></div>
  15655. </li></ul>
  15656. <p>For more information about libfreetype, check:
  15657. <a class="url" href="http://www.freetype.org/">http://www.freetype.org/</a>.
  15658. </p>
  15659. <p>For more information about fontconfig, check:
  15660. <a class="url" href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  15661. </p>
  15662. <p>For more information about libfribidi, check:
  15663. <a class="url" href="http://fribidi.org/">http://fribidi.org/</a>.
  15664. </p>
  15665. <p>For more information about libharfbuzz, check:
  15666. <a class="url" href="https://github.com/harfbuzz/harfbuzz">https://github.com/harfbuzz/harfbuzz</a>.
  15667. </p>
  15668. <a class="anchor" id="drawvg"></a><a name="drawvg-1"></a>
  15669. <h3 class="section">11.76 drawvg<span class="pull-right"><a class="anchor hidden-xs" href="#drawvg-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawvg-1" aria-hidden="true">TOC</a></span></h3>
  15670. <p>Draw vector graphics on top of video frames, by executing a script written in
  15671. a custom language called VGS (<em class="emph">Vector Graphics Script</em>).
  15672. </p>
  15673. <p>The documentation for the language can be found in
  15674. <a data-manual="drawvg-reference" href="drawvg-reference.html#Top">drawvg - Language Reference</a>. A version of this reference
  15675. with rendered examples can be found at the
  15676. <a class="uref" href="https://ayosec.github.io/ffmpeg-drawvg/playground/docs/langref.html">author&rsquo;s site</a>.
  15677. </p>
  15678. <p>Graphics are rendered using the <a class="uref" href="https://cairographics.org/">cario 2D
  15679. graphics library</a>.
  15680. </p>
  15681. <p>To enable compilation of this filter, you need to configure FFmpeg with
  15682. <code class="code">--enable-cairo</code>.
  15683. </p>
  15684. <a name="Parameters"></a>
  15685. <h4 class="subsection">11.76.1 Parameters<span class="pull-right"><a class="anchor hidden-xs" href="#Parameters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Parameters" aria-hidden="true">TOC</a></span></h4>
  15686. <p>Either <code class="code">script</code> or <code class="code">file</code> must be set.
  15687. </p>
  15688. <dl class="table">
  15689. <dt><samp class="option">s, script</samp></dt>
  15690. <dd><p>Script source to draw the graphics.
  15691. </p>
  15692. </dd>
  15693. <dt><samp class="option">file</samp></dt>
  15694. <dd><p>Path of the file to load the script source.
  15695. </p>
  15696. </dd>
  15697. </dl>
  15698. <a name="Pixel-Formats"></a>
  15699. <h4 class="subsection">11.76.2 Pixel Formats<span class="pull-right"><a class="anchor hidden-xs" href="#Pixel-Formats" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Pixel-Formats" aria-hidden="true">TOC</a></span></h4>
  15700. <p>Since Cairo only supports RGB images, if the input video is something else (like
  15701. YUV 4:2:0), before executing the script the video is converted to a format
  15702. compatible with Cairo. Then, you have to use either the <a class="ref" href="#format">format</a> filter,
  15703. or the <code class="code">-pix_fmt</code> option, to convert it to the expected format in the
  15704. output.
  15705. </p>
  15706. <a name="Examples-71"></a>
  15707. <h4 class="subsection">11.76.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-71" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-71" aria-hidden="true">TOC</a></span></h4>
  15708. <ul class="itemize mark-bullet">
  15709. <li>Draw the outline of an ellipse.
  15710. <div class="example">
  15711. <pre class="example-preformatted">ffmpeg -i input.webm \
  15712. -vf 'drawvg=ellipse (w/2) (h/2) (w/3) (h/3) stroke' \
  15713. -pix_fmt yuv420p \
  15714. output.webm
  15715. </pre></div>
  15716. </li><li>
  15717. Draw a square rotating in the middle of the frame.
  15718. <p>The script for drawvg is in a file <code class="code">draw.vgs</code>:
  15719. </p>
  15720. <div class="example">
  15721. <pre class="example-preformatted">translate (w/2) (h/2)
  15722. rotate t
  15723. rect -100 -100 200 200
  15724. setcolor red@0.5
  15725. fill
  15726. </pre></div>
  15727. <p>Then:
  15728. </p>
  15729. <div class="example">
  15730. <pre class="example-preformatted">ffmpeg -i input.webm -vf 'drawvg=file=draw.vgs,format=yuv420p' output.webm
  15731. </pre></div>
  15732. </li></ul>
  15733. <a name="edgedetect"></a>
  15734. <h3 class="section">11.77 edgedetect<span class="pull-right"><a class="anchor hidden-xs" href="#edgedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-edgedetect" aria-hidden="true">TOC</a></span></h3>
  15735. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  15736. </p>
  15737. <p>The filter accepts the following options:
  15738. </p>
  15739. <dl class="table">
  15740. <dt><samp class="option">low</samp></dt>
  15741. <dt><samp class="option">high</samp></dt>
  15742. <dd><p>Set low and high threshold values used by the Canny thresholding
  15743. algorithm.
  15744. </p>
  15745. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  15746. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  15747. by the low threshold.
  15748. </p>
  15749. <p><var class="var">low</var> and <var class="var">high</var> threshold values must be chosen in the range
  15750. [0,1], and <var class="var">low</var> should be lesser or equal to <var class="var">high</var>.
  15751. </p>
  15752. <p>Default value for <var class="var">low</var> is <code class="code">20/255</code>, and default value for <var class="var">high</var>
  15753. is <code class="code">50/255</code>.
  15754. </p>
  15755. </dd>
  15756. <dt><samp class="option">mode</samp></dt>
  15757. <dd><p>Define the drawing mode.
  15758. </p>
  15759. <dl class="table">
  15760. <dt>&lsquo;<samp class="samp">wires</samp>&rsquo;</dt>
  15761. <dd><p>Draw white/gray wires on black background.
  15762. </p>
  15763. </dd>
  15764. <dt>&lsquo;<samp class="samp">colormix</samp>&rsquo;</dt>
  15765. <dd><p>Mix the colors to create a paint/cartoon effect.
  15766. </p>
  15767. </dd>
  15768. <dt>&lsquo;<samp class="samp">canny</samp>&rsquo;</dt>
  15769. <dd><p>Apply Canny edge detector on all selected planes.
  15770. </p></dd>
  15771. </dl>
  15772. <p>Default value is <var class="var">wires</var>.
  15773. </p>
  15774. </dd>
  15775. <dt><samp class="option">planes</samp></dt>
  15776. <dd><p>Select planes for filtering. By default all available planes are filtered.
  15777. </p></dd>
  15778. </dl>
  15779. <a name="Examples-72"></a>
  15780. <h4 class="subsection">11.77.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-72" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-72" aria-hidden="true">TOC</a></span></h4>
  15781. <ul class="itemize mark-bullet">
  15782. <li>Standard edge detection with custom values for the hysteresis thresholding:
  15783. <div class="example">
  15784. <pre class="example-preformatted">edgedetect=low=0.1:high=0.4
  15785. </pre></div>
  15786. </li><li>Painting effect without thresholding:
  15787. <div class="example">
  15788. <pre class="example-preformatted">edgedetect=mode=colormix:high=0
  15789. </pre></div>
  15790. </li></ul>
  15791. <a name="elbg"></a>
  15792. <h3 class="section">11.78 elbg<span class="pull-right"><a class="anchor hidden-xs" href="#elbg" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-elbg" aria-hidden="true">TOC</a></span></h3>
  15793. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  15794. </p>
  15795. <p>For each input image, the filter will compute the optimal mapping from
  15796. the input to the output given the codebook length, that is the number
  15797. of distinct output colors.
  15798. </p>
  15799. <p>This filter accepts the following options.
  15800. </p>
  15801. <dl class="table">
  15802. <dt><samp class="option">codebook_length, l</samp></dt>
  15803. <dd><p>Set codebook length. The value must be a positive integer, and
  15804. represents the number of distinct output colors. Default value is 256.
  15805. </p>
  15806. </dd>
  15807. <dt><samp class="option">nb_steps, n</samp></dt>
  15808. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  15809. mapping. The higher the value the better the result and the higher the
  15810. computation time. Default value is 1.
  15811. </p>
  15812. </dd>
  15813. <dt><samp class="option">seed, s</samp></dt>
  15814. <dd><p>Set a random seed, must be an integer included between 0 and
  15815. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  15816. will try to use a good random seed on a best effort basis.
  15817. </p>
  15818. </dd>
  15819. <dt><samp class="option">pal8</samp></dt>
  15820. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  15821. length greater than 256. Default is disabled.
  15822. </p>
  15823. </dd>
  15824. <dt><samp class="option">use_alpha</samp></dt>
  15825. <dd><p>Include alpha values in the quantization calculation. Allows creating
  15826. palettized output images (e.g. PNG8) with multiple alpha smooth blending.
  15827. </p></dd>
  15828. </dl>
  15829. <a name="entropy"></a>
  15830. <h3 class="section">11.79 entropy<span class="pull-right"><a class="anchor hidden-xs" href="#entropy" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-entropy" aria-hidden="true">TOC</a></span></h3>
  15831. <p>Measure graylevel entropy in histogram of color channels of video frames.
  15832. </p>
  15833. <p>It accepts the following parameters:
  15834. </p>
  15835. <dl class="table">
  15836. <dt><samp class="option">mode</samp></dt>
  15837. <dd><p>Can be either <var class="var">normal</var> or <var class="var">diff</var>. Default is <var class="var">normal</var>.
  15838. </p>
  15839. <p><var class="var">diff</var> mode measures entropy of histogram delta values, absolute differences
  15840. between neighbour histogram values.
  15841. </p></dd>
  15842. </dl>
  15843. <a name="epx"></a>
  15844. <h3 class="section">11.80 epx<span class="pull-right"><a class="anchor hidden-xs" href="#epx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-epx" aria-hidden="true">TOC</a></span></h3>
  15845. <p>Apply the EPX magnification filter which is designed for pixel art.
  15846. </p>
  15847. <p>It accepts the following option:
  15848. </p>
  15849. <dl class="table">
  15850. <dt><samp class="option">n</samp></dt>
  15851. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xEPX</code>, <code class="code">3</code> for
  15852. <code class="code">3xEPX</code>.
  15853. Default is <code class="code">3</code>.
  15854. </p></dd>
  15855. </dl>
  15856. <a name="eq"></a>
  15857. <h3 class="section">11.81 eq<span class="pull-right"><a class="anchor hidden-xs" href="#eq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-eq" aria-hidden="true">TOC</a></span></h3>
  15858. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  15859. </p>
  15860. <p>The filter accepts the following options:
  15861. </p>
  15862. <dl class="table">
  15863. <dt><samp class="option">contrast</samp></dt>
  15864. <dd><p>Set the contrast expression. The value must be a float value in range
  15865. <code class="code">-1000.0</code> to <code class="code">1000.0</code>. The default value is &quot;1&quot;.
  15866. </p>
  15867. </dd>
  15868. <dt><samp class="option">brightness</samp></dt>
  15869. <dd><p>Set the brightness expression. The value must be a float value in
  15870. range <code class="code">-1.0</code> to <code class="code">1.0</code>. The default value is &quot;0&quot;.
  15871. </p>
  15872. </dd>
  15873. <dt><samp class="option">saturation</samp></dt>
  15874. <dd><p>Set the saturation expression. The value must be a float in
  15875. range <code class="code">0.0</code> to <code class="code">3.0</code>. The default value is &quot;1&quot;.
  15876. </p>
  15877. </dd>
  15878. <dt><samp class="option">gamma</samp></dt>
  15879. <dd><p>Set the gamma expression. The value must be a float in range
  15880. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  15881. </p>
  15882. </dd>
  15883. <dt><samp class="option">gamma_r</samp></dt>
  15884. <dd><p>Set the gamma expression for red. The value must be a float in
  15885. range <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  15886. </p>
  15887. </dd>
  15888. <dt><samp class="option">gamma_g</samp></dt>
  15889. <dd><p>Set the gamma expression for green. The value must be a float in range
  15890. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  15891. </p>
  15892. </dd>
  15893. <dt><samp class="option">gamma_b</samp></dt>
  15894. <dd><p>Set the gamma expression for blue. The value must be a float in range
  15895. <code class="code">0.1</code> to <code class="code">10.0</code>. The default value is &quot;1&quot;.
  15896. </p>
  15897. </dd>
  15898. <dt><samp class="option">gamma_weight</samp></dt>
  15899. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  15900. of a high gamma value on bright image areas, e.g. keep them from
  15901. getting overamplified and just plain white. The value must be a float
  15902. in range <code class="code">0.0</code> to <code class="code">1.0</code>. A value of <code class="code">0.0</code> turns the
  15903. gamma correction all the way down while <code class="code">1.0</code> leaves it at its
  15904. full strength. Default is &quot;1&quot;.
  15905. </p>
  15906. </dd>
  15907. <dt><samp class="option">eval</samp></dt>
  15908. <dd><p>Set when the expressions for brightness, contrast, saturation and
  15909. gamma expressions are evaluated.
  15910. </p>
  15911. <p>It accepts the following values:
  15912. </p><dl class="table">
  15913. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  15914. <dd><p>only evaluate expressions once during the filter initialization or
  15915. when a command is processed
  15916. </p>
  15917. </dd>
  15918. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  15919. <dd><p>evaluate expressions for each incoming frame
  15920. </p></dd>
  15921. </dl>
  15922. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  15923. </p></dd>
  15924. </dl>
  15925. <p>The expressions accept the following parameters:
  15926. </p><dl class="table">
  15927. <dt><samp class="option">n</samp></dt>
  15928. <dd><p>frame count of the input frame starting from 0
  15929. </p>
  15930. </dd>
  15931. <dt><samp class="option">pos</samp></dt>
  15932. <dd><p>byte position of the corresponding packet in the input file, NAN if
  15933. unspecified; deprecated, do not use
  15934. </p>
  15935. </dd>
  15936. <dt><samp class="option">r</samp></dt>
  15937. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  15938. </p>
  15939. </dd>
  15940. <dt><samp class="option">t</samp></dt>
  15941. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  15942. </p></dd>
  15943. </dl>
  15944. <a name="Commands-89"></a>
  15945. <h4 class="subsection">11.81.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-89" aria-hidden="true">TOC</a></span></h4>
  15946. <p>The filter supports the following commands:
  15947. </p>
  15948. <dl class="table">
  15949. <dt><samp class="option">contrast</samp></dt>
  15950. <dd><p>Set the contrast expression.
  15951. </p>
  15952. </dd>
  15953. <dt><samp class="option">brightness</samp></dt>
  15954. <dd><p>Set the brightness expression.
  15955. </p>
  15956. </dd>
  15957. <dt><samp class="option">saturation</samp></dt>
  15958. <dd><p>Set the saturation expression.
  15959. </p>
  15960. </dd>
  15961. <dt><samp class="option">gamma</samp></dt>
  15962. <dd><p>Set the gamma expression.
  15963. </p>
  15964. </dd>
  15965. <dt><samp class="option">gamma_r</samp></dt>
  15966. <dd><p>Set the gamma_r expression.
  15967. </p>
  15968. </dd>
  15969. <dt><samp class="option">gamma_g</samp></dt>
  15970. <dd><p>Set gamma_g expression.
  15971. </p>
  15972. </dd>
  15973. <dt><samp class="option">gamma_b</samp></dt>
  15974. <dd><p>Set gamma_b expression.
  15975. </p>
  15976. </dd>
  15977. <dt><samp class="option">gamma_weight</samp></dt>
  15978. <dd><p>Set gamma_weight expression.
  15979. </p>
  15980. <p>The command accepts the same syntax of the corresponding option.
  15981. </p>
  15982. <p>If the specified expression is not valid, it is kept at its current
  15983. value.
  15984. </p>
  15985. </dd>
  15986. </dl>
  15987. <a class="anchor" id="erosion"></a><a name="erosion-1"></a>
  15988. <h3 class="section">11.82 erosion<span class="pull-right"><a class="anchor hidden-xs" href="#erosion-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion-1" aria-hidden="true">TOC</a></span></h3>
  15989. <p>Apply erosion effect to the video.
  15990. </p>
  15991. <p>This filter replaces the pixel by the local(3x3) minimum.
  15992. </p>
  15993. <p>It accepts the following options:
  15994. </p>
  15995. <dl class="table">
  15996. <dt><samp class="option">threshold0</samp></dt>
  15997. <dt><samp class="option">threshold1</samp></dt>
  15998. <dt><samp class="option">threshold2</samp></dt>
  15999. <dt><samp class="option">threshold3</samp></dt>
  16000. <dd><p>Limit the maximum change for each plane, default is 65535.
  16001. If 0, plane will remain unchanged.
  16002. </p>
  16003. </dd>
  16004. <dt><samp class="option">coordinates</samp></dt>
  16005. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  16006. pixels are used.
  16007. </p>
  16008. <p>Flags to local 3x3 coordinates maps like this:
  16009. </p>
  16010. <p>1 2 3
  16011. 4 5
  16012. 6 7 8
  16013. </p></dd>
  16014. </dl>
  16015. <a name="Commands-90"></a>
  16016. <h4 class="subsection">11.82.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-90" aria-hidden="true">TOC</a></span></h4>
  16017. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  16018. </p>
  16019. <a name="estdif"></a>
  16020. <h3 class="section">11.83 estdif<span class="pull-right"><a class="anchor hidden-xs" href="#estdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-estdif" aria-hidden="true">TOC</a></span></h3>
  16021. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  16022. Tracing Deinterlacing Filter&quot;).
  16023. </p>
  16024. <p>Spatial only filter that uses edge slope tracing algorithm
  16025. to interpolate missing lines.
  16026. It accepts the following parameters:
  16027. </p>
  16028. <dl class="table">
  16029. <dt><samp class="option">mode</samp></dt>
  16030. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  16031. </p>
  16032. <dl class="table">
  16033. <dt><samp class="option">frame</samp></dt>
  16034. <dd><p>Output one frame for each frame.
  16035. </p></dd>
  16036. <dt><samp class="option">field</samp></dt>
  16037. <dd><p>Output one frame for each field.
  16038. </p></dd>
  16039. </dl>
  16040. <p>The default value is <code class="code">field</code>.
  16041. </p>
  16042. </dd>
  16043. <dt><samp class="option">parity</samp></dt>
  16044. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  16045. of the following values:
  16046. </p>
  16047. <dl class="table">
  16048. <dt><samp class="option">tff</samp></dt>
  16049. <dd><p>Assume the top field is first.
  16050. </p></dd>
  16051. <dt><samp class="option">bff</samp></dt>
  16052. <dd><p>Assume the bottom field is first.
  16053. </p></dd>
  16054. <dt><samp class="option">auto</samp></dt>
  16055. <dd><p>Enable automatic detection of field parity.
  16056. </p></dd>
  16057. </dl>
  16058. <p>The default value is <code class="code">auto</code>.
  16059. If the interlacing is unknown or the decoder does not export this information,
  16060. top field first will be assumed.
  16061. </p>
  16062. </dd>
  16063. <dt><samp class="option">deint</samp></dt>
  16064. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  16065. values:
  16066. </p>
  16067. <dl class="table">
  16068. <dt><samp class="option">all</samp></dt>
  16069. <dd><p>Deinterlace all frames.
  16070. </p></dd>
  16071. <dt><samp class="option">interlaced</samp></dt>
  16072. <dd><p>Only deinterlace frames marked as interlaced.
  16073. </p></dd>
  16074. </dl>
  16075. <p>The default value is <code class="code">all</code>.
  16076. </p>
  16077. </dd>
  16078. <dt><samp class="option">rslope</samp></dt>
  16079. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  16080. Allowed range is from 1 to 15.
  16081. </p>
  16082. </dd>
  16083. <dt><samp class="option">redge</samp></dt>
  16084. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  16085. Allowed range is from 0 to 15.
  16086. </p>
  16087. </dd>
  16088. <dt><samp class="option">ecost</samp></dt>
  16089. <dd><p>Specify the edge cost for edge matching. Default value is 2.
  16090. Allowed range is from 0 to 50.
  16091. </p>
  16092. </dd>
  16093. <dt><samp class="option">mcost</samp></dt>
  16094. <dd><p>Specify the middle cost for edge matching. Default value is 1.
  16095. Allowed range is from 0 to 50.
  16096. </p>
  16097. </dd>
  16098. <dt><samp class="option">dcost</samp></dt>
  16099. <dd><p>Specify the distance cost for edge matching. Default value is 1.
  16100. Allowed range is from 0 to 50.
  16101. </p>
  16102. </dd>
  16103. <dt><samp class="option">interp</samp></dt>
  16104. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  16105. of the following values:
  16106. </p>
  16107. <dl class="table">
  16108. <dt><samp class="option">2p</samp></dt>
  16109. <dd><p>Two-point interpolation.
  16110. </p></dd>
  16111. <dt><samp class="option">4p</samp></dt>
  16112. <dd><p>Four-point interpolation.
  16113. </p></dd>
  16114. <dt><samp class="option">6p</samp></dt>
  16115. <dd><p>Six-point interpolation.
  16116. </p></dd>
  16117. </dl>
  16118. </dd>
  16119. </dl>
  16120. <a name="Commands-91"></a>
  16121. <h4 class="subsection">11.83.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-91" aria-hidden="true">TOC</a></span></h4>
  16122. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  16123. </p>
  16124. <a name="exposure"></a>
  16125. <h3 class="section">11.84 exposure<span class="pull-right"><a class="anchor hidden-xs" href="#exposure" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-exposure" aria-hidden="true">TOC</a></span></h3>
  16126. <p>Adjust exposure of the video stream.
  16127. </p>
  16128. <p>The filter accepts the following options:
  16129. </p>
  16130. <dl class="table">
  16131. <dt><samp class="option">exposure</samp></dt>
  16132. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  16133. Default value is 0 EV.
  16134. </p>
  16135. </dd>
  16136. <dt><samp class="option">black</samp></dt>
  16137. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  16138. Default value is 0.
  16139. </p></dd>
  16140. </dl>
  16141. <a name="Commands-92"></a>
  16142. <h4 class="subsection">11.84.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-92" aria-hidden="true">TOC</a></span></h4>
  16143. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  16144. </p>
  16145. <a name="extractplanes"></a>
  16146. <h3 class="section">11.85 extractplanes<span class="pull-right"><a class="anchor hidden-xs" href="#extractplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-extractplanes" aria-hidden="true">TOC</a></span></h3>
  16147. <p>Extract color channel components from input video stream into
  16148. separate grayscale video streams.
  16149. </p>
  16150. <p>The filter accepts the following option:
  16151. </p>
  16152. <dl class="table">
  16153. <dt><samp class="option">planes</samp></dt>
  16154. <dd><p>Set plane(s) to extract.
  16155. </p>
  16156. <p>Available values for planes are:
  16157. </p><dl class="table">
  16158. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  16159. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  16160. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  16161. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  16162. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  16163. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  16164. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  16165. </dl>
  16166. <p>Choosing planes not available in the input will result in an error.
  16167. That means you cannot select <code class="code">r</code>, <code class="code">g</code>, <code class="code">b</code> planes
  16168. with <code class="code">y</code>, <code class="code">u</code>, <code class="code">v</code> planes at same time.
  16169. </p></dd>
  16170. </dl>
  16171. <a name="Examples-73"></a>
  16172. <h4 class="subsection">11.85.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-73" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-73" aria-hidden="true">TOC</a></span></h4>
  16173. <ul class="itemize mark-bullet">
  16174. <li>Extract luma, u and v color channel component from input video frame
  16175. into 3 grayscale outputs:
  16176. <div class="example">
  16177. <pre class="example-preformatted">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
  16178. </pre></div>
  16179. </li></ul>
  16180. <a name="fade"></a>
  16181. <h3 class="section">11.86 fade<span class="pull-right"><a class="anchor hidden-xs" href="#fade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fade" aria-hidden="true">TOC</a></span></h3>
  16182. <p>Apply a fade-in/out effect to the input video.
  16183. </p>
  16184. <p>It accepts the following parameters:
  16185. </p>
  16186. <dl class="table">
  16187. <dt><samp class="option">type, t</samp></dt>
  16188. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  16189. effect.
  16190. Default is <code class="code">in</code>.
  16191. </p>
  16192. </dd>
  16193. <dt><samp class="option">start_frame, s</samp></dt>
  16194. <dd><p>Specify the number of the frame to start applying the fade
  16195. effect at. Default is 0.
  16196. </p>
  16197. </dd>
  16198. <dt><samp class="option">nb_frames, n</samp></dt>
  16199. <dd><p>The number of frames that the fade effect lasts. At the end of the
  16200. fade-in effect, the output video will have the same intensity as the input video.
  16201. At the end of the fade-out transition, the output video will be filled with the
  16202. selected <samp class="option">color</samp>.
  16203. Default is 25.
  16204. </p>
  16205. </dd>
  16206. <dt><samp class="option">alpha</samp></dt>
  16207. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  16208. Default value is 0.
  16209. </p>
  16210. </dd>
  16211. <dt><samp class="option">start_time, st</samp></dt>
  16212. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  16213. effect. If both start_frame and start_time are specified, the fade will start at
  16214. whichever comes last. Default is 0.
  16215. </p>
  16216. </dd>
  16217. <dt><samp class="option">duration, d</samp></dt>
  16218. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  16219. fade-in effect the output video will have the same intensity as the input video,
  16220. at the end of the fade-out transition the output video will be filled with the
  16221. selected <samp class="option">color</samp>.
  16222. If both duration and nb_frames are specified, duration is used. Default is 0
  16223. (nb_frames is used by default).
  16224. </p>
  16225. </dd>
  16226. <dt><samp class="option">color, c</samp></dt>
  16227. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  16228. </p></dd>
  16229. </dl>
  16230. <a name="Examples-74"></a>
  16231. <h4 class="subsection">11.86.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-74" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-74" aria-hidden="true">TOC</a></span></h4>
  16232. <ul class="itemize mark-bullet">
  16233. <li>Fade in the first 30 frames of video:
  16234. <div class="example">
  16235. <pre class="example-preformatted">fade=in:0:30
  16236. </pre></div>
  16237. <p>The command above is equivalent to:
  16238. </p><div class="example">
  16239. <pre class="example-preformatted">fade=t=in:s=0:n=30
  16240. </pre></div>
  16241. </li><li>Fade out the last 45 frames of a 200-frame video:
  16242. <div class="example">
  16243. <pre class="example-preformatted">fade=out:155:45
  16244. fade=type=out:start_frame=155:nb_frames=45
  16245. </pre></div>
  16246. </li><li>Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  16247. <div class="example">
  16248. <pre class="example-preformatted">fade=in:0:25, fade=out:975:25
  16249. </pre></div>
  16250. </li><li>Make the first 5 frames yellow, then fade in from frame 5-24:
  16251. <div class="example">
  16252. <pre class="example-preformatted">fade=in:5:20:color=yellow
  16253. </pre></div>
  16254. </li><li>Fade in alpha over first 25 frames of video:
  16255. <div class="example">
  16256. <pre class="example-preformatted">fade=in:0:25:alpha=1
  16257. </pre></div>
  16258. </li><li>Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  16259. <div class="example">
  16260. <pre class="example-preformatted">fade=t=in:st=5.5:d=0.5
  16261. </pre></div>
  16262. </li></ul>
  16263. <a name="feedback"></a>
  16264. <h3 class="section">11.87 feedback<span class="pull-right"><a class="anchor hidden-xs" href="#feedback" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-feedback" aria-hidden="true">TOC</a></span></h3>
  16265. <p>Apply feedback video filter.
  16266. </p>
  16267. <p>This filter pass cropped input frames to 2nd output.
  16268. From there it can be filtered with other video filters.
  16269. After filter receives frame from 2nd input, that frame
  16270. is combined on top of original frame from 1st input and passed
  16271. to 1st output.
  16272. </p>
  16273. <p>The typical usage is filter only part of frame.
  16274. </p>
  16275. <p>The filter accepts the following options:
  16276. </p><dl class="table">
  16277. <dt><samp class="option">x</samp></dt>
  16278. <dt><samp class="option">y</samp></dt>
  16279. <dd><p>Set the top left crop position.
  16280. </p>
  16281. </dd>
  16282. <dt><samp class="option">w</samp></dt>
  16283. <dt><samp class="option">h</samp></dt>
  16284. <dd><p>Set the crop size.
  16285. </p></dd>
  16286. </dl>
  16287. <a name="Examples-75"></a>
  16288. <h4 class="subsection">11.87.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-75" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-75" aria-hidden="true">TOC</a></span></h4>
  16289. <ul class="itemize mark-bullet">
  16290. <li>Blur only top left rectangular part of video frame size 100x100 with gblur filter.
  16291. <div class="example">
  16292. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]gblur=8[blurin]
  16293. </pre></div>
  16294. </li><li>Draw black box on top left part of video frame of size 100x100 with drawbox filter.
  16295. <div class="example">
  16296. <pre class="example-preformatted">[in][blurin]feedback=x=0:y=0:w=100:h=100[out][blurout];[blurout]drawbox=x=0:y=0:w=100:h=100:t=100[blurin]
  16297. </pre></div>
  16298. </li><li>Pixelize rectangular part of video frame of size 100x100 with pixelize filter.
  16299. <div class="example">
  16300. <pre class="example-preformatted">[in][blurin]feedback=x=320:y=240:w=100:h=100[out][blurout];[blurout]pixelize[blurin]
  16301. </pre></div>
  16302. </li></ul>
  16303. <a name="fftdnoiz"></a>
  16304. <h3 class="section">11.88 fftdnoiz<span class="pull-right"><a class="anchor hidden-xs" href="#fftdnoiz" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftdnoiz" aria-hidden="true">TOC</a></span></h3>
  16305. <p>Denoise frames using 3D FFT (frequency domain filtering).
  16306. </p>
  16307. <p>The filter accepts the following options:
  16308. </p>
  16309. <dl class="table">
  16310. <dt><samp class="option">sigma</samp></dt>
  16311. <dd><p>Set the noise sigma constant. This sets denoising strength.
  16312. Default value is 1. Allowed range is from 0 to 30.
  16313. Using very high sigma with low overlap may give blocking artifacts.
  16314. </p>
  16315. </dd>
  16316. <dt><samp class="option">amount</samp></dt>
  16317. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  16318. Default value is 1. Allowed range is from 0 to 1.
  16319. </p>
  16320. </dd>
  16321. <dt><samp class="option">block</samp></dt>
  16322. <dd><p>Set size of block in pixels, Default is 32, can be 8 to 256.
  16323. </p>
  16324. </dd>
  16325. <dt><samp class="option">overlap</samp></dt>
  16326. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  16327. </p>
  16328. </dd>
  16329. <dt><samp class="option">method</samp></dt>
  16330. <dd><p>Set denoising method. Default is <code class="code">wiener</code>, can also be <code class="code">hard</code>.
  16331. </p>
  16332. </dd>
  16333. <dt><samp class="option">prev</samp></dt>
  16334. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  16335. </p>
  16336. </dd>
  16337. <dt><samp class="option">next</samp></dt>
  16338. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  16339. </p>
  16340. </dd>
  16341. <dt><samp class="option">planes</samp></dt>
  16342. <dd><p>Set planes which will be filtered, by default are all available filtered
  16343. except alpha.
  16344. </p></dd>
  16345. </dl>
  16346. <a name="fftfilt"></a>
  16347. <h3 class="section">11.89 fftfilt<span class="pull-right"><a class="anchor hidden-xs" href="#fftfilt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fftfilt" aria-hidden="true">TOC</a></span></h3>
  16348. <p>Apply arbitrary expressions to samples in frequency domain
  16349. </p>
  16350. <dl class="table">
  16351. <dt><samp class="option">dc_Y</samp></dt>
  16352. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  16353. accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The default
  16354. value is set to <code class="code">0</code>.
  16355. </p>
  16356. </dd>
  16357. <dt><samp class="option">dc_U</samp></dt>
  16358. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  16359. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  16360. default value is set to <code class="code">0</code>.
  16361. </p>
  16362. </dd>
  16363. <dt><samp class="option">dc_V</samp></dt>
  16364. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  16365. filter accepts an integer value in range <code class="code">0</code> to <code class="code">1000</code>. The
  16366. default value is set to <code class="code">0</code>.
  16367. </p>
  16368. </dd>
  16369. <dt><samp class="option">weight_Y</samp></dt>
  16370. <dd><p>Set the frequency domain weight expression for the luma plane.
  16371. </p>
  16372. </dd>
  16373. <dt><samp class="option">weight_U</samp></dt>
  16374. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  16375. </p>
  16376. </dd>
  16377. <dt><samp class="option">weight_V</samp></dt>
  16378. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  16379. </p>
  16380. </dd>
  16381. <dt><samp class="option">eval</samp></dt>
  16382. <dd><p>Set when the expressions are evaluated.
  16383. </p>
  16384. <p>It accepts the following values:
  16385. </p><dl class="table">
  16386. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  16387. <dd><p>Only evaluate expressions once during the filter initialization.
  16388. </p>
  16389. </dd>
  16390. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  16391. <dd><p>Evaluate expressions for each incoming frame.
  16392. </p></dd>
  16393. </dl>
  16394. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  16395. </p>
  16396. <p>The filter accepts the following variables:
  16397. </p></dd>
  16398. <dt><samp class="option">X</samp></dt>
  16399. <dt><samp class="option">Y</samp></dt>
  16400. <dd><p>The coordinates of the current sample.
  16401. </p>
  16402. </dd>
  16403. <dt><samp class="option">W</samp></dt>
  16404. <dt><samp class="option">H</samp></dt>
  16405. <dd><p>The width and height of the image.
  16406. </p>
  16407. </dd>
  16408. <dt><samp class="option">N</samp></dt>
  16409. <dd><p>The number of input frame, starting from 0.
  16410. </p>
  16411. </dd>
  16412. <dt><samp class="option">WS</samp></dt>
  16413. <dt><samp class="option">HS</samp></dt>
  16414. <dd><p>The size of FFT array for horizontal and vertical processing.
  16415. </p></dd>
  16416. </dl>
  16417. <a name="Examples-76"></a>
  16418. <h4 class="subsection">11.89.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-76" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-76" aria-hidden="true">TOC</a></span></h4>
  16419. <ul class="itemize mark-bullet">
  16420. <li>High-pass:
  16421. <div class="example">
  16422. <pre class="example-preformatted">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  16423. </pre></div>
  16424. </li><li>Low-pass:
  16425. <div class="example">
  16426. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  16427. </pre></div>
  16428. </li><li>Sharpen:
  16429. <div class="example">
  16430. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  16431. </pre></div>
  16432. </li><li>Blur:
  16433. <div class="example">
  16434. <pre class="example-preformatted">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  16435. </pre></div>
  16436. </li></ul>
  16437. <a name="field"></a>
  16438. <h3 class="section">11.90 field<span class="pull-right"><a class="anchor hidden-xs" href="#field" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-field" aria-hidden="true">TOC</a></span></h3>
  16439. <p>Extract a single field from an interlaced image using stride
  16440. arithmetic to avoid wasting CPU time. The output frames are marked as
  16441. non-interlaced.
  16442. </p>
  16443. <p>The filter accepts the following options:
  16444. </p>
  16445. <dl class="table">
  16446. <dt><samp class="option">type</samp></dt>
  16447. <dd><p>Specify whether to extract the top (if the value is <code class="code">0</code> or
  16448. <code class="code">top</code>) or the bottom field (if the value is <code class="code">1</code> or
  16449. <code class="code">bottom</code>).
  16450. </p></dd>
  16451. </dl>
  16452. <a name="fieldhint"></a>
  16453. <h3 class="section">11.91 fieldhint<span class="pull-right"><a class="anchor hidden-xs" href="#fieldhint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldhint" aria-hidden="true">TOC</a></span></h3>
  16454. <p>Create new frames by copying the top and bottom fields from surrounding frames
  16455. supplied as numbers by the hint file.
  16456. </p>
  16457. <dl class="table">
  16458. <dt><samp class="option">hint</samp></dt>
  16459. <dd><p>Set file containing hints: absolute/relative frame numbers.
  16460. </p>
  16461. <p>There must be one line for each frame in a clip. Each line must contain two
  16462. numbers separated by the comma, optionally followed by <code class="code">-</code> or <code class="code">+</code>.
  16463. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  16464. is current frame number for <code class="code">absolute</code> mode or out of [-1, 1] range
  16465. for <code class="code">relative</code> mode. First number tells from which frame to pick up top
  16466. field and second number tells from which frame to pick up bottom field.
  16467. </p>
  16468. <p>If optionally followed by <code class="code">+</code> output frame will be marked as interlaced,
  16469. else if followed by <code class="code">-</code> output frame will be marked as progressive, else
  16470. it will be marked same as input frame.
  16471. If optionally followed by <code class="code">t</code> output frame will use only top field, or in
  16472. case of <code class="code">b</code> it will use only bottom field.
  16473. If line starts with <code class="code">#</code> or <code class="code">;</code> that line is skipped.
  16474. </p>
  16475. </dd>
  16476. <dt><samp class="option">mode</samp></dt>
  16477. <dd><p>Can be item <code class="code">absolute</code> or <code class="code">relative</code> or <code class="code">pattern</code>. Default is <code class="code">absolute</code>.
  16478. The <code class="code">pattern</code> mode is same as <code class="code">relative</code> mode, except at last entry of file if there
  16479. are more frames to process than <code class="code">hint</code> file is seek back to start.
  16480. </p></dd>
  16481. </dl>
  16482. <p>Example of first several lines of <code class="code">hint</code> file for <code class="code">relative</code> mode:
  16483. </p><div class="example">
  16484. <pre class="example-preformatted">0,0 - # first frame
  16485. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  16486. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  16487. 1,0 -
  16488. 0,0 -
  16489. 0,0 -
  16490. 1,0 -
  16491. 1,0 -
  16492. 1,0 -
  16493. 0,0 -
  16494. 0,0 -
  16495. 1,0 -
  16496. 1,0 -
  16497. 1,0 -
  16498. 0,0 -
  16499. </pre></div>
  16500. <a name="fieldmatch"></a>
  16501. <h3 class="section">11.92 fieldmatch<span class="pull-right"><a class="anchor hidden-xs" href="#fieldmatch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldmatch" aria-hidden="true">TOC</a></span></h3>
  16502. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  16503. progressive frames from a telecined stream. The filter does not drop duplicated
  16504. frames, so to achieve a complete inverse telecine <code class="code">fieldmatch</code> needs to be
  16505. followed by a decimation filter such as <a class="ref" href="#decimate">decimate</a> in the filtergraph.
  16506. </p>
  16507. <p>The separation of the field matching and the decimation is notably motivated by
  16508. the possibility of inserting a de-interlacing filter fallback between the two.
  16509. If the source has mixed telecined and real interlaced content,
  16510. <code class="code">fieldmatch</code> will not be able to match fields for the interlaced parts.
  16511. But these remaining combed frames will be marked as interlaced, and thus can be
  16512. de-interlaced by a later filter such as <a class="ref" href="#yadif">yadif</a> before decimation.
  16513. </p>
  16514. <p>In addition to the various configuration options, <code class="code">fieldmatch</code> can take an
  16515. optional second stream, activated through the <samp class="option">ppsrc</samp> option. If
  16516. enabled, the frames reconstruction will be based on the fields and frames from
  16517. this second stream. This allows the first input to be pre-processed in order to
  16518. help the various algorithms of the filter, while keeping the output lossless
  16519. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  16520. or brightness/contrast adjustments can help.
  16521. </p>
  16522. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  16523. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  16524. which <code class="code">fieldmatch</code> is based on. While the semantic and usage are very
  16525. close, some behaviour and options names can differ.
  16526. </p>
  16527. <p>The <a class="ref" href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  16528. If your input has mixed telecined (30fps) and progressive content with a lower
  16529. framerate like 24fps use the following filterchain to produce the necessary cfr
  16530. stream: <code class="code">dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  16531. </p>
  16532. <p>The filter accepts the following options:
  16533. </p>
  16534. <dl class="table">
  16535. <dt><samp class="option">order</samp></dt>
  16536. <dd><p>Specify the assumed field order of the input stream. Available values are:
  16537. </p>
  16538. <dl class="table">
  16539. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  16540. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  16541. </p></dd>
  16542. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  16543. <dd><p>Assume bottom field first.
  16544. </p></dd>
  16545. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  16546. <dd><p>Assume top field first.
  16547. </p></dd>
  16548. </dl>
  16549. <p>Note that it is sometimes recommended not to trust the parity announced by the
  16550. stream.
  16551. </p>
  16552. <p>Default value is <var class="var">auto</var>.
  16553. </p>
  16554. </dd>
  16555. <dt><samp class="option">mode</samp></dt>
  16556. <dd><p>Set the matching mode or strategy to use. <samp class="option">pc</samp> mode is the safest in the
  16557. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  16558. possible, but if there are bad edits or blended fields it will end up
  16559. outputting combed frames when a good match might actually exist. On the other
  16560. hand, <samp class="option">pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  16561. but will almost always find a good frame if there is one. The other values are
  16562. all somewhere in between <samp class="option">pc</samp> and <samp class="option">pcn_ub</samp> in terms of risking
  16563. jerkiness and creating duplicate frames versus finding good matches in sections
  16564. with bad edits, orphaned fields, blended fields, etc.
  16565. </p>
  16566. <p>More details about p/c/n/u/b are available in <a class="ref" href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
  16567. </p>
  16568. <p>Available values are:
  16569. </p>
  16570. <dl class="table">
  16571. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  16572. <dd><p>2-way matching (p/c)
  16573. </p></dd>
  16574. <dt>&lsquo;<samp class="samp">pc_n</samp>&rsquo;</dt>
  16575. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  16576. </p></dd>
  16577. <dt>&lsquo;<samp class="samp">pc_u</samp>&rsquo;</dt>
  16578. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  16579. </p></dd>
  16580. <dt>&lsquo;<samp class="samp">pc_n_ub</samp>&rsquo;</dt>
  16581. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  16582. still combed (p/c + n + u/b)
  16583. </p></dd>
  16584. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  16585. <dd><p>3-way matching (p/c/n)
  16586. </p></dd>
  16587. <dt>&lsquo;<samp class="samp">pcn_ub</samp>&rsquo;</dt>
  16588. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  16589. detected as combed (p/c/n + u/b)
  16590. </p></dd>
  16591. </dl>
  16592. <p>The parenthesis at the end indicate the matches that would be used for that
  16593. mode assuming <samp class="option">order</samp>=<var class="var">tff</var> (and <samp class="option">field</samp> on <var class="var">auto</var> or
  16594. <var class="var">top</var>).
  16595. </p>
  16596. <p>In terms of speed <samp class="option">pc</samp> mode is by far the fastest and <samp class="option">pcn_ub</samp> is
  16597. the slowest.
  16598. </p>
  16599. <p>Default value is <var class="var">pc_n</var>.
  16600. </p>
  16601. </dd>
  16602. <dt><samp class="option">ppsrc</samp></dt>
  16603. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  16604. input stream as the clean source to pick the fields from. See the filter
  16605. introduction for more details. It is similar to the <samp class="option">clip2</samp> feature from
  16606. VFM/TFM.
  16607. </p>
  16608. <p>Default value is <code class="code">0</code> (disabled).
  16609. </p>
  16610. </dd>
  16611. <dt><samp class="option">field</samp></dt>
  16612. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  16613. <samp class="option">order</samp> unless you experience matching failures with that setting. In
  16614. certain circumstances changing the field that is used to match from can have a
  16615. large impact on matching performance. Available values are:
  16616. </p>
  16617. <dl class="table">
  16618. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  16619. <dd><p>Automatic (same value as <samp class="option">order</samp>).
  16620. </p></dd>
  16621. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  16622. <dd><p>Match from the bottom field.
  16623. </p></dd>
  16624. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  16625. <dd><p>Match from the top field.
  16626. </p></dd>
  16627. </dl>
  16628. <p>Default value is <var class="var">auto</var>.
  16629. </p>
  16630. </dd>
  16631. <dt><samp class="option">mchroma</samp></dt>
  16632. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  16633. cases it is recommended to leave this enabled. You should set this to <code class="code">0</code>
  16634. only if your clip has bad chroma problems such as heavy rainbowing or other
  16635. artifacts. Setting this to <code class="code">0</code> could also be used to speed things up at
  16636. the cost of some accuracy.
  16637. </p>
  16638. <p>Default value is <code class="code">1</code>.
  16639. </p>
  16640. </dd>
  16641. <dt><samp class="option">y0</samp></dt>
  16642. <dt><samp class="option">y1</samp></dt>
  16643. <dd><p>These define an exclusion band which excludes the lines between <samp class="option">y0</samp> and
  16644. <samp class="option">y1</samp> from being included in the field matching decision. An exclusion
  16645. band can be used to ignore subtitles, a logo, or other things that may
  16646. interfere with the matching. <samp class="option">y0</samp> sets the starting scan line and
  16647. <samp class="option">y1</samp> sets the ending line; all lines in between <samp class="option">y0</samp> and
  16648. <samp class="option">y1</samp> (including <samp class="option">y0</samp> and <samp class="option">y1</samp>) will be ignored. Setting
  16649. <samp class="option">y0</samp> and <samp class="option">y1</samp> to the same value will disable the feature.
  16650. <samp class="option">y0</samp> and <samp class="option">y1</samp> defaults to <code class="code">0</code>.
  16651. </p>
  16652. </dd>
  16653. <dt><samp class="option">scthresh</samp></dt>
  16654. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  16655. the luma plane. Good values are in the <code class="code">[8.0, 14.0]</code> range. Scene change
  16656. detection is only relevant in case <samp class="option">combmatch</samp>=<var class="var">sc</var>. The range for
  16657. <samp class="option">scthresh</samp> is <code class="code">[0.0, 100.0]</code>.
  16658. </p>
  16659. <p>Default value is <code class="code">12.0</code>.
  16660. </p>
  16661. </dd>
  16662. <dt><samp class="option">combmatch</samp></dt>
  16663. <dd><p>When <samp class="option">combatch</samp> is not <var class="var">none</var>, <code class="code">fieldmatch</code> will take into
  16664. account the combed scores of matches when deciding what match to use as the
  16665. final match. Available values are:
  16666. </p>
  16667. <dl class="table">
  16668. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  16669. <dd><p>No final matching based on combed scores.
  16670. </p></dd>
  16671. <dt>&lsquo;<samp class="samp">sc</samp>&rsquo;</dt>
  16672. <dd><p>Combed scores are only used when a scene change is detected.
  16673. </p></dd>
  16674. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  16675. <dd><p>Use combed scores all the time.
  16676. </p></dd>
  16677. </dl>
  16678. <p>Default is <var class="var">sc</var>.
  16679. </p>
  16680. </dd>
  16681. <dt><samp class="option">combdbg</samp></dt>
  16682. <dd><p>Force <code class="code">fieldmatch</code> to calculate the combed metrics for certain matches and
  16683. print them. This setting is known as <samp class="option">micout</samp> in TFM/VFM vocabulary.
  16684. Available values are:
  16685. </p>
  16686. <dl class="table">
  16687. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  16688. <dd><p>No forced calculation.
  16689. </p></dd>
  16690. <dt>&lsquo;<samp class="samp">pcn</samp>&rsquo;</dt>
  16691. <dd><p>Force p/c/n calculations.
  16692. </p></dd>
  16693. <dt>&lsquo;<samp class="samp">pcnub</samp>&rsquo;</dt>
  16694. <dd><p>Force p/c/n/u/b calculations.
  16695. </p></dd>
  16696. </dl>
  16697. <p>Default value is <var class="var">none</var>.
  16698. </p>
  16699. </dd>
  16700. <dt><samp class="option">cthresh</samp></dt>
  16701. <dd><p>This is the area combing threshold used for combed frame detection. This
  16702. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  16703. Larger values mean combing must be more visible and smaller values mean combing
  16704. can be less visible or strong and still be detected. Valid settings are from
  16705. <code class="code">-1</code> (every pixel will be detected as combed) to <code class="code">255</code> (no pixel will
  16706. be detected as combed). This is basically a pixel difference value. A good
  16707. range is <code class="code">[8, 12]</code>.
  16708. </p>
  16709. <p>Default value is <code class="code">9</code>.
  16710. </p>
  16711. </dd>
  16712. <dt><samp class="option">chroma</samp></dt>
  16713. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  16714. disable this if your source has chroma problems (rainbowing, etc.) that are
  16715. causing problems for the combed frame detection with chroma enabled. Actually,
  16716. using <samp class="option">chroma</samp>=<var class="var">0</var> is usually more reliable, except for the case
  16717. where there is chroma only combing in the source.
  16718. </p>
  16719. <p>Default value is <code class="code">0</code>.
  16720. </p>
  16721. </dd>
  16722. <dt><samp class="option">blockx</samp></dt>
  16723. <dt><samp class="option">blocky</samp></dt>
  16724. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  16725. frame detection. This has to do with the size of the area in which
  16726. <samp class="option">combpel</samp> pixels are required to be detected as combed for a frame to be
  16727. declared combed. See the <samp class="option">combpel</samp> parameter description for more info.
  16728. Possible values are any number that is a power of 2 starting at 4 and going up
  16729. to 512.
  16730. </p>
  16731. <p>Default value is <code class="code">16</code>.
  16732. </p>
  16733. </dd>
  16734. <dt><samp class="option">combpel</samp></dt>
  16735. <dd><p>The number of combed pixels inside any of the <samp class="option">blocky</samp> by
  16736. <samp class="option">blockx</samp> size blocks on the frame for the frame to be detected as
  16737. combed. While <samp class="option">cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  16738. setting controls &quot;how much&quot; combing there must be in any localized area (a
  16739. window defined by the <samp class="option">blockx</samp> and <samp class="option">blocky</samp> settings) on the
  16740. frame. Minimum value is <code class="code">0</code> and maximum is <code class="code">blocky x blockx</code> (at
  16741. which point no frames will ever be detected as combed). This setting is known
  16742. as <samp class="option">MI</samp> in TFM/VFM vocabulary.
  16743. </p>
  16744. <p>Default value is <code class="code">80</code>.
  16745. </p></dd>
  16746. </dl>
  16747. <a class="anchor" id="p_002fc_002fn_002fu_002fb-meaning"></a><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  16748. <h4 class="subsection">11.92.1 p/c/n/u/b meaning<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn_002fu_002fb-meaning-1" aria-hidden="true">TOC</a></span></h4>
  16749. <a name="p_002fc_002fn"></a>
  16750. <h4 class="subsubsection">11.92.1.1 p/c/n<span class="pull-right"><a class="anchor hidden-xs" href="#p_002fc_002fn" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-p_002fc_002fn" aria-hidden="true">TOC</a></span></h4>
  16751. <p>We assume the following telecined stream:
  16752. </p>
  16753. <div class="example">
  16754. <pre class="example-preformatted">Top fields: 1 2 2 3 4
  16755. Bottom fields: 1 2 3 4 4
  16756. </pre></div>
  16757. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  16758. first two frames are progressive, the 3rd and 4th are combed, and so on.
  16759. </p>
  16760. <p>When <code class="code">fieldmatch</code> is configured to run a matching from bottom
  16761. (<samp class="option">field</samp>=<var class="var">bottom</var>) this is how this input stream get transformed:
  16762. </p>
  16763. <div class="example">
  16764. <pre class="example-preformatted">Input stream:
  16765. T 1 2 2 3 4
  16766. B 1 2 3 4 4 &lt;-- matching reference
  16767. Matches: c c n n c
  16768. Output stream:
  16769. T 1 2 3 4 4
  16770. B 1 2 3 4 4
  16771. </pre></div>
  16772. <p>As a result of the field matching, we can see that some frames get duplicated.
  16773. To perform a complete inverse telecine, you need to rely on a decimation filter
  16774. after this operation. See for instance the <a class="ref" href="#decimate">decimate</a> filter.
  16775. </p>
  16776. <p>The same operation now matching from top fields (<samp class="option">field</samp>=<var class="var">top</var>)
  16777. looks like this:
  16778. </p>
  16779. <div class="example">
  16780. <pre class="example-preformatted">Input stream:
  16781. T 1 2 2 3 4 &lt;-- matching reference
  16782. B 1 2 3 4 4
  16783. Matches: c c p p c
  16784. Output stream:
  16785. T 1 2 2 3 4
  16786. B 1 2 2 3 4
  16787. </pre></div>
  16788. <p>In these examples, we can see what <var class="var">p</var>, <var class="var">c</var> and <var class="var">n</var> mean;
  16789. basically, they refer to the frame and field of the opposite parity:
  16790. </p>
  16791. <ul class="itemize mark-bullet">
  16792. <li><var class="var">p</var> matches the field of the opposite parity in the previous frame
  16793. </li><li><var class="var">c</var> matches the field of the opposite parity in the current frame
  16794. </li><li><var class="var">n</var> matches the field of the opposite parity in the next frame
  16795. </li></ul>
  16796. <a name="u_002fb"></a>
  16797. <h4 class="subsubsection">11.92.1.2 u/b<span class="pull-right"><a class="anchor hidden-xs" href="#u_002fb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-u_002fb" aria-hidden="true">TOC</a></span></h4>
  16798. <p>The <var class="var">u</var> and <var class="var">b</var> matching are a bit special in the sense that they match
  16799. from the opposite parity flag. In the following examples, we assume that we are
  16800. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  16801. &rsquo;x&rsquo; is placed above and below each matched fields.
  16802. </p>
  16803. <p>With bottom matching (<samp class="option">field</samp>=<var class="var">bottom</var>):
  16804. </p><div class="example">
  16805. <pre class="example-preformatted">Match: c p n b u
  16806. x x x x x
  16807. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  16808. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  16809. x x x x x
  16810. Output frames:
  16811. 2 1 2 2 2
  16812. 2 2 2 1 3
  16813. </pre></div>
  16814. <p>With top matching (<samp class="option">field</samp>=<var class="var">top</var>):
  16815. </p><div class="example">
  16816. <pre class="example-preformatted">Match: c p n b u
  16817. x x x x x
  16818. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  16819. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  16820. x x x x x
  16821. Output frames:
  16822. 2 2 2 1 2
  16823. 2 1 3 2 2
  16824. </pre></div>
  16825. <a name="Examples-77"></a>
  16826. <h4 class="subsection">11.92.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-77" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-77" aria-hidden="true">TOC</a></span></h4>
  16827. <p>Simple IVTC of a top field first telecined stream:
  16828. </p><div class="example">
  16829. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=none, decimate
  16830. </pre></div>
  16831. <p>Advanced IVTC, with fallback on <a class="ref" href="#yadif">yadif</a> for still combed frames:
  16832. </p><div class="example">
  16833. <pre class="example-preformatted">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  16834. </pre></div>
  16835. <a name="fieldorder"></a>
  16836. <h3 class="section">11.93 fieldorder<span class="pull-right"><a class="anchor hidden-xs" href="#fieldorder" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fieldorder" aria-hidden="true">TOC</a></span></h3>
  16837. <p>Transform the field order of the input video.
  16838. </p>
  16839. <p>It accepts the following parameters:
  16840. </p>
  16841. <dl class="table">
  16842. <dt><samp class="option">order</samp></dt>
  16843. <dd><p>The output field order. Valid values are <var class="var">tff</var> for top field first or <var class="var">bff</var>
  16844. for bottom field first.
  16845. </p></dd>
  16846. </dl>
  16847. <p>The default value is &lsquo;<samp class="samp">tff</samp>&rsquo;.
  16848. </p>
  16849. <p>The transformation is done by shifting the picture content up or down
  16850. by one line, and filling the remaining line with appropriate picture content.
  16851. This method is consistent with most broadcast field order converters.
  16852. </p>
  16853. <p>If the input video is not flagged as being interlaced, or it is already
  16854. flagged as being of the required output field order, then this filter does
  16855. not alter the incoming video.
  16856. </p>
  16857. <p>It is very useful when converting to or from PAL DV material,
  16858. which is bottom field first.
  16859. </p>
  16860. <p>For example:
  16861. </p><div class="example">
  16862. <pre class="example-preformatted">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  16863. </pre></div>
  16864. <a name="fillborders"></a>
  16865. <h3 class="section">11.94 fillborders<span class="pull-right"><a class="anchor hidden-xs" href="#fillborders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fillborders" aria-hidden="true">TOC</a></span></h3>
  16866. <p>Fill borders of the input video, without changing video stream dimensions.
  16867. Sometimes video can have garbage at the four edges and you may not want to
  16868. crop video input to keep size multiple of some number.
  16869. </p>
  16870. <p>This filter accepts the following options:
  16871. </p>
  16872. <dl class="table">
  16873. <dt><samp class="option">left</samp></dt>
  16874. <dd><p>Number of pixels to fill from left border.
  16875. </p>
  16876. </dd>
  16877. <dt><samp class="option">right</samp></dt>
  16878. <dd><p>Number of pixels to fill from right border.
  16879. </p>
  16880. </dd>
  16881. <dt><samp class="option">top</samp></dt>
  16882. <dd><p>Number of pixels to fill from top border.
  16883. </p>
  16884. </dd>
  16885. <dt><samp class="option">bottom</samp></dt>
  16886. <dd><p>Number of pixels to fill from bottom border.
  16887. </p>
  16888. </dd>
  16889. <dt><samp class="option">mode</samp></dt>
  16890. <dd><p>Set fill mode.
  16891. </p>
  16892. <p>It accepts the following values:
  16893. </p><dl class="table">
  16894. <dt>&lsquo;<samp class="samp">smear</samp>&rsquo;</dt>
  16895. <dd><p>fill pixels using outermost pixels
  16896. </p>
  16897. </dd>
  16898. <dt>&lsquo;<samp class="samp">mirror</samp>&rsquo;</dt>
  16899. <dd><p>fill pixels using mirroring (half sample symmetric)
  16900. </p>
  16901. </dd>
  16902. <dt>&lsquo;<samp class="samp">fixed</samp>&rsquo;</dt>
  16903. <dd><p>fill pixels with constant value
  16904. </p>
  16905. </dd>
  16906. <dt>&lsquo;<samp class="samp">reflect</samp>&rsquo;</dt>
  16907. <dd><p>fill pixels using reflecting (whole sample symmetric)
  16908. </p>
  16909. </dd>
  16910. <dt>&lsquo;<samp class="samp">wrap</samp>&rsquo;</dt>
  16911. <dd><p>fill pixels using wrapping
  16912. </p>
  16913. </dd>
  16914. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  16915. <dd><p>fade pixels to constant value
  16916. </p>
  16917. </dd>
  16918. <dt>&lsquo;<samp class="samp">margins</samp>&rsquo;</dt>
  16919. <dd><p>fill pixels at top and bottom with weighted averages pixels near borders
  16920. </p></dd>
  16921. </dl>
  16922. <p>Default is <var class="var">smear</var>.
  16923. </p>
  16924. </dd>
  16925. <dt><samp class="option">color</samp></dt>
  16926. <dd><p>Set color for pixels in fixed or fade mode. Default is <var class="var">black</var>.
  16927. </p></dd>
  16928. </dl>
  16929. <a name="Commands-93"></a>
  16930. <h4 class="subsection">11.94.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-93" aria-hidden="true">TOC</a></span></h4>
  16931. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  16932. The command accepts the same syntax of the corresponding option.
  16933. </p>
  16934. <p>If the specified expression is not valid, it is kept at its current
  16935. value.
  16936. </p>
  16937. <a name="find_005frect"></a>
  16938. <h3 class="section">11.95 find_rect<span class="pull-right"><a class="anchor hidden-xs" href="#find_005frect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-find_005frect" aria-hidden="true">TOC</a></span></h3>
  16939. <p>Find a rectangular object in the input video.
  16940. </p>
  16941. <p>The object to search for must be specified as a gray8 image specified with the
  16942. <samp class="option">object</samp> option.
  16943. </p>
  16944. <p>For each possible match, a score is computed. If the score reaches the specified
  16945. threshold, the object is considered found.
  16946. </p>
  16947. <p>If the input video contains multiple instances of the object, the filter will
  16948. find only one of them.
  16949. </p>
  16950. <p>When an object is found, the following metadata entries are set in the matching
  16951. frame:
  16952. </p><dl class="table">
  16953. <dt><samp class="option">lavfi.rect.w</samp></dt>
  16954. <dd><p>width of object
  16955. </p>
  16956. </dd>
  16957. <dt><samp class="option">lavfi.rect.h</samp></dt>
  16958. <dd><p>height of object
  16959. </p>
  16960. </dd>
  16961. <dt><samp class="option">lavfi.rect.x</samp></dt>
  16962. <dd><p>x position of object
  16963. </p>
  16964. </dd>
  16965. <dt><samp class="option">lavfi.rect.y</samp></dt>
  16966. <dd><p>y position of object
  16967. </p>
  16968. </dd>
  16969. <dt><samp class="option">lavfi.rect.score</samp></dt>
  16970. <dd><p>match score of the found object
  16971. </p></dd>
  16972. </dl>
  16973. <p>It accepts the following options:
  16974. </p>
  16975. <dl class="table">
  16976. <dt><samp class="option">object</samp></dt>
  16977. <dd><p>Filepath of the object image, needs to be in gray8.
  16978. </p>
  16979. </dd>
  16980. <dt><samp class="option">threshold</samp></dt>
  16981. <dd><p>Detection threshold, expressed as a decimal number in the range 0-1.
  16982. </p>
  16983. <p>A threshold value of 0.01 means only exact matches, a threshold of 0.99 means
  16984. almost everything matches.
  16985. </p>
  16986. <p>Default value is 0.5.
  16987. </p>
  16988. </dd>
  16989. <dt><samp class="option">mipmaps</samp></dt>
  16990. <dd><p>Number of mipmaps, default is 3.
  16991. </p>
  16992. </dd>
  16993. <dt><samp class="option">xmin, ymin, xmax, ymax</samp></dt>
  16994. <dd><p>Specifies the rectangle in which to search.
  16995. </p>
  16996. </dd>
  16997. <dt><samp class="option">discard</samp></dt>
  16998. <dd><p>Discard frames where object is not detected. Default is disabled.
  16999. </p></dd>
  17000. </dl>
  17001. <a name="Examples-78"></a>
  17002. <h4 class="subsection">11.95.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-78" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-78" aria-hidden="true">TOC</a></span></h4>
  17003. <ul class="itemize mark-bullet">
  17004. <li>Cover a rectangular object by the supplied image of a given video using <code class="command">ffmpeg</code>:
  17005. <div class="example">
  17006. <pre class="example-preformatted">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  17007. </pre></div>
  17008. </li><li>Find the position of an object in each frame using <code class="command">ffprobe</code> and write
  17009. it to a log file:
  17010. <div class="example">
  17011. <pre class="example-preformatted">ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \
  17012. -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \
  17013. -of csv -o find_rect.csv
  17014. </pre></div>
  17015. </li></ul>
  17016. <a name="floodfill"></a>
  17017. <h3 class="section">11.96 floodfill<span class="pull-right"><a class="anchor hidden-xs" href="#floodfill" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-floodfill" aria-hidden="true">TOC</a></span></h3>
  17018. <p>Flood area with values of same pixel components with another values.
  17019. </p>
  17020. <p>It accepts the following options:
  17021. </p><dl class="table">
  17022. <dt><samp class="option">x</samp></dt>
  17023. <dd><p>Set pixel x coordinate.
  17024. </p>
  17025. </dd>
  17026. <dt><samp class="option">y</samp></dt>
  17027. <dd><p>Set pixel y coordinate.
  17028. </p>
  17029. </dd>
  17030. <dt><samp class="option">s0</samp></dt>
  17031. <dd><p>Set source #0 component value.
  17032. </p>
  17033. </dd>
  17034. <dt><samp class="option">s1</samp></dt>
  17035. <dd><p>Set source #1 component value.
  17036. </p>
  17037. </dd>
  17038. <dt><samp class="option">s2</samp></dt>
  17039. <dd><p>Set source #2 component value.
  17040. </p>
  17041. </dd>
  17042. <dt><samp class="option">s3</samp></dt>
  17043. <dd><p>Set source #3 component value.
  17044. </p>
  17045. </dd>
  17046. <dt><samp class="option">d0</samp></dt>
  17047. <dd><p>Set destination #0 component value.
  17048. </p>
  17049. </dd>
  17050. <dt><samp class="option">d1</samp></dt>
  17051. <dd><p>Set destination #1 component value.
  17052. </p>
  17053. </dd>
  17054. <dt><samp class="option">d2</samp></dt>
  17055. <dd><p>Set destination #2 component value.
  17056. </p>
  17057. </dd>
  17058. <dt><samp class="option">d3</samp></dt>
  17059. <dd><p>Set destination #3 component value.
  17060. </p></dd>
  17061. </dl>
  17062. <a class="anchor" id="format"></a><a name="format-1"></a>
  17063. <h3 class="section">11.97 format<span class="pull-right"><a class="anchor hidden-xs" href="#format-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-format-1" aria-hidden="true">TOC</a></span></h3>
  17064. <p>Convert the input video to one of the specified pixel formats.
  17065. Libavfilter will try to pick one that is suitable as input to
  17066. the next filter.
  17067. </p>
  17068. <p>It accepts the following parameters:
  17069. </p><dl class="table">
  17070. <dt><samp class="option">pix_fmts</samp></dt>
  17071. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  17072. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  17073. </p>
  17074. </dd>
  17075. <dt><samp class="option">color_spaces</samp></dt>
  17076. <dd><p>A &rsquo;|&rsquo;-separated list of color space names, such as
  17077. &quot;color_spaces=bt709|bt470bg|bt2020nc&quot;.
  17078. </p>
  17079. </dd>
  17080. <dt><samp class="option">color_ranges</samp></dt>
  17081. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  17082. &quot;color_ranges=tv|pc&quot;.
  17083. </p>
  17084. </dd>
  17085. <dt><samp class="option">alpha_modes</samp></dt>
  17086. <dd><p>A &rsquo;|&rsquo;-separated list of color range names, such as
  17087. &quot;alpha_modes=straight|premultiplied&quot;.
  17088. </p>
  17089. </dd>
  17090. </dl>
  17091. <a name="Examples-79"></a>
  17092. <h4 class="subsection">11.97.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-79" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-79" aria-hidden="true">TOC</a></span></h4>
  17093. <ul class="itemize mark-bullet">
  17094. <li>Convert the input video to the <var class="var">yuv420p</var> format
  17095. <div class="example">
  17096. <pre class="example-preformatted">format=pix_fmts=yuv420p
  17097. </pre></div>
  17098. <p>Convert the input video to any of the formats in the list
  17099. </p><div class="example">
  17100. <pre class="example-preformatted">format=pix_fmts=yuv420p|yuv444p|yuv410p
  17101. </pre></div>
  17102. </li></ul>
  17103. <a class="anchor" id="fps"></a><a name="fps-1"></a>
  17104. <h3 class="section">11.98 fps<span class="pull-right"><a class="anchor hidden-xs" href="#fps-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fps-1" aria-hidden="true">TOC</a></span></h3>
  17105. <p>Convert the video to specified constant frame rate by duplicating or dropping
  17106. frames as necessary.
  17107. </p>
  17108. <p>It accepts the following parameters:
  17109. </p><dl class="table">
  17110. <dt><samp class="option">fps</samp></dt>
  17111. <dd><p>The desired output frame rate. It accepts expressions containing the following
  17112. constants:
  17113. </p>
  17114. <dl class="table">
  17115. <dt>&lsquo;<samp class="samp">source_fps</samp>&rsquo;</dt>
  17116. <dd><p>The input&rsquo;s frame rate
  17117. </p>
  17118. </dd>
  17119. <dt>&lsquo;<samp class="samp">ntsc</samp>&rsquo;</dt>
  17120. <dd><p>NTSC frame rate of <code class="code">30000/1001</code>
  17121. </p>
  17122. </dd>
  17123. <dt>&lsquo;<samp class="samp">pal</samp>&rsquo;</dt>
  17124. <dd><p>PAL frame rate of <code class="code">25.0</code>
  17125. </p>
  17126. </dd>
  17127. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  17128. <dd><p>Film frame rate of <code class="code">24.0</code>
  17129. </p>
  17130. </dd>
  17131. <dt>&lsquo;<samp class="samp">ntsc_film</samp>&rsquo;</dt>
  17132. <dd><p>NTSC-film frame rate of <code class="code">24000/1001</code>
  17133. </p></dd>
  17134. </dl>
  17135. <p>The default is <code class="code">25</code>.
  17136. </p>
  17137. </dd>
  17138. <dt><samp class="option">start_time</samp></dt>
  17139. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  17140. padding/trimming at the start of stream. By default, no assumption is made
  17141. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  17142. For example, this could be set to 0 to pad the beginning with duplicates of
  17143. the first frame if a video stream starts after the audio stream or to trim any
  17144. frames with a negative PTS.
  17145. </p>
  17146. </dd>
  17147. <dt><samp class="option">round</samp></dt>
  17148. <dd><p>Timestamp (PTS) rounding method.
  17149. </p>
  17150. <p>Possible values are:
  17151. </p><dl class="table">
  17152. <dt><samp class="option">zero</samp></dt>
  17153. <dd><p>round towards 0
  17154. </p></dd>
  17155. <dt><samp class="option">inf</samp></dt>
  17156. <dd><p>round away from 0
  17157. </p></dd>
  17158. <dt><samp class="option">down</samp></dt>
  17159. <dd><p>round towards -infinity
  17160. </p></dd>
  17161. <dt><samp class="option">up</samp></dt>
  17162. <dd><p>round towards +infinity
  17163. </p></dd>
  17164. <dt><samp class="option">near</samp></dt>
  17165. <dd><p>round to nearest
  17166. </p></dd>
  17167. </dl>
  17168. <p>The default is <code class="code">near</code>.
  17169. </p>
  17170. </dd>
  17171. <dt><samp class="option">eof_action</samp></dt>
  17172. <dd><p>Action performed when reading the last frame.
  17173. </p>
  17174. <p>Possible values are:
  17175. </p><dl class="table">
  17176. <dt><samp class="option">round</samp></dt>
  17177. <dd><p>Use same timestamp rounding method as used for other frames.
  17178. </p></dd>
  17179. <dt><samp class="option">pass</samp></dt>
  17180. <dd><p>Pass through last frame if input duration has not been reached yet.
  17181. </p></dd>
  17182. </dl>
  17183. <p>The default is <code class="code">round</code>.
  17184. </p>
  17185. </dd>
  17186. </dl>
  17187. <p>Alternatively, the options can be specified as a flat string:
  17188. <var class="var">fps</var>[:<var class="var">start_time</var>[:<var class="var">round</var>]].
  17189. </p>
  17190. <p>See also the <a class="ref" href="#setpts">setpts</a> filter.
  17191. </p>
  17192. <a name="Examples-80"></a>
  17193. <h4 class="subsection">11.98.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-80" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-80" aria-hidden="true">TOC</a></span></h4>
  17194. <ul class="itemize mark-bullet">
  17195. <li>A typical usage in order to set the fps to 25:
  17196. <div class="example">
  17197. <pre class="example-preformatted">fps=fps=25
  17198. </pre></div>
  17199. </li><li>Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  17200. <div class="example">
  17201. <pre class="example-preformatted">fps=fps=film:round=near
  17202. </pre></div>
  17203. </li></ul>
  17204. <a name="framepack"></a>
  17205. <h3 class="section">11.99 framepack<span class="pull-right"><a class="anchor hidden-xs" href="#framepack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framepack" aria-hidden="true">TOC</a></span></h3>
  17206. <p>Pack two different video streams into a stereoscopic video, setting proper
  17207. metadata on supported codecs. The two views should have the same size and
  17208. framerate and processing will stop when the shorter video ends. Please note
  17209. that you may conveniently adjust view properties with the <a class="ref" href="#scale">scale</a> and
  17210. <a class="ref" href="#fps">fps</a> filters.
  17211. </p>
  17212. <p>It accepts the following parameters:
  17213. </p><dl class="table">
  17214. <dt><samp class="option">format</samp></dt>
  17215. <dd><p>The desired packing format. Supported values are:
  17216. </p>
  17217. <dl class="table">
  17218. <dt><samp class="option">sbs</samp></dt>
  17219. <dd><p>The views are next to each other (default).
  17220. </p>
  17221. </dd>
  17222. <dt><samp class="option">tab</samp></dt>
  17223. <dd><p>The views are on top of each other.
  17224. </p>
  17225. </dd>
  17226. <dt><samp class="option">lines</samp></dt>
  17227. <dd><p>The views are packed by line.
  17228. </p>
  17229. </dd>
  17230. <dt><samp class="option">columns</samp></dt>
  17231. <dd><p>The views are packed by column.
  17232. </p>
  17233. </dd>
  17234. <dt><samp class="option">frameseq</samp></dt>
  17235. <dd><p>The views are temporally interleaved.
  17236. </p>
  17237. </dd>
  17238. </dl>
  17239. </dd>
  17240. </dl>
  17241. <p>Some examples:
  17242. </p>
  17243. <div class="example">
  17244. <pre class="example-preformatted"># Convert left and right views into a frame-sequential video
  17245. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  17246. # Convert views into a side-by-side video with the same output resolution as the input
  17247. 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
  17248. </pre></div>
  17249. <a name="framerate"></a>
  17250. <h3 class="section">11.100 framerate<span class="pull-right"><a class="anchor hidden-xs" href="#framerate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framerate" aria-hidden="true">TOC</a></span></h3>
  17251. <p>Change the frame rate by interpolating new video output frames from the source
  17252. frames.
  17253. </p>
  17254. <p>This filter is not designed to function correctly with interlaced media. If
  17255. you wish to change the frame rate of interlaced media then you are required
  17256. to deinterlace before this filter and re-interlace after this filter.
  17257. </p>
  17258. <p>A description of the accepted options follows.
  17259. </p>
  17260. <dl class="table">
  17261. <dt><samp class="option">fps</samp></dt>
  17262. <dd><p>Specify the output frames per second. This option can also be specified
  17263. as a value alone. The default is <code class="code">50</code>.
  17264. </p>
  17265. </dd>
  17266. <dt><samp class="option">interp_start</samp></dt>
  17267. <dd><p>Specify the start of a range where the output frame will be created as a
  17268. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  17269. the default is <code class="code">15</code>.
  17270. </p>
  17271. </dd>
  17272. <dt><samp class="option">interp_end</samp></dt>
  17273. <dd><p>Specify the end of a range where the output frame will be created as a
  17274. linear interpolation of two frames. The range is [<code class="code">0</code>-<code class="code">255</code>],
  17275. the default is <code class="code">240</code>.
  17276. </p>
  17277. </dd>
  17278. <dt><samp class="option">scene</samp></dt>
  17279. <dd><p>Specify the level at which a scene change is detected as a value between
  17280. 0 and 100 to indicate a new scene; a low value reflects a low
  17281. probability for the current frame to introduce a new scene, while a higher
  17282. value means the current frame is more likely to be one.
  17283. The default is <code class="code">8.2</code>.
  17284. </p>
  17285. </dd>
  17286. <dt><samp class="option">flags</samp></dt>
  17287. <dd><p>Specify flags influencing the filter process.
  17288. </p>
  17289. <p>Available value for <var class="var">flags</var> is:
  17290. </p>
  17291. <dl class="table">
  17292. <dt><samp class="option">scene_change_detect, scd</samp></dt>
  17293. <dd><p>Enable scene change detection using the value of the option <var class="var">scene</var>.
  17294. This flag is enabled by default.
  17295. </p></dd>
  17296. </dl>
  17297. </dd>
  17298. </dl>
  17299. <a name="framestep"></a>
  17300. <h3 class="section">11.101 framestep<span class="pull-right"><a class="anchor hidden-xs" href="#framestep" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-framestep" aria-hidden="true">TOC</a></span></h3>
  17301. <p>Select one frame every N-th frame.
  17302. </p>
  17303. <p>This filter accepts the following option:
  17304. </p><dl class="table">
  17305. <dt><samp class="option">step</samp></dt>
  17306. <dd><p>Select frame after every <code class="code">step</code> frames.
  17307. Allowed values are positive integers higher than 0. Default value is <code class="code">1</code>.
  17308. </p></dd>
  17309. </dl>
  17310. <a name="freezedetect"></a>
  17311. <h3 class="section">11.102 freezedetect<span class="pull-right"><a class="anchor hidden-xs" href="#freezedetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezedetect" aria-hidden="true">TOC</a></span></h3>
  17312. <p>Detect frozen video.
  17313. </p>
  17314. <p>This filter logs a message and sets frame metadata when it detects that the
  17315. input video has no significant change in content during a specified duration.
  17316. Video freeze detection calculates the mean average absolute difference of all
  17317. the components of video frames and compares it to a noise floor.
  17318. </p>
  17319. <p>The printed times and duration are expressed in seconds. The
  17320. <code class="code">lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  17321. whose timestamp equals or exceeds the detection duration and it contains the
  17322. timestamp of the first frame of the freeze. The
  17323. <code class="code">lavfi.freezedetect.freeze_duration</code> and
  17324. <code class="code">lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  17325. after the freeze.
  17326. </p>
  17327. <p>The filter accepts the following options:
  17328. </p>
  17329. <dl class="table">
  17330. <dt><samp class="option">noise, n</samp></dt>
  17331. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  17332. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  17333. 0.001.
  17334. </p>
  17335. </dd>
  17336. <dt><samp class="option">duration, d</samp></dt>
  17337. <dd><p>Set freeze duration until notification (default is 2 seconds).
  17338. </p></dd>
  17339. </dl>
  17340. <a name="freezeframes"></a>
  17341. <h3 class="section">11.103 freezeframes<span class="pull-right"><a class="anchor hidden-xs" href="#freezeframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-freezeframes" aria-hidden="true">TOC</a></span></h3>
  17342. <p>Freeze video frames.
  17343. </p>
  17344. <p>This filter freezes video frames using frame from 2nd input.
  17345. </p>
  17346. <p>The filter accepts the following options:
  17347. </p>
  17348. <dl class="table">
  17349. <dt><samp class="option">first</samp></dt>
  17350. <dd><p>Set number of first frame from which to start freeze.
  17351. </p>
  17352. </dd>
  17353. <dt><samp class="option">last</samp></dt>
  17354. <dd><p>Set number of last frame from which to end freeze.
  17355. </p>
  17356. </dd>
  17357. <dt><samp class="option">replace</samp></dt>
  17358. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  17359. </p></dd>
  17360. </dl>
  17361. <a class="anchor" id="frei0r"></a><a name="frei0r-1"></a>
  17362. <h3 class="section">11.104 frei0r<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r-1" aria-hidden="true">TOC</a></span></h3>
  17363. <p>Apply a frei0r effect to the input video.
  17364. </p>
  17365. <p>To enable the compilation of this filter, you need to install the frei0r
  17366. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  17367. </p>
  17368. <p>It accepts the following parameters:
  17369. </p>
  17370. <dl class="table">
  17371. <dt><samp class="option">filter_name</samp></dt>
  17372. <dd><p>The name of the frei0r effect to load. If the environment variable
  17373. <code class="env">FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  17374. directories specified by the colon-separated list in <code class="env">FREI0R_PATH</code>.
  17375. Otherwise, the standard frei0r paths are searched, in this order:
  17376. <samp class="file">HOME/.frei0r-1/lib/</samp>, <samp class="file">/usr/local/lib/frei0r-1/</samp>,
  17377. <samp class="file">/usr/lib/frei0r-1/</samp>.
  17378. </p>
  17379. </dd>
  17380. <dt><samp class="option">filter_params</samp></dt>
  17381. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  17382. </p>
  17383. </dd>
  17384. </dl>
  17385. <p>A frei0r effect parameter can be a boolean (its value is either
  17386. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  17387. <var class="var">R</var>/<var class="var">G</var>/<var class="var">B</var>, where <var class="var">R</var>, <var class="var">G</var>, and <var class="var">B</var> are floating point
  17388. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  17389. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  17390. a position (specified as <var class="var">X</var>/<var class="var">Y</var>, where
  17391. <var class="var">X</var> and <var class="var">Y</var> are floating point numbers) and/or a string.
  17392. </p>
  17393. <p>The number and types of parameters depend on the loaded effect. If an
  17394. effect parameter is not specified, the default value is set.
  17395. </p>
  17396. <a name="Examples-81"></a>
  17397. <h4 class="subsection">11.104.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-81" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-81" aria-hidden="true">TOC</a></span></h4>
  17398. <ul class="itemize mark-bullet">
  17399. <li>Apply the distort0r effect, setting the first two double parameters:
  17400. <div class="example">
  17401. <pre class="example-preformatted">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  17402. </pre></div>
  17403. </li><li>Apply the colordistance effect, taking a color as the first parameter:
  17404. <div class="example">
  17405. <pre class="example-preformatted">frei0r=colordistance:0.2/0.3/0.4
  17406. frei0r=colordistance:violet
  17407. frei0r=colordistance:0x112233
  17408. </pre></div>
  17409. </li><li>Apply the perspective effect, specifying the top left and top right image
  17410. positions:
  17411. <div class="example">
  17412. <pre class="example-preformatted">frei0r=perspective:0.2/0.2|0.8/0.2
  17413. </pre></div>
  17414. </li></ul>
  17415. <p>For more information, see
  17416. <a class="url" href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  17417. </p>
  17418. <a name="Commands-94"></a>
  17419. <h4 class="subsection">11.104.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-94" aria-hidden="true">TOC</a></span></h4>
  17420. <p>This filter supports the <samp class="option">filter_params</samp> option as <a class="ref" href="#commands">commands</a>.
  17421. </p>
  17422. <a name="fspp"></a>
  17423. <h3 class="section">11.105 fspp<span class="pull-right"><a class="anchor hidden-xs" href="#fspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fspp" aria-hidden="true">TOC</a></span></h3>
  17424. <p>Apply fast and simple postprocessing. It is a faster version of <a class="ref" href="#spp">spp</a>.
  17425. </p>
  17426. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  17427. processing filter, one of them is performed once per block, not per pixel.
  17428. This allows for much higher speed.
  17429. </p>
  17430. <p>The filter accepts the following options:
  17431. </p>
  17432. <dl class="table">
  17433. <dt><samp class="option">quality</samp></dt>
  17434. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  17435. an integer in the range 4-5. Default value is <code class="code">4</code>.
  17436. </p>
  17437. </dd>
  17438. <dt><samp class="option">qp</samp></dt>
  17439. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  17440. If not set, the filter will use the QP from the video stream (if available).
  17441. </p>
  17442. </dd>
  17443. <dt><samp class="option">strength</samp></dt>
  17444. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  17445. more details but also more artifacts, while higher values make the image smoother
  17446. but also blurrier. Default value is <code class="code">0</code> − PSNR optimal.
  17447. </p>
  17448. </dd>
  17449. <dt><samp class="option">use_bframe_qp</samp></dt>
  17450. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  17451. option may cause flicker since the B-Frames have often larger QP. Default is
  17452. <code class="code">0</code> (not enabled).
  17453. </p>
  17454. </dd>
  17455. </dl>
  17456. <a class="anchor" id="fsync"></a><a name="fsync-1"></a>
  17457. <h3 class="section">11.106 fsync<span class="pull-right"><a class="anchor hidden-xs" href="#fsync-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fsync-1" aria-hidden="true">TOC</a></span></h3>
  17458. <p>Synchronize video frames with an external mapping from a file.
  17459. </p>
  17460. <p>For each input PTS given in the map file it either drops or creates as many
  17461. frames as necessary to recreate the sequence of output frames given in the
  17462. map file.
  17463. </p>
  17464. <p>This filter is useful to recreate the output frames of a framerate conversion
  17465. by the <a class="ref" href="#fps">fps</a> filter, recorded into a map file using the ffmpeg option
  17466. <code class="code">-stats_mux_pre</code>, and do further processing to the corresponding frames
  17467. e.g. quality comparison.
  17468. </p>
  17469. <p>Each line of the map file must contain three items per input frame, the input
  17470. PTS (decimal), the output PTS (decimal) and the
  17471. output TIMEBASE (decimal/decimal), separated by a space.
  17472. This file format corresponds to the output
  17473. of <code class="code">-stats_mux_pre_fmt=&quot;{ptsi} {pts} {tb}&quot;</code>.
  17474. </p>
  17475. <p>The filter assumes the map file is sorted by increasing input PTS.
  17476. </p>
  17477. <p>The filter accepts the following options:
  17478. </p><dl class="table">
  17479. <dt><samp class="option">file, f</samp></dt>
  17480. <dd><p>The filename of the map file to be used.
  17481. </p></dd>
  17482. </dl>
  17483. <p>Example:
  17484. </p><div class="example">
  17485. <pre class="example-preformatted"># Convert a video to 25 fps and record a MAP_FILE file with the default format of this filter
  17486. ffmpeg -i INPUT -vf fps=fps=25 -stats_mux_pre MAP_FILE -stats_mux_pre_fmt &quot;{ptsi} {pts} {tb}&quot; OUTPUT
  17487. # Sort MAP_FILE by increasing input PTS
  17488. sort -n MAP_FILE
  17489. # Use INPUT, OUTPUT and the MAP_FILE from above to compare the corresponding frames in INPUT and OUTPUT via SSIM
  17490. ffmpeg -i INPUT -i OUTPUT -filter_complex '[0:v]fsync=file=MAP_FILE[ref];[1:v][ref]ssim' -f null -
  17491. </pre></div>
  17492. <a name="gblur"></a>
  17493. <h3 class="section">11.107 gblur<span class="pull-right"><a class="anchor hidden-xs" href="#gblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur" aria-hidden="true">TOC</a></span></h3>
  17494. <p>Apply Gaussian blur filter.
  17495. </p>
  17496. <p>The filter accepts the following options:
  17497. </p>
  17498. <dl class="table">
  17499. <dt><samp class="option">sigma</samp></dt>
  17500. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  17501. </p>
  17502. </dd>
  17503. <dt><samp class="option">steps</samp></dt>
  17504. <dd><p>Set number of steps for Gaussian approximation. Default is <code class="code">1</code>.
  17505. </p>
  17506. </dd>
  17507. <dt><samp class="option">planes</samp></dt>
  17508. <dd><p>Set which planes to filter. By default all planes are filtered.
  17509. </p>
  17510. </dd>
  17511. <dt><samp class="option">sigmaV</samp></dt>
  17512. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  17513. Default is <code class="code">-1</code>.
  17514. </p></dd>
  17515. </dl>
  17516. <a name="Commands-95"></a>
  17517. <h4 class="subsection">11.107.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-95" aria-hidden="true">TOC</a></span></h4>
  17518. <p>This filter supports same commands as options.
  17519. The command accepts the same syntax of the corresponding option.
  17520. </p>
  17521. <p>If the specified expression is not valid, it is kept at its current
  17522. value.
  17523. </p>
  17524. <a name="geq"></a>
  17525. <h3 class="section">11.108 geq<span class="pull-right"><a class="anchor hidden-xs" href="#geq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-geq" aria-hidden="true">TOC</a></span></h3>
  17526. <p>Apply generic equation to each pixel.
  17527. </p>
  17528. <p>The filter accepts the following options:
  17529. </p>
  17530. <dl class="table">
  17531. <dt><samp class="option">lum_expr, lum</samp></dt>
  17532. <dd><p>Set the luma expression.
  17533. </p></dd>
  17534. <dt><samp class="option">cb_expr, cb</samp></dt>
  17535. <dd><p>Set the chrominance blue expression.
  17536. </p></dd>
  17537. <dt><samp class="option">cr_expr, cr</samp></dt>
  17538. <dd><p>Set the chrominance red expression.
  17539. </p></dd>
  17540. <dt><samp class="option">alpha_expr, a</samp></dt>
  17541. <dd><p>Set the alpha expression.
  17542. </p></dd>
  17543. <dt><samp class="option">red_expr, r</samp></dt>
  17544. <dd><p>Set the red expression.
  17545. </p></dd>
  17546. <dt><samp class="option">green_expr, g</samp></dt>
  17547. <dd><p>Set the green expression.
  17548. </p></dd>
  17549. <dt><samp class="option">blue_expr, b</samp></dt>
  17550. <dd><p>Set the blue expression.
  17551. </p></dd>
  17552. </dl>
  17553. <p>The colorspace is selected according to the specified options. If one
  17554. of the <samp class="option">lum_expr</samp>, <samp class="option">cb_expr</samp>, or <samp class="option">cr_expr</samp>
  17555. options is specified, the filter will automatically select a YCbCr
  17556. colorspace. If one of the <samp class="option">red_expr</samp>, <samp class="option">green_expr</samp>, or
  17557. <samp class="option">blue_expr</samp> options is specified, it will select an RGB
  17558. colorspace.
  17559. </p>
  17560. <p>If one of the chrominance expression is not defined, it falls back on the other
  17561. one. If no alpha expression is specified it will evaluate to opaque value.
  17562. If none of chrominance expressions are specified, they will evaluate
  17563. to the luma expression.
  17564. </p>
  17565. <p>The expressions can use the following variables and functions:
  17566. </p>
  17567. <dl class="table">
  17568. <dt><samp class="option">N</samp></dt>
  17569. <dd><p>The sequential number of the filtered frame, starting from <code class="code">0</code>.
  17570. </p>
  17571. </dd>
  17572. <dt><samp class="option">X</samp></dt>
  17573. <dt><samp class="option">Y</samp></dt>
  17574. <dd><p>The coordinates of the current sample.
  17575. </p>
  17576. </dd>
  17577. <dt><samp class="option">W</samp></dt>
  17578. <dt><samp class="option">H</samp></dt>
  17579. <dd><p>The width and height of the image.
  17580. </p>
  17581. </dd>
  17582. <dt><samp class="option">SW</samp></dt>
  17583. <dt><samp class="option">SH</samp></dt>
  17584. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  17585. ratio between the corresponding luma plane number of pixels and the current
  17586. plane ones. E.g. for YUV4:2:0 the values are <code class="code">1,1</code> for the luma plane, and
  17587. <code class="code">0.5,0.5</code> for chroma planes.
  17588. </p>
  17589. </dd>
  17590. <dt><samp class="option">T</samp></dt>
  17591. <dd><p>Time of the current frame, expressed in seconds.
  17592. </p>
  17593. </dd>
  17594. <dt><samp class="option">p(x, y)</samp></dt>
  17595. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the current
  17596. plane.
  17597. </p>
  17598. </dd>
  17599. <dt><samp class="option">lum(x, y)</samp></dt>
  17600. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the luma
  17601. plane.
  17602. </p>
  17603. </dd>
  17604. <dt><samp class="option">cb(x, y)</samp></dt>
  17605. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  17606. blue-difference chroma plane. Return 0 if there is no such plane.
  17607. </p>
  17608. </dd>
  17609. <dt><samp class="option">cr(x, y)</samp></dt>
  17610. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  17611. red-difference chroma plane. Return 0 if there is no such plane.
  17612. </p>
  17613. </dd>
  17614. <dt><samp class="option">r(x, y)</samp></dt>
  17615. <dt><samp class="option">g(x, y)</samp></dt>
  17616. <dt><samp class="option">b(x, y)</samp></dt>
  17617. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  17618. red/green/blue component. Return 0 if there is no such component.
  17619. </p>
  17620. </dd>
  17621. <dt><samp class="option">alpha(x, y)</samp></dt>
  17622. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the alpha
  17623. plane. Return 0 if there is no such plane.
  17624. </p>
  17625. </dd>
  17626. <dt><samp class="option">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></dt>
  17627. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  17628. sums of samples within a rectangle. See the functions without the sum postfix.
  17629. </p>
  17630. </dd>
  17631. <dt><samp class="option">interpolation</samp></dt>
  17632. <dd><p>Set one of interpolation methods:
  17633. </p><dl class="table">
  17634. <dt><samp class="option">nearest, n</samp></dt>
  17635. <dt><samp class="option">bilinear, b</samp></dt>
  17636. </dl>
  17637. <p>Default is bilinear.
  17638. </p></dd>
  17639. </dl>
  17640. <p>For functions, if <var class="var">x</var> and <var class="var">y</var> are outside the area, the value will be
  17641. automatically clipped to the closer edge.
  17642. </p>
  17643. <p>Please note that this filter can use multiple threads in which case each slice
  17644. will have its own expression state. If you want to use only a single expression
  17645. state because your expressions depend on previous state then you should limit
  17646. the number of filter threads to 1.
  17647. </p>
  17648. <a name="Examples-82"></a>
  17649. <h4 class="subsection">11.108.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-82" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-82" aria-hidden="true">TOC</a></span></h4>
  17650. <ul class="itemize mark-bullet">
  17651. <li>Flip the image horizontally:
  17652. <div class="example">
  17653. <pre class="example-preformatted">geq=p(W-X\,Y)
  17654. </pre></div>
  17655. </li><li>Generate a bidimensional sine wave, with angle <code class="code">PI/3</code> and a
  17656. wavelength of 100 pixels:
  17657. <div class="example">
  17658. <pre class="example-preformatted">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  17659. </pre></div>
  17660. </li><li>Generate a fancy enigmatic moving light:
  17661. <div class="example">
  17662. <pre class="example-preformatted">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
  17663. </pre></div>
  17664. </li><li>Generate a quick emboss effect:
  17665. <div class="example">
  17666. <pre class="example-preformatted">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  17667. </pre></div>
  17668. </li><li>Modify RGB components depending on pixel position:
  17669. <div class="example">
  17670. <pre class="example-preformatted">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  17671. </pre></div>
  17672. </li><li>Create a radial gradient that is the same size as the input (also see
  17673. the <a class="ref" href="#vignette">vignette</a> filter):
  17674. <div class="example">
  17675. <pre class="example-preformatted">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  17676. </pre></div>
  17677. </li></ul>
  17678. <a name="gradfun"></a>
  17679. <h3 class="section">11.109 gradfun<span class="pull-right"><a class="anchor hidden-xs" href="#gradfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradfun" aria-hidden="true">TOC</a></span></h3>
  17680. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  17681. regions by truncation to 8-bit color depth.
  17682. Interpolate the gradients that should go where the bands are, and
  17683. dither them.
  17684. </p>
  17685. <p>It is designed for playback only. Do not use it prior to
  17686. lossy compression, because compression tends to lose the dither and
  17687. bring back the bands.
  17688. </p>
  17689. <p>It accepts the following parameters:
  17690. </p>
  17691. <dl class="table">
  17692. <dt><samp class="option">strength</samp></dt>
  17693. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  17694. the threshold for detecting nearly flat regions. Acceptable values range from
  17695. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  17696. valid range.
  17697. </p>
  17698. </dd>
  17699. <dt><samp class="option">radius</samp></dt>
  17700. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  17701. gradients, but also prevents the filter from modifying the pixels near detailed
  17702. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  17703. values will be clipped to the valid range.
  17704. </p>
  17705. </dd>
  17706. </dl>
  17707. <p>Alternatively, the options can be specified as a flat string:
  17708. <var class="var">strength</var>[:<var class="var">radius</var>]
  17709. </p>
  17710. <a name="Examples-83"></a>
  17711. <h4 class="subsection">11.109.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-83" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-83" aria-hidden="true">TOC</a></span></h4>
  17712. <ul class="itemize mark-bullet">
  17713. <li>Apply the filter with a <code class="code">3.5</code> strength and radius of <code class="code">8</code>:
  17714. <div class="example">
  17715. <pre class="example-preformatted">gradfun=3.5:8
  17716. </pre></div>
  17717. </li><li>Specify radius, omitting the strength (which will fall-back to the default
  17718. value):
  17719. <div class="example">
  17720. <pre class="example-preformatted">gradfun=radius=8
  17721. </pre></div>
  17722. </li></ul>
  17723. <a class="anchor" id="graphmonitor"></a><a name="graphmonitor-1"></a>
  17724. <h3 class="section">11.110 graphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#graphmonitor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-graphmonitor-1" aria-hidden="true">TOC</a></span></h3>
  17725. <p>Show various filtergraph stats.
  17726. </p>
  17727. <p>With this filter one can debug complete filtergraph.
  17728. Especially issues with links filling with queued frames.
  17729. </p>
  17730. <p>The filter accepts the following options:
  17731. </p>
  17732. <dl class="table">
  17733. <dt><samp class="option">size, s</samp></dt>
  17734. <dd><p>Set video output size. Default is <var class="var">hd720</var>.
  17735. </p>
  17736. </dd>
  17737. <dt><samp class="option">opacity, o</samp></dt>
  17738. <dd><p>Set video opacity. Default is <var class="var">0.9</var>. Allowed range is from <var class="var">0</var> to <var class="var">1</var>.
  17739. </p>
  17740. </dd>
  17741. <dt><samp class="option">mode, m</samp></dt>
  17742. <dd><p>Set output mode flags.
  17743. </p>
  17744. <p>Available values for flags are:
  17745. </p><dl class="table">
  17746. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  17747. <dd><p>No any filtering. Default.
  17748. </p></dd>
  17749. <dt>&lsquo;<samp class="samp">compact</samp>&rsquo;</dt>
  17750. <dd><p>Show only filters with queued frames.
  17751. </p></dd>
  17752. <dt>&lsquo;<samp class="samp">nozero</samp>&rsquo;</dt>
  17753. <dd><p>Show only filters with non-zero stats.
  17754. </p></dd>
  17755. <dt>&lsquo;<samp class="samp">noeof</samp>&rsquo;</dt>
  17756. <dd><p>Show only filters with non-eof stat.
  17757. </p></dd>
  17758. <dt>&lsquo;<samp class="samp">nodisabled</samp>&rsquo;</dt>
  17759. <dd><p>Show only filters that are enabled in timeline.
  17760. </p></dd>
  17761. </dl>
  17762. </dd>
  17763. <dt><samp class="option">flags, f</samp></dt>
  17764. <dd><p>Set flags which enable which stats are shown in video.
  17765. </p>
  17766. <p>Available values for flags are:
  17767. </p><dl class="table">
  17768. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  17769. <dd><p>All flags turned off.
  17770. </p>
  17771. </dd>
  17772. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  17773. <dd><p>All flags turned on.
  17774. </p>
  17775. </dd>
  17776. <dt>&lsquo;<samp class="samp">queue</samp>&rsquo;</dt>
  17777. <dd><p>Display number of queued frames in each link.
  17778. </p>
  17779. </dd>
  17780. <dt>&lsquo;<samp class="samp">frame_count_in</samp>&rsquo;</dt>
  17781. <dd><p>Display number of frames taken from filter.
  17782. </p>
  17783. </dd>
  17784. <dt>&lsquo;<samp class="samp">frame_count_out</samp>&rsquo;</dt>
  17785. <dd><p>Display number of frames given out from filter.
  17786. </p>
  17787. </dd>
  17788. <dt>&lsquo;<samp class="samp">frame_count_delta</samp>&rsquo;</dt>
  17789. <dd><p>Display delta number of frames between above two values.
  17790. </p>
  17791. </dd>
  17792. <dt>&lsquo;<samp class="samp">pts</samp>&rsquo;</dt>
  17793. <dd><p>Display current filtered frame pts.
  17794. </p>
  17795. </dd>
  17796. <dt>&lsquo;<samp class="samp">pts_delta</samp>&rsquo;</dt>
  17797. <dd><p>Display pts delta between current and previous frame.
  17798. </p>
  17799. </dd>
  17800. <dt>&lsquo;<samp class="samp">time</samp>&rsquo;</dt>
  17801. <dd><p>Display current filtered frame time.
  17802. </p>
  17803. </dd>
  17804. <dt>&lsquo;<samp class="samp">time_delta</samp>&rsquo;</dt>
  17805. <dd><p>Display time delta between current and previous frame.
  17806. </p>
  17807. </dd>
  17808. <dt>&lsquo;<samp class="samp">timebase</samp>&rsquo;</dt>
  17809. <dd><p>Display time base for filter link.
  17810. </p>
  17811. </dd>
  17812. <dt>&lsquo;<samp class="samp">format</samp>&rsquo;</dt>
  17813. <dd><p>Display used format for filter link.
  17814. </p>
  17815. </dd>
  17816. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  17817. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  17818. </p>
  17819. </dd>
  17820. <dt>&lsquo;<samp class="samp">rate</samp>&rsquo;</dt>
  17821. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  17822. </p>
  17823. </dd>
  17824. <dt>&lsquo;<samp class="samp">eof</samp>&rsquo;</dt>
  17825. <dd><p>Display link output status.
  17826. </p>
  17827. </dd>
  17828. <dt>&lsquo;<samp class="samp">sample_count_in</samp>&rsquo;</dt>
  17829. <dd><p>Display number of samples taken from filter.
  17830. </p>
  17831. </dd>
  17832. <dt>&lsquo;<samp class="samp">sample_count_out</samp>&rsquo;</dt>
  17833. <dd><p>Display number of samples given out from filter.
  17834. </p>
  17835. </dd>
  17836. <dt>&lsquo;<samp class="samp">sample_count_delta</samp>&rsquo;</dt>
  17837. <dd><p>Display delta number of samples between above two values.
  17838. </p>
  17839. </dd>
  17840. <dt>&lsquo;<samp class="samp">disabled</samp>&rsquo;</dt>
  17841. <dd><p>Show the timeline filter status.
  17842. </p></dd>
  17843. </dl>
  17844. </dd>
  17845. <dt><samp class="option">rate, r</samp></dt>
  17846. <dd><p>Set upper limit for video rate of output stream, Default value is <var class="var">25</var>.
  17847. This guarantee that output video frame rate will not be higher than this value.
  17848. </p></dd>
  17849. </dl>
  17850. <a name="grayworld"></a>
  17851. <h3 class="section">11.111 grayworld<span class="pull-right"><a class="anchor hidden-xs" href="#grayworld" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-grayworld" aria-hidden="true">TOC</a></span></h3>
  17852. <p>A color constancy filter that applies color correction based on the grayworld assumption
  17853. </p>
  17854. <p>See: <a class="url" href="https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging">https://www.researchgate.net/publication/275213614_A_New_Color_Correction_Method_for_Underwater_Imaging</a>
  17855. </p>
  17856. <p>The algorithm uses linear light, so input
  17857. data should be linearized beforehand (and possibly correctly tagged).
  17858. </p>
  17859. <div class="example">
  17860. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,grayworld,zscale=transfer=bt709,format=yuv420p OUTPUT
  17861. </pre></div>
  17862. <a name="greyedge"></a>
  17863. <h3 class="section">11.112 greyedge<span class="pull-right"><a class="anchor hidden-xs" href="#greyedge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-greyedge" aria-hidden="true">TOC</a></span></h3>
  17864. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  17865. and corrects the scene colors accordingly.
  17866. </p>
  17867. <p>See: <a class="url" href="https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf">https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf</a>
  17868. </p>
  17869. <p>The filter accepts the following options:
  17870. </p>
  17871. <dl class="table">
  17872. <dt><samp class="option">difford</samp></dt>
  17873. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  17874. [0,2] and default value is 1.
  17875. </p>
  17876. </dd>
  17877. <dt><samp class="option">minknorm</samp></dt>
  17878. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  17879. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  17880. max value instead of calculating Minkowski distance.
  17881. </p>
  17882. </dd>
  17883. <dt><samp class="option">sigma</samp></dt>
  17884. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  17885. chosen in the range [0,1024.0] and default value = 1. floor( <var class="var">sigma</var> * break_off_sigma(3) )
  17886. can&rsquo;t be equal to 0 if <var class="var">difford</var> is greater than 0.
  17887. </p></dd>
  17888. </dl>
  17889. <a name="Examples-84"></a>
  17890. <h4 class="subsection">11.112.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-84" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-84" aria-hidden="true">TOC</a></span></h4>
  17891. <ul class="itemize mark-bullet">
  17892. <li>Grey Edge:
  17893. <div class="example">
  17894. <pre class="example-preformatted">greyedge=difford=1:minknorm=5:sigma=2
  17895. </pre></div>
  17896. </li><li>Max Edge:
  17897. <div class="example">
  17898. <pre class="example-preformatted">greyedge=difford=1:minknorm=0:sigma=2
  17899. </pre></div>
  17900. </li></ul>
  17901. <a name="guided"></a>
  17902. <h3 class="section">11.113 guided<span class="pull-right"><a class="anchor hidden-xs" href="#guided" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-guided" aria-hidden="true">TOC</a></span></h3>
  17903. <p>Apply guided filter for edge-preserving smoothing, dehazing and so on.
  17904. </p>
  17905. <p>The filter accepts the following options:
  17906. </p><dl class="table">
  17907. <dt><samp class="option">radius</samp></dt>
  17908. <dd><p>Set the box radius in pixels.
  17909. Allowed range is 1 to 20. Default is 3.
  17910. </p>
  17911. </dd>
  17912. <dt><samp class="option">eps</samp></dt>
  17913. <dd><p>Set regularization parameter (with square).
  17914. Allowed range is 0 to 1. Default is 0.01.
  17915. </p>
  17916. </dd>
  17917. <dt><samp class="option">mode</samp></dt>
  17918. <dd><p>Set filter mode. Can be <code class="code">basic</code> or <code class="code">fast</code>.
  17919. Default is <code class="code">basic</code>.
  17920. </p>
  17921. </dd>
  17922. <dt><samp class="option">sub</samp></dt>
  17923. <dd><p>Set subsampling ratio for <code class="code">fast</code> mode.
  17924. Range is 2 to 64. Default is 4.
  17925. No subsampling occurs in <code class="code">basic</code> mode.
  17926. </p>
  17927. </dd>
  17928. <dt><samp class="option">guidance</samp></dt>
  17929. <dd><p>Set guidance mode. Can be <code class="code">off</code> or <code class="code">on</code>. Default is <code class="code">off</code>.
  17930. If <code class="code">off</code>, single input is required.
  17931. If <code class="code">on</code>, two inputs of the same resolution and pixel format are required.
  17932. The second input serves as the guidance.
  17933. </p>
  17934. </dd>
  17935. <dt><samp class="option">planes</samp></dt>
  17936. <dd><p>Set planes to filter. Default is first only.
  17937. </p></dd>
  17938. </dl>
  17939. <a name="Commands-96"></a>
  17940. <h4 class="subsection">11.113.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-96" aria-hidden="true">TOC</a></span></h4>
  17941. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  17942. </p>
  17943. <a name="Examples-85"></a>
  17944. <h4 class="subsection">11.113.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-85" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-85" aria-hidden="true">TOC</a></span></h4>
  17945. <ul class="itemize mark-bullet">
  17946. <li>Edge-preserving smoothing with guided filter:
  17947. <div class="example">
  17948. <pre class="example-preformatted">ffmpeg -i in.png -vf guided out.png
  17949. </pre></div>
  17950. </li><li>Dehazing, structure-transferring filtering, detail enhancement with guided filter.
  17951. For the generation of guidance image, refer to paper &quot;Guided Image Filtering&quot;.
  17952. See: <a class="url" href="http://kaiminghe.com/publications/pami12guidedfilter.pdf">http://kaiminghe.com/publications/pami12guidedfilter.pdf</a>.
  17953. <div class="example">
  17954. <pre class="example-preformatted">ffmpeg -i in.png -i guidance.png -filter_complex guided=guidance=on out.png
  17955. </pre></div>
  17956. </li></ul>
  17957. <a class="anchor" id="haldclut"></a><a name="haldclut-1"></a>
  17958. <h3 class="section">11.114 haldclut<span class="pull-right"><a class="anchor hidden-xs" href="#haldclut-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-haldclut-1" aria-hidden="true">TOC</a></span></h3>
  17959. <p>Apply a Hald CLUT to a video stream.
  17960. </p>
  17961. <p>First input is the video stream to process, and second one is the Hald CLUT.
  17962. The Hald CLUT input can be a simple picture or a complete video stream.
  17963. </p>
  17964. <p>The filter accepts the following options:
  17965. </p>
  17966. <dl class="table">
  17967. <dt><samp class="option">clut</samp></dt>
  17968. <dd><p>Set which CLUT video frames will be processed from second input stream,
  17969. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  17970. </p>
  17971. </dd>
  17972. <dt><samp class="option">shortest</samp></dt>
  17973. <dd><p>Force termination when the shortest input terminates. Default is <code class="code">0</code>.
  17974. </p></dd>
  17975. <dt><samp class="option">repeatlast</samp></dt>
  17976. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  17977. <code class="code">0</code> disable the filter after the last frame of the CLUT is reached.
  17978. Default is <code class="code">1</code>.
  17979. </p></dd>
  17980. </dl>
  17981. <p><code class="code">haldclut</code> also has the same interpolation options as <a class="ref" href="#lut3d">lut3d</a> (both
  17982. filters share the same internals).
  17983. </p>
  17984. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  17985. </p>
  17986. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  17987. (Hald CLUT author) at <a class="url" href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  17988. </p>
  17989. <a name="Commands-97"></a>
  17990. <h4 class="subsection">11.114.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-97" aria-hidden="true">TOC</a></span></h4>
  17991. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  17992. </p>
  17993. <a name="Workflow-examples"></a>
  17994. <h4 class="subsection">11.114.2 Workflow examples<span class="pull-right"><a class="anchor hidden-xs" href="#Workflow-examples" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Workflow-examples" aria-hidden="true">TOC</a></span></h4>
  17995. <a name="Hald-CLUT-video-stream"></a>
  17996. <h4 class="subsubsection">11.114.2.1 Hald CLUT video stream<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-video-stream" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-video-stream" aria-hidden="true">TOC</a></span></h4>
  17997. <p>Generate an identity Hald CLUT stream altered with various effects:
  17998. </p><div class="example">
  17999. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" 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
  18000. </pre></div>
  18001. <p>Note: make sure you use a lossless codec.
  18002. </p>
  18003. <p>Then use it with <code class="code">haldclut</code> to apply it on some random stream:
  18004. </p><div class="example">
  18005. <pre class="example-preformatted">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  18006. </pre></div>
  18007. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  18008. <samp class="file">clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  18009. to the remaining frames of the <code class="code">mandelbrot</code> stream.
  18010. </p>
  18011. <a name="Hald-CLUT-with-preview"></a>
  18012. <h4 class="subsubsection">11.114.2.2 Hald CLUT with preview<span class="pull-right"><a class="anchor hidden-xs" href="#Hald-CLUT-with-preview" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Hald-CLUT-with-preview" aria-hidden="true">TOC</a></span></h4>
  18013. <p>A Hald CLUT is supposed to be a squared image of <code class="code">Level*Level*Level</code> by
  18014. <code class="code">Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  18015. biggest possible square starting at the top left of the picture. The remaining
  18016. padding pixels (bottom or right) will be ignored. This area can be used to add
  18017. a preview of the Hald CLUT.
  18018. </p>
  18019. <p>Typically, the following generated Hald CLUT will be supported by the
  18020. <code class="code">haldclut</code> filter:
  18021. </p>
  18022. <div class="example">
  18023. <pre class="example-preformatted">ffmpeg -f lavfi -i <a class="ref" href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  18024. pad=iw+320 [padded_clut];
  18025. smptebars=s=320x256, split [a][b];
  18026. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  18027. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  18028. </pre></div>
  18029. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  18030. bars are displayed on the right-top, and below the same color bars processed by
  18031. the color changes.
  18032. </p>
  18033. <p>Then, the effect of this Hald CLUT can be visualized with:
  18034. </p><div class="example">
  18035. <pre class="example-preformatted">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  18036. </pre></div>
  18037. <a name="hflip"></a>
  18038. <h3 class="section">11.115 hflip<span class="pull-right"><a class="anchor hidden-xs" href="#hflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip" aria-hidden="true">TOC</a></span></h3>
  18039. <p>Flip the input video horizontally.
  18040. </p>
  18041. <p>For example, to horizontally flip the input video with <code class="command">ffmpeg</code>:
  18042. </p><div class="example">
  18043. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  18044. </pre></div>
  18045. <a name="histeq"></a>
  18046. <h3 class="section">11.116 histeq<span class="pull-right"><a class="anchor hidden-xs" href="#histeq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histeq" aria-hidden="true">TOC</a></span></h3>
  18047. <p>This filter applies a global color histogram equalization on a
  18048. per-frame basis.
  18049. </p>
  18050. <p>It can be used to correct video that has a compressed range of pixel
  18051. intensities. The filter redistributes the pixel intensities to
  18052. equalize their distribution across the intensity range. It may be
  18053. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  18054. useful only for correcting degraded or poorly captured source
  18055. video.
  18056. </p>
  18057. <p>The filter accepts the following options:
  18058. </p>
  18059. <dl class="table">
  18060. <dt><samp class="option">strength</samp></dt>
  18061. <dd><p>Determine the amount of equalization to be applied. As the strength
  18062. is reduced, the distribution of pixel intensities more-and-more
  18063. approaches that of the input frame. The value must be a float number
  18064. in the range [0,1] and defaults to 0.200.
  18065. </p>
  18066. </dd>
  18067. <dt><samp class="option">intensity</samp></dt>
  18068. <dd><p>Set the maximum intensity that can generated and scale the output
  18069. values appropriately. The strength should be set as desired and then
  18070. the intensity can be limited if needed to avoid washing-out. The value
  18071. must be a float number in the range [0,1] and defaults to 0.210.
  18072. </p>
  18073. </dd>
  18074. <dt><samp class="option">antibanding</samp></dt>
  18075. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  18076. the luminance of output pixels by a small amount to avoid banding of
  18077. the histogram. Possible values are <code class="code">none</code>, <code class="code">weak</code> or
  18078. <code class="code">strong</code>. It defaults to <code class="code">none</code>.
  18079. </p></dd>
  18080. </dl>
  18081. <a class="anchor" id="histogram"></a><a name="histogram-1"></a>
  18082. <h3 class="section">11.117 histogram<span class="pull-right"><a class="anchor hidden-xs" href="#histogram-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-histogram-1" aria-hidden="true">TOC</a></span></h3>
  18083. <p>Compute and draw a color distribution histogram for the input video.
  18084. </p>
  18085. <p>The computed histogram is a representation of the color component
  18086. distribution in an image.
  18087. </p>
  18088. <p>Standard histogram displays the color components distribution in an image.
  18089. Displays color graph for each color component. Shows distribution of
  18090. the Y, U, V, A or R, G, B components, depending on input format, in the
  18091. current frame. Below each graph a color component scale meter is shown.
  18092. </p>
  18093. <p>The filter accepts the following options:
  18094. </p>
  18095. <dl class="table">
  18096. <dt><samp class="option">level_height</samp></dt>
  18097. <dd><p>Set height of level. Default value is <code class="code">200</code>.
  18098. Allowed range is [50, 2048].
  18099. </p>
  18100. </dd>
  18101. <dt><samp class="option">scale_height</samp></dt>
  18102. <dd><p>Set height of color scale. Default value is <code class="code">12</code>.
  18103. Allowed range is [0, 40].
  18104. </p>
  18105. </dd>
  18106. <dt><samp class="option">display_mode</samp></dt>
  18107. <dd><p>Set display mode.
  18108. It accepts the following values:
  18109. </p><dl class="table">
  18110. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  18111. <dd><p>Per color component graphs are placed below each other.
  18112. </p>
  18113. </dd>
  18114. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  18115. <dd><p>Per color component graphs are placed side by side.
  18116. </p>
  18117. </dd>
  18118. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  18119. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  18120. that the graphs representing color components are superimposed directly
  18121. over one another.
  18122. </p></dd>
  18123. </dl>
  18124. <p>Default is <code class="code">stack</code>.
  18125. </p>
  18126. </dd>
  18127. <dt><samp class="option">levels_mode</samp></dt>
  18128. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  18129. Default is <code class="code">linear</code>.
  18130. </p>
  18131. </dd>
  18132. <dt><samp class="option">components</samp></dt>
  18133. <dd><p>Set what color components to display.
  18134. Default is <code class="code">7</code>.
  18135. </p>
  18136. </dd>
  18137. <dt><samp class="option">fgopacity</samp></dt>
  18138. <dd><p>Set foreground opacity. Default is <code class="code">0.7</code>.
  18139. </p>
  18140. </dd>
  18141. <dt><samp class="option">bgopacity</samp></dt>
  18142. <dd><p>Set background opacity. Default is <code class="code">0.5</code>.
  18143. </p>
  18144. </dd>
  18145. <dt><samp class="option">colors_mode</samp></dt>
  18146. <dd><p>Set colors mode.
  18147. It accepts the following values:
  18148. </p><dl class="table">
  18149. <dt>&lsquo;<samp class="samp">whiteonblack</samp>&rsquo;</dt>
  18150. <dt>&lsquo;<samp class="samp">blackonwhite</samp>&rsquo;</dt>
  18151. <dt>&lsquo;<samp class="samp">whiteongray</samp>&rsquo;</dt>
  18152. <dt>&lsquo;<samp class="samp">blackongray</samp>&rsquo;</dt>
  18153. <dt>&lsquo;<samp class="samp">coloronblack</samp>&rsquo;</dt>
  18154. <dt>&lsquo;<samp class="samp">coloronwhite</samp>&rsquo;</dt>
  18155. <dt>&lsquo;<samp class="samp">colorongray</samp>&rsquo;</dt>
  18156. <dt>&lsquo;<samp class="samp">blackoncolor</samp>&rsquo;</dt>
  18157. <dt>&lsquo;<samp class="samp">whiteoncolor</samp>&rsquo;</dt>
  18158. <dt>&lsquo;<samp class="samp">grayoncolor</samp>&rsquo;</dt>
  18159. </dl>
  18160. <p>Default is <code class="code">whiteonblack</code>.
  18161. </p></dd>
  18162. </dl>
  18163. <a name="Examples-86"></a>
  18164. <h4 class="subsection">11.117.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-86" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-86" aria-hidden="true">TOC</a></span></h4>
  18165. <ul class="itemize mark-bullet">
  18166. <li>Calculate and draw histogram:
  18167. <div class="example">
  18168. <pre class="example-preformatted">ffplay -i input -vf histogram
  18169. </pre></div>
  18170. </li></ul>
  18171. <a class="anchor" id="hqdn3d"></a><a name="hqdn3d-1"></a>
  18172. <h3 class="section">11.118 hqdn3d<span class="pull-right"><a class="anchor hidden-xs" href="#hqdn3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqdn3d-1" aria-hidden="true">TOC</a></span></h3>
  18173. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  18174. image noise, producing smooth images and making still images really
  18175. still. It should enhance compressibility.
  18176. </p>
  18177. <p>It accepts the following optional parameters:
  18178. </p>
  18179. <dl class="table">
  18180. <dt><samp class="option">luma_spatial</samp></dt>
  18181. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  18182. It defaults to 4.0.
  18183. </p>
  18184. </dd>
  18185. <dt><samp class="option">chroma_spatial</samp></dt>
  18186. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  18187. It defaults to 3.0*<var class="var">luma_spatial</var>/4.0.
  18188. </p>
  18189. </dd>
  18190. <dt><samp class="option">luma_tmp</samp></dt>
  18191. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  18192. 6.0*<var class="var">luma_spatial</var>/4.0.
  18193. </p>
  18194. </dd>
  18195. <dt><samp class="option">chroma_tmp</samp></dt>
  18196. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  18197. <var class="var">luma_tmp</var>*<var class="var">chroma_spatial</var>/<var class="var">luma_spatial</var>.
  18198. </p></dd>
  18199. </dl>
  18200. <a name="Commands-98"></a>
  18201. <h4 class="subsection">11.118.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-98" aria-hidden="true">TOC</a></span></h4>
  18202. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  18203. The command accepts the same syntax of the corresponding option.
  18204. </p>
  18205. <p>If the specified expression is not valid, it is kept at its current
  18206. value.
  18207. </p>
  18208. <a class="anchor" id="hwdownload"></a><a name="hwdownload-1"></a>
  18209. <h3 class="section">11.119 hwdownload<span class="pull-right"><a class="anchor hidden-xs" href="#hwdownload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwdownload-1" aria-hidden="true">TOC</a></span></h3>
  18210. <p>Download hardware frames to system memory.
  18211. </p>
  18212. <p>The input must be in hardware frames, and the output a non-hardware format.
  18213. Not all formats will be supported on the output - it may be necessary to insert
  18214. an additional <samp class="option">format</samp> filter immediately following in the graph to get
  18215. the output in a supported format.
  18216. </p>
  18217. <a name="hwmap"></a>
  18218. <h3 class="section">11.120 hwmap<span class="pull-right"><a class="anchor hidden-xs" href="#hwmap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwmap" aria-hidden="true">TOC</a></span></h3>
  18219. <p>Map hardware frames to system memory or to another device.
  18220. </p>
  18221. <p>This filter has several different modes of operation; which one is used depends
  18222. on the input and output formats:
  18223. </p><ul class="itemize mark-bullet">
  18224. <li>Hardware frame input, normal frame output
  18225. <p>Map the input frames to system memory and pass them to the output. If the
  18226. original hardware frame is later required (for example, after overlaying
  18227. something else on part of it), the <samp class="option">hwmap</samp> filter can be used again
  18228. in the next mode to retrieve it.
  18229. </p></li><li>Normal frame input, hardware frame output
  18230. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  18231. that is, return the original hardware frame.
  18232. </p>
  18233. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  18234. device for the output, then map them back to the software format at the input
  18235. and give those frames to the preceding filter. This will then act like the
  18236. <samp class="option">hwupload</samp> filter, but may be able to avoid an additional copy when
  18237. the input is already in a compatible format.
  18238. </p></li><li>Hardware frame input and output
  18239. <p>A device must be supplied for the output, either directly or with the
  18240. <samp class="option">derive_device</samp> option. The input and output devices must be of
  18241. different types and compatible - the exact meaning of this is
  18242. system-dependent, but typically it means that they must refer to the same
  18243. underlying hardware context (for example, refer to the same graphics card).
  18244. </p>
  18245. <p>If the input frames were originally created on the output device, then unmap
  18246. to retrieve the original frames.
  18247. </p>
  18248. <p>Otherwise, map the frames to the output device - create new hardware frames
  18249. on the output corresponding to the frames on the input.
  18250. </p></li></ul>
  18251. <p>The following additional parameters are accepted:
  18252. </p>
  18253. <dl class="table">
  18254. <dt><samp class="option">mode</samp></dt>
  18255. <dd><p>Set the frame mapping mode. Some combination of:
  18256. </p><dl class="table">
  18257. <dt><var class="var">read</var></dt>
  18258. <dd><p>The mapped frame should be readable.
  18259. </p></dd>
  18260. <dt><var class="var">write</var></dt>
  18261. <dd><p>The mapped frame should be writeable.
  18262. </p></dd>
  18263. <dt><var class="var">overwrite</var></dt>
  18264. <dd><p>The mapping will always overwrite the entire frame.
  18265. </p>
  18266. <p>This may improve performance in some cases, as the original contents of the
  18267. frame need not be loaded.
  18268. </p></dd>
  18269. <dt><var class="var">direct</var></dt>
  18270. <dd><p>The mapping must not involve any copying.
  18271. </p>
  18272. <p>Indirect mappings to copies of frames are created in some cases where either
  18273. direct mapping is not possible or it would have unexpected properties.
  18274. Setting this flag ensures that the mapping is direct and will fail if that is
  18275. not possible.
  18276. </p></dd>
  18277. </dl>
  18278. <p>Defaults to <var class="var">read+write</var> if not specified.
  18279. </p>
  18280. </dd>
  18281. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  18282. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  18283. device of type <var class="var">type</var> from the device the input frames exist on.
  18284. </p>
  18285. </dd>
  18286. <dt><samp class="option">reverse</samp></dt>
  18287. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  18288. and map them back to the source. This may be necessary in some cases where
  18289. a mapping in one direction is required but only the opposite direction is
  18290. supported by the devices being used.
  18291. </p>
  18292. <p>This option is dangerous - it may break the preceding filter in undefined
  18293. ways if there are any additional constraints on that filter&rsquo;s output.
  18294. Do not use it without fully understanding the implications of its use.
  18295. </p></dd>
  18296. </dl>
  18297. <a class="anchor" id="hwupload"></a><a name="hwupload-1"></a>
  18298. <h3 class="section">11.121 hwupload<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload-1" aria-hidden="true">TOC</a></span></h3>
  18299. <p>Upload system memory frames to hardware surfaces.
  18300. </p>
  18301. <p>The device to upload to must be supplied when the filter is initialised. If
  18302. using ffmpeg, select the appropriate device with the <samp class="option">-filter_hw_device</samp>
  18303. option or with the <samp class="option">derive_device</samp> option. The input and output devices
  18304. must be of different types and compatible - the exact meaning of this is
  18305. system-dependent, but typically it means that they must refer to the same
  18306. underlying hardware context (for example, refer to the same graphics card).
  18307. </p>
  18308. <p>The following additional parameters are accepted:
  18309. </p>
  18310. <dl class="table">
  18311. <dt><samp class="option">derive_device <var class="var">type</var></samp></dt>
  18312. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  18313. device of type <var class="var">type</var> from the device the input frames exist on.
  18314. </p></dd>
  18315. </dl>
  18316. <a class="anchor" id="hwupload_005fcuda"></a><a name="hwupload_005fcuda-1"></a>
  18317. <h3 class="section">11.122 hwupload_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#hwupload_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hwupload_005fcuda-1" aria-hidden="true">TOC</a></span></h3>
  18318. <p>Upload system memory frames to a CUDA device.
  18319. </p>
  18320. <p>It accepts the following optional parameters:
  18321. </p>
  18322. <dl class="table">
  18323. <dt><samp class="option">device</samp></dt>
  18324. <dd><p>The number of the CUDA device to use
  18325. </p></dd>
  18326. </dl>
  18327. <a name="hqx"></a>
  18328. <h3 class="section">11.123 hqx<span class="pull-right"><a class="anchor hidden-xs" href="#hqx" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hqx" aria-hidden="true">TOC</a></span></h3>
  18329. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  18330. was originally created by Maxim Stepin.
  18331. </p>
  18332. <p>It accepts the following option:
  18333. </p>
  18334. <dl class="table">
  18335. <dt><samp class="option">n</samp></dt>
  18336. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">hq2x</code>, <code class="code">3</code> for
  18337. <code class="code">hq3x</code> and <code class="code">4</code> for <code class="code">hq4x</code>.
  18338. Default is <code class="code">3</code>.
  18339. </p></dd>
  18340. </dl>
  18341. <a class="anchor" id="hstack"></a><a name="hstack-1"></a>
  18342. <h3 class="section">11.124 hstack<span class="pull-right"><a class="anchor hidden-xs" href="#hstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack-1" aria-hidden="true">TOC</a></span></h3>
  18343. <p>Stack input videos horizontally.
  18344. </p>
  18345. <p>All streams must be of same pixel format and of same height.
  18346. </p>
  18347. <p>Note that this filter is faster than using <a class="ref" href="#overlay">overlay</a> and <a class="ref" href="#pad">pad</a> filter
  18348. to create same output.
  18349. </p>
  18350. <p>The filter accepts the following option:
  18351. </p>
  18352. <dl class="table">
  18353. <dt><samp class="option">inputs</samp></dt>
  18354. <dd><p>Set number of input streams. Default is 2.
  18355. </p>
  18356. </dd>
  18357. <dt><samp class="option">shortest</samp></dt>
  18358. <dd><p>If set to 1, force the output to terminate when the shortest input
  18359. terminates. Default value is 0.
  18360. </p></dd>
  18361. </dl>
  18362. <a name="hsvhold"></a>
  18363. <h3 class="section">11.125 hsvhold<span class="pull-right"><a class="anchor hidden-xs" href="#hsvhold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvhold" aria-hidden="true">TOC</a></span></h3>
  18364. <p>Turns a certain HSV range into gray values.
  18365. </p>
  18366. <p>This filter measures color difference between set HSV color in options
  18367. and ones measured in video stream. Depending on options, output
  18368. colors can be changed to be gray or not.
  18369. </p>
  18370. <p>The filter accepts the following options:
  18371. </p>
  18372. <dl class="table">
  18373. <dt><samp class="option">hue</samp></dt>
  18374. <dd><p>Set the hue value which will be used in color difference calculation.
  18375. Allowed range is from -360 to 360. Default value is 0.
  18376. </p>
  18377. </dd>
  18378. <dt><samp class="option">sat</samp></dt>
  18379. <dd><p>Set the saturation value which will be used in color difference calculation.
  18380. Allowed range is from -1 to 1. Default value is 0.
  18381. </p>
  18382. </dd>
  18383. <dt><samp class="option">val</samp></dt>
  18384. <dd><p>Set the value which will be used in color difference calculation.
  18385. Allowed range is from -1 to 1. Default value is 0.
  18386. </p>
  18387. </dd>
  18388. <dt><samp class="option">similarity</samp></dt>
  18389. <dd><p>Set similarity percentage with the key color.
  18390. Allowed range is from 0 to 1. Default value is 0.01.
  18391. </p>
  18392. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  18393. </p>
  18394. </dd>
  18395. <dt><samp class="option">blend</samp></dt>
  18396. <dd><p>Blend percentage.
  18397. Allowed range is from 0 to 1. Default value is 0.
  18398. </p>
  18399. <p>0.0 makes pixels either fully gray, or not gray at all.
  18400. </p>
  18401. <p>Higher values result in more gray pixels, with a higher gray pixel
  18402. the more similar the pixels color is to the key color.
  18403. </p></dd>
  18404. </dl>
  18405. <a name="hsvkey"></a>
  18406. <h3 class="section">11.126 hsvkey<span class="pull-right"><a class="anchor hidden-xs" href="#hsvkey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hsvkey" aria-hidden="true">TOC</a></span></h3>
  18407. <p>Turns a certain HSV range into transparency.
  18408. </p>
  18409. <p>This filter measures color difference between set HSV color in options
  18410. and ones measured in video stream. Depending on options, output
  18411. colors can be changed to transparent by adding alpha channel.
  18412. </p>
  18413. <p>The filter accepts the following options:
  18414. </p>
  18415. <dl class="table">
  18416. <dt><samp class="option">hue</samp></dt>
  18417. <dd><p>Set the hue value which will be used in color difference calculation.
  18418. Allowed range is from -360 to 360. Default value is 0.
  18419. </p>
  18420. </dd>
  18421. <dt><samp class="option">sat</samp></dt>
  18422. <dd><p>Set the saturation value which will be used in color difference calculation.
  18423. Allowed range is from -1 to 1. Default value is 0.
  18424. </p>
  18425. </dd>
  18426. <dt><samp class="option">val</samp></dt>
  18427. <dd><p>Set the value which will be used in color difference calculation.
  18428. Allowed range is from -1 to 1. Default value is 0.
  18429. </p>
  18430. </dd>
  18431. <dt><samp class="option">similarity</samp></dt>
  18432. <dd><p>Set similarity percentage with the key color.
  18433. Allowed range is from 0 to 1. Default value is 0.01.
  18434. </p>
  18435. <p>0.00001 matches only the exact key color, while 1.0 matches everything.
  18436. </p>
  18437. </dd>
  18438. <dt><samp class="option">blend</samp></dt>
  18439. <dd><p>Blend percentage.
  18440. Allowed range is from 0 to 1. Default value is 0.
  18441. </p>
  18442. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  18443. </p>
  18444. <p>Higher values result in semi-transparent pixels, with a higher transparency
  18445. the more similar the pixels color is to the key color.
  18446. </p></dd>
  18447. </dl>
  18448. <a name="hue"></a>
  18449. <h3 class="section">11.127 hue<span class="pull-right"><a class="anchor hidden-xs" href="#hue" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hue" aria-hidden="true">TOC</a></span></h3>
  18450. <p>Modify the hue and/or the saturation of the input.
  18451. </p>
  18452. <p>It accepts the following parameters:
  18453. </p>
  18454. <dl class="table">
  18455. <dt><samp class="option">h</samp></dt>
  18456. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  18457. and defaults to &quot;0&quot;.
  18458. </p>
  18459. </dd>
  18460. <dt><samp class="option">s</samp></dt>
  18461. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  18462. defaults to &quot;1&quot;.
  18463. </p>
  18464. </dd>
  18465. <dt><samp class="option">H</samp></dt>
  18466. <dd><p>Specify the hue angle as a number of radians. It accepts an
  18467. expression, and defaults to &quot;0&quot;.
  18468. </p>
  18469. </dd>
  18470. <dt><samp class="option">b</samp></dt>
  18471. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  18472. defaults to &quot;0&quot;.
  18473. </p></dd>
  18474. </dl>
  18475. <p><samp class="option">h</samp> and <samp class="option">H</samp> are mutually exclusive, and can&rsquo;t be
  18476. specified at the same time.
  18477. </p>
  18478. <p>The <samp class="option">b</samp>, <samp class="option">h</samp>, <samp class="option">H</samp> and <samp class="option">s</samp> option values are
  18479. expressions containing the following constants:
  18480. </p>
  18481. <dl class="table">
  18482. <dt><samp class="option">n</samp></dt>
  18483. <dd><p>frame count of the input frame starting from 0
  18484. </p>
  18485. </dd>
  18486. <dt><samp class="option">pts</samp></dt>
  18487. <dd><p>presentation timestamp of the input frame expressed in time base units
  18488. </p>
  18489. </dd>
  18490. <dt><samp class="option">r</samp></dt>
  18491. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  18492. </p>
  18493. </dd>
  18494. <dt><samp class="option">t</samp></dt>
  18495. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  18496. </p>
  18497. </dd>
  18498. <dt><samp class="option">tb</samp></dt>
  18499. <dd><p>time base of the input video
  18500. </p></dd>
  18501. </dl>
  18502. <a name="Examples-87"></a>
  18503. <h4 class="subsection">11.127.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-87" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-87" aria-hidden="true">TOC</a></span></h4>
  18504. <ul class="itemize mark-bullet">
  18505. <li>Set the hue to 90 degrees and the saturation to 1.0:
  18506. <div class="example">
  18507. <pre class="example-preformatted">hue=h=90:s=1
  18508. </pre></div>
  18509. </li><li>Same command but expressing the hue in radians:
  18510. <div class="example">
  18511. <pre class="example-preformatted">hue=H=PI/2:s=1
  18512. </pre></div>
  18513. </li><li>Rotate hue and make the saturation swing between 0
  18514. and 2 over a period of 1 second:
  18515. <div class="example">
  18516. <pre class="example-preformatted">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  18517. </pre></div>
  18518. </li><li>Apply a 3 seconds saturation fade-in effect starting at 0:
  18519. <div class="example">
  18520. <pre class="example-preformatted">hue=&quot;s=min(t/3\,1)&quot;
  18521. </pre></div>
  18522. <p>The general fade-in expression can be written as:
  18523. </p><div class="example">
  18524. <pre class="example-preformatted">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  18525. </pre></div>
  18526. </li><li>Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  18527. <div class="example">
  18528. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  18529. </pre></div>
  18530. <p>The general fade-out expression can be written as:
  18531. </p><div class="example">
  18532. <pre class="example-preformatted">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  18533. </pre></div>
  18534. </li></ul>
  18535. <a name="Commands-99"></a>
  18536. <h4 class="subsection">11.127.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-99" aria-hidden="true">TOC</a></span></h4>
  18537. <p>This filter supports the following commands:
  18538. </p><dl class="table">
  18539. <dt><samp class="option">b</samp></dt>
  18540. <dt><samp class="option">s</samp></dt>
  18541. <dt><samp class="option">h</samp></dt>
  18542. <dt><samp class="option">H</samp></dt>
  18543. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  18544. The command accepts the same syntax of the corresponding option.
  18545. </p>
  18546. <p>If the specified expression is not valid, it is kept at its current
  18547. value.
  18548. </p></dd>
  18549. </dl>
  18550. <a name="huesaturation"></a>
  18551. <h3 class="section">11.128 huesaturation<span class="pull-right"><a class="anchor hidden-xs" href="#huesaturation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-huesaturation" aria-hidden="true">TOC</a></span></h3>
  18552. <p>Apply hue-saturation-intensity adjustments to input video stream.
  18553. </p>
  18554. <p>This filter operates in RGB colorspace.
  18555. </p>
  18556. <p>This filter accepts the following options:
  18557. </p>
  18558. <dl class="table">
  18559. <dt><samp class="option">hue</samp></dt>
  18560. <dd><p>Set the hue shift in degrees to apply. Default is 0.
  18561. Allowed range is from -180 to 180.
  18562. </p>
  18563. </dd>
  18564. <dt><samp class="option">saturation</samp></dt>
  18565. <dd><p>Set the saturation shift. Default is 0.
  18566. Allowed range is from -1 to 1.
  18567. </p>
  18568. </dd>
  18569. <dt><samp class="option">intensity</samp></dt>
  18570. <dd><p>Set the intensity shift. Default is 0.
  18571. Allowed range is from -1 to 1.
  18572. </p>
  18573. </dd>
  18574. <dt><samp class="option">colors</samp></dt>
  18575. <dd><p>Set which primary and complementary colors are going to be adjusted.
  18576. This options is set by providing one or multiple values.
  18577. This can select multiple colors at once. By default all colors are selected.
  18578. </p><dl class="table">
  18579. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  18580. <dd><p>Adjust reds.
  18581. </p></dd>
  18582. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  18583. <dd><p>Adjust yellows.
  18584. </p></dd>
  18585. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  18586. <dd><p>Adjust greens.
  18587. </p></dd>
  18588. <dt>&lsquo;<samp class="samp">c</samp>&rsquo;</dt>
  18589. <dd><p>Adjust cyans.
  18590. </p></dd>
  18591. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  18592. <dd><p>Adjust blues.
  18593. </p></dd>
  18594. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  18595. <dd><p>Adjust magentas.
  18596. </p></dd>
  18597. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  18598. <dd><p>Adjust all colors.
  18599. </p></dd>
  18600. </dl>
  18601. </dd>
  18602. <dt><samp class="option">strength</samp></dt>
  18603. <dd><p>Set strength of filtering. Allowed range is from 0 to 100.
  18604. Default value is 1.
  18605. </p>
  18606. </dd>
  18607. <dt><samp class="option">rw, gw, bw</samp></dt>
  18608. <dd><p>Set weight for each RGB component. Allowed range is from 0 to 1.
  18609. By default is set to 0.333, 0.334, 0.333.
  18610. Those options are used in saturation and lightess processing.
  18611. </p>
  18612. </dd>
  18613. <dt><samp class="option">lightness</samp></dt>
  18614. <dd><p>Set preserving lightness, by default is disabled.
  18615. Adjusting hues can change lightness from original RGB triplet,
  18616. with this option enabled lightness is kept at same value.
  18617. </p></dd>
  18618. </dl>
  18619. <a name="hysteresis"></a>
  18620. <h3 class="section">11.129 hysteresis<span class="pull-right"><a class="anchor hidden-xs" href="#hysteresis" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hysteresis" aria-hidden="true">TOC</a></span></h3>
  18621. <p>Grow first stream into second stream by connecting components.
  18622. This makes it possible to build more robust edge masks.
  18623. </p>
  18624. <p>This filter accepts the following options:
  18625. </p>
  18626. <dl class="table">
  18627. <dt><samp class="option">planes</samp></dt>
  18628. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  18629. copied from first stream.
  18630. By default value 0xf, all planes will be processed.
  18631. </p>
  18632. </dd>
  18633. <dt><samp class="option">threshold</samp></dt>
  18634. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  18635. this value filter algorithm for connecting components is activated.
  18636. By default value is 0.
  18637. </p></dd>
  18638. </dl>
  18639. <p>The <code class="code">hysteresis</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  18640. </p>
  18641. <a name="iccdetect"></a>
  18642. <h3 class="section">11.130 iccdetect<span class="pull-right"><a class="anchor hidden-xs" href="#iccdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccdetect" aria-hidden="true">TOC</a></span></h3>
  18643. <p>Detect the colorspace from an embedded ICC profile (if present), and update
  18644. the frame&rsquo;s tags accordingly.
  18645. </p>
  18646. <p>This filter accepts the following options:
  18647. </p>
  18648. <dl class="table">
  18649. <dt><samp class="option">force</samp></dt>
  18650. <dd><p>If true, the frame&rsquo;s existing colorspace tags will always be overridden by
  18651. values detected from an ICC profile. Otherwise, they will only be assigned if
  18652. they contain <code class="code">unknown</code>. Enabled by default.
  18653. </p></dd>
  18654. </dl>
  18655. <a name="iccgen"></a>
  18656. <h3 class="section">11.131 iccgen<span class="pull-right"><a class="anchor hidden-xs" href="#iccgen" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-iccgen" aria-hidden="true">TOC</a></span></h3>
  18657. <p>Generate ICC profiles and attach them to frames.
  18658. </p>
  18659. <p>This filter accepts the following options:
  18660. </p>
  18661. <dl class="table">
  18662. <dt><samp class="option">color_primaries</samp></dt>
  18663. <dt><samp class="option">color_trc</samp></dt>
  18664. <dd><p>Configure the colorspace that the ICC profile will be generated for. The
  18665. default value of <code class="code">auto</code> infers the value from the input frame&rsquo;s metadata,
  18666. defaulting to BT.709/sRGB as appropriate.
  18667. </p>
  18668. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values, but note that
  18669. <code class="code">unknown</code> are not valid values for this filter.
  18670. </p>
  18671. </dd>
  18672. <dt><samp class="option">force</samp></dt>
  18673. <dd><p>If true, an ICC profile will be generated even if it would overwrite an
  18674. already existing ICC profile. Disabled by default.
  18675. </p></dd>
  18676. </dl>
  18677. <a name="identity"></a>
  18678. <h3 class="section">11.132 identity<span class="pull-right"><a class="anchor hidden-xs" href="#identity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-identity" aria-hidden="true">TOC</a></span></h3>
  18679. <p>Obtain the identity score between two input videos.
  18680. </p>
  18681. <p>This filter takes two input videos.
  18682. </p>
  18683. <p>Both input videos must have the same resolution and pixel format for
  18684. this filter to work correctly. Also it assumes that both inputs
  18685. have the same number of frames, which are compared one by one.
  18686. </p>
  18687. <p>The obtained per component, average, min and max identity score is printed through
  18688. the logging system.
  18689. </p>
  18690. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  18691. </p>
  18692. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  18693. </p>
  18694. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  18695. with the reference file <samp class="file">ref.mpg</samp>.
  18696. </p>
  18697. <div class="example">
  18698. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  18699. </pre></div>
  18700. <a name="idet"></a>
  18701. <h3 class="section">11.133 idet<span class="pull-right"><a class="anchor hidden-xs" href="#idet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-idet" aria-hidden="true">TOC</a></span></h3>
  18702. <p>Detect video interlacing type.
  18703. </p>
  18704. <p>This filter tries to detect if the input frames are interlaced, progressive,
  18705. top or bottom field first. It will also try to detect fields that are
  18706. repeated between adjacent frames (a sign of telecine).
  18707. </p>
  18708. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  18709. Multiple frame detection incorporates the classification history of previous frames.
  18710. </p>
  18711. <p>The filter will log these metadata values:
  18712. </p>
  18713. <dl class="table">
  18714. <dt><samp class="option">single.current_frame</samp></dt>
  18715. <dd><p>Detected type of current frame using single-frame detection. One of:
  18716. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  18717. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  18718. </p>
  18719. </dd>
  18720. <dt><samp class="option">single.tff</samp></dt>
  18721. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  18722. </p>
  18723. </dd>
  18724. <dt><samp class="option">multiple.tff</samp></dt>
  18725. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  18726. </p>
  18727. </dd>
  18728. <dt><samp class="option">single.bff</samp></dt>
  18729. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  18730. </p>
  18731. </dd>
  18732. <dt><samp class="option">multiple.current_frame</samp></dt>
  18733. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  18734. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  18735. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  18736. </p>
  18737. </dd>
  18738. <dt><samp class="option">multiple.bff</samp></dt>
  18739. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  18740. </p>
  18741. </dd>
  18742. <dt><samp class="option">single.progressive</samp></dt>
  18743. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  18744. </p>
  18745. </dd>
  18746. <dt><samp class="option">multiple.progressive</samp></dt>
  18747. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  18748. </p>
  18749. </dd>
  18750. <dt><samp class="option">single.undetermined</samp></dt>
  18751. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  18752. </p>
  18753. </dd>
  18754. <dt><samp class="option">multiple.undetermined</samp></dt>
  18755. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  18756. </p>
  18757. </dd>
  18758. <dt><samp class="option">repeated.current_frame</samp></dt>
  18759. <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;.
  18760. </p>
  18761. </dd>
  18762. <dt><samp class="option">repeated.neither</samp></dt>
  18763. <dd><p>Cumulative number of frames with no repeated field.
  18764. </p>
  18765. </dd>
  18766. <dt><samp class="option">repeated.top</samp></dt>
  18767. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  18768. </p>
  18769. </dd>
  18770. <dt><samp class="option">repeated.bottom</samp></dt>
  18771. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  18772. </p></dd>
  18773. </dl>
  18774. <p>The filter accepts the following options:
  18775. </p>
  18776. <dl class="table">
  18777. <dt><samp class="option">intl_thres</samp></dt>
  18778. <dd><p>Set interlacing threshold.
  18779. </p></dd>
  18780. <dt><samp class="option">prog_thres</samp></dt>
  18781. <dd><p>Set progressive threshold.
  18782. </p></dd>
  18783. <dt><samp class="option">rep_thres</samp></dt>
  18784. <dd><p>Threshold for repeated field detection.
  18785. </p></dd>
  18786. <dt><samp class="option">half_life</samp></dt>
  18787. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  18788. statistics is halved (i.e., it contributes only 0.5 to its
  18789. classification). The default of 0 means that all frames seen are given
  18790. full weight of 1.0 forever.
  18791. </p></dd>
  18792. <dt><samp class="option">analyze_interlaced_flag</samp></dt>
  18793. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  18794. if the interlaced flag is accurate, it will not count undetermined frames.
  18795. If the flag is found to be accurate it will be used without any further
  18796. computations, if it is found to be inaccurate it will be cleared without any
  18797. further computations. This allows inserting the idet filter as a low computational
  18798. method to clean up the interlaced flag
  18799. </p></dd>
  18800. </dl>
  18801. <a name="Examples-88"></a>
  18802. <h4 class="subsection">11.133.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-88" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-88" aria-hidden="true">TOC</a></span></h4>
  18803. <p>Inspect the field order of the first 360 frames in a video, in verbose detail:
  18804. </p><div class="example">
  18805. <pre class="example-preformatted">ffmpeg -i INPUT -filter:v idet,metadata=mode=print -frames:v 360 -an -f null -
  18806. </pre></div>
  18807. <p>The idet filter will add analysis metadata to each frame, which will then be
  18808. discarded. At the end, the filter will also print a final report with statistics.
  18809. </p>
  18810. <a name="il"></a>
  18811. <h3 class="section">11.134 il<span class="pull-right"><a class="anchor hidden-xs" href="#il" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-il" aria-hidden="true">TOC</a></span></h3>
  18812. <p>Deinterleave or interleave fields.
  18813. </p>
  18814. <p>This filter allows one to process interlaced images fields without
  18815. deinterlacing them. Deinterleaving splits the input frame into 2
  18816. fields (so called half pictures). Odd lines are moved to the top
  18817. half of the output image, even lines to the bottom half.
  18818. You can process (filter) them independently and then re-interleave them.
  18819. </p>
  18820. <p>The filter accepts the following options:
  18821. </p>
  18822. <dl class="table">
  18823. <dt><samp class="option">luma_mode, l</samp></dt>
  18824. <dt><samp class="option">chroma_mode, c</samp></dt>
  18825. <dt><samp class="option">alpha_mode, a</samp></dt>
  18826. <dd><p>Available values for <var class="var">luma_mode</var>, <var class="var">chroma_mode</var> and
  18827. <var class="var">alpha_mode</var> are:
  18828. </p>
  18829. <dl class="table">
  18830. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  18831. <dd><p>Do nothing.
  18832. </p>
  18833. </dd>
  18834. <dt>&lsquo;<samp class="samp">deinterleave, d</samp>&rsquo;</dt>
  18835. <dd><p>Deinterleave fields, placing one above the other.
  18836. </p>
  18837. </dd>
  18838. <dt>&lsquo;<samp class="samp">interleave, i</samp>&rsquo;</dt>
  18839. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  18840. </p></dd>
  18841. </dl>
  18842. <p>Default value is <code class="code">none</code>.
  18843. </p>
  18844. </dd>
  18845. <dt><samp class="option">luma_swap, ls</samp></dt>
  18846. <dt><samp class="option">chroma_swap, cs</samp></dt>
  18847. <dt><samp class="option">alpha_swap, as</samp></dt>
  18848. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code class="code">0</code>.
  18849. </p></dd>
  18850. </dl>
  18851. <a name="Commands-100"></a>
  18852. <h4 class="subsection">11.134.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-100" aria-hidden="true">TOC</a></span></h4>
  18853. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18854. </p>
  18855. <a name="inflate"></a>
  18856. <h3 class="section">11.135 inflate<span class="pull-right"><a class="anchor hidden-xs" href="#inflate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-inflate" aria-hidden="true">TOC</a></span></h3>
  18857. <p>Apply inflate effect to the video.
  18858. </p>
  18859. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  18860. only values higher than the pixel.
  18861. </p>
  18862. <p>It accepts the following options:
  18863. </p>
  18864. <dl class="table">
  18865. <dt><samp class="option">threshold0</samp></dt>
  18866. <dt><samp class="option">threshold1</samp></dt>
  18867. <dt><samp class="option">threshold2</samp></dt>
  18868. <dt><samp class="option">threshold3</samp></dt>
  18869. <dd><p>Limit the maximum change for each plane, default is 65535.
  18870. If 0, plane will remain unchanged.
  18871. </p></dd>
  18872. </dl>
  18873. <a name="Commands-101"></a>
  18874. <h4 class="subsection">11.135.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-101" aria-hidden="true">TOC</a></span></h4>
  18875. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18876. </p>
  18877. <a name="interlace_002c-interlace_005fvulkan"></a>
  18878. <h3 class="section">11.136 interlace, interlace_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#interlace_002c-interlace_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace_002c-interlace_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  18879. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  18880. lower) lines from odd frames with lower (or upper) lines from even frames,
  18881. halving the frame rate and preserving image height.
  18882. </p>
  18883. <div class="example">
  18884. <pre class="example-preformatted"> Original Original New Frame
  18885. Frame 'j' Frame 'j+1' (tff)
  18886. ========== =========== ==================
  18887. Line 0 --------------------&gt; Frame 'j' Line 0
  18888. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  18889. Line 2 ---------------------&gt; Frame 'j' Line 2
  18890. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  18891. ... ... ...
  18892. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  18893. </pre></div>
  18894. <p>It accepts the following optional parameters:
  18895. </p>
  18896. <dl class="table">
  18897. <dt><samp class="option">scan</samp></dt>
  18898. <dd><p>This determines whether the interlaced frame is taken from the even
  18899. (tff - default) or odd (bff) lines of the progressive frame.
  18900. </p>
  18901. </dd>
  18902. <dt><samp class="option">lowpass</samp></dt>
  18903. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  18904. reduce moire patterns.
  18905. </p>
  18906. <dl class="table">
  18907. <dt>&lsquo;<samp class="samp">0, off</samp>&rsquo;</dt>
  18908. <dd><p>Disable vertical lowpass filter
  18909. </p>
  18910. </dd>
  18911. <dt>&lsquo;<samp class="samp">1, linear</samp>&rsquo;</dt>
  18912. <dd><p>Enable linear filter (default)
  18913. </p>
  18914. </dd>
  18915. <dt>&lsquo;<samp class="samp">2, complex</samp>&rsquo;</dt>
  18916. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  18917. but better retain detail and subjective sharpness impression.
  18918. </p>
  18919. </dd>
  18920. </dl>
  18921. </dd>
  18922. </dl>
  18923. <a name="kerndeint"></a>
  18924. <h3 class="section">11.137 kerndeint<span class="pull-right"><a class="anchor hidden-xs" href="#kerndeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kerndeint" aria-hidden="true">TOC</a></span></h3>
  18925. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  18926. deinterling. Work on interlaced parts of a video to produce
  18927. progressive frames.
  18928. </p>
  18929. <p>The description of the accepted parameters follows.
  18930. </p>
  18931. <dl class="table">
  18932. <dt><samp class="option">thresh</samp></dt>
  18933. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  18934. determining if a pixel line must be processed. It must be an integer
  18935. in the range [0,255] and defaults to 10. A value of 0 will result in
  18936. applying the process on every pixels.
  18937. </p>
  18938. </dd>
  18939. <dt><samp class="option">map</samp></dt>
  18940. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  18941. Default is 0.
  18942. </p>
  18943. </dd>
  18944. <dt><samp class="option">order</samp></dt>
  18945. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  18946. 0. Default is 0.
  18947. </p>
  18948. </dd>
  18949. <dt><samp class="option">sharp</samp></dt>
  18950. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  18951. </p>
  18952. </dd>
  18953. <dt><samp class="option">twoway</samp></dt>
  18954. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  18955. </p></dd>
  18956. </dl>
  18957. <a name="Examples-89"></a>
  18958. <h4 class="subsection">11.137.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-89" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-89" aria-hidden="true">TOC</a></span></h4>
  18959. <ul class="itemize mark-bullet">
  18960. <li>Apply default values:
  18961. <div class="example">
  18962. <pre class="example-preformatted">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  18963. </pre></div>
  18964. </li><li>Enable additional sharpening:
  18965. <div class="example">
  18966. <pre class="example-preformatted">kerndeint=sharp=1
  18967. </pre></div>
  18968. </li><li>Paint processed pixels in white:
  18969. <div class="example">
  18970. <pre class="example-preformatted">kerndeint=map=1
  18971. </pre></div>
  18972. </li></ul>
  18973. <a name="kirsch"></a>
  18974. <h3 class="section">11.138 kirsch<span class="pull-right"><a class="anchor hidden-xs" href="#kirsch" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-kirsch" aria-hidden="true">TOC</a></span></h3>
  18975. <p>Apply kirsch operator to input video stream.
  18976. </p>
  18977. <p>The filter accepts the following option:
  18978. </p>
  18979. <dl class="table">
  18980. <dt><samp class="option">planes</samp></dt>
  18981. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  18982. By default value 0xf, all planes will be processed.
  18983. </p>
  18984. </dd>
  18985. <dt><samp class="option">scale</samp></dt>
  18986. <dd><p>Set value which will be multiplied with filtered result.
  18987. </p>
  18988. </dd>
  18989. <dt><samp class="option">delta</samp></dt>
  18990. <dd><p>Set value which will be added to filtered result.
  18991. </p></dd>
  18992. </dl>
  18993. <a name="Commands-102"></a>
  18994. <h4 class="subsection">11.138.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-102" aria-hidden="true">TOC</a></span></h4>
  18995. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  18996. </p>
  18997. <a name="lagfun"></a>
  18998. <h3 class="section">11.139 lagfun<span class="pull-right"><a class="anchor hidden-xs" href="#lagfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lagfun" aria-hidden="true">TOC</a></span></h3>
  18999. <p>Slowly update darker pixels.
  19000. </p>
  19001. <p>This filter makes short flashes of light appear longer.
  19002. This filter accepts the following options:
  19003. </p>
  19004. <dl class="table">
  19005. <dt><samp class="option">decay</samp></dt>
  19006. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  19007. </p>
  19008. </dd>
  19009. <dt><samp class="option">planes</samp></dt>
  19010. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  19011. </p></dd>
  19012. </dl>
  19013. <a name="Commands-103"></a>
  19014. <h4 class="subsection">11.139.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-103" aria-hidden="true">TOC</a></span></h4>
  19015. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19016. </p>
  19017. <a name="lenscorrection"></a>
  19018. <h3 class="section">11.140 lenscorrection<span class="pull-right"><a class="anchor hidden-xs" href="#lenscorrection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lenscorrection" aria-hidden="true">TOC</a></span></h3>
  19019. <p>Correct radial lens distortion
  19020. </p>
  19021. <p>This filter can be used to correct for radial distortion as can result from the use
  19022. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  19023. one can use tools available for example as part of opencv or simply trial-and-error.
  19024. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  19025. and extract the k1 and k2 coefficients from the resulting matrix.
  19026. </p>
  19027. <p>Note that effectively the same filter is available in the open-source tools Krita and
  19028. Digikam from the KDE project.
  19029. </p>
  19030. <p>In contrast to the <a class="ref" href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  19031. this filter corrects the distortion of the image, whereas <a class="ref" href="#vignette">vignette</a> corrects the
  19032. brightness distribution, so you may want to use both filters together in certain
  19033. cases, though you will have to take care of ordering, i.e. whether vignetting should
  19034. be applied before or after lens correction.
  19035. </p>
  19036. <a name="Options"></a>
  19037. <h4 class="subsection">11.140.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options" aria-hidden="true">TOC</a></span></h4>
  19038. <p>The filter accepts the following options:
  19039. </p>
  19040. <dl class="table">
  19041. <dt><samp class="option">cx</samp></dt>
  19042. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  19043. distortion. This value has a range [0,1] and is expressed as fractions of the image
  19044. width. Default is 0.5.
  19045. </p></dd>
  19046. <dt><samp class="option">cy</samp></dt>
  19047. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  19048. distortion. This value has a range [0,1] and is expressed as fractions of the image
  19049. height. Default is 0.5.
  19050. </p></dd>
  19051. <dt><samp class="option">k1</samp></dt>
  19052. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  19053. no correction. Default is 0.
  19054. </p></dd>
  19055. <dt><samp class="option">k2</samp></dt>
  19056. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  19057. 0 means no correction. Default is 0.
  19058. </p></dd>
  19059. <dt><samp class="option">i</samp></dt>
  19060. <dd><p>Set interpolation type. Can be <code class="code">nearest</code> or <code class="code">bilinear</code>.
  19061. Default is <code class="code">nearest</code>.
  19062. </p></dd>
  19063. <dt><samp class="option">fc</samp></dt>
  19064. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  19065. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  19066. manual</a>. Default color is <code class="code">black@0</code>.
  19067. </p></dd>
  19068. </dl>
  19069. <p>The formula that generates the correction is:
  19070. </p>
  19071. <p><var class="var">r_src</var> = <var class="var">r_tgt</var> * (1 + <var class="var">k1</var> * (<var class="var">r_tgt</var> / <var class="var">r_0</var>)^2 + <var class="var">k2</var> * (<var class="var">r_tgt</var> / <var class="var">r_0</var>)^4)
  19072. </p>
  19073. <p>where <var class="var">r_0</var> is halve of the image diagonal and <var class="var">r_src</var> and <var class="var">r_tgt</var> are the
  19074. distances from the focal point in the source and target images, respectively.
  19075. </p>
  19076. <a name="Commands-104"></a>
  19077. <h4 class="subsection">11.140.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-104" aria-hidden="true">TOC</a></span></h4>
  19078. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  19079. </p>
  19080. <a name="lensfun"></a>
  19081. <h3 class="section">11.141 lensfun<span class="pull-right"><a class="anchor hidden-xs" href="#lensfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lensfun" aria-hidden="true">TOC</a></span></h3>
  19082. <p>Apply lens correction via the lensfun library (<a class="url" href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  19083. </p>
  19084. <p>The <code class="code">lensfun</code> filter requires the camera make, camera model, and lens model
  19085. to apply the lens correction. The filter will load the lensfun database and
  19086. query it to find the corresponding camera and lens entries in the database. As
  19087. long as these entries can be found with the given options, the filter can
  19088. perform corrections on frames. Note that incomplete strings will result in the
  19089. filter choosing the best match with the given options, and the filter will
  19090. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  19091. provide the make, camera model, and lens model as they are required.
  19092. </p>
  19093. <p>To obtain a list of available makes and models, leave out one or both of <code class="code">make</code> and
  19094. <code class="code">model</code> options. The filter will send the full list to the log with level <code class="code">INFO</code>.
  19095. The first column is the make and the second column is the model.
  19096. To obtain a list of available lenses, set any values for make and model and leave out the
  19097. <code class="code">lens_model</code> option. The filter will send the full list of lenses in the log with level
  19098. <code class="code">INFO</code>. The ffmpeg tool will exit after the list is printed.
  19099. </p>
  19100. <p>The filter accepts the following options:
  19101. </p>
  19102. <dl class="table">
  19103. <dt><samp class="option">make</samp></dt>
  19104. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  19105. </p>
  19106. </dd>
  19107. <dt><samp class="option">model</samp></dt>
  19108. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  19109. required.
  19110. </p>
  19111. </dd>
  19112. <dt><samp class="option">lens_model</samp></dt>
  19113. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  19114. option is required.
  19115. </p>
  19116. </dd>
  19117. <dt><samp class="option">db_path</samp></dt>
  19118. <dd><p>The full path to the lens database folder. If not set, the filter will attempt to
  19119. load the database from the install path when the library was built. Default is unset.
  19120. </p>
  19121. </dd>
  19122. <dt><samp class="option">mode</samp></dt>
  19123. <dd><p>The type of correction to apply. The following values are valid options:
  19124. </p>
  19125. <dl class="table">
  19126. <dt>&lsquo;<samp class="samp">vignetting</samp>&rsquo;</dt>
  19127. <dd><p>Enables fixing lens vignetting.
  19128. </p>
  19129. </dd>
  19130. <dt>&lsquo;<samp class="samp">geometry</samp>&rsquo;</dt>
  19131. <dd><p>Enables fixing lens geometry. This is the default.
  19132. </p>
  19133. </dd>
  19134. <dt>&lsquo;<samp class="samp">subpixel</samp>&rsquo;</dt>
  19135. <dd><p>Enables fixing chromatic aberrations.
  19136. </p>
  19137. </dd>
  19138. <dt>&lsquo;<samp class="samp">vig_geo</samp>&rsquo;</dt>
  19139. <dd><p>Enables fixing lens vignetting and lens geometry.
  19140. </p>
  19141. </dd>
  19142. <dt>&lsquo;<samp class="samp">vig_subpixel</samp>&rsquo;</dt>
  19143. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  19144. </p>
  19145. </dd>
  19146. <dt>&lsquo;<samp class="samp">distortion</samp>&rsquo;</dt>
  19147. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  19148. </p>
  19149. </dd>
  19150. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  19151. <dd><p>Enables all possible corrections.
  19152. </p>
  19153. </dd>
  19154. </dl>
  19155. </dd>
  19156. <dt><samp class="option">focal_length</samp></dt>
  19157. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  19158. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  19159. range should be chosen when using that lens. Default 18.
  19160. </p>
  19161. </dd>
  19162. <dt><samp class="option">aperture</samp></dt>
  19163. <dd><p>The aperture of the image/video (expected constant for video). Note that
  19164. aperture is only used for vignetting correction. Default 3.5.
  19165. </p>
  19166. </dd>
  19167. <dt><samp class="option">focus_distance</samp></dt>
  19168. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  19169. focus distance is only used for vignetting and only slightly affects the
  19170. vignetting correction process. If unknown, leave it at the default value (which
  19171. is 1000).
  19172. </p>
  19173. </dd>
  19174. <dt><samp class="option">scale</samp></dt>
  19175. <dd><p>The scale factor which is applied after transformation. After correction the
  19176. video is no longer necessarily rectangular. This parameter controls how much of
  19177. the resulting image is visible. The value 0 means that a value will be chosen
  19178. automatically such that there is little or no unmapped area in the output
  19179. image. 1.0 means that no additional scaling is done. Lower values may result
  19180. in more of the corrected image being visible, while higher values may avoid
  19181. unmapped areas in the output.
  19182. </p>
  19183. </dd>
  19184. <dt><samp class="option">target_geometry</samp></dt>
  19185. <dd><p>The target geometry of the output image/video. The following values are valid
  19186. options:
  19187. </p>
  19188. <dl class="table">
  19189. <dt>&lsquo;<samp class="samp">rectilinear (default)</samp>&rsquo;</dt>
  19190. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  19191. <dt>&lsquo;<samp class="samp">panoramic</samp>&rsquo;</dt>
  19192. <dt>&lsquo;<samp class="samp">equirectangular</samp>&rsquo;</dt>
  19193. <dt>&lsquo;<samp class="samp">fisheye_orthographic</samp>&rsquo;</dt>
  19194. <dt>&lsquo;<samp class="samp">fisheye_stereographic</samp>&rsquo;</dt>
  19195. <dt>&lsquo;<samp class="samp">fisheye_equisolid</samp>&rsquo;</dt>
  19196. <dt>&lsquo;<samp class="samp">fisheye_thoby</samp>&rsquo;</dt>
  19197. </dl>
  19198. </dd>
  19199. <dt><samp class="option">reverse</samp></dt>
  19200. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  19201. it).
  19202. </p>
  19203. </dd>
  19204. <dt><samp class="option">interpolation</samp></dt>
  19205. <dd><p>The type of interpolation used when correcting distortion. The following values
  19206. are valid options:
  19207. </p>
  19208. <dl class="table">
  19209. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  19210. <dt>&lsquo;<samp class="samp">linear (default)</samp>&rsquo;</dt>
  19211. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  19212. </dl>
  19213. </dd>
  19214. </dl>
  19215. <a name="Examples-90"></a>
  19216. <h4 class="subsection">11.141.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-90" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-90" aria-hidden="true">TOC</a></span></h4>
  19217. <ul class="itemize mark-bullet">
  19218. <li>Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  19219. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  19220. aperture of &quot;8.0&quot;.
  19221. <div class="example">
  19222. <pre class="example-preformatted">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
  19223. </pre></div>
  19224. </li><li>Apply the same as before, but only for the first 5 seconds of video.
  19225. <div class="example">
  19226. <pre class="example-preformatted">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
  19227. </pre></div>
  19228. </li></ul>
  19229. <a name="lcevc"></a>
  19230. <h3 class="section">11.142 lcevc<span class="pull-right"><a class="anchor hidden-xs" href="#lcevc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lcevc" aria-hidden="true">TOC</a></span></h3>
  19231. <p>Low Complexity Enhancement Video Codec filter based on liblcevc_dec
  19232. (<a class="url" href="https://github.com/v-novaltd/LCEVCdec">https://github.com/v-novaltd/LCEVCdec</a>).
  19233. </p>
  19234. <a name="libplacebo"></a>
  19235. <h3 class="section">11.143 libplacebo<span class="pull-right"><a class="anchor hidden-xs" href="#libplacebo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libplacebo" aria-hidden="true">TOC</a></span></h3>
  19236. <p>Flexible GPU-accelerated processing filter based on libplacebo
  19237. (<a class="url" href="https://code.videolan.org/videolan/libplacebo">https://code.videolan.org/videolan/libplacebo</a>).
  19238. </p>
  19239. <a name="Options-1"></a>
  19240. <h4 class="subsection">11.143.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-1" aria-hidden="true">TOC</a></span></h4>
  19241. <p>The options for this filter are divided into the following sections:
  19242. </p>
  19243. <a name="Output-mode"></a>
  19244. <h4 class="subsubsection">11.143.1.1 Output mode<span class="pull-right"><a class="anchor hidden-xs" href="#Output-mode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Output-mode" aria-hidden="true">TOC</a></span></h4>
  19245. <p>These options control the overall output mode. By default, libplacebo will try
  19246. to preserve the source colorimetry and size as best as it can, but it will
  19247. apply any embedded film grain, dolby vision metadata or anamorphic SAR present
  19248. in source frames.
  19249. </p><dl class="table">
  19250. <dt><samp class="option">inputs</samp></dt>
  19251. <dd><p>Set the number of inputs. This can be used, alongside the <code class="code">idx</code> variable,
  19252. to allow placing/blending multiple inputs inside the output frame. This
  19253. effectively enables functionality similar to <a class="ref" href="#hstack">hstack</a>, <a class="ref" href="#overlay">overlay</a>, etc.
  19254. </p>
  19255. </dd>
  19256. <dt><samp class="option">w</samp></dt>
  19257. <dt><samp class="option">h</samp></dt>
  19258. <dd><p>Set the output video dimension expression. Default values are <code class="code">iw</code> and
  19259. <code class="code">ih</code>.
  19260. </p>
  19261. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  19262. </p>
  19263. </dd>
  19264. <dt><samp class="option">crop_x</samp></dt>
  19265. <dt><samp class="option">crop_y</samp></dt>
  19266. <dd><p>Set the input crop x/y expressions, default values are <code class="code">(iw-cw)/2</code> and
  19267. <code class="code">(ih-ch)/2</code>.
  19268. </p>
  19269. </dd>
  19270. <dt><samp class="option">crop_w</samp></dt>
  19271. <dt><samp class="option">crop_h</samp></dt>
  19272. <dd><p>Set the input crop width/height expressions, default values are <code class="code">iw</code> and
  19273. <code class="code">ih</code>.
  19274. </p>
  19275. </dd>
  19276. <dt><samp class="option">pos_x</samp></dt>
  19277. <dt><samp class="option">pos_y</samp></dt>
  19278. <dd><p>Set the output placement x/y expressions, default values are <code class="code">(ow-pw)/2</code>
  19279. and <code class="code">(oh-ph)/2</code>.
  19280. </p>
  19281. </dd>
  19282. <dt><samp class="option">pos_w</samp></dt>
  19283. <dt><samp class="option">pos_h</samp></dt>
  19284. <dd><p>Set the output placement width/height expressions, default values are <code class="code">ow</code>
  19285. and <code class="code">oh</code>.
  19286. </p>
  19287. </dd>
  19288. <dt><samp class="option">rotate</samp></dt>
  19289. <dd><p>Rotate the input frame clockwise by the specified angle.
  19290. </p>
  19291. <dl class="table">
  19292. <dt>&lsquo;<samp class="samp">0, 360</samp>&rsquo;</dt>
  19293. <dt>&lsquo;<samp class="samp">90</samp>&rsquo;</dt>
  19294. <dt>&lsquo;<samp class="samp">180</samp>&rsquo;</dt>
  19295. <dt>&lsquo;<samp class="samp">270</samp>&rsquo;</dt>
  19296. </dl>
  19297. </dd>
  19298. <dt><samp class="option">fps</samp></dt>
  19299. <dd><p>Set the output frame rate. This can be rational, e.g. <code class="code">60000/1001</code>. If
  19300. set to the special string <code class="code">none</code> (the default), input timestamps will
  19301. instead be passed through to the output unmodified. Otherwise, the input video
  19302. frames will be interpolated as necessary to rescale the video to the specified
  19303. target framerate, in a manner as determined by the <samp class="option">frame_mixer</samp> option.
  19304. </p>
  19305. </dd>
  19306. <dt><samp class="option">format</samp></dt>
  19307. <dd><p>Set the output format override. If unset (the default), frames will be output
  19308. in the same format as the respective input frames. Otherwise, format conversion
  19309. will be performed.
  19310. </p>
  19311. </dd>
  19312. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  19313. <dt><samp class="option">force_divisible_by</samp></dt>
  19314. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options. Note that
  19315. <samp class="option">force_divisible_by</samp> also works with <code class="code">fit_sense=constraint</code>.
  19316. </p>
  19317. </dd>
  19318. <dt><samp class="option">reset_sar</samp></dt>
  19319. <dd><p>If enabled, output frames will always have a pixel aspect ratio of 1:1. If
  19320. disabled (the default), any aspect ratio mismatches, including those from
  19321. e.g. anamorphic video sources, are forwarded to the output pixel aspect ratio.
  19322. </p>
  19323. </dd>
  19324. <dt><samp class="option">normalize_sar</samp></dt>
  19325. <dd><p>Like <samp class="option">reset_sar</samp>, but instead of stretching the video content to fill
  19326. the new output aspect ratio, the content is instead padded or cropped as
  19327. necessary. Mutually exclusive with <samp class="option">fit_mode</samp>. Disabled by default.
  19328. </p>
  19329. </dd>
  19330. <dt><samp class="option">pad_crop_ratio</samp></dt>
  19331. <dd><p>Specifies a ratio (between <code class="code">0.0</code> and <code class="code">1.0</code>) between padding and
  19332. cropping when the input aspect ratio does not match the output aspect ratio and
  19333. <samp class="option">normalize_sar</samp> is in effect. The default of <code class="code">0.0</code> always pads the
  19334. content with black borders, while a value of <code class="code">1.0</code> always crops off parts
  19335. of the content. Intermediate values are possible, leading to a mix of the two
  19336. approaches.
  19337. </p>
  19338. </dd>
  19339. <dt><samp class="option">fit_mode</samp></dt>
  19340. <dd><p>Specify the content fit strategy according to a list of predefined modes.
  19341. Determines how the input image is to be placed inside the destination crop
  19342. rectangle (as defined by <code class="code">pos_x/y</code> and <code class="code">pos_w/h</code>). The names and
  19343. their implementations are taken from the CSS &rsquo;object-fit&rsquo; property. Note that
  19344. this option is mutually exclusive with <samp class="option">normalize_sar</samp>. Defaults to
  19345. <code class="code">fill</code>. Valid values are:
  19346. </p>
  19347. <dl class="table">
  19348. <dt>&lsquo;<samp class="samp">fill</samp>&rsquo;</dt>
  19349. <dd><p>Stretch the input to the output rectangle, ignoring aspect ratio mismatches.
  19350. Note that unless <samp class="option">reset_sar</samp> is also enabled, the output will still
  19351. have the correct pixel aspect ratio tagged.
  19352. </p>
  19353. </dd>
  19354. <dt>&lsquo;<samp class="samp">contain</samp>&rsquo;</dt>
  19355. <dd><p>Scale the input to fit inside the output, preserving aspect ratio by padding.
  19356. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  19357. <code class="code">0.0</code>.
  19358. </p>
  19359. </dd>
  19360. <dt>&lsquo;<samp class="samp">cover</samp>&rsquo;</dt>
  19361. <dd><p>Scale the input to fill the output, preserving aspect ratio by cropping.
  19362. Equivalent to <samp class="option">normalize_sar</samp> with <samp class="option">pad_crop_ratio</samp> set to
  19363. <code class="code">1.0</code>.
  19364. </p>
  19365. </dd>
  19366. <dt>&lsquo;<samp class="samp">none, place</samp>&rsquo;</dt>
  19367. <dd><p>Don&rsquo;t scale the input. The input will be placed inside the output rectangle at
  19368. its natural size; which may result in additional padding or cropping.
  19369. </p>
  19370. </dd>
  19371. <dt>&lsquo;<samp class="samp">scale_down</samp>&rsquo;</dt>
  19372. <dd><p>Scale the input down as much as needed to fit inside the output. Equivalent
  19373. to either <code class="code">contain</code> or <code class="code">none</code>, depending on whether the input is
  19374. larger than the output or not.
  19375. </p></dd>
  19376. </dl>
  19377. </dd>
  19378. <dt><samp class="option">fit_sense</samp></dt>
  19379. <dd><p>When <samp class="option">fit_mode</samp> is in use, this option controls how the fit strategy
  19380. is applied against the specified output resolution. Mutually exclusive with
  19381. <samp class="option">force_original_aspect_ratio</samp>. Valid values are:
  19382. </p>
  19383. <dl class="table">
  19384. <dt>&lsquo;<samp class="samp">target</samp>&rsquo;</dt>
  19385. <dd><p>The computed output resolution is taken as the exact size of the output frame.
  19386. This is the default behavior.
  19387. </p>
  19388. </dd>
  19389. <dt>&lsquo;<samp class="samp">constraint</samp>&rsquo;</dt>
  19390. <dd><p>The computed output resolution is a size reference against which the fit mode
  19391. is applied, enlarging or decreasing the true frame size as needed to fit the
  19392. content.
  19393. </p></dd>
  19394. </dl>
  19395. </dd>
  19396. <dt><samp class="option">fillcolor</samp></dt>
  19397. <dd><p>Set the color used to fill the output area not covered by the output image, for
  19398. example as a result of <samp class="option">normalize_sar</samp>. For the general syntax of this
  19399. option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  19400. manual</a>. Defaults to <code class="code">black@0</code>.
  19401. </p>
  19402. </dd>
  19403. <dt><samp class="option">corner_rounding</samp></dt>
  19404. <dd><p>Render frames with rounded corners. The value, given as a float ranging from
  19405. <code class="code">0.0</code> to <code class="code">1.0</code>, indicates the relative degree of rounding, from fully
  19406. square to fully circular. In other words, it gives the radius divided by half
  19407. the smaller side length. Defaults to <code class="code">0.0</code>.
  19408. </p>
  19409. </dd>
  19410. <dt><samp class="option">lut</samp></dt>
  19411. <dd><p>Specifies a custom LUT (in Adobe .cube format) to apply to the colors
  19412. as part of color conversion. The exact interpretation depends on the value
  19413. of <samp class="option">lut_type</samp>.
  19414. </p>
  19415. </dd>
  19416. <dt><samp class="option">lut_type</samp></dt>
  19417. <dd><p>Controls the interpretation of color values fed to and from the LUT
  19418. specified as <samp class="option">lut</samp>. Valid values are:
  19419. </p>
  19420. <dl class="table">
  19421. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  19422. <dd><p>Chooses the interpretation of the LUT automatically from tagged
  19423. metadata, and otherwise falls back to &lsquo;<samp class="samp">native</samp>&rsquo;. (Default)
  19424. </p>
  19425. </dd>
  19426. <dt>&lsquo;<samp class="samp">native</samp>&rsquo;</dt>
  19427. <dd><p>Applied to raw image contents in its native RGB colorspace (non-linear
  19428. light), before conversion to the output color space.
  19429. </p>
  19430. </dd>
  19431. <dt>&lsquo;<samp class="samp">normalized</samp>&rsquo;</dt>
  19432. <dd><p>Applied to the normalized RGB image contents, in linear light, before
  19433. conversion to the output color space.
  19434. </p>
  19435. </dd>
  19436. <dt>&lsquo;<samp class="samp">conversion</samp>&rsquo;</dt>
  19437. <dd><p>Fully replaces the conversion from the image color space to the output
  19438. color space. If such a LUT is present, it has the highest priority, and
  19439. overrides any ICC profiles, as well as options related to tone mapping
  19440. and output colorimetry (<samp class="option">color_primaries</samp>, <samp class="option">color_trc</samp>).
  19441. </p>
  19442. </dd>
  19443. </dl>
  19444. </dd>
  19445. <dt><samp class="option">extra_opts</samp></dt>
  19446. <dd><p>Pass extra libplacebo internal configuration options. These can be specified
  19447. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  19448. shows how to configure a custom filter kernel (&quot;EWA LanczosSharp&quot;) and use it
  19449. to double the input image resolution:
  19450. </p>
  19451. <div class="example">
  19452. <pre class="example-preformatted">-vf &quot;libplacebo=w=iw*2:h=ih*2:extra_opts='upscaler=custom\:upscaler_preset=ewa_lanczos\:upscaler_blur=0.9812505644269356'&quot;
  19453. </pre></div>
  19454. </dd>
  19455. <dt><samp class="option">shader_cache</samp></dt>
  19456. <dd><p>File path of a cache directory that libplacebo will use to store and load
  19457. cached shader objects. This cache is not cleaned up automatically. If the
  19458. path does not end in a directory separator, the generated filenames will be
  19459. effectively prefixed by the last path component. All directories must already
  19460. exist.
  19461. </p>
  19462. <div class="example">
  19463. <pre class="example-preformatted">-vf &quot;libplacebo=shader_cache=/tmp/pl-shader-&quot;
  19464. </pre></div>
  19465. </dd>
  19466. <dt><samp class="option">colorspace</samp></dt>
  19467. <dt><samp class="option">color_primaries</samp></dt>
  19468. <dt><samp class="option">color_trc</samp></dt>
  19469. <dt><samp class="option">range</samp></dt>
  19470. <dt><samp class="option">chroma_location</samp></dt>
  19471. <dd><p>Configure the colorspace that output frames will be delivered in. The default
  19472. value of <code class="code">auto</code> outputs frames in the same format as the input frames,
  19473. leading to no change. For any other value, conversion will be performed.
  19474. </p>
  19475. <p>See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  19476. </p>
  19477. </dd>
  19478. <dt><samp class="option">alpha_mode</samp></dt>
  19479. <dd><p>Choose the desired output alpha mode, when the output format has an alpha
  19480. channel. See the <a class="ref" href="#setparams">setparams</a> filter for a list of possible values.
  19481. </p>
  19482. </dd>
  19483. <dt><samp class="option">apply_filmgrain</samp></dt>
  19484. <dd><p>Apply film grain (e.g. AV1 or H.274) if present in source frames, and strip
  19485. it from the output. Enabled by default.
  19486. </p>
  19487. </dd>
  19488. <dt><samp class="option">apply_dolbyvision</samp></dt>
  19489. <dd><p>Apply Dolby Vision RPU metadata if present in source frames, and strip it from
  19490. the output. Enabled by default. Note that Dolby Vision will always output
  19491. BT.2020+PQ, overriding the usual input frame metadata. These will also be
  19492. picked as the values of <code class="code">auto</code> for the respective frame output options.
  19493. </p></dd>
  19494. </dl>
  19495. <p>In addition to the expression constants documented for the <a class="ref" href="#scale">scale</a> filter,
  19496. the <samp class="option">crop_w</samp>, <samp class="option">crop_h</samp>, <samp class="option">crop_x</samp>, <samp class="option">crop_y</samp>,
  19497. <samp class="option">pos_w</samp>, <samp class="option">pos_h</samp>, <samp class="option">pos_x</samp> and <samp class="option">pos_y</samp> options can
  19498. also contain the following constants:
  19499. </p>
  19500. <dl class="table">
  19501. <dt><samp class="option">in_idx, idx</samp></dt>
  19502. <dd><p>The (0-based) numeric index of the currently active input stream.
  19503. </p></dd>
  19504. <dt><samp class="option">crop_w, cw</samp></dt>
  19505. <dt><samp class="option">crop_h, ch</samp></dt>
  19506. <dd><p>The computed values of <samp class="option">crop_w</samp> and <samp class="option">crop_h</samp>.
  19507. </p>
  19508. </dd>
  19509. <dt><samp class="option">pos_w, pw</samp></dt>
  19510. <dt><samp class="option">pos_h, ph</samp></dt>
  19511. <dd><p>The computed values of <samp class="option">pos_w</samp> and <samp class="option">pos_h</samp>.
  19512. </p>
  19513. </dd>
  19514. <dt><samp class="option">in_t, t</samp></dt>
  19515. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  19516. </p>
  19517. </dd>
  19518. <dt><samp class="option">out_t, ot</samp></dt>
  19519. <dd><p>The input frame timestamp, in seconds. NAN if input timestamp is unknown.
  19520. </p>
  19521. </dd>
  19522. <dt><samp class="option">n</samp></dt>
  19523. <dd><p>The input frame number, starting with 0.
  19524. </p></dd>
  19525. </dl>
  19526. <a name="Scaling"></a>
  19527. <h4 class="subsubsection">11.143.1.2 Scaling<span class="pull-right"><a class="anchor hidden-xs" href="#Scaling" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Scaling" aria-hidden="true">TOC</a></span></h4>
  19528. <p>The options in this section control how libplacebo performs upscaling and (if
  19529. necessary) downscaling. Note that libplacebo will always internally operate on
  19530. 4:4:4 content, so any sub-sampled chroma formats such as <code class="code">yuv420p</code> will
  19531. necessarily be upsampled and downsampled as part of the rendering process. That
  19532. means scaling might be in effect even if the source and destination resolution
  19533. are the same.
  19534. </p><dl class="table">
  19535. <dt><samp class="option">upscaler</samp></dt>
  19536. <dt><samp class="option">downscaler</samp></dt>
  19537. <dd><p>Configure the filter kernel used for upscaling and downscaling. The respective
  19538. defaults are <code class="code">spline36</code> and <code class="code">mitchell</code>. For a full list of possible
  19539. values, pass <code class="code">help</code> to these options. The most important values are:
  19540. </p><dl class="table">
  19541. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  19542. <dd><p>Forces the use of built-in GPU texture sampling (typically bilinear). Extremely
  19543. fast but poor quality, especially when downscaling.
  19544. </p>
  19545. </dd>
  19546. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  19547. <dd><p>Bilinear interpolation. Can generally be done for free on GPUs, except when
  19548. doing so would lead to aliasing. Fast and low quality.
  19549. </p>
  19550. </dd>
  19551. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  19552. <dd><p>Nearest-neighbour interpolation. Sharp but highly aliasing.
  19553. </p>
  19554. </dd>
  19555. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  19556. <dd><p>Algorithm that looks visually similar to nearest-neighbour interpolation but
  19557. tries to preserve pixel aspect ratio. Good for pixel art, since it results in
  19558. minimal distortion of the artistic appearance.
  19559. </p>
  19560. </dd>
  19561. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  19562. <dd><p>Standard sinc-sinc interpolation kernel.
  19563. </p>
  19564. </dd>
  19565. <dt>&lsquo;<samp class="samp">spline36</samp>&rsquo;</dt>
  19566. <dd><p>Cubic spline approximation of lanczos. No difference in performance, but has
  19567. very slightly less ringing.
  19568. </p>
  19569. </dd>
  19570. <dt>&lsquo;<samp class="samp">ewa_lanczos</samp>&rsquo;</dt>
  19571. <dd><p>Elliptically weighted average version of lanczos, based on a jinc-jinc kernel.
  19572. This is also popularly referred to as just &quot;Jinc scaling&quot;. Slow but very high
  19573. quality.
  19574. </p>
  19575. </dd>
  19576. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  19577. <dd><p>Gaussian kernel. Has certain ideal mathematical properties, but subjectively
  19578. very blurry.
  19579. </p>
  19580. </dd>
  19581. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  19582. <dd><p>Cubic BC spline with parameters recommended by Mitchell and Netravali. Very
  19583. little ringing.
  19584. </p></dd>
  19585. </dl>
  19586. </dd>
  19587. <dt><samp class="option">frame_mixer</samp></dt>
  19588. <dd><p>Controls the kernel used for mixing frames temporally. The default value is
  19589. <code class="code">none</code>, which disables frame mixing. For a full list of possible values,
  19590. pass <code class="code">help</code> to this option. The most important values are:
  19591. </p><dl class="table">
  19592. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  19593. <dd><p>Disables frame mixing, giving a result equivalent to &quot;nearest neighbour&quot;
  19594. semantics.
  19595. </p>
  19596. </dd>
  19597. <dt>&lsquo;<samp class="samp">oversample</samp>&rsquo;</dt>
  19598. <dd><p>Oversamples the input video to create a &quot;Smooth Motion&quot;-type effect: if an
  19599. output frame would exactly fall on the transition between two video frames, it
  19600. is blended according to the relative overlap. This is the recommended option
  19601. whenever preserving the original subjective appearance is desired.
  19602. </p>
  19603. </dd>
  19604. <dt>&lsquo;<samp class="samp">mitchell_clamp</samp>&rsquo;</dt>
  19605. <dd><p>Larger filter kernel that smoothly interpolates multiple frames in a manner
  19606. designed to eliminate ringing and other artefacts as much as possible. This is
  19607. the recommended option wherever maximum visual smoothness is desired.
  19608. </p>
  19609. </dd>
  19610. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  19611. <dd><p>Linear blend/fade between frames. Especially useful for constructing e.g.
  19612. slideshows.
  19613. </p></dd>
  19614. </dl>
  19615. </dd>
  19616. <dt><samp class="option">antiringing</samp></dt>
  19617. <dd><p>Enables anti-ringing (for non-EWA filters). The value (between <code class="code">0.0</code> and
  19618. <code class="code">1.0</code>) configures the strength of the anti-ringing algorithm. May increase
  19619. aliasing if set too high. Disabled by default.
  19620. </p>
  19621. </dd>
  19622. <dt><samp class="option">sigmoid</samp></dt>
  19623. <dd><p>Enable sigmoidal compression during upscaling. Reduces ringing slightly.
  19624. Enabled by default.
  19625. </p></dd>
  19626. </dl>
  19627. <a name="Deinterlacing"></a>
  19628. <h4 class="subsubsection">11.143.1.3 Deinterlacing<span class="pull-right"><a class="anchor hidden-xs" href="#Deinterlacing" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Deinterlacing" aria-hidden="true">TOC</a></span></h4>
  19629. <p>Deinterlacing is automatically supported when frames are tagged as interlaced,
  19630. however frames are not deinterlaced unless a deinterlacing algorithm is chosen.
  19631. </p><dl class="table">
  19632. <dt><samp class="option">deinterlace</samp></dt>
  19633. <dd><p>The the deinterlacing algorithm to use.
  19634. </p><dl class="table">
  19635. <dt>&lsquo;<samp class="samp">weave</samp>&rsquo;</dt>
  19636. <dd><p>No deinterlacing, weave fields together into a single frame. This is the default.
  19637. </p></dd>
  19638. <dt>&lsquo;<samp class="samp">bob</samp>&rsquo;</dt>
  19639. <dd><p>Naive bob deinterlacing, simply repeat each field line twice.
  19640. </p></dd>
  19641. <dt>&lsquo;<samp class="samp">yadif</samp>&rsquo;</dt>
  19642. <dd><p>Yet another deinterlacing filter. See the <a class="ref" href="#yadif">yadif</a> filter for more details.
  19643. </p></dd>
  19644. <dt>&lsquo;<samp class="samp">bwdif</samp>&rsquo;</dt>
  19645. <dd><p>Bob weaver deinterlacing filter. See the <a class="ref" href="#bwdif">bwdif</a> filter for more details.
  19646. </p></dd>
  19647. </dl>
  19648. </dd>
  19649. <dt><samp class="option">skip_spatial_check</samp></dt>
  19650. <dd><p>Skip the spatial deinterlacing check when using <code class="code">yadif</code> deinterlacing.
  19651. </p>
  19652. </dd>
  19653. <dt><samp class="option">send_fields</samp></dt>
  19654. <dd><p>Output a frame for each field, rather than for each frame. Note that this will
  19655. always double the tagged output frame rate, even if the input does not contain
  19656. any interlaced frames. Disabled by default.
  19657. </p></dd>
  19658. </dl>
  19659. <a name="Debanding"></a>
  19660. <h4 class="subsubsection">11.143.1.4 Debanding<span class="pull-right"><a class="anchor hidden-xs" href="#Debanding" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debanding" aria-hidden="true">TOC</a></span></h4>
  19661. <p>Libplacebo comes with a built-in debanding filter that is good at counteracting
  19662. many common sources of banding and blocking. Turning this on is highly
  19663. recommended whenever quality is desired.
  19664. </p><dl class="table">
  19665. <dt><samp class="option">deband</samp></dt>
  19666. <dd><p>Enable (fast) debanding algorithm. Disabled by default.
  19667. </p>
  19668. </dd>
  19669. <dt><samp class="option">deband_iterations</samp></dt>
  19670. <dd><p>Number of deband iterations of the debanding algorithm. Each iteration is
  19671. performed with progressively increased radius (and diminished threshold).
  19672. Recommended values are in the range <code class="code">1</code> to <code class="code">4</code>. Defaults to <code class="code">1</code>.
  19673. </p>
  19674. </dd>
  19675. <dt><samp class="option">deband_threshold</samp></dt>
  19676. <dd><p>Debanding filter strength. Higher numbers lead to more aggressive debanding.
  19677. Defaults to <code class="code">4.0</code>.
  19678. </p>
  19679. </dd>
  19680. <dt><samp class="option">deband_radius</samp></dt>
  19681. <dd><p>Debanding filter radius. A higher radius is better for slow gradients, while
  19682. a lower radius is better for steep gradients. Defaults to <code class="code">16.0</code>.
  19683. </p>
  19684. </dd>
  19685. <dt><samp class="option">deband_grain</samp></dt>
  19686. <dd><p>Amount of extra output grain to add. Helps hide imperfections. Defaults to
  19687. <code class="code">6.0</code>.
  19688. </p></dd>
  19689. </dl>
  19690. <a name="Color-adjustment"></a>
  19691. <h4 class="subsubsection">11.143.1.5 Color adjustment<span class="pull-right"><a class="anchor hidden-xs" href="#Color-adjustment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Color-adjustment" aria-hidden="true">TOC</a></span></h4>
  19692. <p>A collection of subjective color controls. Not very rigorous, so the exact
  19693. effect will vary somewhat depending on the input primaries and colorspace.
  19694. </p><dl class="table">
  19695. <dt><samp class="option">brightness</samp></dt>
  19696. <dd><p>Brightness boost, between <code class="code">-1.0</code> and <code class="code">1.0</code>. Defaults to <code class="code">0.0</code>.
  19697. </p>
  19698. </dd>
  19699. <dt><samp class="option">contrast</samp></dt>
  19700. <dd><p>Contrast gain, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  19701. </p>
  19702. </dd>
  19703. <dt><samp class="option">saturation</samp></dt>
  19704. <dd><p>Saturation gain, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  19705. </p>
  19706. </dd>
  19707. <dt><samp class="option">hue</samp></dt>
  19708. <dd><p>Hue shift in radians, between <code class="code">-3.14</code> and <code class="code">3.14</code>. Defaults to
  19709. <code class="code">0.0</code>. This will rotate the UV subvector, defaulting to BT.709
  19710. coefficients for RGB inputs.
  19711. </p>
  19712. </dd>
  19713. <dt><samp class="option">gamma</samp></dt>
  19714. <dd><p>Gamma adjustment, between <code class="code">0.0</code> and <code class="code">16.0</code>. Defaults to <code class="code">1.0</code>.
  19715. </p>
  19716. </dd>
  19717. <dt><samp class="option">temperature</samp></dt>
  19718. <dd><p>Color temperature adjustment. Lower values make the output warmer/redder,
  19719. down to <code class="code">1667</code>, while higher values make the output cooler/bluer, up to
  19720. <code class="code">25000</code>. Defaults to <code class="code">6500</code> (neutral white).
  19721. </p>
  19722. </dd>
  19723. <dt><samp class="option">cones</samp></dt>
  19724. <dd><p>Cone model to use for color blindness simulation. Accepts any combination of
  19725. <code class="code">l</code>, <code class="code">m</code> and <code class="code">s</code>. Here are some examples:
  19726. </p><dl class="table">
  19727. <dt>&lsquo;<samp class="samp">m</samp>&rsquo;</dt>
  19728. <dd><p>Deuteranomaly / deuteranopia (affecting 3%-4% of the population)
  19729. </p></dd>
  19730. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  19731. <dd><p>Protanomaly / protanopia (affecting 1%-2% of the population)
  19732. </p></dd>
  19733. <dt>&lsquo;<samp class="samp">l+m</samp>&rsquo;</dt>
  19734. <dd><p>Monochromacy (very rare)
  19735. </p></dd>
  19736. <dt>&lsquo;<samp class="samp">l+m+s</samp>&rsquo;</dt>
  19737. <dd><p>Achromatopsy (complete loss of daytime vision, extremely rare)
  19738. </p></dd>
  19739. </dl>
  19740. </dd>
  19741. <dt><samp class="option">cone-strength</samp></dt>
  19742. <dd><p>Gain factor for the cones specified by <code class="code">cones</code>, between <code class="code">0.0</code> and
  19743. <code class="code">10.0</code>. A value of <code class="code">1.0</code> results in no change to color vision. A
  19744. value of <code class="code">0.0</code> (the default) simulates complete loss of those cones. Values
  19745. above <code class="code">1.0</code> result in exaggerating the differences between cones, which
  19746. may help compensate for reduced color vision.
  19747. </p></dd>
  19748. </dl>
  19749. <a name="Peak-detection"></a>
  19750. <h4 class="subsubsection">11.143.1.6 Peak detection<span class="pull-right"><a class="anchor hidden-xs" href="#Peak-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Peak-detection" aria-hidden="true">TOC</a></span></h4>
  19751. <p>To help deal with sources that only have static HDR10 metadata (or no tagging
  19752. whatsoever), libplacebo uses its own internal frame analysis compute shader to
  19753. analyze source frames and adapt the tone mapping function in realtime. If this
  19754. is too slow, or if exactly reproducible frame-perfect results are needed, it&rsquo;s
  19755. recommended to turn this feature off.
  19756. </p><dl class="table">
  19757. <dt><samp class="option">peak_detect</samp></dt>
  19758. <dd><p>Enable HDR peak detection. Ignores static MaxCLL/MaxFALL values in favor of
  19759. dynamic detection from the input. Note that the detected values do not get
  19760. written back to the output frames, they merely guide the internal tone mapping
  19761. process. Enabled by default.
  19762. </p>
  19763. </dd>
  19764. <dt><samp class="option">smoothing_period</samp></dt>
  19765. <dd><p>Peak detection smoothing period, between <code class="code">0.0</code> and <code class="code">1000.0</code>. Higher
  19766. values result in peak detection becoming less responsive to changes in the
  19767. input. Defaults to <code class="code">100.0</code>.
  19768. </p>
  19769. </dd>
  19770. <dt><samp class="option">scene_threshold_low</samp></dt>
  19771. <dt><samp class="option">scene_threshold_high</samp></dt>
  19772. <dd><p>Lower and upper thresholds for scene change detection. Expressed in a
  19773. logarithmic scale between <code class="code">0.0</code> and <code class="code">100.0</code>. Default to <code class="code">5.5</code>
  19774. and <code class="code">10.0</code>, respectively. Setting either to a negative value disables
  19775. this functionality.
  19776. </p>
  19777. </dd>
  19778. <dt><samp class="option">percentile</samp></dt>
  19779. <dd><p>Which percentile of the frame brightness histogram to use as the source peak
  19780. for tone-mapping. Defaults to <code class="code">99.995</code>, a fairly conservative value.
  19781. Setting this to <code class="code">100.0</code> disables frame histogram measurement and instead
  19782. uses the true peak brightness for tone-mapping.
  19783. </p></dd>
  19784. </dl>
  19785. <a name="Tone-mapping"></a>
  19786. <h4 class="subsubsection">11.143.1.7 Tone mapping<span class="pull-right"><a class="anchor hidden-xs" href="#Tone-mapping" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Tone-mapping" aria-hidden="true">TOC</a></span></h4>
  19787. <p>The options in this section control how libplacebo performs tone-mapping and
  19788. gamut-mapping when dealing with mismatches between wide-gamut or HDR content.
  19789. In general, libplacebo relies on accurate source tagging and mastering display
  19790. gamut information to produce the best results.
  19791. </p><dl class="table">
  19792. <dt><samp class="option">gamut_mode</samp></dt>
  19793. <dd><p>How to handle out-of-gamut colors that can occur as a result of colorimetric
  19794. gamut mapping.
  19795. </p><dl class="table">
  19796. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  19797. <dd><p>Do nothing, simply clip out-of-range colors to the RGB volume. Low quality but
  19798. extremely fast.
  19799. </p></dd>
  19800. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  19801. <dd><p>Perceptually soft-clip colors to the gamut volume. This is the default.
  19802. </p></dd>
  19803. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  19804. <dd><p>Relative colorimetric hard-clip. Similar to <code class="code">perceptual</code> but without
  19805. the soft knee.
  19806. </p></dd>
  19807. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  19808. <dd><p>Saturation mapping, maps primaries directly to primaries in RGB space.
  19809. Not recommended except for artificial computer graphics for which a bright,
  19810. saturated display is desired.
  19811. </p></dd>
  19812. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  19813. <dd><p>Absolute colorimetric hard-clip. Performs no adjustment of the white point.
  19814. </p></dd>
  19815. <dt>&lsquo;<samp class="samp">desaturate</samp>&rsquo;</dt>
  19816. <dd><p>Hard-desaturates out-of-gamut colors towards white, while preserving the
  19817. luminance. Has a tendency to distort the visual appearance of bright objects.
  19818. </p></dd>
  19819. <dt>&lsquo;<samp class="samp">darken</samp>&rsquo;</dt>
  19820. <dd><p>Linearly reduces content brightness to preserves saturated details, followed by
  19821. clipping the remaining out-of-gamut colors.
  19822. </p></dd>
  19823. <dt>&lsquo;<samp class="samp">warn</samp>&rsquo;</dt>
  19824. <dd><p>Highlight out-of-gamut pixels (by inverting/marking them).
  19825. </p></dd>
  19826. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  19827. <dd><p>Linearly reduces chromaticity of the entire image to make it fit within the
  19828. target color volume. Be careful when using this on BT.2020 sources without
  19829. proper mastering metadata, as doing so will lead to excessive desaturation.
  19830. </p></dd>
  19831. </dl>
  19832. </dd>
  19833. <dt><samp class="option">tonemapping</samp></dt>
  19834. <dd><p>Tone-mapping algorithm to use. Available values are:
  19835. </p><dl class="table">
  19836. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  19837. <dd><p>Automatic selection based on internal heuristics. This is the default.
  19838. </p></dd>
  19839. <dt>&lsquo;<samp class="samp">clip</samp>&rsquo;</dt>
  19840. <dd><p>Performs no tone-mapping, just clips out-of-range colors. Retains perfect color
  19841. accuracy for in-range colors but completely destroys out-of-range information.
  19842. Does not perform any black point adaptation. Not configurable.
  19843. </p></dd>
  19844. <dt>&lsquo;<samp class="samp">st2094-40</samp>&rsquo;</dt>
  19845. <dd><p>EETF from SMPTE ST 2094-40 Annex B, which applies the Bezier curves from HDR10+
  19846. dynamic metadata based on Bezier curves to perform tone-mapping. The OOTF used
  19847. is adjusted based on the ratio between the targeted and actual display peak
  19848. luminances.
  19849. </p></dd>
  19850. <dt>&lsquo;<samp class="samp">st2094-10</samp>&rsquo;</dt>
  19851. <dd><p>EETF from SMPTE ST 2094-10 Annex B.2, which takes into account the input signal
  19852. average luminance in addition to the maximum/minimum. The configurable contrast
  19853. parameter influences the slope of the linear output segment, defaulting to
  19854. <code class="code">1.0</code> for no increase/decrease in contrast. Note that this does not
  19855. currently include the subjective gain/offset/gamma controls defined in Annex
  19856. B.3.
  19857. </p></dd>
  19858. <dt>&lsquo;<samp class="samp">bt.2390</samp>&rsquo;</dt>
  19859. <dd><p>EETF from the ITU-R Report BT.2390, a hermite spline roll-off with linear
  19860. segment. The knee point offset is configurable. Note that this parameter
  19861. defaults to <code class="code">1.0</code>, rather than the value of <code class="code">0.5</code> from the ITU-R
  19862. spec.
  19863. </p></dd>
  19864. <dt>&lsquo;<samp class="samp">bt.2446a</samp>&rsquo;</dt>
  19865. <dd><p>EETF from ITU-R Report BT.2446, method A. Designed for well-mastered HDR
  19866. sources. Can be used for both forward and inverse tone mapping. Not
  19867. configurable.
  19868. </p></dd>
  19869. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  19870. <dd><p>Simple spline consisting of two polynomials, joined by a single pivot point.
  19871. The parameter gives the pivot point (in PQ space), defaulting to <code class="code">0.30</code>.
  19872. Can be used for both forward and inverse tone mapping.
  19873. </p></dd>
  19874. <dt>&lsquo;<samp class="samp">reinhard</samp>&rsquo;</dt>
  19875. <dd><p>Simple non-linear, global tone mapping algorithm. The parameter specifies the
  19876. local contrast coefficient at the display peak. Essentially, a parameter of
  19877. <code class="code">0.5</code> implies that the reference white will be about half as bright as
  19878. when clipping. Defaults to <code class="code">0.5</code>, which results in the simplest
  19879. formulation of this function.
  19880. </p></dd>
  19881. <dt>&lsquo;<samp class="samp">mobius</samp>&rsquo;</dt>
  19882. <dd><p>Generalization of the reinhard tone mapping algorithm to support an additional
  19883. linear slope near black. The tone mapping parameter indicates the trade-off
  19884. between the linear section and the non-linear section. Essentially, for a given
  19885. parameter <var class="var">x</var>, every color value below <var class="var">x</var> will be mapped linearly,
  19886. while higher values get non-linearly tone-mapped. Values near <code class="code">1.0</code> make
  19887. this curve behave like <code class="code">clip</code>, while values near <code class="code">0.0</code> make this
  19888. curve behave like <code class="code">reinhard</code>. The default value is <code class="code">0.3</code>, which
  19889. provides a good balance between colorimetric accuracy and preserving
  19890. out-of-gamut details.
  19891. </p></dd>
  19892. <dt>&lsquo;<samp class="samp">hable</samp>&rsquo;</dt>
  19893. <dd><p>Piece-wise, filmic tone-mapping algorithm developed by John Hable for use in
  19894. Uncharted 2, inspired by a similar tone-mapping algorithm used by Kodak.
  19895. Popularized by its use in video games with HDR rendering. Preserves both dark
  19896. and bright details very well, but comes with the drawback of changing the
  19897. average brightness quite significantly. This is sort of similar to
  19898. <code class="code">reinhard</code> with parameter <code class="code">0.24</code>.
  19899. </p></dd>
  19900. <dt>&lsquo;<samp class="samp">gamma</samp>&rsquo;</dt>
  19901. <dd><p>Fits a gamma (power) function to transfer between the source and target color
  19902. spaces, effectively resulting in a perceptual hard-knee joining two roughly
  19903. linear sections. This preserves details at all scales fairly accurately, but
  19904. can result in an image with a muted or dull appearance. The parameter is used
  19905. as the cutoff point, defaulting to <code class="code">0.5</code>.
  19906. </p></dd>
  19907. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  19908. <dd><p>Linearly stretches the input range to the output range, in PQ space. This will
  19909. preserve all details accurately, but results in a significantly different
  19910. average brightness. Can be used for inverse tone-mapping in addition to regular
  19911. tone-mapping. The parameter can be used as an additional linear gain
  19912. coefficient (defaulting to <code class="code">1.0</code>).
  19913. </p></dd>
  19914. </dl>
  19915. </dd>
  19916. <dt><samp class="option">tonemapping_param</samp></dt>
  19917. <dd><p>For tunable tone mapping functions, this parameter can be used to fine-tune the
  19918. curve behavior. Refer to the documentation of <code class="code">tonemapping</code>. The default
  19919. value of <code class="code">0.0</code> is replaced by the curve&rsquo;s preferred default setting.
  19920. </p>
  19921. </dd>
  19922. <dt><samp class="option">inverse_tonemapping</samp></dt>
  19923. <dd><p>If enabled, this filter will also attempt stretching SDR signals to fill HDR
  19924. output color volumes. Disabled by default.
  19925. </p>
  19926. </dd>
  19927. <dt><samp class="option">tonemapping_lut_size</samp></dt>
  19928. <dd><p>Size of the tone-mapping LUT, between <code class="code">2</code> and <code class="code">1024</code>. Defaults to
  19929. <code class="code">256</code>. Note that this figure is squared when combined with
  19930. <code class="code">peak_detect</code>.
  19931. </p>
  19932. </dd>
  19933. <dt><samp class="option">contrast_recovery</samp></dt>
  19934. <dd><p>Contrast recovery strength. If set to a value above <code class="code">0.0</code>, the source
  19935. image will be divided into high-frequency and low-frequency components, and a
  19936. portion of the high-frequency image is added back onto the tone-mapped output.
  19937. May cause excessive ringing artifacts for some HDR sources, but can improve the
  19938. subjective sharpness and detail left over in the image after tone-mapping.
  19939. Defaults to <code class="code">0.30</code>.
  19940. </p>
  19941. </dd>
  19942. <dt><samp class="option">contrast_smoothness</samp></dt>
  19943. <dd><p>Contrast recovery lowpass kernel size. Defaults to <code class="code">3.5</code>. Increasing or
  19944. decreasing this will affect the visual appearance substantially. Has no effect
  19945. when <code class="code">contrast_recovery</code> is disabled.
  19946. </p></dd>
  19947. </dl>
  19948. <a name="Dithering"></a>
  19949. <h4 class="subsubsection">11.143.1.8 Dithering<span class="pull-right"><a class="anchor hidden-xs" href="#Dithering" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Dithering" aria-hidden="true">TOC</a></span></h4>
  19950. <p>By default, libplacebo will dither whenever necessary, which includes rendering
  19951. to any integer format below 16-bit precision. It&rsquo;s recommended to always leave
  19952. this on, since not doing so may result in visible banding in the output, even
  19953. if the <code class="code">debanding</code> filter is enabled. If maximum performance is needed,
  19954. use <code class="code">ordered_fixed</code> instead of disabling dithering.
  19955. </p><dl class="table">
  19956. <dt><samp class="option">dithering</samp></dt>
  19957. <dd><p>Dithering method to use. Accepts the following values:
  19958. </p><dl class="table">
  19959. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  19960. <dd><p>Disables dithering completely. May result in visible banding.
  19961. </p></dd>
  19962. <dt>&lsquo;<samp class="samp">blue</samp>&rsquo;</dt>
  19963. <dd><p>Dither with pseudo-blue noise. This is the default.
  19964. </p></dd>
  19965. <dt>&lsquo;<samp class="samp">ordered</samp>&rsquo;</dt>
  19966. <dd><p>Tunable ordered dither pattern.
  19967. </p></dd>
  19968. <dt>&lsquo;<samp class="samp">ordered_fixed</samp>&rsquo;</dt>
  19969. <dd><p>Faster ordered dither with a fixed size of <code class="code">6</code>. Texture-less.
  19970. </p></dd>
  19971. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  19972. <dd><p>Dither with white noise. Texture-less.
  19973. </p></dd>
  19974. </dl>
  19975. </dd>
  19976. <dt><samp class="option">dither_lut_size</samp></dt>
  19977. <dd><p>Dither LUT size, as log base2 between <code class="code">1</code> and <code class="code">8</code>. Defaults to
  19978. <code class="code">6</code>, corresponding to a LUT size of <code class="code">64x64</code>.
  19979. </p>
  19980. </dd>
  19981. <dt><samp class="option">dither_temporal</samp></dt>
  19982. <dd><p>Enables temporal dithering. Disabled by default.
  19983. </p></dd>
  19984. </dl>
  19985. <a name="Custom-shaders"></a>
  19986. <h4 class="subsubsection">11.143.1.9 Custom shaders<span class="pull-right"><a class="anchor hidden-xs" href="#Custom-shaders" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Custom-shaders" aria-hidden="true">TOC</a></span></h4>
  19987. <p>libplacebo supports a number of custom shaders based on the mpv .hook GLSL
  19988. syntax. A collection of such shaders can be found here:
  19989. <a class="url" href="https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders">https://github.com/mpv-player/mpv/wiki/User-Scripts#user-shaders</a>
  19990. </p>
  19991. <p>A full description of the mpv shader format is beyond the scope of this
  19992. section, but a summary can be found here:
  19993. <a class="url" href="https://mpv.io/manual/master/#options-glsl-shader">https://mpv.io/manual/master/#options-glsl-shader</a>
  19994. </p><dl class="table">
  19995. <dt><samp class="option">custom_shader_path</samp></dt>
  19996. <dd><p>Specifies a path to a custom shader file to load at runtime.
  19997. </p>
  19998. </dd>
  19999. <dt><samp class="option">custom_shader_bin</samp></dt>
  20000. <dd><p>Specifies a complete custom shader as a raw string.
  20001. </p></dd>
  20002. </dl>
  20003. <a name="Debugging-_002f-performance"></a>
  20004. <h4 class="subsubsection">11.143.1.10 Debugging / performance<span class="pull-right"><a class="anchor hidden-xs" href="#Debugging-_002f-performance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Debugging-_002f-performance" aria-hidden="true">TOC</a></span></h4>
  20005. <p>All of the options in this section default off. They may be of assistance when
  20006. attempting to squeeze the maximum performance at the cost of quality.
  20007. </p><dl class="table">
  20008. <dt><samp class="option">skip_aa</samp></dt>
  20009. <dd><p>Disable anti-aliasing when downscaling.
  20010. </p>
  20011. </dd>
  20012. <dt><samp class="option">disable_linear</samp></dt>
  20013. <dd><p>Disable linear light scaling.
  20014. </p>
  20015. </dd>
  20016. <dt><samp class="option">disable_builtin</samp></dt>
  20017. <dd><p>Disable built-in GPU sampling (forces LUT).
  20018. </p>
  20019. </dd>
  20020. <dt><samp class="option">disable_fbos</samp></dt>
  20021. <dd><p>Forcibly disable FBOs, resulting in loss of almost all functionality, but
  20022. offering the maximum possible speed.
  20023. </p></dd>
  20024. </dl>
  20025. <a name="Commands-105"></a>
  20026. <h4 class="subsection">11.143.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-105" aria-hidden="true">TOC</a></span></h4>
  20027. <p>This filter supports almost all of the above options as <a class="ref" href="#commands">commands</a>.
  20028. </p>
  20029. <a name="Examples-91"></a>
  20030. <h4 class="subsection">11.143.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-91" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-91" aria-hidden="true">TOC</a></span></h4>
  20031. <ul class="itemize mark-bullet">
  20032. <li>Tone-map input to standard gamut BT.709 output:
  20033. <div class="example">
  20034. <pre class="example-preformatted">libplacebo=colorspace=bt709:color_primaries=bt709:color_trc=bt709:range=tv
  20035. </pre></div>
  20036. </li><li>Rescale input to fit into standard 1080p, with high quality scaling:
  20037. <div class="example">
  20038. <pre class="example-preformatted">libplacebo=w=1920:h=1080:force_original_aspect_ratio=decrease:normalize_sar=true:upscaler=ewa_lanczos:downscaler=ewa_lanczos
  20039. </pre></div>
  20040. </li><li>Interpolate low FPS / VFR input to smoothed constant 60 fps output:
  20041. <div class="example">
  20042. <pre class="example-preformatted">libplacebo=fps=60:frame_mixer=mitchell_clamp
  20043. </pre></div>
  20044. </li><li>Convert input to standard sRGB JPEG:
  20045. <div class="example">
  20046. <pre class="example-preformatted">libplacebo=format=yuv420p:colorspace=bt470bg:color_primaries=bt709:color_trc=iec61966-2-1:range=pc
  20047. </pre></div>
  20048. </li><li>Use higher quality debanding settings:
  20049. <div class="example">
  20050. <pre class="example-preformatted">libplacebo=deband=true:deband_iterations=3:deband_radius=8:deband_threshold=6
  20051. </pre></div>
  20052. </li><li>Run this filter on the CPU, on systems with Mesa installed (and with the most
  20053. expensive options disabled):
  20054. <div class="example">
  20055. <pre class="example-preformatted">ffmpeg ... -init_hw_device vulkan:llvmpipe ... -vf libplacebo=upscaler=none:downscaler=none:peak_detect=false
  20056. </pre></div>
  20057. </li><li>Suppress CPU-based AV1/H.274 film grain application in the decoder, in favor of
  20058. doing it with this filter. Note that this is only a gain if the frames are
  20059. either already on the GPU, or if you&rsquo;re using libplacebo for other purposes,
  20060. since otherwise the VRAM roundtrip will more than offset any expected speedup.
  20061. <div class="example">
  20062. <pre class="example-preformatted">ffmpeg -export_side_data +film_grain ... -vf libplacebo=apply_filmgrain=true
  20063. </pre></div>
  20064. </li><li>Interop with VAAPI hwdec to avoid round-tripping through RAM:
  20065. <div class="example">
  20066. <pre class="example-preformatted">ffmpeg -init_hw_device vulkan -hwaccel vaapi -hwaccel_output_format vaapi ... -vf libplacebo
  20067. </pre></div>
  20068. </li></ul>
  20069. <a class="anchor" id="libvmaf"></a><a name="libvmaf-1"></a>
  20070. <h3 class="section">11.144 libvmaf<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf-1" aria-hidden="true">TOC</a></span></h3>
  20071. <p>Calculate the VMAF (Video Multi-Method Assessment Fusion) score for a
  20072. reference/distorted pair of input videos.
  20073. </p>
  20074. <p>The first input is the distorted video, and the second input is the reference video.
  20075. </p>
  20076. <p>The obtained VMAF score is printed through the logging system.
  20077. </p>
  20078. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  20079. After installing the library it can be enabled using:
  20080. <code class="code">./configure --enable-libvmaf</code>.
  20081. </p>
  20082. <p>The filter has following options:
  20083. </p>
  20084. <dl class="table">
  20085. <dt><samp class="option">model</samp></dt>
  20086. <dd><p>A &lsquo;|&lsquo; delimited list of vmaf models. Each model can be configured with a number of parameters.
  20087. Default value: <code class="code">&quot;version=vmaf_v0.6.1&quot;</code>
  20088. </p>
  20089. </dd>
  20090. <dt><samp class="option">feature</samp></dt>
  20091. <dd><p>A &lsquo;|&lsquo; delimited list of features. Each feature can be configured with a number of parameters.
  20092. </p>
  20093. </dd>
  20094. <dt><samp class="option">log_path</samp></dt>
  20095. <dd><p>Set the file path to be used to store log files.
  20096. </p>
  20097. </dd>
  20098. <dt><samp class="option">log_fmt</samp></dt>
  20099. <dd><p>Set the format of the log file (xml, json, csv, or sub).
  20100. </p>
  20101. </dd>
  20102. <dt><samp class="option">pool</samp></dt>
  20103. <dd><p>Set the pool method to be used for computing vmaf.
  20104. Options are <code class="code">min</code>, <code class="code">harmonic_mean</code> or <code class="code">mean</code> (default).
  20105. </p>
  20106. </dd>
  20107. <dt><samp class="option">n_threads</samp></dt>
  20108. <dd><p>Set number of threads to be used when initializing libvmaf.
  20109. Default value: <code class="code">0</code>, no threads.
  20110. </p>
  20111. </dd>
  20112. <dt><samp class="option">n_subsample</samp></dt>
  20113. <dd><p>Set frame subsampling interval to be used.
  20114. </p></dd>
  20115. </dl>
  20116. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  20117. </p>
  20118. <a name="Examples-92"></a>
  20119. <h4 class="subsection">11.144.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-92" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-92" aria-hidden="true">TOC</a></span></h4>
  20120. <ul class="itemize mark-bullet">
  20121. <li>In the examples below, a distorted video <samp class="file">distorted.mpg</samp> is
  20122. compared with a reference file <samp class="file">reference.mpg</samp>.
  20123. </li><li>Basic usage:
  20124. <div class="example">
  20125. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf=log_path=output.xml -f null -
  20126. </pre></div>
  20127. </li><li>Example with multiple models:
  20128. <div class="example">
  20129. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='model=version=vmaf_v0.6.1\\:name=vmaf|version=vmaf_v0.6.1neg\\:name=vmaf_neg' -f null -
  20130. </pre></div>
  20131. </li><li>Example with multiple additional features:
  20132. <div class="example">
  20133. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mpg -lavfi libvmaf='feature=name=psnr|name=ciede' -f null -
  20134. </pre></div>
  20135. </li><li>Example with options and different containers:
  20136. <div class="example">
  20137. <pre class="example-preformatted">ffmpeg -i distorted.mpg -i reference.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=log_fmt=json:log_path=output.json&quot; -f null -
  20138. </pre></div>
  20139. </li></ul>
  20140. <a name="libvmaf_005fcuda"></a>
  20141. <h3 class="section">11.145 libvmaf_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf_005fcuda" aria-hidden="true">TOC</a></span></h3>
  20142. <p>This is the CUDA variant of the <a class="ref" href="#libvmaf">libvmaf</a> filter. It only accepts CUDA frames.
  20143. </p>
  20144. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  20145. After installing the library it can be enabled using:
  20146. <code class="code">./configure --enable-nonfree --enable-ffnvcodec --enable-libvmaf</code>.
  20147. </p>
  20148. <a name="Examples-93"></a>
  20149. <h4 class="subsection">11.145.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-93" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-93" aria-hidden="true">TOC</a></span></h4>
  20150. <ul class="itemize mark-bullet">
  20151. <li>Basic usage showing CUVID hardware decoding and CUDA scaling with <a class="ref" href="#scale_005fcuda">scale_cuda</a>:
  20152. <div class="example">
  20153. <pre class="example-preformatted">ffmpeg \
  20154. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i dis.obu \
  20155. -hwaccel cuda -hwaccel_output_format cuda -codec:v av1_cuvid -i ref.obu \
  20156. -filter_complex &quot;
  20157. [0:v]scale_cuda=format=yuv420p[dis]; \
  20158. [1:v]scale_cuda=format=yuv420p[ref]; \
  20159. [dis][ref]libvmaf_cuda=log_fmt=json:log_path=output.json
  20160. &quot; \
  20161. -f null -
  20162. </pre></div>
  20163. </li></ul>
  20164. <a name="limitdiff"></a>
  20165. <h3 class="section">11.146 limitdiff<span class="pull-right"><a class="anchor hidden-xs" href="#limitdiff" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limitdiff" aria-hidden="true">TOC</a></span></h3>
  20166. <p>Apply limited difference filter using second and optionally third video stream.
  20167. </p>
  20168. <p>The filter accepts the following options:
  20169. </p>
  20170. <dl class="table">
  20171. <dt><samp class="option">threshold</samp></dt>
  20172. <dd><p>Set the threshold to use when allowing certain differences between video streams.
  20173. Any absolute difference value lower or exact than this threshold will pick pixel components from
  20174. first video stream.
  20175. </p>
  20176. </dd>
  20177. <dt><samp class="option">elasticity</samp></dt>
  20178. <dd><p>Set the elasticity of soft thresholding when processing video streams.
  20179. This value multiplied with first one sets second threshold.
  20180. Any absolute difference value greater or exact than second threshold will pick pixel components
  20181. from second video stream. For values between those two threshold
  20182. linear interpolation between first and second video stream will be used.
  20183. </p>
  20184. </dd>
  20185. <dt><samp class="option">reference</samp></dt>
  20186. <dd><p>Enable the reference (third) video stream processing. By default is disabled.
  20187. If set, this video stream will be used for calculating absolute difference with first video
  20188. stream.
  20189. </p>
  20190. </dd>
  20191. <dt><samp class="option">planes</samp></dt>
  20192. <dd><p>Specify which planes will be processed. Defaults to all available.
  20193. </p></dd>
  20194. </dl>
  20195. <a name="Commands-106"></a>
  20196. <h4 class="subsection">11.146.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-106" aria-hidden="true">TOC</a></span></h4>
  20197. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option &lsquo;<samp class="samp">reference</samp>&rsquo;.
  20198. </p>
  20199. <a name="limiter"></a>
  20200. <h3 class="section">11.147 limiter<span class="pull-right"><a class="anchor hidden-xs" href="#limiter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-limiter" aria-hidden="true">TOC</a></span></h3>
  20201. <p>Limits the pixel components values to the specified range [min, max].
  20202. </p>
  20203. <p>The filter accepts the following options:
  20204. </p>
  20205. <dl class="table">
  20206. <dt><samp class="option">min</samp></dt>
  20207. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  20208. </p>
  20209. </dd>
  20210. <dt><samp class="option">max</samp></dt>
  20211. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  20212. </p>
  20213. </dd>
  20214. <dt><samp class="option">planes</samp></dt>
  20215. <dd><p>Specify which planes will be processed. Defaults to all available.
  20216. </p></dd>
  20217. </dl>
  20218. <a name="Commands-107"></a>
  20219. <h4 class="subsection">11.147.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-107" aria-hidden="true">TOC</a></span></h4>
  20220. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20221. </p>
  20222. <a name="loop"></a>
  20223. <h3 class="section">11.148 loop<span class="pull-right"><a class="anchor hidden-xs" href="#loop" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-loop" aria-hidden="true">TOC</a></span></h3>
  20224. <p>Loop video frames.
  20225. </p>
  20226. <p>The filter accepts the following options:
  20227. </p>
  20228. <dl class="table">
  20229. <dt><samp class="option">loop</samp></dt>
  20230. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  20231. Default is 0.
  20232. </p>
  20233. </dd>
  20234. <dt><samp class="option">size</samp></dt>
  20235. <dd><p>Set maximal size in number of frames. Default is 0.
  20236. </p>
  20237. </dd>
  20238. <dt><samp class="option">start</samp></dt>
  20239. <dd><p>Set first frame of loop. Default is 0.
  20240. </p>
  20241. </dd>
  20242. <dt><samp class="option">time</samp></dt>
  20243. <dd><p>Set the time of loop start in seconds.
  20244. Only used if option named <var class="var">start</var> is set to <code class="code">-1</code>.
  20245. </p></dd>
  20246. </dl>
  20247. <a name="Examples-94"></a>
  20248. <h4 class="subsection">11.148.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-94" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-94" aria-hidden="true">TOC</a></span></h4>
  20249. <ul class="itemize mark-bullet">
  20250. <li>Loop single first frame infinitely:
  20251. <div class="example">
  20252. <pre class="example-preformatted">loop=loop=-1:size=1:start=0
  20253. </pre></div>
  20254. </li><li>Loop single first frame 10 times:
  20255. <div class="example">
  20256. <pre class="example-preformatted">loop=loop=10:size=1:start=0
  20257. </pre></div>
  20258. </li><li>Loop 10 first frames 5 times:
  20259. <div class="example">
  20260. <pre class="example-preformatted">loop=loop=5:size=10:start=0
  20261. </pre></div>
  20262. </li></ul>
  20263. <a name="lut1d"></a>
  20264. <h3 class="section">11.149 lut1d<span class="pull-right"><a class="anchor hidden-xs" href="#lut1d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut1d" aria-hidden="true">TOC</a></span></h3>
  20265. <p>Apply a 1D LUT to an input video.
  20266. </p>
  20267. <p>The filter accepts the following options:
  20268. </p>
  20269. <dl class="table">
  20270. <dt><samp class="option">file</samp></dt>
  20271. <dd><p>Set the 1D LUT file name.
  20272. </p>
  20273. <p>Currently supported formats:
  20274. </p><dl class="table">
  20275. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  20276. <dd><p>Iridas
  20277. </p></dd>
  20278. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  20279. <dd><p>cineSpace
  20280. </p></dd>
  20281. </dl>
  20282. </dd>
  20283. <dt><samp class="option">interp</samp></dt>
  20284. <dd><p>Select interpolation mode.
  20285. </p>
  20286. <p>Available values are:
  20287. </p>
  20288. <dl class="table">
  20289. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  20290. <dd><p>Use values from the nearest defined point.
  20291. </p></dd>
  20292. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  20293. <dd><p>Interpolate values using the linear interpolation.
  20294. </p></dd>
  20295. <dt>&lsquo;<samp class="samp">cosine</samp>&rsquo;</dt>
  20296. <dd><p>Interpolate values using the cosine interpolation.
  20297. </p></dd>
  20298. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  20299. <dd><p>Interpolate values using the cubic interpolation.
  20300. </p></dd>
  20301. <dt>&lsquo;<samp class="samp">spline</samp>&rsquo;</dt>
  20302. <dd><p>Interpolate values using the spline interpolation.
  20303. </p></dd>
  20304. </dl>
  20305. </dd>
  20306. </dl>
  20307. <a name="Commands-108"></a>
  20308. <h4 class="subsection">11.149.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-108" aria-hidden="true">TOC</a></span></h4>
  20309. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20310. </p>
  20311. <a class="anchor" id="lut3d"></a><a name="lut3d-1"></a>
  20312. <h3 class="section">11.150 lut3d<span class="pull-right"><a class="anchor hidden-xs" href="#lut3d-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut3d-1" aria-hidden="true">TOC</a></span></h3>
  20313. <p>Apply a 3D LUT to an input video.
  20314. </p>
  20315. <p>The filter accepts the following options:
  20316. </p>
  20317. <dl class="table">
  20318. <dt><samp class="option">file</samp></dt>
  20319. <dd><p>Set the 3D LUT file name.
  20320. </p>
  20321. <p>Currently supported formats:
  20322. </p><dl class="table">
  20323. <dt>&lsquo;<samp class="samp">3dl</samp>&rsquo;</dt>
  20324. <dd><p>AfterEffects
  20325. </p></dd>
  20326. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  20327. <dd><p>Iridas
  20328. </p></dd>
  20329. <dt>&lsquo;<samp class="samp">dat</samp>&rsquo;</dt>
  20330. <dd><p>DaVinci
  20331. </p></dd>
  20332. <dt>&lsquo;<samp class="samp">m3d</samp>&rsquo;</dt>
  20333. <dd><p>Pandora
  20334. </p></dd>
  20335. <dt>&lsquo;<samp class="samp">csp</samp>&rsquo;</dt>
  20336. <dd><p>cineSpace
  20337. </p></dd>
  20338. </dl>
  20339. </dd>
  20340. <dt><samp class="option">interp</samp></dt>
  20341. <dd><p>Select interpolation mode.
  20342. </p>
  20343. <p>Available values are:
  20344. </p>
  20345. <dl class="table">
  20346. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  20347. <dd><p>Use values from the nearest defined point.
  20348. </p></dd>
  20349. <dt>&lsquo;<samp class="samp">trilinear</samp>&rsquo;</dt>
  20350. <dd><p>Interpolate values using the 8 points defining a cube.
  20351. </p></dd>
  20352. <dt>&lsquo;<samp class="samp">tetrahedral</samp>&rsquo;</dt>
  20353. <dd><p>Interpolate values using a tetrahedron.
  20354. </p></dd>
  20355. <dt>&lsquo;<samp class="samp">pyramid</samp>&rsquo;</dt>
  20356. <dd><p>Interpolate values using a pyramid.
  20357. </p></dd>
  20358. <dt>&lsquo;<samp class="samp">prism</samp>&rsquo;</dt>
  20359. <dd><p>Interpolate values using a prism.
  20360. </p></dd>
  20361. </dl>
  20362. </dd>
  20363. </dl>
  20364. <a name="Commands-109"></a>
  20365. <h4 class="subsection">11.150.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-109" aria-hidden="true">TOC</a></span></h4>
  20366. <p>This filter supports the <code class="code">interp</code> option as <a class="ref" href="#commands">commands</a>.
  20367. </p>
  20368. <a name="lumakey"></a>
  20369. <h3 class="section">11.151 lumakey<span class="pull-right"><a class="anchor hidden-xs" href="#lumakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lumakey" aria-hidden="true">TOC</a></span></h3>
  20370. <p>Turn certain luma values into transparency.
  20371. </p>
  20372. <p>The filter accepts the following options:
  20373. </p>
  20374. <dl class="table">
  20375. <dt><samp class="option">threshold</samp></dt>
  20376. <dd><p>Set the luma which will be used as base for transparency.
  20377. Default value is <code class="code">0</code>.
  20378. </p>
  20379. </dd>
  20380. <dt><samp class="option">tolerance</samp></dt>
  20381. <dd><p>Set the range of luma values to be keyed out.
  20382. Default value is <code class="code">0.01</code>.
  20383. </p>
  20384. </dd>
  20385. <dt><samp class="option">softness</samp></dt>
  20386. <dd><p>Set the range of softness. Default value is <code class="code">0</code>.
  20387. Use this to control gradual transition from zero to full transparency.
  20388. </p></dd>
  20389. </dl>
  20390. <a name="Commands-110"></a>
  20391. <h4 class="subsection">11.151.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-110" aria-hidden="true">TOC</a></span></h4>
  20392. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  20393. The command accepts the same syntax of the corresponding option.
  20394. </p>
  20395. <p>If the specified expression is not valid, it is kept at its current
  20396. value.
  20397. </p>
  20398. <a class="anchor" id="lutrgb"></a><a class="anchor" id="lutyuv"></a><a class="anchor" id="lut"></a><a name="lut_002c-lutrgb_002c-lutyuv"></a>
  20399. <h3 class="section">11.152 lut, lutrgb, lutyuv<span class="pull-right"><a class="anchor hidden-xs" href="#lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut_002c-lutrgb_002c-lutyuv" aria-hidden="true">TOC</a></span></h3>
  20400. <p>Compute a look-up table for binding each pixel component input value
  20401. to an output value, and apply it to the input video.
  20402. </p>
  20403. <p><var class="var">lutyuv</var> applies a lookup table to a YUV input video, <var class="var">lutrgb</var>
  20404. to an RGB input video.
  20405. </p>
  20406. <p>These filters accept the following parameters:
  20407. </p><dl class="table">
  20408. <dt><samp class="option">c0</samp></dt>
  20409. <dd><p>set first pixel component expression
  20410. </p></dd>
  20411. <dt><samp class="option">c1</samp></dt>
  20412. <dd><p>set second pixel component expression
  20413. </p></dd>
  20414. <dt><samp class="option">c2</samp></dt>
  20415. <dd><p>set third pixel component expression
  20416. </p></dd>
  20417. <dt><samp class="option">c3</samp></dt>
  20418. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  20419. </p>
  20420. </dd>
  20421. <dt><samp class="option">r</samp></dt>
  20422. <dd><p>set red component expression
  20423. </p></dd>
  20424. <dt><samp class="option">g</samp></dt>
  20425. <dd><p>set green component expression
  20426. </p></dd>
  20427. <dt><samp class="option">b</samp></dt>
  20428. <dd><p>set blue component expression
  20429. </p></dd>
  20430. <dt><samp class="option">a</samp></dt>
  20431. <dd><p>alpha component expression
  20432. </p>
  20433. </dd>
  20434. <dt><samp class="option">y</samp></dt>
  20435. <dd><p>set Y/luma component expression
  20436. </p></dd>
  20437. <dt><samp class="option">u</samp></dt>
  20438. <dd><p>set U/Cb component expression
  20439. </p></dd>
  20440. <dt><samp class="option">v</samp></dt>
  20441. <dd><p>set V/Cr component expression
  20442. </p></dd>
  20443. </dl>
  20444. <p>Each of them specifies the expression to use for computing the lookup table for
  20445. the corresponding pixel component values.
  20446. </p>
  20447. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  20448. format in input.
  20449. </p>
  20450. <p>The <var class="var">lut</var> filter requires either YUV or RGB pixel formats in input,
  20451. <var class="var">lutrgb</var> requires RGB pixel formats in input, and <var class="var">lutyuv</var> requires YUV.
  20452. </p>
  20453. <p>The expressions can contain the following constants and functions:
  20454. </p>
  20455. <dl class="table">
  20456. <dt><samp class="option">w</samp></dt>
  20457. <dt><samp class="option">h</samp></dt>
  20458. <dd><p>The input width and height.
  20459. </p>
  20460. </dd>
  20461. <dt><samp class="option">val</samp></dt>
  20462. <dd><p>The input value for the pixel component.
  20463. </p>
  20464. </dd>
  20465. <dt><samp class="option">clipval</samp></dt>
  20466. <dd><p>The input value, clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range.
  20467. </p>
  20468. </dd>
  20469. <dt><samp class="option">maxval</samp></dt>
  20470. <dd><p>The maximum value for the pixel component.
  20471. </p>
  20472. </dd>
  20473. <dt><samp class="option">minval</samp></dt>
  20474. <dd><p>The minimum value for the pixel component.
  20475. </p>
  20476. </dd>
  20477. <dt><samp class="option">negval</samp></dt>
  20478. <dd><p>The negated value for the pixel component value, clipped to the
  20479. <var class="var">minval</var>-<var class="var">maxval</var> range; it corresponds to the expression
  20480. &quot;maxval-clipval+minval&quot;.
  20481. </p>
  20482. </dd>
  20483. <dt><samp class="option">clip(val)</samp></dt>
  20484. <dd><p>The computed value in <var class="var">val</var>, clipped to the
  20485. <var class="var">minval</var>-<var class="var">maxval</var> range.
  20486. </p>
  20487. </dd>
  20488. <dt><samp class="option">gammaval(gamma)</samp></dt>
  20489. <dd><p>The computed gamma correction value of the pixel component value,
  20490. clipped to the <var class="var">minval</var>-<var class="var">maxval</var> range. It corresponds to the
  20491. expression
  20492. &quot;pow((clipval-minval)/(maxval-minval)\,<var class="var">gamma</var>)*(maxval-minval)+minval&quot;
  20493. </p>
  20494. </dd>
  20495. </dl>
  20496. <p>All expressions default to &quot;clipval&quot;.
  20497. </p>
  20498. <a name="Commands-111"></a>
  20499. <h4 class="subsection">11.152.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-111" aria-hidden="true">TOC</a></span></h4>
  20500. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  20501. </p>
  20502. <a name="Examples-95"></a>
  20503. <h4 class="subsection">11.152.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-95" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-95" aria-hidden="true">TOC</a></span></h4>
  20504. <ul class="itemize mark-bullet">
  20505. <li>Negate input video:
  20506. <div class="example">
  20507. <pre class="example-preformatted">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  20508. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  20509. </pre></div>
  20510. <p>The above is the same as:
  20511. </p><div class="example">
  20512. <pre class="example-preformatted">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  20513. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  20514. </pre></div>
  20515. </li><li>Negate luma:
  20516. <div class="example">
  20517. <pre class="example-preformatted">lutyuv=y=negval
  20518. </pre></div>
  20519. </li><li>Remove chroma components, turning the video into a graytone image:
  20520. <div class="example">
  20521. <pre class="example-preformatted">lutyuv=&quot;u=128:v=128&quot;
  20522. </pre></div>
  20523. </li><li>Apply a luma burning effect:
  20524. <div class="example">
  20525. <pre class="example-preformatted">lutyuv=&quot;y=2*val&quot;
  20526. </pre></div>
  20527. </li><li>Remove green and blue components:
  20528. <div class="example">
  20529. <pre class="example-preformatted">lutrgb=&quot;g=0:b=0&quot;
  20530. </pre></div>
  20531. </li><li>Set a constant alpha channel value on input:
  20532. <div class="example">
  20533. <pre class="example-preformatted">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  20534. </pre></div>
  20535. </li><li>Correct luma gamma by a factor of 0.5:
  20536. <div class="example">
  20537. <pre class="example-preformatted">lutyuv=y=gammaval(0.5)
  20538. </pre></div>
  20539. </li><li>Discard least significant bits of luma:
  20540. <div class="example">
  20541. <pre class="example-preformatted">lutyuv=y='bitand(val, 128+64+32)'
  20542. </pre></div>
  20543. </li><li>Technicolor like effect:
  20544. <div class="example">
  20545. <pre class="example-preformatted">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  20546. </pre></div>
  20547. </li></ul>
  20548. <a name="lut2_002c-tlut2"></a>
  20549. <h3 class="section">11.153 lut2, tlut2<span class="pull-right"><a class="anchor hidden-xs" href="#lut2_002c-tlut2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-lut2_002c-tlut2" aria-hidden="true">TOC</a></span></h3>
  20550. <p>The <code class="code">lut2</code> filter takes two input streams and outputs one
  20551. stream.
  20552. </p>
  20553. <p>The <code class="code">tlut2</code> (time lut2) filter takes two consecutive frames
  20554. from one single stream.
  20555. </p>
  20556. <p>This filter accepts the following parameters:
  20557. </p><dl class="table">
  20558. <dt><samp class="option">c0</samp></dt>
  20559. <dd><p>set first pixel component expression
  20560. </p></dd>
  20561. <dt><samp class="option">c1</samp></dt>
  20562. <dd><p>set second pixel component expression
  20563. </p></dd>
  20564. <dt><samp class="option">c2</samp></dt>
  20565. <dd><p>set third pixel component expression
  20566. </p></dd>
  20567. <dt><samp class="option">c3</samp></dt>
  20568. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  20569. </p>
  20570. </dd>
  20571. <dt><samp class="option">d</samp></dt>
  20572. <dd><p>set output bit depth, only available for <code class="code">lut2</code> filter. By default is 0,
  20573. which means bit depth is automatically picked from first input format.
  20574. </p></dd>
  20575. </dl>
  20576. <p>The <code class="code">lut2</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  20577. </p>
  20578. <p>Each of them specifies the expression to use for computing the lookup table for
  20579. the corresponding pixel component values.
  20580. </p>
  20581. <p>The exact component associated to each of the <var class="var">c*</var> options depends on the
  20582. format in inputs.
  20583. </p>
  20584. <p>The expressions can contain the following constants:
  20585. </p>
  20586. <dl class="table">
  20587. <dt><samp class="option">w</samp></dt>
  20588. <dt><samp class="option">h</samp></dt>
  20589. <dd><p>The input width and height.
  20590. </p>
  20591. </dd>
  20592. <dt><samp class="option">x</samp></dt>
  20593. <dd><p>The first input value for the pixel component.
  20594. </p>
  20595. </dd>
  20596. <dt><samp class="option">y</samp></dt>
  20597. <dd><p>The second input value for the pixel component.
  20598. </p>
  20599. </dd>
  20600. <dt><samp class="option">bdx</samp></dt>
  20601. <dd><p>The first input video bit depth.
  20602. </p>
  20603. </dd>
  20604. <dt><samp class="option">bdy</samp></dt>
  20605. <dd><p>The second input video bit depth.
  20606. </p></dd>
  20607. </dl>
  20608. <p>All expressions default to &quot;x&quot;.
  20609. </p>
  20610. <a name="Commands-112"></a>
  20611. <h4 class="subsection">11.153.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-112" aria-hidden="true">TOC</a></span></h4>
  20612. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a> except option <code class="code">d</code>.
  20613. </p>
  20614. <a name="Examples-96"></a>
  20615. <h4 class="subsection">11.153.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-96" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-96" aria-hidden="true">TOC</a></span></h4>
  20616. <ul class="itemize mark-bullet">
  20617. <li>Highlight differences between two RGB video streams:
  20618. <div class="example">
  20619. <pre class="example-preformatted">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)'
  20620. </pre></div>
  20621. </li><li>Highlight differences between two YUV video streams:
  20622. <div class="example">
  20623. <pre class="example-preformatted">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)'
  20624. </pre></div>
  20625. </li><li>Show max difference between two video streams:
  20626. <div class="example">
  20627. <pre class="example-preformatted">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)))'
  20628. </pre></div>
  20629. </li></ul>
  20630. <a name="maskedclamp"></a>
  20631. <h3 class="section">11.154 maskedclamp<span class="pull-right"><a class="anchor hidden-xs" href="#maskedclamp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedclamp" aria-hidden="true">TOC</a></span></h3>
  20632. <p>Clamp the first input stream with the second input and third input stream.
  20633. </p>
  20634. <p>Returns the value of first stream to be between second input
  20635. stream - <code class="code">undershoot</code> and third input stream + <code class="code">overshoot</code>.
  20636. </p>
  20637. <p>This filter accepts the following options:
  20638. </p><dl class="table">
  20639. <dt><samp class="option">undershoot</samp></dt>
  20640. <dd><p>Default value is <code class="code">0</code>.
  20641. </p>
  20642. </dd>
  20643. <dt><samp class="option">overshoot</samp></dt>
  20644. <dd><p>Default value is <code class="code">0</code>.
  20645. </p>
  20646. </dd>
  20647. <dt><samp class="option">planes</samp></dt>
  20648. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  20649. copied from first stream.
  20650. By default value 0xf, all planes will be processed.
  20651. </p></dd>
  20652. </dl>
  20653. <a name="Commands-113"></a>
  20654. <h4 class="subsection">11.154.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-113" aria-hidden="true">TOC</a></span></h4>
  20655. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20656. </p>
  20657. <a name="maskedmax"></a>
  20658. <h3 class="section">11.155 maskedmax<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmax" aria-hidden="true">TOC</a></span></h3>
  20659. <p>Merge the second and third input stream into output stream using absolute differences
  20660. between second input stream and first input stream and absolute difference between
  20661. third input stream and first input stream. The picked value will be from second input
  20662. stream if second absolute difference is greater than first one or from third input stream
  20663. otherwise.
  20664. </p>
  20665. <p>This filter accepts the following options:
  20666. </p><dl class="table">
  20667. <dt><samp class="option">planes</samp></dt>
  20668. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  20669. copied from first stream.
  20670. By default value 0xf, all planes will be processed.
  20671. </p></dd>
  20672. </dl>
  20673. <a name="Commands-114"></a>
  20674. <h4 class="subsection">11.155.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-114" aria-hidden="true">TOC</a></span></h4>
  20675. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20676. </p>
  20677. <a name="maskedmerge"></a>
  20678. <h3 class="section">11.156 maskedmerge<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmerge" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmerge" aria-hidden="true">TOC</a></span></h3>
  20679. <p>Merge the first input stream with the second input stream using per pixel
  20680. weights in the third input stream.
  20681. </p>
  20682. <p>A value of 0 in the third stream pixel component means that pixel component
  20683. from first stream is returned unchanged, while maximum value (eg. 255 for
  20684. 8-bit videos) means that pixel component from second stream is returned
  20685. unchanged. Intermediate values define the amount of merging between both
  20686. input stream&rsquo;s pixel components.
  20687. </p>
  20688. <p>This filter accepts the following options:
  20689. </p><dl class="table">
  20690. <dt><samp class="option">planes</samp></dt>
  20691. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  20692. copied from first stream.
  20693. By default value 0xf, all planes will be processed.
  20694. </p></dd>
  20695. </dl>
  20696. <a name="Commands-115"></a>
  20697. <h4 class="subsection">11.156.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-115" aria-hidden="true">TOC</a></span></h4>
  20698. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20699. </p>
  20700. <a name="maskedmin"></a>
  20701. <h3 class="section">11.157 maskedmin<span class="pull-right"><a class="anchor hidden-xs" href="#maskedmin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedmin" aria-hidden="true">TOC</a></span></h3>
  20702. <p>Merge the second and third input stream into output stream using absolute differences
  20703. between second input stream and first input stream and absolute difference between
  20704. third input stream and first input stream. The picked value will be from second input
  20705. stream if second absolute difference is less than first one or from third input stream
  20706. otherwise.
  20707. </p>
  20708. <p>This filter accepts the following options:
  20709. </p><dl class="table">
  20710. <dt><samp class="option">planes</samp></dt>
  20711. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  20712. copied from first stream.
  20713. By default value 0xf, all planes will be processed.
  20714. </p></dd>
  20715. </dl>
  20716. <a name="Commands-116"></a>
  20717. <h4 class="subsection">11.157.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-116" aria-hidden="true">TOC</a></span></h4>
  20718. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20719. </p>
  20720. <a name="maskedthreshold"></a>
  20721. <h3 class="section">11.158 maskedthreshold<span class="pull-right"><a class="anchor hidden-xs" href="#maskedthreshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskedthreshold" aria-hidden="true">TOC</a></span></h3>
  20722. <p>Pick pixels comparing absolute difference of two video streams with fixed
  20723. threshold.
  20724. </p>
  20725. <p>If absolute difference between pixel component of first and second video
  20726. stream is equal or lower than user supplied threshold than pixel component
  20727. from first video stream is picked, otherwise pixel component from second
  20728. video stream is picked.
  20729. </p>
  20730. <p>This filter accepts the following options:
  20731. </p><dl class="table">
  20732. <dt><samp class="option">threshold</samp></dt>
  20733. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  20734. video streams.
  20735. </p>
  20736. </dd>
  20737. <dt><samp class="option">planes</samp></dt>
  20738. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  20739. copied from second stream.
  20740. By default value 0xf, all planes will be processed.
  20741. </p>
  20742. </dd>
  20743. <dt><samp class="option">mode</samp></dt>
  20744. <dd><p>Set mode of filter operation. Can be <code class="code">abs</code> or <code class="code">diff</code>.
  20745. Default is <code class="code">abs</code>.
  20746. </p></dd>
  20747. </dl>
  20748. <a name="Commands-117"></a>
  20749. <h4 class="subsection">11.158.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-117" aria-hidden="true">TOC</a></span></h4>
  20750. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20751. </p>
  20752. <a name="maskfun"></a>
  20753. <h3 class="section">11.159 maskfun<span class="pull-right"><a class="anchor hidden-xs" href="#maskfun" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-maskfun" aria-hidden="true">TOC</a></span></h3>
  20754. <p>Create mask from input video.
  20755. </p>
  20756. <p>For example it is useful to create motion masks after <code class="code">tblend</code> filter.
  20757. </p>
  20758. <p>This filter accepts the following options:
  20759. </p>
  20760. <dl class="table">
  20761. <dt><samp class="option">low</samp></dt>
  20762. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  20763. </p>
  20764. </dd>
  20765. <dt><samp class="option">high</samp></dt>
  20766. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  20767. allowed for current pixel format.
  20768. </p>
  20769. </dd>
  20770. <dt><samp class="option">planes</samp></dt>
  20771. <dd><p>Set planes to filter, by default all available planes are filtered.
  20772. </p>
  20773. </dd>
  20774. <dt><samp class="option">fill</samp></dt>
  20775. <dd><p>Fill all frame pixels with this value.
  20776. </p>
  20777. </dd>
  20778. <dt><samp class="option">sum</samp></dt>
  20779. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  20780. average, output frame will be completely filled with value set by <var class="var">fill</var> option.
  20781. Typically useful for scene changes when used in combination with <code class="code">tblend</code> filter.
  20782. </p></dd>
  20783. </dl>
  20784. <a name="Commands-118"></a>
  20785. <h4 class="subsection">11.159.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-118" aria-hidden="true">TOC</a></span></h4>
  20786. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  20787. </p>
  20788. <a name="mcdeint"></a>
  20789. <h3 class="section">11.160 mcdeint<span class="pull-right"><a class="anchor hidden-xs" href="#mcdeint" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mcdeint" aria-hidden="true">TOC</a></span></h3>
  20790. <p>Apply motion-compensation deinterlacing.
  20791. </p>
  20792. <p>It needs one field per frame as input and must thus be used together
  20793. with yadif=1/3 or equivalent.
  20794. </p>
  20795. <p>This filter accepts the following options:
  20796. </p><dl class="table">
  20797. <dt><samp class="option">mode</samp></dt>
  20798. <dd><p>Set the deinterlacing mode.
  20799. </p>
  20800. <p>It accepts one of the following values:
  20801. </p><dl class="table">
  20802. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  20803. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  20804. <dt>&lsquo;<samp class="samp">slow</samp>&rsquo;</dt>
  20805. <dd><p>use iterative motion estimation
  20806. </p></dd>
  20807. <dt>&lsquo;<samp class="samp">extra_slow</samp>&rsquo;</dt>
  20808. <dd><p>like &lsquo;<samp class="samp">slow</samp>&rsquo;, but use multiple reference frames.
  20809. </p></dd>
  20810. </dl>
  20811. <p>Default value is &lsquo;<samp class="samp">fast</samp>&rsquo;.
  20812. </p>
  20813. </dd>
  20814. <dt><samp class="option">parity</samp></dt>
  20815. <dd><p>Set the picture field parity assumed for the input video. It must be
  20816. one of the following values:
  20817. </p>
  20818. <dl class="table">
  20819. <dt>&lsquo;<samp class="samp">0, tff</samp>&rsquo;</dt>
  20820. <dd><p>assume top field first
  20821. </p></dd>
  20822. <dt>&lsquo;<samp class="samp">1, bff</samp>&rsquo;</dt>
  20823. <dd><p>assume bottom field first
  20824. </p></dd>
  20825. </dl>
  20826. <p>Default value is &lsquo;<samp class="samp">bff</samp>&rsquo;.
  20827. </p>
  20828. </dd>
  20829. <dt><samp class="option">qp</samp></dt>
  20830. <dd><p>Set per-block quantization parameter (QP) used by the internal
  20831. encoder.
  20832. </p>
  20833. <p>Higher values should result in a smoother motion vector field but less
  20834. optimal individual vectors. Default value is 1.
  20835. </p></dd>
  20836. </dl>
  20837. <a name="median"></a>
  20838. <h3 class="section">11.161 median<span class="pull-right"><a class="anchor hidden-xs" href="#median" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-median" aria-hidden="true">TOC</a></span></h3>
  20839. <p>Pick median pixel from certain rectangle defined by radius.
  20840. </p>
  20841. <p>This filter accepts the following options:
  20842. </p>
  20843. <dl class="table">
  20844. <dt><samp class="option">radius</samp></dt>
  20845. <dd><p>Set horizontal radius size. Default value is <code class="code">1</code>.
  20846. Allowed range is integer from 1 to 127.
  20847. </p>
  20848. </dd>
  20849. <dt><samp class="option">planes</samp></dt>
  20850. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  20851. </p>
  20852. </dd>
  20853. <dt><samp class="option">radiusV</samp></dt>
  20854. <dd><p>Set vertical radius size. Default value is <code class="code">0</code>.
  20855. Allowed range is integer from 0 to 127.
  20856. If it is 0, value will be picked from horizontal <code class="code">radius</code> option.
  20857. </p>
  20858. </dd>
  20859. <dt><samp class="option">percentile</samp></dt>
  20860. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  20861. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  20862. minimum values, and <code class="code">1</code> maximum values.
  20863. </p></dd>
  20864. </dl>
  20865. <a name="Commands-119"></a>
  20866. <h4 class="subsection">11.161.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-119" aria-hidden="true">TOC</a></span></h4>
  20867. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  20868. The command accepts the same syntax of the corresponding option.
  20869. </p>
  20870. <p>If the specified expression is not valid, it is kept at its current
  20871. value.
  20872. </p>
  20873. <a name="mergeplanes"></a>
  20874. <h3 class="section">11.162 mergeplanes<span class="pull-right"><a class="anchor hidden-xs" href="#mergeplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mergeplanes" aria-hidden="true">TOC</a></span></h3>
  20875. <p>Merge color channel components from several video streams.
  20876. </p>
  20877. <p>The filter accepts up to 4 input streams, and merge selected input
  20878. planes to the output video.
  20879. </p>
  20880. <p>This filter accepts the following options:
  20881. </p><dl class="table">
  20882. <dt><samp class="option">mapping</samp></dt>
  20883. <dd><p>Set input to output plane mapping. Default is <code class="code">0</code>.
  20884. </p>
  20885. <p>The mappings is specified as a bitmap. It should be specified as a
  20886. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  20887. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  20888. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  20889. corresponding input to use (from 0 to 3). The rest of the mappings is
  20890. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  20891. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  20892. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  20893. </p>
  20894. </dd>
  20895. <dt><samp class="option">format</samp></dt>
  20896. <dd><p>Set output pixel format. Default is <code class="code">yuva444p</code>.
  20897. </p>
  20898. </dd>
  20899. <dt><samp class="option">map0s</samp></dt>
  20900. <dt><samp class="option">map1s</samp></dt>
  20901. <dt><samp class="option">map2s</samp></dt>
  20902. <dt><samp class="option">map3s</samp></dt>
  20903. <dd><p>Set input to output stream mapping for output Nth plane. Default is <code class="code">0</code>.
  20904. </p>
  20905. </dd>
  20906. <dt><samp class="option">map0p</samp></dt>
  20907. <dt><samp class="option">map1p</samp></dt>
  20908. <dt><samp class="option">map2p</samp></dt>
  20909. <dt><samp class="option">map3p</samp></dt>
  20910. <dd><p>Set input to output plane mapping for output Nth plane. Default is <code class="code">0</code>.
  20911. </p></dd>
  20912. </dl>
  20913. <a name="Examples-97"></a>
  20914. <h4 class="subsection">11.162.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-97" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-97" aria-hidden="true">TOC</a></span></h4>
  20915. <ul class="itemize mark-bullet">
  20916. <li>Merge three gray video streams of same width and height into single video stream:
  20917. <div class="example">
  20918. <pre class="example-preformatted">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  20919. </pre></div>
  20920. </li><li>Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  20921. <div class="example">
  20922. <pre class="example-preformatted">[a0][a1]mergeplanes=0x00010210:yuva444p
  20923. </pre></div>
  20924. </li><li>Swap Y and A plane in yuva444p stream:
  20925. <div class="example">
  20926. <pre class="example-preformatted">format=yuva444p,mergeplanes=0x03010200:yuva444p
  20927. </pre></div>
  20928. </li><li>Swap U and V plane in yuv420p stream:
  20929. <div class="example">
  20930. <pre class="example-preformatted">format=yuv420p,mergeplanes=0x000201:yuv420p
  20931. </pre></div>
  20932. </li><li>Cast a rgb24 clip to yuv444p:
  20933. <div class="example">
  20934. <pre class="example-preformatted">format=rgb24,mergeplanes=0x000102:yuv444p
  20935. </pre></div>
  20936. </li></ul>
  20937. <a name="mestimate"></a>
  20938. <h3 class="section">11.163 mestimate<span class="pull-right"><a class="anchor hidden-xs" href="#mestimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mestimate" aria-hidden="true">TOC</a></span></h3>
  20939. <p>Estimate and export motion vectors using block matching algorithms.
  20940. Motion vectors are stored in frame side data to be used by other filters.
  20941. </p>
  20942. <p>This filter accepts the following options:
  20943. </p><dl class="table">
  20944. <dt><samp class="option">method</samp></dt>
  20945. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  20946. </p>
  20947. <dl class="table">
  20948. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  20949. <dd><p>Exhaustive search algorithm.
  20950. </p></dd>
  20951. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  20952. <dd><p>Three step search algorithm.
  20953. </p></dd>
  20954. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  20955. <dd><p>Two dimensional logarithmic search algorithm.
  20956. </p></dd>
  20957. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  20958. <dd><p>New three step search algorithm.
  20959. </p></dd>
  20960. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  20961. <dd><p>Four step search algorithm.
  20962. </p></dd>
  20963. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  20964. <dd><p>Diamond search algorithm.
  20965. </p></dd>
  20966. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  20967. <dd><p>Hexagon-based search algorithm.
  20968. </p></dd>
  20969. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  20970. <dd><p>Enhanced predictive zonal search algorithm.
  20971. </p></dd>
  20972. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  20973. <dd><p>Uneven multi-hexagon search algorithm.
  20974. </p></dd>
  20975. </dl>
  20976. <p>Default value is &lsquo;<samp class="samp">esa</samp>&rsquo;.
  20977. </p>
  20978. </dd>
  20979. <dt><samp class="option">mb_size</samp></dt>
  20980. <dd><p>Macroblock size. Default <code class="code">16</code>.
  20981. </p>
  20982. </dd>
  20983. <dt><samp class="option">search_param</samp></dt>
  20984. <dd><p>Search parameter. Default <code class="code">7</code>.
  20985. </p></dd>
  20986. </dl>
  20987. <a name="midequalizer"></a>
  20988. <h3 class="section">11.164 midequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#midequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-midequalizer" aria-hidden="true">TOC</a></span></h3>
  20989. <p>Apply Midway Image Equalization effect using two video streams.
  20990. </p>
  20991. <p>Midway Image Equalization adjusts a pair of images to have the same
  20992. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  20993. useful for e.g. matching exposures from a pair of stereo cameras.
  20994. </p>
  20995. <p>This filter has two inputs and one output, which must be of same pixel format, but
  20996. may be of different sizes. The output of filter is first input adjusted with
  20997. midway histogram of both inputs.
  20998. </p>
  20999. <p>This filter accepts the following option:
  21000. </p>
  21001. <dl class="table">
  21002. <dt><samp class="option">planes</samp></dt>
  21003. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  21004. </p></dd>
  21005. </dl>
  21006. <a name="minterpolate"></a>
  21007. <h3 class="section">11.165 minterpolate<span class="pull-right"><a class="anchor hidden-xs" href="#minterpolate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-minterpolate" aria-hidden="true">TOC</a></span></h3>
  21008. <p>Convert the video to specified frame rate using motion interpolation.
  21009. </p>
  21010. <p>This filter accepts the following options:
  21011. </p><dl class="table">
  21012. <dt><samp class="option">fps</samp></dt>
  21013. <dd><p>Specify the output frame rate. This can be rational e.g. <code class="code">60000/1001</code>. Frames are dropped if <var class="var">fps</var> is lower than source fps. Default <code class="code">60</code>.
  21014. </p>
  21015. </dd>
  21016. <dt><samp class="option">mi_mode</samp></dt>
  21017. <dd><p>Motion interpolation mode. Following values are accepted:
  21018. </p><dl class="table">
  21019. <dt>&lsquo;<samp class="samp">dup</samp>&rsquo;</dt>
  21020. <dd><p>Duplicate previous or next frame for interpolating new ones.
  21021. </p></dd>
  21022. <dt>&lsquo;<samp class="samp">blend</samp>&rsquo;</dt>
  21023. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  21024. </p></dd>
  21025. <dt>&lsquo;<samp class="samp">mci</samp>&rsquo;</dt>
  21026. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  21027. </p>
  21028. <dl class="table">
  21029. <dt>&lsquo;<samp class="samp">mc_mode</samp>&rsquo;</dt>
  21030. <dd><p>Motion compensation mode. Following values are accepted:
  21031. </p><dl class="table">
  21032. <dt>&lsquo;<samp class="samp">obmc</samp>&rsquo;</dt>
  21033. <dd><p>Overlapped block motion compensation.
  21034. </p></dd>
  21035. <dt>&lsquo;<samp class="samp">aobmc</samp>&rsquo;</dt>
  21036. <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.
  21037. </p></dd>
  21038. </dl>
  21039. <p>Default mode is &lsquo;<samp class="samp">obmc</samp>&rsquo;.
  21040. </p>
  21041. </dd>
  21042. <dt>&lsquo;<samp class="samp">me_mode</samp>&rsquo;</dt>
  21043. <dd><p>Motion estimation mode. Following values are accepted:
  21044. </p><dl class="table">
  21045. <dt>&lsquo;<samp class="samp">bidir</samp>&rsquo;</dt>
  21046. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  21047. </p></dd>
  21048. <dt>&lsquo;<samp class="samp">bilat</samp>&rsquo;</dt>
  21049. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  21050. </p></dd>
  21051. </dl>
  21052. <p>Default mode is &lsquo;<samp class="samp">bilat</samp>&rsquo;.
  21053. </p>
  21054. </dd>
  21055. <dt>&lsquo;<samp class="samp">me</samp>&rsquo;</dt>
  21056. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  21057. </p><dl class="table">
  21058. <dt>&lsquo;<samp class="samp">esa</samp>&rsquo;</dt>
  21059. <dd><p>Exhaustive search algorithm.
  21060. </p></dd>
  21061. <dt>&lsquo;<samp class="samp">tss</samp>&rsquo;</dt>
  21062. <dd><p>Three step search algorithm.
  21063. </p></dd>
  21064. <dt>&lsquo;<samp class="samp">tdls</samp>&rsquo;</dt>
  21065. <dd><p>Two dimensional logarithmic search algorithm.
  21066. </p></dd>
  21067. <dt>&lsquo;<samp class="samp">ntss</samp>&rsquo;</dt>
  21068. <dd><p>New three step search algorithm.
  21069. </p></dd>
  21070. <dt>&lsquo;<samp class="samp">fss</samp>&rsquo;</dt>
  21071. <dd><p>Four step search algorithm.
  21072. </p></dd>
  21073. <dt>&lsquo;<samp class="samp">ds</samp>&rsquo;</dt>
  21074. <dd><p>Diamond search algorithm.
  21075. </p></dd>
  21076. <dt>&lsquo;<samp class="samp">hexbs</samp>&rsquo;</dt>
  21077. <dd><p>Hexagon-based search algorithm.
  21078. </p></dd>
  21079. <dt>&lsquo;<samp class="samp">epzs</samp>&rsquo;</dt>
  21080. <dd><p>Enhanced predictive zonal search algorithm.
  21081. </p></dd>
  21082. <dt>&lsquo;<samp class="samp">umh</samp>&rsquo;</dt>
  21083. <dd><p>Uneven multi-hexagon search algorithm.
  21084. </p></dd>
  21085. </dl>
  21086. <p>Default algorithm is &lsquo;<samp class="samp">epzs</samp>&rsquo;.
  21087. </p>
  21088. </dd>
  21089. <dt>&lsquo;<samp class="samp">mb_size</samp>&rsquo;</dt>
  21090. <dd><p>Macroblock size. Default <code class="code">16</code>.
  21091. </p>
  21092. </dd>
  21093. <dt>&lsquo;<samp class="samp">search_param</samp>&rsquo;</dt>
  21094. <dd><p>Motion estimation search parameter. Default <code class="code">32</code>.
  21095. </p>
  21096. </dd>
  21097. <dt>&lsquo;<samp class="samp">vsbmc</samp>&rsquo;</dt>
  21098. <dd><p>Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make them less blurry. Default is <code class="code">0</code> (disabled).
  21099. </p></dd>
  21100. </dl>
  21101. </dd>
  21102. </dl>
  21103. </dd>
  21104. <dt><samp class="option">scd</samp></dt>
  21105. <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:
  21106. </p><dl class="table">
  21107. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  21108. <dd><p>Disable scene change detection.
  21109. </p></dd>
  21110. <dt>&lsquo;<samp class="samp">fdiff</samp>&rsquo;</dt>
  21111. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var class="var">scd_threshold</var> scene change is detected.
  21112. </p></dd>
  21113. </dl>
  21114. <p>Default method is &lsquo;<samp class="samp">fdiff</samp>&rsquo;.
  21115. </p>
  21116. </dd>
  21117. <dt><samp class="option">scd_threshold</samp></dt>
  21118. <dd><p>Scene change detection threshold. Default is <code class="code">10.</code>.
  21119. </p></dd>
  21120. </dl>
  21121. <a name="mix"></a>
  21122. <h3 class="section">11.166 mix<span class="pull-right"><a class="anchor hidden-xs" href="#mix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mix" aria-hidden="true">TOC</a></span></h3>
  21123. <p>Mix several video input streams into one video stream.
  21124. </p>
  21125. <p>A description of the accepted options follows.
  21126. </p>
  21127. <dl class="table">
  21128. <dt><samp class="option">inputs</samp></dt>
  21129. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  21130. </p>
  21131. </dd>
  21132. <dt><samp class="option">weights</samp></dt>
  21133. <dd><p>Specify weight of each input video stream as sequence.
  21134. Each weight is separated by space. If number of weights
  21135. is smaller than number of <var class="var">frames</var> last specified
  21136. weight will be used for all remaining unset weights.
  21137. </p>
  21138. </dd>
  21139. <dt><samp class="option">scale</samp></dt>
  21140. <dd><p>Specify scale, if it is set it will be multiplied with sum
  21141. of each weight multiplied with pixel values to give final destination
  21142. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  21143. </p>
  21144. </dd>
  21145. <dt><samp class="option">planes</samp></dt>
  21146. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  21147. </p>
  21148. </dd>
  21149. <dt><samp class="option">duration</samp></dt>
  21150. <dd><p>Specify how end of stream is determined.
  21151. </p><dl class="table">
  21152. <dt>&lsquo;<samp class="samp">longest</samp>&rsquo;</dt>
  21153. <dd><p>The duration of the longest input. (default)
  21154. </p>
  21155. </dd>
  21156. <dt>&lsquo;<samp class="samp">shortest</samp>&rsquo;</dt>
  21157. <dd><p>The duration of the shortest input.
  21158. </p>
  21159. </dd>
  21160. <dt>&lsquo;<samp class="samp">first</samp>&rsquo;</dt>
  21161. <dd><p>The duration of the first input.
  21162. </p></dd>
  21163. </dl>
  21164. </dd>
  21165. </dl>
  21166. <a name="Commands-120"></a>
  21167. <h4 class="subsection">11.166.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-120" aria-hidden="true">TOC</a></span></h4>
  21168. <p>This filter supports the following commands:
  21169. </p><dl class="table">
  21170. <dt><samp class="option">weights</samp></dt>
  21171. <dt><samp class="option">scale</samp></dt>
  21172. <dt><samp class="option">planes</samp></dt>
  21173. <dd><p>Syntax is same as option with same name.
  21174. </p></dd>
  21175. </dl>
  21176. <a name="monochrome"></a>
  21177. <h3 class="section">11.167 monochrome<span class="pull-right"><a class="anchor hidden-xs" href="#monochrome" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-monochrome" aria-hidden="true">TOC</a></span></h3>
  21178. <p>Convert video to gray using custom color filter.
  21179. </p>
  21180. <p>A description of the accepted options follows.
  21181. </p>
  21182. <dl class="table">
  21183. <dt><samp class="option">cb</samp></dt>
  21184. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  21185. Default value is 0.
  21186. </p>
  21187. </dd>
  21188. <dt><samp class="option">cr</samp></dt>
  21189. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  21190. Default value is 0.
  21191. </p>
  21192. </dd>
  21193. <dt><samp class="option">size</samp></dt>
  21194. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  21195. Default value is 1.
  21196. </p>
  21197. </dd>
  21198. <dt><samp class="option">high</samp></dt>
  21199. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  21200. Default value is 0.
  21201. </p></dd>
  21202. </dl>
  21203. <a name="Commands-121"></a>
  21204. <h4 class="subsection">11.167.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-121" aria-hidden="true">TOC</a></span></h4>
  21205. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  21206. </p>
  21207. <a name="morpho"></a>
  21208. <h3 class="section">11.168 morpho<span class="pull-right"><a class="anchor hidden-xs" href="#morpho" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-morpho" aria-hidden="true">TOC</a></span></h3>
  21209. <p>This filter allows to apply main morphological grayscale transforms,
  21210. erode and dilate with arbitrary structures set in second input stream.
  21211. </p>
  21212. <p>Unlike naive implementation and much slower performance in <a class="ref" href="#erosion">erosion</a>
  21213. and <a class="ref" href="#dilation">dilation</a> filters, when speed is critical <code class="code">morpho</code> filter
  21214. should be used instead.
  21215. </p>
  21216. <p>A description of accepted options follows,
  21217. </p>
  21218. <dl class="table">
  21219. <dt><samp class="option">mode</samp></dt>
  21220. <dd><p>Set morphological transform to apply, can be:
  21221. </p>
  21222. <dl class="table">
  21223. <dt>&lsquo;<samp class="samp">erode</samp>&rsquo;</dt>
  21224. <dt>&lsquo;<samp class="samp">dilate</samp>&rsquo;</dt>
  21225. <dt>&lsquo;<samp class="samp">open</samp>&rsquo;</dt>
  21226. <dt>&lsquo;<samp class="samp">close</samp>&rsquo;</dt>
  21227. <dt>&lsquo;<samp class="samp">gradient</samp>&rsquo;</dt>
  21228. <dt>&lsquo;<samp class="samp">tophat</samp>&rsquo;</dt>
  21229. <dt>&lsquo;<samp class="samp">blackhat</samp>&rsquo;</dt>
  21230. </dl>
  21231. <p>Default is <code class="code">erode</code>.
  21232. </p>
  21233. </dd>
  21234. <dt><samp class="option">planes</samp></dt>
  21235. <dd><p>Set planes to filter, by default all planes except alpha are filtered.
  21236. </p>
  21237. </dd>
  21238. <dt><samp class="option">structure</samp></dt>
  21239. <dd><p>Set which structure video frames will be processed from second input stream,
  21240. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  21241. </p></dd>
  21242. </dl>
  21243. <p>The <code class="code">morpho</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  21244. </p>
  21245. <a name="Commands-122"></a>
  21246. <h4 class="subsection">11.168.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-122" aria-hidden="true">TOC</a></span></h4>
  21247. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  21248. </p>
  21249. <a name="mpdecimate"></a>
  21250. <h3 class="section">11.169 mpdecimate<span class="pull-right"><a class="anchor hidden-xs" href="#mpdecimate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mpdecimate" aria-hidden="true">TOC</a></span></h3>
  21251. <p>Drop frames that do not differ greatly from the previous frame in
  21252. order to reduce frame rate.
  21253. </p>
  21254. <p>The main use of this filter is for very-low-bitrate encoding
  21255. (e.g. streaming over dialup modem), but it could in theory be used for
  21256. fixing movies that were inverse-telecined incorrectly.
  21257. </p>
  21258. <p>A description of the accepted options follows.
  21259. </p>
  21260. <dl class="table">
  21261. <dt><samp class="option">max</samp></dt>
  21262. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  21263. positive), or the minimum interval between dropped frames (if
  21264. negative). If the value is 0, the frame is dropped disregarding the
  21265. number of previous sequentially dropped frames.
  21266. </p>
  21267. <p>Default value is 0.
  21268. </p>
  21269. </dd>
  21270. <dt><samp class="option">keep</samp></dt>
  21271. <dd><p>Set the maximum number of consecutive similar frames to ignore before to start dropping them.
  21272. If the value is 0, the frame is dropped disregarding the
  21273. number of previous sequentially similar frames.
  21274. </p>
  21275. <p>Default value is 0.
  21276. </p>
  21277. </dd>
  21278. <dt><samp class="option">hi</samp></dt>
  21279. <dt><samp class="option">lo</samp></dt>
  21280. <dt><samp class="option">frac</samp></dt>
  21281. <dd><p>Set the dropping threshold values.
  21282. </p>
  21283. <p>Values for <samp class="option">hi</samp> and <samp class="option">lo</samp> are for 8x8 pixel blocks and
  21284. represent actual pixel value differences, so a threshold of 64
  21285. corresponds to 1 unit of difference for each pixel, or the same spread
  21286. out differently over the block.
  21287. </p>
  21288. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  21289. than a threshold of <samp class="option">hi</samp>, and if no more than <samp class="option">frac</samp> blocks (1
  21290. meaning the whole image) differ by more than a threshold of <samp class="option">lo</samp>.
  21291. </p>
  21292. <p>Default value for <samp class="option">hi</samp> is 64*12, default value for <samp class="option">lo</samp> is
  21293. 64*5, and default value for <samp class="option">frac</samp> is 0.33.
  21294. </p></dd>
  21295. </dl>
  21296. <a name="msad"></a>
  21297. <h3 class="section">11.170 msad<span class="pull-right"><a class="anchor hidden-xs" href="#msad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-msad" aria-hidden="true">TOC</a></span></h3>
  21298. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  21299. </p>
  21300. <p>This filter takes two input videos.
  21301. </p>
  21302. <p>Both input videos must have the same resolution and pixel format for
  21303. this filter to work correctly. Also it assumes that both inputs
  21304. have the same number of frames, which are compared one by one.
  21305. </p>
  21306. <p>The obtained per component, average, min and max MSAD is printed through
  21307. the logging system.
  21308. </p>
  21309. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  21310. </p>
  21311. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  21312. </p>
  21313. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  21314. with the reference file <samp class="file">ref.mpg</samp>.
  21315. </p>
  21316. <div class="example">
  21317. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  21318. </pre></div>
  21319. <a name="multiply"></a>
  21320. <h3 class="section">11.171 multiply<span class="pull-right"><a class="anchor hidden-xs" href="#multiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-multiply" aria-hidden="true">TOC</a></span></h3>
  21321. <p>Multiply first video stream pixels values with second video stream pixels values.
  21322. </p>
  21323. <p>The filter accepts the following options:
  21324. </p>
  21325. <dl class="table">
  21326. <dt><samp class="option">scale</samp></dt>
  21327. <dd><p>Set the scale applied to second video stream. By default is <code class="code">1</code>.
  21328. Allowed range is from <code class="code">0</code> to <code class="code">9</code>.
  21329. </p>
  21330. </dd>
  21331. <dt><samp class="option">offset</samp></dt>
  21332. <dd><p>Set the offset applied to second video stream. By default is <code class="code">0.5</code>.
  21333. Allowed range is from <code class="code">-1</code> to <code class="code">1</code>.
  21334. </p>
  21335. </dd>
  21336. <dt><samp class="option">planes</samp></dt>
  21337. <dd><p>Specify planes from input video stream that will be processed.
  21338. By default all planes are processed.
  21339. </p></dd>
  21340. </dl>
  21341. <a name="Commands-123"></a>
  21342. <h4 class="subsection">11.171.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-123" aria-hidden="true">TOC</a></span></h4>
  21343. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  21344. </p>
  21345. <a name="negate"></a>
  21346. <h3 class="section">11.172 negate<span class="pull-right"><a class="anchor hidden-xs" href="#negate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-negate" aria-hidden="true">TOC</a></span></h3>
  21347. <p>Negate (invert) the input video.
  21348. </p>
  21349. <p>It accepts the following option:
  21350. </p>
  21351. <dl class="table">
  21352. <dt><samp class="option">components</samp></dt>
  21353. <dd><p>Set components to negate.
  21354. </p>
  21355. <p>Available values for components are:
  21356. </p><dl class="table">
  21357. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  21358. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  21359. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  21360. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  21361. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  21362. <dt>&lsquo;<samp class="samp">g</samp>&rsquo;</dt>
  21363. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  21364. </dl>
  21365. </dd>
  21366. <dt><samp class="option">negate_alpha</samp></dt>
  21367. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  21368. </p></dd>
  21369. </dl>
  21370. <a name="Commands-124"></a>
  21371. <h4 class="subsection">11.172.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-124" aria-hidden="true">TOC</a></span></h4>
  21372. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  21373. </p>
  21374. <a class="anchor" id="nlmeans"></a><a name="nlmeans-1"></a>
  21375. <h3 class="section">11.173 nlmeans<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans-1" aria-hidden="true">TOC</a></span></h3>
  21376. <p>Denoise frames using Non-Local Means algorithm.
  21377. </p>
  21378. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  21379. context similarity is defined by comparing their surrounding patches of size
  21380. <samp class="option">p</samp>x<samp class="option">p</samp>. Patches are searched in an area of <samp class="option">r</samp>x<samp class="option">r</samp>
  21381. around the pixel.
  21382. </p>
  21383. <p>Note that the research area defines centers for patches, which means some
  21384. patches will be made of pixels outside that research area.
  21385. </p>
  21386. <p>The filter accepts the following options.
  21387. </p>
  21388. <dl class="table">
  21389. <dt><samp class="option">s</samp></dt>
  21390. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  21391. </p>
  21392. </dd>
  21393. <dt><samp class="option">p</samp></dt>
  21394. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  21395. </p>
  21396. </dd>
  21397. <dt><samp class="option">pc</samp></dt>
  21398. <dd><p>Same as <samp class="option">p</samp> but for chroma planes.
  21399. </p>
  21400. <p>The default value is <var class="var">0</var> and means automatic.
  21401. </p>
  21402. </dd>
  21403. <dt><samp class="option">r</samp></dt>
  21404. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  21405. </p>
  21406. </dd>
  21407. <dt><samp class="option">rc</samp></dt>
  21408. <dd><p>Same as <samp class="option">r</samp> but for chroma planes.
  21409. </p>
  21410. <p>The default value is <var class="var">0</var> and means automatic.
  21411. </p></dd>
  21412. </dl>
  21413. <a name="nnedi"></a>
  21414. <h3 class="section">11.174 nnedi<span class="pull-right"><a class="anchor hidden-xs" href="#nnedi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nnedi" aria-hidden="true">TOC</a></span></h3>
  21415. <p>Deinterlace video using neural network edge directed interpolation.
  21416. </p>
  21417. <p>This filter accepts the following options:
  21418. </p>
  21419. <dl class="table">
  21420. <dt><samp class="option">weights</samp></dt>
  21421. <dd><p>Mandatory option, without binary file filter can not work.
  21422. Currently file can be found here:
  21423. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  21424. </p>
  21425. </dd>
  21426. <dt><samp class="option">deint</samp></dt>
  21427. <dd><p>Set which frames to deinterlace, by default it is <code class="code">all</code>.
  21428. Can be <code class="code">all</code> or <code class="code">interlaced</code>.
  21429. </p>
  21430. </dd>
  21431. <dt><samp class="option">field</samp></dt>
  21432. <dd><p>Set mode of operation.
  21433. </p>
  21434. <p>Can be one of the following:
  21435. </p>
  21436. <dl class="table">
  21437. <dt>&lsquo;<samp class="samp">af</samp>&rsquo;</dt>
  21438. <dd><p>Use frame flags, both fields.
  21439. </p></dd>
  21440. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  21441. <dd><p>Use frame flags, single field.
  21442. </p></dd>
  21443. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  21444. <dd><p>Use top field only.
  21445. </p></dd>
  21446. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  21447. <dd><p>Use bottom field only.
  21448. </p></dd>
  21449. <dt>&lsquo;<samp class="samp">tf</samp>&rsquo;</dt>
  21450. <dd><p>Use both fields, top first.
  21451. </p></dd>
  21452. <dt>&lsquo;<samp class="samp">bf</samp>&rsquo;</dt>
  21453. <dd><p>Use both fields, bottom first.
  21454. </p></dd>
  21455. </dl>
  21456. </dd>
  21457. <dt><samp class="option">planes</samp></dt>
  21458. <dd><p>Set which planes to process, by default filter process all frames.
  21459. </p>
  21460. </dd>
  21461. <dt><samp class="option">nsize</samp></dt>
  21462. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  21463. network.
  21464. </p>
  21465. <p>Can be one of the following:
  21466. </p>
  21467. <dl class="table">
  21468. <dt>&lsquo;<samp class="samp">s8x6</samp>&rsquo;</dt>
  21469. <dt>&lsquo;<samp class="samp">s16x6</samp>&rsquo;</dt>
  21470. <dt>&lsquo;<samp class="samp">s32x6</samp>&rsquo;</dt>
  21471. <dt>&lsquo;<samp class="samp">s48x6</samp>&rsquo;</dt>
  21472. <dt>&lsquo;<samp class="samp">s8x4</samp>&rsquo;</dt>
  21473. <dt>&lsquo;<samp class="samp">s16x4</samp>&rsquo;</dt>
  21474. <dt>&lsquo;<samp class="samp">s32x4</samp>&rsquo;</dt>
  21475. </dl>
  21476. </dd>
  21477. <dt><samp class="option">nns</samp></dt>
  21478. <dd><p>Set the number of neurons in predictor neural network.
  21479. Can be one of the following:
  21480. </p>
  21481. <dl class="table">
  21482. <dt>&lsquo;<samp class="samp">n16</samp>&rsquo;</dt>
  21483. <dt>&lsquo;<samp class="samp">n32</samp>&rsquo;</dt>
  21484. <dt>&lsquo;<samp class="samp">n64</samp>&rsquo;</dt>
  21485. <dt>&lsquo;<samp class="samp">n128</samp>&rsquo;</dt>
  21486. <dt>&lsquo;<samp class="samp">n256</samp>&rsquo;</dt>
  21487. </dl>
  21488. </dd>
  21489. <dt><samp class="option">qual</samp></dt>
  21490. <dd><p>Controls the number of different neural network predictions that are blended
  21491. together to compute the final output value. Can be <code class="code">fast</code>, default or
  21492. <code class="code">slow</code>.
  21493. </p>
  21494. </dd>
  21495. <dt><samp class="option">etype</samp></dt>
  21496. <dd><p>Set which set of weights to use in the predictor.
  21497. Can be one of the following:
  21498. </p>
  21499. <dl class="table">
  21500. <dt>&lsquo;<samp class="samp">a, abs</samp>&rsquo;</dt>
  21501. <dd><p>weights trained to minimize absolute error
  21502. </p></dd>
  21503. <dt>&lsquo;<samp class="samp">s, mse</samp>&rsquo;</dt>
  21504. <dd><p>weights trained to minimize squared error
  21505. </p></dd>
  21506. </dl>
  21507. </dd>
  21508. <dt><samp class="option">pscrn</samp></dt>
  21509. <dd><p>Controls whether or not the prescreener neural network is used to decide
  21510. which pixels should be processed by the predictor neural network and which
  21511. can be handled by simple cubic interpolation.
  21512. The prescreener is trained to know whether cubic interpolation will be
  21513. sufficient for a pixel or whether it should be predicted by the predictor nn.
  21514. The computational complexity of the prescreener nn is much less than that of
  21515. the predictor nn. Since most pixels can be handled by cubic interpolation,
  21516. using the prescreener generally results in much faster processing.
  21517. The prescreener is pretty accurate, so the difference between using it and not
  21518. using it is almost always unnoticeable.
  21519. </p>
  21520. <p>Can be one of the following:
  21521. </p>
  21522. <dl class="table">
  21523. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  21524. <dt>&lsquo;<samp class="samp">original</samp>&rsquo;</dt>
  21525. <dt>&lsquo;<samp class="samp">new</samp>&rsquo;</dt>
  21526. <dt>&lsquo;<samp class="samp">new2</samp>&rsquo;</dt>
  21527. <dt>&lsquo;<samp class="samp">new3</samp>&rsquo;</dt>
  21528. </dl>
  21529. <p>Default is <code class="code">new</code>.
  21530. </p></dd>
  21531. </dl>
  21532. <a name="Commands-125"></a>
  21533. <h4 class="subsection">11.174.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-125" aria-hidden="true">TOC</a></span></h4>
  21534. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">weights</var> option.
  21535. </p>
  21536. <a name="noformat"></a>
  21537. <h3 class="section">11.175 noformat<span class="pull-right"><a class="anchor hidden-xs" href="#noformat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noformat" aria-hidden="true">TOC</a></span></h3>
  21538. <p>Force libavfilter not to use any of the specified pixel formats for the
  21539. input to the next filter.
  21540. </p>
  21541. <p>It accepts the following parameters:
  21542. </p><dl class="table">
  21543. <dt><samp class="option">pix_fmts</samp></dt>
  21544. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  21545. pix_fmts=yuv420p|monow|rgb24&quot;.
  21546. </p>
  21547. </dd>
  21548. </dl>
  21549. <a name="Examples-98"></a>
  21550. <h4 class="subsection">11.175.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-98" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-98" aria-hidden="true">TOC</a></span></h4>
  21551. <ul class="itemize mark-bullet">
  21552. <li>Force libavfilter to use a format different from <var class="var">yuv420p</var> for the
  21553. input to the vflip filter:
  21554. <div class="example">
  21555. <pre class="example-preformatted">noformat=pix_fmts=yuv420p,vflip
  21556. </pre></div>
  21557. </li><li>Convert the input video to any of the formats not contained in the list:
  21558. <div class="example">
  21559. <pre class="example-preformatted">noformat=yuv420p|yuv444p|yuv410p
  21560. </pre></div>
  21561. </li></ul>
  21562. <a name="noise"></a>
  21563. <h3 class="section">11.176 noise<span class="pull-right"><a class="anchor hidden-xs" href="#noise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-noise" aria-hidden="true">TOC</a></span></h3>
  21564. <p>Add noise on video input frame.
  21565. </p>
  21566. <p>The filter accepts the following options:
  21567. </p>
  21568. <dl class="table">
  21569. <dt><samp class="option">all_seed</samp></dt>
  21570. <dt><samp class="option">c0_seed</samp></dt>
  21571. <dt><samp class="option">c1_seed</samp></dt>
  21572. <dt><samp class="option">c2_seed</samp></dt>
  21573. <dt><samp class="option">c3_seed</samp></dt>
  21574. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  21575. of <var class="var">all_seed</var>. Default value is <code class="code">123457</code>.
  21576. </p>
  21577. </dd>
  21578. <dt><samp class="option">all_strength, alls</samp></dt>
  21579. <dt><samp class="option">c0_strength, c0s</samp></dt>
  21580. <dt><samp class="option">c1_strength, c1s</samp></dt>
  21581. <dt><samp class="option">c2_strength, c2s</samp></dt>
  21582. <dt><samp class="option">c3_strength, c3s</samp></dt>
  21583. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  21584. <var class="var">all_strength</var>. Default value is <code class="code">0</code>. Allowed range is [0, 100].
  21585. </p>
  21586. </dd>
  21587. <dt><samp class="option">all_flags, allf</samp></dt>
  21588. <dt><samp class="option">c0_flags, c0f</samp></dt>
  21589. <dt><samp class="option">c1_flags, c1f</samp></dt>
  21590. <dt><samp class="option">c2_flags, c2f</samp></dt>
  21591. <dt><samp class="option">c3_flags, c3f</samp></dt>
  21592. <dd><p>Set pixel component flags or set flags for all components if <var class="var">all_flags</var>.
  21593. Available values for component flags are:
  21594. </p><dl class="table">
  21595. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  21596. <dd><p>averaged temporal noise (smoother)
  21597. </p></dd>
  21598. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  21599. <dd><p>mix random noise with a (semi)regular pattern
  21600. </p></dd>
  21601. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  21602. <dd><p>temporal noise (noise pattern changes between frames)
  21603. </p></dd>
  21604. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  21605. <dd><p>uniform noise (gaussian otherwise)
  21606. </p></dd>
  21607. </dl>
  21608. </dd>
  21609. </dl>
  21610. <a name="Examples-99"></a>
  21611. <h4 class="subsection">11.176.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-99" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-99" aria-hidden="true">TOC</a></span></h4>
  21612. <p>Add temporal and uniform noise to input video:
  21613. </p><div class="example">
  21614. <pre class="example-preformatted">noise=alls=20:allf=t+u
  21615. </pre></div>
  21616. <a name="normalize"></a>
  21617. <h3 class="section">11.177 normalize<span class="pull-right"><a class="anchor hidden-xs" href="#normalize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-normalize" aria-hidden="true">TOC</a></span></h3>
  21618. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  21619. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  21620. </p>
  21621. <p>For each channel of each frame, the filter computes the input range and maps
  21622. it linearly to the user-specified output range. The output range defaults
  21623. to the full dynamic range from pure black to pure white.
  21624. </p>
  21625. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  21626. changes in brightness) caused when small dark or bright objects enter or leave
  21627. the scene. This is similar to the auto-exposure (automatic gain control) on a
  21628. video camera, and, like a video camera, it may cause a period of over- or
  21629. under-exposure of the video.
  21630. </p>
  21631. <p>The R,G,B channels can be normalized independently, which may cause some
  21632. color shifting, or linked together as a single channel, which prevents
  21633. color shifting. Linked normalization preserves hue. Independent normalization
  21634. does not, so it can be used to remove some color casts. Independent and linked
  21635. normalization can be combined in any ratio.
  21636. </p>
  21637. <p>The normalize filter accepts the following options:
  21638. </p>
  21639. <dl class="table">
  21640. <dt><samp class="option">blackpt</samp></dt>
  21641. <dt><samp class="option">whitept</samp></dt>
  21642. <dd><p>Colors which define the output range. The minimum input value is mapped to
  21643. the <var class="var">blackpt</var>. The maximum input value is mapped to the <var class="var">whitept</var>.
  21644. The defaults are black and white respectively. Specifying white for
  21645. <var class="var">blackpt</var> and black for <var class="var">whitept</var> will give color-inverted,
  21646. normalized video. Shades of grey can be used to reduce the dynamic range
  21647. (contrast). Specifying saturated colors here can create some interesting
  21648. effects.
  21649. </p>
  21650. </dd>
  21651. <dt><samp class="option">smoothing</samp></dt>
  21652. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  21653. of each channel is smoothed using a rolling average over the current frame
  21654. and the <var class="var">smoothing</var> previous frames. The default is 0 (no temporal
  21655. smoothing).
  21656. </p>
  21657. </dd>
  21658. <dt><samp class="option">independence</samp></dt>
  21659. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  21660. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  21661. independent. Defaults to 1.0 (fully independent).
  21662. </p>
  21663. </dd>
  21664. <dt><samp class="option">strength</samp></dt>
  21665. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  21666. expensive no-op. Defaults to 1.0 (full strength).
  21667. </p>
  21668. </dd>
  21669. </dl>
  21670. <a name="Commands-126"></a>
  21671. <h4 class="subsection">11.177.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-126" aria-hidden="true">TOC</a></span></h4>
  21672. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options, excluding <var class="var">smoothing</var> option.
  21673. The command accepts the same syntax of the corresponding option.
  21674. </p>
  21675. <p>If the specified expression is not valid, it is kept at its current
  21676. value.
  21677. </p>
  21678. <a name="Examples-100"></a>
  21679. <h4 class="subsection">11.177.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-100" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-100" aria-hidden="true">TOC</a></span></h4>
  21680. <p>Stretch video contrast to use the full dynamic range, with no temporal
  21681. smoothing; may flicker depending on the source content:
  21682. </p><div class="example">
  21683. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=0
  21684. </pre></div>
  21685. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  21686. reduced, depending on the source content:
  21687. </p><div class="example">
  21688. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50
  21689. </pre></div>
  21690. <p>As above, but with hue-preserving linked channel normalization:
  21691. </p><div class="example">
  21692. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  21693. </pre></div>
  21694. <p>As above, but with half strength:
  21695. </p><div class="example">
  21696. <pre class="example-preformatted">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  21697. </pre></div>
  21698. <p>Map the darkest input color to red, the brightest input color to cyan:
  21699. </p><div class="example">
  21700. <pre class="example-preformatted">normalize=blackpt=red:whitept=cyan
  21701. </pre></div>
  21702. <a name="null"></a>
  21703. <h3 class="section">11.178 null<span class="pull-right"><a class="anchor hidden-xs" href="#null" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-null" aria-hidden="true">TOC</a></span></h3>
  21704. <p>Pass the video source unchanged to the output.
  21705. </p>
  21706. <a name="ocr"></a>
  21707. <h3 class="section">11.179 ocr<span class="pull-right"><a class="anchor hidden-xs" href="#ocr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocr" aria-hidden="true">TOC</a></span></h3>
  21708. <p>Optical Character Recognition
  21709. </p>
  21710. <p>This filter uses Tesseract for optical character recognition. To enable
  21711. compilation of this filter, you need to configure FFmpeg with
  21712. <code class="code">--enable-libtesseract</code>.
  21713. </p>
  21714. <p>It accepts the following options:
  21715. </p>
  21716. <dl class="table">
  21717. <dt><samp class="option">datapath</samp></dt>
  21718. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  21719. set at installation.
  21720. </p>
  21721. </dd>
  21722. <dt><samp class="option">language</samp></dt>
  21723. <dd><p>Set language, default is &quot;eng&quot;.
  21724. </p>
  21725. </dd>
  21726. <dt><samp class="option">whitelist</samp></dt>
  21727. <dd><p>Set character whitelist.
  21728. </p>
  21729. </dd>
  21730. <dt><samp class="option">blacklist</samp></dt>
  21731. <dd><p>Set character blacklist.
  21732. </p></dd>
  21733. </dl>
  21734. <p>The filter exports recognized text as the frame metadata <code class="code">lavfi.ocr.text</code>.
  21735. The filter exports confidence of recognized words as the frame metadata <code class="code">lavfi.ocr.confidence</code>.
  21736. </p>
  21737. <a name="ocv"></a>
  21738. <h3 class="section">11.180 ocv<span class="pull-right"><a class="anchor hidden-xs" href="#ocv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ocv" aria-hidden="true">TOC</a></span></h3>
  21739. <p>Apply a video transform using libopencv.
  21740. </p>
  21741. <p>To enable this filter, install the libopencv library and headers and
  21742. configure FFmpeg with <code class="code">--enable-libopencv</code>.
  21743. </p>
  21744. <p>It accepts the following parameters:
  21745. </p>
  21746. <dl class="table">
  21747. <dt><samp class="option">filter_name</samp></dt>
  21748. <dd><p>The name of the libopencv filter to apply.
  21749. </p>
  21750. </dd>
  21751. <dt><samp class="option">filter_params</samp></dt>
  21752. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  21753. values are assumed.
  21754. </p>
  21755. </dd>
  21756. </dl>
  21757. <p>Refer to the official libopencv documentation for more precise
  21758. information:
  21759. <a class="url" href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  21760. </p>
  21761. <p>Several libopencv filters are supported; see the following subsections.
  21762. </p>
  21763. <a class="anchor" id="dilate"></a><a name="dilate-1"></a>
  21764. <h4 class="subsection">11.180.1 dilate<span class="pull-right"><a class="anchor hidden-xs" href="#dilate-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilate-1" aria-hidden="true">TOC</a></span></h4>
  21765. <p>Dilate an image by using a specific structuring element.
  21766. It corresponds to the libopencv function <code class="code">cvDilate</code>.
  21767. </p>
  21768. <p>It accepts the parameters: <var class="var">struct_el</var>|<var class="var">nb_iterations</var>.
  21769. </p>
  21770. <p><var class="var">struct_el</var> represents a structuring element, and has the syntax:
  21771. <var class="var">cols</var>x<var class="var">rows</var>+<var class="var">anchor_x</var>x<var class="var">anchor_y</var>/<var class="var">shape</var>
  21772. </p>
  21773. <p><var class="var">cols</var> and <var class="var">rows</var> represent the number of columns and rows of
  21774. the structuring element, <var class="var">anchor_x</var> and <var class="var">anchor_y</var> the anchor
  21775. point, and <var class="var">shape</var> the shape for the structuring element. <var class="var">shape</var>
  21776. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  21777. </p>
  21778. <p>If the value for <var class="var">shape</var> is &quot;custom&quot;, it must be followed by a
  21779. string of the form &quot;=<var class="var">filename</var>&quot;. The file with name
  21780. <var class="var">filename</var> is assumed to represent a binary image, with each
  21781. printable character corresponding to a bright pixel. When a custom
  21782. <var class="var">shape</var> is used, <var class="var">cols</var> and <var class="var">rows</var> are ignored, the number
  21783. or columns and rows of the read file are assumed instead.
  21784. </p>
  21785. <p>The default value for <var class="var">struct_el</var> is &quot;3x3+0x0/rect&quot;.
  21786. </p>
  21787. <p><var class="var">nb_iterations</var> specifies the number of times the transform is
  21788. applied to the image, and defaults to 1.
  21789. </p>
  21790. <p>Some examples:
  21791. </p><div class="example">
  21792. <pre class="example-preformatted"># Use the default values
  21793. ocv=dilate
  21794. # Dilate using a structuring element with a 5x5 cross, iterating two times
  21795. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  21796. # Read the shape from the file diamond.shape, iterating two times.
  21797. # The file diamond.shape may contain a pattern of characters like this
  21798. # *
  21799. # ***
  21800. # *****
  21801. # ***
  21802. # *
  21803. # The specified columns and rows are ignored
  21804. # but the anchor point coordinates are not
  21805. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  21806. </pre></div>
  21807. <a name="erode"></a>
  21808. <h4 class="subsection">11.180.2 erode<span class="pull-right"><a class="anchor hidden-xs" href="#erode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erode" aria-hidden="true">TOC</a></span></h4>
  21809. <p>Erode an image by using a specific structuring element.
  21810. It corresponds to the libopencv function <code class="code">cvErode</code>.
  21811. </p>
  21812. <p>It accepts the parameters: <var class="var">struct_el</var>:<var class="var">nb_iterations</var>,
  21813. with the same syntax and semantics as the <a class="ref" href="#dilate">dilate</a> filter.
  21814. </p>
  21815. <a name="smooth"></a>
  21816. <h4 class="subsection">11.180.3 smooth<span class="pull-right"><a class="anchor hidden-xs" href="#smooth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smooth" aria-hidden="true">TOC</a></span></h4>
  21817. <p>Smooth the input video.
  21818. </p>
  21819. <p>The filter takes the following parameters:
  21820. <var class="var">type</var>|<var class="var">param1</var>|<var class="var">param2</var>|<var class="var">param3</var>|<var class="var">param4</var>.
  21821. </p>
  21822. <p><var class="var">type</var> is the type of smooth filter to apply, and must be one of
  21823. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  21824. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  21825. </p>
  21826. <p>The meaning of <var class="var">param1</var>, <var class="var">param2</var>, <var class="var">param3</var>, and <var class="var">param4</var>
  21827. depends on the smooth type. <var class="var">param1</var> and
  21828. <var class="var">param2</var> accept integer positive values or 0. <var class="var">param3</var> and
  21829. <var class="var">param4</var> accept floating point values.
  21830. </p>
  21831. <p>The default value for <var class="var">param1</var> is 3. The default value for the
  21832. other parameters is 0.
  21833. </p>
  21834. <p>These parameters correspond to the parameters assigned to the
  21835. libopencv function <code class="code">cvSmooth</code>.
  21836. </p>
  21837. <a name="oscilloscope"></a>
  21838. <h3 class="section">11.181 oscilloscope<span class="pull-right"><a class="anchor hidden-xs" href="#oscilloscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-oscilloscope" aria-hidden="true">TOC</a></span></h3>
  21839. <p>2D Video Oscilloscope.
  21840. </p>
  21841. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  21842. </p>
  21843. <p>It accepts the following parameters:
  21844. </p>
  21845. <dl class="table">
  21846. <dt><samp class="option">x</samp></dt>
  21847. <dd><p>Set scope center x position.
  21848. </p>
  21849. </dd>
  21850. <dt><samp class="option">y</samp></dt>
  21851. <dd><p>Set scope center y position.
  21852. </p>
  21853. </dd>
  21854. <dt><samp class="option">s</samp></dt>
  21855. <dd><p>Set scope size, relative to frame diagonal.
  21856. </p>
  21857. </dd>
  21858. <dt><samp class="option">t</samp></dt>
  21859. <dd><p>Set scope tilt/rotation.
  21860. </p>
  21861. </dd>
  21862. <dt><samp class="option">o</samp></dt>
  21863. <dd><p>Set trace opacity.
  21864. </p>
  21865. </dd>
  21866. <dt><samp class="option">tx</samp></dt>
  21867. <dd><p>Set trace center x position.
  21868. </p>
  21869. </dd>
  21870. <dt><samp class="option">ty</samp></dt>
  21871. <dd><p>Set trace center y position.
  21872. </p>
  21873. </dd>
  21874. <dt><samp class="option">tw</samp></dt>
  21875. <dd><p>Set trace width, relative to width of frame.
  21876. </p>
  21877. </dd>
  21878. <dt><samp class="option">th</samp></dt>
  21879. <dd><p>Set trace height, relative to height of frame.
  21880. </p>
  21881. </dd>
  21882. <dt><samp class="option">c</samp></dt>
  21883. <dd><p>Set which components to trace. By default it traces first three components.
  21884. </p>
  21885. </dd>
  21886. <dt><samp class="option">g</samp></dt>
  21887. <dd><p>Draw trace grid. By default is enabled.
  21888. </p>
  21889. </dd>
  21890. <dt><samp class="option">st</samp></dt>
  21891. <dd><p>Draw some statistics. By default is enabled.
  21892. </p>
  21893. </dd>
  21894. <dt><samp class="option">sc</samp></dt>
  21895. <dd><p>Draw scope. By default is enabled.
  21896. </p></dd>
  21897. </dl>
  21898. <a name="Commands-127"></a>
  21899. <h4 class="subsection">11.181.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-127" aria-hidden="true">TOC</a></span></h4>
  21900. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  21901. The command accepts the same syntax of the corresponding option.
  21902. </p>
  21903. <p>If the specified expression is not valid, it is kept at its current
  21904. value.
  21905. </p>
  21906. <a name="Examples-101"></a>
  21907. <h4 class="subsection">11.181.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-101" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-101" aria-hidden="true">TOC</a></span></h4>
  21908. <ul class="itemize mark-bullet">
  21909. <li>Inspect full first row of video frame.
  21910. <div class="example">
  21911. <pre class="example-preformatted">oscilloscope=x=0.5:y=0:s=1
  21912. </pre></div>
  21913. </li><li>Inspect full last row of video frame.
  21914. <div class="example">
  21915. <pre class="example-preformatted">oscilloscope=x=0.5:y=1:s=1
  21916. </pre></div>
  21917. </li><li>Inspect full 5th line of video frame of height 1080.
  21918. <div class="example">
  21919. <pre class="example-preformatted">oscilloscope=x=0.5:y=5/1080:s=1
  21920. </pre></div>
  21921. </li><li>Inspect full last column of video frame.
  21922. <div class="example">
  21923. <pre class="example-preformatted">oscilloscope=x=1:y=0.5:s=1:t=1
  21924. </pre></div>
  21925. </li></ul>
  21926. <a class="anchor" id="overlay"></a><a name="overlay-1"></a>
  21927. <h3 class="section">11.182 overlay<span class="pull-right"><a class="anchor hidden-xs" href="#overlay-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay-1" aria-hidden="true">TOC</a></span></h3>
  21928. <p>Overlay one video on top of another.
  21929. </p>
  21930. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  21931. video on which the second input is overlaid.
  21932. </p>
  21933. <p>It accepts the following parameters:
  21934. </p>
  21935. <p>A description of the accepted options follows.
  21936. </p>
  21937. <dl class="table">
  21938. <dt><samp class="option">x</samp></dt>
  21939. <dt><samp class="option">y</samp></dt>
  21940. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  21941. on the main video. Default value is &quot;0&quot; for both expressions. In case
  21942. the expression is invalid, it is set to a huge value (meaning that the
  21943. overlay will not be displayed within the output visible area).
  21944. </p>
  21945. </dd>
  21946. <dt><samp class="option">eof_action</samp></dt>
  21947. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  21948. </p>
  21949. </dd>
  21950. <dt><samp class="option">eval</samp></dt>
  21951. <dd><p>Set when the expressions for <samp class="option">x</samp>, and <samp class="option">y</samp> are evaluated.
  21952. </p>
  21953. <p>It accepts the following values:
  21954. </p><dl class="table">
  21955. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  21956. <dd><p>only evaluate expressions once during the filter initialization or
  21957. when a command is processed
  21958. </p>
  21959. </dd>
  21960. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  21961. <dd><p>evaluate expressions for each incoming frame
  21962. </p></dd>
  21963. </dl>
  21964. <p>Default value is &lsquo;<samp class="samp">frame</samp>&rsquo;.
  21965. </p>
  21966. </dd>
  21967. <dt><samp class="option">shortest</samp></dt>
  21968. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  21969. </p>
  21970. </dd>
  21971. <dt><samp class="option">format</samp></dt>
  21972. <dd><p>Set the format for the output video.
  21973. </p>
  21974. <p>It accepts the following values:
  21975. </p><dl class="table">
  21976. <dt>&lsquo;<samp class="samp">yuv420</samp>&rsquo;</dt>
  21977. <dd><p>force YUV 4:2:0 8-bit planar output
  21978. </p>
  21979. </dd>
  21980. <dt>&lsquo;<samp class="samp">yuv420p10</samp>&rsquo;</dt>
  21981. <dd><p>force YUV 4:2:0 10-bit planar output
  21982. </p>
  21983. </dd>
  21984. <dt>&lsquo;<samp class="samp">yuv422</samp>&rsquo;</dt>
  21985. <dd><p>force YUV 4:2:2 8-bit planar output
  21986. </p>
  21987. </dd>
  21988. <dt>&lsquo;<samp class="samp">yuv422p10</samp>&rsquo;</dt>
  21989. <dd><p>force YUV 4:2:2 10-bit planar output
  21990. </p>
  21991. </dd>
  21992. <dt>&lsquo;<samp class="samp">yuv444</samp>&rsquo;</dt>
  21993. <dd><p>force YUV 4:4:4 8-bit planar output
  21994. </p>
  21995. </dd>
  21996. <dt>&lsquo;<samp class="samp">yuv444p10</samp>&rsquo;</dt>
  21997. <dd><p>force YUV 4:4:4 10-bit planar output
  21998. </p>
  21999. </dd>
  22000. <dt>&lsquo;<samp class="samp">rgb</samp>&rsquo;</dt>
  22001. <dd><p>force RGB 8-bit packed output
  22002. </p>
  22003. </dd>
  22004. <dt>&lsquo;<samp class="samp">gbrp</samp>&rsquo;</dt>
  22005. <dd><p>force RGB 8-bit planar output
  22006. </p>
  22007. </dd>
  22008. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  22009. <dd><p>automatically pick format
  22010. </p></dd>
  22011. </dl>
  22012. <p>Default value is &lsquo;<samp class="samp">yuv420</samp>&rsquo;.
  22013. </p>
  22014. </dd>
  22015. <dt><samp class="option">repeatlast</samp></dt>
  22016. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  22017. </p>
  22018. </dd>
  22019. <dt><samp class="option">alpha</samp></dt>
  22020. <dd><p>Set format of alpha of the overlaid video, it can be <var class="var">straight</var> or
  22021. <var class="var">premultiplied</var>, or <var class="var">auto</var> to choose the alpha mode automatically.
  22022. Default is <var class="var">auto</var>.
  22023. </p></dd>
  22024. </dl>
  22025. <p>The <samp class="option">x</samp>, and <samp class="option">y</samp> expressions can contain the following
  22026. parameters.
  22027. </p>
  22028. <dl class="table">
  22029. <dt><samp class="option">main_w, W</samp></dt>
  22030. <dt><samp class="option">main_h, H</samp></dt>
  22031. <dd><p>The main input width and height.
  22032. </p>
  22033. </dd>
  22034. <dt><samp class="option">overlay_w, w</samp></dt>
  22035. <dt><samp class="option">overlay_h, h</samp></dt>
  22036. <dd><p>The overlay input width and height.
  22037. </p>
  22038. </dd>
  22039. <dt><samp class="option">x</samp></dt>
  22040. <dt><samp class="option">y</samp></dt>
  22041. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  22042. each new frame.
  22043. </p>
  22044. </dd>
  22045. <dt><samp class="option">hsub</samp></dt>
  22046. <dt><samp class="option">vsub</samp></dt>
  22047. <dd><p>horizontal and vertical chroma subsample values of the output
  22048. format. For example for the pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and
  22049. <var class="var">vsub</var> is 1.
  22050. </p>
  22051. </dd>
  22052. <dt><samp class="option">n</samp></dt>
  22053. <dd><p>the number of input frame, starting from 0
  22054. </p>
  22055. </dd>
  22056. <dt><samp class="option">pos</samp></dt>
  22057. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  22058. do not use
  22059. </p>
  22060. </dd>
  22061. <dt><samp class="option">t</samp></dt>
  22062. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  22063. </p>
  22064. </dd>
  22065. </dl>
  22066. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  22067. </p>
  22068. <p>Note that the <var class="var">n</var>, <var class="var">t</var> variables are available only
  22069. when evaluation is done <em class="emph">per frame</em>, and will evaluate to NAN
  22070. when <samp class="option">eval</samp> is set to &lsquo;<samp class="samp">init</samp>&rsquo;.
  22071. </p>
  22072. <p>Be aware that frames are taken from each input video in timestamp
  22073. order, hence, if their initial timestamps differ, it is a good idea
  22074. to pass the two inputs through a <var class="var">setpts=PTS-STARTPTS</var> filter to
  22075. have them begin in the same zero timestamp, as the example for
  22076. the <var class="var">movie</var> filter does.
  22077. </p>
  22078. <p>You can chain together more overlays but you should test the
  22079. efficiency of such approach.
  22080. </p>
  22081. <a name="Commands-128"></a>
  22082. <h4 class="subsection">11.182.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-128" aria-hidden="true">TOC</a></span></h4>
  22083. <p>This filter supports the following commands:
  22084. </p><dl class="table">
  22085. <dt><samp class="option">x</samp></dt>
  22086. <dt><samp class="option">y</samp></dt>
  22087. <dd><p>Modify the x and y of the overlay input.
  22088. The command accepts the same syntax of the corresponding option.
  22089. </p>
  22090. <p>If the specified expression is not valid, it is kept at its current
  22091. value.
  22092. </p></dd>
  22093. </dl>
  22094. <a name="Examples-102"></a>
  22095. <h4 class="subsection">11.182.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-102" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-102" aria-hidden="true">TOC</a></span></h4>
  22096. <ul class="itemize mark-bullet">
  22097. <li>Draw the overlay at 10 pixels from the bottom right corner of the main
  22098. video:
  22099. <div class="example">
  22100. <pre class="example-preformatted">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  22101. </pre></div>
  22102. <p>Using named options the example above becomes:
  22103. </p><div class="example">
  22104. <pre class="example-preformatted">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  22105. </pre></div>
  22106. </li><li>Insert a transparent PNG logo in the bottom left corner of the input,
  22107. using the <code class="command">ffmpeg</code> tool with the <code class="code">-filter_complex</code> option:
  22108. <div class="example">
  22109. <pre class="example-preformatted">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  22110. </pre></div>
  22111. </li><li>Insert 2 different transparent PNG logos (second logo on bottom
  22112. right corner) using the <code class="command">ffmpeg</code> tool:
  22113. <div class="example">
  22114. <pre class="example-preformatted">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
  22115. </pre></div>
  22116. </li><li>Add a transparent color layer on top of the main video; <code class="code">WxH</code>
  22117. must specify the size of the main input to the overlay filter:
  22118. <div class="example">
  22119. <pre class="example-preformatted">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  22120. </pre></div>
  22121. </li><li>Play an original video and a filtered version (here with the deshake
  22122. filter) side by side using the <code class="command">ffplay</code> tool:
  22123. <div class="example">
  22124. <pre class="example-preformatted">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  22125. </pre></div>
  22126. <p>The above command is the same as:
  22127. </p><div class="example">
  22128. <pre class="example-preformatted">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  22129. </pre></div>
  22130. </li><li>Make a sliding overlay appearing from the left to the right top part of the
  22131. screen starting since time 2:
  22132. <div class="example">
  22133. <pre class="example-preformatted">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  22134. </pre></div>
  22135. </li><li>Compose output by putting two input videos side to side:
  22136. <div class="example">
  22137. <pre class="example-preformatted">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  22138. nullsrc=size=200x100 [background];
  22139. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  22140. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  22141. [background][left] overlay=shortest=1 [background+left];
  22142. [background+left][right] overlay=shortest=1:x=100 [left+right]
  22143. &quot;
  22144. </pre></div>
  22145. </li><li>Mask 10-20 seconds of a video by applying the delogo filter to a section
  22146. <div class="example">
  22147. <pre class="example-preformatted">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  22148. -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]'
  22149. masked.avi
  22150. </pre></div>
  22151. </li><li>Chain several overlays in cascade:
  22152. <div class="example">
  22153. <pre class="example-preformatted">nullsrc=s=200x200 [bg];
  22154. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  22155. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  22156. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  22157. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  22158. [in3] null, [mid2] overlay=100:100 [out0]
  22159. </pre></div>
  22160. </li></ul>
  22161. <a name="owdenoise"></a>
  22162. <h3 class="section">11.183 owdenoise<span class="pull-right"><a class="anchor hidden-xs" href="#owdenoise" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-owdenoise" aria-hidden="true">TOC</a></span></h3>
  22163. <p>Apply Overcomplete Wavelet denoiser.
  22164. </p>
  22165. <p>The filter accepts the following options:
  22166. </p>
  22167. <dl class="table">
  22168. <dt><samp class="option">depth</samp></dt>
  22169. <dd><p>Set depth.
  22170. </p>
  22171. <p>Larger depth values will denoise lower frequency components more, but
  22172. slow down filtering.
  22173. </p>
  22174. <p>Must be an int in the range 8-16, default is <code class="code">8</code>.
  22175. </p>
  22176. </dd>
  22177. <dt><samp class="option">luma_strength, ls</samp></dt>
  22178. <dd><p>Set luma strength.
  22179. </p>
  22180. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  22181. </p>
  22182. </dd>
  22183. <dt><samp class="option">chroma_strength, cs</samp></dt>
  22184. <dd><p>Set chroma strength.
  22185. </p>
  22186. <p>Must be a double value in the range 0-1000, default is <code class="code">1.0</code>.
  22187. </p></dd>
  22188. </dl>
  22189. <a class="anchor" id="pad"></a><a name="pad-1"></a>
  22190. <h3 class="section">11.184 pad<span class="pull-right"><a class="anchor hidden-xs" href="#pad-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad-1" aria-hidden="true">TOC</a></span></h3>
  22191. <p>Add paddings to the input image, and place the original input at the
  22192. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  22193. </p>
  22194. <p>It accepts the following parameters:
  22195. </p>
  22196. <dl class="table">
  22197. <dt><samp class="option">width, w</samp></dt>
  22198. <dt><samp class="option">height, h</samp></dt>
  22199. <dd><p>Specify an expression for the size of the output image with the
  22200. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  22201. corresponding input size is used for the output.
  22202. </p>
  22203. <p>The <var class="var">width</var> expression can reference the value set by the
  22204. <var class="var">height</var> expression, and vice versa.
  22205. </p>
  22206. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  22207. </p>
  22208. </dd>
  22209. <dt><samp class="option">x</samp></dt>
  22210. <dt><samp class="option">y</samp></dt>
  22211. <dd><p>Specify the offsets to place the input image at within the padded area,
  22212. with respect to the top/left border of the output image.
  22213. </p>
  22214. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  22215. expression, and vice versa.
  22216. </p>
  22217. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  22218. </p>
  22219. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  22220. so the input image is centered on the padded area.
  22221. </p>
  22222. </dd>
  22223. <dt><samp class="option">color</samp></dt>
  22224. <dd><p>Specify the color of the padded area. For the syntax of this option,
  22225. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  22226. manual</a>.
  22227. </p>
  22228. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  22229. </p>
  22230. </dd>
  22231. <dt><samp class="option">eval</samp></dt>
  22232. <dd><p>Specify when to evaluate <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var> and <var class="var">y</var> expression.
  22233. </p>
  22234. <p>It accepts the following values:
  22235. </p>
  22236. <dl class="table">
  22237. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  22238. <dd><p>Only evaluate expressions once during the filter initialization or when
  22239. a command is processed.
  22240. </p>
  22241. </dd>
  22242. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  22243. <dd><p>Evaluate expressions for each incoming frame.
  22244. </p>
  22245. </dd>
  22246. </dl>
  22247. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  22248. </p>
  22249. </dd>
  22250. <dt><samp class="option">aspect</samp></dt>
  22251. <dd><p>Pad to aspect instead to a resolution.
  22252. </p>
  22253. </dd>
  22254. </dl>
  22255. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  22256. options are expressions containing the following constants:
  22257. </p>
  22258. <dl class="table">
  22259. <dt><samp class="option">in_w</samp></dt>
  22260. <dt><samp class="option">in_h</samp></dt>
  22261. <dd><p>The input video width and height.
  22262. </p>
  22263. </dd>
  22264. <dt><samp class="option">iw</samp></dt>
  22265. <dt><samp class="option">ih</samp></dt>
  22266. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  22267. </p>
  22268. </dd>
  22269. <dt><samp class="option">out_w</samp></dt>
  22270. <dt><samp class="option">out_h</samp></dt>
  22271. <dd><p>The output width and height (the size of the padded area), as
  22272. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  22273. </p>
  22274. </dd>
  22275. <dt><samp class="option">ow</samp></dt>
  22276. <dt><samp class="option">oh</samp></dt>
  22277. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  22278. </p>
  22279. </dd>
  22280. <dt><samp class="option">x</samp></dt>
  22281. <dt><samp class="option">y</samp></dt>
  22282. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  22283. expressions, or NAN if not yet specified.
  22284. </p>
  22285. </dd>
  22286. <dt><samp class="option">a</samp></dt>
  22287. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  22288. </p>
  22289. </dd>
  22290. <dt><samp class="option">sar</samp></dt>
  22291. <dd><p>input sample aspect ratio
  22292. </p>
  22293. </dd>
  22294. <dt><samp class="option">dar</samp></dt>
  22295. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  22296. </p>
  22297. </dd>
  22298. <dt><samp class="option">hsub</samp></dt>
  22299. <dt><samp class="option">vsub</samp></dt>
  22300. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  22301. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  22302. </p></dd>
  22303. </dl>
  22304. <a name="Examples-103"></a>
  22305. <h4 class="subsection">11.184.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-103" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-103" aria-hidden="true">TOC</a></span></h4>
  22306. <ul class="itemize mark-bullet">
  22307. <li>Add paddings with the color &quot;violet&quot; to the input video. The output video
  22308. size is 640x480, and the top-left corner of the input video is placed at
  22309. column 0, row 40
  22310. <div class="example">
  22311. <pre class="example-preformatted">pad=640:480:0:40:violet
  22312. </pre></div>
  22313. <p>The example above is equivalent to the following command:
  22314. </p><div class="example">
  22315. <pre class="example-preformatted">pad=width=640:height=480:x=0:y=40:color=violet
  22316. </pre></div>
  22317. </li><li>Pad the input to get an output with dimensions increased by 3/2,
  22318. and put the input video at the center of the padded area:
  22319. <div class="example">
  22320. <pre class="example-preformatted">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  22321. </pre></div>
  22322. </li><li>Pad the input to get a squared output with size equal to the maximum
  22323. value between the input width and height, and put the input video at
  22324. the center of the padded area:
  22325. <div class="example">
  22326. <pre class="example-preformatted">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  22327. </pre></div>
  22328. </li><li>Pad the input to get a final w/h ratio of 16:9:
  22329. <div class="example">
  22330. <pre class="example-preformatted">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  22331. </pre></div>
  22332. </li><li>In case of anamorphic video, in order to set the output display aspect
  22333. correctly, it is necessary to use <var class="var">sar</var> in the expression,
  22334. according to the relation:
  22335. <div class="example">
  22336. <pre class="example-preformatted">(ih * X / ih) * sar = output_dar
  22337. X = output_dar / sar
  22338. </pre></div>
  22339. <p>Thus the previous example needs to be modified to:
  22340. </p><div class="example">
  22341. <pre class="example-preformatted">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  22342. </pre></div>
  22343. </li><li>Double the output size and put the input video in the bottom-right
  22344. corner of the output padded area:
  22345. <div class="example">
  22346. <pre class="example-preformatted">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  22347. </pre></div>
  22348. </li></ul>
  22349. <a class="anchor" id="palettegen"></a><a name="palettegen-1"></a>
  22350. <h3 class="section">11.185 palettegen<span class="pull-right"><a class="anchor hidden-xs" href="#palettegen-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-palettegen-1" aria-hidden="true">TOC</a></span></h3>
  22351. <p>Generate one palette for a whole video stream.
  22352. </p>
  22353. <p>It accepts the following options:
  22354. </p>
  22355. <dl class="table">
  22356. <dt><samp class="option">max_colors</samp></dt>
  22357. <dd><p>Set the maximum number of colors to quantize in the palette.
  22358. Note: the palette will still contain 256 colors; the unused palette entries
  22359. will be black.
  22360. </p>
  22361. </dd>
  22362. <dt><samp class="option">reserve_transparent</samp></dt>
  22363. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  22364. transparency. Reserving the transparency color is useful for GIF optimization.
  22365. If not set, the maximum of colors in the palette will be 256. You probably want
  22366. to disable this option for a standalone image.
  22367. Set by default.
  22368. </p>
  22369. </dd>
  22370. <dt><samp class="option">transparency_color</samp></dt>
  22371. <dd><p>Set the color that will be used as background for transparency.
  22372. </p>
  22373. </dd>
  22374. <dt><samp class="option">stats_mode</samp></dt>
  22375. <dd><p>Set statistics mode.
  22376. </p>
  22377. <p>It accepts the following values:
  22378. </p><dl class="table">
  22379. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  22380. <dd><p>Compute full frame histograms.
  22381. </p></dd>
  22382. <dt>&lsquo;<samp class="samp">diff</samp>&rsquo;</dt>
  22383. <dd><p>Compute histograms only for the part that differs from previous frame. This
  22384. might be relevant to give more importance to the moving part of your input if
  22385. the background is static.
  22386. </p></dd>
  22387. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  22388. <dd><p>Compute new histogram for each frame.
  22389. </p></dd>
  22390. </dl>
  22391. <p>Default value is <var class="var">full</var>.
  22392. </p></dd>
  22393. </dl>
  22394. <p>The filter also exports the frame metadata <code class="code">lavfi.color_quant_ratio</code>
  22395. (<code class="code">nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  22396. color quantization of the palette. This information is also visible at
  22397. <var class="var">info</var> logging level.
  22398. </p>
  22399. <a name="Examples-104"></a>
  22400. <h4 class="subsection">11.185.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-104" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-104" aria-hidden="true">TOC</a></span></h4>
  22401. <ul class="itemize mark-bullet">
  22402. <li>Generate a representative palette of a given video using <code class="command">ffmpeg</code>:
  22403. <div class="example">
  22404. <pre class="example-preformatted">ffmpeg -i input.mkv -vf palettegen palette.png
  22405. </pre></div>
  22406. </li></ul>
  22407. <a name="paletteuse"></a>
  22408. <h3 class="section">11.186 paletteuse<span class="pull-right"><a class="anchor hidden-xs" href="#paletteuse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-paletteuse" aria-hidden="true">TOC</a></span></h3>
  22409. <p>Use a palette to downsample an input video stream.
  22410. </p>
  22411. <p>The filter takes two inputs: one video stream and a palette. The palette must
  22412. be a 256 pixels image.
  22413. </p>
  22414. <p>It accepts the following options:
  22415. </p>
  22416. <dl class="table">
  22417. <dt><samp class="option">dither</samp></dt>
  22418. <dd><p>Select dithering mode. Available algorithms are:
  22419. </p><dl class="table">
  22420. <dt>&lsquo;<samp class="samp">bayer</samp>&rsquo;</dt>
  22421. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  22422. </p></dd>
  22423. <dt>&lsquo;<samp class="samp">heckbert</samp>&rsquo;</dt>
  22424. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  22425. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  22426. reference.
  22427. </p></dd>
  22428. <dt>&lsquo;<samp class="samp">floyd_steinberg</samp>&rsquo;</dt>
  22429. <dd><p>Floyd and Steingberg dithering (error diffusion)
  22430. </p></dd>
  22431. <dt>&lsquo;<samp class="samp">sierra2</samp>&rsquo;</dt>
  22432. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  22433. </p></dd>
  22434. <dt>&lsquo;<samp class="samp">sierra2_4a</samp>&rsquo;</dt>
  22435. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  22436. </p></dd>
  22437. <dt>&lsquo;<samp class="samp">sierra3</samp>&rsquo;</dt>
  22438. <dd><p>Frankie Sierra dithering v3 (error diffusion)
  22439. </p></dd>
  22440. <dt>&lsquo;<samp class="samp">burkes</samp>&rsquo;</dt>
  22441. <dd><p>Burkes dithering (error diffusion)
  22442. </p></dd>
  22443. <dt>&lsquo;<samp class="samp">atkinson</samp>&rsquo;</dt>
  22444. <dd><p>Atkinson dithering by Bill Atkinson at Apple Computer (error diffusion)
  22445. </p></dd>
  22446. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  22447. <dd><p>Disable dithering.
  22448. </p></dd>
  22449. </dl>
  22450. <p>Default is <var class="var">sierra2_4a</var>.
  22451. </p>
  22452. </dd>
  22453. <dt><samp class="option">bayer_scale</samp></dt>
  22454. <dd><p>When <var class="var">bayer</var> dithering is selected, this option defines the scale of the
  22455. pattern (how much the crosshatch pattern is visible). A low value means more
  22456. visible pattern for less banding, and higher value means less visible pattern
  22457. at the cost of more banding.
  22458. </p>
  22459. <p>The option must be an integer value in the range [0,5]. Default is <var class="var">2</var>.
  22460. </p>
  22461. </dd>
  22462. <dt><samp class="option">diff_mode</samp></dt>
  22463. <dd><p>If set, define the zone to process
  22464. </p>
  22465. <dl class="table">
  22466. <dt>&lsquo;<samp class="samp">rectangle</samp>&rsquo;</dt>
  22467. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  22468. cropping/offsetting compression mechanism. This option can be useful for speed
  22469. if only a part of the image is changing, and has use cases such as limiting the
  22470. scope of the error diffusal <samp class="option">dither</samp> to the rectangle that bounds the
  22471. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  22472. much, and as a result less moving noise and better GIF compression).
  22473. </p></dd>
  22474. </dl>
  22475. <p>Default is <var class="var">none</var>.
  22476. </p>
  22477. </dd>
  22478. <dt><samp class="option">new</samp></dt>
  22479. <dd><p>Take new palette for each output frame.
  22480. </p>
  22481. </dd>
  22482. <dt><samp class="option">alpha_threshold</samp></dt>
  22483. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  22484. will be treated as completely opaque, and values below this threshold will be
  22485. treated as completely transparent.
  22486. </p>
  22487. <p>The option must be an integer value in the range [0,255]. Default is <var class="var">128</var>.
  22488. </p></dd>
  22489. </dl>
  22490. <a name="Examples-105"></a>
  22491. <h4 class="subsection">11.186.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-105" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-105" aria-hidden="true">TOC</a></span></h4>
  22492. <ul class="itemize mark-bullet">
  22493. <li>Use a palette (generated for example with <a class="ref" href="#palettegen">palettegen</a>) to encode a GIF
  22494. using <code class="command">ffmpeg</code>:
  22495. <div class="example">
  22496. <pre class="example-preformatted">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  22497. </pre></div>
  22498. </li></ul>
  22499. <a name="perspective"></a>
  22500. <h3 class="section">11.187 perspective<span class="pull-right"><a class="anchor hidden-xs" href="#perspective" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perspective" aria-hidden="true">TOC</a></span></h3>
  22501. <p>Correct perspective of video not recorded perpendicular to the screen.
  22502. </p>
  22503. <p>A description of the accepted parameters follows.
  22504. </p>
  22505. <dl class="table">
  22506. <dt><samp class="option">x0</samp></dt>
  22507. <dt><samp class="option">y0</samp></dt>
  22508. <dt><samp class="option">x1</samp></dt>
  22509. <dt><samp class="option">y1</samp></dt>
  22510. <dt><samp class="option">x2</samp></dt>
  22511. <dt><samp class="option">y2</samp></dt>
  22512. <dt><samp class="option">x3</samp></dt>
  22513. <dt><samp class="option">y3</samp></dt>
  22514. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  22515. Default values are <code class="code">0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  22516. If the <code class="code">sense</code> option is set to <code class="code">source</code>, then the specified points will be sent
  22517. to the corners of the destination. If the <code class="code">sense</code> option is set to <code class="code">destination</code>,
  22518. then the corners of the source will be sent to the specified coordinates.
  22519. </p>
  22520. <p>The expressions can use the following variables:
  22521. </p>
  22522. <dl class="table">
  22523. <dt><samp class="option">W</samp></dt>
  22524. <dt><samp class="option">H</samp></dt>
  22525. <dd><p>the width and height of video frame.
  22526. </p></dd>
  22527. <dt><samp class="option">in</samp></dt>
  22528. <dd><p>Input frame count.
  22529. </p></dd>
  22530. <dt><samp class="option">on</samp></dt>
  22531. <dd><p>Output frame count.
  22532. </p></dd>
  22533. </dl>
  22534. </dd>
  22535. <dt><samp class="option">interpolation</samp></dt>
  22536. <dd><p>Set interpolation for perspective correction.
  22537. </p>
  22538. <p>It accepts the following values:
  22539. </p><dl class="table">
  22540. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  22541. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  22542. </dl>
  22543. <p>Default value is &lsquo;<samp class="samp">linear</samp>&rsquo;.
  22544. </p>
  22545. </dd>
  22546. <dt><samp class="option">sense</samp></dt>
  22547. <dd><p>Set interpretation of coordinate options.
  22548. </p>
  22549. <p>It accepts the following values:
  22550. </p><dl class="table">
  22551. <dt>&lsquo;<samp class="samp">0, source</samp>&rsquo;</dt>
  22552. <dd>
  22553. <p>Send point in the source specified by the given coordinates to
  22554. the corners of the destination.
  22555. </p>
  22556. </dd>
  22557. <dt>&lsquo;<samp class="samp">1, destination</samp>&rsquo;</dt>
  22558. <dd>
  22559. <p>Send the corners of the source to the point in the destination specified
  22560. by the given coordinates.
  22561. </p>
  22562. <p>Default value is &lsquo;<samp class="samp">source</samp>&rsquo;.
  22563. </p></dd>
  22564. </dl>
  22565. </dd>
  22566. <dt><samp class="option">eval</samp></dt>
  22567. <dd><p>Set when the expressions for coordinates <samp class="option">x0,y0,...x3,y3</samp> are evaluated.
  22568. </p>
  22569. <p>It accepts the following values:
  22570. </p><dl class="table">
  22571. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  22572. <dd><p>only evaluate expressions once during the filter initialization or
  22573. when a command is processed
  22574. </p>
  22575. </dd>
  22576. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  22577. <dd><p>evaluate expressions for each incoming frame
  22578. </p></dd>
  22579. </dl>
  22580. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  22581. </p></dd>
  22582. </dl>
  22583. <a name="phase"></a>
  22584. <h3 class="section">11.188 phase<span class="pull-right"><a class="anchor hidden-xs" href="#phase" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phase" aria-hidden="true">TOC</a></span></h3>
  22585. <p>Delay interlaced video by one field time so that the field order changes.
  22586. </p>
  22587. <p>The intended use is to fix PAL movies that have been captured with the
  22588. opposite field order to the film-to-video transfer.
  22589. </p>
  22590. <p>A description of the accepted parameters follows.
  22591. </p>
  22592. <dl class="table">
  22593. <dt><samp class="option">mode</samp></dt>
  22594. <dd><p>Set phase mode.
  22595. </p>
  22596. <p>It accepts the following values:
  22597. </p><dl class="table">
  22598. <dt>&lsquo;<samp class="samp">t</samp>&rsquo;</dt>
  22599. <dd><p>Capture field order top-first, transfer bottom-first.
  22600. Filter will delay the bottom field.
  22601. </p>
  22602. </dd>
  22603. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  22604. <dd><p>Capture field order bottom-first, transfer top-first.
  22605. Filter will delay the top field.
  22606. </p>
  22607. </dd>
  22608. <dt>&lsquo;<samp class="samp">p</samp>&rsquo;</dt>
  22609. <dd><p>Capture and transfer with the same field order. This mode only exists
  22610. for the documentation of the other options to refer to, but if you
  22611. actually select it, the filter will faithfully do nothing.
  22612. </p>
  22613. </dd>
  22614. <dt>&lsquo;<samp class="samp">a</samp>&rsquo;</dt>
  22615. <dd><p>Capture field order determined automatically by field flags, transfer
  22616. opposite.
  22617. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; modes on a frame by frame
  22618. basis using field flags. If no field information is available,
  22619. then this works just like &lsquo;<samp class="samp">u</samp>&rsquo;.
  22620. </p>
  22621. </dd>
  22622. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  22623. <dd><p>Capture unknown or varying, transfer opposite.
  22624. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">b</samp>&rsquo; on a frame by frame basis by
  22625. analyzing the images and selecting the alternative that produces best
  22626. match between the fields.
  22627. </p>
  22628. </dd>
  22629. <dt>&lsquo;<samp class="samp">T</samp>&rsquo;</dt>
  22630. <dd><p>Capture top-first, transfer unknown or varying.
  22631. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  22632. </p>
  22633. </dd>
  22634. <dt>&lsquo;<samp class="samp">B</samp>&rsquo;</dt>
  22635. <dd><p>Capture bottom-first, transfer unknown or varying.
  22636. Filter selects among &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis.
  22637. </p>
  22638. </dd>
  22639. <dt>&lsquo;<samp class="samp">A</samp>&rsquo;</dt>
  22640. <dd><p>Capture determined by field flags, transfer unknown or varying.
  22641. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo;, &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using field flags and
  22642. image analysis. If no field information is available, then this works just
  22643. like &lsquo;<samp class="samp">U</samp>&rsquo;. This is the default mode.
  22644. </p>
  22645. </dd>
  22646. <dt>&lsquo;<samp class="samp">U</samp>&rsquo;</dt>
  22647. <dd><p>Both capture and transfer unknown or varying.
  22648. Filter selects among &lsquo;<samp class="samp">t</samp>&rsquo;, &lsquo;<samp class="samp">b</samp>&rsquo; and &lsquo;<samp class="samp">p</samp>&rsquo; using image analysis only.
  22649. </p></dd>
  22650. </dl>
  22651. </dd>
  22652. </dl>
  22653. <a name="Commands-129"></a>
  22654. <h4 class="subsection">11.188.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-129" aria-hidden="true">TOC</a></span></h4>
  22655. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  22656. </p>
  22657. <a name="photosensitivity"></a>
  22658. <h3 class="section">11.189 photosensitivity<span class="pull-right"><a class="anchor hidden-xs" href="#photosensitivity" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-photosensitivity" aria-hidden="true">TOC</a></span></h3>
  22659. <p>Reduce various flashes in video, so to help users with epilepsy.
  22660. </p>
  22661. <p>It accepts the following options:
  22662. </p><dl class="table">
  22663. <dt><samp class="option">frames, f</samp></dt>
  22664. <dd><p>Set how many frames to use when filtering. Default is 30.
  22665. </p>
  22666. </dd>
  22667. <dt><samp class="option">threshold, t</samp></dt>
  22668. <dd><p>Set detection threshold factor. Default is 1.
  22669. Lower is stricter.
  22670. </p>
  22671. </dd>
  22672. <dt><samp class="option">skip</samp></dt>
  22673. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  22674. Allowed range is from 1 to 1024.
  22675. </p>
  22676. </dd>
  22677. <dt><samp class="option">bypass</samp></dt>
  22678. <dd><p>Leave frames unchanged. Default is disabled.
  22679. </p></dd>
  22680. </dl>
  22681. <a name="pixdesctest"></a>
  22682. <h3 class="section">11.190 pixdesctest<span class="pull-right"><a class="anchor hidden-xs" href="#pixdesctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixdesctest" aria-hidden="true">TOC</a></span></h3>
  22683. <p>Pixel format descriptor test filter, mainly useful for internal
  22684. testing. The output video should be equal to the input video.
  22685. </p>
  22686. <p>For example:
  22687. </p><div class="example">
  22688. <pre class="example-preformatted">format=monow, pixdesctest
  22689. </pre></div>
  22690. <p>can be used to test the monowhite pixel format descriptor definition.
  22691. </p>
  22692. <a name="pixelize"></a>
  22693. <h3 class="section">11.191 pixelize<span class="pull-right"><a class="anchor hidden-xs" href="#pixelize" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixelize" aria-hidden="true">TOC</a></span></h3>
  22694. <p>Apply pixelization to video stream.
  22695. </p>
  22696. <p>The filter accepts the following options:
  22697. </p><dl class="table">
  22698. <dt><samp class="option">width, w</samp></dt>
  22699. <dt><samp class="option">height, h</samp></dt>
  22700. <dd><p>Set block dimensions that will be used for pixelization.
  22701. Default value is <code class="code">16</code>.
  22702. </p>
  22703. </dd>
  22704. <dt><samp class="option">mode, m</samp></dt>
  22705. <dd><p>Set the mode of pixelization used.
  22706. </p>
  22707. <p>Possible values are:
  22708. </p><dl class="table">
  22709. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  22710. <dt>&lsquo;<samp class="samp">min</samp>&rsquo;</dt>
  22711. <dt>&lsquo;<samp class="samp">max</samp>&rsquo;</dt>
  22712. </dl>
  22713. <p>Default value is <code class="code">avg</code>.
  22714. </p>
  22715. </dd>
  22716. <dt><samp class="option">planes, p</samp></dt>
  22717. <dd><p>Set what planes to filter. Default is to filter all planes.
  22718. </p></dd>
  22719. </dl>
  22720. <a name="Commands-130"></a>
  22721. <h4 class="subsection">11.191.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-130" aria-hidden="true">TOC</a></span></h4>
  22722. <p>This filter supports all options as <a class="ref" href="#commands">commands</a>.
  22723. </p>
  22724. <a name="pixscope"></a>
  22725. <h3 class="section">11.192 pixscope<span class="pull-right"><a class="anchor hidden-xs" href="#pixscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pixscope" aria-hidden="true">TOC</a></span></h3>
  22726. <p>Display sample values of color channels. Mainly useful for checking color
  22727. and levels. Minimum supported resolution is 640x480.
  22728. </p>
  22729. <p>The filters accept the following options:
  22730. </p>
  22731. <dl class="table">
  22732. <dt><samp class="option">x</samp></dt>
  22733. <dd><p>Set scope X position, relative offset on X axis.
  22734. </p>
  22735. </dd>
  22736. <dt><samp class="option">y</samp></dt>
  22737. <dd><p>Set scope Y position, relative offset on Y axis.
  22738. </p>
  22739. </dd>
  22740. <dt><samp class="option">w</samp></dt>
  22741. <dd><p>Set scope width.
  22742. </p>
  22743. </dd>
  22744. <dt><samp class="option">h</samp></dt>
  22745. <dd><p>Set scope height.
  22746. </p>
  22747. </dd>
  22748. <dt><samp class="option">o</samp></dt>
  22749. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  22750. </p>
  22751. </dd>
  22752. <dt><samp class="option">wx</samp></dt>
  22753. <dd><p>Set window X position, relative offset on X axis.
  22754. </p>
  22755. </dd>
  22756. <dt><samp class="option">wy</samp></dt>
  22757. <dd><p>Set window Y position, relative offset on Y axis.
  22758. </p></dd>
  22759. </dl>
  22760. <a name="Commands-131"></a>
  22761. <h4 class="subsection">11.192.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-131" aria-hidden="true">TOC</a></span></h4>
  22762. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  22763. </p>
  22764. <a name="pp7"></a>
  22765. <h3 class="section">11.193 pp7<span class="pull-right"><a class="anchor hidden-xs" href="#pp7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp7" aria-hidden="true">TOC</a></span></h3>
  22766. <p>Apply Postprocessing filter 7. It is variant of the <a class="ref" href="#spp">spp</a> filter,
  22767. similar to spp = 6 with 7 point DCT, where only the center sample is
  22768. used after IDCT.
  22769. </p>
  22770. <p>The filter accepts the following options:
  22771. </p>
  22772. <dl class="table">
  22773. <dt><samp class="option">qp</samp></dt>
  22774. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  22775. 0 to 63. If not set, the filter will use the QP from the video stream
  22776. (if available).
  22777. </p>
  22778. </dd>
  22779. <dt><samp class="option">mode</samp></dt>
  22780. <dd><p>Set thresholding mode. Available modes are:
  22781. </p>
  22782. <dl class="table">
  22783. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  22784. <dd><p>Set hard thresholding.
  22785. </p></dd>
  22786. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  22787. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  22788. </p></dd>
  22789. <dt>&lsquo;<samp class="samp">medium</samp>&rsquo;</dt>
  22790. <dd><p>Set medium thresholding (good results, default).
  22791. </p></dd>
  22792. </dl>
  22793. </dd>
  22794. </dl>
  22795. <a name="premultiply"></a>
  22796. <h3 class="section">11.194 premultiply<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply" aria-hidden="true">TOC</a></span></h3>
  22797. <p>Apply alpha premultiply effect to input video stream using first plane
  22798. of second stream as alpha.
  22799. </p>
  22800. <p>Both streams must have same dimensions and same pixel format.
  22801. </p>
  22802. <p>The filter accepts the following option:
  22803. </p>
  22804. <dl class="table">
  22805. <dt><samp class="option">planes</samp></dt>
  22806. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  22807. By default value 0xf, all planes will be processed.
  22808. </p>
  22809. </dd>
  22810. <dt><samp class="option">inplace</samp></dt>
  22811. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  22812. </p></dd>
  22813. </dl>
  22814. <a name="premultiply_005fdynamic"></a>
  22815. <h3 class="section">11.195 premultiply_dynamic<span class="pull-right"><a class="anchor hidden-xs" href="#premultiply_005fdynamic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-premultiply_005fdynamic" aria-hidden="true">TOC</a></span></h3>
  22816. <p>Dynamically premultiply or unpremultiply the input video stream as needed,
  22817. to match the requirements of the downstream filter graph. This is roughly
  22818. equivalent to either <code class="code">premultiply:inplace=yes</code> or
  22819. <code class="code">unpremultiply:inplace=yes</code>, or otherwise a noop.
  22820. </p>
  22821. <p>The filter accepts the following option:
  22822. </p>
  22823. <dl class="table">
  22824. <dt><samp class="option">planes</samp></dt>
  22825. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  22826. By default value 0xf, all planes will be processed.
  22827. </p></dd>
  22828. </dl>
  22829. <a name="prewitt"></a>
  22830. <h3 class="section">11.196 prewitt<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt" aria-hidden="true">TOC</a></span></h3>
  22831. <p>Apply prewitt operator to input video stream.
  22832. </p>
  22833. <p>The filter accepts the following option:
  22834. </p>
  22835. <dl class="table">
  22836. <dt><samp class="option">planes</samp></dt>
  22837. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  22838. By default value 0xf, all planes will be processed.
  22839. </p>
  22840. </dd>
  22841. <dt><samp class="option">scale</samp></dt>
  22842. <dd><p>Set value which will be multiplied with filtered result.
  22843. </p>
  22844. </dd>
  22845. <dt><samp class="option">delta</samp></dt>
  22846. <dd><p>Set value which will be added to filtered result.
  22847. </p></dd>
  22848. </dl>
  22849. <a name="Commands-132"></a>
  22850. <h4 class="subsection">11.196.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-132" aria-hidden="true">TOC</a></span></h4>
  22851. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  22852. </p>
  22853. <a name="pseudocolor"></a>
  22854. <h3 class="section">11.197 pseudocolor<span class="pull-right"><a class="anchor hidden-xs" href="#pseudocolor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pseudocolor" aria-hidden="true">TOC</a></span></h3>
  22855. <p>Alter frame colors in video with pseudocolors.
  22856. </p>
  22857. <p>This filter accepts the following options:
  22858. </p>
  22859. <dl class="table">
  22860. <dt><samp class="option">c0</samp></dt>
  22861. <dd><p>set pixel first component expression
  22862. </p>
  22863. </dd>
  22864. <dt><samp class="option">c1</samp></dt>
  22865. <dd><p>set pixel second component expression
  22866. </p>
  22867. </dd>
  22868. <dt><samp class="option">c2</samp></dt>
  22869. <dd><p>set pixel third component expression
  22870. </p>
  22871. </dd>
  22872. <dt><samp class="option">c3</samp></dt>
  22873. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  22874. </p>
  22875. </dd>
  22876. <dt><samp class="option">index, i</samp></dt>
  22877. <dd><p>set component to use as base for altering colors
  22878. </p>
  22879. </dd>
  22880. <dt><samp class="option">preset, p</samp></dt>
  22881. <dd><p>Pick one of built-in LUTs. By default is set to none.
  22882. </p>
  22883. <p>Available LUTs:
  22884. </p><dl class="table">
  22885. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  22886. <dt>&lsquo;<samp class="samp">inferno</samp>&rsquo;</dt>
  22887. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  22888. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  22889. <dt>&lsquo;<samp class="samp">turbo</samp>&rsquo;</dt>
  22890. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  22891. <dt>&lsquo;<samp class="samp">range1</samp>&rsquo;</dt>
  22892. <dt>&lsquo;<samp class="samp">range2</samp>&rsquo;</dt>
  22893. <dt>&lsquo;<samp class="samp">shadows</samp>&rsquo;</dt>
  22894. <dt>&lsquo;<samp class="samp">highlights</samp>&rsquo;</dt>
  22895. <dt>&lsquo;<samp class="samp">solar</samp>&rsquo;</dt>
  22896. <dt>&lsquo;<samp class="samp">nominal</samp>&rsquo;</dt>
  22897. <dt>&lsquo;<samp class="samp">preferred</samp>&rsquo;</dt>
  22898. <dt>&lsquo;<samp class="samp">total</samp>&rsquo;</dt>
  22899. <dt>&lsquo;<samp class="samp">spectral</samp>&rsquo;</dt>
  22900. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  22901. <dt>&lsquo;<samp class="samp">heat</samp>&rsquo;</dt>
  22902. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  22903. <dt>&lsquo;<samp class="samp">blues</samp>&rsquo;</dt>
  22904. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  22905. <dt>&lsquo;<samp class="samp">helix</samp>&rsquo;</dt>
  22906. </dl>
  22907. </dd>
  22908. <dt><samp class="option">opacity</samp></dt>
  22909. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  22910. Default value is set to 1.
  22911. </p></dd>
  22912. </dl>
  22913. <p>Each of the expression options specifies the expression to use for computing
  22914. the lookup table for the corresponding pixel component values.
  22915. </p>
  22916. <p>The expressions can contain the following constants and functions:
  22917. </p>
  22918. <dl class="table">
  22919. <dt><samp class="option">w</samp></dt>
  22920. <dt><samp class="option">h</samp></dt>
  22921. <dd><p>The input width and height.
  22922. </p>
  22923. </dd>
  22924. <dt><samp class="option">val</samp></dt>
  22925. <dd><p>The input value for the pixel component.
  22926. </p>
  22927. </dd>
  22928. <dt><samp class="option">ymin, umin, vmin, amin</samp></dt>
  22929. <dd><p>The minimum allowed component value.
  22930. </p>
  22931. </dd>
  22932. <dt><samp class="option">ymax, umax, vmax, amax</samp></dt>
  22933. <dd><p>The maximum allowed component value.
  22934. </p></dd>
  22935. </dl>
  22936. <p>All expressions default to &quot;val&quot;.
  22937. </p>
  22938. <a name="Commands-133"></a>
  22939. <h4 class="subsection">11.197.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-133" aria-hidden="true">TOC</a></span></h4>
  22940. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  22941. </p>
  22942. <a name="Examples-106"></a>
  22943. <h4 class="subsection">11.197.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-106" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-106" aria-hidden="true">TOC</a></span></h4>
  22944. <ul class="itemize mark-bullet">
  22945. <li>Change too high luma values to gradient:
  22946. <div class="example">
  22947. <pre class="example-preformatted">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;
  22948. </pre></div>
  22949. </li></ul>
  22950. <a class="anchor" id="psnr"></a><a name="psnr-1"></a>
  22951. <h3 class="section">11.198 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr-1" aria-hidden="true">TOC</a></span></h3>
  22952. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  22953. Ratio) between two input videos.
  22954. </p>
  22955. <p>This filter takes in input two input videos, the first input is
  22956. considered the &quot;main&quot; source and is passed unchanged to the
  22957. output. The second input is used as a &quot;reference&quot; video for computing
  22958. the PSNR.
  22959. </p>
  22960. <p>Both video inputs must have the same resolution and pixel format for
  22961. this filter to work correctly. Also it assumes that both inputs
  22962. have the same number of frames, which are compared one by one.
  22963. </p>
  22964. <p>The obtained average PSNR is printed through the logging system.
  22965. </p>
  22966. <p>The filter stores the accumulated MSE (mean squared error) of each
  22967. frame, and at the end of the processing it is averaged across all frames
  22968. equally, and the following formula is applied to obtain the PSNR:
  22969. </p>
  22970. <div class="example">
  22971. <pre class="example-preformatted">PSNR = 10*log10(MAX^2/MSE)
  22972. </pre></div>
  22973. <p>Where MAX is the average of the maximum values of each component of the
  22974. image.
  22975. </p>
  22976. <p>The description of the accepted parameters follows.
  22977. </p>
  22978. <dl class="table">
  22979. <dt><samp class="option">stats_file, f</samp></dt>
  22980. <dd><p>If specified the filter will use the named file to save the PSNR of
  22981. each individual frame. When filename equals &quot;-&quot; the data is sent to
  22982. standard output.
  22983. </p>
  22984. </dd>
  22985. <dt><samp class="option">stats_version</samp></dt>
  22986. <dd><p>Specifies which version of the stats file format to use. Details of
  22987. each format are written below.
  22988. Default value is 1.
  22989. </p>
  22990. </dd>
  22991. <dt><samp class="option">output_max</samp></dt>
  22992. <dd><p>Determines whether the max value is output to the stats log.
  22993. Default value is 0.
  22994. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  22995. the filter will return an error.
  22996. </p></dd>
  22997. </dl>
  22998. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  22999. </p>
  23000. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  23001. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  23002. couple of frames.
  23003. </p>
  23004. <p>If a <var class="var">stats_version</var> greater than 1 is specified, a header line precedes
  23005. the list of per-frame-pair stats, with key value pairs following the frame
  23006. format with the following parameters:
  23007. </p>
  23008. <dl class="table">
  23009. <dt><samp class="option">psnr_log_version</samp></dt>
  23010. <dd><p>The version of the log file format. Will match <var class="var">stats_version</var>.
  23011. </p>
  23012. </dd>
  23013. <dt><samp class="option">fields</samp></dt>
  23014. <dd><p>A comma separated list of the per-frame-pair parameters included in
  23015. the log.
  23016. </p></dd>
  23017. </dl>
  23018. <p>A description of each shown per-frame-pair parameter follows:
  23019. </p>
  23020. <dl class="table">
  23021. <dt><samp class="option">n</samp></dt>
  23022. <dd><p>sequential number of the input frame, starting from 1
  23023. </p>
  23024. </dd>
  23025. <dt><samp class="option">mse_avg</samp></dt>
  23026. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  23027. frames, averaged over all the image components.
  23028. </p>
  23029. </dd>
  23030. <dt><samp class="option">mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  23031. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  23032. frames for the component specified by the suffix.
  23033. </p>
  23034. </dd>
  23035. <dt><samp class="option">psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  23036. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  23037. specified by the suffix.
  23038. </p>
  23039. </dd>
  23040. <dt><samp class="option">max_avg, max_y, max_u, max_v</samp></dt>
  23041. <dd><p>Maximum allowed value for each channel, and average over all
  23042. channels.
  23043. </p></dd>
  23044. </dl>
  23045. <a name="Examples-107"></a>
  23046. <h4 class="subsection">11.198.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-107" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-107" aria-hidden="true">TOC</a></span></h4>
  23047. <ul class="itemize mark-bullet">
  23048. <li>For example:
  23049. <div class="example">
  23050. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  23051. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  23052. </pre></div>
  23053. <p>On this example the input file being processed is compared with the
  23054. reference file <samp class="file">ref_movie.mpg</samp>. The PSNR of each individual frame
  23055. is stored in <samp class="file">stats.log</samp>.
  23056. </p>
  23057. </li><li>Another example with different containers:
  23058. <div class="example">
  23059. <pre class="example-preformatted">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 -
  23060. </pre></div>
  23061. </li></ul>
  23062. <a class="anchor" id="pullup"></a><a name="pullup-1"></a>
  23063. <h3 class="section">11.199 pullup<span class="pull-right"><a class="anchor hidden-xs" href="#pullup-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pullup-1" aria-hidden="true">TOC</a></span></h3>
  23064. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  23065. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  23066. content.
  23067. </p>
  23068. <p>The pullup filter is designed to take advantage of future context in making
  23069. its decisions. This filter is stateless in the sense that it does not lock
  23070. onto a pattern to follow, but it instead looks forward to the following
  23071. fields in order to identify matches and rebuild progressive frames.
  23072. </p>
  23073. <p>To produce content with an even framerate, insert the fps filter after
  23074. pullup, use <code class="code">fps=24000/1001</code> if the input frame rate is 29.97fps,
  23075. <code class="code">fps=24</code> for 30fps and the (rare) telecined 25fps input.
  23076. </p>
  23077. <p>The filter accepts the following options:
  23078. </p>
  23079. <dl class="table">
  23080. <dt><samp class="option">jl</samp></dt>
  23081. <dt><samp class="option">jr</samp></dt>
  23082. <dt><samp class="option">jt</samp></dt>
  23083. <dt><samp class="option">jb</samp></dt>
  23084. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  23085. bottom of the image, respectively. Left and right are in units of 8 pixels,
  23086. while top and bottom are in units of 2 lines.
  23087. The default is 8 pixels on each side.
  23088. </p>
  23089. </dd>
  23090. <dt><samp class="option">sb</samp></dt>
  23091. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  23092. filter generating an occasional mismatched frame, but it may also cause an
  23093. excessive number of frames to be dropped during high motion sequences.
  23094. Conversely, setting it to -1 will make filter match fields more easily.
  23095. This may help processing of video where there is slight blurring between
  23096. the fields, but may also cause there to be interlaced frames in the output.
  23097. Default value is <code class="code">0</code>.
  23098. </p>
  23099. </dd>
  23100. <dt><samp class="option">mp</samp></dt>
  23101. <dd><p>Set the metric plane to use. It accepts the following values:
  23102. </p><dl class="table">
  23103. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  23104. <dd><p>Use luma plane.
  23105. </p>
  23106. </dd>
  23107. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  23108. <dd><p>Use chroma blue plane.
  23109. </p>
  23110. </dd>
  23111. <dt>&lsquo;<samp class="samp">v</samp>&rsquo;</dt>
  23112. <dd><p>Use chroma red plane.
  23113. </p></dd>
  23114. </dl>
  23115. <p>This option may be set to use chroma plane instead of the default luma plane
  23116. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  23117. source material, but more likely will decrease accuracy, especially if there
  23118. is chroma noise (rainbow effect) or any grayscale video.
  23119. The main purpose of setting <samp class="option">mp</samp> to a chroma plane is to reduce CPU
  23120. load and make pullup usable in realtime on slow machines.
  23121. </p></dd>
  23122. </dl>
  23123. <p>For best results (without duplicated frames in the output file) it is
  23124. necessary to change the output frame rate. For example, to inverse
  23125. telecine NTSC input:
  23126. </p><div class="example">
  23127. <pre class="example-preformatted">ffmpeg -i input -vf pullup -r 24000/1001 ...
  23128. </pre></div>
  23129. <a name="qp"></a>
  23130. <h3 class="section">11.200 qp<span class="pull-right"><a class="anchor hidden-xs" href="#qp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qp" aria-hidden="true">TOC</a></span></h3>
  23131. <p>Change video quantization parameters (QP).
  23132. </p>
  23133. <p>The filter accepts the following option:
  23134. </p>
  23135. <dl class="table">
  23136. <dt><samp class="option">qp</samp></dt>
  23137. <dd><p>Set expression for quantization parameter.
  23138. </p></dd>
  23139. </dl>
  23140. <p>The expression is evaluated through the eval API and can contain, among others,
  23141. the following constants:
  23142. </p>
  23143. <dl class="table">
  23144. <dt><var class="var">known</var></dt>
  23145. <dd><p>1 if index is not 129, 0 otherwise.
  23146. </p>
  23147. </dd>
  23148. <dt><var class="var">qp</var></dt>
  23149. <dd><p>Sequential index starting from -129 to 128.
  23150. </p></dd>
  23151. </dl>
  23152. <a name="Examples-108"></a>
  23153. <h4 class="subsection">11.200.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-108" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-108" aria-hidden="true">TOC</a></span></h4>
  23154. <ul class="itemize mark-bullet">
  23155. <li>Some equation like:
  23156. <div class="example">
  23157. <pre class="example-preformatted">qp=2+2*sin(PI*qp)
  23158. </pre></div>
  23159. </li></ul>
  23160. <a name="qrencode"></a>
  23161. <h3 class="section">11.201 qrencode<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode" aria-hidden="true">TOC</a></span></h3>
  23162. <p>Generate a QR code using the libqrencode library (see
  23163. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>), and overlay it on top of the current
  23164. frame.
  23165. </p>
  23166. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  23167. <code class="code">--enable-libqrencode</code>.
  23168. </p>
  23169. <p>The QR code is generated from the provided text or text pattern. The
  23170. corresponding QR code is scaled and overlaid into the video output according to
  23171. the specified options.
  23172. </p>
  23173. <p>In case no text is specified, no QR code is overlaied.
  23174. </p>
  23175. <p>This filter accepts the following options:
  23176. </p>
  23177. <dl class="table">
  23178. <dt><samp class="option">qrcode_width, q</samp></dt>
  23179. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  23180. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  23181. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  23182. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  23183. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  23184. there is no padding.
  23185. </p>
  23186. <p>These expressions are evaluated for each new frame.
  23187. </p>
  23188. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  23189. </p>
  23190. </dd>
  23191. <dt><samp class="option">x</samp></dt>
  23192. <dt><samp class="option">y</samp></dt>
  23193. <dd><p>Specify an expression for positioning the padded QR code top-left corner. The
  23194. <var class="var">x</var> expression can reference the value set by the <var class="var">y</var> expression, and
  23195. vice.
  23196. </p>
  23197. <p>By default <var class="var">x</var> and <var class="var">y</var> are set set to <var class="var">0</var>, meaning that the QR code
  23198. is placed in the top left corner of the input.
  23199. </p>
  23200. <p>These expressions are evaluated for each new frame.
  23201. </p>
  23202. <p>See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  23203. </p>
  23204. </dd>
  23205. <dt><samp class="option">case_sensitive, cs</samp></dt>
  23206. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  23207. default. This can be disabled to reduce the QR encoding size.
  23208. </p>
  23209. </dd>
  23210. <dt><samp class="option">level, l</samp></dt>
  23211. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  23212. the encoding size will increase but the code will be more robust to corruption.
  23213. Lower level is <var class="var">L</var>.
  23214. </p>
  23215. <p>It accepts the following values:
  23216. </p><dl class="table">
  23217. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  23218. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  23219. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  23220. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  23221. </dl>
  23222. </dd>
  23223. <dt><samp class="option">expansion</samp></dt>
  23224. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  23225. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  23226. section below for details.
  23227. </p>
  23228. </dd>
  23229. <dt><samp class="option">text</samp></dt>
  23230. <dt><samp class="option">textfile</samp></dt>
  23231. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  23232. (just an empty colored frame).
  23233. </p>
  23234. <p>In case expansion is enabled, the text is treated as a text template, using the
  23235. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  23236. Text expansion</a> section below for details.
  23237. </p>
  23238. </dd>
  23239. <dt><samp class="option">background_color, bc</samp></dt>
  23240. <dt><samp class="option">foreground_color, fc</samp></dt>
  23241. <dd><p>Set the QR code and background color. The default value of
  23242. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  23243. is &quot;white&quot;.
  23244. </p>
  23245. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  23246. section in the ffmpeg-utils manual</a>.
  23247. </p></dd>
  23248. </dl>
  23249. <a class="anchor" id="qrencode_005fexpressions"></a><a name="qrencode-Expressions"></a>
  23250. <h4 class="subsection">11.201.1 qrencode Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Expressions" aria-hidden="true">TOC</a></span></h4>
  23251. <p>The expressions set by the options contain the following constants and functions.
  23252. </p>
  23253. <dl class="table">
  23254. <dt><samp class="option">dar</samp></dt>
  23255. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  23256. </p>
  23257. </dd>
  23258. <dt><samp class="option">duration</samp></dt>
  23259. <dd><p>the current frame&rsquo;s duration, in seconds
  23260. </p>
  23261. </dd>
  23262. <dt><samp class="option">hsub</samp></dt>
  23263. <dt><samp class="option">vsub</samp></dt>
  23264. <dd><p>horizontal and vertical chroma subsample values. For example for the
  23265. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  23266. </p>
  23267. </dd>
  23268. <dt><samp class="option">main_h, H</samp></dt>
  23269. <dd><p>the input height
  23270. </p>
  23271. </dd>
  23272. <dt><samp class="option">main_w, W</samp></dt>
  23273. <dd><p>the input width
  23274. </p>
  23275. </dd>
  23276. <dt><samp class="option">n</samp></dt>
  23277. <dd><p>the number of input frame, starting from 0
  23278. </p>
  23279. </dd>
  23280. <dt><samp class="option">pict_type</samp></dt>
  23281. <dd><p>a number representing the picture type
  23282. </p>
  23283. </dd>
  23284. <dt><samp class="option">qr_w, w</samp></dt>
  23285. <dd><p>the width of the encoded QR code
  23286. </p>
  23287. </dd>
  23288. <dt><samp class="option">rendered_qr_w, q</samp></dt>
  23289. <dt><samp class="option">rendered_padded_qr_w, Q</samp></dt>
  23290. <dd><p>the width of the rendered QR code, without and without padding.
  23291. </p>
  23292. <p>These parameters allow the <var class="var">q</var> and <var class="var">Q</var> expressions to refer to each
  23293. other, so you can for example specify <code class="code">q=3/4*Q</code>.
  23294. </p>
  23295. </dd>
  23296. <dt><samp class="option">rand(min, max)</samp></dt>
  23297. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  23298. </p>
  23299. </dd>
  23300. <dt><samp class="option">sar</samp></dt>
  23301. <dd><p>the input sample aspect ratio
  23302. </p>
  23303. </dd>
  23304. <dt><samp class="option">t</samp></dt>
  23305. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  23306. </p>
  23307. </dd>
  23308. <dt><samp class="option">x</samp></dt>
  23309. <dt><samp class="option">y</samp></dt>
  23310. <dd><p>the x and y offset coordinates where the text is drawn.
  23311. </p>
  23312. <p>These parameters allow the <var class="var">x</var> and <var class="var">y</var> expressions to refer to each
  23313. other, so you can for example specify <code class="code">y=x/dar</code>.
  23314. </p></dd>
  23315. </dl>
  23316. <a class="anchor" id="qrencode_005ftext_005fexpansion"></a><a name="qrencode-Text-expansion"></a>
  23317. <h4 class="subsection">11.201.2 qrencode Text expansion<span class="pull-right"><a class="anchor hidden-xs" href="#qrencode-Text-expansion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencode-Text-expansion" aria-hidden="true">TOC</a></span></h4>
  23318. <p>If <samp class="option">expansion</samp> is set to <code class="code">none</code>, the text is printed verbatim.
  23319. </p>
  23320. <p>If <samp class="option">expansion</samp> is set to <code class="code">normal</code> (which is the default),
  23321. the following expansion mechanism is used.
  23322. </p>
  23323. <p>The backslash character &lsquo;<samp class="samp">\</samp>&rsquo;, followed by any character, always expands to
  23324. the second character.
  23325. </p>
  23326. <p>Sequences of the form <code class="code">%{...}</code> are expanded. The text between the
  23327. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  23328. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  23329. they should be escaped.
  23330. </p>
  23331. <p>Note that they probably must also be escaped as the value for the <samp class="option">text</samp>
  23332. option in the filter argument string and as the filter argument in the
  23333. filtergraph description, and possibly also for the shell, that makes up to four
  23334. levels of escaping; using a text file with the <samp class="option">textfile</samp> option avoids
  23335. these problems.
  23336. </p>
  23337. <p>The following functions are available:
  23338. </p>
  23339. <dl class="table">
  23340. <dt><code class="command">n, frame_num</code></dt>
  23341. <dd><p>return the frame number
  23342. </p>
  23343. </dd>
  23344. <dt><code class="command">pts</code></dt>
  23345. <dd><p>Return the presentation timestamp of the current frame.
  23346. </p>
  23347. <p>It can take up to two arguments.
  23348. </p>
  23349. <p>The first argument is the format of the timestamp; it defaults to <code class="code">flt</code> for
  23350. seconds as a decimal number with microsecond accuracy; <code class="code">hms</code> stands for a
  23351. formatted <var class="var">[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  23352. <code class="code">gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  23353. <code class="code">localtime</code> stands for the timestamp of the frame formatted as local time
  23354. zone time. If the format is set to <code class="code">hms24hh</code>, the time is formatted in 24h
  23355. format (00-23).
  23356. </p>
  23357. <p>The second argument is an offset added to the timestamp.
  23358. </p>
  23359. <p>If the format is set to <code class="code">localtime</code> or <code class="code">gmtime</code>, a third argument may
  23360. be supplied: a <code class="code">strftime</code> C function format string. By default,
  23361. <var class="var">YYYY-MM-DD HH:MM:SS</var> format will be used.
  23362. </p>
  23363. </dd>
  23364. <dt><code class="command">expr, e</code></dt>
  23365. <dd><p>Evaluate the expression&rsquo;s value and output as a double.
  23366. </p>
  23367. <p>It must take one argument specifying the expression to be evaluated, accepting
  23368. the constants and functions defined in <a class="ref" href="#qrencode_005fexpressions">qrencode_expressions</a>.
  23369. </p>
  23370. </dd>
  23371. <dt><code class="command">expr_formatted, ef</code></dt>
  23372. <dd><p>Evaluate the expression&rsquo;s value and output as a formatted string.
  23373. </p>
  23374. <p>The first argument is the expression to be evaluated, just as for the <var class="var">expr</var> function.
  23375. The second argument specifies the output format. Allowed values are &lsquo;<samp class="samp">x</samp>&rsquo;,
  23376. &lsquo;<samp class="samp">X</samp>&rsquo;, &lsquo;<samp class="samp">d</samp>&rsquo; and &lsquo;<samp class="samp">u</samp>&rsquo;. They are treated exactly as in the
  23377. <code class="code">printf</code> function.
  23378. The third parameter is optional and sets the number of positions taken by the output.
  23379. It can be used to add padding with zeros from the left.
  23380. </p>
  23381. </dd>
  23382. <dt><code class="command">gmtime</code></dt>
  23383. <dd><p>The time at which the filter is running, expressed in UTC.
  23384. It can accept an argument: a <code class="code">strftime</code> C function format string.
  23385. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  23386. which prints fractions of the second with optionally specified number of digits.
  23387. </p>
  23388. </dd>
  23389. <dt><code class="command">localtime</code></dt>
  23390. <dd><p>The time at which the filter is running, expressed in the local time zone.
  23391. It can accept an argument: a <code class="code">strftime</code> C function format string.
  23392. The format string is extended to support the variable <var class="var">%[1-6]N</var>
  23393. which prints fractions of the second with optionally specified number of digits.
  23394. </p>
  23395. </dd>
  23396. <dt><code class="command">metadata</code></dt>
  23397. <dd><p>Frame metadata. Takes one or two arguments.
  23398. </p>
  23399. <p>The first argument is mandatory and specifies the metadata key.
  23400. </p>
  23401. <p>The second argument is optional and specifies a default value, used when the
  23402. metadata key is not found or empty.
  23403. </p>
  23404. <p>Available metadata can be identified by inspecting entries starting with TAG
  23405. included within each frame section printed by running <code class="code">ffprobe
  23406. -show_frames</code>.
  23407. </p>
  23408. <p>String metadata generated in filters leading to the qrencode filter are also
  23409. available.
  23410. </p>
  23411. </dd>
  23412. <dt><code class="command">rand(min, max)</code></dt>
  23413. <dd><p>return a random number included between <var class="var">min</var> and <var class="var">max</var>
  23414. </p></dd>
  23415. </dl>
  23416. <a name="Examples-109"></a>
  23417. <h4 class="subsection">11.201.3 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-109" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-109" aria-hidden="true">TOC</a></span></h4>
  23418. <ul class="itemize mark-bullet">
  23419. <li>Generate a QR code encoding the specified text with the default size, overalaid
  23420. in the top left corner of the input video, with the default size:
  23421. <div class="example">
  23422. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org
  23423. </pre></div>
  23424. </li><li>Same as below, but select blue on pink colors:
  23425. <div class="example">
  23426. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:bc=pink@0.5:fc=blue
  23427. </pre></div>
  23428. </li><li>Place the QR code in the bottom right corner of the input video:
  23429. <div class="example">
  23430. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:x=W-Q:y=H-Q
  23431. </pre></div>
  23432. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  23433. 4/3 of the QR code width:
  23434. <div class="example">
  23435. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=200:Q=4/3*q
  23436. </pre></div>
  23437. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  23438. code width 3/4 of the padded width:
  23439. <div class="example">
  23440. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:Q=200:q=3/4*Q
  23441. </pre></div>
  23442. </li><li>Make the QR code a fraction of the input video width:
  23443. <div class="example">
  23444. <pre class="example-preformatted">qrencode=text=www.ffmpeg.org:q=W/5
  23445. </pre></div>
  23446. </li><li>Generate a QR code encoding the frame number:
  23447. <div class="example">
  23448. <pre class="example-preformatted">qrencode=text=%{n}
  23449. </pre></div>
  23450. </li><li>Generate a QR code encoding the GMT timestamp:
  23451. <div class="example">
  23452. <pre class="example-preformatted">qrencode=text=%{gmtime}
  23453. </pre></div>
  23454. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  23455. <div class="example">
  23456. <pre class="example-preformatted">qrencode=text=%{pts}
  23457. </pre></div>
  23458. </li></ul>
  23459. <a name="quirc"></a>
  23460. <h3 class="section">11.202 quirc<span class="pull-right"><a class="anchor hidden-xs" href="#quirc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-quirc" aria-hidden="true">TOC</a></span></h3>
  23461. <p>Identify and decode a QR code using the libquirc library (see
  23462. <a class="url" href="https://github.com/dlbeer/quirc/">https://github.com/dlbeer/quirc/</a>), and print the identified QR codes
  23463. positions and payload as metadata.
  23464. </p>
  23465. <p>To enable the compilation of this filter, you need to configure FFmpeg with
  23466. <code class="code">--enable-libquirc</code>.
  23467. </p>
  23468. <p>For each found QR code in the input video, some metadata entries are added with
  23469. the prefix <var class="var">lavfi.quirc.N</var>, where <var class="var">N</var> is the index, starting from 0,
  23470. associated to the QR code.
  23471. </p>
  23472. <p>A description of each metadata value follows:
  23473. </p>
  23474. <dl class="table">
  23475. <dt><samp class="option">lavfi.quirc.count</samp></dt>
  23476. <dd><p>the number of found QR codes, it is not set in case none was found
  23477. </p>
  23478. </dd>
  23479. <dt><samp class="option">lavfi.quirc.N.corner.M.x</samp></dt>
  23480. <dt><samp class="option">lavfi.quirc.N.coreer.M.y</samp></dt>
  23481. <dd><p>the x/y positions of the four corners of the square containing the QR code,
  23482. where <var class="var">M</var> is the index of the corner starting from 0
  23483. </p>
  23484. </dd>
  23485. <dt><samp class="option">lavfi.quirc.N.payload</samp></dt>
  23486. <dd><p>the payload of the QR code
  23487. </p></dd>
  23488. </dl>
  23489. <a name="random"></a>
  23490. <h3 class="section">11.203 random<span class="pull-right"><a class="anchor hidden-xs" href="#random" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-random" aria-hidden="true">TOC</a></span></h3>
  23491. <p>Flush video frames from internal cache of frames into a random order.
  23492. No frame is discarded.
  23493. Inspired by <a class="ref" href="#frei0r">frei0r</a> nervous filter.
  23494. </p>
  23495. <dl class="table">
  23496. <dt><samp class="option">frames</samp></dt>
  23497. <dd><p>Set size in number of frames of internal cache, in range from <code class="code">2</code> to
  23498. <code class="code">512</code>. Default is <code class="code">30</code>.
  23499. </p>
  23500. </dd>
  23501. <dt><samp class="option">seed</samp></dt>
  23502. <dd><p>Set seed for random number generator, must be an integer included between
  23503. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  23504. less than <code class="code">0</code>, the filter will try to use a good random seed on a
  23505. best effort basis.
  23506. </p></dd>
  23507. </dl>
  23508. <a name="readeia608"></a>
  23509. <h3 class="section">11.204 readeia608<span class="pull-right"><a class="anchor hidden-xs" href="#readeia608" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readeia608" aria-hidden="true">TOC</a></span></h3>
  23510. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  23511. </p>
  23512. <p>This filter adds frame metadata for <code class="code">lavfi.readeia608.X.cc</code> and
  23513. <code class="code">lavfi.readeia608.X.line</code>, where <code class="code">X</code> is the number of the identified line
  23514. with EIA-608 data (starting from 0). A description of each metadata value follows:
  23515. </p>
  23516. <dl class="table">
  23517. <dt><samp class="option">lavfi.readeia608.X.cc</samp></dt>
  23518. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  23519. </p>
  23520. </dd>
  23521. <dt><samp class="option">lavfi.readeia608.X.line</samp></dt>
  23522. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  23523. </p></dd>
  23524. </dl>
  23525. <p>This filter accepts the following options:
  23526. </p>
  23527. <dl class="table">
  23528. <dt><samp class="option">scan_min</samp></dt>
  23529. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code class="code">0</code>.
  23530. </p>
  23531. </dd>
  23532. <dt><samp class="option">scan_max</samp></dt>
  23533. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code class="code">29</code>.
  23534. </p>
  23535. </dd>
  23536. <dt><samp class="option">spw</samp></dt>
  23537. <dd><p>Set the ratio of width reserved for sync code detection.
  23538. Default is <code class="code">0.27</code>. Allowed range is <code class="code">[0.1 - 0.7]</code>.
  23539. </p>
  23540. </dd>
  23541. <dt><samp class="option">chp</samp></dt>
  23542. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  23543. <code class="code">0x00</code> for that character. Default is false.
  23544. </p>
  23545. </dd>
  23546. <dt><samp class="option">lp</samp></dt>
  23547. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  23548. </p></dd>
  23549. </dl>
  23550. <a name="Commands-134"></a>
  23551. <h4 class="subsection">11.204.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-134" aria-hidden="true">TOC</a></span></h4>
  23552. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23553. </p>
  23554. <a name="Examples-110"></a>
  23555. <h4 class="subsection">11.204.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-110" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-110" aria-hidden="true">TOC</a></span></h4>
  23556. <ul class="itemize mark-bullet">
  23557. <li>Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  23558. <div class="example">
  23559. <pre class="example-preformatted">ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
  23560. </pre></div>
  23561. </li></ul>
  23562. <a name="readvitc"></a>
  23563. <h3 class="section">11.205 readvitc<span class="pull-right"><a class="anchor hidden-xs" href="#readvitc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-readvitc" aria-hidden="true">TOC</a></span></h3>
  23564. <p>Read vertical interval timecode (VITC) information from the top lines of a
  23565. video frame.
  23566. </p>
  23567. <p>The filter adds frame metadata key <code class="code">lavfi.readvitc.tc_str</code> with the
  23568. timecode value, if a valid timecode has been detected. Further metadata key
  23569. <code class="code">lavfi.readvitc.found</code> is set to 0/1 depending on whether
  23570. timecode data has been found or not.
  23571. </p>
  23572. <p>This filter accepts the following options:
  23573. </p>
  23574. <dl class="table">
  23575. <dt><samp class="option">scan_max</samp></dt>
  23576. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  23577. <code class="code">-1</code> the full video frame is scanned. Default is <code class="code">45</code>.
  23578. </p>
  23579. </dd>
  23580. <dt><samp class="option">thr_b</samp></dt>
  23581. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  23582. default value is <code class="code">0.2</code>. The value must be equal or less than <code class="code">thr_w</code>.
  23583. </p>
  23584. </dd>
  23585. <dt><samp class="option">thr_w</samp></dt>
  23586. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  23587. default value is <code class="code">0.6</code>. The value must be equal or greater than <code class="code">thr_b</code>.
  23588. </p></dd>
  23589. </dl>
  23590. <a name="Examples-111"></a>
  23591. <h4 class="subsection">11.205.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-111" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-111" aria-hidden="true">TOC</a></span></h4>
  23592. <ul class="itemize mark-bullet">
  23593. <li>Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  23594. draw <code class="code">--:--:--:--</code> as a placeholder:
  23595. <div class="example">
  23596. <pre class="example-preformatted">ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
  23597. </pre></div>
  23598. </li></ul>
  23599. <a name="remap"></a>
  23600. <h3 class="section">11.206 remap<span class="pull-right"><a class="anchor hidden-xs" href="#remap" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap" aria-hidden="true">TOC</a></span></h3>
  23601. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  23602. </p>
  23603. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  23604. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  23605. value for pixel will be used for destination pixel.
  23606. </p>
  23607. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  23608. will have Xmap/Ymap video stream dimensions.
  23609. Xmap and Ymap input video streams are 16bit depth, single channel.
  23610. </p>
  23611. <dl class="table">
  23612. <dt><samp class="option">format</samp></dt>
  23613. <dd><p>Specify pixel format of output from this filter. Can be <code class="code">color</code> or <code class="code">gray</code>.
  23614. Default is <code class="code">color</code>.
  23615. </p>
  23616. </dd>
  23617. <dt><samp class="option">fill</samp></dt>
  23618. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  23619. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  23620. manual</a>. Default color is <code class="code">black</code>.
  23621. </p></dd>
  23622. </dl>
  23623. <a name="removegrain"></a>
  23624. <h3 class="section">11.207 removegrain<span class="pull-right"><a class="anchor hidden-xs" href="#removegrain" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removegrain" aria-hidden="true">TOC</a></span></h3>
  23625. <p>The removegrain filter is a spatial denoiser for progressive video.
  23626. </p>
  23627. <dl class="table">
  23628. <dt><samp class="option">m0</samp></dt>
  23629. <dd><p>Set mode for the first plane.
  23630. </p>
  23631. </dd>
  23632. <dt><samp class="option">m1</samp></dt>
  23633. <dd><p>Set mode for the second plane.
  23634. </p>
  23635. </dd>
  23636. <dt><samp class="option">m2</samp></dt>
  23637. <dd><p>Set mode for the third plane.
  23638. </p>
  23639. </dd>
  23640. <dt><samp class="option">m3</samp></dt>
  23641. <dd><p>Set mode for the fourth plane.
  23642. </p></dd>
  23643. </dl>
  23644. <p>Range of mode is from 0 to 24. Description of each mode follows:
  23645. </p>
  23646. <dl class="table">
  23647. <dt><var class="var">0</var></dt>
  23648. <dd><p>Leave input plane unchanged. Default.
  23649. </p>
  23650. </dd>
  23651. <dt><var class="var">1</var></dt>
  23652. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  23653. </p>
  23654. </dd>
  23655. <dt><var class="var">2</var></dt>
  23656. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  23657. </p>
  23658. </dd>
  23659. <dt><var class="var">3</var></dt>
  23660. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  23661. </p>
  23662. </dd>
  23663. <dt><var class="var">4</var></dt>
  23664. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  23665. This is equivalent to a median filter.
  23666. </p>
  23667. </dd>
  23668. <dt><var class="var">5</var></dt>
  23669. <dd><p>Line-sensitive clipping giving the minimal change.
  23670. </p>
  23671. </dd>
  23672. <dt><var class="var">6</var></dt>
  23673. <dd><p>Line-sensitive clipping, intermediate.
  23674. </p>
  23675. </dd>
  23676. <dt><var class="var">7</var></dt>
  23677. <dd><p>Line-sensitive clipping, intermediate.
  23678. </p>
  23679. </dd>
  23680. <dt><var class="var">8</var></dt>
  23681. <dd><p>Line-sensitive clipping, intermediate.
  23682. </p>
  23683. </dd>
  23684. <dt><var class="var">9</var></dt>
  23685. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  23686. </p>
  23687. </dd>
  23688. <dt><var class="var">10</var></dt>
  23689. <dd><p>Replaces the target pixel with the closest neighbour.
  23690. </p>
  23691. </dd>
  23692. <dt><var class="var">11</var></dt>
  23693. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  23694. </p>
  23695. </dd>
  23696. <dt><var class="var">12</var></dt>
  23697. <dd><p>Same as mode 11.
  23698. </p>
  23699. </dd>
  23700. <dt><var class="var">13</var></dt>
  23701. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  23702. pixels are the closest.
  23703. </p>
  23704. </dd>
  23705. <dt><var class="var">14</var></dt>
  23706. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  23707. pixels are the closest.
  23708. </p>
  23709. </dd>
  23710. <dt><var class="var">15</var></dt>
  23711. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  23712. interpolation formula.
  23713. </p>
  23714. </dd>
  23715. <dt><var class="var">16</var></dt>
  23716. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  23717. interpolation formula.
  23718. </p>
  23719. </dd>
  23720. <dt><var class="var">17</var></dt>
  23721. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  23722. minimum of each pair of opposite neighbour pixels.
  23723. </p>
  23724. </dd>
  23725. <dt><var class="var">18</var></dt>
  23726. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  23727. the current pixel is minimal.
  23728. </p>
  23729. </dd>
  23730. <dt><var class="var">19</var></dt>
  23731. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  23732. </p>
  23733. </dd>
  23734. <dt><var class="var">20</var></dt>
  23735. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  23736. </p>
  23737. </dd>
  23738. <dt><var class="var">21</var></dt>
  23739. <dd><p>Clips pixels using the averages of opposite neighbour.
  23740. </p>
  23741. </dd>
  23742. <dt><var class="var">22</var></dt>
  23743. <dd><p>Same as mode 21 but simpler and faster.
  23744. </p>
  23745. </dd>
  23746. <dt><var class="var">23</var></dt>
  23747. <dd><p>Small edge and halo removal, but reputed useless.
  23748. </p>
  23749. </dd>
  23750. <dt><var class="var">24</var></dt>
  23751. <dd><p>Similar as 23.
  23752. </p></dd>
  23753. </dl>
  23754. <a name="removelogo"></a>
  23755. <h3 class="section">11.208 removelogo<span class="pull-right"><a class="anchor hidden-xs" href="#removelogo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-removelogo" aria-hidden="true">TOC</a></span></h3>
  23756. <p>Suppress a TV station logo, using an image file to determine which
  23757. pixels comprise the logo. It works by filling in the pixels that
  23758. comprise the logo with neighboring pixels.
  23759. </p>
  23760. <p>The filter accepts the following options:
  23761. </p>
  23762. <dl class="table">
  23763. <dt><samp class="option">filename, f</samp></dt>
  23764. <dd><p>Set the filter bitmap file, which can be any image format supported by
  23765. libavformat. The width and height of the image file must match those of the
  23766. video stream being processed.
  23767. </p></dd>
  23768. </dl>
  23769. <p>Pixels in the provided bitmap image with a value of zero are not
  23770. considered part of the logo, non-zero pixels are considered part of
  23771. the logo. If you use white (255) for the logo and black (0) for the
  23772. rest, you will be safe. For making the filter bitmap, it is
  23773. recommended to take a screen capture of a black frame with the logo
  23774. visible, and then using a threshold filter followed by the erode
  23775. filter once or twice.
  23776. </p>
  23777. <p>If needed, little splotches can be fixed manually. Remember that if
  23778. logo pixels are not covered, the filter quality will be much
  23779. reduced. Marking too many pixels as part of the logo does not hurt as
  23780. much, but it will increase the amount of blurring needed to cover over
  23781. the image and will destroy more information than necessary, and extra
  23782. pixels will slow things down on a large logo.
  23783. </p>
  23784. <a name="repeatfields"></a>
  23785. <h3 class="section">11.209 repeatfields<span class="pull-right"><a class="anchor hidden-xs" href="#repeatfields" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-repeatfields" aria-hidden="true">TOC</a></span></h3>
  23786. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  23787. fields based on its value.
  23788. </p>
  23789. <a name="reverse"></a>
  23790. <h3 class="section">11.210 reverse<span class="pull-right"><a class="anchor hidden-xs" href="#reverse" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-reverse" aria-hidden="true">TOC</a></span></h3>
  23791. <p>Reverse a video clip.
  23792. </p>
  23793. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  23794. is suggested.
  23795. </p>
  23796. <a name="Examples-112"></a>
  23797. <h4 class="subsection">11.210.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-112" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-112" aria-hidden="true">TOC</a></span></h4>
  23798. <ul class="itemize mark-bullet">
  23799. <li>Take the first 5 seconds of a clip, and reverse it.
  23800. <div class="example">
  23801. <pre class="example-preformatted">trim=end=5,reverse
  23802. </pre></div>
  23803. </li></ul>
  23804. <a name="rgbashift"></a>
  23805. <h3 class="section">11.211 rgbashift<span class="pull-right"><a class="anchor hidden-xs" href="#rgbashift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rgbashift" aria-hidden="true">TOC</a></span></h3>
  23806. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  23807. </p>
  23808. <p>The filter accepts the following options:
  23809. </p><dl class="table">
  23810. <dt><samp class="option">rh</samp></dt>
  23811. <dd><p>Set amount to shift red horizontally.
  23812. </p></dd>
  23813. <dt><samp class="option">rv</samp></dt>
  23814. <dd><p>Set amount to shift red vertically.
  23815. </p></dd>
  23816. <dt><samp class="option">gh</samp></dt>
  23817. <dd><p>Set amount to shift green horizontally.
  23818. </p></dd>
  23819. <dt><samp class="option">gv</samp></dt>
  23820. <dd><p>Set amount to shift green vertically.
  23821. </p></dd>
  23822. <dt><samp class="option">bh</samp></dt>
  23823. <dd><p>Set amount to shift blue horizontally.
  23824. </p></dd>
  23825. <dt><samp class="option">bv</samp></dt>
  23826. <dd><p>Set amount to shift blue vertically.
  23827. </p></dd>
  23828. <dt><samp class="option">ah</samp></dt>
  23829. <dd><p>Set amount to shift alpha horizontally.
  23830. </p></dd>
  23831. <dt><samp class="option">av</samp></dt>
  23832. <dd><p>Set amount to shift alpha vertically.
  23833. </p></dd>
  23834. <dt><samp class="option">edge</samp></dt>
  23835. <dd><p>Set edge mode, can be <var class="var">smear</var>, default, or <var class="var">warp</var>.
  23836. </p></dd>
  23837. </dl>
  23838. <a name="Commands-135"></a>
  23839. <h4 class="subsection">11.211.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-135" aria-hidden="true">TOC</a></span></h4>
  23840. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23841. </p>
  23842. <a name="roberts"></a>
  23843. <h3 class="section">11.212 roberts<span class="pull-right"><a class="anchor hidden-xs" href="#roberts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts" aria-hidden="true">TOC</a></span></h3>
  23844. <p>Apply roberts cross operator to input video stream.
  23845. </p>
  23846. <p>The filter accepts the following option:
  23847. </p>
  23848. <dl class="table">
  23849. <dt><samp class="option">planes</samp></dt>
  23850. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  23851. By default value 0xf, all planes will be processed.
  23852. </p>
  23853. </dd>
  23854. <dt><samp class="option">scale</samp></dt>
  23855. <dd><p>Set value which will be multiplied with filtered result.
  23856. </p>
  23857. </dd>
  23858. <dt><samp class="option">delta</samp></dt>
  23859. <dd><p>Set value which will be added to filtered result.
  23860. </p></dd>
  23861. </dl>
  23862. <a name="Commands-136"></a>
  23863. <h4 class="subsection">11.212.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-136" aria-hidden="true">TOC</a></span></h4>
  23864. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  23865. </p>
  23866. <a name="rotate"></a>
  23867. <h3 class="section">11.213 rotate<span class="pull-right"><a class="anchor hidden-xs" href="#rotate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-rotate" aria-hidden="true">TOC</a></span></h3>
  23868. <p>Rotate video by an arbitrary angle expressed in radians.
  23869. </p>
  23870. <p>The filter accepts the following options:
  23871. </p>
  23872. <p>A description of the optional parameters follows.
  23873. </p><dl class="table">
  23874. <dt><samp class="option">angle, a</samp></dt>
  23875. <dd><p>Set an expression for the angle by which to rotate the input video
  23876. clockwise, expressed as a number of radians. A negative value will
  23877. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  23878. </p>
  23879. <p>This expression is evaluated for each frame.
  23880. </p>
  23881. </dd>
  23882. <dt><samp class="option">out_w, ow</samp></dt>
  23883. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  23884. This expression is evaluated just once during configuration.
  23885. </p>
  23886. </dd>
  23887. <dt><samp class="option">out_h, oh</samp></dt>
  23888. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  23889. This expression is evaluated just once during configuration.
  23890. </p>
  23891. </dd>
  23892. <dt><samp class="option">bilinear</samp></dt>
  23893. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  23894. it. Default value is 1.
  23895. </p>
  23896. </dd>
  23897. <dt><samp class="option">fillcolor, c</samp></dt>
  23898. <dd><p>Set the color used to fill the output area not covered by the rotated
  23899. image. For the general syntax of this option, check the
  23900. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  23901. If the special value &quot;none&quot; is selected then no
  23902. background is printed (useful for example if the background is never shown).
  23903. </p>
  23904. <p>Default value is &quot;black&quot;.
  23905. </p></dd>
  23906. </dl>
  23907. <p>The expressions for the angle and the output size can contain the
  23908. following constants and functions:
  23909. </p>
  23910. <dl class="table">
  23911. <dt><samp class="option">n</samp></dt>
  23912. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  23913. before the first frame is filtered.
  23914. </p>
  23915. </dd>
  23916. <dt><samp class="option">t</samp></dt>
  23917. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  23918. configured. It is always NAN before the first frame is filtered.
  23919. </p>
  23920. </dd>
  23921. <dt><samp class="option">hsub</samp></dt>
  23922. <dt><samp class="option">vsub</samp></dt>
  23923. <dd><p>horizontal and vertical chroma subsample values. For example for the
  23924. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  23925. </p>
  23926. </dd>
  23927. <dt><samp class="option">in_w, iw</samp></dt>
  23928. <dt><samp class="option">in_h, ih</samp></dt>
  23929. <dd><p>the input video width and height
  23930. </p>
  23931. </dd>
  23932. <dt><samp class="option">out_w, ow</samp></dt>
  23933. <dt><samp class="option">out_h, oh</samp></dt>
  23934. <dd><p>the output width and height, that is the size of the padded area as
  23935. specified by the <var class="var">width</var> and <var class="var">height</var> expressions
  23936. </p>
  23937. </dd>
  23938. <dt><samp class="option">rotw(a)</samp></dt>
  23939. <dt><samp class="option">roth(a)</samp></dt>
  23940. <dd><p>the minimal width/height required for completely containing the input
  23941. video rotated by <var class="var">a</var> radians.
  23942. </p>
  23943. <p>These are only available when computing the <samp class="option">out_w</samp> and
  23944. <samp class="option">out_h</samp> expressions.
  23945. </p></dd>
  23946. </dl>
  23947. <a name="Examples-113"></a>
  23948. <h4 class="subsection">11.213.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-113" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-113" aria-hidden="true">TOC</a></span></h4>
  23949. <ul class="itemize mark-bullet">
  23950. <li>Rotate the input by PI/6 radians clockwise:
  23951. <div class="example">
  23952. <pre class="example-preformatted">rotate=PI/6
  23953. </pre></div>
  23954. </li><li>Rotate the input by PI/6 radians counter-clockwise:
  23955. <div class="example">
  23956. <pre class="example-preformatted">rotate=-PI/6
  23957. </pre></div>
  23958. </li><li>Rotate the input by 45 degrees clockwise:
  23959. <div class="example">
  23960. <pre class="example-preformatted">rotate=45*PI/180
  23961. </pre></div>
  23962. </li><li>Apply a constant rotation with period T, starting from an angle of PI/3:
  23963. <div class="example">
  23964. <pre class="example-preformatted">rotate=PI/3+2*PI*t/T
  23965. </pre></div>
  23966. </li><li>Make the input video rotation oscillating with a period of T
  23967. seconds and an amplitude of A radians:
  23968. <div class="example">
  23969. <pre class="example-preformatted">rotate=A*sin(2*PI/T*t)
  23970. </pre></div>
  23971. </li><li>Rotate the video, output size is chosen so that the whole rotating
  23972. input video is always completely contained in the output:
  23973. <div class="example">
  23974. <pre class="example-preformatted">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  23975. </pre></div>
  23976. </li><li>Rotate the video, reduce the output size so that no background is ever
  23977. shown:
  23978. <div class="example">
  23979. <pre class="example-preformatted">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  23980. </pre></div>
  23981. </li></ul>
  23982. <a name="Commands-137"></a>
  23983. <h4 class="subsection">11.213.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-137" aria-hidden="true">TOC</a></span></h4>
  23984. <p>The filter supports the following commands:
  23985. </p>
  23986. <dl class="table">
  23987. <dt><samp class="option">a, angle</samp></dt>
  23988. <dd><p>Set the angle expression.
  23989. The command accepts the same syntax of the corresponding option.
  23990. </p>
  23991. <p>If the specified expression is not valid, it is kept at its current
  23992. value.
  23993. </p></dd>
  23994. </dl>
  23995. <a name="sab"></a>
  23996. <h3 class="section">11.214 sab<span class="pull-right"><a class="anchor hidden-xs" href="#sab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sab" aria-hidden="true">TOC</a></span></h3>
  23997. <p>Apply Shape Adaptive Blur.
  23998. </p>
  23999. <p>The filter accepts the following options:
  24000. </p>
  24001. <dl class="table">
  24002. <dt><samp class="option">luma_radius, lr</samp></dt>
  24003. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  24004. value is 1.0. A greater value will result in a more blurred image, and
  24005. in slower processing.
  24006. </p>
  24007. </dd>
  24008. <dt><samp class="option">luma_pre_filter_radius, lpfr</samp></dt>
  24009. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  24010. value is 1.0.
  24011. </p>
  24012. </dd>
  24013. <dt><samp class="option">luma_strength, ls</samp></dt>
  24014. <dd><p>Set luma maximum difference between pixels to still be considered, must
  24015. be a value in the 0.1-100.0 range, default value is 1.0.
  24016. </p>
  24017. </dd>
  24018. <dt><samp class="option">chroma_radius, cr</samp></dt>
  24019. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  24020. greater value will result in a more blurred image, and in slower
  24021. processing.
  24022. </p>
  24023. </dd>
  24024. <dt><samp class="option">chroma_pre_filter_radius, cpfr</samp></dt>
  24025. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  24026. </p>
  24027. </dd>
  24028. <dt><samp class="option">chroma_strength, cs</samp></dt>
  24029. <dd><p>Set chroma maximum difference between pixels to still be considered,
  24030. must be a value in the -0.9-100.0 range.
  24031. </p></dd>
  24032. </dl>
  24033. <p>Each chroma option value, if not explicitly specified, is set to the
  24034. corresponding luma option value.
  24035. </p>
  24036. <a class="anchor" id="scale"></a><a name="scale-1"></a>
  24037. <h3 class="section">11.215 scale<span class="pull-right"><a class="anchor hidden-xs" href="#scale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale-1" aria-hidden="true">TOC</a></span></h3>
  24038. <p>Scale (resize) the input video, using the libswscale library.
  24039. </p>
  24040. <p>The scale filter forces the output display aspect ratio to be the same
  24041. of the input, by changing the output sample aspect ratio.
  24042. </p>
  24043. <p>If the input image format is different from the format requested by
  24044. the next filter, the scale filter will convert the input to the
  24045. requested format.
  24046. </p>
  24047. <a name="Options-2"></a>
  24048. <h4 class="subsection">11.215.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-2" aria-hidden="true">TOC</a></span></h4>
  24049. <p>The filter accepts the following options, any of the options supported
  24050. by the libswscale scaler, as well as any of the <a class="ref" href="#framesync">framesync</a> options.
  24051. </p>
  24052. <p>See <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#scaler_005foptions">the ffmpeg-scaler manual</a> for
  24053. the complete list of scaler options.
  24054. </p>
  24055. <dl class="table">
  24056. <dt><samp class="option">width, w</samp></dt>
  24057. <dt><samp class="option">height, h</samp></dt>
  24058. <dd><p>Set the output video dimension expression. Default value is the input
  24059. dimension.
  24060. </p>
  24061. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  24062. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  24063. is used for the output.
  24064. </p>
  24065. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  24066. will use a value that maintains the aspect ratio of the input image,
  24067. calculated from the other specified dimension. After that it will,
  24068. however, make sure that the calculated dimension is divisible by n and
  24069. adjust the value if necessary.
  24070. </p>
  24071. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  24072. both values being set to 0 as previously detailed.
  24073. </p>
  24074. <p>See below for the list of accepted constants for use in the dimension
  24075. expression.
  24076. </p>
  24077. </dd>
  24078. <dt><samp class="option">eval</samp></dt>
  24079. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  24080. </p>
  24081. <dl class="table">
  24082. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  24083. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  24084. </p>
  24085. </dd>
  24086. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  24087. <dd><p>Evaluate expressions for each incoming frame.
  24088. </p>
  24089. </dd>
  24090. </dl>
  24091. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  24092. </p>
  24093. </dd>
  24094. <dt><samp class="option">interl</samp></dt>
  24095. <dd><p>Set the interlacing mode. It accepts the following values:
  24096. </p>
  24097. <dl class="table">
  24098. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  24099. <dd><p>Force interlaced aware scaling.
  24100. </p>
  24101. </dd>
  24102. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  24103. <dd><p>Do not apply interlaced scaling.
  24104. </p>
  24105. </dd>
  24106. <dt>&lsquo;<samp class="samp">-1</samp>&rsquo;</dt>
  24107. <dd><p>Select interlaced aware scaling depending on whether the source frames
  24108. are flagged as interlaced or not.
  24109. </p></dd>
  24110. </dl>
  24111. <p>Default value is &lsquo;<samp class="samp">0</samp>&rsquo;.
  24112. </p>
  24113. </dd>
  24114. <dt><samp class="option">flags</samp></dt>
  24115. <dd><p>Set libswscale scaling flags. See
  24116. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fflags">the ffmpeg-scaler manual</a> for the
  24117. complete list of values. If not explicitly specified the filter applies
  24118. the default flags.
  24119. </p>
  24120. </dd>
  24121. <dt><samp class="option">param0, param1</samp></dt>
  24122. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  24123. <a data-manual="ffmpeg-scaler" href="ffmpeg-scaler.html#sws_005fparams">the ffmpeg-scaler manual</a> for the
  24124. complete documentation. If not explicitly specified the filter applies
  24125. empty parameters.
  24126. </p>
  24127. </dd>
  24128. <dt><samp class="option">intent</samp></dt>
  24129. <dd><p>Set the ICC rendering intent to use when transforming between different color
  24130. spaces. It accepts the following values:
  24131. </p>
  24132. <dl class="table">
  24133. <dt>&lsquo;<samp class="samp">perceptual</samp>&rsquo;</dt>
  24134. <dd><p>Use a perceptually guided tone and gamut mapping curve. The exact details of
  24135. the mapping used may change at any time and should not be relied on as stable.
  24136. This intent is recommended for final viewing of image/video content in typical
  24137. viewing settings.
  24138. </p>
  24139. </dd>
  24140. <dt>&lsquo;<samp class="samp">relative_colorimetric</samp>&rsquo;</dt>
  24141. <dd><p>Statically clip out-of-gamut colors using a colorimetric clipping curve which
  24142. attempts to find the colorimetrically least dissimilar in-gamut color. This
  24143. intent performs white point adaptation and black point adaptation. This is
  24144. the default. This intent is recommended wherever faithful color reproduction
  24145. is of the utmost importance, even at the cost of clipping.
  24146. </p>
  24147. </dd>
  24148. <dt>&lsquo;<samp class="samp">absolute_colorimetric</samp>&rsquo;</dt>
  24149. <dd><p>Hard clip out-of-gamut colors with no attempt at white or black point
  24150. reproduction. This intent will reproduce in-gamut colors 1:1 on the output
  24151. display as they would appear on the reference display, assuming the output
  24152. display is appropriately calibrated.
  24153. </p>
  24154. </dd>
  24155. <dt>&lsquo;<samp class="samp">saturation</samp>&rsquo;</dt>
  24156. <dd><p>Performs saturation mapping - that is, stretches the input color volume
  24157. directly onto the output color volume, in non-linear fashion that preserves the
  24158. original signal appearance as much as possible. This intent is recommended for
  24159. signal content evaluation, as it will not lead to any clipping. It is roughly
  24160. analogous to not performing any color mapping, although it still takes into
  24161. account the mastering display primaries and any differences in encoding TRC.
  24162. </p></dd>
  24163. </dl>
  24164. </dd>
  24165. <dt><samp class="option">size, s</samp></dt>
  24166. <dd><p>Set the video size. For the syntax of this option, check the
  24167. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  24168. </p>
  24169. </dd>
  24170. <dt><samp class="option">in_color_matrix</samp></dt>
  24171. <dt><samp class="option">out_color_matrix</samp></dt>
  24172. <dd><p>Set in/output YCbCr color space type.
  24173. </p>
  24174. <p>This allows the autodetected value to be overridden as well as allows forcing
  24175. a specific value used for the output and encoder.
  24176. </p>
  24177. <p>If not specified, the color space type depends on the pixel format.
  24178. </p>
  24179. <p>Possible values:
  24180. </p>
  24181. <dl class="table">
  24182. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24183. <dd><p>Choose automatically.
  24184. </p>
  24185. </dd>
  24186. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24187. <dd><p>Format conforming to International Telecommunication Union (ITU)
  24188. Recommendation BT.709.
  24189. </p>
  24190. </dd>
  24191. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  24192. <dd><p>Set color space conforming to the United States Federal Communications
  24193. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  24194. </p>
  24195. </dd>
  24196. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  24197. <dt>&lsquo;<samp class="samp">bt470</samp>&rsquo;</dt>
  24198. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24199. <dd><p>Set color space conforming to:
  24200. </p>
  24201. <ul class="itemize mark-bullet">
  24202. <li>ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  24203. </li><li>ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  24204. </li><li>Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  24205. </li></ul>
  24206. </dd>
  24207. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24208. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  24209. </p>
  24210. </dd>
  24211. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  24212. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  24213. </p></dd>
  24214. </dl>
  24215. </dd>
  24216. <dt><samp class="option">in_range</samp></dt>
  24217. <dt><samp class="option">out_range</samp></dt>
  24218. <dd><p>Set in/output YCbCr sample range.
  24219. </p>
  24220. <p>This allows the autodetected value to be overridden as well as allows forcing
  24221. a specific value used for the output and encoder. If not specified, the
  24222. range depends on the pixel format. Possible values:
  24223. </p>
  24224. <dl class="table">
  24225. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  24226. <dd><p>Choose automatically.
  24227. </p>
  24228. </dd>
  24229. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  24230. <dd><p>Set full range (0-255 in case of 8-bit luma).
  24231. </p>
  24232. </dd>
  24233. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  24234. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  24235. </p></dd>
  24236. </dl>
  24237. </dd>
  24238. <dt><samp class="option">in_chroma_loc</samp></dt>
  24239. <dt><samp class="option">out_chroma_loc</samp></dt>
  24240. <dd><p>Set in/output chroma sample location. If not specified, center-sited chroma
  24241. is used by default. Possible values:
  24242. </p>
  24243. <dl class="table">
  24244. <dt>&lsquo;<samp class="samp">auto, unknown</samp>&rsquo;</dt>
  24245. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  24246. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  24247. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  24248. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  24249. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  24250. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  24251. </dl>
  24252. </dd>
  24253. <dt><samp class="option">in_primaries</samp></dt>
  24254. <dt><samp class="option">out_primaries</samp></dt>
  24255. <dd><p>Set in/output RGB primaries.
  24256. </p>
  24257. <p>This allows the autodetected value to be overridden as well as allows forcing
  24258. a specific value used for the output and encoder. Possible values:
  24259. </p>
  24260. <dl class="table">
  24261. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24262. <dd><p>Choose automatically. This is the default.
  24263. </p>
  24264. </dd>
  24265. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24266. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24267. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24268. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24269. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24270. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  24271. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  24272. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  24273. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  24274. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  24275. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  24276. <dt>&lsquo;<samp class="samp">ebu3213</samp>&rsquo;</dt>
  24277. </dl>
  24278. </dd>
  24279. <dt><samp class="option">in_transfer</samp></dt>
  24280. <dt><samp class="option">out_transfer</samp></dt>
  24281. <dd><p>Set in/output transfer response curve (TRC).
  24282. </p>
  24283. <p>This allows the autodetected value to be overridden as well as allows forcing
  24284. a specific value used for the output and encoder. Possible values:
  24285. </p>
  24286. <dl class="table">
  24287. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24288. <dd><p>Choose automatically. This is the default.
  24289. </p>
  24290. </dd>
  24291. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24292. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24293. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  24294. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24295. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  24296. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24297. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24298. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  24299. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  24300. <dt>&lsquo;<samp class="samp">srgb</samp>&rsquo;</dt>
  24301. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  24302. <dt>&lsquo;<samp class="samp">xvycc</samp>&rsquo;</dt>
  24303. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  24304. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  24305. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  24306. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  24307. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  24308. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  24309. </dl>
  24310. </dd>
  24311. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  24312. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  24313. keep the original aspect ratio. Possible values:
  24314. </p>
  24315. <dl class="table">
  24316. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  24317. <dd><p>Scale the video as specified and disable this feature.
  24318. </p>
  24319. </dd>
  24320. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  24321. <dd><p>The output video dimensions will automatically be decreased if needed.
  24322. </p>
  24323. </dd>
  24324. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  24325. <dd><p>The output video dimensions will automatically be increased if needed.
  24326. </p>
  24327. </dd>
  24328. </dl>
  24329. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  24330. maximum allowed resolution, you can use this to limit the output video to
  24331. that, while retaining the aspect ratio. For example, device A allows
  24332. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  24333. decrease) and specifying 1280x720 to the command line makes the output
  24334. 1280x533.
  24335. </p>
  24336. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  24337. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  24338. to work.
  24339. </p>
  24340. </dd>
  24341. <dt><samp class="option">force_divisible_by</samp></dt>
  24342. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  24343. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  24344. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  24345. </p>
  24346. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  24347. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  24348. may be slightly modified.
  24349. </p>
  24350. <p>This option can be handy if you need to have a video fit within or exceed
  24351. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  24352. encoder restrictions on width or height divisibility.
  24353. </p>
  24354. </dd>
  24355. <dt><samp class="option">reset_sar</samp></dt>
  24356. <dd><p>Enabling this option leads to the output SAR being reset to 1.
  24357. Additionally, if the user requests proportional scaling either
  24358. through the width or height expressions, e.g. <code class="code">w=-4:h=360</code> or <code class="code">w=iw/2:h=-1</code>
  24359. or by enabling <code class="code">force_original_aspect_ratio</code>, then the input DAR is taken into
  24360. account and the output is scaled to produce square pixels.
  24361. Default is false.
  24362. </p>
  24363. </dd>
  24364. </dl>
  24365. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  24366. containing the following constants:
  24367. </p>
  24368. <dl class="table">
  24369. <dt><var class="var">in_w</var></dt>
  24370. <dt><var class="var">in_h</var></dt>
  24371. <dd><p>The input width and height
  24372. </p>
  24373. </dd>
  24374. <dt><var class="var">iw</var></dt>
  24375. <dt><var class="var">ih</var></dt>
  24376. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  24377. </p>
  24378. </dd>
  24379. <dt><var class="var">out_w</var></dt>
  24380. <dt><var class="var">out_h</var></dt>
  24381. <dd><p>The output (scaled) width and height
  24382. </p>
  24383. </dd>
  24384. <dt><var class="var">ow</var></dt>
  24385. <dt><var class="var">oh</var></dt>
  24386. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  24387. </p>
  24388. </dd>
  24389. <dt><var class="var">a</var></dt>
  24390. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  24391. </p>
  24392. </dd>
  24393. <dt><var class="var">sar</var></dt>
  24394. <dd><p>input sample aspect ratio
  24395. </p>
  24396. </dd>
  24397. <dt><var class="var">dar</var></dt>
  24398. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  24399. </p>
  24400. </dd>
  24401. <dt><var class="var">hsub</var></dt>
  24402. <dt><var class="var">vsub</var></dt>
  24403. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  24404. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  24405. </p>
  24406. </dd>
  24407. <dt><var class="var">ohsub</var></dt>
  24408. <dt><var class="var">ovsub</var></dt>
  24409. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  24410. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  24411. </p>
  24412. </dd>
  24413. <dt><var class="var">n</var></dt>
  24414. <dd><p>The (sequential) number of the input frame, starting from 0.
  24415. Only available with <code class="code">eval=frame</code>.
  24416. </p>
  24417. </dd>
  24418. <dt><var class="var">t</var></dt>
  24419. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  24420. seconds. Only available with <code class="code">eval=frame</code>.
  24421. </p>
  24422. </dd>
  24423. <dt><var class="var">pos</var></dt>
  24424. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  24425. this information is unavailable and/or meaningless (for example in case of synthetic video).
  24426. Only available with <code class="code">eval=frame</code>.
  24427. Deprecated, do not use.
  24428. </p>
  24429. </dd>
  24430. <dt><var class="var">ref_w, rw</var></dt>
  24431. <dt><var class="var">ref_h, rh</var></dt>
  24432. <dt><var class="var">ref_a</var></dt>
  24433. <dt><var class="var">ref_dar, rdar</var></dt>
  24434. <dt><var class="var">ref_n</var></dt>
  24435. <dt><var class="var">ref_t</var></dt>
  24436. <dt><var class="var">ref_pos</var></dt>
  24437. <dd><p>Eqvuialent to the above, but for a second reference input. If any of these
  24438. variables are present, this filter accepts two inputs.
  24439. </p></dd>
  24440. </dl>
  24441. <a name="Examples-114"></a>
  24442. <h4 class="subsection">11.215.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-114" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-114" aria-hidden="true">TOC</a></span></h4>
  24443. <ul class="itemize mark-bullet">
  24444. <li>Scale the input video to a size of 200x100
  24445. <div class="example">
  24446. <pre class="example-preformatted">scale=w=200:h=100
  24447. </pre></div>
  24448. <p>This is equivalent to:
  24449. </p><div class="example">
  24450. <pre class="example-preformatted">scale=200:100
  24451. </pre></div>
  24452. <p>or:
  24453. </p><div class="example">
  24454. <pre class="example-preformatted">scale=200x100
  24455. </pre></div>
  24456. </li><li>Specify a size abbreviation for the output size:
  24457. <div class="example">
  24458. <pre class="example-preformatted">scale=qcif
  24459. </pre></div>
  24460. <p>which can also be written as:
  24461. </p><div class="example">
  24462. <pre class="example-preformatted">scale=size=qcif
  24463. </pre></div>
  24464. </li><li>Scale the input to 2x:
  24465. <div class="example">
  24466. <pre class="example-preformatted">scale=w=2*iw:h=2*ih
  24467. </pre></div>
  24468. </li><li>The above is the same as:
  24469. <div class="example">
  24470. <pre class="example-preformatted">scale=2*in_w:2*in_h
  24471. </pre></div>
  24472. </li><li>Scale the input to 2x with forced interlaced scaling:
  24473. <div class="example">
  24474. <pre class="example-preformatted">scale=2*iw:2*ih:interl=1
  24475. </pre></div>
  24476. </li><li>Scale the input to half size:
  24477. <div class="example">
  24478. <pre class="example-preformatted">scale=w=iw/2:h=ih/2
  24479. </pre></div>
  24480. </li><li>Increase the width, and set the height to the same size:
  24481. <div class="example">
  24482. <pre class="example-preformatted">scale=3/2*iw:ow
  24483. </pre></div>
  24484. </li><li>Seek Greek harmony:
  24485. <div class="example">
  24486. <pre class="example-preformatted">scale=iw:1/PHI*iw
  24487. scale=ih*PHI:ih
  24488. </pre></div>
  24489. </li><li>Increase the height, and set the width to 3/2 of the height:
  24490. <div class="example">
  24491. <pre class="example-preformatted">scale=w=3/2*oh:h=3/5*ih
  24492. </pre></div>
  24493. </li><li>Increase the size, making the size a multiple of the chroma
  24494. subsample values:
  24495. <div class="example">
  24496. <pre class="example-preformatted">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  24497. </pre></div>
  24498. </li><li>Increase the width to a maximum of 500 pixels,
  24499. keeping the same aspect ratio as the input:
  24500. <div class="example">
  24501. <pre class="example-preformatted">scale=w='min(500\, iw*3/2):h=-1'
  24502. </pre></div>
  24503. </li><li>Make pixels square by combining scale and setsar:
  24504. <div class="example">
  24505. <pre class="example-preformatted">scale='trunc(ih*dar):ih',setsar=1/1
  24506. </pre></div>
  24507. </li><li>Make pixels square using reset_sar,
  24508. making sure the resulting resolution is even (required by some codecs):
  24509. <div class="example">
  24510. <pre class="example-preformatted">scale='-2:ih-mod(ih,2):reset_sar=1'
  24511. </pre></div>
  24512. </li><li>Scale to target exactly, however reset SAR to 1:
  24513. <div class="example">
  24514. <pre class="example-preformatted">scale='400:300:reset_sar=1'
  24515. </pre></div>
  24516. </li><li>Scale to even dimensions that fit within 400x300, preserving input SAR:
  24517. <div class="example">
  24518. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2'
  24519. </pre></div>
  24520. </li><li>Scale to produce square pixels with even dimensions that fit within 400x300:
  24521. <div class="example">
  24522. <pre class="example-preformatted">scale='400:300:force_original_aspect_ratio=decrease:force_divisible_by=2:reset_sar=1'
  24523. </pre></div>
  24524. </li><li>Scale a subtitle stream (sub) to match the main video (main) in size before
  24525. overlaying. (&quot;scale2ref&quot;)
  24526. <div class="example">
  24527. <pre class="example-preformatted">'[main]split[a][b]; [ref][a]scale=rw:rh[c]; [b][c]overlay'
  24528. </pre></div>
  24529. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display
  24530. aspect ratio.
  24531. <div class="example">
  24532. <pre class="example-preformatted">[logo-in][video-in]scale=w=oh*dar:h=rh/10[logo-out]
  24533. </pre></div>
  24534. </li></ul>
  24535. <a name="Commands-138"></a>
  24536. <h4 class="subsection">11.215.3 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-138" aria-hidden="true">TOC</a></span></h4>
  24537. <p>This filter supports the following commands:
  24538. </p><dl class="table">
  24539. <dt><samp class="option">width, w</samp></dt>
  24540. <dt><samp class="option">height, h</samp></dt>
  24541. <dd><p>Set the output video dimension expression.
  24542. The command accepts the same syntax of the corresponding option.
  24543. </p>
  24544. <p>If the specified expression is not valid, it is kept at its current
  24545. value.
  24546. </p></dd>
  24547. </dl>
  24548. <a name="scharr"></a>
  24549. <h3 class="section">11.216 scharr<span class="pull-right"><a class="anchor hidden-xs" href="#scharr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scharr" aria-hidden="true">TOC</a></span></h3>
  24550. <p>Apply scharr operator to input video stream.
  24551. </p>
  24552. <p>The filter accepts the following option:
  24553. </p>
  24554. <dl class="table">
  24555. <dt><samp class="option">planes</samp></dt>
  24556. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  24557. By default value 0xf, all planes will be processed.
  24558. </p>
  24559. </dd>
  24560. <dt><samp class="option">scale</samp></dt>
  24561. <dd><p>Set value which will be multiplied with filtered result.
  24562. </p>
  24563. </dd>
  24564. <dt><samp class="option">delta</samp></dt>
  24565. <dd><p>Set value which will be added to filtered result.
  24566. </p></dd>
  24567. </dl>
  24568. <a name="Commands-139"></a>
  24569. <h4 class="subsection">11.216.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-139" aria-hidden="true">TOC</a></span></h4>
  24570. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  24571. </p>
  24572. <a name="scroll"></a>
  24573. <h3 class="section">11.217 scroll<span class="pull-right"><a class="anchor hidden-xs" href="#scroll" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scroll" aria-hidden="true">TOC</a></span></h3>
  24574. <p>Scroll input video horizontally and/or vertically by constant speed.
  24575. </p>
  24576. <p>The filter accepts the following options:
  24577. </p><dl class="table">
  24578. <dt><samp class="option">horizontal, h</samp></dt>
  24579. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  24580. Negative values changes scrolling direction.
  24581. </p>
  24582. </dd>
  24583. <dt><samp class="option">vertical, v</samp></dt>
  24584. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  24585. Negative values changes scrolling direction.
  24586. </p>
  24587. </dd>
  24588. <dt><samp class="option">hpos</samp></dt>
  24589. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  24590. </p>
  24591. </dd>
  24592. <dt><samp class="option">vpos</samp></dt>
  24593. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  24594. </p></dd>
  24595. </dl>
  24596. <a name="Commands-140"></a>
  24597. <h4 class="subsection">11.217.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-140" aria-hidden="true">TOC</a></span></h4>
  24598. <p>This filter supports the following <a class="ref" href="#commands">commands</a>:
  24599. </p><dl class="table">
  24600. <dt><samp class="option">horizontal, h</samp></dt>
  24601. <dd><p>Set the horizontal scrolling speed.
  24602. </p></dd>
  24603. <dt><samp class="option">vertical, v</samp></dt>
  24604. <dd><p>Set the vertical scrolling speed.
  24605. </p></dd>
  24606. </dl>
  24607. <a class="anchor" id="scdet"></a><a name="scdet-1"></a>
  24608. <h3 class="section">11.218 scdet<span class="pull-right"><a class="anchor hidden-xs" href="#scdet-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scdet-1" aria-hidden="true">TOC</a></span></h3>
  24609. <p>Detect video scene change.
  24610. </p>
  24611. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  24612. forward the frame to the next filter, so they can use these metadata to detect
  24613. scene change or others.
  24614. </p>
  24615. <p>In addition, this filter logs a message and sets frame metadata when it detects
  24616. a scene change by <samp class="option">threshold</samp>.
  24617. </p>
  24618. <p><code class="code">lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  24619. </p>
  24620. <p><code class="code">lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  24621. to detect scene change.
  24622. </p>
  24623. <p><code class="code">lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  24624. detect scene change with <samp class="option">threshold</samp>.
  24625. </p>
  24626. <p>The filter accepts the following options:
  24627. </p>
  24628. <dl class="table">
  24629. <dt><samp class="option">threshold, t</samp></dt>
  24630. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  24631. values are in the <code class="code">[8.0, 14.0]</code> range. The range for <samp class="option">threshold</samp> is
  24632. <code class="code">[0., 100.]</code>.
  24633. </p>
  24634. <p>Default value is <code class="code">10.</code>.
  24635. </p>
  24636. </dd>
  24637. <dt><samp class="option">sc_pass, s</samp></dt>
  24638. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code class="code">0</code>
  24639. You can enable it if you want to get snapshot of scene change frames only.
  24640. </p></dd>
  24641. </dl>
  24642. <a class="anchor" id="selectivecolor"></a><a name="selectivecolor-1"></a>
  24643. <h3 class="section">11.219 selectivecolor<span class="pull-right"><a class="anchor hidden-xs" href="#selectivecolor-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-selectivecolor-1" aria-hidden="true">TOC</a></span></h3>
  24644. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  24645. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  24646. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  24647. </p>
  24648. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  24649. </p>
  24650. <p>The filter accepts the following options:
  24651. </p>
  24652. <dl class="table">
  24653. <dt><samp class="option">correction_method</samp></dt>
  24654. <dd><p>Select color correction method.
  24655. </p>
  24656. <p>Available values are:
  24657. </p><dl class="table">
  24658. <dt>&lsquo;<samp class="samp">absolute</samp>&rsquo;</dt>
  24659. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  24660. component value).
  24661. </p></dd>
  24662. <dt>&lsquo;<samp class="samp">relative</samp>&rsquo;</dt>
  24663. <dd><p>Specified adjustments are relative to the original component value.
  24664. </p></dd>
  24665. </dl>
  24666. <p>Default is <code class="code">absolute</code>.
  24667. </p></dd>
  24668. <dt><samp class="option">reds</samp></dt>
  24669. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  24670. </p></dd>
  24671. <dt><samp class="option">yellows</samp></dt>
  24672. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  24673. </p></dd>
  24674. <dt><samp class="option">greens</samp></dt>
  24675. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  24676. </p></dd>
  24677. <dt><samp class="option">cyans</samp></dt>
  24678. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  24679. </p></dd>
  24680. <dt><samp class="option">blues</samp></dt>
  24681. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  24682. </p></dd>
  24683. <dt><samp class="option">magentas</samp></dt>
  24684. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  24685. </p></dd>
  24686. <dt><samp class="option">whites</samp></dt>
  24687. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  24688. </p></dd>
  24689. <dt><samp class="option">neutrals</samp></dt>
  24690. <dd><p>Adjustments for all pixels except pure black and pure white
  24691. </p></dd>
  24692. <dt><samp class="option">blacks</samp></dt>
  24693. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  24694. </p></dd>
  24695. <dt><samp class="option">psfile</samp></dt>
  24696. <dd><p>Specify a Photoshop selective color file (<code class="code">.asv</code>) to import the settings from.
  24697. </p></dd>
  24698. </dl>
  24699. <p>All the adjustment settings (<samp class="option">reds</samp>, <samp class="option">yellows</samp>, ...) accept up to
  24700. 4 space separated floating point adjustment values in the [-1,1] range,
  24701. respectively to adjust the amount of cyan, magenta, yellow and black for the
  24702. pixels of its range.
  24703. </p>
  24704. <a name="Examples-115"></a>
  24705. <h4 class="subsection">11.219.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-115" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-115" aria-hidden="true">TOC</a></span></h4>
  24706. <ul class="itemize mark-bullet">
  24707. <li>Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  24708. increase magenta by 27% in blue areas:
  24709. <div class="example">
  24710. <pre class="example-preformatted">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  24711. </pre></div>
  24712. </li><li>Use a Photoshop selective color preset:
  24713. <div class="example">
  24714. <pre class="example-preformatted">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  24715. </pre></div>
  24716. </li></ul>
  24717. <a class="anchor" id="separatefields"></a><a name="separatefields-1"></a>
  24718. <h3 class="section">11.220 separatefields<span class="pull-right"><a class="anchor hidden-xs" href="#separatefields-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-separatefields-1" aria-hidden="true">TOC</a></span></h3>
  24719. <p>The <code class="code">separatefields</code> takes a frame-based video input and splits
  24720. each frame into its components fields, producing a new half height clip
  24721. with twice the frame rate and twice the frame count.
  24722. </p>
  24723. <p>This filter use field-dominance information in frame to decide which
  24724. of each pair of fields to place first in the output.
  24725. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">separatefields</code> filter.
  24726. </p>
  24727. <a name="setdar_002c-setsar"></a>
  24728. <h3 class="section">11.221 setdar, setsar<span class="pull-right"><a class="anchor hidden-xs" href="#setdar_002c-setsar" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setdar_002c-setsar" aria-hidden="true">TOC</a></span></h3>
  24729. <p>The <code class="code">setdar</code> filter sets the Display Aspect Ratio for the filter
  24730. output video.
  24731. </p>
  24732. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  24733. Ratio, according to the following equation:
  24734. </p><div class="example">
  24735. <pre class="example-preformatted"><var class="var">DAR</var> = <var class="var">HORIZONTAL_RESOLUTION</var> / <var class="var">VERTICAL_RESOLUTION</var> * <var class="var">SAR</var>
  24736. </pre></div>
  24737. <p>Keep in mind that the <code class="code">setdar</code> filter does not modify the pixel
  24738. dimensions of the video frame. Also, the display aspect ratio set by
  24739. this filter may be changed by later filters in the filterchain,
  24740. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  24741. applied.
  24742. </p>
  24743. <p>The <code class="code">setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  24744. the filter output video.
  24745. </p>
  24746. <p>Note that as a consequence of the application of this filter, the
  24747. output display aspect ratio will change according to the equation
  24748. above.
  24749. </p>
  24750. <p>Keep in mind that the sample aspect ratio set by the <code class="code">setsar</code>
  24751. filter may be changed by later filters in the filterchain, e.g. if
  24752. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  24753. </p>
  24754. <p>It accepts the following parameters:
  24755. </p>
  24756. <dl class="table">
  24757. <dt><samp class="option">r, ratio, dar (<code class="code">setdar</code> only), sar (<code class="code">setsar</code> only)</samp></dt>
  24758. <dd><p>Set the aspect ratio used by the filter.
  24759. </p>
  24760. <p>The parameter can be a floating point number string, or an expression. If the
  24761. parameter is not specified, the value &quot;0&quot; is assumed, meaning that the same
  24762. input value is used.
  24763. </p>
  24764. </dd>
  24765. <dt><samp class="option">max</samp></dt>
  24766. <dd><p>Set the maximum integer value to use for expressing numerator and
  24767. denominator when reducing the expressed aspect ratio to a rational.
  24768. Default value is <code class="code">100</code>.
  24769. </p>
  24770. </dd>
  24771. </dl>
  24772. <p>The parameter <var class="var">sar</var> is an expression containing the following constants:
  24773. </p>
  24774. <dl class="table">
  24775. <dt><samp class="option">w, h</samp></dt>
  24776. <dd><p>The input width and height.
  24777. </p>
  24778. </dd>
  24779. <dt><samp class="option">a</samp></dt>
  24780. <dd><p>Same as <var class="var">w</var> / <var class="var">h</var>.
  24781. </p>
  24782. </dd>
  24783. <dt><samp class="option">sar</samp></dt>
  24784. <dd><p>The input sample aspect ratio.
  24785. </p>
  24786. </dd>
  24787. <dt><samp class="option">dar</samp></dt>
  24788. <dd><p>The input display aspect ratio. It is the same as
  24789. (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>.
  24790. </p>
  24791. </dd>
  24792. <dt><samp class="option">hsub, vsub</samp></dt>
  24793. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  24794. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  24795. </p></dd>
  24796. </dl>
  24797. <a name="Examples-116"></a>
  24798. <h4 class="subsection">11.221.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-116" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-116" aria-hidden="true">TOC</a></span></h4>
  24799. <ul class="itemize mark-bullet">
  24800. <li>To change the display aspect ratio to 16:9, specify one of the following:
  24801. <div class="example">
  24802. <pre class="example-preformatted">setdar=dar=1.77777
  24803. setdar=dar=16/9
  24804. </pre></div>
  24805. </li><li>To change the sample aspect ratio to 10:11, specify:
  24806. <div class="example">
  24807. <pre class="example-preformatted">setsar=sar=10/11
  24808. </pre></div>
  24809. </li><li>To set a display aspect ratio of 16:9, and specify a maximum integer value of
  24810. 1000 in the aspect ratio reduction, use the command:
  24811. <div class="example">
  24812. <pre class="example-preformatted">setdar=ratio=16/9:max=1000
  24813. </pre></div>
  24814. </li></ul>
  24815. <a class="anchor" id="setfield"></a><a name="setfield-1"></a>
  24816. <h3 class="section">11.222 setfield<span class="pull-right"><a class="anchor hidden-xs" href="#setfield-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setfield-1" aria-hidden="true">TOC</a></span></h3>
  24817. <p>Force field for the output video frame.
  24818. </p>
  24819. <p>The <code class="code">setfield</code> filter marks the interlace type field for the
  24820. output frames. It does not change the input frame, but only sets the
  24821. corresponding property, which affects how the frame is treated by
  24822. following filters (e.g. <code class="code">fieldorder</code> or <code class="code">yadif</code>).
  24823. </p>
  24824. <p>The filter accepts the following options:
  24825. </p>
  24826. <dl class="table">
  24827. <dt><samp class="option">mode</samp></dt>
  24828. <dd><p>Available values are:
  24829. </p>
  24830. <dl class="table">
  24831. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24832. <dd><p>Keep the same field property.
  24833. </p>
  24834. </dd>
  24835. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  24836. <dd><p>Mark the frame as bottom-field-first.
  24837. </p>
  24838. </dd>
  24839. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  24840. <dd><p>Mark the frame as top-field-first.
  24841. </p>
  24842. </dd>
  24843. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  24844. <dd><p>Mark the frame as progressive.
  24845. </p></dd>
  24846. </dl>
  24847. </dd>
  24848. </dl>
  24849. <a class="anchor" id="setparams"></a><a name="setparams-1"></a>
  24850. <h3 class="section">11.223 setparams<span class="pull-right"><a class="anchor hidden-xs" href="#setparams-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setparams-1" aria-hidden="true">TOC</a></span></h3>
  24851. <p>Force frame parameter for the output video frame.
  24852. </p>
  24853. <p>The <code class="code">setparams</code> filter marks interlace and color range for the
  24854. output frames. It does not change the input frame, but only sets the
  24855. corresponding property, which affects how the frame is treated by
  24856. filters/encoders.
  24857. </p>
  24858. <dl class="table">
  24859. <dt><samp class="option">field_mode</samp></dt>
  24860. <dd><p>Available values are:
  24861. </p>
  24862. <dl class="table">
  24863. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24864. <dd><p>Keep the same field property (default).
  24865. </p>
  24866. </dd>
  24867. <dt>&lsquo;<samp class="samp">bff</samp>&rsquo;</dt>
  24868. <dd><p>Mark the frame as bottom-field-first.
  24869. </p>
  24870. </dd>
  24871. <dt>&lsquo;<samp class="samp">tff</samp>&rsquo;</dt>
  24872. <dd><p>Mark the frame as top-field-first.
  24873. </p>
  24874. </dd>
  24875. <dt>&lsquo;<samp class="samp">prog</samp>&rsquo;</dt>
  24876. <dd><p>Mark the frame as progressive.
  24877. </p></dd>
  24878. </dl>
  24879. </dd>
  24880. <dt><samp class="option">range</samp></dt>
  24881. <dd><p>Available values are:
  24882. </p>
  24883. <dl class="table">
  24884. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24885. <dd><p>Keep the same color range property (default).
  24886. </p>
  24887. </dd>
  24888. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  24889. <dd><p>Mark the frame as unspecified color range.
  24890. </p>
  24891. </dd>
  24892. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  24893. <dd><p>Mark the frame as limited range.
  24894. </p>
  24895. </dd>
  24896. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  24897. <dd><p>Mark the frame as full range.
  24898. </p></dd>
  24899. </dl>
  24900. </dd>
  24901. <dt><samp class="option">color_primaries</samp></dt>
  24902. <dd><p>Set the color primaries.
  24903. Available values are:
  24904. </p>
  24905. <dl class="table">
  24906. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24907. <dd><p>Keep the same color primaries property (default).
  24908. </p>
  24909. </dd>
  24910. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24911. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  24912. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24913. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24914. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24915. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24916. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  24917. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  24918. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  24919. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  24920. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  24921. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  24922. </dl>
  24923. </dd>
  24924. <dt><samp class="option">color_trc</samp></dt>
  24925. <dd><p>Set the color transfer.
  24926. Available values are:
  24927. </p>
  24928. <dl class="table">
  24929. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24930. <dd><p>Keep the same color trc property (default).
  24931. </p>
  24932. </dd>
  24933. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24934. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  24935. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  24936. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24937. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24938. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24939. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  24940. <dt>&lsquo;<samp class="samp">log100</samp>&rsquo;</dt>
  24941. <dt>&lsquo;<samp class="samp">log316</samp>&rsquo;</dt>
  24942. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  24943. <dt>&lsquo;<samp class="samp">bt1361e</samp>&rsquo;</dt>
  24944. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  24945. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  24946. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  24947. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  24948. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  24949. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  24950. </dl>
  24951. </dd>
  24952. <dt><samp class="option">colorspace</samp></dt>
  24953. <dd><p>Set the colorspace.
  24954. Available values are:
  24955. </p>
  24956. <dl class="table">
  24957. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24958. <dd><p>Keep the same colorspace property (default).
  24959. </p>
  24960. </dd>
  24961. <dt>&lsquo;<samp class="samp">gbr</samp>&rsquo;</dt>
  24962. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  24963. <dt>&lsquo;<samp class="samp">unknown</samp>&rsquo;</dt>
  24964. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  24965. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  24966. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  24967. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  24968. <dt>&lsquo;<samp class="samp">ycgco</samp>&rsquo;</dt>
  24969. <dt>&lsquo;<samp class="samp">bt2020nc</samp>&rsquo;</dt>
  24970. <dt>&lsquo;<samp class="samp">bt2020c</samp>&rsquo;</dt>
  24971. <dt>&lsquo;<samp class="samp">smpte2085</samp>&rsquo;</dt>
  24972. <dt>&lsquo;<samp class="samp">chroma-derived-nc</samp>&rsquo;</dt>
  24973. <dt>&lsquo;<samp class="samp">chroma-derived-c</samp>&rsquo;</dt>
  24974. <dt>&lsquo;<samp class="samp">ictcp</samp>&rsquo;</dt>
  24975. </dl>
  24976. </dd>
  24977. <dt><samp class="option">chroma_location</samp></dt>
  24978. <dd><p>Set the chroma sample location.
  24979. Available values are:
  24980. </p>
  24981. <dl class="table">
  24982. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  24983. <dd><p>Keep the same chroma location (default).
  24984. </p>
  24985. </dd>
  24986. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  24987. <dt>&lsquo;<samp class="samp">left</samp>&rsquo;</dt>
  24988. <dt>&lsquo;<samp class="samp">center</samp>&rsquo;</dt>
  24989. <dt>&lsquo;<samp class="samp">topleft</samp>&rsquo;</dt>
  24990. <dt>&lsquo;<samp class="samp">top</samp>&rsquo;</dt>
  24991. <dt>&lsquo;<samp class="samp">bottomleft</samp>&rsquo;</dt>
  24992. <dt>&lsquo;<samp class="samp">bottom</samp>&rsquo;</dt>
  24993. </dl>
  24994. </dd>
  24995. <dt><samp class="option">alpha_mode</samp></dt>
  24996. <dd><p>Set the alpha moda.
  24997. Available values are:
  24998. </p>
  24999. <dl class="table">
  25000. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  25001. <dd><p>Keep the same alpha mode (default).
  25002. </p>
  25003. </dd>
  25004. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  25005. <dt>&lsquo;<samp class="samp">premultiplied</samp>&rsquo;</dt>
  25006. <dt>&lsquo;<samp class="samp">straight</samp>&rsquo;</dt>
  25007. </dl>
  25008. </dd>
  25009. </dl>
  25010. <a name="shear"></a>
  25011. <h3 class="section">11.224 shear<span class="pull-right"><a class="anchor hidden-xs" href="#shear" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shear" aria-hidden="true">TOC</a></span></h3>
  25012. <p>Apply shear transform to input video.
  25013. </p>
  25014. <p>This filter supports the following options:
  25015. </p>
  25016. <dl class="table">
  25017. <dt><samp class="option">shx</samp></dt>
  25018. <dd><p>Shear factor in X-direction. Default value is 0.
  25019. Allowed range is from -2 to 2.
  25020. </p>
  25021. </dd>
  25022. <dt><samp class="option">shy</samp></dt>
  25023. <dd><p>Shear factor in Y-direction. Default value is 0.
  25024. Allowed range is from -2 to 2.
  25025. </p>
  25026. </dd>
  25027. <dt><samp class="option">fillcolor, c</samp></dt>
  25028. <dd><p>Set the color used to fill the output area not covered by the transformed
  25029. video. For the general syntax of this option, check the
  25030. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  25031. If the special value &quot;none&quot; is selected then no
  25032. background is printed (useful for example if the background is never shown).
  25033. </p>
  25034. <p>Default value is &quot;black&quot;.
  25035. </p>
  25036. </dd>
  25037. <dt><samp class="option">interp</samp></dt>
  25038. <dd><p>Set interpolation type. Can be <code class="code">bilinear</code> or <code class="code">nearest</code>. Default is <code class="code">bilinear</code>.
  25039. </p></dd>
  25040. </dl>
  25041. <a name="Commands-141"></a>
  25042. <h4 class="subsection">11.224.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-141" aria-hidden="true">TOC</a></span></h4>
  25043. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25044. </p>
  25045. <a name="showinfo"></a>
  25046. <h3 class="section">11.225 showinfo<span class="pull-right"><a class="anchor hidden-xs" href="#showinfo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showinfo" aria-hidden="true">TOC</a></span></h3>
  25047. <p>Show a line containing various information for each input video frame.
  25048. The input video is not modified.
  25049. </p>
  25050. <p>This filter supports the following options:
  25051. </p>
  25052. <dl class="table">
  25053. <dt><samp class="option">checksum</samp></dt>
  25054. <dd><p>Calculate checksums of each plane. By default enabled.
  25055. </p>
  25056. </dd>
  25057. <dt><samp class="option">udu_sei_as_ascii</samp></dt>
  25058. <dd><p>Try to print user data unregistered SEI as ascii character when possible,
  25059. in hex format otherwise.
  25060. </p></dd>
  25061. </dl>
  25062. <p>The shown line contains a sequence of key/value pairs of the form
  25063. <var class="var">key</var>:<var class="var">value</var>.
  25064. </p>
  25065. <p>The following values are shown in the output:
  25066. </p>
  25067. <dl class="table">
  25068. <dt><samp class="option">n</samp></dt>
  25069. <dd><p>The (sequential) number of the input frame, starting from 0.
  25070. </p>
  25071. </dd>
  25072. <dt><samp class="option">pts</samp></dt>
  25073. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  25074. time base units. The time base unit depends on the filter input pad.
  25075. </p>
  25076. </dd>
  25077. <dt><samp class="option">pts_time</samp></dt>
  25078. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  25079. seconds.
  25080. </p>
  25081. </dd>
  25082. <dt><samp class="option">fmt</samp></dt>
  25083. <dd><p>The pixel format name.
  25084. </p>
  25085. </dd>
  25086. <dt><samp class="option">sar</samp></dt>
  25087. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  25088. <var class="var">num</var>/<var class="var">den</var>.
  25089. </p>
  25090. </dd>
  25091. <dt><samp class="option">s</samp></dt>
  25092. <dd><p>The size of the input frame. For the syntax of this option, check the
  25093. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25094. </p>
  25095. </dd>
  25096. <dt><samp class="option">i</samp></dt>
  25097. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  25098. for bottom field first).
  25099. </p>
  25100. </dd>
  25101. <dt><samp class="option">iskey</samp></dt>
  25102. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  25103. </p>
  25104. </dd>
  25105. <dt><samp class="option">type</samp></dt>
  25106. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  25107. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  25108. Also refer to the documentation of the <code class="code">AVPictureType</code> enum and of
  25109. the <code class="code">av_get_picture_type_char</code> function defined in
  25110. <samp class="file">libavutil/avutil.h</samp>.
  25111. </p>
  25112. </dd>
  25113. <dt><samp class="option">checksum</samp></dt>
  25114. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  25115. </p>
  25116. </dd>
  25117. <dt><samp class="option">plane_checksum</samp></dt>
  25118. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  25119. expressed in the form &quot;[<var class="var">c0</var> <var class="var">c1</var> <var class="var">c2</var> <var class="var">c3</var>]&quot;.
  25120. </p>
  25121. </dd>
  25122. <dt><samp class="option">mean</samp></dt>
  25123. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  25124. &quot;[<var class="var">mean0</var> <var class="var">mean1</var> <var class="var">mean2</var> <var class="var">mean3</var>]&quot;.
  25125. </p>
  25126. </dd>
  25127. <dt><samp class="option">stdev</samp></dt>
  25128. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  25129. in the form &quot;[<var class="var">stdev0</var> <var class="var">stdev1</var> <var class="var">stdev2</var> <var class="var">stdev3</var>]&quot;.
  25130. </p>
  25131. </dd>
  25132. </dl>
  25133. <a name="showpalette"></a>
  25134. <h3 class="section">11.226 showpalette<span class="pull-right"><a class="anchor hidden-xs" href="#showpalette" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showpalette" aria-hidden="true">TOC</a></span></h3>
  25135. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  25136. <var class="var">pal8</var> pixel format frames.
  25137. </p>
  25138. <p>It accepts the following option:
  25139. </p>
  25140. <dl class="table">
  25141. <dt><samp class="option">s</samp></dt>
  25142. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  25143. <code class="code">30</code> (for a <code class="code">30x30</code> pixel box).
  25144. </p></dd>
  25145. </dl>
  25146. <a name="shuffleframes"></a>
  25147. <h3 class="section">11.227 shuffleframes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleframes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleframes" aria-hidden="true">TOC</a></span></h3>
  25148. <p>Reorder and/or duplicate and/or drop video frames.
  25149. </p>
  25150. <p>It accepts the following parameters:
  25151. </p>
  25152. <dl class="table">
  25153. <dt><samp class="option">mapping</samp></dt>
  25154. <dd><p>Set the destination indexes of input frames.
  25155. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  25156. frames. Number of indexes also sets maximal value that each index may have.
  25157. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  25158. </p></dd>
  25159. </dl>
  25160. <p>The first frame has the index 0. The default is to keep the input unchanged.
  25161. </p>
  25162. <a name="Examples-117"></a>
  25163. <h4 class="subsection">11.227.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-117" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-117" aria-hidden="true">TOC</a></span></h4>
  25164. <ul class="itemize mark-bullet">
  25165. <li>Swap second and third frame of every three frames of the input:
  25166. <div class="example">
  25167. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  25168. </pre></div>
  25169. </li><li>Swap 10th and 1st frame of every ten frames of the input:
  25170. <div class="example">
  25171. <pre class="example-preformatted">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  25172. </pre></div>
  25173. </li></ul>
  25174. <a name="shufflepixels"></a>
  25175. <h3 class="section">11.228 shufflepixels<span class="pull-right"><a class="anchor hidden-xs" href="#shufflepixels" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shufflepixels" aria-hidden="true">TOC</a></span></h3>
  25176. <p>Reorder pixels in video frames.
  25177. </p>
  25178. <p>This filter accepts the following options:
  25179. </p>
  25180. <dl class="table">
  25181. <dt><samp class="option">direction, d</samp></dt>
  25182. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  25183. Default direction is forward.
  25184. </p>
  25185. </dd>
  25186. <dt><samp class="option">mode, m</samp></dt>
  25187. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  25188. </p>
  25189. </dd>
  25190. <dt><samp class="option">width, w</samp></dt>
  25191. <dt><samp class="option">height, h</samp></dt>
  25192. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  25193. part of size is used, and in case of vertical shuffle mode only height
  25194. part of size is used.
  25195. </p>
  25196. </dd>
  25197. <dt><samp class="option">seed, s</samp></dt>
  25198. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  25199. to reverse filtering process to get original input.
  25200. For example, to reverse forward shuffle you need to use same parameters
  25201. and exact same seed and to set direction to inverse.
  25202. </p></dd>
  25203. </dl>
  25204. <a name="shuffleplanes"></a>
  25205. <h3 class="section">11.229 shuffleplanes<span class="pull-right"><a class="anchor hidden-xs" href="#shuffleplanes" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-shuffleplanes" aria-hidden="true">TOC</a></span></h3>
  25206. <p>Reorder and/or duplicate video planes.
  25207. </p>
  25208. <p>It accepts the following parameters:
  25209. </p>
  25210. <dl class="table">
  25211. <dt><samp class="option">map0</samp></dt>
  25212. <dd><p>The index of the input plane to be used as the first output plane.
  25213. </p>
  25214. </dd>
  25215. <dt><samp class="option">map1</samp></dt>
  25216. <dd><p>The index of the input plane to be used as the second output plane.
  25217. </p>
  25218. </dd>
  25219. <dt><samp class="option">map2</samp></dt>
  25220. <dd><p>The index of the input plane to be used as the third output plane.
  25221. </p>
  25222. </dd>
  25223. <dt><samp class="option">map3</samp></dt>
  25224. <dd><p>The index of the input plane to be used as the fourth output plane.
  25225. </p>
  25226. </dd>
  25227. </dl>
  25228. <p>The first plane has the index 0. The default is to keep the input unchanged.
  25229. </p>
  25230. <a name="Examples-118"></a>
  25231. <h4 class="subsection">11.229.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-118" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-118" aria-hidden="true">TOC</a></span></h4>
  25232. <ul class="itemize mark-bullet">
  25233. <li>Swap the second and third planes of the input:
  25234. <div class="example">
  25235. <pre class="example-preformatted">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  25236. </pre></div>
  25237. </li></ul>
  25238. <a class="anchor" id="signalstats"></a><a name="signalstats-1"></a>
  25239. <h3 class="section">11.230 signalstats<span class="pull-right"><a class="anchor hidden-xs" href="#signalstats-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signalstats-1" aria-hidden="true">TOC</a></span></h3>
  25240. <p>Evaluate various visual metrics that assist in determining issues associated
  25241. with the digitization of analog video media.
  25242. </p>
  25243. <p>By default the filter will log these metadata values:
  25244. </p>
  25245. <dl class="table">
  25246. <dt><samp class="option">YMIN</samp></dt>
  25247. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  25248. range of [0-255].
  25249. </p>
  25250. </dd>
  25251. <dt><samp class="option">YLOW</samp></dt>
  25252. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  25253. range of [0-255].
  25254. </p>
  25255. </dd>
  25256. <dt><samp class="option">YAVG</samp></dt>
  25257. <dd><p>Display the average Y value within the input frame. Expressed in range of
  25258. [0-255].
  25259. </p>
  25260. </dd>
  25261. <dt><samp class="option">YHIGH</samp></dt>
  25262. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  25263. range of [0-255].
  25264. </p>
  25265. </dd>
  25266. <dt><samp class="option">YMAX</samp></dt>
  25267. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  25268. range of [0-255].
  25269. </p>
  25270. </dd>
  25271. <dt><samp class="option">UMIN</samp></dt>
  25272. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  25273. range of [0-255].
  25274. </p>
  25275. </dd>
  25276. <dt><samp class="option">ULOW</samp></dt>
  25277. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  25278. range of [0-255].
  25279. </p>
  25280. </dd>
  25281. <dt><samp class="option">UAVG</samp></dt>
  25282. <dd><p>Display the average U value within the input frame. Expressed in range of
  25283. [0-255].
  25284. </p>
  25285. </dd>
  25286. <dt><samp class="option">UHIGH</samp></dt>
  25287. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  25288. range of [0-255].
  25289. </p>
  25290. </dd>
  25291. <dt><samp class="option">UMAX</samp></dt>
  25292. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  25293. range of [0-255].
  25294. </p>
  25295. </dd>
  25296. <dt><samp class="option">VMIN</samp></dt>
  25297. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  25298. range of [0-255].
  25299. </p>
  25300. </dd>
  25301. <dt><samp class="option">VLOW</samp></dt>
  25302. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  25303. range of [0-255].
  25304. </p>
  25305. </dd>
  25306. <dt><samp class="option">VAVG</samp></dt>
  25307. <dd><p>Display the average V value within the input frame. Expressed in range of
  25308. [0-255].
  25309. </p>
  25310. </dd>
  25311. <dt><samp class="option">VHIGH</samp></dt>
  25312. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  25313. range of [0-255].
  25314. </p>
  25315. </dd>
  25316. <dt><samp class="option">VMAX</samp></dt>
  25317. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  25318. range of [0-255].
  25319. </p>
  25320. </dd>
  25321. <dt><samp class="option">SATMIN</samp></dt>
  25322. <dd><p>Display the minimal saturation value contained within the input frame.
  25323. Expressed in range of [0-~181.02].
  25324. </p>
  25325. </dd>
  25326. <dt><samp class="option">SATLOW</samp></dt>
  25327. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  25328. Expressed in range of [0-~181.02].
  25329. </p>
  25330. </dd>
  25331. <dt><samp class="option">SATAVG</samp></dt>
  25332. <dd><p>Display the average saturation value within the input frame. Expressed in range
  25333. of [0-~181.02].
  25334. </p>
  25335. </dd>
  25336. <dt><samp class="option">SATHIGH</samp></dt>
  25337. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  25338. Expressed in range of [0-~181.02].
  25339. </p>
  25340. </dd>
  25341. <dt><samp class="option">SATMAX</samp></dt>
  25342. <dd><p>Display the maximum saturation value contained within the input frame.
  25343. Expressed in range of [0-~181.02].
  25344. </p>
  25345. </dd>
  25346. <dt><samp class="option">HUEMED</samp></dt>
  25347. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  25348. [0-360].
  25349. </p>
  25350. </dd>
  25351. <dt><samp class="option">HUEAVG</samp></dt>
  25352. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  25353. [0-360].
  25354. </p>
  25355. </dd>
  25356. <dt><samp class="option">YDIF</samp></dt>
  25357. <dd><p>Display the average of sample value difference between all values of the Y
  25358. plane in the current frame and corresponding values of the previous input frame.
  25359. Expressed in range of [0-255].
  25360. </p>
  25361. </dd>
  25362. <dt><samp class="option">UDIF</samp></dt>
  25363. <dd><p>Display the average of sample value difference between all values of the U
  25364. plane in the current frame and corresponding values of the previous input frame.
  25365. Expressed in range of [0-255].
  25366. </p>
  25367. </dd>
  25368. <dt><samp class="option">VDIF</samp></dt>
  25369. <dd><p>Display the average of sample value difference between all values of the V
  25370. plane in the current frame and corresponding values of the previous input frame.
  25371. Expressed in range of [0-255].
  25372. </p>
  25373. </dd>
  25374. <dt><samp class="option">YBITDEPTH</samp></dt>
  25375. <dd><p>Display bit depth of Y plane in current frame.
  25376. Expressed in range of [0-16].
  25377. </p>
  25378. </dd>
  25379. <dt><samp class="option">UBITDEPTH</samp></dt>
  25380. <dd><p>Display bit depth of U plane in current frame.
  25381. Expressed in range of [0-16].
  25382. </p>
  25383. </dd>
  25384. <dt><samp class="option">VBITDEPTH</samp></dt>
  25385. <dd><p>Display bit depth of V plane in current frame.
  25386. Expressed in range of [0-16].
  25387. </p></dd>
  25388. </dl>
  25389. <p>The filter accepts the following options:
  25390. </p>
  25391. <dl class="table">
  25392. <dt><samp class="option">stat</samp></dt>
  25393. <dt><samp class="option">out</samp></dt>
  25394. <dd>
  25395. <p><samp class="option">stat</samp> specify an additional form of image analysis.
  25396. <samp class="option">out</samp> output video with the specified type of pixel highlighted.
  25397. </p>
  25398. <p>Both options accept the following values:
  25399. </p>
  25400. <dl class="table">
  25401. <dt>&lsquo;<samp class="samp">tout</samp>&rsquo;</dt>
  25402. <dd><p>Identify <var class="var">temporal outliers</var> pixels. A <var class="var">temporal outlier</var> is a pixel
  25403. unlike the neighboring pixels of the same field. Examples of temporal outliers
  25404. include the results of video dropouts, head clogs, or tape tracking issues.
  25405. </p>
  25406. </dd>
  25407. <dt>&lsquo;<samp class="samp">vrep</samp>&rsquo;</dt>
  25408. <dd><p>Identify <var class="var">vertical line repetition</var>. Vertical line repetition includes
  25409. similar rows of pixels within a frame. In born-digital video vertical line
  25410. repetition is common, but this pattern is uncommon in video digitized from an
  25411. analog source. When it occurs in video that results from the digitization of an
  25412. analog source it can indicate concealment from a dropout compensator.
  25413. </p>
  25414. </dd>
  25415. <dt>&lsquo;<samp class="samp">brng</samp>&rsquo;</dt>
  25416. <dd><p>Identify pixels that fall outside of legal broadcast range.
  25417. </p></dd>
  25418. </dl>
  25419. </dd>
  25420. <dt><samp class="option">color, c</samp></dt>
  25421. <dd><p>Set the highlight color for the <samp class="option">out</samp> option. The default color is
  25422. yellow.
  25423. </p></dd>
  25424. </dl>
  25425. <a name="Examples-119"></a>
  25426. <h4 class="subsection">11.230.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-119" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-119" aria-hidden="true">TOC</a></span></h4>
  25427. <ul class="itemize mark-bullet">
  25428. <li>Output data of various video metrics:
  25429. <div class="example">
  25430. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  25431. </pre></div>
  25432. </li><li>Output specific data about the minimum and maximum values of the Y plane per frame:
  25433. <div class="example">
  25434. <pre class="example-preformatted">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  25435. </pre></div>
  25436. </li><li>Playback video while highlighting pixels that are outside of broadcast range in red.
  25437. <div class="example">
  25438. <pre class="example-preformatted">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  25439. </pre></div>
  25440. </li><li>Playback video with signalstats metadata drawn over the frame.
  25441. <div class="example">
  25442. <pre class="example-preformatted">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  25443. </pre></div>
  25444. <p>The contents of signalstat_drawtext.txt used in the command are:
  25445. </p><div class="example">
  25446. <pre class="example-preformatted">time %{pts:hms}
  25447. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  25448. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  25449. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  25450. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  25451. </pre></div>
  25452. </li></ul>
  25453. <a class="anchor" id="signature"></a><a name="signature-1"></a>
  25454. <h3 class="section">11.231 signature<span class="pull-right"><a class="anchor hidden-xs" href="#signature-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-signature-1" aria-hidden="true">TOC</a></span></h3>
  25455. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  25456. input. In this case the matching between the inputs can be calculated additionally.
  25457. The filter always passes through the first input. The signature of each stream can
  25458. be written into a file.
  25459. </p>
  25460. <p>It accepts the following options:
  25461. </p>
  25462. <dl class="table">
  25463. <dt><samp class="option">detectmode</samp></dt>
  25464. <dd><p>Enable or disable the matching process.
  25465. </p>
  25466. <p>Available values are:
  25467. </p>
  25468. <dl class="table">
  25469. <dt>&lsquo;<samp class="samp">off</samp>&rsquo;</dt>
  25470. <dd><p>Disable the calculation of a matching (default).
  25471. </p></dd>
  25472. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  25473. <dd><p>Calculate the matching for the whole video and output whether the whole video
  25474. matches or only parts.
  25475. </p></dd>
  25476. <dt>&lsquo;<samp class="samp">fast</samp>&rsquo;</dt>
  25477. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  25478. some cases.
  25479. </p></dd>
  25480. </dl>
  25481. </dd>
  25482. <dt><samp class="option">nb_inputs</samp></dt>
  25483. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  25484. Default value is 1.
  25485. </p>
  25486. </dd>
  25487. <dt><samp class="option">filename</samp></dt>
  25488. <dd><p>Set the path to which the output is written. If there is more than one input,
  25489. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  25490. integer), that will be replaced with the input number. If no filename is
  25491. specified, no output will be written. This is the default.
  25492. </p>
  25493. </dd>
  25494. <dt><samp class="option">format</samp></dt>
  25495. <dd><p>Choose the output format.
  25496. </p>
  25497. <p>Available values are:
  25498. </p>
  25499. <dl class="table">
  25500. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  25501. <dd><p>Use the specified binary representation (default).
  25502. </p></dd>
  25503. <dt>&lsquo;<samp class="samp">xml</samp>&rsquo;</dt>
  25504. <dd><p>Use the specified xml representation.
  25505. </p></dd>
  25506. </dl>
  25507. </dd>
  25508. <dt><samp class="option">th_d</samp></dt>
  25509. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  25510. greater than zero. The default value is 9000.
  25511. </p>
  25512. </dd>
  25513. <dt><samp class="option">th_dc</samp></dt>
  25514. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  25515. greater than zero. The default value is 60000.
  25516. </p>
  25517. </dd>
  25518. <dt><samp class="option">th_xh</samp></dt>
  25519. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  25520. greater than zero. The default value is 116.
  25521. </p>
  25522. </dd>
  25523. <dt><samp class="option">th_di</samp></dt>
  25524. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  25525. sequence. The option value must be a non negative integer value.
  25526. The default value is 0.
  25527. </p>
  25528. </dd>
  25529. <dt><samp class="option">th_it</samp></dt>
  25530. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  25531. The option value must be a double value between 0 and 1. The default value is 0.5.
  25532. </p></dd>
  25533. </dl>
  25534. <a name="Examples-120"></a>
  25535. <h4 class="subsection">11.231.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-120" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-120" aria-hidden="true">TOC</a></span></h4>
  25536. <ul class="itemize mark-bullet">
  25537. <li>To calculate the signature of an input video and store it in signature.bin:
  25538. <div class="example">
  25539. <pre class="example-preformatted">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  25540. </pre></div>
  25541. </li><li>To detect whether two videos match and store the signatures in XML format in
  25542. signature0.xml and signature1.xml:
  25543. <div class="example">
  25544. <pre class="example-preformatted">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 -
  25545. </pre></div>
  25546. </li></ul>
  25547. <a class="anchor" id="siti"></a><a name="siti-1"></a>
  25548. <h3 class="section">11.232 siti<span class="pull-right"><a class="anchor hidden-xs" href="#siti-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-siti-1" aria-hidden="true">TOC</a></span></h3>
  25549. <p>Calculate Spatial Information (SI) and Temporal Information (TI) scores for a video,
  25550. as defined in ITU-T Rec. P.910 (11/21): Subjective video quality assessment methods
  25551. for multimedia applications. Available PDF at <a class="url" href="https://www.itu.int/rec/T-REC-P.910-202111-S/en">https://www.itu.int/rec/T-REC-P.910-202111-S/en</a>.
  25552. Note that this is a legacy implementation that corresponds to a superseded recommendation.
  25553. Refer to ITU-T Rec. P.910 (07/22) for the latest version: <a class="url" href="https://www.itu.int/rec/T-REC-P.910-202207-I/en">https://www.itu.int/rec/T-REC-P.910-202207-I/en</a>
  25554. </p>
  25555. <p>It accepts the following option:
  25556. </p>
  25557. <dl class="table">
  25558. <dt><samp class="option">print_summary</samp></dt>
  25559. <dd><p>If set to 1, Summary statistics will be printed to the console. Default 0.
  25560. </p></dd>
  25561. </dl>
  25562. <a name="Examples-121"></a>
  25563. <h4 class="subsection">11.232.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-121" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-121" aria-hidden="true">TOC</a></span></h4>
  25564. <ul class="itemize mark-bullet">
  25565. <li>To calculate SI/TI metrics and print summary:
  25566. <div class="example">
  25567. <pre class="example-preformatted">ffmpeg -i input.mp4 -vf siti=print_summary=1 -f null -
  25568. </pre></div>
  25569. </li></ul>
  25570. <a class="anchor" id="smartblur"></a><a name="smartblur-1"></a>
  25571. <h3 class="section">11.233 smartblur<span class="pull-right"><a class="anchor hidden-xs" href="#smartblur-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-smartblur-1" aria-hidden="true">TOC</a></span></h3>
  25572. <p>Blur the input video without impacting the outlines.
  25573. </p>
  25574. <p>It accepts the following options:
  25575. </p>
  25576. <dl class="table">
  25577. <dt><samp class="option">luma_radius, lr</samp></dt>
  25578. <dd><p>Set the luma radius. The option value must be a float number in
  25579. the range [0.1,5.0] that specifies the variance of the gaussian filter
  25580. used to blur the image (slower if larger). Default value is 1.0.
  25581. </p>
  25582. </dd>
  25583. <dt><samp class="option">luma_strength, ls</samp></dt>
  25584. <dd><p>Set the luma strength. The option value must be a float number
  25585. in the range [-1.0,1.0] that configures the blurring. A value included
  25586. in [0.0,1.0] will blur the image whereas a value included in
  25587. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  25588. </p>
  25589. </dd>
  25590. <dt><samp class="option">luma_threshold, lt</samp></dt>
  25591. <dd><p>Set the luma threshold used as a coefficient to determine
  25592. whether a pixel should be blurred or not. The option value must be an
  25593. integer in the range [-30,30]. A value of 0 will filter all the image,
  25594. a value included in [0,30] will filter flat areas and a value included
  25595. in [-30,0] will filter edges. Default value is 0.
  25596. </p>
  25597. </dd>
  25598. <dt><samp class="option">chroma_radius, cr</samp></dt>
  25599. <dd><p>Set the chroma radius. The option value must be a float number in
  25600. the range [0.1,5.0] that specifies the variance of the gaussian filter
  25601. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  25602. </p>
  25603. </dd>
  25604. <dt><samp class="option">chroma_strength, cs</samp></dt>
  25605. <dd><p>Set the chroma strength. The option value must be a float number
  25606. in the range [-1.0,1.0] that configures the blurring. A value included
  25607. in [0.0,1.0] will blur the image whereas a value included in
  25608. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  25609. </p>
  25610. </dd>
  25611. <dt><samp class="option">chroma_threshold, ct</samp></dt>
  25612. <dd><p>Set the chroma threshold used as a coefficient to determine
  25613. whether a pixel should be blurred or not. The option value must be an
  25614. integer in the range [-30,30]. A value of 0 will filter all the image,
  25615. a value included in [0,30] will filter flat areas and a value included
  25616. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  25617. </p>
  25618. </dd>
  25619. <dt><samp class="option">alpha_radius, ar</samp></dt>
  25620. <dd><p>Set the alpha radius. The option value must be a float number in
  25621. the range [0.1,5.0] that specifies the variance of the gaussian filter
  25622. used to blur the image (slower if larger). Default value is <samp class="option">luma_radius</samp>.
  25623. </p>
  25624. </dd>
  25625. <dt><samp class="option">alpha_strength, as</samp></dt>
  25626. <dd><p>Set the alpha strength. The option value must be a float number
  25627. in the range [-1.0,1.0] that configures the blurring. A value included
  25628. in [0.0,1.0] will blur the image whereas a value included in
  25629. [-1.0,0.0] will sharpen the image. Default value is <samp class="option">luma_strength</samp>.
  25630. </p>
  25631. </dd>
  25632. <dt><samp class="option">alpha_threshold, at</samp></dt>
  25633. <dd><p>Set the alpha threshold used as a coefficient to determine
  25634. whether a pixel should be blurred or not. The option value must be an
  25635. integer in the range [-30,30]. A value of 0 will filter all the image,
  25636. a value included in [0,30] will filter flat areas and a value included
  25637. in [-30,0] will filter edges. Default value is <samp class="option">luma_threshold</samp>.
  25638. </p></dd>
  25639. </dl>
  25640. <p>If a chroma or alpha option is not explicitly set, the corresponding luma value
  25641. is set.
  25642. </p>
  25643. <a name="sobel"></a>
  25644. <h3 class="section">11.234 sobel<span class="pull-right"><a class="anchor hidden-xs" href="#sobel" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel" aria-hidden="true">TOC</a></span></h3>
  25645. <p>Apply sobel operator to input video stream.
  25646. </p>
  25647. <p>The filter accepts the following option:
  25648. </p>
  25649. <dl class="table">
  25650. <dt><samp class="option">planes</samp></dt>
  25651. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  25652. By default value 0xf, all planes will be processed.
  25653. </p>
  25654. </dd>
  25655. <dt><samp class="option">scale</samp></dt>
  25656. <dd><p>Set value which will be multiplied with filtered result.
  25657. </p>
  25658. </dd>
  25659. <dt><samp class="option">delta</samp></dt>
  25660. <dd><p>Set value which will be added to filtered result.
  25661. </p></dd>
  25662. </dl>
  25663. <a name="Commands-142"></a>
  25664. <h4 class="subsection">11.234.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-142" aria-hidden="true">TOC</a></span></h4>
  25665. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  25666. </p>
  25667. <a class="anchor" id="spp"></a><a name="spp-1"></a>
  25668. <h3 class="section">11.235 spp<span class="pull-right"><a class="anchor hidden-xs" href="#spp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spp-1" aria-hidden="true">TOC</a></span></h3>
  25669. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  25670. at several (or - in the case of <samp class="option">quality</samp> level <code class="code">6</code> - all) shifts
  25671. and average the results.
  25672. </p>
  25673. <p>The filter accepts the following options:
  25674. </p>
  25675. <dl class="table">
  25676. <dt><samp class="option">quality</samp></dt>
  25677. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  25678. an integer in the range 0-6. If set to <code class="code">0</code>, the filter will have no
  25679. effect. A value of <code class="code">6</code> means the higher quality. For each increment of
  25680. that value the speed drops by a factor of approximately 2. Default value is
  25681. <code class="code">3</code>.
  25682. </p>
  25683. </dd>
  25684. <dt><samp class="option">qp</samp></dt>
  25685. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  25686. from the video stream (if available).
  25687. </p>
  25688. </dd>
  25689. <dt><samp class="option">mode</samp></dt>
  25690. <dd><p>Set thresholding mode. Available modes are:
  25691. </p>
  25692. <dl class="table">
  25693. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  25694. <dd><p>Set hard thresholding (default).
  25695. </p></dd>
  25696. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  25697. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  25698. </p></dd>
  25699. </dl>
  25700. </dd>
  25701. <dt><samp class="option">use_bframe_qp</samp></dt>
  25702. <dd><p>Enable the use of the QP from the B-Frames if set to <code class="code">1</code>. Using this
  25703. option may cause flicker since the B-Frames have often larger QP. Default is
  25704. <code class="code">0</code> (not enabled).
  25705. </p></dd>
  25706. </dl>
  25707. <a name="Commands-143"></a>
  25708. <h4 class="subsection">11.235.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-143" aria-hidden="true">TOC</a></span></h4>
  25709. <p>This filter supports the following commands:
  25710. </p><dl class="table">
  25711. <dt><samp class="option">quality, level</samp></dt>
  25712. <dd><p>Set quality level. The value <code class="code">max</code> can be used to set the maximum level,
  25713. currently <code class="code">6</code>.
  25714. </p></dd>
  25715. </dl>
  25716. <a class="anchor" id="sr"></a><a name="sr-1"></a>
  25717. <h3 class="section">11.236 sr<span class="pull-right"><a class="anchor hidden-xs" href="#sr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr-1" aria-hidden="true">TOC</a></span></h3>
  25718. <p>Scale the input by applying one of the super-resolution methods based on
  25719. convolutional neural networks. Supported models:
  25720. </p>
  25721. <ul class="itemize mark-bullet">
  25722. <li>Super-Resolution Convolutional Neural Network model (SRCNN).
  25723. See <a class="url" href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  25724. </li><li>Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  25725. See <a class="url" href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  25726. </li></ul>
  25727. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  25728. <a class="url" href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  25729. is at <a class="url" href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  25730. </p>
  25731. <p>The filter accepts the following options:
  25732. </p>
  25733. <dl class="table">
  25734. <dt><samp class="option">dnn_backend</samp></dt>
  25735. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  25736. the following values:
  25737. </p>
  25738. <dl class="table">
  25739. <dt>&lsquo;<samp class="samp">tensorflow</samp>&rsquo;</dt>
  25740. <dd><p>TensorFlow backend. To enable this backend you
  25741. need to install the TensorFlow for C library (see
  25742. <a class="url" href="https://www.tensorflow.org/install/lang_c">https://www.tensorflow.org/install/lang_c</a>) and configure FFmpeg with
  25743. <code class="code">--enable-libtensorflow</code>
  25744. </p></dd>
  25745. </dl>
  25746. </dd>
  25747. <dt><samp class="option">model</samp></dt>
  25748. <dd><p>Set path to model file specifying network architecture and its parameters.
  25749. Note that different backends use different file formats. TensorFlow, OpenVINO backend
  25750. can load files for only its format.
  25751. </p>
  25752. </dd>
  25753. <dt><samp class="option">scale_factor</samp></dt>
  25754. <dd><p>Set scale factor for SRCNN model. Allowed values are <code class="code">2</code>, <code class="code">3</code> and <code class="code">4</code>.
  25755. Default value is <code class="code">2</code>. Scale factor is necessary for SRCNN model, because it accepts
  25756. input upscaled using bicubic upscaling with proper scale factor.
  25757. </p></dd>
  25758. </dl>
  25759. <p>To get full functionality (such as async execution), please use the <a class="ref" href="#dnn_005fprocessing">dnn_processing</a> filter.
  25760. </p>
  25761. <a class="anchor" id="sr_005famf"></a><a name="sr_005famf-1"></a>
  25762. <h3 class="section">11.237 sr_amf<span class="pull-right"><a class="anchor hidden-xs" href="#sr_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sr_005famf-1" aria-hidden="true">TOC</a></span></h3>
  25763. <p>Upscale (size increasing) for the input video using AMD Advanced Media Framework library for hardware acceleration.
  25764. Use advanced algorithms for upscaling with higher output quality.
  25765. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  25766. </p>
  25767. <p>The filter accepts the following options:
  25768. </p><dl class="table">
  25769. <dt><samp class="option">w</samp></dt>
  25770. <dt><samp class="option">h</samp></dt>
  25771. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  25772. </p>
  25773. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  25774. </p>
  25775. </dd>
  25776. <dt><samp class="option">algorithm</samp></dt>
  25777. <dd><p>Sets the algorithm used for scaling:
  25778. </p>
  25779. <dl class="table">
  25780. <dt><var class="var">bilinear</var></dt>
  25781. <dd><p>Bilinear
  25782. </p>
  25783. </dd>
  25784. <dt><var class="var">bicubic</var></dt>
  25785. <dd><p>Bicubic
  25786. </p>
  25787. </dd>
  25788. <dt><var class="var">sr1-0</var></dt>
  25789. <dd><p>Video SR1.0
  25790. This is a default value
  25791. </p>
  25792. </dd>
  25793. <dt><var class="var">point</var></dt>
  25794. <dd><p>Point
  25795. </p>
  25796. </dd>
  25797. <dt><var class="var">sr1-1</var></dt>
  25798. <dd><p>Video SR1.1
  25799. </p>
  25800. </dd>
  25801. </dl>
  25802. </dd>
  25803. <dt><samp class="option">sharpness</samp></dt>
  25804. <dd><p>Control hq scaler sharpening. The value is a float in the range of [0.0, 2.0]
  25805. </p>
  25806. </dd>
  25807. <dt><samp class="option">format</samp></dt>
  25808. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  25809. pixel format is used.
  25810. </p>
  25811. </dd>
  25812. <dt><samp class="option">keep-ratio</samp></dt>
  25813. <dd><p>Force the scaler to keep the aspect ratio of the input image when the output size has a different aspect ratio.
  25814. Default value is false.
  25815. </p>
  25816. </dd>
  25817. <dt><samp class="option">fill</samp></dt>
  25818. <dd><p>Specifies whether the output image outside the region of interest,
  25819. which does not fill the entire output surface should be filled with a solid color.
  25820. </p>
  25821. </dd>
  25822. </dl>
  25823. <a name="Examples-122"></a>
  25824. <h4 class="subsection">11.237.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-122" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-122" aria-hidden="true">TOC</a></span></h4>
  25825. <ul class="itemize mark-bullet">
  25826. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  25827. <div class="example">
  25828. <pre class="example-preformatted">sr_amf=-2:720:format=yuv420p
  25829. </pre></div>
  25830. </li><li>Upscale to 4K with algorithm video SR1.1.
  25831. <div class="example">
  25832. <pre class="example-preformatted">sr_amf=4096:2160:algorithm=sr1-1
  25833. </pre></div>
  25834. </li></ul>
  25835. <a name="ssim"></a>
  25836. <h3 class="section">11.238 ssim<span class="pull-right"><a class="anchor hidden-xs" href="#ssim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ssim" aria-hidden="true">TOC</a></span></h3>
  25837. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  25838. </p>
  25839. <p>This filter takes in input two input videos, the first input is
  25840. considered the &quot;main&quot; source and is passed unchanged to the
  25841. output. The second input is used as a &quot;reference&quot; video for computing
  25842. the SSIM.
  25843. </p>
  25844. <p>Both video inputs must have the same resolution and pixel format for
  25845. this filter to work correctly. Also it assumes that both inputs
  25846. have the same number of frames, which are compared one by one.
  25847. </p>
  25848. <p>The filter stores the calculated SSIM of each frame.
  25849. </p>
  25850. <p>The description of the accepted parameters follows.
  25851. </p>
  25852. <dl class="table">
  25853. <dt><samp class="option">stats_file, f</samp></dt>
  25854. <dd><p>If specified the filter will use the named file to save the SSIM of
  25855. each individual frame. When filename equals &quot;-&quot; the data is sent to
  25856. standard output.
  25857. </p></dd>
  25858. </dl>
  25859. <p>The file printed if <var class="var">stats_file</var> is selected, contains a sequence of
  25860. key/value pairs of the form <var class="var">key</var>:<var class="var">value</var> for each compared
  25861. couple of frames.
  25862. </p>
  25863. <p>A description of each shown parameter follows:
  25864. </p>
  25865. <dl class="table">
  25866. <dt><samp class="option">n</samp></dt>
  25867. <dd><p>sequential number of the input frame, starting from 1
  25868. </p>
  25869. </dd>
  25870. <dt><samp class="option">Y, U, V, R, G, B</samp></dt>
  25871. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  25872. </p>
  25873. </dd>
  25874. <dt><samp class="option">All</samp></dt>
  25875. <dd><p>SSIM of the compared frames for the whole frame.
  25876. </p>
  25877. </dd>
  25878. <dt><samp class="option">dB</samp></dt>
  25879. <dd><p>Same as above but in dB representation.
  25880. </p></dd>
  25881. </dl>
  25882. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  25883. </p>
  25884. <a name="Examples-123"></a>
  25885. <h4 class="subsection">11.238.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-123" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-123" aria-hidden="true">TOC</a></span></h4>
  25886. <ul class="itemize mark-bullet">
  25887. <li>For example:
  25888. <div class="example">
  25889. <pre class="example-preformatted">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  25890. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  25891. </pre></div>
  25892. <p>On this example the input file being processed is compared with the
  25893. reference file <samp class="file">ref_movie.mpg</samp>. The SSIM of each individual frame
  25894. is stored in <samp class="file">stats.log</samp>.
  25895. </p>
  25896. </li><li>Another example with both psnr and ssim at same time:
  25897. <div class="example">
  25898. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  25899. </pre></div>
  25900. </li><li>Another example with different containers:
  25901. <div class="example">
  25902. <pre class="example-preformatted">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 -
  25903. </pre></div>
  25904. </li></ul>
  25905. <a name="stereo3d"></a>
  25906. <h3 class="section">11.239 stereo3d<span class="pull-right"><a class="anchor hidden-xs" href="#stereo3d" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-stereo3d" aria-hidden="true">TOC</a></span></h3>
  25907. <p>Convert between different stereoscopic image formats.
  25908. </p>
  25909. <p>The filters accept the following options:
  25910. </p>
  25911. <dl class="table">
  25912. <dt><samp class="option">in</samp></dt>
  25913. <dd><p>Set stereoscopic image format of input.
  25914. </p>
  25915. <p>Available values for input image formats are:
  25916. </p><dl class="table">
  25917. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  25918. <dd><p>side by side parallel (left eye left, right eye right)
  25919. </p>
  25920. </dd>
  25921. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  25922. <dd><p>side by side crosseye (right eye left, left eye right)
  25923. </p>
  25924. </dd>
  25925. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  25926. <dd><p>side by side parallel with half width resolution
  25927. (left eye left, right eye right)
  25928. </p>
  25929. </dd>
  25930. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  25931. <dd><p>side by side crosseye with half width resolution
  25932. (right eye left, left eye right)
  25933. </p>
  25934. </dd>
  25935. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  25936. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  25937. <dd><p>above-below (left eye above, right eye below)
  25938. </p>
  25939. </dd>
  25940. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  25941. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  25942. <dd><p>above-below (right eye above, left eye below)
  25943. </p>
  25944. </dd>
  25945. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  25946. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  25947. <dd><p>above-below with half height resolution
  25948. (left eye above, right eye below)
  25949. </p>
  25950. </dd>
  25951. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  25952. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  25953. <dd><p>above-below with half height resolution
  25954. (right eye above, left eye below)
  25955. </p>
  25956. </dd>
  25957. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  25958. <dd><p>alternating frames (left eye first, right eye second)
  25959. </p>
  25960. </dd>
  25961. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  25962. <dd><p>alternating frames (right eye first, left eye second)
  25963. </p>
  25964. </dd>
  25965. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  25966. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  25967. </p>
  25968. </dd>
  25969. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  25970. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  25971. </p>
  25972. </dd>
  25973. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  25974. <dd><p>interleaved columns, left eye first
  25975. </p>
  25976. </dd>
  25977. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  25978. <dd><p>interleaved columns, right eye first
  25979. </p>
  25980. <p>Default value is &lsquo;<samp class="samp">sbsl</samp>&rsquo;.
  25981. </p></dd>
  25982. </dl>
  25983. </dd>
  25984. <dt><samp class="option">out</samp></dt>
  25985. <dd><p>Set stereoscopic image format of output.
  25986. </p>
  25987. <dl class="table">
  25988. <dt>&lsquo;<samp class="samp">sbsl</samp>&rsquo;</dt>
  25989. <dd><p>side by side parallel (left eye left, right eye right)
  25990. </p>
  25991. </dd>
  25992. <dt>&lsquo;<samp class="samp">sbsr</samp>&rsquo;</dt>
  25993. <dd><p>side by side crosseye (right eye left, left eye right)
  25994. </p>
  25995. </dd>
  25996. <dt>&lsquo;<samp class="samp">sbs2l</samp>&rsquo;</dt>
  25997. <dd><p>side by side parallel with half width resolution
  25998. (left eye left, right eye right)
  25999. </p>
  26000. </dd>
  26001. <dt>&lsquo;<samp class="samp">sbs2r</samp>&rsquo;</dt>
  26002. <dd><p>side by side crosseye with half width resolution
  26003. (right eye left, left eye right)
  26004. </p>
  26005. </dd>
  26006. <dt>&lsquo;<samp class="samp">abl</samp>&rsquo;</dt>
  26007. <dt>&lsquo;<samp class="samp">tbl</samp>&rsquo;</dt>
  26008. <dd><p>above-below (left eye above, right eye below)
  26009. </p>
  26010. </dd>
  26011. <dt>&lsquo;<samp class="samp">abr</samp>&rsquo;</dt>
  26012. <dt>&lsquo;<samp class="samp">tbr</samp>&rsquo;</dt>
  26013. <dd><p>above-below (right eye above, left eye below)
  26014. </p>
  26015. </dd>
  26016. <dt>&lsquo;<samp class="samp">ab2l</samp>&rsquo;</dt>
  26017. <dt>&lsquo;<samp class="samp">tb2l</samp>&rsquo;</dt>
  26018. <dd><p>above-below with half height resolution
  26019. (left eye above, right eye below)
  26020. </p>
  26021. </dd>
  26022. <dt>&lsquo;<samp class="samp">ab2r</samp>&rsquo;</dt>
  26023. <dt>&lsquo;<samp class="samp">tb2r</samp>&rsquo;</dt>
  26024. <dd><p>above-below with half height resolution
  26025. (right eye above, left eye below)
  26026. </p>
  26027. </dd>
  26028. <dt>&lsquo;<samp class="samp">al</samp>&rsquo;</dt>
  26029. <dd><p>alternating frames (left eye first, right eye second)
  26030. </p>
  26031. </dd>
  26032. <dt>&lsquo;<samp class="samp">ar</samp>&rsquo;</dt>
  26033. <dd><p>alternating frames (right eye first, left eye second)
  26034. </p>
  26035. </dd>
  26036. <dt>&lsquo;<samp class="samp">irl</samp>&rsquo;</dt>
  26037. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  26038. </p>
  26039. </dd>
  26040. <dt>&lsquo;<samp class="samp">irr</samp>&rsquo;</dt>
  26041. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  26042. </p>
  26043. </dd>
  26044. <dt>&lsquo;<samp class="samp">arbg</samp>&rsquo;</dt>
  26045. <dd><p>anaglyph red/blue gray
  26046. (red filter on left eye, blue filter on right eye)
  26047. </p>
  26048. </dd>
  26049. <dt>&lsquo;<samp class="samp">argg</samp>&rsquo;</dt>
  26050. <dd><p>anaglyph red/green gray
  26051. (red filter on left eye, green filter on right eye)
  26052. </p>
  26053. </dd>
  26054. <dt>&lsquo;<samp class="samp">arcg</samp>&rsquo;</dt>
  26055. <dd><p>anaglyph red/cyan gray
  26056. (red filter on left eye, cyan filter on right eye)
  26057. </p>
  26058. </dd>
  26059. <dt>&lsquo;<samp class="samp">arch</samp>&rsquo;</dt>
  26060. <dd><p>anaglyph red/cyan half colored
  26061. (red filter on left eye, cyan filter on right eye)
  26062. </p>
  26063. </dd>
  26064. <dt>&lsquo;<samp class="samp">arcc</samp>&rsquo;</dt>
  26065. <dd><p>anaglyph red/cyan color
  26066. (red filter on left eye, cyan filter on right eye)
  26067. </p>
  26068. </dd>
  26069. <dt>&lsquo;<samp class="samp">arcd</samp>&rsquo;</dt>
  26070. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  26071. (red filter on left eye, cyan filter on right eye)
  26072. </p>
  26073. </dd>
  26074. <dt>&lsquo;<samp class="samp">agmg</samp>&rsquo;</dt>
  26075. <dd><p>anaglyph green/magenta gray
  26076. (green filter on left eye, magenta filter on right eye)
  26077. </p>
  26078. </dd>
  26079. <dt>&lsquo;<samp class="samp">agmh</samp>&rsquo;</dt>
  26080. <dd><p>anaglyph green/magenta half colored
  26081. (green filter on left eye, magenta filter on right eye)
  26082. </p>
  26083. </dd>
  26084. <dt>&lsquo;<samp class="samp">agmc</samp>&rsquo;</dt>
  26085. <dd><p>anaglyph green/magenta colored
  26086. (green filter on left eye, magenta filter on right eye)
  26087. </p>
  26088. </dd>
  26089. <dt>&lsquo;<samp class="samp">agmd</samp>&rsquo;</dt>
  26090. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  26091. (green filter on left eye, magenta filter on right eye)
  26092. </p>
  26093. </dd>
  26094. <dt>&lsquo;<samp class="samp">aybg</samp>&rsquo;</dt>
  26095. <dd><p>anaglyph yellow/blue gray
  26096. (yellow filter on left eye, blue filter on right eye)
  26097. </p>
  26098. </dd>
  26099. <dt>&lsquo;<samp class="samp">aybh</samp>&rsquo;</dt>
  26100. <dd><p>anaglyph yellow/blue half colored
  26101. (yellow filter on left eye, blue filter on right eye)
  26102. </p>
  26103. </dd>
  26104. <dt>&lsquo;<samp class="samp">aybc</samp>&rsquo;</dt>
  26105. <dd><p>anaglyph yellow/blue colored
  26106. (yellow filter on left eye, blue filter on right eye)
  26107. </p>
  26108. </dd>
  26109. <dt>&lsquo;<samp class="samp">aybd</samp>&rsquo;</dt>
  26110. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  26111. (yellow filter on left eye, blue filter on right eye)
  26112. </p>
  26113. </dd>
  26114. <dt>&lsquo;<samp class="samp">ml</samp>&rsquo;</dt>
  26115. <dd><p>mono output (left eye only)
  26116. </p>
  26117. </dd>
  26118. <dt>&lsquo;<samp class="samp">mr</samp>&rsquo;</dt>
  26119. <dd><p>mono output (right eye only)
  26120. </p>
  26121. </dd>
  26122. <dt>&lsquo;<samp class="samp">chl</samp>&rsquo;</dt>
  26123. <dd><p>checkerboard, left eye first
  26124. </p>
  26125. </dd>
  26126. <dt>&lsquo;<samp class="samp">chr</samp>&rsquo;</dt>
  26127. <dd><p>checkerboard, right eye first
  26128. </p>
  26129. </dd>
  26130. <dt>&lsquo;<samp class="samp">icl</samp>&rsquo;</dt>
  26131. <dd><p>interleaved columns, left eye first
  26132. </p>
  26133. </dd>
  26134. <dt>&lsquo;<samp class="samp">icr</samp>&rsquo;</dt>
  26135. <dd><p>interleaved columns, right eye first
  26136. </p>
  26137. </dd>
  26138. <dt>&lsquo;<samp class="samp">hdmi</samp>&rsquo;</dt>
  26139. <dd><p>HDMI frame pack
  26140. </p></dd>
  26141. </dl>
  26142. <p>Default value is &lsquo;<samp class="samp">arcd</samp>&rsquo;.
  26143. </p></dd>
  26144. </dl>
  26145. <a name="Examples-124"></a>
  26146. <h4 class="subsection">11.239.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-124" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-124" aria-hidden="true">TOC</a></span></h4>
  26147. <ul class="itemize mark-bullet">
  26148. <li>Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  26149. <div class="example">
  26150. <pre class="example-preformatted">stereo3d=sbsl:aybd
  26151. </pre></div>
  26152. </li><li>Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  26153. <div class="example">
  26154. <pre class="example-preformatted">stereo3d=abl:sbsr
  26155. </pre></div>
  26156. </li></ul>
  26157. <a name="streamselect_002c-astreamselect"></a>
  26158. <h3 class="section">11.240 streamselect, astreamselect<span class="pull-right"><a class="anchor hidden-xs" href="#streamselect_002c-astreamselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-streamselect_002c-astreamselect" aria-hidden="true">TOC</a></span></h3>
  26159. <p>Select video or audio streams.
  26160. </p>
  26161. <p>The filter accepts the following options:
  26162. </p>
  26163. <dl class="table">
  26164. <dt><samp class="option">inputs</samp></dt>
  26165. <dd><p>Set number of inputs. Default is 2.
  26166. </p>
  26167. </dd>
  26168. <dt><samp class="option">map</samp></dt>
  26169. <dd><p>Set input indexes to remap to outputs.
  26170. </p></dd>
  26171. </dl>
  26172. <a name="Commands-144"></a>
  26173. <h4 class="subsection">11.240.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-144" aria-hidden="true">TOC</a></span></h4>
  26174. <p>The <code class="code">streamselect</code> and <code class="code">astreamselect</code> filter supports the following
  26175. commands:
  26176. </p>
  26177. <dl class="table">
  26178. <dt><samp class="option">map</samp></dt>
  26179. <dd><p>Set input indexes to remap to outputs.
  26180. </p></dd>
  26181. </dl>
  26182. <a name="Examples-125"></a>
  26183. <h4 class="subsection">11.240.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-125" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-125" aria-hidden="true">TOC</a></span></h4>
  26184. <ul class="itemize mark-bullet">
  26185. <li>Select first 5 seconds 1st stream and rest of time 2nd stream:
  26186. <div class="example">
  26187. <pre class="example-preformatted">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  26188. </pre></div>
  26189. </li><li>Same as above, but for audio:
  26190. <div class="example">
  26191. <pre class="example-preformatted">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  26192. </pre></div>
  26193. </li></ul>
  26194. <a class="anchor" id="subtitles"></a><a name="subtitles-1"></a>
  26195. <h3 class="section">11.241 subtitles<span class="pull-right"><a class="anchor hidden-xs" href="#subtitles-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-subtitles-1" aria-hidden="true">TOC</a></span></h3>
  26196. <p>Draw subtitles on top of input video using the libass library.
  26197. </p>
  26198. <p>To enable compilation of this filter you need to configure FFmpeg with
  26199. <code class="code">--enable-libass</code>. This filter also requires a build with libavcodec and
  26200. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  26201. Alpha) subtitles format.
  26202. </p>
  26203. <p>The filter accepts the following options:
  26204. </p>
  26205. <dl class="table">
  26206. <dt><samp class="option">filename, f</samp></dt>
  26207. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  26208. </p>
  26209. </dd>
  26210. <dt><samp class="option">original_size</samp></dt>
  26211. <dd><p>Specify the size of the original video, the video for which the ASS file
  26212. was composed. For the syntax of this option, check the
  26213. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26214. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  26215. correctly scale the fonts if the aspect ratio has been changed.
  26216. </p>
  26217. </dd>
  26218. <dt><samp class="option">fontsdir</samp></dt>
  26219. <dd><p>Set a directory path containing fonts that can be used by the filter.
  26220. These fonts will be used in addition to whatever the font provider uses.
  26221. </p>
  26222. </dd>
  26223. <dt><samp class="option">alpha</samp></dt>
  26224. <dd><p>Process alpha channel, by default alpha channel is untouched.
  26225. </p>
  26226. </dd>
  26227. <dt><samp class="option">charenc</samp></dt>
  26228. <dd><p>Set subtitles input character encoding. <code class="code">subtitles</code> filter only. Only
  26229. useful if not UTF-8.
  26230. </p>
  26231. </dd>
  26232. <dt><samp class="option">stream_index, si</samp></dt>
  26233. <dd><p>Set subtitles stream index. <code class="code">subtitles</code> filter only.
  26234. </p>
  26235. </dd>
  26236. <dt><samp class="option">force_style</samp></dt>
  26237. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  26238. string containing ASS style format <code class="code">KEY=VALUE</code> couples separated by &quot;,&quot;.
  26239. </p>
  26240. </dd>
  26241. <dt><samp class="option">wrap_unicode</samp></dt>
  26242. <dd><p>Break lines according to the Unicode Line Breaking Algorithm. Availability requires
  26243. at least libass release 0.17.0 (or LIBASS_VERSION 0x01600010), <em class="emph">and</em> libass must
  26244. have been built with libunibreak.
  26245. </p>
  26246. <p>The option is enabled by default except for native ASS.
  26247. </p></dd>
  26248. </dl>
  26249. <p>If the first key is not specified, it is assumed that the first value
  26250. specifies the <samp class="option">filename</samp>.
  26251. </p>
  26252. <p>For example, to render the file <samp class="file">sub.srt</samp> on top of the input
  26253. video, use the command:
  26254. </p><div class="example">
  26255. <pre class="example-preformatted">subtitles=sub.srt
  26256. </pre></div>
  26257. <p>which is equivalent to:
  26258. </p><div class="example">
  26259. <pre class="example-preformatted">subtitles=filename=sub.srt
  26260. </pre></div>
  26261. <p>To render the default subtitles stream from file <samp class="file">video.mkv</samp>, use:
  26262. </p><div class="example">
  26263. <pre class="example-preformatted">subtitles=video.mkv
  26264. </pre></div>
  26265. <p>To render the second subtitles stream from that file, use:
  26266. </p><div class="example">
  26267. <pre class="example-preformatted">subtitles=video.mkv:si=1
  26268. </pre></div>
  26269. <p>To make the subtitles stream from <samp class="file">sub.srt</samp> appear in 80% transparent blue
  26270. <code class="code">DejaVu Serif</code>, use:
  26271. </p><div class="example">
  26272. <pre class="example-preformatted">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  26273. </pre></div>
  26274. <a name="super2xsai"></a>
  26275. <h3 class="section">11.242 super2xsai<span class="pull-right"><a class="anchor hidden-xs" href="#super2xsai" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-super2xsai" aria-hidden="true">TOC</a></span></h3>
  26276. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  26277. Interpolate) pixel art scaling algorithm.
  26278. </p>
  26279. <p>Useful for enlarging pixel art images without reducing sharpness.
  26280. </p>
  26281. <a name="swaprect"></a>
  26282. <h3 class="section">11.243 swaprect<span class="pull-right"><a class="anchor hidden-xs" href="#swaprect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swaprect" aria-hidden="true">TOC</a></span></h3>
  26283. <p>Swap two rectangular objects in video.
  26284. </p>
  26285. <p>This filter accepts the following options:
  26286. </p>
  26287. <dl class="table">
  26288. <dt><samp class="option">w</samp></dt>
  26289. <dd><p>Set object width.
  26290. </p>
  26291. </dd>
  26292. <dt><samp class="option">h</samp></dt>
  26293. <dd><p>Set object height.
  26294. </p>
  26295. </dd>
  26296. <dt><samp class="option">x1</samp></dt>
  26297. <dd><p>Set 1st rect x coordinate.
  26298. </p>
  26299. </dd>
  26300. <dt><samp class="option">y1</samp></dt>
  26301. <dd><p>Set 1st rect y coordinate.
  26302. </p>
  26303. </dd>
  26304. <dt><samp class="option">x2</samp></dt>
  26305. <dd><p>Set 2nd rect x coordinate.
  26306. </p>
  26307. </dd>
  26308. <dt><samp class="option">y2</samp></dt>
  26309. <dd><p>Set 2nd rect y coordinate.
  26310. </p>
  26311. <p>All expressions are evaluated once for each frame.
  26312. </p></dd>
  26313. </dl>
  26314. <p>The all options are expressions containing the following constants:
  26315. </p>
  26316. <dl class="table">
  26317. <dt><samp class="option">w</samp></dt>
  26318. <dt><samp class="option">h</samp></dt>
  26319. <dd><p>The input width and height.
  26320. </p>
  26321. </dd>
  26322. <dt><samp class="option">a</samp></dt>
  26323. <dd><p>same as <var class="var">w</var> / <var class="var">h</var>
  26324. </p>
  26325. </dd>
  26326. <dt><samp class="option">sar</samp></dt>
  26327. <dd><p>input sample aspect ratio
  26328. </p>
  26329. </dd>
  26330. <dt><samp class="option">dar</samp></dt>
  26331. <dd><p>input display aspect ratio, it is the same as (<var class="var">w</var> / <var class="var">h</var>) * <var class="var">sar</var>
  26332. </p>
  26333. </dd>
  26334. <dt><samp class="option">n</samp></dt>
  26335. <dd><p>The number of the input frame, starting from 0.
  26336. </p>
  26337. </dd>
  26338. <dt><samp class="option">t</samp></dt>
  26339. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  26340. </p>
  26341. </dd>
  26342. <dt><samp class="option">pos</samp></dt>
  26343. <dd><p>the position in the file of the input frame, NAN if unknown; deprecated,
  26344. do not use
  26345. </p></dd>
  26346. </dl>
  26347. <a name="Commands-145"></a>
  26348. <h4 class="subsection">11.243.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-145" aria-hidden="true">TOC</a></span></h4>
  26349. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  26350. </p>
  26351. <a name="swapuv"></a>
  26352. <h3 class="section">11.244 swapuv<span class="pull-right"><a class="anchor hidden-xs" href="#swapuv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-swapuv" aria-hidden="true">TOC</a></span></h3>
  26353. <p>Swap U &amp; V plane.
  26354. </p>
  26355. <a name="tblend"></a>
  26356. <h3 class="section">11.245 tblend<span class="pull-right"><a class="anchor hidden-xs" href="#tblend" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tblend" aria-hidden="true">TOC</a></span></h3>
  26357. <p>Blend successive video frames.
  26358. </p>
  26359. <p>See <a class="ref" href="#blend">blend</a>
  26360. </p>
  26361. <a name="telecine"></a>
  26362. <h3 class="section">11.246 telecine<span class="pull-right"><a class="anchor hidden-xs" href="#telecine" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-telecine" aria-hidden="true">TOC</a></span></h3>
  26363. <p>Apply telecine process to the video.
  26364. </p>
  26365. <p>This filter accepts the following options:
  26366. </p>
  26367. <dl class="table">
  26368. <dt><samp class="option">first_field</samp></dt>
  26369. <dd><dl class="table">
  26370. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  26371. <dd><p>top field first
  26372. </p></dd>
  26373. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  26374. <dd><p>bottom field first
  26375. The default value is <code class="code">top</code>.
  26376. </p></dd>
  26377. </dl>
  26378. </dd>
  26379. <dt><samp class="option">pattern</samp></dt>
  26380. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  26381. The default value is <code class="code">23</code>.
  26382. </p></dd>
  26383. </dl>
  26384. <div class="example">
  26385. <pre class="example-preformatted">Some typical patterns:
  26386. NTSC output (30i):
  26387. 27.5p: 32222
  26388. 24p: 23 (classic)
  26389. 24p: 2332 (preferred)
  26390. 20p: 33
  26391. 18p: 334
  26392. 16p: 3444
  26393. PAL output (25i):
  26394. 27.5p: 12222
  26395. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  26396. 16.67p: 33
  26397. 16p: 33333334
  26398. </pre></div>
  26399. <a name="thistogram"></a>
  26400. <h3 class="section">11.247 thistogram<span class="pull-right"><a class="anchor hidden-xs" href="#thistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thistogram" aria-hidden="true">TOC</a></span></h3>
  26401. <p>Compute and draw a color distribution histogram for the input video across time.
  26402. </p>
  26403. <p>Unlike <a class="ref" href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  26404. at certain time, this filter shows also past histograms of number of frames defined
  26405. by <code class="code">width</code> option.
  26406. </p>
  26407. <p>The computed histogram is a representation of the color component
  26408. distribution in an image.
  26409. </p>
  26410. <p>The filter accepts the following options:
  26411. </p>
  26412. <dl class="table">
  26413. <dt><samp class="option">width, w</samp></dt>
  26414. <dd><p>Set width of single color component output. Default value is <code class="code">0</code>.
  26415. Value of <code class="code">0</code> means width will be picked from input video.
  26416. This also set number of passed histograms to keep.
  26417. Allowed range is [0, 8192].
  26418. </p>
  26419. </dd>
  26420. <dt><samp class="option">display_mode, d</samp></dt>
  26421. <dd><p>Set display mode.
  26422. It accepts the following values:
  26423. </p><dl class="table">
  26424. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  26425. <dd><p>Per color component graphs are placed below each other.
  26426. </p>
  26427. </dd>
  26428. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  26429. <dd><p>Per color component graphs are placed side by side.
  26430. </p>
  26431. </dd>
  26432. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  26433. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  26434. that the graphs representing color components are superimposed directly
  26435. over one another.
  26436. </p></dd>
  26437. </dl>
  26438. <p>Default is <code class="code">stack</code>.
  26439. </p>
  26440. </dd>
  26441. <dt><samp class="option">levels_mode, m</samp></dt>
  26442. <dd><p>Set mode. Can be either <code class="code">linear</code>, or <code class="code">logarithmic</code>.
  26443. Default is <code class="code">linear</code>.
  26444. </p>
  26445. </dd>
  26446. <dt><samp class="option">components, c</samp></dt>
  26447. <dd><p>Set what color components to display.
  26448. Default is <code class="code">7</code>.
  26449. </p>
  26450. </dd>
  26451. <dt><samp class="option">bgopacity, b</samp></dt>
  26452. <dd><p>Set background opacity. Default is <code class="code">0.9</code>.
  26453. </p>
  26454. </dd>
  26455. <dt><samp class="option">envelope, e</samp></dt>
  26456. <dd><p>Show envelope. Default is disabled.
  26457. </p>
  26458. </dd>
  26459. <dt><samp class="option">ecolor, ec</samp></dt>
  26460. <dd><p>Set envelope color. Default is <code class="code">gold</code>.
  26461. </p>
  26462. </dd>
  26463. <dt><samp class="option">slide</samp></dt>
  26464. <dd><p>Set slide mode.
  26465. </p>
  26466. <p>Available values for slide is:
  26467. </p><dl class="table">
  26468. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  26469. <dd><p>Draw new frame when right border is reached.
  26470. </p>
  26471. </dd>
  26472. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  26473. <dd><p>Replace old columns with new ones.
  26474. </p>
  26475. </dd>
  26476. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  26477. <dd><p>Scroll from right to left.
  26478. </p>
  26479. </dd>
  26480. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  26481. <dd><p>Scroll from left to right.
  26482. </p>
  26483. </dd>
  26484. <dt>&lsquo;<samp class="samp">picture</samp>&rsquo;</dt>
  26485. <dd><p>Draw single picture.
  26486. </p></dd>
  26487. </dl>
  26488. <p>Default is <code class="code">replace</code>.
  26489. </p></dd>
  26490. </dl>
  26491. <a name="threshold"></a>
  26492. <h3 class="section">11.248 threshold<span class="pull-right"><a class="anchor hidden-xs" href="#threshold" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-threshold" aria-hidden="true">TOC</a></span></h3>
  26493. <p>Apply threshold effect to video stream.
  26494. </p>
  26495. <p>This filter needs four video streams to perform thresholding.
  26496. First stream is stream we are filtering.
  26497. Second stream is holding threshold values, third stream is holding min values,
  26498. and last, fourth stream is holding max values.
  26499. </p>
  26500. <p>The filter accepts the following option:
  26501. </p>
  26502. <dl class="table">
  26503. <dt><samp class="option">planes</samp></dt>
  26504. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  26505. By default value 0xf, all planes will be processed.
  26506. </p></dd>
  26507. </dl>
  26508. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  26509. of pixel component from 2nd threshold stream, third stream value will picked,
  26510. otherwise fourth stream pixel component value will be picked.
  26511. </p>
  26512. <p>Using color source filter one can perform various types of thresholding:
  26513. </p>
  26514. <a name="Commands-146"></a>
  26515. <h4 class="subsection">11.248.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-146" aria-hidden="true">TOC</a></span></h4>
  26516. <p>This filter supports the all options as <a class="ref" href="#commands">commands</a>.
  26517. </p>
  26518. <a name="Examples-126"></a>
  26519. <h4 class="subsection">11.248.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-126" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-126" aria-hidden="true">TOC</a></span></h4>
  26520. <ul class="itemize mark-bullet">
  26521. <li>Binary threshold, using gray color as threshold:
  26522. <div class="example">
  26523. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
  26524. </pre></div>
  26525. </li><li>Inverted binary threshold, using gray color as threshold:
  26526. <div class="example">
  26527. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
  26528. </pre></div>
  26529. </li><li>Truncate binary threshold, using gray color as threshold:
  26530. <div class="example">
  26531. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  26532. </pre></div>
  26533. </li><li>Threshold to zero, using gray color as threshold:
  26534. <div class="example">
  26535. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  26536. </pre></div>
  26537. </li><li>Inverted threshold to zero, using gray color as threshold:
  26538. <div class="example">
  26539. <pre class="example-preformatted">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  26540. </pre></div>
  26541. </li></ul>
  26542. <a name="thumbnail"></a>
  26543. <h3 class="section">11.249 thumbnail<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail" aria-hidden="true">TOC</a></span></h3>
  26544. <p>Select the most representative frame in a given sequence of consecutive frames.
  26545. </p>
  26546. <p>The filter accepts the following options:
  26547. </p>
  26548. <dl class="table">
  26549. <dt><samp class="option">n</samp></dt>
  26550. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  26551. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  26552. the end. Default is <code class="code">100</code>.
  26553. </p>
  26554. </dd>
  26555. <dt><samp class="option">log</samp></dt>
  26556. <dd><p>Set the log level to display picked frame stats.
  26557. Default is <code class="code">info</code>.
  26558. </p></dd>
  26559. </dl>
  26560. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  26561. value will result in a higher memory usage, so a high value is not recommended.
  26562. </p>
  26563. <a name="Examples-127"></a>
  26564. <h4 class="subsection">11.249.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-127" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-127" aria-hidden="true">TOC</a></span></h4>
  26565. <ul class="itemize mark-bullet">
  26566. <li>Extract one picture each 50 frames:
  26567. <div class="example">
  26568. <pre class="example-preformatted">thumbnail=50
  26569. </pre></div>
  26570. </li><li>Complete example of a thumbnail creation with <code class="command">ffmpeg</code>:
  26571. <div class="example">
  26572. <pre class="example-preformatted">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  26573. </pre></div>
  26574. </li></ul>
  26575. <a class="anchor" id="tile"></a><a name="tile-1"></a>
  26576. <h3 class="section">11.250 tile<span class="pull-right"><a class="anchor hidden-xs" href="#tile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tile-1" aria-hidden="true">TOC</a></span></h3>
  26577. <p>Tile several successive frames together.
  26578. </p>
  26579. <p>The <a class="ref" href="#untile">untile</a> filter can do the reverse.
  26580. </p>
  26581. <p>The filter accepts the following options:
  26582. </p>
  26583. <dl class="table">
  26584. <dt><samp class="option">layout</samp></dt>
  26585. <dd><p>Set the grid size in the form <code class="code">COLUMNSxROWS</code>. Range is up to UINT_MAX cells.
  26586. Default is <code class="code">6x5</code>.
  26587. </p>
  26588. </dd>
  26589. <dt><samp class="option">nb_frames</samp></dt>
  26590. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  26591. than or equal to <var class="var">w</var>x<var class="var">h</var>. The default value is <code class="code">0</code>, meaning all
  26592. the area will be used.
  26593. </p>
  26594. </dd>
  26595. <dt><samp class="option">margin</samp></dt>
  26596. <dd><p>Set the outer border margin in pixels. Range is 0 to 1024. Default is <code class="code">0</code>.
  26597. </p>
  26598. </dd>
  26599. <dt><samp class="option">padding</samp></dt>
  26600. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  26601. more advanced padding options (such as having different values for the edges),
  26602. refer to the pad video filter. Range is 0 to 1024. Default is <code class="code">0</code>.
  26603. </p>
  26604. </dd>
  26605. <dt><samp class="option">color</samp></dt>
  26606. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  26607. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  26608. The default value of <var class="var">color</var> is &quot;black&quot;.
  26609. </p>
  26610. </dd>
  26611. <dt><samp class="option">overlap</samp></dt>
  26612. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  26613. The value must be between <code class="code">0</code> and <var class="var">nb_frames - 1</var>. Default is <code class="code">0</code>.
  26614. </p>
  26615. </dd>
  26616. <dt><samp class="option">init_padding</samp></dt>
  26617. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  26618. This controls how soon will one get first output frame.
  26619. The value must be between <code class="code">0</code> and <var class="var">nb_frames - 1</var>. Default is <code class="code">0</code>.
  26620. </p></dd>
  26621. </dl>
  26622. <a name="Examples-128"></a>
  26623. <h4 class="subsection">11.250.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-128" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-128" aria-hidden="true">TOC</a></span></h4>
  26624. <ul class="itemize mark-bullet">
  26625. <li>Produce 8x8 PNG tiles of all keyframes (<samp class="option">-skip_frame nokey</samp>) in a movie:
  26626. <div class="example">
  26627. <pre class="example-preformatted">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  26628. </pre></div>
  26629. <p>The <samp class="option">-vsync 0</samp> is necessary to prevent <code class="command">ffmpeg</code> from
  26630. duplicating each output frame to accommodate the originally detected frame
  26631. rate.
  26632. </p>
  26633. </li><li>Display <code class="code">5</code> pictures in an area of <code class="code">3x2</code> frames,
  26634. with <code class="code">7</code> pixels between them, and <code class="code">2</code> pixels of initial margin, using
  26635. mixed flat and named options:
  26636. <div class="example">
  26637. <pre class="example-preformatted">tile=3x2:nb_frames=5:padding=7:margin=2
  26638. </pre></div>
  26639. </li></ul>
  26640. <a name="tiltandshift"></a>
  26641. <h3 class="section">11.251 tiltandshift<span class="pull-right"><a class="anchor hidden-xs" href="#tiltandshift" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tiltandshift" aria-hidden="true">TOC</a></span></h3>
  26642. <p>Apply tilt-and-shift effect.
  26643. </p>
  26644. <p>What happens when you invert time and space?
  26645. </p>
  26646. <p>Normally a video is composed of several frames that represent a different
  26647. instant of time and shows a scene that evolves in the space captured by the
  26648. frame. This filter is the antipode of that concept, taking inspiration from
  26649. tilt and shift photography.
  26650. </p>
  26651. <p>A filtered frame contains the whole timeline of events composing the sequence,
  26652. and this is obtained by placing a slice of pixels from each frame into a single
  26653. one. However, since there are no infinite-width frames, this is done up the
  26654. width of the input frame, and a video is recomposed by shifting away one
  26655. column for each subsequent frame. In order to map space to time, the filter
  26656. tilts each input frame as well, so that motion is preserved. This is accomplished
  26657. by progressively selecting a different column from each input frame.
  26658. </p>
  26659. <p>The end result is a sort of inverted parallax, so that far away objects move
  26660. much faster that the ones in the front. The ideal conditions for this video
  26661. effect are when there is either very little motion and the background is static,
  26662. or when there is a lot of motion and a very wide depth of field (e.g. wide
  26663. panorama, while moving on a train).
  26664. </p>
  26665. <p>The filter accepts the following parameters:
  26666. </p>
  26667. <dl class="table">
  26668. <dt><samp class="option">tilt</samp></dt>
  26669. <dd><p>Tilt video while shifting (default). When unset, video will be sliding a
  26670. static image, composed of the first column of each frame.
  26671. </p>
  26672. </dd>
  26673. <dt><samp class="option">start</samp></dt>
  26674. <dd><p>What to do at the start of filtering (see below).
  26675. </p>
  26676. </dd>
  26677. <dt><samp class="option">end</samp></dt>
  26678. <dd><p>What to do at the end of filtering (see below).
  26679. </p>
  26680. </dd>
  26681. <dt><samp class="option">hold</samp></dt>
  26682. <dd><p>How many columns should pass through before start of filtering.
  26683. </p>
  26684. </dd>
  26685. <dt><samp class="option">pad</samp></dt>
  26686. <dd><p>How many columns should be inserted before end of filtering.
  26687. </p>
  26688. </dd>
  26689. </dl>
  26690. <p>Normally the filter shifts and tilts from the very first frame, and stops when
  26691. the last one is received. However, before filtering starts, normal video may
  26692. be preserved, so that the effect is slowly shifted in its place. Similarly,
  26693. the last video frame may be reconstructed at the end. Alternatively it is
  26694. possible to just start and end with black.
  26695. </p>
  26696. <dl class="table">
  26697. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  26698. <dd><p>Filtering starts immediately and ends when the last frame is received.
  26699. </p>
  26700. </dd>
  26701. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  26702. <dd><p>The first frames or the very last frame are kept intact during processing.
  26703. </p>
  26704. </dd>
  26705. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  26706. <dd><p>Black is padded at the beginning or at the end of filtering.
  26707. </p>
  26708. </dd>
  26709. </dl>
  26710. <a name="tinterlace"></a>
  26711. <h3 class="section">11.252 tinterlace<span class="pull-right"><a class="anchor hidden-xs" href="#tinterlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tinterlace" aria-hidden="true">TOC</a></span></h3>
  26712. <p>Perform various types of temporal field interlacing.
  26713. </p>
  26714. <p>Frames are counted starting from 1, so the first input frame is
  26715. considered odd.
  26716. </p>
  26717. <p>The filter accepts the following options:
  26718. </p>
  26719. <dl class="table">
  26720. <dt><samp class="option">mode</samp></dt>
  26721. <dd><p>Specify the mode of the interlacing. This option can also be specified
  26722. as a value alone. See below for a list of values for this option.
  26723. </p>
  26724. <p>Available values are:
  26725. </p>
  26726. <dl class="table">
  26727. <dt>&lsquo;<samp class="samp">merge, 0</samp>&rsquo;</dt>
  26728. <dd><p>Move odd frames into the upper field, even into the lower field,
  26729. generating a double height frame at half frame rate.
  26730. </p><div class="example">
  26731. <pre class="example-preformatted"> ------&gt; time
  26732. Input:
  26733. Frame 1 Frame 2 Frame 3 Frame 4
  26734. 11111 22222 33333 44444
  26735. 11111 22222 33333 44444
  26736. 11111 22222 33333 44444
  26737. 11111 22222 33333 44444
  26738. Output:
  26739. 11111 33333
  26740. 22222 44444
  26741. 11111 33333
  26742. 22222 44444
  26743. 11111 33333
  26744. 22222 44444
  26745. 11111 33333
  26746. 22222 44444
  26747. </pre></div>
  26748. </dd>
  26749. <dt>&lsquo;<samp class="samp">drop_even, 1</samp>&rsquo;</dt>
  26750. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  26751. unchanged height at half frame rate.
  26752. </p>
  26753. <div class="example">
  26754. <pre class="example-preformatted"> ------&gt; time
  26755. Input:
  26756. Frame 1 Frame 2 Frame 3 Frame 4
  26757. 11111 22222 33333 44444
  26758. 11111 22222 33333 44444
  26759. 11111 22222 33333 44444
  26760. 11111 22222 33333 44444
  26761. Output:
  26762. 11111 33333
  26763. 11111 33333
  26764. 11111 33333
  26765. 11111 33333
  26766. </pre></div>
  26767. </dd>
  26768. <dt>&lsquo;<samp class="samp">drop_odd, 2</samp>&rsquo;</dt>
  26769. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  26770. unchanged height at half frame rate.
  26771. </p>
  26772. <div class="example">
  26773. <pre class="example-preformatted"> ------&gt; time
  26774. Input:
  26775. Frame 1 Frame 2 Frame 3 Frame 4
  26776. 11111 22222 33333 44444
  26777. 11111 22222 33333 44444
  26778. 11111 22222 33333 44444
  26779. 11111 22222 33333 44444
  26780. Output:
  26781. 22222 44444
  26782. 22222 44444
  26783. 22222 44444
  26784. 22222 44444
  26785. </pre></div>
  26786. </dd>
  26787. <dt>&lsquo;<samp class="samp">pad, 3</samp>&rsquo;</dt>
  26788. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  26789. generating a frame with double height at the same input frame rate.
  26790. </p>
  26791. <div class="example">
  26792. <pre class="example-preformatted"> ------&gt; time
  26793. Input:
  26794. Frame 1 Frame 2 Frame 3 Frame 4
  26795. 11111 22222 33333 44444
  26796. 11111 22222 33333 44444
  26797. 11111 22222 33333 44444
  26798. 11111 22222 33333 44444
  26799. Output:
  26800. 11111 ..... 33333 .....
  26801. ..... 22222 ..... 44444
  26802. 11111 ..... 33333 .....
  26803. ..... 22222 ..... 44444
  26804. 11111 ..... 33333 .....
  26805. ..... 22222 ..... 44444
  26806. 11111 ..... 33333 .....
  26807. ..... 22222 ..... 44444
  26808. </pre></div>
  26809. </dd>
  26810. <dt>&lsquo;<samp class="samp">interleave_top, 4</samp>&rsquo;</dt>
  26811. <dd><p>Interleave the upper field from odd frames with the lower field from
  26812. even frames, generating a frame with unchanged height at half frame rate.
  26813. </p>
  26814. <div class="example">
  26815. <pre class="example-preformatted"> ------&gt; time
  26816. Input:
  26817. Frame 1 Frame 2 Frame 3 Frame 4
  26818. 11111&lt;- 22222 33333&lt;- 44444
  26819. 11111 22222&lt;- 33333 44444&lt;-
  26820. 11111&lt;- 22222 33333&lt;- 44444
  26821. 11111 22222&lt;- 33333 44444&lt;-
  26822. Output:
  26823. 11111 33333
  26824. 22222 44444
  26825. 11111 33333
  26826. 22222 44444
  26827. </pre></div>
  26828. </dd>
  26829. <dt>&lsquo;<samp class="samp">interleave_bottom, 5</samp>&rsquo;</dt>
  26830. <dd><p>Interleave the lower field from odd frames with the upper field from
  26831. even frames, generating a frame with unchanged height at half frame rate.
  26832. </p>
  26833. <div class="example">
  26834. <pre class="example-preformatted"> ------&gt; time
  26835. Input:
  26836. Frame 1 Frame 2 Frame 3 Frame 4
  26837. 11111 22222&lt;- 33333 44444&lt;-
  26838. 11111&lt;- 22222 33333&lt;- 44444
  26839. 11111 22222&lt;- 33333 44444&lt;-
  26840. 11111&lt;- 22222 33333&lt;- 44444
  26841. Output:
  26842. 22222 44444
  26843. 11111 33333
  26844. 22222 44444
  26845. 11111 33333
  26846. </pre></div>
  26847. </dd>
  26848. <dt>&lsquo;<samp class="samp">interlacex2, 6</samp>&rsquo;</dt>
  26849. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  26850. containing the second temporal field from the previous input frame and
  26851. the first temporal field from the next input frame. This mode relies on
  26852. the top_field_first flag. Useful for interlaced video displays with no
  26853. field synchronisation.
  26854. </p>
  26855. <div class="example">
  26856. <pre class="example-preformatted"> ------&gt; time
  26857. Input:
  26858. Frame 1 Frame 2 Frame 3 Frame 4
  26859. 11111 22222 33333 44444
  26860. 11111 22222 33333 44444
  26861. 11111 22222 33333 44444
  26862. 11111 22222 33333 44444
  26863. Output:
  26864. 11111 22222 22222 33333 33333 44444 44444
  26865. 11111 11111 22222 22222 33333 33333 44444
  26866. 11111 22222 22222 33333 33333 44444 44444
  26867. 11111 11111 22222 22222 33333 33333 44444
  26868. </pre></div>
  26869. </dd>
  26870. <dt>&lsquo;<samp class="samp">mergex2, 7</samp>&rsquo;</dt>
  26871. <dd><p>Move odd frames into the upper field, even into the lower field,
  26872. generating a double height frame at same frame rate.
  26873. </p>
  26874. <div class="example">
  26875. <pre class="example-preformatted"> ------&gt; time
  26876. Input:
  26877. Frame 1 Frame 2 Frame 3 Frame 4
  26878. 11111 22222 33333 44444
  26879. 11111 22222 33333 44444
  26880. 11111 22222 33333 44444
  26881. 11111 22222 33333 44444
  26882. Output:
  26883. 11111 33333 33333 55555
  26884. 22222 22222 44444 44444
  26885. 11111 33333 33333 55555
  26886. 22222 22222 44444 44444
  26887. 11111 33333 33333 55555
  26888. 22222 22222 44444 44444
  26889. 11111 33333 33333 55555
  26890. 22222 22222 44444 44444
  26891. </pre></div>
  26892. </dd>
  26893. </dl>
  26894. <p>Numeric values are deprecated but are accepted for backward
  26895. compatibility reasons.
  26896. </p>
  26897. <p>Default mode is <code class="code">merge</code>.
  26898. </p>
  26899. </dd>
  26900. <dt><samp class="option">flags</samp></dt>
  26901. <dd><p>Specify flags influencing the filter process.
  26902. </p>
  26903. <p>Available value for <var class="var">flags</var> is:
  26904. </p>
  26905. <dl class="table">
  26906. <dt><samp class="option">low_pass_filter, vlpf</samp></dt>
  26907. <dd><p>Enable linear vertical low-pass filtering in the filter.
  26908. Vertical low-pass filtering is required when creating an interlaced
  26909. destination from a progressive source which contains high-frequency
  26910. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  26911. patterning.
  26912. </p>
  26913. </dd>
  26914. <dt><samp class="option">complex_filter, cvlpf</samp></dt>
  26915. <dd><p>Enable complex vertical low-pass filtering.
  26916. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  26917. patterning but better retain detail and subjective sharpness impression.
  26918. </p>
  26919. </dd>
  26920. <dt><samp class="option">bypass_il</samp></dt>
  26921. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  26922. </p></dd>
  26923. </dl>
  26924. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  26925. enabled for <samp class="option">mode</samp> <var class="var">interleave_top</var> and <var class="var">interleave_bottom</var>.
  26926. </p>
  26927. </dd>
  26928. </dl>
  26929. <a name="tmedian"></a>
  26930. <h3 class="section">11.253 tmedian<span class="pull-right"><a class="anchor hidden-xs" href="#tmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmedian" aria-hidden="true">TOC</a></span></h3>
  26931. <p>Pick median pixels from several successive input video frames.
  26932. </p>
  26933. <p>The filter accepts the following options:
  26934. </p>
  26935. <dl class="table">
  26936. <dt><samp class="option">radius</samp></dt>
  26937. <dd><p>Set radius of median filter.
  26938. Default is 1. Allowed range is from 1 to 127.
  26939. </p>
  26940. </dd>
  26941. <dt><samp class="option">planes</samp></dt>
  26942. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  26943. </p>
  26944. </dd>
  26945. <dt><samp class="option">percentile</samp></dt>
  26946. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  26947. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  26948. minimum values, and <code class="code">1</code> maximum values.
  26949. </p></dd>
  26950. </dl>
  26951. <a name="Commands-147"></a>
  26952. <h4 class="subsection">11.253.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-147" aria-hidden="true">TOC</a></span></h4>
  26953. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">radius</code>.
  26954. </p>
  26955. <a name="tmidequalizer"></a>
  26956. <h3 class="section">11.254 tmidequalizer<span class="pull-right"><a class="anchor hidden-xs" href="#tmidequalizer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmidequalizer" aria-hidden="true">TOC</a></span></h3>
  26957. <p>Apply Temporal Midway Video Equalization effect.
  26958. </p>
  26959. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  26960. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  26961. useful for e.g. matching exposures from a video frames sequence.
  26962. </p>
  26963. <p>This filter accepts the following option:
  26964. </p>
  26965. <dl class="table">
  26966. <dt><samp class="option">radius</samp></dt>
  26967. <dd><p>Set filtering radius. Default is <code class="code">5</code>. Allowed range is from 1 to 127.
  26968. </p>
  26969. </dd>
  26970. <dt><samp class="option">sigma</samp></dt>
  26971. <dd><p>Set filtering sigma. Default is <code class="code">0.5</code>. This controls strength of filtering.
  26972. Setting this option to 0 effectively does nothing.
  26973. </p>
  26974. </dd>
  26975. <dt><samp class="option">planes</samp></dt>
  26976. <dd><p>Set which planes to process. Default is <code class="code">15</code>, which is all available planes.
  26977. </p></dd>
  26978. </dl>
  26979. <a name="tmix"></a>
  26980. <h3 class="section">11.255 tmix<span class="pull-right"><a class="anchor hidden-xs" href="#tmix" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tmix" aria-hidden="true">TOC</a></span></h3>
  26981. <p>Mix successive video frames.
  26982. </p>
  26983. <p>A description of the accepted options follows.
  26984. </p>
  26985. <dl class="table">
  26986. <dt><samp class="option">frames</samp></dt>
  26987. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  26988. </p>
  26989. </dd>
  26990. <dt><samp class="option">weights</samp></dt>
  26991. <dd><p>Specify weight of each input video frame.
  26992. Each weight is separated by space. If number of weights is smaller than
  26993. number of <var class="var">frames</var> last specified weight will be used for all remaining
  26994. unset weights.
  26995. </p>
  26996. </dd>
  26997. <dt><samp class="option">scale</samp></dt>
  26998. <dd><p>Specify scale, if it is set it will be multiplied with sum
  26999. of each weight multiplied with pixel values to give final destination
  27000. pixel value. By default <var class="var">scale</var> is auto scaled to sum of weights.
  27001. </p>
  27002. </dd>
  27003. <dt><samp class="option">planes</samp></dt>
  27004. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  27005. </p></dd>
  27006. </dl>
  27007. <a name="Examples-129"></a>
  27008. <h4 class="subsection">11.255.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-129" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-129" aria-hidden="true">TOC</a></span></h4>
  27009. <ul class="itemize mark-bullet">
  27010. <li>Average 7 successive frames:
  27011. <div class="example">
  27012. <pre class="example-preformatted">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  27013. </pre></div>
  27014. </li><li>Apply simple temporal convolution:
  27015. <div class="example">
  27016. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  27017. </pre></div>
  27018. </li><li>Similar as above but only showing temporal differences:
  27019. <div class="example">
  27020. <pre class="example-preformatted">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  27021. </pre></div>
  27022. </li></ul>
  27023. <a name="Commands-148"></a>
  27024. <h4 class="subsection">11.255.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-148" aria-hidden="true">TOC</a></span></h4>
  27025. <p>This filter supports the following commands:
  27026. </p><dl class="table">
  27027. <dt><samp class="option">weights</samp></dt>
  27028. <dt><samp class="option">scale</samp></dt>
  27029. <dt><samp class="option">planes</samp></dt>
  27030. <dd><p>Syntax is same as option with same name.
  27031. </p></dd>
  27032. </dl>
  27033. <a class="anchor" id="tonemap"></a><a name="tonemap-1"></a>
  27034. <h3 class="section">11.256 tonemap<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap-1" aria-hidden="true">TOC</a></span></h3>
  27035. <p>Tone map colors from different dynamic ranges.
  27036. </p>
  27037. <p>This filter expects data in single precision floating point, as it needs to
  27038. operate on (and can output) out-of-range values. Another filter, such as
  27039. <a class="ref" href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  27040. </p>
  27041. <p>The tonemapping algorithms implemented only work on linear light, so input
  27042. data should be linearized beforehand (and possibly correctly tagged).
  27043. </p>
  27044. <div class="example">
  27045. <pre class="example-preformatted">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  27046. </pre></div>
  27047. <a name="Options-3"></a>
  27048. <h4 class="subsection">11.256.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-3" aria-hidden="true">TOC</a></span></h4>
  27049. <p>The filter accepts the following options.
  27050. </p>
  27051. <dl class="table">
  27052. <dt><samp class="option">tonemap</samp></dt>
  27053. <dd><p>Set the tone map algorithm to use.
  27054. </p>
  27055. <p>Possible values are:
  27056. </p><dl class="table">
  27057. <dt><var class="var">none</var></dt>
  27058. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  27059. </p>
  27060. </dd>
  27061. <dt><var class="var">clip</var></dt>
  27062. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  27063. in-range values, while distorting out-of-range values.
  27064. </p>
  27065. </dd>
  27066. <dt><var class="var">linear</var></dt>
  27067. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  27068. </p>
  27069. </dd>
  27070. <dt><var class="var">gamma</var></dt>
  27071. <dd><p>Fit a logarithmic transfer between the tone curves.
  27072. </p>
  27073. </dd>
  27074. <dt><var class="var">reinhard</var></dt>
  27075. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  27076. contrast, which results in flattening details and degrading color accuracy.
  27077. </p>
  27078. </dd>
  27079. <dt><var class="var">hable</var></dt>
  27080. <dd><p>Preserve both dark and bright details better than <var class="var">reinhard</var>, at the cost
  27081. of slightly darkening everything. Use it when detail preservation is more
  27082. important than color and brightness accuracy.
  27083. </p>
  27084. </dd>
  27085. <dt><var class="var">mobius</var></dt>
  27086. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  27087. in-range material as much as possible. Use it when color accuracy is more
  27088. important than detail preservation.
  27089. </p></dd>
  27090. </dl>
  27091. <p>Default is none.
  27092. </p>
  27093. </dd>
  27094. <dt><samp class="option">param</samp></dt>
  27095. <dd><p>Tune the tone mapping algorithm.
  27096. </p>
  27097. <p>This affects the following algorithms:
  27098. </p><dl class="table">
  27099. <dt><var class="var">none</var></dt>
  27100. <dd><p>Ignored.
  27101. </p>
  27102. </dd>
  27103. <dt><var class="var">linear</var></dt>
  27104. <dd><p>Specifies the scale factor to use while stretching.
  27105. Default to 1.0.
  27106. </p>
  27107. </dd>
  27108. <dt><var class="var">gamma</var></dt>
  27109. <dd><p>Specifies the exponent of the function.
  27110. Default to 1.8.
  27111. </p>
  27112. </dd>
  27113. <dt><var class="var">clip</var></dt>
  27114. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  27115. Default to 1.0.
  27116. </p>
  27117. </dd>
  27118. <dt><var class="var">reinhard</var></dt>
  27119. <dd><p>Specify the local contrast coefficient at the display peak.
  27120. Default to 0.5, which means that in-gamut values will be about half as bright
  27121. as when clipping.
  27122. </p>
  27123. </dd>
  27124. <dt><var class="var">hable</var></dt>
  27125. <dd><p>Ignored.
  27126. </p>
  27127. </dd>
  27128. <dt><var class="var">mobius</var></dt>
  27129. <dd><p>Specify the transition point from linear to mobius transform. Every value
  27130. below this point is guaranteed to be mapped 1:1. The higher the value, the
  27131. more accurate the result will be, at the cost of losing bright details.
  27132. Default to 0.3, which due to the steep initial slope still preserves in-range
  27133. colors fairly accurately.
  27134. </p></dd>
  27135. </dl>
  27136. </dd>
  27137. <dt><samp class="option">desat</samp></dt>
  27138. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  27139. higher the parameter, the more color information will be preserved. This
  27140. setting helps prevent unnaturally blown-out colors for super-highlights, by
  27141. (smoothly) turning into white instead. This makes images feel more natural,
  27142. at the cost of reducing information about out-of-range colors.
  27143. </p>
  27144. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  27145. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  27146. </p>
  27147. <p>This option works only if the input frame has a supported color tag.
  27148. </p>
  27149. </dd>
  27150. <dt><samp class="option">peak</samp></dt>
  27151. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  27152. embedded peak information in display metadata is not reliable or when tone
  27153. mapping from a lower range to a higher range.
  27154. </p></dd>
  27155. </dl>
  27156. <a name="tpad"></a>
  27157. <h3 class="section">11.257 tpad<span class="pull-right"><a class="anchor hidden-xs" href="#tpad" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tpad" aria-hidden="true">TOC</a></span></h3>
  27158. <p>Temporarily pad video frames.
  27159. </p>
  27160. <p>The filter accepts the following options:
  27161. </p>
  27162. <dl class="table">
  27163. <dt><samp class="option">start</samp></dt>
  27164. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  27165. </p>
  27166. </dd>
  27167. <dt><samp class="option">stop</samp></dt>
  27168. <dd><p>Specify number of padding frames after input video stream.
  27169. Set to -1 to pad indefinitely. Default is 0.
  27170. </p>
  27171. </dd>
  27172. <dt><samp class="option">start_mode</samp></dt>
  27173. <dd><p>Set kind of frames added to beginning of stream.
  27174. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  27175. With <var class="var">add</var> frames of solid-color are added.
  27176. With <var class="var">clone</var> frames are clones of first frame.
  27177. Default is <var class="var">add</var>.
  27178. </p>
  27179. </dd>
  27180. <dt><samp class="option">stop_mode</samp></dt>
  27181. <dd><p>Set kind of frames added to end of stream.
  27182. Can be either <var class="var">add</var> or <var class="var">clone</var>.
  27183. With <var class="var">add</var> frames of solid-color are added.
  27184. With <var class="var">clone</var> frames are clones of last frame.
  27185. Default is <var class="var">add</var>.
  27186. </p>
  27187. </dd>
  27188. <dt><samp class="option">start_duration, stop_duration</samp></dt>
  27189. <dd><p>Specify the duration of the start/stop delay. See
  27190. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  27191. for the accepted syntax.
  27192. These options override <var class="var">start</var> and <var class="var">stop</var>. Default is 0.
  27193. </p>
  27194. </dd>
  27195. <dt><samp class="option">color</samp></dt>
  27196. <dd><p>Specify the color of the padded area. For the syntax of this option,
  27197. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  27198. manual</a>.
  27199. </p>
  27200. <p>The default value of <var class="var">color</var> is &quot;black&quot;.
  27201. </p></dd>
  27202. </dl>
  27203. <a class="anchor" id="transpose"></a><a name="transpose-1"></a>
  27204. <h3 class="section">11.258 transpose<span class="pull-right"><a class="anchor hidden-xs" href="#transpose-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose-1" aria-hidden="true">TOC</a></span></h3>
  27205. <p>Transpose rows with columns in the input video and optionally flip it.
  27206. </p>
  27207. <p>It accepts the following parameters:
  27208. </p>
  27209. <dl class="table">
  27210. <dt><samp class="option">dir</samp></dt>
  27211. <dd><p>Specify the transposition direction.
  27212. </p>
  27213. <p>Can assume the following values:
  27214. </p><dl class="table">
  27215. <dt>&lsquo;<samp class="samp">0, 4, cclock_flip</samp>&rsquo;</dt>
  27216. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  27217. </p><div class="example">
  27218. <pre class="example-preformatted">L.R L.l
  27219. . . -&gt; . .
  27220. l.r R.r
  27221. </pre></div>
  27222. </dd>
  27223. <dt>&lsquo;<samp class="samp">1, 5, clock</samp>&rsquo;</dt>
  27224. <dd><p>Rotate by 90 degrees clockwise, that is:
  27225. </p><div class="example">
  27226. <pre class="example-preformatted">L.R l.L
  27227. . . -&gt; . .
  27228. l.r r.R
  27229. </pre></div>
  27230. </dd>
  27231. <dt>&lsquo;<samp class="samp">2, 6, cclock</samp>&rsquo;</dt>
  27232. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  27233. </p><div class="example">
  27234. <pre class="example-preformatted">L.R R.r
  27235. . . -&gt; . .
  27236. l.r L.l
  27237. </pre></div>
  27238. </dd>
  27239. <dt>&lsquo;<samp class="samp">3, 7, clock_flip</samp>&rsquo;</dt>
  27240. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  27241. </p><div class="example">
  27242. <pre class="example-preformatted">L.R r.R
  27243. . . -&gt; . .
  27244. l.r l.L
  27245. </pre></div>
  27246. </dd>
  27247. </dl>
  27248. <p>For values between 4-7, the transposition is only done if the input
  27249. video geometry is portrait and not landscape. These values are
  27250. deprecated, the <code class="code">passthrough</code> option should be used instead.
  27251. </p>
  27252. <p>Numerical values are deprecated, and should be dropped in favor of
  27253. symbolic constants.
  27254. </p>
  27255. </dd>
  27256. <dt><samp class="option">passthrough</samp></dt>
  27257. <dd><p>Do not apply the transposition if the input geometry matches the one
  27258. specified by the specified value. It accepts the following values:
  27259. </p><dl class="table">
  27260. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  27261. <dd><p>Always apply transposition.
  27262. </p></dd>
  27263. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  27264. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  27265. </p></dd>
  27266. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  27267. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  27268. </p></dd>
  27269. </dl>
  27270. <p>Default value is <code class="code">none</code>.
  27271. </p></dd>
  27272. </dl>
  27273. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  27274. layout:
  27275. </p><div class="example">
  27276. <pre class="example-preformatted">transpose=dir=1:passthrough=portrait
  27277. </pre></div>
  27278. <p>The command above can also be specified as:
  27279. </p><div class="example">
  27280. <pre class="example-preformatted">transpose=1:portrait
  27281. </pre></div>
  27282. <a name="trim"></a>
  27283. <h3 class="section">11.259 trim<span class="pull-right"><a class="anchor hidden-xs" href="#trim" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-trim" aria-hidden="true">TOC</a></span></h3>
  27284. <p>Trim the input so that the output contains one continuous subpart of the input.
  27285. </p>
  27286. <p>It accepts the following parameters:
  27287. </p><dl class="table">
  27288. <dt><samp class="option">start</samp></dt>
  27289. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  27290. timestamp <var class="var">start</var> will be the first frame in the output.
  27291. </p>
  27292. </dd>
  27293. <dt><samp class="option">end</samp></dt>
  27294. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  27295. immediately preceding the one with the timestamp <var class="var">end</var> will be the last
  27296. frame in the output.
  27297. </p>
  27298. </dd>
  27299. <dt><samp class="option">start_pts</samp></dt>
  27300. <dd><p>This is the same as <var class="var">start</var>, except this option sets the start timestamp
  27301. in timebase units instead of seconds.
  27302. </p>
  27303. </dd>
  27304. <dt><samp class="option">end_pts</samp></dt>
  27305. <dd><p>This is the same as <var class="var">end</var>, except this option sets the end timestamp
  27306. in timebase units instead of seconds.
  27307. </p>
  27308. </dd>
  27309. <dt><samp class="option">duration</samp></dt>
  27310. <dd><p>The maximum duration of the output in seconds.
  27311. </p>
  27312. </dd>
  27313. <dt><samp class="option">start_frame</samp></dt>
  27314. <dd><p>The number of the first frame that should be passed to the output.
  27315. </p>
  27316. </dd>
  27317. <dt><samp class="option">end_frame</samp></dt>
  27318. <dd><p>The number of the first frame that should be dropped.
  27319. </p></dd>
  27320. </dl>
  27321. <p><samp class="option">start</samp>, <samp class="option">end</samp>, and <samp class="option">duration</samp> are expressed as time
  27322. duration specifications; see
  27323. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  27324. for the accepted syntax.
  27325. </p>
  27326. <p>Note that the first two sets of the start/end options and the <samp class="option">duration</samp>
  27327. option look at the frame timestamp, while the _frame variants simply count the
  27328. frames that pass through the filter. Also note that this filter does not modify
  27329. the timestamps. If you wish for the output timestamps to start at zero, insert a
  27330. setpts filter after the trim filter.
  27331. </p>
  27332. <p>If multiple start or end options are set, this filter tries to be greedy and
  27333. keep all the frames that match at least one of the specified constraints. To keep
  27334. only the part that matches all the constraints at once, chain multiple trim
  27335. filters.
  27336. </p>
  27337. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  27338. just the end values to keep everything before the specified time.
  27339. </p>
  27340. <p>Examples:
  27341. </p><ul class="itemize mark-bullet">
  27342. <li>Drop everything except the second minute of input:
  27343. <div class="example">
  27344. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=60:120
  27345. </pre></div>
  27346. </li><li>Keep only the first second:
  27347. <div class="example">
  27348. <pre class="example-preformatted">ffmpeg -i INPUT -vf trim=duration=1
  27349. </pre></div>
  27350. </li></ul>
  27351. <a name="unpremultiply"></a>
  27352. <h3 class="section">11.260 unpremultiply<span class="pull-right"><a class="anchor hidden-xs" href="#unpremultiply" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unpremultiply" aria-hidden="true">TOC</a></span></h3>
  27353. <p>Apply alpha unpremultiply effect to input video stream using first plane
  27354. of second stream as alpha.
  27355. </p>
  27356. <p>Both streams must have same dimensions and same pixel format.
  27357. </p>
  27358. <p>The filter accepts the following option:
  27359. </p>
  27360. <dl class="table">
  27361. <dt><samp class="option">planes</samp></dt>
  27362. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  27363. By default value 0xf, all planes will be processed.
  27364. </p>
  27365. <p>If the format has 1 or 2 components, then luma is bit 0.
  27366. If the format has 3 or 4 components:
  27367. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  27368. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  27369. If present, the alpha channel is always the last bit.
  27370. </p>
  27371. </dd>
  27372. <dt><samp class="option">inplace</samp></dt>
  27373. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  27374. </p></dd>
  27375. </dl>
  27376. <a class="anchor" id="unsharp"></a><a name="unsharp-1"></a>
  27377. <h3 class="section">11.261 unsharp<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp-1" aria-hidden="true">TOC</a></span></h3>
  27378. <p>Sharpen or blur the input video.
  27379. </p>
  27380. <p>It accepts the following parameters:
  27381. </p>
  27382. <dl class="table">
  27383. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  27384. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  27385. 3 and 23. The default value is 5.
  27386. </p>
  27387. </dd>
  27388. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  27389. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  27390. and 23. The default value is 5.
  27391. </p>
  27392. </dd>
  27393. <dt><samp class="option">luma_amount, la</samp></dt>
  27394. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  27395. values lay between -1.5 and 1.5.
  27396. </p>
  27397. <p>Negative values will blur the input video, while positive values will
  27398. sharpen it, a value of zero will disable the effect.
  27399. </p>
  27400. <p>Default value is 1.0.
  27401. </p>
  27402. </dd>
  27403. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  27404. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  27405. between 3 and 23. The default value is 5.
  27406. </p>
  27407. </dd>
  27408. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  27409. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  27410. between 3 and 23. The default value is 5.
  27411. </p>
  27412. </dd>
  27413. <dt><samp class="option">chroma_amount, ca</samp></dt>
  27414. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  27415. values lay between -1.5 and 1.5.
  27416. </p>
  27417. <p>Negative values will blur the input video, while positive values will
  27418. sharpen it, a value of zero will disable the effect.
  27419. </p>
  27420. <p>Default value is 0.0.
  27421. </p>
  27422. </dd>
  27423. <dt><samp class="option">alpha_msize_x, ax</samp></dt>
  27424. <dd><p>Set the alpha matrix horizontal size. It must be an odd integer
  27425. between 3 and 23. The default value is 5.
  27426. </p>
  27427. </dd>
  27428. <dt><samp class="option">alpha_msize_y, ay</samp></dt>
  27429. <dd><p>Set the alpha matrix vertical size. It must be an odd integer
  27430. between 3 and 23. The default value is 5.
  27431. </p>
  27432. </dd>
  27433. <dt><samp class="option">alpha_amount, aa</samp></dt>
  27434. <dd><p>Set the alpha effect strength. It must be a floating point number, reasonable
  27435. values lay between -1.5 and 1.5.
  27436. </p>
  27437. <p>Negative values will blur the input video, while positive values will
  27438. sharpen it, a value of zero will disable the effect.
  27439. </p>
  27440. <p>Default value is 0.0.
  27441. </p>
  27442. </dd>
  27443. </dl>
  27444. <p>All parameters are optional and default to the equivalent of the
  27445. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  27446. </p>
  27447. <a name="Examples-130"></a>
  27448. <h4 class="subsection">11.261.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-130" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-130" aria-hidden="true">TOC</a></span></h4>
  27449. <ul class="itemize mark-bullet">
  27450. <li>Apply strong luma sharpen effect:
  27451. <div class="example">
  27452. <pre class="example-preformatted">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  27453. </pre></div>
  27454. </li><li>Apply a strong blur of both luma and chroma parameters:
  27455. <div class="example">
  27456. <pre class="example-preformatted">unsharp=7:7:-2:7:7:-2
  27457. </pre></div>
  27458. </li></ul>
  27459. <a class="anchor" id="untile"></a><a name="untile-1"></a>
  27460. <h3 class="section">11.262 untile<span class="pull-right"><a class="anchor hidden-xs" href="#untile-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-untile-1" aria-hidden="true">TOC</a></span></h3>
  27461. <p>Decompose a video made of tiled images into the individual images.
  27462. </p>
  27463. <p>The frame rate of the output video is the frame rate of the input video
  27464. multiplied by the number of tiles.
  27465. </p>
  27466. <p>This filter does the reverse of <a class="ref" href="#tile">tile</a>.
  27467. </p>
  27468. <p>The filter accepts the following options:
  27469. </p>
  27470. <dl class="table">
  27471. <dt><samp class="option">layout</samp></dt>
  27472. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  27473. this option, check the
  27474. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27475. </p></dd>
  27476. </dl>
  27477. <a name="Examples-131"></a>
  27478. <h4 class="subsection">11.262.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-131" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-131" aria-hidden="true">TOC</a></span></h4>
  27479. <ul class="itemize mark-bullet">
  27480. <li>Produce a 1-second video from a still image file made of 25 frames stacked
  27481. vertically, like an analogic film reel:
  27482. <div class="example">
  27483. <pre class="example-preformatted">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  27484. </pre></div>
  27485. </li></ul>
  27486. <a name="uspp"></a>
  27487. <h3 class="section">11.263 uspp<span class="pull-right"><a class="anchor hidden-xs" href="#uspp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-uspp" aria-hidden="true">TOC</a></span></h3>
  27488. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  27489. the image at several (or - in the case of <samp class="option">quality</samp> level <code class="code">8</code> - all)
  27490. shifts and average the results.
  27491. </p>
  27492. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  27493. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  27494. DCT similar to MJPEG.
  27495. </p>
  27496. <p>This filter is not available in ffmpeg versions between 5.0 and 6.0.
  27497. </p>
  27498. <p>The filter accepts the following options:
  27499. </p>
  27500. <dl class="table">
  27501. <dt><samp class="option">quality</samp></dt>
  27502. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  27503. an integer in the range 0-8. If set to <code class="code">0</code>, the filter will have no
  27504. effect. A value of <code class="code">8</code> means the higher quality. For each increment of
  27505. that value the speed drops by a factor of approximately 2. Default value is
  27506. <code class="code">3</code>.
  27507. </p>
  27508. </dd>
  27509. <dt><samp class="option">qp</samp></dt>
  27510. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  27511. from the video stream (if available).
  27512. </p>
  27513. </dd>
  27514. <dt><samp class="option">codec</samp></dt>
  27515. <dd><p>Use specified codec instead of snow.
  27516. </p></dd>
  27517. </dl>
  27518. <a name="v360"></a>
  27519. <h3 class="section">11.264 v360<span class="pull-right"><a class="anchor hidden-xs" href="#v360" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-v360" aria-hidden="true">TOC</a></span></h3>
  27520. <p>Convert 360 videos between various formats.
  27521. </p>
  27522. <p>The filter accepts the following options:
  27523. </p>
  27524. <dl class="table">
  27525. <dt><samp class="option">input</samp></dt>
  27526. <dt><samp class="option">output</samp></dt>
  27527. <dd><p>Set format of the input/output video.
  27528. </p>
  27529. <p>Available formats:
  27530. </p>
  27531. <dl class="table">
  27532. <dt>&lsquo;<samp class="samp">e</samp>&rsquo;</dt>
  27533. <dt>&lsquo;<samp class="samp">equirect</samp>&rsquo;</dt>
  27534. <dd><p>Equirectangular projection.
  27535. </p>
  27536. </dd>
  27537. <dt>&lsquo;<samp class="samp">c3x2</samp>&rsquo;</dt>
  27538. <dt>&lsquo;<samp class="samp">c6x1</samp>&rsquo;</dt>
  27539. <dt>&lsquo;<samp class="samp">c1x6</samp>&rsquo;</dt>
  27540. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  27541. </p>
  27542. <p>Format specific options:
  27543. </p>
  27544. <dl class="table">
  27545. <dt><samp class="option">in_pad</samp></dt>
  27546. <dt><samp class="option">out_pad</samp></dt>
  27547. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  27548. </p>
  27549. <p>Example values:
  27550. </p><dl class="table">
  27551. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  27552. <dd><p>No padding.
  27553. </p></dd>
  27554. <dt>&lsquo;<samp class="samp">0.01</samp>&rsquo;</dt>
  27555. <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)
  27556. </p></dd>
  27557. </dl>
  27558. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>.
  27559. Maximum value is <b class="b">&lsquo;<samp class="samp">0.1</samp>&rsquo;</b>.
  27560. </p>
  27561. </dd>
  27562. <dt><samp class="option">fin_pad</samp></dt>
  27563. <dt><samp class="option">fout_pad</samp></dt>
  27564. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  27565. </p>
  27566. <p>Default value is <b class="b">&lsquo;<samp class="samp">0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  27567. </p>
  27568. </dd>
  27569. <dt><samp class="option">in_forder</samp></dt>
  27570. <dt><samp class="option">out_forder</samp></dt>
  27571. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  27572. </p>
  27573. <p>Designation of directions:
  27574. </p><dl class="table">
  27575. <dt>&lsquo;<samp class="samp">r</samp>&rsquo;</dt>
  27576. <dd><p>right
  27577. </p></dd>
  27578. <dt>&lsquo;<samp class="samp">l</samp>&rsquo;</dt>
  27579. <dd><p>left
  27580. </p></dd>
  27581. <dt>&lsquo;<samp class="samp">u</samp>&rsquo;</dt>
  27582. <dd><p>up
  27583. </p></dd>
  27584. <dt>&lsquo;<samp class="samp">d</samp>&rsquo;</dt>
  27585. <dd><p>down
  27586. </p></dd>
  27587. <dt>&lsquo;<samp class="samp">f</samp>&rsquo;</dt>
  27588. <dd><p>forward
  27589. </p></dd>
  27590. <dt>&lsquo;<samp class="samp">b</samp>&rsquo;</dt>
  27591. <dd><p>back
  27592. </p></dd>
  27593. </dl>
  27594. <p>Default value is <b class="b">&lsquo;<samp class="samp">rludfb</samp>&rsquo;</b>.
  27595. </p>
  27596. </dd>
  27597. <dt><samp class="option">in_frot</samp></dt>
  27598. <dt><samp class="option">out_frot</samp></dt>
  27599. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  27600. </p>
  27601. <p>Designation of angles:
  27602. </p><dl class="table">
  27603. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  27604. <dd><p>0 degrees clockwise
  27605. </p></dd>
  27606. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  27607. <dd><p>90 degrees clockwise
  27608. </p></dd>
  27609. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  27610. <dd><p>180 degrees clockwise
  27611. </p></dd>
  27612. <dt>&lsquo;<samp class="samp">3</samp>&rsquo;</dt>
  27613. <dd><p>270 degrees clockwise
  27614. </p></dd>
  27615. </dl>
  27616. <p>Default value is <b class="b">&lsquo;<samp class="samp">000000</samp>&rsquo;</b>.
  27617. </p></dd>
  27618. </dl>
  27619. </dd>
  27620. <dt>&lsquo;<samp class="samp">eac</samp>&rsquo;</dt>
  27621. <dd><p>Equi-Angular Cubemap.
  27622. </p>
  27623. </dd>
  27624. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  27625. <dt>&lsquo;<samp class="samp">gnomonic</samp>&rsquo;</dt>
  27626. <dt>&lsquo;<samp class="samp">rectilinear</samp>&rsquo;</dt>
  27627. <dd><p>Regular video.
  27628. </p>
  27629. <p>Format specific options:
  27630. </p><dl class="table">
  27631. <dt><samp class="option">h_fov</samp></dt>
  27632. <dt><samp class="option">v_fov</samp></dt>
  27633. <dt><samp class="option">d_fov</samp></dt>
  27634. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27635. </p>
  27636. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27637. </p>
  27638. </dd>
  27639. <dt><samp class="option">ih_fov</samp></dt>
  27640. <dt><samp class="option">iv_fov</samp></dt>
  27641. <dt><samp class="option">id_fov</samp></dt>
  27642. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27643. </p>
  27644. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27645. </p></dd>
  27646. </dl>
  27647. </dd>
  27648. <dt>&lsquo;<samp class="samp">dfisheye</samp>&rsquo;</dt>
  27649. <dd><p>Dual fisheye.
  27650. </p>
  27651. <p>Format specific options:
  27652. </p><dl class="table">
  27653. <dt><samp class="option">h_fov</samp></dt>
  27654. <dt><samp class="option">v_fov</samp></dt>
  27655. <dt><samp class="option">d_fov</samp></dt>
  27656. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27657. </p>
  27658. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27659. </p>
  27660. </dd>
  27661. <dt><samp class="option">ih_fov</samp></dt>
  27662. <dt><samp class="option">iv_fov</samp></dt>
  27663. <dt><samp class="option">id_fov</samp></dt>
  27664. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27665. </p>
  27666. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27667. </p></dd>
  27668. </dl>
  27669. </dd>
  27670. <dt>&lsquo;<samp class="samp">barrel</samp>&rsquo;</dt>
  27671. <dt>&lsquo;<samp class="samp">fb</samp>&rsquo;</dt>
  27672. <dt>&lsquo;<samp class="samp">barrelsplit</samp>&rsquo;</dt>
  27673. <dd><p>Facebook&rsquo;s 360 formats.
  27674. </p>
  27675. </dd>
  27676. <dt>&lsquo;<samp class="samp">sg</samp>&rsquo;</dt>
  27677. <dd><p>Stereographic format.
  27678. </p>
  27679. <p>Format specific options:
  27680. </p><dl class="table">
  27681. <dt><samp class="option">h_fov</samp></dt>
  27682. <dt><samp class="option">v_fov</samp></dt>
  27683. <dt><samp class="option">d_fov</samp></dt>
  27684. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27685. </p>
  27686. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27687. </p>
  27688. </dd>
  27689. <dt><samp class="option">ih_fov</samp></dt>
  27690. <dt><samp class="option">iv_fov</samp></dt>
  27691. <dt><samp class="option">id_fov</samp></dt>
  27692. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27693. </p>
  27694. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27695. </p></dd>
  27696. </dl>
  27697. </dd>
  27698. <dt>&lsquo;<samp class="samp">mercator</samp>&rsquo;</dt>
  27699. <dd><p>Mercator format.
  27700. </p>
  27701. </dd>
  27702. <dt>&lsquo;<samp class="samp">ball</samp>&rsquo;</dt>
  27703. <dd><p>Ball format, gives significant distortion toward the back.
  27704. </p>
  27705. </dd>
  27706. <dt>&lsquo;<samp class="samp">hammer</samp>&rsquo;</dt>
  27707. <dd><p>Hammer-Aitoff map projection format.
  27708. </p>
  27709. </dd>
  27710. <dt>&lsquo;<samp class="samp">sinusoidal</samp>&rsquo;</dt>
  27711. <dd><p>Sinusoidal map projection format.
  27712. </p>
  27713. </dd>
  27714. <dt>&lsquo;<samp class="samp">fisheye</samp>&rsquo;</dt>
  27715. <dd><p>Fisheye projection.
  27716. </p>
  27717. <p>Format specific options:
  27718. </p><dl class="table">
  27719. <dt><samp class="option">h_fov</samp></dt>
  27720. <dt><samp class="option">v_fov</samp></dt>
  27721. <dt><samp class="option">d_fov</samp></dt>
  27722. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27723. </p>
  27724. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27725. </p>
  27726. </dd>
  27727. <dt><samp class="option">ih_fov</samp></dt>
  27728. <dt><samp class="option">iv_fov</samp></dt>
  27729. <dt><samp class="option">id_fov</samp></dt>
  27730. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27731. </p>
  27732. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27733. </p></dd>
  27734. </dl>
  27735. </dd>
  27736. <dt>&lsquo;<samp class="samp">pannini</samp>&rsquo;</dt>
  27737. <dd><p>Pannini projection.
  27738. </p>
  27739. <p>Format specific options:
  27740. </p><dl class="table">
  27741. <dt><samp class="option">h_fov</samp></dt>
  27742. <dd><p>Set output pannini parameter.
  27743. </p>
  27744. </dd>
  27745. <dt><samp class="option">ih_fov</samp></dt>
  27746. <dd><p>Set input pannini parameter.
  27747. </p></dd>
  27748. </dl>
  27749. </dd>
  27750. <dt>&lsquo;<samp class="samp">cylindrical</samp>&rsquo;</dt>
  27751. <dd><p>Cylindrical projection.
  27752. </p>
  27753. <p>Format specific options:
  27754. </p><dl class="table">
  27755. <dt><samp class="option">h_fov</samp></dt>
  27756. <dt><samp class="option">v_fov</samp></dt>
  27757. <dt><samp class="option">d_fov</samp></dt>
  27758. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27759. </p>
  27760. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27761. </p>
  27762. </dd>
  27763. <dt><samp class="option">ih_fov</samp></dt>
  27764. <dt><samp class="option">iv_fov</samp></dt>
  27765. <dt><samp class="option">id_fov</samp></dt>
  27766. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27767. </p>
  27768. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27769. </p></dd>
  27770. </dl>
  27771. </dd>
  27772. <dt>&lsquo;<samp class="samp">perspective</samp>&rsquo;</dt>
  27773. <dd><p>Perspective projection. <i class="i">(output only)</i>
  27774. </p>
  27775. <p>Format specific options:
  27776. </p><dl class="table">
  27777. <dt><samp class="option">v_fov</samp></dt>
  27778. <dd><p>Set perspective parameter.
  27779. </p></dd>
  27780. </dl>
  27781. </dd>
  27782. <dt>&lsquo;<samp class="samp">tetrahedron</samp>&rsquo;</dt>
  27783. <dd><p>Tetrahedron projection.
  27784. </p>
  27785. </dd>
  27786. <dt>&lsquo;<samp class="samp">tsp</samp>&rsquo;</dt>
  27787. <dd><p>Truncated square pyramid projection.
  27788. </p>
  27789. </dd>
  27790. <dt>&lsquo;<samp class="samp">he</samp>&rsquo;</dt>
  27791. <dt>&lsquo;<samp class="samp">hequirect</samp>&rsquo;</dt>
  27792. <dd><p>Half equirectangular projection.
  27793. </p>
  27794. </dd>
  27795. <dt>&lsquo;<samp class="samp">equisolid</samp>&rsquo;</dt>
  27796. <dd><p>Equisolid format.
  27797. </p>
  27798. <p>Format specific options:
  27799. </p><dl class="table">
  27800. <dt><samp class="option">h_fov</samp></dt>
  27801. <dt><samp class="option">v_fov</samp></dt>
  27802. <dt><samp class="option">d_fov</samp></dt>
  27803. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27804. </p>
  27805. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27806. </p>
  27807. </dd>
  27808. <dt><samp class="option">ih_fov</samp></dt>
  27809. <dt><samp class="option">iv_fov</samp></dt>
  27810. <dt><samp class="option">id_fov</samp></dt>
  27811. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27812. </p>
  27813. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27814. </p></dd>
  27815. </dl>
  27816. </dd>
  27817. <dt>&lsquo;<samp class="samp">og</samp>&rsquo;</dt>
  27818. <dd><p>Orthographic format.
  27819. </p>
  27820. <p>Format specific options:
  27821. </p><dl class="table">
  27822. <dt><samp class="option">h_fov</samp></dt>
  27823. <dt><samp class="option">v_fov</samp></dt>
  27824. <dt><samp class="option">d_fov</samp></dt>
  27825. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  27826. </p>
  27827. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27828. </p>
  27829. </dd>
  27830. <dt><samp class="option">ih_fov</samp></dt>
  27831. <dt><samp class="option">iv_fov</samp></dt>
  27832. <dt><samp class="option">id_fov</samp></dt>
  27833. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  27834. </p>
  27835. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  27836. </p></dd>
  27837. </dl>
  27838. </dd>
  27839. <dt>&lsquo;<samp class="samp">octahedron</samp>&rsquo;</dt>
  27840. <dd><p>Octahedron projection.
  27841. </p>
  27842. </dd>
  27843. <dt>&lsquo;<samp class="samp">cylindricalea</samp>&rsquo;</dt>
  27844. <dd><p>Cylindrical Equal Area projection.
  27845. </p></dd>
  27846. </dl>
  27847. </dd>
  27848. <dt><samp class="option">interp</samp></dt>
  27849. <dd><p>Set interpolation method.<br>
  27850. <i class="i">Note: more complex interpolation methods require much more memory to run.</i>
  27851. </p>
  27852. <p>Available methods:
  27853. </p>
  27854. <dl class="table">
  27855. <dt>&lsquo;<samp class="samp">near</samp>&rsquo;</dt>
  27856. <dt>&lsquo;<samp class="samp">nearest</samp>&rsquo;</dt>
  27857. <dd><p>Nearest neighbour.
  27858. </p></dd>
  27859. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  27860. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  27861. <dd><p>Bilinear interpolation.
  27862. </p></dd>
  27863. <dt>&lsquo;<samp class="samp">lagrange9</samp>&rsquo;</dt>
  27864. <dd><p>Lagrange9 interpolation.
  27865. </p></dd>
  27866. <dt>&lsquo;<samp class="samp">cube</samp>&rsquo;</dt>
  27867. <dt>&lsquo;<samp class="samp">cubic</samp>&rsquo;</dt>
  27868. <dd><p>Bicubic interpolation.
  27869. </p></dd>
  27870. <dt>&lsquo;<samp class="samp">lanc</samp>&rsquo;</dt>
  27871. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  27872. <dd><p>Lanczos interpolation.
  27873. </p></dd>
  27874. <dt>&lsquo;<samp class="samp">sp16</samp>&rsquo;</dt>
  27875. <dt>&lsquo;<samp class="samp">spline16</samp>&rsquo;</dt>
  27876. <dd><p>Spline16 interpolation.
  27877. </p></dd>
  27878. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  27879. <dt>&lsquo;<samp class="samp">gaussian</samp>&rsquo;</dt>
  27880. <dd><p>Gaussian interpolation.
  27881. </p></dd>
  27882. <dt>&lsquo;<samp class="samp">mitchell</samp>&rsquo;</dt>
  27883. <dd><p>Mitchell interpolation.
  27884. </p></dd>
  27885. </dl>
  27886. <p>Default value is <b class="b">&lsquo;<samp class="samp">line</samp>&rsquo;</b>.
  27887. </p>
  27888. </dd>
  27889. <dt><samp class="option">w</samp></dt>
  27890. <dt><samp class="option">h</samp></dt>
  27891. <dd><p>Set the output video resolution.
  27892. </p>
  27893. <p>Default resolution depends on formats.
  27894. </p>
  27895. </dd>
  27896. <dt><samp class="option">in_stereo</samp></dt>
  27897. <dt><samp class="option">out_stereo</samp></dt>
  27898. <dd><p>Set the input/output stereo format.
  27899. </p>
  27900. <dl class="table">
  27901. <dt>&lsquo;<samp class="samp">2d</samp>&rsquo;</dt>
  27902. <dd><p>2D mono
  27903. </p></dd>
  27904. <dt>&lsquo;<samp class="samp">sbs</samp>&rsquo;</dt>
  27905. <dd><p>Side by side
  27906. </p></dd>
  27907. <dt>&lsquo;<samp class="samp">tb</samp>&rsquo;</dt>
  27908. <dd><p>Top bottom
  27909. </p></dd>
  27910. </dl>
  27911. <p>Default value is <b class="b">&lsquo;<samp class="samp">2d</samp>&rsquo;</b> for input and output format.
  27912. </p>
  27913. </dd>
  27914. <dt><samp class="option">yaw</samp></dt>
  27915. <dt><samp class="option">pitch</samp></dt>
  27916. <dt><samp class="option">roll</samp></dt>
  27917. <dd><p>Set rotation for the output video. Values in degrees.
  27918. </p>
  27919. </dd>
  27920. <dt><samp class="option">rorder</samp></dt>
  27921. <dd><p>Set rotation order for the output video. Choose one item for each position.
  27922. </p>
  27923. <dl class="table">
  27924. <dt>&lsquo;<samp class="samp">y, Y</samp>&rsquo;</dt>
  27925. <dd><p>yaw
  27926. </p></dd>
  27927. <dt>&lsquo;<samp class="samp">p, P</samp>&rsquo;</dt>
  27928. <dd><p>pitch
  27929. </p></dd>
  27930. <dt>&lsquo;<samp class="samp">r, R</samp>&rsquo;</dt>
  27931. <dd><p>roll
  27932. </p></dd>
  27933. </dl>
  27934. <p>Default value is <b class="b">&lsquo;<samp class="samp">ypr</samp>&rsquo;</b>.
  27935. </p>
  27936. </dd>
  27937. <dt><samp class="option">h_flip</samp></dt>
  27938. <dt><samp class="option">v_flip</samp></dt>
  27939. <dt><samp class="option">d_flip</samp></dt>
  27940. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  27941. </p>
  27942. </dd>
  27943. <dt><samp class="option">ih_flip</samp></dt>
  27944. <dt><samp class="option">iv_flip</samp></dt>
  27945. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  27946. </p>
  27947. </dd>
  27948. <dt><samp class="option">in_trans</samp></dt>
  27949. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  27950. </p>
  27951. </dd>
  27952. <dt><samp class="option">out_trans</samp></dt>
  27953. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  27954. </p>
  27955. </dd>
  27956. <dt><samp class="option">h_offset</samp></dt>
  27957. <dt><samp class="option">v_offset</samp></dt>
  27958. <dd><p>Set output horizontal/vertical off-axis offset. Default is set to 0.
  27959. Allowed range is from -1 to 1.
  27960. </p>
  27961. </dd>
  27962. <dt><samp class="option">alpha_mask</samp></dt>
  27963. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  27964. </p>
  27965. </dd>
  27966. <dt><samp class="option">reset_rot</samp></dt>
  27967. <dd><p>Reset rotation of output video. Boolean value, by default disabled.
  27968. </p></dd>
  27969. </dl>
  27970. <a name="Examples-132"></a>
  27971. <h4 class="subsection">11.264.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-132" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-132" aria-hidden="true">TOC</a></span></h4>
  27972. <ul class="itemize mark-bullet">
  27973. <li>Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  27974. <div class="example">
  27975. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  27976. </pre></div>
  27977. </li><li>Extract back view of Equi-Angular Cubemap:
  27978. <div class="example">
  27979. <pre class="example-preformatted">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  27980. </pre></div>
  27981. </li><li>Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  27982. <div class="example">
  27983. <pre class="example-preformatted">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  27984. </pre></div>
  27985. </li></ul>
  27986. <a name="Commands-149"></a>
  27987. <h4 class="subsection">11.264.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-149" aria-hidden="true">TOC</a></span></h4>
  27988. <p>This filter supports subset of above options as <a class="ref" href="#commands">commands</a>.
  27989. </p>
  27990. <a name="vaguedenoiser"></a>
  27991. <h3 class="section">11.265 vaguedenoiser<span class="pull-right"><a class="anchor hidden-xs" href="#vaguedenoiser" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vaguedenoiser" aria-hidden="true">TOC</a></span></h3>
  27992. <p>Apply a wavelet based denoiser.
  27993. </p>
  27994. <p>It transforms each frame from the video input into the wavelet domain,
  27995. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  27996. the obtained coefficients. It does an inverse wavelet transform after.
  27997. Due to wavelet properties, it should give a nice smoothed result, and
  27998. reduced noise, without blurring picture features.
  27999. </p>
  28000. <p>This filter accepts the following options:
  28001. </p>
  28002. <dl class="table">
  28003. <dt><samp class="option">threshold</samp></dt>
  28004. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  28005. Hard thresholding can use a higher threshold than soft thresholding
  28006. before the video looks overfiltered. Default value is 2.
  28007. </p>
  28008. </dd>
  28009. <dt><samp class="option">method</samp></dt>
  28010. <dd><p>The filtering method the filter will use.
  28011. </p>
  28012. <p>It accepts the following values:
  28013. </p><dl class="table">
  28014. <dt>&lsquo;<samp class="samp">hard</samp>&rsquo;</dt>
  28015. <dd><p>All values under the threshold will be zeroed.
  28016. </p>
  28017. </dd>
  28018. <dt>&lsquo;<samp class="samp">soft</samp>&rsquo;</dt>
  28019. <dd><p>All values under the threshold will be zeroed. All values above will be
  28020. reduced by the threshold.
  28021. </p>
  28022. </dd>
  28023. <dt>&lsquo;<samp class="samp">garrote</samp>&rsquo;</dt>
  28024. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  28025. (less) hard thresholding.
  28026. </p></dd>
  28027. </dl>
  28028. <p>Default is garrote.
  28029. </p>
  28030. </dd>
  28031. <dt><samp class="option">nsteps</samp></dt>
  28032. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  28033. be decomposed beyond a particular point (typically, 8 for a 640x480
  28034. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  28035. </p>
  28036. </dd>
  28037. <dt><samp class="option">percent</samp></dt>
  28038. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  28039. </p>
  28040. </dd>
  28041. <dt><samp class="option">planes</samp></dt>
  28042. <dd><p>A list of the planes to process. By default all planes are processed.
  28043. </p>
  28044. </dd>
  28045. <dt><samp class="option">type</samp></dt>
  28046. <dd><p>The threshold type the filter will use.
  28047. </p>
  28048. <p>It accepts the following values:
  28049. </p><dl class="table">
  28050. <dt>&lsquo;<samp class="samp">universal</samp>&rsquo;</dt>
  28051. <dd><p>Threshold used is same for all decompositions.
  28052. </p>
  28053. </dd>
  28054. <dt>&lsquo;<samp class="samp">bayes</samp>&rsquo;</dt>
  28055. <dd><p>Threshold used depends also on each decomposition coefficients.
  28056. </p></dd>
  28057. </dl>
  28058. <p>Default is universal.
  28059. </p></dd>
  28060. </dl>
  28061. <a name="varblur"></a>
  28062. <h3 class="section">11.266 varblur<span class="pull-right"><a class="anchor hidden-xs" href="#varblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-varblur" aria-hidden="true">TOC</a></span></h3>
  28063. <p>Apply variable blur filter by using 2nd video stream to set blur radius.
  28064. The 2nd stream must have the same dimensions.
  28065. </p>
  28066. <p>This filter accepts the following options:
  28067. </p>
  28068. <dl class="table">
  28069. <dt><samp class="option">min_r</samp></dt>
  28070. <dd><p>Set min allowed radius. Allowed range is from 0 to 254. Default is 0.
  28071. </p></dd>
  28072. <dt><samp class="option">max_r</samp></dt>
  28073. <dd><p>Set max allowed radius. Allowed range is from 1 to 255. Default is 8.
  28074. </p></dd>
  28075. <dt><samp class="option">planes</samp></dt>
  28076. <dd><p>Set which planes to process. By default, all are used.
  28077. </p></dd>
  28078. </dl>
  28079. <p>The <code class="code">varblur</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  28080. </p>
  28081. <a name="Commands-150"></a>
  28082. <h4 class="subsection">11.266.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-150" aria-hidden="true">TOC</a></span></h4>
  28083. <p>This filter supports all the above options as <a class="ref" href="#commands">commands</a>.
  28084. </p>
  28085. <a name="vectorscope"></a>
  28086. <h3 class="section">11.267 vectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#vectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vectorscope" aria-hidden="true">TOC</a></span></h3>
  28087. <p>Display 2 color component values in the two dimensional graph (which is called
  28088. a vectorscope).
  28089. </p>
  28090. <p>This filter accepts the following options:
  28091. </p>
  28092. <dl class="table">
  28093. <dt><samp class="option">mode, m</samp></dt>
  28094. <dd><p>Set vectorscope mode.
  28095. </p>
  28096. <p>It accepts the following values:
  28097. </p><dl class="table">
  28098. <dt>&lsquo;<samp class="samp">gray</samp>&rsquo;</dt>
  28099. <dt>&lsquo;<samp class="samp">tint</samp>&rsquo;</dt>
  28100. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  28101. same component color value on location in graph. This is the default mode.
  28102. </p>
  28103. </dd>
  28104. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  28105. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  28106. present in video frame are drawn in gradient of 2 color components which are
  28107. set by option <code class="code">x</code> and <code class="code">y</code>. The 3rd color component is static.
  28108. </p>
  28109. </dd>
  28110. <dt>&lsquo;<samp class="samp">color2</samp>&rsquo;</dt>
  28111. <dd><p>Actual color components values present in video frame are displayed on graph.
  28112. </p>
  28113. </dd>
  28114. <dt>&lsquo;<samp class="samp">color3</samp>&rsquo;</dt>
  28115. <dd><p>Similar as color2 but higher frequency of same values <code class="code">x</code> and <code class="code">y</code>
  28116. on graph increases value of another color component, which is luminance by
  28117. default values of <code class="code">x</code> and <code class="code">y</code>.
  28118. </p>
  28119. </dd>
  28120. <dt>&lsquo;<samp class="samp">color4</samp>&rsquo;</dt>
  28121. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  28122. colors map to same position on graph then color with higher value of component
  28123. not present in graph is picked.
  28124. </p>
  28125. </dd>
  28126. <dt>&lsquo;<samp class="samp">color5</samp>&rsquo;</dt>
  28127. <dd><p>Gray values are displayed on graph. Similar to <code class="code">color</code> but with 3rd color
  28128. component picked from radial gradient.
  28129. </p></dd>
  28130. </dl>
  28131. </dd>
  28132. <dt><samp class="option">x</samp></dt>
  28133. <dd><p>Set which color component will be represented on X-axis. Default is <code class="code">1</code>.
  28134. </p>
  28135. </dd>
  28136. <dt><samp class="option">y</samp></dt>
  28137. <dd><p>Set which color component will be represented on Y-axis. Default is <code class="code">2</code>.
  28138. </p>
  28139. </dd>
  28140. <dt><samp class="option">intensity, i</samp></dt>
  28141. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  28142. of color component which represents frequency of (X, Y) location in graph.
  28143. </p>
  28144. </dd>
  28145. <dt><samp class="option">envelope, e</samp></dt>
  28146. <dd><dl class="table">
  28147. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  28148. <dd><p>No envelope, this is default.
  28149. </p>
  28150. </dd>
  28151. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  28152. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  28153. </p>
  28154. </dd>
  28155. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  28156. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  28157. can still spot out of range values without constantly looking at vectorscope.
  28158. </p>
  28159. </dd>
  28160. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  28161. <dd><p>Peak and instant envelope combined together.
  28162. </p></dd>
  28163. </dl>
  28164. </dd>
  28165. <dt><samp class="option">graticule, g</samp></dt>
  28166. <dd><p>Set what kind of graticule to draw.
  28167. </p><dl class="table">
  28168. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  28169. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  28170. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  28171. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  28172. </dl>
  28173. </dd>
  28174. <dt><samp class="option">opacity, o</samp></dt>
  28175. <dd><p>Set graticule opacity.
  28176. </p>
  28177. </dd>
  28178. <dt><samp class="option">flags, f</samp></dt>
  28179. <dd><p>Set graticule flags.
  28180. </p>
  28181. <dl class="table">
  28182. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  28183. <dd><p>Draw graticule for white point.
  28184. </p>
  28185. </dd>
  28186. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  28187. <dd><p>Draw graticule for black point.
  28188. </p>
  28189. </dd>
  28190. <dt>&lsquo;<samp class="samp">name</samp>&rsquo;</dt>
  28191. <dd><p>Draw color points short names.
  28192. </p></dd>
  28193. </dl>
  28194. </dd>
  28195. <dt><samp class="option">bgopacity, b</samp></dt>
  28196. <dd><p>Set background opacity.
  28197. </p>
  28198. </dd>
  28199. <dt><samp class="option">lthreshold, l</samp></dt>
  28200. <dd><p>Set low threshold for color component not represented on X or Y axis.
  28201. Values lower than this value will be ignored. Default is 0.
  28202. Note this value is multiplied with actual max possible value one pixel component
  28203. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  28204. is 0.1 * 255 = 25.
  28205. </p>
  28206. </dd>
  28207. <dt><samp class="option">hthreshold, h</samp></dt>
  28208. <dd><p>Set high threshold for color component not represented on X or Y axis.
  28209. Values higher than this value will be ignored. Default is 1.
  28210. Note this value is multiplied with actual max possible value one pixel component
  28211. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  28212. is 0.9 * 255 = 230.
  28213. </p>
  28214. </dd>
  28215. <dt><samp class="option">colorspace, c</samp></dt>
  28216. <dd><p>Set what kind of colorspace to use when drawing graticule.
  28217. </p><dl class="table">
  28218. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  28219. <dt>&lsquo;<samp class="samp">601</samp>&rsquo;</dt>
  28220. <dt>&lsquo;<samp class="samp">709</samp>&rsquo;</dt>
  28221. </dl>
  28222. <p>Default is auto.
  28223. </p>
  28224. </dd>
  28225. <dt><samp class="option">tint0, t0</samp></dt>
  28226. <dt><samp class="option">tint1, t1</samp></dt>
  28227. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  28228. This means no tint, and output will remain gray.
  28229. </p></dd>
  28230. </dl>
  28231. <a class="anchor" id="vidstabdetect"></a><a name="vidstabdetect-1"></a>
  28232. <h3 class="section">11.268 vidstabdetect<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabdetect-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabdetect-1" aria-hidden="true">TOC</a></span></h3>
  28233. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  28234. <a class="ref" href="#vidstabtransform">vidstabtransform</a> for pass 2.
  28235. </p>
  28236. <p>This filter generates a file with relative translation and rotation
  28237. transform information about subsequent frames, which is then used by
  28238. the <a class="ref" href="#vidstabtransform">vidstabtransform</a> filter.
  28239. </p>
  28240. <p>To enable compilation of this filter you need to configure FFmpeg with
  28241. <code class="code">--enable-libvidstab</code>.
  28242. </p>
  28243. <p>This filter accepts the following options:
  28244. </p>
  28245. <dl class="table">
  28246. <dt><samp class="option">result</samp></dt>
  28247. <dd><p>Set the path to the file used to write the transforms information.
  28248. Default value is <samp class="file">transforms.trf</samp>.
  28249. </p>
  28250. </dd>
  28251. <dt><samp class="option">shakiness</samp></dt>
  28252. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  28253. integer in the range 1-10, a value of 1 means little shakiness, a
  28254. value of 10 means strong shakiness. Default value is 5.
  28255. </p>
  28256. </dd>
  28257. <dt><samp class="option">accuracy</samp></dt>
  28258. <dd><p>Set the accuracy of the detection process. It must be a value in the
  28259. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  28260. accuracy. Default value is 15.
  28261. </p>
  28262. </dd>
  28263. <dt><samp class="option">stepsize</samp></dt>
  28264. <dd><p>Set stepsize of the search process. The region around minimum is
  28265. scanned with 1 pixel resolution. Default value is 6.
  28266. </p>
  28267. </dd>
  28268. <dt><samp class="option">mincontrast</samp></dt>
  28269. <dd><p>Set minimum contrast. Below this value a local measurement field is
  28270. discarded. Must be a floating point value in the range 0-1. Default
  28271. value is 0.3.
  28272. </p>
  28273. </dd>
  28274. <dt><samp class="option">tripod</samp></dt>
  28275. <dd><p>Set reference frame number for tripod mode.
  28276. </p>
  28277. <p>If enabled, the motion of the frames is compared to a reference frame
  28278. in the filtered stream, identified by the specified number. The idea
  28279. is to compensate all movements in a more-or-less static scene and keep
  28280. the camera view absolutely still.
  28281. </p>
  28282. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  28283. </p>
  28284. </dd>
  28285. <dt><samp class="option">show</samp></dt>
  28286. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  28287. integer in the range 0-2. Default value is 0, which disables any
  28288. visualization.
  28289. </p>
  28290. </dd>
  28291. <dt><samp class="option">fileformat</samp></dt>
  28292. <dd><p>Format for the transforms data file to be written.
  28293. Acceptable values are
  28294. </p>
  28295. <dl class="table">
  28296. <dt>&lsquo;<samp class="samp">ascii</samp>&rsquo;</dt>
  28297. <dd><p>Human-readable plain text
  28298. </p>
  28299. </dd>
  28300. <dt>&lsquo;<samp class="samp">binary</samp>&rsquo;</dt>
  28301. <dd><p>Binary format, roughly 40% smaller than <code class="code">ascii</code>. (<em class="emph">default</em>)
  28302. </p></dd>
  28303. </dl>
  28304. </dd>
  28305. </dl>
  28306. <a name="Examples-133"></a>
  28307. <h4 class="subsection">11.268.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-133" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-133" aria-hidden="true">TOC</a></span></h4>
  28308. <ul class="itemize mark-bullet">
  28309. <li>Use default values:
  28310. <div class="example">
  28311. <pre class="example-preformatted">vidstabdetect
  28312. </pre></div>
  28313. </li><li>Analyze strongly shaky movie and put the results in file
  28314. <samp class="file">mytransforms.trf</samp>:
  28315. <div class="example">
  28316. <pre class="example-preformatted">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  28317. </pre></div>
  28318. </li><li>Visualize the result of internal transformations in the resulting
  28319. video:
  28320. <div class="example">
  28321. <pre class="example-preformatted">vidstabdetect=show=1
  28322. </pre></div>
  28323. </li><li>Analyze a video with medium shakiness using <code class="command">ffmpeg</code>:
  28324. <div class="example">
  28325. <pre class="example-preformatted">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  28326. </pre></div>
  28327. </li></ul>
  28328. <a class="anchor" id="vidstabtransform"></a><a name="vidstabtransform-1"></a>
  28329. <h3 class="section">11.269 vidstabtransform<span class="pull-right"><a class="anchor hidden-xs" href="#vidstabtransform-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vidstabtransform-1" aria-hidden="true">TOC</a></span></h3>
  28330. <p>Video stabilization/deshaking: pass 2 of 2,
  28331. see <a class="ref" href="#vidstabdetect">vidstabdetect</a> for pass 1.
  28332. </p>
  28333. <p>Read a file with transform information for each frame and
  28334. apply/compensate them. Together with the <a class="ref" href="#vidstabdetect">vidstabdetect</a>
  28335. filter this can be used to deshake videos. See also
  28336. <a class="url" href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  28337. the <a class="ref" href="#unsharp">unsharp</a> filter, see below.
  28338. </p>
  28339. <p>To enable compilation of this filter you need to configure FFmpeg with
  28340. <code class="code">--enable-libvidstab</code>.
  28341. </p>
  28342. <a name="Options-4"></a>
  28343. <h4 class="subsection">11.269.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-4" aria-hidden="true">TOC</a></span></h4>
  28344. <dl class="table">
  28345. <dt><samp class="option">input</samp></dt>
  28346. <dd><p>Set path to the file used to read the transforms. Default value is
  28347. <samp class="file">transforms.trf</samp>.
  28348. </p>
  28349. </dd>
  28350. <dt><samp class="option">smoothing</samp></dt>
  28351. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  28352. camera movements. Default value is 10.
  28353. </p>
  28354. <p>For example a number of 10 means that 21 frames are used (10 in the
  28355. past and 10 in the future) to smoothen the motion in the video. A
  28356. larger value leads to a smoother video, but limits the acceleration of
  28357. the camera (pan/tilt movements). 0 is a special case where a static
  28358. camera is simulated.
  28359. </p>
  28360. </dd>
  28361. <dt><samp class="option">optalgo</samp></dt>
  28362. <dd><p>Set the camera path optimization algorithm.
  28363. </p>
  28364. <p>Accepted values are:
  28365. </p><dl class="table">
  28366. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  28367. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  28368. </p></dd>
  28369. <dt>&lsquo;<samp class="samp">avg</samp>&rsquo;</dt>
  28370. <dd><p>averaging on transformations
  28371. </p></dd>
  28372. </dl>
  28373. </dd>
  28374. <dt><samp class="option">maxshift</samp></dt>
  28375. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  28376. meaning no limit.
  28377. </p>
  28378. </dd>
  28379. <dt><samp class="option">maxangle</samp></dt>
  28380. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  28381. value is -1, meaning no limit.
  28382. </p>
  28383. </dd>
  28384. <dt><samp class="option">crop</samp></dt>
  28385. <dd><p>Specify how to deal with borders that may be visible due to movement
  28386. compensation.
  28387. </p>
  28388. <p>Available values are:
  28389. </p><dl class="table">
  28390. <dt>&lsquo;<samp class="samp">keep</samp>&rsquo;</dt>
  28391. <dd><p>keep image information from previous frame (default)
  28392. </p></dd>
  28393. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  28394. <dd><p>fill the border black
  28395. </p></dd>
  28396. </dl>
  28397. </dd>
  28398. <dt><samp class="option">invert</samp></dt>
  28399. <dd><p>Invert transforms if set to 1. Default value is 0.
  28400. </p>
  28401. </dd>
  28402. <dt><samp class="option">relative</samp></dt>
  28403. <dd><p>Consider transforms as relative to previous frame if set to 1,
  28404. absolute if set to 0. Default value is 0.
  28405. </p>
  28406. </dd>
  28407. <dt><samp class="option">zoom</samp></dt>
  28408. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  28409. effect, a negative value in a zoom-out effect. Default value is 0 (no
  28410. zoom).
  28411. </p>
  28412. </dd>
  28413. <dt><samp class="option">optzoom</samp></dt>
  28414. <dd><p>Set optimal zooming to avoid borders.
  28415. </p>
  28416. <p>Accepted values are:
  28417. </p><dl class="table">
  28418. <dt>&lsquo;<samp class="samp">0</samp>&rsquo;</dt>
  28419. <dd><p>disabled
  28420. </p></dd>
  28421. <dt>&lsquo;<samp class="samp">1</samp>&rsquo;</dt>
  28422. <dd><p>optimal static zoom value is determined (only very strong movements
  28423. will lead to visible borders) (default)
  28424. </p></dd>
  28425. <dt>&lsquo;<samp class="samp">2</samp>&rsquo;</dt>
  28426. <dd><p>optimal adaptive zoom value is determined (no borders will be
  28427. visible), see <samp class="option">zoomspeed</samp>
  28428. </p></dd>
  28429. </dl>
  28430. <p>Note that the value given at zoom is added to the one calculated here.
  28431. </p>
  28432. </dd>
  28433. <dt><samp class="option">zoomspeed</samp></dt>
  28434. <dd><p>Set percent to zoom maximally each frame (enabled when
  28435. <samp class="option">optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  28436. 0.25.
  28437. </p>
  28438. </dd>
  28439. <dt><samp class="option">interpol</samp></dt>
  28440. <dd><p>Specify type of interpolation.
  28441. </p>
  28442. <p>Available values are:
  28443. </p><dl class="table">
  28444. <dt>&lsquo;<samp class="samp">no</samp>&rsquo;</dt>
  28445. <dd><p>no interpolation
  28446. </p></dd>
  28447. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  28448. <dd><p>linear only horizontal
  28449. </p></dd>
  28450. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  28451. <dd><p>linear in both directions (default)
  28452. </p></dd>
  28453. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  28454. <dd><p>cubic in both directions (slow)
  28455. </p></dd>
  28456. </dl>
  28457. </dd>
  28458. <dt><samp class="option">tripod</samp></dt>
  28459. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  28460. <code class="code">relative=0:smoothing=0</code>. Default value is 0.
  28461. </p>
  28462. <p>Use also <code class="code">tripod</code> option of <a class="ref" href="#vidstabdetect">vidstabdetect</a>.
  28463. </p>
  28464. </dd>
  28465. <dt><samp class="option">debug</samp></dt>
  28466. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  28467. are written to the temporary file <samp class="file">global_motions.trf</samp>. Default
  28468. value is 0.
  28469. </p></dd>
  28470. </dl>
  28471. <a name="Examples-134"></a>
  28472. <h4 class="subsection">11.269.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-134" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-134" aria-hidden="true">TOC</a></span></h4>
  28473. <ul class="itemize mark-bullet">
  28474. <li>Use <code class="command">ffmpeg</code> for a typical stabilization with default values:
  28475. <div class="example">
  28476. <pre class="example-preformatted">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  28477. </pre></div>
  28478. <p>Note the use of the <a class="ref" href="#unsharp">unsharp</a> filter which is always recommended.
  28479. </p>
  28480. </li><li>Zoom in a bit more and load transform data from a given file:
  28481. <div class="example">
  28482. <pre class="example-preformatted">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  28483. </pre></div>
  28484. </li><li>Smoothen the video even more:
  28485. <div class="example">
  28486. <pre class="example-preformatted">vidstabtransform=smoothing=30
  28487. </pre></div>
  28488. </li></ul>
  28489. <a name="vflip"></a>
  28490. <h3 class="section">11.270 vflip<span class="pull-right"><a class="anchor hidden-xs" href="#vflip" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip" aria-hidden="true">TOC</a></span></h3>
  28491. <p>Flip the input video vertically.
  28492. </p>
  28493. <p>For example, to vertically flip a video with <code class="command">ffmpeg</code>:
  28494. </p><div class="example">
  28495. <pre class="example-preformatted">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  28496. </pre></div>
  28497. <a name="vfrdet"></a>
  28498. <h3 class="section">11.271 vfrdet<span class="pull-right"><a class="anchor hidden-xs" href="#vfrdet" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vfrdet" aria-hidden="true">TOC</a></span></h3>
  28499. <p>Detect variable frame rate video.
  28500. </p>
  28501. <p>This filter tries to detect if the input is variable or constant frame rate.
  28502. </p>
  28503. <p>At end it will output number of frames detected as having variable delta pts,
  28504. and ones with constant delta pts.
  28505. If there was frames with variable delta, than it will also show min, max and
  28506. average delta encountered.
  28507. </p>
  28508. <a name="vibrance"></a>
  28509. <h3 class="section">11.272 vibrance<span class="pull-right"><a class="anchor hidden-xs" href="#vibrance" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vibrance" aria-hidden="true">TOC</a></span></h3>
  28510. <p>Boost or alter saturation.
  28511. </p>
  28512. <p>The filter accepts the following options:
  28513. </p><dl class="table">
  28514. <dt><samp class="option">intensity</samp></dt>
  28515. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  28516. Default is 0. Allowed range is from -2 to 2.
  28517. </p>
  28518. </dd>
  28519. <dt><samp class="option">rbal</samp></dt>
  28520. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  28521. </p>
  28522. </dd>
  28523. <dt><samp class="option">gbal</samp></dt>
  28524. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  28525. </p>
  28526. </dd>
  28527. <dt><samp class="option">bbal</samp></dt>
  28528. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  28529. </p>
  28530. </dd>
  28531. <dt><samp class="option">rlum</samp></dt>
  28532. <dd><p>Set the red luma coefficient.
  28533. </p>
  28534. </dd>
  28535. <dt><samp class="option">glum</samp></dt>
  28536. <dd><p>Set the green luma coefficient.
  28537. </p>
  28538. </dd>
  28539. <dt><samp class="option">blum</samp></dt>
  28540. <dd><p>Set the blue luma coefficient.
  28541. </p>
  28542. </dd>
  28543. <dt><samp class="option">alternate</samp></dt>
  28544. <dd><p>If <code class="code">intensity</code> is negative and this is set to 1, colors will change,
  28545. otherwise colors will be less saturated, more towards gray.
  28546. </p></dd>
  28547. </dl>
  28548. <a name="Commands-151"></a>
  28549. <h4 class="subsection">11.272.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-151" aria-hidden="true">TOC</a></span></h4>
  28550. <p>This filter supports the all above options as <a class="ref" href="#commands">commands</a>.
  28551. </p>
  28552. <a name="vif"></a>
  28553. <h3 class="section">11.273 vif<span class="pull-right"><a class="anchor hidden-xs" href="#vif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vif" aria-hidden="true">TOC</a></span></h3>
  28554. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  28555. </p>
  28556. <p>This filter takes two input videos.
  28557. </p>
  28558. <p>Both input videos must have the same resolution and pixel format for
  28559. this filter to work correctly. Also it assumes that both inputs
  28560. have the same number of frames, which are compared one by one.
  28561. </p>
  28562. <p>The obtained average VIF score is printed through the logging system.
  28563. </p>
  28564. <p>The filter stores the calculated VIF score of each frame.
  28565. </p>
  28566. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  28567. </p>
  28568. <p>In the below example the input file <samp class="file">main.mpg</samp> being processed is compared
  28569. with the reference file <samp class="file">ref.mpg</samp>.
  28570. </p>
  28571. <div class="example">
  28572. <pre class="example-preformatted">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  28573. </pre></div>
  28574. <a class="anchor" id="vignette"></a><a name="vignette-1"></a>
  28575. <h3 class="section">11.274 vignette<span class="pull-right"><a class="anchor hidden-xs" href="#vignette-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vignette-1" aria-hidden="true">TOC</a></span></h3>
  28576. <p>Make or reverse a natural vignetting effect.
  28577. </p>
  28578. <p>The filter accepts the following options:
  28579. </p>
  28580. <dl class="table">
  28581. <dt><samp class="option">angle, a</samp></dt>
  28582. <dd><p>Set lens angle expression as a number of radians.
  28583. </p>
  28584. <p>The value is clipped in the <code class="code">[0,PI/2]</code> range.
  28585. </p>
  28586. <p>Default value: <code class="code">&quot;PI/5&quot;</code>
  28587. </p>
  28588. </dd>
  28589. <dt><samp class="option">x0</samp></dt>
  28590. <dt><samp class="option">y0</samp></dt>
  28591. <dd><p>Set center coordinates expressions. Respectively <code class="code">&quot;w/2&quot;</code> and <code class="code">&quot;h/2&quot;</code>
  28592. by default.
  28593. </p>
  28594. </dd>
  28595. <dt><samp class="option">mode</samp></dt>
  28596. <dd><p>Set forward/backward mode.
  28597. </p>
  28598. <p>Available modes are:
  28599. </p><dl class="table">
  28600. <dt>&lsquo;<samp class="samp">forward</samp>&rsquo;</dt>
  28601. <dd><p>The larger the distance from the central point, the darker the image becomes.
  28602. </p>
  28603. </dd>
  28604. <dt>&lsquo;<samp class="samp">backward</samp>&rsquo;</dt>
  28605. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  28606. This can be used to reverse a vignette effect, though there is no automatic
  28607. detection to extract the lens <samp class="option">angle</samp> and other settings (yet). It can
  28608. also be used to create a burning effect.
  28609. </p></dd>
  28610. </dl>
  28611. <p>Default value is &lsquo;<samp class="samp">forward</samp>&rsquo;.
  28612. </p>
  28613. </dd>
  28614. <dt><samp class="option">eval</samp></dt>
  28615. <dd><p>Set evaluation mode for the expressions (<samp class="option">angle</samp>, <samp class="option">x0</samp>, <samp class="option">y0</samp>).
  28616. </p>
  28617. <p>It accepts the following values:
  28618. </p><dl class="table">
  28619. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  28620. <dd><p>Evaluate expressions only once during the filter initialization.
  28621. </p>
  28622. </dd>
  28623. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  28624. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  28625. &lsquo;<samp class="samp">init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  28626. allows advanced dynamic expressions.
  28627. </p></dd>
  28628. </dl>
  28629. <p>Default value is &lsquo;<samp class="samp">init</samp>&rsquo;.
  28630. </p>
  28631. </dd>
  28632. <dt><samp class="option">dither</samp></dt>
  28633. <dd><p>Set dithering to reduce the circular banding effects. Default is <code class="code">1</code>
  28634. (enabled).
  28635. </p>
  28636. </dd>
  28637. <dt><samp class="option">aspect</samp></dt>
  28638. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  28639. Setting this value to the SAR of the input will make a rectangular vignetting
  28640. following the dimensions of the video.
  28641. </p>
  28642. <p>Default is <code class="code">1/1</code>.
  28643. </p></dd>
  28644. </dl>
  28645. <a name="Expressions"></a>
  28646. <h4 class="subsection">11.274.1 Expressions<span class="pull-right"><a class="anchor hidden-xs" href="#Expressions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Expressions" aria-hidden="true">TOC</a></span></h4>
  28647. <p>The <samp class="option">alpha</samp>, <samp class="option">x0</samp> and <samp class="option">y0</samp> expressions can contain the
  28648. following parameters.
  28649. </p>
  28650. <dl class="table">
  28651. <dt><samp class="option">w</samp></dt>
  28652. <dt><samp class="option">h</samp></dt>
  28653. <dd><p>input width and height
  28654. </p>
  28655. </dd>
  28656. <dt><samp class="option">n</samp></dt>
  28657. <dd><p>the number of input frame, starting from 0
  28658. </p>
  28659. </dd>
  28660. <dt><samp class="option">pts</samp></dt>
  28661. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  28662. <var class="var">TB</var> units, NAN if undefined
  28663. </p>
  28664. </dd>
  28665. <dt><samp class="option">r</samp></dt>
  28666. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  28667. </p>
  28668. </dd>
  28669. <dt><samp class="option">t</samp></dt>
  28670. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  28671. expressed in seconds, NAN if undefined
  28672. </p>
  28673. </dd>
  28674. <dt><samp class="option">tb</samp></dt>
  28675. <dd><p>time base of the input video
  28676. </p></dd>
  28677. </dl>
  28678. <a name="Examples-135"></a>
  28679. <h4 class="subsection">11.274.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-135" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-135" aria-hidden="true">TOC</a></span></h4>
  28680. <ul class="itemize mark-bullet">
  28681. <li>Apply simple strong vignetting effect:
  28682. <div class="example">
  28683. <pre class="example-preformatted">vignette=PI/4
  28684. </pre></div>
  28685. </li><li>Make a flickering vignetting:
  28686. <div class="example">
  28687. <pre class="example-preformatted">vignette='PI/4+random(1)*PI/50':eval=frame
  28688. </pre></div>
  28689. </li></ul>
  28690. <a name="vmafmotion"></a>
  28691. <h3 class="section">11.275 vmafmotion<span class="pull-right"><a class="anchor hidden-xs" href="#vmafmotion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vmafmotion" aria-hidden="true">TOC</a></span></h3>
  28692. <p>Obtain the average VMAF motion score of a video.
  28693. It is one of the component metrics of VMAF.
  28694. </p>
  28695. <p>The obtained average motion score is printed through the logging system.
  28696. </p>
  28697. <p>The filter accepts the following options:
  28698. </p>
  28699. <dl class="table">
  28700. <dt><samp class="option">stats_file</samp></dt>
  28701. <dd><p>If specified, the filter will use the named file to save the motion score of
  28702. each frame with respect to the previous frame.
  28703. When filename equals &quot;-&quot; the data is sent to standard output.
  28704. </p></dd>
  28705. </dl>
  28706. <p>Example:
  28707. </p><div class="example">
  28708. <pre class="example-preformatted">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  28709. </pre></div>
  28710. <a class="anchor" id="vpp_005famf"></a><a name="vpp_005famf-1"></a>
  28711. <h3 class="section">11.276 vpp_amf<span class="pull-right"><a class="anchor hidden-xs" href="#vpp_005famf-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vpp_005famf-1" aria-hidden="true">TOC</a></span></h3>
  28712. <p>Scale (resize) and convert colorspace, transfer characteristics or color primaries for the input video, using AMD Advanced Media Framework library for hardware acceleration.
  28713. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  28714. </p>
  28715. <p>The filter accepts the following options:
  28716. </p><dl class="table">
  28717. <dt><samp class="option">w</samp></dt>
  28718. <dt><samp class="option">h</samp></dt>
  28719. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  28720. </p>
  28721. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  28722. </p>
  28723. </dd>
  28724. <dt><samp class="option">scale_type</samp></dt>
  28725. <dd><p>Sets the algorithm used for scaling:
  28726. </p>
  28727. <dl class="table">
  28728. <dt><var class="var">bilinear</var></dt>
  28729. <dd><p>Bilinear
  28730. </p>
  28731. <p>This is the default.
  28732. </p>
  28733. </dd>
  28734. <dt><var class="var">bicubic</var></dt>
  28735. <dd><p>Bicubic
  28736. </p>
  28737. </dd>
  28738. </dl>
  28739. </dd>
  28740. <dt><samp class="option">format</samp></dt>
  28741. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  28742. pixel format is used.
  28743. </p>
  28744. </dd>
  28745. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  28746. <dt><samp class="option">force_divisible_by</samp></dt>
  28747. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  28748. </p>
  28749. </dd>
  28750. <dt><samp class="option">reset_sar</samp></dt>
  28751. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  28752. </p>
  28753. <a class="anchor" id="color_005fprofile"></a></dd>
  28754. <dt><samp class="option">color_profile</samp></dt>
  28755. <dd><p>Specify all color properties at once.
  28756. </p>
  28757. <p>The accepted values are:
  28758. </p><dl class="table">
  28759. <dt>&lsquo;<samp class="samp">bt601</samp>&rsquo;</dt>
  28760. <dd><p>BT.601
  28761. </p>
  28762. </dd>
  28763. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  28764. <dd><p>BT.709
  28765. </p>
  28766. </dd>
  28767. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  28768. <dd><p>BT.2020
  28769. </p>
  28770. </dd>
  28771. </dl>
  28772. </dd>
  28773. <dt><samp class="option">trc</samp></dt>
  28774. <dd><p>Specify output transfer characteristics.
  28775. </p>
  28776. <p>The accepted values are:
  28777. </p><dl class="table">
  28778. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  28779. <dd><p>BT.709
  28780. </p>
  28781. </dd>
  28782. <dt>&lsquo;<samp class="samp">gamma22</samp>&rsquo;</dt>
  28783. <dd><p>Constant gamma of 2.2
  28784. </p>
  28785. </dd>
  28786. <dt>&lsquo;<samp class="samp">gamma28</samp>&rsquo;</dt>
  28787. <dd><p>Constant gamma of 2.8
  28788. </p>
  28789. </dd>
  28790. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  28791. <dd><p>SMPTE-170M
  28792. </p>
  28793. </dd>
  28794. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  28795. <dd><p>SMPTE-240M
  28796. </p>
  28797. </dd>
  28798. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  28799. <dd><p>Linear
  28800. </p>
  28801. </dd>
  28802. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  28803. <dd><p>LOG
  28804. </p>
  28805. </dd>
  28806. <dt>&lsquo;<samp class="samp">log-sqrt</samp>&rsquo;</dt>
  28807. <dd><p>LOG_SQRT
  28808. </p>
  28809. </dd>
  28810. <dt>&lsquo;<samp class="samp">iec61966-2-4</samp>&rsquo;</dt>
  28811. <dd><p>iec61966-2-4
  28812. </p>
  28813. </dd>
  28814. <dt>&lsquo;<samp class="samp">bt1361-ecg</samp>&rsquo;</dt>
  28815. <dd><p>BT1361_ECG
  28816. </p>
  28817. </dd>
  28818. <dt>&lsquo;<samp class="samp">iec61966-2-1</samp>&rsquo;</dt>
  28819. <dd><p>iec61966-2-1
  28820. </p>
  28821. </dd>
  28822. <dt>&lsquo;<samp class="samp">bt2020-10</samp>&rsquo;</dt>
  28823. <dd><p>BT.2020 for 10-bits content
  28824. </p>
  28825. </dd>
  28826. <dt>&lsquo;<samp class="samp">bt2020-12</samp>&rsquo;</dt>
  28827. <dd><p>BT.2020 for 12-bits content
  28828. </p>
  28829. </dd>
  28830. <dt>&lsquo;<samp class="samp">smpte2084</samp>&rsquo;</dt>
  28831. <dd><p>SMPTE2084
  28832. </p>
  28833. </dd>
  28834. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  28835. <dd><p>SMPTE428
  28836. </p>
  28837. </dd>
  28838. <dt>&lsquo;<samp class="samp">arib-std-b67</samp>&rsquo;</dt>
  28839. <dd><p>ARIB_STD_B67
  28840. </p>
  28841. </dd>
  28842. </dl>
  28843. </dd>
  28844. <dt><samp class="option">primaries</samp></dt>
  28845. <dd><p>Specify output color primaries.
  28846. </p>
  28847. <p>The accepted values are:
  28848. </p><dl class="table">
  28849. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  28850. <dd><p>BT.709
  28851. </p>
  28852. </dd>
  28853. <dt>&lsquo;<samp class="samp">bt470m</samp>&rsquo;</dt>
  28854. <dd><p>BT.470M
  28855. </p>
  28856. </dd>
  28857. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  28858. <dd><p>BT.470BG or BT.601-6 625
  28859. </p>
  28860. </dd>
  28861. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  28862. <dd><p>SMPTE-170M or BT.601-6 525
  28863. </p>
  28864. </dd>
  28865. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  28866. <dd><p>SMPTE-240M
  28867. </p>
  28868. </dd>
  28869. <dt>&lsquo;<samp class="samp">film</samp>&rsquo;</dt>
  28870. <dd><p>film
  28871. </p>
  28872. </dd>
  28873. <dt>&lsquo;<samp class="samp">bt2020</samp>&rsquo;</dt>
  28874. <dd><p>BT.2020
  28875. </p>
  28876. </dd>
  28877. <dt>&lsquo;<samp class="samp">smpte428</samp>&rsquo;</dt>
  28878. <dd><p>SMPTE-428
  28879. </p>
  28880. </dd>
  28881. <dt>&lsquo;<samp class="samp">smpte431</samp>&rsquo;</dt>
  28882. <dd><p>SMPTE-431
  28883. </p>
  28884. </dd>
  28885. <dt>&lsquo;<samp class="samp">smpte432</samp>&rsquo;</dt>
  28886. <dd><p>SMPTE-432
  28887. </p>
  28888. </dd>
  28889. <dt>&lsquo;<samp class="samp">jedec-p22</samp>&rsquo;</dt>
  28890. <dd><p>JEDEC P22 phosphors
  28891. </p>
  28892. </dd>
  28893. </dl>
  28894. </dd>
  28895. </dl>
  28896. <a name="Examples-136"></a>
  28897. <h4 class="subsection">11.276.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-136" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-136" aria-hidden="true">TOC</a></span></h4>
  28898. <ul class="itemize mark-bullet">
  28899. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  28900. <div class="example">
  28901. <pre class="example-preformatted">vpp_amf=-2:720:format=yuv420p
  28902. </pre></div>
  28903. </li><li>Upscale to 4K and change color profile to bt2020.
  28904. <div class="example">
  28905. <pre class="example-preformatted">vpp_amf=4096:2160:color_profile=bt2020
  28906. </pre></div>
  28907. </li></ul>
  28908. <a class="anchor" id="vstack"></a><a name="vstack-1"></a>
  28909. <h3 class="section">11.277 vstack<span class="pull-right"><a class="anchor hidden-xs" href="#vstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack-1" aria-hidden="true">TOC</a></span></h3>
  28910. <p>Stack input videos vertically.
  28911. </p>
  28912. <p>All streams must be of same pixel format and of same width.
  28913. </p>
  28914. <p>Note that this filter is faster than using <a class="ref" href="#overlay">overlay</a> and <a class="ref" href="#pad">pad</a> filter
  28915. to create same output.
  28916. </p>
  28917. <p>The filter accepts the following options:
  28918. </p>
  28919. <dl class="table">
  28920. <dt><samp class="option">inputs</samp></dt>
  28921. <dd><p>Set number of input streams. Default is 2.
  28922. </p>
  28923. </dd>
  28924. <dt><samp class="option">shortest</samp></dt>
  28925. <dd><p>If set to 1, force the output to terminate when the shortest input
  28926. terminates. Default value is 0.
  28927. </p></dd>
  28928. </dl>
  28929. <a name="w3fdif"></a>
  28930. <h3 class="section">11.278 w3fdif<span class="pull-right"><a class="anchor hidden-xs" href="#w3fdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-w3fdif" aria-hidden="true">TOC</a></span></h3>
  28931. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  28932. Deinterlacing Filter&quot;).
  28933. </p>
  28934. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  28935. implemented based on the de-interlace algorithm written by Jim
  28936. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  28937. uses filter coefficients calculated by BBC R&amp;D.
  28938. </p>
  28939. <p>This filter uses field-dominance information in frame to decide which
  28940. of each pair of fields to place first in the output.
  28941. If it gets it wrong use <a class="ref" href="#setfield">setfield</a> filter before <code class="code">w3fdif</code> filter.
  28942. </p>
  28943. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  28944. and &quot;complex&quot;. Which set of filter coefficients is used can
  28945. be set by passing an optional parameter:
  28946. </p>
  28947. <dl class="table">
  28948. <dt><samp class="option">filter</samp></dt>
  28949. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  28950. </p>
  28951. <dl class="table">
  28952. <dt>&lsquo;<samp class="samp">simple</samp>&rsquo;</dt>
  28953. <dd><p>Simple filter coefficient set.
  28954. </p></dd>
  28955. <dt>&lsquo;<samp class="samp">complex</samp>&rsquo;</dt>
  28956. <dd><p>More-complex filter coefficient set.
  28957. </p></dd>
  28958. </dl>
  28959. <p>Default value is &lsquo;<samp class="samp">complex</samp>&rsquo;.
  28960. </p>
  28961. </dd>
  28962. <dt><samp class="option">mode</samp></dt>
  28963. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  28964. </p>
  28965. <dl class="table">
  28966. <dt><samp class="option">frame</samp></dt>
  28967. <dd><p>Output one frame for each frame.
  28968. </p></dd>
  28969. <dt><samp class="option">field</samp></dt>
  28970. <dd><p>Output one frame for each field.
  28971. </p></dd>
  28972. </dl>
  28973. <p>The default value is <code class="code">field</code>.
  28974. </p>
  28975. </dd>
  28976. <dt><samp class="option">parity</samp></dt>
  28977. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  28978. of the following values:
  28979. </p>
  28980. <dl class="table">
  28981. <dt><samp class="option">tff</samp></dt>
  28982. <dd><p>Assume the top field is first.
  28983. </p></dd>
  28984. <dt><samp class="option">bff</samp></dt>
  28985. <dd><p>Assume the bottom field is first.
  28986. </p></dd>
  28987. <dt><samp class="option">auto</samp></dt>
  28988. <dd><p>Enable automatic detection of field parity.
  28989. </p></dd>
  28990. </dl>
  28991. <p>The default value is <code class="code">auto</code>.
  28992. If the interlacing is unknown or the decoder does not export this information,
  28993. top field first will be assumed.
  28994. </p>
  28995. </dd>
  28996. <dt><samp class="option">deint</samp></dt>
  28997. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  28998. </p>
  28999. <dl class="table">
  29000. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  29001. <dd><p>Deinterlace all frames,
  29002. </p></dd>
  29003. <dt>&lsquo;<samp class="samp">interlaced</samp>&rsquo;</dt>
  29004. <dd><p>Only deinterlace frames marked as interlaced.
  29005. </p></dd>
  29006. </dl>
  29007. <p>Default value is &lsquo;<samp class="samp">all</samp>&rsquo;.
  29008. </p></dd>
  29009. </dl>
  29010. <a name="Commands-152"></a>
  29011. <h4 class="subsection">11.278.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-152" aria-hidden="true">TOC</a></span></h4>
  29012. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  29013. </p>
  29014. <a name="waveform"></a>
  29015. <h3 class="section">11.279 waveform<span class="pull-right"><a class="anchor hidden-xs" href="#waveform" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-waveform" aria-hidden="true">TOC</a></span></h3>
  29016. <p>Video waveform monitor.
  29017. </p>
  29018. <p>The waveform monitor plots color component intensity. By default luma
  29019. only. Each column of the waveform corresponds to a column of pixels in the
  29020. source video.
  29021. </p>
  29022. <p>It accepts the following options:
  29023. </p>
  29024. <dl class="table">
  29025. <dt><samp class="option">mode, m</samp></dt>
  29026. <dd><p>Can be either <code class="code">row</code>, or <code class="code">column</code>. Default is <code class="code">column</code>.
  29027. In row mode, the graph on the left side represents color component value 0 and
  29028. the right side represents value = 255. In column mode, the top side represents
  29029. color component value = 0 and bottom side represents value = 255.
  29030. </p>
  29031. </dd>
  29032. <dt><samp class="option">intensity, i</samp></dt>
  29033. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  29034. luminance are distributed across input rows/columns.
  29035. Default value is <code class="code">0.04</code>. Allowed range is [0, 1].
  29036. </p>
  29037. </dd>
  29038. <dt><samp class="option">mirror, r</samp></dt>
  29039. <dd><p>Set mirroring mode. <code class="code">0</code> means unmirrored, <code class="code">1</code> means mirrored.
  29040. In mirrored mode, higher values will be represented on the left
  29041. side for <code class="code">row</code> mode and at the top for <code class="code">column</code> mode. Default is
  29042. <code class="code">1</code> (mirrored).
  29043. </p>
  29044. </dd>
  29045. <dt><samp class="option">display, d</samp></dt>
  29046. <dd><p>Set display mode.
  29047. It accepts the following values:
  29048. </p><dl class="table">
  29049. <dt>&lsquo;<samp class="samp">overlay</samp>&rsquo;</dt>
  29050. <dd><p>Presents information identical to that in the <code class="code">parade</code>, except
  29051. that the graphs representing color components are superimposed directly
  29052. over one another.
  29053. </p>
  29054. <p>This display mode makes it easier to spot relative differences or similarities
  29055. in overlapping areas of the color components that are supposed to be identical,
  29056. such as neutral whites, grays, or blacks.
  29057. </p>
  29058. </dd>
  29059. <dt>&lsquo;<samp class="samp">stack</samp>&rsquo;</dt>
  29060. <dd><p>Display separate graph for the color components side by side in
  29061. <code class="code">row</code> mode or one below the other in <code class="code">column</code> mode.
  29062. </p>
  29063. </dd>
  29064. <dt>&lsquo;<samp class="samp">parade</samp>&rsquo;</dt>
  29065. <dd><p>Display separate graph for the color components side by side in
  29066. <code class="code">column</code> mode or one below the other in <code class="code">row</code> mode.
  29067. </p>
  29068. <p>Using this display mode makes it easy to spot color casts in the highlights
  29069. and shadows of an image, by comparing the contours of the top and the bottom
  29070. graphs of each waveform. Since whites, grays, and blacks are characterized
  29071. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  29072. should display three waveforms of roughly equal width/height. If not, the
  29073. correction is easy to perform by making level adjustments the three waveforms.
  29074. </p></dd>
  29075. </dl>
  29076. <p>Default is <code class="code">stack</code>.
  29077. </p>
  29078. </dd>
  29079. <dt><samp class="option">components, c</samp></dt>
  29080. <dd><p>Set which color components to display. Default is 1, which means only luma
  29081. or red color component if input is in RGB colorspace. If is set for example to
  29082. 7 it will display all 3 (if) available color components.
  29083. </p>
  29084. </dd>
  29085. <dt><samp class="option">envelope, e</samp></dt>
  29086. <dd><dl class="table">
  29087. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  29088. <dd><p>No envelope, this is default.
  29089. </p>
  29090. </dd>
  29091. <dt>&lsquo;<samp class="samp">instant</samp>&rsquo;</dt>
  29092. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  29093. visible even with small <code class="code">step</code> value.
  29094. </p>
  29095. </dd>
  29096. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  29097. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  29098. can still spot out of range values without constantly looking at waveforms.
  29099. </p>
  29100. </dd>
  29101. <dt>&lsquo;<samp class="samp">peak+instant</samp>&rsquo;</dt>
  29102. <dd><p>Peak and instant envelope combined together.
  29103. </p></dd>
  29104. </dl>
  29105. </dd>
  29106. <dt><samp class="option">filter, f</samp></dt>
  29107. <dd><dl class="table">
  29108. <dt>&lsquo;<samp class="samp">lowpass</samp>&rsquo;</dt>
  29109. <dd><p>No filtering, this is default.
  29110. </p>
  29111. </dd>
  29112. <dt>&lsquo;<samp class="samp">flat</samp>&rsquo;</dt>
  29113. <dd><p>Luma and chroma combined together.
  29114. </p>
  29115. </dd>
  29116. <dt>&lsquo;<samp class="samp">aflat</samp>&rsquo;</dt>
  29117. <dd><p>Similar as above, but shows difference between blue and red chroma.
  29118. </p>
  29119. </dd>
  29120. <dt>&lsquo;<samp class="samp">xflat</samp>&rsquo;</dt>
  29121. <dd><p>Similar as above, but use different colors.
  29122. </p>
  29123. </dd>
  29124. <dt>&lsquo;<samp class="samp">yflat</samp>&rsquo;</dt>
  29125. <dd><p>Similar as above, but again with different colors.
  29126. </p>
  29127. </dd>
  29128. <dt>&lsquo;<samp class="samp">chroma</samp>&rsquo;</dt>
  29129. <dd><p>Displays only chroma.
  29130. </p>
  29131. </dd>
  29132. <dt>&lsquo;<samp class="samp">color</samp>&rsquo;</dt>
  29133. <dd><p>Displays actual color value on waveform.
  29134. </p>
  29135. </dd>
  29136. <dt>&lsquo;<samp class="samp">acolor</samp>&rsquo;</dt>
  29137. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  29138. </p></dd>
  29139. </dl>
  29140. </dd>
  29141. <dt><samp class="option">graticule, g</samp></dt>
  29142. <dd><p>Set which graticule to display.
  29143. </p>
  29144. <dl class="table">
  29145. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  29146. <dd><p>Do not display graticule.
  29147. </p>
  29148. </dd>
  29149. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  29150. <dd><p>Display green graticule showing legal broadcast ranges.
  29151. </p>
  29152. </dd>
  29153. <dt>&lsquo;<samp class="samp">orange</samp>&rsquo;</dt>
  29154. <dd><p>Display orange graticule showing legal broadcast ranges.
  29155. </p>
  29156. </dd>
  29157. <dt>&lsquo;<samp class="samp">invert</samp>&rsquo;</dt>
  29158. <dd><p>Display invert graticule showing legal broadcast ranges.
  29159. </p></dd>
  29160. </dl>
  29161. </dd>
  29162. <dt><samp class="option">opacity, o</samp></dt>
  29163. <dd><p>Set graticule opacity.
  29164. </p>
  29165. </dd>
  29166. <dt><samp class="option">flags, fl</samp></dt>
  29167. <dd><p>Set graticule flags.
  29168. </p>
  29169. <dl class="table">
  29170. <dt>&lsquo;<samp class="samp">numbers</samp>&rsquo;</dt>
  29171. <dd><p>Draw numbers above lines. By default enabled.
  29172. </p>
  29173. </dd>
  29174. <dt>&lsquo;<samp class="samp">dots</samp>&rsquo;</dt>
  29175. <dd><p>Draw dots instead of lines.
  29176. </p></dd>
  29177. </dl>
  29178. </dd>
  29179. <dt><samp class="option">scale, s</samp></dt>
  29180. <dd><p>Set scale used for displaying graticule.
  29181. </p>
  29182. <dl class="table">
  29183. <dt>&lsquo;<samp class="samp">digital</samp>&rsquo;</dt>
  29184. <dt>&lsquo;<samp class="samp">millivolts</samp>&rsquo;</dt>
  29185. <dt>&lsquo;<samp class="samp">ire</samp>&rsquo;</dt>
  29186. </dl>
  29187. <p>Default is digital.
  29188. </p>
  29189. </dd>
  29190. <dt><samp class="option">bgopacity, b</samp></dt>
  29191. <dd><p>Set background opacity.
  29192. </p>
  29193. </dd>
  29194. <dt><samp class="option">tint0, t0</samp></dt>
  29195. <dt><samp class="option">tint1, t1</samp></dt>
  29196. <dd><p>Set tint for output.
  29197. Only used with lowpass filter and when display is not overlay and input
  29198. pixel formats are not RGB.
  29199. </p>
  29200. </dd>
  29201. <dt><samp class="option">fitmode, fm</samp></dt>
  29202. <dd><p>Set sample aspect ratio of video output frames.
  29203. Can be used to configure waveform so it is not
  29204. stretched too much in one of directions.
  29205. </p>
  29206. <dl class="table">
  29207. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  29208. <dd><p>Set sample aspect ration to 1/1.
  29209. </p></dd>
  29210. <dt>&lsquo;<samp class="samp">size</samp>&rsquo;</dt>
  29211. <dd><p>Set sample aspect ratio to match input size of video
  29212. </p></dd>
  29213. </dl>
  29214. <p>Default is &lsquo;<samp class="samp">none</samp>&rsquo;.
  29215. </p>
  29216. </dd>
  29217. <dt><samp class="option">input</samp></dt>
  29218. <dd><p>Set input formats for filter to pick from.
  29219. Can be &lsquo;<samp class="samp">all</samp>&rsquo;, for selecting from all available formats,
  29220. or &lsquo;<samp class="samp">first</samp>&rsquo;, for selecting first available format.
  29221. Default is &lsquo;<samp class="samp">first</samp>&rsquo;.
  29222. </p></dd>
  29223. </dl>
  29224. <a name="weave_002c-doubleweave"></a>
  29225. <h3 class="section">11.280 weave, doubleweave<span class="pull-right"><a class="anchor hidden-xs" href="#weave_002c-doubleweave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-weave_002c-doubleweave" aria-hidden="true">TOC</a></span></h3>
  29226. <p>The <code class="code">weave</code> takes a field-based video input and join
  29227. each two sequential fields into single frame, producing a new double
  29228. height clip with half the frame rate and half the frame count.
  29229. </p>
  29230. <p>The <code class="code">doubleweave</code> works same as <code class="code">weave</code> but without
  29231. halving frame rate and frame count.
  29232. </p>
  29233. <p>It accepts the following option:
  29234. </p>
  29235. <dl class="table">
  29236. <dt><samp class="option">first_field</samp></dt>
  29237. <dd><p>Set first field. Available values are:
  29238. </p>
  29239. <dl class="table">
  29240. <dt>&lsquo;<samp class="samp">top, t</samp>&rsquo;</dt>
  29241. <dd><p>Set the frame as top-field-first.
  29242. </p>
  29243. </dd>
  29244. <dt>&lsquo;<samp class="samp">bottom, b</samp>&rsquo;</dt>
  29245. <dd><p>Set the frame as bottom-field-first.
  29246. </p></dd>
  29247. </dl>
  29248. </dd>
  29249. </dl>
  29250. <a name="Examples-137"></a>
  29251. <h4 class="subsection">11.280.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-137" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-137" aria-hidden="true">TOC</a></span></h4>
  29252. <ul class="itemize mark-bullet">
  29253. <li>Interlace video using <a class="ref" href="#select">select</a> and <a class="ref" href="#separatefields">separatefields</a> filter:
  29254. <div class="example">
  29255. <pre class="example-preformatted">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  29256. </pre></div>
  29257. </li></ul>
  29258. <a name="xbr"></a>
  29259. <h3 class="section">11.281 xbr<span class="pull-right"><a class="anchor hidden-xs" href="#xbr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xbr" aria-hidden="true">TOC</a></span></h3>
  29260. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  29261. art. It follows a set of edge-detection rules, see
  29262. <a class="url" href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  29263. </p>
  29264. <p>It accepts the following option:
  29265. </p>
  29266. <dl class="table">
  29267. <dt><samp class="option">n</samp></dt>
  29268. <dd><p>Set the scaling dimension: <code class="code">2</code> for <code class="code">2xBR</code>, <code class="code">3</code> for
  29269. <code class="code">3xBR</code> and <code class="code">4</code> for <code class="code">4xBR</code>.
  29270. Default is <code class="code">3</code>.
  29271. </p></dd>
  29272. </dl>
  29273. <a name="xcorrelate"></a>
  29274. <h3 class="section">11.282 xcorrelate<span class="pull-right"><a class="anchor hidden-xs" href="#xcorrelate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xcorrelate" aria-hidden="true">TOC</a></span></h3>
  29275. <p>Apply normalized cross-correlation between first and second input video stream.
  29276. </p>
  29277. <p>Second input video stream dimensions must be lower than first input video stream.
  29278. </p>
  29279. <p>The filter accepts the following options:
  29280. </p>
  29281. <dl class="table">
  29282. <dt><samp class="option">planes</samp></dt>
  29283. <dd><p>Set which planes to process.
  29284. </p>
  29285. </dd>
  29286. <dt><samp class="option">secondary</samp></dt>
  29287. <dd><p>Set which secondary video frames will be processed from second input video stream,
  29288. can be <var class="var">first</var> or <var class="var">all</var>. Default is <var class="var">all</var>.
  29289. </p></dd>
  29290. </dl>
  29291. <p>The <code class="code">xcorrelate</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  29292. </p>
  29293. <a name="xfade"></a>
  29294. <h3 class="section">11.283 xfade<span class="pull-right"><a class="anchor hidden-xs" href="#xfade" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade" aria-hidden="true">TOC</a></span></h3>
  29295. <p>Apply cross fade from one input video stream to another input video stream.
  29296. The cross fade is applied for specified duration.
  29297. </p>
  29298. <p>Both inputs must be constant frame-rate and have the same resolution, pixel format,
  29299. frame rate and timebase.
  29300. </p>
  29301. <p>The filter accepts the following options:
  29302. </p>
  29303. <dl class="table">
  29304. <dt><samp class="option">transition</samp></dt>
  29305. <dd><p>Set one of available transition effects:
  29306. </p>
  29307. <dl class="table">
  29308. <dt>&lsquo;<samp class="samp">custom</samp>&rsquo;</dt>
  29309. <dt>&lsquo;<samp class="samp">fade</samp>&rsquo;</dt>
  29310. <dt>&lsquo;<samp class="samp">wipeleft</samp>&rsquo;</dt>
  29311. <dt>&lsquo;<samp class="samp">wiperight</samp>&rsquo;</dt>
  29312. <dt>&lsquo;<samp class="samp">wipeup</samp>&rsquo;</dt>
  29313. <dt>&lsquo;<samp class="samp">wipedown</samp>&rsquo;</dt>
  29314. <dt>&lsquo;<samp class="samp">slideleft</samp>&rsquo;</dt>
  29315. <dt>&lsquo;<samp class="samp">slideright</samp>&rsquo;</dt>
  29316. <dt>&lsquo;<samp class="samp">slideup</samp>&rsquo;</dt>
  29317. <dt>&lsquo;<samp class="samp">slidedown</samp>&rsquo;</dt>
  29318. <dt>&lsquo;<samp class="samp">circlecrop</samp>&rsquo;</dt>
  29319. <dt>&lsquo;<samp class="samp">rectcrop</samp>&rsquo;</dt>
  29320. <dt>&lsquo;<samp class="samp">distance</samp>&rsquo;</dt>
  29321. <dt>&lsquo;<samp class="samp">fadeblack</samp>&rsquo;</dt>
  29322. <dt>&lsquo;<samp class="samp">fadewhite</samp>&rsquo;</dt>
  29323. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  29324. <dt>&lsquo;<samp class="samp">smoothleft</samp>&rsquo;</dt>
  29325. <dt>&lsquo;<samp class="samp">smoothright</samp>&rsquo;</dt>
  29326. <dt>&lsquo;<samp class="samp">smoothup</samp>&rsquo;</dt>
  29327. <dt>&lsquo;<samp class="samp">smoothdown</samp>&rsquo;</dt>
  29328. <dt>&lsquo;<samp class="samp">circleopen</samp>&rsquo;</dt>
  29329. <dt>&lsquo;<samp class="samp">circleclose</samp>&rsquo;</dt>
  29330. <dt>&lsquo;<samp class="samp">vertopen</samp>&rsquo;</dt>
  29331. <dt>&lsquo;<samp class="samp">vertclose</samp>&rsquo;</dt>
  29332. <dt>&lsquo;<samp class="samp">horzopen</samp>&rsquo;</dt>
  29333. <dt>&lsquo;<samp class="samp">horzclose</samp>&rsquo;</dt>
  29334. <dt>&lsquo;<samp class="samp">dissolve</samp>&rsquo;</dt>
  29335. <dt>&lsquo;<samp class="samp">pixelize</samp>&rsquo;</dt>
  29336. <dt>&lsquo;<samp class="samp">diagtl</samp>&rsquo;</dt>
  29337. <dt>&lsquo;<samp class="samp">diagtr</samp>&rsquo;</dt>
  29338. <dt>&lsquo;<samp class="samp">diagbl</samp>&rsquo;</dt>
  29339. <dt>&lsquo;<samp class="samp">diagbr</samp>&rsquo;</dt>
  29340. <dt>&lsquo;<samp class="samp">hlslice</samp>&rsquo;</dt>
  29341. <dt>&lsquo;<samp class="samp">hrslice</samp>&rsquo;</dt>
  29342. <dt>&lsquo;<samp class="samp">vuslice</samp>&rsquo;</dt>
  29343. <dt>&lsquo;<samp class="samp">vdslice</samp>&rsquo;</dt>
  29344. <dt>&lsquo;<samp class="samp">hblur</samp>&rsquo;</dt>
  29345. <dt>&lsquo;<samp class="samp">fadegrays</samp>&rsquo;</dt>
  29346. <dt>&lsquo;<samp class="samp">wipetl</samp>&rsquo;</dt>
  29347. <dt>&lsquo;<samp class="samp">wipetr</samp>&rsquo;</dt>
  29348. <dt>&lsquo;<samp class="samp">wipebl</samp>&rsquo;</dt>
  29349. <dt>&lsquo;<samp class="samp">wipebr</samp>&rsquo;</dt>
  29350. <dt>&lsquo;<samp class="samp">squeezeh</samp>&rsquo;</dt>
  29351. <dt>&lsquo;<samp class="samp">squeezev</samp>&rsquo;</dt>
  29352. <dt>&lsquo;<samp class="samp">zoomin</samp>&rsquo;</dt>
  29353. <dt>&lsquo;<samp class="samp">fadefast</samp>&rsquo;</dt>
  29354. <dt>&lsquo;<samp class="samp">fadeslow</samp>&rsquo;</dt>
  29355. <dt>&lsquo;<samp class="samp">hlwind</samp>&rsquo;</dt>
  29356. <dt>&lsquo;<samp class="samp">hrwind</samp>&rsquo;</dt>
  29357. <dt>&lsquo;<samp class="samp">vuwind</samp>&rsquo;</dt>
  29358. <dt>&lsquo;<samp class="samp">vdwind</samp>&rsquo;</dt>
  29359. <dt>&lsquo;<samp class="samp">coverleft</samp>&rsquo;</dt>
  29360. <dt>&lsquo;<samp class="samp">coverright</samp>&rsquo;</dt>
  29361. <dt>&lsquo;<samp class="samp">coverup</samp>&rsquo;</dt>
  29362. <dt>&lsquo;<samp class="samp">coverdown</samp>&rsquo;</dt>
  29363. <dt>&lsquo;<samp class="samp">revealleft</samp>&rsquo;</dt>
  29364. <dt>&lsquo;<samp class="samp">revealright</samp>&rsquo;</dt>
  29365. <dt>&lsquo;<samp class="samp">revealup</samp>&rsquo;</dt>
  29366. <dt>&lsquo;<samp class="samp">revealdown</samp>&rsquo;</dt>
  29367. </dl>
  29368. <p>Default transition effect is fade.
  29369. </p>
  29370. </dd>
  29371. <dt><samp class="option">duration</samp></dt>
  29372. <dd><p>Set cross fade duration in seconds.
  29373. Range is 0 to 60 seconds.
  29374. Default duration is 1 second.
  29375. </p>
  29376. </dd>
  29377. <dt><samp class="option">offset</samp></dt>
  29378. <dd><p>Set cross fade start relative to first input stream in seconds.
  29379. Default offset is 0.
  29380. </p>
  29381. </dd>
  29382. <dt><samp class="option">expr</samp></dt>
  29383. <dd><p>Set expression for custom transition effect.
  29384. </p>
  29385. <p>The expressions can use the following variables and functions:
  29386. </p>
  29387. <dl class="table">
  29388. <dt><samp class="option">X</samp></dt>
  29389. <dt><samp class="option">Y</samp></dt>
  29390. <dd><p>The coordinates of the current sample.
  29391. </p>
  29392. </dd>
  29393. <dt><samp class="option">W</samp></dt>
  29394. <dt><samp class="option">H</samp></dt>
  29395. <dd><p>The width and height of the image.
  29396. </p>
  29397. </dd>
  29398. <dt><samp class="option">P</samp></dt>
  29399. <dd><p>Progress of transition effect.
  29400. </p>
  29401. </dd>
  29402. <dt><samp class="option">PLANE</samp></dt>
  29403. <dd><p>Currently processed plane.
  29404. </p>
  29405. </dd>
  29406. <dt><samp class="option">A</samp></dt>
  29407. <dd><p>Return value of first input at current location and plane.
  29408. </p>
  29409. </dd>
  29410. <dt><samp class="option">B</samp></dt>
  29411. <dd><p>Return value of second input at current location and plane.
  29412. </p>
  29413. </dd>
  29414. <dt><samp class="option">a0(x, y)</samp></dt>
  29415. <dt><samp class="option">a1(x, y)</samp></dt>
  29416. <dt><samp class="option">a2(x, y)</samp></dt>
  29417. <dt><samp class="option">a3(x, y)</samp></dt>
  29418. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  29419. first/second/third/fourth component of first input.
  29420. </p>
  29421. </dd>
  29422. <dt><samp class="option">b0(x, y)</samp></dt>
  29423. <dt><samp class="option">b1(x, y)</samp></dt>
  29424. <dt><samp class="option">b2(x, y)</samp></dt>
  29425. <dt><samp class="option">b3(x, y)</samp></dt>
  29426. <dd><p>Return the value of the pixel at location (<var class="var">x</var>,<var class="var">y</var>) of the
  29427. first/second/third/fourth component of second input.
  29428. </p></dd>
  29429. </dl>
  29430. </dd>
  29431. </dl>
  29432. <a name="Examples-138"></a>
  29433. <h4 class="subsection">11.283.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-138" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-138" aria-hidden="true">TOC</a></span></h4>
  29434. <ul class="itemize mark-bullet">
  29435. <li>Cross fade from one input video to another input video, with fade transition and duration of transition
  29436. of 2 seconds starting at offset of 5 seconds:
  29437. <div class="example">
  29438. <pre class="example-preformatted">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  29439. </pre></div>
  29440. </li></ul>
  29441. <a name="xmedian"></a>
  29442. <h3 class="section">11.284 xmedian<span class="pull-right"><a class="anchor hidden-xs" href="#xmedian" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xmedian" aria-hidden="true">TOC</a></span></h3>
  29443. <p>Pick median pixels from several input videos.
  29444. </p>
  29445. <p>The filter accepts the following options:
  29446. </p>
  29447. <dl class="table">
  29448. <dt><samp class="option">inputs</samp></dt>
  29449. <dd><p>Set number of inputs.
  29450. Default is 3. Allowed range is from 3 to 255.
  29451. If number of inputs is even number, than result will be mean value between two median values.
  29452. </p>
  29453. </dd>
  29454. <dt><samp class="option">planes</samp></dt>
  29455. <dd><p>Set which planes to filter. Default value is <code class="code">15</code>, by which all planes are processed.
  29456. </p>
  29457. </dd>
  29458. <dt><samp class="option">percentile</samp></dt>
  29459. <dd><p>Set median percentile. Default value is <code class="code">0.5</code>.
  29460. Default value of <code class="code">0.5</code> will pick always median values, while <code class="code">0</code> will pick
  29461. minimum values, and <code class="code">1</code> maximum values.
  29462. </p></dd>
  29463. </dl>
  29464. <a name="Commands-153"></a>
  29465. <h4 class="subsection">11.284.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-153" aria-hidden="true">TOC</a></span></h4>
  29466. <p>This filter supports all above options as <a class="ref" href="#commands">commands</a>, excluding option <code class="code">inputs</code>.
  29467. </p>
  29468. <a class="anchor" id="xpsnr"></a><a name="xpsnr-1"></a>
  29469. <h3 class="section">11.285 xpsnr<span class="pull-right"><a class="anchor hidden-xs" href="#xpsnr-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xpsnr-1" aria-hidden="true">TOC</a></span></h3>
  29470. <p>Obtain the average (across all input frames) and minimum (across all color plane averages)
  29471. eXtended Perceptually weighted peak Signal-to-Noise Ratio (XPSNR) between two input videos.
  29472. </p>
  29473. <p>The XPSNR is a low-complexity psychovisually motivated distortion measurement algorithm for
  29474. assessing the difference between two video streams or images. This is especially useful for
  29475. objectively quantifying the distortions caused by video and image codecs, as an alternative
  29476. to a formal subjective test. The logarithmic XPSNR output values are in a similar range as
  29477. those of traditional <a class="ref" href="#psnr">psnr</a> assessments but better reflect human impressions of visual
  29478. coding quality. More details on the XPSNR measure, which essentially represents a blockwise
  29479. weighted variant of the PSNR measure, can be found in the following freely available papers:
  29480. </p>
  29481. <ul class="itemize mark-bullet">
  29482. <li>C. R. Helmrich, M. Siekmann, S. Becker, S. Bosse, D. Marpe, and T. Wiegand, &quot;XPSNR: A
  29483. Low-Complexity Extension of the Perceptually Weighted Peak Signal-to-Noise Ratio for
  29484. High-Resolution Video Quality Assessment,&quot; in Proc. IEEE Int. Conf. Acoustics, Speech,
  29485. Sig. Process. (ICASSP), virt./online, May 2020. <a class="url" href="www.ecodis.de/xpsnr.htm">www.ecodis.de/xpsnr.htm</a>
  29486. </li><li>C. R. Helmrich, S. Bosse, H. Schwarz, D. Marpe, and T. Wiegand, &quot;A Study of the
  29487. Extended Perceptually Weighted Peak Signal-to-Noise Ratio (XPSNR) for Video Compression
  29488. with Different Resolutions and Bit Depths,&quot; ITU Journal: ICT Discoveries, vol. 3, no.
  29489. 1, pp. 65 - 72, May 2020. <a class="url" href="http://handle.itu.int/11.1002/pub/8153d78b-en">http://handle.itu.int/11.1002/pub/8153d78b-en</a>
  29490. </li></ul>
  29491. <p>When publishing the results of XPSNR assessments obtained using, e.g., this FFmpeg filter, a
  29492. reference to the above papers as a means of documentation is strongly encouraged. The filter
  29493. requires two input videos. The first input is considered a (usually not distorted) reference
  29494. source and is passed unchanged to the output, whereas the second input is a (distorted) test
  29495. signal. Except for the bit depth, these two video inputs must have the same pixel format. In
  29496. addition, for best performance, both compared input videos should be in YCbCr color format.
  29497. </p>
  29498. <p>The obtained overall XPSNR values mentioned above are printed through the logging system. In
  29499. case of input with multiple color planes, we suggest reporting of the minimum XPSNR average.
  29500. </p>
  29501. <p>The following parameter, which behaves like the one for the <a class="ref" href="#psnr">psnr</a> filter, is accepted:
  29502. </p>
  29503. <dl class="table">
  29504. <dt><samp class="option">stats_file, f</samp></dt>
  29505. <dd><p>If specified, the filter will use the named file to save the XPSNR value of each individual
  29506. frame and color plane. When the file name equals &quot;-&quot;, that data is sent to standard output.
  29507. </p></dd>
  29508. </dl>
  29509. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  29510. </p>
  29511. <a name="Examples-139"></a>
  29512. <h4 class="subsection">11.285.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-139" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-139" aria-hidden="true">TOC</a></span></h4>
  29513. <ul class="itemize mark-bullet">
  29514. <li>XPSNR analysis of two 1080p HD videos, ref_source.yuv and test_video.yuv, both at 24 frames
  29515. per second, with color format 4:2:0, bit depth 8, and output of a logfile named &quot;xpsnr.log&quot;:
  29516. <div class="example">
  29517. <pre class="example-preformatted">ffmpeg -s 1920x1080 -framerate 24 -pix_fmt yuv420p -i ref_source.yuv -s 1920x1080 -framerate
  29518. 24 -pix_fmt yuv420p -i test_video.yuv -lavfi xpsnr=&quot;stats_file=xpsnr.log&quot; -f null -
  29519. </pre></div>
  29520. </li><li>XPSNR analysis of two 2160p UHD videos, ref_source.yuv with bit depth 8 and test_video.yuv
  29521. with bit depth 10, both at 60 frames per second with color format 4:2:0, no logfile output:
  29522. <div class="example">
  29523. <pre class="example-preformatted">ffmpeg -s 3840x2160 -framerate 60 -pix_fmt yuv420p -i ref_source.yuv -s 3840x2160 -framerate
  29524. 60 -pix_fmt yuv420p10le -i test_video.yuv -lavfi xpsnr=&quot;stats_file=-&quot; -f null -
  29525. </pre></div>
  29526. </li></ul>
  29527. <a class="anchor" id="xstack"></a><a name="xstack-1"></a>
  29528. <h3 class="section">11.286 xstack<span class="pull-right"><a class="anchor hidden-xs" href="#xstack-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack-1" aria-hidden="true">TOC</a></span></h3>
  29529. <p>Stack video inputs into custom layout.
  29530. </p>
  29531. <p>All streams must be of same pixel format.
  29532. </p>
  29533. <p>The filter accepts the following options:
  29534. </p>
  29535. <dl class="table">
  29536. <dt><samp class="option">inputs</samp></dt>
  29537. <dd><p>Set number of input streams. Default is 2.
  29538. </p>
  29539. </dd>
  29540. <dt><samp class="option">layout</samp></dt>
  29541. <dd><p>Specify layout of inputs.
  29542. This option requires the desired layout configuration to be explicitly set by the user.
  29543. This sets position of each video input in output. Each input
  29544. is separated by &rsquo;|&rsquo;.
  29545. The first number represents the column, and the second number represents the row.
  29546. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  29547. where X is video input from which to take width or height.
  29548. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  29549. case values are summed together.
  29550. </p>
  29551. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  29552. the output video frame will be filled. Similarly, videos can overlap each
  29553. other if their position doesn&rsquo;t leave enough space for the full frame of
  29554. adjoining videos.
  29555. </p>
  29556. <p>For 2 inputs, a default layout of <code class="code">0_0|w0_0</code> (equivalent to
  29557. <code class="code">grid=2x1</code>) is set. In all other cases, a layout or a grid must be set by
  29558. the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  29559. Specifying both will result in an error.
  29560. </p>
  29561. </dd>
  29562. <dt><samp class="option">grid</samp></dt>
  29563. <dd><p>Specify a fixed size grid of inputs.
  29564. This option is used to create a fixed size grid of the input streams. Set the
  29565. grid size in the form <code class="code">COLUMNSxROWS</code>. There must be <code class="code">ROWS * COLUMNS</code>
  29566. input streams and they will be arranged as a grid with <code class="code">ROWS</code> rows and
  29567. <code class="code">COLUMNS</code> columns. When using this option, each input stream within a row
  29568. must have the same height and all the rows must have the same width.
  29569. </p>
  29570. <p>If <code class="code">grid</code> is set, then <code class="code">inputs</code> option is ignored and is implicitly
  29571. set to <code class="code">ROWS * COLUMNS</code>.
  29572. </p>
  29573. <p>For 2 inputs, a default grid of <code class="code">2x1</code> (equivalent to
  29574. <code class="code">layout=0_0|w0_0</code>) is set. In all other cases, a layout or a grid must be
  29575. set by the user. Either <code class="code">grid</code> or <code class="code">layout</code> can be specified at a time.
  29576. Specifying both will result in an error.
  29577. </p>
  29578. </dd>
  29579. <dt><samp class="option">shortest</samp></dt>
  29580. <dd><p>If set to 1, force the output to terminate when the shortest input
  29581. terminates. Default value is 0.
  29582. </p>
  29583. </dd>
  29584. <dt><samp class="option">fill</samp></dt>
  29585. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  29586. By default fill is set to none, so it is disabled.
  29587. </p></dd>
  29588. </dl>
  29589. <a name="Examples-140"></a>
  29590. <h4 class="subsection">11.286.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-140" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-140" aria-hidden="true">TOC</a></span></h4>
  29591. <ul class="itemize mark-bullet">
  29592. <li>Display 4 inputs into 2x2 grid.
  29593. <p>Layout:
  29594. </p><div class="example">
  29595. <pre class="example-preformatted">input1(0, 0) | input3(w0, 0)
  29596. input2(0, h0) | input4(w0, h0)
  29597. </pre></div>
  29598. <div class="example">
  29599. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  29600. </pre></div>
  29601. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  29602. </p>
  29603. </li><li>Display 4 inputs into 1x4 grid.
  29604. <p>Layout:
  29605. </p><div class="example">
  29606. <pre class="example-preformatted">input1(0, 0)
  29607. input2(0, h0)
  29608. input3(0, h0+h1)
  29609. input4(0, h0+h1+h2)
  29610. </pre></div>
  29611. <div class="example">
  29612. <pre class="example-preformatted">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  29613. </pre></div>
  29614. <p>Note that if inputs are of different widths, unused space will appear.
  29615. </p>
  29616. </li><li>Display 9 inputs into 3x3 grid.
  29617. <p>Layout:
  29618. </p><div class="example">
  29619. <pre class="example-preformatted">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  29620. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  29621. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  29622. </pre></div>
  29623. <div class="example">
  29624. <pre class="example-preformatted">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
  29625. </pre></div>
  29626. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  29627. </p>
  29628. </li><li>Display 16 inputs into 4x4 grid.
  29629. <p>Layout:
  29630. </p><div class="example">
  29631. <pre class="example-preformatted">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  29632. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  29633. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  29634. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  29635. </pre></div>
  29636. <div class="example">
  29637. <pre class="example-preformatted">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|
  29638. 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
  29639. </pre></div>
  29640. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  29641. </p>
  29642. </li></ul>
  29643. <a class="anchor" id="yadif"></a><a name="yadif-1"></a>
  29644. <h3 class="section">11.287 yadif<span class="pull-right"><a class="anchor hidden-xs" href="#yadif-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif-1" aria-hidden="true">TOC</a></span></h3>
  29645. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  29646. filter&quot;).
  29647. </p>
  29648. <p>It accepts the following parameters:
  29649. </p>
  29650. <dl class="table">
  29651. <dt><samp class="option">mode</samp></dt>
  29652. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  29653. </p>
  29654. <dl class="table">
  29655. <dt><samp class="option">0, send_frame</samp></dt>
  29656. <dd><p>Output one frame for each frame.
  29657. </p></dd>
  29658. <dt><samp class="option">1, send_field</samp></dt>
  29659. <dd><p>Output one frame for each field.
  29660. </p></dd>
  29661. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  29662. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  29663. </p></dd>
  29664. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  29665. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  29666. </p></dd>
  29667. </dl>
  29668. <p>The default value is <code class="code">send_frame</code>.
  29669. </p>
  29670. </dd>
  29671. <dt><samp class="option">parity</samp></dt>
  29672. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  29673. of the following values:
  29674. </p>
  29675. <dl class="table">
  29676. <dt><samp class="option">0, tff</samp></dt>
  29677. <dd><p>Assume the top field is first.
  29678. </p></dd>
  29679. <dt><samp class="option">1, bff</samp></dt>
  29680. <dd><p>Assume the bottom field is first.
  29681. </p></dd>
  29682. <dt><samp class="option">-1, auto</samp></dt>
  29683. <dd><p>Enable automatic detection of field parity.
  29684. </p></dd>
  29685. </dl>
  29686. <p>The default value is <code class="code">auto</code>.
  29687. If the interlacing is unknown or the decoder does not export this information,
  29688. top field first will be assumed.
  29689. </p>
  29690. </dd>
  29691. <dt><samp class="option">deint</samp></dt>
  29692. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  29693. values:
  29694. </p>
  29695. <dl class="table">
  29696. <dt><samp class="option">0, all</samp></dt>
  29697. <dd><p>Deinterlace all frames.
  29698. </p></dd>
  29699. <dt><samp class="option">1, interlaced</samp></dt>
  29700. <dd><p>Only deinterlace frames marked as interlaced.
  29701. </p></dd>
  29702. </dl>
  29703. <p>The default value is <code class="code">all</code>.
  29704. </p></dd>
  29705. </dl>
  29706. <a name="yaepblur"></a>
  29707. <h3 class="section">11.288 yaepblur<span class="pull-right"><a class="anchor hidden-xs" href="#yaepblur" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yaepblur" aria-hidden="true">TOC</a></span></h3>
  29708. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  29709. The algorithm is described in
  29710. &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;
  29711. </p>
  29712. <p>It accepts the following parameters:
  29713. </p>
  29714. <dl class="table">
  29715. <dt><samp class="option">radius, r</samp></dt>
  29716. <dd><p>Set the window radius. Default value is 3.
  29717. </p>
  29718. </dd>
  29719. <dt><samp class="option">planes, p</samp></dt>
  29720. <dd><p>Set which planes to filter. Default is only the first plane.
  29721. </p>
  29722. </dd>
  29723. <dt><samp class="option">sigma, s</samp></dt>
  29724. <dd><p>Set blur strength. Default value is 128.
  29725. </p></dd>
  29726. </dl>
  29727. <a name="Commands-154"></a>
  29728. <h4 class="subsection">11.288.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-154" aria-hidden="true">TOC</a></span></h4>
  29729. <p>This filter supports same <a class="ref" href="#commands">commands</a> as options.
  29730. </p>
  29731. <a name="zoompan"></a>
  29732. <h3 class="section">11.289 zoompan<span class="pull-right"><a class="anchor hidden-xs" href="#zoompan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoompan" aria-hidden="true">TOC</a></span></h3>
  29733. <p>Apply Zoom &amp; Pan effect.
  29734. </p>
  29735. <p>This filter accepts the following options:
  29736. </p>
  29737. <dl class="table">
  29738. <dt><samp class="option">zoom, z</samp></dt>
  29739. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  29740. </p>
  29741. </dd>
  29742. <dt><samp class="option">x</samp></dt>
  29743. <dt><samp class="option">y</samp></dt>
  29744. <dd><p>Set the x and y expression. Default is 0.
  29745. </p>
  29746. </dd>
  29747. <dt><samp class="option">d</samp></dt>
  29748. <dd><p>Set the duration expression in number of frames.
  29749. This sets for how many number of frames effect will last for
  29750. single input image. Default is 90.
  29751. </p>
  29752. </dd>
  29753. <dt><samp class="option">s</samp></dt>
  29754. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  29755. </p>
  29756. </dd>
  29757. <dt><samp class="option">fps</samp></dt>
  29758. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  29759. </p></dd>
  29760. </dl>
  29761. <p>Each expression can contain the following constants:
  29762. </p>
  29763. <dl class="table">
  29764. <dt><samp class="option">in_w, iw</samp></dt>
  29765. <dd><p>Input width.
  29766. </p>
  29767. </dd>
  29768. <dt><samp class="option">in_h, ih</samp></dt>
  29769. <dd><p>Input height.
  29770. </p>
  29771. </dd>
  29772. <dt><samp class="option">out_w, ow</samp></dt>
  29773. <dd><p>Output width.
  29774. </p>
  29775. </dd>
  29776. <dt><samp class="option">out_h, oh</samp></dt>
  29777. <dd><p>Output height.
  29778. </p>
  29779. </dd>
  29780. <dt><samp class="option">in</samp></dt>
  29781. <dd><p>Input frame count.
  29782. </p>
  29783. </dd>
  29784. <dt><samp class="option">on</samp></dt>
  29785. <dd><p>Output frame count.
  29786. </p>
  29787. </dd>
  29788. <dt><samp class="option">in_time, it</samp></dt>
  29789. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  29790. </p>
  29791. </dd>
  29792. <dt><samp class="option">out_time, time, ot</samp></dt>
  29793. <dd><p>The output timestamp expressed in seconds.
  29794. </p>
  29795. </dd>
  29796. <dt><samp class="option">x</samp></dt>
  29797. <dt><samp class="option">y</samp></dt>
  29798. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  29799. for current input frame.
  29800. </p>
  29801. </dd>
  29802. <dt><samp class="option">px</samp></dt>
  29803. <dt><samp class="option">py</samp></dt>
  29804. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  29805. not yet such frame (first input frame).
  29806. </p>
  29807. </dd>
  29808. <dt><samp class="option">zoom</samp></dt>
  29809. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  29810. </p>
  29811. </dd>
  29812. <dt><samp class="option">pzoom</samp></dt>
  29813. <dd><p>Last calculated zoom of last output frame of previous input frame.
  29814. </p>
  29815. </dd>
  29816. <dt><samp class="option">duration</samp></dt>
  29817. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  29818. for each input frame.
  29819. </p>
  29820. </dd>
  29821. <dt><samp class="option">pduration</samp></dt>
  29822. <dd><p>number of output frames created for previous input frame
  29823. </p>
  29824. </dd>
  29825. <dt><samp class="option">a</samp></dt>
  29826. <dd><p>Rational number: input width / input height
  29827. </p>
  29828. </dd>
  29829. <dt><samp class="option">sar</samp></dt>
  29830. <dd><p>sample aspect ratio
  29831. </p>
  29832. </dd>
  29833. <dt><samp class="option">dar</samp></dt>
  29834. <dd><p>display aspect ratio
  29835. </p>
  29836. </dd>
  29837. </dl>
  29838. <a name="Examples-141"></a>
  29839. <h4 class="subsection">11.289.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-141" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-141" aria-hidden="true">TOC</a></span></h4>
  29840. <ul class="itemize mark-bullet">
  29841. <li>Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  29842. <div class="example">
  29843. <pre class="example-preformatted">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
  29844. </pre></div>
  29845. </li><li>Zoom in up to 1.5x and pan always at center of picture:
  29846. <div class="example">
  29847. <pre class="example-preformatted">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  29848. </pre></div>
  29849. </li><li>Same as above but without pausing:
  29850. <div class="example">
  29851. <pre class="example-preformatted">zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  29852. </pre></div>
  29853. </li><li>Zoom in 2x into center of picture only for the first second of the input video:
  29854. <div class="example">
  29855. <pre class="example-preformatted">zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  29856. </pre></div>
  29857. </li></ul>
  29858. <a class="anchor" id="zscale"></a><a name="zscale-1"></a>
  29859. <h3 class="section">11.290 zscale<span class="pull-right"><a class="anchor hidden-xs" href="#zscale-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zscale-1" aria-hidden="true">TOC</a></span></h3>
  29860. <p>Scale (resize) the input video, using the z.lib library:
  29861. <a class="url" href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  29862. filter, you need to configure FFmpeg with <code class="code">--enable-libzimg</code>.
  29863. </p>
  29864. <p>The zscale filter forces the output display aspect ratio to be the same
  29865. as the input, by changing the output sample aspect ratio.
  29866. </p>
  29867. <p>If the input image format is different from the format requested by
  29868. the next filter, the zscale filter will convert the input to the
  29869. requested format.
  29870. </p>
  29871. <a name="Options-5"></a>
  29872. <h4 class="subsection">11.290.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-5" aria-hidden="true">TOC</a></span></h4>
  29873. <p>The filter accepts the following options.
  29874. </p>
  29875. <dl class="table">
  29876. <dt><samp class="option">width, w</samp></dt>
  29877. <dt><samp class="option">height, h</samp></dt>
  29878. <dd><p>Set the output video dimension expression. Default value is the input
  29879. dimension.
  29880. </p>
  29881. <p>If the <var class="var">width</var> or <var class="var">w</var> value is 0, the input width is used for
  29882. the output. If the <var class="var">height</var> or <var class="var">h</var> value is 0, the input height
  29883. is used for the output.
  29884. </p>
  29885. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  29886. will use a value that maintains the aspect ratio of the input image,
  29887. calculated from the other specified dimension. After that it will,
  29888. however, make sure that the calculated dimension is divisible by n and
  29889. adjust the value if necessary.
  29890. </p>
  29891. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  29892. both values being set to 0 as previously detailed.
  29893. </p>
  29894. <p>See below for the list of accepted constants for use in the dimension
  29895. expression.
  29896. </p>
  29897. </dd>
  29898. <dt><samp class="option">size, s</samp></dt>
  29899. <dd><p>Set the video size. For the syntax of this option, check the
  29900. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29901. </p>
  29902. </dd>
  29903. <dt><samp class="option">dither, d</samp></dt>
  29904. <dd><p>Set the dither type.
  29905. </p>
  29906. <p>Possible values are:
  29907. </p><dl class="table">
  29908. <dt><var class="var">none</var></dt>
  29909. <dt><var class="var">ordered</var></dt>
  29910. <dt><var class="var">random</var></dt>
  29911. <dt><var class="var">error_diffusion</var></dt>
  29912. </dl>
  29913. <p>Default is none.
  29914. </p>
  29915. </dd>
  29916. <dt><samp class="option">filter, f</samp></dt>
  29917. <dd><p>Set the resize filter type.
  29918. </p>
  29919. <p>Possible values are:
  29920. </p><dl class="table">
  29921. <dt><var class="var">point</var></dt>
  29922. <dt><var class="var">bilinear</var></dt>
  29923. <dt><var class="var">bicubic</var></dt>
  29924. <dt><var class="var">spline16</var></dt>
  29925. <dt><var class="var">spline36</var></dt>
  29926. <dt><var class="var">spline64</var></dt>
  29927. <dt><var class="var">lanczos</var></dt>
  29928. </dl>
  29929. <p>Default is bilinear.
  29930. </p>
  29931. </dd>
  29932. <dt><samp class="option">range, r</samp></dt>
  29933. <dd><p>Set the color range.
  29934. </p>
  29935. <p>Possible values are:
  29936. </p><dl class="table">
  29937. <dt><var class="var">input</var></dt>
  29938. <dt><var class="var">limited</var></dt>
  29939. <dt><var class="var">full</var></dt>
  29940. </dl>
  29941. <p>Default is same as input.
  29942. </p>
  29943. </dd>
  29944. <dt><samp class="option">primaries, p</samp></dt>
  29945. <dd><p>Set the color primaries.
  29946. </p>
  29947. <p>Possible values are:
  29948. </p><dl class="table">
  29949. <dt><var class="var">input</var></dt>
  29950. <dt><var class="var">709</var></dt>
  29951. <dt><var class="var">unspecified</var></dt>
  29952. <dt><var class="var">170m</var></dt>
  29953. <dt><var class="var">240m</var></dt>
  29954. <dt><var class="var">2020</var></dt>
  29955. </dl>
  29956. <p>Default is same as input.
  29957. </p>
  29958. </dd>
  29959. <dt><samp class="option">transfer, t</samp></dt>
  29960. <dd><p>Set the transfer characteristics.
  29961. </p>
  29962. <p>Possible values are:
  29963. </p><dl class="table">
  29964. <dt><var class="var">input</var></dt>
  29965. <dt><var class="var">709</var></dt>
  29966. <dt><var class="var">unspecified</var></dt>
  29967. <dt><var class="var">601</var></dt>
  29968. <dt><var class="var">linear</var></dt>
  29969. <dt><var class="var">2020_10</var></dt>
  29970. <dt><var class="var">2020_12</var></dt>
  29971. <dt><var class="var">smpte2084</var></dt>
  29972. <dt><var class="var">iec61966-2-1</var></dt>
  29973. <dt><var class="var">arib-std-b67</var></dt>
  29974. </dl>
  29975. <p>Default is same as input.
  29976. </p>
  29977. </dd>
  29978. <dt><samp class="option">matrix, m</samp></dt>
  29979. <dd><p>Set the colorspace matrix.
  29980. </p>
  29981. <p>Possible value are:
  29982. </p><dl class="table">
  29983. <dt><var class="var">input</var></dt>
  29984. <dt><var class="var">709</var></dt>
  29985. <dt><var class="var">unspecified</var></dt>
  29986. <dt><var class="var">470bg</var></dt>
  29987. <dt><var class="var">170m</var></dt>
  29988. <dt><var class="var">2020_ncl</var></dt>
  29989. <dt><var class="var">2020_cl</var></dt>
  29990. </dl>
  29991. <p>Default is same as input.
  29992. </p>
  29993. </dd>
  29994. <dt><samp class="option">rangein, rin</samp></dt>
  29995. <dd><p>Set the input color range.
  29996. </p>
  29997. <p>Possible values are:
  29998. </p><dl class="table">
  29999. <dt><var class="var">input</var></dt>
  30000. <dt><var class="var">limited</var></dt>
  30001. <dt><var class="var">full</var></dt>
  30002. </dl>
  30003. <p>Default is same as input.
  30004. </p>
  30005. </dd>
  30006. <dt><samp class="option">primariesin, pin</samp></dt>
  30007. <dd><p>Set the input color primaries.
  30008. </p>
  30009. <p>Possible values are:
  30010. </p><dl class="table">
  30011. <dt><var class="var">input</var></dt>
  30012. <dt><var class="var">709</var></dt>
  30013. <dt><var class="var">unspecified</var></dt>
  30014. <dt><var class="var">170m</var></dt>
  30015. <dt><var class="var">240m</var></dt>
  30016. <dt><var class="var">2020</var></dt>
  30017. </dl>
  30018. <p>Default is same as input.
  30019. </p>
  30020. </dd>
  30021. <dt><samp class="option">transferin, tin</samp></dt>
  30022. <dd><p>Set the input transfer characteristics.
  30023. </p>
  30024. <p>Possible values are:
  30025. </p><dl class="table">
  30026. <dt><var class="var">input</var></dt>
  30027. <dt><var class="var">709</var></dt>
  30028. <dt><var class="var">unspecified</var></dt>
  30029. <dt><var class="var">601</var></dt>
  30030. <dt><var class="var">linear</var></dt>
  30031. <dt><var class="var">2020_10</var></dt>
  30032. <dt><var class="var">2020_12</var></dt>
  30033. </dl>
  30034. <p>Default is same as input.
  30035. </p>
  30036. </dd>
  30037. <dt><samp class="option">matrixin, min</samp></dt>
  30038. <dd><p>Set the input colorspace matrix.
  30039. </p>
  30040. <p>Possible value are:
  30041. </p><dl class="table">
  30042. <dt><var class="var">input</var></dt>
  30043. <dt><var class="var">709</var></dt>
  30044. <dt><var class="var">unspecified</var></dt>
  30045. <dt><var class="var">470bg</var></dt>
  30046. <dt><var class="var">170m</var></dt>
  30047. <dt><var class="var">2020_ncl</var></dt>
  30048. <dt><var class="var">2020_cl</var></dt>
  30049. </dl>
  30050. </dd>
  30051. <dt><samp class="option">chromal, c</samp></dt>
  30052. <dd><p>Set the output chroma location.
  30053. </p>
  30054. <p>Possible values are:
  30055. </p><dl class="table">
  30056. <dt><var class="var">input</var></dt>
  30057. <dt><var class="var">left</var></dt>
  30058. <dt><var class="var">center</var></dt>
  30059. <dt><var class="var">topleft</var></dt>
  30060. <dt><var class="var">top</var></dt>
  30061. <dt><var class="var">bottomleft</var></dt>
  30062. <dt><var class="var">bottom</var></dt>
  30063. </dl>
  30064. </dd>
  30065. <dt><samp class="option">chromalin, cin</samp></dt>
  30066. <dd><p>Set the input chroma location.
  30067. </p>
  30068. <p>Possible values are:
  30069. </p><dl class="table">
  30070. <dt><var class="var">input</var></dt>
  30071. <dt><var class="var">left</var></dt>
  30072. <dt><var class="var">center</var></dt>
  30073. <dt><var class="var">topleft</var></dt>
  30074. <dt><var class="var">top</var></dt>
  30075. <dt><var class="var">bottomleft</var></dt>
  30076. <dt><var class="var">bottom</var></dt>
  30077. </dl>
  30078. </dd>
  30079. <dt><samp class="option">npl</samp></dt>
  30080. <dd><p>Set the nominal peak luminance.
  30081. </p>
  30082. </dd>
  30083. <dt><samp class="option">param_a</samp></dt>
  30084. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  30085. filter taps for lanczos.
  30086. </p>
  30087. </dd>
  30088. <dt><samp class="option">param_b</samp></dt>
  30089. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  30090. </p></dd>
  30091. </dl>
  30092. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  30093. containing the following constants:
  30094. </p>
  30095. <dl class="table">
  30096. <dt><var class="var">in_w</var></dt>
  30097. <dt><var class="var">in_h</var></dt>
  30098. <dd><p>The input width and height
  30099. </p>
  30100. </dd>
  30101. <dt><var class="var">iw</var></dt>
  30102. <dt><var class="var">ih</var></dt>
  30103. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  30104. </p>
  30105. </dd>
  30106. <dt><var class="var">out_w</var></dt>
  30107. <dt><var class="var">out_h</var></dt>
  30108. <dd><p>The output (scaled) width and height
  30109. </p>
  30110. </dd>
  30111. <dt><var class="var">ow</var></dt>
  30112. <dt><var class="var">oh</var></dt>
  30113. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  30114. </p>
  30115. </dd>
  30116. <dt><var class="var">a</var></dt>
  30117. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  30118. </p>
  30119. </dd>
  30120. <dt><var class="var">sar</var></dt>
  30121. <dd><p>input sample aspect ratio
  30122. </p>
  30123. </dd>
  30124. <dt><var class="var">dar</var></dt>
  30125. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  30126. </p>
  30127. </dd>
  30128. <dt><var class="var">hsub</var></dt>
  30129. <dt><var class="var">vsub</var></dt>
  30130. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  30131. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  30132. </p>
  30133. </dd>
  30134. <dt><var class="var">ohsub</var></dt>
  30135. <dt><var class="var">ovsub</var></dt>
  30136. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  30137. pixel format &quot;yuv422p&quot; <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  30138. </p></dd>
  30139. </dl>
  30140. <a name="Commands-155"></a>
  30141. <h4 class="subsection">11.290.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-155" aria-hidden="true">TOC</a></span></h4>
  30142. <p>This filter supports the following commands:
  30143. </p><dl class="table">
  30144. <dt><samp class="option">width, w</samp></dt>
  30145. <dt><samp class="option">height, h</samp></dt>
  30146. <dd><p>Set the output video dimension expression.
  30147. The command accepts the same syntax of the corresponding option.
  30148. </p>
  30149. <p>If the specified expression is not valid, it is kept at its current
  30150. value.
  30151. </p></dd>
  30152. </dl>
  30153. <a name="CUDA-Video-Filters"></a>
  30154. <h2 class="chapter">12 CUDA Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  30155. <p>To enable CUDA and/or NPP filters please refer to configuration guidelines for <a class="ref" href="#CUDA">CUDA</a> and for <a class="ref" href="#CUDA-NPP">CUDA NPP</a> filters.
  30156. </p>
  30157. <p>Running CUDA filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  30158. </p><dl class="table">
  30159. <dt><samp class="option">-init_hw_device cuda[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  30160. <dd><p>Initialise a new hardware device of type <var class="var">cuda</var> called <var class="var">name</var>, using the
  30161. given device parameters.
  30162. </p>
  30163. </dd>
  30164. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  30165. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  30166. </p>
  30167. </dd>
  30168. </dl>
  30169. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  30170. </p>
  30171. <ul class="itemize mark-bullet">
  30172. <li>Example of initializing second CUDA device on the system and running scale_cuda and bilateral_cuda filters.
  30173. <div class="example">
  30174. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -init_hw_device cuda:1 -filter_complex \
  30175. &quot;[0:v]scale_cuda=format=yuv444p[scaled_video];[scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  30176. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  30177. </pre></div>
  30178. </li></ul>
  30179. <p>Since CUDA filters operate exclusively on GPU memory, frame data must sometimes be uploaded (<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces associated with the appropriate CUDA device before processing, and downloaded (<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory afterward, if required. Whether <a class="ref" href="#hwupload">hwupload</a> or <a class="ref" href="#hwdownload">hwdownload</a> is necessary depends on the specific workflow:
  30180. </p>
  30181. <ul class="itemize mark-bullet">
  30182. <li>If the input frames are already in GPU memory (e.g., when using <code class="code">-hwaccel cuda</code> or <code class="code">-hwaccel_output_format cuda</code>), explicit use of <a class="ref" href="#hwupload">hwupload</a> is not needed, as the data is already in the appropriate memory space.
  30183. </li><li>If the input frames are in CPU memory (e.g., software-decoded frames or frames processed by CPU-based filters), it is necessary to use <a class="ref" href="#hwupload">hwupload</a> to transfer the data to GPU memory for CUDA processing.
  30184. </li><li>If the output of the CUDA filters needs to be further processed by software-based filters or saved in a format not supported by GPU-based encoders, <a class="ref" href="#hwdownload">hwdownload</a> is required to transfer the data back to CPU memory.
  30185. </li></ul>
  30186. <p>Note that <a class="ref" href="#hwupload">hwupload</a> uploads data to a surface with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before <a class="ref" href="#hwupload">hwupload</a> to ensure the input is in the correct format. Similarly, <a class="ref" href="#hwdownload">hwdownload</a> may not support all output formats, so an additional <a class="ref" href="#format">format</a> filter may need to be inserted immediately after <a class="ref" href="#hwdownload">hwdownload</a> in the filter graph to ensure compatibility.
  30187. </p>
  30188. <a class="anchor" id="CUDA"></a><a name="CUDA-1"></a>
  30189. <h3 class="section">12.1 CUDA<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-1" aria-hidden="true">TOC</a></span></h3>
  30190. <p>Below is a description of the currently available Nvidia CUDA video filters.
  30191. </p>
  30192. <p>Prerequisites:
  30193. </p><ul class="itemize mark-bullet">
  30194. <li>Install Nvidia CUDA Toolkit
  30195. </li></ul>
  30196. <p>Note: If FFmpeg detects the Nvidia CUDA Toolkit during configuration, it will enable CUDA filters automatically without requiring any additional flags. If you want to explicitly enable them, use the following options:
  30197. </p>
  30198. <ul class="itemize mark-bullet">
  30199. <li>Configure FFmpeg with <code class="code">--enable-cuda-nvcc --enable-nonfree</code>.
  30200. </li><li>Configure FFmpeg with <code class="code">--enable-cuda-llvm</code>. Additional requirement: <code class="code">llvm</code> lib must be installed.
  30201. </li></ul>
  30202. <a name="bilateral_005fcuda"></a>
  30203. <h4 class="subsection">12.1.1 bilateral_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bilateral_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bilateral_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30204. <p>CUDA accelerated bilateral filter, an edge preserving filter.
  30205. This filter is mathematically accurate thanks to the use of GPU acceleration.
  30206. For best output quality, use one to one chroma subsampling, i.e. yuv444p format.
  30207. </p>
  30208. <p>The filter accepts the following options:
  30209. </p><dl class="table">
  30210. <dt><samp class="option">sigmaS</samp></dt>
  30211. <dd><p>Set sigma of gaussian function to calculate spatial weight, also called sigma space.
  30212. Allowed range is 0.1 to 512. Default is 0.1.
  30213. </p>
  30214. </dd>
  30215. <dt><samp class="option">sigmaR</samp></dt>
  30216. <dd><p>Set sigma of gaussian function to calculate color range weight, also called sigma color.
  30217. Allowed range is 0.1 to 512. Default is 0.1.
  30218. </p>
  30219. </dd>
  30220. <dt><samp class="option">window_size</samp></dt>
  30221. <dd><p>Set window size of the bilateral function to determine the number of neighbours to loop on.
  30222. If the number entered is even, one will be added automatically.
  30223. Allowed range is 1 to 255. Default is 1.
  30224. </p></dd>
  30225. </dl>
  30226. <a name="Examples-142"></a>
  30227. <h4 class="subsubsection">12.1.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-142" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-142" aria-hidden="true">TOC</a></span></h4>
  30228. <ul class="itemize mark-bullet">
  30229. <li>Apply the bilateral filter on a video.
  30230. <div class="example">
  30231. <pre class="example-preformatted">./ffmpeg -v verbose \
  30232. -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 \
  30233. -init_hw_device cuda \
  30234. -filter_complex \
  30235. &quot; \
  30236. [0:v]scale_cuda=format=yuv444p[scaled_video];
  30237. [scaled_video]bilateral_cuda=window_size=9:sigmaS=3.0:sigmaR=50.0&quot; \
  30238. -an -sn -c:v h264_nvenc -cq 20 out.mp4
  30239. </pre></div>
  30240. </li></ul>
  30241. <a name="bwdif_005fcuda"></a>
  30242. <h4 class="subsection">12.1.2 bwdif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30243. <p>Deinterlace the input video using the <a class="ref" href="#bwdif">bwdif</a> algorithm, but implemented
  30244. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  30245. and/or nvenc.
  30246. </p>
  30247. <p>It accepts the following parameters:
  30248. </p>
  30249. <dl class="table">
  30250. <dt><samp class="option">mode</samp></dt>
  30251. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  30252. </p>
  30253. <dl class="table">
  30254. <dt><samp class="option">0, send_frame</samp></dt>
  30255. <dd><p>Output one frame for each frame.
  30256. </p></dd>
  30257. <dt><samp class="option">1, send_field</samp></dt>
  30258. <dd><p>Output one frame for each field.
  30259. </p></dd>
  30260. </dl>
  30261. <p>The default value is <code class="code">send_field</code>.
  30262. </p>
  30263. </dd>
  30264. <dt><samp class="option">parity</samp></dt>
  30265. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  30266. of the following values:
  30267. </p>
  30268. <dl class="table">
  30269. <dt><samp class="option">0, tff</samp></dt>
  30270. <dd><p>Assume the top field is first.
  30271. </p></dd>
  30272. <dt><samp class="option">1, bff</samp></dt>
  30273. <dd><p>Assume the bottom field is first.
  30274. </p></dd>
  30275. <dt><samp class="option">-1, auto</samp></dt>
  30276. <dd><p>Enable automatic detection of field parity.
  30277. </p></dd>
  30278. </dl>
  30279. <p>The default value is <code class="code">auto</code>.
  30280. If the interlacing is unknown or the decoder does not export this information,
  30281. top field first will be assumed.
  30282. </p>
  30283. </dd>
  30284. <dt><samp class="option">deint</samp></dt>
  30285. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  30286. values:
  30287. </p>
  30288. <dl class="table">
  30289. <dt><samp class="option">0, all</samp></dt>
  30290. <dd><p>Deinterlace all frames.
  30291. </p></dd>
  30292. <dt><samp class="option">1, interlaced</samp></dt>
  30293. <dd><p>Only deinterlace frames marked as interlaced.
  30294. </p></dd>
  30295. </dl>
  30296. <p>The default value is <code class="code">all</code>.
  30297. </p></dd>
  30298. </dl>
  30299. <a name="chromakey_005fcuda"></a>
  30300. <h4 class="subsection">12.1.3 chromakey_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30301. <p>CUDA accelerated YUV colorspace color/chroma keying.
  30302. </p>
  30303. <p>This filter works like normal chromakey filter but operates on CUDA frames.
  30304. for more details and parameters see <a class="ref" href="#chromakey">chromakey</a>.
  30305. </p>
  30306. <a name="Examples-143"></a>
  30307. <h4 class="subsubsection">12.1.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-143" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-143" aria-hidden="true">TOC</a></span></h4>
  30308. <ul class="itemize mark-bullet">
  30309. <li>Make all the green pixels in the input video transparent and use it as an overlay for another video:
  30310. <div class="example">
  30311. <pre class="example-preformatted">./ffmpeg \
  30312. -hwaccel cuda -hwaccel_output_format cuda -i input_green.mp4 \
  30313. -hwaccel cuda -hwaccel_output_format cuda -i base_video.mp4 \
  30314. -init_hw_device cuda \
  30315. -filter_complex \
  30316. &quot; \
  30317. [0:v]chromakey_cuda=0x25302D:0.1:0.12:1[overlay_video]; \
  30318. [1:v]scale_cuda=format=yuv420p[base]; \
  30319. [base][overlay_video]overlay_cuda&quot; \
  30320. -an -sn -c:v h264_nvenc -cq 20 output.mp4
  30321. </pre></div>
  30322. </li><li>Process two software sources, explicitly uploading the frames:
  30323. <div class="example">
  30324. <pre class="example-preformatted">./ffmpeg -init_hw_device cuda=cuda -filter_hw_device cuda \
  30325. -f lavfi -i color=size=800x600:color=white,format=yuv420p \
  30326. -f lavfi -i yuvtestsrc=size=200x200,format=yuv420p \
  30327. -filter_complex \
  30328. &quot; \
  30329. [0]hwupload[under]; \
  30330. [1]hwupload,chromakey_cuda=green:0.1:0.12[over]; \
  30331. [under][over]overlay_cuda&quot; \
  30332. -c:v hevc_nvenc -cq 18 -preset slow output.mp4
  30333. </pre></div>
  30334. </li></ul>
  30335. <a name="colorspace_005fcuda"></a>
  30336. <h4 class="subsection">12.1.4 colorspace_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#colorspace_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorspace_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30337. <p>CUDA accelerated implementation of the colorspace filter.
  30338. </p>
  30339. <p>It is by no means feature complete compared to the software colorspace filter,
  30340. and at the current time only supports color range conversion between jpeg/full
  30341. and mpeg/limited range.
  30342. </p>
  30343. <p>The filter accepts the following options:
  30344. </p>
  30345. <dl class="table">
  30346. <dt><samp class="option">range</samp></dt>
  30347. <dd><p>Specify output color range.
  30348. </p>
  30349. <p>The accepted values are:
  30350. </p><dl class="table">
  30351. <dt>&lsquo;<samp class="samp">tv</samp>&rsquo;</dt>
  30352. <dd><p>TV (restricted) range
  30353. </p>
  30354. </dd>
  30355. <dt>&lsquo;<samp class="samp">mpeg</samp>&rsquo;</dt>
  30356. <dd><p>MPEG (restricted) range
  30357. </p>
  30358. </dd>
  30359. <dt>&lsquo;<samp class="samp">pc</samp>&rsquo;</dt>
  30360. <dd><p>PC (full) range
  30361. </p>
  30362. </dd>
  30363. <dt>&lsquo;<samp class="samp">jpeg</samp>&rsquo;</dt>
  30364. <dd><p>JPEG (full) range
  30365. </p>
  30366. </dd>
  30367. </dl>
  30368. </dd>
  30369. </dl>
  30370. <a class="anchor" id="overlay_005fcuda"></a><a name="overlay_005fcuda-1"></a>
  30371. <h4 class="subsection">12.1.5 overlay_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  30372. <p>Overlay one video on top of another.
  30373. </p>
  30374. <p>This is the CUDA variant of the <a class="ref" href="#overlay">overlay</a> filter.
  30375. It only accepts CUDA frames. The underlying input pixel formats have to match.
  30376. </p>
  30377. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  30378. video on which the second input is overlaid.
  30379. </p>
  30380. <p>It accepts the following parameters:
  30381. </p>
  30382. <dl class="table">
  30383. <dt><samp class="option">x</samp></dt>
  30384. <dt><samp class="option">y</samp></dt>
  30385. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  30386. on the main video.
  30387. </p>
  30388. <p>They can contain the following parameters:
  30389. </p>
  30390. <dl class="table">
  30391. <dt><samp class="option">main_w, W</samp></dt>
  30392. <dt><samp class="option">main_h, H</samp></dt>
  30393. <dd><p>The main input width and height.
  30394. </p>
  30395. </dd>
  30396. <dt><samp class="option">overlay_w, w</samp></dt>
  30397. <dt><samp class="option">overlay_h, h</samp></dt>
  30398. <dd><p>The overlay input width and height.
  30399. </p>
  30400. </dd>
  30401. <dt><samp class="option">x</samp></dt>
  30402. <dt><samp class="option">y</samp></dt>
  30403. <dd><p>The computed values for <var class="var">x</var> and <var class="var">y</var>. They are evaluated for
  30404. each new frame.
  30405. </p>
  30406. </dd>
  30407. <dt><samp class="option">n</samp></dt>
  30408. <dd><p>The ordinal index of the main input frame, starting from 0.
  30409. </p>
  30410. </dd>
  30411. <dt><samp class="option">pos</samp></dt>
  30412. <dd><p>The byte offset position in the file of the main input frame, NAN if unknown.
  30413. Deprecated, do not use.
  30414. </p>
  30415. </dd>
  30416. <dt><samp class="option">t</samp></dt>
  30417. <dd><p>The timestamp of the main input frame, expressed in seconds, NAN if unknown.
  30418. </p>
  30419. </dd>
  30420. </dl>
  30421. <p>Default value is &quot;0&quot; for both expressions.
  30422. </p>
  30423. </dd>
  30424. <dt><samp class="option">eval</samp></dt>
  30425. <dd><p>Set when the expressions for <samp class="option">x</samp> and <samp class="option">y</samp> are evaluated.
  30426. </p>
  30427. <p>It accepts the following values:
  30428. </p><dl class="table">
  30429. <dt><samp class="option">init</samp></dt>
  30430. <dd><p>Evaluate expressions once during filter initialization or
  30431. when a command is processed.
  30432. </p>
  30433. </dd>
  30434. <dt><samp class="option">frame</samp></dt>
  30435. <dd><p>Evaluate expressions for each incoming frame
  30436. </p></dd>
  30437. </dl>
  30438. <p>Default value is <samp class="option">frame</samp>.
  30439. </p>
  30440. </dd>
  30441. <dt><samp class="option">eof_action</samp></dt>
  30442. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  30443. </p>
  30444. </dd>
  30445. <dt><samp class="option">shortest</samp></dt>
  30446. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  30447. </p>
  30448. </dd>
  30449. <dt><samp class="option">repeatlast</samp></dt>
  30450. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  30451. </p>
  30452. </dd>
  30453. </dl>
  30454. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  30455. </p>
  30456. <a class="anchor" id="pad_005fcuda"></a><a name="pad_005fcuda-1"></a>
  30457. <h4 class="subsection">12.1.6 pad_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  30458. <p>Add paddings to an input video stream using CUDA.
  30459. </p>
  30460. <p>This filter is the CUDA-accelerated version of the <a class="ref" href="#pad">pad</a> filter. It accepts the same options and expressions and provides the same core functionality.
  30461. For a detailed description of available options, please see the documentation for the <a class="ref" href="#pad">pad</a> filter.
  30462. </p>
  30463. <a name="Examples-144"></a>
  30464. <h4 class="subsubsection">12.1.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-144" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-144" aria-hidden="true">TOC</a></span></h4>
  30465. <ul class="itemize mark-bullet">
  30466. <li>Add a 200-pixel black border to all sides of a video frame:
  30467. <div class="example">
  30468. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=iw+400:h=ih+400:x=200:y=200&quot; -c:v h264_nvenc out.mp4
  30469. </pre></div>
  30470. </li><li>Pad the input video to a 16:9 aspect ratio, filling with the color &quot;blue&quot;:
  30471. <div class="example">
  30472. <pre class="example-preformatted">ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.mp4 -vf &quot;pad_cuda=w=ih*16/9/sar:h=ih:x=(ow-iw)/2:y=(oh-ih)/2:color=blue&quot; -c:v h264_nvenc out.mp4
  30473. </pre></div>
  30474. </li></ul>
  30475. <a class="anchor" id="scale_005fcuda"></a><a name="scale_005fcuda-1"></a>
  30476. <h4 class="subsection">12.1.7 scale_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fcuda-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fcuda-1" aria-hidden="true">TOC</a></span></h4>
  30477. <p>Scale (resize) and convert (pixel format) the input video, using accelerated CUDA kernels.
  30478. Setting the output width and height works in the same way as for the <a class="ref" href="#scale">scale</a> filter.
  30479. </p>
  30480. <p>The filter accepts the following options:
  30481. </p><dl class="table">
  30482. <dt><samp class="option">w</samp></dt>
  30483. <dt><samp class="option">h</samp></dt>
  30484. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  30485. </p>
  30486. <p>Allows for the same expressions as the <a class="ref" href="#scale">scale</a> filter.
  30487. </p>
  30488. </dd>
  30489. <dt><samp class="option">interp_algo</samp></dt>
  30490. <dd><p>Sets the algorithm used for scaling:
  30491. </p>
  30492. <dl class="table">
  30493. <dt><var class="var">nearest</var></dt>
  30494. <dd><p>Nearest neighbour
  30495. </p>
  30496. <p>Used by default if input parameters match the desired output.
  30497. </p>
  30498. </dd>
  30499. <dt><var class="var">bilinear</var></dt>
  30500. <dd><p>Bilinear
  30501. </p>
  30502. </dd>
  30503. <dt><var class="var">bicubic</var></dt>
  30504. <dd><p>Bicubic
  30505. </p>
  30506. <p>This is the default.
  30507. </p>
  30508. </dd>
  30509. <dt><var class="var">lanczos</var></dt>
  30510. <dd><p>Lanczos
  30511. </p>
  30512. </dd>
  30513. </dl>
  30514. </dd>
  30515. <dt><samp class="option">format</samp></dt>
  30516. <dd><p>Controls the output pixel format. By default, or if none is specified, the input
  30517. pixel format is used.
  30518. </p>
  30519. <p>The filter does not support converting between YUV and RGB pixel formats.
  30520. </p>
  30521. </dd>
  30522. <dt><samp class="option">passthrough</samp></dt>
  30523. <dd><p>If set to 0, every frame is processed, even if no conversion is necessary.
  30524. This mode can be useful to use the filter as a buffer for a downstream
  30525. frame-consumer that exhausts the limited decoder frame pool.
  30526. </p>
  30527. <p>If set to 1, frames are passed through as-is if they match the desired output
  30528. parameters. This is the default behaviour.
  30529. </p>
  30530. </dd>
  30531. <dt><samp class="option">param</samp></dt>
  30532. <dd><p>Algorithm-Specific parameter.
  30533. </p>
  30534. <p>Affects the curves of the bicubic algorithm.
  30535. </p>
  30536. </dd>
  30537. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  30538. <dt><samp class="option">force_divisible_by</samp></dt>
  30539. <dd><p>Work the same as the identical <a class="ref" href="#scale">scale</a> filter options.
  30540. </p>
  30541. </dd>
  30542. <dt><samp class="option">reset_sar</samp></dt>
  30543. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  30544. </p>
  30545. </dd>
  30546. </dl>
  30547. <a name="Examples-145"></a>
  30548. <h4 class="subsubsection">12.1.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-145" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-145" aria-hidden="true">TOC</a></span></h4>
  30549. <ul class="itemize mark-bullet">
  30550. <li>Scale input to 720p, keeping aspect ratio and ensuring the output is yuv420p.
  30551. <div class="example">
  30552. <pre class="example-preformatted">scale_cuda=-2:720:format=yuv420p
  30553. </pre></div>
  30554. </li><li>Upscale to 4K using nearest neighbour algorithm.
  30555. <div class="example">
  30556. <pre class="example-preformatted">scale_cuda=4096:2160:interp_algo=nearest
  30557. </pre></div>
  30558. </li><li>Don&rsquo;t do any conversion or scaling, but copy all input frames into newly allocated ones.
  30559. This can be useful to deal with a filter and encode chain that otherwise exhausts the
  30560. decoders frame pool.
  30561. <div class="example">
  30562. <pre class="example-preformatted">scale_cuda=passthrough=0
  30563. </pre></div>
  30564. </li></ul>
  30565. <a name="thumbnail_005fcuda"></a>
  30566. <h4 class="subsection">12.1.8 thumbnail_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#thumbnail_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-thumbnail_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30567. <p>Select the most representative frame in a given sequence of consecutive frames using CUDA.
  30568. </p>
  30569. <p>The filter accepts the following options:
  30570. </p>
  30571. <dl class="table">
  30572. <dt><samp class="option">n</samp></dt>
  30573. <dd><p>Set the frames batch size to analyze; in a set of <var class="var">n</var> frames, the filter
  30574. will pick one of them, and then handle the next batch of <var class="var">n</var> frames until
  30575. the end. Default is <code class="code">100</code>.
  30576. </p></dd>
  30577. </dl>
  30578. <p>Since the filter keeps track of the whole frames sequence, a bigger <var class="var">n</var>
  30579. value will result in a higher memory usage, so a high value is not recommended.
  30580. </p>
  30581. <a name="Example"></a>
  30582. <h4 class="subsubsection">12.1.8.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example" aria-hidden="true">TOC</a></span></h4>
  30583. <ul class="itemize mark-bullet">
  30584. <li>Thumbnails are extracted from every <var class="var">n</var>=150-frame batch, selecting one per batch. Chosen frames are then scaled with <a class="ref" href="#scale_005fcuda">scale_cuda</a>.
  30585. <div class="example">
  30586. <pre class="example-preformatted">./ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i ./input.mp4 -vf &quot;thumbnail_cuda=150,scale_cuda=1920:1080,hwdownload,format=nv12&quot; ./output/out%03d.png
  30587. </pre></div>
  30588. </li></ul>
  30589. <a name="yadif_005fcuda"></a>
  30590. <h4 class="subsection">12.1.9 yadif_cuda<span class="pull-right"><a class="anchor hidden-xs" href="#yadif_005fcuda" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-yadif_005fcuda" aria-hidden="true">TOC</a></span></h4>
  30591. <p>Deinterlace the input video using the <a class="ref" href="#yadif">yadif</a> algorithm, but implemented
  30592. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  30593. and/or nvenc.
  30594. </p>
  30595. <p>It accepts the following parameters:
  30596. </p>
  30597. <dl class="table">
  30598. <dt><samp class="option">mode</samp></dt>
  30599. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  30600. </p>
  30601. <dl class="table">
  30602. <dt><samp class="option">0, send_frame</samp></dt>
  30603. <dd><p>Output one frame for each frame.
  30604. </p></dd>
  30605. <dt><samp class="option">1, send_field</samp></dt>
  30606. <dd><p>Output one frame for each field.
  30607. </p></dd>
  30608. <dt><samp class="option">2, send_frame_nospatial</samp></dt>
  30609. <dd><p>Like <code class="code">send_frame</code>, but it skips the spatial interlacing check.
  30610. </p></dd>
  30611. <dt><samp class="option">3, send_field_nospatial</samp></dt>
  30612. <dd><p>Like <code class="code">send_field</code>, but it skips the spatial interlacing check.
  30613. </p></dd>
  30614. </dl>
  30615. <p>The default value is <code class="code">send_frame</code>.
  30616. </p>
  30617. </dd>
  30618. <dt><samp class="option">parity</samp></dt>
  30619. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  30620. of the following values:
  30621. </p>
  30622. <dl class="table">
  30623. <dt><samp class="option">0, tff</samp></dt>
  30624. <dd><p>Assume the top field is first.
  30625. </p></dd>
  30626. <dt><samp class="option">1, bff</samp></dt>
  30627. <dd><p>Assume the bottom field is first.
  30628. </p></dd>
  30629. <dt><samp class="option">-1, auto</samp></dt>
  30630. <dd><p>Enable automatic detection of field parity.
  30631. </p></dd>
  30632. </dl>
  30633. <p>The default value is <code class="code">auto</code>.
  30634. If the interlacing is unknown or the decoder does not export this information,
  30635. top field first will be assumed.
  30636. </p>
  30637. </dd>
  30638. <dt><samp class="option">deint</samp></dt>
  30639. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  30640. values:
  30641. </p>
  30642. <dl class="table">
  30643. <dt><samp class="option">0, all</samp></dt>
  30644. <dd><p>Deinterlace all frames.
  30645. </p></dd>
  30646. <dt><samp class="option">1, interlaced</samp></dt>
  30647. <dd><p>Only deinterlace frames marked as interlaced.
  30648. </p></dd>
  30649. </dl>
  30650. <p>The default value is <code class="code">all</code>.
  30651. </p></dd>
  30652. </dl>
  30653. <a class="anchor" id="CUDA-NPP"></a><a name="CUDA-NPP-1"></a>
  30654. <h3 class="section">12.2 CUDA NPP<span class="pull-right"><a class="anchor hidden-xs" href="#CUDA-NPP-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-CUDA-NPP-1" aria-hidden="true">TOC</a></span></h3>
  30655. <p>Below is a description of the currently available NVIDIA Performance Primitives (libnpp) video filters.
  30656. </p>
  30657. <p>Prerequisites:
  30658. </p><ul class="itemize mark-bullet">
  30659. <li>Install Nvidia CUDA Toolkit
  30660. </li><li>Install libnpp
  30661. </li></ul>
  30662. <p>To enable CUDA NPP filters:
  30663. </p>
  30664. <ul class="itemize mark-bullet">
  30665. <li>Configure FFmpeg with <code class="code">--enable-nonfree --enable-libnpp</code>.
  30666. </li></ul>
  30667. <a class="anchor" id="scale_005fnpp"></a><a name="scale_005fnpp-1"></a>
  30668. <h4 class="subsection">12.2.1 scale_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fnpp-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fnpp-1" aria-hidden="true">TOC</a></span></h4>
  30669. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  30670. format conversion on CUDA video frames. Setting the output width and height
  30671. works in the same way as for the <var class="var">scale</var> filter.
  30672. </p>
  30673. <p>The following additional options are accepted:
  30674. </p><dl class="table">
  30675. <dt><samp class="option">format</samp></dt>
  30676. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  30677. default), the input format will be kept. Note that automatic format negotiation
  30678. and conversion is not yet supported for hardware frames
  30679. </p>
  30680. </dd>
  30681. <dt><samp class="option">interp_algo</samp></dt>
  30682. <dd><p>The interpolation algorithm used for resizing. One of the following:
  30683. </p><dl class="table">
  30684. <dt><samp class="option">nn</samp></dt>
  30685. <dd><p>Nearest neighbour.
  30686. </p>
  30687. </dd>
  30688. <dt><samp class="option">linear</samp></dt>
  30689. <dt><samp class="option">cubic</samp></dt>
  30690. <dt><samp class="option">cubic2p_bspline</samp></dt>
  30691. <dd><p>2-parameter cubic (B=1, C=0)
  30692. </p>
  30693. </dd>
  30694. <dt><samp class="option">cubic2p_catmullrom</samp></dt>
  30695. <dd><p>2-parameter cubic (B=0, C=1/2)
  30696. </p>
  30697. </dd>
  30698. <dt><samp class="option">cubic2p_b05c03</samp></dt>
  30699. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  30700. </p>
  30701. </dd>
  30702. <dt><samp class="option">super</samp></dt>
  30703. <dd><p>Supersampling
  30704. </p>
  30705. </dd>
  30706. <dt><samp class="option">lanczos</samp></dt>
  30707. </dl>
  30708. </dd>
  30709. <dt><samp class="option">force_original_aspect_ratio</samp></dt>
  30710. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  30711. keep the original aspect ratio. Possible values:
  30712. </p>
  30713. <dl class="table">
  30714. <dt>&lsquo;<samp class="samp">disable</samp>&rsquo;</dt>
  30715. <dd><p>Scale the video as specified and disable this feature.
  30716. </p>
  30717. </dd>
  30718. <dt>&lsquo;<samp class="samp">decrease</samp>&rsquo;</dt>
  30719. <dd><p>The output video dimensions will automatically be decreased if needed.
  30720. </p>
  30721. </dd>
  30722. <dt>&lsquo;<samp class="samp">increase</samp>&rsquo;</dt>
  30723. <dd><p>The output video dimensions will automatically be increased if needed.
  30724. </p>
  30725. </dd>
  30726. </dl>
  30727. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  30728. maximum allowed resolution, you can use this to limit the output video to
  30729. that, while retaining the aspect ratio. For example, device A allows
  30730. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  30731. decrease) and specifying 1280x720 to the command line makes the output
  30732. 1280x533.
  30733. </p>
  30734. <p>Please note that this is a different thing than specifying -1 for <samp class="option">w</samp>
  30735. or <samp class="option">h</samp>, you still need to specify the output resolution for this option
  30736. to work.
  30737. </p>
  30738. </dd>
  30739. <dt><samp class="option">force_divisible_by</samp></dt>
  30740. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  30741. given integer when used together with <samp class="option">force_original_aspect_ratio</samp>. This
  30742. works similar to using <code class="code">-n</code> in the <samp class="option">w</samp> and <samp class="option">h</samp> options.
  30743. </p>
  30744. <p>This option respects the value set for <samp class="option">force_original_aspect_ratio</samp>,
  30745. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  30746. may be slightly modified.
  30747. </p>
  30748. <p>This option can be handy if you need to have a video fit within or exceed
  30749. a defined resolution using <samp class="option">force_original_aspect_ratio</samp> but also have
  30750. encoder restrictions on width or height divisibility.
  30751. </p>
  30752. </dd>
  30753. <dt><samp class="option">reset_sar</samp></dt>
  30754. <dd><p>Works the same as the identical <a class="ref" href="#scale">scale</a> filter option.
  30755. </p>
  30756. </dd>
  30757. <dt><samp class="option">eval</samp></dt>
  30758. <dd><p>Specify when to evaluate <var class="var">width</var> and <var class="var">height</var> expression. It accepts the following values:
  30759. </p>
  30760. <dl class="table">
  30761. <dt>&lsquo;<samp class="samp">init</samp>&rsquo;</dt>
  30762. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  30763. </p>
  30764. </dd>
  30765. <dt>&lsquo;<samp class="samp">frame</samp>&rsquo;</dt>
  30766. <dd><p>Evaluate expressions for each incoming frame.
  30767. </p>
  30768. </dd>
  30769. </dl>
  30770. </dd>
  30771. </dl>
  30772. <p>The values of the <samp class="option">w</samp> and <samp class="option">h</samp> options are expressions
  30773. containing the following constants:
  30774. </p>
  30775. <dl class="table">
  30776. <dt><var class="var">in_w</var></dt>
  30777. <dt><var class="var">in_h</var></dt>
  30778. <dd><p>The input width and height
  30779. </p>
  30780. </dd>
  30781. <dt><var class="var">iw</var></dt>
  30782. <dt><var class="var">ih</var></dt>
  30783. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  30784. </p>
  30785. </dd>
  30786. <dt><var class="var">out_w</var></dt>
  30787. <dt><var class="var">out_h</var></dt>
  30788. <dd><p>The output (scaled) width and height
  30789. </p>
  30790. </dd>
  30791. <dt><var class="var">ow</var></dt>
  30792. <dt><var class="var">oh</var></dt>
  30793. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>
  30794. </p>
  30795. </dd>
  30796. <dt><var class="var">a</var></dt>
  30797. <dd><p>The same as <var class="var">iw</var> / <var class="var">ih</var>
  30798. </p>
  30799. </dd>
  30800. <dt><var class="var">sar</var></dt>
  30801. <dd><p>input sample aspect ratio
  30802. </p>
  30803. </dd>
  30804. <dt><var class="var">dar</var></dt>
  30805. <dd><p>The input display aspect ratio. Calculated from <code class="code">(iw / ih) * sar</code>.
  30806. </p>
  30807. </dd>
  30808. <dt><var class="var">n</var></dt>
  30809. <dd><p>The (sequential) number of the input frame, starting from 0.
  30810. Only available with <code class="code">eval=frame</code>.
  30811. </p>
  30812. </dd>
  30813. <dt><var class="var">t</var></dt>
  30814. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  30815. seconds. Only available with <code class="code">eval=frame</code>.
  30816. </p>
  30817. </dd>
  30818. <dt><var class="var">pos</var></dt>
  30819. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  30820. this information is unavailable and/or meaningless (for example in case of synthetic video).
  30821. Only available with <code class="code">eval=frame</code>.
  30822. Deprecated, do not use.
  30823. </p></dd>
  30824. </dl>
  30825. <a name="scale2ref_005fnpp"></a>
  30826. <h4 class="subsection">12.2.2 scale2ref_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale2ref_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale2ref_005fnpp" aria-hidden="true">TOC</a></span></h4>
  30827. <p>Use the NVIDIA Performance Primitives (libnpp) to scale (resize) the input
  30828. video, based on a reference video.
  30829. </p>
  30830. <p>See the <a class="ref" href="#scale_005fnpp">scale_npp</a> filter for available options, scale2ref_npp supports the same
  30831. but uses the reference video instead of the main input as basis. scale2ref_npp
  30832. also supports the following additional constants for the <samp class="option">w</samp> and
  30833. <samp class="option">h</samp> options:
  30834. </p>
  30835. <dl class="table">
  30836. <dt><var class="var">main_w</var></dt>
  30837. <dt><var class="var">main_h</var></dt>
  30838. <dd><p>The main input video&rsquo;s width and height
  30839. </p>
  30840. </dd>
  30841. <dt><var class="var">main_a</var></dt>
  30842. <dd><p>The same as <var class="var">main_w</var> / <var class="var">main_h</var>
  30843. </p>
  30844. </dd>
  30845. <dt><var class="var">main_sar</var></dt>
  30846. <dd><p>The main input video&rsquo;s sample aspect ratio
  30847. </p>
  30848. </dd>
  30849. <dt><var class="var">main_dar, mdar</var></dt>
  30850. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  30851. <code class="code">(main_w / main_h) * main_sar</code>.
  30852. </p>
  30853. </dd>
  30854. <dt><var class="var">main_n</var></dt>
  30855. <dd><p>The (sequential) number of the main input frame, starting from 0.
  30856. Only available with <code class="code">eval=frame</code>.
  30857. </p>
  30858. </dd>
  30859. <dt><var class="var">main_t</var></dt>
  30860. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  30861. seconds. Only available with <code class="code">eval=frame</code>.
  30862. </p>
  30863. </dd>
  30864. <dt><var class="var">main_pos</var></dt>
  30865. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  30866. this information is unavailable and/or meaningless (for example in case of synthetic video).
  30867. Only available with <code class="code">eval=frame</code>.
  30868. </p></dd>
  30869. </dl>
  30870. <a name="Examples-146"></a>
  30871. <h4 class="subsubsection">12.2.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-146" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-146" aria-hidden="true">TOC</a></span></h4>
  30872. <ul class="itemize mark-bullet">
  30873. <li>Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  30874. <div class="example">
  30875. <pre class="example-preformatted">'scale2ref_npp[b][a];[a][b]overlay_cuda'
  30876. </pre></div>
  30877. </li><li>Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  30878. <div class="example">
  30879. <pre class="example-preformatted">[logo-in][video-in]scale2ref_npp=w=oh*mdar:h=ih/10[logo-out][video-out]
  30880. </pre></div>
  30881. </li></ul>
  30882. <a name="sharpen_005fnpp"></a>
  30883. <h4 class="subsection">12.2.3 sharpen_npp<span class="pull-right"><a class="anchor hidden-xs" href="#sharpen_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sharpen_005fnpp" aria-hidden="true">TOC</a></span></h4>
  30884. <p>Use the NVIDIA Performance Primitives (libnpp) to perform image sharpening with
  30885. border control.
  30886. </p>
  30887. <p>The following additional options are accepted:
  30888. </p><dl class="table">
  30889. <dt><samp class="option">border_type</samp></dt>
  30890. <dd><p>Type of sampling to be used ad frame borders. One of the following:
  30891. </p><dl class="table">
  30892. <dt><samp class="option">replicate</samp></dt>
  30893. <dd><p>Replicate pixel values.
  30894. </p>
  30895. </dd>
  30896. </dl>
  30897. </dd>
  30898. </dl>
  30899. <a name="transpose_005fnpp"></a>
  30900. <h4 class="subsection">12.2.4 transpose_npp<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fnpp" aria-hidden="true">TOC</a></span></h4>
  30901. <p>Transpose rows with columns in the input video and optionally flip it.
  30902. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  30903. </p>
  30904. <p>It accepts the following parameters:
  30905. </p>
  30906. <dl class="table">
  30907. <dt><samp class="option">dir</samp></dt>
  30908. <dd><p>Specify the transposition direction.
  30909. </p>
  30910. <p>Can assume the following values:
  30911. </p><dl class="table">
  30912. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  30913. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  30914. </p>
  30915. </dd>
  30916. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  30917. <dd><p>Rotate by 90 degrees clockwise.
  30918. </p>
  30919. </dd>
  30920. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  30921. <dd><p>Rotate by 90 degrees counterclockwise.
  30922. </p>
  30923. </dd>
  30924. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  30925. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  30926. </p></dd>
  30927. </dl>
  30928. </dd>
  30929. <dt><samp class="option">passthrough</samp></dt>
  30930. <dd><p>Do not apply the transposition if the input geometry matches the one
  30931. specified by the specified value. It accepts the following values:
  30932. </p><dl class="table">
  30933. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  30934. <dd><p>Always apply transposition. (default)
  30935. </p></dd>
  30936. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  30937. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  30938. </p></dd>
  30939. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  30940. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  30941. </p></dd>
  30942. </dl>
  30943. </dd>
  30944. </dl>
  30945. <a name="OpenCL-Video-Filters"></a>
  30946. <h2 class="chapter">13 OpenCL Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#OpenCL-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-OpenCL-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  30947. <p>Below is a description of the currently available OpenCL video filters.
  30948. </p>
  30949. <p>To enable compilation of these filters you need to configure FFmpeg with
  30950. <code class="code">--enable-opencl</code>.
  30951. </p>
  30952. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  30953. </p><dl class="table">
  30954. <dt><samp class="option">-init_hw_device opencl[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  30955. <dd><p>Initialise a new hardware device of type <var class="var">opencl</var> called <var class="var">name</var>, using the
  30956. given device parameters.
  30957. </p>
  30958. </dd>
  30959. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  30960. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  30961. </p>
  30962. </dd>
  30963. </dl>
  30964. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  30965. </p>
  30966. <ul class="itemize mark-bullet">
  30967. <li>Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  30968. <div class="example">
  30969. <pre class="example-preformatted">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  30970. </pre></div>
  30971. </li></ul>
  30972. <p>Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded(<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a class="ref" 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 class="ref" href="#format">format</a> filter immediately before to get the input into the right format and <a class="ref" href="#hwdownload">hwdownload</a> does not support all formats on the output - it may be necessary to insert an additional <a class="ref" href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  30973. </p>
  30974. <a name="avgblur_005fopencl"></a>
  30975. <h3 class="section">13.1 avgblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  30976. <p>Apply average blur filter.
  30977. </p>
  30978. <p>The filter accepts the following options:
  30979. </p>
  30980. <dl class="table">
  30981. <dt><samp class="option">sizeX</samp></dt>
  30982. <dd><p>Set horizontal radius size.
  30983. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">1</code>.
  30984. </p>
  30985. </dd>
  30986. <dt><samp class="option">planes</samp></dt>
  30987. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  30988. </p>
  30989. </dd>
  30990. <dt><samp class="option">sizeY</samp></dt>
  30991. <dd><p>Set vertical radius size. Range is <code class="code">[1, 1024]</code> and default value is <code class="code">0</code>. If zero, <code class="code">sizeX</code> value will be used.
  30992. </p></dd>
  30993. </dl>
  30994. <a name="Example-1"></a>
  30995. <h4 class="subsection">13.1.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-1" aria-hidden="true">TOC</a></span></h4>
  30996. <ul class="itemize mark-bullet">
  30997. <li>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.
  30998. <div class="example">
  30999. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  31000. </pre></div>
  31001. </li></ul>
  31002. <a name="boxblur_005fopencl"></a>
  31003. <h3 class="section">13.2 boxblur_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#boxblur_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-boxblur_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31004. <p>Apply a boxblur algorithm to the input video.
  31005. </p>
  31006. <p>It accepts the following parameters:
  31007. </p>
  31008. <dl class="table">
  31009. <dt><samp class="option">luma_radius, lr</samp></dt>
  31010. <dt><samp class="option">luma_power, lp</samp></dt>
  31011. <dt><samp class="option">chroma_radius, cr</samp></dt>
  31012. <dt><samp class="option">chroma_power, cp</samp></dt>
  31013. <dt><samp class="option">alpha_radius, ar</samp></dt>
  31014. <dt><samp class="option">alpha_power, ap</samp></dt>
  31015. </dl>
  31016. <p>A description of the accepted options follows.
  31017. </p>
  31018. <dl class="table">
  31019. <dt><samp class="option">luma_radius, lr</samp></dt>
  31020. <dt><samp class="option">chroma_radius, cr</samp></dt>
  31021. <dt><samp class="option">alpha_radius, ar</samp></dt>
  31022. <dd><p>Set an expression for the box radius in pixels used for blurring the
  31023. corresponding input plane.
  31024. </p>
  31025. <p>The radius value must be a non-negative number, and must not be
  31026. greater than the value of the expression <code class="code">min(w,h)/2</code> for the
  31027. luma and alpha planes, and of <code class="code">min(cw,ch)/2</code> for the chroma
  31028. planes.
  31029. </p>
  31030. <p>Default value for <samp class="option">luma_radius</samp> is &quot;2&quot;. If not specified,
  31031. <samp class="option">chroma_radius</samp> and <samp class="option">alpha_radius</samp> default to the
  31032. corresponding value set for <samp class="option">luma_radius</samp>.
  31033. </p>
  31034. <p>The expressions can contain the following constants:
  31035. </p><dl class="table">
  31036. <dt><samp class="option">w</samp></dt>
  31037. <dt><samp class="option">h</samp></dt>
  31038. <dd><p>The input width and height in pixels.
  31039. </p>
  31040. </dd>
  31041. <dt><samp class="option">cw</samp></dt>
  31042. <dt><samp class="option">ch</samp></dt>
  31043. <dd><p>The input chroma image width and height in pixels.
  31044. </p>
  31045. </dd>
  31046. <dt><samp class="option">hsub</samp></dt>
  31047. <dt><samp class="option">vsub</samp></dt>
  31048. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  31049. pixel format &quot;yuv422p&quot;, <var class="var">hsub</var> is 2 and <var class="var">vsub</var> is 1.
  31050. </p></dd>
  31051. </dl>
  31052. </dd>
  31053. <dt><samp class="option">luma_power, lp</samp></dt>
  31054. <dt><samp class="option">chroma_power, cp</samp></dt>
  31055. <dt><samp class="option">alpha_power, ap</samp></dt>
  31056. <dd><p>Specify how many times the boxblur filter is applied to the
  31057. corresponding plane.
  31058. </p>
  31059. <p>Default value for <samp class="option">luma_power</samp> is 2. If not specified,
  31060. <samp class="option">chroma_power</samp> and <samp class="option">alpha_power</samp> default to the
  31061. corresponding value set for <samp class="option">luma_power</samp>.
  31062. </p>
  31063. <p>A value of 0 will disable the effect.
  31064. </p></dd>
  31065. </dl>
  31066. <a name="Examples-147"></a>
  31067. <h4 class="subsection">13.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-147" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-147" aria-hidden="true">TOC</a></span></h4>
  31068. <p>Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses <var class="var">luma_radius</var>, <var class="var">chroma_radius</var>, <var class="var">alpha_radius</var> for each plane respectively. The filter will apply <var class="var">luma_power</var>, <var class="var">chroma_power</var>, <var class="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.
  31069. </p>
  31070. <ul class="itemize mark-bullet">
  31071. <li>Apply a boxblur filter with the luma, chroma, and alpha radius
  31072. 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.
  31073. <div class="example">
  31074. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  31075. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  31076. </pre></div>
  31077. </li><li>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.
  31078. <p>For the luma plane, a 2x2 box radius will be run once.
  31079. </p>
  31080. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  31081. </p>
  31082. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  31083. </p><div class="example">
  31084. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  31085. </pre></div>
  31086. </li></ul>
  31087. <a name="colorkey_005fopencl"></a>
  31088. <h3 class="section">13.3 colorkey_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#colorkey_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-colorkey_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31089. <p>RGB colorspace color keying.
  31090. </p>
  31091. <p>The filter accepts the following options:
  31092. </p>
  31093. <dl class="table">
  31094. <dt><samp class="option">color</samp></dt>
  31095. <dd><p>The color which will be replaced with transparency.
  31096. </p>
  31097. </dd>
  31098. <dt><samp class="option">similarity</samp></dt>
  31099. <dd><p>Similarity percentage with the key color.
  31100. </p>
  31101. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  31102. </p>
  31103. </dd>
  31104. <dt><samp class="option">blend</samp></dt>
  31105. <dd><p>Blend percentage.
  31106. </p>
  31107. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  31108. </p>
  31109. <p>Higher values result in semi-transparent pixels, with a higher transparency
  31110. the more similar the pixels color is to the key color.
  31111. </p></dd>
  31112. </dl>
  31113. <a name="Examples-148"></a>
  31114. <h4 class="subsection">13.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-148" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-148" aria-hidden="true">TOC</a></span></h4>
  31115. <ul class="itemize mark-bullet">
  31116. <li>Make every semi-green pixel in the input transparent with some slight blending:
  31117. <div class="example">
  31118. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  31119. </pre></div>
  31120. </li></ul>
  31121. <a name="convolution_005fopencl"></a>
  31122. <h3 class="section">13.4 convolution_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#convolution_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-convolution_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31123. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  31124. </p>
  31125. <p>The filter accepts the following options:
  31126. </p>
  31127. <dl class="table">
  31128. <dt><samp class="option">0m</samp></dt>
  31129. <dt><samp class="option">1m</samp></dt>
  31130. <dt><samp class="option">2m</samp></dt>
  31131. <dt><samp class="option">3m</samp></dt>
  31132. <dd><p>Set matrix for each plane.
  31133. Matrix is sequence of 9, 25 or 49 signed numbers.
  31134. Default value for each plane is <code class="code">0 0 0 0 1 0 0 0 0</code>.
  31135. </p>
  31136. </dd>
  31137. <dt><samp class="option">0rdiv</samp></dt>
  31138. <dt><samp class="option">1rdiv</samp></dt>
  31139. <dt><samp class="option">2rdiv</samp></dt>
  31140. <dt><samp class="option">3rdiv</samp></dt>
  31141. <dd><p>Set multiplier for calculated value for each plane.
  31142. If unset or 0, it will be sum of all matrix elements.
  31143. The option value must be a float number greater or equal to <code class="code">0.0</code>. Default value is <code class="code">1.0</code>.
  31144. </p>
  31145. </dd>
  31146. <dt><samp class="option">0bias</samp></dt>
  31147. <dt><samp class="option">1bias</samp></dt>
  31148. <dt><samp class="option">2bias</samp></dt>
  31149. <dt><samp class="option">3bias</samp></dt>
  31150. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  31151. Useful for making the overall image brighter or darker.
  31152. The option value must be a float number greater or equal to <code class="code">0.0</code>. Default value is <code class="code">0.0</code>.
  31153. </p>
  31154. </dd>
  31155. </dl>
  31156. <a name="Examples-149"></a>
  31157. <h4 class="subsection">13.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-149" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-149" aria-hidden="true">TOC</a></span></h4>
  31158. <ul class="itemize mark-bullet">
  31159. <li>Apply sharpen:
  31160. <div class="example">
  31161. <pre class="example-preformatted">-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
  31162. </pre></div>
  31163. </li><li>Apply blur:
  31164. <div class="example">
  31165. <pre class="example-preformatted">-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
  31166. </pre></div>
  31167. </li><li>Apply edge enhance:
  31168. <div class="example">
  31169. <pre class="example-preformatted">-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
  31170. </pre></div>
  31171. </li><li>Apply edge detect:
  31172. <div class="example">
  31173. <pre class="example-preformatted">-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
  31174. </pre></div>
  31175. </li><li>Apply laplacian edge detector which includes diagonals:
  31176. <div class="example">
  31177. <pre class="example-preformatted">-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
  31178. </pre></div>
  31179. </li><li>Apply emboss:
  31180. <div class="example">
  31181. <pre class="example-preformatted">-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
  31182. </pre></div>
  31183. </li></ul>
  31184. <a name="erosion_005fopencl"></a>
  31185. <h3 class="section">13.5 erosion_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#erosion_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31186. <p>Apply erosion effect to the video.
  31187. </p>
  31188. <p>This filter replaces the pixel by the local(3x3) minimum.
  31189. </p>
  31190. <p>It accepts the following options:
  31191. </p>
  31192. <dl class="table">
  31193. <dt><samp class="option">threshold0</samp></dt>
  31194. <dt><samp class="option">threshold1</samp></dt>
  31195. <dt><samp class="option">threshold2</samp></dt>
  31196. <dt><samp class="option">threshold3</samp></dt>
  31197. <dd><p>Limit the maximum change for each plane. Range is <code class="code">[0, 65535]</code> and default value is <code class="code">65535</code>.
  31198. If <code class="code">0</code>, plane will remain unchanged.
  31199. </p>
  31200. </dd>
  31201. <dt><samp class="option">coordinates</samp></dt>
  31202. <dd><p>Flag which specifies the pixel to refer to.
  31203. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  31204. </p>
  31205. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  31206. </p>
  31207. <p>1 2 3
  31208. </p>
  31209. <p>4 x 5
  31210. </p>
  31211. <p>6 7 8
  31212. </p></dd>
  31213. </dl>
  31214. <a name="Example-2"></a>
  31215. <h4 class="subsection">13.5.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-2" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-2" aria-hidden="true">TOC</a></span></h4>
  31216. <ul class="itemize mark-bullet">
  31217. <li>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.
  31218. <div class="example">
  31219. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  31220. </pre></div>
  31221. </li></ul>
  31222. <a name="deshake_005fopencl"></a>
  31223. <h3 class="section">13.6 deshake_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#deshake_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-deshake_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31224. <p>Feature-point based video stabilization filter.
  31225. </p>
  31226. <p>The filter accepts the following options:
  31227. </p>
  31228. <dl class="table">
  31229. <dt><samp class="option">tripod</samp></dt>
  31230. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code class="code">0</code>.
  31231. </p>
  31232. </dd>
  31233. <dt><samp class="option">debug</samp></dt>
  31234. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  31235. </p>
  31236. <p>Note that in order to see console debug output you will also need to pass <code class="code">-v verbose</code> to ffmpeg.
  31237. </p>
  31238. <p>Viewing point matches in the output video is only supported for RGB input.
  31239. </p>
  31240. <p>Defaults to <code class="code">0</code>.
  31241. </p>
  31242. </dd>
  31243. <dt><samp class="option">adaptive_crop</samp></dt>
  31244. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  31245. </p>
  31246. <p>Defaults to <code class="code">1</code>.
  31247. </p>
  31248. </dd>
  31249. <dt><samp class="option">refine_features</samp></dt>
  31250. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  31251. </p>
  31252. <p>This can be turned off for a slight performance gain at the cost of precision.
  31253. </p>
  31254. <p>Defaults to <code class="code">1</code>.
  31255. </p>
  31256. </dd>
  31257. <dt><samp class="option">smooth_strength</samp></dt>
  31258. <dd><p>The strength of the smoothing applied to the camera path from <code class="code">0.0</code> to <code class="code">1.0</code>.
  31259. </p>
  31260. <p><code class="code">1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  31261. </p>
  31262. <p><code class="code">0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  31263. </p>
  31264. <p>Defaults to <code class="code">0.0</code>.
  31265. </p>
  31266. </dd>
  31267. <dt><samp class="option">smooth_window_multiplier</samp></dt>
  31268. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  31269. </p>
  31270. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  31271. </p>
  31272. <p>Acceptable values range from <code class="code">0.1</code> to <code class="code">10.0</code>.
  31273. </p>
  31274. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  31275. potentially improving smoothness, but also increase latency and memory usage.
  31276. </p>
  31277. <p>Defaults to <code class="code">2.0</code>.
  31278. </p>
  31279. </dd>
  31280. </dl>
  31281. <a name="Examples-150"></a>
  31282. <h4 class="subsection">13.6.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-150" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-150" aria-hidden="true">TOC</a></span></h4>
  31283. <ul class="itemize mark-bullet">
  31284. <li>Stabilize a video with a fixed, medium smoothing strength:
  31285. <div class="example">
  31286. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  31287. </pre></div>
  31288. </li><li>Stabilize a video with debugging (both in console and in rendered video):
  31289. <div class="example">
  31290. <pre class="example-preformatted">-i INPUT -filter_complex &quot;[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p&quot; -v verbose OUTPUT
  31291. </pre></div>
  31292. </li></ul>
  31293. <a name="dilation_005fopencl"></a>
  31294. <h3 class="section">13.7 dilation_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#dilation_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31295. <p>Apply dilation effect to the video.
  31296. </p>
  31297. <p>This filter replaces the pixel by the local(3x3) maximum.
  31298. </p>
  31299. <p>It accepts the following options:
  31300. </p>
  31301. <dl class="table">
  31302. <dt><samp class="option">threshold0</samp></dt>
  31303. <dt><samp class="option">threshold1</samp></dt>
  31304. <dt><samp class="option">threshold2</samp></dt>
  31305. <dt><samp class="option">threshold3</samp></dt>
  31306. <dd><p>Limit the maximum change for each plane. Range is <code class="code">[0, 65535]</code> and default value is <code class="code">65535</code>.
  31307. If <code class="code">0</code>, plane will remain unchanged.
  31308. </p>
  31309. </dd>
  31310. <dt><samp class="option">coordinates</samp></dt>
  31311. <dd><p>Flag which specifies the pixel to refer to.
  31312. Range is <code class="code">[0, 255]</code> and default value is <code class="code">255</code>, i.e. all eight pixels are used.
  31313. </p>
  31314. <p>Flags to local 3x3 coordinates region centered on <code class="code">x</code>:
  31315. </p>
  31316. <p>1 2 3
  31317. </p>
  31318. <p>4 x 5
  31319. </p>
  31320. <p>6 7 8
  31321. </p></dd>
  31322. </dl>
  31323. <a name="Example-3"></a>
  31324. <h4 class="subsection">13.7.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-3" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-3" aria-hidden="true">TOC</a></span></h4>
  31325. <ul class="itemize mark-bullet">
  31326. <li>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.
  31327. <div class="example">
  31328. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  31329. </pre></div>
  31330. </li></ul>
  31331. <a class="anchor" id="nlmeans_005fopencl"></a><a name="nlmeans_005fopencl-1"></a>
  31332. <h3 class="section">13.8 nlmeans_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  31333. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a class="ref" href="#nlmeans">nlmeans</a>.
  31334. </p>
  31335. <a name="overlay_005fopencl"></a>
  31336. <h3 class="section">13.9 overlay_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31337. <p>Overlay one video on top of another.
  31338. </p>
  31339. <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.
  31340. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  31341. </p>
  31342. <p>The filter accepts the following options:
  31343. </p>
  31344. <dl class="table">
  31345. <dt><samp class="option">x</samp></dt>
  31346. <dd><p>Set the x coordinate of the overlaid video on the main video.
  31347. Default value is <code class="code">0</code>.
  31348. </p>
  31349. </dd>
  31350. <dt><samp class="option">y</samp></dt>
  31351. <dd><p>Set the y coordinate of the overlaid video on the main video.
  31352. Default value is <code class="code">0</code>.
  31353. </p>
  31354. </dd>
  31355. </dl>
  31356. <a name="Examples-151"></a>
  31357. <h4 class="subsection">13.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-151" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-151" aria-hidden="true">TOC</a></span></h4>
  31358. <ul class="itemize mark-bullet">
  31359. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  31360. <div class="example">
  31361. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  31362. </pre></div>
  31363. </li><li>The inputs have same memory layout for color channels , the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  31364. <div class="example">
  31365. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  31366. </pre></div>
  31367. </li></ul>
  31368. <a name="pad_005fopencl"></a>
  31369. <h3 class="section">13.10 pad_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31370. <p>Add paddings to the input image, and place the original input at the
  31371. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  31372. </p>
  31373. <p>It accepts the following options:
  31374. </p>
  31375. <dl class="table">
  31376. <dt><samp class="option">width, w</samp></dt>
  31377. <dt><samp class="option">height, h</samp></dt>
  31378. <dd><p>Specify an expression for the size of the output image with the
  31379. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  31380. corresponding input size is used for the output.
  31381. </p>
  31382. <p>The <var class="var">width</var> expression can reference the value set by the
  31383. <var class="var">height</var> expression, and vice versa.
  31384. </p>
  31385. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  31386. </p>
  31387. </dd>
  31388. <dt><samp class="option">x</samp></dt>
  31389. <dt><samp class="option">y</samp></dt>
  31390. <dd><p>Specify the offsets to place the input image at within the padded area,
  31391. with respect to the top/left border of the output image.
  31392. </p>
  31393. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  31394. expression, and vice versa.
  31395. </p>
  31396. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  31397. </p>
  31398. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  31399. so the input image is centered on the padded area.
  31400. </p>
  31401. </dd>
  31402. <dt><samp class="option">color</samp></dt>
  31403. <dd><p>Specify the color of the padded area. For the syntax of this option,
  31404. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  31405. manual</a>.
  31406. </p>
  31407. </dd>
  31408. <dt><samp class="option">aspect</samp></dt>
  31409. <dd><p>Pad to an aspect instead to a resolution.
  31410. </p></dd>
  31411. </dl>
  31412. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  31413. options are expressions containing the following constants:
  31414. </p>
  31415. <dl class="table">
  31416. <dt><samp class="option">in_w</samp></dt>
  31417. <dt><samp class="option">in_h</samp></dt>
  31418. <dd><p>The input video width and height.
  31419. </p>
  31420. </dd>
  31421. <dt><samp class="option">iw</samp></dt>
  31422. <dt><samp class="option">ih</samp></dt>
  31423. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  31424. </p>
  31425. </dd>
  31426. <dt><samp class="option">out_w</samp></dt>
  31427. <dt><samp class="option">out_h</samp></dt>
  31428. <dd><p>The output width and height (the size of the padded area), as
  31429. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  31430. </p>
  31431. </dd>
  31432. <dt><samp class="option">ow</samp></dt>
  31433. <dt><samp class="option">oh</samp></dt>
  31434. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  31435. </p>
  31436. </dd>
  31437. <dt><samp class="option">x</samp></dt>
  31438. <dt><samp class="option">y</samp></dt>
  31439. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  31440. expressions, or NAN if not yet specified.
  31441. </p>
  31442. </dd>
  31443. <dt><samp class="option">a</samp></dt>
  31444. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  31445. </p>
  31446. </dd>
  31447. <dt><samp class="option">sar</samp></dt>
  31448. <dd><p>input sample aspect ratio
  31449. </p>
  31450. </dd>
  31451. <dt><samp class="option">dar</samp></dt>
  31452. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  31453. </p></dd>
  31454. </dl>
  31455. <a name="prewitt_005fopencl"></a>
  31456. <h3 class="section">13.11 prewitt_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#prewitt_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-prewitt_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31457. <p>Apply the Prewitt operator (<a class="url" href="https://en.wikipedia.org/wiki/Prewitt_operator">https://en.wikipedia.org/wiki/Prewitt_operator</a>) to input video stream.
  31458. </p>
  31459. <p>The filter accepts the following option:
  31460. </p>
  31461. <dl class="table">
  31462. <dt><samp class="option">planes</samp></dt>
  31463. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  31464. </p>
  31465. </dd>
  31466. <dt><samp class="option">scale</samp></dt>
  31467. <dd><p>Set value which will be multiplied with filtered result.
  31468. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  31469. </p>
  31470. </dd>
  31471. <dt><samp class="option">delta</samp></dt>
  31472. <dd><p>Set value which will be added to filtered result.
  31473. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  31474. </p></dd>
  31475. </dl>
  31476. <a name="Example-4"></a>
  31477. <h4 class="subsection">13.11.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-4" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-4" aria-hidden="true">TOC</a></span></h4>
  31478. <ul class="itemize mark-bullet">
  31479. <li>Apply the Prewitt operator with scale set to 2 and delta set to 10.
  31480. <div class="example">
  31481. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  31482. </pre></div>
  31483. </li></ul>
  31484. <a class="anchor" id="program_005fopencl"></a><a name="program_005fopencl-1"></a>
  31485. <h3 class="section">13.12 program_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#program_005fopencl-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-program_005fopencl-1" aria-hidden="true">TOC</a></span></h3>
  31486. <p>Filter video using an OpenCL program.
  31487. </p>
  31488. <dl class="table">
  31489. <dt><samp class="option">source</samp></dt>
  31490. <dd><p>OpenCL program source file.
  31491. </p>
  31492. </dd>
  31493. <dt><samp class="option">kernel</samp></dt>
  31494. <dd><p>Kernel name in program.
  31495. </p>
  31496. </dd>
  31497. <dt><samp class="option">inputs</samp></dt>
  31498. <dd><p>Number of inputs to the filter. Defaults to 1.
  31499. </p>
  31500. </dd>
  31501. <dt><samp class="option">size, s</samp></dt>
  31502. <dd><p>Size of output frames. Defaults to the same as the first input.
  31503. </p>
  31504. </dd>
  31505. </dl>
  31506. <p>The <code class="code">program_opencl</code> filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  31507. </p>
  31508. <p>The program source file must contain a kernel function with the given name,
  31509. which will be run once for each plane of the output. Each run on a plane
  31510. gets enqueued as a separate 2D global NDRange with one work-item for each
  31511. pixel to be generated. The global ID offset for each work-item is therefore
  31512. the coordinates of a pixel in the destination image.
  31513. </p>
  31514. <p>The kernel function needs to take the following arguments:
  31515. </p><ul class="itemize mark-bullet">
  31516. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  31517. <p>This image will become the output; the kernel should write all of it.
  31518. </p></li><li>Frame index, <var class="var">unsigned int</var>.
  31519. <p>This is a counter starting from zero and increasing by one for each frame.
  31520. </p></li><li>Source images, <var class="var">__read_only image2d_t</var>.
  31521. <p>These are the most recent images on each input. The kernel may read from
  31522. them to generate the output, but they can&rsquo;t be written to.
  31523. </p></li></ul>
  31524. <p>Example programs:
  31525. </p>
  31526. <ul class="itemize mark-bullet">
  31527. <li>Copy the input to the output (output must be the same size as the input).
  31528. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  31529. unsigned int index,
  31530. __read_only image2d_t source)
  31531. {
  31532. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  31533. int2 location = (int2)(get_global_id(0), get_global_id(1));
  31534. float4 value = read_imagef(source, sampler, location);
  31535. write_imagef(destination, location, value);
  31536. }
  31537. </pre>
  31538. </li><li>Apply a simple transformation, rotating the input by an amount increasing
  31539. with the index counter. Pixel values are linearly interpolated by the
  31540. sampler, and the output need not have the same dimensions as the input.
  31541. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  31542. unsigned int index,
  31543. __read_only image2d_t src)
  31544. {
  31545. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  31546. CLK_FILTER_LINEAR);
  31547. float angle = (float)index / 100.0f;
  31548. float2 dst_dim = convert_float2(get_image_dim(dst));
  31549. float2 src_dim = convert_float2(get_image_dim(src));
  31550. float2 dst_cen = dst_dim / 2.0f;
  31551. float2 src_cen = src_dim / 2.0f;
  31552. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  31553. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  31554. float2 src_pos = {
  31555. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  31556. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  31557. };
  31558. src_pos = src_pos * src_dim / dst_dim;
  31559. float2 src_loc = src_pos + src_cen;
  31560. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  31561. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  31562. write_imagef(dst, dst_loc, 0.5f);
  31563. else
  31564. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  31565. }
  31566. </pre>
  31567. </li><li>Blend two inputs together, with the amount of each input used varying
  31568. with the index counter.
  31569. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  31570. unsigned int index,
  31571. __read_only image2d_t src1,
  31572. __read_only image2d_t src2)
  31573. {
  31574. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  31575. CLK_FILTER_LINEAR);
  31576. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  31577. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  31578. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  31579. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  31580. float4 val1 = read_imagef(src1, sampler, src1_loc);
  31581. float4 val2 = read_imagef(src2, sampler, src2_loc);
  31582. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  31583. }
  31584. </pre>
  31585. </li></ul>
  31586. <a name="remap_005fopencl"></a>
  31587. <h3 class="section">13.13 remap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#remap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-remap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31588. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  31589. </p>
  31590. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  31591. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  31592. value for pixel will be used for destination pixel.
  31593. </p>
  31594. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  31595. will have Xmap/Ymap video stream dimensions.
  31596. Xmap and Ymap input video streams are 32bit float pixel format, single channel.
  31597. </p>
  31598. <dl class="table">
  31599. <dt><samp class="option">interp</samp></dt>
  31600. <dd><p>Specify interpolation used for remapping of pixels.
  31601. Allowed values are <code class="code">near</code> and <code class="code">linear</code>.
  31602. Default value is <code class="code">linear</code>.
  31603. </p>
  31604. </dd>
  31605. <dt><samp class="option">fill</samp></dt>
  31606. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  31607. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  31608. manual</a>. Default color is <code class="code">black</code>.
  31609. </p></dd>
  31610. </dl>
  31611. <a name="roberts_005fopencl"></a>
  31612. <h3 class="section">13.14 roberts_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#roberts_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-roberts_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31613. <p>Apply the Roberts cross operator (<a class="url" href="https://en.wikipedia.org/wiki/Roberts_cross">https://en.wikipedia.org/wiki/Roberts_cross</a>) to input video stream.
  31614. </p>
  31615. <p>The filter accepts the following option:
  31616. </p>
  31617. <dl class="table">
  31618. <dt><samp class="option">planes</samp></dt>
  31619. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  31620. </p>
  31621. </dd>
  31622. <dt><samp class="option">scale</samp></dt>
  31623. <dd><p>Set value which will be multiplied with filtered result.
  31624. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  31625. </p>
  31626. </dd>
  31627. <dt><samp class="option">delta</samp></dt>
  31628. <dd><p>Set value which will be added to filtered result.
  31629. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  31630. </p></dd>
  31631. </dl>
  31632. <a name="Example-5"></a>
  31633. <h4 class="subsection">13.14.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-5" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-5" aria-hidden="true">TOC</a></span></h4>
  31634. <ul class="itemize mark-bullet">
  31635. <li>Apply the Roberts cross operator with scale set to 2 and delta set to 10
  31636. <div class="example">
  31637. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  31638. </pre></div>
  31639. </li></ul>
  31640. <a name="sobel_005fopencl"></a>
  31641. <h3 class="section">13.15 sobel_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#sobel_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sobel_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31642. <p>Apply the Sobel operator (<a class="url" href="https://en.wikipedia.org/wiki/Sobel_operator">https://en.wikipedia.org/wiki/Sobel_operator</a>) to input video stream.
  31643. </p>
  31644. <p>The filter accepts the following option:
  31645. </p>
  31646. <dl class="table">
  31647. <dt><samp class="option">planes</samp></dt>
  31648. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  31649. </p>
  31650. </dd>
  31651. <dt><samp class="option">scale</samp></dt>
  31652. <dd><p>Set value which will be multiplied with filtered result.
  31653. Range is <code class="code">[0.0, 65535]</code> and default value is <code class="code">1.0</code>.
  31654. </p>
  31655. </dd>
  31656. <dt><samp class="option">delta</samp></dt>
  31657. <dd><p>Set value which will be added to filtered result.
  31658. Range is <code class="code">[-65535, 65535]</code> and default value is <code class="code">0.0</code>.
  31659. </p></dd>
  31660. </dl>
  31661. <a name="Example-6"></a>
  31662. <h4 class="subsection">13.15.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-6" aria-hidden="true">TOC</a></span></h4>
  31663. <ul class="itemize mark-bullet">
  31664. <li>Apply sobel operator with scale set to 2 and delta set to 10
  31665. <div class="example">
  31666. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  31667. </pre></div>
  31668. </li></ul>
  31669. <a name="tonemap_005fopencl"></a>
  31670. <h3 class="section">13.16 tonemap_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31671. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  31672. </p>
  31673. <p>It accepts the following parameters:
  31674. </p>
  31675. <dl class="table">
  31676. <dt><samp class="option">tonemap</samp></dt>
  31677. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a class="ref" href="#tonemap">tonemap</a>.
  31678. </p>
  31679. </dd>
  31680. <dt><samp class="option">param</samp></dt>
  31681. <dd><p>Tune the tone mapping algorithm. same as param option in <a class="ref" href="#tonemap">tonemap</a>.
  31682. </p>
  31683. </dd>
  31684. <dt><samp class="option">desat</samp></dt>
  31685. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  31686. higher the parameter, the more color information will be preserved. This
  31687. setting helps prevent unnaturally blown-out colors for super-highlights, by
  31688. (smoothly) turning into white instead. This makes images feel more natural,
  31689. at the cost of reducing information about out-of-range colors.
  31690. </p>
  31691. <p>The default value is 0.5, and the algorithm here is a little different from
  31692. the cpu version tonemap currently. A setting of 0.0 disables this option.
  31693. </p>
  31694. </dd>
  31695. <dt><samp class="option">threshold</samp></dt>
  31696. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  31697. is used to detect whether the scene has changed or not. If the distance between
  31698. the current frame average brightness and the current running average exceeds
  31699. a threshold value, we would re-calculate scene average and peak brightness.
  31700. The default value is 0.2.
  31701. </p>
  31702. </dd>
  31703. <dt><samp class="option">format</samp></dt>
  31704. <dd><p>Specify the output pixel format.
  31705. </p>
  31706. <p>Currently supported formats are:
  31707. </p><dl class="table">
  31708. <dt><var class="var">p010</var></dt>
  31709. <dt><var class="var">nv12</var></dt>
  31710. </dl>
  31711. </dd>
  31712. <dt><samp class="option">range, r</samp></dt>
  31713. <dd><p>Set the output color range.
  31714. </p>
  31715. <p>Possible values are:
  31716. </p><dl class="table">
  31717. <dt><var class="var">tv/mpeg</var></dt>
  31718. <dt><var class="var">pc/jpeg</var></dt>
  31719. </dl>
  31720. <p>Default is same as input.
  31721. </p>
  31722. </dd>
  31723. <dt><samp class="option">primaries, p</samp></dt>
  31724. <dd><p>Set the output color primaries.
  31725. </p>
  31726. <p>Possible values are:
  31727. </p><dl class="table">
  31728. <dt><var class="var">bt709</var></dt>
  31729. <dt><var class="var">bt2020</var></dt>
  31730. </dl>
  31731. <p>Default is same as input.
  31732. </p>
  31733. </dd>
  31734. <dt><samp class="option">transfer, t</samp></dt>
  31735. <dd><p>Set the output transfer characteristics.
  31736. </p>
  31737. <p>Possible values are:
  31738. </p><dl class="table">
  31739. <dt><var class="var">bt709</var></dt>
  31740. <dt><var class="var">bt2020</var></dt>
  31741. </dl>
  31742. <p>Default is bt709.
  31743. </p>
  31744. </dd>
  31745. <dt><samp class="option">matrix, m</samp></dt>
  31746. <dd><p>Set the output colorspace matrix.
  31747. </p>
  31748. <p>Possible value are:
  31749. </p><dl class="table">
  31750. <dt><var class="var">bt709</var></dt>
  31751. <dt><var class="var">bt2020</var></dt>
  31752. </dl>
  31753. <p>Default is same as input.
  31754. </p>
  31755. </dd>
  31756. </dl>
  31757. <a name="Example-7"></a>
  31758. <h4 class="subsection">13.16.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-7" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-7" aria-hidden="true">TOC</a></span></h4>
  31759. <ul class="itemize mark-bullet">
  31760. <li>Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  31761. <div class="example">
  31762. <pre class="example-preformatted">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  31763. </pre></div>
  31764. </li></ul>
  31765. <a name="unsharp_005fopencl"></a>
  31766. <h3 class="section">13.17 unsharp_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#unsharp_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-unsharp_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31767. <p>Sharpen or blur the input video.
  31768. </p>
  31769. <p>It accepts the following parameters:
  31770. </p>
  31771. <dl class="table">
  31772. <dt><samp class="option">luma_msize_x, lx</samp></dt>
  31773. <dd><p>Set the luma matrix horizontal size.
  31774. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  31775. </p>
  31776. </dd>
  31777. <dt><samp class="option">luma_msize_y, ly</samp></dt>
  31778. <dd><p>Set the luma matrix vertical size.
  31779. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  31780. </p>
  31781. </dd>
  31782. <dt><samp class="option">luma_amount, la</samp></dt>
  31783. <dd><p>Set the luma effect strength.
  31784. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">1.0</code>.
  31785. </p>
  31786. <p>Negative values will blur the input video, while positive values will
  31787. sharpen it, a value of zero will disable the effect.
  31788. </p>
  31789. </dd>
  31790. <dt><samp class="option">chroma_msize_x, cx</samp></dt>
  31791. <dd><p>Set the chroma matrix horizontal size.
  31792. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  31793. </p>
  31794. </dd>
  31795. <dt><samp class="option">chroma_msize_y, cy</samp></dt>
  31796. <dd><p>Set the chroma matrix vertical size.
  31797. Range is <code class="code">[1, 23]</code> and default value is <code class="code">5</code>.
  31798. </p>
  31799. </dd>
  31800. <dt><samp class="option">chroma_amount, ca</samp></dt>
  31801. <dd><p>Set the chroma effect strength.
  31802. Range is <code class="code">[-10, 10]</code> and default value is <code class="code">0.0</code>.
  31803. </p>
  31804. <p>Negative values will blur the input video, while positive values will
  31805. sharpen it, a value of zero will disable the effect.
  31806. </p>
  31807. </dd>
  31808. </dl>
  31809. <p>All parameters are optional and default to the equivalent of the
  31810. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  31811. </p>
  31812. <a name="Examples-152"></a>
  31813. <h4 class="subsection">13.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-152" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-152" aria-hidden="true">TOC</a></span></h4>
  31814. <ul class="itemize mark-bullet">
  31815. <li>Apply strong luma sharpen effect:
  31816. <div class="example">
  31817. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload&quot; OUTPUT
  31818. </pre></div>
  31819. </li><li>Apply a strong blur of both luma and chroma parameters:
  31820. <div class="example">
  31821. <pre class="example-preformatted">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  31822. </pre></div>
  31823. </li></ul>
  31824. <a name="xfade_005fopencl"></a>
  31825. <h3 class="section">13.18 xfade_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#xfade_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xfade_005fopencl" aria-hidden="true">TOC</a></span></h3>
  31826. <p>Cross fade two videos with custom transition effect by using OpenCL.
  31827. </p>
  31828. <p>It accepts the following options:
  31829. </p>
  31830. <dl class="table">
  31831. <dt><samp class="option">transition</samp></dt>
  31832. <dd><p>Set one of possible transition effects.
  31833. </p>
  31834. <dl class="table">
  31835. <dt><samp class="option">custom</samp></dt>
  31836. <dd><p>Select custom transition effect, the actual transition description
  31837. will be picked from source and kernel options.
  31838. </p>
  31839. </dd>
  31840. <dt><samp class="option">fade</samp></dt>
  31841. <dt><samp class="option">wipeleft</samp></dt>
  31842. <dt><samp class="option">wiperight</samp></dt>
  31843. <dt><samp class="option">wipeup</samp></dt>
  31844. <dt><samp class="option">wipedown</samp></dt>
  31845. <dt><samp class="option">slideleft</samp></dt>
  31846. <dt><samp class="option">slideright</samp></dt>
  31847. <dt><samp class="option">slideup</samp></dt>
  31848. <dt><samp class="option">slidedown</samp></dt>
  31849. <dd>
  31850. <p>Default transition is fade.
  31851. </p></dd>
  31852. </dl>
  31853. </dd>
  31854. <dt><samp class="option">source</samp></dt>
  31855. <dd><p>OpenCL program source file for custom transition.
  31856. </p>
  31857. </dd>
  31858. <dt><samp class="option">kernel</samp></dt>
  31859. <dd><p>Set name of kernel to use for custom transition from program source file.
  31860. </p>
  31861. </dd>
  31862. <dt><samp class="option">duration</samp></dt>
  31863. <dd><p>Set duration of video transition.
  31864. </p>
  31865. </dd>
  31866. <dt><samp class="option">offset</samp></dt>
  31867. <dd><p>Set time of start of transition relative to first video.
  31868. </p></dd>
  31869. </dl>
  31870. <p>The program source file must contain a kernel function with the given name,
  31871. which will be run once for each plane of the output. Each run on a plane
  31872. gets enqueued as a separate 2D global NDRange with one work-item for each
  31873. pixel to be generated. The global ID offset for each work-item is therefore
  31874. the coordinates of a pixel in the destination image.
  31875. </p>
  31876. <p>The kernel function needs to take the following arguments:
  31877. </p><ul class="itemize mark-bullet">
  31878. <li>Destination image, <var class="var">__write_only image2d_t</var>.
  31879. <p>This image will become the output; the kernel should write all of it.
  31880. </p>
  31881. </li><li>First Source image, <var class="var">__read_only image2d_t</var>.
  31882. Second Source image, <var class="var">__read_only image2d_t</var>.
  31883. <p>These are the most recent images on each input. The kernel may read from
  31884. them to generate the output, but they can&rsquo;t be written to.
  31885. </p>
  31886. </li><li>Transition progress, <var class="var">float</var>. This value is always between 0 and 1 inclusive.
  31887. </li></ul>
  31888. <p>Example programs:
  31889. </p>
  31890. <ul class="itemize mark-bullet">
  31891. <li>Apply dots curtain transition effect:
  31892. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  31893. __read_only image2d_t src1,
  31894. __read_only image2d_t src2,
  31895. float progress)
  31896. {
  31897. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  31898. CLK_FILTER_LINEAR);
  31899. int2 p = (int2)(get_global_id(0), get_global_id(1));
  31900. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  31901. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  31902. rp = rp / dim;
  31903. float2 dots = (float2)(20.0, 20.0);
  31904. float2 center = (float2)(0,0);
  31905. float2 unused;
  31906. float4 val1 = read_imagef(src1, sampler, p);
  31907. float4 val2 = read_imagef(src2, sampler, p);
  31908. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  31909. write_imagef(dst, p, next ? val1 : val2);
  31910. }
  31911. </pre>
  31912. </li></ul>
  31913. <a name="VAAPI-Video-Filters"></a>
  31914. <h2 class="chapter">14 VAAPI Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VAAPI-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VAAPI-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  31915. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  31916. </p>
  31917. <p>To enable compilation of these filters you need to configure FFmpeg with
  31918. <code class="code">--enable-vaapi</code>.
  31919. </p>
  31920. <p>To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read <a class="url" href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI">https://trac.ffmpeg.org/wiki/Hardware/VAAPI</a>
  31921. </p>
  31922. <a name="overlay_005fvaapi"></a>
  31923. <h3 class="section">14.1 overlay_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  31924. <p>Overlay one video on the top of another.
  31925. </p>
  31926. <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.
  31927. </p>
  31928. <p>The filter accepts the following options:
  31929. </p>
  31930. <dl class="table">
  31931. <dt><samp class="option">x</samp></dt>
  31932. <dt><samp class="option">y</samp></dt>
  31933. <dd><p>Set expressions for the x and y coordinates of the overlaid video
  31934. on the main video.
  31935. </p>
  31936. <p>Default value is &quot;0&quot; for both expressions.
  31937. </p>
  31938. </dd>
  31939. <dt><samp class="option">w</samp></dt>
  31940. <dt><samp class="option">h</samp></dt>
  31941. <dd><p>Set expressions for the width and height the overlaid video
  31942. on the main video.
  31943. </p>
  31944. <p>Default values are &rsquo;overlay_iw&rsquo; for &rsquo;w&rsquo; and &rsquo;overlay_ih*w/overlay_iw&rsquo; for &rsquo;h&rsquo;.
  31945. </p>
  31946. <p>The expressions can contain the following parameters:
  31947. </p>
  31948. <dl class="table">
  31949. <dt><samp class="option">main_w, W</samp></dt>
  31950. <dt><samp class="option">main_h, H</samp></dt>
  31951. <dd><p>The main input width and height.
  31952. </p>
  31953. </dd>
  31954. <dt><samp class="option">overlay_iw</samp></dt>
  31955. <dt><samp class="option">overlay_ih</samp></dt>
  31956. <dd><p>The overlay input width and height.
  31957. </p>
  31958. </dd>
  31959. <dt><samp class="option">overlay_w, w</samp></dt>
  31960. <dt><samp class="option">overlay_h, h</samp></dt>
  31961. <dd><p>The overlay output width and height.
  31962. </p>
  31963. </dd>
  31964. <dt><samp class="option">overlay_x, x</samp></dt>
  31965. <dt><samp class="option">overlay_y, y</samp></dt>
  31966. <dd><p>Position of the overlay layer inside of main
  31967. </p>
  31968. </dd>
  31969. </dl>
  31970. </dd>
  31971. <dt><samp class="option">alpha</samp></dt>
  31972. <dd><p>Set transparency of overlaid video. Allowed range is 0.0 to 1.0.
  31973. Higher value means lower transparency.
  31974. Default value is <code class="code">1.0</code>.
  31975. </p>
  31976. </dd>
  31977. <dt><samp class="option">eof_action</samp></dt>
  31978. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  31979. </p>
  31980. </dd>
  31981. <dt><samp class="option">shortest</samp></dt>
  31982. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  31983. </p>
  31984. </dd>
  31985. <dt><samp class="option">repeatlast</samp></dt>
  31986. <dd><p>See <a class="ref" href="#framesync">framesync</a>.
  31987. </p>
  31988. </dd>
  31989. </dl>
  31990. <p>This filter also supports the <a class="ref" href="#framesync">framesync</a> options.
  31991. </p><a name="Examples-153"></a>
  31992. <h4 class="subsection">14.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-153" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-153" aria-hidden="true">TOC</a></span></h4>
  31993. <ul class="itemize mark-bullet">
  31994. <li>Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs for this filter are yuv420p format.
  31995. <div class="example">
  31996. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_vaapi&quot; OUTPUT
  31997. </pre></div>
  31998. </li><li>Overlay an image LOGO at the offset (200, 100) from the top-left corner of the INPUT video.
  31999. The inputs have same memory layout for color channels, the overlay has additional alpha plane, like INPUT is yuv420p, and the LOGO is yuva420p.
  32000. <div class="example">
  32001. <pre class="example-preformatted">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_vaapi=x=200:y=100:w=400:h=300:alpha=1.0, hwdownload, format=nv12&quot; OUTPUT
  32002. </pre></div>
  32003. </li></ul>
  32004. <a name="tonemap_005fvaapi"></a>
  32005. <h3 class="section">14.2 tonemap_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#tonemap_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-tonemap_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32006. <p>Perform HDR-to-SDR or HDR-to-HDR tone-mapping.
  32007. It currently only accepts HDR10 as input.
  32008. </p>
  32009. <p>It accepts the following parameters:
  32010. </p>
  32011. <dl class="table">
  32012. <dt><samp class="option">format</samp></dt>
  32013. <dd><p>Specify the output pixel format.
  32014. </p>
  32015. <p>Default is nv12 for HDR-to-SDR tone-mapping and p010 for HDR-to-HDR
  32016. tone-mapping.
  32017. </p>
  32018. </dd>
  32019. <dt><samp class="option">primaries, p</samp></dt>
  32020. <dd><p>Set the output color primaries.
  32021. </p>
  32022. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  32023. tone-mapping.
  32024. </p>
  32025. </dd>
  32026. <dt><samp class="option">transfer, t</samp></dt>
  32027. <dd><p>Set the output transfer characteristics.
  32028. </p>
  32029. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  32030. tone-mapping.
  32031. </p>
  32032. </dd>
  32033. <dt><samp class="option">matrix, m</samp></dt>
  32034. <dd><p>Set the output colorspace matrix.
  32035. </p>
  32036. <p>Default is bt709 for HDR-to-SDR tone-mapping and same as input for HDR-to-HDR
  32037. tone-mapping.
  32038. </p>
  32039. </dd>
  32040. <dt><samp class="option">display</samp></dt>
  32041. <dd><p>Set the output mastering display colour volume. It is given by a &rsquo;|&rsquo;-separated
  32042. list of two values, two values are space separated. It set display primaries
  32043. x &amp; y in G, B, R order, then white point x &amp; y, the nominal minimum &amp; maximum
  32044. display luminances.
  32045. </p>
  32046. <p>HDR-to-HDR tone-mapping will be performed when this option is set.
  32047. </p>
  32048. </dd>
  32049. <dt><samp class="option">light</samp></dt>
  32050. <dd><p>Set the output content light level information. It accepts 2 space-separated
  32051. values, the first input is the maximum light level and the second input is
  32052. the maximum average light level.
  32053. </p>
  32054. <p>It is ignored for HDR-to-SDR tone-mapping, and optional for HDR-to-HDR
  32055. tone-mapping.
  32056. </p>
  32057. </dd>
  32058. </dl>
  32059. <a name="Example-8"></a>
  32060. <h4 class="subsection">14.2.1 Example<span class="pull-right"><a class="anchor hidden-xs" href="#Example-8" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Example-8" aria-hidden="true">TOC</a></span></h4>
  32061. <ul class="itemize mark-bullet">
  32062. <li>Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  32063. <div class="example">
  32064. <pre class="example-preformatted">tonemap_vaapi=format=p010:t=bt2020-10
  32065. </pre></div>
  32066. </li><li>Convert HDR video to HDR video
  32067. <div class="example">
  32068. <pre class="example-preformatted">tonemap_vaapi=display=7500\ 3000|34000\ 16000|13250\ 34500|15635\ 16450|500\ 10000000
  32069. </pre></div>
  32070. </li></ul>
  32071. <a name="hstack_005fvaapi"></a>
  32072. <h3 class="section">14.3 hstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32073. <p>Stack input videos horizontally.
  32074. </p>
  32075. <p>This is the VA-API variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  32076. have different height, this filter will scale down/up each input stream while
  32077. keeping the original aspect.
  32078. </p>
  32079. <p>It accepts the following options:
  32080. </p>
  32081. <dl class="table">
  32082. <dt><samp class="option">inputs</samp></dt>
  32083. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  32084. </p>
  32085. </dd>
  32086. <dt><samp class="option">shortest</samp></dt>
  32087. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  32088. </p>
  32089. </dd>
  32090. <dt><samp class="option">height</samp></dt>
  32091. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  32092. height of the first input stream. Default value is 0.
  32093. </p></dd>
  32094. </dl>
  32095. <a name="vstack_005fvaapi"></a>
  32096. <h3 class="section">14.4 vstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32097. <p>Stack input videos vertically.
  32098. </p>
  32099. <p>This is the VA-API variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  32100. have different width, this filter will scale down/up each input stream while
  32101. keeping the original aspect.
  32102. </p>
  32103. <p>It accepts the following options:
  32104. </p>
  32105. <dl class="table">
  32106. <dt><samp class="option">inputs</samp></dt>
  32107. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  32108. </p>
  32109. </dd>
  32110. <dt><samp class="option">shortest</samp></dt>
  32111. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  32112. </p>
  32113. </dd>
  32114. <dt><samp class="option">width</samp></dt>
  32115. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  32116. width of the first input stream. Default value is 0.
  32117. </p></dd>
  32118. </dl>
  32119. <a name="xstack_005fvaapi"></a>
  32120. <h3 class="section">14.5 xstack_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32121. <p>Stack video inputs into custom layout.
  32122. </p>
  32123. <p>This is the VA-API variant of the <a class="ref" href="#xstack">xstack</a> filter, each input stream may
  32124. have different size, this filter will scale down/up each input stream to the
  32125. given output size, or the size of the first input stream.
  32126. </p>
  32127. <p>It accepts the following options:
  32128. </p>
  32129. <dl class="table">
  32130. <dt><samp class="option">inputs</samp></dt>
  32131. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32132. </p>
  32133. </dd>
  32134. <dt><samp class="option">shortest</samp></dt>
  32135. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32136. </p>
  32137. </dd>
  32138. <dt><samp class="option">layout</samp></dt>
  32139. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32140. Moreover, this permits the user to supply output size for each input stream.
  32141. </p><div class="example">
  32142. <pre class="example-preformatted">xstack_vaapi=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  32143. </pre></div>
  32144. </dd>
  32145. <dt><samp class="option">grid</samp></dt>
  32146. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32147. </p>
  32148. </dd>
  32149. <dt><samp class="option">grid_tile_size</samp></dt>
  32150. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  32151. is not set, this filter will set output size by default to the size of the
  32152. first input stream. For the syntax of this option, check the
  32153. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  32154. </p>
  32155. </dd>
  32156. <dt><samp class="option">fill</samp></dt>
  32157. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32158. </p></dd>
  32159. </dl>
  32160. <a name="pad_005fvaapi"></a>
  32161. <h3 class="section">14.6 pad_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#pad_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pad_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32162. <p>Add paddings to the input image, and place the original input at the
  32163. provided <var class="var">x</var>, <var class="var">y</var> coordinates.
  32164. </p>
  32165. <p>It accepts the following options:
  32166. </p>
  32167. <dl class="table">
  32168. <dt><samp class="option">width, w</samp></dt>
  32169. <dt><samp class="option">height, h</samp></dt>
  32170. <dd><p>Specify an expression for the size of the output image with the
  32171. paddings added. If the value for <var class="var">width</var> or <var class="var">height</var> is 0, the
  32172. corresponding input size is used for the output.
  32173. </p>
  32174. <p>The <var class="var">width</var> expression can reference the value set by the
  32175. <var class="var">height</var> expression, and vice versa.
  32176. </p>
  32177. <p>The default value of <var class="var">width</var> and <var class="var">height</var> is 0.
  32178. </p>
  32179. </dd>
  32180. <dt><samp class="option">x</samp></dt>
  32181. <dt><samp class="option">y</samp></dt>
  32182. <dd><p>Specify the offsets to place the input image at within the padded area,
  32183. with respect to the top/left border of the output image.
  32184. </p>
  32185. <p>The <var class="var">x</var> expression can reference the value set by the <var class="var">y</var>
  32186. expression, and vice versa.
  32187. </p>
  32188. <p>The default value of <var class="var">x</var> and <var class="var">y</var> is 0.
  32189. </p>
  32190. <p>If <var class="var">x</var> or <var class="var">y</var> evaluate to a negative number, they&rsquo;ll be changed
  32191. so the input image is centered on the padded area.
  32192. </p>
  32193. </dd>
  32194. <dt><samp class="option">color</samp></dt>
  32195. <dd><p>Specify the color of the padded area. For the syntax of this option,
  32196. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils
  32197. manual</a>.
  32198. </p>
  32199. </dd>
  32200. <dt><samp class="option">aspect</samp></dt>
  32201. <dd><p>Pad to an aspect instead to a resolution.
  32202. </p></dd>
  32203. </dl>
  32204. <p>The value for the <var class="var">width</var>, <var class="var">height</var>, <var class="var">x</var>, and <var class="var">y</var>
  32205. options are expressions containing the following constants:
  32206. </p>
  32207. <dl class="table">
  32208. <dt><samp class="option">in_w</samp></dt>
  32209. <dt><samp class="option">in_h</samp></dt>
  32210. <dd><p>The input video width and height.
  32211. </p>
  32212. </dd>
  32213. <dt><samp class="option">iw</samp></dt>
  32214. <dt><samp class="option">ih</samp></dt>
  32215. <dd><p>These are the same as <var class="var">in_w</var> and <var class="var">in_h</var>.
  32216. </p>
  32217. </dd>
  32218. <dt><samp class="option">out_w</samp></dt>
  32219. <dt><samp class="option">out_h</samp></dt>
  32220. <dd><p>The output width and height (the size of the padded area), as
  32221. specified by the <var class="var">width</var> and <var class="var">height</var> expressions.
  32222. </p>
  32223. </dd>
  32224. <dt><samp class="option">ow</samp></dt>
  32225. <dt><samp class="option">oh</samp></dt>
  32226. <dd><p>These are the same as <var class="var">out_w</var> and <var class="var">out_h</var>.
  32227. </p>
  32228. </dd>
  32229. <dt><samp class="option">x</samp></dt>
  32230. <dt><samp class="option">y</samp></dt>
  32231. <dd><p>The x and y offsets as specified by the <var class="var">x</var> and <var class="var">y</var>
  32232. expressions, or NAN if not yet specified.
  32233. </p>
  32234. </dd>
  32235. <dt><samp class="option">a</samp></dt>
  32236. <dd><p>same as <var class="var">iw</var> / <var class="var">ih</var>
  32237. </p>
  32238. </dd>
  32239. <dt><samp class="option">sar</samp></dt>
  32240. <dd><p>input sample aspect ratio
  32241. </p>
  32242. </dd>
  32243. <dt><samp class="option">dar</samp></dt>
  32244. <dd><p>input display aspect ratio, it is the same as (<var class="var">iw</var> / <var class="var">ih</var>) * <var class="var">sar</var>
  32245. </p></dd>
  32246. </dl>
  32247. <a name="drawbox_005fvaapi"></a>
  32248. <h3 class="section">14.7 drawbox_vaapi<span class="pull-right"><a class="anchor hidden-xs" href="#drawbox_005fvaapi" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-drawbox_005fvaapi" aria-hidden="true">TOC</a></span></h3>
  32249. <p>Draw a colored box on the input image.
  32250. </p>
  32251. <p>It accepts the following parameters:
  32252. </p>
  32253. <dl class="table">
  32254. <dt><samp class="option">x</samp></dt>
  32255. <dt><samp class="option">y</samp></dt>
  32256. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  32257. </p>
  32258. </dd>
  32259. <dt><samp class="option">width, w</samp></dt>
  32260. <dt><samp class="option">height, h</samp></dt>
  32261. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  32262. the input width and height. It defaults to 0.
  32263. </p>
  32264. </dd>
  32265. <dt><samp class="option">color, c</samp></dt>
  32266. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  32267. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  32268. </p>
  32269. </dd>
  32270. <dt><samp class="option">thickness, t</samp></dt>
  32271. <dd><p>The expression which sets the thickness of the box edge.
  32272. A value of <code class="code">fill</code> will create a filled box. Default value is <code class="code">3</code>.
  32273. </p>
  32274. <p>See below for the list of accepted constants.
  32275. </p>
  32276. </dd>
  32277. <dt><samp class="option">replace</samp></dt>
  32278. <dd><p>With value <code class="code">1</code>, the pixels of the painted box will overwrite the video&rsquo;s color and alpha pixels.
  32279. Default is <code class="code">0</code>, which composites the box onto the input video.
  32280. </p></dd>
  32281. </dl>
  32282. <p>The parameters for <var class="var">x</var>, <var class="var">y</var>, <var class="var">w</var> and <var class="var">h</var> and <var class="var">t</var> are expressions containing the
  32283. following constants:
  32284. </p>
  32285. <dl class="table">
  32286. <dt><samp class="option">in_h, ih</samp></dt>
  32287. <dt><samp class="option">in_w, iw</samp></dt>
  32288. <dd><p>The input width and height.
  32289. </p>
  32290. </dd>
  32291. <dt><samp class="option">x</samp></dt>
  32292. <dt><samp class="option">y</samp></dt>
  32293. <dd><p>The x and y offset coordinates where the box is drawn.
  32294. </p>
  32295. </dd>
  32296. <dt><samp class="option">w</samp></dt>
  32297. <dt><samp class="option">h</samp></dt>
  32298. <dd><p>The width and height of the drawn box.
  32299. </p>
  32300. </dd>
  32301. <dt><samp class="option">t</samp></dt>
  32302. <dd><p>The thickness of the drawn box.
  32303. </p>
  32304. </dd>
  32305. </dl>
  32306. <a name="Examples-154"></a>
  32307. <h4 class="subsection">14.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-154" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-154" aria-hidden="true">TOC</a></span></h4>
  32308. <ul class="itemize mark-bullet">
  32309. <li>Draw a black box around the edge of the input image:
  32310. <div class="example">
  32311. <pre class="example-preformatted">drawbox
  32312. </pre></div>
  32313. </li><li>Draw a box with color red and an opacity of 50%:
  32314. <div class="example">
  32315. <pre class="example-preformatted">drawbox=10:20:200:60:red@0.5
  32316. </pre></div>
  32317. <p>The previous example can be specified as:
  32318. </p><div class="example">
  32319. <pre class="example-preformatted">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  32320. </pre></div>
  32321. </li><li>Fill the box with pink color:
  32322. <div class="example">
  32323. <pre class="example-preformatted">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  32324. </pre></div>
  32325. </li><li>Draw a 2-pixel red 2.40:1 mask:
  32326. <div class="example">
  32327. <pre class="example-preformatted">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
  32328. </pre></div>
  32329. </li></ul>
  32330. <a name="VideoToolbox-Video-Filters"></a>
  32331. <h2 class="chapter">15 VideoToolbox Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#VideoToolbox-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-VideoToolbox-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  32332. <p>Below is a description of the currently available VideoToolbox video filters.
  32333. </p>
  32334. <p>VideoToolbox filter depends on VideoToolbox framework, and is auto detected
  32335. when building ffmpeg for an Apple platform such as macOS. Add
  32336. <code class="code">--enable-videotoolbox</code> to configure if autodetect is disabled.
  32337. </p>
  32338. <a name="scale_005fvt"></a>
  32339. <h3 class="section">15.1 scale_vt<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fvt" aria-hidden="true">TOC</a></span></h3>
  32340. <p>Scale and convert the color parameters using VTPixelTransferSession.
  32341. </p>
  32342. <p>The filter accepts the following options:
  32343. </p><dl class="table">
  32344. <dt><samp class="option">w</samp></dt>
  32345. <dt><samp class="option">h</samp></dt>
  32346. <dd><p>Set the output video dimension expression. Default value is the input dimension.
  32347. </p>
  32348. </dd>
  32349. <dt><samp class="option">color_matrix</samp></dt>
  32350. <dd><p>Set the output colorspace matrix.
  32351. </p>
  32352. </dd>
  32353. <dt><samp class="option">color_primaries</samp></dt>
  32354. <dd><p>Set the output color primaries.
  32355. </p>
  32356. </dd>
  32357. <dt><samp class="option">color_transfer</samp></dt>
  32358. <dd><p>Set the output transfer characteristics.
  32359. </p>
  32360. </dd>
  32361. </dl>
  32362. <a name="Examples-155"></a>
  32363. <h4 class="subsection">15.1.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-155" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-155" aria-hidden="true">TOC</a></span></h4>
  32364. <ul class="itemize mark-bullet">
  32365. <li>Perform HDR to SDR conversion, and scale to half size of input
  32366. <div class="example">
  32367. <pre class="example-preformatted">ffmpeg -hwaccel videotoolbox \
  32368. -hwaccel_output_format videotoolbox_vld \
  32369. -i hdr.mov \
  32370. -c:v hevc_videotoolbox \
  32371. -profile:v main \
  32372. -b:v 3M \
  32373. -vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
  32374. -c:a copy \
  32375. -tag:v hvc1 \
  32376. sdr.mp4
  32377. </pre></div>
  32378. </li></ul>
  32379. <a name="transpose_005fvt"></a>
  32380. <h3 class="section">15.2 transpose_vt<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvt" aria-hidden="true">TOC</a></span></h3>
  32381. <p>Transpose rows with columns in the input video and optionally flip it.
  32382. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  32383. </p>
  32384. <p>It accepts the following parameters:
  32385. </p>
  32386. <dl class="table">
  32387. <dt><samp class="option">dir</samp></dt>
  32388. <dd><p>Specify the transposition direction.
  32389. </p>
  32390. <p>Can assume the following values:
  32391. </p><dl class="table">
  32392. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  32393. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  32394. </p>
  32395. </dd>
  32396. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  32397. <dd><p>Rotate by 90 degrees clockwise.
  32398. </p>
  32399. </dd>
  32400. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  32401. <dd><p>Rotate by 90 degrees counterclockwise.
  32402. </p>
  32403. </dd>
  32404. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  32405. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  32406. </p>
  32407. </dd>
  32408. <dt>&lsquo;<samp class="samp">hflip</samp>&rsquo;</dt>
  32409. <dd><p>Flip the input video horizontally.
  32410. </p>
  32411. </dd>
  32412. <dt>&lsquo;<samp class="samp">vflip</samp>&rsquo;</dt>
  32413. <dd><p>Flip the input video vertically.
  32414. </p>
  32415. </dd>
  32416. </dl>
  32417. </dd>
  32418. <dt><samp class="option">passthrough</samp></dt>
  32419. <dd><p>Do not apply the transposition if the input geometry matches the one
  32420. specified by the specified value. It accepts the following values:
  32421. </p><dl class="table">
  32422. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32423. <dd><p>Always apply transposition. (default)
  32424. </p></dd>
  32425. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  32426. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  32427. </p></dd>
  32428. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  32429. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  32430. </p></dd>
  32431. </dl>
  32432. </dd>
  32433. </dl>
  32434. <a name="Vulkan-Video-Filters"></a>
  32435. <h2 class="chapter">16 Vulkan Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Vulkan-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Vulkan-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  32436. <p>Below is a description of the currently available Vulkan video filters.
  32437. </p>
  32438. <p>To enable compilation of these filters you need to configure FFmpeg with
  32439. <code class="code">--enable-vulkan</code> and either <code class="code">--enable-libglslang</code> or <code class="code">--enable-libshaderc</code>.
  32440. </p>
  32441. <p>Running Vulkan filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  32442. </p><dl class="table">
  32443. <dt><samp class="option">-init_hw_device vulkan[=<var class="var">name</var>][:<var class="var">device</var>[,<var class="var">key=value</var>...]]</samp></dt>
  32444. <dd><p>Initialise a new hardware device of type <var class="var">vulkan</var> called <var class="var">name</var>, using the
  32445. given device parameters and options in <var class="var">key=value</var>. The following options
  32446. are supported:
  32447. </p>
  32448. <dl class="table">
  32449. <dt><samp class="option">debug</samp></dt>
  32450. <dd><p>Switches validation layers on if set to 1.
  32451. </p>
  32452. </dd>
  32453. <dt><samp class="option">linear_images</samp></dt>
  32454. <dd><p>Allocates linear images. Does not apply to decoding.
  32455. </p>
  32456. </dd>
  32457. <dt><samp class="option">disable_multiplane</samp></dt>
  32458. <dd><p>Disables multiplane images. Does not apply to decoding.
  32459. </p>
  32460. </dd>
  32461. <dt><samp class="option">avoid_host_import</samp></dt>
  32462. <dd><p>Avoids the use of dynamic host memory imports, in favor of a regular memcpy()
  32463. into a previously mapped buffer.
  32464. </p></dd>
  32465. </dl>
  32466. </dd>
  32467. <dt><samp class="option">-filter_hw_device <var class="var">name</var></samp></dt>
  32468. <dd><p>Pass the hardware device called <var class="var">name</var> to all filters in any filter graph.
  32469. </p>
  32470. </dd>
  32471. </dl>
  32472. <p>For more detailed information see <a class="url" href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  32473. </p>
  32474. <ul class="itemize mark-bullet">
  32475. <li>Example of choosing the first device and running nlmeans_vulkan filter with default parameters on it.
  32476. <div class="example">
  32477. <pre class="example-preformatted">-init_hw_device vulkan=vk:0 -filter_hw_device vk -i INPUT -vf &quot;hwupload,nlmeans_vulkan,hwdownload&quot; OUTPUT
  32478. </pre></div>
  32479. </li></ul>
  32480. <p>As Vulkan filters are not able to access frame data in normal memory, all frame data needs to be uploaded (<a class="ref" href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded (<a class="ref" href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a class="ref" href="#hwupload">hwupload</a> will upload to a frame with the same layout as the software frame, so it may be necessary to add a <a class="ref" href="#format">format</a> filter immediately before to get the input into the right format and <a class="ref" href="#hwdownload">hwdownload</a> does not support all formats on the output - it is usually necessary to insert an additional <a class="ref" href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  32481. </p>
  32482. <a name="avgblur_005fvulkan"></a>
  32483. <h3 class="section">16.1 avgblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#avgblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avgblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32484. <p>Apply an average blur filter, implemented on the GPU using Vulkan.
  32485. </p>
  32486. <p>The filter accepts the following options:
  32487. </p>
  32488. <dl class="table">
  32489. <dt><samp class="option">sizeX</samp></dt>
  32490. <dd><p>Set horizontal radius size.
  32491. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  32492. </p>
  32493. </dd>
  32494. <dt><samp class="option">sizeY</samp></dt>
  32495. <dd><p>Set vertical radius size. Range is <code class="code">[1, 32]</code> and default value is <code class="code">3</code>.
  32496. </p>
  32497. </dd>
  32498. <dt><samp class="option">planes</samp></dt>
  32499. <dd><p>Set which planes to filter. Default value is <code class="code">0xf</code>, by which all planes are processed.
  32500. </p></dd>
  32501. </dl>
  32502. <a name="blend_005fvulkan"></a>
  32503. <h3 class="section">16.2 blend_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#blend_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blend_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32504. <p>Blend two Vulkan frames into each other.
  32505. </p>
  32506. <p>The <code class="code">blend</code> filter takes two input streams and outputs one
  32507. stream, the first input is the &quot;top&quot; layer and second input is
  32508. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  32509. </p>
  32510. <p>A description of the accepted options follows.
  32511. </p>
  32512. <dl class="table">
  32513. <dt><samp class="option">c0_mode</samp></dt>
  32514. <dt><samp class="option">c1_mode</samp></dt>
  32515. <dt><samp class="option">c2_mode</samp></dt>
  32516. <dt><samp class="option">c3_mode</samp></dt>
  32517. <dt><samp class="option">all_mode</samp></dt>
  32518. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  32519. of <var class="var">all_mode</var>. Default value is <code class="code">normal</code>.
  32520. </p>
  32521. <p>Available values for component modes are:
  32522. </p><dl class="table">
  32523. <dt>&lsquo;<samp class="samp">normal</samp>&rsquo;</dt>
  32524. <dt>&lsquo;<samp class="samp">multiply</samp>&rsquo;</dt>
  32525. </dl>
  32526. </dd>
  32527. </dl>
  32528. <a name="bwdif_005fvulkan"></a>
  32529. <h3 class="section">16.3 bwdif_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32530. <p>Deinterlacer using <a class="ref" href="#bwdif">bwdif</a>, the &quot;Bob Weaver Deinterlacing Filter&quot; algorithm, implemented
  32531. on the GPU using Vulkan.
  32532. </p>
  32533. <p>It accepts the following parameters:
  32534. </p>
  32535. <dl class="table">
  32536. <dt><samp class="option">mode</samp></dt>
  32537. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  32538. </p>
  32539. <dl class="table">
  32540. <dt><samp class="option">0, send_frame</samp></dt>
  32541. <dd><p>Output one frame for each frame.
  32542. </p></dd>
  32543. <dt><samp class="option">1, send_field</samp></dt>
  32544. <dd><p>Output one frame for each field.
  32545. </p></dd>
  32546. </dl>
  32547. <p>The default value is <code class="code">send_field</code>.
  32548. </p>
  32549. </dd>
  32550. <dt><samp class="option">parity</samp></dt>
  32551. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  32552. of the following values:
  32553. </p>
  32554. <dl class="table">
  32555. <dt><samp class="option">0, tff</samp></dt>
  32556. <dd><p>Assume the top field is first.
  32557. </p></dd>
  32558. <dt><samp class="option">1, bff</samp></dt>
  32559. <dd><p>Assume the bottom field is first.
  32560. </p></dd>
  32561. <dt><samp class="option">-1, auto</samp></dt>
  32562. <dd><p>Enable automatic detection of field parity.
  32563. </p></dd>
  32564. </dl>
  32565. <p>The default value is <code class="code">auto</code>.
  32566. If the interlacing is unknown or the decoder does not export this information,
  32567. top field first will be assumed.
  32568. </p>
  32569. </dd>
  32570. <dt><samp class="option">deint</samp></dt>
  32571. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  32572. values:
  32573. </p>
  32574. <dl class="table">
  32575. <dt><samp class="option">0, all</samp></dt>
  32576. <dd><p>Deinterlace all frames.
  32577. </p></dd>
  32578. <dt><samp class="option">1, interlaced</samp></dt>
  32579. <dd><p>Only deinterlace frames marked as interlaced.
  32580. </p></dd>
  32581. </dl>
  32582. <p>The default value is <code class="code">all</code>.
  32583. </p></dd>
  32584. </dl>
  32585. <a name="chromaber_005fvulkan"></a>
  32586. <h3 class="section">16.4 chromaber_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#chromaber_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromaber_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32587. <p>Apply an effect that emulates chromatic aberration. Works best with RGB inputs,
  32588. but provides a similar effect with YCbCr inputs too.
  32589. </p>
  32590. <dl class="table">
  32591. <dt><samp class="option">dist_x</samp></dt>
  32592. <dd><p>Horizontal displacement multiplier. Each chroma pixel&rsquo;s position will be multiplied
  32593. by this amount, starting from the center of the image. Default is <code class="code">0</code>.
  32594. </p>
  32595. </dd>
  32596. <dt><samp class="option">dist_y</samp></dt>
  32597. <dd><p>Similarly, this sets the vertical displacement multiplier. Default is <code class="code">0</code>.
  32598. </p>
  32599. </dd>
  32600. </dl>
  32601. <a name="color_005fvulkan"></a>
  32602. <h3 class="section">16.5 color_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#color_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-color_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32603. <p>Video source that creates a Vulkan frame of a solid color.
  32604. Useful for benchmarking, or overlaying.
  32605. </p>
  32606. <p>It accepts the following parameters:
  32607. </p>
  32608. <dl class="table">
  32609. <dt><samp class="option">color</samp></dt>
  32610. <dd><p>The color to use. Either a name, or a hexadecimal value.
  32611. The default value is <code class="code">black</code>.
  32612. </p>
  32613. </dd>
  32614. <dt><samp class="option">size</samp></dt>
  32615. <dd><p>The size of the output frame. Default value is <code class="code">1920x1080</code>.
  32616. </p>
  32617. </dd>
  32618. <dt><samp class="option">rate</samp></dt>
  32619. <dd><p>The framerate to output at. Default value is <code class="code">60</code> frames per second.
  32620. </p>
  32621. </dd>
  32622. <dt><samp class="option">duration</samp></dt>
  32623. <dd><p>The video duration. Default value is <code class="code">-0.000001</code>.
  32624. </p>
  32625. </dd>
  32626. <dt><samp class="option">sar</samp></dt>
  32627. <dd><p>The video signal aspect ratio. Default value is <code class="code">1/1</code>.
  32628. </p>
  32629. </dd>
  32630. <dt><samp class="option">format</samp></dt>
  32631. <dd><p>The pixel format of the output Vulkan frames. Default value is <code class="code">yuv444p</code>.
  32632. </p>
  32633. </dd>
  32634. <dt><samp class="option">out_range</samp></dt>
  32635. <dd><p>Set the output YCbCr sample range.
  32636. </p>
  32637. <p>This allows the autodetected value to be overridden as well as allows forcing
  32638. a specific value used for the output and encoder. If not specified, the
  32639. range depends on the pixel format. Possible values:
  32640. </p>
  32641. <dl class="table">
  32642. <dt>&lsquo;<samp class="samp">auto/unknown</samp>&rsquo;</dt>
  32643. <dd><p>Choose automatically.
  32644. </p>
  32645. </dd>
  32646. <dt>&lsquo;<samp class="samp">jpeg/full/pc</samp>&rsquo;</dt>
  32647. <dd><p>Set full range (0-255 in case of 8-bit luma).
  32648. </p>
  32649. </dd>
  32650. <dt>&lsquo;<samp class="samp">mpeg/limited/tv</samp>&rsquo;</dt>
  32651. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  32652. </p></dd>
  32653. </dl>
  32654. </dd>
  32655. </dl>
  32656. <a name="vflip_005fvulkan"></a>
  32657. <h3 class="section">16.6 vflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#vflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32658. <p>Flips an image vertically.
  32659. </p>
  32660. <a name="hflip_005fvulkan"></a>
  32661. <h3 class="section">16.7 hflip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#hflip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hflip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32662. <p>Flips an image horizontally.
  32663. </p>
  32664. <a name="flip_005fvulkan"></a>
  32665. <h3 class="section">16.8 flip_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#flip_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-flip_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32666. <p>Flips an image along both the vertical and horizontal axis.
  32667. </p>
  32668. <a name="gblur_005fvulkan"></a>
  32669. <h3 class="section">16.9 gblur_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#gblur_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gblur_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32670. <p>Apply Gaussian blur filter on Vulkan frames.
  32671. </p>
  32672. <p>The filter accepts the following options:
  32673. </p>
  32674. <dl class="table">
  32675. <dt><samp class="option">sigma</samp></dt>
  32676. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code class="code">0.5</code>.
  32677. </p>
  32678. </dd>
  32679. <dt><samp class="option">sigmaV</samp></dt>
  32680. <dd><p>Set vertical sigma, if negative it will be same as <code class="code">sigma</code>.
  32681. Default is <code class="code">-1</code>.
  32682. </p>
  32683. </dd>
  32684. <dt><samp class="option">planes</samp></dt>
  32685. <dd><p>Set which planes to filter. By default all planes are filtered.
  32686. </p>
  32687. </dd>
  32688. <dt><samp class="option">size</samp></dt>
  32689. <dd><p>Set the kernel size along the horizontal axis. Default is <code class="code">19</code>.
  32690. </p>
  32691. </dd>
  32692. <dt><samp class="option">sizeV</samp></dt>
  32693. <dd><p>Set the kernel size along the vertical axis. Default is <code class="code">0</code>,
  32694. which sets to use the same value as <var class="var">size</var>.
  32695. </p>
  32696. </dd>
  32697. </dl>
  32698. <a name="nlmeans_005fvulkan"></a>
  32699. <h3 class="section">16.10 nlmeans_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32700. <p>Denoise frames using Non-Local Means algorithm, implemented on the GPU using
  32701. Vulkan.
  32702. Supports more pixel formats than <a class="ref" href="#nlmeans">nlmeans</a> or <a class="ref" href="#nlmeans_005fopencl">nlmeans_opencl</a>, including
  32703. alpha channel support.
  32704. </p>
  32705. <p>The filter accepts the following options.
  32706. </p>
  32707. <dl class="table">
  32708. <dt><samp class="option">s</samp></dt>
  32709. <dd><p>Set denoising strength for all components. Default is 1.0. Must be in range [0.0, 100.0].
  32710. </p>
  32711. </dd>
  32712. <dt><samp class="option">p</samp></dt>
  32713. <dd><p>Set patch size for all planes. Default is 7. Must be odd number in range [0, 99].
  32714. </p>
  32715. </dd>
  32716. <dt><samp class="option">r</samp></dt>
  32717. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  32718. </p>
  32719. </dd>
  32720. <dt><samp class="option">t</samp></dt>
  32721. <dd><p>Set parallelism. Default is 8. Must be a number in the range [1, 64].
  32722. Larger values will use more VRAM but may not result in greater speed.
  32723. The optimal value is hardware and input dependent.
  32724. </p>
  32725. </dd>
  32726. <dt><samp class="option">s0</samp></dt>
  32727. <dt><samp class="option">s1</samp></dt>
  32728. <dt><samp class="option">s2</samp></dt>
  32729. <dt><samp class="option">s3</samp></dt>
  32730. <dd><p>Set denoising strength for a specific component. Default is <var class="var">1.0</var>, equal to <samp class="option">s</samp>.
  32731. Must be in range [0.0, 100.0]. 0.0 disables denoising in that component.
  32732. </p>
  32733. </dd>
  32734. <dt><samp class="option">p0</samp></dt>
  32735. <dt><samp class="option">p1</samp></dt>
  32736. <dt><samp class="option">p2</samp></dt>
  32737. <dt><samp class="option">p3</samp></dt>
  32738. <dd><p>Set patch size for a specific component. Default is <var class="var">7</var>, equal to <samp class="option">p</samp>.
  32739. Must be odd number in range [0, 99].
  32740. </p>
  32741. </dd>
  32742. </dl>
  32743. <a name="overlay_005fvulkan"></a>
  32744. <h3 class="section">16.11 overlay_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#overlay_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-overlay_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32745. <p>Overlay one video on top of another.
  32746. </p>
  32747. <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.
  32748. This filter requires all inputs to use the same pixel format. So, format conversion may be needed.
  32749. </p>
  32750. <p>The filter accepts the following options:
  32751. </p>
  32752. <dl class="table">
  32753. <dt><samp class="option">x</samp></dt>
  32754. <dd><p>Set the x coordinate of the overlaid video on the main video.
  32755. Default value is <code class="code">0</code>.
  32756. </p>
  32757. </dd>
  32758. <dt><samp class="option">y</samp></dt>
  32759. <dd><p>Set the y coordinate of the overlaid video on the main video.
  32760. Default value is <code class="code">0</code>.
  32761. </p>
  32762. </dd>
  32763. </dl>
  32764. <a name="transpose_005fvulkan"></a>
  32765. <h3 class="section">16.12 transpose_vulkan<span class="pull-right"><a class="anchor hidden-xs" href="#transpose_005fvulkan" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-transpose_005fvulkan" aria-hidden="true">TOC</a></span></h3>
  32766. <p>Transpose rows with columns in the input video and optionally flip it.
  32767. For more in depth examples see the <a class="ref" href="#transpose">transpose</a> video filter, which shares mostly the same options.
  32768. </p>
  32769. <p>It accepts the following parameters:
  32770. </p>
  32771. <dl class="table">
  32772. <dt><samp class="option">dir</samp></dt>
  32773. <dd><p>Specify the transposition direction.
  32774. </p>
  32775. <p>Can assume the following values:
  32776. </p><dl class="table">
  32777. <dt>&lsquo;<samp class="samp">cclock_flip</samp>&rsquo;</dt>
  32778. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  32779. </p>
  32780. </dd>
  32781. <dt>&lsquo;<samp class="samp">clock</samp>&rsquo;</dt>
  32782. <dd><p>Rotate by 90 degrees clockwise.
  32783. </p>
  32784. </dd>
  32785. <dt>&lsquo;<samp class="samp">cclock</samp>&rsquo;</dt>
  32786. <dd><p>Rotate by 90 degrees counterclockwise.
  32787. </p>
  32788. </dd>
  32789. <dt>&lsquo;<samp class="samp">clock_flip</samp>&rsquo;</dt>
  32790. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  32791. </p></dd>
  32792. </dl>
  32793. </dd>
  32794. <dt><samp class="option">passthrough</samp></dt>
  32795. <dd><p>Do not apply the transposition if the input geometry matches the one
  32796. specified by the specified value. It accepts the following values:
  32797. </p><dl class="table">
  32798. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  32799. <dd><p>Always apply transposition. (default)
  32800. </p></dd>
  32801. <dt>&lsquo;<samp class="samp">portrait</samp>&rsquo;</dt>
  32802. <dd><p>Preserve portrait geometry (when <var class="var">height</var> &gt;= <var class="var">width</var>).
  32803. </p></dd>
  32804. <dt>&lsquo;<samp class="samp">landscape</samp>&rsquo;</dt>
  32805. <dd><p>Preserve landscape geometry (when <var class="var">width</var> &gt;= <var class="var">height</var>).
  32806. </p></dd>
  32807. </dl>
  32808. </dd>
  32809. </dl>
  32810. <a name="QSV-Video-Filters"></a>
  32811. <h2 class="chapter">17 QSV Video Filters<span class="pull-right"><a class="anchor hidden-xs" href="#QSV-Video-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-QSV-Video-Filters" aria-hidden="true">TOC</a></span></h2>
  32812. <p>Below is a description of the currently available QSV video filters.
  32813. </p>
  32814. <p>To enable compilation of these filters you need to configure FFmpeg with
  32815. <code class="code">--enable-libmfx</code> or <code class="code">--enable-libvpl</code>.
  32816. </p>
  32817. <p>To use QSV filters, you need to setup the QSV device correctly. For more information, please read <a class="url" href="https://trac.ffmpeg.org/wiki/Hardware/QuickSync">https://trac.ffmpeg.org/wiki/Hardware/QuickSync</a>
  32818. </p>
  32819. <a name="hstack_005fqsv"></a>
  32820. <h3 class="section">17.1 hstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#hstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  32821. <p>Stack input videos horizontally.
  32822. </p>
  32823. <p>This is the QSV variant of the <a class="ref" href="#hstack">hstack</a> filter, each input stream may
  32824. have different height, this filter will scale down/up each input stream while
  32825. keeping the original aspect.
  32826. </p>
  32827. <p>It accepts the following options:
  32828. </p>
  32829. <dl class="table">
  32830. <dt><samp class="option">inputs</samp></dt>
  32831. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  32832. </p>
  32833. </dd>
  32834. <dt><samp class="option">shortest</samp></dt>
  32835. <dd><p>See <a class="ref" href="#hstack">hstack</a>.
  32836. </p>
  32837. </dd>
  32838. <dt><samp class="option">height</samp></dt>
  32839. <dd><p>Set height of output. If set to 0, this filter will set height of output to
  32840. height of the first input stream. Default value is 0.
  32841. </p></dd>
  32842. </dl>
  32843. <a name="vstack_005fqsv"></a>
  32844. <h3 class="section">17.2 vstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#vstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  32845. <p>Stack input videos vertically.
  32846. </p>
  32847. <p>This is the QSV variant of the <a class="ref" href="#vstack">vstack</a> filter, each input stream may
  32848. have different width, this filter will scale down/up each input stream while
  32849. keeping the original aspect.
  32850. </p>
  32851. <p>It accepts the following options:
  32852. </p>
  32853. <dl class="table">
  32854. <dt><samp class="option">inputs</samp></dt>
  32855. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  32856. </p>
  32857. </dd>
  32858. <dt><samp class="option">shortest</samp></dt>
  32859. <dd><p>See <a class="ref" href="#vstack">vstack</a>.
  32860. </p>
  32861. </dd>
  32862. <dt><samp class="option">width</samp></dt>
  32863. <dd><p>Set width of output. If set to 0, this filter will set width of output to
  32864. width of the first input stream. Default value is 0.
  32865. </p></dd>
  32866. </dl>
  32867. <a name="xstack_005fqsv"></a>
  32868. <h3 class="section">17.3 xstack_qsv<span class="pull-right"><a class="anchor hidden-xs" href="#xstack_005fqsv" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack_005fqsv" aria-hidden="true">TOC</a></span></h3>
  32869. <p>Stack video inputs into custom layout.
  32870. </p>
  32871. <p>This is the QSV variant of the <a class="ref" href="#xstack">xstack</a> filter.
  32872. </p>
  32873. <p>It accepts the following options:
  32874. </p>
  32875. <dl class="table">
  32876. <dt><samp class="option">inputs</samp></dt>
  32877. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32878. </p>
  32879. </dd>
  32880. <dt><samp class="option">shortest</samp></dt>
  32881. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32882. </p>
  32883. </dd>
  32884. <dt><samp class="option">layout</samp></dt>
  32885. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32886. Moreover, this permits the user to supply output size for each input stream.
  32887. </p><div class="example">
  32888. <pre class="example-preformatted">xstack_qsv=inputs=4:layout=0_0_1920x1080|0_h0_1920x1080|w0_0_1920x1080|w0_h0_1920x1080
  32889. </pre></div>
  32890. </dd>
  32891. <dt><samp class="option">grid</samp></dt>
  32892. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32893. </p>
  32894. </dd>
  32895. <dt><samp class="option">grid_tile_size</samp></dt>
  32896. <dd><p>Set output size for each input stream when <samp class="option">grid</samp> is set. If this option
  32897. is not set, this filter will set output size by default to the size of the
  32898. first input stream. For the syntax of this option, check the
  32899. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  32900. </p>
  32901. </dd>
  32902. <dt><samp class="option">fill</samp></dt>
  32903. <dd><p>See <a class="ref" href="#xstack">xstack</a>.
  32904. </p></dd>
  32905. </dl>
  32906. <a name="Video-Sources"></a>
  32907. <h2 class="chapter">18 Video Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sources" aria-hidden="true">TOC</a></span></h2>
  32908. <p>Below is a description of the currently available video sources.
  32909. </p>
  32910. <a name="buffer"></a>
  32911. <h3 class="section">18.1 buffer<span class="pull-right"><a class="anchor hidden-xs" href="#buffer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffer" aria-hidden="true">TOC</a></span></h3>
  32912. <p>Buffer video frames, and make them available to the filter chain.
  32913. </p>
  32914. <p>This source is mainly intended for a programmatic use, in particular
  32915. through the interface defined in <samp class="file">libavfilter/buffersrc.h</samp>.
  32916. </p>
  32917. <p>It accepts the following parameters:
  32918. </p>
  32919. <dl class="table">
  32920. <dt><samp class="option">video_size</samp></dt>
  32921. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  32922. syntax of this option, check the
  32923. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  32924. </p>
  32925. </dd>
  32926. <dt><samp class="option">width</samp></dt>
  32927. <dd><p>The input video width.
  32928. </p>
  32929. </dd>
  32930. <dt><samp class="option">height</samp></dt>
  32931. <dd><p>The input video height.
  32932. </p>
  32933. </dd>
  32934. <dt><samp class="option">pix_fmt</samp></dt>
  32935. <dd><p>A string representing the pixel format of the buffered video frames.
  32936. It may be a number corresponding to a pixel format, or a pixel format
  32937. name.
  32938. </p>
  32939. </dd>
  32940. <dt><samp class="option">time_base</samp></dt>
  32941. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  32942. </p>
  32943. </dd>
  32944. <dt><samp class="option">frame_rate</samp></dt>
  32945. <dd><p>Specify the frame rate expected for the video stream.
  32946. </p>
  32947. </dd>
  32948. <dt><samp class="option">colorspace</samp></dt>
  32949. <dd><p>A string representing the color space of the buffered video frames.
  32950. It may be a number corresponding to a color space, or a color space
  32951. name.
  32952. </p>
  32953. </dd>
  32954. <dt><samp class="option">range</samp></dt>
  32955. <dd><p>A string representing the color range of the buffered video frames.
  32956. It may be a number corresponding to a color range, or a color range
  32957. name.
  32958. </p>
  32959. </dd>
  32960. <dt><samp class="option">alpha_mode</samp></dt>
  32961. <dd><p>A string representing the alpha mode of the buffered video frames.
  32962. It may be a number corresponding to an alpha mode, or an alpha mode
  32963. name.
  32964. </p>
  32965. </dd>
  32966. <dt><samp class="option">pixel_aspect, sar</samp></dt>
  32967. <dd><p>The sample (pixel) aspect ratio of the input video.
  32968. </p>
  32969. </dd>
  32970. <dt><samp class="option">hw_frames_ctx</samp></dt>
  32971. <dd><p>When using a hardware pixel format, this should be a reference to an
  32972. AVHWFramesContext describing input frames.
  32973. </p></dd>
  32974. </dl>
  32975. <p>For example:
  32976. </p><div class="example">
  32977. <pre class="example-preformatted">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  32978. </pre></div>
  32979. <p>will instruct the source to accept video frames with size 320x240 and
  32980. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  32981. square pixels (1:1 sample aspect ratio).
  32982. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  32983. (check the enum AVPixelFormat definition in <samp class="file">libavutil/pixfmt.h</samp>),
  32984. this example corresponds to:
  32985. </p><div class="example">
  32986. <pre class="example-preformatted">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  32987. </pre></div>
  32988. <p>Alternatively, the options can be specified as a flat string, but this
  32989. syntax is deprecated:
  32990. </p>
  32991. <p><var class="var">width</var>:<var class="var">height</var>:<var class="var">pix_fmt</var>:<var class="var">time_base.num</var>:<var class="var">time_base.den</var>:<var class="var">pixel_aspect.num</var>:<var class="var">pixel_aspect.den</var>
  32992. </p>
  32993. <a name="cellauto"></a>
  32994. <h3 class="section">18.2 cellauto<span class="pull-right"><a class="anchor hidden-xs" href="#cellauto" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-cellauto" aria-hidden="true">TOC</a></span></h3>
  32995. <p>Create a pattern generated by an elementary cellular automaton.
  32996. </p>
  32997. <p>The initial state of the cellular automaton can be defined through the
  32998. <samp class="option">filename</samp> and <samp class="option">pattern</samp> options. If such options are
  32999. not specified an initial state is created randomly.
  33000. </p>
  33001. <p>At each new frame a new row in the video is filled with the result of
  33002. the cellular automaton next generation. The behavior when the whole
  33003. frame is filled is defined by the <samp class="option">scroll</samp> option.
  33004. </p>
  33005. <p>This source accepts the following options:
  33006. </p>
  33007. <dl class="table">
  33008. <dt><samp class="option">filename, f</samp></dt>
  33009. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  33010. the specified file.
  33011. In the file, each non-whitespace character is considered an alive
  33012. cell, a newline will terminate the row, and further characters in the
  33013. file will be ignored.
  33014. </p>
  33015. </dd>
  33016. <dt><samp class="option">pattern, p</samp></dt>
  33017. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  33018. the specified string.
  33019. </p>
  33020. <p>Each non-whitespace character in the string is considered an alive
  33021. cell, a newline will terminate the row, and further characters in the
  33022. string will be ignored.
  33023. </p>
  33024. </dd>
  33025. <dt><samp class="option">rate, r</samp></dt>
  33026. <dd><p>Set the video rate, that is the number of frames generated per second.
  33027. Default is 25.
  33028. </p>
  33029. </dd>
  33030. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  33031. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  33032. is a floating point number value ranging from 0 to 1, defaults to
  33033. 1/PHI.
  33034. </p>
  33035. <p>This option is ignored when a file or a pattern is specified.
  33036. </p>
  33037. </dd>
  33038. <dt><samp class="option">random_seed, seed</samp></dt>
  33039. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  33040. included between 0 and UINT32_MAX. If not specified, or if explicitly
  33041. set to -1, the filter will try to use a good random seed on a best
  33042. effort basis.
  33043. </p>
  33044. </dd>
  33045. <dt><samp class="option">rule</samp></dt>
  33046. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  33047. Default value is 110.
  33048. </p>
  33049. </dd>
  33050. <dt><samp class="option">size, s</samp></dt>
  33051. <dd><p>Set the size of the output video. For the syntax of this option, check the
  33052. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  33053. </p>
  33054. <p>If <samp class="option">filename</samp> or <samp class="option">pattern</samp> is specified, the size is set
  33055. by default to the width of the specified initial state row, and the
  33056. height is set to <var class="var">width</var> * PHI.
  33057. </p>
  33058. <p>If <samp class="option">size</samp> is set, it must contain the width of the specified
  33059. pattern string, and the specified pattern will be centered in the
  33060. larger row.
  33061. </p>
  33062. <p>If a filename or a pattern string is not specified, the size value
  33063. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  33064. </p>
  33065. </dd>
  33066. <dt><samp class="option">scroll</samp></dt>
  33067. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  33068. have been already filled. If set to 0, the new generated row will be
  33069. written over the top row just after the bottom row is filled.
  33070. Defaults to 1.
  33071. </p>
  33072. </dd>
  33073. <dt><samp class="option">start_full, full</samp></dt>
  33074. <dd><p>If set to 1, completely fill the output with generated rows before
  33075. outputting the first frame.
  33076. This is the default behavior, for disabling set the value to 0.
  33077. </p>
  33078. </dd>
  33079. <dt><samp class="option">stitch</samp></dt>
  33080. <dd><p>If set to 1, stitch the left and right row edges together.
  33081. This is the default behavior, for disabling set the value to 0.
  33082. </p></dd>
  33083. </dl>
  33084. <a name="Examples-156"></a>
  33085. <h4 class="subsection">18.2.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-156" aria-hidden="true">TOC</a></span></h4>
  33086. <ul class="itemize mark-bullet">
  33087. <li>Read the initial state from <samp class="file">pattern</samp>, and specify an output of
  33088. size 200x400.
  33089. <div class="example">
  33090. <pre class="example-preformatted">cellauto=f=pattern:s=200x400
  33091. </pre></div>
  33092. </li><li>Generate a random initial row with a width of 200 cells, with a fill
  33093. ratio of 2/3:
  33094. <div class="example">
  33095. <pre class="example-preformatted">cellauto=ratio=2/3:s=200x200
  33096. </pre></div>
  33097. </li><li>Create a pattern generated by rule 18 starting by a single alive cell
  33098. centered on an initial row with width 100:
  33099. <div class="example">
  33100. <pre class="example-preformatted">cellauto=p=@:s=100x400:full=0:rule=18
  33101. </pre></div>
  33102. </li><li>Specify a more elaborated initial pattern:
  33103. <div class="example">
  33104. <pre class="example-preformatted">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  33105. </pre></div>
  33106. </li></ul>
  33107. <a class="anchor" id="coreimagesrc"></a><a name="coreimagesrc-1"></a>
  33108. <h3 class="section">18.3 coreimagesrc<span class="pull-right"><a class="anchor hidden-xs" href="#coreimagesrc-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-coreimagesrc-1" aria-hidden="true">TOC</a></span></h3>
  33109. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  33110. </p>
  33111. <p>This video source is a specialized version of the <a class="ref" href="#coreimage">coreimage</a> video filter.
  33112. Use a core image generator at the beginning of the applied filterchain to
  33113. generate the content.
  33114. </p>
  33115. <p>The coreimagesrc video source accepts the following options:
  33116. </p><dl class="table">
  33117. <dt><samp class="option">list_generators</samp></dt>
  33118. <dd><p>List all available generators along with all their respective options as well as
  33119. possible minimum and maximum values along with the default values.
  33120. </p><div class="example">
  33121. <pre class="example-preformatted">list_generators=true
  33122. </pre></div>
  33123. </dd>
  33124. <dt><samp class="option">size, s</samp></dt>
  33125. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  33126. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  33127. The default value is <code class="code">320x240</code>.
  33128. </p>
  33129. </dd>
  33130. <dt><samp class="option">rate, r</samp></dt>
  33131. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  33132. generated per second. It has to be a string in the format
  33133. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  33134. number or a valid video frame rate abbreviation. The default value is
  33135. &quot;25&quot;.
  33136. </p>
  33137. </dd>
  33138. <dt><samp class="option">sar</samp></dt>
  33139. <dd><p>Set the sample aspect ratio of the sourced video.
  33140. </p>
  33141. </dd>
  33142. <dt><samp class="option">duration, d</samp></dt>
  33143. <dd><p>Set the duration of the sourced video. See
  33144. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33145. for the accepted syntax.
  33146. </p>
  33147. <p>If not specified, or the expressed duration is negative, the video is
  33148. supposed to be generated forever.
  33149. </p></dd>
  33150. </dl>
  33151. <p>Additionally, all options of the <a class="ref" href="#coreimage">coreimage</a> video filter are accepted.
  33152. A complete filterchain can be used for further processing of the
  33153. generated input without CPU-HOST transfer. See <a class="ref" href="#coreimage">coreimage</a> documentation
  33154. and examples for details.
  33155. </p>
  33156. <a name="Examples-157"></a>
  33157. <h4 class="subsection">18.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-157" aria-hidden="true">TOC</a></span></h4>
  33158. <ul class="itemize mark-bullet">
  33159. <li>Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  33160. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  33161. <div class="example">
  33162. <pre class="example-preformatted">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  33163. </pre></div>
  33164. <p>This example is equivalent to the QRCode example of <a class="ref" href="#coreimage">coreimage</a> without the
  33165. need for a nullsrc video source.
  33166. </p></li></ul>
  33167. <a name="ddagrab"></a>
  33168. <h3 class="section">18.4 ddagrab<span class="pull-right"><a class="anchor hidden-xs" href="#ddagrab" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ddagrab" aria-hidden="true">TOC</a></span></h3>
  33169. <p>Captures the Windows Desktop via Desktop Duplication API.
  33170. </p>
  33171. <p>The filter exclusively returns D3D11 Hardware Frames, for on-gpu encoding
  33172. or processing. So an explicit <a class="ref" href="#hwdownload">hwdownload</a> is needed for any kind of
  33173. software processing.
  33174. </p>
  33175. <p>It accepts the following options:
  33176. </p>
  33177. <dl class="table">
  33178. <dt><samp class="option">output_idx</samp></dt>
  33179. <dd><p>DXGI Output Index to capture.
  33180. </p>
  33181. <p>Usually corresponds to the index Windows has given the screen minus one,
  33182. so it&rsquo;s starting at 0.
  33183. </p>
  33184. <p>Defaults to output 0.
  33185. </p>
  33186. </dd>
  33187. <dt><samp class="option">draw_mouse</samp></dt>
  33188. <dd><p>Whether to draw the mouse cursor.
  33189. </p>
  33190. <p>Defaults to true.
  33191. </p>
  33192. <p>Only affects hardware cursors. If a game or application renders its own cursor,
  33193. it&rsquo;ll always be captured.
  33194. </p>
  33195. </dd>
  33196. <dt><samp class="option">framerate</samp></dt>
  33197. <dd><p>Maximum framerate at which the desktop will be captured - the interval between
  33198. successive frames will not be smaller than the inverse of the framerate. When
  33199. <var class="var">dup_frames</var> is true (the default) and the desktop is not being updated
  33200. often enough, the filter will duplicate a previous frame. Note that there is no
  33201. background buffering going on, so when the filter is not polled often enough
  33202. then the actual inter-frame interval may be significantly larger.
  33203. </p>
  33204. <p>Defaults to 30 FPS.
  33205. </p>
  33206. </dd>
  33207. <dt><samp class="option">video_size</samp></dt>
  33208. <dd><p>Specify the size of the captured video.
  33209. </p>
  33210. <p>Defaults to the full size of the screen.
  33211. </p>
  33212. <p>Cropped from the bottom/right if smaller than screen size.
  33213. </p>
  33214. </dd>
  33215. <dt><samp class="option">offset_x</samp></dt>
  33216. <dd><p>Horizontal offset of the captured video.
  33217. </p>
  33218. </dd>
  33219. <dt><samp class="option">offset_y</samp></dt>
  33220. <dd><p>Vertical offset of the captured video.
  33221. </p>
  33222. </dd>
  33223. <dt><samp class="option">output_fmt</samp></dt>
  33224. <dd><p>Desired filter output format.
  33225. Defaults to 8 Bit BGRA.
  33226. </p>
  33227. <p>It accepts the following values:
  33228. </p><dl class="table">
  33229. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  33230. <dd><p>Passes all supported output formats to DDA and returns what DDA decides to use.
  33231. </p></dd>
  33232. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  33233. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  33234. <dd><p>8 Bit formats always work, and DDA will convert to them if necessary.
  33235. </p></dd>
  33236. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  33237. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  33238. <dd><p>Filter initialization will fail if 10 bit format is requested but unavailable.
  33239. </p></dd>
  33240. </dl>
  33241. </dd>
  33242. <dt><samp class="option">dup_frames</samp></dt>
  33243. <dd><p>When this option is set to true (the default), the filter will duplicate frames
  33244. when the desktop has not been updated in order to maintain approximately
  33245. constant target framerate. When this option is set to false, the filter will
  33246. wait for the desktop to be updated (inter-frame intervals may vary significantly
  33247. in this case).
  33248. </p>
  33249. </dd>
  33250. </dl>
  33251. <a name="Examples-158"></a>
  33252. <h4 class="subsection">18.4.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-158" aria-hidden="true">TOC</a></span></h4>
  33253. <p>Capture primary screen and encode using nvenc:
  33254. </p><div class="example">
  33255. <pre class="example-preformatted">ffmpeg -f lavfi -i ddagrab -c:v h264_nvenc -cq 18 output.mp4
  33256. </pre></div>
  33257. <p>You can also skip the lavfi device and directly use the filter.
  33258. Also demonstrates downloading the frame and encoding with libx264.
  33259. Explicit output format specification is required in this case:
  33260. </p><div class="example">
  33261. <pre class="example-preformatted">ffmpeg -filter_complex ddagrab=output_idx=1:framerate=60,hwdownload,format=bgra -c:v libx264 -crf 18 output.mp4
  33262. </pre></div>
  33263. <p>If you want to capture only a subsection of the desktop, this can be achieved
  33264. by specifying a smaller size and its offsets into the screen:
  33265. </p><div class="example">
  33266. <pre class="example-preformatted">ddagrab=video_size=800x600:offset_x=100:offset_y=100
  33267. </pre></div>
  33268. <a name="gfxcapture"></a>
  33269. <h3 class="section">18.5 gfxcapture<span class="pull-right"><a class="anchor hidden-xs" href="#gfxcapture" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gfxcapture" aria-hidden="true">TOC</a></span></h3>
  33270. <p>Capture windows or monitors using Windows.Graphics.Capture API.
  33271. </p>
  33272. <p>This source provides low overhead capture of application windows or entire monitors.
  33273. The filter outputs hardware frames in <code class="code">d3d11</code> format; use <code class="code">hwdownload,format=</code>
  33274. if system memory frames are required.
  33275. </p>
  33276. <p>The window to be captured can be selected via regular expressions on its title,
  33277. class name or backing executable name, by explicit native handles, or by monitor
  33278. index or explicit native handle. A window must match all provided expressions to be
  33279. selected. The first matching window will be picked, in whatever order Windows
  33280. returns them.
  33281. </p>
  33282. <p>Explicit handles (<samp class="option">hwnd</samp>, <samp class="option">hmonitor</samp>) override pattern or index
  33283. based selection. If neither handles nor a monitor index are given, the first
  33284. window matching the provided regular expressions is captured.
  33285. </p>
  33286. <p>This source does NOT hold a stable FPS. It returns frames at whatever rate the compositor
  33287. provides them, only capped by the <samp class="option">max_framerate</samp>.
  33288. If you need a stable rate, you need to add an fps filter to drop/duplicate frames as needed.
  33289. </p>
  33290. <p>If the capture source disappears mid-capture (window closed, monitor disconnected), the filter will return EOF.
  33291. </p>
  33292. <p>This source accepts the following options:
  33293. </p><dl class="table">
  33294. <dt><samp class="option">window_title</samp></dt>
  33295. <dd><p>ECMAScript regular expression matched against the window title. Supports a
  33296. PCRE style <code class="code">(?i)</code> prefix for case-insensitive matching.
  33297. </p>
  33298. </dd>
  33299. <dt><samp class="option">window_class</samp></dt>
  33300. <dd><p>As <samp class="option">window_title</samp>, but matched against the window class name.
  33301. </p>
  33302. </dd>
  33303. <dt><samp class="option">window_exe</samp></dt>
  33304. <dd><p>As <samp class="option">window_title</samp>, but matched against the executable file name of the
  33305. window&rsquo;s process.
  33306. </p>
  33307. </dd>
  33308. <dt><samp class="option">monitor_idx</samp></dt>
  33309. <dd><p>Zero-based index of the monitor to capture.
  33310. </p>
  33311. <p>Can also be set to <code class="code">window</code> to capture the monitor the selected window
  33312. is displayed on at filter initialization time.
  33313. </p>
  33314. </dd>
  33315. <dt><samp class="option">hwnd</samp></dt>
  33316. <dd><p>Explicit native window handle (HWND).
  33317. </p>
  33318. </dd>
  33319. <dt><samp class="option">hmonitor</samp></dt>
  33320. <dd><p>Explicit native monitor handle (HMONITOR).
  33321. </p>
  33322. </dd>
  33323. <dt><samp class="option">capture_cursor</samp></dt>
  33324. <dd><p>Capture the mouse cursor. Enabled by default.
  33325. </p>
  33326. </dd>
  33327. <dt><samp class="option">capture_border</samp></dt>
  33328. <dd><p>Capture the full area of the window, including its window decorarions/border.
  33329. Disabled by default.
  33330. </p>
  33331. </dd>
  33332. <dt><samp class="option">display_border</samp></dt>
  33333. <dd><p>Draw a yellow highlight border around the captured window. Disabled by default.
  33334. </p>
  33335. </dd>
  33336. <dt><samp class="option">max_framerate</samp></dt>
  33337. <dd><p>Maximum capture frame rate. Accepts a video rate (e.g. <code class="code">30</code>, <code class="code">60/1</code>,
  33338. <code class="code">24000/1001</code>). The default is <code class="code">60</code> FPS.
  33339. The actual rate is the rate at which the compositor renders the window/monitor,
  33340. capped by this option.
  33341. </p>
  33342. </dd>
  33343. <dt><samp class="option">width</samp></dt>
  33344. <dd><p>Force the output canvas width. If zero (default) the initial captured source
  33345. width is used. If a negative number is provided, the width will be rounded
  33346. down to the next multiple of that number.
  33347. </p>
  33348. <p>See <samp class="option">resize_mode</samp>.
  33349. </p>
  33350. </dd>
  33351. <dt><samp class="option">height</samp></dt>
  33352. <dd><p>Force the output canvas height. If zero (default) the initial captured source
  33353. height is used. If a negative number is provided, the height will be rounded
  33354. down to the next multiple of that number.
  33355. </p>
  33356. <p>See <samp class="option">resize_mode</samp>.
  33357. </p>
  33358. </dd>
  33359. <dt><samp class="option">crop_left</samp></dt>
  33360. <dd><p>Crop this many pixels from the left side of the captured frames.
  33361. </p>
  33362. </dd>
  33363. <dt><samp class="option">crop_top</samp></dt>
  33364. <dd><p>Crop this many pixels from the left side of the captured frames.
  33365. </p>
  33366. </dd>
  33367. <dt><samp class="option">crop_right</samp></dt>
  33368. <dd><p>Crop this many pixels from the left side of the captured frames.
  33369. </p>
  33370. </dd>
  33371. <dt><samp class="option">crop_bottom</samp></dt>
  33372. <dd><p>Crop this many pixels from the left side of the captured frames.
  33373. </p>
  33374. </dd>
  33375. <dt><samp class="option">premultiplied</samp></dt>
  33376. <dd><p>If set to 1, return frames with premultiplied alpha. Default is 0 (straight
  33377. alpha).
  33378. </p>
  33379. </dd>
  33380. <dt><samp class="option">resize_mode</samp></dt>
  33381. <dd><p>Defines how the captured content is fitted into the output canvas size.
  33382. Possible values:
  33383. </p><dl class="table">
  33384. <dt>&lsquo;<samp class="samp">crop</samp>&rsquo;</dt>
  33385. <dd><p>Crop (or pad with black) to the canvas size. (default)
  33386. </p></dd>
  33387. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  33388. <dd><p>Scale the source to fill the canvas, potentially altering aspect ratio.
  33389. </p></dd>
  33390. <dt>&lsquo;<samp class="samp">scale_aspect</samp>&rsquo;</dt>
  33391. <dd><p>Scale the source to fit inside the canvas while preserving aspect ratio.
  33392. Remaining area is filled with black.
  33393. </p></dd>
  33394. </dl>
  33395. </dd>
  33396. <dt><samp class="option">scale_mode</samp></dt>
  33397. <dd><p>Scaling algorithm used when resizing is required.
  33398. </p>
  33399. <p>Possible values:
  33400. </p><dl class="table">
  33401. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  33402. <dd><p>Nearest neighbour (pixelated) scaling.
  33403. </p></dd>
  33404. <dt>&lsquo;<samp class="samp">bilinear</samp>&rsquo;</dt>
  33405. <dd><p>Bilinear filtering. (default)
  33406. </p></dd>
  33407. <dt>&lsquo;<samp class="samp">bicubic</samp>&rsquo;</dt>
  33408. <dd><p>Bicubic filtering. Potentially more blurry, but fewer scaling artifacts depending on contents.
  33409. </p></dd>
  33410. </dl>
  33411. </dd>
  33412. <dt><samp class="option">output_fmt</samp></dt>
  33413. <dd><p>Desired output pixel format inside the D3D11 hardware frames.
  33414. </p>
  33415. <p>Possible values:
  33416. </p><dl class="table">
  33417. <dt>&lsquo;<samp class="samp">bgra</samp>&rsquo;</dt>
  33418. <dt>&lsquo;<samp class="samp">8bit</samp>&rsquo;</dt>
  33419. <dd><p>8 bit BGRA output (default)
  33420. </p></dd>
  33421. <dt>&lsquo;<samp class="samp">x2bgr10</samp>&rsquo;</dt>
  33422. <dt>&lsquo;<samp class="samp">10bit</samp>&rsquo;</dt>
  33423. <dd><p>10 bit BGR output
  33424. </p></dd>
  33425. <dt>&lsquo;<samp class="samp">rgbaf16</samp>&rsquo;</dt>
  33426. <dt>&lsquo;<samp class="samp">16bit</samp>&rsquo;</dt>
  33427. <dd><p>16bit float RGBA output
  33428. </p></dd>
  33429. </dl>
  33430. </dd>
  33431. </dl>
  33432. <a name="Examples-159"></a>
  33433. <h4 class="subsection">18.5.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-159" aria-hidden="true">TOC</a></span></h4>
  33434. <ul class="itemize mark-bullet">
  33435. <li>Capture a window by title (case-insensitive) at a maximum of 60 fps:
  33436. <div class="example">
  33437. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_title='(?i)My Application':max_framerate=60,hwdownload,format=bgra,format=yuv420p -c:v libx264 -crf 15 capture.mp4
  33438. </pre></div>
  33439. </li><li>Capture monitor 1 at native refresh, 10bit color depth, scale to 1920x1080 preserving aspect:
  33440. <div class="example">
  33441. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=monitor_idx=1:width=1920:height=1080:resize_mode=scale_aspect:output_fmt=10bit -c:v hevc_nvenc -cq 15 capture.mp4
  33442. </pre></div>
  33443. </li><li>Capture a window by executable name, draw border, force point scaling, fixed 60 fps:
  33444. <div class="example">
  33445. <pre class="example-preformatted">ffmpeg -filter_complex gfxcapture=window_exe='^firefox.exe$':display_border=1:scale_mode=point,fps=60 -rc qvbr -qvbr_quality_level 15 -c:v h264_amf capture.mp4
  33446. </pre></div>
  33447. </li></ul>
  33448. <a name="gradients"></a>
  33449. <h3 class="section">18.6 gradients<span class="pull-right"><a class="anchor hidden-xs" href="#gradients" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-gradients" aria-hidden="true">TOC</a></span></h3>
  33450. <p>Generate several gradients.
  33451. </p>
  33452. <dl class="table">
  33453. <dt><samp class="option">size, s</samp></dt>
  33454. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  33455. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  33456. </p>
  33457. </dd>
  33458. <dt><samp class="option">rate, r</samp></dt>
  33459. <dd><p>Set frame rate, expressed as number of frames per second. Default
  33460. value is &quot;25&quot;.
  33461. </p>
  33462. </dd>
  33463. <dt><samp class="option">c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  33464. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  33465. </p>
  33466. </dd>
  33467. <dt><samp class="option">x0, y0, y0, y1</samp></dt>
  33468. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  33469. are picked.
  33470. </p>
  33471. </dd>
  33472. <dt><samp class="option">nb_colors, n</samp></dt>
  33473. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  33474. </p>
  33475. </dd>
  33476. <dt><samp class="option">seed</samp></dt>
  33477. <dd><p>Set seed for picking gradient line points.
  33478. </p>
  33479. </dd>
  33480. <dt><samp class="option">duration, d</samp></dt>
  33481. <dd><p>Set the duration of the sourced video. See
  33482. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33483. for the accepted syntax.
  33484. </p>
  33485. <p>If not specified, or the expressed duration is negative, the video is
  33486. supposed to be generated forever.
  33487. </p>
  33488. </dd>
  33489. <dt><samp class="option">speed</samp></dt>
  33490. <dd><p>Set speed of gradients rotation.
  33491. </p>
  33492. </dd>
  33493. <dt><samp class="option">type, t</samp></dt>
  33494. <dd><p>Set type of gradients.
  33495. Available values are:
  33496. </p><dl class="table">
  33497. <dt>&lsquo;<samp class="samp">linear</samp>&rsquo;</dt>
  33498. <dt>&lsquo;<samp class="samp">radial</samp>&rsquo;</dt>
  33499. <dt>&lsquo;<samp class="samp">circular</samp>&rsquo;</dt>
  33500. <dt>&lsquo;<samp class="samp">spiral</samp>&rsquo;</dt>
  33501. <dt>&lsquo;<samp class="samp">square</samp>&rsquo;</dt>
  33502. </dl>
  33503. <p>Default type is <var class="var">linear</var>.
  33504. </p></dd>
  33505. </dl>
  33506. <a name="Commands-156"></a>
  33507. <h4 class="subsection">18.6.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-156" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-156" aria-hidden="true">TOC</a></span></h4>
  33508. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  33509. </p>
  33510. <a name="mandelbrot"></a>
  33511. <h3 class="section">18.7 mandelbrot<span class="pull-right"><a class="anchor hidden-xs" href="#mandelbrot" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mandelbrot" aria-hidden="true">TOC</a></span></h3>
  33512. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  33513. point specified with <var class="var">start_x</var> and <var class="var">start_y</var>.
  33514. </p>
  33515. <p>This source accepts the following options:
  33516. </p>
  33517. <dl class="table">
  33518. <dt><samp class="option">end_pts</samp></dt>
  33519. <dd><p>Set the terminal pts value. Default value is 400.
  33520. </p>
  33521. </dd>
  33522. <dt><samp class="option">end_scale</samp></dt>
  33523. <dd><p>Set the terminal scale value.
  33524. Must be a floating point value. Default value is 0.3.
  33525. </p>
  33526. </dd>
  33527. <dt><samp class="option">inner</samp></dt>
  33528. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  33529. Mandelbrot fractal internal region.
  33530. </p>
  33531. <p>It shall assume one of the following values:
  33532. </p><dl class="table">
  33533. <dt><samp class="option">black</samp></dt>
  33534. <dd><p>Set black mode.
  33535. </p></dd>
  33536. <dt><samp class="option">convergence</samp></dt>
  33537. <dd><p>Show time until convergence.
  33538. </p></dd>
  33539. <dt><samp class="option">mincol</samp></dt>
  33540. <dd><p>Set color based on point closest to the origin of the iterations.
  33541. </p></dd>
  33542. <dt><samp class="option">period</samp></dt>
  33543. <dd><p>Set period mode.
  33544. </p></dd>
  33545. </dl>
  33546. <p>Default value is <var class="var">mincol</var>.
  33547. </p>
  33548. </dd>
  33549. <dt><samp class="option">bailout</samp></dt>
  33550. <dd><p>Set the bailout value. Default value is 10.0.
  33551. </p>
  33552. </dd>
  33553. <dt><samp class="option">maxiter</samp></dt>
  33554. <dd><p>Set the maximum of iterations performed by the rendering
  33555. algorithm. Default value is 7189.
  33556. </p>
  33557. </dd>
  33558. <dt><samp class="option">outer</samp></dt>
  33559. <dd><p>Set outer coloring mode.
  33560. It shall assume one of following values:
  33561. </p><dl class="table">
  33562. <dt><samp class="option">iteration_count</samp></dt>
  33563. <dd><p>Set iteration count mode.
  33564. </p></dd>
  33565. <dt><samp class="option">normalized_iteration_count</samp></dt>
  33566. <dd><p>set normalized iteration count mode.
  33567. </p></dd>
  33568. </dl>
  33569. <p>Default value is <var class="var">normalized_iteration_count</var>.
  33570. </p>
  33571. </dd>
  33572. <dt><samp class="option">rate, r</samp></dt>
  33573. <dd><p>Set frame rate, expressed as number of frames per second. Default
  33574. value is &quot;25&quot;.
  33575. </p>
  33576. </dd>
  33577. <dt><samp class="option">size, s</samp></dt>
  33578. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  33579. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  33580. </p>
  33581. </dd>
  33582. <dt><samp class="option">start_scale</samp></dt>
  33583. <dd><p>Set the initial scale value. Default value is 3.0.
  33584. </p>
  33585. </dd>
  33586. <dt><samp class="option">start_x</samp></dt>
  33587. <dd><p>Set the initial x position. Must be a floating point value between
  33588. -100 and 100. Default value is -0.743643887037158704752191506114774.
  33589. </p>
  33590. </dd>
  33591. <dt><samp class="option">start_y</samp></dt>
  33592. <dd><p>Set the initial y position. Must be a floating point value between
  33593. -100 and 100. Default value is -0.131825904205311970493132056385139.
  33594. </p></dd>
  33595. </dl>
  33596. <a name="mptestsrc"></a>
  33597. <h3 class="section">18.8 mptestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#mptestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-mptestsrc" aria-hidden="true">TOC</a></span></h3>
  33598. <p>Generate various test patterns, as generated by the MPlayer test filter.
  33599. </p>
  33600. <p>The size of the generated video is fixed, and is 512x512.
  33601. This source is useful in particular for testing encoding features.
  33602. </p>
  33603. <p>This source accepts the following options:
  33604. </p>
  33605. <dl class="table">
  33606. <dt><samp class="option">rate, r</samp></dt>
  33607. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  33608. generated per second. It has to be a string in the format
  33609. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  33610. number or a valid video frame rate abbreviation. The default value is
  33611. &quot;25&quot;.
  33612. </p>
  33613. </dd>
  33614. <dt><samp class="option">duration, d</samp></dt>
  33615. <dd><p>Set the duration of the sourced video. See
  33616. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  33617. for the accepted syntax.
  33618. </p>
  33619. <p>If not specified, or the expressed duration is negative, the video is
  33620. supposed to be generated forever.
  33621. </p>
  33622. </dd>
  33623. <dt><samp class="option">test, t</samp></dt>
  33624. <dd>
  33625. <p>Set the number or the name of the test to perform. Supported tests are:
  33626. </p><dl class="table">
  33627. <dt><samp class="option">dc_luma</samp></dt>
  33628. <dt><samp class="option">dc_chroma</samp></dt>
  33629. <dt><samp class="option">freq_luma</samp></dt>
  33630. <dt><samp class="option">freq_chroma</samp></dt>
  33631. <dt><samp class="option">amp_luma</samp></dt>
  33632. <dt><samp class="option">amp_chroma</samp></dt>
  33633. <dt><samp class="option">cbp</samp></dt>
  33634. <dt><samp class="option">mv</samp></dt>
  33635. <dt><samp class="option">ring1</samp></dt>
  33636. <dt><samp class="option">ring2</samp></dt>
  33637. <dt><samp class="option">all</samp></dt>
  33638. <dt><samp class="option">max_frames, m</samp></dt>
  33639. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  33640. </p>
  33641. </dd>
  33642. </dl>
  33643. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  33644. </p></dd>
  33645. </dl>
  33646. <p>Some examples:
  33647. </p><div class="example">
  33648. <pre class="example-preformatted">mptestsrc=t=dc_luma
  33649. </pre></div>
  33650. <p>will generate a &quot;dc_luma&quot; test pattern.
  33651. </p>
  33652. <a name="frei0r_005fsrc"></a>
  33653. <h3 class="section">18.9 frei0r_src<span class="pull-right"><a class="anchor hidden-xs" href="#frei0r_005fsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-frei0r_005fsrc" aria-hidden="true">TOC</a></span></h3>
  33654. <p>Provide a frei0r source.
  33655. </p>
  33656. <p>To enable compilation of this filter you need to install the frei0r
  33657. header and configure FFmpeg with <code class="code">--enable-frei0r</code>.
  33658. </p>
  33659. <p>This source accepts the following parameters:
  33660. </p>
  33661. <dl class="table">
  33662. <dt><samp class="option">size</samp></dt>
  33663. <dd><p>The size of the video to generate. For the syntax of this option, check the
  33664. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  33665. </p>
  33666. </dd>
  33667. <dt><samp class="option">framerate</samp></dt>
  33668. <dd><p>The framerate of the generated video. It may be a string of the form
  33669. <var class="var">num</var>/<var class="var">den</var> or a frame rate abbreviation.
  33670. </p>
  33671. </dd>
  33672. <dt><samp class="option">filter_name</samp></dt>
  33673. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  33674. how to set the parameters, read the <a class="ref" href="#frei0r">frei0r</a> section in the video filters
  33675. documentation.
  33676. </p>
  33677. </dd>
  33678. <dt><samp class="option">filter_params</samp></dt>
  33679. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  33680. </p>
  33681. </dd>
  33682. </dl>
  33683. <p>For example, to generate a frei0r partik0l source with size 200x200
  33684. and frame rate 10 which is overlaid on the overlay filter main input:
  33685. </p><div class="example">
  33686. <pre class="example-preformatted">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  33687. </pre></div>
  33688. <a name="life"></a>
  33689. <h3 class="section">18.10 life<span class="pull-right"><a class="anchor hidden-xs" href="#life" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-life" aria-hidden="true">TOC</a></span></h3>
  33690. <p>Generate a life pattern.
  33691. </p>
  33692. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  33693. </p>
  33694. <p>The sourced input represents a life grid, each pixel represents a cell
  33695. which can be in one of two possible states, alive or dead. Every cell
  33696. interacts with its eight neighbours, which are the cells that are
  33697. horizontally, vertically, or diagonally adjacent.
  33698. </p>
  33699. <p>At each interaction the grid evolves according to the adopted rule,
  33700. which specifies the number of neighbor alive cells which will make a
  33701. cell stay alive or born. The <samp class="option">rule</samp> option allows one to specify
  33702. the rule to adopt.
  33703. </p>
  33704. <p>This source accepts the following options:
  33705. </p>
  33706. <dl class="table">
  33707. <dt><samp class="option">filename, f</samp></dt>
  33708. <dd><p>Set the file from which to read the initial grid state. In the file,
  33709. each non-whitespace character is considered an alive cell, and newline
  33710. is used to delimit the end of each row.
  33711. </p>
  33712. <p>If this option is not specified, the initial grid is generated
  33713. randomly.
  33714. </p>
  33715. </dd>
  33716. <dt><samp class="option">rate, r</samp></dt>
  33717. <dd><p>Set the video rate, that is the number of frames generated per second.
  33718. Default is 25.
  33719. </p>
  33720. </dd>
  33721. <dt><samp class="option">random_fill_ratio, ratio</samp></dt>
  33722. <dd><p>Set the random fill ratio for the initial random grid. It is a
  33723. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  33724. It is ignored when a file is specified.
  33725. </p>
  33726. </dd>
  33727. <dt><samp class="option">random_seed, seed</samp></dt>
  33728. <dd><p>Set the seed for filling the initial random grid, must be an integer
  33729. included between 0 and UINT32_MAX. If not specified, or if explicitly
  33730. set to -1, the filter will try to use a good random seed on a best
  33731. effort basis.
  33732. </p>
  33733. </dd>
  33734. <dt><samp class="option">rule</samp></dt>
  33735. <dd><p>Set the life rule.
  33736. </p>
  33737. <p>A rule can be specified with a code of the kind &quot;S<var class="var">NS</var>/B<var class="var">NB</var>&quot;,
  33738. where <var class="var">NS</var> and <var class="var">NB</var> are sequences of numbers in the range 0-8,
  33739. <var class="var">NS</var> specifies the number of alive neighbor cells which make a
  33740. live cell stay alive, and <var class="var">NB</var> the number of alive neighbor cells
  33741. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  33742. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  33743. </p>
  33744. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  33745. high order bits are used to encode the next cell state if it is alive
  33746. for each number of neighbor alive cells, the low order bits specify
  33747. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  33748. higher number of neighbor cells.
  33749. For example the number 6153 = <code class="code">(12&lt;&lt;9)+9</code> specifies a stay alive
  33750. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  33751. </p>
  33752. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  33753. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  33754. cells, and will born a new cell if there are three alive cells around
  33755. a dead cell.
  33756. </p>
  33757. </dd>
  33758. <dt><samp class="option">size, s</samp></dt>
  33759. <dd><p>Set the size of the output video. For the syntax of this option, check the
  33760. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  33761. </p>
  33762. <p>If <samp class="option">filename</samp> is specified, the size is set by default to the
  33763. same size of the input file. If <samp class="option">size</samp> is set, it must contain
  33764. the size specified in the input file, and the initial grid defined in
  33765. that file is centered in the larger resulting area.
  33766. </p>
  33767. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  33768. (used for a randomly generated initial grid).
  33769. </p>
  33770. </dd>
  33771. <dt><samp class="option">stitch</samp></dt>
  33772. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  33773. top and bottom edges also. Defaults to 1.
  33774. </p>
  33775. </dd>
  33776. <dt><samp class="option">mold</samp></dt>
  33777. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp class="option">death_color</samp> to
  33778. <samp class="option">mold_color</samp> with a step of <samp class="option">mold</samp>. <samp class="option">mold</samp> can have a
  33779. value from 0 to 255.
  33780. </p>
  33781. </dd>
  33782. <dt><samp class="option">life_color</samp></dt>
  33783. <dd><p>Set the color of living (or new born) cells.
  33784. </p>
  33785. </dd>
  33786. <dt><samp class="option">death_color</samp></dt>
  33787. <dd><p>Set the color of dead cells. If <samp class="option">mold</samp> is set, this is the first color
  33788. used to represent a dead cell.
  33789. </p>
  33790. </dd>
  33791. <dt><samp class="option">mold_color</samp></dt>
  33792. <dd><p>Set mold color, for definitely dead and moldy cells.
  33793. </p>
  33794. <p>For the syntax of these 3 color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the
  33795. ffmpeg-utils manual</a>.
  33796. </p></dd>
  33797. </dl>
  33798. <a name="Examples-160"></a>
  33799. <h4 class="subsection">18.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-160" aria-hidden="true">TOC</a></span></h4>
  33800. <ul class="itemize mark-bullet">
  33801. <li>Read a grid from <samp class="file">pattern</samp>, and center it on a grid of size
  33802. 300x300 pixels:
  33803. <div class="example">
  33804. <pre class="example-preformatted">life=f=pattern:s=300x300
  33805. </pre></div>
  33806. </li><li>Generate a random grid of size 200x200, with a fill ratio of 2/3:
  33807. <div class="example">
  33808. <pre class="example-preformatted">life=ratio=2/3:s=200x200
  33809. </pre></div>
  33810. </li><li>Specify a custom rule for evolving a randomly generated grid:
  33811. <div class="example">
  33812. <pre class="example-preformatted">life=rule=S14/B34
  33813. </pre></div>
  33814. </li><li>Full example with slow death effect (mold) using <code class="command">ffplay</code>:
  33815. <div class="example">
  33816. <pre class="example-preformatted">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
  33817. </pre></div>
  33818. </li></ul>
  33819. <a name="perlin"></a>
  33820. <h3 class="section">18.11 perlin<span class="pull-right"><a class="anchor hidden-xs" href="#perlin" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perlin" aria-hidden="true">TOC</a></span></h3>
  33821. <p>Generate Perlin noise.
  33822. </p>
  33823. <p>Perlin noise is a kind of noise with local continuity in space. This
  33824. can be used to generate patterns with continuity in space and time,
  33825. e.g. to simulate smoke, fluids, or terrain.
  33826. </p>
  33827. <p>In case more than one octave is specified through the <samp class="option">octaves</samp>
  33828. option, Perlin noise is generated as a sum of components, each one
  33829. with doubled frequency. In this case the <samp class="option">persistence</samp> option
  33830. specify the ratio of the amplitude with respect to the previous
  33831. component. More octave components enable to specify more high
  33832. frequency details in the generated noise (e.g. small size variations
  33833. due to boulders in a generated terrain).
  33834. </p>
  33835. <a name="Options-6"></a>
  33836. <h4 class="subsection">18.11.1 Options<span class="pull-right"><a class="anchor hidden-xs" href="#Options-6" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Options-6" aria-hidden="true">TOC</a></span></h4>
  33837. <dl class="table">
  33838. <dt><samp class="option">size, s</samp></dt>
  33839. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  33840. syntax of this option, check the
  33841. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  33842. Default value is <code class="code">320x240</code>.
  33843. </p>
  33844. </dd>
  33845. <dt><samp class="option">rate, r</samp></dt>
  33846. <dd><p>Specify the frame rate expected for the video stream, expressed as a
  33847. number of frames per second. Default value is <code class="code">25</code>.
  33848. </p>
  33849. </dd>
  33850. <dt><samp class="option">octaves</samp></dt>
  33851. <dd><p>Specify the total number of components making up the noise, each one
  33852. with doubled frequency. Default value is <code class="code">1</code>.
  33853. </p>
  33854. </dd>
  33855. <dt><samp class="option">persistence</samp></dt>
  33856. <dd><p>Set the ratio used to compute the amplitude of the next octave
  33857. component with respect to the previous component amplitude. Default
  33858. value is <code class="code">1</code>.
  33859. </p>
  33860. </dd>
  33861. <dt><samp class="option">xscale</samp></dt>
  33862. <dt><samp class="option">yscale</samp></dt>
  33863. <dd><p>Define a scale factor used to multiple the x, y coordinates. This can
  33864. be useful to define an effect with a pattern stretched along the x or
  33865. y axis. Default value is <code class="code">1</code>.
  33866. </p>
  33867. </dd>
  33868. <dt><samp class="option">tscale</samp></dt>
  33869. <dd><p>Define a scale factor used to multiple the time coordinate. This can
  33870. be useful to change the time variation speed. Default value is <code class="code">1</code>.
  33871. </p>
  33872. </dd>
  33873. <dt><samp class="option">random_mode</samp></dt>
  33874. <dd><p>Set random mode used to compute initial pattern.
  33875. </p>
  33876. <p>Supported values are:
  33877. </p><dl class="table">
  33878. <dt><samp class="option">random</samp></dt>
  33879. <dd><p>Compute and use random seed.
  33880. </p>
  33881. </dd>
  33882. <dt><samp class="option">ken</samp></dt>
  33883. <dd><p>Use the predefined initial pattern defined by Ken Perlin in the
  33884. original article, can be useful to compare the output with other
  33885. sources.
  33886. </p>
  33887. </dd>
  33888. <dt><samp class="option">seed</samp></dt>
  33889. <dd><p>Use the value specified by <samp class="option">random_seed</samp> option.
  33890. </p></dd>
  33891. </dl>
  33892. <p>Default value is <code class="code">random</code>.
  33893. </p>
  33894. </dd>
  33895. <dt><samp class="option">random_seed, seed</samp></dt>
  33896. <dd><p>When <samp class="option">random_mode</samp> is set to <var class="var">random_seed</var>, use this value
  33897. to compute the initial pattern. Default value is <code class="code">0</code>.
  33898. </p></dd>
  33899. </dl>
  33900. <a name="Examples-161"></a>
  33901. <h4 class="subsection">18.11.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-161" aria-hidden="true">TOC</a></span></h4>
  33902. <ul class="itemize mark-bullet">
  33903. <li>Generate single component:
  33904. <div class="example">
  33905. <pre class="example-preformatted">perlin
  33906. </pre></div>
  33907. </li><li>Use Perlin noise with 7 components, each one with a halved contribution
  33908. to total amplitude:
  33909. <div class="example">
  33910. <pre class="example-preformatted">perlin=octaves=7:persistence=0.5
  33911. </pre></div>
  33912. </li><li>Chain Perlin noise with the <a class="ref" href="#lutyuv">lutyuv</a> to generate a black&amp;white
  33913. effect:
  33914. <div class="example">
  33915. <pre class="example-preformatted">perlin=octaves=3:tscale=0.3,lutyuv=y='if(lt(val\,128)\,255\,0)'
  33916. </pre></div>
  33917. </li><li>Stretch noise along the y axis, and convert gray level to red-only
  33918. signal:
  33919. <div class="example">
  33920. <pre class="example-preformatted">perlin=octaves=7:tscale=0.4:yscale=0.3,lutrgb=r=val:b=0:g=0
  33921. </pre></div>
  33922. </li></ul>
  33923. <a name="qrencodesrc"></a>
  33924. <h3 class="section">18.12 qrencodesrc<span class="pull-right"><a class="anchor hidden-xs" href="#qrencodesrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-qrencodesrc" aria-hidden="true">TOC</a></span></h3>
  33925. <p>Generate a QR code using the libqrencode library (see
  33926. <a class="url" href="https://fukuchi.org/works/qrencode/">https://fukuchi.org/works/qrencode/</a>).
  33927. </p>
  33928. <p>To enable the compilation of this source, you need to configure FFmpeg with
  33929. <code class="code">--enable-libqrencode</code>.
  33930. </p>
  33931. <p>The QR code is generated from the provided text or text pattern. The
  33932. corresponding QR code is scaled and put in the video output according to the
  33933. specified output size options.
  33934. </p>
  33935. <p>In case no text is specified, the QR code is not generated, but an empty colored
  33936. output is returned instead.
  33937. </p>
  33938. <p>This source accepts the following options:
  33939. </p>
  33940. <dl class="table">
  33941. <dt><samp class="option">qrcode_width, q</samp></dt>
  33942. <dt><samp class="option">padded_qrcode_width, Q</samp></dt>
  33943. <dd><p>Specify an expression for the width of the rendered QR code, with and without
  33944. padding. The <var class="var">qrcode_width</var> expression can reference the value set by the
  33945. <var class="var">padded_qrcode_width</var> expression, and vice versa.
  33946. By default <var class="var">padded_qrcode_width</var> is set to <var class="var">qrcode_width</var>, meaning that
  33947. there is no padding.
  33948. </p>
  33949. <p>These expressions are evaluated only once, when initializing the source.
  33950. See the <a class="ref" href="#qrencode_005fexpressions">qrencode Expressions</a> section for details.
  33951. </p>
  33952. <p>Note that some of the constants are missing for the source (for example the
  33953. <var class="var">x</var> or <var class="var">t</var> or ¸<var class="var">n</var>), since they only makes sense when evaluating the
  33954. expression for each frame rather than at initialization time.
  33955. </p>
  33956. </dd>
  33957. <dt><samp class="option">rate, r</samp></dt>
  33958. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  33959. generated per second. It has to be a string in the format
  33960. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  33961. number or a valid video frame rate abbreviation. The default value is
  33962. &quot;25&quot;.
  33963. </p>
  33964. </dd>
  33965. <dt><samp class="option">case_sensitive, cs</samp></dt>
  33966. <dd><p>Instruct libqrencode to use case sensitive encoding. This is enabled by
  33967. default. This can be disabled to reduce the QR encoding size.
  33968. </p>
  33969. </dd>
  33970. <dt><samp class="option">level, l</samp></dt>
  33971. <dd><p>Specify the QR encoding error correction level. With an higher correction level,
  33972. the encoding size will increase but the code will be more robust to corruption.
  33973. Lower level is <var class="var">L</var>.
  33974. </p>
  33975. <p>It accepts the following values:
  33976. </p><dl class="table">
  33977. <dt>&lsquo;<samp class="samp">L</samp>&rsquo;</dt>
  33978. <dt>&lsquo;<samp class="samp">M</samp>&rsquo;</dt>
  33979. <dt>&lsquo;<samp class="samp">Q</samp>&rsquo;</dt>
  33980. <dt>&lsquo;<samp class="samp">H</samp>&rsquo;</dt>
  33981. </dl>
  33982. </dd>
  33983. <dt><samp class="option">expansion</samp></dt>
  33984. <dd><p>Select how the input text is expanded. Can be either <code class="code">none</code>, or
  33985. <code class="code">normal</code> (default). See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode Text expansion</a>
  33986. section for details.
  33987. </p>
  33988. </dd>
  33989. <dt><samp class="option">text</samp></dt>
  33990. <dt><samp class="option">textfile</samp></dt>
  33991. <dd><p>Define the text to be rendered. In case neither is specified, no QR is encoded
  33992. (just an empty colored frame).
  33993. </p>
  33994. <p>In case expansion is enabled, the text is treated as a text template, using the
  33995. qrencode expansion mechanism. See the <a class="ref" href="#qrencode_005ftext_005fexpansion">qrencode
  33996. Text expansion</a> section for details.
  33997. </p>
  33998. </dd>
  33999. <dt><samp class="option">background_color, bc</samp></dt>
  34000. <dt><samp class="option">foreground_color, fc</samp></dt>
  34001. <dd><p>Set the QR code and background color. The default value of
  34002. <var class="var">foreground_color</var> is &quot;black&quot;, the default value of <var class="var">background_color</var>
  34003. is &quot;white&quot;.
  34004. </p>
  34005. <p>For the syntax of the color options, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot;
  34006. section in the ffmpeg-utils manual</a>.
  34007. </p></dd>
  34008. </dl>
  34009. <a name="Examples-162"></a>
  34010. <h4 class="subsection">18.12.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-162" aria-hidden="true">TOC</a></span></h4>
  34011. <ul class="itemize mark-bullet">
  34012. <li>Generate a QR code encoding the specified text with the default size:
  34013. <div class="example">
  34014. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org
  34015. </pre></div>
  34016. </li><li>Same as below, but select blue on pink colors:
  34017. <div class="example">
  34018. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:bc=pink:fc=blue
  34019. </pre></div>
  34020. </li><li>Generate a QR code with width of 200 pixels and padding, making the padded width
  34021. 4/3 of the QR code width:
  34022. <div class="example">
  34023. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:q=200:Q=4/3*q
  34024. </pre></div>
  34025. </li><li>Generate a QR code with padded width of 200 pixels and padding, making the QR
  34026. code width 3/4 of the padded width:
  34027. <div class="example">
  34028. <pre class="example-preformatted">qrencodesrc=text=www.ffmpeg.org:Q=200:q=3/4*Q
  34029. </pre></div>
  34030. </li><li>Generate a QR code encoding the frame number:
  34031. <div class="example">
  34032. <pre class="example-preformatted">qrencodesrc=text=%{n}
  34033. </pre></div>
  34034. </li><li>Generate a QR code encoding the GMT timestamp:
  34035. <div class="example">
  34036. <pre class="example-preformatted">qrencodesrc=text=%{gmtime}
  34037. </pre></div>
  34038. </li><li>Generate a QR code encoding the timestamp expressed as a float:
  34039. <div class="example">
  34040. <pre class="example-preformatted">qrencodesrc=text=%{pts}
  34041. </pre></div>
  34042. </li></ul>
  34043. <a class="anchor" id="allrgb"></a><a class="anchor" id="allyuv"></a><a class="anchor" id="color"></a><a class="anchor" id="colorchart"></a><a class="anchor" id="colorspectrum"></a><a class="anchor" id="haldclutsrc"></a><a class="anchor" id="nullsrc"></a><a class="anchor" id="pal75bars"></a><a class="anchor" id="pal100bars"></a><a class="anchor" id="rgbtestsrc"></a><a class="anchor" id="smptebars"></a><a class="anchor" id="smptehdbars"></a><a class="anchor" id="testsrc"></a><a class="anchor" id="testsrc2"></a><a class="anchor" id="yuvtestsrc"></a><a name="allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  34044. <h3 class="section">18.13 allrgb, allyuv, color, colorchart, colorspectrum, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc<span class="pull-right"><a class="anchor hidden-xs" href="#allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-allrgb_002c-allyuv_002c-color_002c-colorchart_002c-colorspectrum_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" aria-hidden="true">TOC</a></span></h3>
  34045. <p>The <code class="code">allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  34046. </p>
  34047. <p>The <code class="code">allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  34048. </p>
  34049. <p>The <code class="code">color</code> source provides an uniformly colored input.
  34050. </p>
  34051. <p>The <code class="code">colorchart</code> source provides a colors checker chart.
  34052. </p>
  34053. <p>The <code class="code">colorspectrum</code> source provides a color spectrum input.
  34054. </p>
  34055. <p>The <code class="code">haldclutsrc</code> source provides an identity Hald CLUT. See also
  34056. <a class="ref" href="#haldclut">haldclut</a> filter.
  34057. </p>
  34058. <p>The <code class="code">nullsrc</code> source returns unprocessed video frames. It is
  34059. mainly useful to be employed in analysis / debugging tools, or as the
  34060. source for filters which ignore the input data.
  34061. </p>
  34062. <p>The <code class="code">pal75bars</code> source generates a color bars pattern, based on
  34063. EBU PAL recommendations with 75% color levels.
  34064. </p>
  34065. <p>The <code class="code">pal100bars</code> source generates a color bars pattern, based on
  34066. EBU PAL recommendations with 100% color levels.
  34067. </p>
  34068. <p>The <code class="code">rgbtestsrc</code> source generates an RGB test pattern useful for
  34069. detecting RGB vs BGR issues. You should see a red, green and blue
  34070. stripe from top to bottom.
  34071. </p>
  34072. <p>The <code class="code">smptebars</code> source generates a color bars pattern, based on
  34073. the SMPTE Engineering Guideline EG 1-1990.
  34074. </p>
  34075. <p>The <code class="code">smptehdbars</code> source generates a color bars pattern, based on
  34076. the SMPTE RP 219-2002.
  34077. </p>
  34078. <p>The <code class="code">testsrc</code> source generates a test video pattern, showing a
  34079. color pattern, a scrolling gradient and a timestamp. This is mainly
  34080. intended for testing purposes.
  34081. </p>
  34082. <p>The <code class="code">testsrc2</code> source is similar to testsrc, but supports more
  34083. pixel formats instead of just <code class="code">rgb24</code>. This allows using it as an
  34084. input for other tests without requiring a format conversion.
  34085. </p>
  34086. <p>The <code class="code">yuvtestsrc</code> source generates an YUV test pattern. You should
  34087. see a y, cb and cr stripe from top to bottom.
  34088. </p>
  34089. <p>The sources accept the following parameters:
  34090. </p>
  34091. <dl class="table">
  34092. <dt><samp class="option">level</samp></dt>
  34093. <dd><p>Specify the level of the Hald CLUT, only available in the <code class="code">haldclutsrc</code>
  34094. source. A level of <code class="code">N</code> generates a picture of <code class="code">N*N*N</code> by <code class="code">N*N*N</code>
  34095. pixels to be used as identity matrix for 3D lookup tables. Each component is
  34096. coded on a <code class="code">1/(N*N)</code> scale.
  34097. </p>
  34098. </dd>
  34099. <dt><samp class="option">color, c</samp></dt>
  34100. <dd><p>Specify the color of the source, only available in the <code class="code">color</code>
  34101. source. For the syntax of this option, check the
  34102. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#color-syntax">&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  34103. </p>
  34104. </dd>
  34105. <dt><samp class="option">size, s</samp></dt>
  34106. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  34107. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34108. The default value is <code class="code">320x240</code>.
  34109. </p>
  34110. <p>This option is not available with the <code class="code">allrgb</code>, <code class="code">allyuv</code>, and
  34111. <code class="code">haldclutsrc</code> filters.
  34112. </p>
  34113. </dd>
  34114. <dt><samp class="option">rate, r</samp></dt>
  34115. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  34116. generated per second. It has to be a string in the format
  34117. <var class="var">frame_rate_num</var>/<var class="var">frame_rate_den</var>, an integer number, a floating point
  34118. number or a valid video frame rate abbreviation. The default value is
  34119. &quot;25&quot;.
  34120. </p>
  34121. </dd>
  34122. <dt><samp class="option">duration, d</samp></dt>
  34123. <dd><p>Set the duration of the sourced video. See
  34124. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  34125. for the accepted syntax.
  34126. </p>
  34127. <p>If not specified, or the expressed duration is negative, the video is
  34128. supposed to be generated forever.
  34129. </p>
  34130. <p>Since the frame rate is used as time base, all frames including the last one
  34131. will have their full duration. If the specified duration is not a multiple
  34132. of the frame duration, it will be rounded up.
  34133. </p>
  34134. </dd>
  34135. <dt><samp class="option">sar</samp></dt>
  34136. <dd><p>Set the sample aspect ratio of the sourced video.
  34137. </p>
  34138. </dd>
  34139. <dt><samp class="option">alpha</samp></dt>
  34140. <dd><p>Specify the alpha (opacity) of the background, only available in the
  34141. <code class="code">testsrc2</code> source. The value must be between 0 (fully transparent) and
  34142. 255 (fully opaque, the default).
  34143. </p>
  34144. </dd>
  34145. <dt><samp class="option">decimals, n</samp></dt>
  34146. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  34147. <code class="code">testsrc</code> source.
  34148. </p>
  34149. <p>The displayed timestamp value will correspond to the original
  34150. timestamp value multiplied by the power of 10 of the specified
  34151. value. Default value is 0.
  34152. </p>
  34153. </dd>
  34154. <dt><samp class="option">type</samp></dt>
  34155. <dd><p>Set the type of the color spectrum, only available in the
  34156. <code class="code">colorspectrum</code> source. Can be one of the following:
  34157. </p>
  34158. <dl class="table">
  34159. <dt>&lsquo;<samp class="samp">black</samp>&rsquo;</dt>
  34160. <dt>&lsquo;<samp class="samp">white</samp>&rsquo;</dt>
  34161. <dt>&lsquo;<samp class="samp">all</samp>&rsquo;</dt>
  34162. </dl>
  34163. </dd>
  34164. <dt><samp class="option">patch_size</samp></dt>
  34165. <dd><p>Set patch size of single color patch, only available in the
  34166. <code class="code">colorchart</code> source. Default is <code class="code">64x64</code>.
  34167. </p>
  34168. </dd>
  34169. <dt><samp class="option">preset</samp></dt>
  34170. <dd><p>Set colorchecker colors preset, only available in the
  34171. <code class="code">colorchart</code> source.
  34172. </p>
  34173. <p>Available values are:
  34174. </p><dl class="table">
  34175. <dt>&lsquo;<samp class="samp">reference</samp>&rsquo;</dt>
  34176. <dt>&lsquo;<samp class="samp">skintones</samp>&rsquo;</dt>
  34177. </dl>
  34178. <p>Default value is <code class="code">reference</code>.
  34179. </p></dd>
  34180. </dl>
  34181. <a name="Examples-163"></a>
  34182. <h4 class="subsection">18.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-163" aria-hidden="true">TOC</a></span></h4>
  34183. <ul class="itemize mark-bullet">
  34184. <li>Generate a video with a duration of 5.3 seconds, with size
  34185. 176x144 and a frame rate of 10 frames per second:
  34186. <div class="example">
  34187. <pre class="example-preformatted">testsrc=duration=5.3:size=qcif:rate=10
  34188. </pre></div>
  34189. </li><li>The following graph description will generate a red source
  34190. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  34191. frames per second:
  34192. <div class="example">
  34193. <pre class="example-preformatted">color=c=red@0.2:s=qcif:r=10
  34194. </pre></div>
  34195. </li><li>If the input content is to be ignored, <code class="code">nullsrc</code> can be used. The
  34196. following command generates noise in the luma plane by employing
  34197. the <code class="code">geq</code> filter:
  34198. <div class="example">
  34199. <pre class="example-preformatted">nullsrc=s=256x256, geq=random(1)*255:128:128
  34200. </pre></div>
  34201. </li></ul>
  34202. <a name="Commands-157"></a>
  34203. <h4 class="subsection">18.13.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-157" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-157" aria-hidden="true">TOC</a></span></h4>
  34204. <p>The <code class="code">color</code> source supports the following commands:
  34205. </p>
  34206. <dl class="table">
  34207. <dt><samp class="option">c, color</samp></dt>
  34208. <dd><p>Set the color of the created image. Accepts the same syntax of the
  34209. corresponding <samp class="option">color</samp> option.
  34210. </p></dd>
  34211. </dl>
  34212. <a name="openclsrc"></a>
  34213. <h3 class="section">18.14 openclsrc<span class="pull-right"><a class="anchor hidden-xs" href="#openclsrc" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-openclsrc" aria-hidden="true">TOC</a></span></h3>
  34214. <p>Generate video using an OpenCL program.
  34215. </p>
  34216. <dl class="table">
  34217. <dt><samp class="option">source</samp></dt>
  34218. <dd><p>OpenCL program source file.
  34219. </p>
  34220. </dd>
  34221. <dt><samp class="option">kernel</samp></dt>
  34222. <dd><p>Kernel name in program.
  34223. </p>
  34224. </dd>
  34225. <dt><samp class="option">size, s</samp></dt>
  34226. <dd><p>Size of frames to generate. This must be set.
  34227. </p>
  34228. </dd>
  34229. <dt><samp class="option">format</samp></dt>
  34230. <dd><p>Pixel format to use for the generated frames. This must be set.
  34231. </p>
  34232. </dd>
  34233. <dt><samp class="option">rate, r</samp></dt>
  34234. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  34235. </p>
  34236. </dd>
  34237. </dl>
  34238. <p>For details of how the program loading works, see the <a class="ref" href="#program_005fopencl">program_opencl</a>
  34239. filter.
  34240. </p>
  34241. <p>Example programs:
  34242. </p>
  34243. <ul class="itemize mark-bullet">
  34244. <li>Generate a colour ramp by setting pixel values from the position of the pixel
  34245. in the output image. (Note that this will work with all pixel formats, but
  34246. the generated output will not be the same.)
  34247. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  34248. unsigned int index)
  34249. {
  34250. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  34251. float4 val;
  34252. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  34253. write_imagef(dst, loc, val);
  34254. }
  34255. </pre>
  34256. </li><li>Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  34257. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  34258. unsigned int index)
  34259. {
  34260. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  34261. float4 value = 0.0f;
  34262. int x = loc.x + index;
  34263. int y = loc.y + index;
  34264. while (x &gt; 0 || y &gt; 0) {
  34265. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  34266. value = 1.0f;
  34267. break;
  34268. }
  34269. x /= 3;
  34270. y /= 3;
  34271. }
  34272. write_imagef(dst, loc, value);
  34273. }
  34274. </pre>
  34275. </li></ul>
  34276. <a name="sierpinski"></a>
  34277. <h3 class="section">18.15 sierpinski<span class="pull-right"><a class="anchor hidden-xs" href="#sierpinski" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sierpinski" aria-hidden="true">TOC</a></span></h3>
  34278. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  34279. </p>
  34280. <p>This source accepts the following options:
  34281. </p>
  34282. <dl class="table">
  34283. <dt><samp class="option">size, s</samp></dt>
  34284. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  34285. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  34286. </p>
  34287. </dd>
  34288. <dt><samp class="option">rate, r</samp></dt>
  34289. <dd><p>Set frame rate, expressed as number of frames per second. Default
  34290. value is &quot;25&quot;.
  34291. </p>
  34292. </dd>
  34293. <dt><samp class="option">seed</samp></dt>
  34294. <dd><p>Set seed which is used for random panning.
  34295. </p>
  34296. </dd>
  34297. <dt><samp class="option">jump</samp></dt>
  34298. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  34299. </p>
  34300. </dd>
  34301. <dt><samp class="option">type</samp></dt>
  34302. <dd><p>Set fractal type, can be default <code class="code">carpet</code> or <code class="code">triangle</code>.
  34303. </p></dd>
  34304. </dl>
  34305. <a name="zoneplate"></a>
  34306. <h3 class="section">18.16 zoneplate<span class="pull-right"><a class="anchor hidden-xs" href="#zoneplate" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zoneplate" aria-hidden="true">TOC</a></span></h3>
  34307. <p>Generate a zoneplate test video pattern.
  34308. </p>
  34309. <p>This source accepts the following options:
  34310. </p>
  34311. <dl class="table">
  34312. <dt><samp class="option">size, s</samp></dt>
  34313. <dd><p>Set frame size. For the syntax of this option, check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video
  34314. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;320x240&quot;.
  34315. </p>
  34316. </dd>
  34317. <dt><samp class="option">rate, r</samp></dt>
  34318. <dd><p>Set frame rate, expressed as number of frames per second. Default
  34319. value is &quot;25&quot;.
  34320. </p>
  34321. </dd>
  34322. <dt><samp class="option">duration, d</samp></dt>
  34323. <dd><p>Set the duration of the sourced video. See
  34324. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#time-duration-syntax">the Time duration section in the ffmpeg-utils(1) manual</a>
  34325. for the accepted syntax.
  34326. </p>
  34327. <p>If not specified, or the expressed duration is negative, the video is
  34328. supposed to be generated forever.
  34329. </p>
  34330. </dd>
  34331. <dt><samp class="option">sar</samp></dt>
  34332. <dd><p>Set the sample aspect ratio of the sourced video.
  34333. </p>
  34334. </dd>
  34335. <dt><samp class="option">precision</samp></dt>
  34336. <dd><p>Set precision in bits for look-up table for sine calculations. Default value is 10.
  34337. Allowed range is from 4 to 16.
  34338. </p>
  34339. </dd>
  34340. <dt><samp class="option">xo</samp></dt>
  34341. <dd><p>Set horizontal axis offset for output signal. Default value is 0.
  34342. </p>
  34343. </dd>
  34344. <dt><samp class="option">yo</samp></dt>
  34345. <dd><p>Set vertical axis offset for output signal. Default value is 0.
  34346. </p>
  34347. </dd>
  34348. <dt><samp class="option">to</samp></dt>
  34349. <dd><p>Set time axis offset for output signal. Default value is 0.
  34350. </p>
  34351. </dd>
  34352. <dt><samp class="option">k0</samp></dt>
  34353. <dd><p>Set 0-order, constant added to signal phase. Default value is 0.
  34354. </p>
  34355. </dd>
  34356. <dt><samp class="option">kx</samp></dt>
  34357. <dd><p>Set 1-order, phase factor multiplier for horizontal axis. Default value is 0.
  34358. </p>
  34359. </dd>
  34360. <dt><samp class="option">ky</samp></dt>
  34361. <dd><p>Set 1-order, phase factor multiplier for vertical axis. Default value is 0.
  34362. </p>
  34363. </dd>
  34364. <dt><samp class="option">kt</samp></dt>
  34365. <dd><p>Set 1-order, phase factor multiplier for time axis. Default value is 0.
  34366. </p>
  34367. </dd>
  34368. <dt><samp class="option">kxt, kyt, kxy</samp></dt>
  34369. <dd><p>Set phase factor multipliers for combination of spatial and temporal axis.
  34370. Default value is 0.
  34371. </p>
  34372. </dd>
  34373. <dt><samp class="option">kx2</samp></dt>
  34374. <dd><p>Set 2-order, phase factor multiplier for horizontal axis. Default value is 0.
  34375. </p>
  34376. </dd>
  34377. <dt><samp class="option">ky2</samp></dt>
  34378. <dd><p>Set 2-order, phase factor multiplier for vertical axis. Default value is 0.
  34379. </p>
  34380. </dd>
  34381. <dt><samp class="option">kt2</samp></dt>
  34382. <dd><p>Set 2-order, phase factor multiplier for time axis. Default value is 0.
  34383. </p>
  34384. </dd>
  34385. <dt><samp class="option">ku</samp></dt>
  34386. <dd><p>Set the constant added to final phase to produce chroma-blue component of signal.
  34387. Default value is 0.
  34388. </p>
  34389. </dd>
  34390. <dt><samp class="option">kv</samp></dt>
  34391. <dd><p>Set the constant added to final phase to produce chroma-red component of signal.
  34392. Default value is 0.
  34393. </p></dd>
  34394. </dl>
  34395. <a name="Commands-158"></a>
  34396. <h4 class="subsection">18.16.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-158" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-158" aria-hidden="true">TOC</a></span></h4>
  34397. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  34398. </p>
  34399. <a name="Examples-164"></a>
  34400. <h4 class="subsection">18.16.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-164" aria-hidden="true">TOC</a></span></h4>
  34401. <ul class="itemize mark-bullet">
  34402. <li>Generate horizontal color sine sweep:
  34403. <div class="example">
  34404. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:kx2=256:s=wvga:xo=-426:kt=11
  34405. </pre></div>
  34406. </li><li>Generate vertical color sine sweep:
  34407. <div class="example">
  34408. <pre class="example-preformatted">zoneplate=ku=512:kv=0:kt2=0:ky2=156:s=wvga:yo=-240:kt=11
  34409. </pre></div>
  34410. </li><li>Generate circular zone-plate:
  34411. <div class="example">
  34412. <pre class="example-preformatted">zoneplate=ku=512:kv=100:kt2=0:ky2=256:kx2=556:s=wvga:yo=0:kt=11
  34413. </pre></div>
  34414. </li></ul>
  34415. <a name="Video-Sinks"></a>
  34416. <h2 class="chapter">19 Video Sinks<span class="pull-right"><a class="anchor hidden-xs" href="#Video-Sinks" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Video-Sinks" aria-hidden="true">TOC</a></span></h2>
  34417. <p>Below is a description of the currently available video sinks.
  34418. </p>
  34419. <a name="buffersink"></a>
  34420. <h3 class="section">19.1 buffersink<span class="pull-right"><a class="anchor hidden-xs" href="#buffersink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-buffersink" aria-hidden="true">TOC</a></span></h3>
  34421. <p>Buffer video frames, and make them available to the end of the filter
  34422. graph.
  34423. </p>
  34424. <p>This sink is mainly intended for programmatic use, in particular
  34425. through the interface defined in <samp class="file">libavfilter/buffersink.h</samp>
  34426. or the options system.
  34427. </p>
  34428. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  34429. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  34430. parameter to <code class="code">avfilter_init_filter</code> for initialization.
  34431. </p>
  34432. <a name="nullsink"></a>
  34433. <h3 class="section">19.2 nullsink<span class="pull-right"><a class="anchor hidden-xs" href="#nullsink" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nullsink" aria-hidden="true">TOC</a></span></h3>
  34434. <p>Null video sink: do absolutely nothing with the input video. It is
  34435. mainly useful as a template and for use in analysis / debugging
  34436. tools.
  34437. </p>
  34438. <a name="Multimedia-Filters"></a>
  34439. <h2 class="chapter">20 Multimedia Filters<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Filters" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Filters" aria-hidden="true">TOC</a></span></h2>
  34440. <p>Below is a description of the currently available multimedia filters.
  34441. </p>
  34442. <a name="a3dscope"></a>
  34443. <h3 class="section">20.1 a3dscope<span class="pull-right"><a class="anchor hidden-xs" href="#a3dscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-a3dscope" aria-hidden="true">TOC</a></span></h3>
  34444. <p>Convert input audio to 3d scope video output.
  34445. </p>
  34446. <p>The filter accepts the following options:
  34447. </p>
  34448. <dl class="table">
  34449. <dt><samp class="option">rate, r</samp></dt>
  34450. <dd><p>Set frame rate, expressed as number of frames per second. Default
  34451. value is &quot;25&quot;.
  34452. </p>
  34453. </dd>
  34454. <dt><samp class="option">size, s</samp></dt>
  34455. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  34456. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34457. Default value is <code class="code">hd720</code>.
  34458. </p>
  34459. </dd>
  34460. <dt><samp class="option">fov</samp></dt>
  34461. <dd><p>Set the camera field of view. Default is 90 degrees.
  34462. Allowed range is from 40 to 150.
  34463. </p>
  34464. </dd>
  34465. <dt><samp class="option">roll</samp></dt>
  34466. <dd><p>Set the camera roll.
  34467. </p>
  34468. </dd>
  34469. <dt><samp class="option">pitch</samp></dt>
  34470. <dd><p>Set the camera pitch.
  34471. </p>
  34472. </dd>
  34473. <dt><samp class="option">yaw</samp></dt>
  34474. <dd><p>Set the camera yaw.
  34475. </p>
  34476. </dd>
  34477. <dt><samp class="option">xzoom</samp></dt>
  34478. <dd><p>Set the camera zoom on X-axis.
  34479. </p>
  34480. </dd>
  34481. <dt><samp class="option">yzoom</samp></dt>
  34482. <dd><p>Set the camera zoom on Y-axis.
  34483. </p>
  34484. </dd>
  34485. <dt><samp class="option">zzoom</samp></dt>
  34486. <dd><p>Set the camera zoom on Z-axis.
  34487. </p>
  34488. </dd>
  34489. <dt><samp class="option">xpos</samp></dt>
  34490. <dd><p>Set the camera position on X-axis.
  34491. </p>
  34492. </dd>
  34493. <dt><samp class="option">ypos</samp></dt>
  34494. <dd><p>Set the camera position on Y-axis.
  34495. </p>
  34496. </dd>
  34497. <dt><samp class="option">zpos</samp></dt>
  34498. <dd><p>Set the camera position on Z-axis.
  34499. </p>
  34500. </dd>
  34501. <dt><samp class="option">length</samp></dt>
  34502. <dd><p>Set the length of displayed audio waves in number of frames.
  34503. </p></dd>
  34504. </dl>
  34505. <a name="Commands-159"></a>
  34506. <h4 class="subsection">20.1.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-159" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-159" aria-hidden="true">TOC</a></span></h4>
  34507. <p>Filter supports the some above options as <a class="ref" href="#commands">commands</a>.
  34508. </p>
  34509. <a name="abitscope"></a>
  34510. <h3 class="section">20.2 abitscope<span class="pull-right"><a class="anchor hidden-xs" href="#abitscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-abitscope" aria-hidden="true">TOC</a></span></h3>
  34511. <p>Convert input audio to a video output, displaying the audio bit scope.
  34512. </p>
  34513. <p>The filter accepts the following options:
  34514. </p>
  34515. <dl class="table">
  34516. <dt><samp class="option">rate, r</samp></dt>
  34517. <dd><p>Set frame rate, expressed as number of frames per second. Default
  34518. value is &quot;25&quot;.
  34519. </p>
  34520. </dd>
  34521. <dt><samp class="option">size, s</samp></dt>
  34522. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  34523. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34524. Default value is <code class="code">1024x256</code>.
  34525. </p>
  34526. </dd>
  34527. <dt><samp class="option">colors</samp></dt>
  34528. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  34529. draw channels. Unrecognized or missing colors will be replaced
  34530. by white color.
  34531. </p>
  34532. </dd>
  34533. <dt><samp class="option">mode, m</samp></dt>
  34534. <dd><p>Set output mode. Can be <code class="code">bars</code> or <code class="code">trace</code>. Default is <code class="code">bars</code>.
  34535. </p></dd>
  34536. </dl>
  34537. <a name="adrawgraph"></a>
  34538. <h3 class="section">20.3 adrawgraph<span class="pull-right"><a class="anchor hidden-xs" href="#adrawgraph" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-adrawgraph" aria-hidden="true">TOC</a></span></h3>
  34539. <p>Draw a graph using input audio metadata.
  34540. </p>
  34541. <p>See <a class="ref" href="#drawgraph">drawgraph</a>
  34542. </p>
  34543. <a name="agraphmonitor"></a>
  34544. <h3 class="section">20.4 agraphmonitor<span class="pull-right"><a class="anchor hidden-xs" href="#agraphmonitor" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-agraphmonitor" aria-hidden="true">TOC</a></span></h3>
  34545. <p>See <a class="ref" href="#graphmonitor">graphmonitor</a>.
  34546. </p>
  34547. <a name="ahistogram"></a>
  34548. <h3 class="section">20.5 ahistogram<span class="pull-right"><a class="anchor hidden-xs" href="#ahistogram" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ahistogram" aria-hidden="true">TOC</a></span></h3>
  34549. <p>Convert input audio to a video output, displaying the volume histogram.
  34550. </p>
  34551. <p>The filter accepts the following options:
  34552. </p>
  34553. <dl class="table">
  34554. <dt><samp class="option">dmode</samp></dt>
  34555. <dd><p>Specify how histogram is calculated.
  34556. </p>
  34557. <p>It accepts the following values:
  34558. </p><dl class="table">
  34559. <dt>&lsquo;<samp class="samp">single</samp>&rsquo;</dt>
  34560. <dd><p>Use single histogram for all channels.
  34561. </p></dd>
  34562. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  34563. <dd><p>Use separate histogram for each channel.
  34564. </p></dd>
  34565. </dl>
  34566. <p>Default is <code class="code">single</code>.
  34567. </p>
  34568. </dd>
  34569. <dt><samp class="option">rate, r</samp></dt>
  34570. <dd><p>Set frame rate, expressed as number of frames per second. Default
  34571. value is &quot;25&quot;.
  34572. </p>
  34573. </dd>
  34574. <dt><samp class="option">size, s</samp></dt>
  34575. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  34576. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34577. Default value is <code class="code">hd720</code>.
  34578. </p>
  34579. </dd>
  34580. <dt><samp class="option">scale</samp></dt>
  34581. <dd><p>Set display scale.
  34582. </p>
  34583. <p>It accepts the following values:
  34584. </p><dl class="table">
  34585. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  34586. <dd><p>logarithmic
  34587. </p></dd>
  34588. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  34589. <dd><p>square root
  34590. </p></dd>
  34591. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  34592. <dd><p>cubic root
  34593. </p></dd>
  34594. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  34595. <dd><p>linear
  34596. </p></dd>
  34597. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  34598. <dd><p>reverse logarithmic
  34599. </p></dd>
  34600. </dl>
  34601. <p>Default is <code class="code">log</code>.
  34602. </p>
  34603. </dd>
  34604. <dt><samp class="option">ascale</samp></dt>
  34605. <dd><p>Set amplitude scale.
  34606. </p>
  34607. <p>It accepts the following values:
  34608. </p><dl class="table">
  34609. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  34610. <dd><p>logarithmic
  34611. </p></dd>
  34612. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  34613. <dd><p>linear
  34614. </p></dd>
  34615. </dl>
  34616. <p>Default is <code class="code">log</code>.
  34617. </p>
  34618. </dd>
  34619. <dt><samp class="option">acount</samp></dt>
  34620. <dd><p>Set how much frames to accumulate in histogram.
  34621. Default is 1. Setting this to -1 accumulates all frames.
  34622. </p>
  34623. </dd>
  34624. <dt><samp class="option">rheight</samp></dt>
  34625. <dd><p>Set histogram ratio of window height.
  34626. </p>
  34627. </dd>
  34628. <dt><samp class="option">slide</samp></dt>
  34629. <dd><p>Set sonogram sliding.
  34630. </p>
  34631. <p>It accepts the following values:
  34632. </p><dl class="table">
  34633. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  34634. <dd><p>replace old rows with new ones.
  34635. </p></dd>
  34636. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  34637. <dd><p>scroll from top to bottom.
  34638. </p></dd>
  34639. </dl>
  34640. <p>Default is <code class="code">replace</code>.
  34641. </p>
  34642. </dd>
  34643. <dt><samp class="option">hmode</samp></dt>
  34644. <dd><p>Set histogram mode.
  34645. </p>
  34646. <p>It accepts the following values:
  34647. </p><dl class="table">
  34648. <dt>&lsquo;<samp class="samp">abs</samp>&rsquo;</dt>
  34649. <dd><p>Use absolute values of samples.
  34650. </p></dd>
  34651. <dt>&lsquo;<samp class="samp">sign</samp>&rsquo;</dt>
  34652. <dd><p>Use untouched values of samples.
  34653. </p></dd>
  34654. </dl>
  34655. <p>Default is <code class="code">abs</code>.
  34656. </p></dd>
  34657. </dl>
  34658. <a name="aphasemeter"></a>
  34659. <h3 class="section">20.6 aphasemeter<span class="pull-right"><a class="anchor hidden-xs" href="#aphasemeter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-aphasemeter" aria-hidden="true">TOC</a></span></h3>
  34660. <p>Measures phase of input audio, which is exported as metadata <code class="code">lavfi.aphasemeter.phase</code>,
  34661. representing mean phase of current audio frame. A video output can also be produced and is
  34662. enabled by default. The audio is passed through as first output.
  34663. </p>
  34664. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  34665. range <code class="code">[-1, 1]</code> where <code class="code">-1</code> means left and right channels are completely out of phase
  34666. and <code class="code">1</code> means channels are in phase.
  34667. </p>
  34668. <p>The filter accepts the following options, all related to its video output:
  34669. </p>
  34670. <dl class="table">
  34671. <dt><samp class="option">rate, r</samp></dt>
  34672. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  34673. </p>
  34674. </dd>
  34675. <dt><samp class="option">size, s</samp></dt>
  34676. <dd><p>Set the video size for the output. For the syntax of this option, check the
  34677. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34678. Default value is <code class="code">800x400</code>.
  34679. </p>
  34680. </dd>
  34681. <dt><samp class="option">rc</samp></dt>
  34682. <dt><samp class="option">gc</samp></dt>
  34683. <dt><samp class="option">bc</samp></dt>
  34684. <dd><p>Specify the red, green, blue contrast. Default values are <code class="code">2</code>,
  34685. <code class="code">7</code> and <code class="code">1</code>.
  34686. Allowed range is <code class="code">[0, 255]</code>.
  34687. </p>
  34688. </dd>
  34689. <dt><samp class="option">mpc</samp></dt>
  34690. <dd><p>Set color which will be used for drawing median phase. If color is
  34691. <code class="code">none</code> which is default, no median phase value will be drawn.
  34692. </p>
  34693. </dd>
  34694. <dt><samp class="option">video</samp></dt>
  34695. <dd><p>Enable video output. Default is enabled.
  34696. </p></dd>
  34697. </dl>
  34698. <a name="phasing-detection"></a>
  34699. <h4 class="subsection">20.6.1 phasing detection<span class="pull-right"><a class="anchor hidden-xs" href="#phasing-detection" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-phasing-detection" aria-hidden="true">TOC</a></span></h4>
  34700. <p>The filter also detects out of phase and mono sequences in stereo streams.
  34701. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  34702. </p>
  34703. <p>The filter accepts the following options for this detection:
  34704. </p>
  34705. <dl class="table">
  34706. <dt><samp class="option">phasing</samp></dt>
  34707. <dd><p>Enable mono and out of phase detection. Default is disabled.
  34708. </p>
  34709. </dd>
  34710. <dt><samp class="option">tolerance, t</samp></dt>
  34711. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code class="code">0</code>.
  34712. Allowed range is <code class="code">[0, 1]</code>.
  34713. </p>
  34714. </dd>
  34715. <dt><samp class="option">angle, a</samp></dt>
  34716. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code class="code">170</code>.
  34717. Allowed range is <code class="code">[90, 180]</code>.
  34718. </p>
  34719. </dd>
  34720. <dt><samp class="option">duration, d</samp></dt>
  34721. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code class="code">2</code>.
  34722. </p></dd>
  34723. </dl>
  34724. <a name="Examples-165"></a>
  34725. <h4 class="subsection">20.6.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-165" aria-hidden="true">TOC</a></span></h4>
  34726. <ul class="itemize mark-bullet">
  34727. <li>Complete example with <code class="command">ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  34728. <div class="example">
  34729. <pre class="example-preformatted">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  34730. </pre></div>
  34731. </li></ul>
  34732. <a name="avectorscope"></a>
  34733. <h3 class="section">20.7 avectorscope<span class="pull-right"><a class="anchor hidden-xs" href="#avectorscope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avectorscope" aria-hidden="true">TOC</a></span></h3>
  34734. <p>Convert input audio to a video output, representing the audio vector
  34735. scope.
  34736. </p>
  34737. <p>The filter is used to measure the difference between channels of stereo
  34738. audio stream. A monaural signal, consisting of identical left and right
  34739. signal, results in straight vertical line. Any stereo separation is visible
  34740. as a deviation from this line, creating a Lissajous figure.
  34741. If the straight (or deviation from it) but horizontal line appears this
  34742. indicates that the left and right channels are out of phase.
  34743. </p>
  34744. <p>The filter accepts the following options:
  34745. </p>
  34746. <dl class="table">
  34747. <dt><samp class="option">mode, m</samp></dt>
  34748. <dd><p>Set the vectorscope mode.
  34749. </p>
  34750. <p>Available values are:
  34751. </p><dl class="table">
  34752. <dt>&lsquo;<samp class="samp">lissajous</samp>&rsquo;</dt>
  34753. <dd><p>Lissajous rotated by 45 degrees.
  34754. </p>
  34755. </dd>
  34756. <dt>&lsquo;<samp class="samp">lissajous_xy</samp>&rsquo;</dt>
  34757. <dd><p>Same as above but not rotated.
  34758. </p>
  34759. </dd>
  34760. <dt>&lsquo;<samp class="samp">polar</samp>&rsquo;</dt>
  34761. <dd><p>Shape resembling half of circle.
  34762. </p></dd>
  34763. </dl>
  34764. <p>Default value is &lsquo;<samp class="samp">lissajous</samp>&rsquo;.
  34765. </p>
  34766. </dd>
  34767. <dt><samp class="option">size, s</samp></dt>
  34768. <dd><p>Set the video size for the output. For the syntax of this option, check the
  34769. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  34770. Default value is <code class="code">400x400</code>.
  34771. </p>
  34772. </dd>
  34773. <dt><samp class="option">rate, r</samp></dt>
  34774. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  34775. </p>
  34776. </dd>
  34777. <dt><samp class="option">rc</samp></dt>
  34778. <dt><samp class="option">gc</samp></dt>
  34779. <dt><samp class="option">bc</samp></dt>
  34780. <dt><samp class="option">ac</samp></dt>
  34781. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code class="code">40</code>,
  34782. <code class="code">160</code>, <code class="code">80</code> and <code class="code">255</code>.
  34783. Allowed range is <code class="code">[0, 255]</code>.
  34784. </p>
  34785. </dd>
  34786. <dt><samp class="option">rf</samp></dt>
  34787. <dt><samp class="option">gf</samp></dt>
  34788. <dt><samp class="option">bf</samp></dt>
  34789. <dt><samp class="option">af</samp></dt>
  34790. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code class="code">15</code>,
  34791. <code class="code">10</code>, <code class="code">5</code> and <code class="code">5</code>.
  34792. Allowed range is <code class="code">[0, 255]</code>.
  34793. </p>
  34794. </dd>
  34795. <dt><samp class="option">zoom</samp></dt>
  34796. <dd><p>Set the zoom factor. Default value is <code class="code">1</code>. Allowed range is <code class="code">[0, 10]</code>.
  34797. Values lower than <var class="var">1</var> will auto adjust zoom factor to maximal possible value.
  34798. </p>
  34799. </dd>
  34800. <dt><samp class="option">draw</samp></dt>
  34801. <dd><p>Set the vectorscope drawing mode.
  34802. </p>
  34803. <p>Available values are:
  34804. </p><dl class="table">
  34805. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  34806. <dd><p>Draw dot for each sample.
  34807. </p>
  34808. </dd>
  34809. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  34810. <dd><p>Draw line between previous and current sample.
  34811. </p>
  34812. </dd>
  34813. <dt>&lsquo;<samp class="samp">aaline</samp>&rsquo;</dt>
  34814. <dd><p>Draw anti-aliased line between previous and current sample.
  34815. </p></dd>
  34816. </dl>
  34817. <p>Default value is &lsquo;<samp class="samp">dot</samp>&rsquo;.
  34818. </p>
  34819. </dd>
  34820. <dt><samp class="option">scale</samp></dt>
  34821. <dd><p>Specify amplitude scale of audio samples.
  34822. </p>
  34823. <p>Available values are:
  34824. </p><dl class="table">
  34825. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  34826. <dd><p>Linear.
  34827. </p>
  34828. </dd>
  34829. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  34830. <dd><p>Square root.
  34831. </p>
  34832. </dd>
  34833. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  34834. <dd><p>Cubic root.
  34835. </p>
  34836. </dd>
  34837. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  34838. <dd><p>Logarithmic.
  34839. </p></dd>
  34840. </dl>
  34841. </dd>
  34842. <dt><samp class="option">swap</samp></dt>
  34843. <dd><p>Swap left channel axis with right channel axis.
  34844. </p>
  34845. </dd>
  34846. <dt><samp class="option">mirror</samp></dt>
  34847. <dd><p>Mirror axis.
  34848. </p>
  34849. <dl class="table">
  34850. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  34851. <dd><p>No mirror.
  34852. </p>
  34853. </dd>
  34854. <dt>&lsquo;<samp class="samp">x</samp>&rsquo;</dt>
  34855. <dd><p>Mirror only x axis.
  34856. </p>
  34857. </dd>
  34858. <dt>&lsquo;<samp class="samp">y</samp>&rsquo;</dt>
  34859. <dd><p>Mirror only y axis.
  34860. </p>
  34861. </dd>
  34862. <dt>&lsquo;<samp class="samp">xy</samp>&rsquo;</dt>
  34863. <dd><p>Mirror both axis.
  34864. </p></dd>
  34865. </dl>
  34866. </dd>
  34867. </dl>
  34868. <a name="Examples-166"></a>
  34869. <h4 class="subsection">20.7.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-166" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-166" aria-hidden="true">TOC</a></span></h4>
  34870. <ul class="itemize mark-bullet">
  34871. <li>Complete example using <code class="command">ffplay</code>:
  34872. <div class="example">
  34873. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  34874. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  34875. </pre></div>
  34876. </li></ul>
  34877. <a name="Commands-160"></a>
  34878. <h4 class="subsection">20.7.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-160" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-160" aria-hidden="true">TOC</a></span></h4>
  34879. <p>This filter supports the all above options as commands except options <code class="code">size</code> and <code class="code">rate</code>.
  34880. </p>
  34881. <a name="bench_002c-abench"></a>
  34882. <h3 class="section">20.8 bench, abench<span class="pull-right"><a class="anchor hidden-xs" href="#bench_002c-abench" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bench_002c-abench" aria-hidden="true">TOC</a></span></h3>
  34883. <p>Benchmark part of a filtergraph.
  34884. </p>
  34885. <p>The filter accepts the following options:
  34886. </p>
  34887. <dl class="table">
  34888. <dt><samp class="option">action</samp></dt>
  34889. <dd><p>Start or stop a timer.
  34890. </p>
  34891. <p>Available values are:
  34892. </p><dl class="table">
  34893. <dt>&lsquo;<samp class="samp">start</samp>&rsquo;</dt>
  34894. <dd><p>Get the current time, set it as frame metadata (using the key
  34895. <code class="code">lavfi.bench.start_time</code>), and forward the frame to the next filter.
  34896. </p>
  34897. </dd>
  34898. <dt>&lsquo;<samp class="samp">stop</samp>&rsquo;</dt>
  34899. <dd><p>Get the current time and fetch the <code class="code">lavfi.bench.start_time</code> metadata from
  34900. the input frame metadata to get the time difference. Time difference, average,
  34901. maximum and minimum time (respectively <code class="code">t</code>, <code class="code">avg</code>, <code class="code">max</code> and
  34902. <code class="code">min</code>) are then printed. The timestamps are expressed in seconds.
  34903. </p></dd>
  34904. </dl>
  34905. </dd>
  34906. </dl>
  34907. <a name="Examples-167"></a>
  34908. <h4 class="subsection">20.8.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-167" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-167" aria-hidden="true">TOC</a></span></h4>
  34909. <ul class="itemize mark-bullet">
  34910. <li>Benchmark <a class="ref" href="#selectivecolor">selectivecolor</a> filter:
  34911. <div class="example">
  34912. <pre class="example-preformatted">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  34913. </pre></div>
  34914. </li></ul>
  34915. <a class="anchor" id="concat-filter"></a><a name="concat"></a>
  34916. <h3 class="section">20.9 concat<span class="pull-right"><a class="anchor hidden-xs" href="#concat" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-concat" aria-hidden="true">TOC</a></span></h3>
  34917. <p>Concatenate audio and video streams, joining them together one after the
  34918. other.
  34919. </p>
  34920. <p>The filter works on segments of synchronized video and audio streams. All
  34921. segments must have the same number of streams of each type, and that will
  34922. also be the number of streams at output.
  34923. </p>
  34924. <p>The filter accepts the following options:
  34925. </p>
  34926. <dl class="table">
  34927. <dt><samp class="option">n</samp></dt>
  34928. <dd><p>Set the number of segments. Default is 2.
  34929. </p>
  34930. </dd>
  34931. <dt><samp class="option">v</samp></dt>
  34932. <dd><p>Set the number of output video streams, that is also the number of video
  34933. streams in each segment. Default is 1.
  34934. </p>
  34935. </dd>
  34936. <dt><samp class="option">a</samp></dt>
  34937. <dd><p>Set the number of output audio streams, that is also the number of audio
  34938. streams in each segment. Default is 0.
  34939. </p>
  34940. </dd>
  34941. <dt><samp class="option">unsafe</samp></dt>
  34942. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  34943. </p>
  34944. </dd>
  34945. </dl>
  34946. <p>The filter has <var class="var">v</var>+<var class="var">a</var> outputs: first <var class="var">v</var> video outputs, then
  34947. <var class="var">a</var> audio outputs.
  34948. </p>
  34949. <p>There are <var class="var">n</var>x(<var class="var">v</var>+<var class="var">a</var>) inputs: first the inputs for the first
  34950. segment, in the same order as the outputs, then the inputs for the second
  34951. segment, etc.
  34952. </p>
  34953. <p>Related streams do not always have exactly the same duration, for various
  34954. reasons including codec frame size or sloppy authoring. For that reason,
  34955. related synchronized streams (e.g. a video and its audio track) should be
  34956. concatenated at once. The concat filter will use the duration of the longest
  34957. stream in each segment (except the last one), and if necessary pad shorter
  34958. audio streams with silence.
  34959. </p>
  34960. <p>For this filter to work correctly, all segments must start at timestamp 0.
  34961. </p>
  34962. <p>All corresponding streams must have the same parameters in all segments; the
  34963. filtering system will automatically select a common pixel format for video
  34964. streams, and a common sample format, sample rate and channel layout for
  34965. audio streams, but other settings, such as resolution, must be converted
  34966. explicitly by the user.
  34967. </p>
  34968. <p>Different frame rates are acceptable but will result in variable frame rate
  34969. at output; be sure to configure the output file to handle it.
  34970. </p>
  34971. <a name="Examples-168"></a>
  34972. <h4 class="subsection">20.9.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-168" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-168" aria-hidden="true">TOC</a></span></h4>
  34973. <ul class="itemize mark-bullet">
  34974. <li>Concatenate an opening, an episode and an ending, all in bilingual version
  34975. (video in stream 0, audio in streams 1 and 2):
  34976. <div class="example">
  34977. <pre class="example-preformatted">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  34978. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  34979. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  34980. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  34981. </pre></div>
  34982. </li><li>Concatenate two parts, handling audio and video separately, using the
  34983. (a)movie sources, and adjusting the resolution:
  34984. <div class="example">
  34985. <pre class="example-preformatted">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  34986. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  34987. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  34988. </pre></div>
  34989. <p>Note that a desync will happen at the stitch if the audio and video streams
  34990. do not have exactly the same duration in the first file.
  34991. </p>
  34992. </li></ul>
  34993. <a name="Commands-161"></a>
  34994. <h4 class="subsection">20.9.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-161" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-161" aria-hidden="true">TOC</a></span></h4>
  34995. <p>This filter supports the following commands:
  34996. </p><dl class="table">
  34997. <dt><samp class="option">next</samp></dt>
  34998. <dd><p>Close the current segment and step to the next one
  34999. </p></dd>
  35000. </dl>
  35001. <a class="anchor" id="ebur128"></a><a name="ebur128-1"></a>
  35002. <h3 class="section">20.10 ebur128<span class="pull-right"><a class="anchor hidden-xs" href="#ebur128-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ebur128-1" aria-hidden="true">TOC</a></span></h3>
  35003. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  35004. level. By default, it logs a message at a frequency of 10Hz with the
  35005. Momentary loudness (identified by <code class="code">M</code>), Short-term loudness (<code class="code">S</code>),
  35006. Integrated loudness (<code class="code">I</code>) and Loudness Range (<code class="code">LRA</code>).
  35007. </p>
  35008. <p>The filter can only analyze streams which have
  35009. sample format is double-precision floating point. The input stream will be converted to
  35010. this specification, if needed. Users may need to insert aformat and/or aresample filters
  35011. after this filter to obtain the original parameters.
  35012. </p>
  35013. <p>The filter also has a video output (see the <var class="var">video</var> option) with a real
  35014. time graph to observe the loudness evolution. The graphic contains the logged
  35015. message mentioned above, so it is not printed anymore when this option is set,
  35016. unless the verbose logging is set. The main graphing area contains the
  35017. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  35018. the momentary loudness (400 milliseconds), but can optionally be configured
  35019. to instead display short-term loudness (see <var class="var">gauge</var>).
  35020. </p>
  35021. <p>The green area marks a +/- 1LU target range around the target loudness
  35022. (-23LUFS by default, unless modified through <var class="var">target</var>).
  35023. </p>
  35024. <p>More information about the Loudness Recommendation EBU R128 on
  35025. <a class="url" href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  35026. </p>
  35027. <p>The filter accepts the following options:
  35028. </p>
  35029. <dl class="table">
  35030. <dt><samp class="option">video</samp></dt>
  35031. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  35032. option is set or no. The video stream will be the first output stream if
  35033. activated. Default is <code class="code">0</code>.
  35034. </p>
  35035. </dd>
  35036. <dt><samp class="option">size</samp></dt>
  35037. <dd><p>Set the video size. This option is for video only. For the syntax of this
  35038. option, check the
  35039. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  35040. Default and minimum resolution is <code class="code">640x480</code>.
  35041. </p>
  35042. </dd>
  35043. <dt><samp class="option">meter</samp></dt>
  35044. <dd><p>Set the EBU scale meter. Default is <code class="code">9</code>. Common values are <code class="code">9</code> and
  35045. <code class="code">18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  35046. other integer value between this range is allowed.
  35047. </p>
  35048. </dd>
  35049. <dt><samp class="option">metadata</samp></dt>
  35050. <dd><p>Set metadata injection. If set to <code class="code">1</code>, the audio input will be segmented
  35051. into 100ms output frames, each of them containing various loudness information
  35052. in metadata. All the metadata keys are prefixed with <code class="code">lavfi.r128.</code>.
  35053. </p>
  35054. <p>Default is <code class="code">0</code>.
  35055. </p>
  35056. </dd>
  35057. <dt><samp class="option">framelog</samp></dt>
  35058. <dd><p>Force the frame logging level.
  35059. </p>
  35060. <p>Available values are:
  35061. </p><dl class="table">
  35062. <dt>&lsquo;<samp class="samp">quiet</samp>&rsquo;</dt>
  35063. <dd><p>logging disabled
  35064. </p></dd>
  35065. <dt>&lsquo;<samp class="samp">info</samp>&rsquo;</dt>
  35066. <dd><p>information logging level
  35067. </p></dd>
  35068. <dt>&lsquo;<samp class="samp">verbose</samp>&rsquo;</dt>
  35069. <dd><p>verbose logging level
  35070. </p></dd>
  35071. </dl>
  35072. <p>By default, the logging level is set to <var class="var">info</var>. If the <samp class="option">video</samp> or
  35073. the <samp class="option">metadata</samp> options are set, it switches to <var class="var">verbose</var>.
  35074. </p>
  35075. </dd>
  35076. <dt><samp class="option">peak</samp></dt>
  35077. <dd><p>Set peak mode(s).
  35078. </p>
  35079. <p>Available modes can be cumulated (the option is a <code class="code">flag</code> type). Possible
  35080. values are:
  35081. </p><dl class="table">
  35082. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  35083. <dd><p>Disable any peak mode (default).
  35084. </p></dd>
  35085. <dt>&lsquo;<samp class="samp">sample</samp>&rsquo;</dt>
  35086. <dd><p>Enable sample-peak mode.
  35087. </p>
  35088. <p>Simple peak mode looking for the higher sample value. It logs a message
  35089. for sample-peak (identified by <code class="code">SPK</code>).
  35090. </p></dd>
  35091. <dt>&lsquo;<samp class="samp">true</samp>&rsquo;</dt>
  35092. <dd><p>Enable true-peak mode.
  35093. </p>
  35094. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  35095. stream for better peak accuracy. It logs a message for true-peak.
  35096. (identified by <code class="code">TPK</code>) and true-peak per frame (identified by <code class="code">FTPK</code>).
  35097. This mode requires a build with <code class="code">libswresample</code>.
  35098. </p></dd>
  35099. </dl>
  35100. </dd>
  35101. <dt><samp class="option">dualmono</samp></dt>
  35102. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  35103. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  35104. If set to <code class="code">true</code>, this option will compensate for this effect.
  35105. Multi-channel input files are not affected by this option.
  35106. </p>
  35107. </dd>
  35108. <dt><samp class="option">panlaw</samp></dt>
  35109. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  35110. This parameter is optional, and has a default value of -3.01dB.
  35111. </p>
  35112. </dd>
  35113. <dt><samp class="option">target</samp></dt>
  35114. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  35115. This parameter is optional and has a default value of -23LUFS as specified
  35116. by EBU R128. However, material published online may prefer a level of -16LUFS
  35117. (e.g. for use with podcasts or video platforms).
  35118. </p>
  35119. </dd>
  35120. <dt><samp class="option">gauge</samp></dt>
  35121. <dd><p>Set the value displayed by the gauge. Valid values are <code class="code">momentary</code> and s
  35122. <code class="code">shortterm</code>. By default the momentary value will be used, but in certain
  35123. scenarios it may be more useful to observe the short term value instead (e.g.
  35124. live mixing).
  35125. </p>
  35126. </dd>
  35127. <dt><samp class="option">scale</samp></dt>
  35128. <dd><p>Sets the display scale for the loudness. Valid parameters are <code class="code">absolute</code>
  35129. (in LUFS) or <code class="code">relative</code> (LU) relative to the target. This only affects the
  35130. video output, not the summary or continuous log output.
  35131. </p>
  35132. </dd>
  35133. <dt><samp class="option">integrated</samp></dt>
  35134. <dd><p>Read-only exported value for measured integrated loudness, in LUFS.
  35135. </p>
  35136. </dd>
  35137. <dt><samp class="option">range</samp></dt>
  35138. <dd><p>Read-only exported value for measured loudness range, in LU.
  35139. </p>
  35140. </dd>
  35141. <dt><samp class="option">lra_low</samp></dt>
  35142. <dd><p>Read-only exported value for measured LRA low, in LUFS.
  35143. </p>
  35144. </dd>
  35145. <dt><samp class="option">lra_high</samp></dt>
  35146. <dd><p>Read-only exported value for measured LRA high, in LUFS.
  35147. </p>
  35148. </dd>
  35149. <dt><samp class="option">sample_peak</samp></dt>
  35150. <dd><p>Read-only exported value for measured sample peak, in dBFS.
  35151. </p>
  35152. </dd>
  35153. <dt><samp class="option">true_peak</samp></dt>
  35154. <dd><p>Read-only exported value for measured true peak, in dBFS.
  35155. </p></dd>
  35156. </dl>
  35157. <a name="Examples-169"></a>
  35158. <h4 class="subsection">20.10.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-169" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-169" aria-hidden="true">TOC</a></span></h4>
  35159. <ul class="itemize mark-bullet">
  35160. <li>Real-time graph using <code class="command">ffplay</code>, with a EBU scale meter +18:
  35161. <div class="example">
  35162. <pre class="example-preformatted">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  35163. </pre></div>
  35164. </li><li>Run an analysis with <code class="command">ffmpeg</code>:
  35165. <div class="example">
  35166. <pre class="example-preformatted">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  35167. </pre></div>
  35168. </li></ul>
  35169. <a name="interleave_002c-ainterleave"></a>
  35170. <h3 class="section">20.11 interleave, ainterleave<span class="pull-right"><a class="anchor hidden-xs" href="#interleave_002c-ainterleave" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interleave_002c-ainterleave" aria-hidden="true">TOC</a></span></h3>
  35171. <p>Temporally interleave frames from several inputs.
  35172. </p>
  35173. <p><code class="code">interleave</code> works with video inputs, <code class="code">ainterleave</code> with audio.
  35174. </p>
  35175. <p>These filters read frames from several inputs and send the oldest
  35176. queued frame to the output.
  35177. </p>
  35178. <p>Input streams must have well defined, monotonically increasing frame
  35179. timestamp values.
  35180. </p>
  35181. <p>In order to submit one frame to output, these filters need to enqueue
  35182. at least one frame for each input, so they cannot work in case one
  35183. input is not yet terminated and will not receive incoming frames.
  35184. </p>
  35185. <p>For example consider the case when one input is a <code class="code">select</code> filter
  35186. which always drops input frames. The <code class="code">interleave</code> filter will keep
  35187. reading from that input, but it will never be able to send new frames
  35188. to output until the input sends an end-of-stream signal.
  35189. </p>
  35190. <p>Also, depending on inputs synchronization, the filters will drop
  35191. frames in case one input receives more frames than the other ones, and
  35192. the queue is already filled.
  35193. </p>
  35194. <p>These filters accept the following options:
  35195. </p>
  35196. <dl class="table">
  35197. <dt><samp class="option">nb_inputs, n</samp></dt>
  35198. <dd><p>Set the number of different inputs, it is 2 by default.
  35199. </p>
  35200. </dd>
  35201. <dt><samp class="option">duration</samp></dt>
  35202. <dd><p>How to determine the end-of-stream.
  35203. </p>
  35204. <dl class="table">
  35205. <dt><samp class="option">longest</samp></dt>
  35206. <dd><p>The duration of the longest input. (default)
  35207. </p>
  35208. </dd>
  35209. <dt><samp class="option">shortest</samp></dt>
  35210. <dd><p>The duration of the shortest input.
  35211. </p>
  35212. </dd>
  35213. <dt><samp class="option">first</samp></dt>
  35214. <dd><p>The duration of the first input.
  35215. </p></dd>
  35216. </dl>
  35217. </dd>
  35218. </dl>
  35219. <a name="Examples-170"></a>
  35220. <h4 class="subsection">20.11.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-170" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-170" aria-hidden="true">TOC</a></span></h4>
  35221. <ul class="itemize mark-bullet">
  35222. <li>Interleave frames belonging to different streams using <code class="command">ffmpeg</code>:
  35223. <div class="example">
  35224. <pre class="example-preformatted">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  35225. </pre></div>
  35226. </li><li>Add flickering blur effect:
  35227. <div class="example">
  35228. <pre class="example-preformatted">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  35229. </pre></div>
  35230. </li></ul>
  35231. <a name="latency_002c-alatency"></a>
  35232. <h3 class="section">20.12 latency, alatency<span class="pull-right"><a class="anchor hidden-xs" href="#latency_002c-alatency" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-latency_002c-alatency" aria-hidden="true">TOC</a></span></h3>
  35233. <p>Measure filtering latency.
  35234. </p>
  35235. <p>Report previous filter filtering latency, delay in number of audio samples for audio filters
  35236. or number of video frames for video filters.
  35237. </p>
  35238. <p>On end of input stream, filter will report min and max measured latency for previous running filter
  35239. in filtergraph.
  35240. </p>
  35241. <a name="metadata_002c-ametadata"></a>
  35242. <h3 class="section">20.13 metadata, ametadata<span class="pull-right"><a class="anchor hidden-xs" href="#metadata_002c-ametadata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-metadata_002c-ametadata" aria-hidden="true">TOC</a></span></h3>
  35243. <p>Manipulate frame metadata.
  35244. </p>
  35245. <p>This filter accepts the following options:
  35246. </p>
  35247. <dl class="table">
  35248. <dt><samp class="option">mode</samp></dt>
  35249. <dd><p>Set mode of operation of the filter.
  35250. </p>
  35251. <p>Can be one of the following:
  35252. </p>
  35253. <dl class="table">
  35254. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  35255. <dd><p>If both <code class="code">value</code> and <code class="code">key</code> is set, select frames
  35256. which have such metadata. If only <code class="code">key</code> is set, select
  35257. every frame that has such key in metadata.
  35258. </p>
  35259. </dd>
  35260. <dt>&lsquo;<samp class="samp">add</samp>&rsquo;</dt>
  35261. <dd><p>Add new metadata <code class="code">key</code> and <code class="code">value</code>. If key is already available
  35262. do nothing.
  35263. </p>
  35264. </dd>
  35265. <dt>&lsquo;<samp class="samp">modify</samp>&rsquo;</dt>
  35266. <dd><p>Modify value of already present key.
  35267. </p>
  35268. </dd>
  35269. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  35270. <dd><p>If <code class="code">value</code> is set, delete only keys that have such value.
  35271. Otherwise, delete key. If <code class="code">key</code> is not set, delete all metadata values in
  35272. the frame.
  35273. </p>
  35274. </dd>
  35275. <dt>&lsquo;<samp class="samp">print</samp>&rsquo;</dt>
  35276. <dd><p>Print key and its value if metadata was found. If <code class="code">key</code> is not set print all
  35277. metadata values available in frame.
  35278. </p></dd>
  35279. </dl>
  35280. </dd>
  35281. <dt><samp class="option">key</samp></dt>
  35282. <dd><p>Set key used with all modes. Must be set for all modes except <code class="code">print</code> and <code class="code">delete</code>.
  35283. </p>
  35284. </dd>
  35285. <dt><samp class="option">value</samp></dt>
  35286. <dd><p>Set metadata value which will be used. This option is mandatory for
  35287. <code class="code">modify</code> and <code class="code">add</code> mode.
  35288. </p>
  35289. </dd>
  35290. <dt><samp class="option">function</samp></dt>
  35291. <dd><p>Which function to use when comparing metadata value and <code class="code">value</code>.
  35292. </p>
  35293. <p>Can be one of following:
  35294. </p>
  35295. <dl class="table">
  35296. <dt>&lsquo;<samp class="samp">same_str</samp>&rsquo;</dt>
  35297. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code class="code">value</code>.
  35298. </p>
  35299. </dd>
  35300. <dt>&lsquo;<samp class="samp">starts_with</samp>&rsquo;</dt>
  35301. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  35302. the <code class="code">value</code> option string.
  35303. </p>
  35304. </dd>
  35305. <dt>&lsquo;<samp class="samp">less</samp>&rsquo;</dt>
  35306. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code class="code">value</code>.
  35307. </p>
  35308. </dd>
  35309. <dt>&lsquo;<samp class="samp">equal</samp>&rsquo;</dt>
  35310. <dd><p>Values are interpreted as floats, returns true if <code class="code">value</code> is equal with metadata value.
  35311. </p>
  35312. </dd>
  35313. <dt>&lsquo;<samp class="samp">greater</samp>&rsquo;</dt>
  35314. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code class="code">value</code>.
  35315. </p>
  35316. </dd>
  35317. <dt>&lsquo;<samp class="samp">expr</samp>&rsquo;</dt>
  35318. <dd><p>Values are interpreted as floats, returns true if expression from option <code class="code">expr</code>
  35319. evaluates to true.
  35320. </p>
  35321. </dd>
  35322. <dt>&lsquo;<samp class="samp">ends_with</samp>&rsquo;</dt>
  35323. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  35324. the <code class="code">value</code> option string.
  35325. </p></dd>
  35326. </dl>
  35327. </dd>
  35328. <dt><samp class="option">expr</samp></dt>
  35329. <dd><p>Set expression which is used when <code class="code">function</code> is set to <code class="code">expr</code>.
  35330. The expression is evaluated through the eval API and can contain the following
  35331. constants:
  35332. </p>
  35333. <dl class="table">
  35334. <dt><samp class="option">VALUE1, FRAMEVAL</samp></dt>
  35335. <dd><p>Float representation of <code class="code">value</code> from metadata key.
  35336. </p>
  35337. </dd>
  35338. <dt><samp class="option">VALUE2, USERVAL</samp></dt>
  35339. <dd><p>Float representation of <code class="code">value</code> as supplied by user in <code class="code">value</code> option.
  35340. </p></dd>
  35341. </dl>
  35342. </dd>
  35343. <dt><samp class="option">file</samp></dt>
  35344. <dd><p>If specified in <code class="code">print</code> mode, output is written to the named file. Instead of
  35345. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  35346. for standard output. If <code class="code">file</code> option is not set, output is written to the log
  35347. with AV_LOG_INFO loglevel.
  35348. </p>
  35349. </dd>
  35350. <dt><samp class="option">direct</samp></dt>
  35351. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var class="var">file</var>.
  35352. </p>
  35353. </dd>
  35354. </dl>
  35355. <a name="Examples-171"></a>
  35356. <h4 class="subsection">20.13.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-171" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-171" aria-hidden="true">TOC</a></span></h4>
  35357. <ul class="itemize mark-bullet">
  35358. <li>Print all metadata values for frames with key <code class="code">lavfi.signalstats.YDIF</code> with values
  35359. between 0 and 1.
  35360. <div class="example">
  35361. <pre class="example-preformatted">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  35362. </pre></div>
  35363. </li><li>Print silencedetect output to file <samp class="file">metadata.txt</samp>.
  35364. <div class="example">
  35365. <pre class="example-preformatted">silencedetect,ametadata=mode=print:file=metadata.txt
  35366. </pre></div>
  35367. </li><li>Direct all metadata to a pipe with file descriptor 4.
  35368. <div class="example">
  35369. <pre class="example-preformatted">metadata=mode=print:file='pipe\:4'
  35370. </pre></div>
  35371. </li></ul>
  35372. <a name="perms_002c-aperms"></a>
  35373. <h3 class="section">20.14 perms, aperms<span class="pull-right"><a class="anchor hidden-xs" href="#perms_002c-aperms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-perms_002c-aperms" aria-hidden="true">TOC</a></span></h3>
  35374. <p>Set read/write permissions for the output frames.
  35375. </p>
  35376. <p>These filters are mainly aimed at developers to test direct path in the
  35377. following filter in the filtergraph.
  35378. </p>
  35379. <p>The filters accept the following options:
  35380. </p>
  35381. <dl class="table">
  35382. <dt><samp class="option">mode</samp></dt>
  35383. <dd><p>Select the permissions mode.
  35384. </p>
  35385. <p>It accepts the following values:
  35386. </p><dl class="table">
  35387. <dt>&lsquo;<samp class="samp">none</samp>&rsquo;</dt>
  35388. <dd><p>Do nothing. This is the default.
  35389. </p></dd>
  35390. <dt>&lsquo;<samp class="samp">ro</samp>&rsquo;</dt>
  35391. <dd><p>Set all the output frames read-only.
  35392. </p></dd>
  35393. <dt>&lsquo;<samp class="samp">rw</samp>&rsquo;</dt>
  35394. <dd><p>Set all the output frames directly writable.
  35395. </p></dd>
  35396. <dt>&lsquo;<samp class="samp">toggle</samp>&rsquo;</dt>
  35397. <dd><p>Make the frame read-only if writable, and writable if read-only.
  35398. </p></dd>
  35399. <dt>&lsquo;<samp class="samp">random</samp>&rsquo;</dt>
  35400. <dd><p>Set each output frame read-only or writable randomly.
  35401. </p></dd>
  35402. </dl>
  35403. </dd>
  35404. <dt><samp class="option">seed</samp></dt>
  35405. <dd><p>Set the seed for the <var class="var">random</var> mode, must be an integer included between
  35406. <code class="code">0</code> and <code class="code">UINT32_MAX</code>. If not specified, or if explicitly set to
  35407. <code class="code">-1</code>, the filter will try to use a good random seed on a best effort
  35408. basis.
  35409. </p></dd>
  35410. </dl>
  35411. <p>Note: in case of auto-inserted filter between the permission filter and the
  35412. following one, the permission might not be received as expected in that
  35413. following filter. Inserting a <a class="ref" href="#format">format</a> or <a class="ref" href="#aformat">aformat</a> filter before the
  35414. perms/aperms filter can avoid this problem.
  35415. </p>
  35416. <a name="realtime_002c-arealtime"></a>
  35417. <h3 class="section">20.15 realtime, arealtime<span class="pull-right"><a class="anchor hidden-xs" href="#realtime_002c-arealtime" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-realtime_002c-arealtime" aria-hidden="true">TOC</a></span></h3>
  35418. <p>Slow down filtering to match real time approximately.
  35419. </p>
  35420. <p>These filters will pause the filtering for a variable amount of time to
  35421. match the output rate with the input timestamps.
  35422. They are similar to the <samp class="option">re</samp> option to <code class="code">ffmpeg</code>.
  35423. </p>
  35424. <p>They accept the following options:
  35425. </p>
  35426. <dl class="table">
  35427. <dt><samp class="option">limit</samp></dt>
  35428. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  35429. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  35430. </p></dd>
  35431. <dt><samp class="option">speed</samp></dt>
  35432. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  35433. Values larger than 1.0 will result in faster than realtime processing,
  35434. smaller will slow processing down. The <var class="var">limit</var> is automatically adapted
  35435. accordingly. Default is 1.0.
  35436. </p>
  35437. <p>A processing speed faster than what is possible without these filters cannot
  35438. be achieved.
  35439. </p></dd>
  35440. </dl>
  35441. <a name="Commands-162"></a>
  35442. <h4 class="subsection">20.15.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-162" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-162" aria-hidden="true">TOC</a></span></h4>
  35443. <p>Both filters supports the all above options as <a class="ref" href="#commands">commands</a>.
  35444. </p>
  35445. <a name="segment_002c-asegment"></a>
  35446. <h3 class="section">20.16 segment, asegment<span class="pull-right"><a class="anchor hidden-xs" href="#segment_002c-asegment" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-segment_002c-asegment" aria-hidden="true">TOC</a></span></h3>
  35447. <p>Split single input stream into multiple streams.
  35448. </p>
  35449. <p>This filter does opposite of concat filters.
  35450. </p>
  35451. <p><code class="code">segment</code> works on video frames, <code class="code">asegment</code> on audio samples.
  35452. </p>
  35453. <p>This filter accepts the following options:
  35454. </p>
  35455. <dl class="table">
  35456. <dt><samp class="option">timestamps</samp></dt>
  35457. <dd><p>Timestamps of output segments separated by &rsquo;|&rsquo;. The first segment will run
  35458. from the beginning of the input stream. The last segment will run until
  35459. the end of the input stream
  35460. </p>
  35461. </dd>
  35462. <dt><samp class="option">frames, samples</samp></dt>
  35463. <dd><p>Exact frame/sample count to split the segments.
  35464. </p></dd>
  35465. </dl>
  35466. <p>In all cases, prefixing an each segment with &rsquo;+&rsquo; will make it relative to the
  35467. previous segment.
  35468. </p>
  35469. <a name="Examples-172"></a>
  35470. <h4 class="subsection">20.16.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-172" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-172" aria-hidden="true">TOC</a></span></h4>
  35471. <ul class="itemize mark-bullet">
  35472. <li>Split input audio stream into three output audio streams, starting at start of input audio stream
  35473. and storing that in 1st output audio stream, then following at 60th second and storing than in 2nd
  35474. output audio stream, and last after 150th second of input audio stream store in 3rd output audio stream:
  35475. <div class="example">
  35476. <pre class="example-preformatted">asegment=timestamps=&quot;60|150&quot;
  35477. </pre></div>
  35478. </li></ul>
  35479. <a class="anchor" id="select"></a><a name="select_002c-aselect"></a>
  35480. <h3 class="section">20.17 select, aselect<span class="pull-right"><a class="anchor hidden-xs" href="#select_002c-aselect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-select_002c-aselect" aria-hidden="true">TOC</a></span></h3>
  35481. <p>Select frames to pass in output.
  35482. </p>
  35483. <p>This filter accepts the following options:
  35484. </p>
  35485. <dl class="table">
  35486. <dt><samp class="option">expr, e</samp></dt>
  35487. <dd><p>Set expression, which is evaluated for each input frame.
  35488. </p>
  35489. <p>If the expression is evaluated to zero, the frame is discarded.
  35490. </p>
  35491. <p>If the evaluation result is negative or NaN, the frame is sent to the
  35492. first output; otherwise it is sent to the output with index
  35493. <code class="code">ceil(val)-1</code>, assuming that the input index starts from 0.
  35494. </p>
  35495. <p>For example a value of <code class="code">1.2</code> corresponds to the output with index
  35496. <code class="code">ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  35497. </p>
  35498. </dd>
  35499. <dt><samp class="option">outputs, n</samp></dt>
  35500. <dd><p>Set the number of outputs. The output to which to send the selected
  35501. frame is based on the result of the evaluation. Default value is 1.
  35502. </p></dd>
  35503. </dl>
  35504. <p>The expression can contain the following constants:
  35505. </p>
  35506. <dl class="table">
  35507. <dt><samp class="option">n</samp></dt>
  35508. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  35509. </p>
  35510. </dd>
  35511. <dt><samp class="option">selected_n</samp></dt>
  35512. <dd><p>The (sequential) number of the selected frame, starting from 0.
  35513. </p>
  35514. </dd>
  35515. <dt><samp class="option">prev_selected_n</samp></dt>
  35516. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  35517. </p>
  35518. </dd>
  35519. <dt><samp class="option">TB</samp></dt>
  35520. <dd><p>The timebase of the input timestamps.
  35521. </p>
  35522. </dd>
  35523. <dt><samp class="option">pts</samp></dt>
  35524. <dd><p>The PTS (Presentation TimeStamp) of the filtered frame,
  35525. expressed in <var class="var">TB</var> units. It&rsquo;s NAN if undefined.
  35526. </p>
  35527. </dd>
  35528. <dt><samp class="option">t</samp></dt>
  35529. <dd><p>The PTS of the filtered frame,
  35530. expressed in seconds. It&rsquo;s NAN if undefined.
  35531. </p>
  35532. </dd>
  35533. <dt><samp class="option">prev_pts</samp></dt>
  35534. <dd><p>The PTS of the previously filtered frame. It&rsquo;s NAN if undefined.
  35535. </p>
  35536. </dd>
  35537. <dt><samp class="option">prev_selected_pts</samp></dt>
  35538. <dd><p>The PTS of the last previously filtered frame. It&rsquo;s NAN if undefined.
  35539. </p>
  35540. </dd>
  35541. <dt><samp class="option">prev_selected_t</samp></dt>
  35542. <dd><p>The PTS of the last previously selected frame, expressed in seconds. It&rsquo;s NAN if undefined.
  35543. </p>
  35544. </dd>
  35545. <dt><samp class="option">start_pts</samp></dt>
  35546. <dd><p>The first PTS in the stream which is not NAN. It remains NAN if not found.
  35547. </p>
  35548. </dd>
  35549. <dt><samp class="option">start_t</samp></dt>
  35550. <dd><p>The first PTS, in seconds, in the stream which is not NAN. It remains NAN if not found.
  35551. </p>
  35552. </dd>
  35553. <dt><samp class="option">pict_type <em class="emph">(video only)</em></samp></dt>
  35554. <dd><p>The type of the filtered frame. It can assume one of the following
  35555. values:
  35556. </p><dl class="table">
  35557. <dt><samp class="option">I</samp></dt>
  35558. <dt><samp class="option">P</samp></dt>
  35559. <dt><samp class="option">B</samp></dt>
  35560. <dt><samp class="option">S</samp></dt>
  35561. <dt><samp class="option">SI</samp></dt>
  35562. <dt><samp class="option">SP</samp></dt>
  35563. <dt><samp class="option">BI</samp></dt>
  35564. </dl>
  35565. </dd>
  35566. <dt><samp class="option">interlace_type <em class="emph">(video only)</em></samp></dt>
  35567. <dd><p>The frame interlace type. It can assume one of the following values:
  35568. </p><dl class="table">
  35569. <dt><samp class="option">PROGRESSIVE</samp></dt>
  35570. <dd><p>The frame is progressive (not interlaced).
  35571. </p></dd>
  35572. <dt><samp class="option">TOPFIRST</samp></dt>
  35573. <dd><p>The frame is top-field-first.
  35574. </p></dd>
  35575. <dt><samp class="option">BOTTOMFIRST</samp></dt>
  35576. <dd><p>The frame is bottom-field-first.
  35577. </p></dd>
  35578. </dl>
  35579. </dd>
  35580. <dt><samp class="option">consumed_sample_n <em class="emph">(audio only)</em></samp></dt>
  35581. <dd><p>the number of selected samples before the current frame
  35582. </p>
  35583. </dd>
  35584. <dt><samp class="option">samples_n <em class="emph">(audio only)</em></samp></dt>
  35585. <dd><p>the number of samples in the current frame
  35586. </p>
  35587. </dd>
  35588. <dt><samp class="option">sample_rate <em class="emph">(audio only)</em></samp></dt>
  35589. <dd><p>the input sample rate
  35590. </p>
  35591. </dd>
  35592. <dt><samp class="option">key</samp></dt>
  35593. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  35594. </p>
  35595. </dd>
  35596. <dt><samp class="option">pos</samp></dt>
  35597. <dd><p>the position in the file of the filtered frame, -1 if the information
  35598. is not available (e.g. for synthetic video); deprecated, do not use
  35599. </p>
  35600. </dd>
  35601. <dt><samp class="option">scene <em class="emph">(video only)</em></samp></dt>
  35602. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  35603. probability for the current frame to introduce a new scene, while a higher
  35604. value means the current frame is more likely to be one (see the example below)
  35605. </p>
  35606. </dd>
  35607. <dt><samp class="option">concatdec_select</samp></dt>
  35608. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  35609. inpoint and an outpoint, but the output packets may not be entirely contained
  35610. in the selected interval. By using this variable, it is possible to skip frames
  35611. generated by the concat demuxer which are not exactly contained in the selected
  35612. interval.
  35613. </p>
  35614. <p>This works by comparing the frame pts against the <var class="var">lavf.concat.start_time</var>
  35615. and the <var class="var">lavf.concat.duration</var> packet metadata values which are also
  35616. present in the decoded frames.
  35617. </p>
  35618. <p>The <var class="var">concatdec_select</var> variable is -1 if the frame pts is at least
  35619. start_time and either the duration metadata is missing or the frame pts is less
  35620. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  35621. missing.
  35622. </p>
  35623. <p>That basically means that an input frame is selected if its pts is within the
  35624. interval set by the concat demuxer.
  35625. </p>
  35626. </dd>
  35627. <dt><samp class="option">iw <em class="emph">(video only)</em></samp></dt>
  35628. <dd><p>Represents the width of the input video frame.
  35629. </p>
  35630. </dd>
  35631. <dt><samp class="option">ih <em class="emph">(video only)</em></samp></dt>
  35632. <dd><p>Represents the height of the input video frame.
  35633. </p>
  35634. </dd>
  35635. <dt><samp class="option">view <em class="emph">(video only)</em></samp></dt>
  35636. <dd><p>View ID for multi-view video.
  35637. </p>
  35638. </dd>
  35639. </dl>
  35640. <p>The default value of the select expression is &quot;1&quot;.
  35641. </p>
  35642. <a name="Examples-173"></a>
  35643. <h4 class="subsection">20.17.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-173" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-173" aria-hidden="true">TOC</a></span></h4>
  35644. <ul class="itemize mark-bullet">
  35645. <li>Select all frames in input:
  35646. <div class="example">
  35647. <pre class="example-preformatted">select
  35648. </pre></div>
  35649. <p>The example above is the same as:
  35650. </p><div class="example">
  35651. <pre class="example-preformatted">select=1
  35652. </pre></div>
  35653. </li><li>Skip all frames:
  35654. <div class="example">
  35655. <pre class="example-preformatted">select=0
  35656. </pre></div>
  35657. </li><li>Select only I-frames:
  35658. <div class="example">
  35659. <pre class="example-preformatted">select='eq(pict_type\,I)'
  35660. </pre></div>
  35661. </li><li>Select one frame every 100:
  35662. <div class="example">
  35663. <pre class="example-preformatted">select='not(mod(n\,100))'
  35664. </pre></div>
  35665. </li><li>Select only frames contained in the 10-20 time interval:
  35666. <div class="example">
  35667. <pre class="example-preformatted">select=between(t\,10\,20)
  35668. </pre></div>
  35669. </li><li>Select only I-frames contained in the 10-20 time interval:
  35670. <div class="example">
  35671. <pre class="example-preformatted">select=between(t\,10\,20)*eq(pict_type\,I)
  35672. </pre></div>
  35673. </li><li>Select frames with a minimum distance of 10 seconds:
  35674. <div class="example">
  35675. <pre class="example-preformatted">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  35676. </pre></div>
  35677. </li><li>Use aselect to select only audio frames with samples number &gt; 100:
  35678. <div class="example">
  35679. <pre class="example-preformatted">aselect='gt(samples_n\,100)'
  35680. </pre></div>
  35681. </li><li>Create a mosaic of the first scenes:
  35682. <div class="example">
  35683. <pre class="example-preformatted">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  35684. </pre></div>
  35685. <p>Comparing <var class="var">scene</var> against a value between 0.3 and 0.5 is generally a sane
  35686. choice.
  35687. </p>
  35688. </li><li>Send even and odd frames to separate outputs, and compose them:
  35689. <div class="example">
  35690. <pre class="example-preformatted">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  35691. </pre></div>
  35692. </li><li>Select useful frames from an ffconcat file which is using inpoints and
  35693. outpoints but where the source files are not intra frame only.
  35694. <div class="example">
  35695. <pre class="example-preformatted">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  35696. </pre></div>
  35697. </li></ul>
  35698. <a name="sendcmd_002c-asendcmd"></a>
  35699. <h3 class="section">20.18 sendcmd, asendcmd<span class="pull-right"><a class="anchor hidden-xs" href="#sendcmd_002c-asendcmd" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sendcmd_002c-asendcmd" aria-hidden="true">TOC</a></span></h3>
  35700. <p>Send commands to filters in the filtergraph.
  35701. </p>
  35702. <p>These filters read commands to be sent to other filters in the
  35703. filtergraph.
  35704. </p>
  35705. <p><code class="code">sendcmd</code> must be inserted between two video filters,
  35706. <code class="code">asendcmd</code> must be inserted between two audio filters, but apart
  35707. from that they act the same way.
  35708. </p>
  35709. <p>The specification of commands can be provided in the filter arguments
  35710. with the <var class="var">commands</var> option, or in a file specified by the
  35711. <var class="var">filename</var> option.
  35712. </p>
  35713. <p>These filters accept the following options:
  35714. </p><dl class="table">
  35715. <dt><samp class="option">commands, c</samp></dt>
  35716. <dd><p>Set the commands to be read and sent to the other filters.
  35717. </p></dd>
  35718. <dt><samp class="option">filename, f</samp></dt>
  35719. <dd><p>Set the filename of the commands to be read and sent to the other
  35720. filters.
  35721. </p></dd>
  35722. </dl>
  35723. <a name="Commands-syntax"></a>
  35724. <h4 class="subsection">20.18.1 Commands syntax<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-syntax" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-syntax" aria-hidden="true">TOC</a></span></h4>
  35725. <p>A commands description consists of a sequence of interval
  35726. specifications, comprising a list of commands to be executed when a
  35727. particular event related to that interval occurs. The occurring event
  35728. is typically the current frame time entering or leaving a given time
  35729. interval.
  35730. </p>
  35731. <p>An interval is specified by the following syntax:
  35732. </p><div class="example">
  35733. <pre class="example-preformatted"><var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>;
  35734. </pre></div>
  35735. <p>The time interval is specified by the <var class="var">START</var> and <var class="var">END</var> times.
  35736. <var class="var">END</var> is optional and defaults to the maximum time.
  35737. </p>
  35738. <p>The current frame time is considered within the specified interval if
  35739. it is included in the interval [<var class="var">START</var>, <var class="var">END</var>), that is when
  35740. the time is greater or equal to <var class="var">START</var> and is lesser than
  35741. <var class="var">END</var>.
  35742. </p>
  35743. <p><var class="var">COMMANDS</var> consists of a sequence of one or more command
  35744. specifications, separated by &quot;,&quot;, relating to that interval. The
  35745. syntax of a command specification is given by:
  35746. </p><div class="example">
  35747. <pre class="example-preformatted">[<var class="var">FLAGS</var>] <var class="var">TARGET</var> <var class="var">COMMAND</var> <var class="var">ARG</var>
  35748. </pre></div>
  35749. <p><var class="var">FLAGS</var> is optional and specifies the type of events relating to
  35750. the time interval which enable sending the specified command, and must
  35751. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  35752. enclosed between &quot;[&quot; and &quot;]&quot;.
  35753. </p>
  35754. <p>The following flags are recognized:
  35755. </p><dl class="table">
  35756. <dt><samp class="option">enter</samp></dt>
  35757. <dd><p>The command is sent when the current frame timestamp enters the
  35758. specified interval. In other words, the command is sent when the
  35759. previous frame timestamp was not in the given interval, and the
  35760. current is.
  35761. </p>
  35762. </dd>
  35763. <dt><samp class="option">leave</samp></dt>
  35764. <dd><p>The command is sent when the current frame timestamp leaves the
  35765. specified interval. In other words, the command is sent when the
  35766. previous frame timestamp was in the given interval, and the
  35767. current is not.
  35768. </p>
  35769. </dd>
  35770. <dt><samp class="option">expr</samp></dt>
  35771. <dd><p>The command <var class="var">ARG</var> is interpreted as expression and result of
  35772. expression is passed as <var class="var">ARG</var>.
  35773. </p>
  35774. <p>The expression is evaluated through the eval API and can contain the following
  35775. constants:
  35776. </p>
  35777. <dl class="table">
  35778. <dt><samp class="option">POS</samp></dt>
  35779. <dd><p>Original position in the file of the frame, or undefined if undefined
  35780. for the current frame. Deprecated, do not use.
  35781. </p>
  35782. </dd>
  35783. <dt><samp class="option">PTS</samp></dt>
  35784. <dd><p>The presentation timestamp in input.
  35785. </p>
  35786. </dd>
  35787. <dt><samp class="option">N</samp></dt>
  35788. <dd><p>The count of the input frame for video or audio, starting from 0.
  35789. </p>
  35790. </dd>
  35791. <dt><samp class="option">T</samp></dt>
  35792. <dd><p>The time in seconds of the current frame.
  35793. </p>
  35794. </dd>
  35795. <dt><samp class="option">TS</samp></dt>
  35796. <dd><p>The start time in seconds of the current command interval.
  35797. </p>
  35798. </dd>
  35799. <dt><samp class="option">TE</samp></dt>
  35800. <dd><p>The end time in seconds of the current command interval.
  35801. </p>
  35802. </dd>
  35803. <dt><samp class="option">TI</samp></dt>
  35804. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  35805. </p>
  35806. </dd>
  35807. <dt><samp class="option">W</samp></dt>
  35808. <dd><p>The video frame width.
  35809. </p>
  35810. </dd>
  35811. <dt><samp class="option">H</samp></dt>
  35812. <dd><p>The video frame height.
  35813. </p></dd>
  35814. </dl>
  35815. </dd>
  35816. </dl>
  35817. <p>If <var class="var">FLAGS</var> is not specified, a default value of <code class="code">[enter]</code> is
  35818. assumed.
  35819. </p>
  35820. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  35821. the filter class or a specific filter instance name.
  35822. </p>
  35823. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  35824. </p>
  35825. <p><var class="var">ARG</var> is optional and specifies the optional list of argument for
  35826. the given <var class="var">COMMAND</var>.
  35827. </p>
  35828. <p>Between one interval specification and another, whitespaces, or
  35829. sequences of characters starting with <code class="code">#</code> until the end of line,
  35830. are ignored and can be used to annotate comments.
  35831. </p>
  35832. <p>A simplified BNF description of the commands specification syntax
  35833. follows:
  35834. </p><div class="example">
  35835. <pre class="example-preformatted"><var class="var">COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  35836. <var class="var">COMMAND_FLAGS</var> ::= <var class="var">COMMAND_FLAG</var> [(+|&quot;|&quot;)<var class="var">COMMAND_FLAG</var>]
  35837. <var class="var">COMMAND</var> ::= [&quot;[&quot; <var class="var">COMMAND_FLAGS</var> &quot;]&quot;] <var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  35838. <var class="var">COMMANDS</var> ::= <var class="var">COMMAND</var> [,<var class="var">COMMANDS</var>]
  35839. <var class="var">INTERVAL</var> ::= <var class="var">START</var>[-<var class="var">END</var>] <var class="var">COMMANDS</var>
  35840. <var class="var">INTERVALS</var> ::= <var class="var">INTERVAL</var>[;<var class="var">INTERVALS</var>]
  35841. </pre></div>
  35842. <a name="Examples-174"></a>
  35843. <h4 class="subsection">20.18.2 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-174" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-174" aria-hidden="true">TOC</a></span></h4>
  35844. <ul class="itemize mark-bullet">
  35845. <li>Specify audio tempo change at second 4:
  35846. <div class="example">
  35847. <pre class="example-preformatted">asendcmd=c='4.0 atempo tempo 1.5',atempo
  35848. </pre></div>
  35849. </li><li>Target a specific filter instance:
  35850. <div class="example">
  35851. <pre class="example-preformatted">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  35852. </pre></div>
  35853. </li><li>Specify a list of drawtext and hue commands in a file.
  35854. <div class="example">
  35855. <pre class="example-preformatted"># show text in the interval 5-10
  35856. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  35857. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  35858. # desaturate the image in the interval 15-20
  35859. 15.0-20.0 [enter] hue s 0,
  35860. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  35861. [leave] hue s 1,
  35862. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  35863. # apply an exponential saturation fade-out effect, starting from time 25
  35864. 25 [enter] hue s exp(25-t)
  35865. </pre></div>
  35866. <p>A filtergraph allowing to read and process the above command list
  35867. stored in a file <samp class="file">test.cmd</samp>, can be specified with:
  35868. </p><div class="example">
  35869. <pre class="example-preformatted">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  35870. </pre></div>
  35871. </li></ul>
  35872. <a class="anchor" id="setpts"></a><a name="setpts_002c-asetpts"></a>
  35873. <h3 class="section">20.19 setpts, asetpts<span class="pull-right"><a class="anchor hidden-xs" href="#setpts_002c-asetpts" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setpts_002c-asetpts" aria-hidden="true">TOC</a></span></h3>
  35874. <p>Change the PTS (presentation timestamp) of the input frames.
  35875. </p>
  35876. <p><code class="code">setpts</code> works on video frames, <code class="code">asetpts</code> on audio frames.
  35877. </p>
  35878. <p>This filter accepts the following options:
  35879. </p>
  35880. <dl class="table">
  35881. <dt><samp class="option">expr</samp></dt>
  35882. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  35883. </p>
  35884. </dd>
  35885. <dt><samp class="option">strip_fps (<em class="emph">video only</em>)</samp></dt>
  35886. <dd><p>Boolean option which determines if the original framerate and frame duration
  35887. metadata is unset. If set to true, be advised that a sane frame rate should be
  35888. explicitly specified if output is sent to a constant frame rate muxer.
  35889. Default is <code class="code">false</code>.
  35890. </p>
  35891. </dd>
  35892. </dl>
  35893. <p>The expression is evaluated through the eval API and can contain the following
  35894. constants:
  35895. </p>
  35896. <dl class="table">
  35897. <dt><samp class="option">FRAME_RATE, FR</samp></dt>
  35898. <dd><p>frame rate, only defined for constant frame-rate video
  35899. </p>
  35900. </dd>
  35901. <dt><samp class="option">PTS</samp></dt>
  35902. <dd><p>The presentation timestamp in input
  35903. </p>
  35904. </dd>
  35905. <dt><samp class="option">N</samp></dt>
  35906. <dd><p>The count of the input frame for video or the number of consumed samples,
  35907. not including the current frame for audio, starting from 0.
  35908. </p>
  35909. </dd>
  35910. <dt><samp class="option">NB_CONSUMED_SAMPLES</samp></dt>
  35911. <dd><p>The number of consumed samples, not including the current frame (only
  35912. audio)
  35913. </p>
  35914. </dd>
  35915. <dt><samp class="option">NB_SAMPLES, S</samp></dt>
  35916. <dd><p>The number of samples in the current frame (only audio)
  35917. </p>
  35918. </dd>
  35919. <dt><samp class="option">SAMPLE_RATE, SR</samp></dt>
  35920. <dd><p>The audio sample rate.
  35921. </p>
  35922. </dd>
  35923. <dt><samp class="option">STARTPTS</samp></dt>
  35924. <dd><p>The PTS of the first frame.
  35925. </p>
  35926. </dd>
  35927. <dt><samp class="option">STARTT</samp></dt>
  35928. <dd><p>the time in seconds of the first frame
  35929. </p>
  35930. </dd>
  35931. <dt><samp class="option">INTERLACED</samp></dt>
  35932. <dd><p>State whether the current frame is interlaced.
  35933. </p>
  35934. </dd>
  35935. <dt><samp class="option">T</samp></dt>
  35936. <dd><p>the time in seconds of the current frame
  35937. </p>
  35938. </dd>
  35939. <dt><samp class="option">POS</samp></dt>
  35940. <dd><p>original position in the file of the frame, or undefined if undefined
  35941. for the current frame; deprecated, do not use
  35942. </p>
  35943. </dd>
  35944. <dt><samp class="option">PREV_INPTS</samp></dt>
  35945. <dd><p>The previous input PTS.
  35946. </p>
  35947. </dd>
  35948. <dt><samp class="option">PREV_INT</samp></dt>
  35949. <dd><p>previous input time in seconds
  35950. </p>
  35951. </dd>
  35952. <dt><samp class="option">PREV_OUTPTS</samp></dt>
  35953. <dd><p>The previous output PTS.
  35954. </p>
  35955. </dd>
  35956. <dt><samp class="option">PREV_OUTT</samp></dt>
  35957. <dd><p>previous output time in seconds
  35958. </p>
  35959. </dd>
  35960. <dt><samp class="option">RTCTIME</samp></dt>
  35961. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  35962. instead.
  35963. </p>
  35964. </dd>
  35965. <dt><samp class="option">RTCSTART</samp></dt>
  35966. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  35967. </p>
  35968. </dd>
  35969. <dt><samp class="option">TB</samp></dt>
  35970. <dd><p>The timebase of the input timestamps.
  35971. </p>
  35972. </dd>
  35973. <dt><samp class="option">T_CHANGE</samp></dt>
  35974. <dd><p>Time of the first frame after command was applied or time of the first frame if no commands.
  35975. </p>
  35976. </dd>
  35977. </dl>
  35978. <a name="Examples-175"></a>
  35979. <h4 class="subsection">20.19.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-175" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-175" aria-hidden="true">TOC</a></span></h4>
  35980. <ul class="itemize mark-bullet">
  35981. <li>Start counting PTS from zero
  35982. <div class="example">
  35983. <pre class="example-preformatted">setpts=PTS-STARTPTS
  35984. </pre></div>
  35985. </li><li>Apply fast motion effect:
  35986. <div class="example">
  35987. <pre class="example-preformatted">setpts=0.5*PTS
  35988. </pre></div>
  35989. </li><li>Apply slow motion effect:
  35990. <div class="example">
  35991. <pre class="example-preformatted">setpts=2.0*PTS
  35992. </pre></div>
  35993. </li><li>Set fixed rate of 25 frames per second:
  35994. <div class="example">
  35995. <pre class="example-preformatted">setpts=N/(25*TB)
  35996. </pre></div>
  35997. </li><li>Apply a random jitter effect of +/-100 TB units:
  35998. <div class="example">
  35999. <pre class="example-preformatted">setpts=PTS+randomi(0, -100\,100)
  36000. </pre></div>
  36001. </li><li>Set fixed rate 25 fps with some jitter:
  36002. <div class="example">
  36003. <pre class="example-preformatted">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  36004. </pre></div>
  36005. </li><li>Apply an offset of 10 seconds to the input PTS:
  36006. <div class="example">
  36007. <pre class="example-preformatted">setpts=PTS+10/TB
  36008. </pre></div>
  36009. </li><li>Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  36010. <div class="example">
  36011. <pre class="example-preformatted">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  36012. </pre></div>
  36013. </li><li>Generate timestamps by counting samples:
  36014. <div class="example">
  36015. <pre class="example-preformatted">asetpts=N/SR/TB
  36016. </pre></div>
  36017. </li></ul>
  36018. <a name="Commands-163"></a>
  36019. <h4 class="subsection">20.19.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-163" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-163" aria-hidden="true">TOC</a></span></h4>
  36020. <p>Both filters support all above options as <a class="ref" href="#commands">commands</a>.
  36021. </p>
  36022. <a name="setrange"></a>
  36023. <h3 class="section">20.20 setrange<span class="pull-right"><a class="anchor hidden-xs" href="#setrange" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-setrange" aria-hidden="true">TOC</a></span></h3>
  36024. <p>Force color range for the output video frame.
  36025. </p>
  36026. <p>The <code class="code">setrange</code> filter marks the color range property for the
  36027. output frames. It does not change the input frame, but only sets the
  36028. corresponding property, which affects how the frame is treated by
  36029. following filters.
  36030. </p>
  36031. <p>The filter accepts the following options:
  36032. </p>
  36033. <dl class="table">
  36034. <dt><samp class="option">range</samp></dt>
  36035. <dd><p>Available values are:
  36036. </p>
  36037. <dl class="table">
  36038. <dt>&lsquo;<samp class="samp">auto</samp>&rsquo;</dt>
  36039. <dd><p>Keep the same color range property.
  36040. </p>
  36041. </dd>
  36042. <dt>&lsquo;<samp class="samp">unspecified, unknown</samp>&rsquo;</dt>
  36043. <dd><p>Set the color range as unspecified.
  36044. </p>
  36045. </dd>
  36046. <dt>&lsquo;<samp class="samp">limited, tv, mpeg</samp>&rsquo;</dt>
  36047. <dd><p>Set the color range as limited.
  36048. </p>
  36049. </dd>
  36050. <dt>&lsquo;<samp class="samp">full, pc, jpeg</samp>&rsquo;</dt>
  36051. <dd><p>Set the color range as full.
  36052. </p></dd>
  36053. </dl>
  36054. </dd>
  36055. </dl>
  36056. <a name="settb_002c-asettb"></a>
  36057. <h3 class="section">20.21 settb, asettb<span class="pull-right"><a class="anchor hidden-xs" href="#settb_002c-asettb" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-settb_002c-asettb" aria-hidden="true">TOC</a></span></h3>
  36058. <p>Set the timebase to use for the output frames timestamps.
  36059. It is mainly useful for testing timebase configuration.
  36060. </p>
  36061. <p>It accepts the following parameters:
  36062. </p>
  36063. <dl class="table">
  36064. <dt><samp class="option">expr, tb</samp></dt>
  36065. <dd><p>The expression which is evaluated into the output timebase.
  36066. </p>
  36067. </dd>
  36068. </dl>
  36069. <p>The value for <samp class="option">tb</samp> is an arithmetic expression representing a
  36070. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  36071. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  36072. audio only). Default value is &quot;intb&quot;.
  36073. </p>
  36074. <a name="Examples-176"></a>
  36075. <h4 class="subsection">20.21.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-176" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-176" aria-hidden="true">TOC</a></span></h4>
  36076. <ul class="itemize mark-bullet">
  36077. <li>Set the timebase to 1/25:
  36078. <div class="example">
  36079. <pre class="example-preformatted">settb=expr=1/25
  36080. </pre></div>
  36081. </li><li>Set the timebase to 1/10:
  36082. <div class="example">
  36083. <pre class="example-preformatted">settb=expr=0.1
  36084. </pre></div>
  36085. </li><li>Set the timebase to 1001/1000:
  36086. <div class="example">
  36087. <pre class="example-preformatted">settb=1+0.001
  36088. </pre></div>
  36089. </li><li>Set the timebase to 2*intb:
  36090. <div class="example">
  36091. <pre class="example-preformatted">settb=2*intb
  36092. </pre></div>
  36093. </li><li>Set the default timebase value:
  36094. <div class="example">
  36095. <pre class="example-preformatted">settb=AVTB
  36096. </pre></div>
  36097. </li></ul>
  36098. <a name="showcqt"></a>
  36099. <h3 class="section">20.22 showcqt<span class="pull-right"><a class="anchor hidden-xs" href="#showcqt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcqt" aria-hidden="true">TOC</a></span></h3>
  36100. <p>Convert input audio to a video output representing frequency spectrum
  36101. logarithmically using Brown-Puckette constant Q transform algorithm with
  36102. direct frequency domain coefficient calculation (but the transform itself
  36103. is not really constant Q, instead the Q factor is actually variable/clamped),
  36104. with musical tone scale, from E0 to D#10.
  36105. </p>
  36106. <p>The filter accepts the following options:
  36107. </p>
  36108. <dl class="table">
  36109. <dt><samp class="option">size, s</samp></dt>
  36110. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  36111. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36112. Default value is <code class="code">1920x1080</code>.
  36113. </p>
  36114. </dd>
  36115. <dt><samp class="option">fps, rate, r</samp></dt>
  36116. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  36117. </p>
  36118. </dd>
  36119. <dt><samp class="option">bar_h</samp></dt>
  36120. <dd><p>Set the bargraph height. It must be even. Default value is <code class="code">-1</code> which
  36121. computes the bargraph height automatically.
  36122. </p>
  36123. </dd>
  36124. <dt><samp class="option">axis_h</samp></dt>
  36125. <dd><p>Set the axis height. It must be even. Default value is <code class="code">-1</code> which computes
  36126. the axis height automatically.
  36127. </p>
  36128. </dd>
  36129. <dt><samp class="option">sono_h</samp></dt>
  36130. <dd><p>Set the sonogram height. It must be even. Default value is <code class="code">-1</code> which
  36131. computes the sonogram height automatically.
  36132. </p>
  36133. </dd>
  36134. <dt><samp class="option">fullhd</samp></dt>
  36135. <dd><p>Set the fullhd resolution. This option is deprecated, use <var class="var">size</var>, <var class="var">s</var>
  36136. instead. Default value is <code class="code">1</code>.
  36137. </p>
  36138. </dd>
  36139. <dt><samp class="option">sono_v, volume</samp></dt>
  36140. <dd><p>Specify the sonogram volume expression. It can contain variables:
  36141. </p><dl class="table">
  36142. <dt><samp class="option">bar_v</samp></dt>
  36143. <dd><p>the <var class="var">bar_v</var> evaluated expression
  36144. </p></dd>
  36145. <dt><samp class="option">frequency, freq, f</samp></dt>
  36146. <dd><p>the frequency where it is evaluated
  36147. </p></dd>
  36148. <dt><samp class="option">timeclamp, tc</samp></dt>
  36149. <dd><p>the value of <var class="var">timeclamp</var> option
  36150. </p></dd>
  36151. </dl>
  36152. <p>and functions:
  36153. </p><dl class="table">
  36154. <dt><samp class="option">a_weighting(f)</samp></dt>
  36155. <dd><p>A-weighting of equal loudness
  36156. </p></dd>
  36157. <dt><samp class="option">b_weighting(f)</samp></dt>
  36158. <dd><p>B-weighting of equal loudness
  36159. </p></dd>
  36160. <dt><samp class="option">c_weighting(f)</samp></dt>
  36161. <dd><p>C-weighting of equal loudness.
  36162. </p></dd>
  36163. </dl>
  36164. <p>Default value is <code class="code">16</code>.
  36165. </p>
  36166. </dd>
  36167. <dt><samp class="option">bar_v, volume2</samp></dt>
  36168. <dd><p>Specify the bargraph volume expression. It can contain variables:
  36169. </p><dl class="table">
  36170. <dt><samp class="option">sono_v</samp></dt>
  36171. <dd><p>the <var class="var">sono_v</var> evaluated expression
  36172. </p></dd>
  36173. <dt><samp class="option">frequency, freq, f</samp></dt>
  36174. <dd><p>the frequency where it is evaluated
  36175. </p></dd>
  36176. <dt><samp class="option">timeclamp, tc</samp></dt>
  36177. <dd><p>the value of <var class="var">timeclamp</var> option
  36178. </p></dd>
  36179. </dl>
  36180. <p>and functions:
  36181. </p><dl class="table">
  36182. <dt><samp class="option">a_weighting(f)</samp></dt>
  36183. <dd><p>A-weighting of equal loudness
  36184. </p></dd>
  36185. <dt><samp class="option">b_weighting(f)</samp></dt>
  36186. <dd><p>B-weighting of equal loudness
  36187. </p></dd>
  36188. <dt><samp class="option">c_weighting(f)</samp></dt>
  36189. <dd><p>C-weighting of equal loudness.
  36190. </p></dd>
  36191. </dl>
  36192. <p>Default value is <code class="code">sono_v</code>.
  36193. </p>
  36194. </dd>
  36195. <dt><samp class="option">sono_g, gamma</samp></dt>
  36196. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  36197. higher gamma makes the spectrum having more range. Default value is <code class="code">3</code>.
  36198. Acceptable range is <code class="code">[1, 7]</code>.
  36199. </p>
  36200. </dd>
  36201. <dt><samp class="option">bar_g, gamma2</samp></dt>
  36202. <dd><p>Specify the bargraph gamma. Default value is <code class="code">1</code>. Acceptable range is
  36203. <code class="code">[1, 7]</code>.
  36204. </p>
  36205. </dd>
  36206. <dt><samp class="option">bar_t</samp></dt>
  36207. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  36208. Default value is <code class="code">1</code>. Acceptable range is <code class="code">[0, 1]</code>.
  36209. </p>
  36210. </dd>
  36211. <dt><samp class="option">timeclamp, tc</samp></dt>
  36212. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  36213. accuracy in time domain and frequency domain. If timeclamp is lower,
  36214. event in time domain is represented more accurately (such as fast bass drum),
  36215. otherwise event in frequency domain is represented more accurately
  36216. (such as bass guitar). Acceptable range is <code class="code">[0.002, 1]</code>. Default value is <code class="code">0.17</code>.
  36217. </p>
  36218. </dd>
  36219. <dt><samp class="option">attack</samp></dt>
  36220. <dd><p>Set attack time in seconds. The default is <code class="code">0</code> (disabled). Otherwise, it
  36221. limits future samples by applying asymmetric windowing in time domain, useful
  36222. when low latency is required. Accepted range is <code class="code">[0, 1]</code>.
  36223. </p>
  36224. </dd>
  36225. <dt><samp class="option">basefreq</samp></dt>
  36226. <dd><p>Specify the transform base frequency. Default value is <code class="code">20.01523126408007475</code>,
  36227. which is frequency 50 cents below E0. Acceptable range is <code class="code">[10, 100000]</code>.
  36228. </p>
  36229. </dd>
  36230. <dt><samp class="option">endfreq</samp></dt>
  36231. <dd><p>Specify the transform end frequency. Default value is <code class="code">20495.59681441799654</code>,
  36232. which is frequency 50 cents above D#10. Acceptable range is <code class="code">[10, 100000]</code>.
  36233. </p>
  36234. </dd>
  36235. <dt><samp class="option">coeffclamp</samp></dt>
  36236. <dd><p>This option is deprecated and ignored.
  36237. </p>
  36238. </dd>
  36239. <dt><samp class="option">tlength</samp></dt>
  36240. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  36241. trade-off between time domain and frequency domain at every frequency sample.
  36242. It can contain variables:
  36243. </p><dl class="table">
  36244. <dt><samp class="option">frequency, freq, f</samp></dt>
  36245. <dd><p>the frequency where it is evaluated
  36246. </p></dd>
  36247. <dt><samp class="option">timeclamp, tc</samp></dt>
  36248. <dd><p>the value of <var class="var">timeclamp</var> option.
  36249. </p></dd>
  36250. </dl>
  36251. <p>Default value is <code class="code">384*tc/(384+tc*f)</code>.
  36252. </p>
  36253. </dd>
  36254. <dt><samp class="option">count</samp></dt>
  36255. <dd><p>Specify the transform count for every video frame. Default value is <code class="code">6</code>.
  36256. Acceptable range is <code class="code">[1, 30]</code>.
  36257. </p>
  36258. </dd>
  36259. <dt><samp class="option">fcount</samp></dt>
  36260. <dd><p>Specify the transform count for every single pixel. Default value is <code class="code">0</code>,
  36261. which makes it computed automatically. Acceptable range is <code class="code">[0, 10]</code>.
  36262. </p>
  36263. </dd>
  36264. <dt><samp class="option">fontfile</samp></dt>
  36265. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  36266. use embedded font. Note that drawing with font file or embedded font is not
  36267. implemented with custom <var class="var">basefreq</var> and <var class="var">endfreq</var>, use <var class="var">axisfile</var>
  36268. option instead.
  36269. </p>
  36270. </dd>
  36271. <dt><samp class="option">font</samp></dt>
  36272. <dd><p>Specify fontconfig pattern. This has lower priority than <var class="var">fontfile</var>. The
  36273. <code class="code">:</code> in the pattern may be replaced by <code class="code">|</code> to avoid unnecessary
  36274. escaping.
  36275. </p>
  36276. </dd>
  36277. <dt><samp class="option">fontcolor</samp></dt>
  36278. <dd><p>Specify font color expression. This is arithmetic expression that should return
  36279. integer value 0xRRGGBB. It can contain variables:
  36280. </p><dl class="table">
  36281. <dt><samp class="option">frequency, freq, f</samp></dt>
  36282. <dd><p>the frequency where it is evaluated
  36283. </p></dd>
  36284. <dt><samp class="option">timeclamp, tc</samp></dt>
  36285. <dd><p>the value of <var class="var">timeclamp</var> option
  36286. </p></dd>
  36287. </dl>
  36288. <p>and functions:
  36289. </p><dl class="table">
  36290. <dt><samp class="option">midi(f)</samp></dt>
  36291. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  36292. </p></dd>
  36293. <dt><samp class="option">r(x), g(x), b(x)</samp></dt>
  36294. <dd><p>red, green, and blue value of intensity x.
  36295. </p></dd>
  36296. </dl>
  36297. <p>Default value is <code class="code">st(0, (midi(f)-59.5)/12);
  36298. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  36299. r(1-ld(1)) + b(ld(1))</code>.
  36300. </p>
  36301. </dd>
  36302. <dt><samp class="option">axisfile</samp></dt>
  36303. <dd><p>Specify image file to draw the axis. This option override <var class="var">fontfile</var> and
  36304. <var class="var">fontcolor</var> option.
  36305. </p>
  36306. </dd>
  36307. <dt><samp class="option">axis, text</samp></dt>
  36308. <dd><p>Enable/disable drawing text to the axis. If it is set to <code class="code">0</code>, drawing to
  36309. the axis is disabled, ignoring <var class="var">fontfile</var> and <var class="var">axisfile</var> option.
  36310. Default value is <code class="code">1</code>.
  36311. </p>
  36312. </dd>
  36313. <dt><samp class="option">csp</samp></dt>
  36314. <dd><p>Set colorspace. The accepted values are:
  36315. </p><dl class="table">
  36316. <dt>&lsquo;<samp class="samp">unspecified</samp>&rsquo;</dt>
  36317. <dd><p>Unspecified (default)
  36318. </p>
  36319. </dd>
  36320. <dt>&lsquo;<samp class="samp">bt709</samp>&rsquo;</dt>
  36321. <dd><p>BT.709
  36322. </p>
  36323. </dd>
  36324. <dt>&lsquo;<samp class="samp">fcc</samp>&rsquo;</dt>
  36325. <dd><p>FCC
  36326. </p>
  36327. </dd>
  36328. <dt>&lsquo;<samp class="samp">bt470bg</samp>&rsquo;</dt>
  36329. <dd><p>BT.470BG or BT.601-6 625
  36330. </p>
  36331. </dd>
  36332. <dt>&lsquo;<samp class="samp">smpte170m</samp>&rsquo;</dt>
  36333. <dd><p>SMPTE-170M or BT.601-6 525
  36334. </p>
  36335. </dd>
  36336. <dt>&lsquo;<samp class="samp">smpte240m</samp>&rsquo;</dt>
  36337. <dd><p>SMPTE-240M
  36338. </p>
  36339. </dd>
  36340. <dt>&lsquo;<samp class="samp">bt2020ncl</samp>&rsquo;</dt>
  36341. <dd><p>BT.2020 with non-constant luminance
  36342. </p>
  36343. </dd>
  36344. </dl>
  36345. </dd>
  36346. <dt><samp class="option">cscheme</samp></dt>
  36347. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  36348. <code class="code">left_r|left_g|left_b|right_r|right_g|right_b</code>.
  36349. The default is <code class="code">1|0.5|0|0|0.5|1</code>.
  36350. </p>
  36351. </dd>
  36352. </dl>
  36353. <a name="Examples-177"></a>
  36354. <h4 class="subsection">20.22.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-177" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-177" aria-hidden="true">TOC</a></span></h4>
  36355. <ul class="itemize mark-bullet">
  36356. <li>Playing audio while showing the spectrum:
  36357. <div class="example">
  36358. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  36359. </pre></div>
  36360. </li><li>Same as above, but with frame rate 30 fps:
  36361. <div class="example">
  36362. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  36363. </pre></div>
  36364. </li><li>Playing at 1280x720:
  36365. <div class="example">
  36366. <pre class="example-preformatted">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  36367. </pre></div>
  36368. </li><li>Disable sonogram display:
  36369. <div class="example">
  36370. <pre class="example-preformatted">sono_h=0
  36371. </pre></div>
  36372. </li><li>A1 and its harmonics: A1, A2, (near)E3, A3:
  36373. <div class="example">
  36374. <pre class="example-preformatted">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),
  36375. asplit[a][out1]; [a] showcqt [out0]'
  36376. </pre></div>
  36377. </li><li>Same as above, but with more accuracy in frequency domain:
  36378. <div class="example">
  36379. <pre class="example-preformatted">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),
  36380. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  36381. </pre></div>
  36382. </li><li>Custom volume:
  36383. <div class="example">
  36384. <pre class="example-preformatted">bar_v=10:sono_v=bar_v*a_weighting(f)
  36385. </pre></div>
  36386. </li><li>Custom gamma, now spectrum is linear to the amplitude.
  36387. <div class="example">
  36388. <pre class="example-preformatted">bar_g=2:sono_g=2
  36389. </pre></div>
  36390. </li><li>Custom tlength equation:
  36391. <div class="example">
  36392. <pre class="example-preformatted">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)))'
  36393. </pre></div>
  36394. </li><li>Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  36395. <div class="example">
  36396. <pre class="example-preformatted">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  36397. </pre></div>
  36398. </li><li>Custom font using fontconfig:
  36399. <div class="example">
  36400. <pre class="example-preformatted">font='Courier New,Monospace,mono|bold'
  36401. </pre></div>
  36402. </li><li>Custom frequency range with custom axis using image file:
  36403. <div class="example">
  36404. <pre class="example-preformatted">axisfile=myaxis.png:basefreq=40:endfreq=10000
  36405. </pre></div>
  36406. </li></ul>
  36407. <a name="showcwt"></a>
  36408. <h3 class="section">20.23 showcwt<span class="pull-right"><a class="anchor hidden-xs" href="#showcwt" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showcwt" aria-hidden="true">TOC</a></span></h3>
  36409. <p>Convert input audio to video output representing frequency spectrum
  36410. using Continuous Wavelet Transform and Morlet wavelet.
  36411. </p>
  36412. <p>The filter accepts the following options:
  36413. </p>
  36414. <dl class="table">
  36415. <dt><samp class="option">size, s</samp></dt>
  36416. <dd><p>Specify the video size for the output. For the syntax of this option,
  36417. check the <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36418. Default value is <code class="code">640x512</code>.
  36419. </p>
  36420. </dd>
  36421. <dt><samp class="option">rate, r</samp></dt>
  36422. <dd><p>Set the output frame rate. Default value is <code class="code">25</code>.
  36423. </p>
  36424. </dd>
  36425. <dt><samp class="option">scale</samp></dt>
  36426. <dd><p>Set the frequency scale used. Allowed values are:
  36427. </p>
  36428. <dl class="table">
  36429. <dt><samp class="option">linear</samp></dt>
  36430. <dt><samp class="option">log</samp></dt>
  36431. <dt><samp class="option">bark</samp></dt>
  36432. <dt><samp class="option">mel</samp></dt>
  36433. <dt><samp class="option">erbs</samp></dt>
  36434. <dt><samp class="option">sqrt</samp></dt>
  36435. <dt><samp class="option">cbrt</samp></dt>
  36436. <dt><samp class="option">qdrt</samp></dt>
  36437. <dt><samp class="option">fm</samp></dt>
  36438. </dl>
  36439. <p>Default value is <code class="code">linear</code>.
  36440. </p>
  36441. </dd>
  36442. <dt><samp class="option">iscale</samp></dt>
  36443. <dd><p>Set the intensity scale used. Allowed values are:
  36444. </p>
  36445. <dl class="table">
  36446. <dt><samp class="option">linear</samp></dt>
  36447. <dt><samp class="option">log</samp></dt>
  36448. <dt><samp class="option">sqrt</samp></dt>
  36449. <dt><samp class="option">cbrt</samp></dt>
  36450. <dt><samp class="option">qdrt</samp></dt>
  36451. </dl>
  36452. <p>Default value is <code class="code">log</code>.
  36453. </p>
  36454. </dd>
  36455. <dt><samp class="option">min</samp></dt>
  36456. <dd><p>Set the minimum frequency that will be used in output.
  36457. Default is <code class="code">20</code> Hz.
  36458. </p>
  36459. </dd>
  36460. <dt><samp class="option">max</samp></dt>
  36461. <dd><p>Set the maximum frequency that will be used in output.
  36462. Default is <code class="code">20000</code> Hz. The real frequency upper limit
  36463. depends on input audio&rsquo;s sample rate and such will be enforced
  36464. on this value when it is set to value greater than Nyquist frequency.
  36465. </p>
  36466. </dd>
  36467. <dt><samp class="option">imin</samp></dt>
  36468. <dd><p>Set the minimum intensity that will be used in output.
  36469. </p>
  36470. </dd>
  36471. <dt><samp class="option">imax</samp></dt>
  36472. <dd><p>Set the maximum intensity that will be used in output.
  36473. </p>
  36474. </dd>
  36475. <dt><samp class="option">logb</samp></dt>
  36476. <dd><p>Set the logarithmic basis for brightness strength when
  36477. mapping calculated magnitude values to pixel values.
  36478. Allowed range is from <code class="code">0</code> to <code class="code">1</code>.
  36479. Default value is <code class="code">0.0001</code>.
  36480. </p>
  36481. </dd>
  36482. <dt><samp class="option">deviation</samp></dt>
  36483. <dd><p>Set the frequency deviation.
  36484. Lower values than <code class="code">1</code> are more frequency oriented,
  36485. while higher values than <code class="code">1</code> are more time oriented.
  36486. Allowed range is from <code class="code">0</code> to <code class="code">10</code>.
  36487. Default value is <code class="code">1</code>.
  36488. </p>
  36489. </dd>
  36490. <dt><samp class="option">pps</samp></dt>
  36491. <dd><p>Set the number of pixel output per each second in one row.
  36492. Allowed range is from <code class="code">1</code> to <code class="code">1024</code>.
  36493. Default value is <code class="code">64</code>.
  36494. </p>
  36495. </dd>
  36496. <dt><samp class="option">mode</samp></dt>
  36497. <dd><p>Set the output visual mode. Allowed values are:
  36498. </p>
  36499. <dl class="table">
  36500. <dt><samp class="option">magnitude</samp></dt>
  36501. <dd><p>Show magnitude.
  36502. </p></dd>
  36503. <dt><samp class="option">phase</samp></dt>
  36504. <dd><p>Show only phase.
  36505. </p></dd>
  36506. <dt><samp class="option">magphase</samp></dt>
  36507. <dd><p>Show combination of magnitude and phase.
  36508. Magnitude is mapped to brightness and phase to color.
  36509. </p></dd>
  36510. <dt><samp class="option">channel</samp></dt>
  36511. <dd><p>Show unique color per channel magnitude.
  36512. </p></dd>
  36513. <dt><samp class="option">stereo</samp></dt>
  36514. <dd><p>Show unique color per stereo difference.
  36515. </p></dd>
  36516. </dl>
  36517. <p>Default value is <code class="code">magnitude</code>.
  36518. </p>
  36519. </dd>
  36520. <dt><samp class="option">slide</samp></dt>
  36521. <dd><p>Set the output slide method. Allowed values are:
  36522. </p>
  36523. <dl class="table">
  36524. <dt><samp class="option">replace</samp></dt>
  36525. <dt><samp class="option">scroll</samp></dt>
  36526. <dt><samp class="option">frame</samp></dt>
  36527. </dl>
  36528. </dd>
  36529. <dt><samp class="option">direction</samp></dt>
  36530. <dd><p>Set the direction method for output slide method. Allowed values are:
  36531. </p>
  36532. <dl class="table">
  36533. <dt><samp class="option">lr</samp></dt>
  36534. <dd><p>Direction from left to right.
  36535. </p></dd>
  36536. <dt><samp class="option">rl</samp></dt>
  36537. <dd><p>Direction from right to left.
  36538. </p></dd>
  36539. <dt><samp class="option">ud</samp></dt>
  36540. <dd><p>Direction from up to down.
  36541. </p></dd>
  36542. <dt><samp class="option">du</samp></dt>
  36543. <dd><p>Direction from down to up.
  36544. </p></dd>
  36545. </dl>
  36546. </dd>
  36547. <dt><samp class="option">bar</samp></dt>
  36548. <dd><p>Set the ratio of bargraph display to display size. Default is 0.
  36549. </p>
  36550. </dd>
  36551. <dt><samp class="option">rotation</samp></dt>
  36552. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  36553. Default value is <code class="code">0</code>.
  36554. </p></dd>
  36555. </dl>
  36556. <a name="showfreqs"></a>
  36557. <h3 class="section">20.24 showfreqs<span class="pull-right"><a class="anchor hidden-xs" href="#showfreqs" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showfreqs" aria-hidden="true">TOC</a></span></h3>
  36558. <p>Convert input audio to video output representing the audio power spectrum.
  36559. Audio amplitude is on Y-axis while frequency is on X-axis.
  36560. </p>
  36561. <p>The filter accepts the following options:
  36562. </p>
  36563. <dl class="table">
  36564. <dt><samp class="option">size, s</samp></dt>
  36565. <dd><p>Specify size of video. For the syntax of this option, check the
  36566. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36567. Default is <code class="code">1024x512</code>.
  36568. </p>
  36569. </dd>
  36570. <dt><samp class="option">rate, r</samp></dt>
  36571. <dd><p>Set video rate. Default is <code class="code">25</code>.
  36572. </p>
  36573. </dd>
  36574. <dt><samp class="option">mode</samp></dt>
  36575. <dd><p>Set display mode.
  36576. This set how each frequency bin will be represented.
  36577. </p>
  36578. <p>It accepts the following values:
  36579. </p><dl class="table">
  36580. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  36581. <dt>&lsquo;<samp class="samp">bar</samp>&rsquo;</dt>
  36582. <dt>&lsquo;<samp class="samp">dot</samp>&rsquo;</dt>
  36583. </dl>
  36584. <p>Default is <code class="code">bar</code>.
  36585. </p>
  36586. </dd>
  36587. <dt><samp class="option">ascale</samp></dt>
  36588. <dd><p>Set amplitude scale.
  36589. </p>
  36590. <p>It accepts the following values:
  36591. </p><dl class="table">
  36592. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  36593. <dd><p>Linear scale.
  36594. </p>
  36595. </dd>
  36596. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  36597. <dd><p>Square root scale.
  36598. </p>
  36599. </dd>
  36600. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  36601. <dd><p>Cubic root scale.
  36602. </p>
  36603. </dd>
  36604. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  36605. <dd><p>Logarithmic scale.
  36606. </p></dd>
  36607. </dl>
  36608. <p>Default is <code class="code">log</code>.
  36609. </p>
  36610. </dd>
  36611. <dt><samp class="option">fscale</samp></dt>
  36612. <dd><p>Set frequency scale.
  36613. </p>
  36614. <p>It accepts the following values:
  36615. </p><dl class="table">
  36616. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  36617. <dd><p>Linear scale.
  36618. </p>
  36619. </dd>
  36620. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  36621. <dd><p>Logarithmic scale.
  36622. </p>
  36623. </dd>
  36624. <dt>&lsquo;<samp class="samp">rlog</samp>&rsquo;</dt>
  36625. <dd><p>Reverse logarithmic scale.
  36626. </p></dd>
  36627. </dl>
  36628. <p>Default is <code class="code">lin</code>.
  36629. </p>
  36630. </dd>
  36631. <dt><samp class="option">win_size</samp></dt>
  36632. <dd><p>Set window size. Allowed range is from 16 to 65536.
  36633. </p>
  36634. <p>Default is <code class="code">2048</code>
  36635. </p>
  36636. </dd>
  36637. <dt><samp class="option">win_func</samp></dt>
  36638. <dd><p>Set windowing function.
  36639. </p>
  36640. <p>It accepts the following values:
  36641. </p><dl class="table">
  36642. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  36643. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  36644. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  36645. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  36646. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  36647. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  36648. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  36649. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  36650. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  36651. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  36652. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  36653. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  36654. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  36655. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  36656. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  36657. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  36658. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  36659. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  36660. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  36661. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  36662. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  36663. </dl>
  36664. <p>Default is <code class="code">hanning</code>.
  36665. </p>
  36666. </dd>
  36667. <dt><samp class="option">overlap</samp></dt>
  36668. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  36669. which means optimal overlap for selected window function will be picked.
  36670. </p>
  36671. </dd>
  36672. <dt><samp class="option">averaging</samp></dt>
  36673. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  36674. Default is <code class="code">1</code>, which means time averaging is disabled.
  36675. </p>
  36676. </dd>
  36677. <dt><samp class="option">colors</samp></dt>
  36678. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  36679. draw channel frequencies. Unrecognized or missing colors will be replaced
  36680. by white color.
  36681. </p>
  36682. </dd>
  36683. <dt><samp class="option">cmode</samp></dt>
  36684. <dd><p>Set channel display mode.
  36685. </p>
  36686. <p>It accepts the following values:
  36687. </p><dl class="table">
  36688. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  36689. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  36690. </dl>
  36691. <p>Default is <code class="code">combined</code>.
  36692. </p>
  36693. </dd>
  36694. <dt><samp class="option">minamp</samp></dt>
  36695. <dd><p>Set minimum amplitude used in <code class="code">log</code> amplitude scaler.
  36696. </p>
  36697. </dd>
  36698. <dt><samp class="option">data</samp></dt>
  36699. <dd><p>Set data display mode.
  36700. </p>
  36701. <p>It accepts the following values:
  36702. </p><dl class="table">
  36703. <dt>&lsquo;<samp class="samp">magnitude</samp>&rsquo;</dt>
  36704. <dt>&lsquo;<samp class="samp">phase</samp>&rsquo;</dt>
  36705. <dt>&lsquo;<samp class="samp">delay</samp>&rsquo;</dt>
  36706. </dl>
  36707. <p>Default is <code class="code">magnitude</code>.
  36708. </p>
  36709. </dd>
  36710. <dt><samp class="option">channels</samp></dt>
  36711. <dd><p>Set channels to use when processing audio. By default all are processed.
  36712. </p></dd>
  36713. </dl>
  36714. <a name="showspatial"></a>
  36715. <h3 class="section">20.25 showspatial<span class="pull-right"><a class="anchor hidden-xs" href="#showspatial" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspatial" aria-hidden="true">TOC</a></span></h3>
  36716. <p>Convert stereo input audio to a video output, representing the spatial relationship
  36717. between two channels.
  36718. </p>
  36719. <p>The filter accepts the following options:
  36720. </p>
  36721. <dl class="table">
  36722. <dt><samp class="option">size, s</samp></dt>
  36723. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  36724. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36725. Default value is <code class="code">512x512</code>.
  36726. </p>
  36727. </dd>
  36728. <dt><samp class="option">win_size</samp></dt>
  36729. <dd><p>Set window size. Allowed range is from <var class="var">1024</var> to <var class="var">65536</var>. Default size is <var class="var">4096</var>.
  36730. </p>
  36731. </dd>
  36732. <dt><samp class="option">win_func</samp></dt>
  36733. <dd><p>Set window function.
  36734. </p>
  36735. <p>It accepts the following values:
  36736. </p><dl class="table">
  36737. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  36738. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  36739. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  36740. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  36741. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  36742. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  36743. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  36744. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  36745. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  36746. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  36747. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  36748. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  36749. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  36750. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  36751. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  36752. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  36753. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  36754. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  36755. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  36756. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  36757. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  36758. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  36759. </dl>
  36760. <p>Default value is <code class="code">hann</code>.
  36761. </p>
  36762. </dd>
  36763. <dt><samp class="option">rate, r</samp></dt>
  36764. <dd><p>Set output framerate.
  36765. </p></dd>
  36766. </dl>
  36767. <a class="anchor" id="showspectrum"></a><a name="showspectrum-1"></a>
  36768. <h3 class="section">20.26 showspectrum<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrum-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrum-1" aria-hidden="true">TOC</a></span></h3>
  36769. <p>Convert input audio to a video output, representing the audio frequency
  36770. spectrum.
  36771. </p>
  36772. <p>The filter accepts the following options:
  36773. </p>
  36774. <dl class="table">
  36775. <dt><samp class="option">size, s</samp></dt>
  36776. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  36777. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  36778. Default value is <code class="code">640x512</code>.
  36779. </p>
  36780. </dd>
  36781. <dt><samp class="option">slide</samp></dt>
  36782. <dd><p>Specify how the spectrum should slide along the window.
  36783. </p>
  36784. <p>It accepts the following values:
  36785. </p><dl class="table">
  36786. <dt>&lsquo;<samp class="samp">replace</samp>&rsquo;</dt>
  36787. <dd><p>the samples start again on the left when they reach the right
  36788. </p></dd>
  36789. <dt>&lsquo;<samp class="samp">scroll</samp>&rsquo;</dt>
  36790. <dd><p>the samples scroll from right to left
  36791. </p></dd>
  36792. <dt>&lsquo;<samp class="samp">fullframe</samp>&rsquo;</dt>
  36793. <dd><p>frames are only produced when the samples reach the right
  36794. </p></dd>
  36795. <dt>&lsquo;<samp class="samp">rscroll</samp>&rsquo;</dt>
  36796. <dd><p>the samples scroll from left to right
  36797. </p></dd>
  36798. <dt>&lsquo;<samp class="samp">lreplace</samp>&rsquo;</dt>
  36799. <dd><p>the samples start again on the right when they reach the left
  36800. </p></dd>
  36801. </dl>
  36802. <p>Default value is <code class="code">replace</code>.
  36803. </p>
  36804. </dd>
  36805. <dt><samp class="option">mode</samp></dt>
  36806. <dd><p>Specify display mode.
  36807. </p>
  36808. <p>It accepts the following values:
  36809. </p><dl class="table">
  36810. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  36811. <dd><p>all channels are displayed in the same row
  36812. </p></dd>
  36813. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  36814. <dd><p>all channels are displayed in separate rows
  36815. </p></dd>
  36816. </dl>
  36817. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  36818. </p>
  36819. </dd>
  36820. <dt><samp class="option">color</samp></dt>
  36821. <dd><p>Specify display color mode.
  36822. </p>
  36823. <p>It accepts the following values:
  36824. </p><dl class="table">
  36825. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  36826. <dd><p>each channel is displayed in a separate color
  36827. </p></dd>
  36828. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  36829. <dd><p>each channel is displayed using the same color scheme
  36830. </p></dd>
  36831. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  36832. <dd><p>each channel is displayed using the rainbow color scheme
  36833. </p></dd>
  36834. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  36835. <dd><p>each channel is displayed using the moreland color scheme
  36836. </p></dd>
  36837. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  36838. <dd><p>each channel is displayed using the nebulae color scheme
  36839. </p></dd>
  36840. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  36841. <dd><p>each channel is displayed using the fire color scheme
  36842. </p></dd>
  36843. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  36844. <dd><p>each channel is displayed using the fiery color scheme
  36845. </p></dd>
  36846. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  36847. <dd><p>each channel is displayed using the fruit color scheme
  36848. </p></dd>
  36849. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  36850. <dd><p>each channel is displayed using the cool color scheme
  36851. </p></dd>
  36852. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  36853. <dd><p>each channel is displayed using the magma color scheme
  36854. </p></dd>
  36855. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  36856. <dd><p>each channel is displayed using the green color scheme
  36857. </p></dd>
  36858. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  36859. <dd><p>each channel is displayed using the viridis color scheme
  36860. </p></dd>
  36861. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  36862. <dd><p>each channel is displayed using the plasma color scheme
  36863. </p></dd>
  36864. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  36865. <dd><p>each channel is displayed using the cividis color scheme
  36866. </p></dd>
  36867. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  36868. <dd><p>each channel is displayed using the terrain color scheme
  36869. </p></dd>
  36870. </dl>
  36871. <p>Default value is &lsquo;<samp class="samp">channel</samp>&rsquo;.
  36872. </p>
  36873. </dd>
  36874. <dt><samp class="option">scale</samp></dt>
  36875. <dd><p>Specify scale used for calculating intensity color values.
  36876. </p>
  36877. <p>It accepts the following values:
  36878. </p><dl class="table">
  36879. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  36880. <dd><p>linear
  36881. </p></dd>
  36882. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  36883. <dd><p>square root, default
  36884. </p></dd>
  36885. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  36886. <dd><p>cubic root
  36887. </p></dd>
  36888. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  36889. <dd><p>logarithmic
  36890. </p></dd>
  36891. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  36892. <dd><p>4th root
  36893. </p></dd>
  36894. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  36895. <dd><p>5th root
  36896. </p></dd>
  36897. </dl>
  36898. <p>Default value is &lsquo;<samp class="samp">sqrt</samp>&rsquo;.
  36899. </p>
  36900. </dd>
  36901. <dt><samp class="option">fscale</samp></dt>
  36902. <dd><p>Specify frequency scale.
  36903. </p>
  36904. <p>It accepts the following values:
  36905. </p><dl class="table">
  36906. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  36907. <dd><p>linear
  36908. </p></dd>
  36909. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  36910. <dd><p>logarithmic
  36911. </p></dd>
  36912. </dl>
  36913. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  36914. </p>
  36915. </dd>
  36916. <dt><samp class="option">saturation</samp></dt>
  36917. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  36918. alternative color scheme. <code class="code">0</code> is no saturation at all.
  36919. Saturation must be in [-10.0, 10.0] range.
  36920. Default value is <code class="code">1</code>.
  36921. </p>
  36922. </dd>
  36923. <dt><samp class="option">win_func</samp></dt>
  36924. <dd><p>Set window function.
  36925. </p>
  36926. <p>It accepts the following values:
  36927. </p><dl class="table">
  36928. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  36929. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  36930. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  36931. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  36932. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  36933. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  36934. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  36935. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  36936. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  36937. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  36938. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  36939. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  36940. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  36941. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  36942. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  36943. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  36944. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  36945. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  36946. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  36947. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  36948. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  36949. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  36950. </dl>
  36951. <p>Default value is <code class="code">hann</code>.
  36952. </p>
  36953. </dd>
  36954. <dt><samp class="option">orientation</samp></dt>
  36955. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  36956. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  36957. </p>
  36958. </dd>
  36959. <dt><samp class="option">overlap</samp></dt>
  36960. <dd><p>Set ratio of overlap window. Default value is <code class="code">0</code>.
  36961. When value is <code class="code">1</code> overlap is set to recommended size for specific
  36962. window function currently used.
  36963. </p>
  36964. </dd>
  36965. <dt><samp class="option">gain</samp></dt>
  36966. <dd><p>Set scale gain for calculating intensity color values.
  36967. Default value is <code class="code">1</code>.
  36968. </p>
  36969. </dd>
  36970. <dt><samp class="option">data</samp></dt>
  36971. <dd><p>Set which data to display. Can be <code class="code">magnitude</code>, default or <code class="code">phase</code>,
  36972. or unwrapped phase: <code class="code">uphase</code>.
  36973. </p>
  36974. </dd>
  36975. <dt><samp class="option">rotation</samp></dt>
  36976. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  36977. Default value is <code class="code">0</code>.
  36978. </p>
  36979. </dd>
  36980. <dt><samp class="option">start</samp></dt>
  36981. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  36982. </p>
  36983. </dd>
  36984. <dt><samp class="option">stop</samp></dt>
  36985. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  36986. </p>
  36987. </dd>
  36988. <dt><samp class="option">fps</samp></dt>
  36989. <dd><p>Set upper frame rate limit. Default is <code class="code">auto</code>, unlimited.
  36990. </p>
  36991. </dd>
  36992. <dt><samp class="option">legend</samp></dt>
  36993. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  36994. </p>
  36995. </dd>
  36996. <dt><samp class="option">drange</samp></dt>
  36997. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  36998. Allowed range is from 10 to 200.
  36999. </p>
  37000. </dd>
  37001. <dt><samp class="option">limit</samp></dt>
  37002. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  37003. Allowed range is from -100 to 100.
  37004. </p>
  37005. </dd>
  37006. <dt><samp class="option">opacity</samp></dt>
  37007. <dd><p>Set opacity strength when using pixel format output with alpha component.
  37008. </p></dd>
  37009. </dl>
  37010. <p>The usage is very similar to the showwaves filter; see the examples in that
  37011. section.
  37012. </p>
  37013. <a name="Examples-178"></a>
  37014. <h4 class="subsection">20.26.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-178" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-178" aria-hidden="true">TOC</a></span></h4>
  37015. <ul class="itemize mark-bullet">
  37016. <li>Large window with logarithmic color scaling:
  37017. <div class="example">
  37018. <pre class="example-preformatted">showspectrum=s=1280x480:scale=log
  37019. </pre></div>
  37020. </li><li>Complete example for a colored and sliding spectrum per channel using <code class="command">ffplay</code>:
  37021. <div class="example">
  37022. <pre class="example-preformatted">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  37023. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  37024. </pre></div>
  37025. </li></ul>
  37026. <a name="showspectrumpic"></a>
  37027. <h3 class="section">20.27 showspectrumpic<span class="pull-right"><a class="anchor hidden-xs" href="#showspectrumpic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showspectrumpic" aria-hidden="true">TOC</a></span></h3>
  37028. <p>Convert input audio to a single video frame, representing the audio frequency
  37029. spectrum.
  37030. </p>
  37031. <p>The filter accepts the following options:
  37032. </p>
  37033. <dl class="table">
  37034. <dt><samp class="option">size, s</samp></dt>
  37035. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  37036. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37037. Default value is <code class="code">4096x2048</code>.
  37038. </p>
  37039. </dd>
  37040. <dt><samp class="option">mode</samp></dt>
  37041. <dd><p>Specify display mode.
  37042. </p>
  37043. <p>It accepts the following values:
  37044. </p><dl class="table">
  37045. <dt>&lsquo;<samp class="samp">combined</samp>&rsquo;</dt>
  37046. <dd><p>all channels are displayed in the same row
  37047. </p></dd>
  37048. <dt>&lsquo;<samp class="samp">separate</samp>&rsquo;</dt>
  37049. <dd><p>all channels are displayed in separate rows
  37050. </p></dd>
  37051. </dl>
  37052. <p>Default value is &lsquo;<samp class="samp">combined</samp>&rsquo;.
  37053. </p>
  37054. </dd>
  37055. <dt><samp class="option">color</samp></dt>
  37056. <dd><p>Specify display color mode.
  37057. </p>
  37058. <p>It accepts the following values:
  37059. </p><dl class="table">
  37060. <dt>&lsquo;<samp class="samp">channel</samp>&rsquo;</dt>
  37061. <dd><p>each channel is displayed in a separate color
  37062. </p></dd>
  37063. <dt>&lsquo;<samp class="samp">intensity</samp>&rsquo;</dt>
  37064. <dd><p>each channel is displayed using the same color scheme
  37065. </p></dd>
  37066. <dt>&lsquo;<samp class="samp">rainbow</samp>&rsquo;</dt>
  37067. <dd><p>each channel is displayed using the rainbow color scheme
  37068. </p></dd>
  37069. <dt>&lsquo;<samp class="samp">moreland</samp>&rsquo;</dt>
  37070. <dd><p>each channel is displayed using the moreland color scheme
  37071. </p></dd>
  37072. <dt>&lsquo;<samp class="samp">nebulae</samp>&rsquo;</dt>
  37073. <dd><p>each channel is displayed using the nebulae color scheme
  37074. </p></dd>
  37075. <dt>&lsquo;<samp class="samp">fire</samp>&rsquo;</dt>
  37076. <dd><p>each channel is displayed using the fire color scheme
  37077. </p></dd>
  37078. <dt>&lsquo;<samp class="samp">fiery</samp>&rsquo;</dt>
  37079. <dd><p>each channel is displayed using the fiery color scheme
  37080. </p></dd>
  37081. <dt>&lsquo;<samp class="samp">fruit</samp>&rsquo;</dt>
  37082. <dd><p>each channel is displayed using the fruit color scheme
  37083. </p></dd>
  37084. <dt>&lsquo;<samp class="samp">cool</samp>&rsquo;</dt>
  37085. <dd><p>each channel is displayed using the cool color scheme
  37086. </p></dd>
  37087. <dt>&lsquo;<samp class="samp">magma</samp>&rsquo;</dt>
  37088. <dd><p>each channel is displayed using the magma color scheme
  37089. </p></dd>
  37090. <dt>&lsquo;<samp class="samp">green</samp>&rsquo;</dt>
  37091. <dd><p>each channel is displayed using the green color scheme
  37092. </p></dd>
  37093. <dt>&lsquo;<samp class="samp">viridis</samp>&rsquo;</dt>
  37094. <dd><p>each channel is displayed using the viridis color scheme
  37095. </p></dd>
  37096. <dt>&lsquo;<samp class="samp">plasma</samp>&rsquo;</dt>
  37097. <dd><p>each channel is displayed using the plasma color scheme
  37098. </p></dd>
  37099. <dt>&lsquo;<samp class="samp">cividis</samp>&rsquo;</dt>
  37100. <dd><p>each channel is displayed using the cividis color scheme
  37101. </p></dd>
  37102. <dt>&lsquo;<samp class="samp">terrain</samp>&rsquo;</dt>
  37103. <dd><p>each channel is displayed using the terrain color scheme
  37104. </p></dd>
  37105. </dl>
  37106. <p>Default value is &lsquo;<samp class="samp">intensity</samp>&rsquo;.
  37107. </p>
  37108. </dd>
  37109. <dt><samp class="option">scale</samp></dt>
  37110. <dd><p>Specify scale used for calculating intensity color values.
  37111. </p>
  37112. <p>It accepts the following values:
  37113. </p><dl class="table">
  37114. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  37115. <dd><p>linear
  37116. </p></dd>
  37117. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  37118. <dd><p>square root, default
  37119. </p></dd>
  37120. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  37121. <dd><p>cubic root
  37122. </p></dd>
  37123. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  37124. <dd><p>logarithmic
  37125. </p></dd>
  37126. <dt>&lsquo;<samp class="samp">4thrt</samp>&rsquo;</dt>
  37127. <dd><p>4th root
  37128. </p></dd>
  37129. <dt>&lsquo;<samp class="samp">5thrt</samp>&rsquo;</dt>
  37130. <dd><p>5th root
  37131. </p></dd>
  37132. </dl>
  37133. <p>Default value is &lsquo;<samp class="samp">log</samp>&rsquo;.
  37134. </p>
  37135. </dd>
  37136. <dt><samp class="option">fscale</samp></dt>
  37137. <dd><p>Specify frequency scale.
  37138. </p>
  37139. <p>It accepts the following values:
  37140. </p><dl class="table">
  37141. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  37142. <dd><p>linear
  37143. </p></dd>
  37144. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  37145. <dd><p>logarithmic
  37146. </p></dd>
  37147. </dl>
  37148. <p>Default value is &lsquo;<samp class="samp">lin</samp>&rsquo;.
  37149. </p>
  37150. </dd>
  37151. <dt><samp class="option">saturation</samp></dt>
  37152. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  37153. alternative color scheme. <code class="code">0</code> is no saturation at all.
  37154. Saturation must be in [-10.0, 10.0] range.
  37155. Default value is <code class="code">1</code>.
  37156. </p>
  37157. </dd>
  37158. <dt><samp class="option">win_func</samp></dt>
  37159. <dd><p>Set window function.
  37160. </p>
  37161. <p>It accepts the following values:
  37162. </p><dl class="table">
  37163. <dt>&lsquo;<samp class="samp">rect</samp>&rsquo;</dt>
  37164. <dt>&lsquo;<samp class="samp">bartlett</samp>&rsquo;</dt>
  37165. <dt>&lsquo;<samp class="samp">hann</samp>&rsquo;</dt>
  37166. <dt>&lsquo;<samp class="samp">hanning</samp>&rsquo;</dt>
  37167. <dt>&lsquo;<samp class="samp">hamming</samp>&rsquo;</dt>
  37168. <dt>&lsquo;<samp class="samp">blackman</samp>&rsquo;</dt>
  37169. <dt>&lsquo;<samp class="samp">welch</samp>&rsquo;</dt>
  37170. <dt>&lsquo;<samp class="samp">flattop</samp>&rsquo;</dt>
  37171. <dt>&lsquo;<samp class="samp">bharris</samp>&rsquo;</dt>
  37172. <dt>&lsquo;<samp class="samp">bnuttall</samp>&rsquo;</dt>
  37173. <dt>&lsquo;<samp class="samp">bhann</samp>&rsquo;</dt>
  37174. <dt>&lsquo;<samp class="samp">sine</samp>&rsquo;</dt>
  37175. <dt>&lsquo;<samp class="samp">nuttall</samp>&rsquo;</dt>
  37176. <dt>&lsquo;<samp class="samp">lanczos</samp>&rsquo;</dt>
  37177. <dt>&lsquo;<samp class="samp">gauss</samp>&rsquo;</dt>
  37178. <dt>&lsquo;<samp class="samp">tukey</samp>&rsquo;</dt>
  37179. <dt>&lsquo;<samp class="samp">dolph</samp>&rsquo;</dt>
  37180. <dt>&lsquo;<samp class="samp">cauchy</samp>&rsquo;</dt>
  37181. <dt>&lsquo;<samp class="samp">parzen</samp>&rsquo;</dt>
  37182. <dt>&lsquo;<samp class="samp">poisson</samp>&rsquo;</dt>
  37183. <dt>&lsquo;<samp class="samp">bohman</samp>&rsquo;</dt>
  37184. <dt>&lsquo;<samp class="samp">kaiser</samp>&rsquo;</dt>
  37185. </dl>
  37186. <p>Default value is <code class="code">hann</code>.
  37187. </p>
  37188. </dd>
  37189. <dt><samp class="option">orientation</samp></dt>
  37190. <dd><p>Set orientation of time vs frequency axis. Can be <code class="code">vertical</code> or
  37191. <code class="code">horizontal</code>. Default is <code class="code">vertical</code>.
  37192. </p>
  37193. </dd>
  37194. <dt><samp class="option">gain</samp></dt>
  37195. <dd><p>Set scale gain for calculating intensity color values.
  37196. Default value is <code class="code">1</code>.
  37197. </p>
  37198. </dd>
  37199. <dt><samp class="option">legend</samp></dt>
  37200. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  37201. </p>
  37202. </dd>
  37203. <dt><samp class="option">rotation</samp></dt>
  37204. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  37205. Default value is <code class="code">0</code>.
  37206. </p>
  37207. </dd>
  37208. <dt><samp class="option">start</samp></dt>
  37209. <dd><p>Set start frequency from which to display spectrogram. Default is <code class="code">0</code>.
  37210. </p>
  37211. </dd>
  37212. <dt><samp class="option">stop</samp></dt>
  37213. <dd><p>Set stop frequency to which to display spectrogram. Default is <code class="code">0</code>.
  37214. </p>
  37215. </dd>
  37216. <dt><samp class="option">drange</samp></dt>
  37217. <dd><p>Set dynamic range used to calculate intensity color values. Default is 120 dBFS.
  37218. Allowed range is from 10 to 200.
  37219. </p>
  37220. </dd>
  37221. <dt><samp class="option">limit</samp></dt>
  37222. <dd><p>Set upper limit of input audio samples volume in dBFS. Default is 0 dBFS.
  37223. Allowed range is from -100 to 100.
  37224. </p>
  37225. </dd>
  37226. <dt><samp class="option">opacity</samp></dt>
  37227. <dd><p>Set opacity strength when using pixel format output with alpha component.
  37228. </p></dd>
  37229. </dl>
  37230. <a name="Examples-179"></a>
  37231. <h4 class="subsection">20.27.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-179" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-179" aria-hidden="true">TOC</a></span></h4>
  37232. <ul class="itemize mark-bullet">
  37233. <li>Extract an audio spectrogram of a whole audio track
  37234. in a 1024x1024 picture using <code class="command">ffmpeg</code>:
  37235. <div class="example">
  37236. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  37237. </pre></div>
  37238. </li></ul>
  37239. <a name="showvolume"></a>
  37240. <h3 class="section">20.28 showvolume<span class="pull-right"><a class="anchor hidden-xs" href="#showvolume" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showvolume" aria-hidden="true">TOC</a></span></h3>
  37241. <p>Convert input audio volume to a video output.
  37242. </p>
  37243. <p>The filter accepts the following options:
  37244. </p>
  37245. <dl class="table">
  37246. <dt><samp class="option">rate, r</samp></dt>
  37247. <dd><p>Set video rate.
  37248. </p>
  37249. </dd>
  37250. <dt><samp class="option">b</samp></dt>
  37251. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  37252. </p>
  37253. </dd>
  37254. <dt><samp class="option">w</samp></dt>
  37255. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  37256. </p>
  37257. </dd>
  37258. <dt><samp class="option">h</samp></dt>
  37259. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  37260. </p>
  37261. </dd>
  37262. <dt><samp class="option">f</samp></dt>
  37263. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  37264. </p>
  37265. </dd>
  37266. <dt><samp class="option">c</samp></dt>
  37267. <dd><p>Set volume color expression.
  37268. </p>
  37269. <p>The expression can use the following variables:
  37270. </p>
  37271. <dl class="table">
  37272. <dt><samp class="option">VOLUME</samp></dt>
  37273. <dd><p>Current max volume of channel in dB.
  37274. </p>
  37275. </dd>
  37276. <dt><samp class="option">PEAK</samp></dt>
  37277. <dd><p>Current peak.
  37278. </p>
  37279. </dd>
  37280. <dt><samp class="option">CHANNEL</samp></dt>
  37281. <dd><p>Current channel number, starting from 0.
  37282. </p></dd>
  37283. </dl>
  37284. </dd>
  37285. <dt><samp class="option">t</samp></dt>
  37286. <dd><p>If set, displays channel names. Default is enabled.
  37287. </p>
  37288. </dd>
  37289. <dt><samp class="option">v</samp></dt>
  37290. <dd><p>If set, displays volume values. Default is enabled.
  37291. </p>
  37292. </dd>
  37293. <dt><samp class="option">o</samp></dt>
  37294. <dd><p>Set orientation, can be horizontal: <code class="code">h</code> or vertical: <code class="code">v</code>,
  37295. default is <code class="code">h</code>.
  37296. </p>
  37297. </dd>
  37298. <dt><samp class="option">s</samp></dt>
  37299. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  37300. step is disabled.
  37301. </p>
  37302. </dd>
  37303. <dt><samp class="option">p</samp></dt>
  37304. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  37305. </p>
  37306. </dd>
  37307. <dt><samp class="option">m</samp></dt>
  37308. <dd><p>Set metering mode, can be peak: <code class="code">p</code> or rms: <code class="code">r</code>,
  37309. default is <code class="code">p</code>.
  37310. </p>
  37311. </dd>
  37312. <dt><samp class="option">ds</samp></dt>
  37313. <dd><p>Set display scale, can be linear: <code class="code">lin</code> or log: <code class="code">log</code>,
  37314. default is <code class="code">lin</code>.
  37315. </p>
  37316. </dd>
  37317. <dt><samp class="option">dm</samp></dt>
  37318. <dd><p>In second.
  37319. If set to &gt; 0., display a line for the max level
  37320. in the previous seconds.
  37321. default is disabled: <code class="code">0.</code>
  37322. </p>
  37323. </dd>
  37324. <dt><samp class="option">dmc</samp></dt>
  37325. <dd><p>The color of the max line. Use when <code class="code">dm</code> option is set to &gt; 0.
  37326. default is: <code class="code">orange</code>
  37327. </p></dd>
  37328. </dl>
  37329. <a name="showwaves"></a>
  37330. <h3 class="section">20.29 showwaves<span class="pull-right"><a class="anchor hidden-xs" href="#showwaves" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwaves" aria-hidden="true">TOC</a></span></h3>
  37331. <p>Convert input audio to a video output, representing the samples waves.
  37332. </p>
  37333. <p>The filter accepts the following options:
  37334. </p>
  37335. <dl class="table">
  37336. <dt><samp class="option">size, s</samp></dt>
  37337. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  37338. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37339. Default value is <code class="code">600x240</code>.
  37340. </p>
  37341. </dd>
  37342. <dt><samp class="option">mode</samp></dt>
  37343. <dd><p>Set display mode.
  37344. </p>
  37345. <p>Available values are:
  37346. </p><dl class="table">
  37347. <dt>&lsquo;<samp class="samp">point</samp>&rsquo;</dt>
  37348. <dd><p>Draw a point for each sample.
  37349. </p>
  37350. </dd>
  37351. <dt>&lsquo;<samp class="samp">line</samp>&rsquo;</dt>
  37352. <dd><p>Draw a vertical line for each sample.
  37353. </p>
  37354. </dd>
  37355. <dt>&lsquo;<samp class="samp">p2p</samp>&rsquo;</dt>
  37356. <dd><p>Draw a point for each sample and a line between them.
  37357. </p>
  37358. </dd>
  37359. <dt>&lsquo;<samp class="samp">cline</samp>&rsquo;</dt>
  37360. <dd><p>Draw a centered vertical line for each sample.
  37361. </p></dd>
  37362. </dl>
  37363. <p>Default value is <code class="code">point</code>.
  37364. </p>
  37365. </dd>
  37366. <dt><samp class="option">n</samp></dt>
  37367. <dd><p>Set the number of samples which are printed on the same column. A
  37368. larger value will decrease the frame rate. Must be a positive
  37369. integer. This option can be set only if the value for <var class="var">rate</var>
  37370. is not explicitly specified.
  37371. </p>
  37372. </dd>
  37373. <dt><samp class="option">rate, r</samp></dt>
  37374. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  37375. option <var class="var">n</var>. Default value is &quot;25&quot;.
  37376. </p>
  37377. </dd>
  37378. <dt><samp class="option">split_channels</samp></dt>
  37379. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  37380. </p>
  37381. </dd>
  37382. <dt><samp class="option">colors</samp></dt>
  37383. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  37384. </p>
  37385. </dd>
  37386. <dt><samp class="option">scale</samp></dt>
  37387. <dd><p>Set amplitude scale.
  37388. </p>
  37389. <p>Available values are:
  37390. </p><dl class="table">
  37391. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  37392. <dd><p>Linear.
  37393. </p>
  37394. </dd>
  37395. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  37396. <dd><p>Logarithmic.
  37397. </p>
  37398. </dd>
  37399. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  37400. <dd><p>Square root.
  37401. </p>
  37402. </dd>
  37403. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  37404. <dd><p>Cubic root.
  37405. </p></dd>
  37406. </dl>
  37407. <p>Default is linear.
  37408. </p>
  37409. </dd>
  37410. <dt><samp class="option">draw</samp></dt>
  37411. <dd><p>Set the draw mode. This is mostly useful to set for high <var class="var">n</var>.
  37412. </p>
  37413. <p>Available values are:
  37414. </p><dl class="table">
  37415. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  37416. <dd><p>Scale pixel values for each drawn sample.
  37417. </p>
  37418. </dd>
  37419. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  37420. <dd><p>Draw every sample directly.
  37421. </p></dd>
  37422. </dl>
  37423. <p>Default value is <code class="code">scale</code>.
  37424. </p></dd>
  37425. </dl>
  37426. <a name="Examples-180"></a>
  37427. <h4 class="subsection">20.29.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-180" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-180" aria-hidden="true">TOC</a></span></h4>
  37428. <ul class="itemize mark-bullet">
  37429. <li>Output the input file audio and the corresponding video representation
  37430. at the same time:
  37431. <div class="example">
  37432. <pre class="example-preformatted">amovie=a.mp3,asplit[out0],showwaves[out1]
  37433. </pre></div>
  37434. </li><li>Create a synthetic signal and show it with showwaves, forcing a
  37435. frame rate of 30 frames per second:
  37436. <div class="example">
  37437. <pre class="example-preformatted">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
  37438. </pre></div>
  37439. </li></ul>
  37440. <a name="showwavespic"></a>
  37441. <h3 class="section">20.30 showwavespic<span class="pull-right"><a class="anchor hidden-xs" href="#showwavespic" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-showwavespic" aria-hidden="true">TOC</a></span></h3>
  37442. <p>Convert input audio to a single video frame, representing the samples waves.
  37443. </p>
  37444. <p>The filter accepts the following options:
  37445. </p>
  37446. <dl class="table">
  37447. <dt><samp class="option">size, s</samp></dt>
  37448. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  37449. <a data-manual="ffmpeg-utils" href="ffmpeg-utils.html#video-size-syntax">&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  37450. Default value is <code class="code">600x240</code>.
  37451. </p>
  37452. </dd>
  37453. <dt><samp class="option">split_channels</samp></dt>
  37454. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  37455. </p>
  37456. </dd>
  37457. <dt><samp class="option">colors</samp></dt>
  37458. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  37459. </p>
  37460. </dd>
  37461. <dt><samp class="option">scale</samp></dt>
  37462. <dd><p>Set amplitude scale.
  37463. </p>
  37464. <p>Available values are:
  37465. </p><dl class="table">
  37466. <dt>&lsquo;<samp class="samp">lin</samp>&rsquo;</dt>
  37467. <dd><p>Linear.
  37468. </p>
  37469. </dd>
  37470. <dt>&lsquo;<samp class="samp">log</samp>&rsquo;</dt>
  37471. <dd><p>Logarithmic.
  37472. </p>
  37473. </dd>
  37474. <dt>&lsquo;<samp class="samp">sqrt</samp>&rsquo;</dt>
  37475. <dd><p>Square root.
  37476. </p>
  37477. </dd>
  37478. <dt>&lsquo;<samp class="samp">cbrt</samp>&rsquo;</dt>
  37479. <dd><p>Cubic root.
  37480. </p></dd>
  37481. </dl>
  37482. <p>Default is linear.
  37483. </p>
  37484. </dd>
  37485. <dt><samp class="option">draw</samp></dt>
  37486. <dd><p>Set the draw mode.
  37487. </p>
  37488. <p>Available values are:
  37489. </p><dl class="table">
  37490. <dt>&lsquo;<samp class="samp">scale</samp>&rsquo;</dt>
  37491. <dd><p>Scale pixel values for each drawn sample.
  37492. </p>
  37493. </dd>
  37494. <dt>&lsquo;<samp class="samp">full</samp>&rsquo;</dt>
  37495. <dd><p>Draw every sample directly.
  37496. </p></dd>
  37497. </dl>
  37498. <p>Default value is <code class="code">scale</code>.
  37499. </p>
  37500. </dd>
  37501. <dt><samp class="option">filter</samp></dt>
  37502. <dd><p>Set the filter mode.
  37503. </p>
  37504. <p>Available values are:
  37505. </p><dl class="table">
  37506. <dt>&lsquo;<samp class="samp">average</samp>&rsquo;</dt>
  37507. <dd><p>Use average samples values for each drawn sample.
  37508. </p>
  37509. </dd>
  37510. <dt>&lsquo;<samp class="samp">peak</samp>&rsquo;</dt>
  37511. <dd><p>Use peak samples values for each drawn sample.
  37512. </p></dd>
  37513. </dl>
  37514. <p>Default value is <code class="code">average</code>.
  37515. </p></dd>
  37516. </dl>
  37517. <a name="Examples-181"></a>
  37518. <h4 class="subsection">20.30.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-181" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-181" aria-hidden="true">TOC</a></span></h4>
  37519. <ul class="itemize mark-bullet">
  37520. <li>Extract a channel split representation of the wave form of a whole audio track
  37521. in a 1024x800 picture using <code class="command">ffmpeg</code>:
  37522. <div class="example">
  37523. <pre class="example-preformatted">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  37524. </pre></div>
  37525. </li></ul>
  37526. <a name="sidedata_002c-asidedata"></a>
  37527. <h3 class="section">20.31 sidedata, asidedata<span class="pull-right"><a class="anchor hidden-xs" href="#sidedata_002c-asidedata" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-sidedata_002c-asidedata" aria-hidden="true">TOC</a></span></h3>
  37528. <p>Delete frame side data, or select frames based on it.
  37529. </p>
  37530. <p>This filter accepts the following options:
  37531. </p>
  37532. <dl class="table">
  37533. <dt><samp class="option">mode</samp></dt>
  37534. <dd><p>Set mode of operation of the filter.
  37535. </p>
  37536. <p>Can be one of the following:
  37537. </p>
  37538. <dl class="table">
  37539. <dt>&lsquo;<samp class="samp">select</samp>&rsquo;</dt>
  37540. <dd><p>Select every frame with side data of <code class="code">type</code>.
  37541. </p>
  37542. </dd>
  37543. <dt>&lsquo;<samp class="samp">delete</samp>&rsquo;</dt>
  37544. <dd><p>Delete side data of <code class="code">type</code>. If <code class="code">type</code> is not set, delete all side
  37545. data in the frame.
  37546. </p>
  37547. </dd>
  37548. </dl>
  37549. </dd>
  37550. <dt><samp class="option">type</samp></dt>
  37551. <dd><p>Set side data type used with all modes. Must be set for <code class="code">select</code> mode.
  37552. </p>
  37553. <p>Possible values are:
  37554. </p>
  37555. <dl class="table">
  37556. <dt>&lsquo;<samp class="samp">PANSCAN</samp>&rsquo;</dt>
  37557. <dt>&lsquo;<samp class="samp">A53_CC</samp>&rsquo;</dt>
  37558. <dt>&lsquo;<samp class="samp">STEREO3D</samp>&rsquo;</dt>
  37559. <dt>&lsquo;<samp class="samp">MATRIXENCODING</samp>&rsquo;</dt>
  37560. <dt>&lsquo;<samp class="samp">DOWNMIX_INFO</samp>&rsquo;</dt>
  37561. <dt>&lsquo;<samp class="samp">REPLAYGAIN</samp>&rsquo;</dt>
  37562. <dt>&lsquo;<samp class="samp">DISPLAYMATRIX</samp>&rsquo;</dt>
  37563. <dt>&lsquo;<samp class="samp">AFD</samp>&rsquo;</dt>
  37564. <dt>&lsquo;<samp class="samp">MOTION_VECTORS</samp>&rsquo;</dt>
  37565. <dt>&lsquo;<samp class="samp">SKIP_SAMPLES</samp>&rsquo;</dt>
  37566. <dt>&lsquo;<samp class="samp">AUDIO_SERVICE_TYPE</samp>&rsquo;</dt>
  37567. <dt>&lsquo;<samp class="samp">MASTERING_DISPLAY_METADATA</samp>&rsquo;</dt>
  37568. <dt>&lsquo;<samp class="samp">GOP_TIMECODE</samp>&rsquo;</dt>
  37569. <dt>&lsquo;<samp class="samp">SPHERICAL</samp>&rsquo;</dt>
  37570. <dt>&lsquo;<samp class="samp">CONTENT_LIGHT_LEVEL</samp>&rsquo;</dt>
  37571. <dt>&lsquo;<samp class="samp">ICC_PROFILE</samp>&rsquo;</dt>
  37572. <dt>&lsquo;<samp class="samp">S12M_TIMECODE</samp>&rsquo;</dt>
  37573. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_PLUS</samp>&rsquo;</dt>
  37574. <dt>&lsquo;<samp class="samp">REGIONS_OF_INTEREST</samp>&rsquo;</dt>
  37575. <dt>&lsquo;<samp class="samp">VIDEO_ENC_PARAMS</samp>&rsquo;</dt>
  37576. <dt>&lsquo;<samp class="samp">SEI_UNREGISTERED</samp>&rsquo;</dt>
  37577. <dt>&lsquo;<samp class="samp">FILM_GRAIN_PARAMS</samp>&rsquo;</dt>
  37578. <dt>&lsquo;<samp class="samp">DETECTION_BOUNDING_BOXES</samp>&rsquo;</dt>
  37579. <dt>&lsquo;<samp class="samp">DETECTION_BBOXES</samp>&rsquo;</dt>
  37580. <dt>&lsquo;<samp class="samp">DOVI_RPU_BUFFER</samp>&rsquo;</dt>
  37581. <dt>&lsquo;<samp class="samp">DOVI_METADATA</samp>&rsquo;</dt>
  37582. <dt>&lsquo;<samp class="samp">DYNAMIC_HDR_VIVID</samp>&rsquo;</dt>
  37583. <dt>&lsquo;<samp class="samp">AMBIENT_VIEWING_ENVIRONMENT</samp>&rsquo;</dt>
  37584. <dt>&lsquo;<samp class="samp">VIDEO_HINT</samp>&rsquo;</dt>
  37585. </dl>
  37586. </dd>
  37587. </dl>
  37588. <a name="spectrumsynth"></a>
  37589. <h3 class="section">20.32 spectrumsynth<span class="pull-right"><a class="anchor hidden-xs" href="#spectrumsynth" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-spectrumsynth" aria-hidden="true">TOC</a></span></h3>
  37590. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  37591. magnitude across time and second represents phase across time.
  37592. The filter will transform from frequency domain as displayed in videos back
  37593. to time domain as presented in audio output.
  37594. </p>
  37595. <p>This filter is primarily created for reversing processed <a class="ref" href="#showspectrum">showspectrum</a>
  37596. filter outputs, but can synthesize sound from other spectrograms too.
  37597. But in such case results are going to be poor if the phase data is not
  37598. available, because in such cases phase data need to be recreated, usually
  37599. it&rsquo;s just recreated from random noise.
  37600. For best results use gray only output (<code class="code">channel</code> color mode in
  37601. <a class="ref" href="#showspectrum">showspectrum</a> filter) and <code class="code">log</code> scale for magnitude video and
  37602. <code class="code">lin</code> scale for phase video. To produce phase, for 2nd video, use
  37603. <code class="code">data</code> option. Inputs videos should generally use <code class="code">fullframe</code>
  37604. slide mode as that saves resources needed for decoding video.
  37605. </p>
  37606. <p>The filter accepts the following options:
  37607. </p>
  37608. <dl class="table">
  37609. <dt><samp class="option">sample_rate</samp></dt>
  37610. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  37611. spectrum was generated may differ.
  37612. </p>
  37613. </dd>
  37614. <dt><samp class="option">channels</samp></dt>
  37615. <dd><p>Set number of channels represented in input video spectrums.
  37616. </p>
  37617. </dd>
  37618. <dt><samp class="option">scale</samp></dt>
  37619. <dd><p>Set scale which was used when generating magnitude input spectrum.
  37620. Can be <code class="code">lin</code> or <code class="code">log</code>. Default is <code class="code">log</code>.
  37621. </p>
  37622. </dd>
  37623. <dt><samp class="option">slide</samp></dt>
  37624. <dd><p>Set slide which was used when generating inputs spectrums.
  37625. Can be <code class="code">replace</code>, <code class="code">scroll</code>, <code class="code">fullframe</code> or <code class="code">rscroll</code>.
  37626. Default is <code class="code">fullframe</code>.
  37627. </p>
  37628. </dd>
  37629. <dt><samp class="option">win_func</samp></dt>
  37630. <dd><p>Set window function used for resynthesis.
  37631. </p>
  37632. </dd>
  37633. <dt><samp class="option">overlap</samp></dt>
  37634. <dd><p>Set window overlap. In range <code class="code">[0, 1]</code>. Default is <code class="code">1</code>,
  37635. which means optimal overlap for selected window function will be picked.
  37636. </p>
  37637. </dd>
  37638. <dt><samp class="option">orientation</samp></dt>
  37639. <dd><p>Set orientation of input videos. Can be <code class="code">vertical</code> or <code class="code">horizontal</code>.
  37640. Default is <code class="code">vertical</code>.
  37641. </p></dd>
  37642. </dl>
  37643. <a name="Examples-182"></a>
  37644. <h4 class="subsection">20.32.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-182" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-182" aria-hidden="true">TOC</a></span></h4>
  37645. <ul class="itemize mark-bullet">
  37646. <li>First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  37647. then resynthesize videos back to audio with spectrumsynth:
  37648. <div class="example">
  37649. <pre class="example-preformatted">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
  37650. 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
  37651. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  37652. </pre></div>
  37653. </li></ul>
  37654. <a name="split_002c-asplit"></a>
  37655. <h3 class="section">20.33 split, asplit<span class="pull-right"><a class="anchor hidden-xs" href="#split_002c-asplit" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-split_002c-asplit" aria-hidden="true">TOC</a></span></h3>
  37656. <p>Split input into several identical outputs.
  37657. </p>
  37658. <p><code class="code">asplit</code> works with audio input, <code class="code">split</code> with video.
  37659. </p>
  37660. <p>The filter accepts a single parameter which specifies the number of outputs. If
  37661. unspecified, it defaults to 2.
  37662. </p>
  37663. <a name="Examples-183"></a>
  37664. <h4 class="subsection">20.33.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-183" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-183" aria-hidden="true">TOC</a></span></h4>
  37665. <ul class="itemize mark-bullet">
  37666. <li>Create two separate outputs from the same input:
  37667. <div class="example">
  37668. <pre class="example-preformatted">[in] split [out0][out1]
  37669. </pre></div>
  37670. </li><li>To create 3 or more outputs, you need to specify the number of
  37671. outputs, like in:
  37672. <div class="example">
  37673. <pre class="example-preformatted">[in] asplit=3 [out0][out1][out2]
  37674. </pre></div>
  37675. </li><li>Create two separate outputs from the same input, one cropped and
  37676. one padded:
  37677. <div class="example">
  37678. <pre class="example-preformatted">[in] split [splitout1][splitout2];
  37679. [splitout1] crop=100:100:0:0 [cropout];
  37680. [splitout2] pad=200:200:100:100 [padout];
  37681. </pre></div>
  37682. </li><li>Create 5 copies of the input audio with <code class="command">ffmpeg</code>:
  37683. <div class="example">
  37684. <pre class="example-preformatted">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  37685. </pre></div>
  37686. </li></ul>
  37687. <a name="zmq_002c-azmq"></a>
  37688. <h3 class="section">20.34 zmq, azmq<span class="pull-right"><a class="anchor hidden-xs" href="#zmq_002c-azmq" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-zmq_002c-azmq" aria-hidden="true">TOC</a></span></h3>
  37689. <p>Receive commands sent through a libzmq client, and forward them to
  37690. filters in the filtergraph.
  37691. </p>
  37692. <p><code class="code">zmq</code> and <code class="code">azmq</code> work as a pass-through filters. <code class="code">zmq</code>
  37693. must be inserted between two video filters, <code class="code">azmq</code> between two
  37694. audio filters. Both are capable to send messages to any filter type.
  37695. </p>
  37696. <p>To enable these filters you need to install the libzmq library and
  37697. headers and configure FFmpeg with <code class="code">--enable-libzmq</code>.
  37698. </p>
  37699. <p>For more information about libzmq see:
  37700. <a class="url" href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  37701. </p>
  37702. <p>The <code class="code">zmq</code> and <code class="code">azmq</code> filters work as a libzmq server, which
  37703. receives messages sent through a network interface defined by the
  37704. <samp class="option">bind_address</samp> (or the abbreviation &quot;<samp class="option">b</samp>&quot;) option.
  37705. Default value of this option is <samp class="file">tcp://localhost:5555</samp>. You may
  37706. want to alter this value to your needs, but do not forget to escape any
  37707. &rsquo;:&rsquo; signs (see <a class="ref" href="#filtergraph-escaping">filtergraph escaping</a>).
  37708. </p>
  37709. <p>The received message must be in the form:
  37710. </p><div class="example">
  37711. <pre class="example-preformatted"><var class="var">TARGET</var> <var class="var">COMMAND</var> [<var class="var">ARG</var>]
  37712. </pre></div>
  37713. <p><var class="var">TARGET</var> specifies the target of the command, usually the name of
  37714. the filter class or a specific filter instance name. The default
  37715. filter instance name uses the pattern &lsquo;<samp class="samp">Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  37716. but you can override this by using the &lsquo;<samp class="samp">filter_name@id</samp>&rsquo; syntax
  37717. (see <a class="ref" href="#Filtergraph-syntax">Filtergraph syntax</a>).
  37718. </p>
  37719. <p><var class="var">COMMAND</var> specifies the name of the command for the target filter.
  37720. </p>
  37721. <p><var class="var">ARG</var> is optional and specifies the optional argument list for the
  37722. given <var class="var">COMMAND</var>.
  37723. </p>
  37724. <p>Upon reception, the message is processed and the corresponding command
  37725. is injected into the filtergraph. Depending on the result, the filter
  37726. will send a reply to the client, adopting the format:
  37727. </p><div class="example">
  37728. <pre class="example-preformatted"><var class="var">ERROR_CODE</var> <var class="var">ERROR_REASON</var>
  37729. <var class="var">MESSAGE</var>
  37730. </pre></div>
  37731. <p><var class="var">MESSAGE</var> is optional.
  37732. </p>
  37733. <a name="Examples-184"></a>
  37734. <h4 class="subsection">20.34.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-184" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-184" aria-hidden="true">TOC</a></span></h4>
  37735. <p>Look at <samp class="file">tools/zmqsend</samp> for an example of a zmq client which can
  37736. be used to send commands processed by these filters.
  37737. </p>
  37738. <p>Consider the following filtergraph generated by <code class="command">ffplay</code>.
  37739. In this example the last overlay filter has an instance name. All other
  37740. filters will have default instance names.
  37741. </p>
  37742. <div class="example">
  37743. <pre class="example-preformatted">ffplay -dumpgraph 1 -f lavfi &quot;
  37744. color=s=100x100:c=red [l];
  37745. color=s=100x100:c=blue [r];
  37746. nullsrc=s=200x100, zmq [bg];
  37747. [bg][l] overlay [bg+l];
  37748. [bg+l][r] overlay@my=x=100 &quot;
  37749. </pre></div>
  37750. <p>To change the color of the left side of the video, the following
  37751. command can be used:
  37752. </p><div class="example">
  37753. <pre class="example-preformatted">echo Parsed_color_0 c yellow | tools/zmqsend
  37754. </pre></div>
  37755. <p>To change the right side:
  37756. </p><div class="example">
  37757. <pre class="example-preformatted">echo Parsed_color_1 c pink | tools/zmqsend
  37758. </pre></div>
  37759. <p>To change the position of the right side:
  37760. </p><div class="example">
  37761. <pre class="example-preformatted">echo overlay@my x 150 | tools/zmqsend
  37762. </pre></div>
  37763. <a name="Multimedia-Sources"></a>
  37764. <h2 class="chapter">21 Multimedia Sources<span class="pull-right"><a class="anchor hidden-xs" href="#Multimedia-Sources" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Multimedia-Sources" aria-hidden="true">TOC</a></span></h2>
  37765. <p>Below is a description of the currently available multimedia sources.
  37766. </p>
  37767. <a name="amovie"></a>
  37768. <h3 class="section">21.1 amovie<span class="pull-right"><a class="anchor hidden-xs" href="#amovie" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-amovie" aria-hidden="true">TOC</a></span></h3>
  37769. <p>This is the same as <a class="ref" href="#movie">movie</a> source, except it selects an audio
  37770. stream by default.
  37771. </p>
  37772. <a name="avsynctest"></a>
  37773. <h3 class="section">21.2 avsynctest<span class="pull-right"><a class="anchor hidden-xs" href="#avsynctest" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-avsynctest" aria-hidden="true">TOC</a></span></h3>
  37774. <p>Generate an Audio/Video Sync Test.
  37775. </p>
  37776. <p>Generated stream periodically shows flash video frame and emits beep in audio.
  37777. Useful to inspect A/V sync issues.
  37778. </p>
  37779. <p>It accepts the following options:
  37780. </p>
  37781. <dl class="table">
  37782. <dt><samp class="option">size, s</samp></dt>
  37783. <dd><p>Set output video size. Default value is <code class="code">hd720</code>.
  37784. </p>
  37785. </dd>
  37786. <dt><samp class="option">framerate, fr</samp></dt>
  37787. <dd><p>Set output video frame rate. Default value is <code class="code">30</code>.
  37788. </p>
  37789. </dd>
  37790. <dt><samp class="option">samplerate, sr</samp></dt>
  37791. <dd><p>Set output audio sample rate. Default value is <code class="code">44100</code>.
  37792. </p>
  37793. </dd>
  37794. <dt><samp class="option">amplitude, a</samp></dt>
  37795. <dd><p>Set output audio beep amplitude. Default value is <code class="code">0.7</code>.
  37796. </p>
  37797. </dd>
  37798. <dt><samp class="option">period, p</samp></dt>
  37799. <dd><p>Set output audio beep period in seconds. Default value is <code class="code">3</code>.
  37800. </p>
  37801. </dd>
  37802. <dt><samp class="option">delay, dl</samp></dt>
  37803. <dd><p>Set output video flash delay in number of frames. Default value is <code class="code">0</code>.
  37804. </p>
  37805. </dd>
  37806. <dt><samp class="option">cycle, c</samp></dt>
  37807. <dd><p>Enable cycling of video delays, by default is disabled.
  37808. </p>
  37809. </dd>
  37810. <dt><samp class="option">duration, d</samp></dt>
  37811. <dd><p>Set stream output duration. By default duration is unlimited.
  37812. </p>
  37813. </dd>
  37814. <dt><samp class="option">fg, bg, ag</samp></dt>
  37815. <dd><p>Set foreground/background/additional color.
  37816. </p></dd>
  37817. </dl>
  37818. <a name="Commands-164"></a>
  37819. <h4 class="subsection">21.2.1 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-164" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-164" aria-hidden="true">TOC</a></span></h4>
  37820. <p>This source supports the some above options as <a class="ref" href="#commands">commands</a>.
  37821. </p>
  37822. <a class="anchor" id="movie"></a><a name="movie-1"></a>
  37823. <h3 class="section">21.3 movie<span class="pull-right"><a class="anchor hidden-xs" href="#movie-1" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-movie-1" aria-hidden="true">TOC</a></span></h3>
  37824. <p>Read audio and/or video stream(s) from a movie container.
  37825. </p>
  37826. <p>It accepts the following parameters:
  37827. </p>
  37828. <dl class="table">
  37829. <dt><samp class="option">filename</samp></dt>
  37830. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  37831. device or a stream accessed through some protocol).
  37832. </p>
  37833. </dd>
  37834. <dt><samp class="option">format_name, f</samp></dt>
  37835. <dd><p>Specifies the format assumed for the movie to read, and can be either
  37836. the name of a container or an input device. If not specified, the
  37837. format is guessed from <var class="var">movie_name</var> or by probing.
  37838. </p>
  37839. </dd>
  37840. <dt><samp class="option">seek_point, sp</samp></dt>
  37841. <dd><p>Specifies the seek point in seconds. The frames will be output
  37842. starting from this seek point. The parameter is evaluated with
  37843. <code class="code">av_strtod</code>, so the numerical value may be suffixed by an IS
  37844. postfix. The default value is &quot;0&quot;.
  37845. </p>
  37846. </dd>
  37847. <dt><samp class="option">streams, s</samp></dt>
  37848. <dd><p>Specifies the streams to read. Several streams can be specified,
  37849. separated by &quot;+&quot;. The source will then have as many outputs, in the
  37850. same order. The syntax is explained in the <a data-manual="ffmpeg" href="ffmpeg.html#Stream-specifiers">&quot;Stream specifiers&quot;
  37851. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  37852. respectively the default (best suited) video and audio stream. Default
  37853. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  37854. </p>
  37855. </dd>
  37856. <dt><samp class="option">stream_index, si</samp></dt>
  37857. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  37858. the most suitable video stream will be automatically selected. The default
  37859. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  37860. audio instead of video.
  37861. </p>
  37862. </dd>
  37863. <dt><samp class="option">loop</samp></dt>
  37864. <dd><p>Specifies how many times to read the stream in sequence.
  37865. If the value is 0, the stream will be looped infinitely.
  37866. Default value is &quot;1&quot;.
  37867. </p>
  37868. <p>Note that when the movie is looped the source timestamps are not
  37869. changed, so it will generate non monotonically increasing timestamps.
  37870. </p>
  37871. </dd>
  37872. <dt><samp class="option">discontinuity</samp></dt>
  37873. <dd><p>Specifies the time difference between frames above which the point is
  37874. considered a timestamp discontinuity which is removed by adjusting the later
  37875. timestamps.
  37876. </p>
  37877. </dd>
  37878. <dt><samp class="option">dec_threads</samp></dt>
  37879. <dd><p>Specifies the number of threads for decoding
  37880. </p>
  37881. </dd>
  37882. <dt><samp class="option">format_opts</samp></dt>
  37883. <dd><p>Specify format options for the opened file. Format options can be specified
  37884. as a list of <var class="var">key</var>=<var class="var">value</var> pairs separated by &rsquo;:&rsquo;. The following example
  37885. shows how to add protocol_whitelist and protocol_blacklist options:
  37886. </p><div class="example">
  37887. <pre class="example-preformatted">ffplay -f lavfi
  37888. &quot;movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'&quot;
  37889. </pre></div>
  37890. </dd>
  37891. </dl>
  37892. <p>It allows overlaying a second video on top of the main input of
  37893. a filtergraph, as shown in this graph:
  37894. </p><div class="example">
  37895. <pre class="example-preformatted">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  37896. ^
  37897. |
  37898. movie --&gt; scale--&gt; deltapts1 -------+
  37899. </pre></div>
  37900. <a name="Examples-185"></a>
  37901. <h4 class="subsection">21.3.1 Examples<span class="pull-right"><a class="anchor hidden-xs" href="#Examples-185" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Examples-185" aria-hidden="true">TOC</a></span></h4>
  37902. <ul class="itemize mark-bullet">
  37903. <li>Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  37904. on top of the input labelled &quot;in&quot;:
  37905. <div class="example">
  37906. <pre class="example-preformatted">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  37907. [in] setpts=PTS-STARTPTS [main];
  37908. [main][over] overlay=16:16 [out]
  37909. </pre></div>
  37910. </li><li>Read from a video4linux2 device, and overlay it on top of the input
  37911. labelled &quot;in&quot;:
  37912. <div class="example">
  37913. <pre class="example-preformatted">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  37914. [in] setpts=PTS-STARTPTS [main];
  37915. [main][over] overlay=16:16 [out]
  37916. </pre></div>
  37917. </li><li>Read the first video stream and the audio stream with id 0x81 from
  37918. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  37919. connected to the pad named &quot;audio&quot;:
  37920. <div class="example">
  37921. <pre class="example-preformatted">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  37922. </pre></div>
  37923. </li></ul>
  37924. <a name="Commands-165"></a>
  37925. <h4 class="subsection">21.3.2 Commands<span class="pull-right"><a class="anchor hidden-xs" href="#Commands-165" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Commands-165" aria-hidden="true">TOC</a></span></h4>
  37926. <p>Both movie and amovie support the following commands:
  37927. </p><dl class="table">
  37928. <dt><samp class="option">seek</samp></dt>
  37929. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  37930. The syntax is: seek <var class="var">stream_index</var>|<var class="var">timestamp</var>|<var class="var">flags</var>
  37931. </p><ul class="itemize mark-bullet">
  37932. <li><var class="var">stream_index</var>: If stream_index is -1, a default
  37933. stream is selected, and <var class="var">timestamp</var> is automatically converted
  37934. from AV_TIME_BASE units to the stream specific time_base.
  37935. </li><li><var class="var">timestamp</var>: Timestamp in AVStream.time_base units
  37936. or, if no stream is specified, in AV_TIME_BASE units.
  37937. </li><li><var class="var">flags</var>: Flags which select direction and seeking mode.
  37938. </li></ul>
  37939. </dd>
  37940. <dt><samp class="option">get_duration</samp></dt>
  37941. <dd><p>Get movie duration in AV_TIME_BASE units.
  37942. </p>
  37943. </dd>
  37944. </dl>
  37945. <a name="See-Also"></a>
  37946. <h2 class="chapter">22 See Also<span class="pull-right"><a class="anchor hidden-xs" href="#See-Also" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-See-Also" aria-hidden="true">TOC</a></span></h2>
  37947. <p><a class="url" href="ffmpeg.html">ffmpeg</a>, <a class="url" href="ffplay.html">ffplay</a>, <a class="url" href="ffprobe.html">ffprobe</a>,
  37948. <a class="url" href="libavfilter.html">libavfilter</a>
  37949. </p>
  37950. <a name="Authors"></a>
  37951. <h2 class="chapter">23 Authors<span class="pull-right"><a class="anchor hidden-xs" href="#Authors" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Authors" aria-hidden="true">TOC</a></span></h2>
  37952. <p>The FFmpeg developers.
  37953. </p>
  37954. <p>For details about the authorship, see the Git history of the project
  37955. (https://git.ffmpeg.org/ffmpeg), e.g. by typing the command
  37956. <code class="command">git log</code> in the FFmpeg source directory, or browsing the
  37957. online repository at <a class="url" href="https://git.ffmpeg.org/ffmpeg">https://git.ffmpeg.org/ffmpeg</a>.
  37958. </p>
  37959. <p>Maintainers for the specific components are listed in the file
  37960. <samp class="file">MAINTAINERS</samp> in the source code tree.
  37961. </p>
  37962. <p style="font-size: small;">
  37963. This document was generated using <a class="uref" href="https://www.gnu.org/software/texinfo/"><em class="emph">makeinfo</em></a>.
  37964. </p>
  37965. </div>
  37966. </body>
  37967. </html>