ffmpeg-filters.html 1.2 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330
  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 6.7, http://www.gnu.org/software/texinfo/ -->
  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. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <span id="SEC_Contents"></span>
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-Description" href="#Description">1 Description</a></li>
  26. <li><a id="toc-Filtering-Introduction" href="#Filtering-Introduction">2 Filtering Introduction</a></li>
  27. <li><a id="toc-graph2dot" href="#graph2dot">3 graph2dot</a></li>
  28. <li><a id="toc-Filtergraph-description" href="#Filtergraph-description">4 Filtergraph description</a>
  29. <ul class="no-bullet">
  30. <li><a id="toc-Filtergraph-syntax-1" href="#Filtergraph-syntax-1">4.1 Filtergraph syntax</a></li>
  31. <li><a id="toc-Notes-on-filtergraph-escaping" href="#Notes-on-filtergraph-escaping">4.2 Notes on filtergraph escaping</a></li>
  32. </ul></li>
  33. <li><a id="toc-Timeline-editing" href="#Timeline-editing">5 Timeline editing</a></li>
  34. <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>
  35. <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>
  36. <li><a id="toc-Audio-Filters" href="#Audio-Filters">8 Audio Filters</a>
  37. <ul class="no-bullet">
  38. <li><a id="toc-acompressor" href="#acompressor">8.1 acompressor</a>
  39. <ul class="no-bullet">
  40. <li><a id="toc-Commands" href="#Commands">8.1.1 Commands</a></li>
  41. </ul></li>
  42. <li><a id="toc-acontrast" href="#acontrast">8.2 acontrast</a></li>
  43. <li><a id="toc-acopy" href="#acopy">8.3 acopy</a></li>
  44. <li><a id="toc-acrossfade" href="#acrossfade">8.4 acrossfade</a>
  45. <ul class="no-bullet">
  46. <li><a id="toc-Examples" href="#Examples">8.4.1 Examples</a></li>
  47. </ul></li>
  48. <li><a id="toc-acrossover" href="#acrossover">8.5 acrossover</a>
  49. <ul class="no-bullet">
  50. <li><a id="toc-Examples-1" href="#Examples-1">8.5.1 Examples</a></li>
  51. </ul></li>
  52. <li><a id="toc-acrusher" href="#acrusher">8.6 acrusher</a>
  53. <ul class="no-bullet">
  54. <li><a id="toc-Commands-1" href="#Commands-1">8.6.1 Commands</a></li>
  55. </ul></li>
  56. <li><a id="toc-acue" href="#acue">8.7 acue</a></li>
  57. <li><a id="toc-adeclick" href="#adeclick">8.8 adeclick</a></li>
  58. <li><a id="toc-adeclip" href="#adeclip">8.9 adeclip</a></li>
  59. <li><a id="toc-adelay" href="#adelay">8.10 adelay</a>
  60. <ul class="no-bullet">
  61. <li><a id="toc-Examples-2" href="#Examples-2">8.10.1 Examples</a></li>
  62. </ul></li>
  63. <li><a id="toc-adenorm" href="#adenorm">8.11 adenorm</a>
  64. <ul class="no-bullet">
  65. <li><a id="toc-Commands-2" href="#Commands-2">8.11.1 Commands</a></li>
  66. </ul></li>
  67. <li><a id="toc-aderivative_002c-aintegral" href="#aderivative_002c-aintegral">8.12 aderivative, aintegral</a></li>
  68. <li><a id="toc-aecho" href="#aecho">8.13 aecho</a>
  69. <ul class="no-bullet">
  70. <li><a id="toc-Examples-3" href="#Examples-3">8.13.1 Examples</a></li>
  71. </ul></li>
  72. <li><a id="toc-aemphasis" href="#aemphasis">8.14 aemphasis</a>
  73. <ul class="no-bullet">
  74. <li><a id="toc-Commands-3" href="#Commands-3">8.14.1 Commands</a></li>
  75. </ul></li>
  76. <li><a id="toc-aeval" href="#aeval">8.15 aeval</a>
  77. <ul class="no-bullet">
  78. <li><a id="toc-Examples-4" href="#Examples-4">8.15.1 Examples</a></li>
  79. </ul></li>
  80. <li><a id="toc-aexciter" href="#aexciter">8.16 aexciter</a>
  81. <ul class="no-bullet">
  82. <li><a id="toc-Commands-4" href="#Commands-4">8.16.1 Commands</a></li>
  83. </ul></li>
  84. <li><a id="toc-afade-1" href="#afade-1">8.17 afade</a>
  85. <ul class="no-bullet">
  86. <li><a id="toc-Commands-5" href="#Commands-5">8.17.1 Commands</a></li>
  87. <li><a id="toc-Examples-5" href="#Examples-5">8.17.2 Examples</a></li>
  88. </ul></li>
  89. <li><a id="toc-afftdn" href="#afftdn">8.18 afftdn</a>
  90. <ul class="no-bullet">
  91. <li><a id="toc-Commands-6" href="#Commands-6">8.18.1 Commands</a></li>
  92. </ul></li>
  93. <li><a id="toc-afftfilt" href="#afftfilt">8.19 afftfilt</a>
  94. <ul class="no-bullet">
  95. <li><a id="toc-Examples-6" href="#Examples-6">8.19.1 Examples</a></li>
  96. </ul></li>
  97. <li><a id="toc-afir-1" href="#afir-1">8.20 afir</a>
  98. <ul class="no-bullet">
  99. <li><a id="toc-Examples-7" href="#Examples-7">8.20.1 Examples</a></li>
  100. </ul></li>
  101. <li><a id="toc-aformat-1" href="#aformat-1">8.21 aformat</a></li>
  102. <li><a id="toc-afreqshift" href="#afreqshift">8.22 afreqshift</a>
  103. <ul class="no-bullet">
  104. <li><a id="toc-Commands-7" href="#Commands-7">8.22.1 Commands</a></li>
  105. </ul></li>
  106. <li><a id="toc-agate" href="#agate">8.23 agate</a>
  107. <ul class="no-bullet">
  108. <li><a id="toc-Commands-8" href="#Commands-8">8.23.1 Commands</a></li>
  109. </ul></li>
  110. <li><a id="toc-aiir" href="#aiir">8.24 aiir</a>
  111. <ul class="no-bullet">
  112. <li><a id="toc-Examples-8" href="#Examples-8">8.24.1 Examples</a></li>
  113. </ul></li>
  114. <li><a id="toc-alimiter" href="#alimiter">8.25 alimiter</a></li>
  115. <li><a id="toc-allpass" href="#allpass">8.26 allpass</a>
  116. <ul class="no-bullet">
  117. <li><a id="toc-Commands-9" href="#Commands-9">8.26.1 Commands</a></li>
  118. </ul></li>
  119. <li><a id="toc-aloop" href="#aloop">8.27 aloop</a></li>
  120. <li><a id="toc-amerge-1" href="#amerge-1">8.28 amerge</a>
  121. <ul class="no-bullet">
  122. <li><a id="toc-Examples-9" href="#Examples-9">8.28.1 Examples</a></li>
  123. </ul></li>
  124. <li><a id="toc-amix" href="#amix">8.29 amix</a>
  125. <ul class="no-bullet">
  126. <li><a id="toc-Commands-10" href="#Commands-10">8.29.1 Commands</a></li>
  127. </ul></li>
  128. <li><a id="toc-amultiply" href="#amultiply">8.30 amultiply</a></li>
  129. <li><a id="toc-anequalizer" href="#anequalizer">8.31 anequalizer</a>
  130. <ul class="no-bullet">
  131. <li><a id="toc-Examples-10" href="#Examples-10">8.31.1 Examples</a></li>
  132. <li><a id="toc-Commands-11" href="#Commands-11">8.31.2 Commands</a></li>
  133. </ul></li>
  134. <li><a id="toc-anlmdn" href="#anlmdn">8.32 anlmdn</a>
  135. <ul class="no-bullet">
  136. <li><a id="toc-Commands-12" href="#Commands-12">8.32.1 Commands</a></li>
  137. </ul></li>
  138. <li><a id="toc-anlms" href="#anlms">8.33 anlms</a>
  139. <ul class="no-bullet">
  140. <li><a id="toc-Examples-11" href="#Examples-11">8.33.1 Examples</a></li>
  141. <li><a id="toc-Commands-13" href="#Commands-13">8.33.2 Commands</a></li>
  142. </ul></li>
  143. <li><a id="toc-anull" href="#anull">8.34 anull</a></li>
  144. <li><a id="toc-apad" href="#apad">8.35 apad</a>
  145. <ul class="no-bullet">
  146. <li><a id="toc-Examples-12" href="#Examples-12">8.35.1 Examples</a></li>
  147. </ul></li>
  148. <li><a id="toc-aphaser" href="#aphaser">8.36 aphaser</a></li>
  149. <li><a id="toc-aphaseshift" href="#aphaseshift">8.37 aphaseshift</a>
  150. <ul class="no-bullet">
  151. <li><a id="toc-Commands-14" href="#Commands-14">8.37.1 Commands</a></li>
  152. </ul></li>
  153. <li><a id="toc-apulsator" href="#apulsator">8.38 apulsator</a></li>
  154. <li><a id="toc-aresample-1" href="#aresample-1">8.39 aresample</a>
  155. <ul class="no-bullet">
  156. <li><a id="toc-Examples-13" href="#Examples-13">8.39.1 Examples</a></li>
  157. </ul></li>
  158. <li><a id="toc-areverse" href="#areverse">8.40 areverse</a>
  159. <ul class="no-bullet">
  160. <li><a id="toc-Examples-14" href="#Examples-14">8.40.1 Examples</a></li>
  161. </ul></li>
  162. <li><a id="toc-arnndn" href="#arnndn">8.41 arnndn</a>
  163. <ul class="no-bullet">
  164. <li><a id="toc-Commands-15" href="#Commands-15">8.41.1 Commands</a></li>
  165. </ul></li>
  166. <li><a id="toc-asetnsamples" href="#asetnsamples">8.42 asetnsamples</a></li>
  167. <li><a id="toc-asetrate" href="#asetrate">8.43 asetrate</a></li>
  168. <li><a id="toc-ashowinfo" href="#ashowinfo">8.44 ashowinfo</a></li>
  169. <li><a id="toc-asoftclip" href="#asoftclip">8.45 asoftclip</a>
  170. <ul class="no-bullet">
  171. <li><a id="toc-Commands-16" href="#Commands-16">8.45.1 Commands</a></li>
  172. </ul></li>
  173. <li><a id="toc-asr" href="#asr">8.46 asr</a></li>
  174. <li><a id="toc-astats-1" href="#astats-1">8.47 astats</a></li>
  175. <li><a id="toc-asubboost" href="#asubboost">8.48 asubboost</a>
  176. <ul class="no-bullet">
  177. <li><a id="toc-Commands-17" href="#Commands-17">8.48.1 Commands</a></li>
  178. </ul></li>
  179. <li><a id="toc-asubcut" href="#asubcut">8.49 asubcut</a>
  180. <ul class="no-bullet">
  181. <li><a id="toc-Commands-18" href="#Commands-18">8.49.1 Commands</a></li>
  182. </ul></li>
  183. <li><a id="toc-asupercut" href="#asupercut">8.50 asupercut</a>
  184. <ul class="no-bullet">
  185. <li><a id="toc-Commands-19" href="#Commands-19">8.50.1 Commands</a></li>
  186. </ul></li>
  187. <li><a id="toc-asuperpass" href="#asuperpass">8.51 asuperpass</a>
  188. <ul class="no-bullet">
  189. <li><a id="toc-Commands-20" href="#Commands-20">8.51.1 Commands</a></li>
  190. </ul></li>
  191. <li><a id="toc-asuperstop" href="#asuperstop">8.52 asuperstop</a>
  192. <ul class="no-bullet">
  193. <li><a id="toc-Commands-21" href="#Commands-21">8.52.1 Commands</a></li>
  194. </ul></li>
  195. <li><a id="toc-atempo" href="#atempo">8.53 atempo</a>
  196. <ul class="no-bullet">
  197. <li><a id="toc-Examples-15" href="#Examples-15">8.53.1 Examples</a></li>
  198. <li><a id="toc-Commands-22" href="#Commands-22">8.53.2 Commands</a></li>
  199. </ul></li>
  200. <li><a id="toc-atrim" href="#atrim">8.54 atrim</a></li>
  201. <li><a id="toc-axcorrelate" href="#axcorrelate">8.55 axcorrelate</a>
  202. <ul class="no-bullet">
  203. <li><a id="toc-Examples-16" href="#Examples-16">8.55.1 Examples</a></li>
  204. </ul></li>
  205. <li><a id="toc-bandpass" href="#bandpass">8.56 bandpass</a>
  206. <ul class="no-bullet">
  207. <li><a id="toc-Commands-23" href="#Commands-23">8.56.1 Commands</a></li>
  208. </ul></li>
  209. <li><a id="toc-bandreject" href="#bandreject">8.57 bandreject</a>
  210. <ul class="no-bullet">
  211. <li><a id="toc-Commands-24" href="#Commands-24">8.57.1 Commands</a></li>
  212. </ul></li>
  213. <li><a id="toc-bass_002c-lowshelf" href="#bass_002c-lowshelf">8.58 bass, lowshelf</a>
  214. <ul class="no-bullet">
  215. <li><a id="toc-Commands-25" href="#Commands-25">8.58.1 Commands</a></li>
  216. </ul></li>
  217. <li><a id="toc-biquad" href="#biquad">8.59 biquad</a>
  218. <ul class="no-bullet">
  219. <li><a id="toc-Commands-26" href="#Commands-26">8.59.1 Commands</a></li>
  220. </ul></li>
  221. <li><a id="toc-bs2b" href="#bs2b">8.60 bs2b</a></li>
  222. <li><a id="toc-channelmap" href="#channelmap">8.61 channelmap</a>
  223. <ul class="no-bullet">
  224. <li><a id="toc-Examples-17" href="#Examples-17">8.61.1 Examples</a></li>
  225. </ul></li>
  226. <li><a id="toc-channelsplit" href="#channelsplit">8.62 channelsplit</a>
  227. <ul class="no-bullet">
  228. <li><a id="toc-Examples-18" href="#Examples-18">8.62.1 Examples</a></li>
  229. </ul></li>
  230. <li><a id="toc-chorus" href="#chorus">8.63 chorus</a>
  231. <ul class="no-bullet">
  232. <li><a id="toc-Examples-19" href="#Examples-19">8.63.1 Examples</a></li>
  233. </ul></li>
  234. <li><a id="toc-compand" href="#compand">8.64 compand</a>
  235. <ul class="no-bullet">
  236. <li><a id="toc-Examples-20" href="#Examples-20">8.64.1 Examples</a></li>
  237. </ul></li>
  238. <li><a id="toc-compensationdelay" href="#compensationdelay">8.65 compensationdelay</a></li>
  239. <li><a id="toc-crossfeed" href="#crossfeed">8.66 crossfeed</a>
  240. <ul class="no-bullet">
  241. <li><a id="toc-Commands-27" href="#Commands-27">8.66.1 Commands</a></li>
  242. </ul></li>
  243. <li><a id="toc-crystalizer" href="#crystalizer">8.67 crystalizer</a>
  244. <ul class="no-bullet">
  245. <li><a id="toc-Commands-28" href="#Commands-28">8.67.1 Commands</a></li>
  246. </ul></li>
  247. <li><a id="toc-dcshift" href="#dcshift">8.68 dcshift</a></li>
  248. <li><a id="toc-deesser" href="#deesser">8.69 deesser</a></li>
  249. <li><a id="toc-drmeter" href="#drmeter">8.70 drmeter</a></li>
  250. <li><a id="toc-dynaudnorm" href="#dynaudnorm">8.71 dynaudnorm</a>
  251. <ul class="no-bullet">
  252. <li><a id="toc-Commands-29" href="#Commands-29">8.71.1 Commands</a></li>
  253. </ul></li>
  254. <li><a id="toc-earwax" href="#earwax">8.72 earwax</a></li>
  255. <li><a id="toc-equalizer" href="#equalizer">8.73 equalizer</a>
  256. <ul class="no-bullet">
  257. <li><a id="toc-Examples-21" href="#Examples-21">8.73.1 Examples</a></li>
  258. <li><a id="toc-Commands-30" href="#Commands-30">8.73.2 Commands</a></li>
  259. </ul></li>
  260. <li><a id="toc-extrastereo" href="#extrastereo">8.74 extrastereo</a>
  261. <ul class="no-bullet">
  262. <li><a id="toc-Commands-31" href="#Commands-31">8.74.1 Commands</a></li>
  263. </ul></li>
  264. <li><a id="toc-firequalizer" href="#firequalizer">8.75 firequalizer</a>
  265. <ul class="no-bullet">
  266. <li><a id="toc-Examples-22" href="#Examples-22">8.75.1 Examples</a></li>
  267. </ul></li>
  268. <li><a id="toc-flanger" href="#flanger">8.76 flanger</a></li>
  269. <li><a id="toc-haas" href="#haas">8.77 haas</a></li>
  270. <li><a id="toc-hdcd" href="#hdcd">8.78 hdcd</a></li>
  271. <li><a id="toc-headphone" href="#headphone">8.79 headphone</a>
  272. <ul class="no-bullet">
  273. <li><a id="toc-Examples-23" href="#Examples-23">8.79.1 Examples</a></li>
  274. </ul></li>
  275. <li><a id="toc-highpass" href="#highpass">8.80 highpass</a>
  276. <ul class="no-bullet">
  277. <li><a id="toc-Commands-32" href="#Commands-32">8.80.1 Commands</a></li>
  278. </ul></li>
  279. <li><a id="toc-join" href="#join">8.81 join</a></li>
  280. <li><a id="toc-ladspa" href="#ladspa">8.82 ladspa</a>
  281. <ul class="no-bullet">
  282. <li><a id="toc-Examples-24" href="#Examples-24">8.82.1 Examples</a></li>
  283. <li><a id="toc-Commands-33" href="#Commands-33">8.82.2 Commands</a></li>
  284. </ul></li>
  285. <li><a id="toc-loudnorm" href="#loudnorm">8.83 loudnorm</a></li>
  286. <li><a id="toc-lowpass" href="#lowpass">8.84 lowpass</a>
  287. <ul class="no-bullet">
  288. <li><a id="toc-Examples-25" href="#Examples-25">8.84.1 Examples</a></li>
  289. <li><a id="toc-Commands-34" href="#Commands-34">8.84.2 Commands</a></li>
  290. </ul></li>
  291. <li><a id="toc-lv2" href="#lv2">8.85 lv2</a>
  292. <ul class="no-bullet">
  293. <li><a id="toc-Examples-26" href="#Examples-26">8.85.1 Examples</a></li>
  294. </ul></li>
  295. <li><a id="toc-mcompand" href="#mcompand">8.86 mcompand</a></li>
  296. <li><a id="toc-pan-1" href="#pan-1">8.87 pan</a>
  297. <ul class="no-bullet">
  298. <li><a id="toc-Mixing-examples" href="#Mixing-examples">8.87.1 Mixing examples</a></li>
  299. <li><a id="toc-Remapping-examples" href="#Remapping-examples">8.87.2 Remapping examples</a></li>
  300. </ul></li>
  301. <li><a id="toc-replaygain" href="#replaygain">8.88 replaygain</a></li>
  302. <li><a id="toc-resample" href="#resample">8.89 resample</a></li>
  303. <li><a id="toc-rubberband" href="#rubberband">8.90 rubberband</a>
  304. <ul class="no-bullet">
  305. <li><a id="toc-Commands-35" href="#Commands-35">8.90.1 Commands</a></li>
  306. </ul></li>
  307. <li><a id="toc-sidechaincompress" href="#sidechaincompress">8.91 sidechaincompress</a>
  308. <ul class="no-bullet">
  309. <li><a id="toc-Commands-36" href="#Commands-36">8.91.1 Commands</a></li>
  310. <li><a id="toc-Examples-27" href="#Examples-27">8.91.2 Examples</a></li>
  311. </ul></li>
  312. <li><a id="toc-sidechaingate" href="#sidechaingate">8.92 sidechaingate</a>
  313. <ul class="no-bullet">
  314. <li><a id="toc-Commands-37" href="#Commands-37">8.92.1 Commands</a></li>
  315. </ul></li>
  316. <li><a id="toc-silencedetect" href="#silencedetect">8.93 silencedetect</a>
  317. <ul class="no-bullet">
  318. <li><a id="toc-Examples-28" href="#Examples-28">8.93.1 Examples</a></li>
  319. </ul></li>
  320. <li><a id="toc-silenceremove" href="#silenceremove">8.94 silenceremove</a>
  321. <ul class="no-bullet">
  322. <li><a id="toc-Examples-29" href="#Examples-29">8.94.1 Examples</a></li>
  323. </ul></li>
  324. <li><a id="toc-sofalizer" href="#sofalizer">8.95 sofalizer</a>
  325. <ul class="no-bullet">
  326. <li><a id="toc-Examples-30" href="#Examples-30">8.95.1 Examples</a></li>
  327. </ul></li>
  328. <li><a id="toc-speechnorm" href="#speechnorm">8.96 speechnorm</a>
  329. <ul class="no-bullet">
  330. <li><a id="toc-Commands-38" href="#Commands-38">8.96.1 Commands</a></li>
  331. </ul></li>
  332. <li><a id="toc-stereotools" href="#stereotools">8.97 stereotools</a>
  333. <ul class="no-bullet">
  334. <li><a id="toc-Commands-39" href="#Commands-39">8.97.1 Commands</a></li>
  335. <li><a id="toc-Examples-31" href="#Examples-31">8.97.2 Examples</a></li>
  336. </ul></li>
  337. <li><a id="toc-stereowiden" href="#stereowiden">8.98 stereowiden</a>
  338. <ul class="no-bullet">
  339. <li><a id="toc-Commands-40" href="#Commands-40">8.98.1 Commands</a></li>
  340. </ul></li>
  341. <li><a id="toc-superequalizer" href="#superequalizer">8.99 superequalizer</a></li>
  342. <li><a id="toc-surround" href="#surround">8.100 surround</a></li>
  343. <li><a id="toc-treble_002c-highshelf" href="#treble_002c-highshelf">8.101 treble, highshelf</a>
  344. <ul class="no-bullet">
  345. <li><a id="toc-Commands-41" href="#Commands-41">8.101.1 Commands</a></li>
  346. </ul></li>
  347. <li><a id="toc-tremolo" href="#tremolo">8.102 tremolo</a></li>
  348. <li><a id="toc-vibrato" href="#vibrato">8.103 vibrato</a></li>
  349. <li><a id="toc-volume" href="#volume">8.104 volume</a>
  350. <ul class="no-bullet">
  351. <li><a id="toc-Commands-42" href="#Commands-42">8.104.1 Commands</a></li>
  352. <li><a id="toc-Examples-32" href="#Examples-32">8.104.2 Examples</a></li>
  353. </ul></li>
  354. <li><a id="toc-volumedetect" href="#volumedetect">8.105 volumedetect</a>
  355. <ul class="no-bullet">
  356. <li><a id="toc-Examples-33" href="#Examples-33">8.105.1 Examples</a></li>
  357. </ul></li>
  358. </ul></li>
  359. <li><a id="toc-Audio-Sources" href="#Audio-Sources">9 Audio Sources</a>
  360. <ul class="no-bullet">
  361. <li><a id="toc-abuffer" href="#abuffer">9.1 abuffer</a>
  362. <ul class="no-bullet">
  363. <li><a id="toc-Examples-34" href="#Examples-34">9.1.1 Examples</a></li>
  364. </ul></li>
  365. <li><a id="toc-aevalsrc" href="#aevalsrc">9.2 aevalsrc</a>
  366. <ul class="no-bullet">
  367. <li><a id="toc-Examples-35" href="#Examples-35">9.2.1 Examples</a></li>
  368. </ul></li>
  369. <li><a id="toc-afirsrc" href="#afirsrc">9.3 afirsrc</a></li>
  370. <li><a id="toc-anullsrc" href="#anullsrc">9.4 anullsrc</a>
  371. <ul class="no-bullet">
  372. <li><a id="toc-Examples-36" href="#Examples-36">9.4.1 Examples</a></li>
  373. </ul></li>
  374. <li><a id="toc-flite" href="#flite">9.5 flite</a>
  375. <ul class="no-bullet">
  376. <li><a id="toc-Examples-37" href="#Examples-37">9.5.1 Examples</a></li>
  377. </ul></li>
  378. <li><a id="toc-anoisesrc" href="#anoisesrc">9.6 anoisesrc</a>
  379. <ul class="no-bullet">
  380. <li><a id="toc-Examples-38" href="#Examples-38">9.6.1 Examples</a></li>
  381. </ul></li>
  382. <li><a id="toc-hilbert" href="#hilbert">9.7 hilbert</a></li>
  383. <li><a id="toc-sinc" href="#sinc">9.8 sinc</a></li>
  384. <li><a id="toc-sine" href="#sine">9.9 sine</a>
  385. <ul class="no-bullet">
  386. <li><a id="toc-Examples-39" href="#Examples-39">9.9.1 Examples</a></li>
  387. </ul></li>
  388. </ul></li>
  389. <li><a id="toc-Audio-Sinks" href="#Audio-Sinks">10 Audio Sinks</a>
  390. <ul class="no-bullet">
  391. <li><a id="toc-abuffersink" href="#abuffersink">10.1 abuffersink</a></li>
  392. <li><a id="toc-anullsink" href="#anullsink">10.2 anullsink</a></li>
  393. </ul></li>
  394. <li><a id="toc-Video-Filters" href="#Video-Filters">11 Video Filters</a>
  395. <ul class="no-bullet">
  396. <li><a id="toc-addroi" href="#addroi">11.1 addroi</a>
  397. <ul class="no-bullet">
  398. <li><a id="toc-Examples-40" href="#Examples-40">11.1.1 Examples</a></li>
  399. </ul></li>
  400. <li><a id="toc-alphaextract" href="#alphaextract">11.2 alphaextract</a></li>
  401. <li><a id="toc-alphamerge" href="#alphamerge">11.3 alphamerge</a></li>
  402. <li><a id="toc-amplify" href="#amplify">11.4 amplify</a>
  403. <ul class="no-bullet">
  404. <li><a id="toc-Commands-43" href="#Commands-43">11.4.1 Commands</a></li>
  405. </ul></li>
  406. <li><a id="toc-ass" href="#ass">11.5 ass</a></li>
  407. <li><a id="toc-atadenoise" href="#atadenoise">11.6 atadenoise</a>
  408. <ul class="no-bullet">
  409. <li><a id="toc-Commands-44" href="#Commands-44">11.6.1 Commands</a></li>
  410. </ul></li>
  411. <li><a id="toc-avgblur" href="#avgblur">11.7 avgblur</a>
  412. <ul class="no-bullet">
  413. <li><a id="toc-Commands-45" href="#Commands-45">11.7.1 Commands</a></li>
  414. </ul></li>
  415. <li><a id="toc-bbox" href="#bbox">11.8 bbox</a>
  416. <ul class="no-bullet">
  417. <li><a id="toc-Commands-46" href="#Commands-46">11.8.1 Commands</a></li>
  418. </ul></li>
  419. <li><a id="toc-bilateral" href="#bilateral">11.9 bilateral</a>
  420. <ul class="no-bullet">
  421. <li><a id="toc-Commands-47" href="#Commands-47">11.9.1 Commands</a></li>
  422. </ul></li>
  423. <li><a id="toc-bitplanenoise" href="#bitplanenoise">11.10 bitplanenoise</a></li>
  424. <li><a id="toc-blackdetect" href="#blackdetect">11.11 blackdetect</a></li>
  425. <li><a id="toc-blackframe" href="#blackframe">11.12 blackframe</a></li>
  426. <li><a id="toc-blend-1" href="#blend-1">11.13 blend</a>
  427. <ul class="no-bullet">
  428. <li><a id="toc-Examples-41" href="#Examples-41">11.13.1 Examples</a></li>
  429. <li><a id="toc-Commands-48" href="#Commands-48">11.13.2 Commands</a></li>
  430. </ul></li>
  431. <li><a id="toc-bm3d" href="#bm3d">11.14 bm3d</a>
  432. <ul class="no-bullet">
  433. <li><a id="toc-Examples-42" href="#Examples-42">11.14.1 Examples</a></li>
  434. </ul></li>
  435. <li><a id="toc-boxblur" href="#boxblur">11.15 boxblur</a>
  436. <ul class="no-bullet">
  437. <li><a id="toc-Examples-43" href="#Examples-43">11.15.1 Examples</a></li>
  438. </ul></li>
  439. <li><a id="toc-bwdif" href="#bwdif">11.16 bwdif</a></li>
  440. <li><a id="toc-cas" href="#cas">11.17 cas</a>
  441. <ul class="no-bullet">
  442. <li><a id="toc-Commands-49" href="#Commands-49">11.17.1 Commands</a></li>
  443. </ul></li>
  444. <li><a id="toc-chromahold" href="#chromahold">11.18 chromahold</a>
  445. <ul class="no-bullet">
  446. <li><a id="toc-Commands-50" href="#Commands-50">11.18.1 Commands</a></li>
  447. </ul></li>
  448. <li><a id="toc-chromakey" href="#chromakey">11.19 chromakey</a>
  449. <ul class="no-bullet">
  450. <li><a id="toc-Commands-51" href="#Commands-51">11.19.1 Commands</a></li>
  451. <li><a id="toc-Examples-44" href="#Examples-44">11.19.2 Examples</a></li>
  452. </ul></li>
  453. <li><a id="toc-chromanr" href="#chromanr">11.20 chromanr</a>
  454. <ul class="no-bullet">
  455. <li><a id="toc-Commands-52" href="#Commands-52">11.20.1 Commands</a></li>
  456. </ul></li>
  457. <li><a id="toc-chromashift" href="#chromashift">11.21 chromashift</a>
  458. <ul class="no-bullet">
  459. <li><a id="toc-Commands-53" href="#Commands-53">11.21.1 Commands</a></li>
  460. </ul></li>
  461. <li><a id="toc-ciescope" href="#ciescope">11.22 ciescope</a></li>
  462. <li><a id="toc-codecview" href="#codecview">11.23 codecview</a>
  463. <ul class="no-bullet">
  464. <li><a id="toc-Examples-45" href="#Examples-45">11.23.1 Examples</a></li>
  465. </ul></li>
  466. <li><a id="toc-colorbalance" href="#colorbalance">11.24 colorbalance</a>
  467. <ul class="no-bullet">
  468. <li><a id="toc-Examples-46" href="#Examples-46">11.24.1 Examples</a></li>
  469. <li><a id="toc-Commands-54" href="#Commands-54">11.24.2 Commands</a></li>
  470. </ul></li>
  471. <li><a id="toc-colorcontrast" href="#colorcontrast">11.25 colorcontrast</a>
  472. <ul class="no-bullet">
  473. <li><a id="toc-Commands-55" href="#Commands-55">11.25.1 Commands</a></li>
  474. </ul></li>
  475. <li><a id="toc-colorcorrect" href="#colorcorrect">11.26 colorcorrect</a>
  476. <ul class="no-bullet">
  477. <li><a id="toc-Commands-56" href="#Commands-56">11.26.1 Commands</a></li>
  478. </ul></li>
  479. <li><a id="toc-colorchannelmixer" href="#colorchannelmixer">11.27 colorchannelmixer</a>
  480. <ul class="no-bullet">
  481. <li><a id="toc-Examples-47" href="#Examples-47">11.27.1 Examples</a></li>
  482. <li><a id="toc-Commands-57" href="#Commands-57">11.27.2 Commands</a></li>
  483. </ul></li>
  484. <li><a id="toc-colorize" href="#colorize">11.28 colorize</a>
  485. <ul class="no-bullet">
  486. <li><a id="toc-Commands-58" href="#Commands-58">11.28.1 Commands</a></li>
  487. </ul></li>
  488. <li><a id="toc-colorkey" href="#colorkey">11.29 colorkey</a>
  489. <ul class="no-bullet">
  490. <li><a id="toc-Examples-48" href="#Examples-48">11.29.1 Examples</a></li>
  491. <li><a id="toc-Commands-59" href="#Commands-59">11.29.2 Commands</a></li>
  492. </ul></li>
  493. <li><a id="toc-colorhold" href="#colorhold">11.30 colorhold</a>
  494. <ul class="no-bullet">
  495. <li><a id="toc-Commands-60" href="#Commands-60">11.30.1 Commands</a></li>
  496. </ul></li>
  497. <li><a id="toc-colorlevels" href="#colorlevels">11.31 colorlevels</a>
  498. <ul class="no-bullet">
  499. <li><a id="toc-Examples-49" href="#Examples-49">11.31.1 Examples</a></li>
  500. <li><a id="toc-Commands-61" href="#Commands-61">11.31.2 Commands</a></li>
  501. </ul></li>
  502. <li><a id="toc-colormatrix" href="#colormatrix">11.32 colormatrix</a></li>
  503. <li><a id="toc-colorspace" href="#colorspace">11.33 colorspace</a></li>
  504. <li><a id="toc-colortemperature" href="#colortemperature">11.34 colortemperature</a>
  505. <ul class="no-bullet">
  506. <li><a id="toc-Commands-62" href="#Commands-62">11.34.1 Commands</a></li>
  507. </ul></li>
  508. <li><a id="toc-convolution" href="#convolution">11.35 convolution</a>
  509. <ul class="no-bullet">
  510. <li><a id="toc-Commands-63" href="#Commands-63">11.35.1 Commands</a></li>
  511. <li><a id="toc-Examples-50" href="#Examples-50">11.35.2 Examples</a></li>
  512. </ul></li>
  513. <li><a id="toc-convolve" href="#convolve">11.36 convolve</a></li>
  514. <li><a id="toc-copy" href="#copy">11.37 copy</a></li>
  515. <li><a id="toc-coreimage-1" href="#coreimage-1">11.38 coreimage</a>
  516. <ul class="no-bullet">
  517. <li><a id="toc-Examples-51" href="#Examples-51">11.38.1 Examples</a></li>
  518. </ul></li>
  519. <li><a id="toc-cover_005frect" href="#cover_005frect">11.39 cover_rect</a>
  520. <ul class="no-bullet">
  521. <li><a id="toc-Examples-52" href="#Examples-52">11.39.1 Examples</a></li>
  522. </ul></li>
  523. <li><a id="toc-crop" href="#crop">11.40 crop</a>
  524. <ul class="no-bullet">
  525. <li><a id="toc-Examples-53" href="#Examples-53">11.40.1 Examples</a></li>
  526. <li><a id="toc-Commands-64" href="#Commands-64">11.40.2 Commands</a></li>
  527. </ul></li>
  528. <li><a id="toc-cropdetect" href="#cropdetect">11.41 cropdetect</a></li>
  529. <li><a id="toc-cue-1" href="#cue-1">11.42 cue</a></li>
  530. <li><a id="toc-curves-1" href="#curves-1">11.43 curves</a>
  531. <ul class="no-bullet">
  532. <li><a id="toc-Commands-65" href="#Commands-65">11.43.1 Commands</a></li>
  533. <li><a id="toc-Examples-54" href="#Examples-54">11.43.2 Examples</a></li>
  534. </ul></li>
  535. <li><a id="toc-datascope" href="#datascope">11.44 datascope</a>
  536. <ul class="no-bullet">
  537. <li><a id="toc-Commands-66" href="#Commands-66">11.44.1 Commands</a></li>
  538. </ul></li>
  539. <li><a id="toc-dblur" href="#dblur">11.45 dblur</a>
  540. <ul class="no-bullet">
  541. <li><a id="toc-Commands-67" href="#Commands-67">11.45.1 Commands</a></li>
  542. </ul></li>
  543. <li><a id="toc-dctdnoiz" href="#dctdnoiz">11.46 dctdnoiz</a>
  544. <ul class="no-bullet">
  545. <li><a id="toc-Examples-55" href="#Examples-55">11.46.1 Examples</a></li>
  546. </ul></li>
  547. <li><a id="toc-deband" href="#deband">11.47 deband</a>
  548. <ul class="no-bullet">
  549. <li><a id="toc-Commands-68" href="#Commands-68">11.47.1 Commands</a></li>
  550. </ul></li>
  551. <li><a id="toc-deblock" href="#deblock">11.48 deblock</a>
  552. <ul class="no-bullet">
  553. <li><a id="toc-Examples-56" href="#Examples-56">11.48.1 Examples</a></li>
  554. <li><a id="toc-Commands-69" href="#Commands-69">11.48.2 Commands</a></li>
  555. </ul></li>
  556. <li><a id="toc-decimate-1" href="#decimate-1">11.49 decimate</a></li>
  557. <li><a id="toc-deconvolve" href="#deconvolve">11.50 deconvolve</a></li>
  558. <li><a id="toc-dedot" href="#dedot">11.51 dedot</a></li>
  559. <li><a id="toc-deflate" href="#deflate">11.52 deflate</a>
  560. <ul class="no-bullet">
  561. <li><a id="toc-Commands-70" href="#Commands-70">11.52.1 Commands</a></li>
  562. </ul></li>
  563. <li><a id="toc-deflicker" href="#deflicker">11.53 deflicker</a></li>
  564. <li><a id="toc-dejudder" href="#dejudder">11.54 dejudder</a></li>
  565. <li><a id="toc-delogo" href="#delogo">11.55 delogo</a>
  566. <ul class="no-bullet">
  567. <li><a id="toc-Examples-57" href="#Examples-57">11.55.1 Examples</a></li>
  568. </ul></li>
  569. <li><a id="toc-derain-1" href="#derain-1">11.56 derain</a></li>
  570. <li><a id="toc-deshake" href="#deshake">11.57 deshake</a></li>
  571. <li><a id="toc-despill" href="#despill">11.58 despill</a>
  572. <ul class="no-bullet">
  573. <li><a id="toc-Commands-71" href="#Commands-71">11.58.1 Commands</a></li>
  574. </ul></li>
  575. <li><a id="toc-detelecine" href="#detelecine">11.59 detelecine</a></li>
  576. <li><a id="toc-dilation" href="#dilation">11.60 dilation</a>
  577. <ul class="no-bullet">
  578. <li><a id="toc-Commands-72" href="#Commands-72">11.60.1 Commands</a></li>
  579. </ul></li>
  580. <li><a id="toc-displace" href="#displace">11.61 displace</a>
  581. <ul class="no-bullet">
  582. <li><a id="toc-Examples-58" href="#Examples-58">11.61.1 Examples</a></li>
  583. </ul></li>
  584. <li><a id="toc-dnn_005fprocessing-1" href="#dnn_005fprocessing-1">11.62 dnn_processing</a>
  585. <ul class="no-bullet">
  586. <li><a id="toc-Examples-59" href="#Examples-59">11.62.1 Examples</a></li>
  587. </ul></li>
  588. <li><a id="toc-drawbox" href="#drawbox">11.63 drawbox</a>
  589. <ul class="no-bullet">
  590. <li><a id="toc-Examples-60" href="#Examples-60">11.63.1 Examples</a></li>
  591. <li><a id="toc-Commands-73" href="#Commands-73">11.63.2 Commands</a></li>
  592. </ul></li>
  593. <li><a id="toc-drawgraph-1" href="#drawgraph-1">11.64 drawgraph</a></li>
  594. <li><a id="toc-drawgrid" href="#drawgrid">11.65 drawgrid</a>
  595. <ul class="no-bullet">
  596. <li><a id="toc-Examples-61" href="#Examples-61">11.65.1 Examples</a></li>
  597. <li><a id="toc-Commands-74" href="#Commands-74">11.65.2 Commands</a></li>
  598. </ul></li>
  599. <li><a id="toc-drawtext-1" href="#drawtext-1">11.66 drawtext</a>
  600. <ul class="no-bullet">
  601. <li><a id="toc-Syntax" href="#Syntax">11.66.1 Syntax</a></li>
  602. <li><a id="toc-Text-expansion" href="#Text-expansion">11.66.2 Text expansion</a></li>
  603. <li><a id="toc-Commands-75" href="#Commands-75">11.66.3 Commands</a></li>
  604. <li><a id="toc-Examples-62" href="#Examples-62">11.66.4 Examples</a></li>
  605. </ul></li>
  606. <li><a id="toc-edgedetect" href="#edgedetect">11.67 edgedetect</a>
  607. <ul class="no-bullet">
  608. <li><a id="toc-Examples-63" href="#Examples-63">11.67.1 Examples</a></li>
  609. </ul></li>
  610. <li><a id="toc-elbg" href="#elbg">11.68 elbg</a></li>
  611. <li><a id="toc-entropy" href="#entropy">11.69 entropy</a></li>
  612. <li><a id="toc-epx" href="#epx">11.70 epx</a></li>
  613. <li><a id="toc-eq" href="#eq">11.71 eq</a>
  614. <ul class="no-bullet">
  615. <li><a id="toc-Commands-76" href="#Commands-76">11.71.1 Commands</a></li>
  616. </ul></li>
  617. <li><a id="toc-erosion" href="#erosion">11.72 erosion</a>
  618. <ul class="no-bullet">
  619. <li><a id="toc-Commands-77" href="#Commands-77">11.72.1 Commands</a></li>
  620. </ul></li>
  621. <li><a id="toc-estdif" href="#estdif">11.73 estdif</a>
  622. <ul class="no-bullet">
  623. <li><a id="toc-Commands-78" href="#Commands-78">11.73.1 Commands</a></li>
  624. </ul></li>
  625. <li><a id="toc-exposure" href="#exposure">11.74 exposure</a>
  626. <ul class="no-bullet">
  627. <li><a id="toc-Commands-79" href="#Commands-79">11.74.1 Commands</a></li>
  628. </ul></li>
  629. <li><a id="toc-extractplanes" href="#extractplanes">11.75 extractplanes</a>
  630. <ul class="no-bullet">
  631. <li><a id="toc-Examples-64" href="#Examples-64">11.75.1 Examples</a></li>
  632. </ul></li>
  633. <li><a id="toc-fade" href="#fade">11.76 fade</a>
  634. <ul class="no-bullet">
  635. <li><a id="toc-Examples-65" href="#Examples-65">11.76.1 Examples</a></li>
  636. </ul></li>
  637. <li><a id="toc-fftdnoiz" href="#fftdnoiz">11.77 fftdnoiz</a></li>
  638. <li><a id="toc-fftfilt" href="#fftfilt">11.78 fftfilt</a>
  639. <ul class="no-bullet">
  640. <li><a id="toc-Examples-66" href="#Examples-66">11.78.1 Examples</a></li>
  641. </ul></li>
  642. <li><a id="toc-field" href="#field">11.79 field</a></li>
  643. <li><a id="toc-fieldhint" href="#fieldhint">11.80 fieldhint</a></li>
  644. <li><a id="toc-fieldmatch" href="#fieldmatch">11.81 fieldmatch</a>
  645. <ul class="no-bullet">
  646. <li><a id="toc-p_002fc_002fn_002fu_002fb-meaning-1" href="#p_002fc_002fn_002fu_002fb-meaning-1">11.81.1 p/c/n/u/b meaning</a>
  647. <ul class="no-bullet">
  648. <li><a id="toc-p_002fc_002fn" href="#p_002fc_002fn">11.81.1.1 p/c/n</a></li>
  649. <li><a id="toc-u_002fb" href="#u_002fb">11.81.1.2 u/b</a></li>
  650. </ul></li>
  651. <li><a id="toc-Examples-67" href="#Examples-67">11.81.2 Examples</a></li>
  652. </ul></li>
  653. <li><a id="toc-fieldorder" href="#fieldorder">11.82 fieldorder</a></li>
  654. <li><a id="toc-fifo_002c-afifo" href="#fifo_002c-afifo">11.83 fifo, afifo</a></li>
  655. <li><a id="toc-fillborders" href="#fillborders">11.84 fillborders</a>
  656. <ul class="no-bullet">
  657. <li><a id="toc-Commands-80" href="#Commands-80">11.84.1 Commands</a></li>
  658. </ul></li>
  659. <li><a id="toc-find_005frect" href="#find_005frect">11.85 find_rect</a>
  660. <ul class="no-bullet">
  661. <li><a id="toc-Examples-68" href="#Examples-68">11.85.1 Examples</a></li>
  662. </ul></li>
  663. <li><a id="toc-floodfill" href="#floodfill">11.86 floodfill</a></li>
  664. <li><a id="toc-format-1" href="#format-1">11.87 format</a>
  665. <ul class="no-bullet">
  666. <li><a id="toc-Examples-69" href="#Examples-69">11.87.1 Examples</a></li>
  667. </ul></li>
  668. <li><a id="toc-fps-1" href="#fps-1">11.88 fps</a>
  669. <ul class="no-bullet">
  670. <li><a id="toc-Examples-70" href="#Examples-70">11.88.1 Examples</a></li>
  671. </ul></li>
  672. <li><a id="toc-framepack" href="#framepack">11.89 framepack</a></li>
  673. <li><a id="toc-framerate" href="#framerate">11.90 framerate</a></li>
  674. <li><a id="toc-framestep" href="#framestep">11.91 framestep</a></li>
  675. <li><a id="toc-freezedetect" href="#freezedetect">11.92 freezedetect</a></li>
  676. <li><a id="toc-freezeframes" href="#freezeframes">11.93 freezeframes</a></li>
  677. <li><a id="toc-frei0r-1" href="#frei0r-1">11.94 frei0r</a>
  678. <ul class="no-bullet">
  679. <li><a id="toc-Examples-71" href="#Examples-71">11.94.1 Examples</a></li>
  680. <li><a id="toc-Commands-81" href="#Commands-81">11.94.2 Commands</a></li>
  681. </ul></li>
  682. <li><a id="toc-fspp" href="#fspp">11.95 fspp</a></li>
  683. <li><a id="toc-gblur" href="#gblur">11.96 gblur</a>
  684. <ul class="no-bullet">
  685. <li><a id="toc-Commands-82" href="#Commands-82">11.96.1 Commands</a></li>
  686. </ul></li>
  687. <li><a id="toc-geq" href="#geq">11.97 geq</a>
  688. <ul class="no-bullet">
  689. <li><a id="toc-Examples-72" href="#Examples-72">11.97.1 Examples</a></li>
  690. </ul></li>
  691. <li><a id="toc-gradfun" href="#gradfun">11.98 gradfun</a>
  692. <ul class="no-bullet">
  693. <li><a id="toc-Examples-73" href="#Examples-73">11.98.1 Examples</a></li>
  694. </ul></li>
  695. <li><a id="toc-graphmonitor-1" href="#graphmonitor-1">11.99 graphmonitor</a></li>
  696. <li><a id="toc-greyedge" href="#greyedge">11.100 greyedge</a>
  697. <ul class="no-bullet">
  698. <li><a id="toc-Examples-74" href="#Examples-74">11.100.1 Examples</a></li>
  699. </ul></li>
  700. <li><a id="toc-haldclut-1" href="#haldclut-1">11.101 haldclut</a>
  701. <ul class="no-bullet">
  702. <li><a id="toc-Commands-83" href="#Commands-83">11.101.1 Commands</a></li>
  703. <li><a id="toc-Workflow-examples" href="#Workflow-examples">11.101.2 Workflow examples</a>
  704. <ul class="no-bullet">
  705. <li><a id="toc-Hald-CLUT-video-stream" href="#Hald-CLUT-video-stream">11.101.2.1 Hald CLUT video stream</a></li>
  706. <li><a id="toc-Hald-CLUT-with-preview" href="#Hald-CLUT-with-preview">11.101.2.2 Hald CLUT with preview</a></li>
  707. </ul></li>
  708. </ul></li>
  709. <li><a id="toc-hflip" href="#hflip">11.102 hflip</a></li>
  710. <li><a id="toc-histeq" href="#histeq">11.103 histeq</a></li>
  711. <li><a id="toc-histogram-1" href="#histogram-1">11.104 histogram</a>
  712. <ul class="no-bullet">
  713. <li><a id="toc-Examples-75" href="#Examples-75">11.104.1 Examples</a></li>
  714. </ul></li>
  715. <li><a id="toc-hqdn3d-1" href="#hqdn3d-1">11.105 hqdn3d</a>
  716. <ul class="no-bullet">
  717. <li><a id="toc-Commands-84" href="#Commands-84">11.105.1 Commands</a></li>
  718. </ul></li>
  719. <li><a id="toc-hwdownload-1" href="#hwdownload-1">11.106 hwdownload</a></li>
  720. <li><a id="toc-hwmap" href="#hwmap">11.107 hwmap</a></li>
  721. <li><a id="toc-hwupload-1" href="#hwupload-1">11.108 hwupload</a></li>
  722. <li><a id="toc-hwupload_005fcuda-1" href="#hwupload_005fcuda-1">11.109 hwupload_cuda</a></li>
  723. <li><a id="toc-hqx" href="#hqx">11.110 hqx</a></li>
  724. <li><a id="toc-hstack" href="#hstack">11.111 hstack</a></li>
  725. <li><a id="toc-hue" href="#hue">11.112 hue</a>
  726. <ul class="no-bullet">
  727. <li><a id="toc-Examples-76" href="#Examples-76">11.112.1 Examples</a></li>
  728. <li><a id="toc-Commands-85" href="#Commands-85">11.112.2 Commands</a></li>
  729. </ul></li>
  730. <li><a id="toc-hysteresis" href="#hysteresis">11.113 hysteresis</a></li>
  731. <li><a id="toc-identity" href="#identity">11.114 identity</a></li>
  732. <li><a id="toc-idet" href="#idet">11.115 idet</a></li>
  733. <li><a id="toc-il" href="#il">11.116 il</a>
  734. <ul class="no-bullet">
  735. <li><a id="toc-Commands-86" href="#Commands-86">11.116.1 Commands</a></li>
  736. </ul></li>
  737. <li><a id="toc-inflate" href="#inflate">11.117 inflate</a>
  738. <ul class="no-bullet">
  739. <li><a id="toc-Commands-87" href="#Commands-87">11.117.1 Commands</a></li>
  740. </ul></li>
  741. <li><a id="toc-interlace" href="#interlace">11.118 interlace</a></li>
  742. <li><a id="toc-kerndeint" href="#kerndeint">11.119 kerndeint</a>
  743. <ul class="no-bullet">
  744. <li><a id="toc-Examples-77" href="#Examples-77">11.119.1 Examples</a></li>
  745. </ul></li>
  746. <li><a id="toc-kirsch" href="#kirsch">11.120 kirsch</a>
  747. <ul class="no-bullet">
  748. <li><a id="toc-Commands-88" href="#Commands-88">11.120.1 Commands</a></li>
  749. </ul></li>
  750. <li><a id="toc-lagfun" href="#lagfun">11.121 lagfun</a>
  751. <ul class="no-bullet">
  752. <li><a id="toc-Commands-89" href="#Commands-89">11.121.1 Commands</a></li>
  753. </ul></li>
  754. <li><a id="toc-lenscorrection" href="#lenscorrection">11.122 lenscorrection</a>
  755. <ul class="no-bullet">
  756. <li><a id="toc-Options" href="#Options">11.122.1 Options</a></li>
  757. <li><a id="toc-Commands-90" href="#Commands-90">11.122.2 Commands</a></li>
  758. </ul></li>
  759. <li><a id="toc-lensfun" href="#lensfun">11.123 lensfun</a>
  760. <ul class="no-bullet">
  761. <li><a id="toc-Examples-78" href="#Examples-78">11.123.1 Examples</a></li>
  762. </ul></li>
  763. <li><a id="toc-libvmaf" href="#libvmaf">11.124 libvmaf</a>
  764. <ul class="no-bullet">
  765. <li><a id="toc-Examples-79" href="#Examples-79">11.124.1 Examples</a></li>
  766. </ul></li>
  767. <li><a id="toc-limiter" href="#limiter">11.125 limiter</a>
  768. <ul class="no-bullet">
  769. <li><a id="toc-Commands-91" href="#Commands-91">11.125.1 Commands</a></li>
  770. </ul></li>
  771. <li><a id="toc-loop" href="#loop">11.126 loop</a>
  772. <ul class="no-bullet">
  773. <li><a id="toc-Examples-80" href="#Examples-80">11.126.1 Examples</a></li>
  774. </ul></li>
  775. <li><a id="toc-lut1d" href="#lut1d">11.127 lut1d</a>
  776. <ul class="no-bullet">
  777. <li><a id="toc-Commands-92" href="#Commands-92">11.127.1 Commands</a></li>
  778. </ul></li>
  779. <li><a id="toc-lut3d-1" href="#lut3d-1">11.128 lut3d</a>
  780. <ul class="no-bullet">
  781. <li><a id="toc-Commands-93" href="#Commands-93">11.128.1 Commands</a></li>
  782. </ul></li>
  783. <li><a id="toc-lumakey" href="#lumakey">11.129 lumakey</a>
  784. <ul class="no-bullet">
  785. <li><a id="toc-Commands-94" href="#Commands-94">11.129.1 Commands</a></li>
  786. </ul></li>
  787. <li><a id="toc-lut_002c-lutrgb_002c-lutyuv" href="#lut_002c-lutrgb_002c-lutyuv">11.130 lut, lutrgb, lutyuv</a>
  788. <ul class="no-bullet">
  789. <li><a id="toc-Commands-95" href="#Commands-95">11.130.1 Commands</a></li>
  790. <li><a id="toc-Examples-81" href="#Examples-81">11.130.2 Examples</a></li>
  791. </ul></li>
  792. <li><a id="toc-lut2_002c-tlut2" href="#lut2_002c-tlut2">11.131 lut2, tlut2</a>
  793. <ul class="no-bullet">
  794. <li><a id="toc-Commands-96" href="#Commands-96">11.131.1 Commands</a></li>
  795. <li><a id="toc-Examples-82" href="#Examples-82">11.131.2 Examples</a></li>
  796. </ul></li>
  797. <li><a id="toc-maskedclamp" href="#maskedclamp">11.132 maskedclamp</a>
  798. <ul class="no-bullet">
  799. <li><a id="toc-Commands-97" href="#Commands-97">11.132.1 Commands</a></li>
  800. </ul></li>
  801. <li><a id="toc-maskedmax" href="#maskedmax">11.133 maskedmax</a>
  802. <ul class="no-bullet">
  803. <li><a id="toc-Commands-98" href="#Commands-98">11.133.1 Commands</a></li>
  804. </ul></li>
  805. <li><a id="toc-maskedmerge" href="#maskedmerge">11.134 maskedmerge</a>
  806. <ul class="no-bullet">
  807. <li><a id="toc-Commands-99" href="#Commands-99">11.134.1 Commands</a></li>
  808. </ul></li>
  809. <li><a id="toc-maskedmin" href="#maskedmin">11.135 maskedmin</a>
  810. <ul class="no-bullet">
  811. <li><a id="toc-Commands-100" href="#Commands-100">11.135.1 Commands</a></li>
  812. </ul></li>
  813. <li><a id="toc-maskedthreshold" href="#maskedthreshold">11.136 maskedthreshold</a>
  814. <ul class="no-bullet">
  815. <li><a id="toc-Commands-101" href="#Commands-101">11.136.1 Commands</a></li>
  816. </ul></li>
  817. <li><a id="toc-maskfun" href="#maskfun">11.137 maskfun</a>
  818. <ul class="no-bullet">
  819. <li><a id="toc-Commands-102" href="#Commands-102">11.137.1 Commands</a></li>
  820. </ul></li>
  821. <li><a id="toc-mcdeint" href="#mcdeint">11.138 mcdeint</a></li>
  822. <li><a id="toc-median" href="#median">11.139 median</a>
  823. <ul class="no-bullet">
  824. <li><a id="toc-Commands-103" href="#Commands-103">11.139.1 Commands</a></li>
  825. </ul></li>
  826. <li><a id="toc-mergeplanes" href="#mergeplanes">11.140 mergeplanes</a>
  827. <ul class="no-bullet">
  828. <li><a id="toc-Examples-83" href="#Examples-83">11.140.1 Examples</a></li>
  829. </ul></li>
  830. <li><a id="toc-mestimate" href="#mestimate">11.141 mestimate</a></li>
  831. <li><a id="toc-midequalizer" href="#midequalizer">11.142 midequalizer</a></li>
  832. <li><a id="toc-minterpolate" href="#minterpolate">11.143 minterpolate</a></li>
  833. <li><a id="toc-mix" href="#mix">11.144 mix</a>
  834. <ul class="no-bullet">
  835. <li><a id="toc-Commands-104" href="#Commands-104">11.144.1 Commands</a></li>
  836. </ul></li>
  837. <li><a id="toc-monochrome" href="#monochrome">11.145 monochrome</a>
  838. <ul class="no-bullet">
  839. <li><a id="toc-Commands-105" href="#Commands-105">11.145.1 Commands</a></li>
  840. </ul></li>
  841. <li><a id="toc-mpdecimate" href="#mpdecimate">11.146 mpdecimate</a></li>
  842. <li><a id="toc-msad" href="#msad">11.147 msad</a></li>
  843. <li><a id="toc-negate" href="#negate">11.148 negate</a>
  844. <ul class="no-bullet">
  845. <li><a id="toc-Commands-106" href="#Commands-106">11.148.1 Commands</a></li>
  846. </ul></li>
  847. <li><a id="toc-nlmeans-1" href="#nlmeans-1">11.149 nlmeans</a></li>
  848. <li><a id="toc-nnedi" href="#nnedi">11.150 nnedi</a>
  849. <ul class="no-bullet">
  850. <li><a id="toc-Commands-107" href="#Commands-107">11.150.1 Commands</a></li>
  851. </ul></li>
  852. <li><a id="toc-noformat" href="#noformat">11.151 noformat</a>
  853. <ul class="no-bullet">
  854. <li><a id="toc-Examples-84" href="#Examples-84">11.151.1 Examples</a></li>
  855. </ul></li>
  856. <li><a id="toc-noise" href="#noise">11.152 noise</a>
  857. <ul class="no-bullet">
  858. <li><a id="toc-Examples-85" href="#Examples-85">11.152.1 Examples</a></li>
  859. </ul></li>
  860. <li><a id="toc-normalize" href="#normalize">11.153 normalize</a>
  861. <ul class="no-bullet">
  862. <li><a id="toc-Commands-108" href="#Commands-108">11.153.1 Commands</a></li>
  863. <li><a id="toc-Examples-86" href="#Examples-86">11.153.2 Examples</a></li>
  864. </ul></li>
  865. <li><a id="toc-null" href="#null">11.154 null</a></li>
  866. <li><a id="toc-ocr" href="#ocr">11.155 ocr</a></li>
  867. <li><a id="toc-ocv" href="#ocv">11.156 ocv</a>
  868. <ul class="no-bullet">
  869. <li><a id="toc-dilate-1" href="#dilate-1">11.156.1 dilate</a></li>
  870. <li><a id="toc-erode" href="#erode">11.156.2 erode</a></li>
  871. <li><a id="toc-smooth" href="#smooth">11.156.3 smooth</a></li>
  872. </ul></li>
  873. <li><a id="toc-oscilloscope" href="#oscilloscope">11.157 oscilloscope</a>
  874. <ul class="no-bullet">
  875. <li><a id="toc-Commands-109" href="#Commands-109">11.157.1 Commands</a></li>
  876. <li><a id="toc-Examples-87" href="#Examples-87">11.157.2 Examples</a></li>
  877. </ul></li>
  878. <li><a id="toc-overlay-1" href="#overlay-1">11.158 overlay</a>
  879. <ul class="no-bullet">
  880. <li><a id="toc-Commands-110" href="#Commands-110">11.158.1 Commands</a></li>
  881. <li><a id="toc-Examples-88" href="#Examples-88">11.158.2 Examples</a></li>
  882. </ul></li>
  883. <li><a id="toc-overlay_005fcuda-1" href="#overlay_005fcuda-1">11.159 overlay_cuda</a></li>
  884. <li><a id="toc-owdenoise" href="#owdenoise">11.160 owdenoise</a></li>
  885. <li><a id="toc-pad-1" href="#pad-1">11.161 pad</a>
  886. <ul class="no-bullet">
  887. <li><a id="toc-Examples-89" href="#Examples-89">11.161.1 Examples</a></li>
  888. </ul></li>
  889. <li><a id="toc-palettegen-1" href="#palettegen-1">11.162 palettegen</a>
  890. <ul class="no-bullet">
  891. <li><a id="toc-Examples-90" href="#Examples-90">11.162.1 Examples</a></li>
  892. </ul></li>
  893. <li><a id="toc-paletteuse" href="#paletteuse">11.163 paletteuse</a>
  894. <ul class="no-bullet">
  895. <li><a id="toc-Examples-91" href="#Examples-91">11.163.1 Examples</a></li>
  896. </ul></li>
  897. <li><a id="toc-perspective" href="#perspective">11.164 perspective</a></li>
  898. <li><a id="toc-phase" href="#phase">11.165 phase</a>
  899. <ul class="no-bullet">
  900. <li><a id="toc-Commands-111" href="#Commands-111">11.165.1 Commands</a></li>
  901. </ul></li>
  902. <li><a id="toc-photosensitivity" href="#photosensitivity">11.166 photosensitivity</a></li>
  903. <li><a id="toc-pixdesctest" href="#pixdesctest">11.167 pixdesctest</a></li>
  904. <li><a id="toc-pixscope" href="#pixscope">11.168 pixscope</a>
  905. <ul class="no-bullet">
  906. <li><a id="toc-Commands-112" href="#Commands-112">11.168.1 Commands</a></li>
  907. </ul></li>
  908. <li><a id="toc-pp" href="#pp">11.169 pp</a>
  909. <ul class="no-bullet">
  910. <li><a id="toc-Examples-92" href="#Examples-92">11.169.1 Examples</a></li>
  911. </ul></li>
  912. <li><a id="toc-pp7" href="#pp7">11.170 pp7</a></li>
  913. <li><a id="toc-premultiply" href="#premultiply">11.171 premultiply</a></li>
  914. <li><a id="toc-prewitt" href="#prewitt">11.172 prewitt</a>
  915. <ul class="no-bullet">
  916. <li><a id="toc-Commands-113" href="#Commands-113">11.172.1 Commands</a></li>
  917. </ul></li>
  918. <li><a id="toc-pseudocolor" href="#pseudocolor">11.173 pseudocolor</a>
  919. <ul class="no-bullet">
  920. <li><a id="toc-Commands-114" href="#Commands-114">11.173.1 Commands</a></li>
  921. <li><a id="toc-Examples-93" href="#Examples-93">11.173.2 Examples</a></li>
  922. </ul></li>
  923. <li><a id="toc-psnr" href="#psnr">11.174 psnr</a>
  924. <ul class="no-bullet">
  925. <li><a id="toc-Examples-94" href="#Examples-94">11.174.1 Examples</a></li>
  926. </ul></li>
  927. <li><a id="toc-pullup-1" href="#pullup-1">11.175 pullup</a></li>
  928. <li><a id="toc-qp" href="#qp">11.176 qp</a>
  929. <ul class="no-bullet">
  930. <li><a id="toc-Examples-95" href="#Examples-95">11.176.1 Examples</a></li>
  931. </ul></li>
  932. <li><a id="toc-random" href="#random">11.177 random</a></li>
  933. <li><a id="toc-readeia608" href="#readeia608">11.178 readeia608</a>
  934. <ul class="no-bullet">
  935. <li><a id="toc-Commands-115" href="#Commands-115">11.178.1 Commands</a></li>
  936. <li><a id="toc-Examples-96" href="#Examples-96">11.178.2 Examples</a></li>
  937. </ul></li>
  938. <li><a id="toc-readvitc" href="#readvitc">11.179 readvitc</a>
  939. <ul class="no-bullet">
  940. <li><a id="toc-Examples-97" href="#Examples-97">11.179.1 Examples</a></li>
  941. </ul></li>
  942. <li><a id="toc-remap" href="#remap">11.180 remap</a></li>
  943. <li><a id="toc-removegrain" href="#removegrain">11.181 removegrain</a></li>
  944. <li><a id="toc-removelogo" href="#removelogo">11.182 removelogo</a></li>
  945. <li><a id="toc-repeatfields" href="#repeatfields">11.183 repeatfields</a></li>
  946. <li><a id="toc-reverse" href="#reverse">11.184 reverse</a>
  947. <ul class="no-bullet">
  948. <li><a id="toc-Examples-98" href="#Examples-98">11.184.1 Examples</a></li>
  949. </ul></li>
  950. <li><a id="toc-rgbashift" href="#rgbashift">11.185 rgbashift</a>
  951. <ul class="no-bullet">
  952. <li><a id="toc-Commands-116" href="#Commands-116">11.185.1 Commands</a></li>
  953. </ul></li>
  954. <li><a id="toc-roberts" href="#roberts">11.186 roberts</a>
  955. <ul class="no-bullet">
  956. <li><a id="toc-Commands-117" href="#Commands-117">11.186.1 Commands</a></li>
  957. </ul></li>
  958. <li><a id="toc-rotate" href="#rotate">11.187 rotate</a>
  959. <ul class="no-bullet">
  960. <li><a id="toc-Examples-99" href="#Examples-99">11.187.1 Examples</a></li>
  961. <li><a id="toc-Commands-118" href="#Commands-118">11.187.2 Commands</a></li>
  962. </ul></li>
  963. <li><a id="toc-sab" href="#sab">11.188 sab</a></li>
  964. <li><a id="toc-scale-1" href="#scale-1">11.189 scale</a>
  965. <ul class="no-bullet">
  966. <li><a id="toc-Options-1" href="#Options-1">11.189.1 Options</a></li>
  967. <li><a id="toc-Examples-100" href="#Examples-100">11.189.2 Examples</a></li>
  968. <li><a id="toc-Commands-119" href="#Commands-119">11.189.3 Commands</a></li>
  969. </ul></li>
  970. <li><a id="toc-scale_005fnpp" href="#scale_005fnpp">11.190 scale_npp</a></li>
  971. <li><a id="toc-scale2ref" href="#scale2ref">11.191 scale2ref</a>
  972. <ul class="no-bullet">
  973. <li><a id="toc-Examples-101" href="#Examples-101">11.191.1 Examples</a></li>
  974. <li><a id="toc-Commands-120" href="#Commands-120">11.191.2 Commands</a></li>
  975. </ul></li>
  976. <li><a id="toc-scroll" href="#scroll">11.192 scroll</a>
  977. <ul class="no-bullet">
  978. <li><a id="toc-Commands-121" href="#Commands-121">11.192.1 Commands</a></li>
  979. </ul></li>
  980. <li><a id="toc-scdet-1" href="#scdet-1">11.193 scdet</a></li>
  981. <li><a id="toc-selectivecolor-1" href="#selectivecolor-1">11.194 selectivecolor</a>
  982. <ul class="no-bullet">
  983. <li><a id="toc-Examples-102" href="#Examples-102">11.194.1 Examples</a></li>
  984. </ul></li>
  985. <li><a id="toc-separatefields-1" href="#separatefields-1">11.195 separatefields</a></li>
  986. <li><a id="toc-setdar_002c-setsar" href="#setdar_002c-setsar">11.196 setdar, setsar</a>
  987. <ul class="no-bullet">
  988. <li><a id="toc-Examples-103" href="#Examples-103">11.196.1 Examples</a></li>
  989. </ul></li>
  990. <li><a id="toc-setfield-1" href="#setfield-1">11.197 setfield</a></li>
  991. <li><a id="toc-setparams-1" href="#setparams-1">11.198 setparams</a></li>
  992. <li><a id="toc-shear" href="#shear">11.199 shear</a>
  993. <ul class="no-bullet">
  994. <li><a id="toc-Commands-122" href="#Commands-122">11.199.1 Commands</a></li>
  995. </ul></li>
  996. <li><a id="toc-showinfo" href="#showinfo">11.200 showinfo</a></li>
  997. <li><a id="toc-showpalette" href="#showpalette">11.201 showpalette</a></li>
  998. <li><a id="toc-shuffleframes" href="#shuffleframes">11.202 shuffleframes</a>
  999. <ul class="no-bullet">
  1000. <li><a id="toc-Examples-104" href="#Examples-104">11.202.1 Examples</a></li>
  1001. </ul></li>
  1002. <li><a id="toc-shufflepixels" href="#shufflepixels">11.203 shufflepixels</a></li>
  1003. <li><a id="toc-shuffleplanes" href="#shuffleplanes">11.204 shuffleplanes</a>
  1004. <ul class="no-bullet">
  1005. <li><a id="toc-Examples-105" href="#Examples-105">11.204.1 Examples</a></li>
  1006. </ul></li>
  1007. <li><a id="toc-signalstats-1" href="#signalstats-1">11.205 signalstats</a>
  1008. <ul class="no-bullet">
  1009. <li><a id="toc-Examples-106" href="#Examples-106">11.205.1 Examples</a></li>
  1010. </ul></li>
  1011. <li><a id="toc-signature-1" href="#signature-1">11.206 signature</a>
  1012. <ul class="no-bullet">
  1013. <li><a id="toc-Examples-107" href="#Examples-107">11.206.1 Examples</a></li>
  1014. </ul></li>
  1015. <li><a id="toc-smartblur-1" href="#smartblur-1">11.207 smartblur</a></li>
  1016. <li><a id="toc-sobel" href="#sobel">11.208 sobel</a>
  1017. <ul class="no-bullet">
  1018. <li><a id="toc-Commands-123" href="#Commands-123">11.208.1 Commands</a></li>
  1019. </ul></li>
  1020. <li><a id="toc-spp-1" href="#spp-1">11.209 spp</a>
  1021. <ul class="no-bullet">
  1022. <li><a id="toc-Commands-124" href="#Commands-124">11.209.1 Commands</a></li>
  1023. </ul></li>
  1024. <li><a id="toc-sr-1" href="#sr-1">11.210 sr</a></li>
  1025. <li><a id="toc-ssim" href="#ssim">11.211 ssim</a>
  1026. <ul class="no-bullet">
  1027. <li><a id="toc-Examples-108" href="#Examples-108">11.211.1 Examples</a></li>
  1028. </ul></li>
  1029. <li><a id="toc-stereo3d" href="#stereo3d">11.212 stereo3d</a>
  1030. <ul class="no-bullet">
  1031. <li><a id="toc-Examples-109" href="#Examples-109">11.212.1 Examples</a></li>
  1032. </ul></li>
  1033. <li><a id="toc-streamselect_002c-astreamselect" href="#streamselect_002c-astreamselect">11.213 streamselect, astreamselect</a>
  1034. <ul class="no-bullet">
  1035. <li><a id="toc-Commands-125" href="#Commands-125">11.213.1 Commands</a></li>
  1036. <li><a id="toc-Examples-110" href="#Examples-110">11.213.2 Examples</a></li>
  1037. </ul></li>
  1038. <li><a id="toc-subtitles-1" href="#subtitles-1">11.214 subtitles</a></li>
  1039. <li><a id="toc-super2xsai" href="#super2xsai">11.215 super2xsai</a></li>
  1040. <li><a id="toc-swaprect" href="#swaprect">11.216 swaprect</a>
  1041. <ul class="no-bullet">
  1042. <li><a id="toc-Commands-126" href="#Commands-126">11.216.1 Commands</a></li>
  1043. </ul></li>
  1044. <li><a id="toc-swapuv" href="#swapuv">11.217 swapuv</a></li>
  1045. <li><a id="toc-tblend" href="#tblend">11.218 tblend</a></li>
  1046. <li><a id="toc-telecine" href="#telecine">11.219 telecine</a></li>
  1047. <li><a id="toc-thistogram" href="#thistogram">11.220 thistogram</a></li>
  1048. <li><a id="toc-threshold" href="#threshold">11.221 threshold</a>
  1049. <ul class="no-bullet">
  1050. <li><a id="toc-Examples-111" href="#Examples-111">11.221.1 Examples</a></li>
  1051. </ul></li>
  1052. <li><a id="toc-thumbnail" href="#thumbnail">11.222 thumbnail</a>
  1053. <ul class="no-bullet">
  1054. <li><a id="toc-Examples-112" href="#Examples-112">11.222.1 Examples</a></li>
  1055. </ul></li>
  1056. <li><a id="toc-tile-1" href="#tile-1">11.223 tile</a>
  1057. <ul class="no-bullet">
  1058. <li><a id="toc-Examples-113" href="#Examples-113">11.223.1 Examples</a></li>
  1059. </ul></li>
  1060. <li><a id="toc-tinterlace" href="#tinterlace">11.224 tinterlace</a></li>
  1061. <li><a id="toc-tmedian" href="#tmedian">11.225 tmedian</a>
  1062. <ul class="no-bullet">
  1063. <li><a id="toc-Commands-127" href="#Commands-127">11.225.1 Commands</a></li>
  1064. </ul></li>
  1065. <li><a id="toc-tmidequalizer" href="#tmidequalizer">11.226 tmidequalizer</a></li>
  1066. <li><a id="toc-tmix" href="#tmix">11.227 tmix</a>
  1067. <ul class="no-bullet">
  1068. <li><a id="toc-Examples-114" href="#Examples-114">11.227.1 Examples</a></li>
  1069. <li><a id="toc-Commands-128" href="#Commands-128">11.227.2 Commands</a></li>
  1070. </ul></li>
  1071. <li><a id="toc-tonemap-1" href="#tonemap-1">11.228 tonemap</a>
  1072. <ul class="no-bullet">
  1073. <li><a id="toc-Options-2" href="#Options-2">11.228.1 Options</a></li>
  1074. </ul></li>
  1075. <li><a id="toc-tpad" href="#tpad">11.229 tpad</a></li>
  1076. <li><a id="toc-transpose-1" href="#transpose-1">11.230 transpose</a></li>
  1077. <li><a id="toc-transpose_005fnpp" href="#transpose_005fnpp">11.231 transpose_npp</a></li>
  1078. <li><a id="toc-trim" href="#trim">11.232 trim</a></li>
  1079. <li><a id="toc-unpremultiply" href="#unpremultiply">11.233 unpremultiply</a></li>
  1080. <li><a id="toc-unsharp-1" href="#unsharp-1">11.234 unsharp</a>
  1081. <ul class="no-bullet">
  1082. <li><a id="toc-Examples-115" href="#Examples-115">11.234.1 Examples</a></li>
  1083. </ul></li>
  1084. <li><a id="toc-untile-1" href="#untile-1">11.235 untile</a>
  1085. <ul class="no-bullet">
  1086. <li><a id="toc-Examples-116" href="#Examples-116">11.235.1 Examples</a></li>
  1087. </ul></li>
  1088. <li><a id="toc-uspp" href="#uspp">11.236 uspp</a></li>
  1089. <li><a id="toc-v360" href="#v360">11.237 v360</a>
  1090. <ul class="no-bullet">
  1091. <li><a id="toc-Examples-117" href="#Examples-117">11.237.1 Examples</a></li>
  1092. <li><a id="toc-Commands-129" href="#Commands-129">11.237.2 Commands</a></li>
  1093. </ul></li>
  1094. <li><a id="toc-vaguedenoiser" href="#vaguedenoiser">11.238 vaguedenoiser</a></li>
  1095. <li><a id="toc-vectorscope" href="#vectorscope">11.239 vectorscope</a></li>
  1096. <li><a id="toc-vidstabdetect-1" href="#vidstabdetect-1">11.240 vidstabdetect</a>
  1097. <ul class="no-bullet">
  1098. <li><a id="toc-Examples-118" href="#Examples-118">11.240.1 Examples</a></li>
  1099. </ul></li>
  1100. <li><a id="toc-vidstabtransform-1" href="#vidstabtransform-1">11.241 vidstabtransform</a>
  1101. <ul class="no-bullet">
  1102. <li><a id="toc-Options-3" href="#Options-3">11.241.1 Options</a></li>
  1103. <li><a id="toc-Examples-119" href="#Examples-119">11.241.2 Examples</a></li>
  1104. </ul></li>
  1105. <li><a id="toc-vflip" href="#vflip">11.242 vflip</a></li>
  1106. <li><a id="toc-vfrdet" href="#vfrdet">11.243 vfrdet</a></li>
  1107. <li><a id="toc-vibrance" href="#vibrance">11.244 vibrance</a>
  1108. <ul class="no-bullet">
  1109. <li><a id="toc-Commands-130" href="#Commands-130">11.244.1 Commands</a></li>
  1110. </ul></li>
  1111. <li><a id="toc-vif" href="#vif">11.245 vif</a></li>
  1112. <li><a id="toc-vignette-1" href="#vignette-1">11.246 vignette</a>
  1113. <ul class="no-bullet">
  1114. <li><a id="toc-Expressions" href="#Expressions">11.246.1 Expressions</a></li>
  1115. <li><a id="toc-Examples-120" href="#Examples-120">11.246.2 Examples</a></li>
  1116. </ul></li>
  1117. <li><a id="toc-vmafmotion" href="#vmafmotion">11.247 vmafmotion</a></li>
  1118. <li><a id="toc-vstack" href="#vstack">11.248 vstack</a></li>
  1119. <li><a id="toc-w3fdif" href="#w3fdif">11.249 w3fdif</a>
  1120. <ul class="no-bullet">
  1121. <li><a id="toc-Commands-131" href="#Commands-131">11.249.1 Commands</a></li>
  1122. </ul></li>
  1123. <li><a id="toc-waveform" href="#waveform">11.250 waveform</a></li>
  1124. <li><a id="toc-weave_002c-doubleweave" href="#weave_002c-doubleweave">11.251 weave, doubleweave</a>
  1125. <ul class="no-bullet">
  1126. <li><a id="toc-Examples-121" href="#Examples-121">11.251.1 Examples</a></li>
  1127. </ul></li>
  1128. <li><a id="toc-xbr" href="#xbr">11.252 xbr</a></li>
  1129. <li><a id="toc-xfade" href="#xfade">11.253 xfade</a>
  1130. <ul class="no-bullet">
  1131. <li><a id="toc-Examples-122" href="#Examples-122">11.253.1 Examples</a></li>
  1132. </ul></li>
  1133. <li><a id="toc-xmedian" href="#xmedian">11.254 xmedian</a>
  1134. <ul class="no-bullet">
  1135. <li><a id="toc-Commands-132" href="#Commands-132">11.254.1 Commands</a></li>
  1136. </ul></li>
  1137. <li><a id="toc-xstack" href="#xstack">11.255 xstack</a>
  1138. <ul class="no-bullet">
  1139. <li><a id="toc-Examples-123" href="#Examples-123">11.255.1 Examples</a></li>
  1140. </ul></li>
  1141. <li><a id="toc-yadif-1" href="#yadif-1">11.256 yadif</a></li>
  1142. <li><a id="toc-yadif_005fcuda" href="#yadif_005fcuda">11.257 yadif_cuda</a></li>
  1143. <li><a id="toc-yaepblur" href="#yaepblur">11.258 yaepblur</a>
  1144. <ul class="no-bullet">
  1145. <li><a id="toc-Commands-133" href="#Commands-133">11.258.1 Commands</a></li>
  1146. </ul></li>
  1147. <li><a id="toc-zoompan" href="#zoompan">11.259 zoompan</a>
  1148. <ul class="no-bullet">
  1149. <li><a id="toc-Examples-124" href="#Examples-124">11.259.1 Examples</a></li>
  1150. </ul></li>
  1151. <li><a id="toc-zscale-1" href="#zscale-1">11.260 zscale</a>
  1152. <ul class="no-bullet">
  1153. <li><a id="toc-Options-4" href="#Options-4">11.260.1 Options</a></li>
  1154. <li><a id="toc-Commands-134" href="#Commands-134">11.260.2 Commands</a></li>
  1155. </ul></li>
  1156. </ul></li>
  1157. <li><a id="toc-OpenCL-Video-Filters" href="#OpenCL-Video-Filters">12 OpenCL Video Filters</a>
  1158. <ul class="no-bullet">
  1159. <li><a id="toc-avgblur_005fopencl" href="#avgblur_005fopencl">12.1 avgblur_opencl</a>
  1160. <ul class="no-bullet">
  1161. <li><a id="toc-Example" href="#Example">12.1.1 Example</a></li>
  1162. </ul></li>
  1163. <li><a id="toc-boxblur_005fopencl" href="#boxblur_005fopencl">12.2 boxblur_opencl</a>
  1164. <ul class="no-bullet">
  1165. <li><a id="toc-Examples-125" href="#Examples-125">12.2.1 Examples</a></li>
  1166. </ul></li>
  1167. <li><a id="toc-colorkey_005fopencl" href="#colorkey_005fopencl">12.3 colorkey_opencl</a>
  1168. <ul class="no-bullet">
  1169. <li><a id="toc-Examples-126" href="#Examples-126">12.3.1 Examples</a></li>
  1170. </ul></li>
  1171. <li><a id="toc-convolution_005fopencl" href="#convolution_005fopencl">12.4 convolution_opencl</a>
  1172. <ul class="no-bullet">
  1173. <li><a id="toc-Examples-127" href="#Examples-127">12.4.1 Examples</a></li>
  1174. </ul></li>
  1175. <li><a id="toc-erosion_005fopencl" href="#erosion_005fopencl">12.5 erosion_opencl</a>
  1176. <ul class="no-bullet">
  1177. <li><a id="toc-Example-1" href="#Example-1">12.5.1 Example</a></li>
  1178. </ul></li>
  1179. <li><a id="toc-deshake_005fopencl" href="#deshake_005fopencl">12.6 deshake_opencl</a>
  1180. <ul class="no-bullet">
  1181. <li><a id="toc-Examples-128" href="#Examples-128">12.6.1 Examples</a></li>
  1182. </ul></li>
  1183. <li><a id="toc-dilation_005fopencl" href="#dilation_005fopencl">12.7 dilation_opencl</a>
  1184. <ul class="no-bullet">
  1185. <li><a id="toc-Example-2" href="#Example-2">12.7.1 Example</a></li>
  1186. </ul></li>
  1187. <li><a id="toc-nlmeans_005fopencl" href="#nlmeans_005fopencl">12.8 nlmeans_opencl</a></li>
  1188. <li><a id="toc-overlay_005fopencl" href="#overlay_005fopencl">12.9 overlay_opencl</a>
  1189. <ul class="no-bullet">
  1190. <li><a id="toc-Examples-129" href="#Examples-129">12.9.1 Examples</a></li>
  1191. </ul></li>
  1192. <li><a id="toc-pad_005fopencl" href="#pad_005fopencl">12.10 pad_opencl</a></li>
  1193. <li><a id="toc-prewitt_005fopencl" href="#prewitt_005fopencl">12.11 prewitt_opencl</a>
  1194. <ul class="no-bullet">
  1195. <li><a id="toc-Example-3" href="#Example-3">12.11.1 Example</a></li>
  1196. </ul></li>
  1197. <li><a id="toc-program_005fopencl-1" href="#program_005fopencl-1">12.12 program_opencl</a></li>
  1198. <li><a id="toc-roberts_005fopencl" href="#roberts_005fopencl">12.13 roberts_opencl</a>
  1199. <ul class="no-bullet">
  1200. <li><a id="toc-Example-4" href="#Example-4">12.13.1 Example</a></li>
  1201. </ul></li>
  1202. <li><a id="toc-sobel_005fopencl" href="#sobel_005fopencl">12.14 sobel_opencl</a>
  1203. <ul class="no-bullet">
  1204. <li><a id="toc-Example-5" href="#Example-5">12.14.1 Example</a></li>
  1205. </ul></li>
  1206. <li><a id="toc-tonemap_005fopencl" href="#tonemap_005fopencl">12.15 tonemap_opencl</a>
  1207. <ul class="no-bullet">
  1208. <li><a id="toc-Example-6" href="#Example-6">12.15.1 Example</a></li>
  1209. </ul></li>
  1210. <li><a id="toc-unsharp_005fopencl" href="#unsharp_005fopencl">12.16 unsharp_opencl</a>
  1211. <ul class="no-bullet">
  1212. <li><a id="toc-Examples-130" href="#Examples-130">12.16.1 Examples</a></li>
  1213. </ul></li>
  1214. <li><a id="toc-xfade_005fopencl" href="#xfade_005fopencl">12.17 xfade_opencl</a></li>
  1215. </ul></li>
  1216. <li><a id="toc-VAAPI-Video-Filters" href="#VAAPI-Video-Filters">13 VAAPI Video Filters</a>
  1217. <ul class="no-bullet">
  1218. <li><a id="toc-tonemap_005fvaapi" href="#tonemap_005fvaapi">13.1 tonemap_vaapi</a>
  1219. <ul class="no-bullet">
  1220. <li><a id="toc-Example-7" href="#Example-7">13.1.1 Example</a></li>
  1221. </ul></li>
  1222. </ul></li>
  1223. <li><a id="toc-Video-Sources" href="#Video-Sources">14 Video Sources</a>
  1224. <ul class="no-bullet">
  1225. <li><a id="toc-buffer" href="#buffer">14.1 buffer</a></li>
  1226. <li><a id="toc-cellauto" href="#cellauto">14.2 cellauto</a>
  1227. <ul class="no-bullet">
  1228. <li><a id="toc-Examples-131" href="#Examples-131">14.2.1 Examples</a></li>
  1229. </ul></li>
  1230. <li><a id="toc-coreimagesrc-1" href="#coreimagesrc-1">14.3 coreimagesrc</a>
  1231. <ul class="no-bullet">
  1232. <li><a id="toc-Examples-132" href="#Examples-132">14.3.1 Examples</a></li>
  1233. </ul></li>
  1234. <li><a id="toc-gradients" href="#gradients">14.4 gradients</a></li>
  1235. <li><a id="toc-mandelbrot" href="#mandelbrot">14.5 mandelbrot</a></li>
  1236. <li><a id="toc-mptestsrc" href="#mptestsrc">14.6 mptestsrc</a></li>
  1237. <li><a id="toc-frei0r_005fsrc" href="#frei0r_005fsrc">14.7 frei0r_src</a></li>
  1238. <li><a id="toc-life" href="#life">14.8 life</a>
  1239. <ul class="no-bullet">
  1240. <li><a id="toc-Examples-133" href="#Examples-133">14.8.1 Examples</a></li>
  1241. </ul></li>
  1242. <li><a id="toc-allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc" href="#allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc">14.9 allrgb, allyuv, color, haldclutsrc, nullsrc, pal75bars, pal100bars, rgbtestsrc, smptebars, smptehdbars, testsrc, testsrc2, yuvtestsrc</a>
  1243. <ul class="no-bullet">
  1244. <li><a id="toc-Examples-134" href="#Examples-134">14.9.1 Examples</a></li>
  1245. <li><a id="toc-Commands-135" href="#Commands-135">14.9.2 Commands</a></li>
  1246. </ul></li>
  1247. <li><a id="toc-openclsrc" href="#openclsrc">14.10 openclsrc</a></li>
  1248. <li><a id="toc-sierpinski" href="#sierpinski">14.11 sierpinski</a></li>
  1249. </ul></li>
  1250. <li><a id="toc-Video-Sinks" href="#Video-Sinks">15 Video Sinks</a>
  1251. <ul class="no-bullet">
  1252. <li><a id="toc-buffersink" href="#buffersink">15.1 buffersink</a></li>
  1253. <li><a id="toc-nullsink" href="#nullsink">15.2 nullsink</a></li>
  1254. </ul></li>
  1255. <li><a id="toc-Multimedia-Filters" href="#Multimedia-Filters">16 Multimedia Filters</a>
  1256. <ul class="no-bullet">
  1257. <li><a id="toc-abitscope" href="#abitscope">16.1 abitscope</a></li>
  1258. <li><a id="toc-adrawgraph" href="#adrawgraph">16.2 adrawgraph</a></li>
  1259. <li><a id="toc-agraphmonitor" href="#agraphmonitor">16.3 agraphmonitor</a></li>
  1260. <li><a id="toc-ahistogram" href="#ahistogram">16.4 ahistogram</a></li>
  1261. <li><a id="toc-aphasemeter" href="#aphasemeter">16.5 aphasemeter</a>
  1262. <ul class="no-bullet">
  1263. <li><a id="toc-phasing-detection" href="#phasing-detection">16.5.1 phasing detection</a></li>
  1264. <li><a id="toc-Examples-135" href="#Examples-135">16.5.2 Examples</a></li>
  1265. </ul></li>
  1266. <li><a id="toc-avectorscope" href="#avectorscope">16.6 avectorscope</a>
  1267. <ul class="no-bullet">
  1268. <li><a id="toc-Examples-136" href="#Examples-136">16.6.1 Examples</a></li>
  1269. </ul></li>
  1270. <li><a id="toc-bench_002c-abench" href="#bench_002c-abench">16.7 bench, abench</a>
  1271. <ul class="no-bullet">
  1272. <li><a id="toc-Examples-137" href="#Examples-137">16.7.1 Examples</a></li>
  1273. </ul></li>
  1274. <li><a id="toc-concat" href="#concat">16.8 concat</a>
  1275. <ul class="no-bullet">
  1276. <li><a id="toc-Examples-138" href="#Examples-138">16.8.1 Examples</a></li>
  1277. <li><a id="toc-Commands-136" href="#Commands-136">16.8.2 Commands</a></li>
  1278. </ul></li>
  1279. <li><a id="toc-ebur128-1" href="#ebur128-1">16.9 ebur128</a>
  1280. <ul class="no-bullet">
  1281. <li><a id="toc-Examples-139" href="#Examples-139">16.9.1 Examples</a></li>
  1282. </ul></li>
  1283. <li><a id="toc-interleave_002c-ainterleave" href="#interleave_002c-ainterleave">16.10 interleave, ainterleave</a>
  1284. <ul class="no-bullet">
  1285. <li><a id="toc-Examples-140" href="#Examples-140">16.10.1 Examples</a></li>
  1286. </ul></li>
  1287. <li><a id="toc-metadata_002c-ametadata" href="#metadata_002c-ametadata">16.11 metadata, ametadata</a>
  1288. <ul class="no-bullet">
  1289. <li><a id="toc-Examples-141" href="#Examples-141">16.11.1 Examples</a></li>
  1290. </ul></li>
  1291. <li><a id="toc-perms_002c-aperms" href="#perms_002c-aperms">16.12 perms, aperms</a></li>
  1292. <li><a id="toc-realtime_002c-arealtime" href="#realtime_002c-arealtime">16.13 realtime, arealtime</a></li>
  1293. <li><a id="toc-select_002c-aselect" href="#select_002c-aselect">16.14 select, aselect</a>
  1294. <ul class="no-bullet">
  1295. <li><a id="toc-Examples-142" href="#Examples-142">16.14.1 Examples</a></li>
  1296. </ul></li>
  1297. <li><a id="toc-sendcmd_002c-asendcmd" href="#sendcmd_002c-asendcmd">16.15 sendcmd, asendcmd</a>
  1298. <ul class="no-bullet">
  1299. <li><a id="toc-Commands-syntax" href="#Commands-syntax">16.15.1 Commands syntax</a></li>
  1300. <li><a id="toc-Examples-143" href="#Examples-143">16.15.2 Examples</a></li>
  1301. </ul></li>
  1302. <li><a id="toc-setpts_002c-asetpts" href="#setpts_002c-asetpts">16.16 setpts, asetpts</a>
  1303. <ul class="no-bullet">
  1304. <li><a id="toc-Examples-144" href="#Examples-144">16.16.1 Examples</a></li>
  1305. </ul></li>
  1306. <li><a id="toc-setrange" href="#setrange">16.17 setrange</a></li>
  1307. <li><a id="toc-settb_002c-asettb" href="#settb_002c-asettb">16.18 settb, asettb</a>
  1308. <ul class="no-bullet">
  1309. <li><a id="toc-Examples-145" href="#Examples-145">16.18.1 Examples</a></li>
  1310. </ul></li>
  1311. <li><a id="toc-showcqt" href="#showcqt">16.19 showcqt</a>
  1312. <ul class="no-bullet">
  1313. <li><a id="toc-Examples-146" href="#Examples-146">16.19.1 Examples</a></li>
  1314. </ul></li>
  1315. <li><a id="toc-showfreqs" href="#showfreqs">16.20 showfreqs</a></li>
  1316. <li><a id="toc-showspatial" href="#showspatial">16.21 showspatial</a></li>
  1317. <li><a id="toc-showspectrum-1" href="#showspectrum-1">16.22 showspectrum</a>
  1318. <ul class="no-bullet">
  1319. <li><a id="toc-Examples-147" href="#Examples-147">16.22.1 Examples</a></li>
  1320. </ul></li>
  1321. <li><a id="toc-showspectrumpic" href="#showspectrumpic">16.23 showspectrumpic</a>
  1322. <ul class="no-bullet">
  1323. <li><a id="toc-Examples-148" href="#Examples-148">16.23.1 Examples</a></li>
  1324. </ul></li>
  1325. <li><a id="toc-showvolume" href="#showvolume">16.24 showvolume</a></li>
  1326. <li><a id="toc-showwaves" href="#showwaves">16.25 showwaves</a>
  1327. <ul class="no-bullet">
  1328. <li><a id="toc-Examples-149" href="#Examples-149">16.25.1 Examples</a></li>
  1329. </ul></li>
  1330. <li><a id="toc-showwavespic" href="#showwavespic">16.26 showwavespic</a>
  1331. <ul class="no-bullet">
  1332. <li><a id="toc-Examples-150" href="#Examples-150">16.26.1 Examples</a></li>
  1333. </ul></li>
  1334. <li><a id="toc-sidedata_002c-asidedata" href="#sidedata_002c-asidedata">16.27 sidedata, asidedata</a></li>
  1335. <li><a id="toc-spectrumsynth" href="#spectrumsynth">16.28 spectrumsynth</a>
  1336. <ul class="no-bullet">
  1337. <li><a id="toc-Examples-151" href="#Examples-151">16.28.1 Examples</a></li>
  1338. </ul></li>
  1339. <li><a id="toc-split_002c-asplit" href="#split_002c-asplit">16.29 split, asplit</a>
  1340. <ul class="no-bullet">
  1341. <li><a id="toc-Examples-152" href="#Examples-152">16.29.1 Examples</a></li>
  1342. </ul></li>
  1343. <li><a id="toc-zmq_002c-azmq" href="#zmq_002c-azmq">16.30 zmq, azmq</a>
  1344. <ul class="no-bullet">
  1345. <li><a id="toc-Examples-153" href="#Examples-153">16.30.1 Examples</a></li>
  1346. </ul></li>
  1347. </ul></li>
  1348. <li><a id="toc-Multimedia-Sources" href="#Multimedia-Sources">17 Multimedia Sources</a>
  1349. <ul class="no-bullet">
  1350. <li><a id="toc-amovie" href="#amovie">17.1 amovie</a></li>
  1351. <li><a id="toc-movie-1" href="#movie-1">17.2 movie</a>
  1352. <ul class="no-bullet">
  1353. <li><a id="toc-Examples-154" href="#Examples-154">17.2.1 Examples</a></li>
  1354. <li><a id="toc-Commands-137" href="#Commands-137">17.2.2 Commands</a></li>
  1355. </ul></li>
  1356. </ul></li>
  1357. <li><a id="toc-See-Also" href="#See-Also">18 See Also</a></li>
  1358. <li><a id="toc-Authors" href="#Authors">19 Authors</a></li>
  1359. </ul>
  1360. </div>
  1361. <a name="Description"></a>
  1362. <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>
  1363. <p>This document describes filters, sources, and sinks provided by the
  1364. libavfilter library.
  1365. </p>
  1366. <a name="Filtering-Introduction"></a>
  1367. <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>
  1368. <p>Filtering in FFmpeg is enabled through the libavfilter library.
  1369. </p>
  1370. <p>In libavfilter, a filter can have multiple inputs and multiple
  1371. outputs.
  1372. To illustrate the sorts of things that are possible, we consider the
  1373. following filtergraph.
  1374. </p>
  1375. <pre class="verbatim"> [main]
  1376. input --&gt; split ---------------------&gt; overlay --&gt; output
  1377. | ^
  1378. |[tmp] [flip]|
  1379. +-----&gt; crop --&gt; vflip -------+
  1380. </pre>
  1381. <p>This filtergraph splits the input stream in two streams, then sends one
  1382. stream through the crop filter and the vflip filter, before merging it
  1383. back with the other stream by overlaying it on top. You can use the
  1384. following command to achieve this:
  1385. </p>
  1386. <div class="example">
  1387. <pre class="example">ffmpeg -i INPUT -vf &quot;split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2&quot; OUTPUT
  1388. </pre></div>
  1389. <p>The result will be that the top half of the video is mirrored
  1390. onto the bottom half of the output video.
  1391. </p>
  1392. <p>Filters in the same linear chain are separated by commas, and distinct
  1393. linear chains of filters are separated by semicolons. In our example,
  1394. <var>crop,vflip</var> are in one linear chain, <var>split</var> and
  1395. <var>overlay</var> are separately in another. The points where the linear
  1396. chains join are labelled by names enclosed in square brackets. In the
  1397. example, the split filter generates two outputs that are associated to
  1398. the labels <var>[main]</var> and <var>[tmp]</var>.
  1399. </p>
  1400. <p>The stream sent to the second output of <var>split</var>, labelled as
  1401. <var>[tmp]</var>, is processed through the <var>crop</var> filter, which crops
  1402. away the lower half part of the video, and then vertically flipped. The
  1403. <var>overlay</var> filter takes in input the first unchanged output of the
  1404. split filter (which was labelled as <var>[main]</var>), and overlay on its
  1405. lower half the output generated by the <var>crop,vflip</var> filterchain.
  1406. </p>
  1407. <p>Some filters take in input a list of parameters: they are specified
  1408. after the filter name and an equal sign, and are separated from each other
  1409. by a colon.
  1410. </p>
  1411. <p>There exist so-called <var>source filters</var> that do not have an
  1412. audio/video input, and <var>sink filters</var> that will not have audio/video
  1413. output.
  1414. </p>
  1415. <a name="graph2dot"></a>
  1416. <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>
  1417. <p>The <samp>graph2dot</samp> program included in the FFmpeg <samp>tools</samp>
  1418. directory can be used to parse a filtergraph description and issue a
  1419. corresponding textual representation in the dot language.
  1420. </p>
  1421. <p>Invoke the command:
  1422. </p><div class="example">
  1423. <pre class="example">graph2dot -h
  1424. </pre></div>
  1425. <p>to see how to use <samp>graph2dot</samp>.
  1426. </p>
  1427. <p>You can then pass the dot description to the <samp>dot</samp> program (from
  1428. the graphviz suite of programs) and obtain a graphical representation
  1429. of the filtergraph.
  1430. </p>
  1431. <p>For example the sequence of commands:
  1432. </p><div class="example">
  1433. <pre class="example">echo <var>GRAPH_DESCRIPTION</var> | \
  1434. tools/graph2dot -o graph.tmp &amp;&amp; \
  1435. dot -Tpng graph.tmp -o graph.png &amp;&amp; \
  1436. display graph.png
  1437. </pre></div>
  1438. <p>can be used to create and display an image representing the graph
  1439. described by the <var>GRAPH_DESCRIPTION</var> string. Note that this string must be
  1440. a complete self-contained graph, with its inputs and outputs explicitly defined.
  1441. For example if your command line is of the form:
  1442. </p><div class="example">
  1443. <pre class="example">ffmpeg -i infile -vf scale=640:360 outfile
  1444. </pre></div>
  1445. <p>your <var>GRAPH_DESCRIPTION</var> string will need to be of the form:
  1446. </p><div class="example">
  1447. <pre class="example">nullsrc,scale=640:360,nullsink
  1448. </pre></div>
  1449. <p>you may also need to set the <var>nullsrc</var> parameters and add a <var>format</var>
  1450. filter in order to simulate a specific input file.
  1451. </p>
  1452. <a name="Filtergraph-description"></a>
  1453. <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>
  1454. <p>A filtergraph is a directed graph of connected filters. It can contain
  1455. cycles, and there can be multiple links between a pair of
  1456. filters. Each link has one input pad on one side connecting it to one
  1457. filter from which it takes its input, and one output pad on the other
  1458. side connecting it to one filter accepting its output.
  1459. </p>
  1460. <p>Each filter in a filtergraph is an instance of a filter class
  1461. registered in the application, which defines the features and the
  1462. number of input and output pads of the filter.
  1463. </p>
  1464. <p>A filter with no input pads is called a &quot;source&quot;, and a filter with no
  1465. output pads is called a &quot;sink&quot;.
  1466. </p>
  1467. <span id="Filtergraph-syntax"></span><a name="Filtergraph-syntax-1"></a>
  1468. <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>
  1469. <p>A filtergraph has a textual representation, which is recognized by the
  1470. <samp>-filter</samp>/<samp>-vf</samp>/<samp>-af</samp> and
  1471. <samp>-filter_complex</samp> options in <code>ffmpeg</code> and
  1472. <samp>-vf</samp>/<samp>-af</samp> in <code>ffplay</code>, and by the
  1473. <code>avfilter_graph_parse_ptr()</code> function defined in
  1474. <samp>libavfilter/avfilter.h</samp>.
  1475. </p>
  1476. <p>A filterchain consists of a sequence of connected filters, each one
  1477. connected to the previous one in the sequence. A filterchain is
  1478. represented by a list of &quot;,&quot;-separated filter descriptions.
  1479. </p>
  1480. <p>A filtergraph consists of a sequence of filterchains. A sequence of
  1481. filterchains is represented by a list of &quot;;&quot;-separated filterchain
  1482. descriptions.
  1483. </p>
  1484. <p>A filter is represented by a string of the form:
  1485. [<var>in_link_1</var>]...[<var>in_link_N</var>]<var>filter_name</var>@<var>id</var>=<var>arguments</var>[<var>out_link_1</var>]...[<var>out_link_M</var>]
  1486. </p>
  1487. <p><var>filter_name</var> is the name of the filter class of which the
  1488. described filter is an instance of, and has to be the name of one of
  1489. the filter classes registered in the program optionally followed by &quot;@<var>id</var>&quot;.
  1490. The name of the filter class is optionally followed by a string
  1491. &quot;=<var>arguments</var>&quot;.
  1492. </p>
  1493. <p><var>arguments</var> is a string which contains the parameters used to
  1494. initialize the filter instance. It may have one of two forms:
  1495. </p><ul>
  1496. <li> A &rsquo;:&rsquo;-separated list of <var>key=value</var> pairs.
  1497. </li><li> A &rsquo;:&rsquo;-separated list of <var>value</var>. In this case, the keys are assumed to be
  1498. the option names in the order they are declared. E.g. the <code>fade</code> filter
  1499. declares three options in this order &ndash; <samp>type</samp>, <samp>start_frame</samp> and
  1500. <samp>nb_frames</samp>. Then the parameter list <var>in:0:30</var> means that the value
  1501. <var>in</var> is assigned to the option <samp>type</samp>, <var>0</var> to
  1502. <samp>start_frame</samp> and <var>30</var> to <samp>nb_frames</samp>.
  1503. </li><li> A &rsquo;:&rsquo;-separated list of mixed direct <var>value</var> and long <var>key=value</var>
  1504. pairs. The direct <var>value</var> must precede the <var>key=value</var> pairs, and
  1505. follow the same constraints order of the previous point. The following
  1506. <var>key=value</var> pairs can be set in any preferred order.
  1507. </li></ul>
  1508. <p>If the option value itself is a list of items (e.g. the <code>format</code> filter
  1509. takes a list of pixel formats), the items in the list are usually separated by
  1510. &lsquo;<samp>|</samp>&rsquo;.
  1511. </p>
  1512. <p>The list of arguments can be quoted using the character &lsquo;<samp>'</samp>&rsquo; as initial
  1513. and ending mark, and the character &lsquo;<samp>\</samp>&rsquo; for escaping the characters
  1514. within the quoted text; otherwise the argument string is considered
  1515. terminated when the next special character (belonging to the set
  1516. &lsquo;<samp>[]=;,</samp>&rsquo;) is encountered.
  1517. </p>
  1518. <p>The name and arguments of the filter are optionally preceded and
  1519. followed by a list of link labels.
  1520. A link label allows one to name a link and associate it to a filter output
  1521. or input pad. The preceding labels <var>in_link_1</var>
  1522. ... <var>in_link_N</var>, are associated to the filter input pads,
  1523. the following labels <var>out_link_1</var> ... <var>out_link_M</var>, are
  1524. associated to the output pads.
  1525. </p>
  1526. <p>When two link labels with the same name are found in the
  1527. filtergraph, a link between the corresponding input and output pad is
  1528. created.
  1529. </p>
  1530. <p>If an output pad is not labelled, it is linked by default to the first
  1531. unlabelled input pad of the next filter in the filterchain.
  1532. For example in the filterchain
  1533. </p><div class="example">
  1534. <pre class="example">nullsrc, split[L1], [L2]overlay, nullsink
  1535. </pre></div>
  1536. <p>the split filter instance has two output pads, and the overlay filter
  1537. instance two input pads. The first output pad of split is labelled
  1538. &quot;L1&quot;, the first input pad of overlay is labelled &quot;L2&quot;, and the second
  1539. output pad of split is linked to the second input pad of overlay,
  1540. which are both unlabelled.
  1541. </p>
  1542. <p>In a filter description, if the input label of the first filter is not
  1543. specified, &quot;in&quot; is assumed; if the output label of the last filter is not
  1544. specified, &quot;out&quot; is assumed.
  1545. </p>
  1546. <p>In a complete filterchain all the unlabelled filter input and output
  1547. pads must be connected. A filtergraph is considered valid if all the
  1548. filter input and output pads of all the filterchains are connected.
  1549. </p>
  1550. <p>Libavfilter will automatically insert <a href="#scale">scale</a> filters where format
  1551. conversion is required. It is possible to specify swscale flags
  1552. for those automatically inserted scalers by prepending
  1553. <code>sws_flags=<var>flags</var>;</code>
  1554. to the filtergraph description.
  1555. </p>
  1556. <p>Here is a BNF description of the filtergraph syntax:
  1557. </p><div class="example">
  1558. <pre class="example"><var>NAME</var> ::= sequence of alphanumeric characters and '_'
  1559. <var>FILTER_NAME</var> ::= <var>NAME</var>[&quot;@&quot;<var>NAME</var>]
  1560. <var>LINKLABEL</var> ::= &quot;[&quot; <var>NAME</var> &quot;]&quot;
  1561. <var>LINKLABELS</var> ::= <var>LINKLABEL</var> [<var>LINKLABELS</var>]
  1562. <var>FILTER_ARGUMENTS</var> ::= sequence of chars (possibly quoted)
  1563. <var>FILTER</var> ::= [<var>LINKLABELS</var>] <var>FILTER_NAME</var> [&quot;=&quot; <var>FILTER_ARGUMENTS</var>] [<var>LINKLABELS</var>]
  1564. <var>FILTERCHAIN</var> ::= <var>FILTER</var> [,<var>FILTERCHAIN</var>]
  1565. <var>FILTERGRAPH</var> ::= [sws_flags=<var>flags</var>;] <var>FILTERCHAIN</var> [;<var>FILTERGRAPH</var>]
  1566. </pre></div>
  1567. <span id="filtergraph-escaping"></span><a name="Notes-on-filtergraph-escaping"></a>
  1568. <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>
  1569. <p>Filtergraph description composition entails several levels of
  1570. escaping. See <a href="ffmpeg-utils.html#quoting_005fand_005fescaping">(ffmpeg-utils)the &quot;Quoting and escaping&quot;
  1571. section in the ffmpeg-utils(1) manual</a> for more
  1572. information about the employed escaping procedure.
  1573. </p>
  1574. <p>A first level escaping affects the content of each filter option
  1575. value, which may contain the special character <code>:</code> used to
  1576. separate values, or one of the escaping characters <code>\'</code>.
  1577. </p>
  1578. <p>A second level escaping affects the whole filter description, which
  1579. may contain the escaping characters <code>\'</code> or the special
  1580. characters <code>[],;</code> used by the filtergraph description.
  1581. </p>
  1582. <p>Finally, when you specify a filtergraph on a shell commandline, you
  1583. need to perform a third level escaping for the shell special
  1584. characters contained within it.
  1585. </p>
  1586. <p>For example, consider the following string to be embedded in
  1587. the <a href="#drawtext">drawtext</a> filter description <samp>text</samp> value:
  1588. </p><div class="example">
  1589. <pre class="example">this is a 'string': may contain one, or more, special characters
  1590. </pre></div>
  1591. <p>This string contains the <code>'</code> special escaping character, and the
  1592. <code>:</code> special character, so it needs to be escaped in this way:
  1593. </p><div class="example">
  1594. <pre class="example">text=this is a \'string\'\: may contain one, or more, special characters
  1595. </pre></div>
  1596. <p>A second level of escaping is required when embedding the filter
  1597. description in a filtergraph description, in order to escape all the
  1598. filtergraph special characters. Thus the example above becomes:
  1599. </p><div class="example">
  1600. <pre class="example">drawtext=text=this is a \\\'string\\\'\\: may contain one\, or more\, special characters
  1601. </pre></div>
  1602. <p>(note that in addition to the <code>\'</code> escaping special characters,
  1603. also <code>,</code> needs to be escaped).
  1604. </p>
  1605. <p>Finally an additional level of escaping is needed when writing the
  1606. filtergraph description in a shell command, which depends on the
  1607. escaping rules of the adopted shell. For example, assuming that
  1608. <code>\</code> is special and needs to be escaped with another <code>\</code>, the
  1609. previous string will finally result in:
  1610. </p><div class="example">
  1611. <pre class="example">-vf &quot;drawtext=text=this is a \\\\\\'string\\\\\\'\\\\: may contain one\\, or more\\, special characters&quot;
  1612. </pre></div>
  1613. <a name="Timeline-editing"></a>
  1614. <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>
  1615. <p>Some filters support a generic <samp>enable</samp> option. For the filters
  1616. supporting timeline editing, this option can be set to an expression which is
  1617. evaluated before sending a frame to the filter. If the evaluation is non-zero,
  1618. the filter will be enabled, otherwise the frame will be sent unchanged to the
  1619. next filter in the filtergraph.
  1620. </p>
  1621. <p>The expression accepts the following values:
  1622. </p><dl compact="compact">
  1623. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  1624. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  1625. </p>
  1626. </dd>
  1627. <dt>&lsquo;<samp>n</samp>&rsquo;</dt>
  1628. <dd><p>sequential number of the input frame, starting from 0
  1629. </p>
  1630. </dd>
  1631. <dt>&lsquo;<samp>pos</samp>&rsquo;</dt>
  1632. <dd><p>the position in the file of the input frame, NAN if unknown
  1633. </p>
  1634. </dd>
  1635. <dt>&lsquo;<samp>w</samp>&rsquo;</dt>
  1636. <dt>&lsquo;<samp>h</samp>&rsquo;</dt>
  1637. <dd><p>width and height of the input frame if video
  1638. </p></dd>
  1639. </dl>
  1640. <p>Additionally, these filters support an <samp>enable</samp> command that can be used
  1641. to re-define the expression.
  1642. </p>
  1643. <p>Like any other filtering option, the <samp>enable</samp> option follows the same
  1644. rules.
  1645. </p>
  1646. <p>For example, to enable a blur filter (<a href="#smartblur">smartblur</a>) from 10 seconds to 3
  1647. minutes, and a <a href="#curves">curves</a> filter starting at 3 seconds:
  1648. </p><div class="example">
  1649. <pre class="example">smartblur = enable='between(t,10,3*60)',
  1650. curves = enable='gte(t,3)' : preset=cross_process
  1651. </pre></div>
  1652. <p>See <code>ffmpeg -filters</code> to view which filters have timeline support.
  1653. </p>
  1654. <span id="commands"></span><a name="Changing-options-at-runtime-with-a-command"></a>
  1655. <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>
  1656. <p>Some options can be changed during the operation of the filter using
  1657. a command. These options are marked &rsquo;T&rsquo; on the output of
  1658. <code>ffmpeg</code> <samp>-h filter=&lt;name of filter&gt;</samp>.
  1659. The name of the command is the name of the option and the argument is
  1660. the new value.
  1661. </p>
  1662. <span id="framesync"></span><a name="Options-for-filters-with-several-inputs-_0028framesync_0029"></a>
  1663. <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>
  1664. <p>Some filters with several inputs support a common set of options.
  1665. These options can only be set by name, not with the short notation.
  1666. </p>
  1667. <dl compact="compact">
  1668. <dt><samp>eof_action</samp></dt>
  1669. <dd><p>The action to take when EOF is encountered on the secondary input; it accepts
  1670. one of the following values:
  1671. </p>
  1672. <dl compact="compact">
  1673. <dt><samp>repeat</samp></dt>
  1674. <dd><p>Repeat the last frame (the default).
  1675. </p></dd>
  1676. <dt><samp>endall</samp></dt>
  1677. <dd><p>End both streams.
  1678. </p></dd>
  1679. <dt><samp>pass</samp></dt>
  1680. <dd><p>Pass the main input through.
  1681. </p></dd>
  1682. </dl>
  1683. </dd>
  1684. <dt><samp>shortest</samp></dt>
  1685. <dd><p>If set to 1, force the output to terminate when the shortest input
  1686. terminates. Default value is 0.
  1687. </p>
  1688. </dd>
  1689. <dt><samp>repeatlast</samp></dt>
  1690. <dd><p>If set to 1, force the filter to extend the last frame of secondary streams
  1691. until the end of the primary stream. A value of 0 disables this behavior.
  1692. Default value is 1.
  1693. </p></dd>
  1694. </dl>
  1695. <a name="Audio-Filters"></a>
  1696. <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>
  1697. <p>When you configure your FFmpeg build, you can disable any of the
  1698. existing filters using <code>--disable-filters</code>.
  1699. The configure output will show the audio filters included in your
  1700. build.
  1701. </p>
  1702. <p>Below is a description of the currently available audio filters.
  1703. </p>
  1704. <a name="acompressor"></a>
  1705. <h3 class="section">8.1 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>
  1706. <p>A compressor is mainly used to reduce the dynamic range of a signal.
  1707. Especially modern music is mostly compressed at a high ratio to
  1708. improve the overall loudness. It&rsquo;s done to get the highest attention
  1709. of a listener, &quot;fatten&quot; the sound and bring more &quot;power&quot; to the track.
  1710. If a signal is compressed too much it may sound dull or &quot;dead&quot;
  1711. afterwards or it may start to &quot;pump&quot; (which could be a powerful effect
  1712. but can also destroy a track completely).
  1713. The right compression is the key to reach a professional sound and is
  1714. the high art of mixing and mastering. Because of its complex settings
  1715. it may take a long time to get the right feeling for this kind of effect.
  1716. </p>
  1717. <p>Compression is done by detecting the volume above a chosen level
  1718. <code>threshold</code> and dividing it by the factor set with <code>ratio</code>.
  1719. So if you set the threshold to -12dB and your signal reaches -6dB a ratio
  1720. of 2:1 will result in a signal at -9dB. Because an exact manipulation of
  1721. the signal would cause distortion of the waveform the reduction can be
  1722. levelled over the time. This is done by setting &quot;Attack&quot; and &quot;Release&quot;.
  1723. <code>attack</code> determines how long the signal has to rise above the threshold
  1724. before any reduction will occur and <code>release</code> sets the time the signal
  1725. has to fall below the threshold to reduce the reduction again. Shorter signals
  1726. than the chosen attack time will be left untouched.
  1727. The overall reduction of the signal can be made up afterwards with the
  1728. <code>makeup</code> setting. So compressing the peaks of a signal about 6dB and
  1729. raising the makeup to this level results in a signal twice as loud than the
  1730. source. To gain a softer entry in the compression the <code>knee</code> flattens the
  1731. hard edge at the threshold in the range of the chosen decibels.
  1732. </p>
  1733. <p>The filter accepts the following options:
  1734. </p>
  1735. <dl compact="compact">
  1736. <dt><samp>level_in</samp></dt>
  1737. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  1738. </p>
  1739. </dd>
  1740. <dt><samp>mode</samp></dt>
  1741. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  1742. Default is <code>downward</code>.
  1743. </p>
  1744. </dd>
  1745. <dt><samp>threshold</samp></dt>
  1746. <dd><p>If a signal of stream rises above this level it will affect the gain
  1747. reduction.
  1748. By default it is 0.125. Range is between 0.00097563 and 1.
  1749. </p>
  1750. </dd>
  1751. <dt><samp>ratio</samp></dt>
  1752. <dd><p>Set a ratio by which the signal is reduced. 1:2 means that if the level
  1753. rose 4dB above the threshold, it will be only 2dB above after the reduction.
  1754. Default is 2. Range is between 1 and 20.
  1755. </p>
  1756. </dd>
  1757. <dt><samp>attack</samp></dt>
  1758. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  1759. reduction starts. Default is 20. Range is between 0.01 and 2000.
  1760. </p>
  1761. </dd>
  1762. <dt><samp>release</samp></dt>
  1763. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  1764. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  1765. </p>
  1766. </dd>
  1767. <dt><samp>makeup</samp></dt>
  1768. <dd><p>Set the amount by how much signal will be amplified after processing.
  1769. Default is 1. Range is from 1 to 64.
  1770. </p>
  1771. </dd>
  1772. <dt><samp>knee</samp></dt>
  1773. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  1774. Default is 2.82843. Range is between 1 and 8.
  1775. </p>
  1776. </dd>
  1777. <dt><samp>link</samp></dt>
  1778. <dd><p>Choose if the <code>average</code> level between all channels of input stream
  1779. or the louder(<code>maximum</code>) channel of input stream affects the
  1780. reduction. Default is <code>average</code>.
  1781. </p>
  1782. </dd>
  1783. <dt><samp>detection</samp></dt>
  1784. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  1785. of <code>rms</code>. Default is <code>rms</code> which is mostly smoother.
  1786. </p>
  1787. </dd>
  1788. <dt><samp>mix</samp></dt>
  1789. <dd><p>How much to use compressed signal in output. Default is 1.
  1790. Range is between 0 and 1.
  1791. </p></dd>
  1792. </dl>
  1793. <a name="Commands"></a>
  1794. <h4 class="subsection">8.1.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>
  1795. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  1796. </p>
  1797. <a name="acontrast"></a>
  1798. <h3 class="section">8.2 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>
  1799. <p>Simple audio dynamic range compression/expansion filter.
  1800. </p>
  1801. <p>The filter accepts the following options:
  1802. </p>
  1803. <dl compact="compact">
  1804. <dt><samp>contrast</samp></dt>
  1805. <dd><p>Set contrast. Default is 33. Allowed range is between 0 and 100.
  1806. </p></dd>
  1807. </dl>
  1808. <a name="acopy"></a>
  1809. <h3 class="section">8.3 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>
  1810. <p>Copy the input audio source unchanged to the output. This is mainly useful for
  1811. testing purposes.
  1812. </p>
  1813. <a name="acrossfade"></a>
  1814. <h3 class="section">8.4 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>
  1815. <p>Apply cross fade from one input audio stream to another input audio stream.
  1816. The cross fade is applied for specified duration near the end of first stream.
  1817. </p>
  1818. <p>The filter accepts the following options:
  1819. </p>
  1820. <dl compact="compact">
  1821. <dt><samp>nb_samples, ns</samp></dt>
  1822. <dd><p>Specify the number of samples for which the cross fade effect has to last.
  1823. At the end of the cross fade effect the first input audio will be completely
  1824. silent. Default is 44100.
  1825. </p>
  1826. </dd>
  1827. <dt><samp>duration, d</samp></dt>
  1828. <dd><p>Specify the duration of the cross fade effect. See
  1829. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  1830. for the accepted syntax.
  1831. By default the duration is determined by <var>nb_samples</var>.
  1832. If set this option is used instead of <var>nb_samples</var>.
  1833. </p>
  1834. </dd>
  1835. <dt><samp>overlap, o</samp></dt>
  1836. <dd><p>Should first stream end overlap with second stream start. Default is enabled.
  1837. </p>
  1838. </dd>
  1839. <dt><samp>curve1</samp></dt>
  1840. <dd><p>Set curve for cross fade transition for first stream.
  1841. </p>
  1842. </dd>
  1843. <dt><samp>curve2</samp></dt>
  1844. <dd><p>Set curve for cross fade transition for second stream.
  1845. </p>
  1846. <p>For description of available curve types see <a href="#afade">afade</a> filter description.
  1847. </p></dd>
  1848. </dl>
  1849. <a name="Examples"></a>
  1850. <h4 class="subsection">8.4.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>
  1851. <ul>
  1852. <li> Cross fade from one input to another:
  1853. <div class="example">
  1854. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:c1=exp:c2=exp output.flac
  1855. </pre></div>
  1856. </li><li> Cross fade from one input to another but without overlapping:
  1857. <div class="example">
  1858. <pre class="example">ffmpeg -i first.flac -i second.flac -filter_complex acrossfade=d=10:o=0:c1=exp:c2=exp output.flac
  1859. </pre></div>
  1860. </li></ul>
  1861. <a name="acrossover"></a>
  1862. <h3 class="section">8.5 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>
  1863. <p>Split audio stream into several bands.
  1864. </p>
  1865. <p>This filter splits audio stream into two or more frequency ranges.
  1866. Summing all streams back will give flat output.
  1867. </p>
  1868. <p>The filter accepts the following options:
  1869. </p>
  1870. <dl compact="compact">
  1871. <dt><samp>split</samp></dt>
  1872. <dd><p>Set split frequencies. Those must be positive and increasing.
  1873. </p>
  1874. </dd>
  1875. <dt><samp>order</samp></dt>
  1876. <dd><p>Set filter order for each band split. This controls filter roll-off or steepness
  1877. of filter transfer function.
  1878. Available values are:
  1879. </p>
  1880. <dl compact="compact">
  1881. <dt>&lsquo;<samp>2nd</samp>&rsquo;</dt>
  1882. <dd><p>12 dB per octave.
  1883. </p></dd>
  1884. <dt>&lsquo;<samp>4th</samp>&rsquo;</dt>
  1885. <dd><p>24 dB per octave.
  1886. </p></dd>
  1887. <dt>&lsquo;<samp>6th</samp>&rsquo;</dt>
  1888. <dd><p>36 dB per octave.
  1889. </p></dd>
  1890. <dt>&lsquo;<samp>8th</samp>&rsquo;</dt>
  1891. <dd><p>48 dB per octave.
  1892. </p></dd>
  1893. <dt>&lsquo;<samp>10th</samp>&rsquo;</dt>
  1894. <dd><p>60 dB per octave.
  1895. </p></dd>
  1896. <dt>&lsquo;<samp>12th</samp>&rsquo;</dt>
  1897. <dd><p>72 dB per octave.
  1898. </p></dd>
  1899. <dt>&lsquo;<samp>14th</samp>&rsquo;</dt>
  1900. <dd><p>84 dB per octave.
  1901. </p></dd>
  1902. <dt>&lsquo;<samp>16th</samp>&rsquo;</dt>
  1903. <dd><p>96 dB per octave.
  1904. </p></dd>
  1905. <dt>&lsquo;<samp>18th</samp>&rsquo;</dt>
  1906. <dd><p>108 dB per octave.
  1907. </p></dd>
  1908. <dt>&lsquo;<samp>20th</samp>&rsquo;</dt>
  1909. <dd><p>120 dB per octave.
  1910. </p></dd>
  1911. </dl>
  1912. <p>Default is <var>4th</var>.
  1913. </p>
  1914. </dd>
  1915. <dt><samp>level</samp></dt>
  1916. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  1917. </p>
  1918. </dd>
  1919. <dt><samp>gains</samp></dt>
  1920. <dd><p>Set output gain for each band. Default value is 1 for all bands.
  1921. </p></dd>
  1922. </dl>
  1923. <a name="Examples-1"></a>
  1924. <h4 class="subsection">8.5.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>
  1925. <ul>
  1926. <li> Split input audio stream into two bands (low and high) with split frequency of 1500 Hz,
  1927. each band will be in separate stream:
  1928. <div class="example">
  1929. <pre class="example">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  1930. </pre></div>
  1931. </li><li> Same as above, but with higher filter order:
  1932. <div class="example">
  1933. <pre class="example">ffmpeg -i in.flac -filter_complex 'acrossover=split=1500:order=8th[LOW][HIGH]' -map '[LOW]' low.wav -map '[HIGH]' high.wav
  1934. </pre></div>
  1935. </li><li> Same as above, but also with additional middle band (frequencies between 1500 and 8000):
  1936. <div class="example">
  1937. <pre class="example">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
  1938. </pre></div>
  1939. </li></ul>
  1940. <a name="acrusher"></a>
  1941. <h3 class="section">8.6 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>
  1942. <p>Reduce audio bit resolution.
  1943. </p>
  1944. <p>This filter is bit crusher with enhanced functionality. A bit crusher
  1945. is used to audibly reduce number of bits an audio signal is sampled
  1946. with. This doesn&rsquo;t change the bit depth at all, it just produces the
  1947. effect. Material reduced in bit depth sounds more harsh and &quot;digital&quot;.
  1948. This filter is able to even round to continuous values instead of discrete
  1949. bit depths.
  1950. Additionally it has a D/C offset which results in different crushing of
  1951. the lower and the upper half of the signal.
  1952. An Anti-Aliasing setting is able to produce &quot;softer&quot; crushing sounds.
  1953. </p>
  1954. <p>Another feature of this filter is the logarithmic mode.
  1955. This setting switches from linear distances between bits to logarithmic ones.
  1956. The result is a much more &quot;natural&quot; sounding crusher which doesn&rsquo;t gate low
  1957. signals for example. The human ear has a logarithmic perception,
  1958. so this kind of crushing is much more pleasant.
  1959. Logarithmic crushing is also able to get anti-aliased.
  1960. </p>
  1961. <p>The filter accepts the following options:
  1962. </p>
  1963. <dl compact="compact">
  1964. <dt><samp>level_in</samp></dt>
  1965. <dd><p>Set level in.
  1966. </p>
  1967. </dd>
  1968. <dt><samp>level_out</samp></dt>
  1969. <dd><p>Set level out.
  1970. </p>
  1971. </dd>
  1972. <dt><samp>bits</samp></dt>
  1973. <dd><p>Set bit reduction.
  1974. </p>
  1975. </dd>
  1976. <dt><samp>mix</samp></dt>
  1977. <dd><p>Set mixing amount.
  1978. </p>
  1979. </dd>
  1980. <dt><samp>mode</samp></dt>
  1981. <dd><p>Can be linear: <code>lin</code> or logarithmic: <code>log</code>.
  1982. </p>
  1983. </dd>
  1984. <dt><samp>dc</samp></dt>
  1985. <dd><p>Set DC.
  1986. </p>
  1987. </dd>
  1988. <dt><samp>aa</samp></dt>
  1989. <dd><p>Set anti-aliasing.
  1990. </p>
  1991. </dd>
  1992. <dt><samp>samples</samp></dt>
  1993. <dd><p>Set sample reduction.
  1994. </p>
  1995. </dd>
  1996. <dt><samp>lfo</samp></dt>
  1997. <dd><p>Enable LFO. By default disabled.
  1998. </p>
  1999. </dd>
  2000. <dt><samp>lforange</samp></dt>
  2001. <dd><p>Set LFO range.
  2002. </p>
  2003. </dd>
  2004. <dt><samp>lforate</samp></dt>
  2005. <dd><p>Set LFO rate.
  2006. </p></dd>
  2007. </dl>
  2008. <a name="Commands-1"></a>
  2009. <h4 class="subsection">8.6.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>
  2010. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2011. </p>
  2012. <a name="acue"></a>
  2013. <h3 class="section">8.7 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>
  2014. <p>Delay audio filtering until a given wallclock timestamp. See the <a href="#cue">cue</a>
  2015. filter.
  2016. </p>
  2017. <a name="adeclick"></a>
  2018. <h3 class="section">8.8 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>
  2019. <p>Remove impulsive noise from input audio.
  2020. </p>
  2021. <p>Samples detected as impulsive noise are replaced by interpolated samples using
  2022. autoregressive modelling.
  2023. </p>
  2024. <dl compact="compact">
  2025. <dt><samp>window, w</samp></dt>
  2026. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to
  2027. <code>100</code>. Default value is <code>55</code> milliseconds.
  2028. This sets size of window which will be processed at once.
  2029. </p>
  2030. </dd>
  2031. <dt><samp>overlap, o</samp></dt>
  2032. <dd><p>Set window overlap, in percentage of window size. Allowed range is from
  2033. <code>50</code> to <code>95</code>. Default value is <code>75</code> percent.
  2034. Setting this to a very high value increases impulsive noise removal but makes
  2035. whole process much slower.
  2036. </p>
  2037. </dd>
  2038. <dt><samp>arorder, a</samp></dt>
  2039. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  2040. <code>0</code> to <code>25</code>. Default value is <code>2</code> percent. This option also
  2041. controls quality of interpolated samples using neighbour good samples.
  2042. </p>
  2043. </dd>
  2044. <dt><samp>threshold, t</samp></dt>
  2045. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  2046. Default value is <code>2</code>.
  2047. This controls the strength of impulsive noise which is going to be removed.
  2048. The lower value, the more samples will be detected as impulsive noise.
  2049. </p>
  2050. </dd>
  2051. <dt><samp>burst, b</samp></dt>
  2052. <dd><p>Set burst fusion, in percentage of window size. Allowed range is <code>0</code> to
  2053. <code>10</code>. Default value is <code>2</code>.
  2054. If any two samples detected as noise are spaced less than this value then any
  2055. sample between those two samples will be also detected as noise.
  2056. </p>
  2057. </dd>
  2058. <dt><samp>method, m</samp></dt>
  2059. <dd><p>Set overlap method.
  2060. </p>
  2061. <p>It accepts the following values:
  2062. </p><dl compact="compact">
  2063. <dt><samp>add, a</samp></dt>
  2064. <dd><p>Select overlap-add method. Even not interpolated samples are slightly
  2065. changed with this method.
  2066. </p>
  2067. </dd>
  2068. <dt><samp>save, s</samp></dt>
  2069. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  2070. </p></dd>
  2071. </dl>
  2072. <p>Default value is <code>a</code>.
  2073. </p></dd>
  2074. </dl>
  2075. <a name="adeclip"></a>
  2076. <h3 class="section">8.9 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>
  2077. <p>Remove clipped samples from input audio.
  2078. </p>
  2079. <p>Samples detected as clipped are replaced by interpolated samples using
  2080. autoregressive modelling.
  2081. </p>
  2082. <dl compact="compact">
  2083. <dt><samp>window, w</samp></dt>
  2084. <dd><p>Set window size, in milliseconds. Allowed range is from <code>10</code> to <code>100</code>.
  2085. Default value is <code>55</code> milliseconds.
  2086. This sets size of window which will be processed at once.
  2087. </p>
  2088. </dd>
  2089. <dt><samp>overlap, o</samp></dt>
  2090. <dd><p>Set window overlap, in percentage of window size. Allowed range is from <code>50</code>
  2091. to <code>95</code>. Default value is <code>75</code> percent.
  2092. </p>
  2093. </dd>
  2094. <dt><samp>arorder, a</samp></dt>
  2095. <dd><p>Set autoregression order, in percentage of window size. Allowed range is from
  2096. <code>0</code> to <code>25</code>. Default value is <code>8</code> percent. This option also controls
  2097. quality of interpolated samples using neighbour good samples.
  2098. </p>
  2099. </dd>
  2100. <dt><samp>threshold, t</samp></dt>
  2101. <dd><p>Set threshold value. Allowed range is from <code>1</code> to <code>100</code>.
  2102. Default value is <code>10</code>. Higher values make clip detection less aggressive.
  2103. </p>
  2104. </dd>
  2105. <dt><samp>hsize, n</samp></dt>
  2106. <dd><p>Set size of histogram used to detect clips. Allowed range is from <code>100</code> to <code>9999</code>.
  2107. Default value is <code>1000</code>. Higher values make clip detection less aggressive.
  2108. </p>
  2109. </dd>
  2110. <dt><samp>method, m</samp></dt>
  2111. <dd><p>Set overlap method.
  2112. </p>
  2113. <p>It accepts the following values:
  2114. </p><dl compact="compact">
  2115. <dt><samp>add, a</samp></dt>
  2116. <dd><p>Select overlap-add method. Even not interpolated samples are slightly changed
  2117. with this method.
  2118. </p>
  2119. </dd>
  2120. <dt><samp>save, s</samp></dt>
  2121. <dd><p>Select overlap-save method. Not interpolated samples remain unchanged.
  2122. </p></dd>
  2123. </dl>
  2124. <p>Default value is <code>a</code>.
  2125. </p></dd>
  2126. </dl>
  2127. <a name="adelay"></a>
  2128. <h3 class="section">8.10 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>
  2129. <p>Delay one or more audio channels.
  2130. </p>
  2131. <p>Samples in delayed channel are filled with silence.
  2132. </p>
  2133. <p>The filter accepts the following option:
  2134. </p>
  2135. <dl compact="compact">
  2136. <dt><samp>delays</samp></dt>
  2137. <dd><p>Set list of delays in milliseconds for each channel separated by &rsquo;|&rsquo;.
  2138. Unused delays will be silently ignored. If number of given delays is
  2139. smaller than number of channels all remaining channels will not be delayed.
  2140. If you want to delay exact number of samples, append &rsquo;S&rsquo; to number.
  2141. If you want instead to delay in seconds, append &rsquo;s&rsquo; to number.
  2142. </p>
  2143. </dd>
  2144. <dt><samp>all</samp></dt>
  2145. <dd><p>Use last set delay for all remaining channels. By default is disabled.
  2146. This option if enabled changes how option <code>delays</code> is interpreted.
  2147. </p></dd>
  2148. </dl>
  2149. <a name="Examples-2"></a>
  2150. <h4 class="subsection">8.10.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>
  2151. <ul>
  2152. <li> Delay first channel by 1.5 seconds, the third channel by 0.5 seconds and leave
  2153. the second channel (and any other channels that may be present) unchanged.
  2154. <div class="example">
  2155. <pre class="example">adelay=1500|0|500
  2156. </pre></div>
  2157. </li><li> Delay second channel by 500 samples, the third channel by 700 samples and leave
  2158. the first channel (and any other channels that may be present) unchanged.
  2159. <div class="example">
  2160. <pre class="example">adelay=0|500S|700S
  2161. </pre></div>
  2162. </li><li> Delay all channels by same number of samples:
  2163. <div class="example">
  2164. <pre class="example">adelay=delays=64S:all=1
  2165. </pre></div>
  2166. </li></ul>
  2167. <a name="adenorm"></a>
  2168. <h3 class="section">8.11 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>
  2169. <p>Remedy denormals in audio by adding extremely low-level noise.
  2170. </p>
  2171. <p>This filter shall be placed before any filter that can produce denormals.
  2172. </p>
  2173. <p>A description of the accepted parameters follows.
  2174. </p>
  2175. <dl compact="compact">
  2176. <dt><samp>level</samp></dt>
  2177. <dd><p>Set level of added noise in dB. Default is <code>-351</code>.
  2178. Allowed range is from -451 to -90.
  2179. </p>
  2180. </dd>
  2181. <dt><samp>type</samp></dt>
  2182. <dd><p>Set type of added noise.
  2183. </p>
  2184. <dl compact="compact">
  2185. <dt><samp>dc</samp></dt>
  2186. <dd><p>Add DC signal.
  2187. </p></dd>
  2188. <dt><samp>ac</samp></dt>
  2189. <dd><p>Add AC signal.
  2190. </p></dd>
  2191. <dt><samp>square</samp></dt>
  2192. <dd><p>Add square signal.
  2193. </p></dd>
  2194. <dt><samp>pulse</samp></dt>
  2195. <dd><p>Add pulse signal.
  2196. </p></dd>
  2197. </dl>
  2198. <p>Default is <code>dc</code>.
  2199. </p></dd>
  2200. </dl>
  2201. <a name="Commands-2"></a>
  2202. <h4 class="subsection">8.11.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>
  2203. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2204. </p>
  2205. <a name="aderivative_002c-aintegral"></a>
  2206. <h3 class="section">8.12 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>
  2207. <p>Compute derivative/integral of audio stream.
  2208. </p>
  2209. <p>Applying both filters one after another produces original audio.
  2210. </p>
  2211. <a name="aecho"></a>
  2212. <h3 class="section">8.13 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>
  2213. <p>Apply echoing to the input audio.
  2214. </p>
  2215. <p>Echoes are reflected sound and can occur naturally amongst mountains
  2216. (and sometimes large buildings) when talking or shouting; digital echo
  2217. effects emulate this behaviour and are often used to help fill out the
  2218. sound of a single instrument or vocal. The time difference between the
  2219. original signal and the reflection is the <code>delay</code>, and the
  2220. loudness of the reflected signal is the <code>decay</code>.
  2221. Multiple echoes can have different delays and decays.
  2222. </p>
  2223. <p>A description of the accepted parameters follows.
  2224. </p>
  2225. <dl compact="compact">
  2226. <dt><samp>in_gain</samp></dt>
  2227. <dd><p>Set input gain of reflected signal. Default is <code>0.6</code>.
  2228. </p>
  2229. </dd>
  2230. <dt><samp>out_gain</samp></dt>
  2231. <dd><p>Set output gain of reflected signal. Default is <code>0.3</code>.
  2232. </p>
  2233. </dd>
  2234. <dt><samp>delays</samp></dt>
  2235. <dd><p>Set list of time intervals in milliseconds between original signal and reflections
  2236. separated by &rsquo;|&rsquo;. Allowed range for each <code>delay</code> is <code>(0 - 90000.0]</code>.
  2237. Default is <code>1000</code>.
  2238. </p>
  2239. </dd>
  2240. <dt><samp>decays</samp></dt>
  2241. <dd><p>Set list of loudness of reflected signals separated by &rsquo;|&rsquo;.
  2242. Allowed range for each <code>decay</code> is <code>(0 - 1.0]</code>.
  2243. Default is <code>0.5</code>.
  2244. </p></dd>
  2245. </dl>
  2246. <a name="Examples-3"></a>
  2247. <h4 class="subsection">8.13.1 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>
  2248. <ul>
  2249. <li> Make it sound as if there are twice as many instruments as are actually playing:
  2250. <div class="example">
  2251. <pre class="example">aecho=0.8:0.88:60:0.4
  2252. </pre></div>
  2253. </li><li> If delay is very short, then it sounds like a (metallic) robot playing music:
  2254. <div class="example">
  2255. <pre class="example">aecho=0.8:0.88:6:0.4
  2256. </pre></div>
  2257. </li><li> A longer delay will sound like an open air concert in the mountains:
  2258. <div class="example">
  2259. <pre class="example">aecho=0.8:0.9:1000:0.3
  2260. </pre></div>
  2261. </li><li> Same as above but with one more mountain:
  2262. <div class="example">
  2263. <pre class="example">aecho=0.8:0.9:1000|1800:0.3|0.25
  2264. </pre></div>
  2265. </li></ul>
  2266. <a name="aemphasis"></a>
  2267. <h3 class="section">8.14 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>
  2268. <p>Audio emphasis filter creates or restores material directly taken from LPs or
  2269. emphased CDs with different filter curves. E.g. to store music on vinyl the
  2270. signal has to be altered by a filter first to even out the disadvantages of
  2271. this recording medium.
  2272. Once the material is played back the inverse filter has to be applied to
  2273. restore the distortion of the frequency response.
  2274. </p>
  2275. <p>The filter accepts the following options:
  2276. </p>
  2277. <dl compact="compact">
  2278. <dt><samp>level_in</samp></dt>
  2279. <dd><p>Set input gain.
  2280. </p>
  2281. </dd>
  2282. <dt><samp>level_out</samp></dt>
  2283. <dd><p>Set output gain.
  2284. </p>
  2285. </dd>
  2286. <dt><samp>mode</samp></dt>
  2287. <dd><p>Set filter mode. For restoring material use <code>reproduction</code> mode, otherwise
  2288. use <code>production</code> mode. Default is <code>reproduction</code> mode.
  2289. </p>
  2290. </dd>
  2291. <dt><samp>type</samp></dt>
  2292. <dd><p>Set filter type. Selects medium. Can be one of the following:
  2293. </p>
  2294. <dl compact="compact">
  2295. <dt><samp>col</samp></dt>
  2296. <dd><p>select Columbia.
  2297. </p></dd>
  2298. <dt><samp>emi</samp></dt>
  2299. <dd><p>select EMI.
  2300. </p></dd>
  2301. <dt><samp>bsi</samp></dt>
  2302. <dd><p>select BSI (78RPM).
  2303. </p></dd>
  2304. <dt><samp>riaa</samp></dt>
  2305. <dd><p>select RIAA.
  2306. </p></dd>
  2307. <dt><samp>cd</samp></dt>
  2308. <dd><p>select Compact Disc (CD).
  2309. </p></dd>
  2310. <dt><samp>50fm</samp></dt>
  2311. <dd><p>select 50µs (FM).
  2312. </p></dd>
  2313. <dt><samp>75fm</samp></dt>
  2314. <dd><p>select 75µs (FM).
  2315. </p></dd>
  2316. <dt><samp>50kf</samp></dt>
  2317. <dd><p>select 50µs (FM-KF).
  2318. </p></dd>
  2319. <dt><samp>75kf</samp></dt>
  2320. <dd><p>select 75µs (FM-KF).
  2321. </p></dd>
  2322. </dl>
  2323. </dd>
  2324. </dl>
  2325. <a name="Commands-3"></a>
  2326. <h4 class="subsection">8.14.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>
  2327. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2328. </p>
  2329. <a name="aeval"></a>
  2330. <h3 class="section">8.15 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>
  2331. <p>Modify an audio signal according to the specified expressions.
  2332. </p>
  2333. <p>This filter accepts one or more expressions (one for each channel),
  2334. which are evaluated and used to modify a corresponding audio signal.
  2335. </p>
  2336. <p>It accepts the following parameters:
  2337. </p>
  2338. <dl compact="compact">
  2339. <dt><samp>exprs</samp></dt>
  2340. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. If
  2341. the number of input channels is greater than the number of
  2342. expressions, the last specified expression is used for the remaining
  2343. output channels.
  2344. </p>
  2345. </dd>
  2346. <dt><samp>channel_layout, c</samp></dt>
  2347. <dd><p>Set output channel layout. If not specified, the channel layout is
  2348. specified by the number of expressions. If set to &lsquo;<samp>same</samp>&rsquo;, it will
  2349. use by default the same input channel layout.
  2350. </p></dd>
  2351. </dl>
  2352. <p>Each expression in <var>exprs</var> can contain the following constants and functions:
  2353. </p>
  2354. <dl compact="compact">
  2355. <dt><samp>ch</samp></dt>
  2356. <dd><p>channel number of the current expression
  2357. </p>
  2358. </dd>
  2359. <dt><samp>n</samp></dt>
  2360. <dd><p>number of the evaluated sample, starting from 0
  2361. </p>
  2362. </dd>
  2363. <dt><samp>s</samp></dt>
  2364. <dd><p>sample rate
  2365. </p>
  2366. </dd>
  2367. <dt><samp>t</samp></dt>
  2368. <dd><p>time of the evaluated sample expressed in seconds
  2369. </p>
  2370. </dd>
  2371. <dt><samp>nb_in_channels</samp></dt>
  2372. <dt><samp>nb_out_channels</samp></dt>
  2373. <dd><p>input and output number of channels
  2374. </p>
  2375. </dd>
  2376. <dt><samp>val(CH)</samp></dt>
  2377. <dd><p>the value of input channel with number <var>CH</var>
  2378. </p></dd>
  2379. </dl>
  2380. <p>Note: this filter is slow. For faster processing you should use a
  2381. dedicated filter.
  2382. </p>
  2383. <a name="Examples-4"></a>
  2384. <h4 class="subsection">8.15.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>
  2385. <ul>
  2386. <li> Half volume:
  2387. <div class="example">
  2388. <pre class="example">aeval=val(ch)/2:c=same
  2389. </pre></div>
  2390. </li><li> Invert phase of the second channel:
  2391. <div class="example">
  2392. <pre class="example">aeval=val(0)|-val(1)
  2393. </pre></div>
  2394. </li></ul>
  2395. <a name="aexciter"></a>
  2396. <h3 class="section">8.16 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>
  2397. <p>An exciter is used to produce high sound that is not present in the
  2398. original signal. This is done by creating harmonic distortions of the
  2399. signal which are restricted in range and added to the original signal.
  2400. An Exciter raises the upper end of an audio signal without simply raising
  2401. the higher frequencies like an equalizer would do to create a more
  2402. &quot;crisp&quot; or &quot;brilliant&quot; sound.
  2403. </p>
  2404. <p>The filter accepts the following options:
  2405. </p>
  2406. <dl compact="compact">
  2407. <dt><samp>level_in</samp></dt>
  2408. <dd><p>Set input level prior processing of signal.
  2409. Allowed range is from 0 to 64.
  2410. Default value is 1.
  2411. </p>
  2412. </dd>
  2413. <dt><samp>level_out</samp></dt>
  2414. <dd><p>Set output level after processing of signal.
  2415. Allowed range is from 0 to 64.
  2416. Default value is 1.
  2417. </p>
  2418. </dd>
  2419. <dt><samp>amount</samp></dt>
  2420. <dd><p>Set the amount of harmonics added to original signal.
  2421. Allowed range is from 0 to 64.
  2422. Default value is 1.
  2423. </p>
  2424. </dd>
  2425. <dt><samp>drive</samp></dt>
  2426. <dd><p>Set the amount of newly created harmonics.
  2427. Allowed range is from 0.1 to 10.
  2428. Default value is 8.5.
  2429. </p>
  2430. </dd>
  2431. <dt><samp>blend</samp></dt>
  2432. <dd><p>Set the octave of newly created harmonics.
  2433. Allowed range is from -10 to 10.
  2434. Default value is 0.
  2435. </p>
  2436. </dd>
  2437. <dt><samp>freq</samp></dt>
  2438. <dd><p>Set the lower frequency limit of producing harmonics in Hz.
  2439. Allowed range is from 2000 to 12000 Hz.
  2440. Default is 7500 Hz.
  2441. </p>
  2442. </dd>
  2443. <dt><samp>ceil</samp></dt>
  2444. <dd><p>Set the upper frequency limit of producing harmonics.
  2445. Allowed range is from 9999 to 20000 Hz.
  2446. If value is lower than 10000 Hz no limit is applied.
  2447. </p>
  2448. </dd>
  2449. <dt><samp>listen</samp></dt>
  2450. <dd><p>Mute the original signal and output only added harmonics.
  2451. By default is disabled.
  2452. </p></dd>
  2453. </dl>
  2454. <a name="Commands-4"></a>
  2455. <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>
  2456. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2457. </p>
  2458. <span id="afade"></span><a name="afade-1"></a>
  2459. <h3 class="section">8.17 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>
  2460. <p>Apply fade-in/out effect to input audio.
  2461. </p>
  2462. <p>A description of the accepted parameters follows.
  2463. </p>
  2464. <dl compact="compact">
  2465. <dt><samp>type, t</samp></dt>
  2466. <dd><p>Specify the effect type, can be either <code>in</code> for fade-in, or
  2467. <code>out</code> for a fade-out effect. Default is <code>in</code>.
  2468. </p>
  2469. </dd>
  2470. <dt><samp>start_sample, ss</samp></dt>
  2471. <dd><p>Specify the number of the start sample for starting to apply the fade
  2472. effect. Default is 0.
  2473. </p>
  2474. </dd>
  2475. <dt><samp>nb_samples, ns</samp></dt>
  2476. <dd><p>Specify the number of samples for which the fade effect has to last. At
  2477. the end of the fade-in effect the output audio will have the same
  2478. volume as the input audio, at the end of the fade-out transition
  2479. the output audio will be silence. Default is 44100.
  2480. </p>
  2481. </dd>
  2482. <dt><samp>start_time, st</samp></dt>
  2483. <dd><p>Specify the start time of the fade effect. Default is 0.
  2484. The value must be specified as a time duration; see
  2485. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  2486. for the accepted syntax.
  2487. If set this option is used instead of <var>start_sample</var>.
  2488. </p>
  2489. </dd>
  2490. <dt><samp>duration, d</samp></dt>
  2491. <dd><p>Specify the duration of the fade effect. See
  2492. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  2493. for the accepted syntax.
  2494. At the end of the fade-in effect the output audio will have the same
  2495. volume as the input audio, at the end of the fade-out transition
  2496. the output audio will be silence.
  2497. By default the duration is determined by <var>nb_samples</var>.
  2498. If set this option is used instead of <var>nb_samples</var>.
  2499. </p>
  2500. </dd>
  2501. <dt><samp>curve</samp></dt>
  2502. <dd><p>Set curve for fade transition.
  2503. </p>
  2504. <p>It accepts the following values:
  2505. </p><dl compact="compact">
  2506. <dt><samp>tri</samp></dt>
  2507. <dd><p>select triangular, linear slope (default)
  2508. </p></dd>
  2509. <dt><samp>qsin</samp></dt>
  2510. <dd><p>select quarter of sine wave
  2511. </p></dd>
  2512. <dt><samp>hsin</samp></dt>
  2513. <dd><p>select half of sine wave
  2514. </p></dd>
  2515. <dt><samp>esin</samp></dt>
  2516. <dd><p>select exponential sine wave
  2517. </p></dd>
  2518. <dt><samp>log</samp></dt>
  2519. <dd><p>select logarithmic
  2520. </p></dd>
  2521. <dt><samp>ipar</samp></dt>
  2522. <dd><p>select inverted parabola
  2523. </p></dd>
  2524. <dt><samp>qua</samp></dt>
  2525. <dd><p>select quadratic
  2526. </p></dd>
  2527. <dt><samp>cub</samp></dt>
  2528. <dd><p>select cubic
  2529. </p></dd>
  2530. <dt><samp>squ</samp></dt>
  2531. <dd><p>select square root
  2532. </p></dd>
  2533. <dt><samp>cbr</samp></dt>
  2534. <dd><p>select cubic root
  2535. </p></dd>
  2536. <dt><samp>par</samp></dt>
  2537. <dd><p>select parabola
  2538. </p></dd>
  2539. <dt><samp>exp</samp></dt>
  2540. <dd><p>select exponential
  2541. </p></dd>
  2542. <dt><samp>iqsin</samp></dt>
  2543. <dd><p>select inverted quarter of sine wave
  2544. </p></dd>
  2545. <dt><samp>ihsin</samp></dt>
  2546. <dd><p>select inverted half of sine wave
  2547. </p></dd>
  2548. <dt><samp>dese</samp></dt>
  2549. <dd><p>select double-exponential seat
  2550. </p></dd>
  2551. <dt><samp>desi</samp></dt>
  2552. <dd><p>select double-exponential sigmoid
  2553. </p></dd>
  2554. <dt><samp>losi</samp></dt>
  2555. <dd><p>select logistic sigmoid
  2556. </p></dd>
  2557. <dt><samp>sinc</samp></dt>
  2558. <dd><p>select sine cardinal function
  2559. </p></dd>
  2560. <dt><samp>isinc</samp></dt>
  2561. <dd><p>select inverted sine cardinal function
  2562. </p></dd>
  2563. <dt><samp>nofade</samp></dt>
  2564. <dd><p>no fade applied
  2565. </p></dd>
  2566. </dl>
  2567. </dd>
  2568. </dl>
  2569. <a name="Commands-5"></a>
  2570. <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>
  2571. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2572. </p>
  2573. <a name="Examples-5"></a>
  2574. <h4 class="subsection">8.17.2 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>
  2575. <ul>
  2576. <li> Fade in first 15 seconds of audio:
  2577. <div class="example">
  2578. <pre class="example">afade=t=in:ss=0:d=15
  2579. </pre></div>
  2580. </li><li> Fade out last 25 seconds of a 900 seconds audio:
  2581. <div class="example">
  2582. <pre class="example">afade=t=out:st=875:d=25
  2583. </pre></div>
  2584. </li></ul>
  2585. <a name="afftdn"></a>
  2586. <h3 class="section">8.18 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>
  2587. <p>Denoise audio samples with FFT.
  2588. </p>
  2589. <p>A description of the accepted parameters follows.
  2590. </p>
  2591. <dl compact="compact">
  2592. <dt><samp>nr</samp></dt>
  2593. <dd><p>Set the noise reduction in dB, allowed range is 0.01 to 97.
  2594. Default value is 12 dB.
  2595. </p>
  2596. </dd>
  2597. <dt><samp>nf</samp></dt>
  2598. <dd><p>Set the noise floor in dB, allowed range is -80 to -20.
  2599. Default value is -50 dB.
  2600. </p>
  2601. </dd>
  2602. <dt><samp>nt</samp></dt>
  2603. <dd><p>Set the noise type.
  2604. </p>
  2605. <p>It accepts the following values:
  2606. </p><dl compact="compact">
  2607. <dt><samp>w</samp></dt>
  2608. <dd><p>Select white noise.
  2609. </p>
  2610. </dd>
  2611. <dt><samp>v</samp></dt>
  2612. <dd><p>Select vinyl noise.
  2613. </p>
  2614. </dd>
  2615. <dt><samp>s</samp></dt>
  2616. <dd><p>Select shellac noise.
  2617. </p>
  2618. </dd>
  2619. <dt><samp>c</samp></dt>
  2620. <dd><p>Select custom noise, defined in <code>bn</code> option.
  2621. </p>
  2622. <p>Default value is white noise.
  2623. </p></dd>
  2624. </dl>
  2625. </dd>
  2626. <dt><samp>bn</samp></dt>
  2627. <dd><p>Set custom band noise for every one of 15 bands.
  2628. Bands are separated by &rsquo; &rsquo; or &rsquo;|&rsquo;.
  2629. </p>
  2630. </dd>
  2631. <dt><samp>rf</samp></dt>
  2632. <dd><p>Set the residual floor in dB, allowed range is -80 to -20.
  2633. Default value is -38 dB.
  2634. </p>
  2635. </dd>
  2636. <dt><samp>tn</samp></dt>
  2637. <dd><p>Enable noise tracking. By default is disabled.
  2638. With this enabled, noise floor is automatically adjusted.
  2639. </p>
  2640. </dd>
  2641. <dt><samp>tr</samp></dt>
  2642. <dd><p>Enable residual tracking. By default is disabled.
  2643. </p>
  2644. </dd>
  2645. <dt><samp>om</samp></dt>
  2646. <dd><p>Set the output mode.
  2647. </p>
  2648. <p>It accepts the following values:
  2649. </p><dl compact="compact">
  2650. <dt><samp>i</samp></dt>
  2651. <dd><p>Pass input unchanged.
  2652. </p>
  2653. </dd>
  2654. <dt><samp>o</samp></dt>
  2655. <dd><p>Pass noise filtered out.
  2656. </p>
  2657. </dd>
  2658. <dt><samp>n</samp></dt>
  2659. <dd><p>Pass only noise.
  2660. </p>
  2661. <p>Default value is <var>o</var>.
  2662. </p></dd>
  2663. </dl>
  2664. </dd>
  2665. </dl>
  2666. <a name="Commands-6"></a>
  2667. <h4 class="subsection">8.18.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>
  2668. <p>This filter supports the following commands:
  2669. </p><dl compact="compact">
  2670. <dt><samp>sample_noise, sn</samp></dt>
  2671. <dd><p>Start or stop measuring noise profile.
  2672. Syntax for the command is : &quot;start&quot; or &quot;stop&quot; string.
  2673. After measuring noise profile is stopped it will be
  2674. automatically applied in filtering.
  2675. </p>
  2676. </dd>
  2677. <dt><samp>noise_reduction, nr</samp></dt>
  2678. <dd><p>Change noise reduction. Argument is single float number.
  2679. Syntax for the command is : &quot;<var>noise_reduction</var>&quot;
  2680. </p>
  2681. </dd>
  2682. <dt><samp>noise_floor, nf</samp></dt>
  2683. <dd><p>Change noise floor. Argument is single float number.
  2684. Syntax for the command is : &quot;<var>noise_floor</var>&quot;
  2685. </p>
  2686. </dd>
  2687. <dt><samp>output_mode, om</samp></dt>
  2688. <dd><p>Change output mode operation.
  2689. Syntax for the command is : &quot;i&quot;, &quot;o&quot; or &quot;n&quot; string.
  2690. </p></dd>
  2691. </dl>
  2692. <a name="afftfilt"></a>
  2693. <h3 class="section">8.19 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>
  2694. <p>Apply arbitrary expressions to samples in frequency domain.
  2695. </p>
  2696. <dl compact="compact">
  2697. <dt><samp>real</samp></dt>
  2698. <dd><p>Set frequency domain real expression for each separate channel separated
  2699. by &rsquo;|&rsquo;. Default is &quot;re&quot;.
  2700. If the number of input channels is greater than the number of
  2701. expressions, the last specified expression is used for the remaining
  2702. output channels.
  2703. </p>
  2704. </dd>
  2705. <dt><samp>imag</samp></dt>
  2706. <dd><p>Set frequency domain imaginary expression for each separate channel
  2707. separated by &rsquo;|&rsquo;. Default is &quot;im&quot;.
  2708. </p>
  2709. <p>Each expression in <var>real</var> and <var>imag</var> can contain the following
  2710. constants and functions:
  2711. </p>
  2712. <dl compact="compact">
  2713. <dt><samp>sr</samp></dt>
  2714. <dd><p>sample rate
  2715. </p>
  2716. </dd>
  2717. <dt><samp>b</samp></dt>
  2718. <dd><p>current frequency bin number
  2719. </p>
  2720. </dd>
  2721. <dt><samp>nb</samp></dt>
  2722. <dd><p>number of available bins
  2723. </p>
  2724. </dd>
  2725. <dt><samp>ch</samp></dt>
  2726. <dd><p>channel number of the current expression
  2727. </p>
  2728. </dd>
  2729. <dt><samp>chs</samp></dt>
  2730. <dd><p>number of channels
  2731. </p>
  2732. </dd>
  2733. <dt><samp>pts</samp></dt>
  2734. <dd><p>current frame pts
  2735. </p>
  2736. </dd>
  2737. <dt><samp>re</samp></dt>
  2738. <dd><p>current real part of frequency bin of current channel
  2739. </p>
  2740. </dd>
  2741. <dt><samp>im</samp></dt>
  2742. <dd><p>current imaginary part of frequency bin of current channel
  2743. </p>
  2744. </dd>
  2745. <dt><samp>real(b, ch)</samp></dt>
  2746. <dd><p>Return the value of real part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  2747. </p>
  2748. </dd>
  2749. <dt><samp>imag(b, ch)</samp></dt>
  2750. <dd><p>Return the value of imaginary part of frequency bin at location (<var>bin</var>,<var>channel</var>)
  2751. </p></dd>
  2752. </dl>
  2753. </dd>
  2754. <dt><samp>win_size</samp></dt>
  2755. <dd><p>Set window size. Allowed range is from 16 to 131072.
  2756. Default is <code>4096</code>
  2757. </p>
  2758. </dd>
  2759. <dt><samp>win_func</samp></dt>
  2760. <dd><p>Set window function. Default is <code>hann</code>.
  2761. </p>
  2762. </dd>
  2763. <dt><samp>overlap</samp></dt>
  2764. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  2765. window function will be picked. Default is <code>0.75</code>.
  2766. </p></dd>
  2767. </dl>
  2768. <a name="Examples-6"></a>
  2769. <h4 class="subsection">8.19.1 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>
  2770. <ul>
  2771. <li> Leave almost only low frequencies in audio:
  2772. <div class="example">
  2773. <pre class="example">afftfilt=&quot;'real=re * (1-clip((b/nb)*b,0,1))':imag='im * (1-clip((b/nb)*b,0,1))'&quot;
  2774. </pre></div>
  2775. </li><li> Apply robotize effect:
  2776. <div class="example">
  2777. <pre class="example">afftfilt=&quot;real='hypot(re,im)*sin(0)':imag='hypot(re,im)*cos(0)':win_size=512:overlap=0.75&quot;
  2778. </pre></div>
  2779. </li><li> Apply whisper effect:
  2780. <div class="example">
  2781. <pre class="example">afftfilt=&quot;real='hypot(re,im)*cos((random(0)*2-1)*2*3.14)':imag='hypot(re,im)*sin((random(1)*2-1)*2*3.14)':win_size=128:overlap=0.8&quot;
  2782. </pre></div>
  2783. </li></ul>
  2784. <span id="afir"></span><a name="afir-1"></a>
  2785. <h3 class="section">8.20 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>
  2786. <p>Apply an arbitrary Finite Impulse Response filter.
  2787. </p>
  2788. <p>This filter is designed for applying long FIR filters,
  2789. up to 60 seconds long.
  2790. </p>
  2791. <p>It can be used as component for digital crossover filters,
  2792. room equalization, cross talk cancellation, wavefield synthesis,
  2793. auralization, ambiophonics, ambisonics and spatialization.
  2794. </p>
  2795. <p>This filter uses the streams higher than first one as FIR coefficients.
  2796. If the non-first stream holds a single channel, it will be used
  2797. for all input channels in the first stream, otherwise
  2798. the number of channels in the non-first stream must be same as
  2799. the number of channels in the first stream.
  2800. </p>
  2801. <p>It accepts the following parameters:
  2802. </p>
  2803. <dl compact="compact">
  2804. <dt><samp>dry</samp></dt>
  2805. <dd><p>Set dry gain. This sets input gain.
  2806. </p>
  2807. </dd>
  2808. <dt><samp>wet</samp></dt>
  2809. <dd><p>Set wet gain. This sets final output gain.
  2810. </p>
  2811. </dd>
  2812. <dt><samp>length</samp></dt>
  2813. <dd><p>Set Impulse Response filter length. Default is 1, which means whole IR is processed.
  2814. </p>
  2815. </dd>
  2816. <dt><samp>gtype</samp></dt>
  2817. <dd><p>Enable applying gain measured from power of IR.
  2818. </p>
  2819. <p>Set which approach to use for auto gain measurement.
  2820. </p>
  2821. <dl compact="compact">
  2822. <dt><samp>none</samp></dt>
  2823. <dd><p>Do not apply any gain.
  2824. </p>
  2825. </dd>
  2826. <dt><samp>peak</samp></dt>
  2827. <dd><p>select peak gain, very conservative approach. This is default value.
  2828. </p>
  2829. </dd>
  2830. <dt><samp>dc</samp></dt>
  2831. <dd><p>select DC gain, limited application.
  2832. </p>
  2833. </dd>
  2834. <dt><samp>gn</samp></dt>
  2835. <dd><p>select gain to noise approach, this is most popular one.
  2836. </p></dd>
  2837. </dl>
  2838. </dd>
  2839. <dt><samp>irgain</samp></dt>
  2840. <dd><p>Set gain to be applied to IR coefficients before filtering.
  2841. Allowed range is 0 to 1. This gain is applied after any gain applied with <var>gtype</var> option.
  2842. </p>
  2843. </dd>
  2844. <dt><samp>irfmt</samp></dt>
  2845. <dd><p>Set format of IR stream. Can be <code>mono</code> or <code>input</code>.
  2846. Default is <code>input</code>.
  2847. </p>
  2848. </dd>
  2849. <dt><samp>maxir</samp></dt>
  2850. <dd><p>Set max allowed Impulse Response filter duration in seconds. Default is 30 seconds.
  2851. Allowed range is 0.1 to 60 seconds.
  2852. </p>
  2853. </dd>
  2854. <dt><samp>response</samp></dt>
  2855. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  2856. By default it is disabled.
  2857. </p>
  2858. </dd>
  2859. <dt><samp>channel</samp></dt>
  2860. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  2861. displayed. This option is used only when <var>response</var> is enabled.
  2862. </p>
  2863. </dd>
  2864. <dt><samp>size</samp></dt>
  2865. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  2866. </p>
  2867. </dd>
  2868. <dt><samp>rate</samp></dt>
  2869. <dd><p>Set video stream frame rate. This option is used only when <var>response</var> is enabled.
  2870. </p>
  2871. </dd>
  2872. <dt><samp>minp</samp></dt>
  2873. <dd><p>Set minimal partition size used for convolution. Default is <var>8192</var>.
  2874. Allowed range is from <var>1</var> to <var>32768</var>.
  2875. Lower values decreases latency at cost of higher CPU usage.
  2876. </p>
  2877. </dd>
  2878. <dt><samp>maxp</samp></dt>
  2879. <dd><p>Set maximal partition size used for convolution. Default is <var>8192</var>.
  2880. Allowed range is from <var>8</var> to <var>32768</var>.
  2881. Lower values may increase CPU usage.
  2882. </p>
  2883. </dd>
  2884. <dt><samp>nbirs</samp></dt>
  2885. <dd><p>Set number of input impulse responses streams which will be switchable at runtime.
  2886. Allowed range is from <var>1</var> to <var>32</var>. Default is <var>1</var>.
  2887. </p>
  2888. </dd>
  2889. <dt><samp>ir</samp></dt>
  2890. <dd><p>Set IR stream which will be used for convolution, starting from <var>0</var>, should always be
  2891. lower than supplied value by <code>nbirs</code> option. Default is <var>0</var>.
  2892. This option can be changed at runtime via <a href="#commands">commands</a>.
  2893. </p></dd>
  2894. </dl>
  2895. <a name="Examples-7"></a>
  2896. <h4 class="subsection">8.20.1 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>
  2897. <ul>
  2898. <li> Apply reverb to stream using mono IR file as second input, complete command using ffmpeg:
  2899. <div class="example">
  2900. <pre class="example">ffmpeg -i input.wav -i middle_tunnel_1way_mono.wav -lavfi afir output.wav
  2901. </pre></div>
  2902. </li></ul>
  2903. <span id="aformat"></span><a name="aformat-1"></a>
  2904. <h3 class="section">8.21 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>
  2905. <p>Set output format constraints for the input audio. The framework will
  2906. negotiate the most appropriate format to minimize conversions.
  2907. </p>
  2908. <p>It accepts the following parameters:
  2909. </p><dl compact="compact">
  2910. <dt><samp>sample_fmts, f</samp></dt>
  2911. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample formats.
  2912. </p>
  2913. </dd>
  2914. <dt><samp>sample_rates, r</samp></dt>
  2915. <dd><p>A &rsquo;|&rsquo;-separated list of requested sample rates.
  2916. </p>
  2917. </dd>
  2918. <dt><samp>channel_layouts, cl</samp></dt>
  2919. <dd><p>A &rsquo;|&rsquo;-separated list of requested channel layouts.
  2920. </p>
  2921. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  2922. for the required syntax.
  2923. </p></dd>
  2924. </dl>
  2925. <p>If a parameter is omitted, all values are allowed.
  2926. </p>
  2927. <p>Force the output to either unsigned 8-bit or signed 16-bit stereo
  2928. </p><div class="example">
  2929. <pre class="example">aformat=sample_fmts=u8|s16:channel_layouts=stereo
  2930. </pre></div>
  2931. <a name="afreqshift"></a>
  2932. <h3 class="section">8.22 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>
  2933. <p>Apply frequency shift to input audio samples.
  2934. </p>
  2935. <p>The filter accepts the following options:
  2936. </p>
  2937. <dl compact="compact">
  2938. <dt><samp>shift</samp></dt>
  2939. <dd><p>Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
  2940. Default value is 0.0.
  2941. </p>
  2942. </dd>
  2943. <dt><samp>level</samp></dt>
  2944. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  2945. Default value is 1.0.
  2946. </p></dd>
  2947. </dl>
  2948. <a name="Commands-7"></a>
  2949. <h4 class="subsection">8.22.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>
  2950. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  2951. </p>
  2952. <a name="agate"></a>
  2953. <h3 class="section">8.23 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>
  2954. <p>A gate is mainly used to reduce lower parts of a signal. This kind of signal
  2955. processing reduces disturbing noise between useful signals.
  2956. </p>
  2957. <p>Gating is done by detecting the volume below a chosen level <var>threshold</var>
  2958. and dividing it by the factor set with <var>ratio</var>. The bottom of the noise
  2959. floor is set via <var>range</var>. Because an exact manipulation of the signal
  2960. would cause distortion of the waveform the reduction can be levelled over
  2961. time. This is done by setting <var>attack</var> and <var>release</var>.
  2962. </p>
  2963. <p><var>attack</var> determines how long the signal has to fall below the threshold
  2964. before any reduction will occur and <var>release</var> sets the time the signal
  2965. has to rise above the threshold to reduce the reduction again.
  2966. Shorter signals than the chosen attack time will be left untouched.
  2967. </p>
  2968. <dl compact="compact">
  2969. <dt><samp>level_in</samp></dt>
  2970. <dd><p>Set input level before filtering.
  2971. Default is 1. Allowed range is from 0.015625 to 64.
  2972. </p>
  2973. </dd>
  2974. <dt><samp>mode</samp></dt>
  2975. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  2976. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  2977. will be amplified, expanding dynamic range in upward direction.
  2978. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  2979. </p>
  2980. </dd>
  2981. <dt><samp>range</samp></dt>
  2982. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  2983. Default is 0.06125. Allowed range is from 0 to 1.
  2984. Setting this to 0 disables reduction and then filter behaves like expander.
  2985. </p>
  2986. </dd>
  2987. <dt><samp>threshold</samp></dt>
  2988. <dd><p>If a signal rises above this level the gain reduction is released.
  2989. Default is 0.125. Allowed range is from 0 to 1.
  2990. </p>
  2991. </dd>
  2992. <dt><samp>ratio</samp></dt>
  2993. <dd><p>Set a ratio by which the signal is reduced.
  2994. Default is 2. Allowed range is from 1 to 9000.
  2995. </p>
  2996. </dd>
  2997. <dt><samp>attack</samp></dt>
  2998. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  2999. reduction stops.
  3000. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  3001. </p>
  3002. </dd>
  3003. <dt><samp>release</samp></dt>
  3004. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  3005. reduction is increased again. Default is 250 milliseconds.
  3006. Allowed range is from 0.01 to 9000.
  3007. </p>
  3008. </dd>
  3009. <dt><samp>makeup</samp></dt>
  3010. <dd><p>Set amount of amplification of signal after processing.
  3011. Default is 1. Allowed range is from 1 to 64.
  3012. </p>
  3013. </dd>
  3014. <dt><samp>knee</samp></dt>
  3015. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  3016. Default is 2.828427125. Allowed range is from 1 to 8.
  3017. </p>
  3018. </dd>
  3019. <dt><samp>detection</samp></dt>
  3020. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  3021. Default is <code>rms</code>. Can be <code>peak</code> or <code>rms</code>.
  3022. </p>
  3023. </dd>
  3024. <dt><samp>link</samp></dt>
  3025. <dd><p>Choose if the average level between all channels or the louder channel affects
  3026. the reduction.
  3027. Default is <code>average</code>. Can be <code>average</code> or <code>maximum</code>.
  3028. </p></dd>
  3029. </dl>
  3030. <a name="Commands-8"></a>
  3031. <h4 class="subsection">8.23.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>
  3032. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3033. </p>
  3034. <a name="aiir"></a>
  3035. <h3 class="section">8.24 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>
  3036. <p>Apply an arbitrary Infinite Impulse Response filter.
  3037. </p>
  3038. <p>It accepts the following parameters:
  3039. </p>
  3040. <dl compact="compact">
  3041. <dt><samp>zeros, z</samp></dt>
  3042. <dd><p>Set B/numerator/zeros/reflection coefficients.
  3043. </p>
  3044. </dd>
  3045. <dt><samp>poles, p</samp></dt>
  3046. <dd><p>Set A/denominator/poles/ladder coefficients.
  3047. </p>
  3048. </dd>
  3049. <dt><samp>gains, k</samp></dt>
  3050. <dd><p>Set channels gains.
  3051. </p>
  3052. </dd>
  3053. <dt><samp>dry_gain</samp></dt>
  3054. <dd><p>Set input gain.
  3055. </p>
  3056. </dd>
  3057. <dt><samp>wet_gain</samp></dt>
  3058. <dd><p>Set output gain.
  3059. </p>
  3060. </dd>
  3061. <dt><samp>format, f</samp></dt>
  3062. <dd><p>Set coefficients format.
  3063. </p>
  3064. <dl compact="compact">
  3065. <dt>&lsquo;<samp>ll</samp>&rsquo;</dt>
  3066. <dd><p>lattice-ladder function
  3067. </p></dd>
  3068. <dt>&lsquo;<samp>sf</samp>&rsquo;</dt>
  3069. <dd><p>analog transfer function
  3070. </p></dd>
  3071. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  3072. <dd><p>digital transfer function
  3073. </p></dd>
  3074. <dt>&lsquo;<samp>zp</samp>&rsquo;</dt>
  3075. <dd><p>Z-plane zeros/poles, cartesian (default)
  3076. </p></dd>
  3077. <dt>&lsquo;<samp>pr</samp>&rsquo;</dt>
  3078. <dd><p>Z-plane zeros/poles, polar radians
  3079. </p></dd>
  3080. <dt>&lsquo;<samp>pd</samp>&rsquo;</dt>
  3081. <dd><p>Z-plane zeros/poles, polar degrees
  3082. </p></dd>
  3083. <dt>&lsquo;<samp>sp</samp>&rsquo;</dt>
  3084. <dd><p>S-plane zeros/poles
  3085. </p></dd>
  3086. </dl>
  3087. </dd>
  3088. <dt><samp>process, r</samp></dt>
  3089. <dd><p>Set type of processing.
  3090. </p>
  3091. <dl compact="compact">
  3092. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  3093. <dd><p>direct processing
  3094. </p></dd>
  3095. <dt>&lsquo;<samp>s</samp>&rsquo;</dt>
  3096. <dd><p>serial processing
  3097. </p></dd>
  3098. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  3099. <dd><p>parallel processing
  3100. </p></dd>
  3101. </dl>
  3102. </dd>
  3103. <dt><samp>precision, e</samp></dt>
  3104. <dd><p>Set filtering precision.
  3105. </p>
  3106. <dl compact="compact">
  3107. <dt>&lsquo;<samp>dbl</samp>&rsquo;</dt>
  3108. <dd><p>double-precision floating-point (default)
  3109. </p></dd>
  3110. <dt>&lsquo;<samp>flt</samp>&rsquo;</dt>
  3111. <dd><p>single-precision floating-point
  3112. </p></dd>
  3113. <dt>&lsquo;<samp>i32</samp>&rsquo;</dt>
  3114. <dd><p>32-bit integers
  3115. </p></dd>
  3116. <dt>&lsquo;<samp>i16</samp>&rsquo;</dt>
  3117. <dd><p>16-bit integers
  3118. </p></dd>
  3119. </dl>
  3120. </dd>
  3121. <dt><samp>normalize, n</samp></dt>
  3122. <dd><p>Normalize filter coefficients, by default is enabled.
  3123. Enabling it will normalize magnitude response at DC to 0dB.
  3124. </p>
  3125. </dd>
  3126. <dt><samp>mix</samp></dt>
  3127. <dd><p>How much to use filtered signal in output. Default is 1.
  3128. Range is between 0 and 1.
  3129. </p>
  3130. </dd>
  3131. <dt><samp>response</samp></dt>
  3132. <dd><p>Show IR frequency response, magnitude(magenta), phase(green) and group delay(yellow) in additional video stream.
  3133. By default it is disabled.
  3134. </p>
  3135. </dd>
  3136. <dt><samp>channel</samp></dt>
  3137. <dd><p>Set for which IR channel to display frequency response. By default is first channel
  3138. displayed. This option is used only when <var>response</var> is enabled.
  3139. </p>
  3140. </dd>
  3141. <dt><samp>size</samp></dt>
  3142. <dd><p>Set video stream size. This option is used only when <var>response</var> is enabled.
  3143. </p></dd>
  3144. </dl>
  3145. <p>Coefficients in <code>tf</code> and <code>sf</code> format are separated by spaces and are in ascending
  3146. order.
  3147. </p>
  3148. <p>Coefficients in <code>zp</code> format are separated by spaces and order of coefficients
  3149. doesn&rsquo;t matter. Coefficients in <code>zp</code> format are complex numbers with <var>i</var>
  3150. imaginary unit.
  3151. </p>
  3152. <p>Different coefficients and gains can be provided for every channel, in such case
  3153. use &rsquo;|&rsquo; to separate coefficients or gains. Last provided coefficients will be
  3154. used for all remaining channels.
  3155. </p>
  3156. <a name="Examples-8"></a>
  3157. <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>
  3158. <ul>
  3159. <li> Apply 2 pole elliptic notch at around 5000Hz for 48000 Hz sample rate:
  3160. <div class="example">
  3161. <pre class="example">aiir=k=1:z=7.957584807809675810E-1 -2.575128568908332300 3.674839853930788710 -2.57512875289799137 7.957586296317130880E-1:p=1 -2.86950072432325953 3.63022088054647218 -2.28075678147272232 6.361362326477423500E-1:f=tf:r=d
  3162. </pre></div>
  3163. </li><li> Same as above but in <code>zp</code> format:
  3164. <div class="example">
  3165. <pre class="example">aiir=k=0.79575848078096756:z=0.80918701+0.58773007i 0.80918701-0.58773007i 0.80884700+0.58784055i 0.80884700-0.58784055i:p=0.63892345+0.59951235i 0.63892345-0.59951235i 0.79582691+0.44198673i 0.79582691-0.44198673i:f=zp:r=s
  3166. </pre></div>
  3167. </li><li> Apply 3-rd order analog normalized Butterworth low-pass filter, using analog transfer function format:
  3168. <div class="example">
  3169. <pre class="example">aiir=z=1.3057 0 0 0:p=1.3057 2.3892 2.1860 1:f=sf:r=d
  3170. </pre></div>
  3171. </li></ul>
  3172. <a name="alimiter"></a>
  3173. <h3 class="section">8.25 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>
  3174. <p>The limiter prevents an input signal from rising over a desired threshold.
  3175. This limiter uses lookahead technology to prevent your signal from distorting.
  3176. It means that there is a small delay after the signal is processed. Keep in mind
  3177. that the delay it produces is the attack time you set.
  3178. </p>
  3179. <p>The filter accepts the following options:
  3180. </p>
  3181. <dl compact="compact">
  3182. <dt><samp>level_in</samp></dt>
  3183. <dd><p>Set input gain. Default is 1.
  3184. </p>
  3185. </dd>
  3186. <dt><samp>level_out</samp></dt>
  3187. <dd><p>Set output gain. Default is 1.
  3188. </p>
  3189. </dd>
  3190. <dt><samp>limit</samp></dt>
  3191. <dd><p>Don&rsquo;t let signals above this level pass the limiter. Default is 1.
  3192. </p>
  3193. </dd>
  3194. <dt><samp>attack</samp></dt>
  3195. <dd><p>The limiter will reach its attenuation level in this amount of time in
  3196. milliseconds. Default is 5 milliseconds.
  3197. </p>
  3198. </dd>
  3199. <dt><samp>release</samp></dt>
  3200. <dd><p>Come back from limiting to attenuation 1.0 in this amount of milliseconds.
  3201. Default is 50 milliseconds.
  3202. </p>
  3203. </dd>
  3204. <dt><samp>asc</samp></dt>
  3205. <dd><p>When gain reduction is always needed ASC takes care of releasing to an
  3206. average reduction level rather than reaching a reduction of 0 in the release
  3207. time.
  3208. </p>
  3209. </dd>
  3210. <dt><samp>asc_level</samp></dt>
  3211. <dd><p>Select how much the release time is affected by ASC, 0 means nearly no changes
  3212. in release time while 1 produces higher release times.
  3213. </p>
  3214. </dd>
  3215. <dt><samp>level</samp></dt>
  3216. <dd><p>Auto level output signal. Default is enabled.
  3217. This normalizes audio back to 0dB if enabled.
  3218. </p></dd>
  3219. </dl>
  3220. <p>Depending on picked setting it is recommended to upsample input 2x or 4x times
  3221. with <a href="#aresample">aresample</a> before applying this filter.
  3222. </p>
  3223. <a name="allpass"></a>
  3224. <h3 class="section">8.26 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>
  3225. <p>Apply a two-pole all-pass filter with central frequency (in Hz)
  3226. <var>frequency</var>, and filter-width <var>width</var>.
  3227. An all-pass filter changes the audio&rsquo;s frequency to phase relationship
  3228. without changing its frequency to amplitude relationship.
  3229. </p>
  3230. <p>The filter accepts the following options:
  3231. </p>
  3232. <dl compact="compact">
  3233. <dt><samp>frequency, f</samp></dt>
  3234. <dd><p>Set frequency in Hz.
  3235. </p>
  3236. </dd>
  3237. <dt><samp>width_type, t</samp></dt>
  3238. <dd><p>Set method to specify band-width of filter.
  3239. </p><dl compact="compact">
  3240. <dt><samp>h</samp></dt>
  3241. <dd><p>Hz
  3242. </p></dd>
  3243. <dt><samp>q</samp></dt>
  3244. <dd><p>Q-Factor
  3245. </p></dd>
  3246. <dt><samp>o</samp></dt>
  3247. <dd><p>octave
  3248. </p></dd>
  3249. <dt><samp>s</samp></dt>
  3250. <dd><p>slope
  3251. </p></dd>
  3252. <dt><samp>k</samp></dt>
  3253. <dd><p>kHz
  3254. </p></dd>
  3255. </dl>
  3256. </dd>
  3257. <dt><samp>width, w</samp></dt>
  3258. <dd><p>Specify the band-width of a filter in width_type units.
  3259. </p>
  3260. </dd>
  3261. <dt><samp>mix, m</samp></dt>
  3262. <dd><p>How much to use filtered signal in output. Default is 1.
  3263. Range is between 0 and 1.
  3264. </p>
  3265. </dd>
  3266. <dt><samp>channels, c</samp></dt>
  3267. <dd><p>Specify which channels to filter, by default all available are filtered.
  3268. </p>
  3269. </dd>
  3270. <dt><samp>normalize, n</samp></dt>
  3271. <dd><p>Normalize biquad coefficients, by default is disabled.
  3272. Enabling it will normalize magnitude response at DC to 0dB.
  3273. </p>
  3274. </dd>
  3275. <dt><samp>order, o</samp></dt>
  3276. <dd><p>Set the filter order, can be 1 or 2. Default is 2.
  3277. </p>
  3278. </dd>
  3279. <dt><samp>transform, a</samp></dt>
  3280. <dd><p>Set transform type of IIR filter.
  3281. </p><dl compact="compact">
  3282. <dt><samp>di</samp></dt>
  3283. <dt><samp>dii</samp></dt>
  3284. <dt><samp>tdii</samp></dt>
  3285. <dt><samp>latt</samp></dt>
  3286. </dl>
  3287. </dd>
  3288. <dt><samp>precision, r</samp></dt>
  3289. <dd><p>Set precison of filtering.
  3290. </p><dl compact="compact">
  3291. <dt><samp>auto</samp></dt>
  3292. <dd><p>Pick automatic sample format depending on surround filters.
  3293. </p></dd>
  3294. <dt><samp>s16</samp></dt>
  3295. <dd><p>Always use signed 16-bit.
  3296. </p></dd>
  3297. <dt><samp>s32</samp></dt>
  3298. <dd><p>Always use signed 32-bit.
  3299. </p></dd>
  3300. <dt><samp>f32</samp></dt>
  3301. <dd><p>Always use float 32-bit.
  3302. </p></dd>
  3303. <dt><samp>f64</samp></dt>
  3304. <dd><p>Always use float 64-bit.
  3305. </p></dd>
  3306. </dl>
  3307. </dd>
  3308. </dl>
  3309. <a name="Commands-9"></a>
  3310. <h4 class="subsection">8.26.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>
  3311. <p>This filter supports the following commands:
  3312. </p><dl compact="compact">
  3313. <dt><samp>frequency, f</samp></dt>
  3314. <dd><p>Change allpass frequency.
  3315. Syntax for the command is : &quot;<var>frequency</var>&quot;
  3316. </p>
  3317. </dd>
  3318. <dt><samp>width_type, t</samp></dt>
  3319. <dd><p>Change allpass width_type.
  3320. Syntax for the command is : &quot;<var>width_type</var>&quot;
  3321. </p>
  3322. </dd>
  3323. <dt><samp>width, w</samp></dt>
  3324. <dd><p>Change allpass width.
  3325. Syntax for the command is : &quot;<var>width</var>&quot;
  3326. </p>
  3327. </dd>
  3328. <dt><samp>mix, m</samp></dt>
  3329. <dd><p>Change allpass mix.
  3330. Syntax for the command is : &quot;<var>mix</var>&quot;
  3331. </p></dd>
  3332. </dl>
  3333. <a name="aloop"></a>
  3334. <h3 class="section">8.27 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>
  3335. <p>Loop audio samples.
  3336. </p>
  3337. <p>The filter accepts the following options:
  3338. </p>
  3339. <dl compact="compact">
  3340. <dt><samp>loop</samp></dt>
  3341. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  3342. Default is 0.
  3343. </p>
  3344. </dd>
  3345. <dt><samp>size</samp></dt>
  3346. <dd><p>Set maximal number of samples. Default is 0.
  3347. </p>
  3348. </dd>
  3349. <dt><samp>start</samp></dt>
  3350. <dd><p>Set first sample of loop. Default is 0.
  3351. </p></dd>
  3352. </dl>
  3353. <span id="amerge"></span><a name="amerge-1"></a>
  3354. <h3 class="section">8.28 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>
  3355. <p>Merge two or more audio streams into a single multi-channel stream.
  3356. </p>
  3357. <p>The filter accepts the following options:
  3358. </p>
  3359. <dl compact="compact">
  3360. <dt><samp>inputs</samp></dt>
  3361. <dd><p>Set the number of inputs. Default is 2.
  3362. </p>
  3363. </dd>
  3364. </dl>
  3365. <p>If the channel layouts of the inputs are disjoint, and therefore compatible,
  3366. the channel layout of the output will be set accordingly and the channels
  3367. will be reordered as necessary. If the channel layouts of the inputs are not
  3368. disjoint, the output will have all the channels of the first input then all
  3369. the channels of the second input, in that order, and the channel layout of
  3370. the output will be the default value corresponding to the total number of
  3371. channels.
  3372. </p>
  3373. <p>For example, if the first input is in 2.1 (FL+FR+LF) and the second input
  3374. is FC+BL+BR, then the output will be in 5.1, with the channels in the
  3375. following order: a1, a2, b1, a3, b2, b3 (a1 is the first channel of the
  3376. first input, b1 is the first channel of the second input).
  3377. </p>
  3378. <p>On the other hand, if both input are in stereo, the output channels will be
  3379. in the default order: a1, a2, b1, b2, and the channel layout will be
  3380. arbitrarily set to 4.0, which may or may not be the expected value.
  3381. </p>
  3382. <p>All inputs must have the same sample rate, and format.
  3383. </p>
  3384. <p>If inputs do not have the same duration, the output will stop with the
  3385. shortest.
  3386. </p>
  3387. <a name="Examples-9"></a>
  3388. <h4 class="subsection">8.28.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>
  3389. <ul>
  3390. <li> Merge two mono files into a stereo stream:
  3391. <div class="example">
  3392. <pre class="example">amovie=left.wav [l] ; amovie=right.mp3 [r] ; [l] [r] amerge
  3393. </pre></div>
  3394. </li><li> Multiple merges assuming 1 video stream and 6 audio streams in <samp>input.mkv</samp>:
  3395. <div class="example">
  3396. <pre class="example">ffmpeg -i input.mkv -filter_complex &quot;[0:1][0:2][0:3][0:4][0:5][0:6] amerge=inputs=6&quot; -c:a pcm_s16le output.mkv
  3397. </pre></div>
  3398. </li></ul>
  3399. <a name="amix"></a>
  3400. <h3 class="section">8.29 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>
  3401. <p>Mixes multiple audio inputs into a single output.
  3402. </p>
  3403. <p>Note that this filter only supports float samples (the <var>amerge</var>
  3404. and <var>pan</var> audio filters support many formats). If the <var>amix</var>
  3405. input has integer samples then <a href="#aresample">aresample</a> will be automatically
  3406. inserted to perform the conversion to float samples.
  3407. </p>
  3408. <p>For example
  3409. </p><div class="example">
  3410. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex amix=inputs=3:duration=first:dropout_transition=3 OUTPUT
  3411. </pre></div>
  3412. <p>will mix 3 input audio streams to a single output with the same duration as the
  3413. first input and a dropout transition time of 3 seconds.
  3414. </p>
  3415. <p>It accepts the following parameters:
  3416. </p><dl compact="compact">
  3417. <dt><samp>inputs</samp></dt>
  3418. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  3419. </p>
  3420. </dd>
  3421. <dt><samp>duration</samp></dt>
  3422. <dd><p>How to determine the end-of-stream.
  3423. </p><dl compact="compact">
  3424. <dt><samp>longest</samp></dt>
  3425. <dd><p>The duration of the longest input. (default)
  3426. </p>
  3427. </dd>
  3428. <dt><samp>shortest</samp></dt>
  3429. <dd><p>The duration of the shortest input.
  3430. </p>
  3431. </dd>
  3432. <dt><samp>first</samp></dt>
  3433. <dd><p>The duration of the first input.
  3434. </p>
  3435. </dd>
  3436. </dl>
  3437. </dd>
  3438. <dt><samp>dropout_transition</samp></dt>
  3439. <dd><p>The transition time, in seconds, for volume renormalization when an input
  3440. stream ends. The default value is 2 seconds.
  3441. </p>
  3442. </dd>
  3443. <dt><samp>weights</samp></dt>
  3444. <dd><p>Specify weight of each input audio stream as sequence.
  3445. Each weight is separated by space. By default all inputs have same weight.
  3446. </p>
  3447. </dd>
  3448. <dt><samp>normalize</samp></dt>
  3449. <dd><p>Always scale inputs instead of only doing summation of samples.
  3450. Beware of heavy clipping if inputs are not normalized prior or after filtering
  3451. by this filter if this option is disabled. By default is enabled.
  3452. </p></dd>
  3453. </dl>
  3454. <a name="Commands-10"></a>
  3455. <h4 class="subsection">8.29.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>
  3456. <p>This filter supports the following commands:
  3457. </p><dl compact="compact">
  3458. <dt><samp>weights</samp></dt>
  3459. <dt><samp>sum</samp></dt>
  3460. <dd><p>Syntax is same as option with same name.
  3461. </p></dd>
  3462. </dl>
  3463. <a name="amultiply"></a>
  3464. <h3 class="section">8.30 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>
  3465. <p>Multiply first audio stream with second audio stream and store result
  3466. in output audio stream. Multiplication is done by multiplying each
  3467. sample from first stream with sample at same position from second stream.
  3468. </p>
  3469. <p>With this element-wise multiplication one can create amplitude fades and
  3470. amplitude modulations.
  3471. </p>
  3472. <a name="anequalizer"></a>
  3473. <h3 class="section">8.31 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>
  3474. <p>High-order parametric multiband equalizer for each channel.
  3475. </p>
  3476. <p>It accepts the following parameters:
  3477. </p><dl compact="compact">
  3478. <dt><samp>params</samp></dt>
  3479. <dd>
  3480. <p>This option string is in format:
  3481. &quot;c<var>chn</var> f=<var>cf</var> w=<var>w</var> g=<var>g</var> t=<var>f</var> | ...&quot;
  3482. Each equalizer band is separated by &rsquo;|&rsquo;.
  3483. </p>
  3484. <dl compact="compact">
  3485. <dt><samp>chn</samp></dt>
  3486. <dd><p>Set channel number to which equalization will be applied.
  3487. If input doesn&rsquo;t have that channel the entry is ignored.
  3488. </p>
  3489. </dd>
  3490. <dt><samp>f</samp></dt>
  3491. <dd><p>Set central frequency for band.
  3492. If input doesn&rsquo;t have that frequency the entry is ignored.
  3493. </p>
  3494. </dd>
  3495. <dt><samp>w</samp></dt>
  3496. <dd><p>Set band width in Hertz.
  3497. </p>
  3498. </dd>
  3499. <dt><samp>g</samp></dt>
  3500. <dd><p>Set band gain in dB.
  3501. </p>
  3502. </dd>
  3503. <dt><samp>t</samp></dt>
  3504. <dd><p>Set filter type for band, optional, can be:
  3505. </p>
  3506. <dl compact="compact">
  3507. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  3508. <dd><p>Butterworth, this is default.
  3509. </p>
  3510. </dd>
  3511. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  3512. <dd><p>Chebyshev type 1.
  3513. </p>
  3514. </dd>
  3515. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  3516. <dd><p>Chebyshev type 2.
  3517. </p></dd>
  3518. </dl>
  3519. </dd>
  3520. </dl>
  3521. </dd>
  3522. <dt><samp>curves</samp></dt>
  3523. <dd><p>With this option activated frequency response of anequalizer is displayed
  3524. in video stream.
  3525. </p>
  3526. </dd>
  3527. <dt><samp>size</samp></dt>
  3528. <dd><p>Set video stream size. Only useful if curves option is activated.
  3529. </p>
  3530. </dd>
  3531. <dt><samp>mgain</samp></dt>
  3532. <dd><p>Set max gain that will be displayed. Only useful if curves option is activated.
  3533. Setting this to a reasonable value makes it possible to display gain which is derived from
  3534. neighbour bands which are too close to each other and thus produce higher gain
  3535. when both are activated.
  3536. </p>
  3537. </dd>
  3538. <dt><samp>fscale</samp></dt>
  3539. <dd><p>Set frequency scale used to draw frequency response in video output.
  3540. Can be linear or logarithmic. Default is logarithmic.
  3541. </p>
  3542. </dd>
  3543. <dt><samp>colors</samp></dt>
  3544. <dd><p>Set color for each channel curve which is going to be displayed in video stream.
  3545. This is list of color names separated by space or by &rsquo;|&rsquo;.
  3546. Unrecognised or missing colors will be replaced by white color.
  3547. </p></dd>
  3548. </dl>
  3549. <a name="Examples-10"></a>
  3550. <h4 class="subsection">8.31.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>
  3551. <ul>
  3552. <li> Lower gain by 10 of central frequency 200Hz and width 100 Hz
  3553. for first 2 channels using Chebyshev type 1 filter:
  3554. <div class="example">
  3555. <pre class="example">anequalizer=c0 f=200 w=100 g=-10 t=1|c1 f=200 w=100 g=-10 t=1
  3556. </pre></div>
  3557. </li></ul>
  3558. <a name="Commands-11"></a>
  3559. <h4 class="subsection">8.31.2 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>
  3560. <p>This filter supports the following commands:
  3561. </p><dl compact="compact">
  3562. <dt><samp>change</samp></dt>
  3563. <dd><p>Alter existing filter parameters.
  3564. Syntax for the commands is : &quot;<var>fN</var>|f=<var>freq</var>|w=<var>width</var>|g=<var>gain</var>&quot;
  3565. </p>
  3566. <p><var>fN</var> is existing filter number, starting from 0, if no such filter is available
  3567. error is returned.
  3568. <var>freq</var> set new frequency parameter.
  3569. <var>width</var> set new width parameter in Hertz.
  3570. <var>gain</var> set new gain parameter in dB.
  3571. </p>
  3572. <p>Full filter invocation with asendcmd may look like this:
  3573. asendcmd=c=&rsquo;4.0 anequalizer change 0|f=200|w=50|g=1&rsquo;,anequalizer=...
  3574. </p></dd>
  3575. </dl>
  3576. <a name="anlmdn"></a>
  3577. <h3 class="section">8.32 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>
  3578. <p>Reduce broadband noise in audio samples using Non-Local Means algorithm.
  3579. </p>
  3580. <p>Each sample is adjusted by looking for other samples with similar contexts. This
  3581. context similarity is defined by comparing their surrounding patches of size
  3582. <samp>p</samp>. Patches are searched in an area of <samp>r</samp> around the sample.
  3583. </p>
  3584. <p>The filter accepts the following options:
  3585. </p>
  3586. <dl compact="compact">
  3587. <dt><samp>s</samp></dt>
  3588. <dd><p>Set denoising strength. Allowed range is from 0.00001 to 10. Default value is 0.00001.
  3589. </p>
  3590. </dd>
  3591. <dt><samp>p</samp></dt>
  3592. <dd><p>Set patch radius duration. Allowed range is from 1 to 100 milliseconds.
  3593. Default value is 2 milliseconds.
  3594. </p>
  3595. </dd>
  3596. <dt><samp>r</samp></dt>
  3597. <dd><p>Set research radius duration. Allowed range is from 2 to 300 milliseconds.
  3598. Default value is 6 milliseconds.
  3599. </p>
  3600. </dd>
  3601. <dt><samp>o</samp></dt>
  3602. <dd><p>Set the output mode.
  3603. </p>
  3604. <p>It accepts the following values:
  3605. </p><dl compact="compact">
  3606. <dt><samp>i</samp></dt>
  3607. <dd><p>Pass input unchanged.
  3608. </p>
  3609. </dd>
  3610. <dt><samp>o</samp></dt>
  3611. <dd><p>Pass noise filtered out.
  3612. </p>
  3613. </dd>
  3614. <dt><samp>n</samp></dt>
  3615. <dd><p>Pass only noise.
  3616. </p>
  3617. <p>Default value is <var>o</var>.
  3618. </p></dd>
  3619. </dl>
  3620. </dd>
  3621. <dt><samp>m</samp></dt>
  3622. <dd><p>Set smooth factor. Default value is <var>11</var>. Allowed range is from <var>1</var> to <var>15</var>.
  3623. </p></dd>
  3624. </dl>
  3625. <a name="Commands-12"></a>
  3626. <h4 class="subsection">8.32.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>
  3627. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3628. </p>
  3629. <a name="anlms"></a>
  3630. <h3 class="section">8.33 anlms<span class="pull-right"><a class="anchor hidden-xs" href="#anlms" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-anlms" aria-hidden="true">TOC</a></span></h3>
  3631. <p>Apply Normalized Least-Mean-Squares algorithm to the first audio stream using the second audio stream.
  3632. </p>
  3633. <p>This adaptive filter is used to mimic a desired filter by finding the filter coefficients that
  3634. relate to producing the least mean square of the error signal (difference between the desired,
  3635. 2nd input audio stream and the actual signal, the 1st input audio stream).
  3636. </p>
  3637. <p>A description of the accepted options follows.
  3638. </p>
  3639. <dl compact="compact">
  3640. <dt><samp>order</samp></dt>
  3641. <dd><p>Set filter order.
  3642. </p>
  3643. </dd>
  3644. <dt><samp>mu</samp></dt>
  3645. <dd><p>Set filter mu.
  3646. </p>
  3647. </dd>
  3648. <dt><samp>eps</samp></dt>
  3649. <dd><p>Set the filter eps.
  3650. </p>
  3651. </dd>
  3652. <dt><samp>leakage</samp></dt>
  3653. <dd><p>Set the filter leakage.
  3654. </p>
  3655. </dd>
  3656. <dt><samp>out_mode</samp></dt>
  3657. <dd><p>It accepts the following values:
  3658. </p><dl compact="compact">
  3659. <dt><samp>i</samp></dt>
  3660. <dd><p>Pass the 1st input.
  3661. </p>
  3662. </dd>
  3663. <dt><samp>d</samp></dt>
  3664. <dd><p>Pass the 2nd input.
  3665. </p>
  3666. </dd>
  3667. <dt><samp>o</samp></dt>
  3668. <dd><p>Pass filtered samples.
  3669. </p>
  3670. </dd>
  3671. <dt><samp>n</samp></dt>
  3672. <dd><p>Pass difference between desired and filtered samples.
  3673. </p>
  3674. <p>Default value is <var>o</var>.
  3675. </p></dd>
  3676. </dl>
  3677. </dd>
  3678. </dl>
  3679. <a name="Examples-11"></a>
  3680. <h4 class="subsection">8.33.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>
  3681. <ul>
  3682. <li> One of many usages of this filter is noise reduction, input audio is filtered
  3683. with same samples that are delayed by fixed amount, one such example for stereo audio is:
  3684. <div class="example">
  3685. <pre class="example">asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
  3686. </pre></div>
  3687. </li></ul>
  3688. <a name="Commands-13"></a>
  3689. <h4 class="subsection">8.33.2 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>
  3690. <p>This filter supports the same commands as options, excluding option <code>order</code>.
  3691. </p>
  3692. <a name="anull"></a>
  3693. <h3 class="section">8.34 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>
  3694. <p>Pass the audio source unchanged to the output.
  3695. </p>
  3696. <a name="apad"></a>
  3697. <h3 class="section">8.35 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>
  3698. <p>Pad the end of an audio stream with silence.
  3699. </p>
  3700. <p>This can be used together with <code>ffmpeg</code> <samp>-shortest</samp> to
  3701. extend audio streams to the same length as the video stream.
  3702. </p>
  3703. <p>A description of the accepted options follows.
  3704. </p>
  3705. <dl compact="compact">
  3706. <dt><samp>packet_size</samp></dt>
  3707. <dd><p>Set silence packet size. Default value is 4096.
  3708. </p>
  3709. </dd>
  3710. <dt><samp>pad_len</samp></dt>
  3711. <dd><p>Set the number of samples of silence to add to the end. After the
  3712. value is reached, the stream is terminated. This option is mutually
  3713. exclusive with <samp>whole_len</samp>.
  3714. </p>
  3715. </dd>
  3716. <dt><samp>whole_len</samp></dt>
  3717. <dd><p>Set the minimum total number of samples in the output audio stream. If
  3718. the value is longer than the input audio length, silence is added to
  3719. the end, until the value is reached. This option is mutually exclusive
  3720. with <samp>pad_len</samp>.
  3721. </p>
  3722. </dd>
  3723. <dt><samp>pad_dur</samp></dt>
  3724. <dd><p>Specify the duration of samples of silence to add. See
  3725. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  3726. for the accepted syntax. Used only if set to non-zero value.
  3727. </p>
  3728. </dd>
  3729. <dt><samp>whole_dur</samp></dt>
  3730. <dd><p>Specify the minimum total duration in the output audio stream. See
  3731. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  3732. for the accepted syntax. Used only if set to non-zero value. If the value is longer than
  3733. the input audio length, silence is added to the end, until the value is reached.
  3734. This option is mutually exclusive with <samp>pad_dur</samp>
  3735. </p></dd>
  3736. </dl>
  3737. <p>If neither the <samp>pad_len</samp> nor the <samp>whole_len</samp> nor <samp>pad_dur</samp>
  3738. nor <samp>whole_dur</samp> option is set, the filter will add silence to the end of
  3739. the input stream indefinitely.
  3740. </p>
  3741. <a name="Examples-12"></a>
  3742. <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>
  3743. <ul>
  3744. <li> Add 1024 samples of silence to the end of the input:
  3745. <div class="example">
  3746. <pre class="example">apad=pad_len=1024
  3747. </pre></div>
  3748. </li><li> Make sure the audio output will contain at least 10000 samples, pad
  3749. the input with silence if required:
  3750. <div class="example">
  3751. <pre class="example">apad=whole_len=10000
  3752. </pre></div>
  3753. </li><li> Use <code>ffmpeg</code> to pad the audio input with silence, so that the
  3754. video stream will always result the shortest and will be converted
  3755. until the end in the output file when using the <samp>shortest</samp>
  3756. option:
  3757. <div class="example">
  3758. <pre class="example">ffmpeg -i VIDEO -i AUDIO -filter_complex &quot;[1:0]apad&quot; -shortest OUTPUT
  3759. </pre></div>
  3760. </li></ul>
  3761. <a name="aphaser"></a>
  3762. <h3 class="section">8.36 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>
  3763. <p>Add a phasing effect to the input audio.
  3764. </p>
  3765. <p>A phaser filter creates series of peaks and troughs in the frequency spectrum.
  3766. The position of the peaks and troughs are modulated so that they vary over time, creating a sweeping effect.
  3767. </p>
  3768. <p>A description of the accepted parameters follows.
  3769. </p>
  3770. <dl compact="compact">
  3771. <dt><samp>in_gain</samp></dt>
  3772. <dd><p>Set input gain. Default is 0.4.
  3773. </p>
  3774. </dd>
  3775. <dt><samp>out_gain</samp></dt>
  3776. <dd><p>Set output gain. Default is 0.74
  3777. </p>
  3778. </dd>
  3779. <dt><samp>delay</samp></dt>
  3780. <dd><p>Set delay in milliseconds. Default is 3.0.
  3781. </p>
  3782. </dd>
  3783. <dt><samp>decay</samp></dt>
  3784. <dd><p>Set decay. Default is 0.4.
  3785. </p>
  3786. </dd>
  3787. <dt><samp>speed</samp></dt>
  3788. <dd><p>Set modulation speed in Hz. Default is 0.5.
  3789. </p>
  3790. </dd>
  3791. <dt><samp>type</samp></dt>
  3792. <dd><p>Set modulation type. Default is triangular.
  3793. </p>
  3794. <p>It accepts the following values:
  3795. </p><dl compact="compact">
  3796. <dt>&lsquo;<samp>triangular, t</samp>&rsquo;</dt>
  3797. <dt>&lsquo;<samp>sinusoidal, s</samp>&rsquo;</dt>
  3798. </dl>
  3799. </dd>
  3800. </dl>
  3801. <a name="aphaseshift"></a>
  3802. <h3 class="section">8.37 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>
  3803. <p>Apply phase shift to input audio samples.
  3804. </p>
  3805. <p>The filter accepts the following options:
  3806. </p>
  3807. <dl compact="compact">
  3808. <dt><samp>shift</samp></dt>
  3809. <dd><p>Specify phase shift. Allowed range is from -1.0 to 1.0.
  3810. Default value is 0.0.
  3811. </p>
  3812. </dd>
  3813. <dt><samp>level</samp></dt>
  3814. <dd><p>Set output gain applied to final output. Allowed range is from 0.0 to 1.0.
  3815. Default value is 1.0.
  3816. </p></dd>
  3817. </dl>
  3818. <a name="Commands-14"></a>
  3819. <h4 class="subsection">8.37.1 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>
  3820. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3821. </p>
  3822. <a name="apulsator"></a>
  3823. <h3 class="section">8.38 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>
  3824. <p>Audio pulsator is something between an autopanner and a tremolo.
  3825. But it can produce funny stereo effects as well. Pulsator changes the volume
  3826. of the left and right channel based on a LFO (low frequency oscillator) with
  3827. different waveforms and shifted phases.
  3828. This filter have the ability to define an offset between left and right
  3829. channel. An offset of 0 means that both LFO shapes match each other.
  3830. The left and right channel are altered equally - a conventional tremolo.
  3831. An offset of 50% means that the shape of the right channel is exactly shifted
  3832. in phase (or moved backwards about half of the frequency) - pulsator acts as
  3833. an autopanner. At 1 both curves match again. Every setting in between moves the
  3834. phase shift gapless between all stages and produces some &quot;bypassing&quot; sounds with
  3835. sine and triangle waveforms. The more you set the offset near 1 (starting from
  3836. the 0.5) the faster the signal passes from the left to the right speaker.
  3837. </p>
  3838. <p>The filter accepts the following options:
  3839. </p>
  3840. <dl compact="compact">
  3841. <dt><samp>level_in</samp></dt>
  3842. <dd><p>Set input gain. By default it is 1. Range is [0.015625 - 64].
  3843. </p>
  3844. </dd>
  3845. <dt><samp>level_out</samp></dt>
  3846. <dd><p>Set output gain. By default it is 1. Range is [0.015625 - 64].
  3847. </p>
  3848. </dd>
  3849. <dt><samp>mode</samp></dt>
  3850. <dd><p>Set waveform shape the LFO will use. Can be one of: sine, triangle, square,
  3851. sawup or sawdown. Default is sine.
  3852. </p>
  3853. </dd>
  3854. <dt><samp>amount</samp></dt>
  3855. <dd><p>Set modulation. Define how much of original signal is affected by the LFO.
  3856. </p>
  3857. </dd>
  3858. <dt><samp>offset_l</samp></dt>
  3859. <dd><p>Set left channel offset. Default is 0. Allowed range is [0 - 1].
  3860. </p>
  3861. </dd>
  3862. <dt><samp>offset_r</samp></dt>
  3863. <dd><p>Set right channel offset. Default is 0.5. Allowed range is [0 - 1].
  3864. </p>
  3865. </dd>
  3866. <dt><samp>width</samp></dt>
  3867. <dd><p>Set pulse width. Default is 1. Allowed range is [0 - 2].
  3868. </p>
  3869. </dd>
  3870. <dt><samp>timing</samp></dt>
  3871. <dd><p>Set possible timing mode. Can be one of: bpm, ms or hz. Default is hz.
  3872. </p>
  3873. </dd>
  3874. <dt><samp>bpm</samp></dt>
  3875. <dd><p>Set bpm. Default is 120. Allowed range is [30 - 300]. Only used if timing
  3876. is set to bpm.
  3877. </p>
  3878. </dd>
  3879. <dt><samp>ms</samp></dt>
  3880. <dd><p>Set ms. Default is 500. Allowed range is [10 - 2000]. Only used if timing
  3881. is set to ms.
  3882. </p>
  3883. </dd>
  3884. <dt><samp>hz</samp></dt>
  3885. <dd><p>Set frequency in Hz. Default is 2. Allowed range is [0.01 - 100]. Only used
  3886. if timing is set to hz.
  3887. </p></dd>
  3888. </dl>
  3889. <span id="aresample"></span><a name="aresample-1"></a>
  3890. <h3 class="section">8.39 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>
  3891. <p>Resample the input audio to the specified parameters, using the
  3892. libswresample library. If none are specified then the filter will
  3893. automatically convert between its input and output.
  3894. </p>
  3895. <p>This filter is also able to stretch/squeeze the audio data to make it match
  3896. the timestamps or to inject silence / cut out audio to make it match the
  3897. timestamps, do a combination of both or do neither.
  3898. </p>
  3899. <p>The filter accepts the syntax
  3900. [<var>sample_rate</var>:]<var>resampler_options</var>, where <var>sample_rate</var>
  3901. expresses a sample rate and <var>resampler_options</var> is a list of
  3902. <var>key</var>=<var>value</var> pairs, separated by &quot;:&quot;. See the
  3903. <a href="ffmpeg-resampler.html#Resampler-Options">(ffmpeg-resampler)&quot;Resampler Options&quot; section in the
  3904. ffmpeg-resampler(1) manual</a>
  3905. for the complete list of supported options.
  3906. </p>
  3907. <a name="Examples-13"></a>
  3908. <h4 class="subsection">8.39.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>
  3909. <ul>
  3910. <li> Resample the input audio to 44100Hz:
  3911. <div class="example">
  3912. <pre class="example">aresample=44100
  3913. </pre></div>
  3914. </li><li> Stretch/squeeze samples to the given timestamps, with a maximum of 1000
  3915. samples per second compensation:
  3916. <div class="example">
  3917. <pre class="example">aresample=async=1000
  3918. </pre></div>
  3919. </li></ul>
  3920. <a name="areverse"></a>
  3921. <h3 class="section">8.40 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>
  3922. <p>Reverse an audio clip.
  3923. </p>
  3924. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  3925. is suggested.
  3926. </p>
  3927. <a name="Examples-14"></a>
  3928. <h4 class="subsection">8.40.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>
  3929. <ul>
  3930. <li> Take the first 5 seconds of a clip, and reverse it.
  3931. <div class="example">
  3932. <pre class="example">atrim=end=5,areverse
  3933. </pre></div>
  3934. </li></ul>
  3935. <a name="arnndn"></a>
  3936. <h3 class="section">8.41 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>
  3937. <p>Reduce noise from speech using Recurrent Neural Networks.
  3938. </p>
  3939. <p>This filter accepts the following options:
  3940. </p>
  3941. <dl compact="compact">
  3942. <dt><samp>model, m</samp></dt>
  3943. <dd><p>Set train model file to load. This option is always required.
  3944. </p>
  3945. </dd>
  3946. <dt><samp>mix</samp></dt>
  3947. <dd><p>Set how much to mix filtered samples into final output.
  3948. Allowed range is from -1 to 1. Default value is 1.
  3949. Negative values are special, they set how much to keep filtered noise
  3950. in the final filter output. Set this option to -1 to hear actual
  3951. noise removed from input signal.
  3952. </p></dd>
  3953. </dl>
  3954. <a name="Commands-15"></a>
  3955. <h4 class="subsection">8.41.1 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>
  3956. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  3957. </p>
  3958. <a name="asetnsamples"></a>
  3959. <h3 class="section">8.42 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>
  3960. <p>Set the number of samples per each output audio frame.
  3961. </p>
  3962. <p>The last output packet may contain a different number of samples, as
  3963. the filter will flush all the remaining samples when the input audio
  3964. signals its end.
  3965. </p>
  3966. <p>The filter accepts the following options:
  3967. </p>
  3968. <dl compact="compact">
  3969. <dt><samp>nb_out_samples, n</samp></dt>
  3970. <dd><p>Set the number of frames per each output audio frame. The number is
  3971. intended as the number of samples <em>per each channel</em>.
  3972. Default value is 1024.
  3973. </p>
  3974. </dd>
  3975. <dt><samp>pad, p</samp></dt>
  3976. <dd><p>If set to 1, the filter will pad the last audio frame with zeroes, so
  3977. that the last frame will contain the same number of samples as the
  3978. previous ones. Default value is 1.
  3979. </p></dd>
  3980. </dl>
  3981. <p>For example, to set the number of per-frame samples to 1234 and
  3982. disable padding for the last frame, use:
  3983. </p><div class="example">
  3984. <pre class="example">asetnsamples=n=1234:p=0
  3985. </pre></div>
  3986. <a name="asetrate"></a>
  3987. <h3 class="section">8.43 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>
  3988. <p>Set the sample rate without altering the PCM data.
  3989. This will result in a change of speed and pitch.
  3990. </p>
  3991. <p>The filter accepts the following options:
  3992. </p>
  3993. <dl compact="compact">
  3994. <dt><samp>sample_rate, r</samp></dt>
  3995. <dd><p>Set the output sample rate. Default is 44100 Hz.
  3996. </p></dd>
  3997. </dl>
  3998. <a name="ashowinfo"></a>
  3999. <h3 class="section">8.44 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>
  4000. <p>Show a line containing various information for each input audio frame.
  4001. The input audio is not modified.
  4002. </p>
  4003. <p>The shown line contains a sequence of key/value pairs of the form
  4004. <var>key</var>:<var>value</var>.
  4005. </p>
  4006. <p>The following values are shown in the output:
  4007. </p>
  4008. <dl compact="compact">
  4009. <dt><samp>n</samp></dt>
  4010. <dd><p>The (sequential) number of the input frame, starting from 0.
  4011. </p>
  4012. </dd>
  4013. <dt><samp>pts</samp></dt>
  4014. <dd><p>The presentation timestamp of the input frame, in time base units; the time base
  4015. depends on the filter input pad, and is usually 1/<var>sample_rate</var>.
  4016. </p>
  4017. </dd>
  4018. <dt><samp>pts_time</samp></dt>
  4019. <dd><p>The presentation timestamp of the input frame in seconds.
  4020. </p>
  4021. </dd>
  4022. <dt><samp>pos</samp></dt>
  4023. <dd><p>position of the frame in the input stream, -1 if this information in
  4024. unavailable and/or meaningless (for example in case of synthetic audio)
  4025. </p>
  4026. </dd>
  4027. <dt><samp>fmt</samp></dt>
  4028. <dd><p>The sample format.
  4029. </p>
  4030. </dd>
  4031. <dt><samp>chlayout</samp></dt>
  4032. <dd><p>The channel layout.
  4033. </p>
  4034. </dd>
  4035. <dt><samp>rate</samp></dt>
  4036. <dd><p>The sample rate for the audio frame.
  4037. </p>
  4038. </dd>
  4039. <dt><samp>nb_samples</samp></dt>
  4040. <dd><p>The number of samples (per channel) in the frame.
  4041. </p>
  4042. </dd>
  4043. <dt><samp>checksum</samp></dt>
  4044. <dd><p>The Adler-32 checksum (printed in hexadecimal) of the audio data. For planar
  4045. audio, the data is treated as if all the planes were concatenated.
  4046. </p>
  4047. </dd>
  4048. <dt><samp>plane_checksums</samp></dt>
  4049. <dd><p>A list of Adler-32 checksums for each data plane.
  4050. </p></dd>
  4051. </dl>
  4052. <a name="asoftclip"></a>
  4053. <h3 class="section">8.45 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>
  4054. <p>Apply audio soft clipping.
  4055. </p>
  4056. <p>Soft clipping is a type of distortion effect where the amplitude of a signal is saturated
  4057. along a smooth curve, rather than the abrupt shape of hard-clipping.
  4058. </p>
  4059. <p>This filter accepts the following options:
  4060. </p>
  4061. <dl compact="compact">
  4062. <dt><samp>type</samp></dt>
  4063. <dd><p>Set type of soft-clipping.
  4064. </p>
  4065. <p>It accepts the following values:
  4066. </p><dl compact="compact">
  4067. <dt><samp>hard</samp></dt>
  4068. <dt><samp>tanh</samp></dt>
  4069. <dt><samp>atan</samp></dt>
  4070. <dt><samp>cubic</samp></dt>
  4071. <dt><samp>exp</samp></dt>
  4072. <dt><samp>alg</samp></dt>
  4073. <dt><samp>quintic</samp></dt>
  4074. <dt><samp>sin</samp></dt>
  4075. <dt><samp>erf</samp></dt>
  4076. </dl>
  4077. </dd>
  4078. <dt><samp>threshold</samp></dt>
  4079. <dd><p>Set threshold from where to start clipping. Default value is 0dB or 1.
  4080. </p>
  4081. </dd>
  4082. <dt><samp>output</samp></dt>
  4083. <dd><p>Set gain applied to output. Default value is 0dB or 1.
  4084. </p>
  4085. </dd>
  4086. <dt><samp>param</samp></dt>
  4087. <dd><p>Set additional parameter which controls sigmoid function.
  4088. </p>
  4089. </dd>
  4090. <dt><samp>oversample</samp></dt>
  4091. <dd><p>Set oversampling factor.
  4092. </p></dd>
  4093. </dl>
  4094. <a name="Commands-16"></a>
  4095. <h4 class="subsection">8.45.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>
  4096. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4097. </p>
  4098. <a name="asr"></a>
  4099. <h3 class="section">8.46 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>
  4100. <p>Automatic Speech Recognition
  4101. </p>
  4102. <p>This filter uses PocketSphinx for speech recognition. To enable
  4103. compilation of this filter, you need to configure FFmpeg with
  4104. <code>--enable-pocketsphinx</code>.
  4105. </p>
  4106. <p>It accepts the following options:
  4107. </p>
  4108. <dl compact="compact">
  4109. <dt><samp>rate</samp></dt>
  4110. <dd><p>Set sampling rate of input audio. Defaults is <code>16000</code>.
  4111. This need to match speech models, otherwise one will get poor results.
  4112. </p>
  4113. </dd>
  4114. <dt><samp>hmm</samp></dt>
  4115. <dd><p>Set dictionary containing acoustic model files.
  4116. </p>
  4117. </dd>
  4118. <dt><samp>dict</samp></dt>
  4119. <dd><p>Set pronunciation dictionary.
  4120. </p>
  4121. </dd>
  4122. <dt><samp>lm</samp></dt>
  4123. <dd><p>Set language model file.
  4124. </p>
  4125. </dd>
  4126. <dt><samp>lmctl</samp></dt>
  4127. <dd><p>Set language model set.
  4128. </p>
  4129. </dd>
  4130. <dt><samp>lmname</samp></dt>
  4131. <dd><p>Set which language model to use.
  4132. </p>
  4133. </dd>
  4134. <dt><samp>logfn</samp></dt>
  4135. <dd><p>Set output for log messages.
  4136. </p></dd>
  4137. </dl>
  4138. <p>The filter exports recognized speech as the frame metadata <code>lavfi.asr.text</code>.
  4139. </p>
  4140. <span id="astats"></span><a name="astats-1"></a>
  4141. <h3 class="section">8.47 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>
  4142. <p>Display time domain statistical information about the audio channels.
  4143. Statistics are calculated and displayed for each audio channel and,
  4144. where applicable, an overall figure is also given.
  4145. </p>
  4146. <p>It accepts the following option:
  4147. </p><dl compact="compact">
  4148. <dt><samp>length</samp></dt>
  4149. <dd><p>Short window length in seconds, used for peak and trough RMS measurement.
  4150. Default is <code>0.05</code> (50 milliseconds). Allowed range is <code>[0.01 - 10]</code>.
  4151. </p>
  4152. </dd>
  4153. <dt><samp>metadata</samp></dt>
  4154. <dd>
  4155. <p>Set metadata injection. All the metadata keys are prefixed with <code>lavfi.astats.X</code>,
  4156. where <code>X</code> is channel number starting from 1 or string <code>Overall</code>. Default is
  4157. disabled.
  4158. </p>
  4159. <p>Available keys for each channel are:
  4160. DC_offset
  4161. Min_level
  4162. Max_level
  4163. Min_difference
  4164. Max_difference
  4165. Mean_difference
  4166. RMS_difference
  4167. Peak_level
  4168. RMS_peak
  4169. RMS_trough
  4170. Crest_factor
  4171. Flat_factor
  4172. Peak_count
  4173. Noise_floor
  4174. Noise_floor_count
  4175. Bit_depth
  4176. Dynamic_range
  4177. Zero_crossings
  4178. Zero_crossings_rate
  4179. Number_of_NaNs
  4180. Number_of_Infs
  4181. Number_of_denormals
  4182. </p>
  4183. <p>and for Overall:
  4184. DC_offset
  4185. Min_level
  4186. Max_level
  4187. Min_difference
  4188. Max_difference
  4189. Mean_difference
  4190. RMS_difference
  4191. Peak_level
  4192. RMS_level
  4193. RMS_peak
  4194. RMS_trough
  4195. Flat_factor
  4196. Peak_count
  4197. Noise_floor
  4198. Noise_floor_count
  4199. Bit_depth
  4200. Number_of_samples
  4201. Number_of_NaNs
  4202. Number_of_Infs
  4203. Number_of_denormals
  4204. </p>
  4205. <p>For example full key look like this <code>lavfi.astats.1.DC_offset</code> or
  4206. this <code>lavfi.astats.Overall.Peak_count</code>.
  4207. </p>
  4208. <p>For description what each key means read below.
  4209. </p>
  4210. </dd>
  4211. <dt><samp>reset</samp></dt>
  4212. <dd><p>Set number of frame after which stats are going to be recalculated.
  4213. Default is disabled.
  4214. </p>
  4215. </dd>
  4216. <dt><samp>measure_perchannel</samp></dt>
  4217. <dd><p>Select the entries which need to be measured per channel. The metadata keys can
  4218. be used as flags, default is <samp>all</samp> which measures everything.
  4219. <samp>none</samp> disables all per channel measurement.
  4220. </p>
  4221. </dd>
  4222. <dt><samp>measure_overall</samp></dt>
  4223. <dd><p>Select the entries which need to be measured overall. The metadata keys can
  4224. be used as flags, default is <samp>all</samp> which measures everything.
  4225. <samp>none</samp> disables all overall measurement.
  4226. </p>
  4227. </dd>
  4228. </dl>
  4229. <p>A description of each shown parameter follows:
  4230. </p>
  4231. <dl compact="compact">
  4232. <dt><samp>DC offset</samp></dt>
  4233. <dd><p>Mean amplitude displacement from zero.
  4234. </p>
  4235. </dd>
  4236. <dt><samp>Min level</samp></dt>
  4237. <dd><p>Minimal sample level.
  4238. </p>
  4239. </dd>
  4240. <dt><samp>Max level</samp></dt>
  4241. <dd><p>Maximal sample level.
  4242. </p>
  4243. </dd>
  4244. <dt><samp>Min difference</samp></dt>
  4245. <dd><p>Minimal difference between two consecutive samples.
  4246. </p>
  4247. </dd>
  4248. <dt><samp>Max difference</samp></dt>
  4249. <dd><p>Maximal difference between two consecutive samples.
  4250. </p>
  4251. </dd>
  4252. <dt><samp>Mean difference</samp></dt>
  4253. <dd><p>Mean difference between two consecutive samples.
  4254. The average of each difference between two consecutive samples.
  4255. </p>
  4256. </dd>
  4257. <dt><samp>RMS difference</samp></dt>
  4258. <dd><p>Root Mean Square difference between two consecutive samples.
  4259. </p>
  4260. </dd>
  4261. <dt><samp>Peak level dB</samp></dt>
  4262. <dt><samp>RMS level dB</samp></dt>
  4263. <dd><p>Standard peak and RMS level measured in dBFS.
  4264. </p>
  4265. </dd>
  4266. <dt><samp>RMS peak dB</samp></dt>
  4267. <dt><samp>RMS trough dB</samp></dt>
  4268. <dd><p>Peak and trough values for RMS level measured over a short window.
  4269. </p>
  4270. </dd>
  4271. <dt><samp>Crest factor</samp></dt>
  4272. <dd><p>Standard ratio of peak to RMS level (note: not in dB).
  4273. </p>
  4274. </dd>
  4275. <dt><samp>Flat factor</samp></dt>
  4276. <dd><p>Flatness (i.e. consecutive samples with the same value) of the signal at its peak levels
  4277. (i.e. either <var>Min level</var> or <var>Max level</var>).
  4278. </p>
  4279. </dd>
  4280. <dt><samp>Peak count</samp></dt>
  4281. <dd><p>Number of occasions (not the number of samples) that the signal attained either
  4282. <var>Min level</var> or <var>Max level</var>.
  4283. </p>
  4284. </dd>
  4285. <dt><samp>Noise floor dB</samp></dt>
  4286. <dd><p>Minimum local peak measured in dBFS over a short window.
  4287. </p>
  4288. </dd>
  4289. <dt><samp>Noise floor count</samp></dt>
  4290. <dd><p>Number of occasions (not the number of samples) that the signal attained
  4291. <var>Noise floor</var>.
  4292. </p>
  4293. </dd>
  4294. <dt><samp>Bit depth</samp></dt>
  4295. <dd><p>Overall bit depth of audio. Number of bits used for each sample.
  4296. </p>
  4297. </dd>
  4298. <dt><samp>Dynamic range</samp></dt>
  4299. <dd><p>Measured dynamic range of audio in dB.
  4300. </p>
  4301. </dd>
  4302. <dt><samp>Zero crossings</samp></dt>
  4303. <dd><p>Number of points where the waveform crosses the zero level axis.
  4304. </p>
  4305. </dd>
  4306. <dt><samp>Zero crossings rate</samp></dt>
  4307. <dd><p>Rate of Zero crossings and number of audio samples.
  4308. </p></dd>
  4309. </dl>
  4310. <a name="asubboost"></a>
  4311. <h3 class="section">8.48 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>
  4312. <p>Boost subwoofer frequencies.
  4313. </p>
  4314. <p>The filter accepts the following options:
  4315. </p>
  4316. <dl compact="compact">
  4317. <dt><samp>dry</samp></dt>
  4318. <dd><p>Set dry gain, how much of original signal is kept. Allowed range is from 0 to 1.
  4319. Default value is 0.7.
  4320. </p>
  4321. </dd>
  4322. <dt><samp>wet</samp></dt>
  4323. <dd><p>Set wet gain, how much of filtered signal is kept. Allowed range is from 0 to 1.
  4324. Default value is 0.7.
  4325. </p>
  4326. </dd>
  4327. <dt><samp>decay</samp></dt>
  4328. <dd><p>Set delay line decay gain value. Allowed range is from 0 to 1.
  4329. Default value is 0.7.
  4330. </p>
  4331. </dd>
  4332. <dt><samp>feedback</samp></dt>
  4333. <dd><p>Set delay line feedback gain value. Allowed range is from 0 to 1.
  4334. Default value is 0.9.
  4335. </p>
  4336. </dd>
  4337. <dt><samp>cutoff</samp></dt>
  4338. <dd><p>Set cutoff frequency in Hertz. Allowed range is 50 to 900.
  4339. Default value is 100.
  4340. </p>
  4341. </dd>
  4342. <dt><samp>slope</samp></dt>
  4343. <dd><p>Set slope amount for cutoff frequency. Allowed range is 0.0001 to 1.
  4344. Default value is 0.5.
  4345. </p>
  4346. </dd>
  4347. <dt><samp>delay</samp></dt>
  4348. <dd><p>Set delay. Allowed range is from 1 to 100.
  4349. Default value is 20.
  4350. </p></dd>
  4351. </dl>
  4352. <a name="Commands-17"></a>
  4353. <h4 class="subsection">8.48.1 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>
  4354. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4355. </p>
  4356. <a name="asubcut"></a>
  4357. <h3 class="section">8.49 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>
  4358. <p>Cut subwoofer frequencies.
  4359. </p>
  4360. <p>This filter allows to set custom, steeper
  4361. roll off than highpass filter, and thus is able to more attenuate
  4362. frequency content in stop-band.
  4363. </p>
  4364. <p>The filter accepts the following options:
  4365. </p>
  4366. <dl compact="compact">
  4367. <dt><samp>cutoff</samp></dt>
  4368. <dd><p>Set cutoff frequency in Hertz. Allowed range is 2 to 200.
  4369. Default value is 20.
  4370. </p>
  4371. </dd>
  4372. <dt><samp>order</samp></dt>
  4373. <dd><p>Set filter order. Available values are from 3 to 20.
  4374. Default value is 10.
  4375. </p>
  4376. </dd>
  4377. <dt><samp>level</samp></dt>
  4378. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  4379. </p></dd>
  4380. </dl>
  4381. <a name="Commands-18"></a>
  4382. <h4 class="subsection">8.49.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>
  4383. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4384. </p>
  4385. <a name="asupercut"></a>
  4386. <h3 class="section">8.50 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>
  4387. <p>Cut super frequencies.
  4388. </p>
  4389. <p>The filter accepts the following options:
  4390. </p>
  4391. <dl compact="compact">
  4392. <dt><samp>cutoff</samp></dt>
  4393. <dd><p>Set cutoff frequency in Hertz. Allowed range is 20000 to 192000.
  4394. Default value is 20000.
  4395. </p>
  4396. </dd>
  4397. <dt><samp>order</samp></dt>
  4398. <dd><p>Set filter order. Available values are from 3 to 20.
  4399. Default value is 10.
  4400. </p>
  4401. </dd>
  4402. <dt><samp>level</samp></dt>
  4403. <dd><p>Set input gain level. Allowed range is from 0 to 1. Default value is 1.
  4404. </p></dd>
  4405. </dl>
  4406. <a name="Commands-19"></a>
  4407. <h4 class="subsection">8.50.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>
  4408. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4409. </p>
  4410. <a name="asuperpass"></a>
  4411. <h3 class="section">8.51 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>
  4412. <p>Apply high order Butterworth band-pass filter.
  4413. </p>
  4414. <p>The filter accepts the following options:
  4415. </p>
  4416. <dl compact="compact">
  4417. <dt><samp>centerf</samp></dt>
  4418. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  4419. Default value is 1000.
  4420. </p>
  4421. </dd>
  4422. <dt><samp>order</samp></dt>
  4423. <dd><p>Set filter order. Available values are from 4 to 20.
  4424. Default value is 4.
  4425. </p>
  4426. </dd>
  4427. <dt><samp>qfactor</samp></dt>
  4428. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  4429. </p>
  4430. </dd>
  4431. <dt><samp>level</samp></dt>
  4432. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  4433. </p></dd>
  4434. </dl>
  4435. <a name="Commands-20"></a>
  4436. <h4 class="subsection">8.51.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>
  4437. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4438. </p>
  4439. <a name="asuperstop"></a>
  4440. <h3 class="section">8.52 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>
  4441. <p>Apply high order Butterworth band-stop filter.
  4442. </p>
  4443. <p>The filter accepts the following options:
  4444. </p>
  4445. <dl compact="compact">
  4446. <dt><samp>centerf</samp></dt>
  4447. <dd><p>Set center frequency in Hertz. Allowed range is 2 to 999999.
  4448. Default value is 1000.
  4449. </p>
  4450. </dd>
  4451. <dt><samp>order</samp></dt>
  4452. <dd><p>Set filter order. Available values are from 4 to 20.
  4453. Default value is 4.
  4454. </p>
  4455. </dd>
  4456. <dt><samp>qfactor</samp></dt>
  4457. <dd><p>Set Q-factor. Allowed range is from 0.01 to 100. Default value is 1.
  4458. </p>
  4459. </dd>
  4460. <dt><samp>level</samp></dt>
  4461. <dd><p>Set input gain level. Allowed range is from 0 to 2. Default value is 1.
  4462. </p></dd>
  4463. </dl>
  4464. <a name="Commands-21"></a>
  4465. <h4 class="subsection">8.52.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>
  4466. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  4467. </p>
  4468. <a name="atempo"></a>
  4469. <h3 class="section">8.53 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>
  4470. <p>Adjust audio tempo.
  4471. </p>
  4472. <p>The filter accepts exactly one parameter, the audio tempo. If not
  4473. specified then the filter will assume nominal 1.0 tempo. Tempo must
  4474. be in the [0.5, 100.0] range.
  4475. </p>
  4476. <p>Note that tempo greater than 2 will skip some samples rather than
  4477. blend them in. If for any reason this is a concern it is always
  4478. possible to daisy-chain several instances of atempo to achieve the
  4479. desired product tempo.
  4480. </p>
  4481. <a name="Examples-15"></a>
  4482. <h4 class="subsection">8.53.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>
  4483. <ul>
  4484. <li> Slow down audio to 80% tempo:
  4485. <div class="example">
  4486. <pre class="example">atempo=0.8
  4487. </pre></div>
  4488. </li><li> To speed up audio to 300% tempo:
  4489. <div class="example">
  4490. <pre class="example">atempo=3
  4491. </pre></div>
  4492. </li><li> To speed up audio to 300% tempo by daisy-chaining two atempo instances:
  4493. <div class="example">
  4494. <pre class="example">atempo=sqrt(3),atempo=sqrt(3)
  4495. </pre></div>
  4496. </li></ul>
  4497. <a name="Commands-22"></a>
  4498. <h4 class="subsection">8.53.2 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>
  4499. <p>This filter supports the following commands:
  4500. </p><dl compact="compact">
  4501. <dt><samp>tempo</samp></dt>
  4502. <dd><p>Change filter tempo scale factor.
  4503. Syntax for the command is : &quot;<var>tempo</var>&quot;
  4504. </p></dd>
  4505. </dl>
  4506. <a name="atrim"></a>
  4507. <h3 class="section">8.54 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>
  4508. <p>Trim the input so that the output contains one continuous subpart of the input.
  4509. </p>
  4510. <p>It accepts the following parameters:
  4511. </p><dl compact="compact">
  4512. <dt><samp>start</samp></dt>
  4513. <dd><p>Timestamp (in seconds) of the start of the section to keep. I.e. the audio
  4514. sample with the timestamp <var>start</var> will be the first sample in the output.
  4515. </p>
  4516. </dd>
  4517. <dt><samp>end</samp></dt>
  4518. <dd><p>Specify time of the first audio sample that will be dropped, i.e. the
  4519. audio sample immediately preceding the one with the timestamp <var>end</var> will be
  4520. the last sample in the output.
  4521. </p>
  4522. </dd>
  4523. <dt><samp>start_pts</samp></dt>
  4524. <dd><p>Same as <var>start</var>, except this option sets the start timestamp in samples
  4525. instead of seconds.
  4526. </p>
  4527. </dd>
  4528. <dt><samp>end_pts</samp></dt>
  4529. <dd><p>Same as <var>end</var>, except this option sets the end timestamp in samples instead
  4530. of seconds.
  4531. </p>
  4532. </dd>
  4533. <dt><samp>duration</samp></dt>
  4534. <dd><p>The maximum duration of the output in seconds.
  4535. </p>
  4536. </dd>
  4537. <dt><samp>start_sample</samp></dt>
  4538. <dd><p>The number of the first sample that should be output.
  4539. </p>
  4540. </dd>
  4541. <dt><samp>end_sample</samp></dt>
  4542. <dd><p>The number of the first sample that should be dropped.
  4543. </p></dd>
  4544. </dl>
  4545. <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
  4546. duration specifications; see
  4547. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>.
  4548. </p>
  4549. <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
  4550. option look at the frame timestamp, while the _sample options simply count the
  4551. samples that pass through the filter. So start/end_pts and start/end_sample will
  4552. give different results when the timestamps are wrong, inexact or do not start at
  4553. zero. Also note that this filter does not modify the timestamps. If you wish
  4554. to have the output timestamps start at zero, insert the asetpts filter after the
  4555. atrim filter.
  4556. </p>
  4557. <p>If multiple start or end options are set, this filter tries to be greedy and
  4558. keep all samples that match at least one of the specified constraints. To keep
  4559. only the part that matches all the constraints at once, chain multiple atrim
  4560. filters.
  4561. </p>
  4562. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  4563. just the end values to keep everything before the specified time.
  4564. </p>
  4565. <p>Examples:
  4566. </p><ul>
  4567. <li> Drop everything except the second minute of input:
  4568. <div class="example">
  4569. <pre class="example">ffmpeg -i INPUT -af atrim=60:120
  4570. </pre></div>
  4571. </li><li> Keep only the first 1000 samples:
  4572. <div class="example">
  4573. <pre class="example">ffmpeg -i INPUT -af atrim=end_sample=1000
  4574. </pre></div>
  4575. </li></ul>
  4576. <a name="axcorrelate"></a>
  4577. <h3 class="section">8.55 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>
  4578. <p>Calculate normalized cross-correlation between two input audio streams.
  4579. </p>
  4580. <p>Resulted samples are always between -1 and 1 inclusive.
  4581. If result is 1 it means two input samples are highly correlated in that selected segment.
  4582. Result 0 means they are not correlated at all.
  4583. If result is -1 it means two input samples are out of phase, which means they cancel each
  4584. other.
  4585. </p>
  4586. <p>The filter accepts the following options:
  4587. </p>
  4588. <dl compact="compact">
  4589. <dt><samp>size</samp></dt>
  4590. <dd><p>Set size of segment over which cross-correlation is calculated.
  4591. Default is 256. Allowed range is from 2 to 131072.
  4592. </p>
  4593. </dd>
  4594. <dt><samp>algo</samp></dt>
  4595. <dd><p>Set algorithm for cross-correlation. Can be <code>slow</code> or <code>fast</code>.
  4596. Default is <code>slow</code>. Fast algorithm assumes mean values over any given segment
  4597. are always zero and thus need much less calculations to make.
  4598. This is generally not true, but is valid for typical audio streams.
  4599. </p></dd>
  4600. </dl>
  4601. <a name="Examples-16"></a>
  4602. <h4 class="subsection">8.55.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>
  4603. <ul>
  4604. <li> Calculate correlation between channels in stereo audio stream:
  4605. <div class="example">
  4606. <pre class="example">ffmpeg -i stereo.wav -af channelsplit,axcorrelate=size=1024:algo=fast correlation.wav
  4607. </pre></div>
  4608. </li></ul>
  4609. <a name="bandpass"></a>
  4610. <h3 class="section">8.56 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>
  4611. <p>Apply a two-pole Butterworth band-pass filter with central
  4612. frequency <var>frequency</var>, and (3dB-point) band-width width.
  4613. The <var>csg</var> option selects a constant skirt gain (peak gain = Q)
  4614. instead of the default: constant 0dB peak gain.
  4615. The filter roll off at 6dB per octave (20dB per decade).
  4616. </p>
  4617. <p>The filter accepts the following options:
  4618. </p>
  4619. <dl compact="compact">
  4620. <dt><samp>frequency, f</samp></dt>
  4621. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  4622. </p>
  4623. </dd>
  4624. <dt><samp>csg</samp></dt>
  4625. <dd><p>Constant skirt gain if set to 1. Defaults to 0.
  4626. </p>
  4627. </dd>
  4628. <dt><samp>width_type, t</samp></dt>
  4629. <dd><p>Set method to specify band-width of filter.
  4630. </p><dl compact="compact">
  4631. <dt><samp>h</samp></dt>
  4632. <dd><p>Hz
  4633. </p></dd>
  4634. <dt><samp>q</samp></dt>
  4635. <dd><p>Q-Factor
  4636. </p></dd>
  4637. <dt><samp>o</samp></dt>
  4638. <dd><p>octave
  4639. </p></dd>
  4640. <dt><samp>s</samp></dt>
  4641. <dd><p>slope
  4642. </p></dd>
  4643. <dt><samp>k</samp></dt>
  4644. <dd><p>kHz
  4645. </p></dd>
  4646. </dl>
  4647. </dd>
  4648. <dt><samp>width, w</samp></dt>
  4649. <dd><p>Specify the band-width of a filter in width_type units.
  4650. </p>
  4651. </dd>
  4652. <dt><samp>mix, m</samp></dt>
  4653. <dd><p>How much to use filtered signal in output. Default is 1.
  4654. Range is between 0 and 1.
  4655. </p>
  4656. </dd>
  4657. <dt><samp>channels, c</samp></dt>
  4658. <dd><p>Specify which channels to filter, by default all available are filtered.
  4659. </p>
  4660. </dd>
  4661. <dt><samp>normalize, n</samp></dt>
  4662. <dd><p>Normalize biquad coefficients, by default is disabled.
  4663. Enabling it will normalize magnitude response at DC to 0dB.
  4664. </p>
  4665. </dd>
  4666. <dt><samp>transform, a</samp></dt>
  4667. <dd><p>Set transform type of IIR filter.
  4668. </p><dl compact="compact">
  4669. <dt><samp>di</samp></dt>
  4670. <dt><samp>dii</samp></dt>
  4671. <dt><samp>tdii</samp></dt>
  4672. <dt><samp>latt</samp></dt>
  4673. </dl>
  4674. </dd>
  4675. <dt><samp>precision, r</samp></dt>
  4676. <dd><p>Set precison of filtering.
  4677. </p><dl compact="compact">
  4678. <dt><samp>auto</samp></dt>
  4679. <dd><p>Pick automatic sample format depending on surround filters.
  4680. </p></dd>
  4681. <dt><samp>s16</samp></dt>
  4682. <dd><p>Always use signed 16-bit.
  4683. </p></dd>
  4684. <dt><samp>s32</samp></dt>
  4685. <dd><p>Always use signed 32-bit.
  4686. </p></dd>
  4687. <dt><samp>f32</samp></dt>
  4688. <dd><p>Always use float 32-bit.
  4689. </p></dd>
  4690. <dt><samp>f64</samp></dt>
  4691. <dd><p>Always use float 64-bit.
  4692. </p></dd>
  4693. </dl>
  4694. </dd>
  4695. </dl>
  4696. <a name="Commands-23"></a>
  4697. <h4 class="subsection">8.56.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>
  4698. <p>This filter supports the following commands:
  4699. </p><dl compact="compact">
  4700. <dt><samp>frequency, f</samp></dt>
  4701. <dd><p>Change bandpass frequency.
  4702. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4703. </p>
  4704. </dd>
  4705. <dt><samp>width_type, t</samp></dt>
  4706. <dd><p>Change bandpass width_type.
  4707. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4708. </p>
  4709. </dd>
  4710. <dt><samp>width, w</samp></dt>
  4711. <dd><p>Change bandpass width.
  4712. Syntax for the command is : &quot;<var>width</var>&quot;
  4713. </p>
  4714. </dd>
  4715. <dt><samp>mix, m</samp></dt>
  4716. <dd><p>Change bandpass mix.
  4717. Syntax for the command is : &quot;<var>mix</var>&quot;
  4718. </p></dd>
  4719. </dl>
  4720. <a name="bandreject"></a>
  4721. <h3 class="section">8.57 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>
  4722. <p>Apply a two-pole Butterworth band-reject filter with central
  4723. frequency <var>frequency</var>, and (3dB-point) band-width <var>width</var>.
  4724. The filter roll off at 6dB per octave (20dB per decade).
  4725. </p>
  4726. <p>The filter accepts the following options:
  4727. </p>
  4728. <dl compact="compact">
  4729. <dt><samp>frequency, f</samp></dt>
  4730. <dd><p>Set the filter&rsquo;s central frequency. Default is <code>3000</code>.
  4731. </p>
  4732. </dd>
  4733. <dt><samp>width_type, t</samp></dt>
  4734. <dd><p>Set method to specify band-width of filter.
  4735. </p><dl compact="compact">
  4736. <dt><samp>h</samp></dt>
  4737. <dd><p>Hz
  4738. </p></dd>
  4739. <dt><samp>q</samp></dt>
  4740. <dd><p>Q-Factor
  4741. </p></dd>
  4742. <dt><samp>o</samp></dt>
  4743. <dd><p>octave
  4744. </p></dd>
  4745. <dt><samp>s</samp></dt>
  4746. <dd><p>slope
  4747. </p></dd>
  4748. <dt><samp>k</samp></dt>
  4749. <dd><p>kHz
  4750. </p></dd>
  4751. </dl>
  4752. </dd>
  4753. <dt><samp>width, w</samp></dt>
  4754. <dd><p>Specify the band-width of a filter in width_type units.
  4755. </p>
  4756. </dd>
  4757. <dt><samp>mix, m</samp></dt>
  4758. <dd><p>How much to use filtered signal in output. Default is 1.
  4759. Range is between 0 and 1.
  4760. </p>
  4761. </dd>
  4762. <dt><samp>channels, c</samp></dt>
  4763. <dd><p>Specify which channels to filter, by default all available are filtered.
  4764. </p>
  4765. </dd>
  4766. <dt><samp>normalize, n</samp></dt>
  4767. <dd><p>Normalize biquad coefficients, by default is disabled.
  4768. Enabling it will normalize magnitude response at DC to 0dB.
  4769. </p>
  4770. </dd>
  4771. <dt><samp>transform, a</samp></dt>
  4772. <dd><p>Set transform type of IIR filter.
  4773. </p><dl compact="compact">
  4774. <dt><samp>di</samp></dt>
  4775. <dt><samp>dii</samp></dt>
  4776. <dt><samp>tdii</samp></dt>
  4777. <dt><samp>latt</samp></dt>
  4778. </dl>
  4779. </dd>
  4780. <dt><samp>precision, r</samp></dt>
  4781. <dd><p>Set precison of filtering.
  4782. </p><dl compact="compact">
  4783. <dt><samp>auto</samp></dt>
  4784. <dd><p>Pick automatic sample format depending on surround filters.
  4785. </p></dd>
  4786. <dt><samp>s16</samp></dt>
  4787. <dd><p>Always use signed 16-bit.
  4788. </p></dd>
  4789. <dt><samp>s32</samp></dt>
  4790. <dd><p>Always use signed 32-bit.
  4791. </p></dd>
  4792. <dt><samp>f32</samp></dt>
  4793. <dd><p>Always use float 32-bit.
  4794. </p></dd>
  4795. <dt><samp>f64</samp></dt>
  4796. <dd><p>Always use float 64-bit.
  4797. </p></dd>
  4798. </dl>
  4799. </dd>
  4800. </dl>
  4801. <a name="Commands-24"></a>
  4802. <h4 class="subsection">8.57.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>
  4803. <p>This filter supports the following commands:
  4804. </p><dl compact="compact">
  4805. <dt><samp>frequency, f</samp></dt>
  4806. <dd><p>Change bandreject frequency.
  4807. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4808. </p>
  4809. </dd>
  4810. <dt><samp>width_type, t</samp></dt>
  4811. <dd><p>Change bandreject width_type.
  4812. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4813. </p>
  4814. </dd>
  4815. <dt><samp>width, w</samp></dt>
  4816. <dd><p>Change bandreject width.
  4817. Syntax for the command is : &quot;<var>width</var>&quot;
  4818. </p>
  4819. </dd>
  4820. <dt><samp>mix, m</samp></dt>
  4821. <dd><p>Change bandreject mix.
  4822. Syntax for the command is : &quot;<var>mix</var>&quot;
  4823. </p></dd>
  4824. </dl>
  4825. <a name="bass_002c-lowshelf"></a>
  4826. <h3 class="section">8.58 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>
  4827. <p>Boost or cut the bass (lower) frequencies of the audio using a two-pole
  4828. shelving filter with a response similar to that of a standard
  4829. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  4830. </p>
  4831. <p>The filter accepts the following options:
  4832. </p>
  4833. <dl compact="compact">
  4834. <dt><samp>gain, g</samp></dt>
  4835. <dd><p>Give the gain at 0 Hz. Its useful range is about -20
  4836. (for a large cut) to +20 (for a large boost).
  4837. Beware of clipping when using a positive gain.
  4838. </p>
  4839. </dd>
  4840. <dt><samp>frequency, f</samp></dt>
  4841. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  4842. to extend or reduce the frequency range to be boosted or cut.
  4843. The default value is <code>100</code> Hz.
  4844. </p>
  4845. </dd>
  4846. <dt><samp>width_type, t</samp></dt>
  4847. <dd><p>Set method to specify band-width of filter.
  4848. </p><dl compact="compact">
  4849. <dt><samp>h</samp></dt>
  4850. <dd><p>Hz
  4851. </p></dd>
  4852. <dt><samp>q</samp></dt>
  4853. <dd><p>Q-Factor
  4854. </p></dd>
  4855. <dt><samp>o</samp></dt>
  4856. <dd><p>octave
  4857. </p></dd>
  4858. <dt><samp>s</samp></dt>
  4859. <dd><p>slope
  4860. </p></dd>
  4861. <dt><samp>k</samp></dt>
  4862. <dd><p>kHz
  4863. </p></dd>
  4864. </dl>
  4865. </dd>
  4866. <dt><samp>width, w</samp></dt>
  4867. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  4868. </p>
  4869. </dd>
  4870. <dt><samp>poles, p</samp></dt>
  4871. <dd><p>Set number of poles. Default is 2.
  4872. </p>
  4873. </dd>
  4874. <dt><samp>mix, m</samp></dt>
  4875. <dd><p>How much to use filtered signal in output. Default is 1.
  4876. Range is between 0 and 1.
  4877. </p>
  4878. </dd>
  4879. <dt><samp>channels, c</samp></dt>
  4880. <dd><p>Specify which channels to filter, by default all available are filtered.
  4881. </p>
  4882. </dd>
  4883. <dt><samp>normalize, n</samp></dt>
  4884. <dd><p>Normalize biquad coefficients, by default is disabled.
  4885. Enabling it will normalize magnitude response at DC to 0dB.
  4886. </p>
  4887. </dd>
  4888. <dt><samp>transform, a</samp></dt>
  4889. <dd><p>Set transform type of IIR filter.
  4890. </p><dl compact="compact">
  4891. <dt><samp>di</samp></dt>
  4892. <dt><samp>dii</samp></dt>
  4893. <dt><samp>tdii</samp></dt>
  4894. <dt><samp>latt</samp></dt>
  4895. </dl>
  4896. </dd>
  4897. <dt><samp>precision, r</samp></dt>
  4898. <dd><p>Set precison of filtering.
  4899. </p><dl compact="compact">
  4900. <dt><samp>auto</samp></dt>
  4901. <dd><p>Pick automatic sample format depending on surround filters.
  4902. </p></dd>
  4903. <dt><samp>s16</samp></dt>
  4904. <dd><p>Always use signed 16-bit.
  4905. </p></dd>
  4906. <dt><samp>s32</samp></dt>
  4907. <dd><p>Always use signed 32-bit.
  4908. </p></dd>
  4909. <dt><samp>f32</samp></dt>
  4910. <dd><p>Always use float 32-bit.
  4911. </p></dd>
  4912. <dt><samp>f64</samp></dt>
  4913. <dd><p>Always use float 64-bit.
  4914. </p></dd>
  4915. </dl>
  4916. </dd>
  4917. </dl>
  4918. <a name="Commands-25"></a>
  4919. <h4 class="subsection">8.58.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>
  4920. <p>This filter supports the following commands:
  4921. </p><dl compact="compact">
  4922. <dt><samp>frequency, f</samp></dt>
  4923. <dd><p>Change bass frequency.
  4924. Syntax for the command is : &quot;<var>frequency</var>&quot;
  4925. </p>
  4926. </dd>
  4927. <dt><samp>width_type, t</samp></dt>
  4928. <dd><p>Change bass width_type.
  4929. Syntax for the command is : &quot;<var>width_type</var>&quot;
  4930. </p>
  4931. </dd>
  4932. <dt><samp>width, w</samp></dt>
  4933. <dd><p>Change bass width.
  4934. Syntax for the command is : &quot;<var>width</var>&quot;
  4935. </p>
  4936. </dd>
  4937. <dt><samp>gain, g</samp></dt>
  4938. <dd><p>Change bass gain.
  4939. Syntax for the command is : &quot;<var>gain</var>&quot;
  4940. </p>
  4941. </dd>
  4942. <dt><samp>mix, m</samp></dt>
  4943. <dd><p>Change bass mix.
  4944. Syntax for the command is : &quot;<var>mix</var>&quot;
  4945. </p></dd>
  4946. </dl>
  4947. <a name="biquad"></a>
  4948. <h3 class="section">8.59 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>
  4949. <p>Apply a biquad IIR filter with the given coefficients.
  4950. Where <var>b0</var>, <var>b1</var>, <var>b2</var> and <var>a0</var>, <var>a1</var>, <var>a2</var>
  4951. are the numerator and denominator coefficients respectively.
  4952. and <var>channels</var>, <var>c</var> specify which channels to filter, by default all
  4953. available are filtered.
  4954. </p>
  4955. <a name="Commands-26"></a>
  4956. <h4 class="subsection">8.59.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>
  4957. <p>This filter supports the following commands:
  4958. </p><dl compact="compact">
  4959. <dt><samp>a0</samp></dt>
  4960. <dt><samp>a1</samp></dt>
  4961. <dt><samp>a2</samp></dt>
  4962. <dt><samp>b0</samp></dt>
  4963. <dt><samp>b1</samp></dt>
  4964. <dt><samp>b2</samp></dt>
  4965. <dd><p>Change biquad parameter.
  4966. Syntax for the command is : &quot;<var>value</var>&quot;
  4967. </p>
  4968. </dd>
  4969. <dt><samp>mix, m</samp></dt>
  4970. <dd><p>How much to use filtered signal in output. Default is 1.
  4971. Range is between 0 and 1.
  4972. </p>
  4973. </dd>
  4974. <dt><samp>channels, c</samp></dt>
  4975. <dd><p>Specify which channels to filter, by default all available are filtered.
  4976. </p>
  4977. </dd>
  4978. <dt><samp>normalize, n</samp></dt>
  4979. <dd><p>Normalize biquad coefficients, by default is disabled.
  4980. Enabling it will normalize magnitude response at DC to 0dB.
  4981. </p>
  4982. </dd>
  4983. <dt><samp>transform, a</samp></dt>
  4984. <dd><p>Set transform type of IIR filter.
  4985. </p><dl compact="compact">
  4986. <dt><samp>di</samp></dt>
  4987. <dt><samp>dii</samp></dt>
  4988. <dt><samp>tdii</samp></dt>
  4989. <dt><samp>latt</samp></dt>
  4990. </dl>
  4991. </dd>
  4992. <dt><samp>precision, r</samp></dt>
  4993. <dd><p>Set precison of filtering.
  4994. </p><dl compact="compact">
  4995. <dt><samp>auto</samp></dt>
  4996. <dd><p>Pick automatic sample format depending on surround filters.
  4997. </p></dd>
  4998. <dt><samp>s16</samp></dt>
  4999. <dd><p>Always use signed 16-bit.
  5000. </p></dd>
  5001. <dt><samp>s32</samp></dt>
  5002. <dd><p>Always use signed 32-bit.
  5003. </p></dd>
  5004. <dt><samp>f32</samp></dt>
  5005. <dd><p>Always use float 32-bit.
  5006. </p></dd>
  5007. <dt><samp>f64</samp></dt>
  5008. <dd><p>Always use float 64-bit.
  5009. </p></dd>
  5010. </dl>
  5011. </dd>
  5012. </dl>
  5013. <a name="bs2b"></a>
  5014. <h3 class="section">8.60 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>
  5015. <p>Bauer stereo to binaural transformation, which improves headphone listening of
  5016. stereo audio records.
  5017. </p>
  5018. <p>To enable compilation of this filter you need to configure FFmpeg with
  5019. <code>--enable-libbs2b</code>.
  5020. </p>
  5021. <p>It accepts the following parameters:
  5022. </p><dl compact="compact">
  5023. <dt><samp>profile</samp></dt>
  5024. <dd><p>Pre-defined crossfeed level.
  5025. </p><dl compact="compact">
  5026. <dt><samp>default</samp></dt>
  5027. <dd><p>Default level (fcut=700, feed=50).
  5028. </p>
  5029. </dd>
  5030. <dt><samp>cmoy</samp></dt>
  5031. <dd><p>Chu Moy circuit (fcut=700, feed=60).
  5032. </p>
  5033. </dd>
  5034. <dt><samp>jmeier</samp></dt>
  5035. <dd><p>Jan Meier circuit (fcut=650, feed=95).
  5036. </p>
  5037. </dd>
  5038. </dl>
  5039. </dd>
  5040. <dt><samp>fcut</samp></dt>
  5041. <dd><p>Cut frequency (in Hz).
  5042. </p>
  5043. </dd>
  5044. <dt><samp>feed</samp></dt>
  5045. <dd><p>Feed level (in Hz).
  5046. </p>
  5047. </dd>
  5048. </dl>
  5049. <a name="channelmap"></a>
  5050. <h3 class="section">8.61 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>
  5051. <p>Remap input channels to new locations.
  5052. </p>
  5053. <p>It accepts the following parameters:
  5054. </p><dl compact="compact">
  5055. <dt><samp>map</samp></dt>
  5056. <dd><p>Map channels from input to output. The argument is a &rsquo;|&rsquo;-separated list of
  5057. mappings, each in the <code><var>in_channel</var>-<var>out_channel</var></code> or
  5058. <var>in_channel</var> form. <var>in_channel</var> can be either the name of the input
  5059. channel (e.g. FL for front left) or its index in the input channel layout.
  5060. <var>out_channel</var> is the name of the output channel or its index in the output
  5061. channel layout. If <var>out_channel</var> is not given then it is implicitly an
  5062. index, starting with zero and increasing by one for each mapping.
  5063. </p>
  5064. </dd>
  5065. <dt><samp>channel_layout</samp></dt>
  5066. <dd><p>The channel layout of the output stream.
  5067. </p></dd>
  5068. </dl>
  5069. <p>If no mapping is present, the filter will implicitly map input channels to
  5070. output channels, preserving indices.
  5071. </p>
  5072. <a name="Examples-17"></a>
  5073. <h4 class="subsection">8.61.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>
  5074. <ul>
  5075. <li> For example, assuming a 5.1+downmix input MOV file,
  5076. <div class="example">
  5077. <pre class="example">ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  5078. </pre></div>
  5079. <p>will create an output WAV file tagged as stereo from the downmix channels of
  5080. the input.
  5081. </p>
  5082. </li><li> To fix a 5.1 WAV improperly encoded in AAC&rsquo;s native channel order
  5083. <div class="example">
  5084. <pre class="example">ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:5.1' out.wav
  5085. </pre></div>
  5086. </li></ul>
  5087. <a name="channelsplit"></a>
  5088. <h3 class="section">8.62 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>
  5089. <p>Split each channel from an input audio stream into a separate output stream.
  5090. </p>
  5091. <p>It accepts the following parameters:
  5092. </p><dl compact="compact">
  5093. <dt><samp>channel_layout</samp></dt>
  5094. <dd><p>The channel layout of the input stream. The default is &quot;stereo&quot;.
  5095. </p></dd>
  5096. <dt><samp>channels</samp></dt>
  5097. <dd><p>A channel layout describing the channels to be extracted as separate output streams
  5098. or &quot;all&quot; to extract each input channel as a separate stream. The default is &quot;all&quot;.
  5099. </p>
  5100. <p>Choosing channels not present in channel layout in the input will result in an error.
  5101. </p></dd>
  5102. </dl>
  5103. <a name="Examples-18"></a>
  5104. <h4 class="subsection">8.62.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>
  5105. <ul>
  5106. <li> For example, assuming a stereo input MP3 file,
  5107. <div class="example">
  5108. <pre class="example">ffmpeg -i in.mp3 -filter_complex channelsplit out.mkv
  5109. </pre></div>
  5110. <p>will create an output Matroska file with two audio streams, one containing only
  5111. the left channel and the other the right channel.
  5112. </p>
  5113. </li><li> Split a 5.1 WAV file into per-channel files:
  5114. <div class="example">
  5115. <pre class="example">ffmpeg -i in.wav -filter_complex
  5116. 'channelsplit=channel_layout=5.1[FL][FR][FC][LFE][SL][SR]'
  5117. -map '[FL]' front_left.wav -map '[FR]' front_right.wav -map '[FC]'
  5118. front_center.wav -map '[LFE]' lfe.wav -map '[SL]' side_left.wav -map '[SR]'
  5119. side_right.wav
  5120. </pre></div>
  5121. </li><li> Extract only LFE from a 5.1 WAV file:
  5122. <div class="example">
  5123. <pre class="example">ffmpeg -i in.wav -filter_complex 'channelsplit=channel_layout=5.1:channels=LFE[LFE]'
  5124. -map '[LFE]' lfe.wav
  5125. </pre></div>
  5126. </li></ul>
  5127. <a name="chorus"></a>
  5128. <h3 class="section">8.63 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>
  5129. <p>Add a chorus effect to the audio.
  5130. </p>
  5131. <p>Can make a single vocal sound like a chorus, but can also be applied to instrumentation.
  5132. </p>
  5133. <p>Chorus resembles an echo effect with a short delay, but whereas with echo the delay is
  5134. constant, with chorus, it is varied using using sinusoidal or triangular modulation.
  5135. The modulation depth defines the range the modulated delay is played before or after
  5136. the delay. Hence the delayed sound will sound slower or faster, that is the delayed
  5137. sound tuned around the original one, like in a chorus where some vocals are slightly
  5138. off key.
  5139. </p>
  5140. <p>It accepts the following parameters:
  5141. </p><dl compact="compact">
  5142. <dt><samp>in_gain</samp></dt>
  5143. <dd><p>Set input gain. Default is 0.4.
  5144. </p>
  5145. </dd>
  5146. <dt><samp>out_gain</samp></dt>
  5147. <dd><p>Set output gain. Default is 0.4.
  5148. </p>
  5149. </dd>
  5150. <dt><samp>delays</samp></dt>
  5151. <dd><p>Set delays. A typical delay is around 40ms to 60ms.
  5152. </p>
  5153. </dd>
  5154. <dt><samp>decays</samp></dt>
  5155. <dd><p>Set decays.
  5156. </p>
  5157. </dd>
  5158. <dt><samp>speeds</samp></dt>
  5159. <dd><p>Set speeds.
  5160. </p>
  5161. </dd>
  5162. <dt><samp>depths</samp></dt>
  5163. <dd><p>Set depths.
  5164. </p></dd>
  5165. </dl>
  5166. <a name="Examples-19"></a>
  5167. <h4 class="subsection">8.63.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>
  5168. <ul>
  5169. <li> A single delay:
  5170. <div class="example">
  5171. <pre class="example">chorus=0.7:0.9:55:0.4:0.25:2
  5172. </pre></div>
  5173. </li><li> Two delays:
  5174. <div class="example">
  5175. <pre class="example">chorus=0.6:0.9:50|60:0.4|0.32:0.25|0.4:2|1.3
  5176. </pre></div>
  5177. </li><li> Fuller sounding chorus with three delays:
  5178. <div class="example">
  5179. <pre class="example">chorus=0.5:0.9:50|60|40:0.4|0.32|0.3:0.25|0.4|0.3:2|2.3|1.3
  5180. </pre></div>
  5181. </li></ul>
  5182. <a name="compand"></a>
  5183. <h3 class="section">8.64 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>
  5184. <p>Compress or expand the audio&rsquo;s dynamic range.
  5185. </p>
  5186. <p>It accepts the following parameters:
  5187. </p>
  5188. <dl compact="compact">
  5189. <dt><samp>attacks</samp></dt>
  5190. <dt><samp>decays</samp></dt>
  5191. <dd><p>A list of times in seconds for each channel over which the instantaneous level
  5192. of the input signal is averaged to determine its volume. <var>attacks</var> refers to
  5193. increase of volume and <var>decays</var> refers to decrease of volume. For most
  5194. situations, the attack time (response to the audio getting louder) should be
  5195. shorter than the decay time, because the human ear is more sensitive to sudden
  5196. loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
  5197. a typical value for decay is 0.8 seconds.
  5198. If specified number of attacks &amp; decays is lower than number of channels, the last
  5199. set attack/decay will be used for all remaining channels.
  5200. </p>
  5201. </dd>
  5202. <dt><samp>points</samp></dt>
  5203. <dd><p>A list of points for the transfer function, specified in dB relative to the
  5204. maximum possible signal amplitude. Each key points list must be defined using
  5205. the following syntax: <code>x0/y0|x1/y1|x2/y2|....</code> or
  5206. <code>x0/y0 x1/y1 x2/y2 ....</code>
  5207. </p>
  5208. <p>The input values must be in strictly increasing order but the transfer function
  5209. does not have to be monotonically rising. The point <code>0/0</code> is assumed but
  5210. may be overridden (by <code>0/out-dBn</code>). Typical values for the transfer
  5211. function are <code>-70/-70|-60/-20|1/0</code>.
  5212. </p>
  5213. </dd>
  5214. <dt><samp>soft-knee</samp></dt>
  5215. <dd><p>Set the curve radius in dB for all joints. It defaults to 0.01.
  5216. </p>
  5217. </dd>
  5218. <dt><samp>gain</samp></dt>
  5219. <dd><p>Set the additional gain in dB to be applied at all points on the transfer
  5220. function. This allows for easy adjustment of the overall gain.
  5221. It defaults to 0.
  5222. </p>
  5223. </dd>
  5224. <dt><samp>volume</samp></dt>
  5225. <dd><p>Set an initial volume, in dB, to be assumed for each channel when filtering
  5226. starts. This permits the user to supply a nominal level initially, so that, for
  5227. example, a very large gain is not applied to initial signal levels before the
  5228. companding has begun to operate. A typical value for audio which is initially
  5229. quiet is -90 dB. It defaults to 0.
  5230. </p>
  5231. </dd>
  5232. <dt><samp>delay</samp></dt>
  5233. <dd><p>Set a delay, in seconds. The input audio is analyzed immediately, but audio is
  5234. delayed before being fed to the volume adjuster. Specifying a delay
  5235. approximately equal to the attack/decay times allows the filter to effectively
  5236. operate in predictive rather than reactive mode. It defaults to 0.
  5237. </p>
  5238. </dd>
  5239. </dl>
  5240. <a name="Examples-20"></a>
  5241. <h4 class="subsection">8.64.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>
  5242. <ul>
  5243. <li> Make music with both quiet and loud passages suitable for listening to in a
  5244. noisy environment:
  5245. <div class="example">
  5246. <pre class="example">compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
  5247. </pre></div>
  5248. <p>Another example for audio with whisper and explosion parts:
  5249. </p><div class="example">
  5250. <pre class="example">compand=0|0:1|1:-90/-900|-70/-70|-30/-9|0/-3:6:0:0:0
  5251. </pre></div>
  5252. </li><li> A noise gate for when the noise is at a lower level than the signal:
  5253. <div class="example">
  5254. <pre class="example">compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
  5255. </pre></div>
  5256. </li><li> Here is another noise gate, this time for when the noise is at a higher level
  5257. than the signal (making it, in some ways, similar to squelch):
  5258. <div class="example">
  5259. <pre class="example">compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
  5260. </pre></div>
  5261. </li><li> 2:1 compression starting at -6dB:
  5262. <div class="example">
  5263. <pre class="example">compand=points=-80/-80|-6/-6|0/-3.8|20/3.5
  5264. </pre></div>
  5265. </li><li> 2:1 compression starting at -9dB:
  5266. <div class="example">
  5267. <pre class="example">compand=points=-80/-80|-9/-9|0/-5.3|20/2.9
  5268. </pre></div>
  5269. </li><li> 2:1 compression starting at -12dB:
  5270. <div class="example">
  5271. <pre class="example">compand=points=-80/-80|-12/-12|0/-6.8|20/1.9
  5272. </pre></div>
  5273. </li><li> 2:1 compression starting at -18dB:
  5274. <div class="example">
  5275. <pre class="example">compand=points=-80/-80|-18/-18|0/-9.8|20/0.7
  5276. </pre></div>
  5277. </li><li> 3:1 compression starting at -15dB:
  5278. <div class="example">
  5279. <pre class="example">compand=points=-80/-80|-15/-15|0/-10.8|20/-5.2
  5280. </pre></div>
  5281. </li><li> Compressor/Gate:
  5282. <div class="example">
  5283. <pre class="example">compand=points=-80/-105|-62/-80|-15.4/-15.4|0/-12|20/-7.6
  5284. </pre></div>
  5285. </li><li> Expander:
  5286. <div class="example">
  5287. <pre class="example">compand=attacks=0:points=-80/-169|-54/-80|-49.5/-64.6|-41.1/-41.1|-25.8/-15|-10.8/-4.5|0/0|20/8.3
  5288. </pre></div>
  5289. </li><li> Hard limiter at -6dB:
  5290. <div class="example">
  5291. <pre class="example">compand=attacks=0:points=-80/-80|-6/-6|20/-6
  5292. </pre></div>
  5293. </li><li> Hard limiter at -12dB:
  5294. <div class="example">
  5295. <pre class="example">compand=attacks=0:points=-80/-80|-12/-12|20/-12
  5296. </pre></div>
  5297. </li><li> Hard noise gate at -35 dB:
  5298. <div class="example">
  5299. <pre class="example">compand=attacks=0:points=-80/-115|-35.1/-80|-35/-35|20/20
  5300. </pre></div>
  5301. </li><li> Soft limiter:
  5302. <div class="example">
  5303. <pre class="example">compand=attacks=0:points=-80/-80|-12.4/-12.4|-6/-8|0/-6.8|20/-2.8
  5304. </pre></div>
  5305. </li></ul>
  5306. <a name="compensationdelay"></a>
  5307. <h3 class="section">8.65 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>
  5308. <p>Compensation Delay Line is a metric based delay to compensate differing
  5309. positions of microphones or speakers.
  5310. </p>
  5311. <p>For example, you have recorded guitar with two microphones placed in
  5312. different locations. Because the front of sound wave has fixed speed in
  5313. normal conditions, the phasing of microphones can vary and depends on
  5314. their location and interposition. The best sound mix can be achieved when
  5315. these microphones are in phase (synchronized). Note that a distance of
  5316. ~30 cm between microphones makes one microphone capture the signal in
  5317. antiphase to the other microphone. That makes the final mix sound moody.
  5318. This filter helps to solve phasing problems by adding different delays
  5319. to each microphone track and make them synchronized.
  5320. </p>
  5321. <p>The best result can be reached when you take one track as base and
  5322. synchronize other tracks one by one with it.
  5323. Remember that synchronization/delay tolerance depends on sample rate, too.
  5324. Higher sample rates will give more tolerance.
  5325. </p>
  5326. <p>The filter accepts the following parameters:
  5327. </p>
  5328. <dl compact="compact">
  5329. <dt><samp>mm</samp></dt>
  5330. <dd><p>Set millimeters distance. This is compensation distance for fine tuning.
  5331. Default is 0.
  5332. </p>
  5333. </dd>
  5334. <dt><samp>cm</samp></dt>
  5335. <dd><p>Set cm distance. This is compensation distance for tightening distance setup.
  5336. Default is 0.
  5337. </p>
  5338. </dd>
  5339. <dt><samp>m</samp></dt>
  5340. <dd><p>Set meters distance. This is compensation distance for hard distance setup.
  5341. Default is 0.
  5342. </p>
  5343. </dd>
  5344. <dt><samp>dry</samp></dt>
  5345. <dd><p>Set dry amount. Amount of unprocessed (dry) signal.
  5346. Default is 0.
  5347. </p>
  5348. </dd>
  5349. <dt><samp>wet</samp></dt>
  5350. <dd><p>Set wet amount. Amount of processed (wet) signal.
  5351. Default is 1.
  5352. </p>
  5353. </dd>
  5354. <dt><samp>temp</samp></dt>
  5355. <dd><p>Set temperature in degrees Celsius. This is the temperature of the environment.
  5356. Default is 20.
  5357. </p></dd>
  5358. </dl>
  5359. <a name="crossfeed"></a>
  5360. <h3 class="section">8.66 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>
  5361. <p>Apply headphone crossfeed filter.
  5362. </p>
  5363. <p>Crossfeed is the process of blending the left and right channels of stereo
  5364. audio recording.
  5365. It is mainly used to reduce extreme stereo separation of low frequencies.
  5366. </p>
  5367. <p>The intent is to produce more speaker like sound to the listener.
  5368. </p>
  5369. <p>The filter accepts the following options:
  5370. </p>
  5371. <dl compact="compact">
  5372. <dt><samp>strength</samp></dt>
  5373. <dd><p>Set strength of crossfeed. Default is 0.2. Allowed range is from 0 to 1.
  5374. This sets gain of low shelf filter for side part of stereo image.
  5375. Default is -6dB. Max allowed is -30db when strength is set to 1.
  5376. </p>
  5377. </dd>
  5378. <dt><samp>range</samp></dt>
  5379. <dd><p>Set soundstage wideness. Default is 0.5. Allowed range is from 0 to 1.
  5380. This sets cut off frequency of low shelf filter. Default is cut off near
  5381. 1550 Hz. With range set to 1 cut off frequency is set to 2100 Hz.
  5382. </p>
  5383. </dd>
  5384. <dt><samp>slope</samp></dt>
  5385. <dd><p>Set curve slope of low shelf filter. Default is 0.5.
  5386. Allowed range is from 0.01 to 1.
  5387. </p>
  5388. </dd>
  5389. <dt><samp>level_in</samp></dt>
  5390. <dd><p>Set input gain. Default is 0.9.
  5391. </p>
  5392. </dd>
  5393. <dt><samp>level_out</samp></dt>
  5394. <dd><p>Set output gain. Default is 1.
  5395. </p></dd>
  5396. </dl>
  5397. <a name="Commands-27"></a>
  5398. <h4 class="subsection">8.66.1 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>
  5399. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5400. </p>
  5401. <a name="crystalizer"></a>
  5402. <h3 class="section">8.67 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>
  5403. <p>Simple algorithm for audio noise sharpening.
  5404. </p>
  5405. <p>This filter linearly increases differences betweeen each audio sample.
  5406. </p>
  5407. <p>The filter accepts the following options:
  5408. </p>
  5409. <dl compact="compact">
  5410. <dt><samp>i</samp></dt>
  5411. <dd><p>Sets the intensity of effect (default: 2.0). Must be in range between -10.0 to 0
  5412. (unchanged sound) to 10.0 (maximum effect).
  5413. To inverse filtering use negative value.
  5414. </p>
  5415. </dd>
  5416. <dt><samp>c</samp></dt>
  5417. <dd><p>Enable clipping. By default is enabled.
  5418. </p></dd>
  5419. </dl>
  5420. <a name="Commands-28"></a>
  5421. <h4 class="subsection">8.67.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>
  5422. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5423. </p>
  5424. <a name="dcshift"></a>
  5425. <h3 class="section">8.68 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>
  5426. <p>Apply a DC shift to the audio.
  5427. </p>
  5428. <p>This can be useful to remove a DC offset (caused perhaps by a hardware problem
  5429. in the recording chain) from the audio. The effect of a DC offset is reduced
  5430. headroom and hence volume. The <a href="#astats">astats</a> filter can be used to determine if
  5431. a signal has a DC offset.
  5432. </p>
  5433. <dl compact="compact">
  5434. <dt><samp>shift</samp></dt>
  5435. <dd><p>Set the DC shift, allowed range is [-1, 1]. It indicates the amount to shift
  5436. the audio.
  5437. </p>
  5438. </dd>
  5439. <dt><samp>limitergain</samp></dt>
  5440. <dd><p>Optional. It should have a value much less than 1 (e.g. 0.05 or 0.02) and is
  5441. used to prevent clipping.
  5442. </p></dd>
  5443. </dl>
  5444. <a name="deesser"></a>
  5445. <h3 class="section">8.69 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>
  5446. <p>Apply de-essing to the audio samples.
  5447. </p>
  5448. <dl compact="compact">
  5449. <dt><samp>i</samp></dt>
  5450. <dd><p>Set intensity for triggering de-essing. Allowed range is from 0 to 1.
  5451. Default is 0.
  5452. </p>
  5453. </dd>
  5454. <dt><samp>m</samp></dt>
  5455. <dd><p>Set amount of ducking on treble part of sound. Allowed range is from 0 to 1.
  5456. Default is 0.5.
  5457. </p>
  5458. </dd>
  5459. <dt><samp>f</samp></dt>
  5460. <dd><p>How much of original frequency content to keep when de-essing. Allowed range is from 0 to 1.
  5461. Default is 0.5.
  5462. </p>
  5463. </dd>
  5464. <dt><samp>s</samp></dt>
  5465. <dd><p>Set the output mode.
  5466. </p>
  5467. <p>It accepts the following values:
  5468. </p><dl compact="compact">
  5469. <dt><samp>i</samp></dt>
  5470. <dd><p>Pass input unchanged.
  5471. </p>
  5472. </dd>
  5473. <dt><samp>o</samp></dt>
  5474. <dd><p>Pass ess filtered out.
  5475. </p>
  5476. </dd>
  5477. <dt><samp>e</samp></dt>
  5478. <dd><p>Pass only ess.
  5479. </p>
  5480. <p>Default value is <var>o</var>.
  5481. </p></dd>
  5482. </dl>
  5483. </dd>
  5484. </dl>
  5485. <a name="drmeter"></a>
  5486. <h3 class="section">8.70 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>
  5487. <p>Measure audio dynamic range.
  5488. </p>
  5489. <p>DR values of 14 and higher is found in very dynamic material. DR of 8 to 13
  5490. is found in transition material. And anything less that 8 have very poor dynamics
  5491. and is very compressed.
  5492. </p>
  5493. <p>The filter accepts the following options:
  5494. </p>
  5495. <dl compact="compact">
  5496. <dt><samp>length</samp></dt>
  5497. <dd><p>Set window length in seconds used to split audio into segments of equal length.
  5498. Default is 3 seconds.
  5499. </p></dd>
  5500. </dl>
  5501. <a name="dynaudnorm"></a>
  5502. <h3 class="section">8.71 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>
  5503. <p>Dynamic Audio Normalizer.
  5504. </p>
  5505. <p>This filter applies a certain amount of gain to the input audio in order
  5506. to bring its peak magnitude to a target level (e.g. 0 dBFS). However, in
  5507. contrast to more &quot;simple&quot; normalization algorithms, the Dynamic Audio
  5508. Normalizer *dynamically* re-adjusts the gain factor to the input audio.
  5509. This allows for applying extra gain to the &quot;quiet&quot; sections of the audio
  5510. while avoiding distortions or clipping the &quot;loud&quot; sections. In other words:
  5511. The Dynamic Audio Normalizer will &quot;even out&quot; the volume of quiet and loud
  5512. sections, in the sense that the volume of each section is brought to the
  5513. same target level. Note, however, that the Dynamic Audio Normalizer achieves
  5514. this goal *without* applying &quot;dynamic range compressing&quot;. It will retain 100%
  5515. of the dynamic range *within* each section of the audio file.
  5516. </p>
  5517. <dl compact="compact">
  5518. <dt><samp>framelen, f</samp></dt>
  5519. <dd><p>Set the frame length in milliseconds. In range from 10 to 8000 milliseconds.
  5520. Default is 500 milliseconds.
  5521. The Dynamic Audio Normalizer processes the input audio in small chunks,
  5522. referred to as frames. This is required, because a peak magnitude has no
  5523. meaning for just a single sample value. Instead, we need to determine the
  5524. peak magnitude for a contiguous sequence of sample values. While a &quot;standard&quot;
  5525. normalizer would simply use the peak magnitude of the complete file, the
  5526. Dynamic Audio Normalizer determines the peak magnitude individually for each
  5527. frame. The length of a frame is specified in milliseconds. By default, the
  5528. Dynamic Audio Normalizer uses a frame length of 500 milliseconds, which has
  5529. been found to give good results with most files.
  5530. Note that the exact frame length, in number of samples, will be determined
  5531. automatically, based on the sampling rate of the individual input audio file.
  5532. </p>
  5533. </dd>
  5534. <dt><samp>gausssize, g</samp></dt>
  5535. <dd><p>Set the Gaussian filter window size. In range from 3 to 301, must be odd
  5536. number. Default is 31.
  5537. Probably the most important parameter of the Dynamic Audio Normalizer is the
  5538. <code>window size</code> of the Gaussian smoothing filter. The filter&rsquo;s window size
  5539. is specified in frames, centered around the current frame. For the sake of
  5540. simplicity, this must be an odd number. Consequently, the default value of 31
  5541. takes into account the current frame, as well as the 15 preceding frames and
  5542. the 15 subsequent frames. Using a larger window results in a stronger
  5543. smoothing effect and thus in less gain variation, i.e. slower gain
  5544. adaptation. Conversely, using a smaller window results in a weaker smoothing
  5545. effect and thus in more gain variation, i.e. faster gain adaptation.
  5546. In other words, the more you increase this value, the more the Dynamic Audio
  5547. Normalizer will behave like a &quot;traditional&quot; normalization filter. On the
  5548. contrary, the more you decrease this value, the more the Dynamic Audio
  5549. Normalizer will behave like a dynamic range compressor.
  5550. </p>
  5551. </dd>
  5552. <dt><samp>peak, p</samp></dt>
  5553. <dd><p>Set the target peak value. This specifies the highest permissible magnitude
  5554. level for the normalized audio input. This filter will try to approach the
  5555. target peak magnitude as closely as possible, but at the same time it also
  5556. makes sure that the normalized signal will never exceed the peak magnitude.
  5557. A frame&rsquo;s maximum local gain factor is imposed directly by the target peak
  5558. magnitude. The default value is 0.95 and thus leaves a headroom of 5%*.
  5559. It is not recommended to go above this value.
  5560. </p>
  5561. </dd>
  5562. <dt><samp>maxgain, m</samp></dt>
  5563. <dd><p>Set the maximum gain factor. In range from 1.0 to 100.0. Default is 10.0.
  5564. The Dynamic Audio Normalizer determines the maximum possible (local) gain
  5565. factor for each input frame, i.e. the maximum gain factor that does not
  5566. result in clipping or distortion. The maximum gain factor is determined by
  5567. the frame&rsquo;s highest magnitude sample. However, the Dynamic Audio Normalizer
  5568. additionally bounds the frame&rsquo;s maximum gain factor by a predetermined
  5569. (global) maximum gain factor. This is done in order to avoid excessive gain
  5570. factors in &quot;silent&quot; or almost silent frames. By default, the maximum gain
  5571. factor is 10.0, For most inputs the default value should be sufficient and
  5572. it usually is not recommended to increase this value. Though, for input
  5573. with an extremely low overall volume level, it may be necessary to allow even
  5574. higher gain factors. Note, however, that the Dynamic Audio Normalizer does
  5575. not simply apply a &quot;hard&quot; threshold (i.e. cut off values above the threshold).
  5576. Instead, a &quot;sigmoid&quot; threshold function will be applied. This way, the
  5577. gain factors will smoothly approach the threshold value, but never exceed that
  5578. value.
  5579. </p>
  5580. </dd>
  5581. <dt><samp>targetrms, r</samp></dt>
  5582. <dd><p>Set the target RMS. In range from 0.0 to 1.0. Default is 0.0 - disabled.
  5583. By default, the Dynamic Audio Normalizer performs &quot;peak&quot; normalization.
  5584. This means that the maximum local gain factor for each frame is defined
  5585. (only) by the frame&rsquo;s highest magnitude sample. This way, the samples can
  5586. be amplified as much as possible without exceeding the maximum signal
  5587. level, i.e. without clipping. Optionally, however, the Dynamic Audio
  5588. Normalizer can also take into account the frame&rsquo;s root mean square,
  5589. abbreviated RMS. In electrical engineering, the RMS is commonly used to
  5590. determine the power of a time-varying signal. It is therefore considered
  5591. that the RMS is a better approximation of the &quot;perceived loudness&quot; than
  5592. just looking at the signal&rsquo;s peak magnitude. Consequently, by adjusting all
  5593. frames to a constant RMS value, a uniform &quot;perceived loudness&quot; can be
  5594. established. If a target RMS value has been specified, a frame&rsquo;s local gain
  5595. factor is defined as the factor that would result in exactly that RMS value.
  5596. Note, however, that the maximum local gain factor is still restricted by the
  5597. frame&rsquo;s highest magnitude sample, in order to prevent clipping.
  5598. </p>
  5599. </dd>
  5600. <dt><samp>coupling, n</samp></dt>
  5601. <dd><p>Enable channels coupling. By default is enabled.
  5602. By default, the Dynamic Audio Normalizer will amplify all channels by the same
  5603. amount. This means the same gain factor will be applied to all channels, i.e.
  5604. the maximum possible gain factor is determined by the &quot;loudest&quot; channel.
  5605. However, in some recordings, it may happen that the volume of the different
  5606. channels is uneven, e.g. one channel may be &quot;quieter&quot; than the other one(s).
  5607. In this case, this option can be used to disable the channel coupling. This way,
  5608. the gain factor will be determined independently for each channel, depending
  5609. only on the individual channel&rsquo;s highest magnitude sample. This allows for
  5610. harmonizing the volume of the different channels.
  5611. </p>
  5612. </dd>
  5613. <dt><samp>correctdc, c</samp></dt>
  5614. <dd><p>Enable DC bias correction. By default is disabled.
  5615. An audio signal (in the time domain) is a sequence of sample values.
  5616. In the Dynamic Audio Normalizer these sample values are represented in the
  5617. -1.0 to 1.0 range, regardless of the original input format. Normally, the
  5618. audio signal, or &quot;waveform&quot;, should be centered around the zero point.
  5619. That means if we calculate the mean value of all samples in a file, or in a
  5620. single frame, then the result should be 0.0 or at least very close to that
  5621. value. If, however, there is a significant deviation of the mean value from
  5622. 0.0, in either positive or negative direction, this is referred to as a
  5623. DC bias or DC offset. Since a DC bias is clearly undesirable, the Dynamic
  5624. Audio Normalizer provides optional DC bias correction.
  5625. With DC bias correction enabled, the Dynamic Audio Normalizer will determine
  5626. the mean value, or &quot;DC correction&quot; offset, of each input frame and subtract
  5627. that value from all of the frame&rsquo;s sample values which ensures those samples
  5628. are centered around 0.0 again. Also, in order to avoid &quot;gaps&quot; at the frame
  5629. boundaries, the DC correction offset values will be interpolated smoothly
  5630. between neighbouring frames.
  5631. </p>
  5632. </dd>
  5633. <dt><samp>altboundary, b</samp></dt>
  5634. <dd><p>Enable alternative boundary mode. By default is disabled.
  5635. The Dynamic Audio Normalizer takes into account a certain neighbourhood
  5636. around each frame. This includes the preceding frames as well as the
  5637. subsequent frames. However, for the &quot;boundary&quot; frames, located at the very
  5638. beginning and at the very end of the audio file, not all neighbouring
  5639. frames are available. In particular, for the first few frames in the audio
  5640. file, the preceding frames are not known. And, similarly, for the last few
  5641. frames in the audio file, the subsequent frames are not known. Thus, the
  5642. question arises which gain factors should be assumed for the missing frames
  5643. in the &quot;boundary&quot; region. The Dynamic Audio Normalizer implements two modes
  5644. to deal with this situation. The default boundary mode assumes a gain factor
  5645. of exactly 1.0 for the missing frames, resulting in a smooth &quot;fade in&quot; and
  5646. &quot;fade out&quot; at the beginning and at the end of the input, respectively.
  5647. </p>
  5648. </dd>
  5649. <dt><samp>compress, s</samp></dt>
  5650. <dd><p>Set the compress factor. In range from 0.0 to 30.0. Default is 0.0.
  5651. By default, the Dynamic Audio Normalizer does not apply &quot;traditional&quot;
  5652. compression. This means that signal peaks will not be pruned and thus the
  5653. full dynamic range will be retained within each local neighbourhood. However,
  5654. in some cases it may be desirable to combine the Dynamic Audio Normalizer&rsquo;s
  5655. normalization algorithm with a more &quot;traditional&quot; compression.
  5656. For this purpose, the Dynamic Audio Normalizer provides an optional compression
  5657. (thresholding) function. If (and only if) the compression feature is enabled,
  5658. all input frames will be processed by a soft knee thresholding function prior
  5659. to the actual normalization process. Put simply, the thresholding function is
  5660. going to prune all samples whose magnitude exceeds a certain threshold value.
  5661. However, the Dynamic Audio Normalizer does not simply apply a fixed threshold
  5662. value. Instead, the threshold value will be adjusted for each individual
  5663. frame.
  5664. In general, smaller parameters result in stronger compression, and vice versa.
  5665. Values below 3.0 are not recommended, because audible distortion may appear.
  5666. </p>
  5667. </dd>
  5668. <dt><samp>threshold, t</samp></dt>
  5669. <dd><p>Set the target threshold value. This specifies the lowest permissible
  5670. magnitude level for the audio input which will be normalized.
  5671. If input frame volume is above this value frame will be normalized.
  5672. Otherwise frame may not be normalized at all. The default value is set
  5673. to 0, which means all input frames will be normalized.
  5674. This option is mostly useful if digital noise is not wanted to be amplified.
  5675. </p></dd>
  5676. </dl>
  5677. <a name="Commands-29"></a>
  5678. <h4 class="subsection">8.71.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>
  5679. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5680. </p>
  5681. <a name="earwax"></a>
  5682. <h3 class="section">8.72 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>
  5683. <p>Make audio easier to listen to on headphones.
  5684. </p>
  5685. <p>This filter adds &lsquo;cues&rsquo; to 44.1kHz stereo (i.e. audio CD format) audio
  5686. so that when listened to on headphones the stereo image is moved from
  5687. inside your head (standard for headphones) to outside and in front of
  5688. the listener (standard for speakers).
  5689. </p>
  5690. <p>Ported from SoX.
  5691. </p>
  5692. <a name="equalizer"></a>
  5693. <h3 class="section">8.73 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>
  5694. <p>Apply a two-pole peaking equalisation (EQ) filter. With this
  5695. filter, the signal-level at and around a selected frequency can
  5696. be increased or decreased, whilst (unlike bandpass and bandreject
  5697. filters) that at all other frequencies is unchanged.
  5698. </p>
  5699. <p>In order to produce complex equalisation curves, this filter can
  5700. be given several times, each with a different central frequency.
  5701. </p>
  5702. <p>The filter accepts the following options:
  5703. </p>
  5704. <dl compact="compact">
  5705. <dt><samp>frequency, f</samp></dt>
  5706. <dd><p>Set the filter&rsquo;s central frequency in Hz.
  5707. </p>
  5708. </dd>
  5709. <dt><samp>width_type, t</samp></dt>
  5710. <dd><p>Set method to specify band-width of filter.
  5711. </p><dl compact="compact">
  5712. <dt><samp>h</samp></dt>
  5713. <dd><p>Hz
  5714. </p></dd>
  5715. <dt><samp>q</samp></dt>
  5716. <dd><p>Q-Factor
  5717. </p></dd>
  5718. <dt><samp>o</samp></dt>
  5719. <dd><p>octave
  5720. </p></dd>
  5721. <dt><samp>s</samp></dt>
  5722. <dd><p>slope
  5723. </p></dd>
  5724. <dt><samp>k</samp></dt>
  5725. <dd><p>kHz
  5726. </p></dd>
  5727. </dl>
  5728. </dd>
  5729. <dt><samp>width, w</samp></dt>
  5730. <dd><p>Specify the band-width of a filter in width_type units.
  5731. </p>
  5732. </dd>
  5733. <dt><samp>gain, g</samp></dt>
  5734. <dd><p>Set the required gain or attenuation in dB.
  5735. Beware of clipping when using a positive gain.
  5736. </p>
  5737. </dd>
  5738. <dt><samp>mix, m</samp></dt>
  5739. <dd><p>How much to use filtered signal in output. Default is 1.
  5740. Range is between 0 and 1.
  5741. </p>
  5742. </dd>
  5743. <dt><samp>channels, c</samp></dt>
  5744. <dd><p>Specify which channels to filter, by default all available are filtered.
  5745. </p>
  5746. </dd>
  5747. <dt><samp>normalize, n</samp></dt>
  5748. <dd><p>Normalize biquad coefficients, by default is disabled.
  5749. Enabling it will normalize magnitude response at DC to 0dB.
  5750. </p>
  5751. </dd>
  5752. <dt><samp>transform, a</samp></dt>
  5753. <dd><p>Set transform type of IIR filter.
  5754. </p><dl compact="compact">
  5755. <dt><samp>di</samp></dt>
  5756. <dt><samp>dii</samp></dt>
  5757. <dt><samp>tdii</samp></dt>
  5758. <dt><samp>latt</samp></dt>
  5759. </dl>
  5760. </dd>
  5761. <dt><samp>precision, r</samp></dt>
  5762. <dd><p>Set precison of filtering.
  5763. </p><dl compact="compact">
  5764. <dt><samp>auto</samp></dt>
  5765. <dd><p>Pick automatic sample format depending on surround filters.
  5766. </p></dd>
  5767. <dt><samp>s16</samp></dt>
  5768. <dd><p>Always use signed 16-bit.
  5769. </p></dd>
  5770. <dt><samp>s32</samp></dt>
  5771. <dd><p>Always use signed 32-bit.
  5772. </p></dd>
  5773. <dt><samp>f32</samp></dt>
  5774. <dd><p>Always use float 32-bit.
  5775. </p></dd>
  5776. <dt><samp>f64</samp></dt>
  5777. <dd><p>Always use float 64-bit.
  5778. </p></dd>
  5779. </dl>
  5780. </dd>
  5781. </dl>
  5782. <a name="Examples-21"></a>
  5783. <h4 class="subsection">8.73.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>
  5784. <ul>
  5785. <li> Attenuate 10 dB at 1000 Hz, with a bandwidth of 200 Hz:
  5786. <div class="example">
  5787. <pre class="example">equalizer=f=1000:t=h:width=200:g=-10
  5788. </pre></div>
  5789. </li><li> Apply 2 dB gain at 1000 Hz with Q 1 and attenuate 5 dB at 100 Hz with Q 2:
  5790. <div class="example">
  5791. <pre class="example">equalizer=f=1000:t=q:w=1:g=2,equalizer=f=100:t=q:w=2:g=-5
  5792. </pre></div>
  5793. </li></ul>
  5794. <a name="Commands-30"></a>
  5795. <h4 class="subsection">8.73.2 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>
  5796. <p>This filter supports the following commands:
  5797. </p><dl compact="compact">
  5798. <dt><samp>frequency, f</samp></dt>
  5799. <dd><p>Change equalizer frequency.
  5800. Syntax for the command is : &quot;<var>frequency</var>&quot;
  5801. </p>
  5802. </dd>
  5803. <dt><samp>width_type, t</samp></dt>
  5804. <dd><p>Change equalizer width_type.
  5805. Syntax for the command is : &quot;<var>width_type</var>&quot;
  5806. </p>
  5807. </dd>
  5808. <dt><samp>width, w</samp></dt>
  5809. <dd><p>Change equalizer width.
  5810. Syntax for the command is : &quot;<var>width</var>&quot;
  5811. </p>
  5812. </dd>
  5813. <dt><samp>gain, g</samp></dt>
  5814. <dd><p>Change equalizer gain.
  5815. Syntax for the command is : &quot;<var>gain</var>&quot;
  5816. </p>
  5817. </dd>
  5818. <dt><samp>mix, m</samp></dt>
  5819. <dd><p>Change equalizer mix.
  5820. Syntax for the command is : &quot;<var>mix</var>&quot;
  5821. </p></dd>
  5822. </dl>
  5823. <a name="extrastereo"></a>
  5824. <h3 class="section">8.74 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>
  5825. <p>Linearly increases the difference between left and right channels which
  5826. adds some sort of &quot;live&quot; effect to playback.
  5827. </p>
  5828. <p>The filter accepts the following options:
  5829. </p>
  5830. <dl compact="compact">
  5831. <dt><samp>m</samp></dt>
  5832. <dd><p>Sets the difference coefficient (default: 2.5). 0.0 means mono sound
  5833. (average of both channels), with 1.0 sound will be unchanged, with
  5834. -1.0 left and right channels will be swapped.
  5835. </p>
  5836. </dd>
  5837. <dt><samp>c</samp></dt>
  5838. <dd><p>Enable clipping. By default is enabled.
  5839. </p></dd>
  5840. </dl>
  5841. <a name="Commands-31"></a>
  5842. <h4 class="subsection">8.74.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>
  5843. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  5844. </p>
  5845. <a name="firequalizer"></a>
  5846. <h3 class="section">8.75 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>
  5847. <p>Apply FIR Equalization using arbitrary frequency response.
  5848. </p>
  5849. <p>The filter accepts the following option:
  5850. </p>
  5851. <dl compact="compact">
  5852. <dt><samp>gain</samp></dt>
  5853. <dd><p>Set gain curve equation (in dB). The expression can contain variables:
  5854. </p><dl compact="compact">
  5855. <dt><samp>f</samp></dt>
  5856. <dd><p>the evaluated frequency
  5857. </p></dd>
  5858. <dt><samp>sr</samp></dt>
  5859. <dd><p>sample rate
  5860. </p></dd>
  5861. <dt><samp>ch</samp></dt>
  5862. <dd><p>channel number, set to 0 when multichannels evaluation is disabled
  5863. </p></dd>
  5864. <dt><samp>chid</samp></dt>
  5865. <dd><p>channel id, see libavutil/channel_layout.h, set to the first channel id when
  5866. multichannels evaluation is disabled
  5867. </p></dd>
  5868. <dt><samp>chs</samp></dt>
  5869. <dd><p>number of channels
  5870. </p></dd>
  5871. <dt><samp>chlayout</samp></dt>
  5872. <dd><p>channel_layout, see libavutil/channel_layout.h
  5873. </p>
  5874. </dd>
  5875. </dl>
  5876. <p>and functions:
  5877. </p><dl compact="compact">
  5878. <dt><samp>gain_interpolate(f)</samp></dt>
  5879. <dd><p>interpolate gain on frequency f based on gain_entry
  5880. </p></dd>
  5881. <dt><samp>cubic_interpolate(f)</samp></dt>
  5882. <dd><p>same as gain_interpolate, but smoother
  5883. </p></dd>
  5884. </dl>
  5885. <p>This option is also available as command. Default is <code>gain_interpolate(f)</code>.
  5886. </p>
  5887. </dd>
  5888. <dt><samp>gain_entry</samp></dt>
  5889. <dd><p>Set gain entry for gain_interpolate function. The expression can
  5890. contain functions:
  5891. </p><dl compact="compact">
  5892. <dt><samp>entry(f, g)</samp></dt>
  5893. <dd><p>store gain entry at frequency f with value g
  5894. </p></dd>
  5895. </dl>
  5896. <p>This option is also available as command.
  5897. </p>
  5898. </dd>
  5899. <dt><samp>delay</samp></dt>
  5900. <dd><p>Set filter delay in seconds. Higher value means more accurate.
  5901. Default is <code>0.01</code>.
  5902. </p>
  5903. </dd>
  5904. <dt><samp>accuracy</samp></dt>
  5905. <dd><p>Set filter accuracy in Hz. Lower value means more accurate.
  5906. Default is <code>5</code>.
  5907. </p>
  5908. </dd>
  5909. <dt><samp>wfunc</samp></dt>
  5910. <dd><p>Set window function. Acceptable values are:
  5911. </p><dl compact="compact">
  5912. <dt><samp>rectangular</samp></dt>
  5913. <dd><p>rectangular window, useful when gain curve is already smooth
  5914. </p></dd>
  5915. <dt><samp>hann</samp></dt>
  5916. <dd><p>hann window (default)
  5917. </p></dd>
  5918. <dt><samp>hamming</samp></dt>
  5919. <dd><p>hamming window
  5920. </p></dd>
  5921. <dt><samp>blackman</samp></dt>
  5922. <dd><p>blackman window
  5923. </p></dd>
  5924. <dt><samp>nuttall3</samp></dt>
  5925. <dd><p>3-terms continuous 1st derivative nuttall window
  5926. </p></dd>
  5927. <dt><samp>mnuttall3</samp></dt>
  5928. <dd><p>minimum 3-terms discontinuous nuttall window
  5929. </p></dd>
  5930. <dt><samp>nuttall</samp></dt>
  5931. <dd><p>4-terms continuous 1st derivative nuttall window
  5932. </p></dd>
  5933. <dt><samp>bnuttall</samp></dt>
  5934. <dd><p>minimum 4-terms discontinuous nuttall (blackman-nuttall) window
  5935. </p></dd>
  5936. <dt><samp>bharris</samp></dt>
  5937. <dd><p>blackman-harris window
  5938. </p></dd>
  5939. <dt><samp>tukey</samp></dt>
  5940. <dd><p>tukey window
  5941. </p></dd>
  5942. </dl>
  5943. </dd>
  5944. <dt><samp>fixed</samp></dt>
  5945. <dd><p>If enabled, use fixed number of audio samples. This improves speed when
  5946. filtering with large delay. Default is disabled.
  5947. </p>
  5948. </dd>
  5949. <dt><samp>multi</samp></dt>
  5950. <dd><p>Enable multichannels evaluation on gain. Default is disabled.
  5951. </p>
  5952. </dd>
  5953. <dt><samp>zero_phase</samp></dt>
  5954. <dd><p>Enable zero phase mode by subtracting timestamp to compensate delay.
  5955. Default is disabled.
  5956. </p>
  5957. </dd>
  5958. <dt><samp>scale</samp></dt>
  5959. <dd><p>Set scale used by gain. Acceptable values are:
  5960. </p><dl compact="compact">
  5961. <dt><samp>linlin</samp></dt>
  5962. <dd><p>linear frequency, linear gain
  5963. </p></dd>
  5964. <dt><samp>linlog</samp></dt>
  5965. <dd><p>linear frequency, logarithmic (in dB) gain (default)
  5966. </p></dd>
  5967. <dt><samp>loglin</samp></dt>
  5968. <dd><p>logarithmic (in octave scale where 20 Hz is 0) frequency, linear gain
  5969. </p></dd>
  5970. <dt><samp>loglog</samp></dt>
  5971. <dd><p>logarithmic frequency, logarithmic gain
  5972. </p></dd>
  5973. </dl>
  5974. </dd>
  5975. <dt><samp>dumpfile</samp></dt>
  5976. <dd><p>Set file for dumping, suitable for gnuplot.
  5977. </p>
  5978. </dd>
  5979. <dt><samp>dumpscale</samp></dt>
  5980. <dd><p>Set scale for dumpfile. Acceptable values are same with scale option.
  5981. Default is linlog.
  5982. </p>
  5983. </dd>
  5984. <dt><samp>fft2</samp></dt>
  5985. <dd><p>Enable 2-channel convolution using complex FFT. This improves speed significantly.
  5986. Default is disabled.
  5987. </p>
  5988. </dd>
  5989. <dt><samp>min_phase</samp></dt>
  5990. <dd><p>Enable minimum phase impulse response. Default is disabled.
  5991. </p></dd>
  5992. </dl>
  5993. <a name="Examples-22"></a>
  5994. <h4 class="subsection">8.75.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>
  5995. <ul>
  5996. <li> lowpass at 1000 Hz:
  5997. <div class="example">
  5998. <pre class="example">firequalizer=gain='if(lt(f,1000), 0, -INF)'
  5999. </pre></div>
  6000. </li><li> lowpass at 1000 Hz with gain_entry:
  6001. <div class="example">
  6002. <pre class="example">firequalizer=gain_entry='entry(1000,0); entry(1001, -INF)'
  6003. </pre></div>
  6004. </li><li> custom equalization:
  6005. <div class="example">
  6006. <pre class="example">firequalizer=gain_entry='entry(100,0); entry(400, -4); entry(1000, -6); entry(2000, 0)'
  6007. </pre></div>
  6008. </li><li> higher delay with zero phase to compensate delay:
  6009. <div class="example">
  6010. <pre class="example">firequalizer=delay=0.1:fixed=on:zero_phase=on
  6011. </pre></div>
  6012. </li><li> lowpass on left channel, highpass on right channel:
  6013. <div class="example">
  6014. <pre class="example">firequalizer=gain='if(eq(chid,1), gain_interpolate(f), if(eq(chid,2), gain_interpolate(1e6+f), 0))'
  6015. :gain_entry='entry(1000, 0); entry(1001,-INF); entry(1e6+1000,0)':multi=on
  6016. </pre></div>
  6017. </li></ul>
  6018. <a name="flanger"></a>
  6019. <h3 class="section">8.76 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>
  6020. <p>Apply a flanging effect to the audio.
  6021. </p>
  6022. <p>The filter accepts the following options:
  6023. </p>
  6024. <dl compact="compact">
  6025. <dt><samp>delay</samp></dt>
  6026. <dd><p>Set base delay in milliseconds. Range from 0 to 30. Default value is 0.
  6027. </p>
  6028. </dd>
  6029. <dt><samp>depth</samp></dt>
  6030. <dd><p>Set added sweep delay in milliseconds. Range from 0 to 10. Default value is 2.
  6031. </p>
  6032. </dd>
  6033. <dt><samp>regen</samp></dt>
  6034. <dd><p>Set percentage regeneration (delayed signal feedback). Range from -95 to 95.
  6035. Default value is 0.
  6036. </p>
  6037. </dd>
  6038. <dt><samp>width</samp></dt>
  6039. <dd><p>Set percentage of delayed signal mixed with original. Range from 0 to 100.
  6040. Default value is 71.
  6041. </p>
  6042. </dd>
  6043. <dt><samp>speed</samp></dt>
  6044. <dd><p>Set sweeps per second (Hz). Range from 0.1 to 10. Default value is 0.5.
  6045. </p>
  6046. </dd>
  6047. <dt><samp>shape</samp></dt>
  6048. <dd><p>Set swept wave shape, can be <var>triangular</var> or <var>sinusoidal</var>.
  6049. Default value is <var>sinusoidal</var>.
  6050. </p>
  6051. </dd>
  6052. <dt><samp>phase</samp></dt>
  6053. <dd><p>Set swept wave percentage-shift for multi channel. Range from 0 to 100.
  6054. Default value is 25.
  6055. </p>
  6056. </dd>
  6057. <dt><samp>interp</samp></dt>
  6058. <dd><p>Set delay-line interpolation, <var>linear</var> or <var>quadratic</var>.
  6059. Default is <var>linear</var>.
  6060. </p></dd>
  6061. </dl>
  6062. <a name="haas"></a>
  6063. <h3 class="section">8.77 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>
  6064. <p>Apply Haas effect to audio.
  6065. </p>
  6066. <p>Note that this makes most sense to apply on mono signals.
  6067. With this filter applied to mono signals it give some directionality and
  6068. stretches its stereo image.
  6069. </p>
  6070. <p>The filter accepts the following options:
  6071. </p>
  6072. <dl compact="compact">
  6073. <dt><samp>level_in</samp></dt>
  6074. <dd><p>Set input level. By default is <var>1</var>, or 0dB
  6075. </p>
  6076. </dd>
  6077. <dt><samp>level_out</samp></dt>
  6078. <dd><p>Set output level. By default is <var>1</var>, or 0dB.
  6079. </p>
  6080. </dd>
  6081. <dt><samp>side_gain</samp></dt>
  6082. <dd><p>Set gain applied to side part of signal. By default is <var>1</var>.
  6083. </p>
  6084. </dd>
  6085. <dt><samp>middle_source</samp></dt>
  6086. <dd><p>Set kind of middle source. Can be one of the following:
  6087. </p>
  6088. <dl compact="compact">
  6089. <dt>&lsquo;<samp>left</samp>&rsquo;</dt>
  6090. <dd><p>Pick left channel.
  6091. </p>
  6092. </dd>
  6093. <dt>&lsquo;<samp>right</samp>&rsquo;</dt>
  6094. <dd><p>Pick right channel.
  6095. </p>
  6096. </dd>
  6097. <dt>&lsquo;<samp>mid</samp>&rsquo;</dt>
  6098. <dd><p>Pick middle part signal of stereo image.
  6099. </p>
  6100. </dd>
  6101. <dt>&lsquo;<samp>side</samp>&rsquo;</dt>
  6102. <dd><p>Pick side part signal of stereo image.
  6103. </p></dd>
  6104. </dl>
  6105. </dd>
  6106. <dt><samp>middle_phase</samp></dt>
  6107. <dd><p>Change middle phase. By default is disabled.
  6108. </p>
  6109. </dd>
  6110. <dt><samp>left_delay</samp></dt>
  6111. <dd><p>Set left channel delay. By default is <var>2.05</var> milliseconds.
  6112. </p>
  6113. </dd>
  6114. <dt><samp>left_balance</samp></dt>
  6115. <dd><p>Set left channel balance. By default is <var>-1</var>.
  6116. </p>
  6117. </dd>
  6118. <dt><samp>left_gain</samp></dt>
  6119. <dd><p>Set left channel gain. By default is <var>1</var>.
  6120. </p>
  6121. </dd>
  6122. <dt><samp>left_phase</samp></dt>
  6123. <dd><p>Change left phase. By default is disabled.
  6124. </p>
  6125. </dd>
  6126. <dt><samp>right_delay</samp></dt>
  6127. <dd><p>Set right channel delay. By defaults is <var>2.12</var> milliseconds.
  6128. </p>
  6129. </dd>
  6130. <dt><samp>right_balance</samp></dt>
  6131. <dd><p>Set right channel balance. By default is <var>1</var>.
  6132. </p>
  6133. </dd>
  6134. <dt><samp>right_gain</samp></dt>
  6135. <dd><p>Set right channel gain. By default is <var>1</var>.
  6136. </p>
  6137. </dd>
  6138. <dt><samp>right_phase</samp></dt>
  6139. <dd><p>Change right phase. By default is enabled.
  6140. </p></dd>
  6141. </dl>
  6142. <a name="hdcd"></a>
  6143. <h3 class="section">8.78 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>
  6144. <p>Decodes High Definition Compatible Digital (HDCD) data. A 16-bit PCM stream with
  6145. embedded HDCD codes is expanded into a 20-bit PCM stream.
  6146. </p>
  6147. <p>The filter supports the Peak Extend and Low-level Gain Adjustment features
  6148. of HDCD, and detects the Transient Filter flag.
  6149. </p>
  6150. <div class="example">
  6151. <pre class="example">ffmpeg -i HDCD16.flac -af hdcd OUT24.flac
  6152. </pre></div>
  6153. <p>When using the filter with wav, note the default encoding for wav is 16-bit,
  6154. so the resulting 20-bit stream will be truncated back to 16-bit. Use something
  6155. like <code>-acodec pcm_s24le</code> after the filter to get 24-bit PCM output.
  6156. </p><div class="example">
  6157. <pre class="example">ffmpeg -i HDCD16.wav -af hdcd OUT16.wav
  6158. ffmpeg -i HDCD16.wav -af hdcd -c:a pcm_s24le OUT24.wav
  6159. </pre></div>
  6160. <p>The filter accepts the following options:
  6161. </p>
  6162. <dl compact="compact">
  6163. <dt><samp>disable_autoconvert</samp></dt>
  6164. <dd><p>Disable any automatic format conversion or resampling in the filter graph.
  6165. </p>
  6166. </dd>
  6167. <dt><samp>process_stereo</samp></dt>
  6168. <dd><p>Process the stereo channels together. If target_gain does not match between
  6169. channels, consider it invalid and use the last valid target_gain.
  6170. </p>
  6171. </dd>
  6172. <dt><samp>cdt_ms</samp></dt>
  6173. <dd><p>Set the code detect timer period in ms.
  6174. </p>
  6175. </dd>
  6176. <dt><samp>force_pe</samp></dt>
  6177. <dd><p>Always extend peaks above -3dBFS even if PE isn&rsquo;t signaled.
  6178. </p>
  6179. </dd>
  6180. <dt><samp>analyze_mode</samp></dt>
  6181. <dd><p>Replace audio with a solid tone and adjust the amplitude to signal some
  6182. specific aspect of the decoding process. The output file can be loaded in
  6183. an audio editor alongside the original to aid analysis.
  6184. </p>
  6185. <p><code>analyze_mode=pe:force_pe=true</code> can be used to see all samples above the PE level.
  6186. </p>
  6187. <p>Modes are:
  6188. </p><dl compact="compact">
  6189. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  6190. <dd><p>Disabled
  6191. </p></dd>
  6192. <dt>&lsquo;<samp>1, lle</samp>&rsquo;</dt>
  6193. <dd><p>Gain adjustment level at each sample
  6194. </p></dd>
  6195. <dt>&lsquo;<samp>2, pe</samp>&rsquo;</dt>
  6196. <dd><p>Samples where peak extend occurs
  6197. </p></dd>
  6198. <dt>&lsquo;<samp>3, cdt</samp>&rsquo;</dt>
  6199. <dd><p>Samples where the code detect timer is active
  6200. </p></dd>
  6201. <dt>&lsquo;<samp>4, tgm</samp>&rsquo;</dt>
  6202. <dd><p>Samples where the target gain does not match between channels
  6203. </p></dd>
  6204. </dl>
  6205. </dd>
  6206. </dl>
  6207. <a name="headphone"></a>
  6208. <h3 class="section">8.79 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>
  6209. <p>Apply head-related transfer functions (HRTFs) to create virtual
  6210. loudspeakers around the user for binaural listening via headphones.
  6211. The HRIRs are provided via additional streams, for each channel
  6212. one stereo input stream is needed.
  6213. </p>
  6214. <p>The filter accepts the following options:
  6215. </p>
  6216. <dl compact="compact">
  6217. <dt><samp>map</samp></dt>
  6218. <dd><p>Set mapping of input streams for convolution.
  6219. The argument is a &rsquo;|&rsquo;-separated list of channel names in order as they
  6220. are given as additional stream inputs for filter.
  6221. This also specify number of input streams. Number of input streams
  6222. must be not less than number of channels in first stream plus one.
  6223. </p>
  6224. </dd>
  6225. <dt><samp>gain</samp></dt>
  6226. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  6227. </p>
  6228. </dd>
  6229. <dt><samp>type</samp></dt>
  6230. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  6231. processing audio in time domain which is slow.
  6232. <var>freq</var> is processing audio in frequency domain which is fast.
  6233. Default is <var>freq</var>.
  6234. </p>
  6235. </dd>
  6236. <dt><samp>lfe</samp></dt>
  6237. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  6238. </p>
  6239. </dd>
  6240. <dt><samp>size</samp></dt>
  6241. <dd><p>Set size of frame in number of samples which will be processed at once.
  6242. Default value is <var>1024</var>. Allowed range is from 1024 to 96000.
  6243. </p>
  6244. </dd>
  6245. <dt><samp>hrir</samp></dt>
  6246. <dd><p>Set format of hrir stream.
  6247. Default value is <var>stereo</var>. Alternative value is <var>multich</var>.
  6248. If value is set to <var>stereo</var>, number of additional streams should
  6249. be greater or equal to number of input channels in first input stream.
  6250. Also each additional stream should have stereo number of channels.
  6251. If value is set to <var>multich</var>, number of additional streams should
  6252. be exactly one. Also number of input channels of additional stream
  6253. should be equal or greater than twice number of channels of first input
  6254. stream.
  6255. </p></dd>
  6256. </dl>
  6257. <a name="Examples-23"></a>
  6258. <h4 class="subsection">8.79.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>
  6259. <ul>
  6260. <li> Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  6261. each amovie filter use stereo file with IR coefficients as input.
  6262. The files give coefficients for each position of virtual loudspeaker:
  6263. <div class="example">
  6264. <pre class="example">ffmpeg -i input.wav
  6265. -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;
  6266. output.wav
  6267. </pre></div>
  6268. </li><li> Full example using wav files as coefficients with amovie filters for 7.1 downmix,
  6269. but now in <var>multich</var> <var>hrir</var> format.
  6270. <div class="example">
  6271. <pre class="example">ffmpeg -i input.wav -filter_complex &quot;amovie=minp.wav[hrirs];[0:a][hrirs]headphone=map=FL|FR|FC|LFE|BL|BR|SL|SR:hrir=multich&quot;
  6272. output.wav
  6273. </pre></div>
  6274. </li></ul>
  6275. <a name="highpass"></a>
  6276. <h3 class="section">8.80 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>
  6277. <p>Apply a high-pass filter with 3dB point frequency.
  6278. The filter can be either single-pole, or double-pole (the default).
  6279. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  6280. </p>
  6281. <p>The filter accepts the following options:
  6282. </p>
  6283. <dl compact="compact">
  6284. <dt><samp>frequency, f</samp></dt>
  6285. <dd><p>Set frequency in Hz. Default is 3000.
  6286. </p>
  6287. </dd>
  6288. <dt><samp>poles, p</samp></dt>
  6289. <dd><p>Set number of poles. Default is 2.
  6290. </p>
  6291. </dd>
  6292. <dt><samp>width_type, t</samp></dt>
  6293. <dd><p>Set method to specify band-width of filter.
  6294. </p><dl compact="compact">
  6295. <dt><samp>h</samp></dt>
  6296. <dd><p>Hz
  6297. </p></dd>
  6298. <dt><samp>q</samp></dt>
  6299. <dd><p>Q-Factor
  6300. </p></dd>
  6301. <dt><samp>o</samp></dt>
  6302. <dd><p>octave
  6303. </p></dd>
  6304. <dt><samp>s</samp></dt>
  6305. <dd><p>slope
  6306. </p></dd>
  6307. <dt><samp>k</samp></dt>
  6308. <dd><p>kHz
  6309. </p></dd>
  6310. </dl>
  6311. </dd>
  6312. <dt><samp>width, w</samp></dt>
  6313. <dd><p>Specify the band-width of a filter in width_type units.
  6314. Applies only to double-pole filter.
  6315. The default is 0.707q and gives a Butterworth response.
  6316. </p>
  6317. </dd>
  6318. <dt><samp>mix, m</samp></dt>
  6319. <dd><p>How much to use filtered signal in output. Default is 1.
  6320. Range is between 0 and 1.
  6321. </p>
  6322. </dd>
  6323. <dt><samp>channels, c</samp></dt>
  6324. <dd><p>Specify which channels to filter, by default all available are filtered.
  6325. </p>
  6326. </dd>
  6327. <dt><samp>normalize, n</samp></dt>
  6328. <dd><p>Normalize biquad coefficients, by default is disabled.
  6329. Enabling it will normalize magnitude response at DC to 0dB.
  6330. </p>
  6331. </dd>
  6332. <dt><samp>transform, a</samp></dt>
  6333. <dd><p>Set transform type of IIR filter.
  6334. </p><dl compact="compact">
  6335. <dt><samp>di</samp></dt>
  6336. <dt><samp>dii</samp></dt>
  6337. <dt><samp>tdii</samp></dt>
  6338. <dt><samp>latt</samp></dt>
  6339. </dl>
  6340. </dd>
  6341. <dt><samp>precision, r</samp></dt>
  6342. <dd><p>Set precison of filtering.
  6343. </p><dl compact="compact">
  6344. <dt><samp>auto</samp></dt>
  6345. <dd><p>Pick automatic sample format depending on surround filters.
  6346. </p></dd>
  6347. <dt><samp>s16</samp></dt>
  6348. <dd><p>Always use signed 16-bit.
  6349. </p></dd>
  6350. <dt><samp>s32</samp></dt>
  6351. <dd><p>Always use signed 32-bit.
  6352. </p></dd>
  6353. <dt><samp>f32</samp></dt>
  6354. <dd><p>Always use float 32-bit.
  6355. </p></dd>
  6356. <dt><samp>f64</samp></dt>
  6357. <dd><p>Always use float 64-bit.
  6358. </p></dd>
  6359. </dl>
  6360. </dd>
  6361. </dl>
  6362. <a name="Commands-32"></a>
  6363. <h4 class="subsection">8.80.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>
  6364. <p>This filter supports the following commands:
  6365. </p><dl compact="compact">
  6366. <dt><samp>frequency, f</samp></dt>
  6367. <dd><p>Change highpass frequency.
  6368. Syntax for the command is : &quot;<var>frequency</var>&quot;
  6369. </p>
  6370. </dd>
  6371. <dt><samp>width_type, t</samp></dt>
  6372. <dd><p>Change highpass width_type.
  6373. Syntax for the command is : &quot;<var>width_type</var>&quot;
  6374. </p>
  6375. </dd>
  6376. <dt><samp>width, w</samp></dt>
  6377. <dd><p>Change highpass width.
  6378. Syntax for the command is : &quot;<var>width</var>&quot;
  6379. </p>
  6380. </dd>
  6381. <dt><samp>mix, m</samp></dt>
  6382. <dd><p>Change highpass mix.
  6383. Syntax for the command is : &quot;<var>mix</var>&quot;
  6384. </p></dd>
  6385. </dl>
  6386. <a name="join"></a>
  6387. <h3 class="section">8.81 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>
  6388. <p>Join multiple input streams into one multi-channel stream.
  6389. </p>
  6390. <p>It accepts the following parameters:
  6391. </p><dl compact="compact">
  6392. <dt><samp>inputs</samp></dt>
  6393. <dd><p>The number of input streams. It defaults to 2.
  6394. </p>
  6395. </dd>
  6396. <dt><samp>channel_layout</samp></dt>
  6397. <dd><p>The desired output channel layout. It defaults to stereo.
  6398. </p>
  6399. </dd>
  6400. <dt><samp>map</samp></dt>
  6401. <dd><p>Map channels from inputs to output. The argument is a &rsquo;|&rsquo;-separated list of
  6402. mappings, each in the <code><var>input_idx</var>.<var>in_channel</var>-<var>out_channel</var></code>
  6403. form. <var>input_idx</var> is the 0-based index of the input stream. <var>in_channel</var>
  6404. can be either the name of the input channel (e.g. FL for front left) or its
  6405. index in the specified input stream. <var>out_channel</var> is the name of the output
  6406. channel.
  6407. </p></dd>
  6408. </dl>
  6409. <p>The filter will attempt to guess the mappings when they are not specified
  6410. explicitly. It does so by first trying to find an unused matching input channel
  6411. and if that fails it picks the first unused input channel.
  6412. </p>
  6413. <p>Join 3 inputs (with properly set channel layouts):
  6414. </p><div class="example">
  6415. <pre class="example">ffmpeg -i INPUT1 -i INPUT2 -i INPUT3 -filter_complex join=inputs=3 OUTPUT
  6416. </pre></div>
  6417. <p>Build a 5.1 output from 6 single-channel streams:
  6418. </p><div class="example">
  6419. <pre class="example">ffmpeg -i fl -i fr -i fc -i sl -i sr -i lfe -filter_complex
  6420. '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'
  6421. out
  6422. </pre></div>
  6423. <a name="ladspa"></a>
  6424. <h3 class="section">8.82 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>
  6425. <p>Load a LADSPA (Linux Audio Developer&rsquo;s Simple Plugin API) plugin.
  6426. </p>
  6427. <p>To enable compilation of this filter you need to configure FFmpeg with
  6428. <code>--enable-ladspa</code>.
  6429. </p>
  6430. <dl compact="compact">
  6431. <dt><samp>file, f</samp></dt>
  6432. <dd><p>Specifies the name of LADSPA plugin library to load. If the environment
  6433. variable <code>LADSPA_PATH</code> is defined, the LADSPA plugin is searched in
  6434. each one of the directories specified by the colon separated list in
  6435. <code>LADSPA_PATH</code>, otherwise in the standard LADSPA paths, which are in
  6436. this order: <samp>HOME/.ladspa/lib/</samp>, <samp>/usr/local/lib/ladspa/</samp>,
  6437. <samp>/usr/lib/ladspa/</samp>.
  6438. </p>
  6439. </dd>
  6440. <dt><samp>plugin, p</samp></dt>
  6441. <dd><p>Specifies the plugin within the library. Some libraries contain only
  6442. one plugin, but others contain many of them. If this is not set filter
  6443. will list all available plugins within the specified library.
  6444. </p>
  6445. </dd>
  6446. <dt><samp>controls, c</samp></dt>
  6447. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  6448. values that determine the behavior of the loaded plugin (for example delay,
  6449. threshold or gain).
  6450. Controls need to be defined using the following syntax:
  6451. c0=<var>value0</var>|c1=<var>value1</var>|c2=<var>value2</var>|..., where
  6452. <var>valuei</var> is the value set on the <var>i</var>-th control.
  6453. Alternatively they can be also defined using the following syntax:
  6454. <var>value0</var>|<var>value1</var>|<var>value2</var>|..., where
  6455. <var>valuei</var> is the value set on the <var>i</var>-th control.
  6456. If <samp>controls</samp> is set to <code>help</code>, all available controls and
  6457. their valid ranges are printed.
  6458. </p>
  6459. </dd>
  6460. <dt><samp>sample_rate, s</samp></dt>
  6461. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  6462. zero inputs.
  6463. </p>
  6464. </dd>
  6465. <dt><samp>nb_samples, n</samp></dt>
  6466. <dd><p>Set the number of samples per channel per each output frame, default
  6467. is 1024. Only used if plugin have zero inputs.
  6468. </p>
  6469. </dd>
  6470. <dt><samp>duration, d</samp></dt>
  6471. <dd><p>Set the minimum duration of the sourced audio. See
  6472. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  6473. for the accepted syntax.
  6474. Note that the resulting duration may be greater than the specified duration,
  6475. as the generated audio is always cut at the end of a complete frame.
  6476. If not specified, or the expressed duration is negative, the audio is
  6477. supposed to be generated forever.
  6478. Only used if plugin have zero inputs.
  6479. </p>
  6480. </dd>
  6481. <dt><samp>latency, l</samp></dt>
  6482. <dd><p>Enable latency compensation, by default is disabled.
  6483. Only used if plugin have inputs.
  6484. </p></dd>
  6485. </dl>
  6486. <a name="Examples-24"></a>
  6487. <h4 class="subsection">8.82.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>
  6488. <ul>
  6489. <li> List all available plugins within amp (LADSPA example plugin) library:
  6490. <div class="example">
  6491. <pre class="example">ladspa=file=amp
  6492. </pre></div>
  6493. </li><li> List all available controls and their valid ranges for <code>vcf_notch</code>
  6494. plugin from <code>VCF</code> library:
  6495. <div class="example">
  6496. <pre class="example">ladspa=f=vcf:p=vcf_notch:c=help
  6497. </pre></div>
  6498. </li><li> Simulate low quality audio equipment using <code>Computer Music Toolkit</code> (CMT)
  6499. plugin library:
  6500. <div class="example">
  6501. <pre class="example">ladspa=file=cmt:plugin=lofi:controls=c0=22|c1=12|c2=12
  6502. </pre></div>
  6503. </li><li> Add reverberation to the audio using TAP-plugins
  6504. (Tom&rsquo;s Audio Processing plugins):
  6505. <div class="example">
  6506. <pre class="example">ladspa=file=tap_reverb:tap_reverb
  6507. </pre></div>
  6508. </li><li> Generate white noise, with 0.2 amplitude:
  6509. <div class="example">
  6510. <pre class="example">ladspa=file=cmt:noise_source_white:c=c0=.2
  6511. </pre></div>
  6512. </li><li> Generate 20 bpm clicks using plugin <code>C* Click - Metronome</code> from the
  6513. <code>C* Audio Plugin Suite</code> (CAPS) library:
  6514. <div class="example">
  6515. <pre class="example">ladspa=file=caps:Click:c=c1=20'
  6516. </pre></div>
  6517. </li><li> Apply <code>C* Eq10X2 - Stereo 10-band equaliser</code> effect:
  6518. <div class="example">
  6519. <pre class="example">ladspa=caps:Eq10X2:c=c0=-48|c9=-24|c3=12|c4=2
  6520. </pre></div>
  6521. </li><li> Increase volume by 20dB using fast lookahead limiter from Steve Harris
  6522. <code>SWH Plugins</code> collection:
  6523. <div class="example">
  6524. <pre class="example">ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:20|0|2
  6525. </pre></div>
  6526. </li><li> Attenuate low frequencies using Multiband EQ from Steve Harris
  6527. <code>SWH Plugins</code> collection:
  6528. <div class="example">
  6529. <pre class="example">ladspa=mbeq_1197:mbeq:-24|-24|-24|0|0|0|0|0|0|0|0|0|0|0|0
  6530. </pre></div>
  6531. </li><li> Reduce stereo image using <code>Narrower</code> from the <code>C* Audio Plugin Suite</code>
  6532. (CAPS) library:
  6533. <div class="example">
  6534. <pre class="example">ladspa=caps:Narrower
  6535. </pre></div>
  6536. </li><li> Another white noise, now using <code>C* Audio Plugin Suite</code> (CAPS) library:
  6537. <div class="example">
  6538. <pre class="example">ladspa=caps:White:.2
  6539. </pre></div>
  6540. </li><li> Some fractal noise, using <code>C* Audio Plugin Suite</code> (CAPS) library:
  6541. <div class="example">
  6542. <pre class="example">ladspa=caps:Fractal:c=c1=1
  6543. </pre></div>
  6544. </li><li> Dynamic volume normalization using <code>VLevel</code> plugin:
  6545. <div class="example">
  6546. <pre class="example">ladspa=vlevel-ladspa:vlevel_mono
  6547. </pre></div>
  6548. </li></ul>
  6549. <a name="Commands-33"></a>
  6550. <h4 class="subsection">8.82.2 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>
  6551. <p>This filter supports the following commands:
  6552. </p><dl compact="compact">
  6553. <dt><samp>cN</samp></dt>
  6554. <dd><p>Modify the <var>N</var>-th control value.
  6555. </p>
  6556. <p>If the specified value is not valid, it is ignored and prior one is kept.
  6557. </p></dd>
  6558. </dl>
  6559. <a name="loudnorm"></a>
  6560. <h3 class="section">8.83 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>
  6561. <p>EBU R128 loudness normalization. Includes both dynamic and linear normalization modes.
  6562. Support for both single pass (livestreams, files) and double pass (files) modes.
  6563. This algorithm can target IL, LRA, and maximum true peak. In dynamic mode, to accurately
  6564. detect true peaks, the audio stream will be upsampled to 192 kHz.
  6565. Use the <code>-ar</code> option or <code>aresample</code> filter to explicitly set an output sample rate.
  6566. </p>
  6567. <p>The filter accepts the following options:
  6568. </p>
  6569. <dl compact="compact">
  6570. <dt><samp>I, i</samp></dt>
  6571. <dd><p>Set integrated loudness target.
  6572. Range is -70.0 - -5.0. Default value is -24.0.
  6573. </p>
  6574. </dd>
  6575. <dt><samp>LRA, lra</samp></dt>
  6576. <dd><p>Set loudness range target.
  6577. Range is 1.0 - 20.0. Default value is 7.0.
  6578. </p>
  6579. </dd>
  6580. <dt><samp>TP, tp</samp></dt>
  6581. <dd><p>Set maximum true peak.
  6582. Range is -9.0 - +0.0. Default value is -2.0.
  6583. </p>
  6584. </dd>
  6585. <dt><samp>measured_I, measured_i</samp></dt>
  6586. <dd><p>Measured IL of input file.
  6587. Range is -99.0 - +0.0.
  6588. </p>
  6589. </dd>
  6590. <dt><samp>measured_LRA, measured_lra</samp></dt>
  6591. <dd><p>Measured LRA of input file.
  6592. Range is 0.0 - 99.0.
  6593. </p>
  6594. </dd>
  6595. <dt><samp>measured_TP, measured_tp</samp></dt>
  6596. <dd><p>Measured true peak of input file.
  6597. Range is -99.0 - +99.0.
  6598. </p>
  6599. </dd>
  6600. <dt><samp>measured_thresh</samp></dt>
  6601. <dd><p>Measured threshold of input file.
  6602. Range is -99.0 - +0.0.
  6603. </p>
  6604. </dd>
  6605. <dt><samp>offset</samp></dt>
  6606. <dd><p>Set offset gain. Gain is applied before the true-peak limiter.
  6607. Range is -99.0 - +99.0. Default is +0.0.
  6608. </p>
  6609. </dd>
  6610. <dt><samp>linear</samp></dt>
  6611. <dd><p>Normalize by linearly scaling the source audio.
  6612. <code>measured_I</code>, <code>measured_LRA</code>, <code>measured_TP</code>,
  6613. and <code>measured_thresh</code> must all be specified. Target LRA shouldn&rsquo;t
  6614. be lower than source LRA and the change in integrated loudness shouldn&rsquo;t
  6615. result in a true peak which exceeds the target TP. If any of these
  6616. conditions aren&rsquo;t met, normalization mode will revert to <var>dynamic</var>.
  6617. Options are <code>true</code> or <code>false</code>. Default is <code>true</code>.
  6618. </p>
  6619. </dd>
  6620. <dt><samp>dual_mono</samp></dt>
  6621. <dd><p>Treat mono input files as &quot;dual-mono&quot;. If a mono file is intended for playback
  6622. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  6623. If set to <code>true</code>, this option will compensate for this effect.
  6624. Multi-channel input files are not affected by this option.
  6625. Options are true or false. Default is false.
  6626. </p>
  6627. </dd>
  6628. <dt><samp>print_format</samp></dt>
  6629. <dd><p>Set print format for stats. Options are summary, json, or none.
  6630. Default value is none.
  6631. </p></dd>
  6632. </dl>
  6633. <a name="lowpass"></a>
  6634. <h3 class="section">8.84 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>
  6635. <p>Apply a low-pass filter with 3dB point frequency.
  6636. The filter can be either single-pole or double-pole (the default).
  6637. The filter roll off at 6dB per pole per octave (20dB per pole per decade).
  6638. </p>
  6639. <p>The filter accepts the following options:
  6640. </p>
  6641. <dl compact="compact">
  6642. <dt><samp>frequency, f</samp></dt>
  6643. <dd><p>Set frequency in Hz. Default is 500.
  6644. </p>
  6645. </dd>
  6646. <dt><samp>poles, p</samp></dt>
  6647. <dd><p>Set number of poles. Default is 2.
  6648. </p>
  6649. </dd>
  6650. <dt><samp>width_type, t</samp></dt>
  6651. <dd><p>Set method to specify band-width of filter.
  6652. </p><dl compact="compact">
  6653. <dt><samp>h</samp></dt>
  6654. <dd><p>Hz
  6655. </p></dd>
  6656. <dt><samp>q</samp></dt>
  6657. <dd><p>Q-Factor
  6658. </p></dd>
  6659. <dt><samp>o</samp></dt>
  6660. <dd><p>octave
  6661. </p></dd>
  6662. <dt><samp>s</samp></dt>
  6663. <dd><p>slope
  6664. </p></dd>
  6665. <dt><samp>k</samp></dt>
  6666. <dd><p>kHz
  6667. </p></dd>
  6668. </dl>
  6669. </dd>
  6670. <dt><samp>width, w</samp></dt>
  6671. <dd><p>Specify the band-width of a filter in width_type units.
  6672. Applies only to double-pole filter.
  6673. The default is 0.707q and gives a Butterworth response.
  6674. </p>
  6675. </dd>
  6676. <dt><samp>mix, m</samp></dt>
  6677. <dd><p>How much to use filtered signal in output. Default is 1.
  6678. Range is between 0 and 1.
  6679. </p>
  6680. </dd>
  6681. <dt><samp>channels, c</samp></dt>
  6682. <dd><p>Specify which channels to filter, by default all available are filtered.
  6683. </p>
  6684. </dd>
  6685. <dt><samp>normalize, n</samp></dt>
  6686. <dd><p>Normalize biquad coefficients, by default is disabled.
  6687. Enabling it will normalize magnitude response at DC to 0dB.
  6688. </p>
  6689. </dd>
  6690. <dt><samp>transform, a</samp></dt>
  6691. <dd><p>Set transform type of IIR filter.
  6692. </p><dl compact="compact">
  6693. <dt><samp>di</samp></dt>
  6694. <dt><samp>dii</samp></dt>
  6695. <dt><samp>tdii</samp></dt>
  6696. <dt><samp>latt</samp></dt>
  6697. </dl>
  6698. </dd>
  6699. <dt><samp>precision, r</samp></dt>
  6700. <dd><p>Set precison of filtering.
  6701. </p><dl compact="compact">
  6702. <dt><samp>auto</samp></dt>
  6703. <dd><p>Pick automatic sample format depending on surround filters.
  6704. </p></dd>
  6705. <dt><samp>s16</samp></dt>
  6706. <dd><p>Always use signed 16-bit.
  6707. </p></dd>
  6708. <dt><samp>s32</samp></dt>
  6709. <dd><p>Always use signed 32-bit.
  6710. </p></dd>
  6711. <dt><samp>f32</samp></dt>
  6712. <dd><p>Always use float 32-bit.
  6713. </p></dd>
  6714. <dt><samp>f64</samp></dt>
  6715. <dd><p>Always use float 64-bit.
  6716. </p></dd>
  6717. </dl>
  6718. </dd>
  6719. </dl>
  6720. <a name="Examples-25"></a>
  6721. <h4 class="subsection">8.84.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>
  6722. <ul>
  6723. <li> Lowpass only LFE channel, it LFE is not present it does nothing:
  6724. <div class="example">
  6725. <pre class="example">lowpass=c=LFE
  6726. </pre></div>
  6727. </li></ul>
  6728. <a name="Commands-34"></a>
  6729. <h4 class="subsection">8.84.2 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>
  6730. <p>This filter supports the following commands:
  6731. </p><dl compact="compact">
  6732. <dt><samp>frequency, f</samp></dt>
  6733. <dd><p>Change lowpass frequency.
  6734. Syntax for the command is : &quot;<var>frequency</var>&quot;
  6735. </p>
  6736. </dd>
  6737. <dt><samp>width_type, t</samp></dt>
  6738. <dd><p>Change lowpass width_type.
  6739. Syntax for the command is : &quot;<var>width_type</var>&quot;
  6740. </p>
  6741. </dd>
  6742. <dt><samp>width, w</samp></dt>
  6743. <dd><p>Change lowpass width.
  6744. Syntax for the command is : &quot;<var>width</var>&quot;
  6745. </p>
  6746. </dd>
  6747. <dt><samp>mix, m</samp></dt>
  6748. <dd><p>Change lowpass mix.
  6749. Syntax for the command is : &quot;<var>mix</var>&quot;
  6750. </p></dd>
  6751. </dl>
  6752. <a name="lv2"></a>
  6753. <h3 class="section">8.85 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>
  6754. <p>Load a LV2 (LADSPA Version 2) plugin.
  6755. </p>
  6756. <p>To enable compilation of this filter you need to configure FFmpeg with
  6757. <code>--enable-lv2</code>.
  6758. </p>
  6759. <dl compact="compact">
  6760. <dt><samp>plugin, p</samp></dt>
  6761. <dd><p>Specifies the plugin URI. You may need to escape &rsquo;:&rsquo;.
  6762. </p>
  6763. </dd>
  6764. <dt><samp>controls, c</samp></dt>
  6765. <dd><p>Set the &rsquo;|&rsquo; separated list of controls which are zero or more floating point
  6766. values that determine the behavior of the loaded plugin (for example delay,
  6767. threshold or gain).
  6768. If <samp>controls</samp> is set to <code>help</code>, all available controls and
  6769. their valid ranges are printed.
  6770. </p>
  6771. </dd>
  6772. <dt><samp>sample_rate, s</samp></dt>
  6773. <dd><p>Specify the sample rate, default to 44100. Only used if plugin have
  6774. zero inputs.
  6775. </p>
  6776. </dd>
  6777. <dt><samp>nb_samples, n</samp></dt>
  6778. <dd><p>Set the number of samples per channel per each output frame, default
  6779. is 1024. Only used if plugin have zero inputs.
  6780. </p>
  6781. </dd>
  6782. <dt><samp>duration, d</samp></dt>
  6783. <dd><p>Set the minimum duration of the sourced audio. See
  6784. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  6785. for the accepted syntax.
  6786. Note that the resulting duration may be greater than the specified duration,
  6787. as the generated audio is always cut at the end of a complete frame.
  6788. If not specified, or the expressed duration is negative, the audio is
  6789. supposed to be generated forever.
  6790. Only used if plugin have zero inputs.
  6791. </p></dd>
  6792. </dl>
  6793. <a name="Examples-26"></a>
  6794. <h4 class="subsection">8.85.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>
  6795. <ul>
  6796. <li> Apply bass enhancer plugin from Calf:
  6797. <div class="example">
  6798. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
  6799. </pre></div>
  6800. </li><li> Apply vinyl plugin from Calf:
  6801. <div class="example">
  6802. <pre class="example">lv2=p=http\\\\://calf.sourceforge.net/plugins/Vinyl:c=drone=0.2|aging=0.5
  6803. </pre></div>
  6804. </li><li> Apply bit crusher plugin from ArtyFX:
  6805. <div class="example">
  6806. <pre class="example">lv2=p=http\\\\://www.openavproductions.com/artyfx#bitta:c=crush=0.3
  6807. </pre></div>
  6808. </li></ul>
  6809. <a name="mcompand"></a>
  6810. <h3 class="section">8.86 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>
  6811. <p>Multiband Compress or expand the audio&rsquo;s dynamic range.
  6812. </p>
  6813. <p>The input audio is divided into bands using 4th order Linkwitz-Riley IIRs.
  6814. This is akin to the crossover of a loudspeaker, and results in flat frequency
  6815. response when absent compander action.
  6816. </p>
  6817. <p>It accepts the following parameters:
  6818. </p>
  6819. <dl compact="compact">
  6820. <dt><samp>args</samp></dt>
  6821. <dd><p>This option syntax is:
  6822. attack,decay,[attack,decay..] soft-knee points crossover_frequency [delay [initial_volume [gain]]] | attack,decay ...
  6823. For explanation of each item refer to compand filter documentation.
  6824. </p></dd>
  6825. </dl>
  6826. <span id="pan"></span><a name="pan-1"></a>
  6827. <h3 class="section">8.87 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>
  6828. <p>Mix channels with specific gain levels. The filter accepts the output
  6829. channel layout followed by a set of channels definitions.
  6830. </p>
  6831. <p>This filter is also designed to efficiently remap the channels of an audio
  6832. stream.
  6833. </p>
  6834. <p>The filter accepts parameters of the form:
  6835. &quot;<var>l</var>|<var>outdef</var>|<var>outdef</var>|...&quot;
  6836. </p>
  6837. <dl compact="compact">
  6838. <dt><samp>l</samp></dt>
  6839. <dd><p>output channel layout or number of channels
  6840. </p>
  6841. </dd>
  6842. <dt><samp>outdef</samp></dt>
  6843. <dd><p>output channel specification, of the form:
  6844. &quot;<var>out_name</var>=[<var>gain</var>*]<var>in_name</var>[(+-)[<var>gain</var>*]<var>in_name</var>...]&quot;
  6845. </p>
  6846. </dd>
  6847. <dt><samp>out_name</samp></dt>
  6848. <dd><p>output channel to define, either a channel name (FL, FR, etc.) or a channel
  6849. number (c0, c1, etc.)
  6850. </p>
  6851. </dd>
  6852. <dt><samp>gain</samp></dt>
  6853. <dd><p>multiplicative coefficient for the channel, 1 leaving the volume unchanged
  6854. </p>
  6855. </dd>
  6856. <dt><samp>in_name</samp></dt>
  6857. <dd><p>input channel to use, see out_name for details; it is not possible to mix
  6858. named and numbered input channels
  6859. </p></dd>
  6860. </dl>
  6861. <p>If the &lsquo;=&rsquo; in a channel specification is replaced by &lsquo;&lt;&rsquo;, then the gains for
  6862. that specification will be renormalized so that the total is 1, thus
  6863. avoiding clipping noise.
  6864. </p>
  6865. <a name="Mixing-examples"></a>
  6866. <h4 class="subsection">8.87.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>
  6867. <p>For example, if you want to down-mix from stereo to mono, but with a bigger
  6868. factor for the left channel:
  6869. </p><div class="example">
  6870. <pre class="example">pan=1c|c0=0.9*c0+0.1*c1
  6871. </pre></div>
  6872. <p>A customized down-mix to stereo that works automatically for 3-, 4-, 5- and
  6873. 7-channels surround:
  6874. </p><div class="example">
  6875. <pre class="example">pan=stereo| FL &lt; FL + 0.5*FC + 0.6*BL + 0.6*SL | FR &lt; FR + 0.5*FC + 0.6*BR + 0.6*SR
  6876. </pre></div>
  6877. <p>Note that <code>ffmpeg</code> integrates a default down-mix (and up-mix) system
  6878. that should be preferred (see &quot;-ac&quot; option) unless you have very specific
  6879. needs.
  6880. </p>
  6881. <a name="Remapping-examples"></a>
  6882. <h4 class="subsection">8.87.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>
  6883. <p>The channel remapping will be effective if, and only if:
  6884. </p>
  6885. <ul>
  6886. <li> gain coefficients are zeroes or ones,
  6887. </li><li> only one input per channel output,
  6888. </li></ul>
  6889. <p>If all these conditions are satisfied, the filter will notify the user (&quot;Pure
  6890. channel mapping detected&quot;), and use an optimized and lossless method to do the
  6891. remapping.
  6892. </p>
  6893. <p>For example, if you have a 5.1 source and want a stereo audio stream by
  6894. dropping the extra channels:
  6895. </p><div class="example">
  6896. <pre class="example">pan=&quot;stereo| c0=FL | c1=FR&quot;
  6897. </pre></div>
  6898. <p>Given the same source, you can also switch front left and front right channels
  6899. and keep the input channel layout:
  6900. </p><div class="example">
  6901. <pre class="example">pan=&quot;5.1| c0=c1 | c1=c0 | c2=c2 | c3=c3 | c4=c4 | c5=c5&quot;
  6902. </pre></div>
  6903. <p>If the input is a stereo audio stream, you can mute the front left channel (and
  6904. still keep the stereo channel layout) with:
  6905. </p><div class="example">
  6906. <pre class="example">pan=&quot;stereo|c1=c1&quot;
  6907. </pre></div>
  6908. <p>Still with a stereo audio stream input, you can copy the right channel in both
  6909. front left and right:
  6910. </p><div class="example">
  6911. <pre class="example">pan=&quot;stereo| c0=FR | c1=FR&quot;
  6912. </pre></div>
  6913. <a name="replaygain"></a>
  6914. <h3 class="section">8.88 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>
  6915. <p>ReplayGain scanner filter. This filter takes an audio stream as an input and
  6916. outputs it unchanged.
  6917. At end of filtering it displays <code>track_gain</code> and <code>track_peak</code>.
  6918. </p>
  6919. <a name="resample"></a>
  6920. <h3 class="section">8.89 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>
  6921. <p>Convert the audio sample format, sample rate and channel layout. It is
  6922. not meant to be used directly.
  6923. </p>
  6924. <a name="rubberband"></a>
  6925. <h3 class="section">8.90 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>
  6926. <p>Apply time-stretching and pitch-shifting with librubberband.
  6927. </p>
  6928. <p>To enable compilation of this filter, you need to configure FFmpeg with
  6929. <code>--enable-librubberband</code>.
  6930. </p>
  6931. <p>The filter accepts the following options:
  6932. </p>
  6933. <dl compact="compact">
  6934. <dt><samp>tempo</samp></dt>
  6935. <dd><p>Set tempo scale factor.
  6936. </p>
  6937. </dd>
  6938. <dt><samp>pitch</samp></dt>
  6939. <dd><p>Set pitch scale factor.
  6940. </p>
  6941. </dd>
  6942. <dt><samp>transients</samp></dt>
  6943. <dd><p>Set transients detector.
  6944. Possible values are:
  6945. </p><dl compact="compact">
  6946. <dt><var>crisp</var></dt>
  6947. <dt><var>mixed</var></dt>
  6948. <dt><var>smooth</var></dt>
  6949. </dl>
  6950. </dd>
  6951. <dt><samp>detector</samp></dt>
  6952. <dd><p>Set detector.
  6953. Possible values are:
  6954. </p><dl compact="compact">
  6955. <dt><var>compound</var></dt>
  6956. <dt><var>percussive</var></dt>
  6957. <dt><var>soft</var></dt>
  6958. </dl>
  6959. </dd>
  6960. <dt><samp>phase</samp></dt>
  6961. <dd><p>Set phase.
  6962. Possible values are:
  6963. </p><dl compact="compact">
  6964. <dt><var>laminar</var></dt>
  6965. <dt><var>independent</var></dt>
  6966. </dl>
  6967. </dd>
  6968. <dt><samp>window</samp></dt>
  6969. <dd><p>Set processing window size.
  6970. Possible values are:
  6971. </p><dl compact="compact">
  6972. <dt><var>standard</var></dt>
  6973. <dt><var>short</var></dt>
  6974. <dt><var>long</var></dt>
  6975. </dl>
  6976. </dd>
  6977. <dt><samp>smoothing</samp></dt>
  6978. <dd><p>Set smoothing.
  6979. Possible values are:
  6980. </p><dl compact="compact">
  6981. <dt><var>off</var></dt>
  6982. <dt><var>on</var></dt>
  6983. </dl>
  6984. </dd>
  6985. <dt><samp>formant</samp></dt>
  6986. <dd><p>Enable formant preservation when shift pitching.
  6987. Possible values are:
  6988. </p><dl compact="compact">
  6989. <dt><var>shifted</var></dt>
  6990. <dt><var>preserved</var></dt>
  6991. </dl>
  6992. </dd>
  6993. <dt><samp>pitchq</samp></dt>
  6994. <dd><p>Set pitch quality.
  6995. Possible values are:
  6996. </p><dl compact="compact">
  6997. <dt><var>quality</var></dt>
  6998. <dt><var>speed</var></dt>
  6999. <dt><var>consistency</var></dt>
  7000. </dl>
  7001. </dd>
  7002. <dt><samp>channels</samp></dt>
  7003. <dd><p>Set channels.
  7004. Possible values are:
  7005. </p><dl compact="compact">
  7006. <dt><var>apart</var></dt>
  7007. <dt><var>together</var></dt>
  7008. </dl>
  7009. </dd>
  7010. </dl>
  7011. <a name="Commands-35"></a>
  7012. <h4 class="subsection">8.90.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>
  7013. <p>This filter supports the following commands:
  7014. </p><dl compact="compact">
  7015. <dt><samp>tempo</samp></dt>
  7016. <dd><p>Change filter tempo scale factor.
  7017. Syntax for the command is : &quot;<var>tempo</var>&quot;
  7018. </p>
  7019. </dd>
  7020. <dt><samp>pitch</samp></dt>
  7021. <dd><p>Change filter pitch scale factor.
  7022. Syntax for the command is : &quot;<var>pitch</var>&quot;
  7023. </p></dd>
  7024. </dl>
  7025. <a name="sidechaincompress"></a>
  7026. <h3 class="section">8.91 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>
  7027. <p>This filter acts like normal compressor but has the ability to compress
  7028. detected signal using second input signal.
  7029. It needs two input streams and returns one output stream.
  7030. First input stream will be processed depending on second stream signal.
  7031. The filtered signal then can be filtered with other filters in later stages of
  7032. processing. See <a href="#pan">pan</a> and <a href="#amerge">amerge</a> filter.
  7033. </p>
  7034. <p>The filter accepts the following options:
  7035. </p>
  7036. <dl compact="compact">
  7037. <dt><samp>level_in</samp></dt>
  7038. <dd><p>Set input gain. Default is 1. Range is between 0.015625 and 64.
  7039. </p>
  7040. </dd>
  7041. <dt><samp>mode</samp></dt>
  7042. <dd><p>Set mode of compressor operation. Can be <code>upward</code> or <code>downward</code>.
  7043. Default is <code>downward</code>.
  7044. </p>
  7045. </dd>
  7046. <dt><samp>threshold</samp></dt>
  7047. <dd><p>If a signal of second stream raises above this level it will affect the gain
  7048. reduction of first stream.
  7049. By default is 0.125. Range is between 0.00097563 and 1.
  7050. </p>
  7051. </dd>
  7052. <dt><samp>ratio</samp></dt>
  7053. <dd><p>Set a ratio about which the signal is reduced. 1:2 means that if the level
  7054. raised 4dB above the threshold, it will be only 2dB above after the reduction.
  7055. Default is 2. Range is between 1 and 20.
  7056. </p>
  7057. </dd>
  7058. <dt><samp>attack</samp></dt>
  7059. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  7060. reduction starts. Default is 20. Range is between 0.01 and 2000.
  7061. </p>
  7062. </dd>
  7063. <dt><samp>release</samp></dt>
  7064. <dd><p>Amount of milliseconds the signal has to fall below the threshold before
  7065. reduction is decreased again. Default is 250. Range is between 0.01 and 9000.
  7066. </p>
  7067. </dd>
  7068. <dt><samp>makeup</samp></dt>
  7069. <dd><p>Set the amount by how much signal will be amplified after processing.
  7070. Default is 1. Range is from 1 to 64.
  7071. </p>
  7072. </dd>
  7073. <dt><samp>knee</samp></dt>
  7074. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  7075. Default is 2.82843. Range is between 1 and 8.
  7076. </p>
  7077. </dd>
  7078. <dt><samp>link</samp></dt>
  7079. <dd><p>Choose if the <code>average</code> level between all channels of side-chain stream
  7080. or the louder(<code>maximum</code>) channel of side-chain stream affects the
  7081. reduction. Default is <code>average</code>.
  7082. </p>
  7083. </dd>
  7084. <dt><samp>detection</samp></dt>
  7085. <dd><p>Should the exact signal be taken in case of <code>peak</code> or an RMS one in case
  7086. of <code>rms</code>. Default is <code>rms</code> which is mainly smoother.
  7087. </p>
  7088. </dd>
  7089. <dt><samp>level_sc</samp></dt>
  7090. <dd><p>Set sidechain gain. Default is 1. Range is between 0.015625 and 64.
  7091. </p>
  7092. </dd>
  7093. <dt><samp>mix</samp></dt>
  7094. <dd><p>How much to use compressed signal in output. Default is 1.
  7095. Range is between 0 and 1.
  7096. </p></dd>
  7097. </dl>
  7098. <a name="Commands-36"></a>
  7099. <h4 class="subsection">8.91.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>
  7100. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  7101. </p>
  7102. <a name="Examples-27"></a>
  7103. <h4 class="subsection">8.91.2 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>
  7104. <ul>
  7105. <li> Full ffmpeg example taking 2 audio inputs, 1st input to be compressed
  7106. depending on the signal of 2nd input and later compressed signal to be
  7107. merged with 2nd input:
  7108. <div class="example">
  7109. <pre class="example">ffmpeg -i main.flac -i sidechain.flac -filter_complex &quot;[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress[compr];[compr][mix]amerge&quot;
  7110. </pre></div>
  7111. </li></ul>
  7112. <a name="sidechaingate"></a>
  7113. <h3 class="section">8.92 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>
  7114. <p>A sidechain gate acts like a normal (wideband) gate but has the ability to
  7115. filter the detected signal before sending it to the gain reduction stage.
  7116. Normally a gate uses the full range signal to detect a level above the
  7117. threshold.
  7118. For example: If you cut all lower frequencies from your sidechain signal
  7119. the gate will decrease the volume of your track only if not enough highs
  7120. appear. With this technique you are able to reduce the resonation of a
  7121. natural drum or remove &quot;rumbling&quot; of muted strokes from a heavily distorted
  7122. guitar.
  7123. It needs two input streams and returns one output stream.
  7124. First input stream will be processed depending on second stream signal.
  7125. </p>
  7126. <p>The filter accepts the following options:
  7127. </p>
  7128. <dl compact="compact">
  7129. <dt><samp>level_in</samp></dt>
  7130. <dd><p>Set input level before filtering.
  7131. Default is 1. Allowed range is from 0.015625 to 64.
  7132. </p>
  7133. </dd>
  7134. <dt><samp>mode</samp></dt>
  7135. <dd><p>Set the mode of operation. Can be <code>upward</code> or <code>downward</code>.
  7136. Default is <code>downward</code>. If set to <code>upward</code> mode, higher parts of signal
  7137. will be amplified, expanding dynamic range in upward direction.
  7138. Otherwise, in case of <code>downward</code> lower parts of signal will be reduced.
  7139. </p>
  7140. </dd>
  7141. <dt><samp>range</samp></dt>
  7142. <dd><p>Set the level of gain reduction when the signal is below the threshold.
  7143. Default is 0.06125. Allowed range is from 0 to 1.
  7144. Setting this to 0 disables reduction and then filter behaves like expander.
  7145. </p>
  7146. </dd>
  7147. <dt><samp>threshold</samp></dt>
  7148. <dd><p>If a signal rises above this level the gain reduction is released.
  7149. Default is 0.125. Allowed range is from 0 to 1.
  7150. </p>
  7151. </dd>
  7152. <dt><samp>ratio</samp></dt>
  7153. <dd><p>Set a ratio about which the signal is reduced.
  7154. Default is 2. Allowed range is from 1 to 9000.
  7155. </p>
  7156. </dd>
  7157. <dt><samp>attack</samp></dt>
  7158. <dd><p>Amount of milliseconds the signal has to rise above the threshold before gain
  7159. reduction stops.
  7160. Default is 20 milliseconds. Allowed range is from 0.01 to 9000.
  7161. </p>
  7162. </dd>
  7163. <dt><samp>release</samp></dt>
  7164. <dd><p>Amount of milliseconds the signal has to fall below the threshold before the
  7165. reduction is increased again. Default is 250 milliseconds.
  7166. Allowed range is from 0.01 to 9000.
  7167. </p>
  7168. </dd>
  7169. <dt><samp>makeup</samp></dt>
  7170. <dd><p>Set amount of amplification of signal after processing.
  7171. Default is 1. Allowed range is from 1 to 64.
  7172. </p>
  7173. </dd>
  7174. <dt><samp>knee</samp></dt>
  7175. <dd><p>Curve the sharp knee around the threshold to enter gain reduction more softly.
  7176. Default is 2.828427125. Allowed range is from 1 to 8.
  7177. </p>
  7178. </dd>
  7179. <dt><samp>detection</samp></dt>
  7180. <dd><p>Choose if exact signal should be taken for detection or an RMS like one.
  7181. Default is rms. Can be peak or rms.
  7182. </p>
  7183. </dd>
  7184. <dt><samp>link</samp></dt>
  7185. <dd><p>Choose if the average level between all channels or the louder channel affects
  7186. the reduction.
  7187. Default is average. Can be average or maximum.
  7188. </p>
  7189. </dd>
  7190. <dt><samp>level_sc</samp></dt>
  7191. <dd><p>Set sidechain gain. Default is 1. Range is from 0.015625 to 64.
  7192. </p></dd>
  7193. </dl>
  7194. <a name="Commands-37"></a>
  7195. <h4 class="subsection">8.92.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>
  7196. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  7197. </p>
  7198. <a name="silencedetect"></a>
  7199. <h3 class="section">8.93 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>
  7200. <p>Detect silence in an audio stream.
  7201. </p>
  7202. <p>This filter logs a message when it detects that the input audio volume is less
  7203. or equal to a noise tolerance value for a duration greater or equal to the
  7204. minimum detected noise duration.
  7205. </p>
  7206. <p>The printed times and duration are expressed in seconds. The
  7207. <code>lavfi.silence_start</code> or <code>lavfi.silence_start.X</code> metadata key
  7208. is set on the first frame whose timestamp equals or exceeds the detection
  7209. duration and it contains the timestamp of the first frame of the silence.
  7210. </p>
  7211. <p>The <code>lavfi.silence_duration</code> or <code>lavfi.silence_duration.X</code>
  7212. and <code>lavfi.silence_end</code> or <code>lavfi.silence_end.X</code> metadata
  7213. keys are set on the first frame after the silence. If <samp>mono</samp> is
  7214. enabled, and each channel is evaluated separately, the <code>.X</code>
  7215. suffixed keys are used, and <code>X</code> corresponds to the channel number.
  7216. </p>
  7217. <p>The filter accepts the following options:
  7218. </p>
  7219. <dl compact="compact">
  7220. <dt><samp>noise, n</samp></dt>
  7221. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  7222. specified value) or amplitude ratio. Default is -60dB, or 0.001.
  7223. </p>
  7224. </dd>
  7225. <dt><samp>duration, d</samp></dt>
  7226. <dd><p>Set silence duration until notification (default is 2 seconds). See
  7227. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  7228. for the accepted syntax.
  7229. </p>
  7230. </dd>
  7231. <dt><samp>mono, m</samp></dt>
  7232. <dd><p>Process each channel separately, instead of combined. By default is disabled.
  7233. </p></dd>
  7234. </dl>
  7235. <a name="Examples-28"></a>
  7236. <h4 class="subsection">8.93.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>
  7237. <ul>
  7238. <li> Detect 5 seconds of silence with -50dB noise tolerance:
  7239. <div class="example">
  7240. <pre class="example">silencedetect=n=-50dB:d=5
  7241. </pre></div>
  7242. </li><li> Complete example with <code>ffmpeg</code> to detect silence with 0.0001 noise
  7243. tolerance in <samp>silence.mp3</samp>:
  7244. <div class="example">
  7245. <pre class="example">ffmpeg -i silence.mp3 -af silencedetect=noise=0.0001 -f null -
  7246. </pre></div>
  7247. </li></ul>
  7248. <a name="silenceremove"></a>
  7249. <h3 class="section">8.94 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>
  7250. <p>Remove silence from the beginning, middle or end of the audio.
  7251. </p>
  7252. <p>The filter accepts the following options:
  7253. </p>
  7254. <dl compact="compact">
  7255. <dt><samp>start_periods</samp></dt>
  7256. <dd><p>This value is used to indicate if audio should be trimmed at beginning of
  7257. the audio. A value of zero indicates no silence should be trimmed from the
  7258. beginning. When specifying a non-zero value, it trims audio up until it
  7259. finds non-silence. Normally, when trimming silence from beginning of audio
  7260. the <var>start_periods</var> will be <code>1</code> but it can be increased to higher
  7261. values to trim all audio up to specific count of non-silence periods.
  7262. Default value is <code>0</code>.
  7263. </p>
  7264. </dd>
  7265. <dt><samp>start_duration</samp></dt>
  7266. <dd><p>Specify the amount of time that non-silence must be detected before it stops
  7267. trimming audio. By increasing the duration, bursts of noises can be treated
  7268. as silence and trimmed off. Default value is <code>0</code>.
  7269. </p>
  7270. </dd>
  7271. <dt><samp>start_threshold</samp></dt>
  7272. <dd><p>This indicates what sample value should be treated as silence. For digital
  7273. audio, a value of <code>0</code> may be fine but for audio recorded from analog,
  7274. you may wish to increase the value to account for background noise.
  7275. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  7276. or amplitude ratio. Default value is <code>0</code>.
  7277. </p>
  7278. </dd>
  7279. <dt><samp>start_silence</samp></dt>
  7280. <dd><p>Specify max duration of silence at beginning that will be kept after
  7281. trimming. Default is 0, which is equal to trimming all samples detected
  7282. as silence.
  7283. </p>
  7284. </dd>
  7285. <dt><samp>start_mode</samp></dt>
  7286. <dd><p>Specify mode of detection of silence end in start of multi-channel audio.
  7287. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  7288. With <var>any</var>, any sample that is detected as non-silence will cause
  7289. stopped trimming of silence.
  7290. With <var>all</var>, only if all channels are detected as non-silence will cause
  7291. stopped trimming of silence.
  7292. </p>
  7293. </dd>
  7294. <dt><samp>stop_periods</samp></dt>
  7295. <dd><p>Set the count for trimming silence from the end of audio.
  7296. To remove silence from the middle of a file, specify a <var>stop_periods</var>
  7297. that is negative. This value is then treated as a positive value and is
  7298. used to indicate the effect should restart processing as specified by
  7299. <var>start_periods</var>, making it suitable for removing periods of silence
  7300. in the middle of the audio.
  7301. Default value is <code>0</code>.
  7302. </p>
  7303. </dd>
  7304. <dt><samp>stop_duration</samp></dt>
  7305. <dd><p>Specify a duration of silence that must exist before audio is not copied any
  7306. more. By specifying a higher duration, silence that is wanted can be left in
  7307. the audio.
  7308. Default value is <code>0</code>.
  7309. </p>
  7310. </dd>
  7311. <dt><samp>stop_threshold</samp></dt>
  7312. <dd><p>This is the same as <samp>start_threshold</samp> but for trimming silence from
  7313. the end of audio.
  7314. Can be specified in dB (in case &quot;dB&quot; is appended to the specified value)
  7315. or amplitude ratio. Default value is <code>0</code>.
  7316. </p>
  7317. </dd>
  7318. <dt><samp>stop_silence</samp></dt>
  7319. <dd><p>Specify max duration of silence at end that will be kept after
  7320. trimming. Default is 0, which is equal to trimming all samples detected
  7321. as silence.
  7322. </p>
  7323. </dd>
  7324. <dt><samp>stop_mode</samp></dt>
  7325. <dd><p>Specify mode of detection of silence start in end of multi-channel audio.
  7326. Can be <var>any</var> or <var>all</var>. Default is <var>any</var>.
  7327. With <var>any</var>, any sample that is detected as non-silence will cause
  7328. stopped trimming of silence.
  7329. With <var>all</var>, only if all channels are detected as non-silence will cause
  7330. stopped trimming of silence.
  7331. </p>
  7332. </dd>
  7333. <dt><samp>detection</samp></dt>
  7334. <dd><p>Set how is silence detected. Can be <code>rms</code> or <code>peak</code>. Second is faster
  7335. and works better with digital silence which is exactly 0.
  7336. Default value is <code>rms</code>.
  7337. </p>
  7338. </dd>
  7339. <dt><samp>window</samp></dt>
  7340. <dd><p>Set duration in number of seconds used to calculate size of window in number
  7341. of samples for detecting silence.
  7342. Default value is <code>0.02</code>. Allowed range is from <code>0</code> to <code>10</code>.
  7343. </p></dd>
  7344. </dl>
  7345. <a name="Examples-29"></a>
  7346. <h4 class="subsection">8.94.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>
  7347. <ul>
  7348. <li> The following example shows how this filter can be used to start a recording
  7349. that does not contain the delay at the start which usually occurs between
  7350. pressing the record button and the start of the performance:
  7351. <div class="example">
  7352. <pre class="example">silenceremove=start_periods=1:start_duration=5:start_threshold=0.02
  7353. </pre></div>
  7354. </li><li> Trim all silence encountered from beginning to end where there is more than 1
  7355. second of silence in audio:
  7356. <div class="example">
  7357. <pre class="example">silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB
  7358. </pre></div>
  7359. </li><li> Trim all digital silence samples, using peak detection, from beginning to end
  7360. where there is more than 0 samples of digital silence in audio and digital
  7361. silence is detected in all channels at same positions in stream:
  7362. <div class="example">
  7363. <pre class="example">silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0
  7364. </pre></div>
  7365. </li></ul>
  7366. <a name="sofalizer"></a>
  7367. <h3 class="section">8.95 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>
  7368. <p>SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
  7369. loudspeakers around the user for binaural listening via headphones (audio
  7370. formats up to 9 channels supported).
  7371. The HRTFs are stored in SOFA files (see <a href="http://www.sofacoustics.org/">http://www.sofacoustics.org/</a> for a database).
  7372. SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
  7373. Austrian Academy of Sciences.
  7374. </p>
  7375. <p>To enable compilation of this filter you need to configure FFmpeg with
  7376. <code>--enable-libmysofa</code>.
  7377. </p>
  7378. <p>The filter accepts the following options:
  7379. </p>
  7380. <dl compact="compact">
  7381. <dt><samp>sofa</samp></dt>
  7382. <dd><p>Set the SOFA file used for rendering.
  7383. </p>
  7384. </dd>
  7385. <dt><samp>gain</samp></dt>
  7386. <dd><p>Set gain applied to audio. Value is in dB. Default is 0.
  7387. </p>
  7388. </dd>
  7389. <dt><samp>rotation</samp></dt>
  7390. <dd><p>Set rotation of virtual loudspeakers in deg. Default is 0.
  7391. </p>
  7392. </dd>
  7393. <dt><samp>elevation</samp></dt>
  7394. <dd><p>Set elevation of virtual speakers in deg. Default is 0.
  7395. </p>
  7396. </dd>
  7397. <dt><samp>radius</samp></dt>
  7398. <dd><p>Set distance in meters between loudspeakers and the listener with near-field
  7399. HRTFs. Default is 1.
  7400. </p>
  7401. </dd>
  7402. <dt><samp>type</samp></dt>
  7403. <dd><p>Set processing type. Can be <var>time</var> or <var>freq</var>. <var>time</var> is
  7404. processing audio in time domain which is slow.
  7405. <var>freq</var> is processing audio in frequency domain which is fast.
  7406. Default is <var>freq</var>.
  7407. </p>
  7408. </dd>
  7409. <dt><samp>speakers</samp></dt>
  7410. <dd><p>Set custom positions of virtual loudspeakers. Syntax for this option is:
  7411. &lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;[|&lt;CH&gt; &lt;AZIM&gt; &lt;ELEV&gt;|...].
  7412. Each virtual loudspeaker is described with short channel name following with
  7413. azimuth and elevation in degrees.
  7414. Each virtual loudspeaker description is separated by &rsquo;|&rsquo;.
  7415. For example to override front left and front right channel positions use:
  7416. &rsquo;speakers=FL 45 15|FR 345 15&rsquo;.
  7417. Descriptions with unrecognised channel names are ignored.
  7418. </p>
  7419. </dd>
  7420. <dt><samp>lfegain</samp></dt>
  7421. <dd><p>Set custom gain for LFE channels. Value is in dB. Default is 0.
  7422. </p>
  7423. </dd>
  7424. <dt><samp>framesize</samp></dt>
  7425. <dd><p>Set custom frame size in number of samples. Default is 1024.
  7426. Allowed range is from 1024 to 96000. Only used if option &lsquo;<samp>type</samp>&rsquo;
  7427. is set to <var>freq</var>.
  7428. </p>
  7429. </dd>
  7430. <dt><samp>normalize</samp></dt>
  7431. <dd><p>Should all IRs be normalized upon importing SOFA file.
  7432. By default is enabled.
  7433. </p>
  7434. </dd>
  7435. <dt><samp>interpolate</samp></dt>
  7436. <dd><p>Should nearest IRs be interpolated with neighbor IRs if exact position
  7437. does not match. By default is disabled.
  7438. </p>
  7439. </dd>
  7440. <dt><samp>minphase</samp></dt>
  7441. <dd><p>Minphase all IRs upon loading of SOFA file. By default is disabled.
  7442. </p>
  7443. </dd>
  7444. <dt><samp>anglestep</samp></dt>
  7445. <dd><p>Set neighbor search angle step. Only used if option <var>interpolate</var> is enabled.
  7446. </p>
  7447. </dd>
  7448. <dt><samp>radstep</samp></dt>
  7449. <dd><p>Set neighbor search radius step. Only used if option <var>interpolate</var> is enabled.
  7450. </p></dd>
  7451. </dl>
  7452. <a name="Examples-30"></a>
  7453. <h4 class="subsection">8.95.1 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>
  7454. <ul>
  7455. <li> Using ClubFritz6 sofa file:
  7456. <div class="example">
  7457. <pre class="example">sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=1
  7458. </pre></div>
  7459. </li><li> Using ClubFritz12 sofa file and bigger radius with small rotation:
  7460. <div class="example">
  7461. <pre class="example">sofalizer=sofa=/path/to/ClubFritz12.sofa:type=freq:radius=2:rotation=5
  7462. </pre></div>
  7463. </li><li> Similar as above but with custom speaker positions for front left, front right, back left and back right
  7464. and also with custom gain:
  7465. <div class="example">
  7466. <pre class="example">&quot;sofalizer=sofa=/path/to/ClubFritz6.sofa:type=freq:radius=2:speakers=FL 45|FR 315|BL 135|BR 225:gain=28&quot;
  7467. </pre></div>
  7468. </li></ul>
  7469. <a name="speechnorm"></a>
  7470. <h3 class="section">8.96 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>
  7471. <p>Speech Normalizer.
  7472. </p>
  7473. <p>This filter expands or compresses each half-cycle of audio samples
  7474. (local set of samples all above or all below zero and between two nearest zero crossings) depending
  7475. on threshold value, so audio reaches target peak value under conditions controlled by below options.
  7476. </p>
  7477. <p>The filter accepts the following options:
  7478. </p>
  7479. <dl compact="compact">
  7480. <dt><samp>peak, p</samp></dt>
  7481. <dd><p>Set the expansion target peak value. This specifies the highest allowed absolute amplitude
  7482. level for the normalized audio input. Default value is 0.95. Allowed range is from 0.0 to 1.0.
  7483. </p>
  7484. </dd>
  7485. <dt><samp>expansion, e</samp></dt>
  7486. <dd><p>Set the maximum expansion factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  7487. This option controls maximum local half-cycle of samples expansion. The maximum expansion
  7488. would be such that local peak value reaches target peak value but never to surpass it and that
  7489. ratio between new and previous peak value does not surpass this option value.
  7490. </p>
  7491. </dd>
  7492. <dt><samp>compression, c</samp></dt>
  7493. <dd><p>Set the maximum compression factor. Allowed range is from 1.0 to 50.0. Default value is 2.0.
  7494. This option controls maximum local half-cycle of samples compression. This option is used
  7495. only if <samp>threshold</samp> option is set to value greater than 0.0, then in such cases
  7496. when local peak is lower or same as value set by <samp>threshold</samp> all samples belonging to
  7497. that peak&rsquo;s half-cycle will be compressed by current compression factor.
  7498. </p>
  7499. </dd>
  7500. <dt><samp>threshold, t</samp></dt>
  7501. <dd><p>Set the threshold value. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  7502. This option specifies which half-cycles of samples will be compressed and which will be expanded.
  7503. Any half-cycle samples with their local peak value below or same as this option value will be
  7504. compressed by current compression factor, otherwise, if greater than threshold value they will be
  7505. expanded with expansion factor so that it could reach peak target value but never surpass it.
  7506. </p>
  7507. </dd>
  7508. <dt><samp>raise, r</samp></dt>
  7509. <dd><p>Set the expansion raising amount per each half-cycle of samples. Default value is 0.001.
  7510. Allowed range is from 0.0 to 1.0. This controls how fast expansion factor is raised per
  7511. each new half-cycle until it reaches <samp>expansion</samp> value.
  7512. Setting this options too high may lead to distortions.
  7513. </p>
  7514. </dd>
  7515. <dt><samp>fall, f</samp></dt>
  7516. <dd><p>Set the compression raising amount per each half-cycle of samples. Default value is 0.001.
  7517. Allowed range is from 0.0 to 1.0. This controls how fast compression factor is raised per
  7518. each new half-cycle until it reaches <samp>compression</samp> value.
  7519. </p>
  7520. </dd>
  7521. <dt><samp>channels, h</samp></dt>
  7522. <dd><p>Specify which channels to filter, by default all available channels are filtered.
  7523. </p>
  7524. </dd>
  7525. <dt><samp>invert, i</samp></dt>
  7526. <dd><p>Enable inverted filtering, by default is disabled. This inverts interpretation of <samp>threshold</samp>
  7527. option. When enabled any half-cycle of samples with their local peak value below or same as
  7528. <samp>threshold</samp> option will be expanded otherwise it will be compressed.
  7529. </p>
  7530. </dd>
  7531. <dt><samp>link, l</samp></dt>
  7532. <dd><p>Link channels when calculating gain applied to each filtered channel sample, by default is disabled.
  7533. When disabled each filtered channel gain calculation is independent, otherwise when this option
  7534. is enabled the minimum of all possible gains for each filtered channel is used.
  7535. </p></dd>
  7536. </dl>
  7537. <a name="Commands-38"></a>
  7538. <h4 class="subsection">8.96.1 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>
  7539. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  7540. </p>
  7541. <a name="stereotools"></a>
  7542. <h3 class="section">8.97 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>
  7543. <p>This filter has some handy utilities to manage stereo signals, for converting
  7544. M/S stereo recordings to L/R signal while having control over the parameters
  7545. or spreading the stereo image of master track.
  7546. </p>
  7547. <p>The filter accepts the following options:
  7548. </p>
  7549. <dl compact="compact">
  7550. <dt><samp>level_in</samp></dt>
  7551. <dd><p>Set input level before filtering for both channels. Defaults is 1.
  7552. Allowed range is from 0.015625 to 64.
  7553. </p>
  7554. </dd>
  7555. <dt><samp>level_out</samp></dt>
  7556. <dd><p>Set output level after filtering for both channels. Defaults is 1.
  7557. Allowed range is from 0.015625 to 64.
  7558. </p>
  7559. </dd>
  7560. <dt><samp>balance_in</samp></dt>
  7561. <dd><p>Set input balance between both channels. Default is 0.
  7562. Allowed range is from -1 to 1.
  7563. </p>
  7564. </dd>
  7565. <dt><samp>balance_out</samp></dt>
  7566. <dd><p>Set output balance between both channels. Default is 0.
  7567. Allowed range is from -1 to 1.
  7568. </p>
  7569. </dd>
  7570. <dt><samp>softclip</samp></dt>
  7571. <dd><p>Enable softclipping. Results in analog distortion instead of harsh digital 0dB
  7572. clipping. Disabled by default.
  7573. </p>
  7574. </dd>
  7575. <dt><samp>mutel</samp></dt>
  7576. <dd><p>Mute the left channel. Disabled by default.
  7577. </p>
  7578. </dd>
  7579. <dt><samp>muter</samp></dt>
  7580. <dd><p>Mute the right channel. Disabled by default.
  7581. </p>
  7582. </dd>
  7583. <dt><samp>phasel</samp></dt>
  7584. <dd><p>Change the phase of the left channel. Disabled by default.
  7585. </p>
  7586. </dd>
  7587. <dt><samp>phaser</samp></dt>
  7588. <dd><p>Change the phase of the right channel. Disabled by default.
  7589. </p>
  7590. </dd>
  7591. <dt><samp>mode</samp></dt>
  7592. <dd><p>Set stereo mode. Available values are:
  7593. </p>
  7594. <dl compact="compact">
  7595. <dt>&lsquo;<samp>lr&gt;lr</samp>&rsquo;</dt>
  7596. <dd><p>Left/Right to Left/Right, this is default.
  7597. </p>
  7598. </dd>
  7599. <dt>&lsquo;<samp>lr&gt;ms</samp>&rsquo;</dt>
  7600. <dd><p>Left/Right to Mid/Side.
  7601. </p>
  7602. </dd>
  7603. <dt>&lsquo;<samp>ms&gt;lr</samp>&rsquo;</dt>
  7604. <dd><p>Mid/Side to Left/Right.
  7605. </p>
  7606. </dd>
  7607. <dt>&lsquo;<samp>lr&gt;ll</samp>&rsquo;</dt>
  7608. <dd><p>Left/Right to Left/Left.
  7609. </p>
  7610. </dd>
  7611. <dt>&lsquo;<samp>lr&gt;rr</samp>&rsquo;</dt>
  7612. <dd><p>Left/Right to Right/Right.
  7613. </p>
  7614. </dd>
  7615. <dt>&lsquo;<samp>lr&gt;l+r</samp>&rsquo;</dt>
  7616. <dd><p>Left/Right to Left + Right.
  7617. </p>
  7618. </dd>
  7619. <dt>&lsquo;<samp>lr&gt;rl</samp>&rsquo;</dt>
  7620. <dd><p>Left/Right to Right/Left.
  7621. </p>
  7622. </dd>
  7623. <dt>&lsquo;<samp>ms&gt;ll</samp>&rsquo;</dt>
  7624. <dd><p>Mid/Side to Left/Left.
  7625. </p>
  7626. </dd>
  7627. <dt>&lsquo;<samp>ms&gt;rr</samp>&rsquo;</dt>
  7628. <dd><p>Mid/Side to Right/Right.
  7629. </p>
  7630. </dd>
  7631. <dt>&lsquo;<samp>ms&gt;rl</samp>&rsquo;</dt>
  7632. <dd><p>Mid/Side to Right/Left.
  7633. </p>
  7634. </dd>
  7635. <dt>&lsquo;<samp>lr&gt;l-r</samp>&rsquo;</dt>
  7636. <dd><p>Left/Right to Left - Right.
  7637. </p></dd>
  7638. </dl>
  7639. </dd>
  7640. <dt><samp>slev</samp></dt>
  7641. <dd><p>Set level of side signal. Default is 1.
  7642. Allowed range is from 0.015625 to 64.
  7643. </p>
  7644. </dd>
  7645. <dt><samp>sbal</samp></dt>
  7646. <dd><p>Set balance of side signal. Default is 0.
  7647. Allowed range is from -1 to 1.
  7648. </p>
  7649. </dd>
  7650. <dt><samp>mlev</samp></dt>
  7651. <dd><p>Set level of the middle signal. Default is 1.
  7652. Allowed range is from 0.015625 to 64.
  7653. </p>
  7654. </dd>
  7655. <dt><samp>mpan</samp></dt>
  7656. <dd><p>Set middle signal pan. Default is 0. Allowed range is from -1 to 1.
  7657. </p>
  7658. </dd>
  7659. <dt><samp>base</samp></dt>
  7660. <dd><p>Set stereo base between mono and inversed channels. Default is 0.
  7661. Allowed range is from -1 to 1.
  7662. </p>
  7663. </dd>
  7664. <dt><samp>delay</samp></dt>
  7665. <dd><p>Set delay in milliseconds how much to delay left from right channel and
  7666. vice versa. Default is 0. Allowed range is from -20 to 20.
  7667. </p>
  7668. </dd>
  7669. <dt><samp>sclevel</samp></dt>
  7670. <dd><p>Set S/C level. Default is 1. Allowed range is from 1 to 100.
  7671. </p>
  7672. </dd>
  7673. <dt><samp>phase</samp></dt>
  7674. <dd><p>Set the stereo phase in degrees. Default is 0. Allowed range is from 0 to 360.
  7675. </p>
  7676. </dd>
  7677. <dt><samp>bmode_in, bmode_out</samp></dt>
  7678. <dd><p>Set balance mode for balance_in/balance_out option.
  7679. </p>
  7680. <p>Can be one of the following:
  7681. </p>
  7682. <dl compact="compact">
  7683. <dt>&lsquo;<samp>balance</samp>&rsquo;</dt>
  7684. <dd><p>Classic balance mode. Attenuate one channel at time.
  7685. Gain is raised up to 1.
  7686. </p>
  7687. </dd>
  7688. <dt>&lsquo;<samp>amplitude</samp>&rsquo;</dt>
  7689. <dd><p>Similar as classic mode above but gain is raised up to 2.
  7690. </p>
  7691. </dd>
  7692. <dt>&lsquo;<samp>power</samp>&rsquo;</dt>
  7693. <dd><p>Equal power distribution, from -6dB to +6dB range.
  7694. </p></dd>
  7695. </dl>
  7696. </dd>
  7697. </dl>
  7698. <a name="Commands-39"></a>
  7699. <h4 class="subsection">8.97.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>
  7700. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  7701. </p>
  7702. <a name="Examples-31"></a>
  7703. <h4 class="subsection">8.97.2 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>
  7704. <ul>
  7705. <li> Apply karaoke like effect:
  7706. <div class="example">
  7707. <pre class="example">stereotools=mlev=0.015625
  7708. </pre></div>
  7709. </li><li> Convert M/S signal to L/R:
  7710. <div class="example">
  7711. <pre class="example">&quot;stereotools=mode=ms&gt;lr&quot;
  7712. </pre></div>
  7713. </li></ul>
  7714. <a name="stereowiden"></a>
  7715. <h3 class="section">8.98 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>
  7716. <p>This filter enhance the stereo effect by suppressing signal common to both
  7717. channels and by delaying the signal of left into right and vice versa,
  7718. thereby widening the stereo effect.
  7719. </p>
  7720. <p>The filter accepts the following options:
  7721. </p>
  7722. <dl compact="compact">
  7723. <dt><samp>delay</samp></dt>
  7724. <dd><p>Time in milliseconds of the delay of left signal into right and vice versa.
  7725. Default is 20 milliseconds.
  7726. </p>
  7727. </dd>
  7728. <dt><samp>feedback</samp></dt>
  7729. <dd><p>Amount of gain in delayed signal into right and vice versa. Gives a delay
  7730. effect of left signal in right output and vice versa which gives widening
  7731. effect. Default is 0.3.
  7732. </p>
  7733. </dd>
  7734. <dt><samp>crossfeed</samp></dt>
  7735. <dd><p>Cross feed of left into right with inverted phase. This helps in suppressing
  7736. the mono. If the value is 1 it will cancel all the signal common to both
  7737. channels. Default is 0.3.
  7738. </p>
  7739. </dd>
  7740. <dt><samp>drymix</samp></dt>
  7741. <dd><p>Set level of input signal of original channel. Default is 0.8.
  7742. </p></dd>
  7743. </dl>
  7744. <a name="Commands-40"></a>
  7745. <h4 class="subsection">8.98.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>
  7746. <p>This filter supports the all above options except <code>delay</code> as <a href="#commands">commands</a>.
  7747. </p>
  7748. <a name="superequalizer"></a>
  7749. <h3 class="section">8.99 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>
  7750. <p>Apply 18 band equalizer.
  7751. </p>
  7752. <p>The filter accepts the following options:
  7753. </p><dl compact="compact">
  7754. <dt><samp>1b</samp></dt>
  7755. <dd><p>Set 65Hz band gain.
  7756. </p></dd>
  7757. <dt><samp>2b</samp></dt>
  7758. <dd><p>Set 92Hz band gain.
  7759. </p></dd>
  7760. <dt><samp>3b</samp></dt>
  7761. <dd><p>Set 131Hz band gain.
  7762. </p></dd>
  7763. <dt><samp>4b</samp></dt>
  7764. <dd><p>Set 185Hz band gain.
  7765. </p></dd>
  7766. <dt><samp>5b</samp></dt>
  7767. <dd><p>Set 262Hz band gain.
  7768. </p></dd>
  7769. <dt><samp>6b</samp></dt>
  7770. <dd><p>Set 370Hz band gain.
  7771. </p></dd>
  7772. <dt><samp>7b</samp></dt>
  7773. <dd><p>Set 523Hz band gain.
  7774. </p></dd>
  7775. <dt><samp>8b</samp></dt>
  7776. <dd><p>Set 740Hz band gain.
  7777. </p></dd>
  7778. <dt><samp>9b</samp></dt>
  7779. <dd><p>Set 1047Hz band gain.
  7780. </p></dd>
  7781. <dt><samp>10b</samp></dt>
  7782. <dd><p>Set 1480Hz band gain.
  7783. </p></dd>
  7784. <dt><samp>11b</samp></dt>
  7785. <dd><p>Set 2093Hz band gain.
  7786. </p></dd>
  7787. <dt><samp>12b</samp></dt>
  7788. <dd><p>Set 2960Hz band gain.
  7789. </p></dd>
  7790. <dt><samp>13b</samp></dt>
  7791. <dd><p>Set 4186Hz band gain.
  7792. </p></dd>
  7793. <dt><samp>14b</samp></dt>
  7794. <dd><p>Set 5920Hz band gain.
  7795. </p></dd>
  7796. <dt><samp>15b</samp></dt>
  7797. <dd><p>Set 8372Hz band gain.
  7798. </p></dd>
  7799. <dt><samp>16b</samp></dt>
  7800. <dd><p>Set 11840Hz band gain.
  7801. </p></dd>
  7802. <dt><samp>17b</samp></dt>
  7803. <dd><p>Set 16744Hz band gain.
  7804. </p></dd>
  7805. <dt><samp>18b</samp></dt>
  7806. <dd><p>Set 20000Hz band gain.
  7807. </p></dd>
  7808. </dl>
  7809. <a name="surround"></a>
  7810. <h3 class="section">8.100 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>
  7811. <p>Apply audio surround upmix filter.
  7812. </p>
  7813. <p>This filter allows to produce multichannel output from audio stream.
  7814. </p>
  7815. <p>The filter accepts the following options:
  7816. </p>
  7817. <dl compact="compact">
  7818. <dt><samp>chl_out</samp></dt>
  7819. <dd><p>Set output channel layout. By default, this is <var>5.1</var>.
  7820. </p>
  7821. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  7822. for the required syntax.
  7823. </p>
  7824. </dd>
  7825. <dt><samp>chl_in</samp></dt>
  7826. <dd><p>Set input channel layout. By default, this is <var>stereo</var>.
  7827. </p>
  7828. <p>See <a href="ffmpeg-utils.html#channel-layout-syntax">(ffmpeg-utils)the Channel Layout section in the ffmpeg-utils(1) manual</a>
  7829. for the required syntax.
  7830. </p>
  7831. </dd>
  7832. <dt><samp>level_in</samp></dt>
  7833. <dd><p>Set input volume level. By default, this is <var>1</var>.
  7834. </p>
  7835. </dd>
  7836. <dt><samp>level_out</samp></dt>
  7837. <dd><p>Set output volume level. By default, this is <var>1</var>.
  7838. </p>
  7839. </dd>
  7840. <dt><samp>lfe</samp></dt>
  7841. <dd><p>Enable LFE channel output if output channel layout has it. By default, this is enabled.
  7842. </p>
  7843. </dd>
  7844. <dt><samp>lfe_low</samp></dt>
  7845. <dd><p>Set LFE low cut off frequency. By default, this is <var>128</var> Hz.
  7846. </p>
  7847. </dd>
  7848. <dt><samp>lfe_high</samp></dt>
  7849. <dd><p>Set LFE high cut off frequency. By default, this is <var>256</var> Hz.
  7850. </p>
  7851. </dd>
  7852. <dt><samp>lfe_mode</samp></dt>
  7853. <dd><p>Set LFE mode, can be <var>add</var> or <var>sub</var>. Default is <var>add</var>.
  7854. In <var>add</var> mode, LFE channel is created from input audio and added to output.
  7855. In <var>sub</var> mode, LFE channel is created from input audio and added to output but
  7856. also all non-LFE output channels are subtracted with output LFE channel.
  7857. </p>
  7858. </dd>
  7859. <dt><samp>angle</samp></dt>
  7860. <dd><p>Set angle of stereo surround transform, Allowed range is from <var>0</var> to <var>360</var>.
  7861. Default is <var>90</var>.
  7862. </p>
  7863. </dd>
  7864. <dt><samp>fc_in</samp></dt>
  7865. <dd><p>Set front center input volume. By default, this is <var>1</var>.
  7866. </p>
  7867. </dd>
  7868. <dt><samp>fc_out</samp></dt>
  7869. <dd><p>Set front center output volume. By default, this is <var>1</var>.
  7870. </p>
  7871. </dd>
  7872. <dt><samp>fl_in</samp></dt>
  7873. <dd><p>Set front left input volume. By default, this is <var>1</var>.
  7874. </p>
  7875. </dd>
  7876. <dt><samp>fl_out</samp></dt>
  7877. <dd><p>Set front left output volume. By default, this is <var>1</var>.
  7878. </p>
  7879. </dd>
  7880. <dt><samp>fr_in</samp></dt>
  7881. <dd><p>Set front right input volume. By default, this is <var>1</var>.
  7882. </p>
  7883. </dd>
  7884. <dt><samp>fr_out</samp></dt>
  7885. <dd><p>Set front right output volume. By default, this is <var>1</var>.
  7886. </p>
  7887. </dd>
  7888. <dt><samp>sl_in</samp></dt>
  7889. <dd><p>Set side left input volume. By default, this is <var>1</var>.
  7890. </p>
  7891. </dd>
  7892. <dt><samp>sl_out</samp></dt>
  7893. <dd><p>Set side left output volume. By default, this is <var>1</var>.
  7894. </p>
  7895. </dd>
  7896. <dt><samp>sr_in</samp></dt>
  7897. <dd><p>Set side right input volume. By default, this is <var>1</var>.
  7898. </p>
  7899. </dd>
  7900. <dt><samp>sr_out</samp></dt>
  7901. <dd><p>Set side right output volume. By default, this is <var>1</var>.
  7902. </p>
  7903. </dd>
  7904. <dt><samp>bl_in</samp></dt>
  7905. <dd><p>Set back left input volume. By default, this is <var>1</var>.
  7906. </p>
  7907. </dd>
  7908. <dt><samp>bl_out</samp></dt>
  7909. <dd><p>Set back left output volume. By default, this is <var>1</var>.
  7910. </p>
  7911. </dd>
  7912. <dt><samp>br_in</samp></dt>
  7913. <dd><p>Set back right input volume. By default, this is <var>1</var>.
  7914. </p>
  7915. </dd>
  7916. <dt><samp>br_out</samp></dt>
  7917. <dd><p>Set back right output volume. By default, this is <var>1</var>.
  7918. </p>
  7919. </dd>
  7920. <dt><samp>bc_in</samp></dt>
  7921. <dd><p>Set back center input volume. By default, this is <var>1</var>.
  7922. </p>
  7923. </dd>
  7924. <dt><samp>bc_out</samp></dt>
  7925. <dd><p>Set back center output volume. By default, this is <var>1</var>.
  7926. </p>
  7927. </dd>
  7928. <dt><samp>lfe_in</samp></dt>
  7929. <dd><p>Set LFE input volume. By default, this is <var>1</var>.
  7930. </p>
  7931. </dd>
  7932. <dt><samp>lfe_out</samp></dt>
  7933. <dd><p>Set LFE output volume. By default, this is <var>1</var>.
  7934. </p>
  7935. </dd>
  7936. <dt><samp>allx</samp></dt>
  7937. <dd><p>Set spread usage of stereo image across X axis for all channels.
  7938. </p>
  7939. </dd>
  7940. <dt><samp>ally</samp></dt>
  7941. <dd><p>Set spread usage of stereo image across Y axis for all channels.
  7942. </p>
  7943. </dd>
  7944. <dt><samp>fcx, flx, frx, blx, brx, slx, srx, bcx</samp></dt>
  7945. <dd><p>Set spread usage of stereo image across X axis for each channel.
  7946. </p>
  7947. </dd>
  7948. <dt><samp>fcy, fly, fry, bly, bry, sly, sry, bcy</samp></dt>
  7949. <dd><p>Set spread usage of stereo image across Y axis for each channel.
  7950. </p>
  7951. </dd>
  7952. <dt><samp>win_size</samp></dt>
  7953. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  7954. </p>
  7955. </dd>
  7956. <dt><samp>win_func</samp></dt>
  7957. <dd><p>Set window function.
  7958. </p>
  7959. <p>It accepts the following values:
  7960. </p><dl compact="compact">
  7961. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  7962. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  7963. <dt>&lsquo;<samp>hann, hanning</samp>&rsquo;</dt>
  7964. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  7965. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  7966. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  7967. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  7968. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  7969. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  7970. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  7971. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  7972. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  7973. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  7974. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  7975. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  7976. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  7977. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  7978. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  7979. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  7980. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  7981. </dl>
  7982. <p>Default is <code>hann</code>.
  7983. </p>
  7984. </dd>
  7985. <dt><samp>overlap</samp></dt>
  7986. <dd><p>Set window overlap. If set to 1, the recommended overlap for selected
  7987. window function will be picked. Default is <code>0.5</code>.
  7988. </p></dd>
  7989. </dl>
  7990. <a name="treble_002c-highshelf"></a>
  7991. <h3 class="section">8.101 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>
  7992. <p>Boost or cut treble (upper) frequencies of the audio using a two-pole
  7993. shelving filter with a response similar to that of a standard
  7994. hi-fi&rsquo;s tone-controls. This is also known as shelving equalisation (EQ).
  7995. </p>
  7996. <p>The filter accepts the following options:
  7997. </p>
  7998. <dl compact="compact">
  7999. <dt><samp>gain, g</samp></dt>
  8000. <dd><p>Give the gain at whichever is the lower of ~22 kHz and the
  8001. Nyquist frequency. Its useful range is about -20 (for a large cut)
  8002. to +20 (for a large boost). Beware of clipping when using a positive gain.
  8003. </p>
  8004. </dd>
  8005. <dt><samp>frequency, f</samp></dt>
  8006. <dd><p>Set the filter&rsquo;s central frequency and so can be used
  8007. to extend or reduce the frequency range to be boosted or cut.
  8008. The default value is <code>3000</code> Hz.
  8009. </p>
  8010. </dd>
  8011. <dt><samp>width_type, t</samp></dt>
  8012. <dd><p>Set method to specify band-width of filter.
  8013. </p><dl compact="compact">
  8014. <dt><samp>h</samp></dt>
  8015. <dd><p>Hz
  8016. </p></dd>
  8017. <dt><samp>q</samp></dt>
  8018. <dd><p>Q-Factor
  8019. </p></dd>
  8020. <dt><samp>o</samp></dt>
  8021. <dd><p>octave
  8022. </p></dd>
  8023. <dt><samp>s</samp></dt>
  8024. <dd><p>slope
  8025. </p></dd>
  8026. <dt><samp>k</samp></dt>
  8027. <dd><p>kHz
  8028. </p></dd>
  8029. </dl>
  8030. </dd>
  8031. <dt><samp>width, w</samp></dt>
  8032. <dd><p>Determine how steep is the filter&rsquo;s shelf transition.
  8033. </p>
  8034. </dd>
  8035. <dt><samp>poles, p</samp></dt>
  8036. <dd><p>Set number of poles. Default is 2.
  8037. </p>
  8038. </dd>
  8039. <dt><samp>mix, m</samp></dt>
  8040. <dd><p>How much to use filtered signal in output. Default is 1.
  8041. Range is between 0 and 1.
  8042. </p>
  8043. </dd>
  8044. <dt><samp>channels, c</samp></dt>
  8045. <dd><p>Specify which channels to filter, by default all available are filtered.
  8046. </p>
  8047. </dd>
  8048. <dt><samp>normalize, n</samp></dt>
  8049. <dd><p>Normalize biquad coefficients, by default is disabled.
  8050. Enabling it will normalize magnitude response at DC to 0dB.
  8051. </p>
  8052. </dd>
  8053. <dt><samp>transform, a</samp></dt>
  8054. <dd><p>Set transform type of IIR filter.
  8055. </p><dl compact="compact">
  8056. <dt><samp>di</samp></dt>
  8057. <dt><samp>dii</samp></dt>
  8058. <dt><samp>tdii</samp></dt>
  8059. <dt><samp>latt</samp></dt>
  8060. </dl>
  8061. </dd>
  8062. <dt><samp>precision, r</samp></dt>
  8063. <dd><p>Set precison of filtering.
  8064. </p><dl compact="compact">
  8065. <dt><samp>auto</samp></dt>
  8066. <dd><p>Pick automatic sample format depending on surround filters.
  8067. </p></dd>
  8068. <dt><samp>s16</samp></dt>
  8069. <dd><p>Always use signed 16-bit.
  8070. </p></dd>
  8071. <dt><samp>s32</samp></dt>
  8072. <dd><p>Always use signed 32-bit.
  8073. </p></dd>
  8074. <dt><samp>f32</samp></dt>
  8075. <dd><p>Always use float 32-bit.
  8076. </p></dd>
  8077. <dt><samp>f64</samp></dt>
  8078. <dd><p>Always use float 64-bit.
  8079. </p></dd>
  8080. </dl>
  8081. </dd>
  8082. </dl>
  8083. <a name="Commands-41"></a>
  8084. <h4 class="subsection">8.101.1 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>
  8085. <p>This filter supports the following commands:
  8086. </p><dl compact="compact">
  8087. <dt><samp>frequency, f</samp></dt>
  8088. <dd><p>Change treble frequency.
  8089. Syntax for the command is : &quot;<var>frequency</var>&quot;
  8090. </p>
  8091. </dd>
  8092. <dt><samp>width_type, t</samp></dt>
  8093. <dd><p>Change treble width_type.
  8094. Syntax for the command is : &quot;<var>width_type</var>&quot;
  8095. </p>
  8096. </dd>
  8097. <dt><samp>width, w</samp></dt>
  8098. <dd><p>Change treble width.
  8099. Syntax for the command is : &quot;<var>width</var>&quot;
  8100. </p>
  8101. </dd>
  8102. <dt><samp>gain, g</samp></dt>
  8103. <dd><p>Change treble gain.
  8104. Syntax for the command is : &quot;<var>gain</var>&quot;
  8105. </p>
  8106. </dd>
  8107. <dt><samp>mix, m</samp></dt>
  8108. <dd><p>Change treble mix.
  8109. Syntax for the command is : &quot;<var>mix</var>&quot;
  8110. </p></dd>
  8111. </dl>
  8112. <a name="tremolo"></a>
  8113. <h3 class="section">8.102 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>
  8114. <p>Sinusoidal amplitude modulation.
  8115. </p>
  8116. <p>The filter accepts the following options:
  8117. </p>
  8118. <dl compact="compact">
  8119. <dt><samp>f</samp></dt>
  8120. <dd><p>Modulation frequency in Hertz. Modulation frequencies in the subharmonic range
  8121. (20 Hz or lower) will result in a tremolo effect.
  8122. This filter may also be used as a ring modulator by specifying
  8123. a modulation frequency higher than 20 Hz.
  8124. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  8125. </p>
  8126. </dd>
  8127. <dt><samp>d</samp></dt>
  8128. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  8129. Default value is 0.5.
  8130. </p></dd>
  8131. </dl>
  8132. <a name="vibrato"></a>
  8133. <h3 class="section">8.103 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>
  8134. <p>Sinusoidal phase modulation.
  8135. </p>
  8136. <p>The filter accepts the following options:
  8137. </p>
  8138. <dl compact="compact">
  8139. <dt><samp>f</samp></dt>
  8140. <dd><p>Modulation frequency in Hertz.
  8141. Range is 0.1 - 20000.0. Default value is 5.0 Hz.
  8142. </p>
  8143. </dd>
  8144. <dt><samp>d</samp></dt>
  8145. <dd><p>Depth of modulation as a percentage. Range is 0.0 - 1.0.
  8146. Default value is 0.5.
  8147. </p></dd>
  8148. </dl>
  8149. <a name="volume"></a>
  8150. <h3 class="section">8.104 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>
  8151. <p>Adjust the input audio volume.
  8152. </p>
  8153. <p>It accepts the following parameters:
  8154. </p><dl compact="compact">
  8155. <dt><samp>volume</samp></dt>
  8156. <dd><p>Set audio volume expression.
  8157. </p>
  8158. <p>Output values are clipped to the maximum value.
  8159. </p>
  8160. <p>The output audio volume is given by the relation:
  8161. </p><div class="example">
  8162. <pre class="example"><var>output_volume</var> = <var>volume</var> * <var>input_volume</var>
  8163. </pre></div>
  8164. <p>The default value for <var>volume</var> is &quot;1.0&quot;.
  8165. </p>
  8166. </dd>
  8167. <dt><samp>precision</samp></dt>
  8168. <dd><p>This parameter represents the mathematical precision.
  8169. </p>
  8170. <p>It determines which input sample formats will be allowed, which affects the
  8171. precision of the volume scaling.
  8172. </p>
  8173. <dl compact="compact">
  8174. <dt><samp>fixed</samp></dt>
  8175. <dd><p>8-bit fixed-point; this limits input sample format to U8, S16, and S32.
  8176. </p></dd>
  8177. <dt><samp>float</samp></dt>
  8178. <dd><p>32-bit floating-point; this limits input sample format to FLT. (default)
  8179. </p></dd>
  8180. <dt><samp>double</samp></dt>
  8181. <dd><p>64-bit floating-point; this limits input sample format to DBL.
  8182. </p></dd>
  8183. </dl>
  8184. </dd>
  8185. <dt><samp>replaygain</samp></dt>
  8186. <dd><p>Choose the behaviour on encountering ReplayGain side data in input frames.
  8187. </p>
  8188. <dl compact="compact">
  8189. <dt><samp>drop</samp></dt>
  8190. <dd><p>Remove ReplayGain side data, ignoring its contents (the default).
  8191. </p>
  8192. </dd>
  8193. <dt><samp>ignore</samp></dt>
  8194. <dd><p>Ignore ReplayGain side data, but leave it in the frame.
  8195. </p>
  8196. </dd>
  8197. <dt><samp>track</samp></dt>
  8198. <dd><p>Prefer the track gain, if present.
  8199. </p>
  8200. </dd>
  8201. <dt><samp>album</samp></dt>
  8202. <dd><p>Prefer the album gain, if present.
  8203. </p></dd>
  8204. </dl>
  8205. </dd>
  8206. <dt><samp>replaygain_preamp</samp></dt>
  8207. <dd><p>Pre-amplification gain in dB to apply to the selected replaygain gain.
  8208. </p>
  8209. <p>Default value for <var>replaygain_preamp</var> is 0.0.
  8210. </p>
  8211. </dd>
  8212. <dt><samp>replaygain_noclip</samp></dt>
  8213. <dd><p>Prevent clipping by limiting the gain applied.
  8214. </p>
  8215. <p>Default value for <var>replaygain_noclip</var> is 1.
  8216. </p>
  8217. </dd>
  8218. <dt><samp>eval</samp></dt>
  8219. <dd><p>Set when the volume expression is evaluated.
  8220. </p>
  8221. <p>It accepts the following values:
  8222. </p><dl compact="compact">
  8223. <dt>&lsquo;<samp>once</samp>&rsquo;</dt>
  8224. <dd><p>only evaluate expression once during the filter initialization, or
  8225. when the &lsquo;<samp>volume</samp>&rsquo; command is sent
  8226. </p>
  8227. </dd>
  8228. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  8229. <dd><p>evaluate expression for each incoming frame
  8230. </p></dd>
  8231. </dl>
  8232. <p>Default value is &lsquo;<samp>once</samp>&rsquo;.
  8233. </p></dd>
  8234. </dl>
  8235. <p>The volume expression can contain the following parameters.
  8236. </p>
  8237. <dl compact="compact">
  8238. <dt><samp>n</samp></dt>
  8239. <dd><p>frame number (starting at zero)
  8240. </p></dd>
  8241. <dt><samp>nb_channels</samp></dt>
  8242. <dd><p>number of channels
  8243. </p></dd>
  8244. <dt><samp>nb_consumed_samples</samp></dt>
  8245. <dd><p>number of samples consumed by the filter
  8246. </p></dd>
  8247. <dt><samp>nb_samples</samp></dt>
  8248. <dd><p>number of samples in the current frame
  8249. </p></dd>
  8250. <dt><samp>pos</samp></dt>
  8251. <dd><p>original frame position in the file
  8252. </p></dd>
  8253. <dt><samp>pts</samp></dt>
  8254. <dd><p>frame PTS
  8255. </p></dd>
  8256. <dt><samp>sample_rate</samp></dt>
  8257. <dd><p>sample rate
  8258. </p></dd>
  8259. <dt><samp>startpts</samp></dt>
  8260. <dd><p>PTS at start of stream
  8261. </p></dd>
  8262. <dt><samp>startt</samp></dt>
  8263. <dd><p>time at start of stream
  8264. </p></dd>
  8265. <dt><samp>t</samp></dt>
  8266. <dd><p>frame time
  8267. </p></dd>
  8268. <dt><samp>tb</samp></dt>
  8269. <dd><p>timestamp timebase
  8270. </p></dd>
  8271. <dt><samp>volume</samp></dt>
  8272. <dd><p>last set volume value
  8273. </p></dd>
  8274. </dl>
  8275. <p>Note that when <samp>eval</samp> is set to &lsquo;<samp>once</samp>&rsquo; only the
  8276. <var>sample_rate</var> and <var>tb</var> variables are available, all other
  8277. variables will evaluate to NAN.
  8278. </p>
  8279. <a name="Commands-42"></a>
  8280. <h4 class="subsection">8.104.1 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>
  8281. <p>This filter supports the following commands:
  8282. </p><dl compact="compact">
  8283. <dt><samp>volume</samp></dt>
  8284. <dd><p>Modify the volume expression.
  8285. The command accepts the same syntax of the corresponding option.
  8286. </p>
  8287. <p>If the specified expression is not valid, it is kept at its current
  8288. value.
  8289. </p></dd>
  8290. </dl>
  8291. <a name="Examples-32"></a>
  8292. <h4 class="subsection">8.104.2 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>
  8293. <ul>
  8294. <li> Halve the input audio volume:
  8295. <div class="example">
  8296. <pre class="example">volume=volume=0.5
  8297. volume=volume=1/2
  8298. volume=volume=-6.0206dB
  8299. </pre></div>
  8300. <p>In all the above example the named key for <samp>volume</samp> can be
  8301. omitted, for example like in:
  8302. </p><div class="example">
  8303. <pre class="example">volume=0.5
  8304. </pre></div>
  8305. </li><li> Increase input audio power by 6 decibels using fixed-point precision:
  8306. <div class="example">
  8307. <pre class="example">volume=volume=6dB:precision=fixed
  8308. </pre></div>
  8309. </li><li> Fade volume after time 10 with an annihilation period of 5 seconds:
  8310. <div class="example">
  8311. <pre class="example">volume='if(lt(t,10),1,max(1-(t-10)/5,0))':eval=frame
  8312. </pre></div>
  8313. </li></ul>
  8314. <a name="volumedetect"></a>
  8315. <h3 class="section">8.105 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>
  8316. <p>Detect the volume of the input video.
  8317. </p>
  8318. <p>The filter has no parameters. The input is not modified. Statistics about
  8319. the volume will be printed in the log when the input stream end is reached.
  8320. </p>
  8321. <p>In particular it will show the mean volume (root mean square), maximum
  8322. volume (on a per-sample basis), and the beginning of a histogram of the
  8323. registered volume values (from the maximum value to a cumulated 1/1000 of
  8324. the samples).
  8325. </p>
  8326. <p>All volumes are in decibels relative to the maximum PCM value.
  8327. </p>
  8328. <a name="Examples-33"></a>
  8329. <h4 class="subsection">8.105.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>
  8330. <p>Here is an excerpt of the output:
  8331. </p><div class="example">
  8332. <pre class="example">[Parsed_volumedetect_0 &nbsp;0xa23120] mean_volume: -27 dB
  8333. [Parsed_volumedetect_0 &nbsp;0xa23120] max_volume: -4 dB
  8334. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_4db: 6
  8335. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_5db: 62
  8336. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_6db: 286
  8337. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_7db: 1042
  8338. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_8db: 2551
  8339. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_9db: 4609
  8340. [Parsed_volumedetect_0 &nbsp;0xa23120] histogram_10db: 8409
  8341. </pre></div>
  8342. <p>It means that:
  8343. </p><ul>
  8344. <li> The mean square energy is approximately -27 dB, or 10^-2.7.
  8345. </li><li> The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
  8346. </li><li> There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
  8347. </li></ul>
  8348. <p>In other words, raising the volume by +4 dB does not cause any clipping,
  8349. raising it by +5 dB causes clipping for 6 samples, etc.
  8350. </p>
  8351. <a name="Audio-Sources"></a>
  8352. <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>
  8353. <p>Below is a description of the currently available audio sources.
  8354. </p>
  8355. <a name="abuffer"></a>
  8356. <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>
  8357. <p>Buffer audio frames, and make them available to the filter chain.
  8358. </p>
  8359. <p>This source is mainly intended for a programmatic use, in particular
  8360. through the interface defined in <samp>libavfilter/buffersrc.h</samp>.
  8361. </p>
  8362. <p>It accepts the following parameters:
  8363. </p><dl compact="compact">
  8364. <dt><samp>time_base</samp></dt>
  8365. <dd><p>The timebase which will be used for timestamps of submitted frames. It must be
  8366. either a floating-point number or in <var>numerator</var>/<var>denominator</var> form.
  8367. </p>
  8368. </dd>
  8369. <dt><samp>sample_rate</samp></dt>
  8370. <dd><p>The sample rate of the incoming audio buffers.
  8371. </p>
  8372. </dd>
  8373. <dt><samp>sample_fmt</samp></dt>
  8374. <dd><p>The sample format of the incoming audio buffers.
  8375. Either a sample format name or its corresponding integer representation from
  8376. the enum AVSampleFormat in <samp>libavutil/samplefmt.h</samp>
  8377. </p>
  8378. </dd>
  8379. <dt><samp>channel_layout</samp></dt>
  8380. <dd><p>The channel layout of the incoming audio buffers.
  8381. Either a channel layout name from channel_layout_map in
  8382. <samp>libavutil/channel_layout.c</samp> or its corresponding integer representation
  8383. from the AV_CH_LAYOUT_* macros in <samp>libavutil/channel_layout.h</samp>
  8384. </p>
  8385. </dd>
  8386. <dt><samp>channels</samp></dt>
  8387. <dd><p>The number of channels of the incoming audio buffers.
  8388. If both <var>channels</var> and <var>channel_layout</var> are specified, then they
  8389. must be consistent.
  8390. </p>
  8391. </dd>
  8392. </dl>
  8393. <a name="Examples-34"></a>
  8394. <h4 class="subsection">9.1.1 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>
  8395. <div class="example">
  8396. <pre class="example">abuffer=sample_rate=44100:sample_fmt=s16p:channel_layout=stereo
  8397. </pre></div>
  8398. <p>will instruct the source to accept planar 16bit signed stereo at 44100Hz.
  8399. Since the sample format with name &quot;s16p&quot; corresponds to the number
  8400. 6 and the &quot;stereo&quot; channel layout corresponds to the value 0x3, this is
  8401. equivalent to:
  8402. </p><div class="example">
  8403. <pre class="example">abuffer=sample_rate=44100:sample_fmt=6:channel_layout=0x3
  8404. </pre></div>
  8405. <a name="aevalsrc"></a>
  8406. <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>
  8407. <p>Generate an audio signal specified by an expression.
  8408. </p>
  8409. <p>This source accepts in input one or more expressions (one for each
  8410. channel), which are evaluated and used to generate a corresponding
  8411. audio signal.
  8412. </p>
  8413. <p>This source accepts the following options:
  8414. </p>
  8415. <dl compact="compact">
  8416. <dt><samp>exprs</samp></dt>
  8417. <dd><p>Set the &rsquo;|&rsquo;-separated expressions list for each separate channel. In case the
  8418. <samp>channel_layout</samp> option is not specified, the selected channel layout
  8419. depends on the number of provided expressions. Otherwise the last
  8420. specified expression is applied to the remaining output channels.
  8421. </p>
  8422. </dd>
  8423. <dt><samp>channel_layout, c</samp></dt>
  8424. <dd><p>Set the channel layout. The number of channels in the specified layout
  8425. must be equal to the number of specified expressions.
  8426. </p>
  8427. </dd>
  8428. <dt><samp>duration, d</samp></dt>
  8429. <dd><p>Set the minimum duration of the sourced audio. See
  8430. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  8431. for the accepted syntax.
  8432. Note that the resulting duration may be greater than the specified
  8433. duration, as the generated audio is always cut at the end of a
  8434. complete frame.
  8435. </p>
  8436. <p>If not specified, or the expressed duration is negative, the audio is
  8437. supposed to be generated forever.
  8438. </p>
  8439. </dd>
  8440. <dt><samp>nb_samples, n</samp></dt>
  8441. <dd><p>Set the number of samples per channel per each output frame,
  8442. default to 1024.
  8443. </p>
  8444. </dd>
  8445. <dt><samp>sample_rate, s</samp></dt>
  8446. <dd><p>Specify the sample rate, default to 44100.
  8447. </p></dd>
  8448. </dl>
  8449. <p>Each expression in <var>exprs</var> can contain the following constants:
  8450. </p>
  8451. <dl compact="compact">
  8452. <dt><samp>n</samp></dt>
  8453. <dd><p>number of the evaluated sample, starting from 0
  8454. </p>
  8455. </dd>
  8456. <dt><samp>t</samp></dt>
  8457. <dd><p>time of the evaluated sample expressed in seconds, starting from 0
  8458. </p>
  8459. </dd>
  8460. <dt><samp>s</samp></dt>
  8461. <dd><p>sample rate
  8462. </p>
  8463. </dd>
  8464. </dl>
  8465. <a name="Examples-35"></a>
  8466. <h4 class="subsection">9.2.1 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>
  8467. <ul>
  8468. <li> Generate silence:
  8469. <div class="example">
  8470. <pre class="example">aevalsrc=0
  8471. </pre></div>
  8472. </li><li> Generate a sin signal with frequency of 440 Hz, set sample rate to
  8473. 8000 Hz:
  8474. <div class="example">
  8475. <pre class="example">aevalsrc=&quot;sin(440*2*PI*t):s=8000&quot;
  8476. </pre></div>
  8477. </li><li> Generate a two channels signal, specify the channel layout (Front
  8478. Center + Back Center) explicitly:
  8479. <div class="example">
  8480. <pre class="example">aevalsrc=&quot;sin(420*2*PI*t)|cos(430*2*PI*t):c=FC|BC&quot;
  8481. </pre></div>
  8482. </li><li> Generate white noise:
  8483. <div class="example">
  8484. <pre class="example">aevalsrc=&quot;-2+random(0)&quot;
  8485. </pre></div>
  8486. </li><li> Generate an amplitude modulated signal:
  8487. <div class="example">
  8488. <pre class="example">aevalsrc=&quot;sin(10*2*PI*t)*sin(880*2*PI*t)&quot;
  8489. </pre></div>
  8490. </li><li> Generate 2.5 Hz binaural beats on a 360 Hz carrier:
  8491. <div class="example">
  8492. <pre class="example">aevalsrc=&quot;0.1*sin(2*PI*(360-2.5/2)*t) | 0.1*sin(2*PI*(360+2.5/2)*t)&quot;
  8493. </pre></div>
  8494. </li></ul>
  8495. <a name="afirsrc"></a>
  8496. <h3 class="section">9.3 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>
  8497. <p>Generate a FIR coefficients using frequency sampling method.
  8498. </p>
  8499. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  8500. </p>
  8501. <p>The filter accepts the following options:
  8502. </p>
  8503. <dl compact="compact">
  8504. <dt><samp>taps, t</samp></dt>
  8505. <dd><p>Set number of filter coefficents in output audio stream.
  8506. Default value is 1025.
  8507. </p>
  8508. </dd>
  8509. <dt><samp>frequency, f</samp></dt>
  8510. <dd><p>Set frequency points from where magnitude and phase are set.
  8511. This must be in non decreasing order, and first element must be 0, while last element
  8512. must be 1. Elements are separated by white spaces.
  8513. </p>
  8514. </dd>
  8515. <dt><samp>magnitude, m</samp></dt>
  8516. <dd><p>Set magnitude value for every frequency point set by <samp>frequency</samp>.
  8517. Number of values must be same as number of frequency points.
  8518. Values are separated by white spaces.
  8519. </p>
  8520. </dd>
  8521. <dt><samp>phase, p</samp></dt>
  8522. <dd><p>Set phase value for every frequency point set by <samp>frequency</samp>.
  8523. Number of values must be same as number of frequency points.
  8524. Values are separated by white spaces.
  8525. </p>
  8526. </dd>
  8527. <dt><samp>sample_rate, r</samp></dt>
  8528. <dd><p>Set sample rate, default is 44100.
  8529. </p>
  8530. </dd>
  8531. <dt><samp>nb_samples, n</samp></dt>
  8532. <dd><p>Set number of samples per each frame. Default is 1024.
  8533. </p>
  8534. </dd>
  8535. <dt><samp>win_func, w</samp></dt>
  8536. <dd><p>Set window function. Default is blackman.
  8537. </p></dd>
  8538. </dl>
  8539. <a name="anullsrc"></a>
  8540. <h3 class="section">9.4 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>
  8541. <p>The null audio source, return unprocessed audio frames. It is mainly useful
  8542. as a template and to be employed in analysis / debugging tools, or as
  8543. the source for filters which ignore the input data (for example the sox
  8544. synth filter).
  8545. </p>
  8546. <p>This source accepts the following options:
  8547. </p>
  8548. <dl compact="compact">
  8549. <dt><samp>channel_layout, cl</samp></dt>
  8550. <dd>
  8551. <p>Specifies the channel layout, and can be either an integer or a string
  8552. representing a channel layout. The default value of <var>channel_layout</var>
  8553. is &quot;stereo&quot;.
  8554. </p>
  8555. <p>Check the channel_layout_map definition in
  8556. <samp>libavutil/channel_layout.c</samp> for the mapping between strings and
  8557. channel layout values.
  8558. </p>
  8559. </dd>
  8560. <dt><samp>sample_rate, r</samp></dt>
  8561. <dd><p>Specifies the sample rate, and defaults to 44100.
  8562. </p>
  8563. </dd>
  8564. <dt><samp>nb_samples, n</samp></dt>
  8565. <dd><p>Set the number of samples per requested frames.
  8566. </p>
  8567. </dd>
  8568. <dt><samp>duration, d</samp></dt>
  8569. <dd><p>Set the duration of the sourced audio. See
  8570. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  8571. for the accepted syntax.
  8572. </p>
  8573. <p>If not specified, or the expressed duration is negative, the audio is
  8574. supposed to be generated forever.
  8575. </p></dd>
  8576. </dl>
  8577. <a name="Examples-36"></a>
  8578. <h4 class="subsection">9.4.1 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>
  8579. <ul>
  8580. <li> Set the sample rate to 48000 Hz and the channel layout to AV_CH_LAYOUT_MONO.
  8581. <div class="example">
  8582. <pre class="example">anullsrc=r=48000:cl=4
  8583. </pre></div>
  8584. </li><li> Do the same operation with a more obvious syntax:
  8585. <div class="example">
  8586. <pre class="example">anullsrc=r=48000:cl=mono
  8587. </pre></div>
  8588. </li></ul>
  8589. <p>All the parameters need to be explicitly defined.
  8590. </p>
  8591. <a name="flite"></a>
  8592. <h3 class="section">9.5 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>
  8593. <p>Synthesize a voice utterance using the libflite library.
  8594. </p>
  8595. <p>To enable compilation of this filter you need to configure FFmpeg with
  8596. <code>--enable-libflite</code>.
  8597. </p>
  8598. <p>Note that versions of the flite library prior to 2.0 are not thread-safe.
  8599. </p>
  8600. <p>The filter accepts the following options:
  8601. </p>
  8602. <dl compact="compact">
  8603. <dt><samp>list_voices</samp></dt>
  8604. <dd><p>If set to 1, list the names of the available voices and exit
  8605. immediately. Default value is 0.
  8606. </p>
  8607. </dd>
  8608. <dt><samp>nb_samples, n</samp></dt>
  8609. <dd><p>Set the maximum number of samples per frame. Default value is 512.
  8610. </p>
  8611. </dd>
  8612. <dt><samp>textfile</samp></dt>
  8613. <dd><p>Set the filename containing the text to speak.
  8614. </p>
  8615. </dd>
  8616. <dt><samp>text</samp></dt>
  8617. <dd><p>Set the text to speak.
  8618. </p>
  8619. </dd>
  8620. <dt><samp>voice, v</samp></dt>
  8621. <dd><p>Set the voice to use for the speech synthesis. Default value is
  8622. <code>kal</code>. See also the <var>list_voices</var> option.
  8623. </p></dd>
  8624. </dl>
  8625. <a name="Examples-37"></a>
  8626. <h4 class="subsection">9.5.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>
  8627. <ul>
  8628. <li> Read from file <samp>speech.txt</samp>, and synthesize the text using the
  8629. standard flite voice:
  8630. <div class="example">
  8631. <pre class="example">flite=textfile=speech.txt
  8632. </pre></div>
  8633. </li><li> Read the specified text selecting the <code>slt</code> voice:
  8634. <div class="example">
  8635. <pre class="example">flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  8636. </pre></div>
  8637. </li><li> Input text to ffmpeg:
  8638. <div class="example">
  8639. <pre class="example">ffmpeg -f lavfi -i flite=text='So fare thee well, poor devil of a Sub-Sub, whose commentator I am':voice=slt
  8640. </pre></div>
  8641. </li><li> Make <samp>ffplay</samp> speak the specified text, using <code>flite</code> and
  8642. the <code>lavfi</code> device:
  8643. <div class="example">
  8644. <pre class="example">ffplay -f lavfi flite=text='No more be grieved for which that thou hast done.'
  8645. </pre></div>
  8646. </li></ul>
  8647. <p>For more information about libflite, check:
  8648. <a href="http://www.festvox.org/flite/">http://www.festvox.org/flite/</a>
  8649. </p>
  8650. <a name="anoisesrc"></a>
  8651. <h3 class="section">9.6 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>
  8652. <p>Generate a noise audio signal.
  8653. </p>
  8654. <p>The filter accepts the following options:
  8655. </p>
  8656. <dl compact="compact">
  8657. <dt><samp>sample_rate, r</samp></dt>
  8658. <dd><p>Specify the sample rate. Default value is 48000 Hz.
  8659. </p>
  8660. </dd>
  8661. <dt><samp>amplitude, a</samp></dt>
  8662. <dd><p>Specify the amplitude (0.0 - 1.0) of the generated audio stream. Default value
  8663. is 1.0.
  8664. </p>
  8665. </dd>
  8666. <dt><samp>duration, d</samp></dt>
  8667. <dd><p>Specify the duration of the generated audio stream. Not specifying this option
  8668. results in noise with an infinite length.
  8669. </p>
  8670. </dd>
  8671. <dt><samp>color, colour, c</samp></dt>
  8672. <dd><p>Specify the color of noise. Available noise colors are white, pink, brown,
  8673. blue, violet and velvet. Default color is white.
  8674. </p>
  8675. </dd>
  8676. <dt><samp>seed, s</samp></dt>
  8677. <dd><p>Specify a value used to seed the PRNG.
  8678. </p>
  8679. </dd>
  8680. <dt><samp>nb_samples, n</samp></dt>
  8681. <dd><p>Set the number of samples per each output frame, default is 1024.
  8682. </p></dd>
  8683. </dl>
  8684. <a name="Examples-38"></a>
  8685. <h4 class="subsection">9.6.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>
  8686. <ul>
  8687. <li> Generate 60 seconds of pink noise, with a 44.1 kHz sampling rate and an amplitude of 0.5:
  8688. <div class="example">
  8689. <pre class="example">anoisesrc=d=60:c=pink:r=44100:a=0.5
  8690. </pre></div>
  8691. </li></ul>
  8692. <a name="hilbert"></a>
  8693. <h3 class="section">9.7 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>
  8694. <p>Generate odd-tap Hilbert transform FIR coefficients.
  8695. </p>
  8696. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for phase-shifting
  8697. the signal by 90 degrees.
  8698. </p>
  8699. <p>This is used in many matrix coding schemes and for analytic signal generation.
  8700. The process is often written as a multiplication by i (or j), the imaginary unit.
  8701. </p>
  8702. <p>The filter accepts the following options:
  8703. </p>
  8704. <dl compact="compact">
  8705. <dt><samp>sample_rate, s</samp></dt>
  8706. <dd><p>Set sample rate, default is 44100.
  8707. </p>
  8708. </dd>
  8709. <dt><samp>taps, t</samp></dt>
  8710. <dd><p>Set length of FIR filter, default is 22051.
  8711. </p>
  8712. </dd>
  8713. <dt><samp>nb_samples, n</samp></dt>
  8714. <dd><p>Set number of samples per each frame.
  8715. </p>
  8716. </dd>
  8717. <dt><samp>win_func, w</samp></dt>
  8718. <dd><p>Set window function to be used when generating FIR coefficients.
  8719. </p></dd>
  8720. </dl>
  8721. <a name="sinc"></a>
  8722. <h3 class="section">9.8 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>
  8723. <p>Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject FIR coefficients.
  8724. </p>
  8725. <p>The resulting stream can be used with <a href="#afir">afir</a> filter for filtering the audio signal.
  8726. </p>
  8727. <p>The filter accepts the following options:
  8728. </p>
  8729. <dl compact="compact">
  8730. <dt><samp>sample_rate, r</samp></dt>
  8731. <dd><p>Set sample rate, default is 44100.
  8732. </p>
  8733. </dd>
  8734. <dt><samp>nb_samples, n</samp></dt>
  8735. <dd><p>Set number of samples per each frame. Default is 1024.
  8736. </p>
  8737. </dd>
  8738. <dt><samp>hp</samp></dt>
  8739. <dd><p>Set high-pass frequency. Default is 0.
  8740. </p>
  8741. </dd>
  8742. <dt><samp>lp</samp></dt>
  8743. <dd><p>Set low-pass frequency. Default is 0.
  8744. If high-pass frequency is lower than low-pass frequency and low-pass frequency
  8745. is higher than 0 then filter will create band-pass filter coefficients,
  8746. otherwise band-reject filter coefficients.
  8747. </p>
  8748. </dd>
  8749. <dt><samp>phase</samp></dt>
  8750. <dd><p>Set filter phase response. Default is 50. Allowed range is from 0 to 100.
  8751. </p>
  8752. </dd>
  8753. <dt><samp>beta</samp></dt>
  8754. <dd><p>Set Kaiser window beta.
  8755. </p>
  8756. </dd>
  8757. <dt><samp>att</samp></dt>
  8758. <dd><p>Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 dB.
  8759. </p>
  8760. </dd>
  8761. <dt><samp>round</samp></dt>
  8762. <dd><p>Enable rounding, by default is disabled.
  8763. </p>
  8764. </dd>
  8765. <dt><samp>hptaps</samp></dt>
  8766. <dd><p>Set number of taps for high-pass filter.
  8767. </p>
  8768. </dd>
  8769. <dt><samp>lptaps</samp></dt>
  8770. <dd><p>Set number of taps for low-pass filter.
  8771. </p></dd>
  8772. </dl>
  8773. <a name="sine"></a>
  8774. <h3 class="section">9.9 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>
  8775. <p>Generate an audio signal made of a sine wave with amplitude 1/8.
  8776. </p>
  8777. <p>The audio signal is bit-exact.
  8778. </p>
  8779. <p>The filter accepts the following options:
  8780. </p>
  8781. <dl compact="compact">
  8782. <dt><samp>frequency, f</samp></dt>
  8783. <dd><p>Set the carrier frequency. Default is 440 Hz.
  8784. </p>
  8785. </dd>
  8786. <dt><samp>beep_factor, b</samp></dt>
  8787. <dd><p>Enable a periodic beep every second with frequency <var>beep_factor</var> times
  8788. the carrier frequency. Default is 0, meaning the beep is disabled.
  8789. </p>
  8790. </dd>
  8791. <dt><samp>sample_rate, r</samp></dt>
  8792. <dd><p>Specify the sample rate, default is 44100.
  8793. </p>
  8794. </dd>
  8795. <dt><samp>duration, d</samp></dt>
  8796. <dd><p>Specify the duration of the generated audio stream.
  8797. </p>
  8798. </dd>
  8799. <dt><samp>samples_per_frame</samp></dt>
  8800. <dd><p>Set the number of samples per output frame.
  8801. </p>
  8802. <p>The expression can contain the following constants:
  8803. </p>
  8804. <dl compact="compact">
  8805. <dt><samp>n</samp></dt>
  8806. <dd><p>The (sequential) number of the output audio frame, starting from 0.
  8807. </p>
  8808. </dd>
  8809. <dt><samp>pts</samp></dt>
  8810. <dd><p>The PTS (Presentation TimeStamp) of the output audio frame,
  8811. expressed in <var>TB</var> units.
  8812. </p>
  8813. </dd>
  8814. <dt><samp>t</samp></dt>
  8815. <dd><p>The PTS of the output audio frame, expressed in seconds.
  8816. </p>
  8817. </dd>
  8818. <dt><samp>TB</samp></dt>
  8819. <dd><p>The timebase of the output audio frames.
  8820. </p></dd>
  8821. </dl>
  8822. <p>Default is <code>1024</code>.
  8823. </p></dd>
  8824. </dl>
  8825. <a name="Examples-39"></a>
  8826. <h4 class="subsection">9.9.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>
  8827. <ul>
  8828. <li> Generate a simple 440 Hz sine wave:
  8829. <div class="example">
  8830. <pre class="example">sine
  8831. </pre></div>
  8832. </li><li> Generate a 220 Hz sine wave with a 880 Hz beep each second, for 5 seconds:
  8833. <div class="example">
  8834. <pre class="example">sine=220:4:d=5
  8835. sine=f=220:b=4:d=5
  8836. sine=frequency=220:beep_factor=4:duration=5
  8837. </pre></div>
  8838. </li><li> Generate a 1 kHz sine wave following <code>1602,1601,1602,1601,1602</code> NTSC
  8839. pattern:
  8840. <div class="example">
  8841. <pre class="example">sine=1000:samples_per_frame='st(0,mod(n,5)); 1602-not(not(eq(ld(0),1)+eq(ld(0),3)))'
  8842. </pre></div>
  8843. </li></ul>
  8844. <a name="Audio-Sinks"></a>
  8845. <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>
  8846. <p>Below is a description of the currently available audio sinks.
  8847. </p>
  8848. <a name="abuffersink"></a>
  8849. <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>
  8850. <p>Buffer audio frames, and make them available to the end of filter chain.
  8851. </p>
  8852. <p>This sink is mainly intended for programmatic use, in particular
  8853. through the interface defined in <samp>libavfilter/buffersink.h</samp>
  8854. or the options system.
  8855. </p>
  8856. <p>It accepts a pointer to an AVABufferSinkContext structure, which
  8857. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  8858. parameter to <code>avfilter_init_filter</code> for initialization.
  8859. </p><a name="anullsink"></a>
  8860. <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>
  8861. <p>Null audio sink; do absolutely nothing with the input audio. It is
  8862. mainly useful as a template and for use in analysis / debugging
  8863. tools.
  8864. </p>
  8865. <a name="Video-Filters"></a>
  8866. <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>
  8867. <p>When you configure your FFmpeg build, you can disable any of the
  8868. existing filters using <code>--disable-filters</code>.
  8869. The configure output will show the video filters included in your
  8870. build.
  8871. </p>
  8872. <p>Below is a description of the currently available video filters.
  8873. </p>
  8874. <a name="addroi"></a>
  8875. <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>
  8876. <p>Mark a region of interest in a video frame.
  8877. </p>
  8878. <p>The frame data is passed through unchanged, but metadata is attached
  8879. to the frame indicating regions of interest which can affect the
  8880. behaviour of later encoding. Multiple regions can be marked by
  8881. applying the filter multiple times.
  8882. </p>
  8883. <dl compact="compact">
  8884. <dt><samp>x</samp></dt>
  8885. <dd><p>Region distance in pixels from the left edge of the frame.
  8886. </p></dd>
  8887. <dt><samp>y</samp></dt>
  8888. <dd><p>Region distance in pixels from the top edge of the frame.
  8889. </p></dd>
  8890. <dt><samp>w</samp></dt>
  8891. <dd><p>Region width in pixels.
  8892. </p></dd>
  8893. <dt><samp>h</samp></dt>
  8894. <dd><p>Region height in pixels.
  8895. </p>
  8896. <p>The parameters <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are expressions,
  8897. and may contain the following variables:
  8898. </p><dl compact="compact">
  8899. <dt><samp>iw</samp></dt>
  8900. <dd><p>Width of the input frame.
  8901. </p></dd>
  8902. <dt><samp>ih</samp></dt>
  8903. <dd><p>Height of the input frame.
  8904. </p></dd>
  8905. </dl>
  8906. </dd>
  8907. <dt><samp>qoffset</samp></dt>
  8908. <dd><p>Quantisation offset to apply within the region.
  8909. </p>
  8910. <p>This must be a real value in the range -1 to +1. A value of zero
  8911. indicates no quality change. A negative value asks for better quality
  8912. (less quantisation), while a positive value asks for worse quality
  8913. (greater quantisation).
  8914. </p>
  8915. <p>The range is calibrated so that the extreme values indicate the
  8916. largest possible offset - if the rest of the frame is encoded with the
  8917. worst possible quality, an offset of -1 indicates that this region
  8918. should be encoded with the best possible quality anyway. Intermediate
  8919. values are then interpolated in some codec-dependent way.
  8920. </p>
  8921. <p>For example, in 10-bit H.264 the quantisation parameter varies between
  8922. -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  8923. this region should be encoded with a QP around one-tenth of the full
  8924. range better than the rest of the frame. So, if most of the frame
  8925. were to be encoded with a QP of around 30, this region would get a QP
  8926. of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  8927. An extreme value of -1 would indicate that this region should be
  8928. encoded with the best possible quality regardless of the treatment of
  8929. the rest of the frame - that is, should be encoded at a QP of -12.
  8930. </p></dd>
  8931. <dt><samp>clear</samp></dt>
  8932. <dd><p>If set to true, remove any existing regions of interest marked on the
  8933. frame before adding the new one.
  8934. </p></dd>
  8935. </dl>
  8936. <a name="Examples-40"></a>
  8937. <h4 class="subsection">11.1.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>
  8938. <ul>
  8939. <li> Mark the centre quarter of the frame as interesting.
  8940. <div class="example">
  8941. <pre class="example">addroi=iw/4:ih/4:iw/2:ih/2:-1/10
  8942. </pre></div>
  8943. </li><li> Mark the 100-pixel-wide region on the left edge of the frame as very
  8944. uninteresting (to be encoded at much lower quality than the rest of
  8945. the frame).
  8946. <div class="example">
  8947. <pre class="example">addroi=0:0:100:ih:+1/5
  8948. </pre></div>
  8949. </li></ul>
  8950. <a name="alphaextract"></a>
  8951. <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>
  8952. <p>Extract the alpha component from the input as a grayscale video. This
  8953. is especially useful with the <var>alphamerge</var> filter.
  8954. </p>
  8955. <a name="alphamerge"></a>
  8956. <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>
  8957. <p>Add or replace the alpha component of the primary input with the
  8958. grayscale value of a second input. This is intended for use with
  8959. <var>alphaextract</var> to allow the transmission or storage of frame
  8960. sequences that have alpha in a format that doesn&rsquo;t support an alpha
  8961. channel.
  8962. </p>
  8963. <p>For example, to reconstruct full frames from a normal YUV-encoded video
  8964. and a separate video created with <var>alphaextract</var>, you might use:
  8965. </p><div class="example">
  8966. <pre class="example">movie=in_alpha.mkv [alpha]; [in][alpha] alphamerge [out]
  8967. </pre></div>
  8968. <a name="amplify"></a>
  8969. <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>
  8970. <p>Amplify differences between current pixel and pixels of adjacent frames in
  8971. same pixel location.
  8972. </p>
  8973. <p>This filter accepts the following options:
  8974. </p>
  8975. <dl compact="compact">
  8976. <dt><samp>radius</samp></dt>
  8977. <dd><p>Set frame radius. Default is 2. Allowed range is from 1 to 63.
  8978. For example radius of 3 will instruct filter to calculate average of 7 frames.
  8979. </p>
  8980. </dd>
  8981. <dt><samp>factor</samp></dt>
  8982. <dd><p>Set factor to amplify difference. Default is 2. Allowed range is from 0 to 65535.
  8983. </p>
  8984. </dd>
  8985. <dt><samp>threshold</samp></dt>
  8986. <dd><p>Set threshold for difference amplification. Any difference greater or equal to
  8987. this value will not alter source pixel. Default is 10.
  8988. Allowed range is from 0 to 65535.
  8989. </p>
  8990. </dd>
  8991. <dt><samp>tolerance</samp></dt>
  8992. <dd><p>Set tolerance for difference amplification. Any difference lower to
  8993. this value will not alter source pixel. Default is 0.
  8994. Allowed range is from 0 to 65535.
  8995. </p>
  8996. </dd>
  8997. <dt><samp>low</samp></dt>
  8998. <dd><p>Set lower limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  8999. This option controls maximum possible value that will decrease source pixel value.
  9000. </p>
  9001. </dd>
  9002. <dt><samp>high</samp></dt>
  9003. <dd><p>Set high limit for changing source pixel. Default is 65535. Allowed range is from 0 to 65535.
  9004. This option controls maximum possible value that will increase source pixel value.
  9005. </p>
  9006. </dd>
  9007. <dt><samp>planes</samp></dt>
  9008. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  9009. </p></dd>
  9010. </dl>
  9011. <a name="Commands-43"></a>
  9012. <h4 class="subsection">11.4.1 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>
  9013. <p>This filter supports the following <a href="#commands">commands</a> that corresponds to option of same name:
  9014. </p><dl compact="compact">
  9015. <dt><samp>factor</samp></dt>
  9016. <dt><samp>threshold</samp></dt>
  9017. <dt><samp>tolerance</samp></dt>
  9018. <dt><samp>low</samp></dt>
  9019. <dt><samp>high</samp></dt>
  9020. <dt><samp>planes</samp></dt>
  9021. </dl>
  9022. <a name="ass"></a>
  9023. <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>
  9024. <p>Same as the <a href="#subtitles">subtitles</a> filter, except that it doesn&rsquo;t require libavcodec
  9025. and libavformat to work. On the other hand, it is limited to ASS (Advanced
  9026. Substation Alpha) subtitles files.
  9027. </p>
  9028. <p>This filter accepts the following option in addition to the common options from
  9029. the <a href="#subtitles">subtitles</a> filter:
  9030. </p>
  9031. <dl compact="compact">
  9032. <dt><samp>shaping</samp></dt>
  9033. <dd><p>Set the shaping engine
  9034. </p>
  9035. <p>Available values are:
  9036. </p><dl compact="compact">
  9037. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  9038. <dd><p>The default libass shaping engine, which is the best available.
  9039. </p></dd>
  9040. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  9041. <dd><p>Fast, font-agnostic shaper that can do only substitutions
  9042. </p></dd>
  9043. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  9044. <dd><p>Slower shaper using OpenType for substitutions and positioning
  9045. </p></dd>
  9046. </dl>
  9047. <p>The default is <code>auto</code>.
  9048. </p></dd>
  9049. </dl>
  9050. <a name="atadenoise"></a>
  9051. <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>
  9052. <p>Apply an Adaptive Temporal Averaging Denoiser to the video input.
  9053. </p>
  9054. <p>The filter accepts the following options:
  9055. </p>
  9056. <dl compact="compact">
  9057. <dt><samp>0a</samp></dt>
  9058. <dd><p>Set threshold A for 1st plane. Default is 0.02.
  9059. Valid range is 0 to 0.3.
  9060. </p>
  9061. </dd>
  9062. <dt><samp>0b</samp></dt>
  9063. <dd><p>Set threshold B for 1st plane. Default is 0.04.
  9064. Valid range is 0 to 5.
  9065. </p>
  9066. </dd>
  9067. <dt><samp>1a</samp></dt>
  9068. <dd><p>Set threshold A for 2nd plane. Default is 0.02.
  9069. Valid range is 0 to 0.3.
  9070. </p>
  9071. </dd>
  9072. <dt><samp>1b</samp></dt>
  9073. <dd><p>Set threshold B for 2nd plane. Default is 0.04.
  9074. Valid range is 0 to 5.
  9075. </p>
  9076. </dd>
  9077. <dt><samp>2a</samp></dt>
  9078. <dd><p>Set threshold A for 3rd plane. Default is 0.02.
  9079. Valid range is 0 to 0.3.
  9080. </p>
  9081. </dd>
  9082. <dt><samp>2b</samp></dt>
  9083. <dd><p>Set threshold B for 3rd plane. Default is 0.04.
  9084. Valid range is 0 to 5.
  9085. </p>
  9086. <p>Threshold A is designed to react on abrupt changes in the input signal and
  9087. threshold B is designed to react on continuous changes in the input signal.
  9088. </p>
  9089. </dd>
  9090. <dt><samp>s</samp></dt>
  9091. <dd><p>Set number of frames filter will use for averaging. Default is 9. Must be odd
  9092. number in range [5, 129].
  9093. </p>
  9094. </dd>
  9095. <dt><samp>p</samp></dt>
  9096. <dd><p>Set what planes of frame filter will use for averaging. Default is all.
  9097. </p>
  9098. </dd>
  9099. <dt><samp>a</samp></dt>
  9100. <dd><p>Set what variant of algorithm filter will use for averaging. Default is <code>p</code> parallel.
  9101. Alternatively can be set to <code>s</code> serial.
  9102. </p>
  9103. <p>Parallel can be faster then serial, while other way around is never true.
  9104. Parallel will abort early on first change being greater then thresholds, while serial
  9105. will continue processing other side of frames if they are equal or below thresholds.
  9106. </p>
  9107. </dd>
  9108. <dt><samp>0s</samp></dt>
  9109. <dt><samp>1s</samp></dt>
  9110. <dt><samp>2s</samp></dt>
  9111. <dd><p>Set sigma for 1st plane, 2nd plane or 3rd plane. Default is 32767.
  9112. Valid range is from 0 to 32767.
  9113. This options controls weight for each pixel in radius defined by size.
  9114. Default value means every pixel have same weight.
  9115. Setting this option to 0 effectively disables filtering.
  9116. </p></dd>
  9117. </dl>
  9118. <a name="Commands-44"></a>
  9119. <h4 class="subsection">11.6.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>
  9120. <p>This filter supports same <a href="#commands">commands</a> as options except option <code>s</code>.
  9121. The command accepts the same syntax of the corresponding option.
  9122. </p>
  9123. <a name="avgblur"></a>
  9124. <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>
  9125. <p>Apply average blur filter.
  9126. </p>
  9127. <p>The filter accepts the following options:
  9128. </p>
  9129. <dl compact="compact">
  9130. <dt><samp>sizeX</samp></dt>
  9131. <dd><p>Set horizontal radius size.
  9132. </p>
  9133. </dd>
  9134. <dt><samp>planes</samp></dt>
  9135. <dd><p>Set which planes to filter. By default all planes are filtered.
  9136. </p>
  9137. </dd>
  9138. <dt><samp>sizeY</samp></dt>
  9139. <dd><p>Set vertical radius size, if zero it will be same as <code>sizeX</code>.
  9140. Default is <code>0</code>.
  9141. </p></dd>
  9142. </dl>
  9143. <a name="Commands-45"></a>
  9144. <h4 class="subsection">11.7.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>
  9145. <p>This filter supports same commands as options.
  9146. The command accepts the same syntax of the corresponding option.
  9147. </p>
  9148. <p>If the specified expression is not valid, it is kept at its current
  9149. value.
  9150. </p>
  9151. <a name="bbox"></a>
  9152. <h3 class="section">11.8 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>
  9153. <p>Compute the bounding box for the non-black pixels in the input frame
  9154. luminance plane.
  9155. </p>
  9156. <p>This filter computes the bounding box containing all the pixels with a
  9157. luminance value greater than the minimum allowed value.
  9158. The parameters describing the bounding box are printed on the filter
  9159. log.
  9160. </p>
  9161. <p>The filter accepts the following option:
  9162. </p>
  9163. <dl compact="compact">
  9164. <dt><samp>min_val</samp></dt>
  9165. <dd><p>Set the minimal luminance value. Default is <code>16</code>.
  9166. </p></dd>
  9167. </dl>
  9168. <a name="Commands-46"></a>
  9169. <h4 class="subsection">11.8.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>
  9170. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9171. </p>
  9172. <a name="bilateral"></a>
  9173. <h3 class="section">11.9 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>
  9174. <p>Apply bilateral filter, spatial smoothing while preserving edges.
  9175. </p>
  9176. <p>The filter accepts the following options:
  9177. </p><dl compact="compact">
  9178. <dt><samp>sigmaS</samp></dt>
  9179. <dd><p>Set sigma of gaussian function to calculate spatial weight.
  9180. Allowed range is 0 to 512. Default is 0.1.
  9181. </p>
  9182. </dd>
  9183. <dt><samp>sigmaR</samp></dt>
  9184. <dd><p>Set sigma of gaussian function to calculate range weight.
  9185. Allowed range is 0 to 1. Default is 0.1.
  9186. </p>
  9187. </dd>
  9188. <dt><samp>planes</samp></dt>
  9189. <dd><p>Set planes to filter. Default is first only.
  9190. </p></dd>
  9191. </dl>
  9192. <a name="Commands-47"></a>
  9193. <h4 class="subsection">11.9.1 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>
  9194. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9195. </p>
  9196. <a name="bitplanenoise"></a>
  9197. <h3 class="section">11.10 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>
  9198. <p>Show and measure bit plane noise.
  9199. </p>
  9200. <p>The filter accepts the following options:
  9201. </p>
  9202. <dl compact="compact">
  9203. <dt><samp>bitplane</samp></dt>
  9204. <dd><p>Set which plane to analyze. Default is <code>1</code>.
  9205. </p>
  9206. </dd>
  9207. <dt><samp>filter</samp></dt>
  9208. <dd><p>Filter out noisy pixels from <code>bitplane</code> set above.
  9209. Default is disabled.
  9210. </p></dd>
  9211. </dl>
  9212. <a name="blackdetect"></a>
  9213. <h3 class="section">11.11 blackdetect<span class="pull-right"><a class="anchor hidden-xs" href="#blackdetect" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-blackdetect" aria-hidden="true">TOC</a></span></h3>
  9214. <p>Detect video intervals that are (almost) completely black. Can be
  9215. useful to detect chapter transitions, commercials, or invalid
  9216. recordings.
  9217. </p>
  9218. <p>The filter outputs its detection analysis to both the log as well as
  9219. frame metadata. If a black segment of at least the specified minimum
  9220. duration is found, a line with the start and end timestamps as well
  9221. as duration is printed to the log with level <code>info</code>. In addition,
  9222. a log line with level <code>debug</code> is printed per frame showing the
  9223. black amount detected for that frame.
  9224. </p>
  9225. <p>The filter also attaches metadata to the first frame of a black
  9226. segment with key <code>lavfi.black_start</code> and to the first frame
  9227. after the black segment ends with key <code>lavfi.black_end</code>. The
  9228. value is the frame&rsquo;s timestamp. This metadata is added regardless
  9229. of the minimum duration specified.
  9230. </p>
  9231. <p>The filter accepts the following options:
  9232. </p>
  9233. <dl compact="compact">
  9234. <dt><samp>black_min_duration, d</samp></dt>
  9235. <dd><p>Set the minimum detected black duration expressed in seconds. It must
  9236. be a non-negative floating point number.
  9237. </p>
  9238. <p>Default value is 2.0.
  9239. </p>
  9240. </dd>
  9241. <dt><samp>picture_black_ratio_th, pic_th</samp></dt>
  9242. <dd><p>Set the threshold for considering a picture &quot;black&quot;.
  9243. Express the minimum value for the ratio:
  9244. </p><div class="example">
  9245. <pre class="example"><var>nb_black_pixels</var> / <var>nb_pixels</var>
  9246. </pre></div>
  9247. <p>for which a picture is considered black.
  9248. Default value is 0.98.
  9249. </p>
  9250. </dd>
  9251. <dt><samp>pixel_black_th, pix_th</samp></dt>
  9252. <dd><p>Set the threshold for considering a pixel &quot;black&quot;.
  9253. </p>
  9254. <p>The threshold expresses the maximum pixel luminance value for which a
  9255. pixel is considered &quot;black&quot;. The provided value is scaled according to
  9256. the following equation:
  9257. </p><div class="example">
  9258. <pre class="example"><var>absolute_threshold</var> = <var>luminance_minimum_value</var> + <var>pixel_black_th</var> * <var>luminance_range_size</var>
  9259. </pre></div>
  9260. <p><var>luminance_range_size</var> and <var>luminance_minimum_value</var> depend on
  9261. the input video format, the range is [0-255] for YUV full-range
  9262. formats and [16-235] for YUV non full-range formats.
  9263. </p>
  9264. <p>Default value is 0.10.
  9265. </p></dd>
  9266. </dl>
  9267. <p>The following example sets the maximum pixel threshold to the minimum
  9268. value, and detects only black intervals of 2 or more seconds:
  9269. </p><div class="example">
  9270. <pre class="example">blackdetect=d=2:pix_th=0.00
  9271. </pre></div>
  9272. <a name="blackframe"></a>
  9273. <h3 class="section">11.12 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>
  9274. <p>Detect frames that are (almost) completely black. Can be useful to
  9275. detect chapter transitions or commercials. Output lines consist of
  9276. the frame number of the detected frame, the percentage of blackness,
  9277. the position in the file if known or -1 and the timestamp in seconds.
  9278. </p>
  9279. <p>In order to display the output lines, you need to set the loglevel at
  9280. least to the AV_LOG_INFO value.
  9281. </p>
  9282. <p>This filter exports frame metadata <code>lavfi.blackframe.pblack</code>.
  9283. The value represents the percentage of pixels in the picture that
  9284. are below the threshold value.
  9285. </p>
  9286. <p>It accepts the following parameters:
  9287. </p>
  9288. <dl compact="compact">
  9289. <dt><samp>amount</samp></dt>
  9290. <dd><p>The percentage of the pixels that have to be below the threshold; it defaults to
  9291. <code>98</code>.
  9292. </p>
  9293. </dd>
  9294. <dt><samp>threshold, thresh</samp></dt>
  9295. <dd><p>The threshold below which a pixel value is considered black; it defaults to
  9296. <code>32</code>.
  9297. </p>
  9298. </dd>
  9299. </dl>
  9300. <span id="blend"></span><a name="blend-1"></a>
  9301. <h3 class="section">11.13 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>
  9302. <p>Blend two video frames into each other.
  9303. </p>
  9304. <p>The <code>blend</code> filter takes two input streams and outputs one
  9305. stream, the first input is the &quot;top&quot; layer and second input is
  9306. &quot;bottom&quot; layer. By default, the output terminates when the longest input terminates.
  9307. </p>
  9308. <p>The <code>tblend</code> (time blend) filter takes two consecutive frames
  9309. from one single stream, and outputs the result obtained by blending
  9310. the new frame on top of the old frame.
  9311. </p>
  9312. <p>A description of the accepted options follows.
  9313. </p>
  9314. <dl compact="compact">
  9315. <dt><samp>c0_mode</samp></dt>
  9316. <dt><samp>c1_mode</samp></dt>
  9317. <dt><samp>c2_mode</samp></dt>
  9318. <dt><samp>c3_mode</samp></dt>
  9319. <dt><samp>all_mode</samp></dt>
  9320. <dd><p>Set blend mode for specific pixel component or all pixel components in case
  9321. of <var>all_mode</var>. Default value is <code>normal</code>.
  9322. </p>
  9323. <p>Available values for component modes are:
  9324. </p><dl compact="compact">
  9325. <dt>&lsquo;<samp>addition</samp>&rsquo;</dt>
  9326. <dt>&lsquo;<samp>grainmerge</samp>&rsquo;</dt>
  9327. <dt>&lsquo;<samp>and</samp>&rsquo;</dt>
  9328. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  9329. <dt>&lsquo;<samp>burn</samp>&rsquo;</dt>
  9330. <dt>&lsquo;<samp>darken</samp>&rsquo;</dt>
  9331. <dt>&lsquo;<samp>difference</samp>&rsquo;</dt>
  9332. <dt>&lsquo;<samp>grainextract</samp>&rsquo;</dt>
  9333. <dt>&lsquo;<samp>divide</samp>&rsquo;</dt>
  9334. <dt>&lsquo;<samp>dodge</samp>&rsquo;</dt>
  9335. <dt>&lsquo;<samp>freeze</samp>&rsquo;</dt>
  9336. <dt>&lsquo;<samp>exclusion</samp>&rsquo;</dt>
  9337. <dt>&lsquo;<samp>extremity</samp>&rsquo;</dt>
  9338. <dt>&lsquo;<samp>glow</samp>&rsquo;</dt>
  9339. <dt>&lsquo;<samp>hardlight</samp>&rsquo;</dt>
  9340. <dt>&lsquo;<samp>hardmix</samp>&rsquo;</dt>
  9341. <dt>&lsquo;<samp>heat</samp>&rsquo;</dt>
  9342. <dt>&lsquo;<samp>lighten</samp>&rsquo;</dt>
  9343. <dt>&lsquo;<samp>linearlight</samp>&rsquo;</dt>
  9344. <dt>&lsquo;<samp>multiply</samp>&rsquo;</dt>
  9345. <dt>&lsquo;<samp>multiply128</samp>&rsquo;</dt>
  9346. <dt>&lsquo;<samp>negation</samp>&rsquo;</dt>
  9347. <dt>&lsquo;<samp>normal</samp>&rsquo;</dt>
  9348. <dt>&lsquo;<samp>or</samp>&rsquo;</dt>
  9349. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  9350. <dt>&lsquo;<samp>phoenix</samp>&rsquo;</dt>
  9351. <dt>&lsquo;<samp>pinlight</samp>&rsquo;</dt>
  9352. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  9353. <dt>&lsquo;<samp>screen</samp>&rsquo;</dt>
  9354. <dt>&lsquo;<samp>softlight</samp>&rsquo;</dt>
  9355. <dt>&lsquo;<samp>subtract</samp>&rsquo;</dt>
  9356. <dt>&lsquo;<samp>vividlight</samp>&rsquo;</dt>
  9357. <dt>&lsquo;<samp>xor</samp>&rsquo;</dt>
  9358. </dl>
  9359. </dd>
  9360. <dt><samp>c0_opacity</samp></dt>
  9361. <dt><samp>c1_opacity</samp></dt>
  9362. <dt><samp>c2_opacity</samp></dt>
  9363. <dt><samp>c3_opacity</samp></dt>
  9364. <dt><samp>all_opacity</samp></dt>
  9365. <dd><p>Set blend opacity for specific pixel component or all pixel components in case
  9366. of <var>all_opacity</var>. Only used in combination with pixel component blend modes.
  9367. </p>
  9368. </dd>
  9369. <dt><samp>c0_expr</samp></dt>
  9370. <dt><samp>c1_expr</samp></dt>
  9371. <dt><samp>c2_expr</samp></dt>
  9372. <dt><samp>c3_expr</samp></dt>
  9373. <dt><samp>all_expr</samp></dt>
  9374. <dd><p>Set blend expression for specific pixel component or all pixel components in case
  9375. of <var>all_expr</var>. Note that related mode options will be ignored if those are set.
  9376. </p>
  9377. <p>The expressions can use the following variables:
  9378. </p>
  9379. <dl compact="compact">
  9380. <dt><samp>N</samp></dt>
  9381. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  9382. </p>
  9383. </dd>
  9384. <dt><samp>X</samp></dt>
  9385. <dt><samp>Y</samp></dt>
  9386. <dd><p>the coordinates of the current sample
  9387. </p>
  9388. </dd>
  9389. <dt><samp>W</samp></dt>
  9390. <dt><samp>H</samp></dt>
  9391. <dd><p>the width and height of currently filtered plane
  9392. </p>
  9393. </dd>
  9394. <dt><samp>SW</samp></dt>
  9395. <dt><samp>SH</samp></dt>
  9396. <dd><p>Width and height scale for the plane being filtered. It is the
  9397. ratio between the dimensions of the current plane to the luma plane,
  9398. e.g. for a <code>yuv420p</code> frame, the values are <code>1,1</code> for
  9399. the luma plane and <code>0.5,0.5</code> for the chroma planes.
  9400. </p>
  9401. </dd>
  9402. <dt><samp>T</samp></dt>
  9403. <dd><p>Time of the current frame, expressed in seconds.
  9404. </p>
  9405. </dd>
  9406. <dt><samp>TOP, A</samp></dt>
  9407. <dd><p>Value of pixel component at current location for first video frame (top layer).
  9408. </p>
  9409. </dd>
  9410. <dt><samp>BOTTOM, B</samp></dt>
  9411. <dd><p>Value of pixel component at current location for second video frame (bottom layer).
  9412. </p></dd>
  9413. </dl>
  9414. </dd>
  9415. </dl>
  9416. <p>The <code>blend</code> filter also supports the <a href="#framesync">framesync</a> options.
  9417. </p>
  9418. <a name="Examples-41"></a>
  9419. <h4 class="subsection">11.13.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>
  9420. <ul>
  9421. <li> Apply transition from bottom layer to top layer in first 10 seconds:
  9422. <div class="example">
  9423. <pre class="example">blend=all_expr='A*(if(gte(T,10),1,T/10))+B*(1-(if(gte(T,10),1,T/10)))'
  9424. </pre></div>
  9425. </li><li> Apply linear horizontal transition from top layer to bottom layer:
  9426. <div class="example">
  9427. <pre class="example">blend=all_expr='A*(X/W)+B*(1-X/W)'
  9428. </pre></div>
  9429. </li><li> Apply 1x1 checkerboard effect:
  9430. <div class="example">
  9431. <pre class="example">blend=all_expr='if(eq(mod(X,2),mod(Y,2)),A,B)'
  9432. </pre></div>
  9433. </li><li> Apply uncover left effect:
  9434. <div class="example">
  9435. <pre class="example">blend=all_expr='if(gte(N*SW+X,W),A,B)'
  9436. </pre></div>
  9437. </li><li> Apply uncover down effect:
  9438. <div class="example">
  9439. <pre class="example">blend=all_expr='if(gte(Y-N*SH,0),A,B)'
  9440. </pre></div>
  9441. </li><li> Apply uncover up-left effect:
  9442. <div class="example">
  9443. <pre class="example">blend=all_expr='if(gte(T*SH*40+Y,H)*gte((T*40*SW+X)*W/H,W),A,B)'
  9444. </pre></div>
  9445. </li><li> Split diagonally video and shows top and bottom layer on each side:
  9446. <div class="example">
  9447. <pre class="example">blend=all_expr='if(gt(X,Y*(W/H)),A,B)'
  9448. </pre></div>
  9449. </li><li> Display differences between the current and the previous frame:
  9450. <div class="example">
  9451. <pre class="example">tblend=all_mode=grainextract
  9452. </pre></div>
  9453. </li></ul>
  9454. <a name="Commands-48"></a>
  9455. <h4 class="subsection">11.13.2 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>
  9456. <p>This filter supports same <a href="#commands">commands</a> as options.
  9457. </p>
  9458. <a name="bm3d"></a>
  9459. <h3 class="section">11.14 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>
  9460. <p>Denoise frames using Block-Matching 3D algorithm.
  9461. </p>
  9462. <p>The filter accepts the following options.
  9463. </p>
  9464. <dl compact="compact">
  9465. <dt><samp>sigma</samp></dt>
  9466. <dd><p>Set denoising strength. Default value is 1.
  9467. Allowed range is from 0 to 999.9.
  9468. The denoising algorithm is very sensitive to sigma, so adjust it
  9469. according to the source.
  9470. </p>
  9471. </dd>
  9472. <dt><samp>block</samp></dt>
  9473. <dd><p>Set local patch size. This sets dimensions in 2D.
  9474. </p>
  9475. </dd>
  9476. <dt><samp>bstep</samp></dt>
  9477. <dd><p>Set sliding step for processing blocks. Default value is 4.
  9478. Allowed range is from 1 to 64.
  9479. Smaller values allows processing more reference blocks and is slower.
  9480. </p>
  9481. </dd>
  9482. <dt><samp>group</samp></dt>
  9483. <dd><p>Set maximal number of similar blocks for 3rd dimension. Default value is 1.
  9484. When set to 1, no block matching is done. Larger values allows more blocks
  9485. in single group.
  9486. Allowed range is from 1 to 256.
  9487. </p>
  9488. </dd>
  9489. <dt><samp>range</samp></dt>
  9490. <dd><p>Set radius for search block matching. Default is 9.
  9491. Allowed range is from 1 to INT32_MAX.
  9492. </p>
  9493. </dd>
  9494. <dt><samp>mstep</samp></dt>
  9495. <dd><p>Set step between two search locations for block matching. Default is 1.
  9496. Allowed range is from 1 to 64. Smaller is slower.
  9497. </p>
  9498. </dd>
  9499. <dt><samp>thmse</samp></dt>
  9500. <dd><p>Set threshold of mean square error for block matching. Valid range is 0 to
  9501. INT32_MAX.
  9502. </p>
  9503. </dd>
  9504. <dt><samp>hdthr</samp></dt>
  9505. <dd><p>Set thresholding parameter for hard thresholding in 3D transformed domain.
  9506. Larger values results in stronger hard-thresholding filtering in frequency
  9507. domain.
  9508. </p>
  9509. </dd>
  9510. <dt><samp>estim</samp></dt>
  9511. <dd><p>Set filtering estimation mode. Can be <code>basic</code> or <code>final</code>.
  9512. Default is <code>basic</code>.
  9513. </p>
  9514. </dd>
  9515. <dt><samp>ref</samp></dt>
  9516. <dd><p>If enabled, filter will use 2nd stream for block matching.
  9517. Default is disabled for <code>basic</code> value of <var>estim</var> option,
  9518. and always enabled if value of <var>estim</var> is <code>final</code>.
  9519. </p>
  9520. </dd>
  9521. <dt><samp>planes</samp></dt>
  9522. <dd><p>Set planes to filter. Default is all available except alpha.
  9523. </p></dd>
  9524. </dl>
  9525. <a name="Examples-42"></a>
  9526. <h4 class="subsection">11.14.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>
  9527. <ul>
  9528. <li> Basic filtering with bm3d:
  9529. <div class="example">
  9530. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic
  9531. </pre></div>
  9532. </li><li> Same as above, but filtering only luma:
  9533. <div class="example">
  9534. <pre class="example">bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic:planes=1
  9535. </pre></div>
  9536. </li><li> Same as above, but with both estimation modes:
  9537. <div class="example">
  9538. <pre class="example">split[a][b],[a]bm3d=sigma=3:block=4:bstep=2:group=1:estim=basic[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  9539. </pre></div>
  9540. </li><li> Same as above, but prefilter with <a href="#nlmeans">nlmeans</a> filter instead:
  9541. <div class="example">
  9542. <pre class="example">split[a][b],[a]nlmeans=s=3:r=7:p=3[a],[b][a]bm3d=sigma=3:block=4:bstep=2:group=16:estim=final:ref=1
  9543. </pre></div>
  9544. </li></ul>
  9545. <a name="boxblur"></a>
  9546. <h3 class="section">11.15 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>
  9547. <p>Apply a boxblur algorithm to the input video.
  9548. </p>
  9549. <p>It accepts the following parameters:
  9550. </p>
  9551. <dl compact="compact">
  9552. <dt><samp>luma_radius, lr</samp></dt>
  9553. <dt><samp>luma_power, lp</samp></dt>
  9554. <dt><samp>chroma_radius, cr</samp></dt>
  9555. <dt><samp>chroma_power, cp</samp></dt>
  9556. <dt><samp>alpha_radius, ar</samp></dt>
  9557. <dt><samp>alpha_power, ap</samp></dt>
  9558. </dl>
  9559. <p>A description of the accepted options follows.
  9560. </p>
  9561. <dl compact="compact">
  9562. <dt><samp>luma_radius, lr</samp></dt>
  9563. <dt><samp>chroma_radius, cr</samp></dt>
  9564. <dt><samp>alpha_radius, ar</samp></dt>
  9565. <dd><p>Set an expression for the box radius in pixels used for blurring the
  9566. corresponding input plane.
  9567. </p>
  9568. <p>The radius value must be a non-negative number, and must not be
  9569. greater than the value of the expression <code>min(w,h)/2</code> for the
  9570. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  9571. planes.
  9572. </p>
  9573. <p>Default value for <samp>luma_radius</samp> is &quot;2&quot;. If not specified,
  9574. <samp>chroma_radius</samp> and <samp>alpha_radius</samp> default to the
  9575. corresponding value set for <samp>luma_radius</samp>.
  9576. </p>
  9577. <p>The expressions can contain the following constants:
  9578. </p><dl compact="compact">
  9579. <dt><samp>w</samp></dt>
  9580. <dt><samp>h</samp></dt>
  9581. <dd><p>The input width and height in pixels.
  9582. </p>
  9583. </dd>
  9584. <dt><samp>cw</samp></dt>
  9585. <dt><samp>ch</samp></dt>
  9586. <dd><p>The input chroma image width and height in pixels.
  9587. </p>
  9588. </dd>
  9589. <dt><samp>hsub</samp></dt>
  9590. <dt><samp>vsub</samp></dt>
  9591. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  9592. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  9593. </p></dd>
  9594. </dl>
  9595. </dd>
  9596. <dt><samp>luma_power, lp</samp></dt>
  9597. <dt><samp>chroma_power, cp</samp></dt>
  9598. <dt><samp>alpha_power, ap</samp></dt>
  9599. <dd><p>Specify how many times the boxblur filter is applied to the
  9600. corresponding plane.
  9601. </p>
  9602. <p>Default value for <samp>luma_power</samp> is 2. If not specified,
  9603. <samp>chroma_power</samp> and <samp>alpha_power</samp> default to the
  9604. corresponding value set for <samp>luma_power</samp>.
  9605. </p>
  9606. <p>A value of 0 will disable the effect.
  9607. </p></dd>
  9608. </dl>
  9609. <a name="Examples-43"></a>
  9610. <h4 class="subsection">11.15.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>
  9611. <ul>
  9612. <li> Apply a boxblur filter with the luma, chroma, and alpha radii
  9613. set to 2:
  9614. <div class="example">
  9615. <pre class="example">boxblur=luma_radius=2:luma_power=1
  9616. boxblur=2:1
  9617. </pre></div>
  9618. </li><li> Set the luma radius to 2, and alpha and chroma radius to 0:
  9619. <div class="example">
  9620. <pre class="example">boxblur=2:1:cr=0:ar=0
  9621. </pre></div>
  9622. </li><li> Set the luma and chroma radii to a fraction of the video dimension:
  9623. <div class="example">
  9624. <pre class="example">boxblur=luma_radius=min(h\,w)/10:luma_power=1:chroma_radius=min(cw\,ch)/10:chroma_power=1
  9625. </pre></div>
  9626. </li></ul>
  9627. <a name="bwdif"></a>
  9628. <h3 class="section">11.16 bwdif<span class="pull-right"><a class="anchor hidden-xs" href="#bwdif" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-bwdif" aria-hidden="true">TOC</a></span></h3>
  9629. <p>Deinterlace the input video (&quot;bwdif&quot; stands for &quot;Bob Weaver
  9630. Deinterlacing Filter&quot;).
  9631. </p>
  9632. <p>Motion adaptive deinterlacing based on yadif with the use of w3fdif and cubic
  9633. interpolation algorithms.
  9634. It accepts the following parameters:
  9635. </p>
  9636. <dl compact="compact">
  9637. <dt><samp>mode</samp></dt>
  9638. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  9639. </p>
  9640. <dl compact="compact">
  9641. <dt><samp>0, send_frame</samp></dt>
  9642. <dd><p>Output one frame for each frame.
  9643. </p></dd>
  9644. <dt><samp>1, send_field</samp></dt>
  9645. <dd><p>Output one frame for each field.
  9646. </p></dd>
  9647. </dl>
  9648. <p>The default value is <code>send_field</code>.
  9649. </p>
  9650. </dd>
  9651. <dt><samp>parity</samp></dt>
  9652. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  9653. of the following values:
  9654. </p>
  9655. <dl compact="compact">
  9656. <dt><samp>0, tff</samp></dt>
  9657. <dd><p>Assume the top field is first.
  9658. </p></dd>
  9659. <dt><samp>1, bff</samp></dt>
  9660. <dd><p>Assume the bottom field is first.
  9661. </p></dd>
  9662. <dt><samp>-1, auto</samp></dt>
  9663. <dd><p>Enable automatic detection of field parity.
  9664. </p></dd>
  9665. </dl>
  9666. <p>The default value is <code>auto</code>.
  9667. If the interlacing is unknown or the decoder does not export this information,
  9668. top field first will be assumed.
  9669. </p>
  9670. </dd>
  9671. <dt><samp>deint</samp></dt>
  9672. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  9673. values:
  9674. </p>
  9675. <dl compact="compact">
  9676. <dt><samp>0, all</samp></dt>
  9677. <dd><p>Deinterlace all frames.
  9678. </p></dd>
  9679. <dt><samp>1, interlaced</samp></dt>
  9680. <dd><p>Only deinterlace frames marked as interlaced.
  9681. </p></dd>
  9682. </dl>
  9683. <p>The default value is <code>all</code>.
  9684. </p></dd>
  9685. </dl>
  9686. <a name="cas"></a>
  9687. <h3 class="section">11.17 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>
  9688. <p>Apply Contrast Adaptive Sharpen filter to video stream.
  9689. </p>
  9690. <p>The filter accepts the following options:
  9691. </p>
  9692. <dl compact="compact">
  9693. <dt><samp>strength</samp></dt>
  9694. <dd><p>Set the sharpening strength. Default value is 0.
  9695. </p>
  9696. </dd>
  9697. <dt><samp>planes</samp></dt>
  9698. <dd><p>Set planes to filter. Default value is to filter all
  9699. planes except alpha plane.
  9700. </p></dd>
  9701. </dl>
  9702. <a name="Commands-49"></a>
  9703. <h4 class="subsection">11.17.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>
  9704. <p>This filter supports same <a href="#commands">commands</a> as options.
  9705. </p>
  9706. <a name="chromahold"></a>
  9707. <h3 class="section">11.18 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>
  9708. <p>Remove all color information for all colors except for certain one.
  9709. </p>
  9710. <p>The filter accepts the following options:
  9711. </p>
  9712. <dl compact="compact">
  9713. <dt><samp>color</samp></dt>
  9714. <dd><p>The color which will not be replaced with neutral chroma.
  9715. </p>
  9716. </dd>
  9717. <dt><samp>similarity</samp></dt>
  9718. <dd><p>Similarity percentage with the above color.
  9719. 0.01 matches only the exact key color, while 1.0 matches everything.
  9720. </p>
  9721. </dd>
  9722. <dt><samp>blend</samp></dt>
  9723. <dd><p>Blend percentage.
  9724. 0.0 makes pixels either fully gray, or not gray at all.
  9725. Higher values result in more preserved color.
  9726. </p>
  9727. </dd>
  9728. <dt><samp>yuv</samp></dt>
  9729. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  9730. </p>
  9731. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  9732. This can be used to pass exact YUV values as hexadecimal numbers.
  9733. </p></dd>
  9734. </dl>
  9735. <a name="Commands-50"></a>
  9736. <h4 class="subsection">11.18.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>
  9737. <p>This filter supports same <a href="#commands">commands</a> as options.
  9738. The command accepts the same syntax of the corresponding option.
  9739. </p>
  9740. <p>If the specified expression is not valid, it is kept at its current
  9741. value.
  9742. </p>
  9743. <a name="chromakey"></a>
  9744. <h3 class="section">11.19 chromakey<span class="pull-right"><a class="anchor hidden-xs" href="#chromakey" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-chromakey" aria-hidden="true">TOC</a></span></h3>
  9745. <p>YUV colorspace color/chroma keying.
  9746. </p>
  9747. <p>The filter accepts the following options:
  9748. </p>
  9749. <dl compact="compact">
  9750. <dt><samp>color</samp></dt>
  9751. <dd><p>The color which will be replaced with transparency.
  9752. </p>
  9753. </dd>
  9754. <dt><samp>similarity</samp></dt>
  9755. <dd><p>Similarity percentage with the key color.
  9756. </p>
  9757. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  9758. </p>
  9759. </dd>
  9760. <dt><samp>blend</samp></dt>
  9761. <dd><p>Blend percentage.
  9762. </p>
  9763. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  9764. </p>
  9765. <p>Higher values result in semi-transparent pixels, with a higher transparency
  9766. the more similar the pixels color is to the key color.
  9767. </p>
  9768. </dd>
  9769. <dt><samp>yuv</samp></dt>
  9770. <dd><p>Signals that the color passed is already in YUV instead of RGB.
  9771. </p>
  9772. <p>Literal colors like &quot;green&quot; or &quot;red&quot; don&rsquo;t make sense with this enabled anymore.
  9773. This can be used to pass exact YUV values as hexadecimal numbers.
  9774. </p></dd>
  9775. </dl>
  9776. <a name="Commands-51"></a>
  9777. <h4 class="subsection">11.19.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>
  9778. <p>This filter supports same <a href="#commands">commands</a> as options.
  9779. The command accepts the same syntax of the corresponding option.
  9780. </p>
  9781. <p>If the specified expression is not valid, it is kept at its current
  9782. value.
  9783. </p>
  9784. <a name="Examples-44"></a>
  9785. <h4 class="subsection">11.19.2 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>
  9786. <ul>
  9787. <li> Make every green pixel in the input image transparent:
  9788. <div class="example">
  9789. <pre class="example">ffmpeg -i input.png -vf chromakey=green out.png
  9790. </pre></div>
  9791. </li><li> Overlay a greenscreen-video on top of a static black background.
  9792. <div class="example">
  9793. <pre class="example">ffmpeg -f lavfi -i color=c=black:s=1280x720 -i video.mp4 -shortest -filter_complex &quot;[1:v]chromakey=0x70de77:0.1:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.mkv
  9794. </pre></div>
  9795. </li></ul>
  9796. <a name="chromanr"></a>
  9797. <h3 class="section">11.20 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>
  9798. <p>Reduce chrominance noise.
  9799. </p>
  9800. <p>The filter accepts the following options:
  9801. </p>
  9802. <dl compact="compact">
  9803. <dt><samp>thres</samp></dt>
  9804. <dd><p>Set threshold for averaging chrominance values.
  9805. Sum of absolute difference of Y, U and V pixel components of current
  9806. pixel and neighbour pixels lower than this threshold will be used in
  9807. averaging. Luma component is left unchanged and is copied to output.
  9808. Default value is 30. Allowed range is from 1 to 200.
  9809. </p>
  9810. </dd>
  9811. <dt><samp>sizew</samp></dt>
  9812. <dd><p>Set horizontal radius of rectangle used for averaging.
  9813. Allowed range is from 1 to 100. Default value is 5.
  9814. </p>
  9815. </dd>
  9816. <dt><samp>sizeh</samp></dt>
  9817. <dd><p>Set vertical radius of rectangle used for averaging.
  9818. Allowed range is from 1 to 100. Default value is 5.
  9819. </p>
  9820. </dd>
  9821. <dt><samp>stepw</samp></dt>
  9822. <dd><p>Set horizontal step when averaging. Default value is 1.
  9823. Allowed range is from 1 to 50.
  9824. Mostly useful to speed-up filtering.
  9825. </p>
  9826. </dd>
  9827. <dt><samp>steph</samp></dt>
  9828. <dd><p>Set vertical step when averaging. Default value is 1.
  9829. Allowed range is from 1 to 50.
  9830. Mostly useful to speed-up filtering.
  9831. </p>
  9832. </dd>
  9833. <dt><samp>threy</samp></dt>
  9834. <dd><p>Set Y threshold for averaging chrominance values.
  9835. Set finer control for max allowed difference between Y components
  9836. of current pixel and neigbour pixels.
  9837. Default value is 200. Allowed range is from 1 to 200.
  9838. </p>
  9839. </dd>
  9840. <dt><samp>threu</samp></dt>
  9841. <dd><p>Set U threshold for averaging chrominance values.
  9842. Set finer control for max allowed difference between U components
  9843. of current pixel and neigbour pixels.
  9844. Default value is 200. Allowed range is from 1 to 200.
  9845. </p>
  9846. </dd>
  9847. <dt><samp>threv</samp></dt>
  9848. <dd><p>Set V threshold for averaging chrominance values.
  9849. Set finer control for max allowed difference between V components
  9850. of current pixel and neigbour pixels.
  9851. Default value is 200. Allowed range is from 1 to 200.
  9852. </p></dd>
  9853. </dl>
  9854. <a name="Commands-52"></a>
  9855. <h4 class="subsection">11.20.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>
  9856. <p>This filter supports same <a href="#commands">commands</a> as options.
  9857. The command accepts the same syntax of the corresponding option.
  9858. </p>
  9859. <a name="chromashift"></a>
  9860. <h3 class="section">11.21 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>
  9861. <p>Shift chroma pixels horizontally and/or vertically.
  9862. </p>
  9863. <p>The filter accepts the following options:
  9864. </p><dl compact="compact">
  9865. <dt><samp>cbh</samp></dt>
  9866. <dd><p>Set amount to shift chroma-blue horizontally.
  9867. </p></dd>
  9868. <dt><samp>cbv</samp></dt>
  9869. <dd><p>Set amount to shift chroma-blue vertically.
  9870. </p></dd>
  9871. <dt><samp>crh</samp></dt>
  9872. <dd><p>Set amount to shift chroma-red horizontally.
  9873. </p></dd>
  9874. <dt><samp>crv</samp></dt>
  9875. <dd><p>Set amount to shift chroma-red vertically.
  9876. </p></dd>
  9877. <dt><samp>edge</samp></dt>
  9878. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  9879. </p></dd>
  9880. </dl>
  9881. <a name="Commands-53"></a>
  9882. <h4 class="subsection">11.21.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>
  9883. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  9884. </p>
  9885. <a name="ciescope"></a>
  9886. <h3 class="section">11.22 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>
  9887. <p>Display CIE color diagram with pixels overlaid onto it.
  9888. </p>
  9889. <p>The filter accepts the following options:
  9890. </p>
  9891. <dl compact="compact">
  9892. <dt><samp>system</samp></dt>
  9893. <dd><p>Set color system.
  9894. </p>
  9895. <dl compact="compact">
  9896. <dt>&lsquo;<samp>ntsc, 470m</samp>&rsquo;</dt>
  9897. <dt>&lsquo;<samp>ebu, 470bg</samp>&rsquo;</dt>
  9898. <dt>&lsquo;<samp>smpte</samp>&rsquo;</dt>
  9899. <dt>&lsquo;<samp>240m</samp>&rsquo;</dt>
  9900. <dt>&lsquo;<samp>apple</samp>&rsquo;</dt>
  9901. <dt>&lsquo;<samp>widergb</samp>&rsquo;</dt>
  9902. <dt>&lsquo;<samp>cie1931</samp>&rsquo;</dt>
  9903. <dt>&lsquo;<samp>rec709, hdtv</samp>&rsquo;</dt>
  9904. <dt>&lsquo;<samp>uhdtv, rec2020</samp>&rsquo;</dt>
  9905. <dt>&lsquo;<samp>dcip3</samp>&rsquo;</dt>
  9906. </dl>
  9907. </dd>
  9908. <dt><samp>cie</samp></dt>
  9909. <dd><p>Set CIE system.
  9910. </p>
  9911. <dl compact="compact">
  9912. <dt>&lsquo;<samp>xyy</samp>&rsquo;</dt>
  9913. <dt>&lsquo;<samp>ucs</samp>&rsquo;</dt>
  9914. <dt>&lsquo;<samp>luv</samp>&rsquo;</dt>
  9915. </dl>
  9916. </dd>
  9917. <dt><samp>gamuts</samp></dt>
  9918. <dd><p>Set what gamuts to draw.
  9919. </p>
  9920. <p>See <code>system</code> option for available values.
  9921. </p>
  9922. </dd>
  9923. <dt><samp>size, s</samp></dt>
  9924. <dd><p>Set ciescope size, by default set to 512.
  9925. </p>
  9926. </dd>
  9927. <dt><samp>intensity, i</samp></dt>
  9928. <dd><p>Set intensity used to map input pixel values to CIE diagram.
  9929. </p>
  9930. </dd>
  9931. <dt><samp>contrast</samp></dt>
  9932. <dd><p>Set contrast used to draw tongue colors that are out of active color system gamut.
  9933. </p>
  9934. </dd>
  9935. <dt><samp>corrgamma</samp></dt>
  9936. <dd><p>Correct gamma displayed on scope, by default enabled.
  9937. </p>
  9938. </dd>
  9939. <dt><samp>showwhite</samp></dt>
  9940. <dd><p>Show white point on CIE diagram, by default disabled.
  9941. </p>
  9942. </dd>
  9943. <dt><samp>gamma</samp></dt>
  9944. <dd><p>Set input gamma. Used only with XYZ input color space.
  9945. </p></dd>
  9946. </dl>
  9947. <a name="codecview"></a>
  9948. <h3 class="section">11.23 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>
  9949. <p>Visualize information exported by some codecs.
  9950. </p>
  9951. <p>Some codecs can export information through frames using side-data or other
  9952. means. For example, some MPEG based codecs export motion vectors through the
  9953. <var>export_mvs</var> flag in the codec <samp>flags2</samp> option.
  9954. </p>
  9955. <p>The filter accepts the following option:
  9956. </p>
  9957. <dl compact="compact">
  9958. <dt><samp>mv</samp></dt>
  9959. <dd><p>Set motion vectors to visualize.
  9960. </p>
  9961. <p>Available flags for <var>mv</var> are:
  9962. </p>
  9963. <dl compact="compact">
  9964. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  9965. <dd><p>forward predicted MVs of P-frames
  9966. </p></dd>
  9967. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  9968. <dd><p>forward predicted MVs of B-frames
  9969. </p></dd>
  9970. <dt>&lsquo;<samp>bb</samp>&rsquo;</dt>
  9971. <dd><p>backward predicted MVs of B-frames
  9972. </p></dd>
  9973. </dl>
  9974. </dd>
  9975. <dt><samp>qp</samp></dt>
  9976. <dd><p>Display quantization parameters using the chroma planes.
  9977. </p>
  9978. </dd>
  9979. <dt><samp>mv_type, mvt</samp></dt>
  9980. <dd><p>Set motion vectors type to visualize. Includes MVs from all frames unless specified by <var>frame_type</var> option.
  9981. </p>
  9982. <p>Available flags for <var>mv_type</var> are:
  9983. </p>
  9984. <dl compact="compact">
  9985. <dt>&lsquo;<samp>fp</samp>&rsquo;</dt>
  9986. <dd><p>forward predicted MVs
  9987. </p></dd>
  9988. <dt>&lsquo;<samp>bp</samp>&rsquo;</dt>
  9989. <dd><p>backward predicted MVs
  9990. </p></dd>
  9991. </dl>
  9992. </dd>
  9993. <dt><samp>frame_type, ft</samp></dt>
  9994. <dd><p>Set frame type to visualize motion vectors of.
  9995. </p>
  9996. <p>Available flags for <var>frame_type</var> are:
  9997. </p>
  9998. <dl compact="compact">
  9999. <dt>&lsquo;<samp>if</samp>&rsquo;</dt>
  10000. <dd><p>intra-coded frames (I-frames)
  10001. </p></dd>
  10002. <dt>&lsquo;<samp>pf</samp>&rsquo;</dt>
  10003. <dd><p>predicted frames (P-frames)
  10004. </p></dd>
  10005. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  10006. <dd><p>bi-directionally predicted frames (B-frames)
  10007. </p></dd>
  10008. </dl>
  10009. </dd>
  10010. </dl>
  10011. <a name="Examples-45"></a>
  10012. <h4 class="subsection">11.23.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>
  10013. <ul>
  10014. <li> Visualize forward predicted MVs of all frames using <code>ffplay</code>:
  10015. <div class="example">
  10016. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv_type=fp
  10017. </pre></div>
  10018. </li><li> Visualize multi-directionals MVs of P and B-Frames using <code>ffplay</code>:
  10019. <div class="example">
  10020. <pre class="example">ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
  10021. </pre></div>
  10022. </li></ul>
  10023. <a name="colorbalance"></a>
  10024. <h3 class="section">11.24 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>
  10025. <p>Modify intensity of primary colors (red, green and blue) of input frames.
  10026. </p>
  10027. <p>The filter allows an input frame to be adjusted in the shadows, midtones or highlights
  10028. regions for the red-cyan, green-magenta or blue-yellow balance.
  10029. </p>
  10030. <p>A positive adjustment value shifts the balance towards the primary color, a negative
  10031. value towards the complementary color.
  10032. </p>
  10033. <p>The filter accepts the following options:
  10034. </p>
  10035. <dl compact="compact">
  10036. <dt><samp>rs</samp></dt>
  10037. <dt><samp>gs</samp></dt>
  10038. <dt><samp>bs</samp></dt>
  10039. <dd><p>Adjust red, green and blue shadows (darkest pixels).
  10040. </p>
  10041. </dd>
  10042. <dt><samp>rm</samp></dt>
  10043. <dt><samp>gm</samp></dt>
  10044. <dt><samp>bm</samp></dt>
  10045. <dd><p>Adjust red, green and blue midtones (medium pixels).
  10046. </p>
  10047. </dd>
  10048. <dt><samp>rh</samp></dt>
  10049. <dt><samp>gh</samp></dt>
  10050. <dt><samp>bh</samp></dt>
  10051. <dd><p>Adjust red, green and blue highlights (brightest pixels).
  10052. </p>
  10053. <p>Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  10054. </p>
  10055. </dd>
  10056. <dt><samp>pl</samp></dt>
  10057. <dd><p>Preserve lightness when changing color balance. Default is disabled.
  10058. </p></dd>
  10059. </dl>
  10060. <a name="Examples-46"></a>
  10061. <h4 class="subsection">11.24.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>
  10062. <ul>
  10063. <li> Add red color cast to shadows:
  10064. <div class="example">
  10065. <pre class="example">colorbalance=rs=.3
  10066. </pre></div>
  10067. </li></ul>
  10068. <a name="Commands-54"></a>
  10069. <h4 class="subsection">11.24.2 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>
  10070. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10071. </p>
  10072. <a name="colorcontrast"></a>
  10073. <h3 class="section">11.25 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>
  10074. <p>Adjust color contrast between RGB components.
  10075. </p>
  10076. <p>The filter accepts the following options:
  10077. </p>
  10078. <dl compact="compact">
  10079. <dt><samp>rc</samp></dt>
  10080. <dd><p>Set the red-cyan contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  10081. </p>
  10082. </dd>
  10083. <dt><samp>gm</samp></dt>
  10084. <dd><p>Set the green-magenta contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  10085. </p>
  10086. </dd>
  10087. <dt><samp>by</samp></dt>
  10088. <dd><p>Set the blue-yellow contrast. Defaults is 0.0. Allowed range is from -1.0 to 1.0.
  10089. </p>
  10090. </dd>
  10091. <dt><samp>rcw</samp></dt>
  10092. <dt><samp>gmw</samp></dt>
  10093. <dt><samp>byw</samp></dt>
  10094. <dd><p>Set the weight of each <code>rc</code>, <code>gm</code>, <code>by</code> option value. Default value is 0.0.
  10095. Allowed range is from 0.0 to 1.0. If all weights are 0.0 filtering is disabled.
  10096. </p>
  10097. </dd>
  10098. <dt><samp>pl</samp></dt>
  10099. <dd><p>Set the amount of preserving lightness. Default value is 0.0. Allowed range is from 0.0 to 1.0.
  10100. </p></dd>
  10101. </dl>
  10102. <a name="Commands-55"></a>
  10103. <h4 class="subsection">11.25.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>
  10104. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10105. </p>
  10106. <a name="colorcorrect"></a>
  10107. <h3 class="section">11.26 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>
  10108. <p>Adjust color white balance selectively for blacks and whites.
  10109. This filter operates in YUV colorspace.
  10110. </p>
  10111. <p>The filter accepts the following options:
  10112. </p>
  10113. <dl compact="compact">
  10114. <dt><samp>rl</samp></dt>
  10115. <dd><p>Set the red shadow spot. Allowed range is from -1.0 to 1.0.
  10116. Default value is 0.
  10117. </p>
  10118. </dd>
  10119. <dt><samp>bl</samp></dt>
  10120. <dd><p>Set the blue shadow spot. Allowed range is from -1.0 to 1.0.
  10121. Default value is 0.
  10122. </p>
  10123. </dd>
  10124. <dt><samp>rh</samp></dt>
  10125. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  10126. Default value is 0.
  10127. </p>
  10128. </dd>
  10129. <dt><samp>bh</samp></dt>
  10130. <dd><p>Set the red highlight spot. Allowed range is from -1.0 to 1.0.
  10131. Default value is 0.
  10132. </p>
  10133. </dd>
  10134. <dt><samp>saturation</samp></dt>
  10135. <dd><p>Set the amount of saturation. Allowed range is from -3.0 to 3.0.
  10136. Default value is 1.
  10137. </p></dd>
  10138. </dl>
  10139. <a name="Commands-56"></a>
  10140. <h4 class="subsection">11.26.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>
  10141. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10142. </p>
  10143. <a name="colorchannelmixer"></a>
  10144. <h3 class="section">11.27 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>
  10145. <p>Adjust video input frames by re-mixing color channels.
  10146. </p>
  10147. <p>This filter modifies a color channel by adding the values associated to
  10148. the other channels of the same pixels. For example if the value to
  10149. modify is red, the output value will be:
  10150. </p><div class="example">
  10151. <pre class="example"><var>red</var>=<var>red</var>*<var>rr</var> + <var>blue</var>*<var>rb</var> + <var>green</var>*<var>rg</var> + <var>alpha</var>*<var>ra</var>
  10152. </pre></div>
  10153. <p>The filter accepts the following options:
  10154. </p>
  10155. <dl compact="compact">
  10156. <dt><samp>rr</samp></dt>
  10157. <dt><samp>rg</samp></dt>
  10158. <dt><samp>rb</samp></dt>
  10159. <dt><samp>ra</samp></dt>
  10160. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output red channel.
  10161. Default is <code>1</code> for <var>rr</var>, and <code>0</code> for <var>rg</var>, <var>rb</var> and <var>ra</var>.
  10162. </p>
  10163. </dd>
  10164. <dt><samp>gr</samp></dt>
  10165. <dt><samp>gg</samp></dt>
  10166. <dt><samp>gb</samp></dt>
  10167. <dt><samp>ga</samp></dt>
  10168. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output green channel.
  10169. Default is <code>1</code> for <var>gg</var>, and <code>0</code> for <var>gr</var>, <var>gb</var> and <var>ga</var>.
  10170. </p>
  10171. </dd>
  10172. <dt><samp>br</samp></dt>
  10173. <dt><samp>bg</samp></dt>
  10174. <dt><samp>bb</samp></dt>
  10175. <dt><samp>ba</samp></dt>
  10176. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output blue channel.
  10177. Default is <code>1</code> for <var>bb</var>, and <code>0</code> for <var>br</var>, <var>bg</var> and <var>ba</var>.
  10178. </p>
  10179. </dd>
  10180. <dt><samp>ar</samp></dt>
  10181. <dt><samp>ag</samp></dt>
  10182. <dt><samp>ab</samp></dt>
  10183. <dt><samp>aa</samp></dt>
  10184. <dd><p>Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
  10185. Default is <code>1</code> for <var>aa</var>, and <code>0</code> for <var>ar</var>, <var>ag</var> and <var>ab</var>.
  10186. </p>
  10187. <p>Allowed ranges for options are <code>[-2.0, 2.0]</code>.
  10188. </p>
  10189. </dd>
  10190. <dt><samp>pl</samp></dt>
  10191. <dd><p>Preserve lightness when changing colors. Allowed range is from <code>[0.0, 1.0]</code>.
  10192. Default is <code>0.0</code>, thus disabled.
  10193. </p></dd>
  10194. </dl>
  10195. <a name="Examples-47"></a>
  10196. <h4 class="subsection">11.27.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>
  10197. <ul>
  10198. <li> Convert source to grayscale:
  10199. <div class="example">
  10200. <pre class="example">colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
  10201. </pre></div>
  10202. </li><li> Simulate sepia tones:
  10203. <div class="example">
  10204. <pre class="example">colorchannelmixer=.393:.769:.189:0:.349:.686:.168:0:.272:.534:.131
  10205. </pre></div>
  10206. </li></ul>
  10207. <a name="Commands-57"></a>
  10208. <h4 class="subsection">11.27.2 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>
  10209. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10210. </p>
  10211. <a name="colorize"></a>
  10212. <h3 class="section">11.28 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>
  10213. <p>Overlay a solid color on the video stream.
  10214. </p>
  10215. <p>The filter accepts the following options:
  10216. </p>
  10217. <dl compact="compact">
  10218. <dt><samp>hue</samp></dt>
  10219. <dd><p>Set the color hue. Allowed range is from 0 to 360.
  10220. Default value is 0.
  10221. </p>
  10222. </dd>
  10223. <dt><samp>saturation</samp></dt>
  10224. <dd><p>Set the color saturation. Allowed range is from 0 to 1.
  10225. Default value is 0.5.
  10226. </p>
  10227. </dd>
  10228. <dt><samp>lightness</samp></dt>
  10229. <dd><p>Set the color lightness. Allowed range is from 0 to 1.
  10230. Default value is 0.5.
  10231. </p>
  10232. </dd>
  10233. <dt><samp>mix</samp></dt>
  10234. <dd><p>Set the mix of source lightness. By default is set to 1.0.
  10235. Allowed range is from 0.0 to 1.0.
  10236. </p></dd>
  10237. </dl>
  10238. <a name="Commands-58"></a>
  10239. <h4 class="subsection">11.28.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>
  10240. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10241. </p>
  10242. <a name="colorkey"></a>
  10243. <h3 class="section">11.29 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>
  10244. <p>RGB colorspace color keying.
  10245. </p>
  10246. <p>The filter accepts the following options:
  10247. </p>
  10248. <dl compact="compact">
  10249. <dt><samp>color</samp></dt>
  10250. <dd><p>The color which will be replaced with transparency.
  10251. </p>
  10252. </dd>
  10253. <dt><samp>similarity</samp></dt>
  10254. <dd><p>Similarity percentage with the key color.
  10255. </p>
  10256. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  10257. </p>
  10258. </dd>
  10259. <dt><samp>blend</samp></dt>
  10260. <dd><p>Blend percentage.
  10261. </p>
  10262. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  10263. </p>
  10264. <p>Higher values result in semi-transparent pixels, with a higher transparency
  10265. the more similar the pixels color is to the key color.
  10266. </p></dd>
  10267. </dl>
  10268. <a name="Examples-48"></a>
  10269. <h4 class="subsection">11.29.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>
  10270. <ul>
  10271. <li> Make every green pixel in the input image transparent:
  10272. <div class="example">
  10273. <pre class="example">ffmpeg -i input.png -vf colorkey=green out.png
  10274. </pre></div>
  10275. </li><li> Overlay a greenscreen-video on top of a static background image.
  10276. <div class="example">
  10277. <pre class="example">ffmpeg -i background.png -i video.mp4 -filter_complex &quot;[1:v]colorkey=0x3BBD1E:0.3:0.2[ckout];[0:v][ckout]overlay[out]&quot; -map &quot;[out]&quot; output.flv
  10278. </pre></div>
  10279. </li></ul>
  10280. <a name="Commands-59"></a>
  10281. <h4 class="subsection">11.29.2 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>
  10282. <p>This filter supports same <a href="#commands">commands</a> as options.
  10283. The command accepts the same syntax of the corresponding option.
  10284. </p>
  10285. <p>If the specified expression is not valid, it is kept at its current
  10286. value.
  10287. </p>
  10288. <a name="colorhold"></a>
  10289. <h3 class="section">11.30 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>
  10290. <p>Remove all color information for all RGB colors except for certain one.
  10291. </p>
  10292. <p>The filter accepts the following options:
  10293. </p>
  10294. <dl compact="compact">
  10295. <dt><samp>color</samp></dt>
  10296. <dd><p>The color which will not be replaced with neutral gray.
  10297. </p>
  10298. </dd>
  10299. <dt><samp>similarity</samp></dt>
  10300. <dd><p>Similarity percentage with the above color.
  10301. 0.01 matches only the exact key color, while 1.0 matches everything.
  10302. </p>
  10303. </dd>
  10304. <dt><samp>blend</samp></dt>
  10305. <dd><p>Blend percentage. 0.0 makes pixels fully gray.
  10306. Higher values result in more preserved color.
  10307. </p></dd>
  10308. </dl>
  10309. <a name="Commands-60"></a>
  10310. <h4 class="subsection">11.30.1 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>
  10311. <p>This filter supports same <a href="#commands">commands</a> as options.
  10312. The command accepts the same syntax of the corresponding option.
  10313. </p>
  10314. <p>If the specified expression is not valid, it is kept at its current
  10315. value.
  10316. </p>
  10317. <a name="colorlevels"></a>
  10318. <h3 class="section">11.31 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>
  10319. <p>Adjust video input frames using levels.
  10320. </p>
  10321. <p>The filter accepts the following options:
  10322. </p>
  10323. <dl compact="compact">
  10324. <dt><samp>rimin</samp></dt>
  10325. <dt><samp>gimin</samp></dt>
  10326. <dt><samp>bimin</samp></dt>
  10327. <dt><samp>aimin</samp></dt>
  10328. <dd><p>Adjust red, green, blue and alpha input black point.
  10329. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>0</code>.
  10330. </p>
  10331. </dd>
  10332. <dt><samp>rimax</samp></dt>
  10333. <dt><samp>gimax</samp></dt>
  10334. <dt><samp>bimax</samp></dt>
  10335. <dt><samp>aimax</samp></dt>
  10336. <dd><p>Adjust red, green, blue and alpha input white point.
  10337. Allowed ranges for options are <code>[-1.0, 1.0]</code>. Defaults are <code>1</code>.
  10338. </p>
  10339. <p>Input levels are used to lighten highlights (bright tones), darken shadows
  10340. (dark tones), change the balance of bright and dark tones.
  10341. </p>
  10342. </dd>
  10343. <dt><samp>romin</samp></dt>
  10344. <dt><samp>gomin</samp></dt>
  10345. <dt><samp>bomin</samp></dt>
  10346. <dt><samp>aomin</samp></dt>
  10347. <dd><p>Adjust red, green, blue and alpha output black point.
  10348. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>0</code>.
  10349. </p>
  10350. </dd>
  10351. <dt><samp>romax</samp></dt>
  10352. <dt><samp>gomax</samp></dt>
  10353. <dt><samp>bomax</samp></dt>
  10354. <dt><samp>aomax</samp></dt>
  10355. <dd><p>Adjust red, green, blue and alpha output white point.
  10356. Allowed ranges for options are <code>[0, 1.0]</code>. Defaults are <code>1</code>.
  10357. </p>
  10358. <p>Output levels allows manual selection of a constrained output level range.
  10359. </p></dd>
  10360. </dl>
  10361. <a name="Examples-49"></a>
  10362. <h4 class="subsection">11.31.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>
  10363. <ul>
  10364. <li> Make video output darker:
  10365. <div class="example">
  10366. <pre class="example">colorlevels=rimin=0.058:gimin=0.058:bimin=0.058
  10367. </pre></div>
  10368. </li><li> Increase contrast:
  10369. <div class="example">
  10370. <pre class="example">colorlevels=rimin=0.039:gimin=0.039:bimin=0.039:rimax=0.96:gimax=0.96:bimax=0.96
  10371. </pre></div>
  10372. </li><li> Make video output lighter:
  10373. <div class="example">
  10374. <pre class="example">colorlevels=rimax=0.902:gimax=0.902:bimax=0.902
  10375. </pre></div>
  10376. </li><li> Increase brightness:
  10377. <div class="example">
  10378. <pre class="example">colorlevels=romin=0.5:gomin=0.5:bomin=0.5
  10379. </pre></div>
  10380. </li></ul>
  10381. <a name="Commands-61"></a>
  10382. <h4 class="subsection">11.31.2 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>
  10383. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10384. </p>
  10385. <a name="colormatrix"></a>
  10386. <h3 class="section">11.32 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>
  10387. <p>Convert color matrix.
  10388. </p>
  10389. <p>The filter accepts the following options:
  10390. </p>
  10391. <dl compact="compact">
  10392. <dt><samp>src</samp></dt>
  10393. <dt><samp>dst</samp></dt>
  10394. <dd><p>Specify the source and destination color matrix. Both values must be
  10395. specified.
  10396. </p>
  10397. <p>The accepted values are:
  10398. </p><dl compact="compact">
  10399. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  10400. <dd><p>BT.709
  10401. </p>
  10402. </dd>
  10403. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  10404. <dd><p>FCC
  10405. </p>
  10406. </dd>
  10407. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  10408. <dd><p>BT.601
  10409. </p>
  10410. </dd>
  10411. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  10412. <dd><p>BT.470
  10413. </p>
  10414. </dd>
  10415. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  10416. <dd><p>BT.470BG
  10417. </p>
  10418. </dd>
  10419. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  10420. <dd><p>SMPTE-170M
  10421. </p>
  10422. </dd>
  10423. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  10424. <dd><p>SMPTE-240M
  10425. </p>
  10426. </dd>
  10427. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  10428. <dd><p>BT.2020
  10429. </p></dd>
  10430. </dl>
  10431. </dd>
  10432. </dl>
  10433. <p>For example to convert from BT.601 to SMPTE-240M, use the command:
  10434. </p><div class="example">
  10435. <pre class="example">colormatrix=bt601:smpte240m
  10436. </pre></div>
  10437. <a name="colorspace"></a>
  10438. <h3 class="section">11.33 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>
  10439. <p>Convert colorspace, transfer characteristics or color primaries.
  10440. Input video needs to have an even size.
  10441. </p>
  10442. <p>The filter accepts the following options:
  10443. </p>
  10444. <dl compact="compact">
  10445. <dd><span id="all"></span></dd>
  10446. <dt><samp>all</samp></dt>
  10447. <dd><p>Specify all color properties at once.
  10448. </p>
  10449. <p>The accepted values are:
  10450. </p><dl compact="compact">
  10451. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  10452. <dd><p>BT.470M
  10453. </p>
  10454. </dd>
  10455. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  10456. <dd><p>BT.470BG
  10457. </p>
  10458. </dd>
  10459. <dt>&lsquo;<samp>bt601-6-525</samp>&rsquo;</dt>
  10460. <dd><p>BT.601-6 525
  10461. </p>
  10462. </dd>
  10463. <dt>&lsquo;<samp>bt601-6-625</samp>&rsquo;</dt>
  10464. <dd><p>BT.601-6 625
  10465. </p>
  10466. </dd>
  10467. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  10468. <dd><p>BT.709
  10469. </p>
  10470. </dd>
  10471. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  10472. <dd><p>SMPTE-170M
  10473. </p>
  10474. </dd>
  10475. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  10476. <dd><p>SMPTE-240M
  10477. </p>
  10478. </dd>
  10479. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  10480. <dd><p>BT.2020
  10481. </p>
  10482. </dd>
  10483. </dl>
  10484. <span id="space"></span></dd>
  10485. <dt><samp>space</samp></dt>
  10486. <dd><p>Specify output colorspace.
  10487. </p>
  10488. <p>The accepted values are:
  10489. </p><dl compact="compact">
  10490. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  10491. <dd><p>BT.709
  10492. </p>
  10493. </dd>
  10494. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  10495. <dd><p>FCC
  10496. </p>
  10497. </dd>
  10498. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  10499. <dd><p>BT.470BG or BT.601-6 625
  10500. </p>
  10501. </dd>
  10502. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  10503. <dd><p>SMPTE-170M or BT.601-6 525
  10504. </p>
  10505. </dd>
  10506. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  10507. <dd><p>SMPTE-240M
  10508. </p>
  10509. </dd>
  10510. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  10511. <dd><p>YCgCo
  10512. </p>
  10513. </dd>
  10514. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  10515. <dd><p>BT.2020 with non-constant luminance
  10516. </p>
  10517. </dd>
  10518. </dl>
  10519. <span id="trc"></span></dd>
  10520. <dt><samp>trc</samp></dt>
  10521. <dd><p>Specify output transfer characteristics.
  10522. </p>
  10523. <p>The accepted values are:
  10524. </p><dl compact="compact">
  10525. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  10526. <dd><p>BT.709
  10527. </p>
  10528. </dd>
  10529. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  10530. <dd><p>BT.470M
  10531. </p>
  10532. </dd>
  10533. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  10534. <dd><p>BT.470BG
  10535. </p>
  10536. </dd>
  10537. <dt>&lsquo;<samp>gamma22</samp>&rsquo;</dt>
  10538. <dd><p>Constant gamma of 2.2
  10539. </p>
  10540. </dd>
  10541. <dt>&lsquo;<samp>gamma28</samp>&rsquo;</dt>
  10542. <dd><p>Constant gamma of 2.8
  10543. </p>
  10544. </dd>
  10545. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  10546. <dd><p>SMPTE-170M, BT.601-6 625 or BT.601-6 525
  10547. </p>
  10548. </dd>
  10549. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  10550. <dd><p>SMPTE-240M
  10551. </p>
  10552. </dd>
  10553. <dt>&lsquo;<samp>srgb</samp>&rsquo;</dt>
  10554. <dd><p>SRGB
  10555. </p>
  10556. </dd>
  10557. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  10558. <dd><p>iec61966-2-1
  10559. </p>
  10560. </dd>
  10561. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  10562. <dd><p>iec61966-2-4
  10563. </p>
  10564. </dd>
  10565. <dt>&lsquo;<samp>xvycc</samp>&rsquo;</dt>
  10566. <dd><p>xvycc
  10567. </p>
  10568. </dd>
  10569. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  10570. <dd><p>BT.2020 for 10-bits content
  10571. </p>
  10572. </dd>
  10573. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  10574. <dd><p>BT.2020 for 12-bits content
  10575. </p>
  10576. </dd>
  10577. </dl>
  10578. <span id="primaries"></span></dd>
  10579. <dt><samp>primaries</samp></dt>
  10580. <dd><p>Specify output color primaries.
  10581. </p>
  10582. <p>The accepted values are:
  10583. </p><dl compact="compact">
  10584. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  10585. <dd><p>BT.709
  10586. </p>
  10587. </dd>
  10588. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  10589. <dd><p>BT.470M
  10590. </p>
  10591. </dd>
  10592. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  10593. <dd><p>BT.470BG or BT.601-6 625
  10594. </p>
  10595. </dd>
  10596. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  10597. <dd><p>SMPTE-170M or BT.601-6 525
  10598. </p>
  10599. </dd>
  10600. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  10601. <dd><p>SMPTE-240M
  10602. </p>
  10603. </dd>
  10604. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  10605. <dd><p>film
  10606. </p>
  10607. </dd>
  10608. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  10609. <dd><p>SMPTE-431
  10610. </p>
  10611. </dd>
  10612. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  10613. <dd><p>SMPTE-432
  10614. </p>
  10615. </dd>
  10616. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  10617. <dd><p>BT.2020
  10618. </p>
  10619. </dd>
  10620. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  10621. <dd><p>JEDEC P22 phosphors
  10622. </p>
  10623. </dd>
  10624. </dl>
  10625. <span id="range"></span></dd>
  10626. <dt><samp>range</samp></dt>
  10627. <dd><p>Specify output color range.
  10628. </p>
  10629. <p>The accepted values are:
  10630. </p><dl compact="compact">
  10631. <dt>&lsquo;<samp>tv</samp>&rsquo;</dt>
  10632. <dd><p>TV (restricted) range
  10633. </p>
  10634. </dd>
  10635. <dt>&lsquo;<samp>mpeg</samp>&rsquo;</dt>
  10636. <dd><p>MPEG (restricted) range
  10637. </p>
  10638. </dd>
  10639. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  10640. <dd><p>PC (full) range
  10641. </p>
  10642. </dd>
  10643. <dt>&lsquo;<samp>jpeg</samp>&rsquo;</dt>
  10644. <dd><p>JPEG (full) range
  10645. </p>
  10646. </dd>
  10647. </dl>
  10648. </dd>
  10649. <dt><samp>format</samp></dt>
  10650. <dd><p>Specify output color format.
  10651. </p>
  10652. <p>The accepted values are:
  10653. </p><dl compact="compact">
  10654. <dt>&lsquo;<samp>yuv420p</samp>&rsquo;</dt>
  10655. <dd><p>YUV 4:2:0 planar 8-bits
  10656. </p>
  10657. </dd>
  10658. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  10659. <dd><p>YUV 4:2:0 planar 10-bits
  10660. </p>
  10661. </dd>
  10662. <dt>&lsquo;<samp>yuv420p12</samp>&rsquo;</dt>
  10663. <dd><p>YUV 4:2:0 planar 12-bits
  10664. </p>
  10665. </dd>
  10666. <dt>&lsquo;<samp>yuv422p</samp>&rsquo;</dt>
  10667. <dd><p>YUV 4:2:2 planar 8-bits
  10668. </p>
  10669. </dd>
  10670. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  10671. <dd><p>YUV 4:2:2 planar 10-bits
  10672. </p>
  10673. </dd>
  10674. <dt>&lsquo;<samp>yuv422p12</samp>&rsquo;</dt>
  10675. <dd><p>YUV 4:2:2 planar 12-bits
  10676. </p>
  10677. </dd>
  10678. <dt>&lsquo;<samp>yuv444p</samp>&rsquo;</dt>
  10679. <dd><p>YUV 4:4:4 planar 8-bits
  10680. </p>
  10681. </dd>
  10682. <dt>&lsquo;<samp>yuv444p10</samp>&rsquo;</dt>
  10683. <dd><p>YUV 4:4:4 planar 10-bits
  10684. </p>
  10685. </dd>
  10686. <dt>&lsquo;<samp>yuv444p12</samp>&rsquo;</dt>
  10687. <dd><p>YUV 4:4:4 planar 12-bits
  10688. </p>
  10689. </dd>
  10690. </dl>
  10691. </dd>
  10692. <dt><samp>fast</samp></dt>
  10693. <dd><p>Do a fast conversion, which skips gamma/primary correction. This will take
  10694. significantly less CPU, but will be mathematically incorrect. To get output
  10695. compatible with that produced by the colormatrix filter, use fast=1.
  10696. </p>
  10697. </dd>
  10698. <dt><samp>dither</samp></dt>
  10699. <dd><p>Specify dithering mode.
  10700. </p>
  10701. <p>The accepted values are:
  10702. </p><dl compact="compact">
  10703. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  10704. <dd><p>No dithering
  10705. </p>
  10706. </dd>
  10707. <dt>&lsquo;<samp>fsb</samp>&rsquo;</dt>
  10708. <dd><p>Floyd-Steinberg dithering
  10709. </p></dd>
  10710. </dl>
  10711. </dd>
  10712. <dt><samp>wpadapt</samp></dt>
  10713. <dd><p>Whitepoint adaptation mode.
  10714. </p>
  10715. <p>The accepted values are:
  10716. </p><dl compact="compact">
  10717. <dt>&lsquo;<samp>bradford</samp>&rsquo;</dt>
  10718. <dd><p>Bradford whitepoint adaptation
  10719. </p>
  10720. </dd>
  10721. <dt>&lsquo;<samp>vonkries</samp>&rsquo;</dt>
  10722. <dd><p>von Kries whitepoint adaptation
  10723. </p>
  10724. </dd>
  10725. <dt>&lsquo;<samp>identity</samp>&rsquo;</dt>
  10726. <dd><p>identity whitepoint adaptation (i.e. no whitepoint adaptation)
  10727. </p></dd>
  10728. </dl>
  10729. </dd>
  10730. <dt><samp>iall</samp></dt>
  10731. <dd><p>Override all input properties at once. Same accepted values as <a href="#all">all</a>.
  10732. </p>
  10733. </dd>
  10734. <dt><samp>ispace</samp></dt>
  10735. <dd><p>Override input colorspace. Same accepted values as <a href="#space">space</a>.
  10736. </p>
  10737. </dd>
  10738. <dt><samp>iprimaries</samp></dt>
  10739. <dd><p>Override input color primaries. Same accepted values as <a href="#primaries">primaries</a>.
  10740. </p>
  10741. </dd>
  10742. <dt><samp>itrc</samp></dt>
  10743. <dd><p>Override input transfer characteristics. Same accepted values as <a href="#trc">trc</a>.
  10744. </p>
  10745. </dd>
  10746. <dt><samp>irange</samp></dt>
  10747. <dd><p>Override input color range. Same accepted values as <a href="#range">range</a>.
  10748. </p>
  10749. </dd>
  10750. </dl>
  10751. <p>The filter converts the transfer characteristics, color space and color
  10752. primaries to the specified user values. The output value, if not specified,
  10753. is set to a default value based on the &quot;all&quot; property. If that property is
  10754. also not specified, the filter will log an error. The output color range and
  10755. format default to the same value as the input color range and format. The
  10756. input transfer characteristics, color space, color primaries and color range
  10757. should be set on the input data. If any of these are missing, the filter will
  10758. log an error and no conversion will take place.
  10759. </p>
  10760. <p>For example to convert the input to SMPTE-240M, use the command:
  10761. </p><div class="example">
  10762. <pre class="example">colorspace=smpte240m
  10763. </pre></div>
  10764. <a name="colortemperature"></a>
  10765. <h3 class="section">11.34 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>
  10766. <p>Adjust color temperature in video to simulate variations in ambient color temperature.
  10767. </p>
  10768. <p>The filter accepts the following options:
  10769. </p>
  10770. <dl compact="compact">
  10771. <dt><samp>temperature</samp></dt>
  10772. <dd><p>Set the temperature in Kelvin. Allowed range is from 1000 to 40000.
  10773. Default value is 6500 K.
  10774. </p>
  10775. </dd>
  10776. <dt><samp>mix</samp></dt>
  10777. <dd><p>Set mixing with filtered output. Allowed range is from 0 to 1.
  10778. Default value is 1.
  10779. </p>
  10780. </dd>
  10781. <dt><samp>pl</samp></dt>
  10782. <dd><p>Set the amount of preserving lightness. Allowed range is from 0 to 1.
  10783. Default value is 0.
  10784. </p></dd>
  10785. </dl>
  10786. <a name="Commands-62"></a>
  10787. <h4 class="subsection">11.34.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>
  10788. <p>This filter supports same <a href="#commands">commands</a> as options.
  10789. </p>
  10790. <a name="convolution"></a>
  10791. <h3 class="section">11.35 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>
  10792. <p>Apply convolution of 3x3, 5x5, 7x7 or horizontal/vertical up to 49 elements.
  10793. </p>
  10794. <p>The filter accepts the following options:
  10795. </p>
  10796. <dl compact="compact">
  10797. <dt><samp>0m</samp></dt>
  10798. <dt><samp>1m</samp></dt>
  10799. <dt><samp>2m</samp></dt>
  10800. <dt><samp>3m</samp></dt>
  10801. <dd><p>Set matrix for each plane.
  10802. Matrix is sequence of 9, 25 or 49 signed integers in <var>square</var> mode,
  10803. and from 1 to 49 odd number of signed integers in <var>row</var> mode.
  10804. </p>
  10805. </dd>
  10806. <dt><samp>0rdiv</samp></dt>
  10807. <dt><samp>1rdiv</samp></dt>
  10808. <dt><samp>2rdiv</samp></dt>
  10809. <dt><samp>3rdiv</samp></dt>
  10810. <dd><p>Set multiplier for calculated value for each plane.
  10811. If unset or 0, it will be sum of all matrix elements.
  10812. </p>
  10813. </dd>
  10814. <dt><samp>0bias</samp></dt>
  10815. <dt><samp>1bias</samp></dt>
  10816. <dt><samp>2bias</samp></dt>
  10817. <dt><samp>3bias</samp></dt>
  10818. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  10819. Useful for making the overall image brighter or darker. Default is 0.0.
  10820. </p>
  10821. </dd>
  10822. <dt><samp>0mode</samp></dt>
  10823. <dt><samp>1mode</samp></dt>
  10824. <dt><samp>2mode</samp></dt>
  10825. <dt><samp>3mode</samp></dt>
  10826. <dd><p>Set matrix mode for each plane. Can be <var>square</var>, <var>row</var> or <var>column</var>.
  10827. Default is <var>square</var>.
  10828. </p></dd>
  10829. </dl>
  10830. <a name="Commands-63"></a>
  10831. <h4 class="subsection">11.35.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>
  10832. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  10833. </p>
  10834. <a name="Examples-50"></a>
  10835. <h4 class="subsection">11.35.2 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>
  10836. <ul>
  10837. <li> Apply sharpen:
  10838. <div class="example">
  10839. <pre class="example">convolution=&quot;0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0&quot;
  10840. </pre></div>
  10841. </li><li> Apply blur:
  10842. <div class="example">
  10843. <pre class="example">convolution=&quot;1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9&quot;
  10844. </pre></div>
  10845. </li><li> Apply edge enhance:
  10846. <div class="example">
  10847. <pre class="example">convolution=&quot;0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128&quot;
  10848. </pre></div>
  10849. </li><li> Apply edge detect:
  10850. <div class="example">
  10851. <pre class="example">convolution=&quot;0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128&quot;
  10852. </pre></div>
  10853. </li><li> Apply laplacian edge detector which includes diagonals:
  10854. <div class="example">
  10855. <pre class="example">convolution=&quot;1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0&quot;
  10856. </pre></div>
  10857. </li><li> Apply emboss:
  10858. <div class="example">
  10859. <pre class="example">convolution=&quot;-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2&quot;
  10860. </pre></div>
  10861. </li></ul>
  10862. <a name="convolve"></a>
  10863. <h3 class="section">11.36 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>
  10864. <p>Apply 2D convolution of video stream in frequency domain using second stream
  10865. as impulse.
  10866. </p>
  10867. <p>The filter accepts the following options:
  10868. </p>
  10869. <dl compact="compact">
  10870. <dt><samp>planes</samp></dt>
  10871. <dd><p>Set which planes to process.
  10872. </p>
  10873. </dd>
  10874. <dt><samp>impulse</samp></dt>
  10875. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  10876. or <var>all</var>. Default is <var>all</var>.
  10877. </p></dd>
  10878. </dl>
  10879. <p>The <code>convolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  10880. </p>
  10881. <a name="copy"></a>
  10882. <h3 class="section">11.37 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>
  10883. <p>Copy the input video source unchanged to the output. This is mainly useful for
  10884. testing purposes.
  10885. </p>
  10886. <span id="coreimage"></span><a name="coreimage-1"></a>
  10887. <h3 class="section">11.38 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>
  10888. <p>Video filtering on GPU using Apple&rsquo;s CoreImage API on OSX.
  10889. </p>
  10890. <p>Hardware acceleration is based on an OpenGL context. Usually, this means it is
  10891. processed by video hardware. However, software-based OpenGL implementations
  10892. exist which means there is no guarantee for hardware processing. It depends on
  10893. the respective OSX.
  10894. </p>
  10895. <p>There are many filters and image generators provided by Apple that come with a
  10896. large variety of options. The filter has to be referenced by its name along
  10897. with its options.
  10898. </p>
  10899. <p>The coreimage filter accepts the following options:
  10900. </p><dl compact="compact">
  10901. <dt><samp>list_filters</samp></dt>
  10902. <dd><p>List all available filters and generators along with all their respective
  10903. options as well as possible minimum and maximum values along with the default
  10904. values.
  10905. </p><div class="example">
  10906. <pre class="example">list_filters=true
  10907. </pre></div>
  10908. </dd>
  10909. <dt><samp>filter</samp></dt>
  10910. <dd><p>Specify all filters by their respective name and options.
  10911. Use <var>list_filters</var> to determine all valid filter names and options.
  10912. Numerical options are specified by a float value and are automatically clamped
  10913. to their respective value range. Vector and color options have to be specified
  10914. by a list of space separated float values. Character escaping has to be done.
  10915. A special option name <code>default</code> is available to use default options for a
  10916. filter.
  10917. </p>
  10918. <p>It is required to specify either <code>default</code> or at least one of the filter options.
  10919. All omitted options are used with their default values.
  10920. The syntax of the filter string is as follows:
  10921. </p><div class="example">
  10922. <pre class="example">filter=&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...][#&lt;NAME&gt;@&lt;OPTION&gt;=&lt;VALUE&gt;[@&lt;OPTION&gt;=&lt;VALUE&gt;][@...]][#...]
  10923. </pre></div>
  10924. </dd>
  10925. <dt><samp>output_rect</samp></dt>
  10926. <dd><p>Specify a rectangle where the output of the filter chain is copied into the
  10927. input image. It is given by a list of space separated float values:
  10928. </p><div class="example">
  10929. <pre class="example">output_rect=x\ y\ width\ height
  10930. </pre></div>
  10931. <p>If not given, the output rectangle equals the dimensions of the input image.
  10932. The output rectangle is automatically cropped at the borders of the input
  10933. image. Negative values are valid for each component.
  10934. </p><div class="example">
  10935. <pre class="example">output_rect=25\ 25\ 100\ 100
  10936. </pre></div>
  10937. </dd>
  10938. </dl>
  10939. <p>Several filters can be chained for successive processing without GPU-HOST
  10940. transfers allowing for fast processing of complex filter chains.
  10941. Currently, only filters with zero (generators) or exactly one (filters) input
  10942. image and one output image are supported. Also, transition filters are not yet
  10943. usable as intended.
  10944. </p>
  10945. <p>Some filters generate output images with additional padding depending on the
  10946. respective filter kernel. The padding is automatically removed to ensure the
  10947. filter output has the same size as the input image.
  10948. </p>
  10949. <p>For image generators, the size of the output image is determined by the
  10950. previous output image of the filter chain or the input image of the whole
  10951. filterchain, respectively. The generators do not use the pixel information of
  10952. this image to generate their output. However, the generated output is
  10953. blended onto this image, resulting in partial or complete coverage of the
  10954. output image.
  10955. </p>
  10956. <p>The <a href="#coreimagesrc">coreimagesrc</a> video source can be used for generating input images
  10957. which are directly fed into the filter chain. By using it, providing input
  10958. images by another video source or an input video is not required.
  10959. </p>
  10960. <a name="Examples-51"></a>
  10961. <h4 class="subsection">11.38.1 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>
  10962. <ul>
  10963. <li> List all filters available:
  10964. <div class="example">
  10965. <pre class="example">coreimage=list_filters=true
  10966. </pre></div>
  10967. </li><li> Use the CIBoxBlur filter with default options to blur an image:
  10968. <div class="example">
  10969. <pre class="example">coreimage=filter=CIBoxBlur@default
  10970. </pre></div>
  10971. </li><li> Use a filter chain with CISepiaTone at default values and CIVignetteEffect with
  10972. its center at 100x100 and a radius of 50 pixels:
  10973. <div class="example">
  10974. <pre class="example">coreimage=filter=CIBoxBlur@default#CIVignetteEffect@inputCenter=100\ 100@inputRadius=50
  10975. </pre></div>
  10976. </li><li> Use nullsrc and CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  10977. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  10978. <div class="example">
  10979. <pre class="example">ffmpeg -f lavfi -i nullsrc=s=100x100,coreimage=filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  10980. </pre></div>
  10981. </li></ul>
  10982. <a name="cover_005frect"></a>
  10983. <h3 class="section">11.39 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>
  10984. <p>Cover a rectangular object
  10985. </p>
  10986. <p>It accepts the following options:
  10987. </p>
  10988. <dl compact="compact">
  10989. <dt><samp>cover</samp></dt>
  10990. <dd><p>Filepath of the optional cover image, needs to be in yuv420.
  10991. </p>
  10992. </dd>
  10993. <dt><samp>mode</samp></dt>
  10994. <dd><p>Set covering mode.
  10995. </p>
  10996. <p>It accepts the following values:
  10997. </p><dl compact="compact">
  10998. <dt>&lsquo;<samp>cover</samp>&rsquo;</dt>
  10999. <dd><p>cover it by the supplied image
  11000. </p></dd>
  11001. <dt>&lsquo;<samp>blur</samp>&rsquo;</dt>
  11002. <dd><p>cover it by interpolating the surrounding pixels
  11003. </p></dd>
  11004. </dl>
  11005. <p>Default value is <var>blur</var>.
  11006. </p></dd>
  11007. </dl>
  11008. <a name="Examples-52"></a>
  11009. <h4 class="subsection">11.39.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>
  11010. <ul>
  11011. <li> Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  11012. <div class="example">
  11013. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  11014. </pre></div>
  11015. </li></ul>
  11016. <a name="crop"></a>
  11017. <h3 class="section">11.40 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>
  11018. <p>Crop the input video to given dimensions.
  11019. </p>
  11020. <p>It accepts the following parameters:
  11021. </p>
  11022. <dl compact="compact">
  11023. <dt><samp>w, out_w</samp></dt>
  11024. <dd><p>The width of the output video. It defaults to <code>iw</code>.
  11025. This expression is evaluated only once during the filter
  11026. configuration, or when the &lsquo;<samp>w</samp>&rsquo; or &lsquo;<samp>out_w</samp>&rsquo; command is sent.
  11027. </p>
  11028. </dd>
  11029. <dt><samp>h, out_h</samp></dt>
  11030. <dd><p>The height of the output video. It defaults to <code>ih</code>.
  11031. This expression is evaluated only once during the filter
  11032. configuration, or when the &lsquo;<samp>h</samp>&rsquo; or &lsquo;<samp>out_h</samp>&rsquo; command is sent.
  11033. </p>
  11034. </dd>
  11035. <dt><samp>x</samp></dt>
  11036. <dd><p>The horizontal position, in the input video, of the left edge of the output
  11037. video. It defaults to <code>(in_w-out_w)/2</code>.
  11038. This expression is evaluated per-frame.
  11039. </p>
  11040. </dd>
  11041. <dt><samp>y</samp></dt>
  11042. <dd><p>The vertical position, in the input video, of the top edge of the output video.
  11043. It defaults to <code>(in_h-out_h)/2</code>.
  11044. This expression is evaluated per-frame.
  11045. </p>
  11046. </dd>
  11047. <dt><samp>keep_aspect</samp></dt>
  11048. <dd><p>If set to 1 will force the output display aspect ratio
  11049. to be the same of the input, by changing the output sample aspect
  11050. ratio. It defaults to 0.
  11051. </p>
  11052. </dd>
  11053. <dt><samp>exact</samp></dt>
  11054. <dd><p>Enable exact cropping. If enabled, subsampled videos will be cropped at exact
  11055. width/height/x/y as specified and will not be rounded to nearest smaller value.
  11056. It defaults to 0.
  11057. </p></dd>
  11058. </dl>
  11059. <p>The <var>out_w</var>, <var>out_h</var>, <var>x</var>, <var>y</var> parameters are
  11060. expressions containing the following constants:
  11061. </p>
  11062. <dl compact="compact">
  11063. <dt><samp>x</samp></dt>
  11064. <dt><samp>y</samp></dt>
  11065. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  11066. each new frame.
  11067. </p>
  11068. </dd>
  11069. <dt><samp>in_w</samp></dt>
  11070. <dt><samp>in_h</samp></dt>
  11071. <dd><p>The input width and height.
  11072. </p>
  11073. </dd>
  11074. <dt><samp>iw</samp></dt>
  11075. <dt><samp>ih</samp></dt>
  11076. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  11077. </p>
  11078. </dd>
  11079. <dt><samp>out_w</samp></dt>
  11080. <dt><samp>out_h</samp></dt>
  11081. <dd><p>The output (cropped) width and height.
  11082. </p>
  11083. </dd>
  11084. <dt><samp>ow</samp></dt>
  11085. <dt><samp>oh</samp></dt>
  11086. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  11087. </p>
  11088. </dd>
  11089. <dt><samp>a</samp></dt>
  11090. <dd><p>same as <var>iw</var> / <var>ih</var>
  11091. </p>
  11092. </dd>
  11093. <dt><samp>sar</samp></dt>
  11094. <dd><p>input sample aspect ratio
  11095. </p>
  11096. </dd>
  11097. <dt><samp>dar</samp></dt>
  11098. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  11099. </p>
  11100. </dd>
  11101. <dt><samp>hsub</samp></dt>
  11102. <dt><samp>vsub</samp></dt>
  11103. <dd><p>horizontal and vertical chroma subsample values. For example for the
  11104. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  11105. </p>
  11106. </dd>
  11107. <dt><samp>n</samp></dt>
  11108. <dd><p>The number of the input frame, starting from 0.
  11109. </p>
  11110. </dd>
  11111. <dt><samp>pos</samp></dt>
  11112. <dd><p>the position in the file of the input frame, NAN if unknown
  11113. </p>
  11114. </dd>
  11115. <dt><samp>t</samp></dt>
  11116. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  11117. </p>
  11118. </dd>
  11119. </dl>
  11120. <p>The expression for <var>out_w</var> may depend on the value of <var>out_h</var>,
  11121. and the expression for <var>out_h</var> may depend on <var>out_w</var>, but they
  11122. cannot depend on <var>x</var> and <var>y</var>, as <var>x</var> and <var>y</var> are
  11123. evaluated after <var>out_w</var> and <var>out_h</var>.
  11124. </p>
  11125. <p>The <var>x</var> and <var>y</var> parameters specify the expressions for the
  11126. position of the top-left corner of the output (non-cropped) area. They
  11127. are evaluated for each frame. If the evaluated value is not valid, it
  11128. is approximated to the nearest valid value.
  11129. </p>
  11130. <p>The expression for <var>x</var> may depend on <var>y</var>, and the expression
  11131. for <var>y</var> may depend on <var>x</var>.
  11132. </p>
  11133. <a name="Examples-53"></a>
  11134. <h4 class="subsection">11.40.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>
  11135. <ul>
  11136. <li> Crop area with size 100x100 at position (12,34).
  11137. <div class="example">
  11138. <pre class="example">crop=100:100:12:34
  11139. </pre></div>
  11140. <p>Using named options, the example above becomes:
  11141. </p><div class="example">
  11142. <pre class="example">crop=w=100:h=100:x=12:y=34
  11143. </pre></div>
  11144. </li><li> Crop the central input area with size 100x100:
  11145. <div class="example">
  11146. <pre class="example">crop=100:100
  11147. </pre></div>
  11148. </li><li> Crop the central input area with size 2/3 of the input video:
  11149. <div class="example">
  11150. <pre class="example">crop=2/3*in_w:2/3*in_h
  11151. </pre></div>
  11152. </li><li> Crop the input video central square:
  11153. <div class="example">
  11154. <pre class="example">crop=out_w=in_h
  11155. crop=in_h
  11156. </pre></div>
  11157. </li><li> Delimit the rectangle with the top-left corner placed at position
  11158. 100:100 and the right-bottom corner corresponding to the right-bottom
  11159. corner of the input image.
  11160. <div class="example">
  11161. <pre class="example">crop=in_w-100:in_h-100:100:100
  11162. </pre></div>
  11163. </li><li> Crop 10 pixels from the left and right borders, and 20 pixels from
  11164. the top and bottom borders
  11165. <div class="example">
  11166. <pre class="example">crop=in_w-2*10:in_h-2*20
  11167. </pre></div>
  11168. </li><li> Keep only the bottom right quarter of the input image:
  11169. <div class="example">
  11170. <pre class="example">crop=in_w/2:in_h/2:in_w/2:in_h/2
  11171. </pre></div>
  11172. </li><li> Crop height for getting Greek harmony:
  11173. <div class="example">
  11174. <pre class="example">crop=in_w:1/PHI*in_w
  11175. </pre></div>
  11176. </li><li> Apply trembling effect:
  11177. <div class="example">
  11178. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)
  11179. </pre></div>
  11180. </li><li> Apply erratic camera effect depending on timestamp:
  11181. <div class="example">
  11182. <pre class="example">crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)&quot;
  11183. </pre></div>
  11184. </li><li> Set x depending on the value of y:
  11185. <div class="example">
  11186. <pre class="example">crop=in_w/2:in_h/2:y:10+10*sin(n/10)
  11187. </pre></div>
  11188. </li></ul>
  11189. <a name="Commands-64"></a>
  11190. <h4 class="subsection">11.40.2 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>
  11191. <p>This filter supports the following commands:
  11192. </p><dl compact="compact">
  11193. <dt><samp>w, out_w</samp></dt>
  11194. <dt><samp>h, out_h</samp></dt>
  11195. <dt><samp>x</samp></dt>
  11196. <dt><samp>y</samp></dt>
  11197. <dd><p>Set width/height of the output video and the horizontal/vertical position
  11198. in the input video.
  11199. The command accepts the same syntax of the corresponding option.
  11200. </p>
  11201. <p>If the specified expression is not valid, it is kept at its current
  11202. value.
  11203. </p></dd>
  11204. </dl>
  11205. <a name="cropdetect"></a>
  11206. <h3 class="section">11.41 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>
  11207. <p>Auto-detect the crop size.
  11208. </p>
  11209. <p>It calculates the necessary cropping parameters and prints the
  11210. recommended parameters via the logging system. The detected dimensions
  11211. correspond to the non-black area of the input video.
  11212. </p>
  11213. <p>It accepts the following parameters:
  11214. </p>
  11215. <dl compact="compact">
  11216. <dt><samp>limit</samp></dt>
  11217. <dd><p>Set higher black value threshold, which can be optionally specified
  11218. from nothing (0) to everything (255 for 8-bit based formats). An intensity
  11219. value greater to the set value is considered non-black. It defaults to 24.
  11220. You can also specify a value between 0.0 and 1.0 which will be scaled depending
  11221. on the bitdepth of the pixel format.
  11222. </p>
  11223. </dd>
  11224. <dt><samp>round</samp></dt>
  11225. <dd><p>The value which the width/height should be divisible by. It defaults to
  11226. 16. The offset is automatically adjusted to center the video. Use 2 to
  11227. get only even dimensions (needed for 4:2:2 video). 16 is best when
  11228. encoding to most video codecs.
  11229. </p>
  11230. </dd>
  11231. <dt><samp>skip</samp></dt>
  11232. <dd><p>Set the number of initial frames for which evaluation is skipped.
  11233. Default is 2. Range is 0 to INT_MAX.
  11234. </p>
  11235. </dd>
  11236. <dt><samp>reset_count, reset</samp></dt>
  11237. <dd><p>Set the counter that determines after how many frames cropdetect will
  11238. reset the previously detected largest video area and start over to
  11239. detect the current optimal crop area. Default value is 0.
  11240. </p>
  11241. <p>This can be useful when channel logos distort the video area. 0
  11242. indicates &rsquo;never reset&rsquo;, and returns the largest area encountered during
  11243. playback.
  11244. </p></dd>
  11245. </dl>
  11246. <span id="cue"></span><a name="cue-1"></a>
  11247. <h3 class="section">11.42 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>
  11248. <p>Delay video filtering until a given wallclock timestamp. The filter first
  11249. passes on <samp>preroll</samp> amount of frames, then it buffers at most
  11250. <samp>buffer</samp> amount of frames and waits for the cue. After reaching the cue
  11251. it forwards the buffered frames and also any subsequent frames coming in its
  11252. input.
  11253. </p>
  11254. <p>The filter can be used synchronize the output of multiple ffmpeg processes for
  11255. realtime output devices like decklink. By putting the delay in the filtering
  11256. chain and pre-buffering frames the process can pass on data to output almost
  11257. immediately after the target wallclock timestamp is reached.
  11258. </p>
  11259. <p>Perfect frame accuracy cannot be guaranteed, but the result is good enough for
  11260. some use cases.
  11261. </p>
  11262. <dl compact="compact">
  11263. <dt><samp>cue</samp></dt>
  11264. <dd><p>The cue timestamp expressed in a UNIX timestamp in microseconds. Default is 0.
  11265. </p>
  11266. </dd>
  11267. <dt><samp>preroll</samp></dt>
  11268. <dd><p>The duration of content to pass on as preroll expressed in seconds. Default is 0.
  11269. </p>
  11270. </dd>
  11271. <dt><samp>buffer</samp></dt>
  11272. <dd><p>The maximum duration of content to buffer before waiting for the cue expressed
  11273. in seconds. Default is 0.
  11274. </p>
  11275. </dd>
  11276. </dl>
  11277. <span id="curves"></span><a name="curves-1"></a>
  11278. <h3 class="section">11.43 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>
  11279. <p>Apply color adjustments using curves.
  11280. </p>
  11281. <p>This filter is similar to the Adobe Photoshop and GIMP curves tools. Each
  11282. component (red, green and blue) has its values defined by <var>N</var> key points
  11283. tied from each other using a smooth curve. The x-axis represents the pixel
  11284. values from the input frame, and the y-axis the new pixel values to be set for
  11285. the output frame.
  11286. </p>
  11287. <p>By default, a component curve is defined by the two points <var>(0;0)</var> and
  11288. <var>(1;1)</var>. This creates a straight line where each original pixel value is
  11289. &quot;adjusted&quot; to its own value, which means no change to the image.
  11290. </p>
  11291. <p>The filter allows you to redefine these two points and add some more. A new
  11292. curve (using a natural cubic spline interpolation) will be define to pass
  11293. smoothly through all these new coordinates. The new defined points needs to be
  11294. strictly increasing over the x-axis, and their <var>x</var> and <var>y</var> values must
  11295. be in the <var>[0;1]</var> interval. If the computed curves happened to go outside
  11296. the vector spaces, the values will be clipped accordingly.
  11297. </p>
  11298. <p>The filter accepts the following options:
  11299. </p>
  11300. <dl compact="compact">
  11301. <dt><samp>preset</samp></dt>
  11302. <dd><p>Select one of the available color presets. This option can be used in addition
  11303. to the <samp>r</samp>, <samp>g</samp>, <samp>b</samp> parameters; in this case, the later
  11304. options takes priority on the preset values.
  11305. Available presets are:
  11306. </p><dl compact="compact">
  11307. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  11308. <dt>&lsquo;<samp>color_negative</samp>&rsquo;</dt>
  11309. <dt>&lsquo;<samp>cross_process</samp>&rsquo;</dt>
  11310. <dt>&lsquo;<samp>darker</samp>&rsquo;</dt>
  11311. <dt>&lsquo;<samp>increase_contrast</samp>&rsquo;</dt>
  11312. <dt>&lsquo;<samp>lighter</samp>&rsquo;</dt>
  11313. <dt>&lsquo;<samp>linear_contrast</samp>&rsquo;</dt>
  11314. <dt>&lsquo;<samp>medium_contrast</samp>&rsquo;</dt>
  11315. <dt>&lsquo;<samp>negative</samp>&rsquo;</dt>
  11316. <dt>&lsquo;<samp>strong_contrast</samp>&rsquo;</dt>
  11317. <dt>&lsquo;<samp>vintage</samp>&rsquo;</dt>
  11318. </dl>
  11319. <p>Default is <code>none</code>.
  11320. </p></dd>
  11321. <dt><samp>master, m</samp></dt>
  11322. <dd><p>Set the master key points. These points will define a second pass mapping. It
  11323. is sometimes called a &quot;luminance&quot; or &quot;value&quot; mapping. It can be used with
  11324. <samp>r</samp>, <samp>g</samp>, <samp>b</samp> or <samp>all</samp> since it acts like a
  11325. post-processing LUT.
  11326. </p></dd>
  11327. <dt><samp>red, r</samp></dt>
  11328. <dd><p>Set the key points for the red component.
  11329. </p></dd>
  11330. <dt><samp>green, g</samp></dt>
  11331. <dd><p>Set the key points for the green component.
  11332. </p></dd>
  11333. <dt><samp>blue, b</samp></dt>
  11334. <dd><p>Set the key points for the blue component.
  11335. </p></dd>
  11336. <dt><samp>all</samp></dt>
  11337. <dd><p>Set the key points for all components (not including master).
  11338. Can be used in addition to the other key points component
  11339. options. In this case, the unset component(s) will fallback on this
  11340. <samp>all</samp> setting.
  11341. </p></dd>
  11342. <dt><samp>psfile</samp></dt>
  11343. <dd><p>Specify a Photoshop curves file (<code>.acv</code>) to import the settings from.
  11344. </p></dd>
  11345. <dt><samp>plot</samp></dt>
  11346. <dd><p>Save Gnuplot script of the curves in specified file.
  11347. </p></dd>
  11348. </dl>
  11349. <p>To avoid some filtergraph syntax conflicts, each key points list need to be
  11350. defined using the following syntax: <code>x0/y0 x1/y1 x2/y2 ...</code>.
  11351. </p>
  11352. <a name="Commands-65"></a>
  11353. <h4 class="subsection">11.43.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>
  11354. <p>This filter supports same <a href="#commands">commands</a> as options.
  11355. </p>
  11356. <a name="Examples-54"></a>
  11357. <h4 class="subsection">11.43.2 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>
  11358. <ul>
  11359. <li> Increase slightly the middle level of blue:
  11360. <div class="example">
  11361. <pre class="example">curves=blue='0/0 0.5/0.58 1/1'
  11362. </pre></div>
  11363. </li><li> Vintage effect:
  11364. <div class="example">
  11365. <pre class="example">curves=r='0/0.11 .42/.51 1/0.95':g='0/0 0.50/0.48 1/1':b='0/0.22 .49/.44 1/0.8'
  11366. </pre></div>
  11367. <p>Here we obtain the following coordinates for each components:
  11368. </p><dl compact="compact">
  11369. <dt><var>red</var></dt>
  11370. <dd><p><code>(0;0.11) (0.42;0.51) (1;0.95)</code>
  11371. </p></dd>
  11372. <dt><var>green</var></dt>
  11373. <dd><p><code>(0;0) (0.50;0.48) (1;1)</code>
  11374. </p></dd>
  11375. <dt><var>blue</var></dt>
  11376. <dd><p><code>(0;0.22) (0.49;0.44) (1;0.80)</code>
  11377. </p></dd>
  11378. </dl>
  11379. </li><li> The previous example can also be achieved with the associated built-in preset:
  11380. <div class="example">
  11381. <pre class="example">curves=preset=vintage
  11382. </pre></div>
  11383. </li><li> Or simply:
  11384. <div class="example">
  11385. <pre class="example">curves=vintage
  11386. </pre></div>
  11387. </li><li> Use a Photoshop preset and redefine the points of the green component:
  11388. <div class="example">
  11389. <pre class="example">curves=psfile='MyCurvesPresets/purple.acv':green='0/0 0.45/0.53 1/1'
  11390. </pre></div>
  11391. </li><li> Check out the curves of the <code>cross_process</code> profile using <code>ffmpeg</code>
  11392. and <code>gnuplot</code>:
  11393. <div class="example">
  11394. <pre class="example">ffmpeg -f lavfi -i color -vf curves=cross_process:plot=/tmp/curves.plt -frames:v 1 -f null -
  11395. gnuplot -p /tmp/curves.plt
  11396. </pre></div>
  11397. </li></ul>
  11398. <a name="datascope"></a>
  11399. <h3 class="section">11.44 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>
  11400. <p>Video data analysis filter.
  11401. </p>
  11402. <p>This filter shows hexadecimal pixel values of part of video.
  11403. </p>
  11404. <p>The filter accepts the following options:
  11405. </p>
  11406. <dl compact="compact">
  11407. <dt><samp>size, s</samp></dt>
  11408. <dd><p>Set output video size.
  11409. </p>
  11410. </dd>
  11411. <dt><samp>x</samp></dt>
  11412. <dd><p>Set x offset from where to pick pixels.
  11413. </p>
  11414. </dd>
  11415. <dt><samp>y</samp></dt>
  11416. <dd><p>Set y offset from where to pick pixels.
  11417. </p>
  11418. </dd>
  11419. <dt><samp>mode</samp></dt>
  11420. <dd><p>Set scope mode, can be one of the following:
  11421. </p><dl compact="compact">
  11422. <dt>&lsquo;<samp>mono</samp>&rsquo;</dt>
  11423. <dd><p>Draw hexadecimal pixel values with white color on black background.
  11424. </p>
  11425. </dd>
  11426. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  11427. <dd><p>Draw hexadecimal pixel values with input video pixel color on black
  11428. background.
  11429. </p>
  11430. </dd>
  11431. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  11432. <dd><p>Draw hexadecimal pixel values on color background picked from input video,
  11433. the text color is picked in such way so its always visible.
  11434. </p></dd>
  11435. </dl>
  11436. </dd>
  11437. <dt><samp>axis</samp></dt>
  11438. <dd><p>Draw rows and columns numbers on left and top of video.
  11439. </p>
  11440. </dd>
  11441. <dt><samp>opacity</samp></dt>
  11442. <dd><p>Set background opacity.
  11443. </p>
  11444. </dd>
  11445. <dt><samp>format</samp></dt>
  11446. <dd><p>Set display number format. Can be <code>hex</code>, or <code>dec</code>. Default is <code>hex</code>.
  11447. </p>
  11448. </dd>
  11449. <dt><samp>components</samp></dt>
  11450. <dd><p>Set pixel components to display. By default all pixel components are displayed.
  11451. </p></dd>
  11452. </dl>
  11453. <a name="Commands-66"></a>
  11454. <h4 class="subsection">11.44.1 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>
  11455. <p>This filter supports same <a href="#commands">commands</a> as options excluding <code>size</code> option.
  11456. </p>
  11457. <a name="dblur"></a>
  11458. <h3 class="section">11.45 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>
  11459. <p>Apply Directional blur filter.
  11460. </p>
  11461. <p>The filter accepts the following options:
  11462. </p>
  11463. <dl compact="compact">
  11464. <dt><samp>angle</samp></dt>
  11465. <dd><p>Set angle of directional blur. Default is <code>45</code>.
  11466. </p>
  11467. </dd>
  11468. <dt><samp>radius</samp></dt>
  11469. <dd><p>Set radius of directional blur. Default is <code>5</code>.
  11470. </p>
  11471. </dd>
  11472. <dt><samp>planes</samp></dt>
  11473. <dd><p>Set which planes to filter. By default all planes are filtered.
  11474. </p></dd>
  11475. </dl>
  11476. <a name="Commands-67"></a>
  11477. <h4 class="subsection">11.45.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>
  11478. <p>This filter supports same <a href="#commands">commands</a> as options.
  11479. The command accepts the same syntax of the corresponding option.
  11480. </p>
  11481. <p>If the specified expression is not valid, it is kept at its current
  11482. value.
  11483. </p>
  11484. <a name="dctdnoiz"></a>
  11485. <h3 class="section">11.46 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>
  11486. <p>Denoise frames using 2D DCT (frequency domain filtering).
  11487. </p>
  11488. <p>This filter is not designed for real time.
  11489. </p>
  11490. <p>The filter accepts the following options:
  11491. </p>
  11492. <dl compact="compact">
  11493. <dt><samp>sigma, s</samp></dt>
  11494. <dd><p>Set the noise sigma constant.
  11495. </p>
  11496. <p>This <var>sigma</var> defines a hard threshold of <code>3 * sigma</code>; every DCT
  11497. coefficient (absolute value) below this threshold with be dropped.
  11498. </p>
  11499. <p>If you need a more advanced filtering, see <samp>expr</samp>.
  11500. </p>
  11501. <p>Default is <code>0</code>.
  11502. </p>
  11503. </dd>
  11504. <dt><samp>overlap</samp></dt>
  11505. <dd><p>Set number overlapping pixels for each block. Since the filter can be slow, you
  11506. may want to reduce this value, at the cost of a less effective filter and the
  11507. risk of various artefacts.
  11508. </p>
  11509. <p>If the overlapping value doesn&rsquo;t permit processing the whole input width or
  11510. height, a warning will be displayed and according borders won&rsquo;t be denoised.
  11511. </p>
  11512. <p>Default value is <var>blocksize</var>-1, which is the best possible setting.
  11513. </p>
  11514. </dd>
  11515. <dt><samp>expr, e</samp></dt>
  11516. <dd><p>Set the coefficient factor expression.
  11517. </p>
  11518. <p>For each coefficient of a DCT block, this expression will be evaluated as a
  11519. multiplier value for the coefficient.
  11520. </p>
  11521. <p>If this is option is set, the <samp>sigma</samp> option will be ignored.
  11522. </p>
  11523. <p>The absolute value of the coefficient can be accessed through the <var>c</var>
  11524. variable.
  11525. </p>
  11526. </dd>
  11527. <dt><samp>n</samp></dt>
  11528. <dd><p>Set the <var>blocksize</var> using the number of bits. <code>1&lt;&lt;<var>n</var></code> defines the
  11529. <var>blocksize</var>, which is the width and height of the processed blocks.
  11530. </p>
  11531. <p>The default value is <var>3</var> (8x8) and can be raised to <var>4</var> for a
  11532. <var>blocksize</var> of 16x16. Note that changing this setting has huge consequences
  11533. on the speed processing. Also, a larger block size does not necessarily means a
  11534. better de-noising.
  11535. </p></dd>
  11536. </dl>
  11537. <a name="Examples-55"></a>
  11538. <h4 class="subsection">11.46.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>
  11539. <p>Apply a denoise with a <samp>sigma</samp> of <code>4.5</code>:
  11540. </p><div class="example">
  11541. <pre class="example">dctdnoiz=4.5
  11542. </pre></div>
  11543. <p>The same operation can be achieved using the expression system:
  11544. </p><div class="example">
  11545. <pre class="example">dctdnoiz=e='gte(c, 4.5*3)'
  11546. </pre></div>
  11547. <p>Violent denoise using a block size of <code>16x16</code>:
  11548. </p><div class="example">
  11549. <pre class="example">dctdnoiz=15:n=4
  11550. </pre></div>
  11551. <a name="deband"></a>
  11552. <h3 class="section">11.47 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>
  11553. <p>Remove banding artifacts from input video.
  11554. It works by replacing banded pixels with average value of referenced pixels.
  11555. </p>
  11556. <p>The filter accepts the following options:
  11557. </p>
  11558. <dl compact="compact">
  11559. <dt><samp>1thr</samp></dt>
  11560. <dt><samp>2thr</samp></dt>
  11561. <dt><samp>3thr</samp></dt>
  11562. <dt><samp>4thr</samp></dt>
  11563. <dd><p>Set banding detection threshold for each plane. Default is 0.02.
  11564. Valid range is 0.00003 to 0.5.
  11565. If difference between current pixel and reference pixel is less than threshold,
  11566. it will be considered as banded.
  11567. </p>
  11568. </dd>
  11569. <dt><samp>range, r</samp></dt>
  11570. <dd><p>Banding detection range in pixels. Default is 16. If positive, random number
  11571. in range 0 to set value will be used. If negative, exact absolute value
  11572. will be used.
  11573. The range defines square of four pixels around current pixel.
  11574. </p>
  11575. </dd>
  11576. <dt><samp>direction, d</samp></dt>
  11577. <dd><p>Set direction in radians from which four pixel will be compared. If positive,
  11578. random direction from 0 to set direction will be picked. If negative, exact of
  11579. absolute value will be picked. For example direction 0, -PI or -2*PI radians
  11580. will pick only pixels on same row and -PI/2 will pick only pixels on same
  11581. column.
  11582. </p>
  11583. </dd>
  11584. <dt><samp>blur, b</samp></dt>
  11585. <dd><p>If enabled, current pixel is compared with average value of all four
  11586. surrounding pixels. The default is enabled. If disabled current pixel is
  11587. compared with all four surrounding pixels. The pixel is considered banded
  11588. if only all four differences with surrounding pixels are less than threshold.
  11589. </p>
  11590. </dd>
  11591. <dt><samp>coupling, c</samp></dt>
  11592. <dd><p>If enabled, current pixel is changed if and only if all pixel components are banded,
  11593. e.g. banding detection threshold is triggered for all color components.
  11594. The default is disabled.
  11595. </p></dd>
  11596. </dl>
  11597. <a name="Commands-68"></a>
  11598. <h4 class="subsection">11.47.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>
  11599. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  11600. </p>
  11601. <a name="deblock"></a>
  11602. <h3 class="section">11.48 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>
  11603. <p>Remove blocking artifacts from input video.
  11604. </p>
  11605. <p>The filter accepts the following options:
  11606. </p>
  11607. <dl compact="compact">
  11608. <dt><samp>filter</samp></dt>
  11609. <dd><p>Set filter type, can be <var>weak</var> or <var>strong</var>. Default is <var>strong</var>.
  11610. This controls what kind of deblocking is applied.
  11611. </p>
  11612. </dd>
  11613. <dt><samp>block</samp></dt>
  11614. <dd><p>Set size of block, allowed range is from 4 to 512. Default is <var>8</var>.
  11615. </p>
  11616. </dd>
  11617. <dt><samp>alpha</samp></dt>
  11618. <dt><samp>beta</samp></dt>
  11619. <dt><samp>gamma</samp></dt>
  11620. <dt><samp>delta</samp></dt>
  11621. <dd><p>Set blocking detection thresholds. Allowed range is 0 to 1.
  11622. Defaults are: <var>0.098</var> for <var>alpha</var> and <var>0.05</var> for the rest.
  11623. Using higher threshold gives more deblocking strength.
  11624. Setting <var>alpha</var> controls threshold detection at exact edge of block.
  11625. Remaining options controls threshold detection near the edge. Each one for
  11626. below/above or left/right. Setting any of those to <var>0</var> disables
  11627. deblocking.
  11628. </p>
  11629. </dd>
  11630. <dt><samp>planes</samp></dt>
  11631. <dd><p>Set planes to filter. Default is to filter all available planes.
  11632. </p></dd>
  11633. </dl>
  11634. <a name="Examples-56"></a>
  11635. <h4 class="subsection">11.48.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>
  11636. <ul>
  11637. <li> Deblock using weak filter and block size of 4 pixels.
  11638. <div class="example">
  11639. <pre class="example">deblock=filter=weak:block=4
  11640. </pre></div>
  11641. </li><li> Deblock using strong filter, block size of 4 pixels and custom thresholds for
  11642. deblocking more edges.
  11643. <div class="example">
  11644. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05
  11645. </pre></div>
  11646. </li><li> Similar as above, but filter only first plane.
  11647. <div class="example">
  11648. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=1
  11649. </pre></div>
  11650. </li><li> Similar as above, but filter only second and third plane.
  11651. <div class="example">
  11652. <pre class="example">deblock=filter=strong:block=4:alpha=0.12:beta=0.07:gamma=0.06:delta=0.05:planes=6
  11653. </pre></div>
  11654. </li></ul>
  11655. <a name="Commands-69"></a>
  11656. <h4 class="subsection">11.48.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>
  11657. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  11658. </p>
  11659. <span id="decimate"></span><a name="decimate-1"></a>
  11660. <h3 class="section">11.49 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>
  11661. <p>Drop duplicated frames at regular intervals.
  11662. </p>
  11663. <p>The filter accepts the following options:
  11664. </p>
  11665. <dl compact="compact">
  11666. <dt><samp>cycle</samp></dt>
  11667. <dd><p>Set the number of frames from which one will be dropped. Setting this to
  11668. <var>N</var> means one frame in every batch of <var>N</var> frames will be dropped.
  11669. Default is <code>5</code>.
  11670. </p>
  11671. </dd>
  11672. <dt><samp>dupthresh</samp></dt>
  11673. <dd><p>Set the threshold for duplicate detection. If the difference metric for a frame
  11674. is less than or equal to this value, then it is declared as duplicate. Default
  11675. is <code>1.1</code>
  11676. </p>
  11677. </dd>
  11678. <dt><samp>scthresh</samp></dt>
  11679. <dd><p>Set scene change threshold. Default is <code>15</code>.
  11680. </p>
  11681. </dd>
  11682. <dt><samp>blockx</samp></dt>
  11683. <dt><samp>blocky</samp></dt>
  11684. <dd><p>Set the size of the x and y-axis blocks used during metric calculations.
  11685. Larger blocks give better noise suppression, but also give worse detection of
  11686. small movements. Must be a power of two. Default is <code>32</code>.
  11687. </p>
  11688. </dd>
  11689. <dt><samp>ppsrc</samp></dt>
  11690. <dd><p>Mark main input as a pre-processed input and activate clean source input
  11691. stream. This allows the input to be pre-processed with various filters to help
  11692. the metrics calculation while keeping the frame selection lossless. When set to
  11693. <code>1</code>, the first stream is for the pre-processed input, and the second
  11694. stream is the clean source from where the kept frames are chosen. Default is
  11695. <code>0</code>.
  11696. </p>
  11697. </dd>
  11698. <dt><samp>chroma</samp></dt>
  11699. <dd><p>Set whether or not chroma is considered in the metric calculations. Default is
  11700. <code>1</code>.
  11701. </p></dd>
  11702. </dl>
  11703. <a name="deconvolve"></a>
  11704. <h3 class="section">11.50 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>
  11705. <p>Apply 2D deconvolution of video stream in frequency domain using second stream
  11706. as impulse.
  11707. </p>
  11708. <p>The filter accepts the following options:
  11709. </p>
  11710. <dl compact="compact">
  11711. <dt><samp>planes</samp></dt>
  11712. <dd><p>Set which planes to process.
  11713. </p>
  11714. </dd>
  11715. <dt><samp>impulse</samp></dt>
  11716. <dd><p>Set which impulse video frames will be processed, can be <var>first</var>
  11717. or <var>all</var>. Default is <var>all</var>.
  11718. </p>
  11719. </dd>
  11720. <dt><samp>noise</samp></dt>
  11721. <dd><p>Set noise when doing divisions. Default is <var>0.0000001</var>. Useful when width
  11722. and height are not same and not power of 2 or if stream prior to convolving
  11723. had noise.
  11724. </p></dd>
  11725. </dl>
  11726. <p>The <code>deconvolve</code> filter also supports the <a href="#framesync">framesync</a> options.
  11727. </p>
  11728. <a name="dedot"></a>
  11729. <h3 class="section">11.51 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>
  11730. <p>Reduce cross-luminance (dot-crawl) and cross-color (rainbows) from video.
  11731. </p>
  11732. <p>It accepts the following options:
  11733. </p>
  11734. <dl compact="compact">
  11735. <dt><samp>m</samp></dt>
  11736. <dd><p>Set mode of operation. Can be combination of <var>dotcrawl</var> for cross-luminance reduction and/or
  11737. <var>rainbows</var> for cross-color reduction.
  11738. </p>
  11739. </dd>
  11740. <dt><samp>lt</samp></dt>
  11741. <dd><p>Set spatial luma threshold. Lower values increases reduction of cross-luminance.
  11742. </p>
  11743. </dd>
  11744. <dt><samp>tl</samp></dt>
  11745. <dd><p>Set tolerance for temporal luma. Higher values increases reduction of cross-luminance.
  11746. </p>
  11747. </dd>
  11748. <dt><samp>tc</samp></dt>
  11749. <dd><p>Set tolerance for chroma temporal variation. Higher values increases reduction of cross-color.
  11750. </p>
  11751. </dd>
  11752. <dt><samp>ct</samp></dt>
  11753. <dd><p>Set temporal chroma threshold. Lower values increases reduction of cross-color.
  11754. </p></dd>
  11755. </dl>
  11756. <a name="deflate"></a>
  11757. <h3 class="section">11.52 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>
  11758. <p>Apply deflate effect to the video.
  11759. </p>
  11760. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  11761. only values lower than the pixel.
  11762. </p>
  11763. <p>It accepts the following options:
  11764. </p>
  11765. <dl compact="compact">
  11766. <dt><samp>threshold0</samp></dt>
  11767. <dt><samp>threshold1</samp></dt>
  11768. <dt><samp>threshold2</samp></dt>
  11769. <dt><samp>threshold3</samp></dt>
  11770. <dd><p>Limit the maximum change for each plane, default is 65535.
  11771. If 0, plane will remain unchanged.
  11772. </p></dd>
  11773. </dl>
  11774. <a name="Commands-70"></a>
  11775. <h4 class="subsection">11.52.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>
  11776. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  11777. </p>
  11778. <a name="deflicker"></a>
  11779. <h3 class="section">11.53 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>
  11780. <p>Remove temporal frame luminance variations.
  11781. </p>
  11782. <p>It accepts the following options:
  11783. </p>
  11784. <dl compact="compact">
  11785. <dt><samp>size, s</samp></dt>
  11786. <dd><p>Set moving-average filter size in frames. Default is 5. Allowed range is 2 - 129.
  11787. </p>
  11788. </dd>
  11789. <dt><samp>mode, m</samp></dt>
  11790. <dd><p>Set averaging mode to smooth temporal luminance variations.
  11791. </p>
  11792. <p>Available values are:
  11793. </p><dl compact="compact">
  11794. <dt>&lsquo;<samp>am</samp>&rsquo;</dt>
  11795. <dd><p>Arithmetic mean
  11796. </p>
  11797. </dd>
  11798. <dt>&lsquo;<samp>gm</samp>&rsquo;</dt>
  11799. <dd><p>Geometric mean
  11800. </p>
  11801. </dd>
  11802. <dt>&lsquo;<samp>hm</samp>&rsquo;</dt>
  11803. <dd><p>Harmonic mean
  11804. </p>
  11805. </dd>
  11806. <dt>&lsquo;<samp>qm</samp>&rsquo;</dt>
  11807. <dd><p>Quadratic mean
  11808. </p>
  11809. </dd>
  11810. <dt>&lsquo;<samp>cm</samp>&rsquo;</dt>
  11811. <dd><p>Cubic mean
  11812. </p>
  11813. </dd>
  11814. <dt>&lsquo;<samp>pm</samp>&rsquo;</dt>
  11815. <dd><p>Power mean
  11816. </p>
  11817. </dd>
  11818. <dt>&lsquo;<samp>median</samp>&rsquo;</dt>
  11819. <dd><p>Median
  11820. </p></dd>
  11821. </dl>
  11822. </dd>
  11823. <dt><samp>bypass</samp></dt>
  11824. <dd><p>Do not actually modify frame. Useful when one only wants metadata.
  11825. </p></dd>
  11826. </dl>
  11827. <a name="dejudder"></a>
  11828. <h3 class="section">11.54 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>
  11829. <p>Remove judder produced by partially interlaced telecined content.
  11830. </p>
  11831. <p>Judder can be introduced, for instance, by <a href="#pullup">pullup</a> filter. If the original
  11832. source was partially telecined content then the output of <code>pullup,dejudder</code>
  11833. will have a variable frame rate. May change the recorded frame rate of the
  11834. container. Aside from that change, this filter will not affect constant frame
  11835. rate video.
  11836. </p>
  11837. <p>The option available in this filter is:
  11838. </p><dl compact="compact">
  11839. <dt><samp>cycle</samp></dt>
  11840. <dd><p>Specify the length of the window over which the judder repeats.
  11841. </p>
  11842. <p>Accepts any integer greater than 1. Useful values are:
  11843. </p><dl compact="compact">
  11844. <dt>&lsquo;<samp>4</samp>&rsquo;</dt>
  11845. <dd><p>If the original was telecined from 24 to 30 fps (Film to NTSC).
  11846. </p>
  11847. </dd>
  11848. <dt>&lsquo;<samp>5</samp>&rsquo;</dt>
  11849. <dd><p>If the original was telecined from 25 to 30 fps (PAL to NTSC).
  11850. </p>
  11851. </dd>
  11852. <dt>&lsquo;<samp>20</samp>&rsquo;</dt>
  11853. <dd><p>If a mixture of the two.
  11854. </p></dd>
  11855. </dl>
  11856. <p>The default is &lsquo;<samp>4</samp>&rsquo;.
  11857. </p></dd>
  11858. </dl>
  11859. <a name="delogo"></a>
  11860. <h3 class="section">11.55 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>
  11861. <p>Suppress a TV station logo by a simple interpolation of the surrounding
  11862. pixels. Just set a rectangle covering the logo and watch it disappear
  11863. (and sometimes something even uglier appear - your mileage may vary).
  11864. </p>
  11865. <p>It accepts the following parameters:
  11866. </p><dl compact="compact">
  11867. <dt><samp>x</samp></dt>
  11868. <dt><samp>y</samp></dt>
  11869. <dd><p>Specify the top left corner coordinates of the logo. They must be
  11870. specified.
  11871. </p>
  11872. </dd>
  11873. <dt><samp>w</samp></dt>
  11874. <dt><samp>h</samp></dt>
  11875. <dd><p>Specify the width and height of the logo to clear. They must be
  11876. specified.
  11877. </p>
  11878. </dd>
  11879. <dt><samp>show</samp></dt>
  11880. <dd><p>When set to 1, a green rectangle is drawn on the screen to simplify
  11881. finding the right <var>x</var>, <var>y</var>, <var>w</var>, and <var>h</var> parameters.
  11882. The default value is 0.
  11883. </p>
  11884. <p>The rectangle is drawn on the outermost pixels which will be (partly)
  11885. replaced with interpolated values. The values of the next pixels
  11886. immediately outside this rectangle in each direction will be used to
  11887. compute the interpolated pixel values inside the rectangle.
  11888. </p>
  11889. </dd>
  11890. </dl>
  11891. <a name="Examples-57"></a>
  11892. <h4 class="subsection">11.55.1 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>
  11893. <ul>
  11894. <li> Set a rectangle covering the area with top left corner coordinates 0,0
  11895. and size 100x77:
  11896. <div class="example">
  11897. <pre class="example">delogo=x=0:y=0:w=100:h=77
  11898. </pre></div>
  11899. </li></ul>
  11900. <span id="derain"></span><a name="derain-1"></a>
  11901. <h3 class="section">11.56 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>
  11902. <p>Remove the rain in the input image/video by applying the derain methods based on
  11903. convolutional neural networks. Supported models:
  11904. </p>
  11905. <ul>
  11906. <li> Recurrent Squeeze-and-Excitation Context Aggregation Net (RESCAN).
  11907. See <a href="http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf">http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_Squeeze-and-Excitation_Context_ECCV_2018_paper.pdf</a>.
  11908. </li></ul>
  11909. <p>Training as well as model generation scripts are provided in
  11910. the repository at <a href="https://github.com/XueweiMeng/derain_filter.git">https://github.com/XueweiMeng/derain_filter.git</a>.
  11911. </p>
  11912. <p>Native model files (.model) can be generated from TensorFlow model
  11913. files (.pb) by using tools/python/convert.py
  11914. </p>
  11915. <p>The filter accepts the following options:
  11916. </p>
  11917. <dl compact="compact">
  11918. <dt><samp>filter_type</samp></dt>
  11919. <dd><p>Specify which filter to use. This option accepts the following values:
  11920. </p>
  11921. <dl compact="compact">
  11922. <dt>&lsquo;<samp>derain</samp>&rsquo;</dt>
  11923. <dd><p>Derain filter. To conduct derain filter, you need to use a derain model.
  11924. </p>
  11925. </dd>
  11926. <dt>&lsquo;<samp>dehaze</samp>&rsquo;</dt>
  11927. <dd><p>Dehaze filter. To conduct dehaze filter, you need to use a dehaze model.
  11928. </p></dd>
  11929. </dl>
  11930. <p>Default value is &lsquo;<samp>derain</samp>&rsquo;.
  11931. </p>
  11932. </dd>
  11933. <dt><samp>dnn_backend</samp></dt>
  11934. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  11935. the following values:
  11936. </p>
  11937. <dl compact="compact">
  11938. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  11939. <dd><p>Native implementation of DNN loading and execution.
  11940. </p>
  11941. </dd>
  11942. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  11943. <dd><p>TensorFlow backend. To enable this backend you
  11944. need to install the TensorFlow for C library (see
  11945. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  11946. <code>--enable-libtensorflow</code>
  11947. </p></dd>
  11948. </dl>
  11949. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  11950. </p>
  11951. </dd>
  11952. <dt><samp>model</samp></dt>
  11953. <dd><p>Set path to model file specifying network architecture and its parameters.
  11954. Note that different backends use different file formats. TensorFlow and native
  11955. backend can load files for only its format.
  11956. </p></dd>
  11957. </dl>
  11958. <p>It can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  11959. </p>
  11960. <a name="deshake"></a>
  11961. <h3 class="section">11.57 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>
  11962. <p>Attempt to fix small changes in horizontal and/or vertical shift. This
  11963. filter helps remove camera shake from hand-holding a camera, bumping a
  11964. tripod, moving on a vehicle, etc.
  11965. </p>
  11966. <p>The filter accepts the following options:
  11967. </p>
  11968. <dl compact="compact">
  11969. <dt><samp>x</samp></dt>
  11970. <dt><samp>y</samp></dt>
  11971. <dt><samp>w</samp></dt>
  11972. <dt><samp>h</samp></dt>
  11973. <dd><p>Specify a rectangular area where to limit the search for motion
  11974. vectors.
  11975. If desired the search for motion vectors can be limited to a
  11976. rectangular area of the frame defined by its top left corner, width
  11977. and height. These parameters have the same meaning as the drawbox
  11978. filter which can be used to visualise the position of the bounding
  11979. box.
  11980. </p>
  11981. <p>This is useful when simultaneous movement of subjects within the frame
  11982. might be confused for camera motion by the motion vector search.
  11983. </p>
  11984. <p>If any or all of <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> are set to -1
  11985. then the full frame is used. This allows later options to be set
  11986. without specifying the bounding box for the motion vector search.
  11987. </p>
  11988. <p>Default - search the whole frame.
  11989. </p>
  11990. </dd>
  11991. <dt><samp>rx</samp></dt>
  11992. <dt><samp>ry</samp></dt>
  11993. <dd><p>Specify the maximum extent of movement in x and y directions in the
  11994. range 0-64 pixels. Default 16.
  11995. </p>
  11996. </dd>
  11997. <dt><samp>edge</samp></dt>
  11998. <dd><p>Specify how to generate pixels to fill blanks at the edge of the
  11999. frame. Available values are:
  12000. </p><dl compact="compact">
  12001. <dt>&lsquo;<samp>blank, 0</samp>&rsquo;</dt>
  12002. <dd><p>Fill zeroes at blank locations
  12003. </p></dd>
  12004. <dt>&lsquo;<samp>original, 1</samp>&rsquo;</dt>
  12005. <dd><p>Original image at blank locations
  12006. </p></dd>
  12007. <dt>&lsquo;<samp>clamp, 2</samp>&rsquo;</dt>
  12008. <dd><p>Extruded edge value at blank locations
  12009. </p></dd>
  12010. <dt>&lsquo;<samp>mirror, 3</samp>&rsquo;</dt>
  12011. <dd><p>Mirrored edge at blank locations
  12012. </p></dd>
  12013. </dl>
  12014. <p>Default value is &lsquo;<samp>mirror</samp>&rsquo;.
  12015. </p>
  12016. </dd>
  12017. <dt><samp>blocksize</samp></dt>
  12018. <dd><p>Specify the blocksize to use for motion search. Range 4-128 pixels,
  12019. default 8.
  12020. </p>
  12021. </dd>
  12022. <dt><samp>contrast</samp></dt>
  12023. <dd><p>Specify the contrast threshold for blocks. Only blocks with more than
  12024. the specified contrast (difference between darkest and lightest
  12025. pixels) will be considered. Range 1-255, default 125.
  12026. </p>
  12027. </dd>
  12028. <dt><samp>search</samp></dt>
  12029. <dd><p>Specify the search strategy. Available values are:
  12030. </p><dl compact="compact">
  12031. <dt>&lsquo;<samp>exhaustive, 0</samp>&rsquo;</dt>
  12032. <dd><p>Set exhaustive search
  12033. </p></dd>
  12034. <dt>&lsquo;<samp>less, 1</samp>&rsquo;</dt>
  12035. <dd><p>Set less exhaustive search.
  12036. </p></dd>
  12037. </dl>
  12038. <p>Default value is &lsquo;<samp>exhaustive</samp>&rsquo;.
  12039. </p>
  12040. </dd>
  12041. <dt><samp>filename</samp></dt>
  12042. <dd><p>If set then a detailed log of the motion search is written to the
  12043. specified file.
  12044. </p>
  12045. </dd>
  12046. </dl>
  12047. <a name="despill"></a>
  12048. <h3 class="section">11.58 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>
  12049. <p>Remove unwanted contamination of foreground colors, caused by reflected color of
  12050. greenscreen or bluescreen.
  12051. </p>
  12052. <p>This filter accepts the following options:
  12053. </p>
  12054. <dl compact="compact">
  12055. <dt><samp>type</samp></dt>
  12056. <dd><p>Set what type of despill to use.
  12057. </p>
  12058. </dd>
  12059. <dt><samp>mix</samp></dt>
  12060. <dd><p>Set how spillmap will be generated.
  12061. </p>
  12062. </dd>
  12063. <dt><samp>expand</samp></dt>
  12064. <dd><p>Set how much to get rid of still remaining spill.
  12065. </p>
  12066. </dd>
  12067. <dt><samp>red</samp></dt>
  12068. <dd><p>Controls amount of red in spill area.
  12069. </p>
  12070. </dd>
  12071. <dt><samp>green</samp></dt>
  12072. <dd><p>Controls amount of green in spill area.
  12073. Should be -1 for greenscreen.
  12074. </p>
  12075. </dd>
  12076. <dt><samp>blue</samp></dt>
  12077. <dd><p>Controls amount of blue in spill area.
  12078. Should be -1 for bluescreen.
  12079. </p>
  12080. </dd>
  12081. <dt><samp>brightness</samp></dt>
  12082. <dd><p>Controls brightness of spill area, preserving colors.
  12083. </p>
  12084. </dd>
  12085. <dt><samp>alpha</samp></dt>
  12086. <dd><p>Modify alpha from generated spillmap.
  12087. </p></dd>
  12088. </dl>
  12089. <a name="Commands-71"></a>
  12090. <h4 class="subsection">11.58.1 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>
  12091. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  12092. </p>
  12093. <a name="detelecine"></a>
  12094. <h3 class="section">11.59 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>
  12095. <p>Apply an exact inverse of the telecine operation. It requires a predefined
  12096. pattern specified using the pattern option which must be the same as that passed
  12097. to the telecine filter.
  12098. </p>
  12099. <p>This filter accepts the following options:
  12100. </p>
  12101. <dl compact="compact">
  12102. <dt><samp>first_field</samp></dt>
  12103. <dd><dl compact="compact">
  12104. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  12105. <dd><p>top field first
  12106. </p></dd>
  12107. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  12108. <dd><p>bottom field first
  12109. The default value is <code>top</code>.
  12110. </p></dd>
  12111. </dl>
  12112. </dd>
  12113. <dt><samp>pattern</samp></dt>
  12114. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  12115. The default value is <code>23</code>.
  12116. </p>
  12117. </dd>
  12118. <dt><samp>start_frame</samp></dt>
  12119. <dd><p>A number representing position of the first frame with respect to the telecine
  12120. pattern. This is to be used if the stream is cut. The default value is <code>0</code>.
  12121. </p></dd>
  12122. </dl>
  12123. <a name="dilation"></a>
  12124. <h3 class="section">11.60 dilation<span class="pull-right"><a class="anchor hidden-xs" href="#dilation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-dilation" aria-hidden="true">TOC</a></span></h3>
  12125. <p>Apply dilation effect to the video.
  12126. </p>
  12127. <p>This filter replaces the pixel by the local(3x3) maximum.
  12128. </p>
  12129. <p>It accepts the following options:
  12130. </p>
  12131. <dl compact="compact">
  12132. <dt><samp>threshold0</samp></dt>
  12133. <dt><samp>threshold1</samp></dt>
  12134. <dt><samp>threshold2</samp></dt>
  12135. <dt><samp>threshold3</samp></dt>
  12136. <dd><p>Limit the maximum change for each plane, default is 65535.
  12137. If 0, plane will remain unchanged.
  12138. </p>
  12139. </dd>
  12140. <dt><samp>coordinates</samp></dt>
  12141. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  12142. pixels are used.
  12143. </p>
  12144. <p>Flags to local 3x3 coordinates maps like this:
  12145. </p>
  12146. <p>1 2 3
  12147. 4 5
  12148. 6 7 8
  12149. </p></dd>
  12150. </dl>
  12151. <a name="Commands-72"></a>
  12152. <h4 class="subsection">11.60.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>
  12153. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  12154. </p>
  12155. <a name="displace"></a>
  12156. <h3 class="section">11.61 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>
  12157. <p>Displace pixels as indicated by second and third input stream.
  12158. </p>
  12159. <p>It takes three input streams and outputs one stream, the first input is the
  12160. source, and second and third input are displacement maps.
  12161. </p>
  12162. <p>The second input specifies how much to displace pixels along the
  12163. x-axis, while the third input specifies how much to displace pixels
  12164. along the y-axis.
  12165. If one of displacement map streams terminates, last frame from that
  12166. displacement map will be used.
  12167. </p>
  12168. <p>Note that once generated, displacements maps can be reused over and over again.
  12169. </p>
  12170. <p>A description of the accepted options follows.
  12171. </p>
  12172. <dl compact="compact">
  12173. <dt><samp>edge</samp></dt>
  12174. <dd><p>Set displace behavior for pixels that are out of range.
  12175. </p>
  12176. <p>Available values are:
  12177. </p><dl compact="compact">
  12178. <dt>&lsquo;<samp>blank</samp>&rsquo;</dt>
  12179. <dd><p>Missing pixels are replaced by black pixels.
  12180. </p>
  12181. </dd>
  12182. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  12183. <dd><p>Adjacent pixels will spread out to replace missing pixels.
  12184. </p>
  12185. </dd>
  12186. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  12187. <dd><p>Out of range pixels are wrapped so they point to pixels of other side.
  12188. </p>
  12189. </dd>
  12190. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  12191. <dd><p>Out of range pixels will be replaced with mirrored pixels.
  12192. </p></dd>
  12193. </dl>
  12194. <p>Default is &lsquo;<samp>smear</samp>&rsquo;.
  12195. </p>
  12196. </dd>
  12197. </dl>
  12198. <a name="Examples-58"></a>
  12199. <h4 class="subsection">11.61.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>
  12200. <ul>
  12201. <li> Add ripple effect to rgb input of video size hd720:
  12202. <div class="example">
  12203. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=s=hd720,lutrgb=128:128:128 -f lavfi -i nullsrc=s=hd720,geq='r=128+30*sin(2*PI*X/400+T):g=128+30*sin(2*PI*X/400+T):b=128+30*sin(2*PI*X/400+T)' -lavfi '[0][1][2]displace' OUTPUT
  12204. </pre></div>
  12205. </li><li> Add wave effect to rgb input of video size hd720:
  12206. <div class="example">
  12207. <pre class="example">ffmpeg -i INPUT -f lavfi -i nullsrc=hd720,geq='r=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):g=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T)):b=128+80*(sin(sqrt((X-W/2)*(X-W/2)+(Y-H/2)*(Y-H/2))/220*2*PI+T))' -lavfi '[1]split[x][y],[0][x][y]displace' OUTPUT
  12208. </pre></div>
  12209. </li></ul>
  12210. <span id="dnn_005fprocessing"></span><a name="dnn_005fprocessing-1"></a>
  12211. <h3 class="section">11.62 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>
  12212. <p>Do image processing with deep neural networks. It works together with another filter
  12213. which converts the pixel format of the Frame to what the dnn network requires.
  12214. </p>
  12215. <p>The filter accepts the following options:
  12216. </p>
  12217. <dl compact="compact">
  12218. <dt><samp>dnn_backend</samp></dt>
  12219. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  12220. the following values:
  12221. </p>
  12222. <dl compact="compact">
  12223. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  12224. <dd><p>Native implementation of DNN loading and execution.
  12225. </p>
  12226. </dd>
  12227. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  12228. <dd><p>TensorFlow backend. To enable this backend you
  12229. need to install the TensorFlow for C library (see
  12230. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  12231. <code>--enable-libtensorflow</code>
  12232. </p>
  12233. </dd>
  12234. <dt>&lsquo;<samp>openvino</samp>&rsquo;</dt>
  12235. <dd><p>OpenVINO backend. To enable this backend you
  12236. need to build and install the OpenVINO for C library (see
  12237. <a 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
  12238. <code>--enable-libopenvino</code> (&ndash;extra-cflags=-I... &ndash;extra-ldflags=-L... might
  12239. be needed if the header files and libraries are not installed into system path)
  12240. </p>
  12241. </dd>
  12242. </dl>
  12243. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  12244. </p>
  12245. </dd>
  12246. <dt><samp>model</samp></dt>
  12247. <dd><p>Set path to model file specifying network architecture and its parameters.
  12248. Note that different backends use different file formats. TensorFlow, OpenVINO and native
  12249. backend can load files for only its format.
  12250. </p>
  12251. <p>Native model file (.model) can be generated from TensorFlow model file (.pb) by using tools/python/convert.py
  12252. </p>
  12253. </dd>
  12254. <dt><samp>input</samp></dt>
  12255. <dd><p>Set the input name of the dnn network.
  12256. </p>
  12257. </dd>
  12258. <dt><samp>output</samp></dt>
  12259. <dd><p>Set the output name of the dnn network.
  12260. </p>
  12261. </dd>
  12262. <dt><samp>async</samp></dt>
  12263. <dd><p>use DNN async execution if set (default: set),
  12264. roll back to sync execution if the backend does not support async.
  12265. </p>
  12266. </dd>
  12267. </dl>
  12268. <a name="Examples-59"></a>
  12269. <h4 class="subsection">11.62.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>
  12270. <ul>
  12271. <li> Remove rain in rgb24 frame with can.pb (see <a href="#derain">derain</a> filter):
  12272. <div class="example">
  12273. <pre class="example">./ffmpeg -i rain.jpg -vf format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y derain.jpg
  12274. </pre></div>
  12275. </li><li> Halve the pixel value of the frame with format gray32f:
  12276. <div class="example">
  12277. <pre class="example">ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
  12278. </pre></div>
  12279. </li><li> Handle the Y channel with srcnn.pb (see <a href="#sr">sr</a> filter) for frame with yuv420p (planar YUV formats supported):
  12280. <div class="example">
  12281. <pre class="example">./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
  12282. </pre></div>
  12283. </li><li> Handle the Y channel with espcn.pb (see <a href="#sr">sr</a> filter), which changes frame size, for format yuv420p (planar YUV formats supported):
  12284. <div class="example">
  12285. <pre class="example">./ffmpeg -i 480p.jpg -vf format=yuv420p,dnn_processing=dnn_backend=tensorflow:model=espcn.pb:input=x:output=y -y tmp.espcn.jpg
  12286. </pre></div>
  12287. </li></ul>
  12288. <a name="drawbox"></a>
  12289. <h3 class="section">11.63 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>
  12290. <p>Draw a colored box on the input image.
  12291. </p>
  12292. <p>It accepts the following parameters:
  12293. </p>
  12294. <dl compact="compact">
  12295. <dt><samp>x</samp></dt>
  12296. <dt><samp>y</samp></dt>
  12297. <dd><p>The expressions which specify the top left corner coordinates of the box. It defaults to 0.
  12298. </p>
  12299. </dd>
  12300. <dt><samp>width, w</samp></dt>
  12301. <dt><samp>height, h</samp></dt>
  12302. <dd><p>The expressions which specify the width and height of the box; if 0 they are interpreted as
  12303. the input width and height. It defaults to 0.
  12304. </p>
  12305. </dd>
  12306. <dt><samp>color, c</samp></dt>
  12307. <dd><p>Specify the color of the box to write. For the general syntax of this option,
  12308. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  12309. value <code>invert</code> is used, the box edge color is the same as the
  12310. video with inverted luma.
  12311. </p>
  12312. </dd>
  12313. <dt><samp>thickness, t</samp></dt>
  12314. <dd><p>The expression which sets the thickness of the box edge.
  12315. A value of <code>fill</code> will create a filled box. Default value is <code>3</code>.
  12316. </p>
  12317. <p>See below for the list of accepted constants.
  12318. </p>
  12319. </dd>
  12320. <dt><samp>replace</samp></dt>
  12321. <dd><p>Applicable if the input has alpha. With value <code>1</code>, the pixels of the painted box
  12322. will overwrite the video&rsquo;s color and alpha pixels.
  12323. Default is <code>0</code>, which composites the box onto the input, leaving the video&rsquo;s alpha intact.
  12324. </p></dd>
  12325. </dl>
  12326. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  12327. following constants:
  12328. </p>
  12329. <dl compact="compact">
  12330. <dt><samp>dar</samp></dt>
  12331. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  12332. </p>
  12333. </dd>
  12334. <dt><samp>hsub</samp></dt>
  12335. <dt><samp>vsub</samp></dt>
  12336. <dd><p>horizontal and vertical chroma subsample values. For example for the
  12337. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  12338. </p>
  12339. </dd>
  12340. <dt><samp>in_h, ih</samp></dt>
  12341. <dt><samp>in_w, iw</samp></dt>
  12342. <dd><p>The input width and height.
  12343. </p>
  12344. </dd>
  12345. <dt><samp>sar</samp></dt>
  12346. <dd><p>The input sample aspect ratio.
  12347. </p>
  12348. </dd>
  12349. <dt><samp>x</samp></dt>
  12350. <dt><samp>y</samp></dt>
  12351. <dd><p>The x and y offset coordinates where the box is drawn.
  12352. </p>
  12353. </dd>
  12354. <dt><samp>w</samp></dt>
  12355. <dt><samp>h</samp></dt>
  12356. <dd><p>The width and height of the drawn box.
  12357. </p>
  12358. </dd>
  12359. <dt><samp>t</samp></dt>
  12360. <dd><p>The thickness of the drawn box.
  12361. </p>
  12362. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  12363. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  12364. </p>
  12365. </dd>
  12366. </dl>
  12367. <a name="Examples-60"></a>
  12368. <h4 class="subsection">11.63.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>
  12369. <ul>
  12370. <li> Draw a black box around the edge of the input image:
  12371. <div class="example">
  12372. <pre class="example">drawbox
  12373. </pre></div>
  12374. </li><li> Draw a box with color red and an opacity of 50%:
  12375. <div class="example">
  12376. <pre class="example">drawbox=10:20:200:60:red@0.5
  12377. </pre></div>
  12378. <p>The previous example can be specified as:
  12379. </p><div class="example">
  12380. <pre class="example">drawbox=x=10:y=20:w=200:h=60:color=red@0.5
  12381. </pre></div>
  12382. </li><li> Fill the box with pink color:
  12383. <div class="example">
  12384. <pre class="example">drawbox=x=10:y=10:w=100:h=100:color=pink@0.5:t=fill
  12385. </pre></div>
  12386. </li><li> Draw a 2-pixel red 2.40:1 mask:
  12387. <div class="example">
  12388. <pre class="example">drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
  12389. </pre></div>
  12390. </li></ul>
  12391. <a name="Commands-73"></a>
  12392. <h4 class="subsection">11.63.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>
  12393. <p>This filter supports same commands as options.
  12394. The command accepts the same syntax of the corresponding option.
  12395. </p>
  12396. <p>If the specified expression is not valid, it is kept at its current
  12397. value.
  12398. </p>
  12399. <span id="drawgraph"></span><a name="drawgraph-1"></a>
  12400. <h3 class="section">11.64 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>
  12401. <p>Draw a graph using input video metadata.
  12402. </p>
  12403. <p>It accepts the following parameters:
  12404. </p>
  12405. <dl compact="compact">
  12406. <dt><samp>m1</samp></dt>
  12407. <dd><p>Set 1st frame metadata key from which metadata values will be used to draw a graph.
  12408. </p>
  12409. </dd>
  12410. <dt><samp>fg1</samp></dt>
  12411. <dd><p>Set 1st foreground color expression.
  12412. </p>
  12413. </dd>
  12414. <dt><samp>m2</samp></dt>
  12415. <dd><p>Set 2nd frame metadata key from which metadata values will be used to draw a graph.
  12416. </p>
  12417. </dd>
  12418. <dt><samp>fg2</samp></dt>
  12419. <dd><p>Set 2nd foreground color expression.
  12420. </p>
  12421. </dd>
  12422. <dt><samp>m3</samp></dt>
  12423. <dd><p>Set 3rd frame metadata key from which metadata values will be used to draw a graph.
  12424. </p>
  12425. </dd>
  12426. <dt><samp>fg3</samp></dt>
  12427. <dd><p>Set 3rd foreground color expression.
  12428. </p>
  12429. </dd>
  12430. <dt><samp>m4</samp></dt>
  12431. <dd><p>Set 4th frame metadata key from which metadata values will be used to draw a graph.
  12432. </p>
  12433. </dd>
  12434. <dt><samp>fg4</samp></dt>
  12435. <dd><p>Set 4th foreground color expression.
  12436. </p>
  12437. </dd>
  12438. <dt><samp>min</samp></dt>
  12439. <dd><p>Set minimal value of metadata value.
  12440. </p>
  12441. </dd>
  12442. <dt><samp>max</samp></dt>
  12443. <dd><p>Set maximal value of metadata value.
  12444. </p>
  12445. </dd>
  12446. <dt><samp>bg</samp></dt>
  12447. <dd><p>Set graph background color. Default is white.
  12448. </p>
  12449. </dd>
  12450. <dt><samp>mode</samp></dt>
  12451. <dd><p>Set graph mode.
  12452. </p>
  12453. <p>Available values for mode is:
  12454. </p><dl compact="compact">
  12455. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  12456. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  12457. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  12458. </dl>
  12459. <p>Default is <code>line</code>.
  12460. </p>
  12461. </dd>
  12462. <dt><samp>slide</samp></dt>
  12463. <dd><p>Set slide mode.
  12464. </p>
  12465. <p>Available values for slide is:
  12466. </p><dl compact="compact">
  12467. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  12468. <dd><p>Draw new frame when right border is reached.
  12469. </p>
  12470. </dd>
  12471. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  12472. <dd><p>Replace old columns with new ones.
  12473. </p>
  12474. </dd>
  12475. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  12476. <dd><p>Scroll from right to left.
  12477. </p>
  12478. </dd>
  12479. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  12480. <dd><p>Scroll from left to right.
  12481. </p>
  12482. </dd>
  12483. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  12484. <dd><p>Draw single picture.
  12485. </p></dd>
  12486. </dl>
  12487. <p>Default is <code>frame</code>.
  12488. </p>
  12489. </dd>
  12490. <dt><samp>size</samp></dt>
  12491. <dd><p>Set size of graph video. For the syntax of this option, check the
  12492. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  12493. The default value is <code>900x256</code>.
  12494. </p>
  12495. </dd>
  12496. <dt><samp>rate, r</samp></dt>
  12497. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  12498. </p>
  12499. <p>The foreground color expressions can use the following variables:
  12500. </p><dl compact="compact">
  12501. <dt><samp>MIN</samp></dt>
  12502. <dd><p>Minimal value of metadata value.
  12503. </p>
  12504. </dd>
  12505. <dt><samp>MAX</samp></dt>
  12506. <dd><p>Maximal value of metadata value.
  12507. </p>
  12508. </dd>
  12509. <dt><samp>VAL</samp></dt>
  12510. <dd><p>Current metadata key value.
  12511. </p></dd>
  12512. </dl>
  12513. <p>The color is defined as 0xAABBGGRR.
  12514. </p></dd>
  12515. </dl>
  12516. <p>Example using metadata from <a href="#signalstats">signalstats</a> filter:
  12517. </p><div class="example">
  12518. <pre class="example">signalstats,drawgraph=lavfi.signalstats.YAVG:min=0:max=255
  12519. </pre></div>
  12520. <p>Example using metadata from <a href="#ebur128">ebur128</a> filter:
  12521. </p><div class="example">
  12522. <pre class="example">ebur128=metadata=1,adrawgraph=lavfi.r128.M:min=-120:max=5
  12523. </pre></div>
  12524. <a name="drawgrid"></a>
  12525. <h3 class="section">11.65 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>
  12526. <p>Draw a grid on the input image.
  12527. </p>
  12528. <p>It accepts the following parameters:
  12529. </p>
  12530. <dl compact="compact">
  12531. <dt><samp>x</samp></dt>
  12532. <dt><samp>y</samp></dt>
  12533. <dd><p>The expressions which specify the coordinates of some point of grid intersection (meant to configure offset). Both default to 0.
  12534. </p>
  12535. </dd>
  12536. <dt><samp>width, w</samp></dt>
  12537. <dt><samp>height, h</samp></dt>
  12538. <dd><p>The expressions which specify the width and height of the grid cell, if 0 they are interpreted as the
  12539. input width and height, respectively, minus <code>thickness</code>, so image gets
  12540. framed. Default to 0.
  12541. </p>
  12542. </dd>
  12543. <dt><samp>color, c</samp></dt>
  12544. <dd><p>Specify the color of the grid. For the general syntax of this option,
  12545. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>. If the special
  12546. value <code>invert</code> is used, the grid color is the same as the
  12547. video with inverted luma.
  12548. </p>
  12549. </dd>
  12550. <dt><samp>thickness, t</samp></dt>
  12551. <dd><p>The expression which sets the thickness of the grid line. Default value is <code>1</code>.
  12552. </p>
  12553. <p>See below for the list of accepted constants.
  12554. </p>
  12555. </dd>
  12556. <dt><samp>replace</samp></dt>
  12557. <dd><p>Applicable if the input has alpha. With <code>1</code> the pixels of the painted grid
  12558. will overwrite the video&rsquo;s color and alpha pixels.
  12559. Default is <code>0</code>, which composites the grid onto the input, leaving the video&rsquo;s alpha intact.
  12560. </p></dd>
  12561. </dl>
  12562. <p>The parameters for <var>x</var>, <var>y</var>, <var>w</var> and <var>h</var> and <var>t</var> are expressions containing the
  12563. following constants:
  12564. </p>
  12565. <dl compact="compact">
  12566. <dt><samp>dar</samp></dt>
  12567. <dd><p>The input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>.
  12568. </p>
  12569. </dd>
  12570. <dt><samp>hsub</samp></dt>
  12571. <dt><samp>vsub</samp></dt>
  12572. <dd><p>horizontal and vertical chroma subsample values. For example for the
  12573. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  12574. </p>
  12575. </dd>
  12576. <dt><samp>in_h, ih</samp></dt>
  12577. <dt><samp>in_w, iw</samp></dt>
  12578. <dd><p>The input grid cell width and height.
  12579. </p>
  12580. </dd>
  12581. <dt><samp>sar</samp></dt>
  12582. <dd><p>The input sample aspect ratio.
  12583. </p>
  12584. </dd>
  12585. <dt><samp>x</samp></dt>
  12586. <dt><samp>y</samp></dt>
  12587. <dd><p>The x and y coordinates of some point of grid intersection (meant to configure offset).
  12588. </p>
  12589. </dd>
  12590. <dt><samp>w</samp></dt>
  12591. <dt><samp>h</samp></dt>
  12592. <dd><p>The width and height of the drawn cell.
  12593. </p>
  12594. </dd>
  12595. <dt><samp>t</samp></dt>
  12596. <dd><p>The thickness of the drawn cell.
  12597. </p>
  12598. <p>These constants allow the <var>x</var>, <var>y</var>, <var>w</var>, <var>h</var> and <var>t</var> expressions to refer to
  12599. each other, so you may for example specify <code>y=x/dar</code> or <code>h=w/dar</code>.
  12600. </p>
  12601. </dd>
  12602. </dl>
  12603. <a name="Examples-61"></a>
  12604. <h4 class="subsection">11.65.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>
  12605. <ul>
  12606. <li> Draw a grid with cell 100x100 pixels, thickness 2 pixels, with color red and an opacity of 50%:
  12607. <div class="example">
  12608. <pre class="example">drawgrid=width=100:height=100:thickness=2:color=red@0.5
  12609. </pre></div>
  12610. </li><li> Draw a white 3x3 grid with an opacity of 50%:
  12611. <div class="example">
  12612. <pre class="example">drawgrid=w=iw/3:h=ih/3:t=2:c=white@0.5
  12613. </pre></div>
  12614. </li></ul>
  12615. <a name="Commands-74"></a>
  12616. <h4 class="subsection">11.65.2 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>
  12617. <p>This filter supports same commands as options.
  12618. The command accepts the same syntax of the corresponding option.
  12619. </p>
  12620. <p>If the specified expression is not valid, it is kept at its current
  12621. value.
  12622. </p>
  12623. <span id="drawtext"></span><a name="drawtext-1"></a>
  12624. <h3 class="section">11.66 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>
  12625. <p>Draw a text string or text from a specified file on top of a video, using the
  12626. libfreetype library.
  12627. </p>
  12628. <p>To enable compilation of this filter, you need to configure FFmpeg with
  12629. <code>--enable-libfreetype</code>.
  12630. To enable default font fallback and the <var>font</var> option you need to
  12631. configure FFmpeg with <code>--enable-libfontconfig</code>.
  12632. To enable the <var>text_shaping</var> option, you need to configure FFmpeg with
  12633. <code>--enable-libfribidi</code>.
  12634. </p>
  12635. <a name="Syntax"></a>
  12636. <h4 class="subsection">11.66.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>
  12637. <p>It accepts the following parameters:
  12638. </p>
  12639. <dl compact="compact">
  12640. <dt><samp>box</samp></dt>
  12641. <dd><p>Used to draw a box around text using the background color.
  12642. The value must be either 1 (enable) or 0 (disable).
  12643. The default value of <var>box</var> is 0.
  12644. </p>
  12645. </dd>
  12646. <dt><samp>boxborderw</samp></dt>
  12647. <dd><p>Set the width of the border to be drawn around the box using <var>boxcolor</var>.
  12648. The default value of <var>boxborderw</var> is 0.
  12649. </p>
  12650. </dd>
  12651. <dt><samp>boxcolor</samp></dt>
  12652. <dd><p>The color to be used for drawing box around text. For the syntax of this
  12653. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  12654. </p>
  12655. <p>The default value of <var>boxcolor</var> is &quot;white&quot;.
  12656. </p>
  12657. </dd>
  12658. <dt><samp>line_spacing</samp></dt>
  12659. <dd><p>Set the line spacing in pixels of the border to be drawn around the box using <var>box</var>.
  12660. The default value of <var>line_spacing</var> is 0.
  12661. </p>
  12662. </dd>
  12663. <dt><samp>borderw</samp></dt>
  12664. <dd><p>Set the width of the border to be drawn around the text using <var>bordercolor</var>.
  12665. The default value of <var>borderw</var> is 0.
  12666. </p>
  12667. </dd>
  12668. <dt><samp>bordercolor</samp></dt>
  12669. <dd><p>Set the color to be used for drawing border around text. For the syntax of this
  12670. option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  12671. </p>
  12672. <p>The default value of <var>bordercolor</var> is &quot;black&quot;.
  12673. </p>
  12674. </dd>
  12675. <dt><samp>expansion</samp></dt>
  12676. <dd><p>Select how the <var>text</var> is expanded. Can be either <code>none</code>,
  12677. <code>strftime</code> (deprecated) or
  12678. <code>normal</code> (default). See the <a href="#drawtext_005fexpansion">Text expansion</a> section
  12679. below for details.
  12680. </p>
  12681. </dd>
  12682. <dt><samp>basetime</samp></dt>
  12683. <dd><p>Set a start time for the count. Value is in microseconds. Only applied
  12684. in the deprecated strftime expansion mode. To emulate in normal expansion
  12685. mode use the <code>pts</code> function, supplying the start time (in seconds)
  12686. as the second argument.
  12687. </p>
  12688. </dd>
  12689. <dt><samp>fix_bounds</samp></dt>
  12690. <dd><p>If true, check and fix text coords to avoid clipping.
  12691. </p>
  12692. </dd>
  12693. <dt><samp>fontcolor</samp></dt>
  12694. <dd><p>The color to be used for drawing fonts. For the syntax of this option, check
  12695. the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  12696. </p>
  12697. <p>The default value of <var>fontcolor</var> is &quot;black&quot;.
  12698. </p>
  12699. </dd>
  12700. <dt><samp>fontcolor_expr</samp></dt>
  12701. <dd><p>String which is expanded the same way as <var>text</var> to obtain dynamic
  12702. <var>fontcolor</var> value. By default this option has empty value and is not
  12703. processed. When this option is set, it overrides <var>fontcolor</var> option.
  12704. </p>
  12705. </dd>
  12706. <dt><samp>font</samp></dt>
  12707. <dd><p>The font family to be used for drawing text. By default Sans.
  12708. </p>
  12709. </dd>
  12710. <dt><samp>fontfile</samp></dt>
  12711. <dd><p>The font file to be used for drawing text. The path must be included.
  12712. This parameter is mandatory if the fontconfig support is disabled.
  12713. </p>
  12714. </dd>
  12715. <dt><samp>alpha</samp></dt>
  12716. <dd><p>Draw the text applying alpha blending. The value can
  12717. be a number between 0.0 and 1.0.
  12718. The expression accepts the same variables <var>x, y</var> as well.
  12719. The default value is 1.
  12720. Please see <var>fontcolor_expr</var>.
  12721. </p>
  12722. </dd>
  12723. <dt><samp>fontsize</samp></dt>
  12724. <dd><p>The font size to be used for drawing text.
  12725. The default value of <var>fontsize</var> is 16.
  12726. </p>
  12727. </dd>
  12728. <dt><samp>text_shaping</samp></dt>
  12729. <dd><p>If set to 1, attempt to shape the text (for example, reverse the order of
  12730. right-to-left text and join Arabic characters) before drawing it.
  12731. Otherwise, just draw the text exactly as given.
  12732. By default 1 (if supported).
  12733. </p>
  12734. </dd>
  12735. <dt><samp>ft_load_flags</samp></dt>
  12736. <dd><p>The flags to be used for loading the fonts.
  12737. </p>
  12738. <p>The flags map the corresponding flags supported by libfreetype, and are
  12739. a combination of the following values:
  12740. </p><dl compact="compact">
  12741. <dt><var>default</var></dt>
  12742. <dt><var>no_scale</var></dt>
  12743. <dt><var>no_hinting</var></dt>
  12744. <dt><var>render</var></dt>
  12745. <dt><var>no_bitmap</var></dt>
  12746. <dt><var>vertical_layout</var></dt>
  12747. <dt><var>force_autohint</var></dt>
  12748. <dt><var>crop_bitmap</var></dt>
  12749. <dt><var>pedantic</var></dt>
  12750. <dt><var>ignore_global_advance_width</var></dt>
  12751. <dt><var>no_recurse</var></dt>
  12752. <dt><var>ignore_transform</var></dt>
  12753. <dt><var>monochrome</var></dt>
  12754. <dt><var>linear_design</var></dt>
  12755. <dt><var>no_autohint</var></dt>
  12756. </dl>
  12757. <p>Default value is &quot;default&quot;.
  12758. </p>
  12759. <p>For more information consult the documentation for the FT_LOAD_*
  12760. libfreetype flags.
  12761. </p>
  12762. </dd>
  12763. <dt><samp>shadowcolor</samp></dt>
  12764. <dd><p>The color to be used for drawing a shadow behind the drawn text. For the
  12765. syntax of this option, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the
  12766. ffmpeg-utils manual</a>.
  12767. </p>
  12768. <p>The default value of <var>shadowcolor</var> is &quot;black&quot;.
  12769. </p>
  12770. </dd>
  12771. <dt><samp>shadowx</samp></dt>
  12772. <dt><samp>shadowy</samp></dt>
  12773. <dd><p>The x and y offsets for the text shadow position with respect to the
  12774. position of the text. They can be either positive or negative
  12775. values. The default value for both is &quot;0&quot;.
  12776. </p>
  12777. </dd>
  12778. <dt><samp>start_number</samp></dt>
  12779. <dd><p>The starting frame number for the n/frame_num variable. The default value
  12780. is &quot;0&quot;.
  12781. </p>
  12782. </dd>
  12783. <dt><samp>tabsize</samp></dt>
  12784. <dd><p>The size in number of spaces to use for rendering the tab.
  12785. Default value is 4.
  12786. </p>
  12787. </dd>
  12788. <dt><samp>timecode</samp></dt>
  12789. <dd><p>Set the initial timecode representation in &quot;hh:mm:ss[:;.]ff&quot;
  12790. format. It can be used with or without text parameter. <var>timecode_rate</var>
  12791. option must be specified.
  12792. </p>
  12793. </dd>
  12794. <dt><samp>timecode_rate, rate, r</samp></dt>
  12795. <dd><p>Set the timecode frame rate (timecode only). Value will be rounded to nearest
  12796. integer. Minimum value is &quot;1&quot;.
  12797. Drop-frame timecode is supported for frame rates 30 &amp; 60.
  12798. </p>
  12799. </dd>
  12800. <dt><samp>tc24hmax</samp></dt>
  12801. <dd><p>If set to 1, the output of the timecode option will wrap around at 24 hours.
  12802. Default is 0 (disabled).
  12803. </p>
  12804. </dd>
  12805. <dt><samp>text</samp></dt>
  12806. <dd><p>The text string to be drawn. The text must be a sequence of UTF-8
  12807. encoded characters.
  12808. This parameter is mandatory if no file is specified with the parameter
  12809. <var>textfile</var>.
  12810. </p>
  12811. </dd>
  12812. <dt><samp>textfile</samp></dt>
  12813. <dd><p>A text file containing text to be drawn. The text must be a sequence
  12814. of UTF-8 encoded characters.
  12815. </p>
  12816. <p>This parameter is mandatory if no text string is specified with the
  12817. parameter <var>text</var>.
  12818. </p>
  12819. <p>If both <var>text</var> and <var>textfile</var> are specified, an error is thrown.
  12820. </p>
  12821. </dd>
  12822. <dt><samp>reload</samp></dt>
  12823. <dd><p>If set to 1, the <var>textfile</var> will be reloaded before each frame.
  12824. Be sure to update it atomically, or it may be read partially, or even fail.
  12825. </p>
  12826. </dd>
  12827. <dt><samp>x</samp></dt>
  12828. <dt><samp>y</samp></dt>
  12829. <dd><p>The expressions which specify the offsets where text will be drawn
  12830. within the video frame. They are relative to the top/left border of the
  12831. output image.
  12832. </p>
  12833. <p>The default value of <var>x</var> and <var>y</var> is &quot;0&quot;.
  12834. </p>
  12835. <p>See below for the list of accepted constants and functions.
  12836. </p></dd>
  12837. </dl>
  12838. <p>The parameters for <var>x</var> and <var>y</var> are expressions containing the
  12839. following constants and functions:
  12840. </p>
  12841. <dl compact="compact">
  12842. <dt><samp>dar</samp></dt>
  12843. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  12844. </p>
  12845. </dd>
  12846. <dt><samp>hsub</samp></dt>
  12847. <dt><samp>vsub</samp></dt>
  12848. <dd><p>horizontal and vertical chroma subsample values. For example for the
  12849. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  12850. </p>
  12851. </dd>
  12852. <dt><samp>line_h, lh</samp></dt>
  12853. <dd><p>the height of each text line
  12854. </p>
  12855. </dd>
  12856. <dt><samp>main_h, h, H</samp></dt>
  12857. <dd><p>the input height
  12858. </p>
  12859. </dd>
  12860. <dt><samp>main_w, w, W</samp></dt>
  12861. <dd><p>the input width
  12862. </p>
  12863. </dd>
  12864. <dt><samp>max_glyph_a, ascent</samp></dt>
  12865. <dd><p>the maximum distance from the baseline to the highest/upper grid
  12866. coordinate used to place a glyph outline point, for all the rendered
  12867. glyphs.
  12868. It is a positive value, due to the grid&rsquo;s orientation with the Y axis
  12869. upwards.
  12870. </p>
  12871. </dd>
  12872. <dt><samp>max_glyph_d, descent</samp></dt>
  12873. <dd><p>the maximum distance from the baseline to the lowest grid coordinate
  12874. used to place a glyph outline point, for all the rendered glyphs.
  12875. This is a negative value, due to the grid&rsquo;s orientation, with the Y axis
  12876. upwards.
  12877. </p>
  12878. </dd>
  12879. <dt><samp>max_glyph_h</samp></dt>
  12880. <dd><p>maximum glyph height, that is the maximum height for all the glyphs
  12881. contained in the rendered text, it is equivalent to <var>ascent</var> -
  12882. <var>descent</var>.
  12883. </p>
  12884. </dd>
  12885. <dt><samp>max_glyph_w</samp></dt>
  12886. <dd><p>maximum glyph width, that is the maximum width for all the glyphs
  12887. contained in the rendered text
  12888. </p>
  12889. </dd>
  12890. <dt><samp>n</samp></dt>
  12891. <dd><p>the number of input frame, starting from 0
  12892. </p>
  12893. </dd>
  12894. <dt><samp>rand(min, max)</samp></dt>
  12895. <dd><p>return a random number included between <var>min</var> and <var>max</var>
  12896. </p>
  12897. </dd>
  12898. <dt><samp>sar</samp></dt>
  12899. <dd><p>The input sample aspect ratio.
  12900. </p>
  12901. </dd>
  12902. <dt><samp>t</samp></dt>
  12903. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  12904. </p>
  12905. </dd>
  12906. <dt><samp>text_h, th</samp></dt>
  12907. <dd><p>the height of the rendered text
  12908. </p>
  12909. </dd>
  12910. <dt><samp>text_w, tw</samp></dt>
  12911. <dd><p>the width of the rendered text
  12912. </p>
  12913. </dd>
  12914. <dt><samp>x</samp></dt>
  12915. <dt><samp>y</samp></dt>
  12916. <dd><p>the x and y offset coordinates where the text is drawn.
  12917. </p>
  12918. <p>These parameters allow the <var>x</var> and <var>y</var> expressions to refer
  12919. to each other, so you can for example specify <code>y=x/dar</code>.
  12920. </p>
  12921. </dd>
  12922. <dt><samp>pict_type</samp></dt>
  12923. <dd><p>A one character description of the current frame&rsquo;s picture type.
  12924. </p>
  12925. </dd>
  12926. <dt><samp>pkt_pos</samp></dt>
  12927. <dd><p>The current packet&rsquo;s position in the input file or stream
  12928. (in bytes, from the start of the input). A value of -1 indicates
  12929. this info is not available.
  12930. </p>
  12931. </dd>
  12932. <dt><samp>pkt_duration</samp></dt>
  12933. <dd><p>The current packet&rsquo;s duration, in seconds.
  12934. </p>
  12935. </dd>
  12936. <dt><samp>pkt_size</samp></dt>
  12937. <dd><p>The current packet&rsquo;s size (in bytes).
  12938. </p></dd>
  12939. </dl>
  12940. <span id="drawtext_005fexpansion"></span><a name="Text-expansion"></a>
  12941. <h4 class="subsection">11.66.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>
  12942. <p>If <samp>expansion</samp> is set to <code>strftime</code>,
  12943. the filter recognizes strftime() sequences in the provided text and
  12944. expands them accordingly. Check the documentation of strftime(). This
  12945. feature is deprecated.
  12946. </p>
  12947. <p>If <samp>expansion</samp> is set to <code>none</code>, the text is printed verbatim.
  12948. </p>
  12949. <p>If <samp>expansion</samp> is set to <code>normal</code> (which is the default),
  12950. the following expansion mechanism is used.
  12951. </p>
  12952. <p>The backslash character &lsquo;<samp>\</samp>&rsquo;, followed by any character, always expands to
  12953. the second character.
  12954. </p>
  12955. <p>Sequences of the form <code>%{...}</code> are expanded. The text between the
  12956. braces is a function name, possibly followed by arguments separated by &rsquo;:&rsquo;.
  12957. If the arguments contain special characters or delimiters (&rsquo;:&rsquo; or &rsquo;}&rsquo;),
  12958. they should be escaped.
  12959. </p>
  12960. <p>Note that they probably must also be escaped as the value for the
  12961. <samp>text</samp> option in the filter argument string and as the filter
  12962. argument in the filtergraph description, and possibly also for the shell,
  12963. that makes up to four levels of escaping; using a text file avoids these
  12964. problems.
  12965. </p>
  12966. <p>The following functions are available:
  12967. </p>
  12968. <dl compact="compact">
  12969. <dt><code>expr, e</code></dt>
  12970. <dd><p>The expression evaluation result.
  12971. </p>
  12972. <p>It must take one argument specifying the expression to be evaluated,
  12973. which accepts the same constants and functions as the <var>x</var> and
  12974. <var>y</var> values. Note that not all constants should be used, for
  12975. example the text size is not known when evaluating the expression, so
  12976. the constants <var>text_w</var> and <var>text_h</var> will have an undefined
  12977. value.
  12978. </p>
  12979. </dd>
  12980. <dt><code>expr_int_format, eif</code></dt>
  12981. <dd><p>Evaluate the expression&rsquo;s value and output as formatted integer.
  12982. </p>
  12983. <p>The first argument is the expression to be evaluated, just as for the <var>expr</var> function.
  12984. The second argument specifies the output format. Allowed values are &lsquo;<samp>x</samp>&rsquo;,
  12985. &lsquo;<samp>X</samp>&rsquo;, &lsquo;<samp>d</samp>&rsquo; and &lsquo;<samp>u</samp>&rsquo;. They are treated exactly as in the
  12986. <code>printf</code> function.
  12987. The third parameter is optional and sets the number of positions taken by the output.
  12988. It can be used to add padding with zeros from the left.
  12989. </p>
  12990. </dd>
  12991. <dt><code>gmtime</code></dt>
  12992. <dd><p>The time at which the filter is running, expressed in UTC.
  12993. It can accept an argument: a strftime() format string.
  12994. </p>
  12995. </dd>
  12996. <dt><code>localtime</code></dt>
  12997. <dd><p>The time at which the filter is running, expressed in the local time zone.
  12998. It can accept an argument: a strftime() format string.
  12999. </p>
  13000. </dd>
  13001. <dt><code>metadata</code></dt>
  13002. <dd><p>Frame metadata. Takes one or two arguments.
  13003. </p>
  13004. <p>The first argument is mandatory and specifies the metadata key.
  13005. </p>
  13006. <p>The second argument is optional and specifies a default value, used when the
  13007. metadata key is not found or empty.
  13008. </p>
  13009. <p>Available metadata can be identified by inspecting entries
  13010. starting with TAG included within each frame section
  13011. printed by running <code>ffprobe -show_frames</code>.
  13012. </p>
  13013. <p>String metadata generated in filters leading to
  13014. the drawtext filter are also available.
  13015. </p>
  13016. </dd>
  13017. <dt><code>n, frame_num</code></dt>
  13018. <dd><p>The frame number, starting from 0.
  13019. </p>
  13020. </dd>
  13021. <dt><code>pict_type</code></dt>
  13022. <dd><p>A one character description of the current picture type.
  13023. </p>
  13024. </dd>
  13025. <dt><code>pts</code></dt>
  13026. <dd><p>The timestamp of the current frame.
  13027. It can take up to three arguments.
  13028. </p>
  13029. <p>The first argument is the format of the timestamp; it defaults to <code>flt</code>
  13030. for seconds as a decimal number with microsecond accuracy; <code>hms</code> stands
  13031. for a formatted <var>[-]HH:MM:SS.mmm</var> timestamp with millisecond accuracy.
  13032. <code>gmtime</code> stands for the timestamp of the frame formatted as UTC time;
  13033. <code>localtime</code> stands for the timestamp of the frame formatted as
  13034. local time zone time.
  13035. </p>
  13036. <p>The second argument is an offset added to the timestamp.
  13037. </p>
  13038. <p>If the format is set to <code>hms</code>, a third argument <code>24HH</code> may be
  13039. supplied to present the hour part of the formatted timestamp in 24h format
  13040. (00-23).
  13041. </p>
  13042. <p>If the format is set to <code>localtime</code> or <code>gmtime</code>,
  13043. a third argument may be supplied: a strftime() format string.
  13044. By default, <var>YYYY-MM-DD HH:MM:SS</var> format will be used.
  13045. </p></dd>
  13046. </dl>
  13047. <a name="Commands-75"></a>
  13048. <h4 class="subsection">11.66.3 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>
  13049. <p>This filter supports altering parameters via commands:
  13050. </p><dl compact="compact">
  13051. <dt><samp>reinit</samp></dt>
  13052. <dd><p>Alter existing filter parameters.
  13053. </p>
  13054. <p>Syntax for the argument is the same as for filter invocation, e.g.
  13055. </p>
  13056. <div class="example">
  13057. <pre class="example">fontsize=56:fontcolor=green:text='Hello World'
  13058. </pre></div>
  13059. <p>Full filter invocation with sendcmd would look like this:
  13060. </p>
  13061. <div class="example">
  13062. <pre class="example">sendcmd=c='56.0 drawtext reinit fontsize=56\:fontcolor=green\:text=Hello\\ World'
  13063. </pre></div>
  13064. </dd>
  13065. </dl>
  13066. <p>If the entire argument can&rsquo;t be parsed or applied as valid values then the filter will
  13067. continue with its existing parameters.
  13068. </p>
  13069. <a name="Examples-62"></a>
  13070. <h4 class="subsection">11.66.4 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>
  13071. <ul>
  13072. <li> Draw &quot;Test Text&quot; with font FreeSerif, using the default values for the
  13073. optional parameters.
  13074. <div class="example">
  13075. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'&quot;
  13076. </pre></div>
  13077. </li><li> Draw &rsquo;Test Text&rsquo; with font FreeSerif of size 24 at position x=100
  13078. and y=50 (counting from the top-left corner of the screen), text is
  13079. yellow with a red box around it. Both the text and the box have an
  13080. opacity of 20%.
  13081. <div class="example">
  13082. <pre class="example">drawtext=&quot;fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
  13083. x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2&quot;
  13084. </pre></div>
  13085. <p>Note that the double quotes are not necessary if spaces are not used
  13086. within the parameter list.
  13087. </p>
  13088. </li><li> Show the text at the center of the video frame:
  13089. <div class="example">
  13090. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=(w-text_w)/2:y=(h-text_h)/2&quot;
  13091. </pre></div>
  13092. </li><li> Show the text at a random position, switching to a new position every 30 seconds:
  13093. <div class="example">
  13094. <pre class="example">drawtext=&quot;fontsize=30:fontfile=FreeSerif.ttf:text='hello world':x=if(eq(mod(t\,30)\,0)\,rand(0\,(w-text_w))\,x):y=if(eq(mod(t\,30)\,0)\,rand(0\,(h-text_h))\,y)&quot;
  13095. </pre></div>
  13096. </li><li> Show a text line sliding from right to left in the last row of the video
  13097. frame. The file <samp>LONG_LINE</samp> is assumed to contain a single line
  13098. with no newlines.
  13099. <div class="example">
  13100. <pre class="example">drawtext=&quot;fontsize=15:fontfile=FreeSerif.ttf:text=LONG_LINE:y=h-line_h:x=-50*t&quot;
  13101. </pre></div>
  13102. </li><li> Show the content of file <samp>CREDITS</samp> off the bottom of the frame and scroll up.
  13103. <div class="example">
  13104. <pre class="example">drawtext=&quot;fontsize=20:fontfile=FreeSerif.ttf:textfile=CREDITS:y=h-20*t&quot;
  13105. </pre></div>
  13106. </li><li> Draw a single green letter &quot;g&quot;, at the center of the input video.
  13107. The glyph baseline is placed at half screen height.
  13108. <div class="example">
  13109. <pre class="example">drawtext=&quot;fontsize=60:fontfile=FreeSerif.ttf:fontcolor=green:text=g:x=(w-max_glyph_w)/2:y=h/2-ascent&quot;
  13110. </pre></div>
  13111. </li><li> Show text for 1 second every 3 seconds:
  13112. <div class="example">
  13113. <pre class="example">drawtext=&quot;fontfile=FreeSerif.ttf:fontcolor=white:x=100:y=x/dar:enable=lt(mod(t\,3)\,1):text='blink'&quot;
  13114. </pre></div>
  13115. </li><li> Use fontconfig to set the font. Note that the colons need to be escaped.
  13116. <div class="example">
  13117. <pre class="example">drawtext='fontfile=Linux Libertine O-40\:style=Semibold:text=FFmpeg'
  13118. </pre></div>
  13119. </li><li> Draw &quot;Test Text&quot; with font size dependent on height of the video.
  13120. <div class="example">
  13121. <pre class="example">drawtext=&quot;text='Test Text': fontsize=h/30: x=(w-text_w)/2: y=(h-text_h*2)&quot;
  13122. </pre></div>
  13123. </li><li> Print the date of a real-time encoding (see strftime(3)):
  13124. <div class="example">
  13125. <pre class="example">drawtext='fontfile=FreeSans.ttf:text=%{localtime\:%a %b %d %Y}'
  13126. </pre></div>
  13127. </li><li> Show text fading in and out (appearing/disappearing):
  13128. <div class="example">
  13129. <pre class="example">#!/bin/sh
  13130. DS=1.0 # display start
  13131. DE=10.0 # display end
  13132. FID=1.5 # fade in duration
  13133. FOD=5 # fade out duration
  13134. 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;
  13135. </pre></div>
  13136. </li><li> Horizontally align multiple separate texts. Note that <samp>max_glyph_a</samp>
  13137. and the <samp>fontsize</samp> value are included in the <samp>y</samp> offset.
  13138. <div class="example">
  13139. <pre class="example">drawtext=fontfile=FreeSans.ttf:text=DOG:fontsize=24:x=10:y=20+24-max_glyph_a,
  13140. drawtext=fontfile=FreeSans.ttf:text=cow:fontsize=24:x=80:y=20+24-max_glyph_a
  13141. </pre></div>
  13142. </li><li> Plot special <var>lavf.image2dec.source_basename</var> metadata onto each frame if
  13143. such metadata exists. Otherwise, plot the string &quot;NA&quot;. Note that image2 demuxer
  13144. must have option <samp>-export_path_metadata 1</samp> for the special metadata fields
  13145. to be available for filters.
  13146. <div class="example">
  13147. <pre class="example">drawtext=&quot;fontsize=20:fontcolor=white:fontfile=FreeSans.ttf:text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=10:y=10&quot;
  13148. </pre></div>
  13149. </li></ul>
  13150. <p>For more information about libfreetype, check:
  13151. <a href="http://www.freetype.org/">http://www.freetype.org/</a>.
  13152. </p>
  13153. <p>For more information about fontconfig, check:
  13154. <a href="http://freedesktop.org/software/fontconfig/fontconfig-user.html">http://freedesktop.org/software/fontconfig/fontconfig-user.html</a>.
  13155. </p>
  13156. <p>For more information about libfribidi, check:
  13157. <a href="http://fribidi.org/">http://fribidi.org/</a>.
  13158. </p>
  13159. <a name="edgedetect"></a>
  13160. <h3 class="section">11.67 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>
  13161. <p>Detect and draw edges. The filter uses the Canny Edge Detection algorithm.
  13162. </p>
  13163. <p>The filter accepts the following options:
  13164. </p>
  13165. <dl compact="compact">
  13166. <dt><samp>low</samp></dt>
  13167. <dt><samp>high</samp></dt>
  13168. <dd><p>Set low and high threshold values used by the Canny thresholding
  13169. algorithm.
  13170. </p>
  13171. <p>The high threshold selects the &quot;strong&quot; edge pixels, which are then
  13172. connected through 8-connectivity with the &quot;weak&quot; edge pixels selected
  13173. by the low threshold.
  13174. </p>
  13175. <p><var>low</var> and <var>high</var> threshold values must be chosen in the range
  13176. [0,1], and <var>low</var> should be lesser or equal to <var>high</var>.
  13177. </p>
  13178. <p>Default value for <var>low</var> is <code>20/255</code>, and default value for <var>high</var>
  13179. is <code>50/255</code>.
  13180. </p>
  13181. </dd>
  13182. <dt><samp>mode</samp></dt>
  13183. <dd><p>Define the drawing mode.
  13184. </p>
  13185. <dl compact="compact">
  13186. <dt>&lsquo;<samp>wires</samp>&rsquo;</dt>
  13187. <dd><p>Draw white/gray wires on black background.
  13188. </p>
  13189. </dd>
  13190. <dt>&lsquo;<samp>colormix</samp>&rsquo;</dt>
  13191. <dd><p>Mix the colors to create a paint/cartoon effect.
  13192. </p>
  13193. </dd>
  13194. <dt>&lsquo;<samp>canny</samp>&rsquo;</dt>
  13195. <dd><p>Apply Canny edge detector on all selected planes.
  13196. </p></dd>
  13197. </dl>
  13198. <p>Default value is <var>wires</var>.
  13199. </p>
  13200. </dd>
  13201. <dt><samp>planes</samp></dt>
  13202. <dd><p>Select planes for filtering. By default all available planes are filtered.
  13203. </p></dd>
  13204. </dl>
  13205. <a name="Examples-63"></a>
  13206. <h4 class="subsection">11.67.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>
  13207. <ul>
  13208. <li> Standard edge detection with custom values for the hysteresis thresholding:
  13209. <div class="example">
  13210. <pre class="example">edgedetect=low=0.1:high=0.4
  13211. </pre></div>
  13212. </li><li> Painting effect without thresholding:
  13213. <div class="example">
  13214. <pre class="example">edgedetect=mode=colormix:high=0
  13215. </pre></div>
  13216. </li></ul>
  13217. <a name="elbg"></a>
  13218. <h3 class="section">11.68 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>
  13219. <p>Apply a posterize effect using the ELBG (Enhanced LBG) algorithm.
  13220. </p>
  13221. <p>For each input image, the filter will compute the optimal mapping from
  13222. the input to the output given the codebook length, that is the number
  13223. of distinct output colors.
  13224. </p>
  13225. <p>This filter accepts the following options.
  13226. </p>
  13227. <dl compact="compact">
  13228. <dt><samp>codebook_length, l</samp></dt>
  13229. <dd><p>Set codebook length. The value must be a positive integer, and
  13230. represents the number of distinct output colors. Default value is 256.
  13231. </p>
  13232. </dd>
  13233. <dt><samp>nb_steps, n</samp></dt>
  13234. <dd><p>Set the maximum number of iterations to apply for computing the optimal
  13235. mapping. The higher the value the better the result and the higher the
  13236. computation time. Default value is 1.
  13237. </p>
  13238. </dd>
  13239. <dt><samp>seed, s</samp></dt>
  13240. <dd><p>Set a random seed, must be an integer included between 0 and
  13241. UINT32_MAX. If not specified, or if explicitly set to -1, the filter
  13242. will try to use a good random seed on a best effort basis.
  13243. </p>
  13244. </dd>
  13245. <dt><samp>pal8</samp></dt>
  13246. <dd><p>Set pal8 output pixel format. This option does not work with codebook
  13247. length greater than 256.
  13248. </p></dd>
  13249. </dl>
  13250. <a name="entropy"></a>
  13251. <h3 class="section">11.69 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>
  13252. <p>Measure graylevel entropy in histogram of color channels of video frames.
  13253. </p>
  13254. <p>It accepts the following parameters:
  13255. </p>
  13256. <dl compact="compact">
  13257. <dt><samp>mode</samp></dt>
  13258. <dd><p>Can be either <var>normal</var> or <var>diff</var>. Default is <var>normal</var>.
  13259. </p>
  13260. <p><var>diff</var> mode measures entropy of histogram delta values, absolute differences
  13261. between neighbour histogram values.
  13262. </p></dd>
  13263. </dl>
  13264. <a name="epx"></a>
  13265. <h3 class="section">11.70 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>
  13266. <p>Apply the EPX magnification filter which is designed for pixel art.
  13267. </p>
  13268. <p>It accepts the following option:
  13269. </p>
  13270. <dl compact="compact">
  13271. <dt><samp>n</samp></dt>
  13272. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xEPX</code>, <code>3</code> for
  13273. <code>3xEPX</code>.
  13274. Default is <code>3</code>.
  13275. </p></dd>
  13276. </dl>
  13277. <a name="eq"></a>
  13278. <h3 class="section">11.71 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>
  13279. <p>Set brightness, contrast, saturation and approximate gamma adjustment.
  13280. </p>
  13281. <p>The filter accepts the following options:
  13282. </p>
  13283. <dl compact="compact">
  13284. <dt><samp>contrast</samp></dt>
  13285. <dd><p>Set the contrast expression. The value must be a float value in range
  13286. <code>-1000.0</code> to <code>1000.0</code>. The default value is &quot;1&quot;.
  13287. </p>
  13288. </dd>
  13289. <dt><samp>brightness</samp></dt>
  13290. <dd><p>Set the brightness expression. The value must be a float value in
  13291. range <code>-1.0</code> to <code>1.0</code>. The default value is &quot;0&quot;.
  13292. </p>
  13293. </dd>
  13294. <dt><samp>saturation</samp></dt>
  13295. <dd><p>Set the saturation expression. The value must be a float in
  13296. range <code>0.0</code> to <code>3.0</code>. The default value is &quot;1&quot;.
  13297. </p>
  13298. </dd>
  13299. <dt><samp>gamma</samp></dt>
  13300. <dd><p>Set the gamma expression. The value must be a float in range
  13301. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  13302. </p>
  13303. </dd>
  13304. <dt><samp>gamma_r</samp></dt>
  13305. <dd><p>Set the gamma expression for red. The value must be a float in
  13306. range <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  13307. </p>
  13308. </dd>
  13309. <dt><samp>gamma_g</samp></dt>
  13310. <dd><p>Set the gamma expression for green. The value must be a float in range
  13311. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  13312. </p>
  13313. </dd>
  13314. <dt><samp>gamma_b</samp></dt>
  13315. <dd><p>Set the gamma expression for blue. The value must be a float in range
  13316. <code>0.1</code> to <code>10.0</code>. The default value is &quot;1&quot;.
  13317. </p>
  13318. </dd>
  13319. <dt><samp>gamma_weight</samp></dt>
  13320. <dd><p>Set the gamma weight expression. It can be used to reduce the effect
  13321. of a high gamma value on bright image areas, e.g. keep them from
  13322. getting overamplified and just plain white. The value must be a float
  13323. in range <code>0.0</code> to <code>1.0</code>. A value of <code>0.0</code> turns the
  13324. gamma correction all the way down while <code>1.0</code> leaves it at its
  13325. full strength. Default is &quot;1&quot;.
  13326. </p>
  13327. </dd>
  13328. <dt><samp>eval</samp></dt>
  13329. <dd><p>Set when the expressions for brightness, contrast, saturation and
  13330. gamma expressions are evaluated.
  13331. </p>
  13332. <p>It accepts the following values:
  13333. </p><dl compact="compact">
  13334. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  13335. <dd><p>only evaluate expressions once during the filter initialization or
  13336. when a command is processed
  13337. </p>
  13338. </dd>
  13339. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  13340. <dd><p>evaluate expressions for each incoming frame
  13341. </p></dd>
  13342. </dl>
  13343. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  13344. </p></dd>
  13345. </dl>
  13346. <p>The expressions accept the following parameters:
  13347. </p><dl compact="compact">
  13348. <dt><samp>n</samp></dt>
  13349. <dd><p>frame count of the input frame starting from 0
  13350. </p>
  13351. </dd>
  13352. <dt><samp>pos</samp></dt>
  13353. <dd><p>byte position of the corresponding packet in the input file, NAN if
  13354. unspecified
  13355. </p>
  13356. </dd>
  13357. <dt><samp>r</samp></dt>
  13358. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  13359. </p>
  13360. </dd>
  13361. <dt><samp>t</samp></dt>
  13362. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  13363. </p></dd>
  13364. </dl>
  13365. <a name="Commands-76"></a>
  13366. <h4 class="subsection">11.71.1 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>
  13367. <p>The filter supports the following commands:
  13368. </p>
  13369. <dl compact="compact">
  13370. <dt><samp>contrast</samp></dt>
  13371. <dd><p>Set the contrast expression.
  13372. </p>
  13373. </dd>
  13374. <dt><samp>brightness</samp></dt>
  13375. <dd><p>Set the brightness expression.
  13376. </p>
  13377. </dd>
  13378. <dt><samp>saturation</samp></dt>
  13379. <dd><p>Set the saturation expression.
  13380. </p>
  13381. </dd>
  13382. <dt><samp>gamma</samp></dt>
  13383. <dd><p>Set the gamma expression.
  13384. </p>
  13385. </dd>
  13386. <dt><samp>gamma_r</samp></dt>
  13387. <dd><p>Set the gamma_r expression.
  13388. </p>
  13389. </dd>
  13390. <dt><samp>gamma_g</samp></dt>
  13391. <dd><p>Set gamma_g expression.
  13392. </p>
  13393. </dd>
  13394. <dt><samp>gamma_b</samp></dt>
  13395. <dd><p>Set gamma_b expression.
  13396. </p>
  13397. </dd>
  13398. <dt><samp>gamma_weight</samp></dt>
  13399. <dd><p>Set gamma_weight expression.
  13400. </p>
  13401. <p>The command accepts the same syntax of the corresponding option.
  13402. </p>
  13403. <p>If the specified expression is not valid, it is kept at its current
  13404. value.
  13405. </p>
  13406. </dd>
  13407. </dl>
  13408. <a name="erosion"></a>
  13409. <h3 class="section">11.72 erosion<span class="pull-right"><a class="anchor hidden-xs" href="#erosion" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-erosion" aria-hidden="true">TOC</a></span></h3>
  13410. <p>Apply erosion effect to the video.
  13411. </p>
  13412. <p>This filter replaces the pixel by the local(3x3) minimum.
  13413. </p>
  13414. <p>It accepts the following options:
  13415. </p>
  13416. <dl compact="compact">
  13417. <dt><samp>threshold0</samp></dt>
  13418. <dt><samp>threshold1</samp></dt>
  13419. <dt><samp>threshold2</samp></dt>
  13420. <dt><samp>threshold3</samp></dt>
  13421. <dd><p>Limit the maximum change for each plane, default is 65535.
  13422. If 0, plane will remain unchanged.
  13423. </p>
  13424. </dd>
  13425. <dt><samp>coordinates</samp></dt>
  13426. <dd><p>Flag which specifies the pixel to refer to. Default is 255 i.e. all eight
  13427. pixels are used.
  13428. </p>
  13429. <p>Flags to local 3x3 coordinates maps like this:
  13430. </p>
  13431. <p>1 2 3
  13432. 4 5
  13433. 6 7 8
  13434. </p></dd>
  13435. </dl>
  13436. <a name="Commands-77"></a>
  13437. <h4 class="subsection">11.72.1 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>
  13438. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  13439. </p>
  13440. <a name="estdif"></a>
  13441. <h3 class="section">11.73 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>
  13442. <p>Deinterlace the input video (&quot;estdif&quot; stands for &quot;Edge Slope
  13443. Tracing Deinterlacing Filter&quot;).
  13444. </p>
  13445. <p>Spatial only filter that uses edge slope tracing algorithm
  13446. to interpolate missing lines.
  13447. It accepts the following parameters:
  13448. </p>
  13449. <dl compact="compact">
  13450. <dt><samp>mode</samp></dt>
  13451. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  13452. </p>
  13453. <dl compact="compact">
  13454. <dt><samp>frame</samp></dt>
  13455. <dd><p>Output one frame for each frame.
  13456. </p></dd>
  13457. <dt><samp>field</samp></dt>
  13458. <dd><p>Output one frame for each field.
  13459. </p></dd>
  13460. </dl>
  13461. <p>The default value is <code>field</code>.
  13462. </p>
  13463. </dd>
  13464. <dt><samp>parity</samp></dt>
  13465. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  13466. of the following values:
  13467. </p>
  13468. <dl compact="compact">
  13469. <dt><samp>tff</samp></dt>
  13470. <dd><p>Assume the top field is first.
  13471. </p></dd>
  13472. <dt><samp>bff</samp></dt>
  13473. <dd><p>Assume the bottom field is first.
  13474. </p></dd>
  13475. <dt><samp>auto</samp></dt>
  13476. <dd><p>Enable automatic detection of field parity.
  13477. </p></dd>
  13478. </dl>
  13479. <p>The default value is <code>auto</code>.
  13480. If the interlacing is unknown or the decoder does not export this information,
  13481. top field first will be assumed.
  13482. </p>
  13483. </dd>
  13484. <dt><samp>deint</samp></dt>
  13485. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  13486. values:
  13487. </p>
  13488. <dl compact="compact">
  13489. <dt><samp>all</samp></dt>
  13490. <dd><p>Deinterlace all frames.
  13491. </p></dd>
  13492. <dt><samp>interlaced</samp></dt>
  13493. <dd><p>Only deinterlace frames marked as interlaced.
  13494. </p></dd>
  13495. </dl>
  13496. <p>The default value is <code>all</code>.
  13497. </p>
  13498. </dd>
  13499. <dt><samp>rslope</samp></dt>
  13500. <dd><p>Specify the search radius for edge slope tracing. Default value is 1.
  13501. Allowed range is from 1 to 15.
  13502. </p>
  13503. </dd>
  13504. <dt><samp>redge</samp></dt>
  13505. <dd><p>Specify the search radius for best edge matching. Default value is 2.
  13506. Allowed range is from 0 to 15.
  13507. </p>
  13508. </dd>
  13509. <dt><samp>interp</samp></dt>
  13510. <dd><p>Specify the interpolation used. Default is 4-point interpolation. It accepts one
  13511. of the following values:
  13512. </p>
  13513. <dl compact="compact">
  13514. <dt><samp>2p</samp></dt>
  13515. <dd><p>Two-point interpolation.
  13516. </p></dd>
  13517. <dt><samp>4p</samp></dt>
  13518. <dd><p>Four-point interpolation.
  13519. </p></dd>
  13520. <dt><samp>6p</samp></dt>
  13521. <dd><p>Six-point interpolation.
  13522. </p></dd>
  13523. </dl>
  13524. </dd>
  13525. </dl>
  13526. <a name="Commands-78"></a>
  13527. <h4 class="subsection">11.73.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>
  13528. <p>This filter supports same <a href="#commands">commands</a> as options.
  13529. </p>
  13530. <a name="exposure"></a>
  13531. <h3 class="section">11.74 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>
  13532. <p>Adjust exposure of the video stream.
  13533. </p>
  13534. <p>The filter accepts the following options:
  13535. </p>
  13536. <dl compact="compact">
  13537. <dt><samp>exposure</samp></dt>
  13538. <dd><p>Set the exposure correction in EV. Allowed range is from -3.0 to 3.0 EV
  13539. Default value is 0 EV.
  13540. </p>
  13541. </dd>
  13542. <dt><samp>black</samp></dt>
  13543. <dd><p>Set the black level correction. Allowed range is from -1.0 to 1.0.
  13544. Default value is 0.
  13545. </p></dd>
  13546. </dl>
  13547. <a name="Commands-79"></a>
  13548. <h4 class="subsection">11.74.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>
  13549. <p>This filter supports same <a href="#commands">commands</a> as options.
  13550. </p>
  13551. <a name="extractplanes"></a>
  13552. <h3 class="section">11.75 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>
  13553. <p>Extract color channel components from input video stream into
  13554. separate grayscale video streams.
  13555. </p>
  13556. <p>The filter accepts the following option:
  13557. </p>
  13558. <dl compact="compact">
  13559. <dt><samp>planes</samp></dt>
  13560. <dd><p>Set plane(s) to extract.
  13561. </p>
  13562. <p>Available values for planes are:
  13563. </p><dl compact="compact">
  13564. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  13565. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  13566. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  13567. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  13568. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  13569. <dt>&lsquo;<samp>g</samp>&rsquo;</dt>
  13570. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  13571. </dl>
  13572. <p>Choosing planes not available in the input will result in an error.
  13573. That means you cannot select <code>r</code>, <code>g</code>, <code>b</code> planes
  13574. with <code>y</code>, <code>u</code>, <code>v</code> planes at same time.
  13575. </p></dd>
  13576. </dl>
  13577. <a name="Examples-64"></a>
  13578. <h4 class="subsection">11.75.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>
  13579. <ul>
  13580. <li> Extract luma, u and v color channel component from input video frame
  13581. into 3 grayscale outputs:
  13582. <div class="example">
  13583. <pre class="example">ffmpeg -i video.avi -filter_complex 'extractplanes=y+u+v[y][u][v]' -map '[y]' y.avi -map '[u]' u.avi -map '[v]' v.avi
  13584. </pre></div>
  13585. </li></ul>
  13586. <a name="fade"></a>
  13587. <h3 class="section">11.76 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>
  13588. <p>Apply a fade-in/out effect to the input video.
  13589. </p>
  13590. <p>It accepts the following parameters:
  13591. </p>
  13592. <dl compact="compact">
  13593. <dt><samp>type, t</samp></dt>
  13594. <dd><p>The effect type can be either &quot;in&quot; for a fade-in, or &quot;out&quot; for a fade-out
  13595. effect.
  13596. Default is <code>in</code>.
  13597. </p>
  13598. </dd>
  13599. <dt><samp>start_frame, s</samp></dt>
  13600. <dd><p>Specify the number of the frame to start applying the fade
  13601. effect at. Default is 0.
  13602. </p>
  13603. </dd>
  13604. <dt><samp>nb_frames, n</samp></dt>
  13605. <dd><p>The number of frames that the fade effect lasts. At the end of the
  13606. fade-in effect, the output video will have the same intensity as the input video.
  13607. At the end of the fade-out transition, the output video will be filled with the
  13608. selected <samp>color</samp>.
  13609. Default is 25.
  13610. </p>
  13611. </dd>
  13612. <dt><samp>alpha</samp></dt>
  13613. <dd><p>If set to 1, fade only alpha channel, if one exists on the input.
  13614. Default value is 0.
  13615. </p>
  13616. </dd>
  13617. <dt><samp>start_time, st</samp></dt>
  13618. <dd><p>Specify the timestamp (in seconds) of the frame to start to apply the fade
  13619. effect. If both start_frame and start_time are specified, the fade will start at
  13620. whichever comes last. Default is 0.
  13621. </p>
  13622. </dd>
  13623. <dt><samp>duration, d</samp></dt>
  13624. <dd><p>The number of seconds for which the fade effect has to last. At the end of the
  13625. fade-in effect the output video will have the same intensity as the input video,
  13626. at the end of the fade-out transition the output video will be filled with the
  13627. selected <samp>color</samp>.
  13628. If both duration and nb_frames are specified, duration is used. Default is 0
  13629. (nb_frames is used by default).
  13630. </p>
  13631. </dd>
  13632. <dt><samp>color, c</samp></dt>
  13633. <dd><p>Specify the color of the fade. Default is &quot;black&quot;.
  13634. </p></dd>
  13635. </dl>
  13636. <a name="Examples-65"></a>
  13637. <h4 class="subsection">11.76.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>
  13638. <ul>
  13639. <li> Fade in the first 30 frames of video:
  13640. <div class="example">
  13641. <pre class="example">fade=in:0:30
  13642. </pre></div>
  13643. <p>The command above is equivalent to:
  13644. </p><div class="example">
  13645. <pre class="example">fade=t=in:s=0:n=30
  13646. </pre></div>
  13647. </li><li> Fade out the last 45 frames of a 200-frame video:
  13648. <div class="example">
  13649. <pre class="example">fade=out:155:45
  13650. fade=type=out:start_frame=155:nb_frames=45
  13651. </pre></div>
  13652. </li><li> Fade in the first 25 frames and fade out the last 25 frames of a 1000-frame video:
  13653. <div class="example">
  13654. <pre class="example">fade=in:0:25, fade=out:975:25
  13655. </pre></div>
  13656. </li><li> Make the first 5 frames yellow, then fade in from frame 5-24:
  13657. <div class="example">
  13658. <pre class="example">fade=in:5:20:color=yellow
  13659. </pre></div>
  13660. </li><li> Fade in alpha over first 25 frames of video:
  13661. <div class="example">
  13662. <pre class="example">fade=in:0:25:alpha=1
  13663. </pre></div>
  13664. </li><li> Make the first 5.5 seconds black, then fade in for 0.5 seconds:
  13665. <div class="example">
  13666. <pre class="example">fade=t=in:st=5.5:d=0.5
  13667. </pre></div>
  13668. </li></ul>
  13669. <a name="fftdnoiz"></a>
  13670. <h3 class="section">11.77 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>
  13671. <p>Denoise frames using 3D FFT (frequency domain filtering).
  13672. </p>
  13673. <p>The filter accepts the following options:
  13674. </p>
  13675. <dl compact="compact">
  13676. <dt><samp>sigma</samp></dt>
  13677. <dd><p>Set the noise sigma constant. This sets denoising strength.
  13678. Default value is 1. Allowed range is from 0 to 30.
  13679. Using very high sigma with low overlap may give blocking artifacts.
  13680. </p>
  13681. </dd>
  13682. <dt><samp>amount</samp></dt>
  13683. <dd><p>Set amount of denoising. By default all detected noise is reduced.
  13684. Default value is 1. Allowed range is from 0 to 1.
  13685. </p>
  13686. </dd>
  13687. <dt><samp>block</samp></dt>
  13688. <dd><p>Set size of block, Default is 4, can be 3, 4, 5 or 6.
  13689. Actual size of block in pixels is 2 to power of <var>block</var>, so by default
  13690. block size in pixels is 2^4 which is 16.
  13691. </p>
  13692. </dd>
  13693. <dt><samp>overlap</samp></dt>
  13694. <dd><p>Set block overlap. Default is 0.5. Allowed range is from 0.2 to 0.8.
  13695. </p>
  13696. </dd>
  13697. <dt><samp>prev</samp></dt>
  13698. <dd><p>Set number of previous frames to use for denoising. By default is set to 0.
  13699. </p>
  13700. </dd>
  13701. <dt><samp>next</samp></dt>
  13702. <dd><p>Set number of next frames to to use for denoising. By default is set to 0.
  13703. </p>
  13704. </dd>
  13705. <dt><samp>planes</samp></dt>
  13706. <dd><p>Set planes which will be filtered, by default are all available filtered
  13707. except alpha.
  13708. </p></dd>
  13709. </dl>
  13710. <a name="fftfilt"></a>
  13711. <h3 class="section">11.78 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>
  13712. <p>Apply arbitrary expressions to samples in frequency domain
  13713. </p>
  13714. <dl compact="compact">
  13715. <dt><samp>dc_Y</samp></dt>
  13716. <dd><p>Adjust the dc value (gain) of the luma plane of the image. The filter
  13717. accepts an integer value in range <code>0</code> to <code>1000</code>. The default
  13718. value is set to <code>0</code>.
  13719. </p>
  13720. </dd>
  13721. <dt><samp>dc_U</samp></dt>
  13722. <dd><p>Adjust the dc value (gain) of the 1st chroma plane of the image. The
  13723. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  13724. default value is set to <code>0</code>.
  13725. </p>
  13726. </dd>
  13727. <dt><samp>dc_V</samp></dt>
  13728. <dd><p>Adjust the dc value (gain) of the 2nd chroma plane of the image. The
  13729. filter accepts an integer value in range <code>0</code> to <code>1000</code>. The
  13730. default value is set to <code>0</code>.
  13731. </p>
  13732. </dd>
  13733. <dt><samp>weight_Y</samp></dt>
  13734. <dd><p>Set the frequency domain weight expression for the luma plane.
  13735. </p>
  13736. </dd>
  13737. <dt><samp>weight_U</samp></dt>
  13738. <dd><p>Set the frequency domain weight expression for the 1st chroma plane.
  13739. </p>
  13740. </dd>
  13741. <dt><samp>weight_V</samp></dt>
  13742. <dd><p>Set the frequency domain weight expression for the 2nd chroma plane.
  13743. </p>
  13744. </dd>
  13745. <dt><samp>eval</samp></dt>
  13746. <dd><p>Set when the expressions are evaluated.
  13747. </p>
  13748. <p>It accepts the following values:
  13749. </p><dl compact="compact">
  13750. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  13751. <dd><p>Only evaluate expressions once during the filter initialization.
  13752. </p>
  13753. </dd>
  13754. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  13755. <dd><p>Evaluate expressions for each incoming frame.
  13756. </p></dd>
  13757. </dl>
  13758. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  13759. </p>
  13760. <p>The filter accepts the following variables:
  13761. </p></dd>
  13762. <dt><samp>X</samp></dt>
  13763. <dt><samp>Y</samp></dt>
  13764. <dd><p>The coordinates of the current sample.
  13765. </p>
  13766. </dd>
  13767. <dt><samp>W</samp></dt>
  13768. <dt><samp>H</samp></dt>
  13769. <dd><p>The width and height of the image.
  13770. </p>
  13771. </dd>
  13772. <dt><samp>N</samp></dt>
  13773. <dd><p>The number of input frame, starting from 0.
  13774. </p></dd>
  13775. </dl>
  13776. <a name="Examples-66"></a>
  13777. <h4 class="subsection">11.78.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>
  13778. <ul>
  13779. <li> High-pass:
  13780. <div class="example">
  13781. <pre class="example">fftfilt=dc_Y=128:weight_Y='squish(1-(Y+X)/100)'
  13782. </pre></div>
  13783. </li><li> Low-pass:
  13784. <div class="example">
  13785. <pre class="example">fftfilt=dc_Y=0:weight_Y='squish((Y+X)/100-1)'
  13786. </pre></div>
  13787. </li><li> Sharpen:
  13788. <div class="example">
  13789. <pre class="example">fftfilt=dc_Y=0:weight_Y='1+squish(1-(Y+X)/100)'
  13790. </pre></div>
  13791. </li><li> Blur:
  13792. <div class="example">
  13793. <pre class="example">fftfilt=dc_Y=0:weight_Y='exp(-4 * ((Y+X)/(W+H)))'
  13794. </pre></div>
  13795. </li></ul>
  13796. <a name="field"></a>
  13797. <h3 class="section">11.79 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>
  13798. <p>Extract a single field from an interlaced image using stride
  13799. arithmetic to avoid wasting CPU time. The output frames are marked as
  13800. non-interlaced.
  13801. </p>
  13802. <p>The filter accepts the following options:
  13803. </p>
  13804. <dl compact="compact">
  13805. <dt><samp>type</samp></dt>
  13806. <dd><p>Specify whether to extract the top (if the value is <code>0</code> or
  13807. <code>top</code>) or the bottom field (if the value is <code>1</code> or
  13808. <code>bottom</code>).
  13809. </p></dd>
  13810. </dl>
  13811. <a name="fieldhint"></a>
  13812. <h3 class="section">11.80 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>
  13813. <p>Create new frames by copying the top and bottom fields from surrounding frames
  13814. supplied as numbers by the hint file.
  13815. </p>
  13816. <dl compact="compact">
  13817. <dt><samp>hint</samp></dt>
  13818. <dd><p>Set file containing hints: absolute/relative frame numbers.
  13819. </p>
  13820. <p>There must be one line for each frame in a clip. Each line must contain two
  13821. numbers separated by the comma, optionally followed by <code>-</code> or <code>+</code>.
  13822. Numbers supplied on each line of file can not be out of [N-1,N+1] where N
  13823. is current frame number for <code>absolute</code> mode or out of [-1, 1] range
  13824. for <code>relative</code> mode. First number tells from which frame to pick up top
  13825. field and second number tells from which frame to pick up bottom field.
  13826. </p>
  13827. <p>If optionally followed by <code>+</code> output frame will be marked as interlaced,
  13828. else if followed by <code>-</code> output frame will be marked as progressive, else
  13829. it will be marked same as input frame.
  13830. If optionally followed by <code>t</code> output frame will use only top field, or in
  13831. case of <code>b</code> it will use only bottom field.
  13832. If line starts with <code>#</code> or <code>;</code> that line is skipped.
  13833. </p>
  13834. </dd>
  13835. <dt><samp>mode</samp></dt>
  13836. <dd><p>Can be item <code>absolute</code> or <code>relative</code>. Default is <code>absolute</code>.
  13837. </p></dd>
  13838. </dl>
  13839. <p>Example of first several lines of <code>hint</code> file for <code>relative</code> mode:
  13840. </p><div class="example">
  13841. <pre class="example">0,0 - # first frame
  13842. 1,0 - # second frame, use third's frame top field and second's frame bottom field
  13843. 1,0 - # third frame, use fourth's frame top field and third's frame bottom field
  13844. 1,0 -
  13845. 0,0 -
  13846. 0,0 -
  13847. 1,0 -
  13848. 1,0 -
  13849. 1,0 -
  13850. 0,0 -
  13851. 0,0 -
  13852. 1,0 -
  13853. 1,0 -
  13854. 1,0 -
  13855. 0,0 -
  13856. </pre></div>
  13857. <a name="fieldmatch"></a>
  13858. <h3 class="section">11.81 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>
  13859. <p>Field matching filter for inverse telecine. It is meant to reconstruct the
  13860. progressive frames from a telecined stream. The filter does not drop duplicated
  13861. frames, so to achieve a complete inverse telecine <code>fieldmatch</code> needs to be
  13862. followed by a decimation filter such as <a href="#decimate">decimate</a> in the filtergraph.
  13863. </p>
  13864. <p>The separation of the field matching and the decimation is notably motivated by
  13865. the possibility of inserting a de-interlacing filter fallback between the two.
  13866. If the source has mixed telecined and real interlaced content,
  13867. <code>fieldmatch</code> will not be able to match fields for the interlaced parts.
  13868. But these remaining combed frames will be marked as interlaced, and thus can be
  13869. de-interlaced by a later filter such as <a href="#yadif">yadif</a> before decimation.
  13870. </p>
  13871. <p>In addition to the various configuration options, <code>fieldmatch</code> can take an
  13872. optional second stream, activated through the <samp>ppsrc</samp> option. If
  13873. enabled, the frames reconstruction will be based on the fields and frames from
  13874. this second stream. This allows the first input to be pre-processed in order to
  13875. help the various algorithms of the filter, while keeping the output lossless
  13876. (assuming the fields are matched properly). Typically, a field-aware denoiser,
  13877. or brightness/contrast adjustments can help.
  13878. </p>
  13879. <p>Note that this filter uses the same algorithms as TIVTC/TFM (AviSynth project)
  13880. and VIVTC/VFM (VapourSynth project). The later is a light clone of TFM from
  13881. which <code>fieldmatch</code> is based on. While the semantic and usage are very
  13882. close, some behaviour and options names can differ.
  13883. </p>
  13884. <p>The <a href="#decimate">decimate</a> filter currently only works for constant frame rate input.
  13885. If your input has mixed telecined (30fps) and progressive content with a lower
  13886. framerate like 24fps use the following filterchain to produce the necessary cfr
  13887. stream: <code>dejudder,fps=30000/1001,fieldmatch,decimate</code>.
  13888. </p>
  13889. <p>The filter accepts the following options:
  13890. </p>
  13891. <dl compact="compact">
  13892. <dt><samp>order</samp></dt>
  13893. <dd><p>Specify the assumed field order of the input stream. Available values are:
  13894. </p>
  13895. <dl compact="compact">
  13896. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  13897. <dd><p>Auto detect parity (use FFmpeg&rsquo;s internal parity value).
  13898. </p></dd>
  13899. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  13900. <dd><p>Assume bottom field first.
  13901. </p></dd>
  13902. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  13903. <dd><p>Assume top field first.
  13904. </p></dd>
  13905. </dl>
  13906. <p>Note that it is sometimes recommended not to trust the parity announced by the
  13907. stream.
  13908. </p>
  13909. <p>Default value is <var>auto</var>.
  13910. </p>
  13911. </dd>
  13912. <dt><samp>mode</samp></dt>
  13913. <dd><p>Set the matching mode or strategy to use. <samp>pc</samp> mode is the safest in the
  13914. sense that it won&rsquo;t risk creating jerkiness due to duplicate frames when
  13915. possible, but if there are bad edits or blended fields it will end up
  13916. outputting combed frames when a good match might actually exist. On the other
  13917. hand, <samp>pcn_ub</samp> mode is the most risky in terms of creating jerkiness,
  13918. but will almost always find a good frame if there is one. The other values are
  13919. all somewhere in between <samp>pc</samp> and <samp>pcn_ub</samp> in terms of risking
  13920. jerkiness and creating duplicate frames versus finding good matches in sections
  13921. with bad edits, orphaned fields, blended fields, etc.
  13922. </p>
  13923. <p>More details about p/c/n/u/b are available in <a href="#p_002fc_002fn_002fu_002fb-meaning">p/c/n/u/b meaning</a> section.
  13924. </p>
  13925. <p>Available values are:
  13926. </p>
  13927. <dl compact="compact">
  13928. <dt>&lsquo;<samp>pc</samp>&rsquo;</dt>
  13929. <dd><p>2-way matching (p/c)
  13930. </p></dd>
  13931. <dt>&lsquo;<samp>pc_n</samp>&rsquo;</dt>
  13932. <dd><p>2-way matching, and trying 3rd match if still combed (p/c + n)
  13933. </p></dd>
  13934. <dt>&lsquo;<samp>pc_u</samp>&rsquo;</dt>
  13935. <dd><p>2-way matching, and trying 3rd match (same order) if still combed (p/c + u)
  13936. </p></dd>
  13937. <dt>&lsquo;<samp>pc_n_ub</samp>&rsquo;</dt>
  13938. <dd><p>2-way matching, trying 3rd match if still combed, and trying 4th/5th matches if
  13939. still combed (p/c + n + u/b)
  13940. </p></dd>
  13941. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  13942. <dd><p>3-way matching (p/c/n)
  13943. </p></dd>
  13944. <dt>&lsquo;<samp>pcn_ub</samp>&rsquo;</dt>
  13945. <dd><p>3-way matching, and trying 4th/5th matches if all 3 of the original matches are
  13946. detected as combed (p/c/n + u/b)
  13947. </p></dd>
  13948. </dl>
  13949. <p>The parenthesis at the end indicate the matches that would be used for that
  13950. mode assuming <samp>order</samp>=<var>tff</var> (and <samp>field</samp> on <var>auto</var> or
  13951. <var>top</var>).
  13952. </p>
  13953. <p>In terms of speed <samp>pc</samp> mode is by far the fastest and <samp>pcn_ub</samp> is
  13954. the slowest.
  13955. </p>
  13956. <p>Default value is <var>pc_n</var>.
  13957. </p>
  13958. </dd>
  13959. <dt><samp>ppsrc</samp></dt>
  13960. <dd><p>Mark the main input stream as a pre-processed input, and enable the secondary
  13961. input stream as the clean source to pick the fields from. See the filter
  13962. introduction for more details. It is similar to the <samp>clip2</samp> feature from
  13963. VFM/TFM.
  13964. </p>
  13965. <p>Default value is <code>0</code> (disabled).
  13966. </p>
  13967. </dd>
  13968. <dt><samp>field</samp></dt>
  13969. <dd><p>Set the field to match from. It is recommended to set this to the same value as
  13970. <samp>order</samp> unless you experience matching failures with that setting. In
  13971. certain circumstances changing the field that is used to match from can have a
  13972. large impact on matching performance. Available values are:
  13973. </p>
  13974. <dl compact="compact">
  13975. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  13976. <dd><p>Automatic (same value as <samp>order</samp>).
  13977. </p></dd>
  13978. <dt>&lsquo;<samp>bottom</samp>&rsquo;</dt>
  13979. <dd><p>Match from the bottom field.
  13980. </p></dd>
  13981. <dt>&lsquo;<samp>top</samp>&rsquo;</dt>
  13982. <dd><p>Match from the top field.
  13983. </p></dd>
  13984. </dl>
  13985. <p>Default value is <var>auto</var>.
  13986. </p>
  13987. </dd>
  13988. <dt><samp>mchroma</samp></dt>
  13989. <dd><p>Set whether or not chroma is included during the match comparisons. In most
  13990. cases it is recommended to leave this enabled. You should set this to <code>0</code>
  13991. only if your clip has bad chroma problems such as heavy rainbowing or other
  13992. artifacts. Setting this to <code>0</code> could also be used to speed things up at
  13993. the cost of some accuracy.
  13994. </p>
  13995. <p>Default value is <code>1</code>.
  13996. </p>
  13997. </dd>
  13998. <dt><samp>y0</samp></dt>
  13999. <dt><samp>y1</samp></dt>
  14000. <dd><p>These define an exclusion band which excludes the lines between <samp>y0</samp> and
  14001. <samp>y1</samp> from being included in the field matching decision. An exclusion
  14002. band can be used to ignore subtitles, a logo, or other things that may
  14003. interfere with the matching. <samp>y0</samp> sets the starting scan line and
  14004. <samp>y1</samp> sets the ending line; all lines in between <samp>y0</samp> and
  14005. <samp>y1</samp> (including <samp>y0</samp> and <samp>y1</samp>) will be ignored. Setting
  14006. <samp>y0</samp> and <samp>y1</samp> to the same value will disable the feature.
  14007. <samp>y0</samp> and <samp>y1</samp> defaults to <code>0</code>.
  14008. </p>
  14009. </dd>
  14010. <dt><samp>scthresh</samp></dt>
  14011. <dd><p>Set the scene change detection threshold as a percentage of maximum change on
  14012. the luma plane. Good values are in the <code>[8.0, 14.0]</code> range. Scene change
  14013. detection is only relevant in case <samp>combmatch</samp>=<var>sc</var>. The range for
  14014. <samp>scthresh</samp> is <code>[0.0, 100.0]</code>.
  14015. </p>
  14016. <p>Default value is <code>12.0</code>.
  14017. </p>
  14018. </dd>
  14019. <dt><samp>combmatch</samp></dt>
  14020. <dd><p>When <samp>combatch</samp> is not <var>none</var>, <code>fieldmatch</code> will take into
  14021. account the combed scores of matches when deciding what match to use as the
  14022. final match. Available values are:
  14023. </p>
  14024. <dl compact="compact">
  14025. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  14026. <dd><p>No final matching based on combed scores.
  14027. </p></dd>
  14028. <dt>&lsquo;<samp>sc</samp>&rsquo;</dt>
  14029. <dd><p>Combed scores are only used when a scene change is detected.
  14030. </p></dd>
  14031. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  14032. <dd><p>Use combed scores all the time.
  14033. </p></dd>
  14034. </dl>
  14035. <p>Default is <var>sc</var>.
  14036. </p>
  14037. </dd>
  14038. <dt><samp>combdbg</samp></dt>
  14039. <dd><p>Force <code>fieldmatch</code> to calculate the combed metrics for certain matches and
  14040. print them. This setting is known as <samp>micout</samp> in TFM/VFM vocabulary.
  14041. Available values are:
  14042. </p>
  14043. <dl compact="compact">
  14044. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  14045. <dd><p>No forced calculation.
  14046. </p></dd>
  14047. <dt>&lsquo;<samp>pcn</samp>&rsquo;</dt>
  14048. <dd><p>Force p/c/n calculations.
  14049. </p></dd>
  14050. <dt>&lsquo;<samp>pcnub</samp>&rsquo;</dt>
  14051. <dd><p>Force p/c/n/u/b calculations.
  14052. </p></dd>
  14053. </dl>
  14054. <p>Default value is <var>none</var>.
  14055. </p>
  14056. </dd>
  14057. <dt><samp>cthresh</samp></dt>
  14058. <dd><p>This is the area combing threshold used for combed frame detection. This
  14059. essentially controls how &quot;strong&quot; or &quot;visible&quot; combing must be to be detected.
  14060. Larger values mean combing must be more visible and smaller values mean combing
  14061. can be less visible or strong and still be detected. Valid settings are from
  14062. <code>-1</code> (every pixel will be detected as combed) to <code>255</code> (no pixel will
  14063. be detected as combed). This is basically a pixel difference value. A good
  14064. range is <code>[8, 12]</code>.
  14065. </p>
  14066. <p>Default value is <code>9</code>.
  14067. </p>
  14068. </dd>
  14069. <dt><samp>chroma</samp></dt>
  14070. <dd><p>Sets whether or not chroma is considered in the combed frame decision. Only
  14071. disable this if your source has chroma problems (rainbowing, etc.) that are
  14072. causing problems for the combed frame detection with chroma enabled. Actually,
  14073. using <samp>chroma</samp>=<var>0</var> is usually more reliable, except for the case
  14074. where there is chroma only combing in the source.
  14075. </p>
  14076. <p>Default value is <code>0</code>.
  14077. </p>
  14078. </dd>
  14079. <dt><samp>blockx</samp></dt>
  14080. <dt><samp>blocky</samp></dt>
  14081. <dd><p>Respectively set the x-axis and y-axis size of the window used during combed
  14082. frame detection. This has to do with the size of the area in which
  14083. <samp>combpel</samp> pixels are required to be detected as combed for a frame to be
  14084. declared combed. See the <samp>combpel</samp> parameter description for more info.
  14085. Possible values are any number that is a power of 2 starting at 4 and going up
  14086. to 512.
  14087. </p>
  14088. <p>Default value is <code>16</code>.
  14089. </p>
  14090. </dd>
  14091. <dt><samp>combpel</samp></dt>
  14092. <dd><p>The number of combed pixels inside any of the <samp>blocky</samp> by
  14093. <samp>blockx</samp> size blocks on the frame for the frame to be detected as
  14094. combed. While <samp>cthresh</samp> controls how &quot;visible&quot; the combing must be, this
  14095. setting controls &quot;how much&quot; combing there must be in any localized area (a
  14096. window defined by the <samp>blockx</samp> and <samp>blocky</samp> settings) on the
  14097. frame. Minimum value is <code>0</code> and maximum is <code>blocky x blockx</code> (at
  14098. which point no frames will ever be detected as combed). This setting is known
  14099. as <samp>MI</samp> in TFM/VFM vocabulary.
  14100. </p>
  14101. <p>Default value is <code>80</code>.
  14102. </p></dd>
  14103. </dl>
  14104. <span id="p_002fc_002fn_002fu_002fb-meaning"></span><a name="p_002fc_002fn_002fu_002fb-meaning-1"></a>
  14105. <h4 class="subsection">11.81.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>
  14106. <a name="p_002fc_002fn"></a>
  14107. <h4 class="subsubsection">11.81.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>
  14108. <p>We assume the following telecined stream:
  14109. </p>
  14110. <div class="example">
  14111. <pre class="example">Top fields: 1 2 2 3 4
  14112. Bottom fields: 1 2 3 4 4
  14113. </pre></div>
  14114. <p>The numbers correspond to the progressive frame the fields relate to. Here, the
  14115. first two frames are progressive, the 3rd and 4th are combed, and so on.
  14116. </p>
  14117. <p>When <code>fieldmatch</code> is configured to run a matching from bottom
  14118. (<samp>field</samp>=<var>bottom</var>) this is how this input stream get transformed:
  14119. </p>
  14120. <div class="example">
  14121. <pre class="example">Input stream:
  14122. T 1 2 2 3 4
  14123. B 1 2 3 4 4 &lt;-- matching reference
  14124. Matches: c c n n c
  14125. Output stream:
  14126. T 1 2 3 4 4
  14127. B 1 2 3 4 4
  14128. </pre></div>
  14129. <p>As a result of the field matching, we can see that some frames get duplicated.
  14130. To perform a complete inverse telecine, you need to rely on a decimation filter
  14131. after this operation. See for instance the <a href="#decimate">decimate</a> filter.
  14132. </p>
  14133. <p>The same operation now matching from top fields (<samp>field</samp>=<var>top</var>)
  14134. looks like this:
  14135. </p>
  14136. <div class="example">
  14137. <pre class="example">Input stream:
  14138. T 1 2 2 3 4 &lt;-- matching reference
  14139. B 1 2 3 4 4
  14140. Matches: c c p p c
  14141. Output stream:
  14142. T 1 2 2 3 4
  14143. B 1 2 2 3 4
  14144. </pre></div>
  14145. <p>In these examples, we can see what <var>p</var>, <var>c</var> and <var>n</var> mean;
  14146. basically, they refer to the frame and field of the opposite parity:
  14147. </p>
  14148. <ul>
  14149. <li> <var>p</var> matches the field of the opposite parity in the previous frame
  14150. </li><li> <var>c</var> matches the field of the opposite parity in the current frame
  14151. </li><li> <var>n</var> matches the field of the opposite parity in the next frame
  14152. </li></ul>
  14153. <a name="u_002fb"></a>
  14154. <h4 class="subsubsection">11.81.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>
  14155. <p>The <var>u</var> and <var>b</var> matching are a bit special in the sense that they match
  14156. from the opposite parity flag. In the following examples, we assume that we are
  14157. currently matching the 2nd frame (Top:2, bottom:2). According to the match, a
  14158. &rsquo;x&rsquo; is placed above and below each matched fields.
  14159. </p>
  14160. <p>With bottom matching (<samp>field</samp>=<var>bottom</var>):
  14161. </p><div class="example">
  14162. <pre class="example">Match: c p n b u
  14163. x x x x x
  14164. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  14165. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  14166. x x x x x
  14167. Output frames:
  14168. 2 1 2 2 2
  14169. 2 2 2 1 3
  14170. </pre></div>
  14171. <p>With top matching (<samp>field</samp>=<var>top</var>):
  14172. </p><div class="example">
  14173. <pre class="example">Match: c p n b u
  14174. x x x x x
  14175. Top 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2
  14176. Bottom 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
  14177. x x x x x
  14178. Output frames:
  14179. 2 2 2 1 2
  14180. 2 1 3 2 2
  14181. </pre></div>
  14182. <a name="Examples-67"></a>
  14183. <h4 class="subsection">11.81.2 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>
  14184. <p>Simple IVTC of a top field first telecined stream:
  14185. </p><div class="example">
  14186. <pre class="example">fieldmatch=order=tff:combmatch=none, decimate
  14187. </pre></div>
  14188. <p>Advanced IVTC, with fallback on <a href="#yadif">yadif</a> for still combed frames:
  14189. </p><div class="example">
  14190. <pre class="example">fieldmatch=order=tff:combmatch=full, yadif=deint=interlaced, decimate
  14191. </pre></div>
  14192. <a name="fieldorder"></a>
  14193. <h3 class="section">11.82 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>
  14194. <p>Transform the field order of the input video.
  14195. </p>
  14196. <p>It accepts the following parameters:
  14197. </p>
  14198. <dl compact="compact">
  14199. <dt><samp>order</samp></dt>
  14200. <dd><p>The output field order. Valid values are <var>tff</var> for top field first or <var>bff</var>
  14201. for bottom field first.
  14202. </p></dd>
  14203. </dl>
  14204. <p>The default value is &lsquo;<samp>tff</samp>&rsquo;.
  14205. </p>
  14206. <p>The transformation is done by shifting the picture content up or down
  14207. by one line, and filling the remaining line with appropriate picture content.
  14208. This method is consistent with most broadcast field order converters.
  14209. </p>
  14210. <p>If the input video is not flagged as being interlaced, or it is already
  14211. flagged as being of the required output field order, then this filter does
  14212. not alter the incoming video.
  14213. </p>
  14214. <p>It is very useful when converting to or from PAL DV material,
  14215. which is bottom field first.
  14216. </p>
  14217. <p>For example:
  14218. </p><div class="example">
  14219. <pre class="example">ffmpeg -i in.vob -vf &quot;fieldorder=bff&quot; out.dv
  14220. </pre></div>
  14221. <a name="fifo_002c-afifo"></a>
  14222. <h3 class="section">11.83 fifo, afifo<span class="pull-right"><a class="anchor hidden-xs" href="#fifo_002c-afifo" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-fifo_002c-afifo" aria-hidden="true">TOC</a></span></h3>
  14223. <p>Buffer input images and send them when they are requested.
  14224. </p>
  14225. <p>It is mainly useful when auto-inserted by the libavfilter
  14226. framework.
  14227. </p>
  14228. <p>It does not take parameters.
  14229. </p>
  14230. <a name="fillborders"></a>
  14231. <h3 class="section">11.84 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>
  14232. <p>Fill borders of the input video, without changing video stream dimensions.
  14233. Sometimes video can have garbage at the four edges and you may not want to
  14234. crop video input to keep size multiple of some number.
  14235. </p>
  14236. <p>This filter accepts the following options:
  14237. </p>
  14238. <dl compact="compact">
  14239. <dt><samp>left</samp></dt>
  14240. <dd><p>Number of pixels to fill from left border.
  14241. </p>
  14242. </dd>
  14243. <dt><samp>right</samp></dt>
  14244. <dd><p>Number of pixels to fill from right border.
  14245. </p>
  14246. </dd>
  14247. <dt><samp>top</samp></dt>
  14248. <dd><p>Number of pixels to fill from top border.
  14249. </p>
  14250. </dd>
  14251. <dt><samp>bottom</samp></dt>
  14252. <dd><p>Number of pixels to fill from bottom border.
  14253. </p>
  14254. </dd>
  14255. <dt><samp>mode</samp></dt>
  14256. <dd><p>Set fill mode.
  14257. </p>
  14258. <p>It accepts the following values:
  14259. </p><dl compact="compact">
  14260. <dt>&lsquo;<samp>smear</samp>&rsquo;</dt>
  14261. <dd><p>fill pixels using outermost pixels
  14262. </p>
  14263. </dd>
  14264. <dt>&lsquo;<samp>mirror</samp>&rsquo;</dt>
  14265. <dd><p>fill pixels using mirroring (half sample symmetric)
  14266. </p>
  14267. </dd>
  14268. <dt>&lsquo;<samp>fixed</samp>&rsquo;</dt>
  14269. <dd><p>fill pixels with constant value
  14270. </p>
  14271. </dd>
  14272. <dt>&lsquo;<samp>reflect</samp>&rsquo;</dt>
  14273. <dd><p>fill pixels using reflecting (whole sample symmetric)
  14274. </p>
  14275. </dd>
  14276. <dt>&lsquo;<samp>wrap</samp>&rsquo;</dt>
  14277. <dd><p>fill pixels using wrapping
  14278. </p>
  14279. </dd>
  14280. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  14281. <dd><p>fade pixels to constant value
  14282. </p></dd>
  14283. </dl>
  14284. <p>Default is <var>smear</var>.
  14285. </p>
  14286. </dd>
  14287. <dt><samp>color</samp></dt>
  14288. <dd><p>Set color for pixels in fixed or fade mode. Default is <var>black</var>.
  14289. </p></dd>
  14290. </dl>
  14291. <a name="Commands-80"></a>
  14292. <h4 class="subsection">11.84.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>
  14293. <p>This filter supports same <a href="#commands">commands</a> as options.
  14294. The command accepts the same syntax of the corresponding option.
  14295. </p>
  14296. <p>If the specified expression is not valid, it is kept at its current
  14297. value.
  14298. </p>
  14299. <a name="find_005frect"></a>
  14300. <h3 class="section">11.85 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>
  14301. <p>Find a rectangular object
  14302. </p>
  14303. <p>It accepts the following options:
  14304. </p>
  14305. <dl compact="compact">
  14306. <dt><samp>object</samp></dt>
  14307. <dd><p>Filepath of the object image, needs to be in gray8.
  14308. </p>
  14309. </dd>
  14310. <dt><samp>threshold</samp></dt>
  14311. <dd><p>Detection threshold, default is 0.5.
  14312. </p>
  14313. </dd>
  14314. <dt><samp>mipmaps</samp></dt>
  14315. <dd><p>Number of mipmaps, default is 3.
  14316. </p>
  14317. </dd>
  14318. <dt><samp>xmin, ymin, xmax, ymax</samp></dt>
  14319. <dd><p>Specifies the rectangle in which to search.
  14320. </p></dd>
  14321. </dl>
  14322. <a name="Examples-68"></a>
  14323. <h4 class="subsection">11.85.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>
  14324. <ul>
  14325. <li> Cover a rectangular object by the supplied image of a given video using <code>ffmpeg</code>:
  14326. <div class="example">
  14327. <pre class="example">ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv
  14328. </pre></div>
  14329. </li></ul>
  14330. <a name="floodfill"></a>
  14331. <h3 class="section">11.86 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>
  14332. <p>Flood area with values of same pixel components with another values.
  14333. </p>
  14334. <p>It accepts the following options:
  14335. </p><dl compact="compact">
  14336. <dt><samp>x</samp></dt>
  14337. <dd><p>Set pixel x coordinate.
  14338. </p>
  14339. </dd>
  14340. <dt><samp>y</samp></dt>
  14341. <dd><p>Set pixel y coordinate.
  14342. </p>
  14343. </dd>
  14344. <dt><samp>s0</samp></dt>
  14345. <dd><p>Set source #0 component value.
  14346. </p>
  14347. </dd>
  14348. <dt><samp>s1</samp></dt>
  14349. <dd><p>Set source #1 component value.
  14350. </p>
  14351. </dd>
  14352. <dt><samp>s2</samp></dt>
  14353. <dd><p>Set source #2 component value.
  14354. </p>
  14355. </dd>
  14356. <dt><samp>s3</samp></dt>
  14357. <dd><p>Set source #3 component value.
  14358. </p>
  14359. </dd>
  14360. <dt><samp>d0</samp></dt>
  14361. <dd><p>Set destination #0 component value.
  14362. </p>
  14363. </dd>
  14364. <dt><samp>d1</samp></dt>
  14365. <dd><p>Set destination #1 component value.
  14366. </p>
  14367. </dd>
  14368. <dt><samp>d2</samp></dt>
  14369. <dd><p>Set destination #2 component value.
  14370. </p>
  14371. </dd>
  14372. <dt><samp>d3</samp></dt>
  14373. <dd><p>Set destination #3 component value.
  14374. </p></dd>
  14375. </dl>
  14376. <span id="format"></span><a name="format-1"></a>
  14377. <h3 class="section">11.87 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>
  14378. <p>Convert the input video to one of the specified pixel formats.
  14379. Libavfilter will try to pick one that is suitable as input to
  14380. the next filter.
  14381. </p>
  14382. <p>It accepts the following parameters:
  14383. </p><dl compact="compact">
  14384. <dt><samp>pix_fmts</samp></dt>
  14385. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  14386. &quot;pix_fmts=yuv420p|monow|rgb24&quot;.
  14387. </p>
  14388. </dd>
  14389. </dl>
  14390. <a name="Examples-69"></a>
  14391. <h4 class="subsection">11.87.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>
  14392. <ul>
  14393. <li> Convert the input video to the <var>yuv420p</var> format
  14394. <div class="example">
  14395. <pre class="example">format=pix_fmts=yuv420p
  14396. </pre></div>
  14397. <p>Convert the input video to any of the formats in the list
  14398. </p><div class="example">
  14399. <pre class="example">format=pix_fmts=yuv420p|yuv444p|yuv410p
  14400. </pre></div>
  14401. </li></ul>
  14402. <span id="fps"></span><a name="fps-1"></a>
  14403. <h3 class="section">11.88 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>
  14404. <p>Convert the video to specified constant frame rate by duplicating or dropping
  14405. frames as necessary.
  14406. </p>
  14407. <p>It accepts the following parameters:
  14408. </p><dl compact="compact">
  14409. <dt><samp>fps</samp></dt>
  14410. <dd><p>The desired output frame rate. The default is <code>25</code>.
  14411. </p>
  14412. </dd>
  14413. <dt><samp>start_time</samp></dt>
  14414. <dd><p>Assume the first PTS should be the given value, in seconds. This allows for
  14415. padding/trimming at the start of stream. By default, no assumption is made
  14416. about the first frame&rsquo;s expected PTS, so no padding or trimming is done.
  14417. For example, this could be set to 0 to pad the beginning with duplicates of
  14418. the first frame if a video stream starts after the audio stream or to trim any
  14419. frames with a negative PTS.
  14420. </p>
  14421. </dd>
  14422. <dt><samp>round</samp></dt>
  14423. <dd><p>Timestamp (PTS) rounding method.
  14424. </p>
  14425. <p>Possible values are:
  14426. </p><dl compact="compact">
  14427. <dt><samp>zero</samp></dt>
  14428. <dd><p>round towards 0
  14429. </p></dd>
  14430. <dt><samp>inf</samp></dt>
  14431. <dd><p>round away from 0
  14432. </p></dd>
  14433. <dt><samp>down</samp></dt>
  14434. <dd><p>round towards -infinity
  14435. </p></dd>
  14436. <dt><samp>up</samp></dt>
  14437. <dd><p>round towards +infinity
  14438. </p></dd>
  14439. <dt><samp>near</samp></dt>
  14440. <dd><p>round to nearest
  14441. </p></dd>
  14442. </dl>
  14443. <p>The default is <code>near</code>.
  14444. </p>
  14445. </dd>
  14446. <dt><samp>eof_action</samp></dt>
  14447. <dd><p>Action performed when reading the last frame.
  14448. </p>
  14449. <p>Possible values are:
  14450. </p><dl compact="compact">
  14451. <dt><samp>round</samp></dt>
  14452. <dd><p>Use same timestamp rounding method as used for other frames.
  14453. </p></dd>
  14454. <dt><samp>pass</samp></dt>
  14455. <dd><p>Pass through last frame if input duration has not been reached yet.
  14456. </p></dd>
  14457. </dl>
  14458. <p>The default is <code>round</code>.
  14459. </p>
  14460. </dd>
  14461. </dl>
  14462. <p>Alternatively, the options can be specified as a flat string:
  14463. <var>fps</var>[:<var>start_time</var>[:<var>round</var>]].
  14464. </p>
  14465. <p>See also the <a href="#setpts">setpts</a> filter.
  14466. </p>
  14467. <a name="Examples-70"></a>
  14468. <h4 class="subsection">11.88.1 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>
  14469. <ul>
  14470. <li> A typical usage in order to set the fps to 25:
  14471. <div class="example">
  14472. <pre class="example">fps=fps=25
  14473. </pre></div>
  14474. </li><li> Sets the fps to 24, using abbreviation and rounding method to round to nearest:
  14475. <div class="example">
  14476. <pre class="example">fps=fps=film:round=near
  14477. </pre></div>
  14478. </li></ul>
  14479. <a name="framepack"></a>
  14480. <h3 class="section">11.89 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>
  14481. <p>Pack two different video streams into a stereoscopic video, setting proper
  14482. metadata on supported codecs. The two views should have the same size and
  14483. framerate and processing will stop when the shorter video ends. Please note
  14484. that you may conveniently adjust view properties with the <a href="#scale">scale</a> and
  14485. <a href="#fps">fps</a> filters.
  14486. </p>
  14487. <p>It accepts the following parameters:
  14488. </p><dl compact="compact">
  14489. <dt><samp>format</samp></dt>
  14490. <dd><p>The desired packing format. Supported values are:
  14491. </p>
  14492. <dl compact="compact">
  14493. <dt><samp>sbs</samp></dt>
  14494. <dd><p>The views are next to each other (default).
  14495. </p>
  14496. </dd>
  14497. <dt><samp>tab</samp></dt>
  14498. <dd><p>The views are on top of each other.
  14499. </p>
  14500. </dd>
  14501. <dt><samp>lines</samp></dt>
  14502. <dd><p>The views are packed by line.
  14503. </p>
  14504. </dd>
  14505. <dt><samp>columns</samp></dt>
  14506. <dd><p>The views are packed by column.
  14507. </p>
  14508. </dd>
  14509. <dt><samp>frameseq</samp></dt>
  14510. <dd><p>The views are temporally interleaved.
  14511. </p>
  14512. </dd>
  14513. </dl>
  14514. </dd>
  14515. </dl>
  14516. <p>Some examples:
  14517. </p>
  14518. <div class="example">
  14519. <pre class="example"># Convert left and right views into a frame-sequential video
  14520. ffmpeg -i LEFT -i RIGHT -filter_complex framepack=frameseq OUTPUT
  14521. # Convert views into a side-by-side video with the same output resolution as the input
  14522. 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
  14523. </pre></div>
  14524. <a name="framerate"></a>
  14525. <h3 class="section">11.90 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>
  14526. <p>Change the frame rate by interpolating new video output frames from the source
  14527. frames.
  14528. </p>
  14529. <p>This filter is not designed to function correctly with interlaced media. If
  14530. you wish to change the frame rate of interlaced media then you are required
  14531. to deinterlace before this filter and re-interlace after this filter.
  14532. </p>
  14533. <p>A description of the accepted options follows.
  14534. </p>
  14535. <dl compact="compact">
  14536. <dt><samp>fps</samp></dt>
  14537. <dd><p>Specify the output frames per second. This option can also be specified
  14538. as a value alone. The default is <code>50</code>.
  14539. </p>
  14540. </dd>
  14541. <dt><samp>interp_start</samp></dt>
  14542. <dd><p>Specify the start of a range where the output frame will be created as a
  14543. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  14544. the default is <code>15</code>.
  14545. </p>
  14546. </dd>
  14547. <dt><samp>interp_end</samp></dt>
  14548. <dd><p>Specify the end of a range where the output frame will be created as a
  14549. linear interpolation of two frames. The range is [<code>0</code>-<code>255</code>],
  14550. the default is <code>240</code>.
  14551. </p>
  14552. </dd>
  14553. <dt><samp>scene</samp></dt>
  14554. <dd><p>Specify the level at which a scene change is detected as a value between
  14555. 0 and 100 to indicate a new scene; a low value reflects a low
  14556. probability for the current frame to introduce a new scene, while a higher
  14557. value means the current frame is more likely to be one.
  14558. The default is <code>8.2</code>.
  14559. </p>
  14560. </dd>
  14561. <dt><samp>flags</samp></dt>
  14562. <dd><p>Specify flags influencing the filter process.
  14563. </p>
  14564. <p>Available value for <var>flags</var> is:
  14565. </p>
  14566. <dl compact="compact">
  14567. <dt><samp>scene_change_detect, scd</samp></dt>
  14568. <dd><p>Enable scene change detection using the value of the option <var>scene</var>.
  14569. This flag is enabled by default.
  14570. </p></dd>
  14571. </dl>
  14572. </dd>
  14573. </dl>
  14574. <a name="framestep"></a>
  14575. <h3 class="section">11.91 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>
  14576. <p>Select one frame every N-th frame.
  14577. </p>
  14578. <p>This filter accepts the following option:
  14579. </p><dl compact="compact">
  14580. <dt><samp>step</samp></dt>
  14581. <dd><p>Select frame after every <code>step</code> frames.
  14582. Allowed values are positive integers higher than 0. Default value is <code>1</code>.
  14583. </p></dd>
  14584. </dl>
  14585. <a name="freezedetect"></a>
  14586. <h3 class="section">11.92 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>
  14587. <p>Detect frozen video.
  14588. </p>
  14589. <p>This filter logs a message and sets frame metadata when it detects that the
  14590. input video has no significant change in content during a specified duration.
  14591. Video freeze detection calculates the mean average absolute difference of all
  14592. the components of video frames and compares it to a noise floor.
  14593. </p>
  14594. <p>The printed times and duration are expressed in seconds. The
  14595. <code>lavfi.freezedetect.freeze_start</code> metadata key is set on the first frame
  14596. whose timestamp equals or exceeds the detection duration and it contains the
  14597. timestamp of the first frame of the freeze. The
  14598. <code>lavfi.freezedetect.freeze_duration</code> and
  14599. <code>lavfi.freezedetect.freeze_end</code> metadata keys are set on the first frame
  14600. after the freeze.
  14601. </p>
  14602. <p>The filter accepts the following options:
  14603. </p>
  14604. <dl compact="compact">
  14605. <dt><samp>noise, n</samp></dt>
  14606. <dd><p>Set noise tolerance. Can be specified in dB (in case &quot;dB&quot; is appended to the
  14607. specified value) or as a difference ratio between 0 and 1. Default is -60dB, or
  14608. 0.001.
  14609. </p>
  14610. </dd>
  14611. <dt><samp>duration, d</samp></dt>
  14612. <dd><p>Set freeze duration until notification (default is 2 seconds).
  14613. </p></dd>
  14614. </dl>
  14615. <a name="freezeframes"></a>
  14616. <h3 class="section">11.93 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>
  14617. <p>Freeze video frames.
  14618. </p>
  14619. <p>This filter freezes video frames using frame from 2nd input.
  14620. </p>
  14621. <p>The filter accepts the following options:
  14622. </p>
  14623. <dl compact="compact">
  14624. <dt><samp>first</samp></dt>
  14625. <dd><p>Set number of first frame from which to start freeze.
  14626. </p>
  14627. </dd>
  14628. <dt><samp>last</samp></dt>
  14629. <dd><p>Set number of last frame from which to end freeze.
  14630. </p>
  14631. </dd>
  14632. <dt><samp>replace</samp></dt>
  14633. <dd><p>Set number of frame from 2nd input which will be used instead of replaced frames.
  14634. </p></dd>
  14635. </dl>
  14636. <span id="frei0r"></span><a name="frei0r-1"></a>
  14637. <h3 class="section">11.94 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>
  14638. <p>Apply a frei0r effect to the input video.
  14639. </p>
  14640. <p>To enable the compilation of this filter, you need to install the frei0r
  14641. header and configure FFmpeg with <code>--enable-frei0r</code>.
  14642. </p>
  14643. <p>It accepts the following parameters:
  14644. </p>
  14645. <dl compact="compact">
  14646. <dt><samp>filter_name</samp></dt>
  14647. <dd><p>The name of the frei0r effect to load. If the environment variable
  14648. <code>FREI0R_PATH</code> is defined, the frei0r effect is searched for in each of the
  14649. directories specified by the colon-separated list in <code>FREI0R_PATH</code>.
  14650. Otherwise, the standard frei0r paths are searched, in this order:
  14651. <samp>HOME/.frei0r-1/lib/</samp>, <samp>/usr/local/lib/frei0r-1/</samp>,
  14652. <samp>/usr/lib/frei0r-1/</samp>.
  14653. </p>
  14654. </dd>
  14655. <dt><samp>filter_params</samp></dt>
  14656. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r effect.
  14657. </p>
  14658. </dd>
  14659. </dl>
  14660. <p>A frei0r effect parameter can be a boolean (its value is either
  14661. &quot;y&quot; or &quot;n&quot;), a double, a color (specified as
  14662. <var>R</var>/<var>G</var>/<var>B</var>, where <var>R</var>, <var>G</var>, and <var>B</var> are floating point
  14663. numbers between 0.0 and 1.0, inclusive) or a color description as specified in the
  14664. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>,
  14665. a position (specified as <var>X</var>/<var>Y</var>, where
  14666. <var>X</var> and <var>Y</var> are floating point numbers) and/or a string.
  14667. </p>
  14668. <p>The number and types of parameters depend on the loaded effect. If an
  14669. effect parameter is not specified, the default value is set.
  14670. </p>
  14671. <a name="Examples-71"></a>
  14672. <h4 class="subsection">11.94.1 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>
  14673. <ul>
  14674. <li> Apply the distort0r effect, setting the first two double parameters:
  14675. <div class="example">
  14676. <pre class="example">frei0r=filter_name=distort0r:filter_params=0.5|0.01
  14677. </pre></div>
  14678. </li><li> Apply the colordistance effect, taking a color as the first parameter:
  14679. <div class="example">
  14680. <pre class="example">frei0r=colordistance:0.2/0.3/0.4
  14681. frei0r=colordistance:violet
  14682. frei0r=colordistance:0x112233
  14683. </pre></div>
  14684. </li><li> Apply the perspective effect, specifying the top left and top right image
  14685. positions:
  14686. <div class="example">
  14687. <pre class="example">frei0r=perspective:0.2/0.2|0.8/0.2
  14688. </pre></div>
  14689. </li></ul>
  14690. <p>For more information, see
  14691. <a href="http://frei0r.dyne.org">http://frei0r.dyne.org</a>
  14692. </p>
  14693. <a name="Commands-81"></a>
  14694. <h4 class="subsection">11.94.2 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>
  14695. <p>This filter supports the <samp>filter_params</samp> option as <a href="#commands">commands</a>.
  14696. </p>
  14697. <a name="fspp"></a>
  14698. <h3 class="section">11.95 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>
  14699. <p>Apply fast and simple postprocessing. It is a faster version of <a href="#spp">spp</a>.
  14700. </p>
  14701. <p>It splits (I)DCT into horizontal/vertical passes. Unlike the simple post-
  14702. processing filter, one of them is performed once per block, not per pixel.
  14703. This allows for much higher speed.
  14704. </p>
  14705. <p>The filter accepts the following options:
  14706. </p>
  14707. <dl compact="compact">
  14708. <dt><samp>quality</samp></dt>
  14709. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  14710. an integer in the range 4-5. Default value is <code>4</code>.
  14711. </p>
  14712. </dd>
  14713. <dt><samp>qp</samp></dt>
  14714. <dd><p>Force a constant quantization parameter. It accepts an integer in range 0-63.
  14715. If not set, the filter will use the QP from the video stream (if available).
  14716. </p>
  14717. </dd>
  14718. <dt><samp>strength</samp></dt>
  14719. <dd><p>Set filter strength. It accepts an integer in range -15 to 32. Lower values mean
  14720. more details but also more artifacts, while higher values make the image smoother
  14721. but also blurrier. Default value is <code>0</code> − PSNR optimal.
  14722. </p>
  14723. </dd>
  14724. <dt><samp>use_bframe_qp</samp></dt>
  14725. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  14726. option may cause flicker since the B-Frames have often larger QP. Default is
  14727. <code>0</code> (not enabled).
  14728. </p>
  14729. </dd>
  14730. </dl>
  14731. <a name="gblur"></a>
  14732. <h3 class="section">11.96 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>
  14733. <p>Apply Gaussian blur filter.
  14734. </p>
  14735. <p>The filter accepts the following options:
  14736. </p>
  14737. <dl compact="compact">
  14738. <dt><samp>sigma</samp></dt>
  14739. <dd><p>Set horizontal sigma, standard deviation of Gaussian blur. Default is <code>0.5</code>.
  14740. </p>
  14741. </dd>
  14742. <dt><samp>steps</samp></dt>
  14743. <dd><p>Set number of steps for Gaussian approximation. Default is <code>1</code>.
  14744. </p>
  14745. </dd>
  14746. <dt><samp>planes</samp></dt>
  14747. <dd><p>Set which planes to filter. By default all planes are filtered.
  14748. </p>
  14749. </dd>
  14750. <dt><samp>sigmaV</samp></dt>
  14751. <dd><p>Set vertical sigma, if negative it will be same as <code>sigma</code>.
  14752. Default is <code>-1</code>.
  14753. </p></dd>
  14754. </dl>
  14755. <a name="Commands-82"></a>
  14756. <h4 class="subsection">11.96.1 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>
  14757. <p>This filter supports same commands as options.
  14758. The command accepts the same syntax of the corresponding option.
  14759. </p>
  14760. <p>If the specified expression is not valid, it is kept at its current
  14761. value.
  14762. </p>
  14763. <a name="geq"></a>
  14764. <h3 class="section">11.97 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>
  14765. <p>Apply generic equation to each pixel.
  14766. </p>
  14767. <p>The filter accepts the following options:
  14768. </p>
  14769. <dl compact="compact">
  14770. <dt><samp>lum_expr, lum</samp></dt>
  14771. <dd><p>Set the luminance expression.
  14772. </p></dd>
  14773. <dt><samp>cb_expr, cb</samp></dt>
  14774. <dd><p>Set the chrominance blue expression.
  14775. </p></dd>
  14776. <dt><samp>cr_expr, cr</samp></dt>
  14777. <dd><p>Set the chrominance red expression.
  14778. </p></dd>
  14779. <dt><samp>alpha_expr, a</samp></dt>
  14780. <dd><p>Set the alpha expression.
  14781. </p></dd>
  14782. <dt><samp>red_expr, r</samp></dt>
  14783. <dd><p>Set the red expression.
  14784. </p></dd>
  14785. <dt><samp>green_expr, g</samp></dt>
  14786. <dd><p>Set the green expression.
  14787. </p></dd>
  14788. <dt><samp>blue_expr, b</samp></dt>
  14789. <dd><p>Set the blue expression.
  14790. </p></dd>
  14791. </dl>
  14792. <p>The colorspace is selected according to the specified options. If one
  14793. of the <samp>lum_expr</samp>, <samp>cb_expr</samp>, or <samp>cr_expr</samp>
  14794. options is specified, the filter will automatically select a YCbCr
  14795. colorspace. If one of the <samp>red_expr</samp>, <samp>green_expr</samp>, or
  14796. <samp>blue_expr</samp> options is specified, it will select an RGB
  14797. colorspace.
  14798. </p>
  14799. <p>If one of the chrominance expression is not defined, it falls back on the other
  14800. one. If no alpha expression is specified it will evaluate to opaque value.
  14801. If none of chrominance expressions are specified, they will evaluate
  14802. to the luminance expression.
  14803. </p>
  14804. <p>The expressions can use the following variables and functions:
  14805. </p>
  14806. <dl compact="compact">
  14807. <dt><samp>N</samp></dt>
  14808. <dd><p>The sequential number of the filtered frame, starting from <code>0</code>.
  14809. </p>
  14810. </dd>
  14811. <dt><samp>X</samp></dt>
  14812. <dt><samp>Y</samp></dt>
  14813. <dd><p>The coordinates of the current sample.
  14814. </p>
  14815. </dd>
  14816. <dt><samp>W</samp></dt>
  14817. <dt><samp>H</samp></dt>
  14818. <dd><p>The width and height of the image.
  14819. </p>
  14820. </dd>
  14821. <dt><samp>SW</samp></dt>
  14822. <dt><samp>SH</samp></dt>
  14823. <dd><p>Width and height scale depending on the currently filtered plane. It is the
  14824. ratio between the corresponding luma plane number of pixels and the current
  14825. plane ones. E.g. for YUV4:2:0 the values are <code>1,1</code> for the luma plane, and
  14826. <code>0.5,0.5</code> for chroma planes.
  14827. </p>
  14828. </dd>
  14829. <dt><samp>T</samp></dt>
  14830. <dd><p>Time of the current frame, expressed in seconds.
  14831. </p>
  14832. </dd>
  14833. <dt><samp>p(x, y)</samp></dt>
  14834. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the current
  14835. plane.
  14836. </p>
  14837. </dd>
  14838. <dt><samp>lum(x, y)</samp></dt>
  14839. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the luminance
  14840. plane.
  14841. </p>
  14842. </dd>
  14843. <dt><samp>cb(x, y)</samp></dt>
  14844. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  14845. blue-difference chroma plane. Return 0 if there is no such plane.
  14846. </p>
  14847. </dd>
  14848. <dt><samp>cr(x, y)</samp></dt>
  14849. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  14850. red-difference chroma plane. Return 0 if there is no such plane.
  14851. </p>
  14852. </dd>
  14853. <dt><samp>r(x, y)</samp></dt>
  14854. <dt><samp>g(x, y)</samp></dt>
  14855. <dt><samp>b(x, y)</samp></dt>
  14856. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  14857. red/green/blue component. Return 0 if there is no such component.
  14858. </p>
  14859. </dd>
  14860. <dt><samp>alpha(x, y)</samp></dt>
  14861. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the alpha
  14862. plane. Return 0 if there is no such plane.
  14863. </p>
  14864. </dd>
  14865. <dt><samp>psum(x,y), lumsum(x, y), cbsum(x,y), crsum(x,y), rsum(x,y), gsum(x,y), bsum(x,y), alphasum(x,y)</samp></dt>
  14866. <dd><p>Sum of sample values in the rectangle from (0,0) to (x,y), this allows obtaining
  14867. sums of samples within a rectangle. See the functions without the sum postfix.
  14868. </p>
  14869. </dd>
  14870. <dt><samp>interpolation</samp></dt>
  14871. <dd><p>Set one of interpolation methods:
  14872. </p><dl compact="compact">
  14873. <dt><samp>nearest, n</samp></dt>
  14874. <dt><samp>bilinear, b</samp></dt>
  14875. </dl>
  14876. <p>Default is bilinear.
  14877. </p></dd>
  14878. </dl>
  14879. <p>For functions, if <var>x</var> and <var>y</var> are outside the area, the value will be
  14880. automatically clipped to the closer edge.
  14881. </p>
  14882. <p>Please note that this filter can use multiple threads in which case each slice
  14883. will have its own expression state. If you want to use only a single expression
  14884. state because your expressions depend on previous state then you should limit
  14885. the number of filter threads to 1.
  14886. </p>
  14887. <a name="Examples-72"></a>
  14888. <h4 class="subsection">11.97.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>
  14889. <ul>
  14890. <li> Flip the image horizontally:
  14891. <div class="example">
  14892. <pre class="example">geq=p(W-X\,Y)
  14893. </pre></div>
  14894. </li><li> Generate a bidimensional sine wave, with angle <code>PI/3</code> and a
  14895. wavelength of 100 pixels:
  14896. <div class="example">
  14897. <pre class="example">geq=128 + 100*sin(2*(PI/100)*(cos(PI/3)*(X-50*T) + sin(PI/3)*Y)):128:128
  14898. </pre></div>
  14899. </li><li> Generate a fancy enigmatic moving light:
  14900. <div class="example">
  14901. <pre class="example">nullsrc=s=256x256,geq=random(1)/hypot(X-cos(N*0.07)*W/2-W/2\,Y-sin(N*0.09)*H/2-H/2)^2*1000000*sin(N*0.02):128:128
  14902. </pre></div>
  14903. </li><li> Generate a quick emboss effect:
  14904. <div class="example">
  14905. <pre class="example">format=gray,geq=lum_expr='(p(X,Y)+(256-p(X-4,Y-4)))/2'
  14906. </pre></div>
  14907. </li><li> Modify RGB components depending on pixel position:
  14908. <div class="example">
  14909. <pre class="example">geq=r='X/W*r(X,Y)':g='(1-X/W)*g(X,Y)':b='(H-Y)/H*b(X,Y)'
  14910. </pre></div>
  14911. </li><li> Create a radial gradient that is the same size as the input (also see
  14912. the <a href="#vignette">vignette</a> filter):
  14913. <div class="example">
  14914. <pre class="example">geq=lum=255*gauss((X/W-0.5)*3)*gauss((Y/H-0.5)*3)/gauss(0)/gauss(0),format=gray
  14915. </pre></div>
  14916. </li></ul>
  14917. <a name="gradfun"></a>
  14918. <h3 class="section">11.98 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>
  14919. <p>Fix the banding artifacts that are sometimes introduced into nearly flat
  14920. regions by truncation to 8-bit color depth.
  14921. Interpolate the gradients that should go where the bands are, and
  14922. dither them.
  14923. </p>
  14924. <p>It is designed for playback only. Do not use it prior to
  14925. lossy compression, because compression tends to lose the dither and
  14926. bring back the bands.
  14927. </p>
  14928. <p>It accepts the following parameters:
  14929. </p>
  14930. <dl compact="compact">
  14931. <dt><samp>strength</samp></dt>
  14932. <dd><p>The maximum amount by which the filter will change any one pixel. This is also
  14933. the threshold for detecting nearly flat regions. Acceptable values range from
  14934. .51 to 64; the default value is 1.2. Out-of-range values will be clipped to the
  14935. valid range.
  14936. </p>
  14937. </dd>
  14938. <dt><samp>radius</samp></dt>
  14939. <dd><p>The neighborhood to fit the gradient to. A larger radius makes for smoother
  14940. gradients, but also prevents the filter from modifying the pixels near detailed
  14941. regions. Acceptable values are 8-32; the default value is 16. Out-of-range
  14942. values will be clipped to the valid range.
  14943. </p>
  14944. </dd>
  14945. </dl>
  14946. <p>Alternatively, the options can be specified as a flat string:
  14947. <var>strength</var>[:<var>radius</var>]
  14948. </p>
  14949. <a name="Examples-73"></a>
  14950. <h4 class="subsection">11.98.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>
  14951. <ul>
  14952. <li> Apply the filter with a <code>3.5</code> strength and radius of <code>8</code>:
  14953. <div class="example">
  14954. <pre class="example">gradfun=3.5:8
  14955. </pre></div>
  14956. </li><li> Specify radius, omitting the strength (which will fall-back to the default
  14957. value):
  14958. <div class="example">
  14959. <pre class="example">gradfun=radius=8
  14960. </pre></div>
  14961. </li></ul>
  14962. <span id="graphmonitor"></span><a name="graphmonitor-1"></a>
  14963. <h3 class="section">11.99 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>
  14964. <p>Show various filtergraph stats.
  14965. </p>
  14966. <p>With this filter one can debug complete filtergraph.
  14967. Especially issues with links filling with queued frames.
  14968. </p>
  14969. <p>The filter accepts the following options:
  14970. </p>
  14971. <dl compact="compact">
  14972. <dt><samp>size, s</samp></dt>
  14973. <dd><p>Set video output size. Default is <var>hd720</var>.
  14974. </p>
  14975. </dd>
  14976. <dt><samp>opacity, o</samp></dt>
  14977. <dd><p>Set video opacity. Default is <var>0.9</var>. Allowed range is from <var>0</var> to <var>1</var>.
  14978. </p>
  14979. </dd>
  14980. <dt><samp>mode, m</samp></dt>
  14981. <dd><p>Set output mode, can be <var>fulll</var> or <var>compact</var>.
  14982. In <var>compact</var> mode only filters with some queued frames have displayed stats.
  14983. </p>
  14984. </dd>
  14985. <dt><samp>flags, f</samp></dt>
  14986. <dd><p>Set flags which enable which stats are shown in video.
  14987. </p>
  14988. <p>Available values for flags are:
  14989. </p><dl compact="compact">
  14990. <dt>&lsquo;<samp>queue</samp>&rsquo;</dt>
  14991. <dd><p>Display number of queued frames in each link.
  14992. </p>
  14993. </dd>
  14994. <dt>&lsquo;<samp>frame_count_in</samp>&rsquo;</dt>
  14995. <dd><p>Display number of frames taken from filter.
  14996. </p>
  14997. </dd>
  14998. <dt>&lsquo;<samp>frame_count_out</samp>&rsquo;</dt>
  14999. <dd><p>Display number of frames given out from filter.
  15000. </p>
  15001. </dd>
  15002. <dt>&lsquo;<samp>pts</samp>&rsquo;</dt>
  15003. <dd><p>Display current filtered frame pts.
  15004. </p>
  15005. </dd>
  15006. <dt>&lsquo;<samp>time</samp>&rsquo;</dt>
  15007. <dd><p>Display current filtered frame time.
  15008. </p>
  15009. </dd>
  15010. <dt>&lsquo;<samp>timebase</samp>&rsquo;</dt>
  15011. <dd><p>Display time base for filter link.
  15012. </p>
  15013. </dd>
  15014. <dt>&lsquo;<samp>format</samp>&rsquo;</dt>
  15015. <dd><p>Display used format for filter link.
  15016. </p>
  15017. </dd>
  15018. <dt>&lsquo;<samp>size</samp>&rsquo;</dt>
  15019. <dd><p>Display video size or number of audio channels in case of audio used by filter link.
  15020. </p>
  15021. </dd>
  15022. <dt>&lsquo;<samp>rate</samp>&rsquo;</dt>
  15023. <dd><p>Display video frame rate or sample rate in case of audio used by filter link.
  15024. </p>
  15025. </dd>
  15026. <dt>&lsquo;<samp>eof</samp>&rsquo;</dt>
  15027. <dd><p>Display link output status.
  15028. </p></dd>
  15029. </dl>
  15030. </dd>
  15031. <dt><samp>rate, r</samp></dt>
  15032. <dd><p>Set upper limit for video rate of output stream, Default value is <var>25</var>.
  15033. This guarantee that output video frame rate will not be higher than this value.
  15034. </p></dd>
  15035. </dl>
  15036. <a name="greyedge"></a>
  15037. <h3 class="section">11.100 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>
  15038. <p>A color constancy variation filter which estimates scene illumination via grey edge algorithm
  15039. and corrects the scene colors accordingly.
  15040. </p>
  15041. <p>See: <a href="https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf">https://staff.science.uva.nl/th.gevers/pub/GeversTIP07.pdf</a>
  15042. </p>
  15043. <p>The filter accepts the following options:
  15044. </p>
  15045. <dl compact="compact">
  15046. <dt><samp>difford</samp></dt>
  15047. <dd><p>The order of differentiation to be applied on the scene. Must be chosen in the range
  15048. [0,2] and default value is 1.
  15049. </p>
  15050. </dd>
  15051. <dt><samp>minknorm</samp></dt>
  15052. <dd><p>The Minkowski parameter to be used for calculating the Minkowski distance. Must
  15053. be chosen in the range [0,20] and default value is 1. Set to 0 for getting
  15054. max value instead of calculating Minkowski distance.
  15055. </p>
  15056. </dd>
  15057. <dt><samp>sigma</samp></dt>
  15058. <dd><p>The standard deviation of Gaussian blur to be applied on the scene. Must be
  15059. chosen in the range [0,1024.0] and default value = 1. floor( <var>sigma</var> * break_off_sigma(3) )
  15060. can&rsquo;t be equal to 0 if <var>difford</var> is greater than 0.
  15061. </p></dd>
  15062. </dl>
  15063. <a name="Examples-74"></a>
  15064. <h4 class="subsection">11.100.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>
  15065. <ul>
  15066. <li> Grey Edge:
  15067. <div class="example">
  15068. <pre class="example">greyedge=difford=1:minknorm=5:sigma=2
  15069. </pre></div>
  15070. </li><li> Max Edge:
  15071. <div class="example">
  15072. <pre class="example">greyedge=difford=1:minknorm=0:sigma=2
  15073. </pre></div>
  15074. </li></ul>
  15075. <span id="haldclut"></span><a name="haldclut-1"></a>
  15076. <h3 class="section">11.101 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>
  15077. <p>Apply a Hald CLUT to a video stream.
  15078. </p>
  15079. <p>First input is the video stream to process, and second one is the Hald CLUT.
  15080. The Hald CLUT input can be a simple picture or a complete video stream.
  15081. </p>
  15082. <p>The filter accepts the following options:
  15083. </p>
  15084. <dl compact="compact">
  15085. <dt><samp>shortest</samp></dt>
  15086. <dd><p>Force termination when the shortest input terminates. Default is <code>0</code>.
  15087. </p></dd>
  15088. <dt><samp>repeatlast</samp></dt>
  15089. <dd><p>Continue applying the last CLUT after the end of the stream. A value of
  15090. <code>0</code> disable the filter after the last frame of the CLUT is reached.
  15091. Default is <code>1</code>.
  15092. </p></dd>
  15093. </dl>
  15094. <p><code>haldclut</code> also has the same interpolation options as <a href="#lut3d">lut3d</a> (both
  15095. filters share the same internals).
  15096. </p>
  15097. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  15098. </p>
  15099. <p>More information about the Hald CLUT can be found on Eskil Steenberg&rsquo;s website
  15100. (Hald CLUT author) at <a href="http://www.quelsolaar.com/technology/clut.html">http://www.quelsolaar.com/technology/clut.html</a>.
  15101. </p>
  15102. <a name="Commands-83"></a>
  15103. <h4 class="subsection">11.101.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>
  15104. <p>This filter supports the <code>interp</code> option as <a href="#commands">commands</a>.
  15105. </p>
  15106. <a name="Workflow-examples"></a>
  15107. <h4 class="subsection">11.101.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>
  15108. <a name="Hald-CLUT-video-stream"></a>
  15109. <h4 class="subsubsection">11.101.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>
  15110. <p>Generate an identity Hald CLUT stream altered with various effects:
  15111. </p><div class="example">
  15112. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;hue=H=2*PI*t:s=sin(2*PI*t)+1, curves=cross_process&quot; -t 10 -c:v ffv1 clut.nut
  15113. </pre></div>
  15114. <p>Note: make sure you use a lossless codec.
  15115. </p>
  15116. <p>Then use it with <code>haldclut</code> to apply it on some random stream:
  15117. </p><div class="example">
  15118. <pre class="example">ffmpeg -f lavfi -i mandelbrot -i clut.nut -filter_complex '[0][1] haldclut' -t 20 mandelclut.mkv
  15119. </pre></div>
  15120. <p>The Hald CLUT will be applied to the 10 first seconds (duration of
  15121. <samp>clut.nut</samp>), then the latest picture of that CLUT stream will be applied
  15122. to the remaining frames of the <code>mandelbrot</code> stream.
  15123. </p>
  15124. <a name="Hald-CLUT-with-preview"></a>
  15125. <h4 class="subsubsection">11.101.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>
  15126. <p>A Hald CLUT is supposed to be a squared image of <code>Level*Level*Level</code> by
  15127. <code>Level*Level*Level</code> pixels. For a given Hald CLUT, FFmpeg will select the
  15128. biggest possible square starting at the top left of the picture. The remaining
  15129. padding pixels (bottom or right) will be ignored. This area can be used to add
  15130. a preview of the Hald CLUT.
  15131. </p>
  15132. <p>Typically, the following generated Hald CLUT will be supported by the
  15133. <code>haldclut</code> filter:
  15134. </p>
  15135. <div class="example">
  15136. <pre class="example">ffmpeg -f lavfi -i <a href="#haldclutsrc">haldclutsrc</a>=8 -vf &quot;
  15137. pad=iw+320 [padded_clut];
  15138. smptebars=s=320x256, split [a][b];
  15139. [padded_clut][a] overlay=W-320:h, curves=color_negative [main];
  15140. [main][b] overlay=W-320&quot; -frames:v 1 clut.png
  15141. </pre></div>
  15142. <p>It contains the original and a preview of the effect of the CLUT: SMPTE color
  15143. bars are displayed on the right-top, and below the same color bars processed by
  15144. the color changes.
  15145. </p>
  15146. <p>Then, the effect of this Hald CLUT can be visualized with:
  15147. </p><div class="example">
  15148. <pre class="example">ffplay input.mkv -vf &quot;movie=clut.png, [in] haldclut&quot;
  15149. </pre></div>
  15150. <a name="hflip"></a>
  15151. <h3 class="section">11.102 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>
  15152. <p>Flip the input video horizontally.
  15153. </p>
  15154. <p>For example, to horizontally flip the input video with <code>ffmpeg</code>:
  15155. </p><div class="example">
  15156. <pre class="example">ffmpeg -i in.avi -vf &quot;hflip&quot; out.avi
  15157. </pre></div>
  15158. <a name="histeq"></a>
  15159. <h3 class="section">11.103 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>
  15160. <p>This filter applies a global color histogram equalization on a
  15161. per-frame basis.
  15162. </p>
  15163. <p>It can be used to correct video that has a compressed range of pixel
  15164. intensities. The filter redistributes the pixel intensities to
  15165. equalize their distribution across the intensity range. It may be
  15166. viewed as an &quot;automatically adjusting contrast filter&quot;. This filter is
  15167. useful only for correcting degraded or poorly captured source
  15168. video.
  15169. </p>
  15170. <p>The filter accepts the following options:
  15171. </p>
  15172. <dl compact="compact">
  15173. <dt><samp>strength</samp></dt>
  15174. <dd><p>Determine the amount of equalization to be applied. As the strength
  15175. is reduced, the distribution of pixel intensities more-and-more
  15176. approaches that of the input frame. The value must be a float number
  15177. in the range [0,1] and defaults to 0.200.
  15178. </p>
  15179. </dd>
  15180. <dt><samp>intensity</samp></dt>
  15181. <dd><p>Set the maximum intensity that can generated and scale the output
  15182. values appropriately. The strength should be set as desired and then
  15183. the intensity can be limited if needed to avoid washing-out. The value
  15184. must be a float number in the range [0,1] and defaults to 0.210.
  15185. </p>
  15186. </dd>
  15187. <dt><samp>antibanding</samp></dt>
  15188. <dd><p>Set the antibanding level. If enabled the filter will randomly vary
  15189. the luminance of output pixels by a small amount to avoid banding of
  15190. the histogram. Possible values are <code>none</code>, <code>weak</code> or
  15191. <code>strong</code>. It defaults to <code>none</code>.
  15192. </p></dd>
  15193. </dl>
  15194. <span id="histogram"></span><a name="histogram-1"></a>
  15195. <h3 class="section">11.104 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>
  15196. <p>Compute and draw a color distribution histogram for the input video.
  15197. </p>
  15198. <p>The computed histogram is a representation of the color component
  15199. distribution in an image.
  15200. </p>
  15201. <p>Standard histogram displays the color components distribution in an image.
  15202. Displays color graph for each color component. Shows distribution of
  15203. the Y, U, V, A or R, G, B components, depending on input format, in the
  15204. current frame. Below each graph a color component scale meter is shown.
  15205. </p>
  15206. <p>The filter accepts the following options:
  15207. </p>
  15208. <dl compact="compact">
  15209. <dt><samp>level_height</samp></dt>
  15210. <dd><p>Set height of level. Default value is <code>200</code>.
  15211. Allowed range is [50, 2048].
  15212. </p>
  15213. </dd>
  15214. <dt><samp>scale_height</samp></dt>
  15215. <dd><p>Set height of color scale. Default value is <code>12</code>.
  15216. Allowed range is [0, 40].
  15217. </p>
  15218. </dd>
  15219. <dt><samp>display_mode</samp></dt>
  15220. <dd><p>Set display mode.
  15221. It accepts the following values:
  15222. </p><dl compact="compact">
  15223. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  15224. <dd><p>Per color component graphs are placed below each other.
  15225. </p>
  15226. </dd>
  15227. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  15228. <dd><p>Per color component graphs are placed side by side.
  15229. </p>
  15230. </dd>
  15231. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  15232. <dd><p>Presents information identical to that in the <code>parade</code>, except
  15233. that the graphs representing color components are superimposed directly
  15234. over one another.
  15235. </p></dd>
  15236. </dl>
  15237. <p>Default is <code>stack</code>.
  15238. </p>
  15239. </dd>
  15240. <dt><samp>levels_mode</samp></dt>
  15241. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  15242. Default is <code>linear</code>.
  15243. </p>
  15244. </dd>
  15245. <dt><samp>components</samp></dt>
  15246. <dd><p>Set what color components to display.
  15247. Default is <code>7</code>.
  15248. </p>
  15249. </dd>
  15250. <dt><samp>fgopacity</samp></dt>
  15251. <dd><p>Set foreground opacity. Default is <code>0.7</code>.
  15252. </p>
  15253. </dd>
  15254. <dt><samp>bgopacity</samp></dt>
  15255. <dd><p>Set background opacity. Default is <code>0.5</code>.
  15256. </p></dd>
  15257. </dl>
  15258. <a name="Examples-75"></a>
  15259. <h4 class="subsection">11.104.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>
  15260. <ul>
  15261. <li> Calculate and draw histogram:
  15262. <div class="example">
  15263. <pre class="example">ffplay -i input -vf histogram
  15264. </pre></div>
  15265. </li></ul>
  15266. <span id="hqdn3d"></span><a name="hqdn3d-1"></a>
  15267. <h3 class="section">11.105 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>
  15268. <p>This is a high precision/quality 3d denoise filter. It aims to reduce
  15269. image noise, producing smooth images and making still images really
  15270. still. It should enhance compressibility.
  15271. </p>
  15272. <p>It accepts the following optional parameters:
  15273. </p>
  15274. <dl compact="compact">
  15275. <dt><samp>luma_spatial</samp></dt>
  15276. <dd><p>A non-negative floating point number which specifies spatial luma strength.
  15277. It defaults to 4.0.
  15278. </p>
  15279. </dd>
  15280. <dt><samp>chroma_spatial</samp></dt>
  15281. <dd><p>A non-negative floating point number which specifies spatial chroma strength.
  15282. It defaults to 3.0*<var>luma_spatial</var>/4.0.
  15283. </p>
  15284. </dd>
  15285. <dt><samp>luma_tmp</samp></dt>
  15286. <dd><p>A floating point number which specifies luma temporal strength. It defaults to
  15287. 6.0*<var>luma_spatial</var>/4.0.
  15288. </p>
  15289. </dd>
  15290. <dt><samp>chroma_tmp</samp></dt>
  15291. <dd><p>A floating point number which specifies chroma temporal strength. It defaults to
  15292. <var>luma_tmp</var>*<var>chroma_spatial</var>/<var>luma_spatial</var>.
  15293. </p></dd>
  15294. </dl>
  15295. <a name="Commands-84"></a>
  15296. <h4 class="subsection">11.105.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>
  15297. <p>This filter supports same <a href="#commands">commands</a> as options.
  15298. The command accepts the same syntax of the corresponding option.
  15299. </p>
  15300. <p>If the specified expression is not valid, it is kept at its current
  15301. value.
  15302. </p>
  15303. <span id="hwdownload"></span><a name="hwdownload-1"></a>
  15304. <h3 class="section">11.106 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>
  15305. <p>Download hardware frames to system memory.
  15306. </p>
  15307. <p>The input must be in hardware frames, and the output a non-hardware format.
  15308. Not all formats will be supported on the output - it may be necessary to insert
  15309. an additional <samp>format</samp> filter immediately following in the graph to get
  15310. the output in a supported format.
  15311. </p>
  15312. <a name="hwmap"></a>
  15313. <h3 class="section">11.107 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>
  15314. <p>Map hardware frames to system memory or to another device.
  15315. </p>
  15316. <p>This filter has several different modes of operation; which one is used depends
  15317. on the input and output formats:
  15318. </p><ul>
  15319. <li> Hardware frame input, normal frame output
  15320. <p>Map the input frames to system memory and pass them to the output. If the
  15321. original hardware frame is later required (for example, after overlaying
  15322. something else on part of it), the <samp>hwmap</samp> filter can be used again
  15323. in the next mode to retrieve it.
  15324. </p></li><li> Normal frame input, hardware frame output
  15325. <p>If the input is actually a software-mapped hardware frame, then unmap it -
  15326. that is, return the original hardware frame.
  15327. </p>
  15328. <p>Otherwise, a device must be provided. Create new hardware surfaces on that
  15329. device for the output, then map them back to the software format at the input
  15330. and give those frames to the preceding filter. This will then act like the
  15331. <samp>hwupload</samp> filter, but may be able to avoid an additional copy when
  15332. the input is already in a compatible format.
  15333. </p></li><li> Hardware frame input and output
  15334. <p>A device must be supplied for the output, either directly or with the
  15335. <samp>derive_device</samp> option. The input and output devices must be of
  15336. different types and compatible - the exact meaning of this is
  15337. system-dependent, but typically it means that they must refer to the same
  15338. underlying hardware context (for example, refer to the same graphics card).
  15339. </p>
  15340. <p>If the input frames were originally created on the output device, then unmap
  15341. to retrieve the original frames.
  15342. </p>
  15343. <p>Otherwise, map the frames to the output device - create new hardware frames
  15344. on the output corresponding to the frames on the input.
  15345. </p></li></ul>
  15346. <p>The following additional parameters are accepted:
  15347. </p>
  15348. <dl compact="compact">
  15349. <dt><samp>mode</samp></dt>
  15350. <dd><p>Set the frame mapping mode. Some combination of:
  15351. </p><dl compact="compact">
  15352. <dt><var>read</var></dt>
  15353. <dd><p>The mapped frame should be readable.
  15354. </p></dd>
  15355. <dt><var>write</var></dt>
  15356. <dd><p>The mapped frame should be writeable.
  15357. </p></dd>
  15358. <dt><var>overwrite</var></dt>
  15359. <dd><p>The mapping will always overwrite the entire frame.
  15360. </p>
  15361. <p>This may improve performance in some cases, as the original contents of the
  15362. frame need not be loaded.
  15363. </p></dd>
  15364. <dt><var>direct</var></dt>
  15365. <dd><p>The mapping must not involve any copying.
  15366. </p>
  15367. <p>Indirect mappings to copies of frames are created in some cases where either
  15368. direct mapping is not possible or it would have unexpected properties.
  15369. Setting this flag ensures that the mapping is direct and will fail if that is
  15370. not possible.
  15371. </p></dd>
  15372. </dl>
  15373. <p>Defaults to <var>read+write</var> if not specified.
  15374. </p>
  15375. </dd>
  15376. <dt><samp>derive_device <var>type</var></samp></dt>
  15377. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  15378. device of type <var>type</var> from the device the input frames exist on.
  15379. </p>
  15380. </dd>
  15381. <dt><samp>reverse</samp></dt>
  15382. <dd><p>In a hardware to hardware mapping, map in reverse - create frames in the sink
  15383. and map them back to the source. This may be necessary in some cases where
  15384. a mapping in one direction is required but only the opposite direction is
  15385. supported by the devices being used.
  15386. </p>
  15387. <p>This option is dangerous - it may break the preceding filter in undefined
  15388. ways if there are any additional constraints on that filter&rsquo;s output.
  15389. Do not use it without fully understanding the implications of its use.
  15390. </p></dd>
  15391. </dl>
  15392. <span id="hwupload"></span><a name="hwupload-1"></a>
  15393. <h3 class="section">11.108 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>
  15394. <p>Upload system memory frames to hardware surfaces.
  15395. </p>
  15396. <p>The device to upload to must be supplied when the filter is initialised. If
  15397. using ffmpeg, select the appropriate device with the <samp>-filter_hw_device</samp>
  15398. option or with the <samp>derive_device</samp> option. The input and output devices
  15399. must be of different types and compatible - the exact meaning of this is
  15400. system-dependent, but typically it means that they must refer to the same
  15401. underlying hardware context (for example, refer to the same graphics card).
  15402. </p>
  15403. <p>The following additional parameters are accepted:
  15404. </p>
  15405. <dl compact="compact">
  15406. <dt><samp>derive_device <var>type</var></samp></dt>
  15407. <dd><p>Rather than using the device supplied at initialisation, instead derive a new
  15408. device of type <var>type</var> from the device the input frames exist on.
  15409. </p></dd>
  15410. </dl>
  15411. <span id="hwupload_005fcuda"></span><a name="hwupload_005fcuda-1"></a>
  15412. <h3 class="section">11.109 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>
  15413. <p>Upload system memory frames to a CUDA device.
  15414. </p>
  15415. <p>It accepts the following optional parameters:
  15416. </p>
  15417. <dl compact="compact">
  15418. <dt><samp>device</samp></dt>
  15419. <dd><p>The number of the CUDA device to use
  15420. </p></dd>
  15421. </dl>
  15422. <a name="hqx"></a>
  15423. <h3 class="section">11.110 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>
  15424. <p>Apply a high-quality magnification filter designed for pixel art. This filter
  15425. was originally created by Maxim Stepin.
  15426. </p>
  15427. <p>It accepts the following option:
  15428. </p>
  15429. <dl compact="compact">
  15430. <dt><samp>n</samp></dt>
  15431. <dd><p>Set the scaling dimension: <code>2</code> for <code>hq2x</code>, <code>3</code> for
  15432. <code>hq3x</code> and <code>4</code> for <code>hq4x</code>.
  15433. Default is <code>3</code>.
  15434. </p></dd>
  15435. </dl>
  15436. <a name="hstack"></a>
  15437. <h3 class="section">11.111 hstack<span class="pull-right"><a class="anchor hidden-xs" href="#hstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-hstack" aria-hidden="true">TOC</a></span></h3>
  15438. <p>Stack input videos horizontally.
  15439. </p>
  15440. <p>All streams must be of same pixel format and of same height.
  15441. </p>
  15442. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  15443. to create same output.
  15444. </p>
  15445. <p>The filter accepts the following option:
  15446. </p>
  15447. <dl compact="compact">
  15448. <dt><samp>inputs</samp></dt>
  15449. <dd><p>Set number of input streams. Default is 2.
  15450. </p>
  15451. </dd>
  15452. <dt><samp>shortest</samp></dt>
  15453. <dd><p>If set to 1, force the output to terminate when the shortest input
  15454. terminates. Default value is 0.
  15455. </p></dd>
  15456. </dl>
  15457. <a name="hue"></a>
  15458. <h3 class="section">11.112 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>
  15459. <p>Modify the hue and/or the saturation of the input.
  15460. </p>
  15461. <p>It accepts the following parameters:
  15462. </p>
  15463. <dl compact="compact">
  15464. <dt><samp>h</samp></dt>
  15465. <dd><p>Specify the hue angle as a number of degrees. It accepts an expression,
  15466. and defaults to &quot;0&quot;.
  15467. </p>
  15468. </dd>
  15469. <dt><samp>s</samp></dt>
  15470. <dd><p>Specify the saturation in the [-10,10] range. It accepts an expression and
  15471. defaults to &quot;1&quot;.
  15472. </p>
  15473. </dd>
  15474. <dt><samp>H</samp></dt>
  15475. <dd><p>Specify the hue angle as a number of radians. It accepts an
  15476. expression, and defaults to &quot;0&quot;.
  15477. </p>
  15478. </dd>
  15479. <dt><samp>b</samp></dt>
  15480. <dd><p>Specify the brightness in the [-10,10] range. It accepts an expression and
  15481. defaults to &quot;0&quot;.
  15482. </p></dd>
  15483. </dl>
  15484. <p><samp>h</samp> and <samp>H</samp> are mutually exclusive, and can&rsquo;t be
  15485. specified at the same time.
  15486. </p>
  15487. <p>The <samp>b</samp>, <samp>h</samp>, <samp>H</samp> and <samp>s</samp> option values are
  15488. expressions containing the following constants:
  15489. </p>
  15490. <dl compact="compact">
  15491. <dt><samp>n</samp></dt>
  15492. <dd><p>frame count of the input frame starting from 0
  15493. </p>
  15494. </dd>
  15495. <dt><samp>pts</samp></dt>
  15496. <dd><p>presentation timestamp of the input frame expressed in time base units
  15497. </p>
  15498. </dd>
  15499. <dt><samp>r</samp></dt>
  15500. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  15501. </p>
  15502. </dd>
  15503. <dt><samp>t</samp></dt>
  15504. <dd><p>timestamp expressed in seconds, NAN if the input timestamp is unknown
  15505. </p>
  15506. </dd>
  15507. <dt><samp>tb</samp></dt>
  15508. <dd><p>time base of the input video
  15509. </p></dd>
  15510. </dl>
  15511. <a name="Examples-76"></a>
  15512. <h4 class="subsection">11.112.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>
  15513. <ul>
  15514. <li> Set the hue to 90 degrees and the saturation to 1.0:
  15515. <div class="example">
  15516. <pre class="example">hue=h=90:s=1
  15517. </pre></div>
  15518. </li><li> Same command but expressing the hue in radians:
  15519. <div class="example">
  15520. <pre class="example">hue=H=PI/2:s=1
  15521. </pre></div>
  15522. </li><li> Rotate hue and make the saturation swing between 0
  15523. and 2 over a period of 1 second:
  15524. <div class="example">
  15525. <pre class="example">hue=&quot;H=2*PI*t: s=sin(2*PI*t)+1&quot;
  15526. </pre></div>
  15527. </li><li> Apply a 3 seconds saturation fade-in effect starting at 0:
  15528. <div class="example">
  15529. <pre class="example">hue=&quot;s=min(t/3\,1)&quot;
  15530. </pre></div>
  15531. <p>The general fade-in expression can be written as:
  15532. </p><div class="example">
  15533. <pre class="example">hue=&quot;s=min(0\, max((t-START)/DURATION\, 1))&quot;
  15534. </pre></div>
  15535. </li><li> Apply a 3 seconds saturation fade-out effect starting at 5 seconds:
  15536. <div class="example">
  15537. <pre class="example">hue=&quot;s=max(0\, min(1\, (8-t)/3))&quot;
  15538. </pre></div>
  15539. <p>The general fade-out expression can be written as:
  15540. </p><div class="example">
  15541. <pre class="example">hue=&quot;s=max(0\, min(1\, (START+DURATION-t)/DURATION))&quot;
  15542. </pre></div>
  15543. </li></ul>
  15544. <a name="Commands-85"></a>
  15545. <h4 class="subsection">11.112.2 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>
  15546. <p>This filter supports the following commands:
  15547. </p><dl compact="compact">
  15548. <dt><samp>b</samp></dt>
  15549. <dt><samp>s</samp></dt>
  15550. <dt><samp>h</samp></dt>
  15551. <dt><samp>H</samp></dt>
  15552. <dd><p>Modify the hue and/or the saturation and/or brightness of the input video.
  15553. The command accepts the same syntax of the corresponding option.
  15554. </p>
  15555. <p>If the specified expression is not valid, it is kept at its current
  15556. value.
  15557. </p></dd>
  15558. </dl>
  15559. <a name="hysteresis"></a>
  15560. <h3 class="section">11.113 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>
  15561. <p>Grow first stream into second stream by connecting components.
  15562. This makes it possible to build more robust edge masks.
  15563. </p>
  15564. <p>This filter accepts the following options:
  15565. </p>
  15566. <dl compact="compact">
  15567. <dt><samp>planes</samp></dt>
  15568. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  15569. copied from first stream.
  15570. By default value 0xf, all planes will be processed.
  15571. </p>
  15572. </dd>
  15573. <dt><samp>threshold</samp></dt>
  15574. <dd><p>Set threshold which is used in filtering. If pixel component value is higher than
  15575. this value filter algorithm for connecting components is activated.
  15576. By default value is 0.
  15577. </p></dd>
  15578. </dl>
  15579. <p>The <code>hysteresis</code> filter also supports the <a href="#framesync">framesync</a> options.
  15580. </p>
  15581. <a name="identity"></a>
  15582. <h3 class="section">11.114 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>
  15583. <p>Obtain the identity score between two input videos.
  15584. </p>
  15585. <p>This filter takes two input videos.
  15586. </p>
  15587. <p>Both input videos must have the same resolution and pixel format for
  15588. this filter to work correctly. Also it assumes that both inputs
  15589. have the same number of frames, which are compared one by one.
  15590. </p>
  15591. <p>The obtained per component, average, min and max identity score is printed through
  15592. the logging system.
  15593. </p>
  15594. <p>The filter stores the calculated identity scores of each frame in frame metadata.
  15595. </p>
  15596. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  15597. with the reference file <samp>ref.mpg</samp>.
  15598. </p>
  15599. <div class="example">
  15600. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi identity -f null -
  15601. </pre></div>
  15602. <a name="idet"></a>
  15603. <h3 class="section">11.115 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>
  15604. <p>Detect video interlacing type.
  15605. </p>
  15606. <p>This filter tries to detect if the input frames are interlaced, progressive,
  15607. top or bottom field first. It will also try to detect fields that are
  15608. repeated between adjacent frames (a sign of telecine).
  15609. </p>
  15610. <p>Single frame detection considers only immediately adjacent frames when classifying each frame.
  15611. Multiple frame detection incorporates the classification history of previous frames.
  15612. </p>
  15613. <p>The filter will log these metadata values:
  15614. </p>
  15615. <dl compact="compact">
  15616. <dt><samp>single.current_frame</samp></dt>
  15617. <dd><p>Detected type of current frame using single-frame detection. One of:
  15618. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  15619. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  15620. </p>
  15621. </dd>
  15622. <dt><samp>single.tff</samp></dt>
  15623. <dd><p>Cumulative number of frames detected as top field first using single-frame detection.
  15624. </p>
  15625. </dd>
  15626. <dt><samp>multiple.tff</samp></dt>
  15627. <dd><p>Cumulative number of frames detected as top field first using multiple-frame detection.
  15628. </p>
  15629. </dd>
  15630. <dt><samp>single.bff</samp></dt>
  15631. <dd><p>Cumulative number of frames detected as bottom field first using single-frame detection.
  15632. </p>
  15633. </dd>
  15634. <dt><samp>multiple.current_frame</samp></dt>
  15635. <dd><p>Detected type of current frame using multiple-frame detection. One of:
  15636. &ldquo;tff&rdquo; (top field first), &ldquo;bff&rdquo; (bottom field first),
  15637. &ldquo;progressive&rdquo;, or &ldquo;undetermined&rdquo;
  15638. </p>
  15639. </dd>
  15640. <dt><samp>multiple.bff</samp></dt>
  15641. <dd><p>Cumulative number of frames detected as bottom field first using multiple-frame detection.
  15642. </p>
  15643. </dd>
  15644. <dt><samp>single.progressive</samp></dt>
  15645. <dd><p>Cumulative number of frames detected as progressive using single-frame detection.
  15646. </p>
  15647. </dd>
  15648. <dt><samp>multiple.progressive</samp></dt>
  15649. <dd><p>Cumulative number of frames detected as progressive using multiple-frame detection.
  15650. </p>
  15651. </dd>
  15652. <dt><samp>single.undetermined</samp></dt>
  15653. <dd><p>Cumulative number of frames that could not be classified using single-frame detection.
  15654. </p>
  15655. </dd>
  15656. <dt><samp>multiple.undetermined</samp></dt>
  15657. <dd><p>Cumulative number of frames that could not be classified using multiple-frame detection.
  15658. </p>
  15659. </dd>
  15660. <dt><samp>repeated.current_frame</samp></dt>
  15661. <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;.
  15662. </p>
  15663. </dd>
  15664. <dt><samp>repeated.neither</samp></dt>
  15665. <dd><p>Cumulative number of frames with no repeated field.
  15666. </p>
  15667. </dd>
  15668. <dt><samp>repeated.top</samp></dt>
  15669. <dd><p>Cumulative number of frames with the top field repeated from the previous frame&rsquo;s top field.
  15670. </p>
  15671. </dd>
  15672. <dt><samp>repeated.bottom</samp></dt>
  15673. <dd><p>Cumulative number of frames with the bottom field repeated from the previous frame&rsquo;s bottom field.
  15674. </p></dd>
  15675. </dl>
  15676. <p>The filter accepts the following options:
  15677. </p>
  15678. <dl compact="compact">
  15679. <dt><samp>intl_thres</samp></dt>
  15680. <dd><p>Set interlacing threshold.
  15681. </p></dd>
  15682. <dt><samp>prog_thres</samp></dt>
  15683. <dd><p>Set progressive threshold.
  15684. </p></dd>
  15685. <dt><samp>rep_thres</samp></dt>
  15686. <dd><p>Threshold for repeated field detection.
  15687. </p></dd>
  15688. <dt><samp>half_life</samp></dt>
  15689. <dd><p>Number of frames after which a given frame&rsquo;s contribution to the
  15690. statistics is halved (i.e., it contributes only 0.5 to its
  15691. classification). The default of 0 means that all frames seen are given
  15692. full weight of 1.0 forever.
  15693. </p></dd>
  15694. <dt><samp>analyze_interlaced_flag</samp></dt>
  15695. <dd><p>When this is not 0 then idet will use the specified number of frames to determine
  15696. if the interlaced flag is accurate, it will not count undetermined frames.
  15697. If the flag is found to be accurate it will be used without any further
  15698. computations, if it is found to be inaccurate it will be cleared without any
  15699. further computations. This allows inserting the idet filter as a low computational
  15700. method to clean up the interlaced flag
  15701. </p></dd>
  15702. </dl>
  15703. <a name="il"></a>
  15704. <h3 class="section">11.116 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>
  15705. <p>Deinterleave or interleave fields.
  15706. </p>
  15707. <p>This filter allows one to process interlaced images fields without
  15708. deinterlacing them. Deinterleaving splits the input frame into 2
  15709. fields (so called half pictures). Odd lines are moved to the top
  15710. half of the output image, even lines to the bottom half.
  15711. You can process (filter) them independently and then re-interleave them.
  15712. </p>
  15713. <p>The filter accepts the following options:
  15714. </p>
  15715. <dl compact="compact">
  15716. <dt><samp>luma_mode, l</samp></dt>
  15717. <dt><samp>chroma_mode, c</samp></dt>
  15718. <dt><samp>alpha_mode, a</samp></dt>
  15719. <dd><p>Available values for <var>luma_mode</var>, <var>chroma_mode</var> and
  15720. <var>alpha_mode</var> are:
  15721. </p>
  15722. <dl compact="compact">
  15723. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  15724. <dd><p>Do nothing.
  15725. </p>
  15726. </dd>
  15727. <dt>&lsquo;<samp>deinterleave, d</samp>&rsquo;</dt>
  15728. <dd><p>Deinterleave fields, placing one above the other.
  15729. </p>
  15730. </dd>
  15731. <dt>&lsquo;<samp>interleave, i</samp>&rsquo;</dt>
  15732. <dd><p>Interleave fields. Reverse the effect of deinterleaving.
  15733. </p></dd>
  15734. </dl>
  15735. <p>Default value is <code>none</code>.
  15736. </p>
  15737. </dd>
  15738. <dt><samp>luma_swap, ls</samp></dt>
  15739. <dt><samp>chroma_swap, cs</samp></dt>
  15740. <dt><samp>alpha_swap, as</samp></dt>
  15741. <dd><p>Swap luma/chroma/alpha fields. Exchange even &amp; odd lines. Default value is <code>0</code>.
  15742. </p></dd>
  15743. </dl>
  15744. <a name="Commands-86"></a>
  15745. <h4 class="subsection">11.116.1 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>
  15746. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  15747. </p>
  15748. <a name="inflate"></a>
  15749. <h3 class="section">11.117 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>
  15750. <p>Apply inflate effect to the video.
  15751. </p>
  15752. <p>This filter replaces the pixel by the local(3x3) average by taking into account
  15753. only values higher than the pixel.
  15754. </p>
  15755. <p>It accepts the following options:
  15756. </p>
  15757. <dl compact="compact">
  15758. <dt><samp>threshold0</samp></dt>
  15759. <dt><samp>threshold1</samp></dt>
  15760. <dt><samp>threshold2</samp></dt>
  15761. <dt><samp>threshold3</samp></dt>
  15762. <dd><p>Limit the maximum change for each plane, default is 65535.
  15763. If 0, plane will remain unchanged.
  15764. </p></dd>
  15765. </dl>
  15766. <a name="Commands-87"></a>
  15767. <h4 class="subsection">11.117.1 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>
  15768. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  15769. </p>
  15770. <a name="interlace"></a>
  15771. <h3 class="section">11.118 interlace<span class="pull-right"><a class="anchor hidden-xs" href="#interlace" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-interlace" aria-hidden="true">TOC</a></span></h3>
  15772. <p>Simple interlacing filter from progressive contents. This interleaves upper (or
  15773. lower) lines from odd frames with lower (or upper) lines from even frames,
  15774. halving the frame rate and preserving image height.
  15775. </p>
  15776. <div class="example">
  15777. <pre class="example"> Original Original New Frame
  15778. Frame 'j' Frame 'j+1' (tff)
  15779. ========== =========== ==================
  15780. Line 0 --------------------&gt; Frame 'j' Line 0
  15781. Line 1 Line 1 ----&gt; Frame 'j+1' Line 1
  15782. Line 2 ---------------------&gt; Frame 'j' Line 2
  15783. Line 3 Line 3 ----&gt; Frame 'j+1' Line 3
  15784. ... ... ...
  15785. New Frame + 1 will be generated by Frame 'j+2' and Frame 'j+3' and so on
  15786. </pre></div>
  15787. <p>It accepts the following optional parameters:
  15788. </p>
  15789. <dl compact="compact">
  15790. <dt><samp>scan</samp></dt>
  15791. <dd><p>This determines whether the interlaced frame is taken from the even
  15792. (tff - default) or odd (bff) lines of the progressive frame.
  15793. </p>
  15794. </dd>
  15795. <dt><samp>lowpass</samp></dt>
  15796. <dd><p>Vertical lowpass filter to avoid twitter interlacing and
  15797. reduce moire patterns.
  15798. </p>
  15799. <dl compact="compact">
  15800. <dt>&lsquo;<samp>0, off</samp>&rsquo;</dt>
  15801. <dd><p>Disable vertical lowpass filter
  15802. </p>
  15803. </dd>
  15804. <dt>&lsquo;<samp>1, linear</samp>&rsquo;</dt>
  15805. <dd><p>Enable linear filter (default)
  15806. </p>
  15807. </dd>
  15808. <dt>&lsquo;<samp>2, complex</samp>&rsquo;</dt>
  15809. <dd><p>Enable complex filter. This will slightly less reduce twitter and moire
  15810. but better retain detail and subjective sharpness impression.
  15811. </p>
  15812. </dd>
  15813. </dl>
  15814. </dd>
  15815. </dl>
  15816. <a name="kerndeint"></a>
  15817. <h3 class="section">11.119 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>
  15818. <p>Deinterlace input video by applying Donald Graft&rsquo;s adaptive kernel
  15819. deinterling. Work on interlaced parts of a video to produce
  15820. progressive frames.
  15821. </p>
  15822. <p>The description of the accepted parameters follows.
  15823. </p>
  15824. <dl compact="compact">
  15825. <dt><samp>thresh</samp></dt>
  15826. <dd><p>Set the threshold which affects the filter&rsquo;s tolerance when
  15827. determining if a pixel line must be processed. It must be an integer
  15828. in the range [0,255] and defaults to 10. A value of 0 will result in
  15829. applying the process on every pixels.
  15830. </p>
  15831. </dd>
  15832. <dt><samp>map</samp></dt>
  15833. <dd><p>Paint pixels exceeding the threshold value to white if set to 1.
  15834. Default is 0.
  15835. </p>
  15836. </dd>
  15837. <dt><samp>order</samp></dt>
  15838. <dd><p>Set the fields order. Swap fields if set to 1, leave fields alone if
  15839. 0. Default is 0.
  15840. </p>
  15841. </dd>
  15842. <dt><samp>sharp</samp></dt>
  15843. <dd><p>Enable additional sharpening if set to 1. Default is 0.
  15844. </p>
  15845. </dd>
  15846. <dt><samp>twoway</samp></dt>
  15847. <dd><p>Enable twoway sharpening if set to 1. Default is 0.
  15848. </p></dd>
  15849. </dl>
  15850. <a name="Examples-77"></a>
  15851. <h4 class="subsection">11.119.1 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>
  15852. <ul>
  15853. <li> Apply default values:
  15854. <div class="example">
  15855. <pre class="example">kerndeint=thresh=10:map=0:order=0:sharp=0:twoway=0
  15856. </pre></div>
  15857. </li><li> Enable additional sharpening:
  15858. <div class="example">
  15859. <pre class="example">kerndeint=sharp=1
  15860. </pre></div>
  15861. </li><li> Paint processed pixels in white:
  15862. <div class="example">
  15863. <pre class="example">kerndeint=map=1
  15864. </pre></div>
  15865. </li></ul>
  15866. <a name="kirsch"></a>
  15867. <h3 class="section">11.120 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>
  15868. <p>Apply kirsch operator to input video stream.
  15869. </p>
  15870. <p>The filter accepts the following option:
  15871. </p>
  15872. <dl compact="compact">
  15873. <dt><samp>planes</samp></dt>
  15874. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  15875. By default value 0xf, all planes will be processed.
  15876. </p>
  15877. </dd>
  15878. <dt><samp>scale</samp></dt>
  15879. <dd><p>Set value which will be multiplied with filtered result.
  15880. </p>
  15881. </dd>
  15882. <dt><samp>delta</samp></dt>
  15883. <dd><p>Set value which will be added to filtered result.
  15884. </p></dd>
  15885. </dl>
  15886. <a name="Commands-88"></a>
  15887. <h4 class="subsection">11.120.1 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>
  15888. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  15889. </p>
  15890. <a name="lagfun"></a>
  15891. <h3 class="section">11.121 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>
  15892. <p>Slowly update darker pixels.
  15893. </p>
  15894. <p>This filter makes short flashes of light appear longer.
  15895. This filter accepts the following options:
  15896. </p>
  15897. <dl compact="compact">
  15898. <dt><samp>decay</samp></dt>
  15899. <dd><p>Set factor for decaying. Default is .95. Allowed range is from 0 to 1.
  15900. </p>
  15901. </dd>
  15902. <dt><samp>planes</samp></dt>
  15903. <dd><p>Set which planes to filter. Default is all. Allowed range is from 0 to 15.
  15904. </p></dd>
  15905. </dl>
  15906. <a name="Commands-89"></a>
  15907. <h4 class="subsection">11.121.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>
  15908. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  15909. </p>
  15910. <a name="lenscorrection"></a>
  15911. <h3 class="section">11.122 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>
  15912. <p>Correct radial lens distortion
  15913. </p>
  15914. <p>This filter can be used to correct for radial distortion as can result from the use
  15915. of wide angle lenses, and thereby re-rectify the image. To find the right parameters
  15916. one can use tools available for example as part of opencv or simply trial-and-error.
  15917. To use opencv use the calibration sample (under samples/cpp) from the opencv sources
  15918. and extract the k1 and k2 coefficients from the resulting matrix.
  15919. </p>
  15920. <p>Note that effectively the same filter is available in the open-source tools Krita and
  15921. Digikam from the KDE project.
  15922. </p>
  15923. <p>In contrast to the <a href="#vignette">vignette</a> filter, which can also be used to compensate lens errors,
  15924. this filter corrects the distortion of the image, whereas <a href="#vignette">vignette</a> corrects the
  15925. brightness distribution, so you may want to use both filters together in certain
  15926. cases, though you will have to take care of ordering, i.e. whether vignetting should
  15927. be applied before or after lens correction.
  15928. </p>
  15929. <a name="Options"></a>
  15930. <h4 class="subsection">11.122.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>
  15931. <p>The filter accepts the following options:
  15932. </p>
  15933. <dl compact="compact">
  15934. <dt><samp>cx</samp></dt>
  15935. <dd><p>Relative x-coordinate of the focal point of the image, and thereby the center of the
  15936. distortion. This value has a range [0,1] and is expressed as fractions of the image
  15937. width. Default is 0.5.
  15938. </p></dd>
  15939. <dt><samp>cy</samp></dt>
  15940. <dd><p>Relative y-coordinate of the focal point of the image, and thereby the center of the
  15941. distortion. This value has a range [0,1] and is expressed as fractions of the image
  15942. height. Default is 0.5.
  15943. </p></dd>
  15944. <dt><samp>k1</samp></dt>
  15945. <dd><p>Coefficient of the quadratic correction term. This value has a range [-1,1]. 0 means
  15946. no correction. Default is 0.
  15947. </p></dd>
  15948. <dt><samp>k2</samp></dt>
  15949. <dd><p>Coefficient of the double quadratic correction term. This value has a range [-1,1].
  15950. 0 means no correction. Default is 0.
  15951. </p></dd>
  15952. <dt><samp>i</samp></dt>
  15953. <dd><p>Set interpolation type. Can be <code>nearest</code> or <code>bilinear</code>.
  15954. Default is <code>nearest</code>.
  15955. </p></dd>
  15956. <dt><samp>fc</samp></dt>
  15957. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  15958. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  15959. manual</a>. Default color is <code>black@0</code>.
  15960. </p></dd>
  15961. </dl>
  15962. <p>The formula that generates the correction is:
  15963. </p>
  15964. <p><var>r_src</var> = <var>r_tgt</var> * (1 + <var>k1</var> * (<var>r_tgt</var> / <var>r_0</var>)^2 + <var>k2</var> * (<var>r_tgt</var> / <var>r_0</var>)^4)
  15965. </p>
  15966. <p>where <var>r_0</var> is halve of the image diagonal and <var>r_src</var> and <var>r_tgt</var> are the
  15967. distances from the focal point in the source and target images, respectively.
  15968. </p>
  15969. <a name="Commands-90"></a>
  15970. <h4 class="subsection">11.122.2 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>
  15971. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  15972. </p>
  15973. <a name="lensfun"></a>
  15974. <h3 class="section">11.123 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>
  15975. <p>Apply lens correction via the lensfun library (<a href="http://lensfun.sourceforge.net/">http://lensfun.sourceforge.net/</a>).
  15976. </p>
  15977. <p>The <code>lensfun</code> filter requires the camera make, camera model, and lens model
  15978. to apply the lens correction. The filter will load the lensfun database and
  15979. query it to find the corresponding camera and lens entries in the database. As
  15980. long as these entries can be found with the given options, the filter can
  15981. perform corrections on frames. Note that incomplete strings will result in the
  15982. filter choosing the best match with the given options, and the filter will
  15983. output the chosen camera and lens models (logged with level &quot;info&quot;). You must
  15984. provide the make, camera model, and lens model as they are required.
  15985. </p>
  15986. <p>The filter accepts the following options:
  15987. </p>
  15988. <dl compact="compact">
  15989. <dt><samp>make</samp></dt>
  15990. <dd><p>The make of the camera (for example, &quot;Canon&quot;). This option is required.
  15991. </p>
  15992. </dd>
  15993. <dt><samp>model</samp></dt>
  15994. <dd><p>The model of the camera (for example, &quot;Canon EOS 100D&quot;). This option is
  15995. required.
  15996. </p>
  15997. </dd>
  15998. <dt><samp>lens_model</samp></dt>
  15999. <dd><p>The model of the lens (for example, &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;). This
  16000. option is required.
  16001. </p>
  16002. </dd>
  16003. <dt><samp>mode</samp></dt>
  16004. <dd><p>The type of correction to apply. The following values are valid options:
  16005. </p>
  16006. <dl compact="compact">
  16007. <dt>&lsquo;<samp>vignetting</samp>&rsquo;</dt>
  16008. <dd><p>Enables fixing lens vignetting.
  16009. </p>
  16010. </dd>
  16011. <dt>&lsquo;<samp>geometry</samp>&rsquo;</dt>
  16012. <dd><p>Enables fixing lens geometry. This is the default.
  16013. </p>
  16014. </dd>
  16015. <dt>&lsquo;<samp>subpixel</samp>&rsquo;</dt>
  16016. <dd><p>Enables fixing chromatic aberrations.
  16017. </p>
  16018. </dd>
  16019. <dt>&lsquo;<samp>vig_geo</samp>&rsquo;</dt>
  16020. <dd><p>Enables fixing lens vignetting and lens geometry.
  16021. </p>
  16022. </dd>
  16023. <dt>&lsquo;<samp>vig_subpixel</samp>&rsquo;</dt>
  16024. <dd><p>Enables fixing lens vignetting and chromatic aberrations.
  16025. </p>
  16026. </dd>
  16027. <dt>&lsquo;<samp>distortion</samp>&rsquo;</dt>
  16028. <dd><p>Enables fixing both lens geometry and chromatic aberrations.
  16029. </p>
  16030. </dd>
  16031. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  16032. <dd><p>Enables all possible corrections.
  16033. </p>
  16034. </dd>
  16035. </dl>
  16036. </dd>
  16037. <dt><samp>focal_length</samp></dt>
  16038. <dd><p>The focal length of the image/video (zoom; expected constant for video). For
  16039. example, a 18&ndash;55mm lens has focal length range of [18&ndash;55], so a value in that
  16040. range should be chosen when using that lens. Default 18.
  16041. </p>
  16042. </dd>
  16043. <dt><samp>aperture</samp></dt>
  16044. <dd><p>The aperture of the image/video (expected constant for video). Note that
  16045. aperture is only used for vignetting correction. Default 3.5.
  16046. </p>
  16047. </dd>
  16048. <dt><samp>focus_distance</samp></dt>
  16049. <dd><p>The focus distance of the image/video (expected constant for video). Note that
  16050. focus distance is only used for vignetting and only slightly affects the
  16051. vignetting correction process. If unknown, leave it at the default value (which
  16052. is 1000).
  16053. </p>
  16054. </dd>
  16055. <dt><samp>scale</samp></dt>
  16056. <dd><p>The scale factor which is applied after transformation. After correction the
  16057. video is no longer necessarily rectangular. This parameter controls how much of
  16058. the resulting image is visible. The value 0 means that a value will be chosen
  16059. automatically such that there is little or no unmapped area in the output
  16060. image. 1.0 means that no additional scaling is done. Lower values may result
  16061. in more of the corrected image being visible, while higher values may avoid
  16062. unmapped areas in the output.
  16063. </p>
  16064. </dd>
  16065. <dt><samp>target_geometry</samp></dt>
  16066. <dd><p>The target geometry of the output image/video. The following values are valid
  16067. options:
  16068. </p>
  16069. <dl compact="compact">
  16070. <dt>&lsquo;<samp>rectilinear (default)</samp>&rsquo;</dt>
  16071. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  16072. <dt>&lsquo;<samp>panoramic</samp>&rsquo;</dt>
  16073. <dt>&lsquo;<samp>equirectangular</samp>&rsquo;</dt>
  16074. <dt>&lsquo;<samp>fisheye_orthographic</samp>&rsquo;</dt>
  16075. <dt>&lsquo;<samp>fisheye_stereographic</samp>&rsquo;</dt>
  16076. <dt>&lsquo;<samp>fisheye_equisolid</samp>&rsquo;</dt>
  16077. <dt>&lsquo;<samp>fisheye_thoby</samp>&rsquo;</dt>
  16078. </dl>
  16079. </dd>
  16080. <dt><samp>reverse</samp></dt>
  16081. <dd><p>Apply the reverse of image correction (instead of correcting distortion, apply
  16082. it).
  16083. </p>
  16084. </dd>
  16085. <dt><samp>interpolation</samp></dt>
  16086. <dd><p>The type of interpolation used when correcting distortion. The following values
  16087. are valid options:
  16088. </p>
  16089. <dl compact="compact">
  16090. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  16091. <dt>&lsquo;<samp>linear (default)</samp>&rsquo;</dt>
  16092. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  16093. </dl>
  16094. </dd>
  16095. </dl>
  16096. <a name="Examples-78"></a>
  16097. <h4 class="subsection">11.123.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>
  16098. <ul>
  16099. <li> Apply lens correction with make &quot;Canon&quot;, camera model &quot;Canon EOS 100D&quot;, and lens
  16100. model &quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot; with focal length of &quot;18&quot; and
  16101. aperture of &quot;8.0&quot;.
  16102. <div class="example">
  16103. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8 -c:v h264 -b:v 8000k output.mov
  16104. </pre></div>
  16105. </li><li> Apply the same as before, but only for the first 5 seconds of video.
  16106. <div class="example">
  16107. <pre class="example">ffmpeg -i input.mov -vf lensfun=make=Canon:model=&quot;Canon EOS 100D&quot;:lens_model=&quot;Canon EF-S 18-55mm f/3.5-5.6 IS STM&quot;:focal_length=18:aperture=8:enable='lte(t\,5)' -c:v h264 -b:v 8000k output.mov
  16108. </pre></div>
  16109. </li></ul>
  16110. <a name="libvmaf"></a>
  16111. <h3 class="section">11.124 libvmaf<span class="pull-right"><a class="anchor hidden-xs" href="#libvmaf" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-libvmaf" aria-hidden="true">TOC</a></span></h3>
  16112. <p>Obtain the VMAF (Video Multi-Method Assessment Fusion)
  16113. score between two input videos.
  16114. </p>
  16115. <p>The obtained VMAF score is printed through the logging system.
  16116. </p>
  16117. <p>It requires Netflix&rsquo;s vmaf library (libvmaf) as a pre-requisite.
  16118. After installing the library it can be enabled using:
  16119. <code>./configure --enable-libvmaf</code>.
  16120. If no model path is specified it uses the default model: <code>vmaf_v0.6.1.pkl</code>.
  16121. </p>
  16122. <p>The filter has following options:
  16123. </p>
  16124. <dl compact="compact">
  16125. <dt><samp>model_path</samp></dt>
  16126. <dd><p>Set the model path which is to be used for SVM.
  16127. Default value: <code>&quot;/usr/local/share/model/vmaf_v0.6.1.pkl&quot;</code>
  16128. </p>
  16129. </dd>
  16130. <dt><samp>log_path</samp></dt>
  16131. <dd><p>Set the file path to be used to store logs.
  16132. </p>
  16133. </dd>
  16134. <dt><samp>log_fmt</samp></dt>
  16135. <dd><p>Set the format of the log file (csv, json or xml).
  16136. </p>
  16137. </dd>
  16138. <dt><samp>enable_transform</samp></dt>
  16139. <dd><p>This option can enable/disable the <code>score_transform</code> applied to the final predicted VMAF score,
  16140. if you have specified score_transform option in the input parameter file passed to <code>run_vmaf_training.py</code>
  16141. Default value: <code>false</code>
  16142. </p>
  16143. </dd>
  16144. <dt><samp>phone_model</samp></dt>
  16145. <dd><p>Invokes the phone model which will generate VMAF scores higher than in the
  16146. regular model, which is more suitable for laptop, TV, etc. viewing conditions.
  16147. Default value: <code>false</code>
  16148. </p>
  16149. </dd>
  16150. <dt><samp>psnr</samp></dt>
  16151. <dd><p>Enables computing psnr along with vmaf.
  16152. Default value: <code>false</code>
  16153. </p>
  16154. </dd>
  16155. <dt><samp>ssim</samp></dt>
  16156. <dd><p>Enables computing ssim along with vmaf.
  16157. Default value: <code>false</code>
  16158. </p>
  16159. </dd>
  16160. <dt><samp>ms_ssim</samp></dt>
  16161. <dd><p>Enables computing ms_ssim along with vmaf.
  16162. Default value: <code>false</code>
  16163. </p>
  16164. </dd>
  16165. <dt><samp>pool</samp></dt>
  16166. <dd><p>Set the pool method to be used for computing vmaf.
  16167. Options are <code>min</code>, <code>harmonic_mean</code> or <code>mean</code> (default).
  16168. </p>
  16169. </dd>
  16170. <dt><samp>n_threads</samp></dt>
  16171. <dd><p>Set number of threads to be used when computing vmaf.
  16172. Default value: <code>0</code>, which makes use of all available logical processors.
  16173. </p>
  16174. </dd>
  16175. <dt><samp>n_subsample</samp></dt>
  16176. <dd><p>Set interval for frame subsampling used when computing vmaf.
  16177. Default value: <code>1</code>
  16178. </p>
  16179. </dd>
  16180. <dt><samp>enable_conf_interval</samp></dt>
  16181. <dd><p>Enables confidence interval.
  16182. Default value: <code>false</code>
  16183. </p></dd>
  16184. </dl>
  16185. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  16186. </p>
  16187. <a name="Examples-79"></a>
  16188. <h4 class="subsection">11.124.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>
  16189. <ul>
  16190. <li> On the below examples the input file <samp>main.mpg</samp> being processed is
  16191. compared with the reference file <samp>ref.mpg</samp>.
  16192. <div class="example">
  16193. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf -f null -
  16194. </pre></div>
  16195. </li><li> Example with options:
  16196. <div class="example">
  16197. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi libvmaf=&quot;psnr=1:log_fmt=json&quot; -f null -
  16198. </pre></div>
  16199. </li><li> Example with options and different containers:
  16200. <div class="example">
  16201. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]libvmaf=psnr=1:log_fmt=json&quot; -f null -
  16202. </pre></div>
  16203. </li></ul>
  16204. <a name="limiter"></a>
  16205. <h3 class="section">11.125 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>
  16206. <p>Limits the pixel components values to the specified range [min, max].
  16207. </p>
  16208. <p>The filter accepts the following options:
  16209. </p>
  16210. <dl compact="compact">
  16211. <dt><samp>min</samp></dt>
  16212. <dd><p>Lower bound. Defaults to the lowest allowed value for the input.
  16213. </p>
  16214. </dd>
  16215. <dt><samp>max</samp></dt>
  16216. <dd><p>Upper bound. Defaults to the highest allowed value for the input.
  16217. </p>
  16218. </dd>
  16219. <dt><samp>planes</samp></dt>
  16220. <dd><p>Specify which planes will be processed. Defaults to all available.
  16221. </p></dd>
  16222. </dl>
  16223. <a name="Commands-91"></a>
  16224. <h4 class="subsection">11.125.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>
  16225. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16226. </p>
  16227. <a name="loop"></a>
  16228. <h3 class="section">11.126 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>
  16229. <p>Loop video frames.
  16230. </p>
  16231. <p>The filter accepts the following options:
  16232. </p>
  16233. <dl compact="compact">
  16234. <dt><samp>loop</samp></dt>
  16235. <dd><p>Set the number of loops. Setting this value to -1 will result in infinite loops.
  16236. Default is 0.
  16237. </p>
  16238. </dd>
  16239. <dt><samp>size</samp></dt>
  16240. <dd><p>Set maximal size in number of frames. Default is 0.
  16241. </p>
  16242. </dd>
  16243. <dt><samp>start</samp></dt>
  16244. <dd><p>Set first frame of loop. Default is 0.
  16245. </p></dd>
  16246. </dl>
  16247. <a name="Examples-80"></a>
  16248. <h4 class="subsection">11.126.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>
  16249. <ul>
  16250. <li> Loop single first frame infinitely:
  16251. <div class="example">
  16252. <pre class="example">loop=loop=-1:size=1:start=0
  16253. </pre></div>
  16254. </li><li> Loop single first frame 10 times:
  16255. <div class="example">
  16256. <pre class="example">loop=loop=10:size=1:start=0
  16257. </pre></div>
  16258. </li><li> Loop 10 first frames 5 times:
  16259. <div class="example">
  16260. <pre class="example">loop=loop=5:size=10:start=0
  16261. </pre></div>
  16262. </li></ul>
  16263. <a name="lut1d"></a>
  16264. <h3 class="section">11.127 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>
  16265. <p>Apply a 1D LUT to an input video.
  16266. </p>
  16267. <p>The filter accepts the following options:
  16268. </p>
  16269. <dl compact="compact">
  16270. <dt><samp>file</samp></dt>
  16271. <dd><p>Set the 1D LUT file name.
  16272. </p>
  16273. <p>Currently supported formats:
  16274. </p><dl compact="compact">
  16275. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  16276. <dd><p>Iridas
  16277. </p></dd>
  16278. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  16279. <dd><p>cineSpace
  16280. </p></dd>
  16281. </dl>
  16282. </dd>
  16283. <dt><samp>interp</samp></dt>
  16284. <dd><p>Select interpolation mode.
  16285. </p>
  16286. <p>Available values are:
  16287. </p>
  16288. <dl compact="compact">
  16289. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  16290. <dd><p>Use values from the nearest defined point.
  16291. </p></dd>
  16292. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  16293. <dd><p>Interpolate values using the linear interpolation.
  16294. </p></dd>
  16295. <dt>&lsquo;<samp>cosine</samp>&rsquo;</dt>
  16296. <dd><p>Interpolate values using the cosine interpolation.
  16297. </p></dd>
  16298. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  16299. <dd><p>Interpolate values using the cubic interpolation.
  16300. </p></dd>
  16301. <dt>&lsquo;<samp>spline</samp>&rsquo;</dt>
  16302. <dd><p>Interpolate values using the spline interpolation.
  16303. </p></dd>
  16304. </dl>
  16305. </dd>
  16306. </dl>
  16307. <a name="Commands-92"></a>
  16308. <h4 class="subsection">11.127.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>
  16309. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16310. </p>
  16311. <span id="lut3d"></span><a name="lut3d-1"></a>
  16312. <h3 class="section">11.128 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>
  16313. <p>Apply a 3D LUT to an input video.
  16314. </p>
  16315. <p>The filter accepts the following options:
  16316. </p>
  16317. <dl compact="compact">
  16318. <dt><samp>file</samp></dt>
  16319. <dd><p>Set the 3D LUT file name.
  16320. </p>
  16321. <p>Currently supported formats:
  16322. </p><dl compact="compact">
  16323. <dt>&lsquo;<samp>3dl</samp>&rsquo;</dt>
  16324. <dd><p>AfterEffects
  16325. </p></dd>
  16326. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  16327. <dd><p>Iridas
  16328. </p></dd>
  16329. <dt>&lsquo;<samp>dat</samp>&rsquo;</dt>
  16330. <dd><p>DaVinci
  16331. </p></dd>
  16332. <dt>&lsquo;<samp>m3d</samp>&rsquo;</dt>
  16333. <dd><p>Pandora
  16334. </p></dd>
  16335. <dt>&lsquo;<samp>csp</samp>&rsquo;</dt>
  16336. <dd><p>cineSpace
  16337. </p></dd>
  16338. </dl>
  16339. </dd>
  16340. <dt><samp>interp</samp></dt>
  16341. <dd><p>Select interpolation mode.
  16342. </p>
  16343. <p>Available values are:
  16344. </p>
  16345. <dl compact="compact">
  16346. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  16347. <dd><p>Use values from the nearest defined point.
  16348. </p></dd>
  16349. <dt>&lsquo;<samp>trilinear</samp>&rsquo;</dt>
  16350. <dd><p>Interpolate values using the 8 points defining a cube.
  16351. </p></dd>
  16352. <dt>&lsquo;<samp>tetrahedral</samp>&rsquo;</dt>
  16353. <dd><p>Interpolate values using a tetrahedron.
  16354. </p></dd>
  16355. <dt>&lsquo;<samp>pyramid</samp>&rsquo;</dt>
  16356. <dd><p>Interpolate values using a pyramid.
  16357. </p></dd>
  16358. <dt>&lsquo;<samp>prism</samp>&rsquo;</dt>
  16359. <dd><p>Interpolate values using a prism.
  16360. </p></dd>
  16361. </dl>
  16362. </dd>
  16363. </dl>
  16364. <a name="Commands-93"></a>
  16365. <h4 class="subsection">11.128.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>
  16366. <p>This filter supports the <code>interp</code> option as <a href="#commands">commands</a>.
  16367. </p>
  16368. <a name="lumakey"></a>
  16369. <h3 class="section">11.129 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>
  16370. <p>Turn certain luma values into transparency.
  16371. </p>
  16372. <p>The filter accepts the following options:
  16373. </p>
  16374. <dl compact="compact">
  16375. <dt><samp>threshold</samp></dt>
  16376. <dd><p>Set the luma which will be used as base for transparency.
  16377. Default value is <code>0</code>.
  16378. </p>
  16379. </dd>
  16380. <dt><samp>tolerance</samp></dt>
  16381. <dd><p>Set the range of luma values to be keyed out.
  16382. Default value is <code>0.01</code>.
  16383. </p>
  16384. </dd>
  16385. <dt><samp>softness</samp></dt>
  16386. <dd><p>Set the range of softness. Default value is <code>0</code>.
  16387. Use this to control gradual transition from zero to full transparency.
  16388. </p></dd>
  16389. </dl>
  16390. <a name="Commands-94"></a>
  16391. <h4 class="subsection">11.129.1 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>
  16392. <p>This filter supports same <a href="#commands">commands</a> as options.
  16393. The command accepts the same syntax of the corresponding option.
  16394. </p>
  16395. <p>If the specified expression is not valid, it is kept at its current
  16396. value.
  16397. </p>
  16398. <a name="lut_002c-lutrgb_002c-lutyuv"></a>
  16399. <h3 class="section">11.130 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>
  16400. <p>Compute a look-up table for binding each pixel component input value
  16401. to an output value, and apply it to the input video.
  16402. </p>
  16403. <p><var>lutyuv</var> applies a lookup table to a YUV input video, <var>lutrgb</var>
  16404. to an RGB input video.
  16405. </p>
  16406. <p>These filters accept the following parameters:
  16407. </p><dl compact="compact">
  16408. <dt><samp>c0</samp></dt>
  16409. <dd><p>set first pixel component expression
  16410. </p></dd>
  16411. <dt><samp>c1</samp></dt>
  16412. <dd><p>set second pixel component expression
  16413. </p></dd>
  16414. <dt><samp>c2</samp></dt>
  16415. <dd><p>set third pixel component expression
  16416. </p></dd>
  16417. <dt><samp>c3</samp></dt>
  16418. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  16419. </p>
  16420. </dd>
  16421. <dt><samp>r</samp></dt>
  16422. <dd><p>set red component expression
  16423. </p></dd>
  16424. <dt><samp>g</samp></dt>
  16425. <dd><p>set green component expression
  16426. </p></dd>
  16427. <dt><samp>b</samp></dt>
  16428. <dd><p>set blue component expression
  16429. </p></dd>
  16430. <dt><samp>a</samp></dt>
  16431. <dd><p>alpha component expression
  16432. </p>
  16433. </dd>
  16434. <dt><samp>y</samp></dt>
  16435. <dd><p>set Y/luminance component expression
  16436. </p></dd>
  16437. <dt><samp>u</samp></dt>
  16438. <dd><p>set U/Cb component expression
  16439. </p></dd>
  16440. <dt><samp>v</samp></dt>
  16441. <dd><p>set V/Cr component expression
  16442. </p></dd>
  16443. </dl>
  16444. <p>Each of them specifies the expression to use for computing the lookup table for
  16445. the corresponding pixel component values.
  16446. </p>
  16447. <p>The exact component associated to each of the <var>c*</var> options depends on the
  16448. format in input.
  16449. </p>
  16450. <p>The <var>lut</var> filter requires either YUV or RGB pixel formats in input,
  16451. <var>lutrgb</var> requires RGB pixel formats in input, and <var>lutyuv</var> requires YUV.
  16452. </p>
  16453. <p>The expressions can contain the following constants and functions:
  16454. </p>
  16455. <dl compact="compact">
  16456. <dt><samp>w</samp></dt>
  16457. <dt><samp>h</samp></dt>
  16458. <dd><p>The input width and height.
  16459. </p>
  16460. </dd>
  16461. <dt><samp>val</samp></dt>
  16462. <dd><p>The input value for the pixel component.
  16463. </p>
  16464. </dd>
  16465. <dt><samp>clipval</samp></dt>
  16466. <dd><p>The input value, clipped to the <var>minval</var>-<var>maxval</var> range.
  16467. </p>
  16468. </dd>
  16469. <dt><samp>maxval</samp></dt>
  16470. <dd><p>The maximum value for the pixel component.
  16471. </p>
  16472. </dd>
  16473. <dt><samp>minval</samp></dt>
  16474. <dd><p>The minimum value for the pixel component.
  16475. </p>
  16476. </dd>
  16477. <dt><samp>negval</samp></dt>
  16478. <dd><p>The negated value for the pixel component value, clipped to the
  16479. <var>minval</var>-<var>maxval</var> range; it corresponds to the expression
  16480. &quot;maxval-clipval+minval&quot;.
  16481. </p>
  16482. </dd>
  16483. <dt><samp>clip(val)</samp></dt>
  16484. <dd><p>The computed value in <var>val</var>, clipped to the
  16485. <var>minval</var>-<var>maxval</var> range.
  16486. </p>
  16487. </dd>
  16488. <dt><samp>gammaval(gamma)</samp></dt>
  16489. <dd><p>The computed gamma correction value of the pixel component value,
  16490. clipped to the <var>minval</var>-<var>maxval</var> range. It corresponds to the
  16491. expression
  16492. &quot;pow((clipval-minval)/(maxval-minval)\,<var>gamma</var>)*(maxval-minval)+minval&quot;
  16493. </p>
  16494. </dd>
  16495. </dl>
  16496. <p>All expressions default to &quot;val&quot;.
  16497. </p>
  16498. <a name="Commands-95"></a>
  16499. <h4 class="subsection">11.130.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>
  16500. <p>This filter supports same <a href="#commands">commands</a> as options.
  16501. </p>
  16502. <a name="Examples-81"></a>
  16503. <h4 class="subsection">11.130.2 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>
  16504. <ul>
  16505. <li> Negate input video:
  16506. <div class="example">
  16507. <pre class="example">lutrgb=&quot;r=maxval+minval-val:g=maxval+minval-val:b=maxval+minval-val&quot;
  16508. lutyuv=&quot;y=maxval+minval-val:u=maxval+minval-val:v=maxval+minval-val&quot;
  16509. </pre></div>
  16510. <p>The above is the same as:
  16511. </p><div class="example">
  16512. <pre class="example">lutrgb=&quot;r=negval:g=negval:b=negval&quot;
  16513. lutyuv=&quot;y=negval:u=negval:v=negval&quot;
  16514. </pre></div>
  16515. </li><li> Negate luminance:
  16516. <div class="example">
  16517. <pre class="example">lutyuv=y=negval
  16518. </pre></div>
  16519. </li><li> Remove chroma components, turning the video into a graytone image:
  16520. <div class="example">
  16521. <pre class="example">lutyuv=&quot;u=128:v=128&quot;
  16522. </pre></div>
  16523. </li><li> Apply a luma burning effect:
  16524. <div class="example">
  16525. <pre class="example">lutyuv=&quot;y=2*val&quot;
  16526. </pre></div>
  16527. </li><li> Remove green and blue components:
  16528. <div class="example">
  16529. <pre class="example">lutrgb=&quot;g=0:b=0&quot;
  16530. </pre></div>
  16531. </li><li> Set a constant alpha channel value on input:
  16532. <div class="example">
  16533. <pre class="example">format=rgba,lutrgb=a=&quot;maxval-minval/2&quot;
  16534. </pre></div>
  16535. </li><li> Correct luminance gamma by a factor of 0.5:
  16536. <div class="example">
  16537. <pre class="example">lutyuv=y=gammaval(0.5)
  16538. </pre></div>
  16539. </li><li> Discard least significant bits of luma:
  16540. <div class="example">
  16541. <pre class="example">lutyuv=y='bitand(val, 128+64+32)'
  16542. </pre></div>
  16543. </li><li> Technicolor like effect:
  16544. <div class="example">
  16545. <pre class="example">lutyuv=u='(val-maxval/2)*2+maxval/2':v='(val-maxval/2)*2+maxval/2'
  16546. </pre></div>
  16547. </li></ul>
  16548. <a name="lut2_002c-tlut2"></a>
  16549. <h3 class="section">11.131 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>
  16550. <p>The <code>lut2</code> filter takes two input streams and outputs one
  16551. stream.
  16552. </p>
  16553. <p>The <code>tlut2</code> (time lut2) filter takes two consecutive frames
  16554. from one single stream.
  16555. </p>
  16556. <p>This filter accepts the following parameters:
  16557. </p><dl compact="compact">
  16558. <dt><samp>c0</samp></dt>
  16559. <dd><p>set first pixel component expression
  16560. </p></dd>
  16561. <dt><samp>c1</samp></dt>
  16562. <dd><p>set second pixel component expression
  16563. </p></dd>
  16564. <dt><samp>c2</samp></dt>
  16565. <dd><p>set third pixel component expression
  16566. </p></dd>
  16567. <dt><samp>c3</samp></dt>
  16568. <dd><p>set fourth pixel component expression, corresponds to the alpha component
  16569. </p>
  16570. </dd>
  16571. <dt><samp>d</samp></dt>
  16572. <dd><p>set output bit depth, only available for <code>lut2</code> filter. By default is 0,
  16573. which means bit depth is automatically picked from first input format.
  16574. </p></dd>
  16575. </dl>
  16576. <p>The <code>lut2</code> filter also supports the <a href="#framesync">framesync</a> options.
  16577. </p>
  16578. <p>Each of them specifies the expression to use for computing the lookup table for
  16579. the corresponding pixel component values.
  16580. </p>
  16581. <p>The exact component associated to each of the <var>c*</var> options depends on the
  16582. format in inputs.
  16583. </p>
  16584. <p>The expressions can contain the following constants:
  16585. </p>
  16586. <dl compact="compact">
  16587. <dt><samp>w</samp></dt>
  16588. <dt><samp>h</samp></dt>
  16589. <dd><p>The input width and height.
  16590. </p>
  16591. </dd>
  16592. <dt><samp>x</samp></dt>
  16593. <dd><p>The first input value for the pixel component.
  16594. </p>
  16595. </dd>
  16596. <dt><samp>y</samp></dt>
  16597. <dd><p>The second input value for the pixel component.
  16598. </p>
  16599. </dd>
  16600. <dt><samp>bdx</samp></dt>
  16601. <dd><p>The first input video bit depth.
  16602. </p>
  16603. </dd>
  16604. <dt><samp>bdy</samp></dt>
  16605. <dd><p>The second input video bit depth.
  16606. </p></dd>
  16607. </dl>
  16608. <p>All expressions default to &quot;x&quot;.
  16609. </p>
  16610. <a name="Commands-96"></a>
  16611. <h4 class="subsection">11.131.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>
  16612. <p>This filter supports the all above options as <a href="#commands">commands</a> except option <code>d</code>.
  16613. </p>
  16614. <a name="Examples-82"></a>
  16615. <h4 class="subsection">11.131.2 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>
  16616. <ul>
  16617. <li> Highlight differences between two RGB video streams:
  16618. <div class="example">
  16619. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,0,pow(2,bdx)-1)'
  16620. </pre></div>
  16621. </li><li> Highlight differences between two YUV video streams:
  16622. <div class="example">
  16623. <pre class="example">lut2='ifnot(x-y,0,pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1):ifnot(x-y,pow(2,bdx-1),pow(2,bdx)-1)'
  16624. </pre></div>
  16625. </li><li> Show max difference between two video streams:
  16626. <div class="example">
  16627. <pre class="example">lut2='if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1))):if(lt(x,y),0,if(gt(x,y),pow(2,bdx)-1,pow(2,bdx-1)))'
  16628. </pre></div>
  16629. </li></ul>
  16630. <a name="maskedclamp"></a>
  16631. <h3 class="section">11.132 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>
  16632. <p>Clamp the first input stream with the second input and third input stream.
  16633. </p>
  16634. <p>Returns the value of first stream to be between second input
  16635. stream - <code>undershoot</code> and third input stream + <code>overshoot</code>.
  16636. </p>
  16637. <p>This filter accepts the following options:
  16638. </p><dl compact="compact">
  16639. <dt><samp>undershoot</samp></dt>
  16640. <dd><p>Default value is <code>0</code>.
  16641. </p>
  16642. </dd>
  16643. <dt><samp>overshoot</samp></dt>
  16644. <dd><p>Default value is <code>0</code>.
  16645. </p>
  16646. </dd>
  16647. <dt><samp>planes</samp></dt>
  16648. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  16649. copied from first stream.
  16650. By default value 0xf, all planes will be processed.
  16651. </p></dd>
  16652. </dl>
  16653. <a name="Commands-97"></a>
  16654. <h4 class="subsection">11.132.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>
  16655. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16656. </p>
  16657. <a name="maskedmax"></a>
  16658. <h3 class="section">11.133 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>
  16659. <p>Merge the second and third input stream into output stream using absolute differences
  16660. between second input stream and first input stream and absolute difference between
  16661. third input stream and first input stream. The picked value will be from second input
  16662. stream if second absolute difference is greater than first one or from third input stream
  16663. otherwise.
  16664. </p>
  16665. <p>This filter accepts the following options:
  16666. </p><dl compact="compact">
  16667. <dt><samp>planes</samp></dt>
  16668. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  16669. copied from first stream.
  16670. By default value 0xf, all planes will be processed.
  16671. </p></dd>
  16672. </dl>
  16673. <a name="Commands-98"></a>
  16674. <h4 class="subsection">11.133.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>
  16675. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16676. </p>
  16677. <a name="maskedmerge"></a>
  16678. <h3 class="section">11.134 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>
  16679. <p>Merge the first input stream with the second input stream using per pixel
  16680. weights in the third input stream.
  16681. </p>
  16682. <p>A value of 0 in the third stream pixel component means that pixel component
  16683. from first stream is returned unchanged, while maximum value (eg. 255 for
  16684. 8-bit videos) means that pixel component from second stream is returned
  16685. unchanged. Intermediate values define the amount of merging between both
  16686. input stream&rsquo;s pixel components.
  16687. </p>
  16688. <p>This filter accepts the following options:
  16689. </p><dl compact="compact">
  16690. <dt><samp>planes</samp></dt>
  16691. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  16692. copied from first stream.
  16693. By default value 0xf, all planes will be processed.
  16694. </p></dd>
  16695. </dl>
  16696. <a name="Commands-99"></a>
  16697. <h4 class="subsection">11.134.1 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>
  16698. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16699. </p>
  16700. <a name="maskedmin"></a>
  16701. <h3 class="section">11.135 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>
  16702. <p>Merge the second and third input stream into output stream using absolute differences
  16703. between second input stream and first input stream and absolute difference between
  16704. third input stream and first input stream. The picked value will be from second input
  16705. stream if second absolute difference is less than first one or from third input stream
  16706. otherwise.
  16707. </p>
  16708. <p>This filter accepts the following options:
  16709. </p><dl compact="compact">
  16710. <dt><samp>planes</samp></dt>
  16711. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  16712. copied from first stream.
  16713. By default value 0xf, all planes will be processed.
  16714. </p></dd>
  16715. </dl>
  16716. <a name="Commands-100"></a>
  16717. <h4 class="subsection">11.135.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>
  16718. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16719. </p>
  16720. <a name="maskedthreshold"></a>
  16721. <h3 class="section">11.136 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>
  16722. <p>Pick pixels comparing absolute difference of two video streams with fixed
  16723. threshold.
  16724. </p>
  16725. <p>If absolute difference between pixel component of first and second video
  16726. stream is equal or lower than user supplied threshold than pixel component
  16727. from first video stream is picked, otherwise pixel component from second
  16728. video stream is picked.
  16729. </p>
  16730. <p>This filter accepts the following options:
  16731. </p><dl compact="compact">
  16732. <dt><samp>threshold</samp></dt>
  16733. <dd><p>Set threshold used when picking pixels from absolute difference from two input
  16734. video streams.
  16735. </p>
  16736. </dd>
  16737. <dt><samp>planes</samp></dt>
  16738. <dd><p>Set which planes will be processed as bitmap, unprocessed planes will be
  16739. copied from second stream.
  16740. By default value 0xf, all planes will be processed.
  16741. </p></dd>
  16742. </dl>
  16743. <a name="Commands-101"></a>
  16744. <h4 class="subsection">11.136.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>
  16745. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16746. </p>
  16747. <a name="maskfun"></a>
  16748. <h3 class="section">11.137 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>
  16749. <p>Create mask from input video.
  16750. </p>
  16751. <p>For example it is useful to create motion masks after <code>tblend</code> filter.
  16752. </p>
  16753. <p>This filter accepts the following options:
  16754. </p>
  16755. <dl compact="compact">
  16756. <dt><samp>low</samp></dt>
  16757. <dd><p>Set low threshold. Any pixel component lower or exact than this value will be set to 0.
  16758. </p>
  16759. </dd>
  16760. <dt><samp>high</samp></dt>
  16761. <dd><p>Set high threshold. Any pixel component higher than this value will be set to max value
  16762. allowed for current pixel format.
  16763. </p>
  16764. </dd>
  16765. <dt><samp>planes</samp></dt>
  16766. <dd><p>Set planes to filter, by default all available planes are filtered.
  16767. </p>
  16768. </dd>
  16769. <dt><samp>fill</samp></dt>
  16770. <dd><p>Fill all frame pixels with this value.
  16771. </p>
  16772. </dd>
  16773. <dt><samp>sum</samp></dt>
  16774. <dd><p>Set max average pixel value for frame. If sum of all pixel components is higher that this
  16775. average, output frame will be completely filled with value set by <var>fill</var> option.
  16776. Typically useful for scene changes when used in combination with <code>tblend</code> filter.
  16777. </p></dd>
  16778. </dl>
  16779. <a name="Commands-102"></a>
  16780. <h4 class="subsection">11.137.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>
  16781. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  16782. </p>
  16783. <a name="mcdeint"></a>
  16784. <h3 class="section">11.138 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>
  16785. <p>Apply motion-compensation deinterlacing.
  16786. </p>
  16787. <p>It needs one field per frame as input and must thus be used together
  16788. with yadif=1/3 or equivalent.
  16789. </p>
  16790. <p>This filter accepts the following options:
  16791. </p><dl compact="compact">
  16792. <dt><samp>mode</samp></dt>
  16793. <dd><p>Set the deinterlacing mode.
  16794. </p>
  16795. <p>It accepts one of the following values:
  16796. </p><dl compact="compact">
  16797. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  16798. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  16799. <dt>&lsquo;<samp>slow</samp>&rsquo;</dt>
  16800. <dd><p>use iterative motion estimation
  16801. </p></dd>
  16802. <dt>&lsquo;<samp>extra_slow</samp>&rsquo;</dt>
  16803. <dd><p>like &lsquo;<samp>slow</samp>&rsquo;, but use multiple reference frames.
  16804. </p></dd>
  16805. </dl>
  16806. <p>Default value is &lsquo;<samp>fast</samp>&rsquo;.
  16807. </p>
  16808. </dd>
  16809. <dt><samp>parity</samp></dt>
  16810. <dd><p>Set the picture field parity assumed for the input video. It must be
  16811. one of the following values:
  16812. </p>
  16813. <dl compact="compact">
  16814. <dt>&lsquo;<samp>0, tff</samp>&rsquo;</dt>
  16815. <dd><p>assume top field first
  16816. </p></dd>
  16817. <dt>&lsquo;<samp>1, bff</samp>&rsquo;</dt>
  16818. <dd><p>assume bottom field first
  16819. </p></dd>
  16820. </dl>
  16821. <p>Default value is &lsquo;<samp>bff</samp>&rsquo;.
  16822. </p>
  16823. </dd>
  16824. <dt><samp>qp</samp></dt>
  16825. <dd><p>Set per-block quantization parameter (QP) used by the internal
  16826. encoder.
  16827. </p>
  16828. <p>Higher values should result in a smoother motion vector field but less
  16829. optimal individual vectors. Default value is 1.
  16830. </p></dd>
  16831. </dl>
  16832. <a name="median"></a>
  16833. <h3 class="section">11.139 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>
  16834. <p>Pick median pixel from certain rectangle defined by radius.
  16835. </p>
  16836. <p>This filter accepts the following options:
  16837. </p>
  16838. <dl compact="compact">
  16839. <dt><samp>radius</samp></dt>
  16840. <dd><p>Set horizontal radius size. Default value is <code>1</code>.
  16841. Allowed range is integer from 1 to 127.
  16842. </p>
  16843. </dd>
  16844. <dt><samp>planes</samp></dt>
  16845. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  16846. </p>
  16847. </dd>
  16848. <dt><samp>radiusV</samp></dt>
  16849. <dd><p>Set vertical radius size. Default value is <code>0</code>.
  16850. Allowed range is integer from 0 to 127.
  16851. If it is 0, value will be picked from horizontal <code>radius</code> option.
  16852. </p>
  16853. </dd>
  16854. <dt><samp>percentile</samp></dt>
  16855. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  16856. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  16857. minimum values, and <code>1</code> maximum values.
  16858. </p></dd>
  16859. </dl>
  16860. <a name="Commands-103"></a>
  16861. <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>
  16862. <p>This filter supports same <a href="#commands">commands</a> as options.
  16863. The command accepts the same syntax of the corresponding option.
  16864. </p>
  16865. <p>If the specified expression is not valid, it is kept at its current
  16866. value.
  16867. </p>
  16868. <a name="mergeplanes"></a>
  16869. <h3 class="section">11.140 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>
  16870. <p>Merge color channel components from several video streams.
  16871. </p>
  16872. <p>The filter accepts up to 4 input streams, and merge selected input
  16873. planes to the output video.
  16874. </p>
  16875. <p>This filter accepts the following options:
  16876. </p><dl compact="compact">
  16877. <dt><samp>mapping</samp></dt>
  16878. <dd><p>Set input to output plane mapping. Default is <code>0</code>.
  16879. </p>
  16880. <p>The mappings is specified as a bitmap. It should be specified as a
  16881. hexadecimal number in the form 0xAa[Bb[Cc[Dd]]]. &rsquo;Aa&rsquo; describes the
  16882. mapping for the first plane of the output stream. &rsquo;A&rsquo; sets the number of
  16883. the input stream to use (from 0 to 3), and &rsquo;a&rsquo; the plane number of the
  16884. corresponding input to use (from 0 to 3). The rest of the mappings is
  16885. similar, &rsquo;Bb&rsquo; describes the mapping for the output stream second
  16886. plane, &rsquo;Cc&rsquo; describes the mapping for the output stream third plane and
  16887. &rsquo;Dd&rsquo; describes the mapping for the output stream fourth plane.
  16888. </p>
  16889. </dd>
  16890. <dt><samp>format</samp></dt>
  16891. <dd><p>Set output pixel format. Default is <code>yuva444p</code>.
  16892. </p></dd>
  16893. </dl>
  16894. <a name="Examples-83"></a>
  16895. <h4 class="subsection">11.140.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>
  16896. <ul>
  16897. <li> Merge three gray video streams of same width and height into single video stream:
  16898. <div class="example">
  16899. <pre class="example">[a0][a1][a2]mergeplanes=0x001020:yuv444p
  16900. </pre></div>
  16901. </li><li> Merge 1st yuv444p stream and 2nd gray video stream into yuva444p video stream:
  16902. <div class="example">
  16903. <pre class="example">[a0][a1]mergeplanes=0x00010210:yuva444p
  16904. </pre></div>
  16905. </li><li> Swap Y and A plane in yuva444p stream:
  16906. <div class="example">
  16907. <pre class="example">format=yuva444p,mergeplanes=0x03010200:yuva444p
  16908. </pre></div>
  16909. </li><li> Swap U and V plane in yuv420p stream:
  16910. <div class="example">
  16911. <pre class="example">format=yuv420p,mergeplanes=0x000201:yuv420p
  16912. </pre></div>
  16913. </li><li> Cast a rgb24 clip to yuv444p:
  16914. <div class="example">
  16915. <pre class="example">format=rgb24,mergeplanes=0x000102:yuv444p
  16916. </pre></div>
  16917. </li></ul>
  16918. <a name="mestimate"></a>
  16919. <h3 class="section">11.141 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>
  16920. <p>Estimate and export motion vectors using block matching algorithms.
  16921. Motion vectors are stored in frame side data to be used by other filters.
  16922. </p>
  16923. <p>This filter accepts the following options:
  16924. </p><dl compact="compact">
  16925. <dt><samp>method</samp></dt>
  16926. <dd><p>Specify the motion estimation method. Accepts one of the following values:
  16927. </p>
  16928. <dl compact="compact">
  16929. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  16930. <dd><p>Exhaustive search algorithm.
  16931. </p></dd>
  16932. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  16933. <dd><p>Three step search algorithm.
  16934. </p></dd>
  16935. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  16936. <dd><p>Two dimensional logarithmic search algorithm.
  16937. </p></dd>
  16938. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  16939. <dd><p>New three step search algorithm.
  16940. </p></dd>
  16941. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  16942. <dd><p>Four step search algorithm.
  16943. </p></dd>
  16944. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  16945. <dd><p>Diamond search algorithm.
  16946. </p></dd>
  16947. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  16948. <dd><p>Hexagon-based search algorithm.
  16949. </p></dd>
  16950. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  16951. <dd><p>Enhanced predictive zonal search algorithm.
  16952. </p></dd>
  16953. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  16954. <dd><p>Uneven multi-hexagon search algorithm.
  16955. </p></dd>
  16956. </dl>
  16957. <p>Default value is &lsquo;<samp>esa</samp>&rsquo;.
  16958. </p>
  16959. </dd>
  16960. <dt><samp>mb_size</samp></dt>
  16961. <dd><p>Macroblock size. Default <code>16</code>.
  16962. </p>
  16963. </dd>
  16964. <dt><samp>search_param</samp></dt>
  16965. <dd><p>Search parameter. Default <code>7</code>.
  16966. </p></dd>
  16967. </dl>
  16968. <a name="midequalizer"></a>
  16969. <h3 class="section">11.142 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>
  16970. <p>Apply Midway Image Equalization effect using two video streams.
  16971. </p>
  16972. <p>Midway Image Equalization adjusts a pair of images to have the same
  16973. histogram, while maintaining their dynamics as much as possible. It&rsquo;s
  16974. useful for e.g. matching exposures from a pair of stereo cameras.
  16975. </p>
  16976. <p>This filter has two inputs and one output, which must be of same pixel format, but
  16977. may be of different sizes. The output of filter is first input adjusted with
  16978. midway histogram of both inputs.
  16979. </p>
  16980. <p>This filter accepts the following option:
  16981. </p>
  16982. <dl compact="compact">
  16983. <dt><samp>planes</samp></dt>
  16984. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  16985. </p></dd>
  16986. </dl>
  16987. <a name="minterpolate"></a>
  16988. <h3 class="section">11.143 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>
  16989. <p>Convert the video to specified frame rate using motion interpolation.
  16990. </p>
  16991. <p>This filter accepts the following options:
  16992. </p><dl compact="compact">
  16993. <dt><samp>fps</samp></dt>
  16994. <dd><p>Specify the output frame rate. This can be rational e.g. <code>60000/1001</code>. Frames are dropped if <var>fps</var> is lower than source fps. Default <code>60</code>.
  16995. </p>
  16996. </dd>
  16997. <dt><samp>mi_mode</samp></dt>
  16998. <dd><p>Motion interpolation mode. Following values are accepted:
  16999. </p><dl compact="compact">
  17000. <dt>&lsquo;<samp>dup</samp>&rsquo;</dt>
  17001. <dd><p>Duplicate previous or next frame for interpolating new ones.
  17002. </p></dd>
  17003. <dt>&lsquo;<samp>blend</samp>&rsquo;</dt>
  17004. <dd><p>Blend source frames. Interpolated frame is mean of previous and next frames.
  17005. </p></dd>
  17006. <dt>&lsquo;<samp>mci</samp>&rsquo;</dt>
  17007. <dd><p>Motion compensated interpolation. Following options are effective when this mode is selected:
  17008. </p>
  17009. <dl compact="compact">
  17010. <dt>&lsquo;<samp>mc_mode</samp>&rsquo;</dt>
  17011. <dd><p>Motion compensation mode. Following values are accepted:
  17012. </p><dl compact="compact">
  17013. <dt>&lsquo;<samp>obmc</samp>&rsquo;</dt>
  17014. <dd><p>Overlapped block motion compensation.
  17015. </p></dd>
  17016. <dt>&lsquo;<samp>aobmc</samp>&rsquo;</dt>
  17017. <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.
  17018. </p></dd>
  17019. </dl>
  17020. <p>Default mode is &lsquo;<samp>obmc</samp>&rsquo;.
  17021. </p>
  17022. </dd>
  17023. <dt>&lsquo;<samp>me_mode</samp>&rsquo;</dt>
  17024. <dd><p>Motion estimation mode. Following values are accepted:
  17025. </p><dl compact="compact">
  17026. <dt>&lsquo;<samp>bidir</samp>&rsquo;</dt>
  17027. <dd><p>Bidirectional motion estimation. Motion vectors are estimated for each source frame in both forward and backward directions.
  17028. </p></dd>
  17029. <dt>&lsquo;<samp>bilat</samp>&rsquo;</dt>
  17030. <dd><p>Bilateral motion estimation. Motion vectors are estimated directly for interpolated frame.
  17031. </p></dd>
  17032. </dl>
  17033. <p>Default mode is &lsquo;<samp>bilat</samp>&rsquo;.
  17034. </p>
  17035. </dd>
  17036. <dt>&lsquo;<samp>me</samp>&rsquo;</dt>
  17037. <dd><p>The algorithm to be used for motion estimation. Following values are accepted:
  17038. </p><dl compact="compact">
  17039. <dt>&lsquo;<samp>esa</samp>&rsquo;</dt>
  17040. <dd><p>Exhaustive search algorithm.
  17041. </p></dd>
  17042. <dt>&lsquo;<samp>tss</samp>&rsquo;</dt>
  17043. <dd><p>Three step search algorithm.
  17044. </p></dd>
  17045. <dt>&lsquo;<samp>tdls</samp>&rsquo;</dt>
  17046. <dd><p>Two dimensional logarithmic search algorithm.
  17047. </p></dd>
  17048. <dt>&lsquo;<samp>ntss</samp>&rsquo;</dt>
  17049. <dd><p>New three step search algorithm.
  17050. </p></dd>
  17051. <dt>&lsquo;<samp>fss</samp>&rsquo;</dt>
  17052. <dd><p>Four step search algorithm.
  17053. </p></dd>
  17054. <dt>&lsquo;<samp>ds</samp>&rsquo;</dt>
  17055. <dd><p>Diamond search algorithm.
  17056. </p></dd>
  17057. <dt>&lsquo;<samp>hexbs</samp>&rsquo;</dt>
  17058. <dd><p>Hexagon-based search algorithm.
  17059. </p></dd>
  17060. <dt>&lsquo;<samp>epzs</samp>&rsquo;</dt>
  17061. <dd><p>Enhanced predictive zonal search algorithm.
  17062. </p></dd>
  17063. <dt>&lsquo;<samp>umh</samp>&rsquo;</dt>
  17064. <dd><p>Uneven multi-hexagon search algorithm.
  17065. </p></dd>
  17066. </dl>
  17067. <p>Default algorithm is &lsquo;<samp>epzs</samp>&rsquo;.
  17068. </p>
  17069. </dd>
  17070. <dt>&lsquo;<samp>mb_size</samp>&rsquo;</dt>
  17071. <dd><p>Macroblock size. Default <code>16</code>.
  17072. </p>
  17073. </dd>
  17074. <dt>&lsquo;<samp>search_param</samp>&rsquo;</dt>
  17075. <dd><p>Motion estimation search parameter. Default <code>32</code>.
  17076. </p>
  17077. </dd>
  17078. <dt>&lsquo;<samp>vsbmc</samp>&rsquo;</dt>
  17079. <dd><p>Enable variable-size block motion compensation. Motion estimation is applied with smaller block sizes at object boundaries in order to make the them less blur. Default is <code>0</code> (disabled).
  17080. </p></dd>
  17081. </dl>
  17082. </dd>
  17083. </dl>
  17084. </dd>
  17085. <dt><samp>scd</samp></dt>
  17086. <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:
  17087. </p><dl compact="compact">
  17088. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  17089. <dd><p>Disable scene change detection.
  17090. </p></dd>
  17091. <dt>&lsquo;<samp>fdiff</samp>&rsquo;</dt>
  17092. <dd><p>Frame difference. Corresponding pixel values are compared and if it satisfies <var>scd_threshold</var> scene change is detected.
  17093. </p></dd>
  17094. </dl>
  17095. <p>Default method is &lsquo;<samp>fdiff</samp>&rsquo;.
  17096. </p>
  17097. </dd>
  17098. <dt><samp>scd_threshold</samp></dt>
  17099. <dd><p>Scene change detection threshold. Default is <code>10.</code>.
  17100. </p></dd>
  17101. </dl>
  17102. <a name="mix"></a>
  17103. <h3 class="section">11.144 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>
  17104. <p>Mix several video input streams into one video stream.
  17105. </p>
  17106. <p>A description of the accepted options follows.
  17107. </p>
  17108. <dl compact="compact">
  17109. <dt><samp>nb_inputs</samp></dt>
  17110. <dd><p>The number of inputs. If unspecified, it defaults to 2.
  17111. </p>
  17112. </dd>
  17113. <dt><samp>weights</samp></dt>
  17114. <dd><p>Specify weight of each input video stream as sequence.
  17115. Each weight is separated by space. If number of weights
  17116. is smaller than number of <var>frames</var> last specified
  17117. weight will be used for all remaining unset weights.
  17118. </p>
  17119. </dd>
  17120. <dt><samp>scale</samp></dt>
  17121. <dd><p>Specify scale, if it is set it will be multiplied with sum
  17122. of each weight multiplied with pixel values to give final destination
  17123. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  17124. </p>
  17125. </dd>
  17126. <dt><samp>duration</samp></dt>
  17127. <dd><p>Specify how end of stream is determined.
  17128. </p><dl compact="compact">
  17129. <dt>&lsquo;<samp>longest</samp>&rsquo;</dt>
  17130. <dd><p>The duration of the longest input. (default)
  17131. </p>
  17132. </dd>
  17133. <dt>&lsquo;<samp>shortest</samp>&rsquo;</dt>
  17134. <dd><p>The duration of the shortest input.
  17135. </p>
  17136. </dd>
  17137. <dt>&lsquo;<samp>first</samp>&rsquo;</dt>
  17138. <dd><p>The duration of the first input.
  17139. </p></dd>
  17140. </dl>
  17141. </dd>
  17142. </dl>
  17143. <a name="Commands-104"></a>
  17144. <h4 class="subsection">11.144.1 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>
  17145. <p>This filter supports the following commands:
  17146. </p><dl compact="compact">
  17147. <dt><samp>weights</samp></dt>
  17148. <dt><samp>scale</samp></dt>
  17149. <dd><p>Syntax is same as option with same name.
  17150. </p></dd>
  17151. </dl>
  17152. <a name="monochrome"></a>
  17153. <h3 class="section">11.145 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>
  17154. <p>Convert video to gray using custom color filter.
  17155. </p>
  17156. <p>A description of the accepted options follows.
  17157. </p>
  17158. <dl compact="compact">
  17159. <dt><samp>cb</samp></dt>
  17160. <dd><p>Set the chroma blue spot. Allowed range is from -1 to 1.
  17161. Default value is 0.
  17162. </p>
  17163. </dd>
  17164. <dt><samp>cr</samp></dt>
  17165. <dd><p>Set the chroma red spot. Allowed range is from -1 to 1.
  17166. Default value is 0.
  17167. </p>
  17168. </dd>
  17169. <dt><samp>size</samp></dt>
  17170. <dd><p>Set the color filter size. Allowed range is from .1 to 10.
  17171. Default value is 1.
  17172. </p>
  17173. </dd>
  17174. <dt><samp>high</samp></dt>
  17175. <dd><p>Set the highlights strength. Allowed range is from 0 to 1.
  17176. Default value is 0.
  17177. </p></dd>
  17178. </dl>
  17179. <a name="Commands-105"></a>
  17180. <h4 class="subsection">11.145.1 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>
  17181. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  17182. </p>
  17183. <a name="mpdecimate"></a>
  17184. <h3 class="section">11.146 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>
  17185. <p>Drop frames that do not differ greatly from the previous frame in
  17186. order to reduce frame rate.
  17187. </p>
  17188. <p>The main use of this filter is for very-low-bitrate encoding
  17189. (e.g. streaming over dialup modem), but it could in theory be used for
  17190. fixing movies that were inverse-telecined incorrectly.
  17191. </p>
  17192. <p>A description of the accepted options follows.
  17193. </p>
  17194. <dl compact="compact">
  17195. <dt><samp>max</samp></dt>
  17196. <dd><p>Set the maximum number of consecutive frames which can be dropped (if
  17197. positive), or the minimum interval between dropped frames (if
  17198. negative). If the value is 0, the frame is dropped disregarding the
  17199. number of previous sequentially dropped frames.
  17200. </p>
  17201. <p>Default value is 0.
  17202. </p>
  17203. </dd>
  17204. <dt><samp>hi</samp></dt>
  17205. <dt><samp>lo</samp></dt>
  17206. <dt><samp>frac</samp></dt>
  17207. <dd><p>Set the dropping threshold values.
  17208. </p>
  17209. <p>Values for <samp>hi</samp> and <samp>lo</samp> are for 8x8 pixel blocks and
  17210. represent actual pixel value differences, so a threshold of 64
  17211. corresponds to 1 unit of difference for each pixel, or the same spread
  17212. out differently over the block.
  17213. </p>
  17214. <p>A frame is a candidate for dropping if no 8x8 blocks differ by more
  17215. than a threshold of <samp>hi</samp>, and if no more than <samp>frac</samp> blocks (1
  17216. meaning the whole image) differ by more than a threshold of <samp>lo</samp>.
  17217. </p>
  17218. <p>Default value for <samp>hi</samp> is 64*12, default value for <samp>lo</samp> is
  17219. 64*5, and default value for <samp>frac</samp> is 0.33.
  17220. </p></dd>
  17221. </dl>
  17222. <a name="msad"></a>
  17223. <h3 class="section">11.147 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>
  17224. <p>Obtain the MSAD (Mean Sum of Absolute Differences) between two input videos.
  17225. </p>
  17226. <p>This filter takes two input videos.
  17227. </p>
  17228. <p>Both input videos must have the same resolution and pixel format for
  17229. this filter to work correctly. Also it assumes that both inputs
  17230. have the same number of frames, which are compared one by one.
  17231. </p>
  17232. <p>The obtained per component, average, min and max MSAD is printed through
  17233. the logging system.
  17234. </p>
  17235. <p>The filter stores the calculated MSAD of each frame in frame metadata.
  17236. </p>
  17237. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  17238. with the reference file <samp>ref.mpg</samp>.
  17239. </p>
  17240. <div class="example">
  17241. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi msad -f null -
  17242. </pre></div>
  17243. <a name="negate"></a>
  17244. <h3 class="section">11.148 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>
  17245. <p>Negate (invert) the input video.
  17246. </p>
  17247. <p>It accepts the following option:
  17248. </p>
  17249. <dl compact="compact">
  17250. <dt><samp>negate_alpha</samp></dt>
  17251. <dd><p>With value 1, it negates the alpha component, if present. Default value is 0.
  17252. </p></dd>
  17253. </dl>
  17254. <a name="Commands-106"></a>
  17255. <h4 class="subsection">11.148.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>
  17256. <p>This filter supports same <a href="#commands">commands</a> as options.
  17257. </p>
  17258. <span id="nlmeans"></span><a name="nlmeans-1"></a>
  17259. <h3 class="section">11.149 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>
  17260. <p>Denoise frames using Non-Local Means algorithm.
  17261. </p>
  17262. <p>Each pixel is adjusted by looking for other pixels with similar contexts. This
  17263. context similarity is defined by comparing their surrounding patches of size
  17264. <samp>p</samp>x<samp>p</samp>. Patches are searched in an area of <samp>r</samp>x<samp>r</samp>
  17265. around the pixel.
  17266. </p>
  17267. <p>Note that the research area defines centers for patches, which means some
  17268. patches will be made of pixels outside that research area.
  17269. </p>
  17270. <p>The filter accepts the following options.
  17271. </p>
  17272. <dl compact="compact">
  17273. <dt><samp>s</samp></dt>
  17274. <dd><p>Set denoising strength. Default is 1.0. Must be in range [1.0, 30.0].
  17275. </p>
  17276. </dd>
  17277. <dt><samp>p</samp></dt>
  17278. <dd><p>Set patch size. Default is 7. Must be odd number in range [0, 99].
  17279. </p>
  17280. </dd>
  17281. <dt><samp>pc</samp></dt>
  17282. <dd><p>Same as <samp>p</samp> but for chroma planes.
  17283. </p>
  17284. <p>The default value is <var>0</var> and means automatic.
  17285. </p>
  17286. </dd>
  17287. <dt><samp>r</samp></dt>
  17288. <dd><p>Set research size. Default is 15. Must be odd number in range [0, 99].
  17289. </p>
  17290. </dd>
  17291. <dt><samp>rc</samp></dt>
  17292. <dd><p>Same as <samp>r</samp> but for chroma planes.
  17293. </p>
  17294. <p>The default value is <var>0</var> and means automatic.
  17295. </p></dd>
  17296. </dl>
  17297. <a name="nnedi"></a>
  17298. <h3 class="section">11.150 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>
  17299. <p>Deinterlace video using neural network edge directed interpolation.
  17300. </p>
  17301. <p>This filter accepts the following options:
  17302. </p>
  17303. <dl compact="compact">
  17304. <dt><samp>weights</samp></dt>
  17305. <dd><p>Mandatory option, without binary file filter can not work.
  17306. Currently file can be found here:
  17307. https://github.com/dubhater/vapoursynth-nnedi3/blob/master/src/nnedi3_weights.bin
  17308. </p>
  17309. </dd>
  17310. <dt><samp>deint</samp></dt>
  17311. <dd><p>Set which frames to deinterlace, by default it is <code>all</code>.
  17312. Can be <code>all</code> or <code>interlaced</code>.
  17313. </p>
  17314. </dd>
  17315. <dt><samp>field</samp></dt>
  17316. <dd><p>Set mode of operation.
  17317. </p>
  17318. <p>Can be one of the following:
  17319. </p>
  17320. <dl compact="compact">
  17321. <dt>&lsquo;<samp>af</samp>&rsquo;</dt>
  17322. <dd><p>Use frame flags, both fields.
  17323. </p></dd>
  17324. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  17325. <dd><p>Use frame flags, single field.
  17326. </p></dd>
  17327. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  17328. <dd><p>Use top field only.
  17329. </p></dd>
  17330. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  17331. <dd><p>Use bottom field only.
  17332. </p></dd>
  17333. <dt>&lsquo;<samp>tf</samp>&rsquo;</dt>
  17334. <dd><p>Use both fields, top first.
  17335. </p></dd>
  17336. <dt>&lsquo;<samp>bf</samp>&rsquo;</dt>
  17337. <dd><p>Use both fields, bottom first.
  17338. </p></dd>
  17339. </dl>
  17340. </dd>
  17341. <dt><samp>planes</samp></dt>
  17342. <dd><p>Set which planes to process, by default filter process all frames.
  17343. </p>
  17344. </dd>
  17345. <dt><samp>nsize</samp></dt>
  17346. <dd><p>Set size of local neighborhood around each pixel, used by the predictor neural
  17347. network.
  17348. </p>
  17349. <p>Can be one of the following:
  17350. </p>
  17351. <dl compact="compact">
  17352. <dt>&lsquo;<samp>s8x6</samp>&rsquo;</dt>
  17353. <dt>&lsquo;<samp>s16x6</samp>&rsquo;</dt>
  17354. <dt>&lsquo;<samp>s32x6</samp>&rsquo;</dt>
  17355. <dt>&lsquo;<samp>s48x6</samp>&rsquo;</dt>
  17356. <dt>&lsquo;<samp>s8x4</samp>&rsquo;</dt>
  17357. <dt>&lsquo;<samp>s16x4</samp>&rsquo;</dt>
  17358. <dt>&lsquo;<samp>s32x4</samp>&rsquo;</dt>
  17359. </dl>
  17360. </dd>
  17361. <dt><samp>nns</samp></dt>
  17362. <dd><p>Set the number of neurons in predictor neural network.
  17363. Can be one of the following:
  17364. </p>
  17365. <dl compact="compact">
  17366. <dt>&lsquo;<samp>n16</samp>&rsquo;</dt>
  17367. <dt>&lsquo;<samp>n32</samp>&rsquo;</dt>
  17368. <dt>&lsquo;<samp>n64</samp>&rsquo;</dt>
  17369. <dt>&lsquo;<samp>n128</samp>&rsquo;</dt>
  17370. <dt>&lsquo;<samp>n256</samp>&rsquo;</dt>
  17371. </dl>
  17372. </dd>
  17373. <dt><samp>qual</samp></dt>
  17374. <dd><p>Controls the number of different neural network predictions that are blended
  17375. together to compute the final output value. Can be <code>fast</code>, default or
  17376. <code>slow</code>.
  17377. </p>
  17378. </dd>
  17379. <dt><samp>etype</samp></dt>
  17380. <dd><p>Set which set of weights to use in the predictor.
  17381. Can be one of the following:
  17382. </p>
  17383. <dl compact="compact">
  17384. <dt>&lsquo;<samp>a, abs</samp>&rsquo;</dt>
  17385. <dd><p>weights trained to minimize absolute error
  17386. </p></dd>
  17387. <dt>&lsquo;<samp>s, mse</samp>&rsquo;</dt>
  17388. <dd><p>weights trained to minimize squared error
  17389. </p></dd>
  17390. </dl>
  17391. </dd>
  17392. <dt><samp>pscrn</samp></dt>
  17393. <dd><p>Controls whether or not the prescreener neural network is used to decide
  17394. which pixels should be processed by the predictor neural network and which
  17395. can be handled by simple cubic interpolation.
  17396. The prescreener is trained to know whether cubic interpolation will be
  17397. sufficient for a pixel or whether it should be predicted by the predictor nn.
  17398. The computational complexity of the prescreener nn is much less than that of
  17399. the predictor nn. Since most pixels can be handled by cubic interpolation,
  17400. using the prescreener generally results in much faster processing.
  17401. The prescreener is pretty accurate, so the difference between using it and not
  17402. using it is almost always unnoticeable.
  17403. </p>
  17404. <p>Can be one of the following:
  17405. </p>
  17406. <dl compact="compact">
  17407. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  17408. <dt>&lsquo;<samp>original</samp>&rsquo;</dt>
  17409. <dt>&lsquo;<samp>new</samp>&rsquo;</dt>
  17410. <dt>&lsquo;<samp>new2</samp>&rsquo;</dt>
  17411. <dt>&lsquo;<samp>new3</samp>&rsquo;</dt>
  17412. </dl>
  17413. <p>Default is <code>new</code>.
  17414. </p></dd>
  17415. </dl>
  17416. <a name="Commands-107"></a>
  17417. <h4 class="subsection">11.150.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>
  17418. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>weights</var> option.
  17419. </p>
  17420. <a name="noformat"></a>
  17421. <h3 class="section">11.151 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>
  17422. <p>Force libavfilter not to use any of the specified pixel formats for the
  17423. input to the next filter.
  17424. </p>
  17425. <p>It accepts the following parameters:
  17426. </p><dl compact="compact">
  17427. <dt><samp>pix_fmts</samp></dt>
  17428. <dd><p>A &rsquo;|&rsquo;-separated list of pixel format names, such as
  17429. pix_fmts=yuv420p|monow|rgb24&quot;.
  17430. </p>
  17431. </dd>
  17432. </dl>
  17433. <a name="Examples-84"></a>
  17434. <h4 class="subsection">11.151.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>
  17435. <ul>
  17436. <li> Force libavfilter to use a format different from <var>yuv420p</var> for the
  17437. input to the vflip filter:
  17438. <div class="example">
  17439. <pre class="example">noformat=pix_fmts=yuv420p,vflip
  17440. </pre></div>
  17441. </li><li> Convert the input video to any of the formats not contained in the list:
  17442. <div class="example">
  17443. <pre class="example">noformat=yuv420p|yuv444p|yuv410p
  17444. </pre></div>
  17445. </li></ul>
  17446. <a name="noise"></a>
  17447. <h3 class="section">11.152 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>
  17448. <p>Add noise on video input frame.
  17449. </p>
  17450. <p>The filter accepts the following options:
  17451. </p>
  17452. <dl compact="compact">
  17453. <dt><samp>all_seed</samp></dt>
  17454. <dt><samp>c0_seed</samp></dt>
  17455. <dt><samp>c1_seed</samp></dt>
  17456. <dt><samp>c2_seed</samp></dt>
  17457. <dt><samp>c3_seed</samp></dt>
  17458. <dd><p>Set noise seed for specific pixel component or all pixel components in case
  17459. of <var>all_seed</var>. Default value is <code>123457</code>.
  17460. </p>
  17461. </dd>
  17462. <dt><samp>all_strength, alls</samp></dt>
  17463. <dt><samp>c0_strength, c0s</samp></dt>
  17464. <dt><samp>c1_strength, c1s</samp></dt>
  17465. <dt><samp>c2_strength, c2s</samp></dt>
  17466. <dt><samp>c3_strength, c3s</samp></dt>
  17467. <dd><p>Set noise strength for specific pixel component or all pixel components in case
  17468. <var>all_strength</var>. Default value is <code>0</code>. Allowed range is [0, 100].
  17469. </p>
  17470. </dd>
  17471. <dt><samp>all_flags, allf</samp></dt>
  17472. <dt><samp>c0_flags, c0f</samp></dt>
  17473. <dt><samp>c1_flags, c1f</samp></dt>
  17474. <dt><samp>c2_flags, c2f</samp></dt>
  17475. <dt><samp>c3_flags, c3f</samp></dt>
  17476. <dd><p>Set pixel component flags or set flags for all components if <var>all_flags</var>.
  17477. Available values for component flags are:
  17478. </p><dl compact="compact">
  17479. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  17480. <dd><p>averaged temporal noise (smoother)
  17481. </p></dd>
  17482. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  17483. <dd><p>mix random noise with a (semi)regular pattern
  17484. </p></dd>
  17485. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  17486. <dd><p>temporal noise (noise pattern changes between frames)
  17487. </p></dd>
  17488. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  17489. <dd><p>uniform noise (gaussian otherwise)
  17490. </p></dd>
  17491. </dl>
  17492. </dd>
  17493. </dl>
  17494. <a name="Examples-85"></a>
  17495. <h4 class="subsection">11.152.1 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>
  17496. <p>Add temporal and uniform noise to input video:
  17497. </p><div class="example">
  17498. <pre class="example">noise=alls=20:allf=t+u
  17499. </pre></div>
  17500. <a name="normalize"></a>
  17501. <h3 class="section">11.153 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>
  17502. <p>Normalize RGB video (aka histogram stretching, contrast stretching).
  17503. See: https://en.wikipedia.org/wiki/Normalization_(image_processing)
  17504. </p>
  17505. <p>For each channel of each frame, the filter computes the input range and maps
  17506. it linearly to the user-specified output range. The output range defaults
  17507. to the full dynamic range from pure black to pure white.
  17508. </p>
  17509. <p>Temporal smoothing can be used on the input range to reduce flickering (rapid
  17510. changes in brightness) caused when small dark or bright objects enter or leave
  17511. the scene. This is similar to the auto-exposure (automatic gain control) on a
  17512. video camera, and, like a video camera, it may cause a period of over- or
  17513. under-exposure of the video.
  17514. </p>
  17515. <p>The R,G,B channels can be normalized independently, which may cause some
  17516. color shifting, or linked together as a single channel, which prevents
  17517. color shifting. Linked normalization preserves hue. Independent normalization
  17518. does not, so it can be used to remove some color casts. Independent and linked
  17519. normalization can be combined in any ratio.
  17520. </p>
  17521. <p>The normalize filter accepts the following options:
  17522. </p>
  17523. <dl compact="compact">
  17524. <dt><samp>blackpt</samp></dt>
  17525. <dt><samp>whitept</samp></dt>
  17526. <dd><p>Colors which define the output range. The minimum input value is mapped to
  17527. the <var>blackpt</var>. The maximum input value is mapped to the <var>whitept</var>.
  17528. The defaults are black and white respectively. Specifying white for
  17529. <var>blackpt</var> and black for <var>whitept</var> will give color-inverted,
  17530. normalized video. Shades of grey can be used to reduce the dynamic range
  17531. (contrast). Specifying saturated colors here can create some interesting
  17532. effects.
  17533. </p>
  17534. </dd>
  17535. <dt><samp>smoothing</samp></dt>
  17536. <dd><p>The number of previous frames to use for temporal smoothing. The input range
  17537. of each channel is smoothed using a rolling average over the current frame
  17538. and the <var>smoothing</var> previous frames. The default is 0 (no temporal
  17539. smoothing).
  17540. </p>
  17541. </dd>
  17542. <dt><samp>independence</samp></dt>
  17543. <dd><p>Controls the ratio of independent (color shifting) channel normalization to
  17544. linked (color preserving) normalization. 0.0 is fully linked, 1.0 is fully
  17545. independent. Defaults to 1.0 (fully independent).
  17546. </p>
  17547. </dd>
  17548. <dt><samp>strength</samp></dt>
  17549. <dd><p>Overall strength of the filter. 1.0 is full strength. 0.0 is a rather
  17550. expensive no-op. Defaults to 1.0 (full strength).
  17551. </p>
  17552. </dd>
  17553. </dl>
  17554. <a name="Commands-108"></a>
  17555. <h4 class="subsection">11.153.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>
  17556. <p>This filter supports same <a href="#commands">commands</a> as options, excluding <var>smoothing</var> option.
  17557. The command accepts the same syntax of the corresponding option.
  17558. </p>
  17559. <p>If the specified expression is not valid, it is kept at its current
  17560. value.
  17561. </p>
  17562. <a name="Examples-86"></a>
  17563. <h4 class="subsection">11.153.2 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>
  17564. <p>Stretch video contrast to use the full dynamic range, with no temporal
  17565. smoothing; may flicker depending on the source content:
  17566. </p><div class="example">
  17567. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=0
  17568. </pre></div>
  17569. <p>As above, but with 50 frames of temporal smoothing; flicker should be
  17570. reduced, depending on the source content:
  17571. </p><div class="example">
  17572. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50
  17573. </pre></div>
  17574. <p>As above, but with hue-preserving linked channel normalization:
  17575. </p><div class="example">
  17576. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0
  17577. </pre></div>
  17578. <p>As above, but with half strength:
  17579. </p><div class="example">
  17580. <pre class="example">normalize=blackpt=black:whitept=white:smoothing=50:independence=0:strength=0.5
  17581. </pre></div>
  17582. <p>Map the darkest input color to red, the brightest input color to cyan:
  17583. </p><div class="example">
  17584. <pre class="example">normalize=blackpt=red:whitept=cyan
  17585. </pre></div>
  17586. <a name="null"></a>
  17587. <h3 class="section">11.154 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>
  17588. <p>Pass the video source unchanged to the output.
  17589. </p>
  17590. <a name="ocr"></a>
  17591. <h3 class="section">11.155 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>
  17592. <p>Optical Character Recognition
  17593. </p>
  17594. <p>This filter uses Tesseract for optical character recognition. To enable
  17595. compilation of this filter, you need to configure FFmpeg with
  17596. <code>--enable-libtesseract</code>.
  17597. </p>
  17598. <p>It accepts the following options:
  17599. </p>
  17600. <dl compact="compact">
  17601. <dt><samp>datapath</samp></dt>
  17602. <dd><p>Set datapath to tesseract data. Default is to use whatever was
  17603. set at installation.
  17604. </p>
  17605. </dd>
  17606. <dt><samp>language</samp></dt>
  17607. <dd><p>Set language, default is &quot;eng&quot;.
  17608. </p>
  17609. </dd>
  17610. <dt><samp>whitelist</samp></dt>
  17611. <dd><p>Set character whitelist.
  17612. </p>
  17613. </dd>
  17614. <dt><samp>blacklist</samp></dt>
  17615. <dd><p>Set character blacklist.
  17616. </p></dd>
  17617. </dl>
  17618. <p>The filter exports recognized text as the frame metadata <code>lavfi.ocr.text</code>.
  17619. The filter exports confidence of recognized words as the frame metadata <code>lavfi.ocr.confidence</code>.
  17620. </p>
  17621. <a name="ocv"></a>
  17622. <h3 class="section">11.156 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>
  17623. <p>Apply a video transform using libopencv.
  17624. </p>
  17625. <p>To enable this filter, install the libopencv library and headers and
  17626. configure FFmpeg with <code>--enable-libopencv</code>.
  17627. </p>
  17628. <p>It accepts the following parameters:
  17629. </p>
  17630. <dl compact="compact">
  17631. <dt><samp>filter_name</samp></dt>
  17632. <dd><p>The name of the libopencv filter to apply.
  17633. </p>
  17634. </dd>
  17635. <dt><samp>filter_params</samp></dt>
  17636. <dd><p>The parameters to pass to the libopencv filter. If not specified, the default
  17637. values are assumed.
  17638. </p>
  17639. </dd>
  17640. </dl>
  17641. <p>Refer to the official libopencv documentation for more precise
  17642. information:
  17643. <a href="http://docs.opencv.org/master/modules/imgproc/doc/filtering.html">http://docs.opencv.org/master/modules/imgproc/doc/filtering.html</a>
  17644. </p>
  17645. <p>Several libopencv filters are supported; see the following subsections.
  17646. </p>
  17647. <span id="dilate"></span><a name="dilate-1"></a>
  17648. <h4 class="subsection">11.156.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>
  17649. <p>Dilate an image by using a specific structuring element.
  17650. It corresponds to the libopencv function <code>cvDilate</code>.
  17651. </p>
  17652. <p>It accepts the parameters: <var>struct_el</var>|<var>nb_iterations</var>.
  17653. </p>
  17654. <p><var>struct_el</var> represents a structuring element, and has the syntax:
  17655. <var>cols</var>x<var>rows</var>+<var>anchor_x</var>x<var>anchor_y</var>/<var>shape</var>
  17656. </p>
  17657. <p><var>cols</var> and <var>rows</var> represent the number of columns and rows of
  17658. the structuring element, <var>anchor_x</var> and <var>anchor_y</var> the anchor
  17659. point, and <var>shape</var> the shape for the structuring element. <var>shape</var>
  17660. must be &quot;rect&quot;, &quot;cross&quot;, &quot;ellipse&quot;, or &quot;custom&quot;.
  17661. </p>
  17662. <p>If the value for <var>shape</var> is &quot;custom&quot;, it must be followed by a
  17663. string of the form &quot;=<var>filename</var>&quot;. The file with name
  17664. <var>filename</var> is assumed to represent a binary image, with each
  17665. printable character corresponding to a bright pixel. When a custom
  17666. <var>shape</var> is used, <var>cols</var> and <var>rows</var> are ignored, the number
  17667. or columns and rows of the read file are assumed instead.
  17668. </p>
  17669. <p>The default value for <var>struct_el</var> is &quot;3x3+0x0/rect&quot;.
  17670. </p>
  17671. <p><var>nb_iterations</var> specifies the number of times the transform is
  17672. applied to the image, and defaults to 1.
  17673. </p>
  17674. <p>Some examples:
  17675. </p><div class="example">
  17676. <pre class="example"># Use the default values
  17677. ocv=dilate
  17678. # Dilate using a structuring element with a 5x5 cross, iterating two times
  17679. ocv=filter_name=dilate:filter_params=5x5+2x2/cross|2
  17680. # Read the shape from the file diamond.shape, iterating two times.
  17681. # The file diamond.shape may contain a pattern of characters like this
  17682. # *
  17683. # ***
  17684. # *****
  17685. # ***
  17686. # *
  17687. # The specified columns and rows are ignored
  17688. # but the anchor point coordinates are not
  17689. ocv=dilate:0x0+2x2/custom=diamond.shape|2
  17690. </pre></div>
  17691. <a name="erode"></a>
  17692. <h4 class="subsection">11.156.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>
  17693. <p>Erode an image by using a specific structuring element.
  17694. It corresponds to the libopencv function <code>cvErode</code>.
  17695. </p>
  17696. <p>It accepts the parameters: <var>struct_el</var>:<var>nb_iterations</var>,
  17697. with the same syntax and semantics as the <a href="#dilate">dilate</a> filter.
  17698. </p>
  17699. <a name="smooth"></a>
  17700. <h4 class="subsection">11.156.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>
  17701. <p>Smooth the input video.
  17702. </p>
  17703. <p>The filter takes the following parameters:
  17704. <var>type</var>|<var>param1</var>|<var>param2</var>|<var>param3</var>|<var>param4</var>.
  17705. </p>
  17706. <p><var>type</var> is the type of smooth filter to apply, and must be one of
  17707. the following values: &quot;blur&quot;, &quot;blur_no_scale&quot;, &quot;median&quot;, &quot;gaussian&quot;,
  17708. or &quot;bilateral&quot;. The default value is &quot;gaussian&quot;.
  17709. </p>
  17710. <p>The meaning of <var>param1</var>, <var>param2</var>, <var>param3</var>, and <var>param4</var>
  17711. depends on the smooth type. <var>param1</var> and
  17712. <var>param2</var> accept integer positive values or 0. <var>param3</var> and
  17713. <var>param4</var> accept floating point values.
  17714. </p>
  17715. <p>The default value for <var>param1</var> is 3. The default value for the
  17716. other parameters is 0.
  17717. </p>
  17718. <p>These parameters correspond to the parameters assigned to the
  17719. libopencv function <code>cvSmooth</code>.
  17720. </p>
  17721. <a name="oscilloscope"></a>
  17722. <h3 class="section">11.157 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>
  17723. <p>2D Video Oscilloscope.
  17724. </p>
  17725. <p>Useful to measure spatial impulse, step responses, chroma delays, etc.
  17726. </p>
  17727. <p>It accepts the following parameters:
  17728. </p>
  17729. <dl compact="compact">
  17730. <dt><samp>x</samp></dt>
  17731. <dd><p>Set scope center x position.
  17732. </p>
  17733. </dd>
  17734. <dt><samp>y</samp></dt>
  17735. <dd><p>Set scope center y position.
  17736. </p>
  17737. </dd>
  17738. <dt><samp>s</samp></dt>
  17739. <dd><p>Set scope size, relative to frame diagonal.
  17740. </p>
  17741. </dd>
  17742. <dt><samp>t</samp></dt>
  17743. <dd><p>Set scope tilt/rotation.
  17744. </p>
  17745. </dd>
  17746. <dt><samp>o</samp></dt>
  17747. <dd><p>Set trace opacity.
  17748. </p>
  17749. </dd>
  17750. <dt><samp>tx</samp></dt>
  17751. <dd><p>Set trace center x position.
  17752. </p>
  17753. </dd>
  17754. <dt><samp>ty</samp></dt>
  17755. <dd><p>Set trace center y position.
  17756. </p>
  17757. </dd>
  17758. <dt><samp>tw</samp></dt>
  17759. <dd><p>Set trace width, relative to width of frame.
  17760. </p>
  17761. </dd>
  17762. <dt><samp>th</samp></dt>
  17763. <dd><p>Set trace height, relative to height of frame.
  17764. </p>
  17765. </dd>
  17766. <dt><samp>c</samp></dt>
  17767. <dd><p>Set which components to trace. By default it traces first three components.
  17768. </p>
  17769. </dd>
  17770. <dt><samp>g</samp></dt>
  17771. <dd><p>Draw trace grid. By default is enabled.
  17772. </p>
  17773. </dd>
  17774. <dt><samp>st</samp></dt>
  17775. <dd><p>Draw some statistics. By default is enabled.
  17776. </p>
  17777. </dd>
  17778. <dt><samp>sc</samp></dt>
  17779. <dd><p>Draw scope. By default is enabled.
  17780. </p></dd>
  17781. </dl>
  17782. <a name="Commands-109"></a>
  17783. <h4 class="subsection">11.157.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>
  17784. <p>This filter supports same <a href="#commands">commands</a> as options.
  17785. The command accepts the same syntax of the corresponding option.
  17786. </p>
  17787. <p>If the specified expression is not valid, it is kept at its current
  17788. value.
  17789. </p>
  17790. <a name="Examples-87"></a>
  17791. <h4 class="subsection">11.157.2 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>
  17792. <ul>
  17793. <li> Inspect full first row of video frame.
  17794. <div class="example">
  17795. <pre class="example">oscilloscope=x=0.5:y=0:s=1
  17796. </pre></div>
  17797. </li><li> Inspect full last row of video frame.
  17798. <div class="example">
  17799. <pre class="example">oscilloscope=x=0.5:y=1:s=1
  17800. </pre></div>
  17801. </li><li> Inspect full 5th line of video frame of height 1080.
  17802. <div class="example">
  17803. <pre class="example">oscilloscope=x=0.5:y=5/1080:s=1
  17804. </pre></div>
  17805. </li><li> Inspect full last column of video frame.
  17806. <div class="example">
  17807. <pre class="example">oscilloscope=x=1:y=0.5:s=1:t=1
  17808. </pre></div>
  17809. </li></ul>
  17810. <span id="overlay"></span><a name="overlay-1"></a>
  17811. <h3 class="section">11.158 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>
  17812. <p>Overlay one video on top of another.
  17813. </p>
  17814. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  17815. video on which the second input is overlaid.
  17816. </p>
  17817. <p>It accepts the following parameters:
  17818. </p>
  17819. <p>A description of the accepted options follows.
  17820. </p>
  17821. <dl compact="compact">
  17822. <dt><samp>x</samp></dt>
  17823. <dt><samp>y</samp></dt>
  17824. <dd><p>Set the expression for the x and y coordinates of the overlaid video
  17825. on the main video. Default value is &quot;0&quot; for both expressions. In case
  17826. the expression is invalid, it is set to a huge value (meaning that the
  17827. overlay will not be displayed within the output visible area).
  17828. </p>
  17829. </dd>
  17830. <dt><samp>eof_action</samp></dt>
  17831. <dd><p>See <a href="#framesync">framesync</a>.
  17832. </p>
  17833. </dd>
  17834. <dt><samp>eval</samp></dt>
  17835. <dd><p>Set when the expressions for <samp>x</samp>, and <samp>y</samp> are evaluated.
  17836. </p>
  17837. <p>It accepts the following values:
  17838. </p><dl compact="compact">
  17839. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  17840. <dd><p>only evaluate expressions once during the filter initialization or
  17841. when a command is processed
  17842. </p>
  17843. </dd>
  17844. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  17845. <dd><p>evaluate expressions for each incoming frame
  17846. </p></dd>
  17847. </dl>
  17848. <p>Default value is &lsquo;<samp>frame</samp>&rsquo;.
  17849. </p>
  17850. </dd>
  17851. <dt><samp>shortest</samp></dt>
  17852. <dd><p>See <a href="#framesync">framesync</a>.
  17853. </p>
  17854. </dd>
  17855. <dt><samp>format</samp></dt>
  17856. <dd><p>Set the format for the output video.
  17857. </p>
  17858. <p>It accepts the following values:
  17859. </p><dl compact="compact">
  17860. <dt>&lsquo;<samp>yuv420</samp>&rsquo;</dt>
  17861. <dd><p>force YUV420 output
  17862. </p>
  17863. </dd>
  17864. <dt>&lsquo;<samp>yuv420p10</samp>&rsquo;</dt>
  17865. <dd><p>force YUV420p10 output
  17866. </p>
  17867. </dd>
  17868. <dt>&lsquo;<samp>yuv422</samp>&rsquo;</dt>
  17869. <dd><p>force YUV422 output
  17870. </p>
  17871. </dd>
  17872. <dt>&lsquo;<samp>yuv422p10</samp>&rsquo;</dt>
  17873. <dd><p>force YUV422p10 output
  17874. </p>
  17875. </dd>
  17876. <dt>&lsquo;<samp>yuv444</samp>&rsquo;</dt>
  17877. <dd><p>force YUV444 output
  17878. </p>
  17879. </dd>
  17880. <dt>&lsquo;<samp>rgb</samp>&rsquo;</dt>
  17881. <dd><p>force packed RGB output
  17882. </p>
  17883. </dd>
  17884. <dt>&lsquo;<samp>gbrp</samp>&rsquo;</dt>
  17885. <dd><p>force planar RGB output
  17886. </p>
  17887. </dd>
  17888. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  17889. <dd><p>automatically pick format
  17890. </p></dd>
  17891. </dl>
  17892. <p>Default value is &lsquo;<samp>yuv420</samp>&rsquo;.
  17893. </p>
  17894. </dd>
  17895. <dt><samp>repeatlast</samp></dt>
  17896. <dd><p>See <a href="#framesync">framesync</a>.
  17897. </p>
  17898. </dd>
  17899. <dt><samp>alpha</samp></dt>
  17900. <dd><p>Set format of alpha of the overlaid video, it can be <var>straight</var> or
  17901. <var>premultiplied</var>. Default is <var>straight</var>.
  17902. </p></dd>
  17903. </dl>
  17904. <p>The <samp>x</samp>, and <samp>y</samp> expressions can contain the following
  17905. parameters.
  17906. </p>
  17907. <dl compact="compact">
  17908. <dt><samp>main_w, W</samp></dt>
  17909. <dt><samp>main_h, H</samp></dt>
  17910. <dd><p>The main input width and height.
  17911. </p>
  17912. </dd>
  17913. <dt><samp>overlay_w, w</samp></dt>
  17914. <dt><samp>overlay_h, h</samp></dt>
  17915. <dd><p>The overlay input width and height.
  17916. </p>
  17917. </dd>
  17918. <dt><samp>x</samp></dt>
  17919. <dt><samp>y</samp></dt>
  17920. <dd><p>The computed values for <var>x</var> and <var>y</var>. They are evaluated for
  17921. each new frame.
  17922. </p>
  17923. </dd>
  17924. <dt><samp>hsub</samp></dt>
  17925. <dt><samp>vsub</samp></dt>
  17926. <dd><p>horizontal and vertical chroma subsample values of the output
  17927. format. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and
  17928. <var>vsub</var> is 1.
  17929. </p>
  17930. </dd>
  17931. <dt><samp>n</samp></dt>
  17932. <dd><p>the number of input frame, starting from 0
  17933. </p>
  17934. </dd>
  17935. <dt><samp>pos</samp></dt>
  17936. <dd><p>the position in the file of the input frame, NAN if unknown
  17937. </p>
  17938. </dd>
  17939. <dt><samp>t</samp></dt>
  17940. <dd><p>The timestamp, expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  17941. </p>
  17942. </dd>
  17943. </dl>
  17944. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  17945. </p>
  17946. <p>Note that the <var>n</var>, <var>pos</var>, <var>t</var> variables are available only
  17947. when evaluation is done <em>per frame</em>, and will evaluate to NAN
  17948. when <samp>eval</samp> is set to &lsquo;<samp>init</samp>&rsquo;.
  17949. </p>
  17950. <p>Be aware that frames are taken from each input video in timestamp
  17951. order, hence, if their initial timestamps differ, it is a good idea
  17952. to pass the two inputs through a <var>setpts=PTS-STARTPTS</var> filter to
  17953. have them begin in the same zero timestamp, as the example for
  17954. the <var>movie</var> filter does.
  17955. </p>
  17956. <p>You can chain together more overlays but you should test the
  17957. efficiency of such approach.
  17958. </p>
  17959. <a name="Commands-110"></a>
  17960. <h4 class="subsection">11.158.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>
  17961. <p>This filter supports the following commands:
  17962. </p><dl compact="compact">
  17963. <dt><samp>x</samp></dt>
  17964. <dt><samp>y</samp></dt>
  17965. <dd><p>Modify the x and y of the overlay input.
  17966. The command accepts the same syntax of the corresponding option.
  17967. </p>
  17968. <p>If the specified expression is not valid, it is kept at its current
  17969. value.
  17970. </p></dd>
  17971. </dl>
  17972. <a name="Examples-88"></a>
  17973. <h4 class="subsection">11.158.2 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>
  17974. <ul>
  17975. <li> Draw the overlay at 10 pixels from the bottom right corner of the main
  17976. video:
  17977. <div class="example">
  17978. <pre class="example">overlay=main_w-overlay_w-10:main_h-overlay_h-10
  17979. </pre></div>
  17980. <p>Using named options the example above becomes:
  17981. </p><div class="example">
  17982. <pre class="example">overlay=x=main_w-overlay_w-10:y=main_h-overlay_h-10
  17983. </pre></div>
  17984. </li><li> Insert a transparent PNG logo in the bottom left corner of the input,
  17985. using the <code>ffmpeg</code> tool with the <code>-filter_complex</code> option:
  17986. <div class="example">
  17987. <pre class="example">ffmpeg -i input -i logo -filter_complex 'overlay=10:main_h-overlay_h-10' output
  17988. </pre></div>
  17989. </li><li> Insert 2 different transparent PNG logos (second logo on bottom
  17990. right corner) using the <code>ffmpeg</code> tool:
  17991. <div class="example">
  17992. <pre class="example">ffmpeg -i input -i logo1 -i logo2 -filter_complex 'overlay=x=10:y=H-h-10,overlay=x=W-w-10:y=H-h-10' output
  17993. </pre></div>
  17994. </li><li> Add a transparent color layer on top of the main video; <code>WxH</code>
  17995. must specify the size of the main input to the overlay filter:
  17996. <div class="example">
  17997. <pre class="example">color=color=red@.3:size=WxH [over]; [in][over] overlay [out]
  17998. </pre></div>
  17999. </li><li> Play an original video and a filtered version (here with the deshake
  18000. filter) side by side using the <code>ffplay</code> tool:
  18001. <div class="example">
  18002. <pre class="example">ffplay input.avi -vf 'split[a][b]; [a]pad=iw*2:ih[src]; [b]deshake[filt]; [src][filt]overlay=w'
  18003. </pre></div>
  18004. <p>The above command is the same as:
  18005. </p><div class="example">
  18006. <pre class="example">ffplay input.avi -vf 'split[b], pad=iw*2[src], [b]deshake, [src]overlay=w'
  18007. </pre></div>
  18008. </li><li> Make a sliding overlay appearing from the left to the right top part of the
  18009. screen starting since time 2:
  18010. <div class="example">
  18011. <pre class="example">overlay=x='if(gte(t,2), -w+(t-2)*20, NAN)':y=0
  18012. </pre></div>
  18013. </li><li> Compose output by putting two input videos side to side:
  18014. <div class="example">
  18015. <pre class="example">ffmpeg -i left.avi -i right.avi -filter_complex &quot;
  18016. nullsrc=size=200x100 [background];
  18017. [0:v] setpts=PTS-STARTPTS, scale=100x100 [left];
  18018. [1:v] setpts=PTS-STARTPTS, scale=100x100 [right];
  18019. [background][left] overlay=shortest=1 [background+left];
  18020. [background+left][right] overlay=shortest=1:x=100 [left+right]
  18021. &quot;
  18022. </pre></div>
  18023. </li><li> Mask 10-20 seconds of a video by applying the delogo filter to a section
  18024. <div class="example">
  18025. <pre class="example">ffmpeg -i test.avi -codec:v:0 wmv2 -ar 11025 -b:v 9000k
  18026. -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]'
  18027. masked.avi
  18028. </pre></div>
  18029. </li><li> Chain several overlays in cascade:
  18030. <div class="example">
  18031. <pre class="example">nullsrc=s=200x200 [bg];
  18032. testsrc=s=100x100, split=4 [in0][in1][in2][in3];
  18033. [in0] lutrgb=r=0, [bg] overlay=0:0 [mid0];
  18034. [in1] lutrgb=g=0, [mid0] overlay=100:0 [mid1];
  18035. [in2] lutrgb=b=0, [mid1] overlay=0:100 [mid2];
  18036. [in3] null, [mid2] overlay=100:100 [out0]
  18037. </pre></div>
  18038. </li></ul>
  18039. <span id="overlay_005fcuda"></span><a name="overlay_005fcuda-1"></a>
  18040. <h3 class="section">11.159 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></h3>
  18041. <p>Overlay one video on top of another.
  18042. </p>
  18043. <p>This is the CUDA variant of the <a href="#overlay">overlay</a> filter.
  18044. It only accepts CUDA frames. The underlying input pixel formats have to match.
  18045. </p>
  18046. <p>It takes two inputs and has one output. The first input is the &quot;main&quot;
  18047. video on which the second input is overlaid.
  18048. </p>
  18049. <p>It accepts the following parameters:
  18050. </p>
  18051. <dl compact="compact">
  18052. <dt><samp>x</samp></dt>
  18053. <dt><samp>y</samp></dt>
  18054. <dd><p>Set the x and y coordinates of the overlaid video on the main video.
  18055. Default value is &quot;0&quot; for both expressions.
  18056. </p>
  18057. </dd>
  18058. <dt><samp>eof_action</samp></dt>
  18059. <dd><p>See <a href="#framesync">framesync</a>.
  18060. </p>
  18061. </dd>
  18062. <dt><samp>shortest</samp></dt>
  18063. <dd><p>See <a href="#framesync">framesync</a>.
  18064. </p>
  18065. </dd>
  18066. <dt><samp>repeatlast</samp></dt>
  18067. <dd><p>See <a href="#framesync">framesync</a>.
  18068. </p>
  18069. </dd>
  18070. </dl>
  18071. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  18072. </p>
  18073. <a name="owdenoise"></a>
  18074. <h3 class="section">11.160 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>
  18075. <p>Apply Overcomplete Wavelet denoiser.
  18076. </p>
  18077. <p>The filter accepts the following options:
  18078. </p>
  18079. <dl compact="compact">
  18080. <dt><samp>depth</samp></dt>
  18081. <dd><p>Set depth.
  18082. </p>
  18083. <p>Larger depth values will denoise lower frequency components more, but
  18084. slow down filtering.
  18085. </p>
  18086. <p>Must be an int in the range 8-16, default is <code>8</code>.
  18087. </p>
  18088. </dd>
  18089. <dt><samp>luma_strength, ls</samp></dt>
  18090. <dd><p>Set luma strength.
  18091. </p>
  18092. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  18093. </p>
  18094. </dd>
  18095. <dt><samp>chroma_strength, cs</samp></dt>
  18096. <dd><p>Set chroma strength.
  18097. </p>
  18098. <p>Must be a double value in the range 0-1000, default is <code>1.0</code>.
  18099. </p></dd>
  18100. </dl>
  18101. <span id="pad"></span><a name="pad-1"></a>
  18102. <h3 class="section">11.161 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>
  18103. <p>Add paddings to the input image, and place the original input at the
  18104. provided <var>x</var>, <var>y</var> coordinates.
  18105. </p>
  18106. <p>It accepts the following parameters:
  18107. </p>
  18108. <dl compact="compact">
  18109. <dt><samp>width, w</samp></dt>
  18110. <dt><samp>height, h</samp></dt>
  18111. <dd><p>Specify an expression for the size of the output image with the
  18112. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  18113. corresponding input size is used for the output.
  18114. </p>
  18115. <p>The <var>width</var> expression can reference the value set by the
  18116. <var>height</var> expression, and vice versa.
  18117. </p>
  18118. <p>The default value of <var>width</var> and <var>height</var> is 0.
  18119. </p>
  18120. </dd>
  18121. <dt><samp>x</samp></dt>
  18122. <dt><samp>y</samp></dt>
  18123. <dd><p>Specify the offsets to place the input image at within the padded area,
  18124. with respect to the top/left border of the output image.
  18125. </p>
  18126. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  18127. expression, and vice versa.
  18128. </p>
  18129. <p>The default value of <var>x</var> and <var>y</var> is 0.
  18130. </p>
  18131. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  18132. so the input image is centered on the padded area.
  18133. </p>
  18134. </dd>
  18135. <dt><samp>color</samp></dt>
  18136. <dd><p>Specify the color of the padded area. For the syntax of this option,
  18137. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  18138. manual</a>.
  18139. </p>
  18140. <p>The default value of <var>color</var> is &quot;black&quot;.
  18141. </p>
  18142. </dd>
  18143. <dt><samp>eval</samp></dt>
  18144. <dd><p>Specify when to evaluate <var>width</var>, <var>height</var>, <var>x</var> and <var>y</var> expression.
  18145. </p>
  18146. <p>It accepts the following values:
  18147. </p>
  18148. <dl compact="compact">
  18149. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  18150. <dd><p>Only evaluate expressions once during the filter initialization or when
  18151. a command is processed.
  18152. </p>
  18153. </dd>
  18154. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  18155. <dd><p>Evaluate expressions for each incoming frame.
  18156. </p>
  18157. </dd>
  18158. </dl>
  18159. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  18160. </p>
  18161. </dd>
  18162. <dt><samp>aspect</samp></dt>
  18163. <dd><p>Pad to aspect instead to a resolution.
  18164. </p>
  18165. </dd>
  18166. </dl>
  18167. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  18168. options are expressions containing the following constants:
  18169. </p>
  18170. <dl compact="compact">
  18171. <dt><samp>in_w</samp></dt>
  18172. <dt><samp>in_h</samp></dt>
  18173. <dd><p>The input video width and height.
  18174. </p>
  18175. </dd>
  18176. <dt><samp>iw</samp></dt>
  18177. <dt><samp>ih</samp></dt>
  18178. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  18179. </p>
  18180. </dd>
  18181. <dt><samp>out_w</samp></dt>
  18182. <dt><samp>out_h</samp></dt>
  18183. <dd><p>The output width and height (the size of the padded area), as
  18184. specified by the <var>width</var> and <var>height</var> expressions.
  18185. </p>
  18186. </dd>
  18187. <dt><samp>ow</samp></dt>
  18188. <dt><samp>oh</samp></dt>
  18189. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  18190. </p>
  18191. </dd>
  18192. <dt><samp>x</samp></dt>
  18193. <dt><samp>y</samp></dt>
  18194. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  18195. expressions, or NAN if not yet specified.
  18196. </p>
  18197. </dd>
  18198. <dt><samp>a</samp></dt>
  18199. <dd><p>same as <var>iw</var> / <var>ih</var>
  18200. </p>
  18201. </dd>
  18202. <dt><samp>sar</samp></dt>
  18203. <dd><p>input sample aspect ratio
  18204. </p>
  18205. </dd>
  18206. <dt><samp>dar</samp></dt>
  18207. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  18208. </p>
  18209. </dd>
  18210. <dt><samp>hsub</samp></dt>
  18211. <dt><samp>vsub</samp></dt>
  18212. <dd><p>The horizontal and vertical chroma subsample values. For example for the
  18213. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  18214. </p></dd>
  18215. </dl>
  18216. <a name="Examples-89"></a>
  18217. <h4 class="subsection">11.161.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>
  18218. <ul>
  18219. <li> Add paddings with the color &quot;violet&quot; to the input video. The output video
  18220. size is 640x480, and the top-left corner of the input video is placed at
  18221. column 0, row 40
  18222. <div class="example">
  18223. <pre class="example">pad=640:480:0:40:violet
  18224. </pre></div>
  18225. <p>The example above is equivalent to the following command:
  18226. </p><div class="example">
  18227. <pre class="example">pad=width=640:height=480:x=0:y=40:color=violet
  18228. </pre></div>
  18229. </li><li> Pad the input to get an output with dimensions increased by 3/2,
  18230. and put the input video at the center of the padded area:
  18231. <div class="example">
  18232. <pre class="example">pad=&quot;3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2&quot;
  18233. </pre></div>
  18234. </li><li> Pad the input to get a squared output with size equal to the maximum
  18235. value between the input width and height, and put the input video at
  18236. the center of the padded area:
  18237. <div class="example">
  18238. <pre class="example">pad=&quot;max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2&quot;
  18239. </pre></div>
  18240. </li><li> Pad the input to get a final w/h ratio of 16:9:
  18241. <div class="example">
  18242. <pre class="example">pad=&quot;ih*16/9:ih:(ow-iw)/2:(oh-ih)/2&quot;
  18243. </pre></div>
  18244. </li><li> In case of anamorphic video, in order to set the output display aspect
  18245. correctly, it is necessary to use <var>sar</var> in the expression,
  18246. according to the relation:
  18247. <div class="example">
  18248. <pre class="example">(ih * X / ih) * sar = output_dar
  18249. X = output_dar / sar
  18250. </pre></div>
  18251. <p>Thus the previous example needs to be modified to:
  18252. </p><div class="example">
  18253. <pre class="example">pad=&quot;ih*16/9/sar:ih:(ow-iw)/2:(oh-ih)/2&quot;
  18254. </pre></div>
  18255. </li><li> Double the output size and put the input video in the bottom-right
  18256. corner of the output padded area:
  18257. <div class="example">
  18258. <pre class="example">pad=&quot;2*iw:2*ih:ow-iw:oh-ih&quot;
  18259. </pre></div>
  18260. </li></ul>
  18261. <span id="palettegen"></span><a name="palettegen-1"></a>
  18262. <h3 class="section">11.162 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>
  18263. <p>Generate one palette for a whole video stream.
  18264. </p>
  18265. <p>It accepts the following options:
  18266. </p>
  18267. <dl compact="compact">
  18268. <dt><samp>max_colors</samp></dt>
  18269. <dd><p>Set the maximum number of colors to quantize in the palette.
  18270. Note: the palette will still contain 256 colors; the unused palette entries
  18271. will be black.
  18272. </p>
  18273. </dd>
  18274. <dt><samp>reserve_transparent</samp></dt>
  18275. <dd><p>Create a palette of 255 colors maximum and reserve the last one for
  18276. transparency. Reserving the transparency color is useful for GIF optimization.
  18277. If not set, the maximum of colors in the palette will be 256. You probably want
  18278. to disable this option for a standalone image.
  18279. Set by default.
  18280. </p>
  18281. </dd>
  18282. <dt><samp>transparency_color</samp></dt>
  18283. <dd><p>Set the color that will be used as background for transparency.
  18284. </p>
  18285. </dd>
  18286. <dt><samp>stats_mode</samp></dt>
  18287. <dd><p>Set statistics mode.
  18288. </p>
  18289. <p>It accepts the following values:
  18290. </p><dl compact="compact">
  18291. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  18292. <dd><p>Compute full frame histograms.
  18293. </p></dd>
  18294. <dt>&lsquo;<samp>diff</samp>&rsquo;</dt>
  18295. <dd><p>Compute histograms only for the part that differs from previous frame. This
  18296. might be relevant to give more importance to the moving part of your input if
  18297. the background is static.
  18298. </p></dd>
  18299. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  18300. <dd><p>Compute new histogram for each frame.
  18301. </p></dd>
  18302. </dl>
  18303. <p>Default value is <var>full</var>.
  18304. </p></dd>
  18305. </dl>
  18306. <p>The filter also exports the frame metadata <code>lavfi.color_quant_ratio</code>
  18307. (<code>nb_color_in / nb_color_out</code>) which you can use to evaluate the degree of
  18308. color quantization of the palette. This information is also visible at
  18309. <var>info</var> logging level.
  18310. </p>
  18311. <a name="Examples-90"></a>
  18312. <h4 class="subsection">11.162.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>
  18313. <ul>
  18314. <li> Generate a representative palette of a given video using <code>ffmpeg</code>:
  18315. <div class="example">
  18316. <pre class="example">ffmpeg -i input.mkv -vf palettegen palette.png
  18317. </pre></div>
  18318. </li></ul>
  18319. <a name="paletteuse"></a>
  18320. <h3 class="section">11.163 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>
  18321. <p>Use a palette to downsample an input video stream.
  18322. </p>
  18323. <p>The filter takes two inputs: one video stream and a palette. The palette must
  18324. be a 256 pixels image.
  18325. </p>
  18326. <p>It accepts the following options:
  18327. </p>
  18328. <dl compact="compact">
  18329. <dt><samp>dither</samp></dt>
  18330. <dd><p>Select dithering mode. Available algorithms are:
  18331. </p><dl compact="compact">
  18332. <dt>&lsquo;<samp>bayer</samp>&rsquo;</dt>
  18333. <dd><p>Ordered 8x8 bayer dithering (deterministic)
  18334. </p></dd>
  18335. <dt>&lsquo;<samp>heckbert</samp>&rsquo;</dt>
  18336. <dd><p>Dithering as defined by Paul Heckbert in 1982 (simple error diffusion).
  18337. Note: this dithering is sometimes considered &quot;wrong&quot; and is included as a
  18338. reference.
  18339. </p></dd>
  18340. <dt>&lsquo;<samp>floyd_steinberg</samp>&rsquo;</dt>
  18341. <dd><p>Floyd and Steingberg dithering (error diffusion)
  18342. </p></dd>
  18343. <dt>&lsquo;<samp>sierra2</samp>&rsquo;</dt>
  18344. <dd><p>Frankie Sierra dithering v2 (error diffusion)
  18345. </p></dd>
  18346. <dt>&lsquo;<samp>sierra2_4a</samp>&rsquo;</dt>
  18347. <dd><p>Frankie Sierra dithering v2 &quot;Lite&quot; (error diffusion)
  18348. </p></dd>
  18349. </dl>
  18350. <p>Default is <var>sierra2_4a</var>.
  18351. </p>
  18352. </dd>
  18353. <dt><samp>bayer_scale</samp></dt>
  18354. <dd><p>When <var>bayer</var> dithering is selected, this option defines the scale of the
  18355. pattern (how much the crosshatch pattern is visible). A low value means more
  18356. visible pattern for less banding, and higher value means less visible pattern
  18357. at the cost of more banding.
  18358. </p>
  18359. <p>The option must be an integer value in the range [0,5]. Default is <var>2</var>.
  18360. </p>
  18361. </dd>
  18362. <dt><samp>diff_mode</samp></dt>
  18363. <dd><p>If set, define the zone to process
  18364. </p>
  18365. <dl compact="compact">
  18366. <dt>&lsquo;<samp>rectangle</samp>&rsquo;</dt>
  18367. <dd><p>Only the changing rectangle will be reprocessed. This is similar to GIF
  18368. cropping/offsetting compression mechanism. This option can be useful for speed
  18369. if only a part of the image is changing, and has use cases such as limiting the
  18370. scope of the error diffusal <samp>dither</samp> to the rectangle that bounds the
  18371. moving scene (it leads to more deterministic output if the scene doesn&rsquo;t change
  18372. much, and as a result less moving noise and better GIF compression).
  18373. </p></dd>
  18374. </dl>
  18375. <p>Default is <var>none</var>.
  18376. </p>
  18377. </dd>
  18378. <dt><samp>new</samp></dt>
  18379. <dd><p>Take new palette for each output frame.
  18380. </p>
  18381. </dd>
  18382. <dt><samp>alpha_threshold</samp></dt>
  18383. <dd><p>Sets the alpha threshold for transparency. Alpha values above this threshold
  18384. will be treated as completely opaque, and values below this threshold will be
  18385. treated as completely transparent.
  18386. </p>
  18387. <p>The option must be an integer value in the range [0,255]. Default is <var>128</var>.
  18388. </p></dd>
  18389. </dl>
  18390. <a name="Examples-91"></a>
  18391. <h4 class="subsection">11.163.1 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>
  18392. <ul>
  18393. <li> Use a palette (generated for example with <a href="#palettegen">palettegen</a>) to encode a GIF
  18394. using <code>ffmpeg</code>:
  18395. <div class="example">
  18396. <pre class="example">ffmpeg -i input.mkv -i palette.png -lavfi paletteuse output.gif
  18397. </pre></div>
  18398. </li></ul>
  18399. <a name="perspective"></a>
  18400. <h3 class="section">11.164 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>
  18401. <p>Correct perspective of video not recorded perpendicular to the screen.
  18402. </p>
  18403. <p>A description of the accepted parameters follows.
  18404. </p>
  18405. <dl compact="compact">
  18406. <dt><samp>x0</samp></dt>
  18407. <dt><samp>y0</samp></dt>
  18408. <dt><samp>x1</samp></dt>
  18409. <dt><samp>y1</samp></dt>
  18410. <dt><samp>x2</samp></dt>
  18411. <dt><samp>y2</samp></dt>
  18412. <dt><samp>x3</samp></dt>
  18413. <dt><samp>y3</samp></dt>
  18414. <dd><p>Set coordinates expression for top left, top right, bottom left and bottom right corners.
  18415. Default values are <code>0:0:W:0:0:H:W:H</code> with which perspective will remain unchanged.
  18416. If the <code>sense</code> option is set to <code>source</code>, then the specified points will be sent
  18417. to the corners of the destination. If the <code>sense</code> option is set to <code>destination</code>,
  18418. then the corners of the source will be sent to the specified coordinates.
  18419. </p>
  18420. <p>The expressions can use the following variables:
  18421. </p>
  18422. <dl compact="compact">
  18423. <dt><samp>W</samp></dt>
  18424. <dt><samp>H</samp></dt>
  18425. <dd><p>the width and height of video frame.
  18426. </p></dd>
  18427. <dt><samp>in</samp></dt>
  18428. <dd><p>Input frame count.
  18429. </p></dd>
  18430. <dt><samp>on</samp></dt>
  18431. <dd><p>Output frame count.
  18432. </p></dd>
  18433. </dl>
  18434. </dd>
  18435. <dt><samp>interpolation</samp></dt>
  18436. <dd><p>Set interpolation for perspective correction.
  18437. </p>
  18438. <p>It accepts the following values:
  18439. </p><dl compact="compact">
  18440. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  18441. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  18442. </dl>
  18443. <p>Default value is &lsquo;<samp>linear</samp>&rsquo;.
  18444. </p>
  18445. </dd>
  18446. <dt><samp>sense</samp></dt>
  18447. <dd><p>Set interpretation of coordinate options.
  18448. </p>
  18449. <p>It accepts the following values:
  18450. </p><dl compact="compact">
  18451. <dt>&lsquo;<samp>0, source</samp>&rsquo;</dt>
  18452. <dd>
  18453. <p>Send point in the source specified by the given coordinates to
  18454. the corners of the destination.
  18455. </p>
  18456. </dd>
  18457. <dt>&lsquo;<samp>1, destination</samp>&rsquo;</dt>
  18458. <dd>
  18459. <p>Send the corners of the source to the point in the destination specified
  18460. by the given coordinates.
  18461. </p>
  18462. <p>Default value is &lsquo;<samp>source</samp>&rsquo;.
  18463. </p></dd>
  18464. </dl>
  18465. </dd>
  18466. <dt><samp>eval</samp></dt>
  18467. <dd><p>Set when the expressions for coordinates <samp>x0,y0,...x3,y3</samp> are evaluated.
  18468. </p>
  18469. <p>It accepts the following values:
  18470. </p><dl compact="compact">
  18471. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  18472. <dd><p>only evaluate expressions once during the filter initialization or
  18473. when a command is processed
  18474. </p>
  18475. </dd>
  18476. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  18477. <dd><p>evaluate expressions for each incoming frame
  18478. </p></dd>
  18479. </dl>
  18480. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  18481. </p></dd>
  18482. </dl>
  18483. <a name="phase"></a>
  18484. <h3 class="section">11.165 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>
  18485. <p>Delay interlaced video by one field time so that the field order changes.
  18486. </p>
  18487. <p>The intended use is to fix PAL movies that have been captured with the
  18488. opposite field order to the film-to-video transfer.
  18489. </p>
  18490. <p>A description of the accepted parameters follows.
  18491. </p>
  18492. <dl compact="compact">
  18493. <dt><samp>mode</samp></dt>
  18494. <dd><p>Set phase mode.
  18495. </p>
  18496. <p>It accepts the following values:
  18497. </p><dl compact="compact">
  18498. <dt>&lsquo;<samp>t</samp>&rsquo;</dt>
  18499. <dd><p>Capture field order top-first, transfer bottom-first.
  18500. Filter will delay the bottom field.
  18501. </p>
  18502. </dd>
  18503. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  18504. <dd><p>Capture field order bottom-first, transfer top-first.
  18505. Filter will delay the top field.
  18506. </p>
  18507. </dd>
  18508. <dt>&lsquo;<samp>p</samp>&rsquo;</dt>
  18509. <dd><p>Capture and transfer with the same field order. This mode only exists
  18510. for the documentation of the other options to refer to, but if you
  18511. actually select it, the filter will faithfully do nothing.
  18512. </p>
  18513. </dd>
  18514. <dt>&lsquo;<samp>a</samp>&rsquo;</dt>
  18515. <dd><p>Capture field order determined automatically by field flags, transfer
  18516. opposite.
  18517. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; modes on a frame by frame
  18518. basis using field flags. If no field information is available,
  18519. then this works just like &lsquo;<samp>u</samp>&rsquo;.
  18520. </p>
  18521. </dd>
  18522. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  18523. <dd><p>Capture unknown or varying, transfer opposite.
  18524. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>b</samp>&rsquo; on a frame by frame basis by
  18525. analyzing the images and selecting the alternative that produces best
  18526. match between the fields.
  18527. </p>
  18528. </dd>
  18529. <dt>&lsquo;<samp>T</samp>&rsquo;</dt>
  18530. <dd><p>Capture top-first, transfer unknown or varying.
  18531. Filter selects among &lsquo;<samp>t</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  18532. </p>
  18533. </dd>
  18534. <dt>&lsquo;<samp>B</samp>&rsquo;</dt>
  18535. <dd><p>Capture bottom-first, transfer unknown or varying.
  18536. Filter selects among &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis.
  18537. </p>
  18538. </dd>
  18539. <dt>&lsquo;<samp>A</samp>&rsquo;</dt>
  18540. <dd><p>Capture determined by field flags, transfer unknown or varying.
  18541. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using field flags and
  18542. image analysis. If no field information is available, then this works just
  18543. like &lsquo;<samp>U</samp>&rsquo;. This is the default mode.
  18544. </p>
  18545. </dd>
  18546. <dt>&lsquo;<samp>U</samp>&rsquo;</dt>
  18547. <dd><p>Both capture and transfer unknown or varying.
  18548. Filter selects among &lsquo;<samp>t</samp>&rsquo;, &lsquo;<samp>b</samp>&rsquo; and &lsquo;<samp>p</samp>&rsquo; using image analysis only.
  18549. </p></dd>
  18550. </dl>
  18551. </dd>
  18552. </dl>
  18553. <a name="Commands-111"></a>
  18554. <h4 class="subsection">11.165.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>
  18555. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  18556. </p>
  18557. <a name="photosensitivity"></a>
  18558. <h3 class="section">11.166 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>
  18559. <p>Reduce various flashes in video, so to help users with epilepsy.
  18560. </p>
  18561. <p>It accepts the following options:
  18562. </p><dl compact="compact">
  18563. <dt><samp>frames, f</samp></dt>
  18564. <dd><p>Set how many frames to use when filtering. Default is 30.
  18565. </p>
  18566. </dd>
  18567. <dt><samp>threshold, t</samp></dt>
  18568. <dd><p>Set detection threshold factor. Default is 1.
  18569. Lower is stricter.
  18570. </p>
  18571. </dd>
  18572. <dt><samp>skip</samp></dt>
  18573. <dd><p>Set how many pixels to skip when sampling frames. Default is 1.
  18574. Allowed range is from 1 to 1024.
  18575. </p>
  18576. </dd>
  18577. <dt><samp>bypass</samp></dt>
  18578. <dd><p>Leave frames unchanged. Default is disabled.
  18579. </p></dd>
  18580. </dl>
  18581. <a name="pixdesctest"></a>
  18582. <h3 class="section">11.167 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>
  18583. <p>Pixel format descriptor test filter, mainly useful for internal
  18584. testing. The output video should be equal to the input video.
  18585. </p>
  18586. <p>For example:
  18587. </p><div class="example">
  18588. <pre class="example">format=monow, pixdesctest
  18589. </pre></div>
  18590. <p>can be used to test the monowhite pixel format descriptor definition.
  18591. </p>
  18592. <a name="pixscope"></a>
  18593. <h3 class="section">11.168 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>
  18594. <p>Display sample values of color channels. Mainly useful for checking color
  18595. and levels. Minimum supported resolution is 640x480.
  18596. </p>
  18597. <p>The filters accept the following options:
  18598. </p>
  18599. <dl compact="compact">
  18600. <dt><samp>x</samp></dt>
  18601. <dd><p>Set scope X position, relative offset on X axis.
  18602. </p>
  18603. </dd>
  18604. <dt><samp>y</samp></dt>
  18605. <dd><p>Set scope Y position, relative offset on Y axis.
  18606. </p>
  18607. </dd>
  18608. <dt><samp>w</samp></dt>
  18609. <dd><p>Set scope width.
  18610. </p>
  18611. </dd>
  18612. <dt><samp>h</samp></dt>
  18613. <dd><p>Set scope height.
  18614. </p>
  18615. </dd>
  18616. <dt><samp>o</samp></dt>
  18617. <dd><p>Set window opacity. This window also holds statistics about pixel area.
  18618. </p>
  18619. </dd>
  18620. <dt><samp>wx</samp></dt>
  18621. <dd><p>Set window X position, relative offset on X axis.
  18622. </p>
  18623. </dd>
  18624. <dt><samp>wy</samp></dt>
  18625. <dd><p>Set window Y position, relative offset on Y axis.
  18626. </p></dd>
  18627. </dl>
  18628. <a name="Commands-112"></a>
  18629. <h4 class="subsection">11.168.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>
  18630. <p>This filter supports same <a href="#commands">commands</a> as options.
  18631. </p>
  18632. <a name="pp"></a>
  18633. <h3 class="section">11.169 pp<span class="pull-right"><a class="anchor hidden-xs" href="#pp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-pp" aria-hidden="true">TOC</a></span></h3>
  18634. <p>Enable the specified chain of postprocessing subfilters using libpostproc. This
  18635. library should be automatically selected with a GPL build (<code>--enable-gpl</code>).
  18636. Subfilters must be separated by &rsquo;/&rsquo; and can be disabled by prepending a &rsquo;-&rsquo;.
  18637. Each subfilter and some options have a short and a long name that can be used
  18638. interchangeably, i.e. dr/dering are the same.
  18639. </p>
  18640. <p>The filters accept the following options:
  18641. </p>
  18642. <dl compact="compact">
  18643. <dt><samp>subfilters</samp></dt>
  18644. <dd><p>Set postprocessing subfilters string.
  18645. </p></dd>
  18646. </dl>
  18647. <p>All subfilters share common options to determine their scope:
  18648. </p>
  18649. <dl compact="compact">
  18650. <dt><samp>a/autoq</samp></dt>
  18651. <dd><p>Honor the quality commands for this subfilter.
  18652. </p>
  18653. </dd>
  18654. <dt><samp>c/chrom</samp></dt>
  18655. <dd><p>Do chrominance filtering, too (default).
  18656. </p>
  18657. </dd>
  18658. <dt><samp>y/nochrom</samp></dt>
  18659. <dd><p>Do luminance filtering only (no chrominance).
  18660. </p>
  18661. </dd>
  18662. <dt><samp>n/noluma</samp></dt>
  18663. <dd><p>Do chrominance filtering only (no luminance).
  18664. </p></dd>
  18665. </dl>
  18666. <p>These options can be appended after the subfilter name, separated by a &rsquo;|&rsquo;.
  18667. </p>
  18668. <p>Available subfilters are:
  18669. </p>
  18670. <dl compact="compact">
  18671. <dt><samp>hb/hdeblock[|difference[|flatness]]</samp></dt>
  18672. <dd><p>Horizontal deblocking filter
  18673. </p><dl compact="compact">
  18674. <dt><samp>difference</samp></dt>
  18675. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  18676. </p></dd>
  18677. <dt><samp>flatness</samp></dt>
  18678. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  18679. </p></dd>
  18680. </dl>
  18681. </dd>
  18682. <dt><samp>vb/vdeblock[|difference[|flatness]]</samp></dt>
  18683. <dd><p>Vertical deblocking filter
  18684. </p><dl compact="compact">
  18685. <dt><samp>difference</samp></dt>
  18686. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  18687. </p></dd>
  18688. <dt><samp>flatness</samp></dt>
  18689. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  18690. </p></dd>
  18691. </dl>
  18692. </dd>
  18693. <dt><samp>ha/hadeblock[|difference[|flatness]]</samp></dt>
  18694. <dd><p>Accurate horizontal deblocking filter
  18695. </p><dl compact="compact">
  18696. <dt><samp>difference</samp></dt>
  18697. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  18698. </p></dd>
  18699. <dt><samp>flatness</samp></dt>
  18700. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  18701. </p></dd>
  18702. </dl>
  18703. </dd>
  18704. <dt><samp>va/vadeblock[|difference[|flatness]]</samp></dt>
  18705. <dd><p>Accurate vertical deblocking filter
  18706. </p><dl compact="compact">
  18707. <dt><samp>difference</samp></dt>
  18708. <dd><p>Difference factor where higher values mean more deblocking (default: <code>32</code>).
  18709. </p></dd>
  18710. <dt><samp>flatness</samp></dt>
  18711. <dd><p>Flatness threshold where lower values mean more deblocking (default: <code>39</code>).
  18712. </p></dd>
  18713. </dl>
  18714. </dd>
  18715. </dl>
  18716. <p>The horizontal and vertical deblocking filters share the difference and
  18717. flatness values so you cannot set different horizontal and vertical
  18718. thresholds.
  18719. </p>
  18720. <dl compact="compact">
  18721. <dt><samp>h1/x1hdeblock</samp></dt>
  18722. <dd><p>Experimental horizontal deblocking filter
  18723. </p>
  18724. </dd>
  18725. <dt><samp>v1/x1vdeblock</samp></dt>
  18726. <dd><p>Experimental vertical deblocking filter
  18727. </p>
  18728. </dd>
  18729. <dt><samp>dr/dering</samp></dt>
  18730. <dd><p>Deringing filter
  18731. </p>
  18732. </dd>
  18733. <dt><samp>tn/tmpnoise[|threshold1[|threshold2[|threshold3]]], temporal noise reducer</samp></dt>
  18734. <dd><dl compact="compact">
  18735. <dt><samp>threshold1</samp></dt>
  18736. <dd><p>larger -&gt; stronger filtering
  18737. </p></dd>
  18738. <dt><samp>threshold2</samp></dt>
  18739. <dd><p>larger -&gt; stronger filtering
  18740. </p></dd>
  18741. <dt><samp>threshold3</samp></dt>
  18742. <dd><p>larger -&gt; stronger filtering
  18743. </p></dd>
  18744. </dl>
  18745. </dd>
  18746. <dt><samp>al/autolevels[:f/fullyrange], automatic brightness / contrast correction</samp></dt>
  18747. <dd><dl compact="compact">
  18748. <dt><samp>f/fullyrange</samp></dt>
  18749. <dd><p>Stretch luminance to <code>0-255</code>.
  18750. </p></dd>
  18751. </dl>
  18752. </dd>
  18753. <dt><samp>lb/linblenddeint</samp></dt>
  18754. <dd><p>Linear blend deinterlacing filter that deinterlaces the given block by
  18755. filtering all lines with a <code>(1 2 1)</code> filter.
  18756. </p>
  18757. </dd>
  18758. <dt><samp>li/linipoldeint</samp></dt>
  18759. <dd><p>Linear interpolating deinterlacing filter that deinterlaces the given block by
  18760. linearly interpolating every second line.
  18761. </p>
  18762. </dd>
  18763. <dt><samp>ci/cubicipoldeint</samp></dt>
  18764. <dd><p>Cubic interpolating deinterlacing filter deinterlaces the given block by
  18765. cubically interpolating every second line.
  18766. </p>
  18767. </dd>
  18768. <dt><samp>md/mediandeint</samp></dt>
  18769. <dd><p>Median deinterlacing filter that deinterlaces the given block by applying a
  18770. median filter to every second line.
  18771. </p>
  18772. </dd>
  18773. <dt><samp>fd/ffmpegdeint</samp></dt>
  18774. <dd><p>FFmpeg deinterlacing filter that deinterlaces the given block by filtering every
  18775. second line with a <code>(-1 4 2 4 -1)</code> filter.
  18776. </p>
  18777. </dd>
  18778. <dt><samp>l5/lowpass5</samp></dt>
  18779. <dd><p>Vertically applied FIR lowpass deinterlacing filter that deinterlaces the given
  18780. block by filtering all lines with a <code>(-1 2 6 2 -1)</code> filter.
  18781. </p>
  18782. </dd>
  18783. <dt><samp>fq/forceQuant[|quantizer]</samp></dt>
  18784. <dd><p>Overrides the quantizer table from the input with the constant quantizer you
  18785. specify.
  18786. </p><dl compact="compact">
  18787. <dt><samp>quantizer</samp></dt>
  18788. <dd><p>Quantizer to use
  18789. </p></dd>
  18790. </dl>
  18791. </dd>
  18792. <dt><samp>de/default</samp></dt>
  18793. <dd><p>Default pp filter combination (<code>hb|a,vb|a,dr|a</code>)
  18794. </p>
  18795. </dd>
  18796. <dt><samp>fa/fast</samp></dt>
  18797. <dd><p>Fast pp filter combination (<code>h1|a,v1|a,dr|a</code>)
  18798. </p>
  18799. </dd>
  18800. <dt><samp>ac</samp></dt>
  18801. <dd><p>High quality pp filter combination (<code>ha|a|128|7,va|a,dr|a</code>)
  18802. </p></dd>
  18803. </dl>
  18804. <a name="Examples-92"></a>
  18805. <h4 class="subsection">11.169.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>
  18806. <ul>
  18807. <li> Apply horizontal and vertical deblocking, deringing and automatic
  18808. brightness/contrast:
  18809. <div class="example">
  18810. <pre class="example">pp=hb/vb/dr/al
  18811. </pre></div>
  18812. </li><li> Apply default filters without brightness/contrast correction:
  18813. <div class="example">
  18814. <pre class="example">pp=de/-al
  18815. </pre></div>
  18816. </li><li> Apply default filters and temporal denoiser:
  18817. <div class="example">
  18818. <pre class="example">pp=default/tmpnoise|1|2|3
  18819. </pre></div>
  18820. </li><li> Apply deblocking on luminance only, and switch vertical deblocking on or off
  18821. automatically depending on available CPU time:
  18822. <div class="example">
  18823. <pre class="example">pp=hb|y/vb|a
  18824. </pre></div>
  18825. </li></ul>
  18826. <a name="pp7"></a>
  18827. <h3 class="section">11.170 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>
  18828. <p>Apply Postprocessing filter 7. It is variant of the <a href="#spp">spp</a> filter,
  18829. similar to spp = 6 with 7 point DCT, where only the center sample is
  18830. used after IDCT.
  18831. </p>
  18832. <p>The filter accepts the following options:
  18833. </p>
  18834. <dl compact="compact">
  18835. <dt><samp>qp</samp></dt>
  18836. <dd><p>Force a constant quantization parameter. It accepts an integer in range
  18837. 0 to 63. If not set, the filter will use the QP from the video stream
  18838. (if available).
  18839. </p>
  18840. </dd>
  18841. <dt><samp>mode</samp></dt>
  18842. <dd><p>Set thresholding mode. Available modes are:
  18843. </p>
  18844. <dl compact="compact">
  18845. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  18846. <dd><p>Set hard thresholding.
  18847. </p></dd>
  18848. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  18849. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  18850. </p></dd>
  18851. <dt>&lsquo;<samp>medium</samp>&rsquo;</dt>
  18852. <dd><p>Set medium thresholding (good results, default).
  18853. </p></dd>
  18854. </dl>
  18855. </dd>
  18856. </dl>
  18857. <a name="premultiply"></a>
  18858. <h3 class="section">11.171 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>
  18859. <p>Apply alpha premultiply effect to input video stream using first plane
  18860. of second stream as alpha.
  18861. </p>
  18862. <p>Both streams must have same dimensions and same pixel format.
  18863. </p>
  18864. <p>The filter accepts the following option:
  18865. </p>
  18866. <dl compact="compact">
  18867. <dt><samp>planes</samp></dt>
  18868. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  18869. By default value 0xf, all planes will be processed.
  18870. </p>
  18871. </dd>
  18872. <dt><samp>inplace</samp></dt>
  18873. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  18874. </p></dd>
  18875. </dl>
  18876. <a name="prewitt"></a>
  18877. <h3 class="section">11.172 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>
  18878. <p>Apply prewitt operator to input video stream.
  18879. </p>
  18880. <p>The filter accepts the following option:
  18881. </p>
  18882. <dl compact="compact">
  18883. <dt><samp>planes</samp></dt>
  18884. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  18885. By default value 0xf, all planes will be processed.
  18886. </p>
  18887. </dd>
  18888. <dt><samp>scale</samp></dt>
  18889. <dd><p>Set value which will be multiplied with filtered result.
  18890. </p>
  18891. </dd>
  18892. <dt><samp>delta</samp></dt>
  18893. <dd><p>Set value which will be added to filtered result.
  18894. </p></dd>
  18895. </dl>
  18896. <a name="Commands-113"></a>
  18897. <h4 class="subsection">11.172.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>
  18898. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  18899. </p>
  18900. <a name="pseudocolor"></a>
  18901. <h3 class="section">11.173 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>
  18902. <p>Alter frame colors in video with pseudocolors.
  18903. </p>
  18904. <p>This filter accepts the following options:
  18905. </p>
  18906. <dl compact="compact">
  18907. <dt><samp>c0</samp></dt>
  18908. <dd><p>set pixel first component expression
  18909. </p>
  18910. </dd>
  18911. <dt><samp>c1</samp></dt>
  18912. <dd><p>set pixel second component expression
  18913. </p>
  18914. </dd>
  18915. <dt><samp>c2</samp></dt>
  18916. <dd><p>set pixel third component expression
  18917. </p>
  18918. </dd>
  18919. <dt><samp>c3</samp></dt>
  18920. <dd><p>set pixel fourth component expression, corresponds to the alpha component
  18921. </p>
  18922. </dd>
  18923. <dt><samp>index, i</samp></dt>
  18924. <dd><p>set component to use as base for altering colors
  18925. </p>
  18926. </dd>
  18927. <dt><samp>preset, p</samp></dt>
  18928. <dd><p>Pick one of built-in LUTs. By default is set to none.
  18929. </p>
  18930. <p>Available LUTs:
  18931. </p><dl compact="compact">
  18932. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  18933. <dt>&lsquo;<samp>inferno</samp>&rsquo;</dt>
  18934. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  18935. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  18936. <dt>&lsquo;<samp>turbo</samp>&rsquo;</dt>
  18937. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  18938. <dt>&lsquo;<samp>range1</samp>&rsquo;</dt>
  18939. <dt>&lsquo;<samp>range2</samp>&rsquo;</dt>
  18940. <dt>&lsquo;<samp>shadows</samp>&rsquo;</dt>
  18941. <dt>&lsquo;<samp>highlights</samp>&rsquo;</dt>
  18942. </dl>
  18943. </dd>
  18944. <dt><samp>opacity</samp></dt>
  18945. <dd><p>Set opacity of output colors. Allowed range is from 0 to 1.
  18946. Default value is set to 1.
  18947. </p></dd>
  18948. </dl>
  18949. <p>Each of the expression options specifies the expression to use for computing
  18950. the lookup table for the corresponding pixel component values.
  18951. </p>
  18952. <p>The expressions can contain the following constants and functions:
  18953. </p>
  18954. <dl compact="compact">
  18955. <dt><samp>w</samp></dt>
  18956. <dt><samp>h</samp></dt>
  18957. <dd><p>The input width and height.
  18958. </p>
  18959. </dd>
  18960. <dt><samp>val</samp></dt>
  18961. <dd><p>The input value for the pixel component.
  18962. </p>
  18963. </dd>
  18964. <dt><samp>ymin, umin, vmin, amin</samp></dt>
  18965. <dd><p>The minimum allowed component value.
  18966. </p>
  18967. </dd>
  18968. <dt><samp>ymax, umax, vmax, amax</samp></dt>
  18969. <dd><p>The maximum allowed component value.
  18970. </p></dd>
  18971. </dl>
  18972. <p>All expressions default to &quot;val&quot;.
  18973. </p>
  18974. <a name="Commands-114"></a>
  18975. <h4 class="subsection">11.173.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>
  18976. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  18977. </p>
  18978. <a name="Examples-93"></a>
  18979. <h4 class="subsection">11.173.2 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>
  18980. <ul>
  18981. <li> Change too high luma values to gradient:
  18982. <div class="example">
  18983. <pre class="example">pseudocolor=&quot;'if(between(val,ymax,amax),lerp(ymin,ymax,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(umax,umin,(val-ymax)/(amax-ymax)),-1):if(between(val,ymax,amax),lerp(vmin,vmax,(val-ymax)/(amax-ymax)),-1):-1'&quot;
  18984. </pre></div>
  18985. </li></ul>
  18986. <a name="psnr"></a>
  18987. <h3 class="section">11.174 psnr<span class="pull-right"><a class="anchor hidden-xs" href="#psnr" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-psnr" aria-hidden="true">TOC</a></span></h3>
  18988. <p>Obtain the average, maximum and minimum PSNR (Peak Signal to Noise
  18989. Ratio) between two input videos.
  18990. </p>
  18991. <p>This filter takes in input two input videos, the first input is
  18992. considered the &quot;main&quot; source and is passed unchanged to the
  18993. output. The second input is used as a &quot;reference&quot; video for computing
  18994. the PSNR.
  18995. </p>
  18996. <p>Both video inputs must have the same resolution and pixel format for
  18997. this filter to work correctly. Also it assumes that both inputs
  18998. have the same number of frames, which are compared one by one.
  18999. </p>
  19000. <p>The obtained average PSNR is printed through the logging system.
  19001. </p>
  19002. <p>The filter stores the accumulated MSE (mean squared error) of each
  19003. frame, and at the end of the processing it is averaged across all frames
  19004. equally, and the following formula is applied to obtain the PSNR:
  19005. </p>
  19006. <div class="example">
  19007. <pre class="example">PSNR = 10*log10(MAX^2/MSE)
  19008. </pre></div>
  19009. <p>Where MAX is the average of the maximum values of each component of the
  19010. image.
  19011. </p>
  19012. <p>The description of the accepted parameters follows.
  19013. </p>
  19014. <dl compact="compact">
  19015. <dt><samp>stats_file, f</samp></dt>
  19016. <dd><p>If specified the filter will use the named file to save the PSNR of
  19017. each individual frame. When filename equals &quot;-&quot; the data is sent to
  19018. standard output.
  19019. </p>
  19020. </dd>
  19021. <dt><samp>stats_version</samp></dt>
  19022. <dd><p>Specifies which version of the stats file format to use. Details of
  19023. each format are written below.
  19024. Default value is 1.
  19025. </p>
  19026. </dd>
  19027. <dt><samp>stats_add_max</samp></dt>
  19028. <dd><p>Determines whether the max value is output to the stats log.
  19029. Default value is 0.
  19030. Requires stats_version &gt;= 2. If this is set and stats_version &lt; 2,
  19031. the filter will return an error.
  19032. </p></dd>
  19033. </dl>
  19034. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  19035. </p>
  19036. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  19037. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  19038. couple of frames.
  19039. </p>
  19040. <p>If a <var>stats_version</var> greater than 1 is specified, a header line precedes
  19041. the list of per-frame-pair stats, with key value pairs following the frame
  19042. format with the following parameters:
  19043. </p>
  19044. <dl compact="compact">
  19045. <dt><samp>psnr_log_version</samp></dt>
  19046. <dd><p>The version of the log file format. Will match <var>stats_version</var>.
  19047. </p>
  19048. </dd>
  19049. <dt><samp>fields</samp></dt>
  19050. <dd><p>A comma separated list of the per-frame-pair parameters included in
  19051. the log.
  19052. </p></dd>
  19053. </dl>
  19054. <p>A description of each shown per-frame-pair parameter follows:
  19055. </p>
  19056. <dl compact="compact">
  19057. <dt><samp>n</samp></dt>
  19058. <dd><p>sequential number of the input frame, starting from 1
  19059. </p>
  19060. </dd>
  19061. <dt><samp>mse_avg</samp></dt>
  19062. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  19063. frames, averaged over all the image components.
  19064. </p>
  19065. </dd>
  19066. <dt><samp>mse_y, mse_u, mse_v, mse_r, mse_g, mse_b, mse_a</samp></dt>
  19067. <dd><p>Mean Square Error pixel-by-pixel average difference of the compared
  19068. frames for the component specified by the suffix.
  19069. </p>
  19070. </dd>
  19071. <dt><samp>psnr_y, psnr_u, psnr_v, psnr_r, psnr_g, psnr_b, psnr_a</samp></dt>
  19072. <dd><p>Peak Signal to Noise ratio of the compared frames for the component
  19073. specified by the suffix.
  19074. </p>
  19075. </dd>
  19076. <dt><samp>max_avg, max_y, max_u, max_v</samp></dt>
  19077. <dd><p>Maximum allowed value for each channel, and average over all
  19078. channels.
  19079. </p></dd>
  19080. </dl>
  19081. <a name="Examples-94"></a>
  19082. <h4 class="subsection">11.174.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>
  19083. <ul>
  19084. <li> For example:
  19085. <div class="example">
  19086. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  19087. [main][ref] psnr=&quot;stats_file=stats.log&quot; [out]
  19088. </pre></div>
  19089. <p>On this example the input file being processed is compared with the
  19090. reference file <samp>ref_movie.mpg</samp>. The PSNR of each individual frame
  19091. is stored in <samp>stats.log</samp>.
  19092. </p>
  19093. </li><li> Another example with different containers:
  19094. <div class="example">
  19095. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]psnr&quot; -f null -
  19096. </pre></div>
  19097. </li></ul>
  19098. <span id="pullup"></span><a name="pullup-1"></a>
  19099. <h3 class="section">11.175 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>
  19100. <p>Pulldown reversal (inverse telecine) filter, capable of handling mixed
  19101. hard-telecine, 24000/1001 fps progressive, and 30000/1001 fps progressive
  19102. content.
  19103. </p>
  19104. <p>The pullup filter is designed to take advantage of future context in making
  19105. its decisions. This filter is stateless in the sense that it does not lock
  19106. onto a pattern to follow, but it instead looks forward to the following
  19107. fields in order to identify matches and rebuild progressive frames.
  19108. </p>
  19109. <p>To produce content with an even framerate, insert the fps filter after
  19110. pullup, use <code>fps=24000/1001</code> if the input frame rate is 29.97fps,
  19111. <code>fps=24</code> for 30fps and the (rare) telecined 25fps input.
  19112. </p>
  19113. <p>The filter accepts the following options:
  19114. </p>
  19115. <dl compact="compact">
  19116. <dt><samp>jl</samp></dt>
  19117. <dt><samp>jr</samp></dt>
  19118. <dt><samp>jt</samp></dt>
  19119. <dt><samp>jb</samp></dt>
  19120. <dd><p>These options set the amount of &quot;junk&quot; to ignore at the left, right, top, and
  19121. bottom of the image, respectively. Left and right are in units of 8 pixels,
  19122. while top and bottom are in units of 2 lines.
  19123. The default is 8 pixels on each side.
  19124. </p>
  19125. </dd>
  19126. <dt><samp>sb</samp></dt>
  19127. <dd><p>Set the strict breaks. Setting this option to 1 will reduce the chances of
  19128. filter generating an occasional mismatched frame, but it may also cause an
  19129. excessive number of frames to be dropped during high motion sequences.
  19130. Conversely, setting it to -1 will make filter match fields more easily.
  19131. This may help processing of video where there is slight blurring between
  19132. the fields, but may also cause there to be interlaced frames in the output.
  19133. Default value is <code>0</code>.
  19134. </p>
  19135. </dd>
  19136. <dt><samp>mp</samp></dt>
  19137. <dd><p>Set the metric plane to use. It accepts the following values:
  19138. </p><dl compact="compact">
  19139. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  19140. <dd><p>Use luma plane.
  19141. </p>
  19142. </dd>
  19143. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  19144. <dd><p>Use chroma blue plane.
  19145. </p>
  19146. </dd>
  19147. <dt>&lsquo;<samp>v</samp>&rsquo;</dt>
  19148. <dd><p>Use chroma red plane.
  19149. </p></dd>
  19150. </dl>
  19151. <p>This option may be set to use chroma plane instead of the default luma plane
  19152. for doing filter&rsquo;s computations. This may improve accuracy on very clean
  19153. source material, but more likely will decrease accuracy, especially if there
  19154. is chroma noise (rainbow effect) or any grayscale video.
  19155. The main purpose of setting <samp>mp</samp> to a chroma plane is to reduce CPU
  19156. load and make pullup usable in realtime on slow machines.
  19157. </p></dd>
  19158. </dl>
  19159. <p>For best results (without duplicated frames in the output file) it is
  19160. necessary to change the output frame rate. For example, to inverse
  19161. telecine NTSC input:
  19162. </p><div class="example">
  19163. <pre class="example">ffmpeg -i input -vf pullup -r 24000/1001 ...
  19164. </pre></div>
  19165. <a name="qp"></a>
  19166. <h3 class="section">11.176 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>
  19167. <p>Change video quantization parameters (QP).
  19168. </p>
  19169. <p>The filter accepts the following option:
  19170. </p>
  19171. <dl compact="compact">
  19172. <dt><samp>qp</samp></dt>
  19173. <dd><p>Set expression for quantization parameter.
  19174. </p></dd>
  19175. </dl>
  19176. <p>The expression is evaluated through the eval API and can contain, among others,
  19177. the following constants:
  19178. </p>
  19179. <dl compact="compact">
  19180. <dt><var>known</var></dt>
  19181. <dd><p>1 if index is not 129, 0 otherwise.
  19182. </p>
  19183. </dd>
  19184. <dt><var>qp</var></dt>
  19185. <dd><p>Sequential index starting from -129 to 128.
  19186. </p></dd>
  19187. </dl>
  19188. <a name="Examples-95"></a>
  19189. <h4 class="subsection">11.176.1 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>
  19190. <ul>
  19191. <li> Some equation like:
  19192. <div class="example">
  19193. <pre class="example">qp=2+2*sin(PI*qp)
  19194. </pre></div>
  19195. </li></ul>
  19196. <a name="random"></a>
  19197. <h3 class="section">11.177 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>
  19198. <p>Flush video frames from internal cache of frames into a random order.
  19199. No frame is discarded.
  19200. Inspired by <a href="#frei0r">frei0r</a> nervous filter.
  19201. </p>
  19202. <dl compact="compact">
  19203. <dt><samp>frames</samp></dt>
  19204. <dd><p>Set size in number of frames of internal cache, in range from <code>2</code> to
  19205. <code>512</code>. Default is <code>30</code>.
  19206. </p>
  19207. </dd>
  19208. <dt><samp>seed</samp></dt>
  19209. <dd><p>Set seed for random number generator, must be an integer included between
  19210. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  19211. less than <code>0</code>, the filter will try to use a good random seed on a
  19212. best effort basis.
  19213. </p></dd>
  19214. </dl>
  19215. <a name="readeia608"></a>
  19216. <h3 class="section">11.178 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>
  19217. <p>Read closed captioning (EIA-608) information from the top lines of a video frame.
  19218. </p>
  19219. <p>This filter adds frame metadata for <code>lavfi.readeia608.X.cc</code> and
  19220. <code>lavfi.readeia608.X.line</code>, where <code>X</code> is the number of the identified line
  19221. with EIA-608 data (starting from 0). A description of each metadata value follows:
  19222. </p>
  19223. <dl compact="compact">
  19224. <dt><samp>lavfi.readeia608.X.cc</samp></dt>
  19225. <dd><p>The two bytes stored as EIA-608 data (printed in hexadecimal).
  19226. </p>
  19227. </dd>
  19228. <dt><samp>lavfi.readeia608.X.line</samp></dt>
  19229. <dd><p>The number of the line on which the EIA-608 data was identified and read.
  19230. </p></dd>
  19231. </dl>
  19232. <p>This filter accepts the following options:
  19233. </p>
  19234. <dl compact="compact">
  19235. <dt><samp>scan_min</samp></dt>
  19236. <dd><p>Set the line to start scanning for EIA-608 data. Default is <code>0</code>.
  19237. </p>
  19238. </dd>
  19239. <dt><samp>scan_max</samp></dt>
  19240. <dd><p>Set the line to end scanning for EIA-608 data. Default is <code>29</code>.
  19241. </p>
  19242. </dd>
  19243. <dt><samp>spw</samp></dt>
  19244. <dd><p>Set the ratio of width reserved for sync code detection.
  19245. Default is <code>0.27</code>. Allowed range is <code>[0.1 - 0.7]</code>.
  19246. </p>
  19247. </dd>
  19248. <dt><samp>chp</samp></dt>
  19249. <dd><p>Enable checking the parity bit. In the event of a parity error, the filter will output
  19250. <code>0x00</code> for that character. Default is false.
  19251. </p>
  19252. </dd>
  19253. <dt><samp>lp</samp></dt>
  19254. <dd><p>Lowpass lines prior to further processing. Default is enabled.
  19255. </p></dd>
  19256. </dl>
  19257. <a name="Commands-115"></a>
  19258. <h4 class="subsection">11.178.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>
  19259. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  19260. </p>
  19261. <a name="Examples-96"></a>
  19262. <h4 class="subsection">11.178.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>
  19263. <ul>
  19264. <li> Output a csv with presentation time and the first two lines of identified EIA-608 captioning data.
  19265. <div class="example">
  19266. <pre class="example">ffprobe -f lavfi -i movie=captioned_video.mov,readeia608 -show_entries frame=pkt_pts_time:frame_tags=lavfi.readeia608.0.cc,lavfi.readeia608.1.cc -of csv
  19267. </pre></div>
  19268. </li></ul>
  19269. <a name="readvitc"></a>
  19270. <h3 class="section">11.179 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>
  19271. <p>Read vertical interval timecode (VITC) information from the top lines of a
  19272. video frame.
  19273. </p>
  19274. <p>The filter adds frame metadata key <code>lavfi.readvitc.tc_str</code> with the
  19275. timecode value, if a valid timecode has been detected. Further metadata key
  19276. <code>lavfi.readvitc.found</code> is set to 0/1 depending on whether
  19277. timecode data has been found or not.
  19278. </p>
  19279. <p>This filter accepts the following options:
  19280. </p>
  19281. <dl compact="compact">
  19282. <dt><samp>scan_max</samp></dt>
  19283. <dd><p>Set the maximum number of lines to scan for VITC data. If the value is set to
  19284. <code>-1</code> the full video frame is scanned. Default is <code>45</code>.
  19285. </p>
  19286. </dd>
  19287. <dt><samp>thr_b</samp></dt>
  19288. <dd><p>Set the luma threshold for black. Accepts float numbers in the range [0.0,1.0],
  19289. default value is <code>0.2</code>. The value must be equal or less than <code>thr_w</code>.
  19290. </p>
  19291. </dd>
  19292. <dt><samp>thr_w</samp></dt>
  19293. <dd><p>Set the luma threshold for white. Accepts float numbers in the range [0.0,1.0],
  19294. default value is <code>0.6</code>. The value must be equal or greater than <code>thr_b</code>.
  19295. </p></dd>
  19296. </dl>
  19297. <a name="Examples-97"></a>
  19298. <h4 class="subsection">11.179.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>
  19299. <ul>
  19300. <li> Detect and draw VITC data onto the video frame; if no valid VITC is detected,
  19301. draw <code>--:--:--:--</code> as a placeholder:
  19302. <div class="example">
  19303. <pre class="example">ffmpeg -i input.avi -filter:v 'readvitc,drawtext=fontfile=FreeMono.ttf:text=%{metadata\\:lavfi.readvitc.tc_str\\:--\\\\\\:--\\\\\\:--\\\\\\:--}:x=(w-tw)/2:y=400-ascent'
  19304. </pre></div>
  19305. </li></ul>
  19306. <a name="remap"></a>
  19307. <h3 class="section">11.180 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>
  19308. <p>Remap pixels using 2nd: Xmap and 3rd: Ymap input video stream.
  19309. </p>
  19310. <p>Destination pixel at position (X, Y) will be picked from source (x, y) position
  19311. where x = Xmap(X, Y) and y = Ymap(X, Y). If mapping values are out of range, zero
  19312. value for pixel will be used for destination pixel.
  19313. </p>
  19314. <p>Xmap and Ymap input video streams must be of same dimensions. Output video stream
  19315. will have Xmap/Ymap video stream dimensions.
  19316. Xmap and Ymap input video streams are 16bit depth, single channel.
  19317. </p>
  19318. <dl compact="compact">
  19319. <dt><samp>format</samp></dt>
  19320. <dd><p>Specify pixel format of output from this filter. Can be <code>color</code> or <code>gray</code>.
  19321. Default is <code>color</code>.
  19322. </p>
  19323. </dd>
  19324. <dt><samp>fill</samp></dt>
  19325. <dd><p>Specify the color of the unmapped pixels. For the syntax of this option,
  19326. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  19327. manual</a>. Default color is <code>black</code>.
  19328. </p></dd>
  19329. </dl>
  19330. <a name="removegrain"></a>
  19331. <h3 class="section">11.181 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>
  19332. <p>The removegrain filter is a spatial denoiser for progressive video.
  19333. </p>
  19334. <dl compact="compact">
  19335. <dt><samp>m0</samp></dt>
  19336. <dd><p>Set mode for the first plane.
  19337. </p>
  19338. </dd>
  19339. <dt><samp>m1</samp></dt>
  19340. <dd><p>Set mode for the second plane.
  19341. </p>
  19342. </dd>
  19343. <dt><samp>m2</samp></dt>
  19344. <dd><p>Set mode for the third plane.
  19345. </p>
  19346. </dd>
  19347. <dt><samp>m3</samp></dt>
  19348. <dd><p>Set mode for the fourth plane.
  19349. </p></dd>
  19350. </dl>
  19351. <p>Range of mode is from 0 to 24. Description of each mode follows:
  19352. </p>
  19353. <dl compact="compact">
  19354. <dt><var>0</var></dt>
  19355. <dd><p>Leave input plane unchanged. Default.
  19356. </p>
  19357. </dd>
  19358. <dt><var>1</var></dt>
  19359. <dd><p>Clips the pixel with the minimum and maximum of the 8 neighbour pixels.
  19360. </p>
  19361. </dd>
  19362. <dt><var>2</var></dt>
  19363. <dd><p>Clips the pixel with the second minimum and maximum of the 8 neighbour pixels.
  19364. </p>
  19365. </dd>
  19366. <dt><var>3</var></dt>
  19367. <dd><p>Clips the pixel with the third minimum and maximum of the 8 neighbour pixels.
  19368. </p>
  19369. </dd>
  19370. <dt><var>4</var></dt>
  19371. <dd><p>Clips the pixel with the fourth minimum and maximum of the 8 neighbour pixels.
  19372. This is equivalent to a median filter.
  19373. </p>
  19374. </dd>
  19375. <dt><var>5</var></dt>
  19376. <dd><p>Line-sensitive clipping giving the minimal change.
  19377. </p>
  19378. </dd>
  19379. <dt><var>6</var></dt>
  19380. <dd><p>Line-sensitive clipping, intermediate.
  19381. </p>
  19382. </dd>
  19383. <dt><var>7</var></dt>
  19384. <dd><p>Line-sensitive clipping, intermediate.
  19385. </p>
  19386. </dd>
  19387. <dt><var>8</var></dt>
  19388. <dd><p>Line-sensitive clipping, intermediate.
  19389. </p>
  19390. </dd>
  19391. <dt><var>9</var></dt>
  19392. <dd><p>Line-sensitive clipping on a line where the neighbours pixels are the closest.
  19393. </p>
  19394. </dd>
  19395. <dt><var>10</var></dt>
  19396. <dd><p>Replaces the target pixel with the closest neighbour.
  19397. </p>
  19398. </dd>
  19399. <dt><var>11</var></dt>
  19400. <dd><p>[1 2 1] horizontal and vertical kernel blur.
  19401. </p>
  19402. </dd>
  19403. <dt><var>12</var></dt>
  19404. <dd><p>Same as mode 11.
  19405. </p>
  19406. </dd>
  19407. <dt><var>13</var></dt>
  19408. <dd><p>Bob mode, interpolates top field from the line where the neighbours
  19409. pixels are the closest.
  19410. </p>
  19411. </dd>
  19412. <dt><var>14</var></dt>
  19413. <dd><p>Bob mode, interpolates bottom field from the line where the neighbours
  19414. pixels are the closest.
  19415. </p>
  19416. </dd>
  19417. <dt><var>15</var></dt>
  19418. <dd><p>Bob mode, interpolates top field. Same as 13 but with a more complicated
  19419. interpolation formula.
  19420. </p>
  19421. </dd>
  19422. <dt><var>16</var></dt>
  19423. <dd><p>Bob mode, interpolates bottom field. Same as 14 but with a more complicated
  19424. interpolation formula.
  19425. </p>
  19426. </dd>
  19427. <dt><var>17</var></dt>
  19428. <dd><p>Clips the pixel with the minimum and maximum of respectively the maximum and
  19429. minimum of each pair of opposite neighbour pixels.
  19430. </p>
  19431. </dd>
  19432. <dt><var>18</var></dt>
  19433. <dd><p>Line-sensitive clipping using opposite neighbours whose greatest distance from
  19434. the current pixel is minimal.
  19435. </p>
  19436. </dd>
  19437. <dt><var>19</var></dt>
  19438. <dd><p>Replaces the pixel with the average of its 8 neighbours.
  19439. </p>
  19440. </dd>
  19441. <dt><var>20</var></dt>
  19442. <dd><p>Averages the 9 pixels ([1 1 1] horizontal and vertical blur).
  19443. </p>
  19444. </dd>
  19445. <dt><var>21</var></dt>
  19446. <dd><p>Clips pixels using the averages of opposite neighbour.
  19447. </p>
  19448. </dd>
  19449. <dt><var>22</var></dt>
  19450. <dd><p>Same as mode 21 but simpler and faster.
  19451. </p>
  19452. </dd>
  19453. <dt><var>23</var></dt>
  19454. <dd><p>Small edge and halo removal, but reputed useless.
  19455. </p>
  19456. </dd>
  19457. <dt><var>24</var></dt>
  19458. <dd><p>Similar as 23.
  19459. </p></dd>
  19460. </dl>
  19461. <a name="removelogo"></a>
  19462. <h3 class="section">11.182 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>
  19463. <p>Suppress a TV station logo, using an image file to determine which
  19464. pixels comprise the logo. It works by filling in the pixels that
  19465. comprise the logo with neighboring pixels.
  19466. </p>
  19467. <p>The filter accepts the following options:
  19468. </p>
  19469. <dl compact="compact">
  19470. <dt><samp>filename, f</samp></dt>
  19471. <dd><p>Set the filter bitmap file, which can be any image format supported by
  19472. libavformat. The width and height of the image file must match those of the
  19473. video stream being processed.
  19474. </p></dd>
  19475. </dl>
  19476. <p>Pixels in the provided bitmap image with a value of zero are not
  19477. considered part of the logo, non-zero pixels are considered part of
  19478. the logo. If you use white (255) for the logo and black (0) for the
  19479. rest, you will be safe. For making the filter bitmap, it is
  19480. recommended to take a screen capture of a black frame with the logo
  19481. visible, and then using a threshold filter followed by the erode
  19482. filter once or twice.
  19483. </p>
  19484. <p>If needed, little splotches can be fixed manually. Remember that if
  19485. logo pixels are not covered, the filter quality will be much
  19486. reduced. Marking too many pixels as part of the logo does not hurt as
  19487. much, but it will increase the amount of blurring needed to cover over
  19488. the image and will destroy more information than necessary, and extra
  19489. pixels will slow things down on a large logo.
  19490. </p>
  19491. <a name="repeatfields"></a>
  19492. <h3 class="section">11.183 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>
  19493. <p>This filter uses the repeat_field flag from the Video ES headers and hard repeats
  19494. fields based on its value.
  19495. </p>
  19496. <a name="reverse"></a>
  19497. <h3 class="section">11.184 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>
  19498. <p>Reverse a video clip.
  19499. </p>
  19500. <p>Warning: This filter requires memory to buffer the entire clip, so trimming
  19501. is suggested.
  19502. </p>
  19503. <a name="Examples-98"></a>
  19504. <h4 class="subsection">11.184.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>
  19505. <ul>
  19506. <li> Take the first 5 seconds of a clip, and reverse it.
  19507. <div class="example">
  19508. <pre class="example">trim=end=5,reverse
  19509. </pre></div>
  19510. </li></ul>
  19511. <a name="rgbashift"></a>
  19512. <h3 class="section">11.185 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>
  19513. <p>Shift R/G/B/A pixels horizontally and/or vertically.
  19514. </p>
  19515. <p>The filter accepts the following options:
  19516. </p><dl compact="compact">
  19517. <dt><samp>rh</samp></dt>
  19518. <dd><p>Set amount to shift red horizontally.
  19519. </p></dd>
  19520. <dt><samp>rv</samp></dt>
  19521. <dd><p>Set amount to shift red vertically.
  19522. </p></dd>
  19523. <dt><samp>gh</samp></dt>
  19524. <dd><p>Set amount to shift green horizontally.
  19525. </p></dd>
  19526. <dt><samp>gv</samp></dt>
  19527. <dd><p>Set amount to shift green vertically.
  19528. </p></dd>
  19529. <dt><samp>bh</samp></dt>
  19530. <dd><p>Set amount to shift blue horizontally.
  19531. </p></dd>
  19532. <dt><samp>bv</samp></dt>
  19533. <dd><p>Set amount to shift blue vertically.
  19534. </p></dd>
  19535. <dt><samp>ah</samp></dt>
  19536. <dd><p>Set amount to shift alpha horizontally.
  19537. </p></dd>
  19538. <dt><samp>av</samp></dt>
  19539. <dd><p>Set amount to shift alpha vertically.
  19540. </p></dd>
  19541. <dt><samp>edge</samp></dt>
  19542. <dd><p>Set edge mode, can be <var>smear</var>, default, or <var>warp</var>.
  19543. </p></dd>
  19544. </dl>
  19545. <a name="Commands-116"></a>
  19546. <h4 class="subsection">11.185.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>
  19547. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  19548. </p>
  19549. <a name="roberts"></a>
  19550. <h3 class="section">11.186 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>
  19551. <p>Apply roberts cross operator to input video stream.
  19552. </p>
  19553. <p>The filter accepts the following option:
  19554. </p>
  19555. <dl compact="compact">
  19556. <dt><samp>planes</samp></dt>
  19557. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  19558. By default value 0xf, all planes will be processed.
  19559. </p>
  19560. </dd>
  19561. <dt><samp>scale</samp></dt>
  19562. <dd><p>Set value which will be multiplied with filtered result.
  19563. </p>
  19564. </dd>
  19565. <dt><samp>delta</samp></dt>
  19566. <dd><p>Set value which will be added to filtered result.
  19567. </p></dd>
  19568. </dl>
  19569. <a name="Commands-117"></a>
  19570. <h4 class="subsection">11.186.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>
  19571. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  19572. </p>
  19573. <a name="rotate"></a>
  19574. <h3 class="section">11.187 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>
  19575. <p>Rotate video by an arbitrary angle expressed in radians.
  19576. </p>
  19577. <p>The filter accepts the following options:
  19578. </p>
  19579. <p>A description of the optional parameters follows.
  19580. </p><dl compact="compact">
  19581. <dt><samp>angle, a</samp></dt>
  19582. <dd><p>Set an expression for the angle by which to rotate the input video
  19583. clockwise, expressed as a number of radians. A negative value will
  19584. result in a counter-clockwise rotation. By default it is set to &quot;0&quot;.
  19585. </p>
  19586. <p>This expression is evaluated for each frame.
  19587. </p>
  19588. </dd>
  19589. <dt><samp>out_w, ow</samp></dt>
  19590. <dd><p>Set the output width expression, default value is &quot;iw&quot;.
  19591. This expression is evaluated just once during configuration.
  19592. </p>
  19593. </dd>
  19594. <dt><samp>out_h, oh</samp></dt>
  19595. <dd><p>Set the output height expression, default value is &quot;ih&quot;.
  19596. This expression is evaluated just once during configuration.
  19597. </p>
  19598. </dd>
  19599. <dt><samp>bilinear</samp></dt>
  19600. <dd><p>Enable bilinear interpolation if set to 1, a value of 0 disables
  19601. it. Default value is 1.
  19602. </p>
  19603. </dd>
  19604. <dt><samp>fillcolor, c</samp></dt>
  19605. <dd><p>Set the color used to fill the output area not covered by the rotated
  19606. image. For the general syntax of this option, check the
  19607. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  19608. If the special value &quot;none&quot; is selected then no
  19609. background is printed (useful for example if the background is never shown).
  19610. </p>
  19611. <p>Default value is &quot;black&quot;.
  19612. </p></dd>
  19613. </dl>
  19614. <p>The expressions for the angle and the output size can contain the
  19615. following constants and functions:
  19616. </p>
  19617. <dl compact="compact">
  19618. <dt><samp>n</samp></dt>
  19619. <dd><p>sequential number of the input frame, starting from 0. It is always NAN
  19620. before the first frame is filtered.
  19621. </p>
  19622. </dd>
  19623. <dt><samp>t</samp></dt>
  19624. <dd><p>time in seconds of the input frame, it is set to 0 when the filter is
  19625. configured. It is always NAN before the first frame is filtered.
  19626. </p>
  19627. </dd>
  19628. <dt><samp>hsub</samp></dt>
  19629. <dt><samp>vsub</samp></dt>
  19630. <dd><p>horizontal and vertical chroma subsample values. For example for the
  19631. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  19632. </p>
  19633. </dd>
  19634. <dt><samp>in_w, iw</samp></dt>
  19635. <dt><samp>in_h, ih</samp></dt>
  19636. <dd><p>the input video width and height
  19637. </p>
  19638. </dd>
  19639. <dt><samp>out_w, ow</samp></dt>
  19640. <dt><samp>out_h, oh</samp></dt>
  19641. <dd><p>the output width and height, that is the size of the padded area as
  19642. specified by the <var>width</var> and <var>height</var> expressions
  19643. </p>
  19644. </dd>
  19645. <dt><samp>rotw(a)</samp></dt>
  19646. <dt><samp>roth(a)</samp></dt>
  19647. <dd><p>the minimal width/height required for completely containing the input
  19648. video rotated by <var>a</var> radians.
  19649. </p>
  19650. <p>These are only available when computing the <samp>out_w</samp> and
  19651. <samp>out_h</samp> expressions.
  19652. </p></dd>
  19653. </dl>
  19654. <a name="Examples-99"></a>
  19655. <h4 class="subsection">11.187.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>
  19656. <ul>
  19657. <li> Rotate the input by PI/6 radians clockwise:
  19658. <div class="example">
  19659. <pre class="example">rotate=PI/6
  19660. </pre></div>
  19661. </li><li> Rotate the input by PI/6 radians counter-clockwise:
  19662. <div class="example">
  19663. <pre class="example">rotate=-PI/6
  19664. </pre></div>
  19665. </li><li> Rotate the input by 45 degrees clockwise:
  19666. <div class="example">
  19667. <pre class="example">rotate=45*PI/180
  19668. </pre></div>
  19669. </li><li> Apply a constant rotation with period T, starting from an angle of PI/3:
  19670. <div class="example">
  19671. <pre class="example">rotate=PI/3+2*PI*t/T
  19672. </pre></div>
  19673. </li><li> Make the input video rotation oscillating with a period of T
  19674. seconds and an amplitude of A radians:
  19675. <div class="example">
  19676. <pre class="example">rotate=A*sin(2*PI/T*t)
  19677. </pre></div>
  19678. </li><li> Rotate the video, output size is chosen so that the whole rotating
  19679. input video is always completely contained in the output:
  19680. <div class="example">
  19681. <pre class="example">rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
  19682. </pre></div>
  19683. </li><li> Rotate the video, reduce the output size so that no background is ever
  19684. shown:
  19685. <div class="example">
  19686. <pre class="example">rotate=2*PI*t:ow='min(iw,ih)/sqrt(2)':oh=ow:c=none
  19687. </pre></div>
  19688. </li></ul>
  19689. <a name="Commands-118"></a>
  19690. <h4 class="subsection">11.187.2 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>
  19691. <p>The filter supports the following commands:
  19692. </p>
  19693. <dl compact="compact">
  19694. <dt><samp>a, angle</samp></dt>
  19695. <dd><p>Set the angle expression.
  19696. The command accepts the same syntax of the corresponding option.
  19697. </p>
  19698. <p>If the specified expression is not valid, it is kept at its current
  19699. value.
  19700. </p></dd>
  19701. </dl>
  19702. <a name="sab"></a>
  19703. <h3 class="section">11.188 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>
  19704. <p>Apply Shape Adaptive Blur.
  19705. </p>
  19706. <p>The filter accepts the following options:
  19707. </p>
  19708. <dl compact="compact">
  19709. <dt><samp>luma_radius, lr</samp></dt>
  19710. <dd><p>Set luma blur filter strength, must be a value in range 0.1-4.0, default
  19711. value is 1.0. A greater value will result in a more blurred image, and
  19712. in slower processing.
  19713. </p>
  19714. </dd>
  19715. <dt><samp>luma_pre_filter_radius, lpfr</samp></dt>
  19716. <dd><p>Set luma pre-filter radius, must be a value in the 0.1-2.0 range, default
  19717. value is 1.0.
  19718. </p>
  19719. </dd>
  19720. <dt><samp>luma_strength, ls</samp></dt>
  19721. <dd><p>Set luma maximum difference between pixels to still be considered, must
  19722. be a value in the 0.1-100.0 range, default value is 1.0.
  19723. </p>
  19724. </dd>
  19725. <dt><samp>chroma_radius, cr</samp></dt>
  19726. <dd><p>Set chroma blur filter strength, must be a value in range -0.9-4.0. A
  19727. greater value will result in a more blurred image, and in slower
  19728. processing.
  19729. </p>
  19730. </dd>
  19731. <dt><samp>chroma_pre_filter_radius, cpfr</samp></dt>
  19732. <dd><p>Set chroma pre-filter radius, must be a value in the -0.9-2.0 range.
  19733. </p>
  19734. </dd>
  19735. <dt><samp>chroma_strength, cs</samp></dt>
  19736. <dd><p>Set chroma maximum difference between pixels to still be considered,
  19737. must be a value in the -0.9-100.0 range.
  19738. </p></dd>
  19739. </dl>
  19740. <p>Each chroma option value, if not explicitly specified, is set to the
  19741. corresponding luma option value.
  19742. </p>
  19743. <span id="scale"></span><a name="scale-1"></a>
  19744. <h3 class="section">11.189 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>
  19745. <p>Scale (resize) the input video, using the libswscale library.
  19746. </p>
  19747. <p>The scale filter forces the output display aspect ratio to be the same
  19748. of the input, by changing the output sample aspect ratio.
  19749. </p>
  19750. <p>If the input image format is different from the format requested by
  19751. the next filter, the scale filter will convert the input to the
  19752. requested format.
  19753. </p>
  19754. <a name="Options-1"></a>
  19755. <h4 class="subsection">11.189.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>
  19756. <p>The filter accepts the following options, or any of the options
  19757. supported by the libswscale scaler.
  19758. </p>
  19759. <p>See <a href="ffmpeg-scaler.html#scaler_005foptions">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for
  19760. the complete list of scaler options.
  19761. </p>
  19762. <dl compact="compact">
  19763. <dt><samp>width, w</samp></dt>
  19764. <dt><samp>height, h</samp></dt>
  19765. <dd><p>Set the output video dimension expression. Default value is the input
  19766. dimension.
  19767. </p>
  19768. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  19769. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  19770. is used for the output.
  19771. </p>
  19772. <p>If one and only one of the values is -n with n &gt;= 1, the scale filter
  19773. will use a value that maintains the aspect ratio of the input image,
  19774. calculated from the other specified dimension. After that it will,
  19775. however, make sure that the calculated dimension is divisible by n and
  19776. adjust the value if necessary.
  19777. </p>
  19778. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  19779. both values being set to 0 as previously detailed.
  19780. </p>
  19781. <p>See below for the list of accepted constants for use in the dimension
  19782. expression.
  19783. </p>
  19784. </dd>
  19785. <dt><samp>eval</samp></dt>
  19786. <dd><p>Specify when to evaluate <var>width</var> and <var>height</var> expression. It accepts the following values:
  19787. </p>
  19788. <dl compact="compact">
  19789. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  19790. <dd><p>Only evaluate expressions once during the filter initialization or when a command is processed.
  19791. </p>
  19792. </dd>
  19793. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  19794. <dd><p>Evaluate expressions for each incoming frame.
  19795. </p>
  19796. </dd>
  19797. </dl>
  19798. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  19799. </p>
  19800. </dd>
  19801. <dt><samp>interl</samp></dt>
  19802. <dd><p>Set the interlacing mode. It accepts the following values:
  19803. </p>
  19804. <dl compact="compact">
  19805. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  19806. <dd><p>Force interlaced aware scaling.
  19807. </p>
  19808. </dd>
  19809. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  19810. <dd><p>Do not apply interlaced scaling.
  19811. </p>
  19812. </dd>
  19813. <dt>&lsquo;<samp>-1</samp>&rsquo;</dt>
  19814. <dd><p>Select interlaced aware scaling depending on whether the source frames
  19815. are flagged as interlaced or not.
  19816. </p></dd>
  19817. </dl>
  19818. <p>Default value is &lsquo;<samp>0</samp>&rsquo;.
  19819. </p>
  19820. </dd>
  19821. <dt><samp>flags</samp></dt>
  19822. <dd><p>Set libswscale scaling flags. See
  19823. <a href="ffmpeg-scaler.html#sws_005fflags">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  19824. complete list of values. If not explicitly specified the filter applies
  19825. the default flags.
  19826. </p>
  19827. </dd>
  19828. <dt><samp>param0, param1</samp></dt>
  19829. <dd><p>Set libswscale input parameters for scaling algorithms that need them. See
  19830. <a href="ffmpeg-scaler.html#sws_005fparams">(ffmpeg-scaler)the ffmpeg-scaler manual</a> for the
  19831. complete documentation. If not explicitly specified the filter applies
  19832. empty parameters.
  19833. </p>
  19834. </dd>
  19835. <dt><samp>size, s</samp></dt>
  19836. <dd><p>Set the video size. For the syntax of this option, check the
  19837. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  19838. </p>
  19839. </dd>
  19840. <dt><samp>in_color_matrix</samp></dt>
  19841. <dt><samp>out_color_matrix</samp></dt>
  19842. <dd><p>Set in/output YCbCr color space type.
  19843. </p>
  19844. <p>This allows the autodetected value to be overridden as well as allows forcing
  19845. a specific value used for the output and encoder.
  19846. </p>
  19847. <p>If not specified, the color space type depends on the pixel format.
  19848. </p>
  19849. <p>Possible values:
  19850. </p>
  19851. <dl compact="compact">
  19852. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  19853. <dd><p>Choose automatically.
  19854. </p>
  19855. </dd>
  19856. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  19857. <dd><p>Format conforming to International Telecommunication Union (ITU)
  19858. Recommendation BT.709.
  19859. </p>
  19860. </dd>
  19861. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  19862. <dd><p>Set color space conforming to the United States Federal Communications
  19863. Commission (FCC) Code of Federal Regulations (CFR) Title 47 (2003) 73.682 (a).
  19864. </p>
  19865. </dd>
  19866. <dt>&lsquo;<samp>bt601</samp>&rsquo;</dt>
  19867. <dt>&lsquo;<samp>bt470</samp>&rsquo;</dt>
  19868. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  19869. <dd><p>Set color space conforming to:
  19870. </p>
  19871. <ul>
  19872. <li> ITU Radiocommunication Sector (ITU-R) Recommendation BT.601
  19873. </li><li> ITU-R Rec. BT.470-6 (1998) Systems B, B1, and G
  19874. </li><li> Society of Motion Picture and Television Engineers (SMPTE) ST 170:2004
  19875. </li></ul>
  19876. </dd>
  19877. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  19878. <dd><p>Set color space conforming to SMPTE ST 240:1999.
  19879. </p>
  19880. </dd>
  19881. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  19882. <dd><p>Set color space conforming to ITU-R BT.2020 non-constant luminance system.
  19883. </p></dd>
  19884. </dl>
  19885. </dd>
  19886. <dt><samp>in_range</samp></dt>
  19887. <dt><samp>out_range</samp></dt>
  19888. <dd><p>Set in/output YCbCr sample range.
  19889. </p>
  19890. <p>This allows the autodetected value to be overridden as well as allows forcing
  19891. a specific value used for the output and encoder. If not specified, the
  19892. range depends on the pixel format. Possible values:
  19893. </p>
  19894. <dl compact="compact">
  19895. <dt>&lsquo;<samp>auto/unknown</samp>&rsquo;</dt>
  19896. <dd><p>Choose automatically.
  19897. </p>
  19898. </dd>
  19899. <dt>&lsquo;<samp>jpeg/full/pc</samp>&rsquo;</dt>
  19900. <dd><p>Set full range (0-255 in case of 8-bit luma).
  19901. </p>
  19902. </dd>
  19903. <dt>&lsquo;<samp>mpeg/limited/tv</samp>&rsquo;</dt>
  19904. <dd><p>Set &quot;MPEG&quot; range (16-235 in case of 8-bit luma).
  19905. </p></dd>
  19906. </dl>
  19907. </dd>
  19908. <dt><samp>force_original_aspect_ratio</samp></dt>
  19909. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  19910. keep the original aspect ratio. Possible values:
  19911. </p>
  19912. <dl compact="compact">
  19913. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  19914. <dd><p>Scale the video as specified and disable this feature.
  19915. </p>
  19916. </dd>
  19917. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  19918. <dd><p>The output video dimensions will automatically be decreased if needed.
  19919. </p>
  19920. </dd>
  19921. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  19922. <dd><p>The output video dimensions will automatically be increased if needed.
  19923. </p>
  19924. </dd>
  19925. </dl>
  19926. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  19927. maximum allowed resolution, you can use this to limit the output video to
  19928. that, while retaining the aspect ratio. For example, device A allows
  19929. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  19930. decrease) and specifying 1280x720 to the command line makes the output
  19931. 1280x533.
  19932. </p>
  19933. <p>Please note that this is a different thing than specifying -1 for <samp>w</samp>
  19934. or <samp>h</samp>, you still need to specify the output resolution for this option
  19935. to work.
  19936. </p>
  19937. </dd>
  19938. <dt><samp>force_divisible_by</samp></dt>
  19939. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  19940. given integer when used together with <samp>force_original_aspect_ratio</samp>. This
  19941. works similar to using <code>-n</code> in the <samp>w</samp> and <samp>h</samp> options.
  19942. </p>
  19943. <p>This option respects the value set for <samp>force_original_aspect_ratio</samp>,
  19944. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  19945. may be slightly modified.
  19946. </p>
  19947. <p>This option can be handy if you need to have a video fit within or exceed
  19948. a defined resolution using <samp>force_original_aspect_ratio</samp> but also have
  19949. encoder restrictions on width or height divisibility.
  19950. </p>
  19951. </dd>
  19952. </dl>
  19953. <p>The values of the <samp>w</samp> and <samp>h</samp> options are expressions
  19954. containing the following constants:
  19955. </p>
  19956. <dl compact="compact">
  19957. <dt><var>in_w</var></dt>
  19958. <dt><var>in_h</var></dt>
  19959. <dd><p>The input width and height
  19960. </p>
  19961. </dd>
  19962. <dt><var>iw</var></dt>
  19963. <dt><var>ih</var></dt>
  19964. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  19965. </p>
  19966. </dd>
  19967. <dt><var>out_w</var></dt>
  19968. <dt><var>out_h</var></dt>
  19969. <dd><p>The output (scaled) width and height
  19970. </p>
  19971. </dd>
  19972. <dt><var>ow</var></dt>
  19973. <dt><var>oh</var></dt>
  19974. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  19975. </p>
  19976. </dd>
  19977. <dt><var>a</var></dt>
  19978. <dd><p>The same as <var>iw</var> / <var>ih</var>
  19979. </p>
  19980. </dd>
  19981. <dt><var>sar</var></dt>
  19982. <dd><p>input sample aspect ratio
  19983. </p>
  19984. </dd>
  19985. <dt><var>dar</var></dt>
  19986. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  19987. </p>
  19988. </dd>
  19989. <dt><var>hsub</var></dt>
  19990. <dt><var>vsub</var></dt>
  19991. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  19992. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  19993. </p>
  19994. </dd>
  19995. <dt><var>ohsub</var></dt>
  19996. <dt><var>ovsub</var></dt>
  19997. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  19998. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  19999. </p>
  20000. </dd>
  20001. <dt><var>n</var></dt>
  20002. <dd><p>The (sequential) number of the input frame, starting from 0.
  20003. Only available with <code>eval=frame</code>.
  20004. </p>
  20005. </dd>
  20006. <dt><var>t</var></dt>
  20007. <dd><p>The presentation timestamp of the input frame, expressed as a number of
  20008. seconds. Only available with <code>eval=frame</code>.
  20009. </p>
  20010. </dd>
  20011. <dt><var>pos</var></dt>
  20012. <dd><p>The position (byte offset) of the frame in the input stream, or NaN if
  20013. this information is unavailable and/or meaningless (for example in case of synthetic video).
  20014. Only available with <code>eval=frame</code>.
  20015. </p></dd>
  20016. </dl>
  20017. <a name="Examples-100"></a>
  20018. <h4 class="subsection">11.189.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>
  20019. <ul>
  20020. <li> Scale the input video to a size of 200x100
  20021. <div class="example">
  20022. <pre class="example">scale=w=200:h=100
  20023. </pre></div>
  20024. <p>This is equivalent to:
  20025. </p><div class="example">
  20026. <pre class="example">scale=200:100
  20027. </pre></div>
  20028. <p>or:
  20029. </p><div class="example">
  20030. <pre class="example">scale=200x100
  20031. </pre></div>
  20032. </li><li> Specify a size abbreviation for the output size:
  20033. <div class="example">
  20034. <pre class="example">scale=qcif
  20035. </pre></div>
  20036. <p>which can also be written as:
  20037. </p><div class="example">
  20038. <pre class="example">scale=size=qcif
  20039. </pre></div>
  20040. </li><li> Scale the input to 2x:
  20041. <div class="example">
  20042. <pre class="example">scale=w=2*iw:h=2*ih
  20043. </pre></div>
  20044. </li><li> The above is the same as:
  20045. <div class="example">
  20046. <pre class="example">scale=2*in_w:2*in_h
  20047. </pre></div>
  20048. </li><li> Scale the input to 2x with forced interlaced scaling:
  20049. <div class="example">
  20050. <pre class="example">scale=2*iw:2*ih:interl=1
  20051. </pre></div>
  20052. </li><li> Scale the input to half size:
  20053. <div class="example">
  20054. <pre class="example">scale=w=iw/2:h=ih/2
  20055. </pre></div>
  20056. </li><li> Increase the width, and set the height to the same size:
  20057. <div class="example">
  20058. <pre class="example">scale=3/2*iw:ow
  20059. </pre></div>
  20060. </li><li> Seek Greek harmony:
  20061. <div class="example">
  20062. <pre class="example">scale=iw:1/PHI*iw
  20063. scale=ih*PHI:ih
  20064. </pre></div>
  20065. </li><li> Increase the height, and set the width to 3/2 of the height:
  20066. <div class="example">
  20067. <pre class="example">scale=w=3/2*oh:h=3/5*ih
  20068. </pre></div>
  20069. </li><li> Increase the size, making the size a multiple of the chroma
  20070. subsample values:
  20071. <div class="example">
  20072. <pre class="example">scale=&quot;trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub&quot;
  20073. </pre></div>
  20074. </li><li> Increase the width to a maximum of 500 pixels,
  20075. keeping the same aspect ratio as the input:
  20076. <div class="example">
  20077. <pre class="example">scale=w='min(500\, iw*3/2):h=-1'
  20078. </pre></div>
  20079. </li><li> Make pixels square by combining scale and setsar:
  20080. <div class="example">
  20081. <pre class="example">scale='trunc(ih*dar):ih',setsar=1/1
  20082. </pre></div>
  20083. </li><li> Make pixels square by combining scale and setsar,
  20084. making sure the resulting resolution is even (required by some codecs):
  20085. <div class="example">
  20086. <pre class="example">scale='trunc(ih*dar/2)*2:trunc(ih/2)*2',setsar=1/1
  20087. </pre></div>
  20088. </li></ul>
  20089. <a name="Commands-119"></a>
  20090. <h4 class="subsection">11.189.3 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>
  20091. <p>This filter supports the following commands:
  20092. </p><dl compact="compact">
  20093. <dt><samp>width, w</samp></dt>
  20094. <dt><samp>height, h</samp></dt>
  20095. <dd><p>Set the output video dimension expression.
  20096. The command accepts the same syntax of the corresponding option.
  20097. </p>
  20098. <p>If the specified expression is not valid, it is kept at its current
  20099. value.
  20100. </p></dd>
  20101. </dl>
  20102. <a name="scale_005fnpp"></a>
  20103. <h3 class="section">11.190 scale_npp<span class="pull-right"><a class="anchor hidden-xs" href="#scale_005fnpp" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale_005fnpp" aria-hidden="true">TOC</a></span></h3>
  20104. <p>Use the NVIDIA Performance Primitives (libnpp) to perform scaling and/or pixel
  20105. format conversion on CUDA video frames. Setting the output width and height
  20106. works in the same way as for the <var>scale</var> filter.
  20107. </p>
  20108. <p>The following additional options are accepted:
  20109. </p><dl compact="compact">
  20110. <dt><samp>format</samp></dt>
  20111. <dd><p>The pixel format of the output CUDA frames. If set to the string &quot;same&quot; (the
  20112. default), the input format will be kept. Note that automatic format negotiation
  20113. and conversion is not yet supported for hardware frames
  20114. </p>
  20115. </dd>
  20116. <dt><samp>interp_algo</samp></dt>
  20117. <dd><p>The interpolation algorithm used for resizing. One of the following:
  20118. </p><dl compact="compact">
  20119. <dt><samp>nn</samp></dt>
  20120. <dd><p>Nearest neighbour.
  20121. </p>
  20122. </dd>
  20123. <dt><samp>linear</samp></dt>
  20124. <dt><samp>cubic</samp></dt>
  20125. <dt><samp>cubic2p_bspline</samp></dt>
  20126. <dd><p>2-parameter cubic (B=1, C=0)
  20127. </p>
  20128. </dd>
  20129. <dt><samp>cubic2p_catmullrom</samp></dt>
  20130. <dd><p>2-parameter cubic (B=0, C=1/2)
  20131. </p>
  20132. </dd>
  20133. <dt><samp>cubic2p_b05c03</samp></dt>
  20134. <dd><p>2-parameter cubic (B=1/2, C=3/10)
  20135. </p>
  20136. </dd>
  20137. <dt><samp>super</samp></dt>
  20138. <dd><p>Supersampling
  20139. </p>
  20140. </dd>
  20141. <dt><samp>lanczos</samp></dt>
  20142. </dl>
  20143. </dd>
  20144. <dt><samp>force_original_aspect_ratio</samp></dt>
  20145. <dd><p>Enable decreasing or increasing output video width or height if necessary to
  20146. keep the original aspect ratio. Possible values:
  20147. </p>
  20148. <dl compact="compact">
  20149. <dt>&lsquo;<samp>disable</samp>&rsquo;</dt>
  20150. <dd><p>Scale the video as specified and disable this feature.
  20151. </p>
  20152. </dd>
  20153. <dt>&lsquo;<samp>decrease</samp>&rsquo;</dt>
  20154. <dd><p>The output video dimensions will automatically be decreased if needed.
  20155. </p>
  20156. </dd>
  20157. <dt>&lsquo;<samp>increase</samp>&rsquo;</dt>
  20158. <dd><p>The output video dimensions will automatically be increased if needed.
  20159. </p>
  20160. </dd>
  20161. </dl>
  20162. <p>One useful instance of this option is that when you know a specific device&rsquo;s
  20163. maximum allowed resolution, you can use this to limit the output video to
  20164. that, while retaining the aspect ratio. For example, device A allows
  20165. 1280x720 playback, and your video is 1920x800. Using this option (set it to
  20166. decrease) and specifying 1280x720 to the command line makes the output
  20167. 1280x533.
  20168. </p>
  20169. <p>Please note that this is a different thing than specifying -1 for <samp>w</samp>
  20170. or <samp>h</samp>, you still need to specify the output resolution for this option
  20171. to work.
  20172. </p>
  20173. </dd>
  20174. <dt><samp>force_divisible_by</samp></dt>
  20175. <dd><p>Ensures that both the output dimensions, width and height, are divisible by the
  20176. given integer when used together with <samp>force_original_aspect_ratio</samp>. This
  20177. works similar to using <code>-n</code> in the <samp>w</samp> and <samp>h</samp> options.
  20178. </p>
  20179. <p>This option respects the value set for <samp>force_original_aspect_ratio</samp>,
  20180. increasing or decreasing the resolution accordingly. The video&rsquo;s aspect ratio
  20181. may be slightly modified.
  20182. </p>
  20183. <p>This option can be handy if you need to have a video fit within or exceed
  20184. a defined resolution using <samp>force_original_aspect_ratio</samp> but also have
  20185. encoder restrictions on width or height divisibility.
  20186. </p>
  20187. </dd>
  20188. </dl>
  20189. <a name="scale2ref"></a>
  20190. <h3 class="section">11.191 scale2ref<span class="pull-right"><a class="anchor hidden-xs" href="#scale2ref" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-scale2ref" aria-hidden="true">TOC</a></span></h3>
  20191. <p>Scale (resize) the input video, based on a reference video.
  20192. </p>
  20193. <p>See the scale filter for available options, scale2ref supports the same but
  20194. uses the reference video instead of the main input as basis. scale2ref also
  20195. supports the following additional constants for the <samp>w</samp> and
  20196. <samp>h</samp> options:
  20197. </p>
  20198. <dl compact="compact">
  20199. <dt><var>main_w</var></dt>
  20200. <dt><var>main_h</var></dt>
  20201. <dd><p>The main input video&rsquo;s width and height
  20202. </p>
  20203. </dd>
  20204. <dt><var>main_a</var></dt>
  20205. <dd><p>The same as <var>main_w</var> / <var>main_h</var>
  20206. </p>
  20207. </dd>
  20208. <dt><var>main_sar</var></dt>
  20209. <dd><p>The main input video&rsquo;s sample aspect ratio
  20210. </p>
  20211. </dd>
  20212. <dt><var>main_dar, mdar</var></dt>
  20213. <dd><p>The main input video&rsquo;s display aspect ratio. Calculated from
  20214. <code>(main_w / main_h) * main_sar</code>.
  20215. </p>
  20216. </dd>
  20217. <dt><var>main_hsub</var></dt>
  20218. <dt><var>main_vsub</var></dt>
  20219. <dd><p>The main input video&rsquo;s horizontal and vertical chroma subsample values.
  20220. For example for the pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var>
  20221. is 1.
  20222. </p>
  20223. </dd>
  20224. <dt><var>main_n</var></dt>
  20225. <dd><p>The (sequential) number of the main input frame, starting from 0.
  20226. Only available with <code>eval=frame</code>.
  20227. </p>
  20228. </dd>
  20229. <dt><var>main_t</var></dt>
  20230. <dd><p>The presentation timestamp of the main input frame, expressed as a number of
  20231. seconds. Only available with <code>eval=frame</code>.
  20232. </p>
  20233. </dd>
  20234. <dt><var>main_pos</var></dt>
  20235. <dd><p>The position (byte offset) of the frame in the main input stream, or NaN if
  20236. this information is unavailable and/or meaningless (for example in case of synthetic video).
  20237. Only available with <code>eval=frame</code>.
  20238. </p></dd>
  20239. </dl>
  20240. <a name="Examples-101"></a>
  20241. <h4 class="subsection">11.191.1 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>
  20242. <ul>
  20243. <li> Scale a subtitle stream (b) to match the main video (a) in size before overlaying
  20244. <div class="example">
  20245. <pre class="example">'scale2ref[b][a];[a][b]overlay'
  20246. </pre></div>
  20247. </li><li> Scale a logo to 1/10th the height of a video, while preserving its display aspect ratio.
  20248. <div class="example">
  20249. <pre class="example">[logo-in][video-in]scale2ref=w=oh*mdar:h=ih/10[logo-out][video-out]
  20250. </pre></div>
  20251. </li></ul>
  20252. <a name="Commands-120"></a>
  20253. <h4 class="subsection">11.191.2 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>
  20254. <p>This filter supports the following commands:
  20255. </p><dl compact="compact">
  20256. <dt><samp>width, w</samp></dt>
  20257. <dt><samp>height, h</samp></dt>
  20258. <dd><p>Set the output video dimension expression.
  20259. The command accepts the same syntax of the corresponding option.
  20260. </p>
  20261. <p>If the specified expression is not valid, it is kept at its current
  20262. value.
  20263. </p></dd>
  20264. </dl>
  20265. <a name="scroll"></a>
  20266. <h3 class="section">11.192 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>
  20267. <p>Scroll input video horizontally and/or vertically by constant speed.
  20268. </p>
  20269. <p>The filter accepts the following options:
  20270. </p><dl compact="compact">
  20271. <dt><samp>horizontal, h</samp></dt>
  20272. <dd><p>Set the horizontal scrolling speed. Default is 0. Allowed range is from -1 to 1.
  20273. Negative values changes scrolling direction.
  20274. </p>
  20275. </dd>
  20276. <dt><samp>vertical, v</samp></dt>
  20277. <dd><p>Set the vertical scrolling speed. Default is 0. Allowed range is from -1 to 1.
  20278. Negative values changes scrolling direction.
  20279. </p>
  20280. </dd>
  20281. <dt><samp>hpos</samp></dt>
  20282. <dd><p>Set the initial horizontal scrolling position. Default is 0. Allowed range is from 0 to 1.
  20283. </p>
  20284. </dd>
  20285. <dt><samp>vpos</samp></dt>
  20286. <dd><p>Set the initial vertical scrolling position. Default is 0. Allowed range is from 0 to 1.
  20287. </p></dd>
  20288. </dl>
  20289. <a name="Commands-121"></a>
  20290. <h4 class="subsection">11.192.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>
  20291. <p>This filter supports the following <a href="#commands">commands</a>:
  20292. </p><dl compact="compact">
  20293. <dt><samp>horizontal, h</samp></dt>
  20294. <dd><p>Set the horizontal scrolling speed.
  20295. </p></dd>
  20296. <dt><samp>vertical, v</samp></dt>
  20297. <dd><p>Set the vertical scrolling speed.
  20298. </p></dd>
  20299. </dl>
  20300. <span id="scdet"></span><a name="scdet-1"></a>
  20301. <h3 class="section">11.193 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>
  20302. <p>Detect video scene change.
  20303. </p>
  20304. <p>This filter sets frame metadata with mafd between frame, the scene score, and
  20305. forward the frame to the next filter, so they can use these metadata to detect
  20306. scene change or others.
  20307. </p>
  20308. <p>In addition, this filter logs a message and sets frame metadata when it detects
  20309. a scene change by <samp>threshold</samp>.
  20310. </p>
  20311. <p><code>lavfi.scd.mafd</code> metadata keys are set with mafd for every frame.
  20312. </p>
  20313. <p><code>lavfi.scd.score</code> metadata keys are set with scene change score for every frame
  20314. to detect scene change.
  20315. </p>
  20316. <p><code>lavfi.scd.time</code> metadata keys are set with current filtered frame time which
  20317. detect scene change with <samp>threshold</samp>.
  20318. </p>
  20319. <p>The filter accepts the following options:
  20320. </p>
  20321. <dl compact="compact">
  20322. <dt><samp>threshold, t</samp></dt>
  20323. <dd><p>Set the scene change detection threshold as a percentage of maximum change. Good
  20324. values are in the <code>[8.0, 14.0]</code> range. The range for <samp>threshold</samp> is
  20325. <code>[0., 100.]</code>.
  20326. </p>
  20327. <p>Default value is <code>10.</code>.
  20328. </p>
  20329. </dd>
  20330. <dt><samp>sc_pass, s</samp></dt>
  20331. <dd><p>Set the flag to pass scene change frames to the next filter. Default value is <code>0</code>
  20332. You can enable it if you want to get snapshot of scene change frames only.
  20333. </p></dd>
  20334. </dl>
  20335. <span id="selectivecolor"></span><a name="selectivecolor-1"></a>
  20336. <h3 class="section">11.194 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>
  20337. <p>Adjust cyan, magenta, yellow and black (CMYK) to certain ranges of colors (such
  20338. as &quot;reds&quot;, &quot;yellows&quot;, &quot;greens&quot;, &quot;cyans&quot;, ...). The adjustment range is defined
  20339. by the &quot;purity&quot; of the color (that is, how saturated it already is).
  20340. </p>
  20341. <p>This filter is similar to the Adobe Photoshop Selective Color tool.
  20342. </p>
  20343. <p>The filter accepts the following options:
  20344. </p>
  20345. <dl compact="compact">
  20346. <dt><samp>correction_method</samp></dt>
  20347. <dd><p>Select color correction method.
  20348. </p>
  20349. <p>Available values are:
  20350. </p><dl compact="compact">
  20351. <dt>&lsquo;<samp>absolute</samp>&rsquo;</dt>
  20352. <dd><p>Specified adjustments are applied &quot;as-is&quot; (added/subtracted to original pixel
  20353. component value).
  20354. </p></dd>
  20355. <dt>&lsquo;<samp>relative</samp>&rsquo;</dt>
  20356. <dd><p>Specified adjustments are relative to the original component value.
  20357. </p></dd>
  20358. </dl>
  20359. <p>Default is <code>absolute</code>.
  20360. </p></dd>
  20361. <dt><samp>reds</samp></dt>
  20362. <dd><p>Adjustments for red pixels (pixels where the red component is the maximum)
  20363. </p></dd>
  20364. <dt><samp>yellows</samp></dt>
  20365. <dd><p>Adjustments for yellow pixels (pixels where the blue component is the minimum)
  20366. </p></dd>
  20367. <dt><samp>greens</samp></dt>
  20368. <dd><p>Adjustments for green pixels (pixels where the green component is the maximum)
  20369. </p></dd>
  20370. <dt><samp>cyans</samp></dt>
  20371. <dd><p>Adjustments for cyan pixels (pixels where the red component is the minimum)
  20372. </p></dd>
  20373. <dt><samp>blues</samp></dt>
  20374. <dd><p>Adjustments for blue pixels (pixels where the blue component is the maximum)
  20375. </p></dd>
  20376. <dt><samp>magentas</samp></dt>
  20377. <dd><p>Adjustments for magenta pixels (pixels where the green component is the minimum)
  20378. </p></dd>
  20379. <dt><samp>whites</samp></dt>
  20380. <dd><p>Adjustments for white pixels (pixels where all components are greater than 128)
  20381. </p></dd>
  20382. <dt><samp>neutrals</samp></dt>
  20383. <dd><p>Adjustments for all pixels except pure black and pure white
  20384. </p></dd>
  20385. <dt><samp>blacks</samp></dt>
  20386. <dd><p>Adjustments for black pixels (pixels where all components are lesser than 128)
  20387. </p></dd>
  20388. <dt><samp>psfile</samp></dt>
  20389. <dd><p>Specify a Photoshop selective color file (<code>.asv</code>) to import the settings from.
  20390. </p></dd>
  20391. </dl>
  20392. <p>All the adjustment settings (<samp>reds</samp>, <samp>yellows</samp>, ...) accept up to
  20393. 4 space separated floating point adjustment values in the [-1,1] range,
  20394. respectively to adjust the amount of cyan, magenta, yellow and black for the
  20395. pixels of its range.
  20396. </p>
  20397. <a name="Examples-102"></a>
  20398. <h4 class="subsection">11.194.1 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>
  20399. <ul>
  20400. <li> Increase cyan by 50% and reduce yellow by 33% in every green areas, and
  20401. increase magenta by 27% in blue areas:
  20402. <div class="example">
  20403. <pre class="example">selectivecolor=greens=.5 0 -.33 0:blues=0 .27
  20404. </pre></div>
  20405. </li><li> Use a Photoshop selective color preset:
  20406. <div class="example">
  20407. <pre class="example">selectivecolor=psfile=MySelectiveColorPresets/Misty.asv
  20408. </pre></div>
  20409. </li></ul>
  20410. <span id="separatefields"></span><a name="separatefields-1"></a>
  20411. <h3 class="section">11.195 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>
  20412. <p>The <code>separatefields</code> takes a frame-based video input and splits
  20413. each frame into its components fields, producing a new half height clip
  20414. with twice the frame rate and twice the frame count.
  20415. </p>
  20416. <p>This filter use field-dominance information in frame to decide which
  20417. of each pair of fields to place first in the output.
  20418. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>separatefields</code> filter.
  20419. </p>
  20420. <a name="setdar_002c-setsar"></a>
  20421. <h3 class="section">11.196 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>
  20422. <p>The <code>setdar</code> filter sets the Display Aspect Ratio for the filter
  20423. output video.
  20424. </p>
  20425. <p>This is done by changing the specified Sample (aka Pixel) Aspect
  20426. Ratio, according to the following equation:
  20427. </p><div class="example">
  20428. <pre class="example"><var>DAR</var> = <var>HORIZONTAL_RESOLUTION</var> / <var>VERTICAL_RESOLUTION</var> * <var>SAR</var>
  20429. </pre></div>
  20430. <p>Keep in mind that the <code>setdar</code> filter does not modify the pixel
  20431. dimensions of the video frame. Also, the display aspect ratio set by
  20432. this filter may be changed by later filters in the filterchain,
  20433. e.g. in case of scaling or if another &quot;setdar&quot; or a &quot;setsar&quot; filter is
  20434. applied.
  20435. </p>
  20436. <p>The <code>setsar</code> filter sets the Sample (aka Pixel) Aspect Ratio for
  20437. the filter output video.
  20438. </p>
  20439. <p>Note that as a consequence of the application of this filter, the
  20440. output display aspect ratio will change according to the equation
  20441. above.
  20442. </p>
  20443. <p>Keep in mind that the sample aspect ratio set by the <code>setsar</code>
  20444. filter may be changed by later filters in the filterchain, e.g. if
  20445. another &quot;setsar&quot; or a &quot;setdar&quot; filter is applied.
  20446. </p>
  20447. <p>It accepts the following parameters:
  20448. </p>
  20449. <dl compact="compact">
  20450. <dt><samp>r, ratio, dar (<code>setdar</code> only), sar (<code>setsar</code> only)</samp></dt>
  20451. <dd><p>Set the aspect ratio used by the filter.
  20452. </p>
  20453. <p>The parameter can be a floating point number string, an expression, or
  20454. a string of the form <var>num</var>:<var>den</var>, where <var>num</var> and
  20455. <var>den</var> are the numerator and denominator of the aspect ratio. If
  20456. the parameter is not specified, it is assumed the value &quot;0&quot;.
  20457. In case the form &quot;<var>num</var>:<var>den</var>&quot; is used, the <code>:</code> character
  20458. should be escaped.
  20459. </p>
  20460. </dd>
  20461. <dt><samp>max</samp></dt>
  20462. <dd><p>Set the maximum integer value to use for expressing numerator and
  20463. denominator when reducing the expressed aspect ratio to a rational.
  20464. Default value is <code>100</code>.
  20465. </p>
  20466. </dd>
  20467. </dl>
  20468. <p>The parameter <var>sar</var> is an expression containing
  20469. the following constants:
  20470. </p>
  20471. <dl compact="compact">
  20472. <dt><samp>E, PI, PHI</samp></dt>
  20473. <dd><p>These are approximated values for the mathematical constants e
  20474. (Euler&rsquo;s number), pi (Greek pi), and phi (the golden ratio).
  20475. </p>
  20476. </dd>
  20477. <dt><samp>w, h</samp></dt>
  20478. <dd><p>The input width and height.
  20479. </p>
  20480. </dd>
  20481. <dt><samp>a</samp></dt>
  20482. <dd><p>These are the same as <var>w</var> / <var>h</var>.
  20483. </p>
  20484. </dd>
  20485. <dt><samp>sar</samp></dt>
  20486. <dd><p>The input sample aspect ratio.
  20487. </p>
  20488. </dd>
  20489. <dt><samp>dar</samp></dt>
  20490. <dd><p>The input display aspect ratio. It is the same as
  20491. (<var>w</var> / <var>h</var>) * <var>sar</var>.
  20492. </p>
  20493. </dd>
  20494. <dt><samp>hsub, vsub</samp></dt>
  20495. <dd><p>Horizontal and vertical chroma subsample values. For example, for the
  20496. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  20497. </p></dd>
  20498. </dl>
  20499. <a name="Examples-103"></a>
  20500. <h4 class="subsection">11.196.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>
  20501. <ul>
  20502. <li> To change the display aspect ratio to 16:9, specify one of the following:
  20503. <div class="example">
  20504. <pre class="example">setdar=dar=1.77777
  20505. setdar=dar=16/9
  20506. </pre></div>
  20507. </li><li> To change the sample aspect ratio to 10:11, specify:
  20508. <div class="example">
  20509. <pre class="example">setsar=sar=10/11
  20510. </pre></div>
  20511. </li><li> To set a display aspect ratio of 16:9, and specify a maximum integer value of
  20512. 1000 in the aspect ratio reduction, use the command:
  20513. <div class="example">
  20514. <pre class="example">setdar=ratio=16/9:max=1000
  20515. </pre></div>
  20516. </li></ul>
  20517. <span id="setfield"></span><a name="setfield-1"></a>
  20518. <h3 class="section">11.197 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>
  20519. <p>Force field for the output video frame.
  20520. </p>
  20521. <p>The <code>setfield</code> filter marks the interlace type field for the
  20522. output frames. It does not change the input frame, but only sets the
  20523. corresponding property, which affects how the frame is treated by
  20524. following filters (e.g. <code>fieldorder</code> or <code>yadif</code>).
  20525. </p>
  20526. <p>The filter accepts the following options:
  20527. </p>
  20528. <dl compact="compact">
  20529. <dt><samp>mode</samp></dt>
  20530. <dd><p>Available values are:
  20531. </p>
  20532. <dl compact="compact">
  20533. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20534. <dd><p>Keep the same field property.
  20535. </p>
  20536. </dd>
  20537. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  20538. <dd><p>Mark the frame as bottom-field-first.
  20539. </p>
  20540. </dd>
  20541. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  20542. <dd><p>Mark the frame as top-field-first.
  20543. </p>
  20544. </dd>
  20545. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  20546. <dd><p>Mark the frame as progressive.
  20547. </p></dd>
  20548. </dl>
  20549. </dd>
  20550. </dl>
  20551. <span id="setparams"></span><a name="setparams-1"></a>
  20552. <h3 class="section">11.198 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>
  20553. <p>Force frame parameter for the output video frame.
  20554. </p>
  20555. <p>The <code>setparams</code> filter marks interlace and color range for the
  20556. output frames. It does not change the input frame, but only sets the
  20557. corresponding property, which affects how the frame is treated by
  20558. filters/encoders.
  20559. </p>
  20560. <dl compact="compact">
  20561. <dt><samp>field_mode</samp></dt>
  20562. <dd><p>Available values are:
  20563. </p>
  20564. <dl compact="compact">
  20565. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20566. <dd><p>Keep the same field property (default).
  20567. </p>
  20568. </dd>
  20569. <dt>&lsquo;<samp>bff</samp>&rsquo;</dt>
  20570. <dd><p>Mark the frame as bottom-field-first.
  20571. </p>
  20572. </dd>
  20573. <dt>&lsquo;<samp>tff</samp>&rsquo;</dt>
  20574. <dd><p>Mark the frame as top-field-first.
  20575. </p>
  20576. </dd>
  20577. <dt>&lsquo;<samp>prog</samp>&rsquo;</dt>
  20578. <dd><p>Mark the frame as progressive.
  20579. </p></dd>
  20580. </dl>
  20581. </dd>
  20582. <dt><samp>range</samp></dt>
  20583. <dd><p>Available values are:
  20584. </p>
  20585. <dl compact="compact">
  20586. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20587. <dd><p>Keep the same color range property (default).
  20588. </p>
  20589. </dd>
  20590. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  20591. <dd><p>Mark the frame as unspecified color range.
  20592. </p>
  20593. </dd>
  20594. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  20595. <dd><p>Mark the frame as limited range.
  20596. </p>
  20597. </dd>
  20598. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  20599. <dd><p>Mark the frame as full range.
  20600. </p></dd>
  20601. </dl>
  20602. </dd>
  20603. <dt><samp>color_primaries</samp></dt>
  20604. <dd><p>Set the color primaries.
  20605. Available values are:
  20606. </p>
  20607. <dl compact="compact">
  20608. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20609. <dd><p>Keep the same color primaries property (default).
  20610. </p>
  20611. </dd>
  20612. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  20613. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  20614. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  20615. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  20616. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  20617. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  20618. <dt>&lsquo;<samp>film</samp>&rsquo;</dt>
  20619. <dt>&lsquo;<samp>bt2020</samp>&rsquo;</dt>
  20620. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  20621. <dt>&lsquo;<samp>smpte431</samp>&rsquo;</dt>
  20622. <dt>&lsquo;<samp>smpte432</samp>&rsquo;</dt>
  20623. <dt>&lsquo;<samp>jedec-p22</samp>&rsquo;</dt>
  20624. </dl>
  20625. </dd>
  20626. <dt><samp>color_trc</samp></dt>
  20627. <dd><p>Set the color transfer.
  20628. Available values are:
  20629. </p>
  20630. <dl compact="compact">
  20631. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20632. <dd><p>Keep the same color trc property (default).
  20633. </p>
  20634. </dd>
  20635. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  20636. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  20637. <dt>&lsquo;<samp>bt470m</samp>&rsquo;</dt>
  20638. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  20639. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  20640. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  20641. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  20642. <dt>&lsquo;<samp>log100</samp>&rsquo;</dt>
  20643. <dt>&lsquo;<samp>log316</samp>&rsquo;</dt>
  20644. <dt>&lsquo;<samp>iec61966-2-4</samp>&rsquo;</dt>
  20645. <dt>&lsquo;<samp>bt1361e</samp>&rsquo;</dt>
  20646. <dt>&lsquo;<samp>iec61966-2-1</samp>&rsquo;</dt>
  20647. <dt>&lsquo;<samp>bt2020-10</samp>&rsquo;</dt>
  20648. <dt>&lsquo;<samp>bt2020-12</samp>&rsquo;</dt>
  20649. <dt>&lsquo;<samp>smpte2084</samp>&rsquo;</dt>
  20650. <dt>&lsquo;<samp>smpte428</samp>&rsquo;</dt>
  20651. <dt>&lsquo;<samp>arib-std-b67</samp>&rsquo;</dt>
  20652. </dl>
  20653. </dd>
  20654. <dt><samp>colorspace</samp></dt>
  20655. <dd><p>Set the colorspace.
  20656. Available values are:
  20657. </p>
  20658. <dl compact="compact">
  20659. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  20660. <dd><p>Keep the same colorspace property (default).
  20661. </p>
  20662. </dd>
  20663. <dt>&lsquo;<samp>gbr</samp>&rsquo;</dt>
  20664. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  20665. <dt>&lsquo;<samp>unknown</samp>&rsquo;</dt>
  20666. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  20667. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  20668. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  20669. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  20670. <dt>&lsquo;<samp>ycgco</samp>&rsquo;</dt>
  20671. <dt>&lsquo;<samp>bt2020nc</samp>&rsquo;</dt>
  20672. <dt>&lsquo;<samp>bt2020c</samp>&rsquo;</dt>
  20673. <dt>&lsquo;<samp>smpte2085</samp>&rsquo;</dt>
  20674. <dt>&lsquo;<samp>chroma-derived-nc</samp>&rsquo;</dt>
  20675. <dt>&lsquo;<samp>chroma-derived-c</samp>&rsquo;</dt>
  20676. <dt>&lsquo;<samp>ictcp</samp>&rsquo;</dt>
  20677. </dl>
  20678. </dd>
  20679. </dl>
  20680. <a name="shear"></a>
  20681. <h3 class="section">11.199 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>
  20682. <p>Apply shear transform to input video.
  20683. </p>
  20684. <p>This filter supports the following options:
  20685. </p>
  20686. <dl compact="compact">
  20687. <dt><samp>shx</samp></dt>
  20688. <dd><p>Shear factor in X-direction. Default value is 0.
  20689. Allowed range is from -2 to 2.
  20690. </p>
  20691. </dd>
  20692. <dt><samp>shy</samp></dt>
  20693. <dd><p>Shear factor in Y-direction. Default value is 0.
  20694. Allowed range is from -2 to 2.
  20695. </p>
  20696. </dd>
  20697. <dt><samp>fillcolor, c</samp></dt>
  20698. <dd><p>Set the color used to fill the output area not covered by the transformed
  20699. video. For the general syntax of this option, check the
  20700. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  20701. If the special value &quot;none&quot; is selected then no
  20702. background is printed (useful for example if the background is never shown).
  20703. </p>
  20704. <p>Default value is &quot;black&quot;.
  20705. </p>
  20706. </dd>
  20707. <dt><samp>interp</samp></dt>
  20708. <dd><p>Set interpolation type. Can be <code>bilinear</code> or <code>nearest</code>. Default is <code>bilinear</code>.
  20709. </p></dd>
  20710. </dl>
  20711. <a name="Commands-122"></a>
  20712. <h4 class="subsection">11.199.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>
  20713. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  20714. </p>
  20715. <a name="showinfo"></a>
  20716. <h3 class="section">11.200 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>
  20717. <p>Show a line containing various information for each input video frame.
  20718. The input video is not modified.
  20719. </p>
  20720. <p>This filter supports the following options:
  20721. </p>
  20722. <dl compact="compact">
  20723. <dt><samp>checksum</samp></dt>
  20724. <dd><p>Calculate checksums of each plane. By default enabled.
  20725. </p></dd>
  20726. </dl>
  20727. <p>The shown line contains a sequence of key/value pairs of the form
  20728. <var>key</var>:<var>value</var>.
  20729. </p>
  20730. <p>The following values are shown in the output:
  20731. </p>
  20732. <dl compact="compact">
  20733. <dt><samp>n</samp></dt>
  20734. <dd><p>The (sequential) number of the input frame, starting from 0.
  20735. </p>
  20736. </dd>
  20737. <dt><samp>pts</samp></dt>
  20738. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  20739. time base units. The time base unit depends on the filter input pad.
  20740. </p>
  20741. </dd>
  20742. <dt><samp>pts_time</samp></dt>
  20743. <dd><p>The Presentation TimeStamp of the input frame, expressed as a number of
  20744. seconds.
  20745. </p>
  20746. </dd>
  20747. <dt><samp>pos</samp></dt>
  20748. <dd><p>The position of the frame in the input stream, or -1 if this information is
  20749. unavailable and/or meaningless (for example in case of synthetic video).
  20750. </p>
  20751. </dd>
  20752. <dt><samp>fmt</samp></dt>
  20753. <dd><p>The pixel format name.
  20754. </p>
  20755. </dd>
  20756. <dt><samp>sar</samp></dt>
  20757. <dd><p>The sample aspect ratio of the input frame, expressed in the form
  20758. <var>num</var>/<var>den</var>.
  20759. </p>
  20760. </dd>
  20761. <dt><samp>s</samp></dt>
  20762. <dd><p>The size of the input frame. For the syntax of this option, check the
  20763. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  20764. </p>
  20765. </dd>
  20766. <dt><samp>i</samp></dt>
  20767. <dd><p>The type of interlaced mode (&quot;P&quot; for &quot;progressive&quot;, &quot;T&quot; for top field first, &quot;B&quot;
  20768. for bottom field first).
  20769. </p>
  20770. </dd>
  20771. <dt><samp>iskey</samp></dt>
  20772. <dd><p>This is 1 if the frame is a key frame, 0 otherwise.
  20773. </p>
  20774. </dd>
  20775. <dt><samp>type</samp></dt>
  20776. <dd><p>The picture type of the input frame (&quot;I&quot; for an I-frame, &quot;P&quot; for a
  20777. P-frame, &quot;B&quot; for a B-frame, or &quot;?&quot; for an unknown type).
  20778. Also refer to the documentation of the <code>AVPictureType</code> enum and of
  20779. the <code>av_get_picture_type_char</code> function defined in
  20780. <samp>libavutil/avutil.h</samp>.
  20781. </p>
  20782. </dd>
  20783. <dt><samp>checksum</samp></dt>
  20784. <dd><p>The Adler-32 checksum (printed in hexadecimal) of all the planes of the input frame.
  20785. </p>
  20786. </dd>
  20787. <dt><samp>plane_checksum</samp></dt>
  20788. <dd><p>The Adler-32 checksum (printed in hexadecimal) of each plane of the input frame,
  20789. expressed in the form &quot;[<var>c0</var> <var>c1</var> <var>c2</var> <var>c3</var>]&quot;.
  20790. </p>
  20791. </dd>
  20792. <dt><samp>mean</samp></dt>
  20793. <dd><p>The mean value of pixels in each plane of the input frame, expressed in the form
  20794. &quot;[<var>mean0</var> <var>mean1</var> <var>mean2</var> <var>mean3</var>]&quot;.
  20795. </p>
  20796. </dd>
  20797. <dt><samp>stdev</samp></dt>
  20798. <dd><p>The standard deviation of pixel values in each plane of the input frame, expressed
  20799. in the form &quot;[<var>stdev0</var> <var>stdev1</var> <var>stdev2</var> <var>stdev3</var>]&quot;.
  20800. </p>
  20801. </dd>
  20802. </dl>
  20803. <a name="showpalette"></a>
  20804. <h3 class="section">11.201 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>
  20805. <p>Displays the 256 colors palette of each frame. This filter is only relevant for
  20806. <var>pal8</var> pixel format frames.
  20807. </p>
  20808. <p>It accepts the following option:
  20809. </p>
  20810. <dl compact="compact">
  20811. <dt><samp>s</samp></dt>
  20812. <dd><p>Set the size of the box used to represent one palette color entry. Default is
  20813. <code>30</code> (for a <code>30x30</code> pixel box).
  20814. </p></dd>
  20815. </dl>
  20816. <a name="shuffleframes"></a>
  20817. <h3 class="section">11.202 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>
  20818. <p>Reorder and/or duplicate and/or drop video frames.
  20819. </p>
  20820. <p>It accepts the following parameters:
  20821. </p>
  20822. <dl compact="compact">
  20823. <dt><samp>mapping</samp></dt>
  20824. <dd><p>Set the destination indexes of input frames.
  20825. This is space or &rsquo;|&rsquo; separated list of indexes that maps input frames to output
  20826. frames. Number of indexes also sets maximal value that each index may have.
  20827. &rsquo;-1&rsquo; index have special meaning and that is to drop frame.
  20828. </p></dd>
  20829. </dl>
  20830. <p>The first frame has the index 0. The default is to keep the input unchanged.
  20831. </p>
  20832. <a name="Examples-104"></a>
  20833. <h4 class="subsection">11.202.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>
  20834. <ul>
  20835. <li> Swap second and third frame of every three frames of the input:
  20836. <div class="example">
  20837. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=0 2 1&quot; OUTPUT
  20838. </pre></div>
  20839. </li><li> Swap 10th and 1st frame of every ten frames of the input:
  20840. <div class="example">
  20841. <pre class="example">ffmpeg -i INPUT -vf &quot;shuffleframes=9 1 2 3 4 5 6 7 8 0&quot; OUTPUT
  20842. </pre></div>
  20843. </li></ul>
  20844. <a name="shufflepixels"></a>
  20845. <h3 class="section">11.203 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>
  20846. <p>Reorder pixels in video frames.
  20847. </p>
  20848. <p>This filter accepts the following options:
  20849. </p>
  20850. <dl compact="compact">
  20851. <dt><samp>direction, d</samp></dt>
  20852. <dd><p>Set shuffle direction. Can be forward or inverse direction.
  20853. Default direction is forward.
  20854. </p>
  20855. </dd>
  20856. <dt><samp>mode, m</samp></dt>
  20857. <dd><p>Set shuffle mode. Can be horizontal, vertical or block mode.
  20858. </p>
  20859. </dd>
  20860. <dt><samp>width, w</samp></dt>
  20861. <dt><samp>height, h</samp></dt>
  20862. <dd><p>Set shuffle block_size. In case of horizontal shuffle mode only width
  20863. part of size is used, and in case of vertical shuffle mode only height
  20864. part of size is used.
  20865. </p>
  20866. </dd>
  20867. <dt><samp>seed, s</samp></dt>
  20868. <dd><p>Set random seed used with shuffling pixels. Mainly useful to set to be able
  20869. to reverse filtering process to get original input.
  20870. For example, to reverse forward shuffle you need to use same parameters
  20871. and exact same seed and to set direction to inverse.
  20872. </p></dd>
  20873. </dl>
  20874. <a name="shuffleplanes"></a>
  20875. <h3 class="section">11.204 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>
  20876. <p>Reorder and/or duplicate video planes.
  20877. </p>
  20878. <p>It accepts the following parameters:
  20879. </p>
  20880. <dl compact="compact">
  20881. <dt><samp>map0</samp></dt>
  20882. <dd><p>The index of the input plane to be used as the first output plane.
  20883. </p>
  20884. </dd>
  20885. <dt><samp>map1</samp></dt>
  20886. <dd><p>The index of the input plane to be used as the second output plane.
  20887. </p>
  20888. </dd>
  20889. <dt><samp>map2</samp></dt>
  20890. <dd><p>The index of the input plane to be used as the third output plane.
  20891. </p>
  20892. </dd>
  20893. <dt><samp>map3</samp></dt>
  20894. <dd><p>The index of the input plane to be used as the fourth output plane.
  20895. </p>
  20896. </dd>
  20897. </dl>
  20898. <p>The first plane has the index 0. The default is to keep the input unchanged.
  20899. </p>
  20900. <a name="Examples-105"></a>
  20901. <h4 class="subsection">11.204.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>
  20902. <ul>
  20903. <li> Swap the second and third planes of the input:
  20904. <div class="example">
  20905. <pre class="example">ffmpeg -i INPUT -vf shuffleplanes=0:2:1:3 OUTPUT
  20906. </pre></div>
  20907. </li></ul>
  20908. <span id="signalstats"></span><a name="signalstats-1"></a>
  20909. <h3 class="section">11.205 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>
  20910. <p>Evaluate various visual metrics that assist in determining issues associated
  20911. with the digitization of analog video media.
  20912. </p>
  20913. <p>By default the filter will log these metadata values:
  20914. </p>
  20915. <dl compact="compact">
  20916. <dt><samp>YMIN</samp></dt>
  20917. <dd><p>Display the minimal Y value contained within the input frame. Expressed in
  20918. range of [0-255].
  20919. </p>
  20920. </dd>
  20921. <dt><samp>YLOW</samp></dt>
  20922. <dd><p>Display the Y value at the 10% percentile within the input frame. Expressed in
  20923. range of [0-255].
  20924. </p>
  20925. </dd>
  20926. <dt><samp>YAVG</samp></dt>
  20927. <dd><p>Display the average Y value within the input frame. Expressed in range of
  20928. [0-255].
  20929. </p>
  20930. </dd>
  20931. <dt><samp>YHIGH</samp></dt>
  20932. <dd><p>Display the Y value at the 90% percentile within the input frame. Expressed in
  20933. range of [0-255].
  20934. </p>
  20935. </dd>
  20936. <dt><samp>YMAX</samp></dt>
  20937. <dd><p>Display the maximum Y value contained within the input frame. Expressed in
  20938. range of [0-255].
  20939. </p>
  20940. </dd>
  20941. <dt><samp>UMIN</samp></dt>
  20942. <dd><p>Display the minimal U value contained within the input frame. Expressed in
  20943. range of [0-255].
  20944. </p>
  20945. </dd>
  20946. <dt><samp>ULOW</samp></dt>
  20947. <dd><p>Display the U value at the 10% percentile within the input frame. Expressed in
  20948. range of [0-255].
  20949. </p>
  20950. </dd>
  20951. <dt><samp>UAVG</samp></dt>
  20952. <dd><p>Display the average U value within the input frame. Expressed in range of
  20953. [0-255].
  20954. </p>
  20955. </dd>
  20956. <dt><samp>UHIGH</samp></dt>
  20957. <dd><p>Display the U value at the 90% percentile within the input frame. Expressed in
  20958. range of [0-255].
  20959. </p>
  20960. </dd>
  20961. <dt><samp>UMAX</samp></dt>
  20962. <dd><p>Display the maximum U value contained within the input frame. Expressed in
  20963. range of [0-255].
  20964. </p>
  20965. </dd>
  20966. <dt><samp>VMIN</samp></dt>
  20967. <dd><p>Display the minimal V value contained within the input frame. Expressed in
  20968. range of [0-255].
  20969. </p>
  20970. </dd>
  20971. <dt><samp>VLOW</samp></dt>
  20972. <dd><p>Display the V value at the 10% percentile within the input frame. Expressed in
  20973. range of [0-255].
  20974. </p>
  20975. </dd>
  20976. <dt><samp>VAVG</samp></dt>
  20977. <dd><p>Display the average V value within the input frame. Expressed in range of
  20978. [0-255].
  20979. </p>
  20980. </dd>
  20981. <dt><samp>VHIGH</samp></dt>
  20982. <dd><p>Display the V value at the 90% percentile within the input frame. Expressed in
  20983. range of [0-255].
  20984. </p>
  20985. </dd>
  20986. <dt><samp>VMAX</samp></dt>
  20987. <dd><p>Display the maximum V value contained within the input frame. Expressed in
  20988. range of [0-255].
  20989. </p>
  20990. </dd>
  20991. <dt><samp>SATMIN</samp></dt>
  20992. <dd><p>Display the minimal saturation value contained within the input frame.
  20993. Expressed in range of [0-~181.02].
  20994. </p>
  20995. </dd>
  20996. <dt><samp>SATLOW</samp></dt>
  20997. <dd><p>Display the saturation value at the 10% percentile within the input frame.
  20998. Expressed in range of [0-~181.02].
  20999. </p>
  21000. </dd>
  21001. <dt><samp>SATAVG</samp></dt>
  21002. <dd><p>Display the average saturation value within the input frame. Expressed in range
  21003. of [0-~181.02].
  21004. </p>
  21005. </dd>
  21006. <dt><samp>SATHIGH</samp></dt>
  21007. <dd><p>Display the saturation value at the 90% percentile within the input frame.
  21008. Expressed in range of [0-~181.02].
  21009. </p>
  21010. </dd>
  21011. <dt><samp>SATMAX</samp></dt>
  21012. <dd><p>Display the maximum saturation value contained within the input frame.
  21013. Expressed in range of [0-~181.02].
  21014. </p>
  21015. </dd>
  21016. <dt><samp>HUEMED</samp></dt>
  21017. <dd><p>Display the median value for hue within the input frame. Expressed in range of
  21018. [0-360].
  21019. </p>
  21020. </dd>
  21021. <dt><samp>HUEAVG</samp></dt>
  21022. <dd><p>Display the average value for hue within the input frame. Expressed in range of
  21023. [0-360].
  21024. </p>
  21025. </dd>
  21026. <dt><samp>YDIF</samp></dt>
  21027. <dd><p>Display the average of sample value difference between all values of the Y
  21028. plane in the current frame and corresponding values of the previous input frame.
  21029. Expressed in range of [0-255].
  21030. </p>
  21031. </dd>
  21032. <dt><samp>UDIF</samp></dt>
  21033. <dd><p>Display the average of sample value difference between all values of the U
  21034. plane in the current frame and corresponding values of the previous input frame.
  21035. Expressed in range of [0-255].
  21036. </p>
  21037. </dd>
  21038. <dt><samp>VDIF</samp></dt>
  21039. <dd><p>Display the average of sample value difference between all values of the V
  21040. plane in the current frame and corresponding values of the previous input frame.
  21041. Expressed in range of [0-255].
  21042. </p>
  21043. </dd>
  21044. <dt><samp>YBITDEPTH</samp></dt>
  21045. <dd><p>Display bit depth of Y plane in current frame.
  21046. Expressed in range of [0-16].
  21047. </p>
  21048. </dd>
  21049. <dt><samp>UBITDEPTH</samp></dt>
  21050. <dd><p>Display bit depth of U plane in current frame.
  21051. Expressed in range of [0-16].
  21052. </p>
  21053. </dd>
  21054. <dt><samp>VBITDEPTH</samp></dt>
  21055. <dd><p>Display bit depth of V plane in current frame.
  21056. Expressed in range of [0-16].
  21057. </p></dd>
  21058. </dl>
  21059. <p>The filter accepts the following options:
  21060. </p>
  21061. <dl compact="compact">
  21062. <dt><samp>stat</samp></dt>
  21063. <dt><samp>out</samp></dt>
  21064. <dd>
  21065. <p><samp>stat</samp> specify an additional form of image analysis.
  21066. <samp>out</samp> output video with the specified type of pixel highlighted.
  21067. </p>
  21068. <p>Both options accept the following values:
  21069. </p>
  21070. <dl compact="compact">
  21071. <dt>&lsquo;<samp>tout</samp>&rsquo;</dt>
  21072. <dd><p>Identify <var>temporal outliers</var> pixels. A <var>temporal outlier</var> is a pixel
  21073. unlike the neighboring pixels of the same field. Examples of temporal outliers
  21074. include the results of video dropouts, head clogs, or tape tracking issues.
  21075. </p>
  21076. </dd>
  21077. <dt>&lsquo;<samp>vrep</samp>&rsquo;</dt>
  21078. <dd><p>Identify <var>vertical line repetition</var>. Vertical line repetition includes
  21079. similar rows of pixels within a frame. In born-digital video vertical line
  21080. repetition is common, but this pattern is uncommon in video digitized from an
  21081. analog source. When it occurs in video that results from the digitization of an
  21082. analog source it can indicate concealment from a dropout compensator.
  21083. </p>
  21084. </dd>
  21085. <dt>&lsquo;<samp>brng</samp>&rsquo;</dt>
  21086. <dd><p>Identify pixels that fall outside of legal broadcast range.
  21087. </p></dd>
  21088. </dl>
  21089. </dd>
  21090. <dt><samp>color, c</samp></dt>
  21091. <dd><p>Set the highlight color for the <samp>out</samp> option. The default color is
  21092. yellow.
  21093. </p></dd>
  21094. </dl>
  21095. <a name="Examples-106"></a>
  21096. <h4 class="subsection">11.205.1 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>
  21097. <ul>
  21098. <li> Output data of various video metrics:
  21099. <div class="example">
  21100. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats=&quot;stat=tout+vrep+brng&quot; -show_frames
  21101. </pre></div>
  21102. </li><li> Output specific data about the minimum and maximum values of the Y plane per frame:
  21103. <div class="example">
  21104. <pre class="example">ffprobe -f lavfi movie=example.mov,signalstats -show_entries frame_tags=lavfi.signalstats.YMAX,lavfi.signalstats.YMIN
  21105. </pre></div>
  21106. </li><li> Playback video while highlighting pixels that are outside of broadcast range in red.
  21107. <div class="example">
  21108. <pre class="example">ffplay example.mov -vf signalstats=&quot;out=brng:color=red&quot;
  21109. </pre></div>
  21110. </li><li> Playback video with signalstats metadata drawn over the frame.
  21111. <div class="example">
  21112. <pre class="example">ffplay example.mov -vf signalstats=stat=brng+vrep+tout,drawtext=fontfile=FreeSerif.ttf:textfile=signalstat_drawtext.txt
  21113. </pre></div>
  21114. <p>The contents of signalstat_drawtext.txt used in the command are:
  21115. </p><div class="example">
  21116. <pre class="example">time %{pts:hms}
  21117. Y (%{metadata:lavfi.signalstats.YMIN}-%{metadata:lavfi.signalstats.YMAX})
  21118. U (%{metadata:lavfi.signalstats.UMIN}-%{metadata:lavfi.signalstats.UMAX})
  21119. V (%{metadata:lavfi.signalstats.VMIN}-%{metadata:lavfi.signalstats.VMAX})
  21120. saturation maximum: %{metadata:lavfi.signalstats.SATMAX}
  21121. </pre></div>
  21122. </li></ul>
  21123. <span id="signature"></span><a name="signature-1"></a>
  21124. <h3 class="section">11.206 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>
  21125. <p>Calculates the MPEG-7 Video Signature. The filter can handle more than one
  21126. input. In this case the matching between the inputs can be calculated additionally.
  21127. The filter always passes through the first input. The signature of each stream can
  21128. be written into a file.
  21129. </p>
  21130. <p>It accepts the following options:
  21131. </p>
  21132. <dl compact="compact">
  21133. <dt><samp>detectmode</samp></dt>
  21134. <dd><p>Enable or disable the matching process.
  21135. </p>
  21136. <p>Available values are:
  21137. </p>
  21138. <dl compact="compact">
  21139. <dt>&lsquo;<samp>off</samp>&rsquo;</dt>
  21140. <dd><p>Disable the calculation of a matching (default).
  21141. </p></dd>
  21142. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  21143. <dd><p>Calculate the matching for the whole video and output whether the whole video
  21144. matches or only parts.
  21145. </p></dd>
  21146. <dt>&lsquo;<samp>fast</samp>&rsquo;</dt>
  21147. <dd><p>Calculate only until a matching is found or the video ends. Should be faster in
  21148. some cases.
  21149. </p></dd>
  21150. </dl>
  21151. </dd>
  21152. <dt><samp>nb_inputs</samp></dt>
  21153. <dd><p>Set the number of inputs. The option value must be a non negative integer.
  21154. Default value is 1.
  21155. </p>
  21156. </dd>
  21157. <dt><samp>filename</samp></dt>
  21158. <dd><p>Set the path to which the output is written. If there is more than one input,
  21159. the path must be a prototype, i.e. must contain %d or %0nd (where n is a positive
  21160. integer), that will be replaced with the input number. If no filename is
  21161. specified, no output will be written. This is the default.
  21162. </p>
  21163. </dd>
  21164. <dt><samp>format</samp></dt>
  21165. <dd><p>Choose the output format.
  21166. </p>
  21167. <p>Available values are:
  21168. </p>
  21169. <dl compact="compact">
  21170. <dt>&lsquo;<samp>binary</samp>&rsquo;</dt>
  21171. <dd><p>Use the specified binary representation (default).
  21172. </p></dd>
  21173. <dt>&lsquo;<samp>xml</samp>&rsquo;</dt>
  21174. <dd><p>Use the specified xml representation.
  21175. </p></dd>
  21176. </dl>
  21177. </dd>
  21178. <dt><samp>th_d</samp></dt>
  21179. <dd><p>Set threshold to detect one word as similar. The option value must be an integer
  21180. greater than zero. The default value is 9000.
  21181. </p>
  21182. </dd>
  21183. <dt><samp>th_dc</samp></dt>
  21184. <dd><p>Set threshold to detect all words as similar. The option value must be an integer
  21185. greater than zero. The default value is 60000.
  21186. </p>
  21187. </dd>
  21188. <dt><samp>th_xh</samp></dt>
  21189. <dd><p>Set threshold to detect frames as similar. The option value must be an integer
  21190. greater than zero. The default value is 116.
  21191. </p>
  21192. </dd>
  21193. <dt><samp>th_di</samp></dt>
  21194. <dd><p>Set the minimum length of a sequence in frames to recognize it as matching
  21195. sequence. The option value must be a non negative integer value.
  21196. The default value is 0.
  21197. </p>
  21198. </dd>
  21199. <dt><samp>th_it</samp></dt>
  21200. <dd><p>Set the minimum relation, that matching frames to all frames must have.
  21201. The option value must be a double value between 0 and 1. The default value is 0.5.
  21202. </p></dd>
  21203. </dl>
  21204. <a name="Examples-107"></a>
  21205. <h4 class="subsection">11.206.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>
  21206. <ul>
  21207. <li> To calculate the signature of an input video and store it in signature.bin:
  21208. <div class="example">
  21209. <pre class="example">ffmpeg -i input.mkv -vf signature=filename=signature.bin -map 0:v -f null -
  21210. </pre></div>
  21211. </li><li> To detect whether two videos match and store the signatures in XML format in
  21212. signature0.xml and signature1.xml:
  21213. <div class="example">
  21214. <pre class="example">ffmpeg -i input1.mkv -i input2.mkv -filter_complex &quot;[0:v][1:v] signature=nb_inputs=2:detectmode=full:format=xml:filename=signature%d.xml&quot; -map :v -f null -
  21215. </pre></div>
  21216. </li></ul>
  21217. <span id="smartblur"></span><a name="smartblur-1"></a>
  21218. <h3 class="section">11.207 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>
  21219. <p>Blur the input video without impacting the outlines.
  21220. </p>
  21221. <p>It accepts the following options:
  21222. </p>
  21223. <dl compact="compact">
  21224. <dt><samp>luma_radius, lr</samp></dt>
  21225. <dd><p>Set the luma radius. The option value must be a float number in
  21226. the range [0.1,5.0] that specifies the variance of the gaussian filter
  21227. used to blur the image (slower if larger). Default value is 1.0.
  21228. </p>
  21229. </dd>
  21230. <dt><samp>luma_strength, ls</samp></dt>
  21231. <dd><p>Set the luma strength. The option value must be a float number
  21232. in the range [-1.0,1.0] that configures the blurring. A value included
  21233. in [0.0,1.0] will blur the image whereas a value included in
  21234. [-1.0,0.0] will sharpen the image. Default value is 1.0.
  21235. </p>
  21236. </dd>
  21237. <dt><samp>luma_threshold, lt</samp></dt>
  21238. <dd><p>Set the luma threshold used as a coefficient to determine
  21239. whether a pixel should be blurred or not. The option value must be an
  21240. integer in the range [-30,30]. A value of 0 will filter all the image,
  21241. a value included in [0,30] will filter flat areas and a value included
  21242. in [-30,0] will filter edges. Default value is 0.
  21243. </p>
  21244. </dd>
  21245. <dt><samp>chroma_radius, cr</samp></dt>
  21246. <dd><p>Set the chroma radius. The option value must be a float number in
  21247. the range [0.1,5.0] that specifies the variance of the gaussian filter
  21248. used to blur the image (slower if larger). Default value is <samp>luma_radius</samp>.
  21249. </p>
  21250. </dd>
  21251. <dt><samp>chroma_strength, cs</samp></dt>
  21252. <dd><p>Set the chroma strength. The option value must be a float number
  21253. in the range [-1.0,1.0] that configures the blurring. A value included
  21254. in [0.0,1.0] will blur the image whereas a value included in
  21255. [-1.0,0.0] will sharpen the image. Default value is <samp>luma_strength</samp>.
  21256. </p>
  21257. </dd>
  21258. <dt><samp>chroma_threshold, ct</samp></dt>
  21259. <dd><p>Set the chroma threshold used as a coefficient to determine
  21260. whether a pixel should be blurred or not. The option value must be an
  21261. integer in the range [-30,30]. A value of 0 will filter all the image,
  21262. a value included in [0,30] will filter flat areas and a value included
  21263. in [-30,0] will filter edges. Default value is <samp>luma_threshold</samp>.
  21264. </p></dd>
  21265. </dl>
  21266. <p>If a chroma option is not explicitly set, the corresponding luma value
  21267. is set.
  21268. </p>
  21269. <a name="sobel"></a>
  21270. <h3 class="section">11.208 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>
  21271. <p>Apply sobel operator to input video stream.
  21272. </p>
  21273. <p>The filter accepts the following option:
  21274. </p>
  21275. <dl compact="compact">
  21276. <dt><samp>planes</samp></dt>
  21277. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  21278. By default value 0xf, all planes will be processed.
  21279. </p>
  21280. </dd>
  21281. <dt><samp>scale</samp></dt>
  21282. <dd><p>Set value which will be multiplied with filtered result.
  21283. </p>
  21284. </dd>
  21285. <dt><samp>delta</samp></dt>
  21286. <dd><p>Set value which will be added to filtered result.
  21287. </p></dd>
  21288. </dl>
  21289. <a name="Commands-123"></a>
  21290. <h4 class="subsection">11.208.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>
  21291. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  21292. </p>
  21293. <span id="spp"></span><a name="spp-1"></a>
  21294. <h3 class="section">11.209 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>
  21295. <p>Apply a simple postprocessing filter that compresses and decompresses the image
  21296. at several (or - in the case of <samp>quality</samp> level <code>6</code> - all) shifts
  21297. and average the results.
  21298. </p>
  21299. <p>The filter accepts the following options:
  21300. </p>
  21301. <dl compact="compact">
  21302. <dt><samp>quality</samp></dt>
  21303. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  21304. an integer in the range 0-6. If set to <code>0</code>, the filter will have no
  21305. effect. A value of <code>6</code> means the higher quality. For each increment of
  21306. that value the speed drops by a factor of approximately 2. Default value is
  21307. <code>3</code>.
  21308. </p>
  21309. </dd>
  21310. <dt><samp>qp</samp></dt>
  21311. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  21312. from the video stream (if available).
  21313. </p>
  21314. </dd>
  21315. <dt><samp>mode</samp></dt>
  21316. <dd><p>Set thresholding mode. Available modes are:
  21317. </p>
  21318. <dl compact="compact">
  21319. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  21320. <dd><p>Set hard thresholding (default).
  21321. </p></dd>
  21322. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  21323. <dd><p>Set soft thresholding (better de-ringing effect, but likely blurrier).
  21324. </p></dd>
  21325. </dl>
  21326. </dd>
  21327. <dt><samp>use_bframe_qp</samp></dt>
  21328. <dd><p>Enable the use of the QP from the B-Frames if set to <code>1</code>. Using this
  21329. option may cause flicker since the B-Frames have often larger QP. Default is
  21330. <code>0</code> (not enabled).
  21331. </p></dd>
  21332. </dl>
  21333. <a name="Commands-124"></a>
  21334. <h4 class="subsection">11.209.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>
  21335. <p>This filter supports the following commands:
  21336. </p><dl compact="compact">
  21337. <dt><samp>quality, level</samp></dt>
  21338. <dd><p>Set quality level. The value <code>max</code> can be used to set the maximum level,
  21339. currently <code>6</code>.
  21340. </p></dd>
  21341. </dl>
  21342. <span id="sr"></span><a name="sr-1"></a>
  21343. <h3 class="section">11.210 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>
  21344. <p>Scale the input by applying one of the super-resolution methods based on
  21345. convolutional neural networks. Supported models:
  21346. </p>
  21347. <ul>
  21348. <li> Super-Resolution Convolutional Neural Network model (SRCNN).
  21349. See <a href="https://arxiv.org/abs/1501.00092">https://arxiv.org/abs/1501.00092</a>.
  21350. </li><li> Efficient Sub-Pixel Convolutional Neural Network model (ESPCN).
  21351. See <a href="https://arxiv.org/abs/1609.05158">https://arxiv.org/abs/1609.05158</a>.
  21352. </li></ul>
  21353. <p>Training scripts as well as scripts for model file (.pb) saving can be found at
  21354. <a href="https://github.com/XueweiMeng/sr/tree/sr_dnn_native">https://github.com/XueweiMeng/sr/tree/sr_dnn_native</a>. Original repository
  21355. is at <a href="https://github.com/HighVoltageRocknRoll/sr.git">https://github.com/HighVoltageRocknRoll/sr.git</a>.
  21356. </p>
  21357. <p>Native model files (.model) can be generated from TensorFlow model
  21358. files (.pb) by using tools/python/convert.py
  21359. </p>
  21360. <p>The filter accepts the following options:
  21361. </p>
  21362. <dl compact="compact">
  21363. <dt><samp>dnn_backend</samp></dt>
  21364. <dd><p>Specify which DNN backend to use for model loading and execution. This option accepts
  21365. the following values:
  21366. </p>
  21367. <dl compact="compact">
  21368. <dt>&lsquo;<samp>native</samp>&rsquo;</dt>
  21369. <dd><p>Native implementation of DNN loading and execution.
  21370. </p>
  21371. </dd>
  21372. <dt>&lsquo;<samp>tensorflow</samp>&rsquo;</dt>
  21373. <dd><p>TensorFlow backend. To enable this backend you
  21374. need to install the TensorFlow for C library (see
  21375. <a href="https://www.tensorflow.org/install/install_c">https://www.tensorflow.org/install/install_c</a>) and configure FFmpeg with
  21376. <code>--enable-libtensorflow</code>
  21377. </p></dd>
  21378. </dl>
  21379. <p>Default value is &lsquo;<samp>native</samp>&rsquo;.
  21380. </p>
  21381. </dd>
  21382. <dt><samp>model</samp></dt>
  21383. <dd><p>Set path to model file specifying network architecture and its parameters.
  21384. Note that different backends use different file formats. TensorFlow backend
  21385. can load files for both formats, while native backend can load files for only
  21386. its format.
  21387. </p>
  21388. </dd>
  21389. <dt><samp>scale_factor</samp></dt>
  21390. <dd><p>Set scale factor for SRCNN model. Allowed values are <code>2</code>, <code>3</code> and <code>4</code>.
  21391. Default value is <code>2</code>. Scale factor is necessary for SRCNN model, because it accepts
  21392. input upscaled using bicubic upscaling with proper scale factor.
  21393. </p></dd>
  21394. </dl>
  21395. <p>This feature can also be finished with <a href="#dnn_005fprocessing">dnn_processing</a> filter.
  21396. </p>
  21397. <a name="ssim"></a>
  21398. <h3 class="section">11.211 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>
  21399. <p>Obtain the SSIM (Structural SImilarity Metric) between two input videos.
  21400. </p>
  21401. <p>This filter takes in input two input videos, the first input is
  21402. considered the &quot;main&quot; source and is passed unchanged to the
  21403. output. The second input is used as a &quot;reference&quot; video for computing
  21404. the SSIM.
  21405. </p>
  21406. <p>Both video inputs must have the same resolution and pixel format for
  21407. this filter to work correctly. Also it assumes that both inputs
  21408. have the same number of frames, which are compared one by one.
  21409. </p>
  21410. <p>The filter stores the calculated SSIM of each frame.
  21411. </p>
  21412. <p>The description of the accepted parameters follows.
  21413. </p>
  21414. <dl compact="compact">
  21415. <dt><samp>stats_file, f</samp></dt>
  21416. <dd><p>If specified the filter will use the named file to save the SSIM of
  21417. each individual frame. When filename equals &quot;-&quot; the data is sent to
  21418. standard output.
  21419. </p></dd>
  21420. </dl>
  21421. <p>The file printed if <var>stats_file</var> is selected, contains a sequence of
  21422. key/value pairs of the form <var>key</var>:<var>value</var> for each compared
  21423. couple of frames.
  21424. </p>
  21425. <p>A description of each shown parameter follows:
  21426. </p>
  21427. <dl compact="compact">
  21428. <dt><samp>n</samp></dt>
  21429. <dd><p>sequential number of the input frame, starting from 1
  21430. </p>
  21431. </dd>
  21432. <dt><samp>Y, U, V, R, G, B</samp></dt>
  21433. <dd><p>SSIM of the compared frames for the component specified by the suffix.
  21434. </p>
  21435. </dd>
  21436. <dt><samp>All</samp></dt>
  21437. <dd><p>SSIM of the compared frames for the whole frame.
  21438. </p>
  21439. </dd>
  21440. <dt><samp>dB</samp></dt>
  21441. <dd><p>Same as above but in dB representation.
  21442. </p></dd>
  21443. </dl>
  21444. <p>This filter also supports the <a href="#framesync">framesync</a> options.
  21445. </p>
  21446. <a name="Examples-108"></a>
  21447. <h4 class="subsection">11.211.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>
  21448. <ul>
  21449. <li> For example:
  21450. <div class="example">
  21451. <pre class="example">movie=ref_movie.mpg, setpts=PTS-STARTPTS [main];
  21452. [main][ref] ssim=&quot;stats_file=stats.log&quot; [out]
  21453. </pre></div>
  21454. <p>On this example the input file being processed is compared with the
  21455. reference file <samp>ref_movie.mpg</samp>. The SSIM of each individual frame
  21456. is stored in <samp>stats.log</samp>.
  21457. </p>
  21458. </li><li> Another example with both psnr and ssim at same time:
  21459. <div class="example">
  21460. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi &quot;ssim;[0:v][1:v]psnr&quot; -f null -
  21461. </pre></div>
  21462. </li><li> Another example with different containers:
  21463. <div class="example">
  21464. <pre class="example">ffmpeg -i main.mpg -i ref.mkv -lavfi &quot;[0:v]settb=AVTB,setpts=PTS-STARTPTS[main];[1:v]settb=AVTB,setpts=PTS-STARTPTS[ref];[main][ref]ssim&quot; -f null -
  21465. </pre></div>
  21466. </li></ul>
  21467. <a name="stereo3d"></a>
  21468. <h3 class="section">11.212 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>
  21469. <p>Convert between different stereoscopic image formats.
  21470. </p>
  21471. <p>The filters accept the following options:
  21472. </p>
  21473. <dl compact="compact">
  21474. <dt><samp>in</samp></dt>
  21475. <dd><p>Set stereoscopic image format of input.
  21476. </p>
  21477. <p>Available values for input image formats are:
  21478. </p><dl compact="compact">
  21479. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  21480. <dd><p>side by side parallel (left eye left, right eye right)
  21481. </p>
  21482. </dd>
  21483. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  21484. <dd><p>side by side crosseye (right eye left, left eye right)
  21485. </p>
  21486. </dd>
  21487. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  21488. <dd><p>side by side parallel with half width resolution
  21489. (left eye left, right eye right)
  21490. </p>
  21491. </dd>
  21492. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  21493. <dd><p>side by side crosseye with half width resolution
  21494. (right eye left, left eye right)
  21495. </p>
  21496. </dd>
  21497. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  21498. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  21499. <dd><p>above-below (left eye above, right eye below)
  21500. </p>
  21501. </dd>
  21502. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  21503. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  21504. <dd><p>above-below (right eye above, left eye below)
  21505. </p>
  21506. </dd>
  21507. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  21508. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  21509. <dd><p>above-below with half height resolution
  21510. (left eye above, right eye below)
  21511. </p>
  21512. </dd>
  21513. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  21514. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  21515. <dd><p>above-below with half height resolution
  21516. (right eye above, left eye below)
  21517. </p>
  21518. </dd>
  21519. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  21520. <dd><p>alternating frames (left eye first, right eye second)
  21521. </p>
  21522. </dd>
  21523. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  21524. <dd><p>alternating frames (right eye first, left eye second)
  21525. </p>
  21526. </dd>
  21527. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  21528. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  21529. </p>
  21530. </dd>
  21531. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  21532. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  21533. </p>
  21534. </dd>
  21535. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  21536. <dd><p>interleaved columns, left eye first
  21537. </p>
  21538. </dd>
  21539. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  21540. <dd><p>interleaved columns, right eye first
  21541. </p>
  21542. <p>Default value is &lsquo;<samp>sbsl</samp>&rsquo;.
  21543. </p></dd>
  21544. </dl>
  21545. </dd>
  21546. <dt><samp>out</samp></dt>
  21547. <dd><p>Set stereoscopic image format of output.
  21548. </p>
  21549. <dl compact="compact">
  21550. <dt>&lsquo;<samp>sbsl</samp>&rsquo;</dt>
  21551. <dd><p>side by side parallel (left eye left, right eye right)
  21552. </p>
  21553. </dd>
  21554. <dt>&lsquo;<samp>sbsr</samp>&rsquo;</dt>
  21555. <dd><p>side by side crosseye (right eye left, left eye right)
  21556. </p>
  21557. </dd>
  21558. <dt>&lsquo;<samp>sbs2l</samp>&rsquo;</dt>
  21559. <dd><p>side by side parallel with half width resolution
  21560. (left eye left, right eye right)
  21561. </p>
  21562. </dd>
  21563. <dt>&lsquo;<samp>sbs2r</samp>&rsquo;</dt>
  21564. <dd><p>side by side crosseye with half width resolution
  21565. (right eye left, left eye right)
  21566. </p>
  21567. </dd>
  21568. <dt>&lsquo;<samp>abl</samp>&rsquo;</dt>
  21569. <dt>&lsquo;<samp>tbl</samp>&rsquo;</dt>
  21570. <dd><p>above-below (left eye above, right eye below)
  21571. </p>
  21572. </dd>
  21573. <dt>&lsquo;<samp>abr</samp>&rsquo;</dt>
  21574. <dt>&lsquo;<samp>tbr</samp>&rsquo;</dt>
  21575. <dd><p>above-below (right eye above, left eye below)
  21576. </p>
  21577. </dd>
  21578. <dt>&lsquo;<samp>ab2l</samp>&rsquo;</dt>
  21579. <dt>&lsquo;<samp>tb2l</samp>&rsquo;</dt>
  21580. <dd><p>above-below with half height resolution
  21581. (left eye above, right eye below)
  21582. </p>
  21583. </dd>
  21584. <dt>&lsquo;<samp>ab2r</samp>&rsquo;</dt>
  21585. <dt>&lsquo;<samp>tb2r</samp>&rsquo;</dt>
  21586. <dd><p>above-below with half height resolution
  21587. (right eye above, left eye below)
  21588. </p>
  21589. </dd>
  21590. <dt>&lsquo;<samp>al</samp>&rsquo;</dt>
  21591. <dd><p>alternating frames (left eye first, right eye second)
  21592. </p>
  21593. </dd>
  21594. <dt>&lsquo;<samp>ar</samp>&rsquo;</dt>
  21595. <dd><p>alternating frames (right eye first, left eye second)
  21596. </p>
  21597. </dd>
  21598. <dt>&lsquo;<samp>irl</samp>&rsquo;</dt>
  21599. <dd><p>interleaved rows (left eye has top row, right eye starts on next row)
  21600. </p>
  21601. </dd>
  21602. <dt>&lsquo;<samp>irr</samp>&rsquo;</dt>
  21603. <dd><p>interleaved rows (right eye has top row, left eye starts on next row)
  21604. </p>
  21605. </dd>
  21606. <dt>&lsquo;<samp>arbg</samp>&rsquo;</dt>
  21607. <dd><p>anaglyph red/blue gray
  21608. (red filter on left eye, blue filter on right eye)
  21609. </p>
  21610. </dd>
  21611. <dt>&lsquo;<samp>argg</samp>&rsquo;</dt>
  21612. <dd><p>anaglyph red/green gray
  21613. (red filter on left eye, green filter on right eye)
  21614. </p>
  21615. </dd>
  21616. <dt>&lsquo;<samp>arcg</samp>&rsquo;</dt>
  21617. <dd><p>anaglyph red/cyan gray
  21618. (red filter on left eye, cyan filter on right eye)
  21619. </p>
  21620. </dd>
  21621. <dt>&lsquo;<samp>arch</samp>&rsquo;</dt>
  21622. <dd><p>anaglyph red/cyan half colored
  21623. (red filter on left eye, cyan filter on right eye)
  21624. </p>
  21625. </dd>
  21626. <dt>&lsquo;<samp>arcc</samp>&rsquo;</dt>
  21627. <dd><p>anaglyph red/cyan color
  21628. (red filter on left eye, cyan filter on right eye)
  21629. </p>
  21630. </dd>
  21631. <dt>&lsquo;<samp>arcd</samp>&rsquo;</dt>
  21632. <dd><p>anaglyph red/cyan color optimized with the least squares projection of dubois
  21633. (red filter on left eye, cyan filter on right eye)
  21634. </p>
  21635. </dd>
  21636. <dt>&lsquo;<samp>agmg</samp>&rsquo;</dt>
  21637. <dd><p>anaglyph green/magenta gray
  21638. (green filter on left eye, magenta filter on right eye)
  21639. </p>
  21640. </dd>
  21641. <dt>&lsquo;<samp>agmh</samp>&rsquo;</dt>
  21642. <dd><p>anaglyph green/magenta half colored
  21643. (green filter on left eye, magenta filter on right eye)
  21644. </p>
  21645. </dd>
  21646. <dt>&lsquo;<samp>agmc</samp>&rsquo;</dt>
  21647. <dd><p>anaglyph green/magenta colored
  21648. (green filter on left eye, magenta filter on right eye)
  21649. </p>
  21650. </dd>
  21651. <dt>&lsquo;<samp>agmd</samp>&rsquo;</dt>
  21652. <dd><p>anaglyph green/magenta color optimized with the least squares projection of dubois
  21653. (green filter on left eye, magenta filter on right eye)
  21654. </p>
  21655. </dd>
  21656. <dt>&lsquo;<samp>aybg</samp>&rsquo;</dt>
  21657. <dd><p>anaglyph yellow/blue gray
  21658. (yellow filter on left eye, blue filter on right eye)
  21659. </p>
  21660. </dd>
  21661. <dt>&lsquo;<samp>aybh</samp>&rsquo;</dt>
  21662. <dd><p>anaglyph yellow/blue half colored
  21663. (yellow filter on left eye, blue filter on right eye)
  21664. </p>
  21665. </dd>
  21666. <dt>&lsquo;<samp>aybc</samp>&rsquo;</dt>
  21667. <dd><p>anaglyph yellow/blue colored
  21668. (yellow filter on left eye, blue filter on right eye)
  21669. </p>
  21670. </dd>
  21671. <dt>&lsquo;<samp>aybd</samp>&rsquo;</dt>
  21672. <dd><p>anaglyph yellow/blue color optimized with the least squares projection of dubois
  21673. (yellow filter on left eye, blue filter on right eye)
  21674. </p>
  21675. </dd>
  21676. <dt>&lsquo;<samp>ml</samp>&rsquo;</dt>
  21677. <dd><p>mono output (left eye only)
  21678. </p>
  21679. </dd>
  21680. <dt>&lsquo;<samp>mr</samp>&rsquo;</dt>
  21681. <dd><p>mono output (right eye only)
  21682. </p>
  21683. </dd>
  21684. <dt>&lsquo;<samp>chl</samp>&rsquo;</dt>
  21685. <dd><p>checkerboard, left eye first
  21686. </p>
  21687. </dd>
  21688. <dt>&lsquo;<samp>chr</samp>&rsquo;</dt>
  21689. <dd><p>checkerboard, right eye first
  21690. </p>
  21691. </dd>
  21692. <dt>&lsquo;<samp>icl</samp>&rsquo;</dt>
  21693. <dd><p>interleaved columns, left eye first
  21694. </p>
  21695. </dd>
  21696. <dt>&lsquo;<samp>icr</samp>&rsquo;</dt>
  21697. <dd><p>interleaved columns, right eye first
  21698. </p>
  21699. </dd>
  21700. <dt>&lsquo;<samp>hdmi</samp>&rsquo;</dt>
  21701. <dd><p>HDMI frame pack
  21702. </p></dd>
  21703. </dl>
  21704. <p>Default value is &lsquo;<samp>arcd</samp>&rsquo;.
  21705. </p></dd>
  21706. </dl>
  21707. <a name="Examples-109"></a>
  21708. <h4 class="subsection">11.212.1 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>
  21709. <ul>
  21710. <li> Convert input video from side by side parallel to anaglyph yellow/blue dubois:
  21711. <div class="example">
  21712. <pre class="example">stereo3d=sbsl:aybd
  21713. </pre></div>
  21714. </li><li> Convert input video from above below (left eye above, right eye below) to side by side crosseye.
  21715. <div class="example">
  21716. <pre class="example">stereo3d=abl:sbsr
  21717. </pre></div>
  21718. </li></ul>
  21719. <a name="streamselect_002c-astreamselect"></a>
  21720. <h3 class="section">11.213 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>
  21721. <p>Select video or audio streams.
  21722. </p>
  21723. <p>The filter accepts the following options:
  21724. </p>
  21725. <dl compact="compact">
  21726. <dt><samp>inputs</samp></dt>
  21727. <dd><p>Set number of inputs. Default is 2.
  21728. </p>
  21729. </dd>
  21730. <dt><samp>map</samp></dt>
  21731. <dd><p>Set input indexes to remap to outputs.
  21732. </p></dd>
  21733. </dl>
  21734. <a name="Commands-125"></a>
  21735. <h4 class="subsection">11.213.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>
  21736. <p>The <code>streamselect</code> and <code>astreamselect</code> filter supports the following
  21737. commands:
  21738. </p>
  21739. <dl compact="compact">
  21740. <dt><samp>map</samp></dt>
  21741. <dd><p>Set input indexes to remap to outputs.
  21742. </p></dd>
  21743. </dl>
  21744. <a name="Examples-110"></a>
  21745. <h4 class="subsection">11.213.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>
  21746. <ul>
  21747. <li> Select first 5 seconds 1st stream and rest of time 2nd stream:
  21748. <div class="example">
  21749. <pre class="example">sendcmd='5.0 streamselect map 1',streamselect=inputs=2:map=0
  21750. </pre></div>
  21751. </li><li> Same as above, but for audio:
  21752. <div class="example">
  21753. <pre class="example">asendcmd='5.0 astreamselect map 1',astreamselect=inputs=2:map=0
  21754. </pre></div>
  21755. </li></ul>
  21756. <span id="subtitles"></span><a name="subtitles-1"></a>
  21757. <h3 class="section">11.214 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>
  21758. <p>Draw subtitles on top of input video using the libass library.
  21759. </p>
  21760. <p>To enable compilation of this filter you need to configure FFmpeg with
  21761. <code>--enable-libass</code>. This filter also requires a build with libavcodec and
  21762. libavformat to convert the passed subtitles file to ASS (Advanced Substation
  21763. Alpha) subtitles format.
  21764. </p>
  21765. <p>The filter accepts the following options:
  21766. </p>
  21767. <dl compact="compact">
  21768. <dt><samp>filename, f</samp></dt>
  21769. <dd><p>Set the filename of the subtitle file to read. It must be specified.
  21770. </p>
  21771. </dd>
  21772. <dt><samp>original_size</samp></dt>
  21773. <dd><p>Specify the size of the original video, the video for which the ASS file
  21774. was composed. For the syntax of this option, check the
  21775. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  21776. Due to a misdesign in ASS aspect ratio arithmetic, this is necessary to
  21777. correctly scale the fonts if the aspect ratio has been changed.
  21778. </p>
  21779. </dd>
  21780. <dt><samp>fontsdir</samp></dt>
  21781. <dd><p>Set a directory path containing fonts that can be used by the filter.
  21782. These fonts will be used in addition to whatever the font provider uses.
  21783. </p>
  21784. </dd>
  21785. <dt><samp>alpha</samp></dt>
  21786. <dd><p>Process alpha channel, by default alpha channel is untouched.
  21787. </p>
  21788. </dd>
  21789. <dt><samp>charenc</samp></dt>
  21790. <dd><p>Set subtitles input character encoding. <code>subtitles</code> filter only. Only
  21791. useful if not UTF-8.
  21792. </p>
  21793. </dd>
  21794. <dt><samp>stream_index, si</samp></dt>
  21795. <dd><p>Set subtitles stream index. <code>subtitles</code> filter only.
  21796. </p>
  21797. </dd>
  21798. <dt><samp>force_style</samp></dt>
  21799. <dd><p>Override default style or script info parameters of the subtitles. It accepts a
  21800. string containing ASS style format <code>KEY=VALUE</code> couples separated by &quot;,&quot;.
  21801. </p></dd>
  21802. </dl>
  21803. <p>If the first key is not specified, it is assumed that the first value
  21804. specifies the <samp>filename</samp>.
  21805. </p>
  21806. <p>For example, to render the file <samp>sub.srt</samp> on top of the input
  21807. video, use the command:
  21808. </p><div class="example">
  21809. <pre class="example">subtitles=sub.srt
  21810. </pre></div>
  21811. <p>which is equivalent to:
  21812. </p><div class="example">
  21813. <pre class="example">subtitles=filename=sub.srt
  21814. </pre></div>
  21815. <p>To render the default subtitles stream from file <samp>video.mkv</samp>, use:
  21816. </p><div class="example">
  21817. <pre class="example">subtitles=video.mkv
  21818. </pre></div>
  21819. <p>To render the second subtitles stream from that file, use:
  21820. </p><div class="example">
  21821. <pre class="example">subtitles=video.mkv:si=1
  21822. </pre></div>
  21823. <p>To make the subtitles stream from <samp>sub.srt</samp> appear in 80% transparent blue
  21824. <code>DejaVu Serif</code>, use:
  21825. </p><div class="example">
  21826. <pre class="example">subtitles=sub.srt:force_style='Fontname=DejaVu Serif,PrimaryColour=&amp;HCCFF0000'
  21827. </pre></div>
  21828. <a name="super2xsai"></a>
  21829. <h3 class="section">11.215 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>
  21830. <p>Scale the input by 2x and smooth using the Super2xSaI (Scale and
  21831. Interpolate) pixel art scaling algorithm.
  21832. </p>
  21833. <p>Useful for enlarging pixel art images without reducing sharpness.
  21834. </p>
  21835. <a name="swaprect"></a>
  21836. <h3 class="section">11.216 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>
  21837. <p>Swap two rectangular objects in video.
  21838. </p>
  21839. <p>This filter accepts the following options:
  21840. </p>
  21841. <dl compact="compact">
  21842. <dt><samp>w</samp></dt>
  21843. <dd><p>Set object width.
  21844. </p>
  21845. </dd>
  21846. <dt><samp>h</samp></dt>
  21847. <dd><p>Set object height.
  21848. </p>
  21849. </dd>
  21850. <dt><samp>x1</samp></dt>
  21851. <dd><p>Set 1st rect x coordinate.
  21852. </p>
  21853. </dd>
  21854. <dt><samp>y1</samp></dt>
  21855. <dd><p>Set 1st rect y coordinate.
  21856. </p>
  21857. </dd>
  21858. <dt><samp>x2</samp></dt>
  21859. <dd><p>Set 2nd rect x coordinate.
  21860. </p>
  21861. </dd>
  21862. <dt><samp>y2</samp></dt>
  21863. <dd><p>Set 2nd rect y coordinate.
  21864. </p>
  21865. <p>All expressions are evaluated once for each frame.
  21866. </p></dd>
  21867. </dl>
  21868. <p>The all options are expressions containing the following constants:
  21869. </p>
  21870. <dl compact="compact">
  21871. <dt><samp>w</samp></dt>
  21872. <dt><samp>h</samp></dt>
  21873. <dd><p>The input width and height.
  21874. </p>
  21875. </dd>
  21876. <dt><samp>a</samp></dt>
  21877. <dd><p>same as <var>w</var> / <var>h</var>
  21878. </p>
  21879. </dd>
  21880. <dt><samp>sar</samp></dt>
  21881. <dd><p>input sample aspect ratio
  21882. </p>
  21883. </dd>
  21884. <dt><samp>dar</samp></dt>
  21885. <dd><p>input display aspect ratio, it is the same as (<var>w</var> / <var>h</var>) * <var>sar</var>
  21886. </p>
  21887. </dd>
  21888. <dt><samp>n</samp></dt>
  21889. <dd><p>The number of the input frame, starting from 0.
  21890. </p>
  21891. </dd>
  21892. <dt><samp>t</samp></dt>
  21893. <dd><p>The timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  21894. </p>
  21895. </dd>
  21896. <dt><samp>pos</samp></dt>
  21897. <dd><p>the position in the file of the input frame, NAN if unknown
  21898. </p></dd>
  21899. </dl>
  21900. <a name="Commands-126"></a>
  21901. <h4 class="subsection">11.216.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>
  21902. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  21903. </p>
  21904. <a name="swapuv"></a>
  21905. <h3 class="section">11.217 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>
  21906. <p>Swap U &amp; V plane.
  21907. </p>
  21908. <a name="tblend"></a>
  21909. <h3 class="section">11.218 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>
  21910. <p>Blend successive video frames.
  21911. </p>
  21912. <p>See <a href="#blend">blend</a>
  21913. </p>
  21914. <a name="telecine"></a>
  21915. <h3 class="section">11.219 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>
  21916. <p>Apply telecine process to the video.
  21917. </p>
  21918. <p>This filter accepts the following options:
  21919. </p>
  21920. <dl compact="compact">
  21921. <dt><samp>first_field</samp></dt>
  21922. <dd><dl compact="compact">
  21923. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  21924. <dd><p>top field first
  21925. </p></dd>
  21926. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  21927. <dd><p>bottom field first
  21928. The default value is <code>top</code>.
  21929. </p></dd>
  21930. </dl>
  21931. </dd>
  21932. <dt><samp>pattern</samp></dt>
  21933. <dd><p>A string of numbers representing the pulldown pattern you wish to apply.
  21934. The default value is <code>23</code>.
  21935. </p></dd>
  21936. </dl>
  21937. <div class="example">
  21938. <pre class="example">Some typical patterns:
  21939. NTSC output (30i):
  21940. 27.5p: 32222
  21941. 24p: 23 (classic)
  21942. 24p: 2332 (preferred)
  21943. 20p: 33
  21944. 18p: 334
  21945. 16p: 3444
  21946. PAL output (25i):
  21947. 27.5p: 12222
  21948. 24p: 222222222223 (&quot;Euro pulldown&quot;)
  21949. 16.67p: 33
  21950. 16p: 33333334
  21951. </pre></div>
  21952. <a name="thistogram"></a>
  21953. <h3 class="section">11.220 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>
  21954. <p>Compute and draw a color distribution histogram for the input video across time.
  21955. </p>
  21956. <p>Unlike <a href="#histogram">histogram</a> video filter which only shows histogram of single input frame
  21957. at certain time, this filter shows also past histograms of number of frames defined
  21958. by <code>width</code> option.
  21959. </p>
  21960. <p>The computed histogram is a representation of the color component
  21961. distribution in an image.
  21962. </p>
  21963. <p>The filter accepts the following options:
  21964. </p>
  21965. <dl compact="compact">
  21966. <dt><samp>width, w</samp></dt>
  21967. <dd><p>Set width of single color component output. Default value is <code>0</code>.
  21968. Value of <code>0</code> means width will be picked from input video.
  21969. This also set number of passed histograms to keep.
  21970. Allowed range is [0, 8192].
  21971. </p>
  21972. </dd>
  21973. <dt><samp>display_mode, d</samp></dt>
  21974. <dd><p>Set display mode.
  21975. It accepts the following values:
  21976. </p><dl compact="compact">
  21977. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  21978. <dd><p>Per color component graphs are placed below each other.
  21979. </p>
  21980. </dd>
  21981. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  21982. <dd><p>Per color component graphs are placed side by side.
  21983. </p>
  21984. </dd>
  21985. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  21986. <dd><p>Presents information identical to that in the <code>parade</code>, except
  21987. that the graphs representing color components are superimposed directly
  21988. over one another.
  21989. </p></dd>
  21990. </dl>
  21991. <p>Default is <code>stack</code>.
  21992. </p>
  21993. </dd>
  21994. <dt><samp>levels_mode, m</samp></dt>
  21995. <dd><p>Set mode. Can be either <code>linear</code>, or <code>logarithmic</code>.
  21996. Default is <code>linear</code>.
  21997. </p>
  21998. </dd>
  21999. <dt><samp>components, c</samp></dt>
  22000. <dd><p>Set what color components to display.
  22001. Default is <code>7</code>.
  22002. </p>
  22003. </dd>
  22004. <dt><samp>bgopacity, b</samp></dt>
  22005. <dd><p>Set background opacity. Default is <code>0.9</code>.
  22006. </p>
  22007. </dd>
  22008. <dt><samp>envelope, e</samp></dt>
  22009. <dd><p>Show envelope. Default is disabled.
  22010. </p>
  22011. </dd>
  22012. <dt><samp>ecolor, ec</samp></dt>
  22013. <dd><p>Set envelope color. Default is <code>gold</code>.
  22014. </p>
  22015. </dd>
  22016. <dt><samp>slide</samp></dt>
  22017. <dd><p>Set slide mode.
  22018. </p>
  22019. <p>Available values for slide is:
  22020. </p><dl compact="compact">
  22021. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  22022. <dd><p>Draw new frame when right border is reached.
  22023. </p>
  22024. </dd>
  22025. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  22026. <dd><p>Replace old columns with new ones.
  22027. </p>
  22028. </dd>
  22029. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  22030. <dd><p>Scroll from right to left.
  22031. </p>
  22032. </dd>
  22033. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  22034. <dd><p>Scroll from left to right.
  22035. </p>
  22036. </dd>
  22037. <dt>&lsquo;<samp>picture</samp>&rsquo;</dt>
  22038. <dd><p>Draw single picture.
  22039. </p></dd>
  22040. </dl>
  22041. <p>Default is <code>replace</code>.
  22042. </p></dd>
  22043. </dl>
  22044. <a name="threshold"></a>
  22045. <h3 class="section">11.221 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>
  22046. <p>Apply threshold effect to video stream.
  22047. </p>
  22048. <p>This filter needs four video streams to perform thresholding.
  22049. First stream is stream we are filtering.
  22050. Second stream is holding threshold values, third stream is holding min values,
  22051. and last, fourth stream is holding max values.
  22052. </p>
  22053. <p>The filter accepts the following option:
  22054. </p>
  22055. <dl compact="compact">
  22056. <dt><samp>planes</samp></dt>
  22057. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  22058. By default value 0xf, all planes will be processed.
  22059. </p></dd>
  22060. </dl>
  22061. <p>For example if first stream pixel&rsquo;s component value is less then threshold value
  22062. of pixel component from 2nd threshold stream, third stream value will picked,
  22063. otherwise fourth stream pixel component value will be picked.
  22064. </p>
  22065. <p>Using color source filter one can perform various types of thresholding:
  22066. </p>
  22067. <a name="Examples-111"></a>
  22068. <h4 class="subsection">11.221.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>
  22069. <ul>
  22070. <li> Binary threshold, using gray color as threshold:
  22071. <div class="example">
  22072. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=black -f lavfi -i color=white -lavfi threshold output.avi
  22073. </pre></div>
  22074. </li><li> Inverted binary threshold, using gray color as threshold:
  22075. <div class="example">
  22076. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -f lavfi -i color=black -lavfi threshold output.avi
  22077. </pre></div>
  22078. </li><li> Truncate binary threshold, using gray color as threshold:
  22079. <div class="example">
  22080. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=gray -lavfi threshold output.avi
  22081. </pre></div>
  22082. </li><li> Threshold to zero, using gray color as threshold:
  22083. <div class="example">
  22084. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -f lavfi -i color=white -i 320x240.avi -lavfi threshold output.avi
  22085. </pre></div>
  22086. </li><li> Inverted threshold to zero, using gray color as threshold:
  22087. <div class="example">
  22088. <pre class="example">ffmpeg -i 320x240.avi -f lavfi -i color=gray -i 320x240.avi -f lavfi -i color=white -lavfi threshold output.avi
  22089. </pre></div>
  22090. </li></ul>
  22091. <a name="thumbnail"></a>
  22092. <h3 class="section">11.222 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>
  22093. <p>Select the most representative frame in a given sequence of consecutive frames.
  22094. </p>
  22095. <p>The filter accepts the following options:
  22096. </p>
  22097. <dl compact="compact">
  22098. <dt><samp>n</samp></dt>
  22099. <dd><p>Set the frames batch size to analyze; in a set of <var>n</var> frames, the filter
  22100. will pick one of them, and then handle the next batch of <var>n</var> frames until
  22101. the end. Default is <code>100</code>.
  22102. </p></dd>
  22103. </dl>
  22104. <p>Since the filter keeps track of the whole frames sequence, a bigger <var>n</var>
  22105. value will result in a higher memory usage, so a high value is not recommended.
  22106. </p>
  22107. <a name="Examples-112"></a>
  22108. <h4 class="subsection">11.222.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>
  22109. <ul>
  22110. <li> Extract one picture each 50 frames:
  22111. <div class="example">
  22112. <pre class="example">thumbnail=50
  22113. </pre></div>
  22114. </li><li> Complete example of a thumbnail creation with <code>ffmpeg</code>:
  22115. <div class="example">
  22116. <pre class="example">ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
  22117. </pre></div>
  22118. </li></ul>
  22119. <span id="tile"></span><a name="tile-1"></a>
  22120. <h3 class="section">11.223 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>
  22121. <p>Tile several successive frames together.
  22122. </p>
  22123. <p>The <a href="#untile">untile</a> filter can do the reverse.
  22124. </p>
  22125. <p>The filter accepts the following options:
  22126. </p>
  22127. <dl compact="compact">
  22128. <dt><samp>layout</samp></dt>
  22129. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  22130. this option, check the
  22131. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  22132. </p>
  22133. </dd>
  22134. <dt><samp>nb_frames</samp></dt>
  22135. <dd><p>Set the maximum number of frames to render in the given area. It must be less
  22136. than or equal to <var>w</var>x<var>h</var>. The default value is <code>0</code>, meaning all
  22137. the area will be used.
  22138. </p>
  22139. </dd>
  22140. <dt><samp>margin</samp></dt>
  22141. <dd><p>Set the outer border margin in pixels.
  22142. </p>
  22143. </dd>
  22144. <dt><samp>padding</samp></dt>
  22145. <dd><p>Set the inner border thickness (i.e. the number of pixels between frames). For
  22146. more advanced padding options (such as having different values for the edges),
  22147. refer to the pad video filter.
  22148. </p>
  22149. </dd>
  22150. <dt><samp>color</samp></dt>
  22151. <dd><p>Specify the color of the unused area. For the syntax of this option, check the
  22152. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  22153. The default value of <var>color</var> is &quot;black&quot;.
  22154. </p>
  22155. </dd>
  22156. <dt><samp>overlap</samp></dt>
  22157. <dd><p>Set the number of frames to overlap when tiling several successive frames together.
  22158. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  22159. </p>
  22160. </dd>
  22161. <dt><samp>init_padding</samp></dt>
  22162. <dd><p>Set the number of frames to initially be empty before displaying first output frame.
  22163. This controls how soon will one get first output frame.
  22164. The value must be between <code>0</code> and <var>nb_frames - 1</var>.
  22165. </p></dd>
  22166. </dl>
  22167. <a name="Examples-113"></a>
  22168. <h4 class="subsection">11.223.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>
  22169. <ul>
  22170. <li> Produce 8x8 PNG tiles of all keyframes (<samp>-skip_frame nokey</samp>) in a movie:
  22171. <div class="example">
  22172. <pre class="example">ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
  22173. </pre></div>
  22174. <p>The <samp>-vsync 0</samp> is necessary to prevent <code>ffmpeg</code> from
  22175. duplicating each output frame to accommodate the originally detected frame
  22176. rate.
  22177. </p>
  22178. </li><li> Display <code>5</code> pictures in an area of <code>3x2</code> frames,
  22179. with <code>7</code> pixels between them, and <code>2</code> pixels of initial margin, using
  22180. mixed flat and named options:
  22181. <div class="example">
  22182. <pre class="example">tile=3x2:nb_frames=5:padding=7:margin=2
  22183. </pre></div>
  22184. </li></ul>
  22185. <a name="tinterlace"></a>
  22186. <h3 class="section">11.224 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>
  22187. <p>Perform various types of temporal field interlacing.
  22188. </p>
  22189. <p>Frames are counted starting from 1, so the first input frame is
  22190. considered odd.
  22191. </p>
  22192. <p>The filter accepts the following options:
  22193. </p>
  22194. <dl compact="compact">
  22195. <dt><samp>mode</samp></dt>
  22196. <dd><p>Specify the mode of the interlacing. This option can also be specified
  22197. as a value alone. See below for a list of values for this option.
  22198. </p>
  22199. <p>Available values are:
  22200. </p>
  22201. <dl compact="compact">
  22202. <dt>&lsquo;<samp>merge, 0</samp>&rsquo;</dt>
  22203. <dd><p>Move odd frames into the upper field, even into the lower field,
  22204. generating a double height frame at half frame rate.
  22205. </p><div class="example">
  22206. <pre class="example"> ------&gt; time
  22207. Input:
  22208. Frame 1 Frame 2 Frame 3 Frame 4
  22209. 11111 22222 33333 44444
  22210. 11111 22222 33333 44444
  22211. 11111 22222 33333 44444
  22212. 11111 22222 33333 44444
  22213. Output:
  22214. 11111 33333
  22215. 22222 44444
  22216. 11111 33333
  22217. 22222 44444
  22218. 11111 33333
  22219. 22222 44444
  22220. 11111 33333
  22221. 22222 44444
  22222. </pre></div>
  22223. </dd>
  22224. <dt>&lsquo;<samp>drop_even, 1</samp>&rsquo;</dt>
  22225. <dd><p>Only output odd frames, even frames are dropped, generating a frame with
  22226. unchanged height at half frame rate.
  22227. </p>
  22228. <div class="example">
  22229. <pre class="example"> ------&gt; time
  22230. Input:
  22231. Frame 1 Frame 2 Frame 3 Frame 4
  22232. 11111 22222 33333 44444
  22233. 11111 22222 33333 44444
  22234. 11111 22222 33333 44444
  22235. 11111 22222 33333 44444
  22236. Output:
  22237. 11111 33333
  22238. 11111 33333
  22239. 11111 33333
  22240. 11111 33333
  22241. </pre></div>
  22242. </dd>
  22243. <dt>&lsquo;<samp>drop_odd, 2</samp>&rsquo;</dt>
  22244. <dd><p>Only output even frames, odd frames are dropped, generating a frame with
  22245. unchanged height at half frame rate.
  22246. </p>
  22247. <div class="example">
  22248. <pre class="example"> ------&gt; time
  22249. Input:
  22250. Frame 1 Frame 2 Frame 3 Frame 4
  22251. 11111 22222 33333 44444
  22252. 11111 22222 33333 44444
  22253. 11111 22222 33333 44444
  22254. 11111 22222 33333 44444
  22255. Output:
  22256. 22222 44444
  22257. 22222 44444
  22258. 22222 44444
  22259. 22222 44444
  22260. </pre></div>
  22261. </dd>
  22262. <dt>&lsquo;<samp>pad, 3</samp>&rsquo;</dt>
  22263. <dd><p>Expand each frame to full height, but pad alternate lines with black,
  22264. generating a frame with double height at the same input frame rate.
  22265. </p>
  22266. <div class="example">
  22267. <pre class="example"> ------&gt; time
  22268. Input:
  22269. Frame 1 Frame 2 Frame 3 Frame 4
  22270. 11111 22222 33333 44444
  22271. 11111 22222 33333 44444
  22272. 11111 22222 33333 44444
  22273. 11111 22222 33333 44444
  22274. Output:
  22275. 11111 ..... 33333 .....
  22276. ..... 22222 ..... 44444
  22277. 11111 ..... 33333 .....
  22278. ..... 22222 ..... 44444
  22279. 11111 ..... 33333 .....
  22280. ..... 22222 ..... 44444
  22281. 11111 ..... 33333 .....
  22282. ..... 22222 ..... 44444
  22283. </pre></div>
  22284. </dd>
  22285. <dt>&lsquo;<samp>interleave_top, 4</samp>&rsquo;</dt>
  22286. <dd><p>Interleave the upper field from odd frames with the lower field from
  22287. even frames, generating a frame with unchanged height at half frame rate.
  22288. </p>
  22289. <div class="example">
  22290. <pre class="example"> ------&gt; time
  22291. Input:
  22292. Frame 1 Frame 2 Frame 3 Frame 4
  22293. 11111&lt;- 22222 33333&lt;- 44444
  22294. 11111 22222&lt;- 33333 44444&lt;-
  22295. 11111&lt;- 22222 33333&lt;- 44444
  22296. 11111 22222&lt;- 33333 44444&lt;-
  22297. Output:
  22298. 11111 33333
  22299. 22222 44444
  22300. 11111 33333
  22301. 22222 44444
  22302. </pre></div>
  22303. </dd>
  22304. <dt>&lsquo;<samp>interleave_bottom, 5</samp>&rsquo;</dt>
  22305. <dd><p>Interleave the lower field from odd frames with the upper field from
  22306. even frames, generating a frame with unchanged height at half frame rate.
  22307. </p>
  22308. <div class="example">
  22309. <pre class="example"> ------&gt; time
  22310. Input:
  22311. Frame 1 Frame 2 Frame 3 Frame 4
  22312. 11111 22222&lt;- 33333 44444&lt;-
  22313. 11111&lt;- 22222 33333&lt;- 44444
  22314. 11111 22222&lt;- 33333 44444&lt;-
  22315. 11111&lt;- 22222 33333&lt;- 44444
  22316. Output:
  22317. 22222 44444
  22318. 11111 33333
  22319. 22222 44444
  22320. 11111 33333
  22321. </pre></div>
  22322. </dd>
  22323. <dt>&lsquo;<samp>interlacex2, 6</samp>&rsquo;</dt>
  22324. <dd><p>Double frame rate with unchanged height. Frames are inserted each
  22325. containing the second temporal field from the previous input frame and
  22326. the first temporal field from the next input frame. This mode relies on
  22327. the top_field_first flag. Useful for interlaced video displays with no
  22328. field synchronisation.
  22329. </p>
  22330. <div class="example">
  22331. <pre class="example"> ------&gt; time
  22332. Input:
  22333. Frame 1 Frame 2 Frame 3 Frame 4
  22334. 11111 22222 33333 44444
  22335. 11111 22222 33333 44444
  22336. 11111 22222 33333 44444
  22337. 11111 22222 33333 44444
  22338. Output:
  22339. 11111 22222 22222 33333 33333 44444 44444
  22340. 11111 11111 22222 22222 33333 33333 44444
  22341. 11111 22222 22222 33333 33333 44444 44444
  22342. 11111 11111 22222 22222 33333 33333 44444
  22343. </pre></div>
  22344. </dd>
  22345. <dt>&lsquo;<samp>mergex2, 7</samp>&rsquo;</dt>
  22346. <dd><p>Move odd frames into the upper field, even into the lower field,
  22347. generating a double height frame at same frame rate.
  22348. </p>
  22349. <div class="example">
  22350. <pre class="example"> ------&gt; time
  22351. Input:
  22352. Frame 1 Frame 2 Frame 3 Frame 4
  22353. 11111 22222 33333 44444
  22354. 11111 22222 33333 44444
  22355. 11111 22222 33333 44444
  22356. 11111 22222 33333 44444
  22357. Output:
  22358. 11111 33333 33333 55555
  22359. 22222 22222 44444 44444
  22360. 11111 33333 33333 55555
  22361. 22222 22222 44444 44444
  22362. 11111 33333 33333 55555
  22363. 22222 22222 44444 44444
  22364. 11111 33333 33333 55555
  22365. 22222 22222 44444 44444
  22366. </pre></div>
  22367. </dd>
  22368. </dl>
  22369. <p>Numeric values are deprecated but are accepted for backward
  22370. compatibility reasons.
  22371. </p>
  22372. <p>Default mode is <code>merge</code>.
  22373. </p>
  22374. </dd>
  22375. <dt><samp>flags</samp></dt>
  22376. <dd><p>Specify flags influencing the filter process.
  22377. </p>
  22378. <p>Available value for <var>flags</var> is:
  22379. </p>
  22380. <dl compact="compact">
  22381. <dt><samp>low_pass_filter, vlpf</samp></dt>
  22382. <dd><p>Enable linear vertical low-pass filtering in the filter.
  22383. Vertical low-pass filtering is required when creating an interlaced
  22384. destination from a progressive source which contains high-frequency
  22385. vertical detail. Filtering will reduce interlace &rsquo;twitter&rsquo; and Moire
  22386. patterning.
  22387. </p>
  22388. </dd>
  22389. <dt><samp>complex_filter, cvlpf</samp></dt>
  22390. <dd><p>Enable complex vertical low-pass filtering.
  22391. This will slightly less reduce interlace &rsquo;twitter&rsquo; and Moire
  22392. patterning but better retain detail and subjective sharpness impression.
  22393. </p>
  22394. </dd>
  22395. <dt><samp>bypass_il</samp></dt>
  22396. <dd><p>Bypass already interlaced frames, only adjust the frame rate.
  22397. </p></dd>
  22398. </dl>
  22399. <p>Vertical low-pass filtering and bypassing already interlaced frames can only be
  22400. enabled for <samp>mode</samp> <var>interleave_top</var> and <var>interleave_bottom</var>.
  22401. </p>
  22402. </dd>
  22403. </dl>
  22404. <a name="tmedian"></a>
  22405. <h3 class="section">11.225 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>
  22406. <p>Pick median pixels from several successive input video frames.
  22407. </p>
  22408. <p>The filter accepts the following options:
  22409. </p>
  22410. <dl compact="compact">
  22411. <dt><samp>radius</samp></dt>
  22412. <dd><p>Set radius of median filter.
  22413. Default is 1. Allowed range is from 1 to 127.
  22414. </p>
  22415. </dd>
  22416. <dt><samp>planes</samp></dt>
  22417. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  22418. </p>
  22419. </dd>
  22420. <dt><samp>percentile</samp></dt>
  22421. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  22422. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  22423. minimum values, and <code>1</code> maximum values.
  22424. </p></dd>
  22425. </dl>
  22426. <a name="Commands-127"></a>
  22427. <h4 class="subsection">11.225.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>
  22428. <p>This filter supports all above options as <a href="#commands">commands</a>, excluding option <code>radius</code>.
  22429. </p>
  22430. <a name="tmidequalizer"></a>
  22431. <h3 class="section">11.226 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>
  22432. <p>Apply Temporal Midway Video Equalization effect.
  22433. </p>
  22434. <p>Midway Video Equalization adjusts a sequence of video frames to have the same
  22435. histograms, while maintaining their dynamics as much as possible. It&rsquo;s
  22436. useful for e.g. matching exposures from a video frames sequence.
  22437. </p>
  22438. <p>This filter accepts the following option:
  22439. </p>
  22440. <dl compact="compact">
  22441. <dt><samp>radius</samp></dt>
  22442. <dd><p>Set filtering radius. Default is <code>5</code>. Allowed range is from 1 to 127.
  22443. </p>
  22444. </dd>
  22445. <dt><samp>sigma</samp></dt>
  22446. <dd><p>Set filtering sigma. Default is <code>0.5</code>. This controls strength of filtering.
  22447. Setting this option to 0 effectively does nothing.
  22448. </p>
  22449. </dd>
  22450. <dt><samp>planes</samp></dt>
  22451. <dd><p>Set which planes to process. Default is <code>15</code>, which is all available planes.
  22452. </p></dd>
  22453. </dl>
  22454. <a name="tmix"></a>
  22455. <h3 class="section">11.227 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>
  22456. <p>Mix successive video frames.
  22457. </p>
  22458. <p>A description of the accepted options follows.
  22459. </p>
  22460. <dl compact="compact">
  22461. <dt><samp>frames</samp></dt>
  22462. <dd><p>The number of successive frames to mix. If unspecified, it defaults to 3.
  22463. </p>
  22464. </dd>
  22465. <dt><samp>weights</samp></dt>
  22466. <dd><p>Specify weight of each input video frame.
  22467. Each weight is separated by space. If number of weights is smaller than
  22468. number of <var>frames</var> last specified weight will be used for all remaining
  22469. unset weights.
  22470. </p>
  22471. </dd>
  22472. <dt><samp>scale</samp></dt>
  22473. <dd><p>Specify scale, if it is set it will be multiplied with sum
  22474. of each weight multiplied with pixel values to give final destination
  22475. pixel value. By default <var>scale</var> is auto scaled to sum of weights.
  22476. </p></dd>
  22477. </dl>
  22478. <a name="Examples-114"></a>
  22479. <h4 class="subsection">11.227.1 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>
  22480. <ul>
  22481. <li> Average 7 successive frames:
  22482. <div class="example">
  22483. <pre class="example">tmix=frames=7:weights=&quot;1 1 1 1 1 1 1&quot;
  22484. </pre></div>
  22485. </li><li> Apply simple temporal convolution:
  22486. <div class="example">
  22487. <pre class="example">tmix=frames=3:weights=&quot;-1 3 -1&quot;
  22488. </pre></div>
  22489. </li><li> Similar as above but only showing temporal differences:
  22490. <div class="example">
  22491. <pre class="example">tmix=frames=3:weights=&quot;-1 2 -1&quot;:scale=1
  22492. </pre></div>
  22493. </li></ul>
  22494. <a name="Commands-128"></a>
  22495. <h4 class="subsection">11.227.2 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>
  22496. <p>This filter supports the following commands:
  22497. </p><dl compact="compact">
  22498. <dt><samp>weights</samp></dt>
  22499. <dt><samp>scale</samp></dt>
  22500. <dd><p>Syntax is same as option with same name.
  22501. </p></dd>
  22502. </dl>
  22503. <span id="tonemap"></span><a name="tonemap-1"></a>
  22504. <h3 class="section">11.228 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>
  22505. <p>Tone map colors from different dynamic ranges.
  22506. </p>
  22507. <p>This filter expects data in single precision floating point, as it needs to
  22508. operate on (and can output) out-of-range values. Another filter, such as
  22509. <a href="#zscale">zscale</a>, is needed to convert the resulting frame to a usable format.
  22510. </p>
  22511. <p>The tonemapping algorithms implemented only work on linear light, so input
  22512. data should be linearized beforehand (and possibly correctly tagged).
  22513. </p>
  22514. <div class="example">
  22515. <pre class="example">ffmpeg -i INPUT -vf zscale=transfer=linear,tonemap=clip,zscale=transfer=bt709,format=yuv420p OUTPUT
  22516. </pre></div>
  22517. <a name="Options-2"></a>
  22518. <h4 class="subsection">11.228.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>
  22519. <p>The filter accepts the following options.
  22520. </p>
  22521. <dl compact="compact">
  22522. <dt><samp>tonemap</samp></dt>
  22523. <dd><p>Set the tone map algorithm to use.
  22524. </p>
  22525. <p>Possible values are:
  22526. </p><dl compact="compact">
  22527. <dt><var>none</var></dt>
  22528. <dd><p>Do not apply any tone map, only desaturate overbright pixels.
  22529. </p>
  22530. </dd>
  22531. <dt><var>clip</var></dt>
  22532. <dd><p>Hard-clip any out-of-range values. Use it for perfect color accuracy for
  22533. in-range values, while distorting out-of-range values.
  22534. </p>
  22535. </dd>
  22536. <dt><var>linear</var></dt>
  22537. <dd><p>Stretch the entire reference gamut to a linear multiple of the display.
  22538. </p>
  22539. </dd>
  22540. <dt><var>gamma</var></dt>
  22541. <dd><p>Fit a logarithmic transfer between the tone curves.
  22542. </p>
  22543. </dd>
  22544. <dt><var>reinhard</var></dt>
  22545. <dd><p>Preserve overall image brightness with a simple curve, using nonlinear
  22546. contrast, which results in flattening details and degrading color accuracy.
  22547. </p>
  22548. </dd>
  22549. <dt><var>hable</var></dt>
  22550. <dd><p>Preserve both dark and bright details better than <var>reinhard</var>, at the cost
  22551. of slightly darkening everything. Use it when detail preservation is more
  22552. important than color and brightness accuracy.
  22553. </p>
  22554. </dd>
  22555. <dt><var>mobius</var></dt>
  22556. <dd><p>Smoothly map out-of-range values, while retaining contrast and colors for
  22557. in-range material as much as possible. Use it when color accuracy is more
  22558. important than detail preservation.
  22559. </p></dd>
  22560. </dl>
  22561. <p>Default is none.
  22562. </p>
  22563. </dd>
  22564. <dt><samp>param</samp></dt>
  22565. <dd><p>Tune the tone mapping algorithm.
  22566. </p>
  22567. <p>This affects the following algorithms:
  22568. </p><dl compact="compact">
  22569. <dt><var>none</var></dt>
  22570. <dd><p>Ignored.
  22571. </p>
  22572. </dd>
  22573. <dt><var>linear</var></dt>
  22574. <dd><p>Specifies the scale factor to use while stretching.
  22575. Default to 1.0.
  22576. </p>
  22577. </dd>
  22578. <dt><var>gamma</var></dt>
  22579. <dd><p>Specifies the exponent of the function.
  22580. Default to 1.8.
  22581. </p>
  22582. </dd>
  22583. <dt><var>clip</var></dt>
  22584. <dd><p>Specify an extra linear coefficient to multiply into the signal before clipping.
  22585. Default to 1.0.
  22586. </p>
  22587. </dd>
  22588. <dt><var>reinhard</var></dt>
  22589. <dd><p>Specify the local contrast coefficient at the display peak.
  22590. Default to 0.5, which means that in-gamut values will be about half as bright
  22591. as when clipping.
  22592. </p>
  22593. </dd>
  22594. <dt><var>hable</var></dt>
  22595. <dd><p>Ignored.
  22596. </p>
  22597. </dd>
  22598. <dt><var>mobius</var></dt>
  22599. <dd><p>Specify the transition point from linear to mobius transform. Every value
  22600. below this point is guaranteed to be mapped 1:1. The higher the value, the
  22601. more accurate the result will be, at the cost of losing bright details.
  22602. Default to 0.3, which due to the steep initial slope still preserves in-range
  22603. colors fairly accurately.
  22604. </p></dd>
  22605. </dl>
  22606. </dd>
  22607. <dt><samp>desat</samp></dt>
  22608. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  22609. higher the parameter, the more color information will be preserved. This
  22610. setting helps prevent unnaturally blown-out colors for super-highlights, by
  22611. (smoothly) turning into white instead. This makes images feel more natural,
  22612. at the cost of reducing information about out-of-range colors.
  22613. </p>
  22614. <p>The default of 2.0 is somewhat conservative and will mostly just apply to
  22615. skies or directly sunlit surfaces. A setting of 0.0 disables this option.
  22616. </p>
  22617. <p>This option works only if the input frame has a supported color tag.
  22618. </p>
  22619. </dd>
  22620. <dt><samp>peak</samp></dt>
  22621. <dd><p>Override signal/nominal/reference peak with this value. Useful when the
  22622. embedded peak information in display metadata is not reliable or when tone
  22623. mapping from a lower range to a higher range.
  22624. </p></dd>
  22625. </dl>
  22626. <a name="tpad"></a>
  22627. <h3 class="section">11.229 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>
  22628. <p>Temporarily pad video frames.
  22629. </p>
  22630. <p>The filter accepts the following options:
  22631. </p>
  22632. <dl compact="compact">
  22633. <dt><samp>start</samp></dt>
  22634. <dd><p>Specify number of delay frames before input video stream. Default is 0.
  22635. </p>
  22636. </dd>
  22637. <dt><samp>stop</samp></dt>
  22638. <dd><p>Specify number of padding frames after input video stream.
  22639. Set to -1 to pad indefinitely. Default is 0.
  22640. </p>
  22641. </dd>
  22642. <dt><samp>start_mode</samp></dt>
  22643. <dd><p>Set kind of frames added to beginning of stream.
  22644. Can be either <var>add</var> or <var>clone</var>.
  22645. With <var>add</var> frames of solid-color are added.
  22646. With <var>clone</var> frames are clones of first frame.
  22647. Default is <var>add</var>.
  22648. </p>
  22649. </dd>
  22650. <dt><samp>stop_mode</samp></dt>
  22651. <dd><p>Set kind of frames added to end of stream.
  22652. Can be either <var>add</var> or <var>clone</var>.
  22653. With <var>add</var> frames of solid-color are added.
  22654. With <var>clone</var> frames are clones of last frame.
  22655. Default is <var>add</var>.
  22656. </p>
  22657. </dd>
  22658. <dt><samp>start_duration, stop_duration</samp></dt>
  22659. <dd><p>Specify the duration of the start/stop delay. See
  22660. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22661. for the accepted syntax.
  22662. These options override <var>start</var> and <var>stop</var>. Default is 0.
  22663. </p>
  22664. </dd>
  22665. <dt><samp>color</samp></dt>
  22666. <dd><p>Specify the color of the padded area. For the syntax of this option,
  22667. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  22668. manual</a>.
  22669. </p>
  22670. <p>The default value of <var>color</var> is &quot;black&quot;.
  22671. </p></dd>
  22672. </dl>
  22673. <span id="transpose"></span><a name="transpose-1"></a>
  22674. <h3 class="section">11.230 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>
  22675. <p>Transpose rows with columns in the input video and optionally flip it.
  22676. </p>
  22677. <p>It accepts the following parameters:
  22678. </p>
  22679. <dl compact="compact">
  22680. <dt><samp>dir</samp></dt>
  22681. <dd><p>Specify the transposition direction.
  22682. </p>
  22683. <p>Can assume the following values:
  22684. </p><dl compact="compact">
  22685. <dt>&lsquo;<samp>0, 4, cclock_flip</samp>&rsquo;</dt>
  22686. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
  22687. </p><div class="example">
  22688. <pre class="example">L.R L.l
  22689. . . -&gt; . .
  22690. l.r R.r
  22691. </pre></div>
  22692. </dd>
  22693. <dt>&lsquo;<samp>1, 5, clock</samp>&rsquo;</dt>
  22694. <dd><p>Rotate by 90 degrees clockwise, that is:
  22695. </p><div class="example">
  22696. <pre class="example">L.R l.L
  22697. . . -&gt; . .
  22698. l.r r.R
  22699. </pre></div>
  22700. </dd>
  22701. <dt>&lsquo;<samp>2, 6, cclock</samp>&rsquo;</dt>
  22702. <dd><p>Rotate by 90 degrees counterclockwise, that is:
  22703. </p><div class="example">
  22704. <pre class="example">L.R R.r
  22705. . . -&gt; . .
  22706. l.r L.l
  22707. </pre></div>
  22708. </dd>
  22709. <dt>&lsquo;<samp>3, 7, clock_flip</samp>&rsquo;</dt>
  22710. <dd><p>Rotate by 90 degrees clockwise and vertically flip, that is:
  22711. </p><div class="example">
  22712. <pre class="example">L.R r.R
  22713. . . -&gt; . .
  22714. l.r l.L
  22715. </pre></div>
  22716. </dd>
  22717. </dl>
  22718. <p>For values between 4-7, the transposition is only done if the input
  22719. video geometry is portrait and not landscape. These values are
  22720. deprecated, the <code>passthrough</code> option should be used instead.
  22721. </p>
  22722. <p>Numerical values are deprecated, and should be dropped in favor of
  22723. symbolic constants.
  22724. </p>
  22725. </dd>
  22726. <dt><samp>passthrough</samp></dt>
  22727. <dd><p>Do not apply the transposition if the input geometry matches the one
  22728. specified by the specified value. It accepts the following values:
  22729. </p><dl compact="compact">
  22730. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22731. <dd><p>Always apply transposition.
  22732. </p></dd>
  22733. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  22734. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  22735. </p></dd>
  22736. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  22737. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  22738. </p></dd>
  22739. </dl>
  22740. <p>Default value is <code>none</code>.
  22741. </p></dd>
  22742. </dl>
  22743. <p>For example to rotate by 90 degrees clockwise and preserve portrait
  22744. layout:
  22745. </p><div class="example">
  22746. <pre class="example">transpose=dir=1:passthrough=portrait
  22747. </pre></div>
  22748. <p>The command above can also be specified as:
  22749. </p><div class="example">
  22750. <pre class="example">transpose=1:portrait
  22751. </pre></div>
  22752. <a name="transpose_005fnpp"></a>
  22753. <h3 class="section">11.231 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></h3>
  22754. <p>Transpose rows with columns in the input video and optionally flip it.
  22755. For more in depth examples see the <a href="#transpose">transpose</a> video filter, which shares mostly the same options.
  22756. </p>
  22757. <p>It accepts the following parameters:
  22758. </p>
  22759. <dl compact="compact">
  22760. <dt><samp>dir</samp></dt>
  22761. <dd><p>Specify the transposition direction.
  22762. </p>
  22763. <p>Can assume the following values:
  22764. </p><dl compact="compact">
  22765. <dt>&lsquo;<samp>cclock_flip</samp>&rsquo;</dt>
  22766. <dd><p>Rotate by 90 degrees counterclockwise and vertically flip. (default)
  22767. </p>
  22768. </dd>
  22769. <dt>&lsquo;<samp>clock</samp>&rsquo;</dt>
  22770. <dd><p>Rotate by 90 degrees clockwise.
  22771. </p>
  22772. </dd>
  22773. <dt>&lsquo;<samp>cclock</samp>&rsquo;</dt>
  22774. <dd><p>Rotate by 90 degrees counterclockwise.
  22775. </p>
  22776. </dd>
  22777. <dt>&lsquo;<samp>clock_flip</samp>&rsquo;</dt>
  22778. <dd><p>Rotate by 90 degrees clockwise and vertically flip.
  22779. </p></dd>
  22780. </dl>
  22781. </dd>
  22782. <dt><samp>passthrough</samp></dt>
  22783. <dd><p>Do not apply the transposition if the input geometry matches the one
  22784. specified by the specified value. It accepts the following values:
  22785. </p><dl compact="compact">
  22786. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  22787. <dd><p>Always apply transposition. (default)
  22788. </p></dd>
  22789. <dt>&lsquo;<samp>portrait</samp>&rsquo;</dt>
  22790. <dd><p>Preserve portrait geometry (when <var>height</var> &gt;= <var>width</var>).
  22791. </p></dd>
  22792. <dt>&lsquo;<samp>landscape</samp>&rsquo;</dt>
  22793. <dd><p>Preserve landscape geometry (when <var>width</var> &gt;= <var>height</var>).
  22794. </p></dd>
  22795. </dl>
  22796. </dd>
  22797. </dl>
  22798. <a name="trim"></a>
  22799. <h3 class="section">11.232 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>
  22800. <p>Trim the input so that the output contains one continuous subpart of the input.
  22801. </p>
  22802. <p>It accepts the following parameters:
  22803. </p><dl compact="compact">
  22804. <dt><samp>start</samp></dt>
  22805. <dd><p>Specify the time of the start of the kept section, i.e. the frame with the
  22806. timestamp <var>start</var> will be the first frame in the output.
  22807. </p>
  22808. </dd>
  22809. <dt><samp>end</samp></dt>
  22810. <dd><p>Specify the time of the first frame that will be dropped, i.e. the frame
  22811. immediately preceding the one with the timestamp <var>end</var> will be the last
  22812. frame in the output.
  22813. </p>
  22814. </dd>
  22815. <dt><samp>start_pts</samp></dt>
  22816. <dd><p>This is the same as <var>start</var>, except this option sets the start timestamp
  22817. in timebase units instead of seconds.
  22818. </p>
  22819. </dd>
  22820. <dt><samp>end_pts</samp></dt>
  22821. <dd><p>This is the same as <var>end</var>, except this option sets the end timestamp
  22822. in timebase units instead of seconds.
  22823. </p>
  22824. </dd>
  22825. <dt><samp>duration</samp></dt>
  22826. <dd><p>The maximum duration of the output in seconds.
  22827. </p>
  22828. </dd>
  22829. <dt><samp>start_frame</samp></dt>
  22830. <dd><p>The number of the first frame that should be passed to the output.
  22831. </p>
  22832. </dd>
  22833. <dt><samp>end_frame</samp></dt>
  22834. <dd><p>The number of the first frame that should be dropped.
  22835. </p></dd>
  22836. </dl>
  22837. <p><samp>start</samp>, <samp>end</samp>, and <samp>duration</samp> are expressed as time
  22838. duration specifications; see
  22839. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  22840. for the accepted syntax.
  22841. </p>
  22842. <p>Note that the first two sets of the start/end options and the <samp>duration</samp>
  22843. option look at the frame timestamp, while the _frame variants simply count the
  22844. frames that pass through the filter. Also note that this filter does not modify
  22845. the timestamps. If you wish for the output timestamps to start at zero, insert a
  22846. setpts filter after the trim filter.
  22847. </p>
  22848. <p>If multiple start or end options are set, this filter tries to be greedy and
  22849. keep all the frames that match at least one of the specified constraints. To keep
  22850. only the part that matches all the constraints at once, chain multiple trim
  22851. filters.
  22852. </p>
  22853. <p>The defaults are such that all the input is kept. So it is possible to set e.g.
  22854. just the end values to keep everything before the specified time.
  22855. </p>
  22856. <p>Examples:
  22857. </p><ul>
  22858. <li> Drop everything except the second minute of input:
  22859. <div class="example">
  22860. <pre class="example">ffmpeg -i INPUT -vf trim=60:120
  22861. </pre></div>
  22862. </li><li> Keep only the first second:
  22863. <div class="example">
  22864. <pre class="example">ffmpeg -i INPUT -vf trim=duration=1
  22865. </pre></div>
  22866. </li></ul>
  22867. <a name="unpremultiply"></a>
  22868. <h3 class="section">11.233 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>
  22869. <p>Apply alpha unpremultiply effect to input video stream using first plane
  22870. of second stream as alpha.
  22871. </p>
  22872. <p>Both streams must have same dimensions and same pixel format.
  22873. </p>
  22874. <p>The filter accepts the following option:
  22875. </p>
  22876. <dl compact="compact">
  22877. <dt><samp>planes</samp></dt>
  22878. <dd><p>Set which planes will be processed, unprocessed planes will be copied.
  22879. By default value 0xf, all planes will be processed.
  22880. </p>
  22881. <p>If the format has 1 or 2 components, then luma is bit 0.
  22882. If the format has 3 or 4 components:
  22883. for RGB formats bit 0 is green, bit 1 is blue and bit 2 is red;
  22884. for YUV formats bit 0 is luma, bit 1 is chroma-U and bit 2 is chroma-V.
  22885. If present, the alpha channel is always the last bit.
  22886. </p>
  22887. </dd>
  22888. <dt><samp>inplace</samp></dt>
  22889. <dd><p>Do not require 2nd input for processing, instead use alpha plane from input stream.
  22890. </p></dd>
  22891. </dl>
  22892. <span id="unsharp"></span><a name="unsharp-1"></a>
  22893. <h3 class="section">11.234 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>
  22894. <p>Sharpen or blur the input video.
  22895. </p>
  22896. <p>It accepts the following parameters:
  22897. </p>
  22898. <dl compact="compact">
  22899. <dt><samp>luma_msize_x, lx</samp></dt>
  22900. <dd><p>Set the luma matrix horizontal size. It must be an odd integer between
  22901. 3 and 23. The default value is 5.
  22902. </p>
  22903. </dd>
  22904. <dt><samp>luma_msize_y, ly</samp></dt>
  22905. <dd><p>Set the luma matrix vertical size. It must be an odd integer between 3
  22906. and 23. The default value is 5.
  22907. </p>
  22908. </dd>
  22909. <dt><samp>luma_amount, la</samp></dt>
  22910. <dd><p>Set the luma effect strength. It must be a floating point number, reasonable
  22911. values lay between -1.5 and 1.5.
  22912. </p>
  22913. <p>Negative values will blur the input video, while positive values will
  22914. sharpen it, a value of zero will disable the effect.
  22915. </p>
  22916. <p>Default value is 1.0.
  22917. </p>
  22918. </dd>
  22919. <dt><samp>chroma_msize_x, cx</samp></dt>
  22920. <dd><p>Set the chroma matrix horizontal size. It must be an odd integer
  22921. between 3 and 23. The default value is 5.
  22922. </p>
  22923. </dd>
  22924. <dt><samp>chroma_msize_y, cy</samp></dt>
  22925. <dd><p>Set the chroma matrix vertical size. It must be an odd integer
  22926. between 3 and 23. The default value is 5.
  22927. </p>
  22928. </dd>
  22929. <dt><samp>chroma_amount, ca</samp></dt>
  22930. <dd><p>Set the chroma effect strength. It must be a floating point number, reasonable
  22931. values lay between -1.5 and 1.5.
  22932. </p>
  22933. <p>Negative values will blur the input video, while positive values will
  22934. sharpen it, a value of zero will disable the effect.
  22935. </p>
  22936. <p>Default value is 0.0.
  22937. </p>
  22938. </dd>
  22939. </dl>
  22940. <p>All parameters are optional and default to the equivalent of the
  22941. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  22942. </p>
  22943. <a name="Examples-115"></a>
  22944. <h4 class="subsection">11.234.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>
  22945. <ul>
  22946. <li> Apply strong luma sharpen effect:
  22947. <div class="example">
  22948. <pre class="example">unsharp=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5
  22949. </pre></div>
  22950. </li><li> Apply a strong blur of both luma and chroma parameters:
  22951. <div class="example">
  22952. <pre class="example">unsharp=7:7:-2:7:7:-2
  22953. </pre></div>
  22954. </li></ul>
  22955. <span id="untile"></span><a name="untile-1"></a>
  22956. <h3 class="section">11.235 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>
  22957. <p>Decompose a video made of tiled images into the individual images.
  22958. </p>
  22959. <p>The frame rate of the output video is the frame rate of the input video
  22960. multiplied by the number of tiles.
  22961. </p>
  22962. <p>This filter does the reverse of <a href="#tile">tile</a>.
  22963. </p>
  22964. <p>The filter accepts the following options:
  22965. </p>
  22966. <dl compact="compact">
  22967. <dt><samp>layout</samp></dt>
  22968. <dd><p>Set the grid size (i.e. the number of lines and columns). For the syntax of
  22969. this option, check the
  22970. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  22971. </p></dd>
  22972. </dl>
  22973. <a name="Examples-116"></a>
  22974. <h4 class="subsection">11.235.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>
  22975. <ul>
  22976. <li> Produce a 1-second video from a still image file made of 25 frames stacked
  22977. vertically, like an analogic film reel:
  22978. <div class="example">
  22979. <pre class="example">ffmpeg -r 1 -i image.jpg -vf untile=1x25 movie.mkv
  22980. </pre></div>
  22981. </li></ul>
  22982. <a name="uspp"></a>
  22983. <h3 class="section">11.236 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>
  22984. <p>Apply ultra slow/simple postprocessing filter that compresses and decompresses
  22985. the image at several (or - in the case of <samp>quality</samp> level <code>8</code> - all)
  22986. shifts and average the results.
  22987. </p>
  22988. <p>The way this differs from the behavior of spp is that uspp actually encodes &amp;
  22989. decodes each case with libavcodec Snow, whereas spp uses a simplified intra only 8x8
  22990. DCT similar to MJPEG.
  22991. </p>
  22992. <p>The filter accepts the following options:
  22993. </p>
  22994. <dl compact="compact">
  22995. <dt><samp>quality</samp></dt>
  22996. <dd><p>Set quality. This option defines the number of levels for averaging. It accepts
  22997. an integer in the range 0-8. If set to <code>0</code>, the filter will have no
  22998. effect. A value of <code>8</code> means the higher quality. For each increment of
  22999. that value the speed drops by a factor of approximately 2. Default value is
  23000. <code>3</code>.
  23001. </p>
  23002. </dd>
  23003. <dt><samp>qp</samp></dt>
  23004. <dd><p>Force a constant quantization parameter. If not set, the filter will use the QP
  23005. from the video stream (if available).
  23006. </p></dd>
  23007. </dl>
  23008. <a name="v360"></a>
  23009. <h3 class="section">11.237 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>
  23010. <p>Convert 360 videos between various formats.
  23011. </p>
  23012. <p>The filter accepts the following options:
  23013. </p>
  23014. <dl compact="compact">
  23015. <dt><samp>input</samp></dt>
  23016. <dt><samp>output</samp></dt>
  23017. <dd><p>Set format of the input/output video.
  23018. </p>
  23019. <p>Available formats:
  23020. </p>
  23021. <dl compact="compact">
  23022. <dt>&lsquo;<samp>e</samp>&rsquo;</dt>
  23023. <dt>&lsquo;<samp>equirect</samp>&rsquo;</dt>
  23024. <dd><p>Equirectangular projection.
  23025. </p>
  23026. </dd>
  23027. <dt>&lsquo;<samp>c3x2</samp>&rsquo;</dt>
  23028. <dt>&lsquo;<samp>c6x1</samp>&rsquo;</dt>
  23029. <dt>&lsquo;<samp>c1x6</samp>&rsquo;</dt>
  23030. <dd><p>Cubemap with 3x2/6x1/1x6 layout.
  23031. </p>
  23032. <p>Format specific options:
  23033. </p>
  23034. <dl compact="compact">
  23035. <dt><samp>in_pad</samp></dt>
  23036. <dt><samp>out_pad</samp></dt>
  23037. <dd><p>Set padding proportion for the input/output cubemap. Values in decimals.
  23038. </p>
  23039. <p>Example values:
  23040. </p><dl compact="compact">
  23041. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  23042. <dd><p>No padding.
  23043. </p></dd>
  23044. <dt>&lsquo;<samp>0.01</samp>&rsquo;</dt>
  23045. <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)
  23046. </p></dd>
  23047. </dl>
  23048. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>.
  23049. Maximum value is <b>&lsquo;<samp>0.1</samp>&rsquo;</b>.
  23050. </p>
  23051. </dd>
  23052. <dt><samp>fin_pad</samp></dt>
  23053. <dt><samp>fout_pad</samp></dt>
  23054. <dd><p>Set fixed padding for the input/output cubemap. Values in pixels.
  23055. </p>
  23056. <p>Default value is <b>&lsquo;<samp>0</samp>&rsquo;</b>. If greater than zero it overrides other padding options.
  23057. </p>
  23058. </dd>
  23059. <dt><samp>in_forder</samp></dt>
  23060. <dt><samp>out_forder</samp></dt>
  23061. <dd><p>Set order of faces for the input/output cubemap. Choose one direction for each position.
  23062. </p>
  23063. <p>Designation of directions:
  23064. </p><dl compact="compact">
  23065. <dt>&lsquo;<samp>r</samp>&rsquo;</dt>
  23066. <dd><p>right
  23067. </p></dd>
  23068. <dt>&lsquo;<samp>l</samp>&rsquo;</dt>
  23069. <dd><p>left
  23070. </p></dd>
  23071. <dt>&lsquo;<samp>u</samp>&rsquo;</dt>
  23072. <dd><p>up
  23073. </p></dd>
  23074. <dt>&lsquo;<samp>d</samp>&rsquo;</dt>
  23075. <dd><p>down
  23076. </p></dd>
  23077. <dt>&lsquo;<samp>f</samp>&rsquo;</dt>
  23078. <dd><p>forward
  23079. </p></dd>
  23080. <dt>&lsquo;<samp>b</samp>&rsquo;</dt>
  23081. <dd><p>back
  23082. </p></dd>
  23083. </dl>
  23084. <p>Default value is <b>&lsquo;<samp>rludfb</samp>&rsquo;</b>.
  23085. </p>
  23086. </dd>
  23087. <dt><samp>in_frot</samp></dt>
  23088. <dt><samp>out_frot</samp></dt>
  23089. <dd><p>Set rotation of faces for the input/output cubemap. Choose one angle for each position.
  23090. </p>
  23091. <p>Designation of angles:
  23092. </p><dl compact="compact">
  23093. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  23094. <dd><p>0 degrees clockwise
  23095. </p></dd>
  23096. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  23097. <dd><p>90 degrees clockwise
  23098. </p></dd>
  23099. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  23100. <dd><p>180 degrees clockwise
  23101. </p></dd>
  23102. <dt>&lsquo;<samp>3</samp>&rsquo;</dt>
  23103. <dd><p>270 degrees clockwise
  23104. </p></dd>
  23105. </dl>
  23106. <p>Default value is <b>&lsquo;<samp>000000</samp>&rsquo;</b>.
  23107. </p></dd>
  23108. </dl>
  23109. </dd>
  23110. <dt>&lsquo;<samp>eac</samp>&rsquo;</dt>
  23111. <dd><p>Equi-Angular Cubemap.
  23112. </p>
  23113. </dd>
  23114. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  23115. <dt>&lsquo;<samp>gnomonic</samp>&rsquo;</dt>
  23116. <dt>&lsquo;<samp>rectilinear</samp>&rsquo;</dt>
  23117. <dd><p>Regular video.
  23118. </p>
  23119. <p>Format specific options:
  23120. </p><dl compact="compact">
  23121. <dt><samp>h_fov</samp></dt>
  23122. <dt><samp>v_fov</samp></dt>
  23123. <dt><samp>d_fov</samp></dt>
  23124. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23125. </p>
  23126. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23127. </p>
  23128. </dd>
  23129. <dt><samp>ih_fov</samp></dt>
  23130. <dt><samp>iv_fov</samp></dt>
  23131. <dt><samp>id_fov</samp></dt>
  23132. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23133. </p>
  23134. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23135. </p></dd>
  23136. </dl>
  23137. </dd>
  23138. <dt>&lsquo;<samp>dfisheye</samp>&rsquo;</dt>
  23139. <dd><p>Dual fisheye.
  23140. </p>
  23141. <p>Format specific options:
  23142. </p><dl compact="compact">
  23143. <dt><samp>h_fov</samp></dt>
  23144. <dt><samp>v_fov</samp></dt>
  23145. <dt><samp>d_fov</samp></dt>
  23146. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23147. </p>
  23148. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23149. </p>
  23150. </dd>
  23151. <dt><samp>ih_fov</samp></dt>
  23152. <dt><samp>iv_fov</samp></dt>
  23153. <dt><samp>id_fov</samp></dt>
  23154. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23155. </p>
  23156. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23157. </p></dd>
  23158. </dl>
  23159. </dd>
  23160. <dt>&lsquo;<samp>barrel</samp>&rsquo;</dt>
  23161. <dt>&lsquo;<samp>fb</samp>&rsquo;</dt>
  23162. <dt>&lsquo;<samp>barrelsplit</samp>&rsquo;</dt>
  23163. <dd><p>Facebook&rsquo;s 360 formats.
  23164. </p>
  23165. </dd>
  23166. <dt>&lsquo;<samp>sg</samp>&rsquo;</dt>
  23167. <dd><p>Stereographic format.
  23168. </p>
  23169. <p>Format specific options:
  23170. </p><dl compact="compact">
  23171. <dt><samp>h_fov</samp></dt>
  23172. <dt><samp>v_fov</samp></dt>
  23173. <dt><samp>d_fov</samp></dt>
  23174. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23175. </p>
  23176. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23177. </p>
  23178. </dd>
  23179. <dt><samp>ih_fov</samp></dt>
  23180. <dt><samp>iv_fov</samp></dt>
  23181. <dt><samp>id_fov</samp></dt>
  23182. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23183. </p>
  23184. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23185. </p></dd>
  23186. </dl>
  23187. </dd>
  23188. <dt>&lsquo;<samp>mercator</samp>&rsquo;</dt>
  23189. <dd><p>Mercator format.
  23190. </p>
  23191. </dd>
  23192. <dt>&lsquo;<samp>ball</samp>&rsquo;</dt>
  23193. <dd><p>Ball format, gives significant distortion toward the back.
  23194. </p>
  23195. </dd>
  23196. <dt>&lsquo;<samp>hammer</samp>&rsquo;</dt>
  23197. <dd><p>Hammer-Aitoff map projection format.
  23198. </p>
  23199. </dd>
  23200. <dt>&lsquo;<samp>sinusoidal</samp>&rsquo;</dt>
  23201. <dd><p>Sinusoidal map projection format.
  23202. </p>
  23203. </dd>
  23204. <dt>&lsquo;<samp>fisheye</samp>&rsquo;</dt>
  23205. <dd><p>Fisheye projection.
  23206. </p>
  23207. <p>Format specific options:
  23208. </p><dl compact="compact">
  23209. <dt><samp>h_fov</samp></dt>
  23210. <dt><samp>v_fov</samp></dt>
  23211. <dt><samp>d_fov</samp></dt>
  23212. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23213. </p>
  23214. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23215. </p>
  23216. </dd>
  23217. <dt><samp>ih_fov</samp></dt>
  23218. <dt><samp>iv_fov</samp></dt>
  23219. <dt><samp>id_fov</samp></dt>
  23220. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23221. </p>
  23222. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23223. </p></dd>
  23224. </dl>
  23225. </dd>
  23226. <dt>&lsquo;<samp>pannini</samp>&rsquo;</dt>
  23227. <dd><p>Pannini projection.
  23228. </p>
  23229. <p>Format specific options:
  23230. </p><dl compact="compact">
  23231. <dt><samp>h_fov</samp></dt>
  23232. <dd><p>Set output pannini parameter.
  23233. </p>
  23234. </dd>
  23235. <dt><samp>ih_fov</samp></dt>
  23236. <dd><p>Set input pannini parameter.
  23237. </p></dd>
  23238. </dl>
  23239. </dd>
  23240. <dt>&lsquo;<samp>cylindrical</samp>&rsquo;</dt>
  23241. <dd><p>Cylindrical projection.
  23242. </p>
  23243. <p>Format specific options:
  23244. </p><dl compact="compact">
  23245. <dt><samp>h_fov</samp></dt>
  23246. <dt><samp>v_fov</samp></dt>
  23247. <dt><samp>d_fov</samp></dt>
  23248. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23249. </p>
  23250. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23251. </p>
  23252. </dd>
  23253. <dt><samp>ih_fov</samp></dt>
  23254. <dt><samp>iv_fov</samp></dt>
  23255. <dt><samp>id_fov</samp></dt>
  23256. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23257. </p>
  23258. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23259. </p></dd>
  23260. </dl>
  23261. </dd>
  23262. <dt>&lsquo;<samp>perspective</samp>&rsquo;</dt>
  23263. <dd><p>Perspective projection. <i>(output only)</i>
  23264. </p>
  23265. <p>Format specific options:
  23266. </p><dl compact="compact">
  23267. <dt><samp>v_fov</samp></dt>
  23268. <dd><p>Set perspective parameter.
  23269. </p></dd>
  23270. </dl>
  23271. </dd>
  23272. <dt>&lsquo;<samp>tetrahedron</samp>&rsquo;</dt>
  23273. <dd><p>Tetrahedron projection.
  23274. </p>
  23275. </dd>
  23276. <dt>&lsquo;<samp>tsp</samp>&rsquo;</dt>
  23277. <dd><p>Truncated square pyramid projection.
  23278. </p>
  23279. </dd>
  23280. <dt>&lsquo;<samp>he</samp>&rsquo;</dt>
  23281. <dt>&lsquo;<samp>hequirect</samp>&rsquo;</dt>
  23282. <dd><p>Half equirectangular projection.
  23283. </p>
  23284. </dd>
  23285. <dt>&lsquo;<samp>equisolid</samp>&rsquo;</dt>
  23286. <dd><p>Equisolid format.
  23287. </p>
  23288. <p>Format specific options:
  23289. </p><dl compact="compact">
  23290. <dt><samp>h_fov</samp></dt>
  23291. <dt><samp>v_fov</samp></dt>
  23292. <dt><samp>d_fov</samp></dt>
  23293. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23294. </p>
  23295. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23296. </p>
  23297. </dd>
  23298. <dt><samp>ih_fov</samp></dt>
  23299. <dt><samp>iv_fov</samp></dt>
  23300. <dt><samp>id_fov</samp></dt>
  23301. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23302. </p>
  23303. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23304. </p></dd>
  23305. </dl>
  23306. </dd>
  23307. <dt>&lsquo;<samp>og</samp>&rsquo;</dt>
  23308. <dd><p>Orthographic format.
  23309. </p>
  23310. <p>Format specific options:
  23311. </p><dl compact="compact">
  23312. <dt><samp>h_fov</samp></dt>
  23313. <dt><samp>v_fov</samp></dt>
  23314. <dt><samp>d_fov</samp></dt>
  23315. <dd><p>Set output horizontal/vertical/diagonal field of view. Values in degrees.
  23316. </p>
  23317. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23318. </p>
  23319. </dd>
  23320. <dt><samp>ih_fov</samp></dt>
  23321. <dt><samp>iv_fov</samp></dt>
  23322. <dt><samp>id_fov</samp></dt>
  23323. <dd><p>Set input horizontal/vertical/diagonal field of view. Values in degrees.
  23324. </p>
  23325. <p>If diagonal field of view is set it overrides horizontal and vertical field of view.
  23326. </p></dd>
  23327. </dl>
  23328. </dd>
  23329. <dt>&lsquo;<samp>octahedron</samp>&rsquo;</dt>
  23330. <dd><p>Octahedron projection.
  23331. </p></dd>
  23332. </dl>
  23333. </dd>
  23334. <dt><samp>interp</samp></dt>
  23335. <dd><p>Set interpolation method.<br>
  23336. <i>Note: more complex interpolation methods require much more memory to run.</i>
  23337. </p>
  23338. <p>Available methods:
  23339. </p>
  23340. <dl compact="compact">
  23341. <dt>&lsquo;<samp>near</samp>&rsquo;</dt>
  23342. <dt>&lsquo;<samp>nearest</samp>&rsquo;</dt>
  23343. <dd><p>Nearest neighbour.
  23344. </p></dd>
  23345. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  23346. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  23347. <dd><p>Bilinear interpolation.
  23348. </p></dd>
  23349. <dt>&lsquo;<samp>lagrange9</samp>&rsquo;</dt>
  23350. <dd><p>Lagrange9 interpolation.
  23351. </p></dd>
  23352. <dt>&lsquo;<samp>cube</samp>&rsquo;</dt>
  23353. <dt>&lsquo;<samp>cubic</samp>&rsquo;</dt>
  23354. <dd><p>Bicubic interpolation.
  23355. </p></dd>
  23356. <dt>&lsquo;<samp>lanc</samp>&rsquo;</dt>
  23357. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  23358. <dd><p>Lanczos interpolation.
  23359. </p></dd>
  23360. <dt>&lsquo;<samp>sp16</samp>&rsquo;</dt>
  23361. <dt>&lsquo;<samp>spline16</samp>&rsquo;</dt>
  23362. <dd><p>Spline16 interpolation.
  23363. </p></dd>
  23364. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  23365. <dt>&lsquo;<samp>gaussian</samp>&rsquo;</dt>
  23366. <dd><p>Gaussian interpolation.
  23367. </p></dd>
  23368. <dt>&lsquo;<samp>mitchell</samp>&rsquo;</dt>
  23369. <dd><p>Mitchell interpolation.
  23370. </p></dd>
  23371. </dl>
  23372. <p>Default value is <b>&lsquo;<samp>line</samp>&rsquo;</b>.
  23373. </p>
  23374. </dd>
  23375. <dt><samp>w</samp></dt>
  23376. <dt><samp>h</samp></dt>
  23377. <dd><p>Set the output video resolution.
  23378. </p>
  23379. <p>Default resolution depends on formats.
  23380. </p>
  23381. </dd>
  23382. <dt><samp>in_stereo</samp></dt>
  23383. <dt><samp>out_stereo</samp></dt>
  23384. <dd><p>Set the input/output stereo format.
  23385. </p>
  23386. <dl compact="compact">
  23387. <dt>&lsquo;<samp>2d</samp>&rsquo;</dt>
  23388. <dd><p>2D mono
  23389. </p></dd>
  23390. <dt>&lsquo;<samp>sbs</samp>&rsquo;</dt>
  23391. <dd><p>Side by side
  23392. </p></dd>
  23393. <dt>&lsquo;<samp>tb</samp>&rsquo;</dt>
  23394. <dd><p>Top bottom
  23395. </p></dd>
  23396. </dl>
  23397. <p>Default value is <b>&lsquo;<samp>2d</samp>&rsquo;</b> for input and output format.
  23398. </p>
  23399. </dd>
  23400. <dt><samp>yaw</samp></dt>
  23401. <dt><samp>pitch</samp></dt>
  23402. <dt><samp>roll</samp></dt>
  23403. <dd><p>Set rotation for the output video. Values in degrees.
  23404. </p>
  23405. </dd>
  23406. <dt><samp>rorder</samp></dt>
  23407. <dd><p>Set rotation order for the output video. Choose one item for each position.
  23408. </p>
  23409. <dl compact="compact">
  23410. <dt>&lsquo;<samp>y, Y</samp>&rsquo;</dt>
  23411. <dd><p>yaw
  23412. </p></dd>
  23413. <dt>&lsquo;<samp>p, P</samp>&rsquo;</dt>
  23414. <dd><p>pitch
  23415. </p></dd>
  23416. <dt>&lsquo;<samp>r, R</samp>&rsquo;</dt>
  23417. <dd><p>roll
  23418. </p></dd>
  23419. </dl>
  23420. <p>Default value is <b>&lsquo;<samp>ypr</samp>&rsquo;</b>.
  23421. </p>
  23422. </dd>
  23423. <dt><samp>h_flip</samp></dt>
  23424. <dt><samp>v_flip</samp></dt>
  23425. <dt><samp>d_flip</samp></dt>
  23426. <dd><p>Flip the output video horizontally(swaps left-right)/vertically(swaps up-down)/in-depth(swaps back-forward). Boolean values.
  23427. </p>
  23428. </dd>
  23429. <dt><samp>ih_flip</samp></dt>
  23430. <dt><samp>iv_flip</samp></dt>
  23431. <dd><p>Set if input video is flipped horizontally/vertically. Boolean values.
  23432. </p>
  23433. </dd>
  23434. <dt><samp>in_trans</samp></dt>
  23435. <dd><p>Set if input video is transposed. Boolean value, by default disabled.
  23436. </p>
  23437. </dd>
  23438. <dt><samp>out_trans</samp></dt>
  23439. <dd><p>Set if output video needs to be transposed. Boolean value, by default disabled.
  23440. </p>
  23441. </dd>
  23442. <dt><samp>alpha_mask</samp></dt>
  23443. <dd><p>Build mask in alpha plane for all unmapped pixels by marking them fully transparent. Boolean value, by default disabled.
  23444. </p></dd>
  23445. </dl>
  23446. <a name="Examples-117"></a>
  23447. <h4 class="subsection">11.237.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>
  23448. <ul>
  23449. <li> Convert equirectangular video to cubemap with 3x2 layout and 1% padding using bicubic interpolation:
  23450. <div class="example">
  23451. <pre class="example">ffmpeg -i input.mkv -vf v360=e:c3x2:cubic:out_pad=0.01 output.mkv
  23452. </pre></div>
  23453. </li><li> Extract back view of Equi-Angular Cubemap:
  23454. <div class="example">
  23455. <pre class="example">ffmpeg -i input.mkv -vf v360=eac:flat:yaw=180 output.mkv
  23456. </pre></div>
  23457. </li><li> Convert transposed and horizontally flipped Equi-Angular Cubemap in side-by-side stereo format to equirectangular top-bottom stereo format:
  23458. <div class="example">
  23459. <pre class="example">v360=eac:equirect:in_stereo=sbs:in_trans=1:ih_flip=1:out_stereo=tb
  23460. </pre></div>
  23461. </li></ul>
  23462. <a name="Commands-129"></a>
  23463. <h4 class="subsection">11.237.2 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>
  23464. <p>This filter supports subset of above options as <a href="#commands">commands</a>.
  23465. </p>
  23466. <a name="vaguedenoiser"></a>
  23467. <h3 class="section">11.238 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>
  23468. <p>Apply a wavelet based denoiser.
  23469. </p>
  23470. <p>It transforms each frame from the video input into the wavelet domain,
  23471. using Cohen-Daubechies-Feauveau 9/7. Then it applies some filtering to
  23472. the obtained coefficients. It does an inverse wavelet transform after.
  23473. Due to wavelet properties, it should give a nice smoothed result, and
  23474. reduced noise, without blurring picture features.
  23475. </p>
  23476. <p>This filter accepts the following options:
  23477. </p>
  23478. <dl compact="compact">
  23479. <dt><samp>threshold</samp></dt>
  23480. <dd><p>The filtering strength. The higher, the more filtered the video will be.
  23481. Hard thresholding can use a higher threshold than soft thresholding
  23482. before the video looks overfiltered. Default value is 2.
  23483. </p>
  23484. </dd>
  23485. <dt><samp>method</samp></dt>
  23486. <dd><p>The filtering method the filter will use.
  23487. </p>
  23488. <p>It accepts the following values:
  23489. </p><dl compact="compact">
  23490. <dt>&lsquo;<samp>hard</samp>&rsquo;</dt>
  23491. <dd><p>All values under the threshold will be zeroed.
  23492. </p>
  23493. </dd>
  23494. <dt>&lsquo;<samp>soft</samp>&rsquo;</dt>
  23495. <dd><p>All values under the threshold will be zeroed. All values above will be
  23496. reduced by the threshold.
  23497. </p>
  23498. </dd>
  23499. <dt>&lsquo;<samp>garrote</samp>&rsquo;</dt>
  23500. <dd><p>Scales or nullifies coefficients - intermediary between (more) soft and
  23501. (less) hard thresholding.
  23502. </p></dd>
  23503. </dl>
  23504. <p>Default is garrote.
  23505. </p>
  23506. </dd>
  23507. <dt><samp>nsteps</samp></dt>
  23508. <dd><p>Number of times, the wavelet will decompose the picture. Picture can&rsquo;t
  23509. be decomposed beyond a particular point (typically, 8 for a 640x480
  23510. frame - as 2^9 = 512 &gt; 480). Valid values are integers between 1 and 32. Default value is 6.
  23511. </p>
  23512. </dd>
  23513. <dt><samp>percent</samp></dt>
  23514. <dd><p>Partial of full denoising (limited coefficients shrinking), from 0 to 100. Default value is 85.
  23515. </p>
  23516. </dd>
  23517. <dt><samp>planes</samp></dt>
  23518. <dd><p>A list of the planes to process. By default all planes are processed.
  23519. </p>
  23520. </dd>
  23521. <dt><samp>type</samp></dt>
  23522. <dd><p>The threshold type the filter will use.
  23523. </p>
  23524. <p>It accepts the following values:
  23525. </p><dl compact="compact">
  23526. <dt>&lsquo;<samp>universal</samp>&rsquo;</dt>
  23527. <dd><p>Threshold used is same for all decompositions.
  23528. </p>
  23529. </dd>
  23530. <dt>&lsquo;<samp>bayes</samp>&rsquo;</dt>
  23531. <dd><p>Threshold used depends also on each decomposition coefficients.
  23532. </p></dd>
  23533. </dl>
  23534. <p>Default is universal.
  23535. </p></dd>
  23536. </dl>
  23537. <a name="vectorscope"></a>
  23538. <h3 class="section">11.239 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>
  23539. <p>Display 2 color component values in the two dimensional graph (which is called
  23540. a vectorscope).
  23541. </p>
  23542. <p>This filter accepts the following options:
  23543. </p>
  23544. <dl compact="compact">
  23545. <dt><samp>mode, m</samp></dt>
  23546. <dd><p>Set vectorscope mode.
  23547. </p>
  23548. <p>It accepts the following values:
  23549. </p><dl compact="compact">
  23550. <dt>&lsquo;<samp>gray</samp>&rsquo;</dt>
  23551. <dt>&lsquo;<samp>tint</samp>&rsquo;</dt>
  23552. <dd><p>Gray values are displayed on graph, higher brightness means more pixels have
  23553. same component color value on location in graph. This is the default mode.
  23554. </p>
  23555. </dd>
  23556. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  23557. <dd><p>Gray values are displayed on graph. Surrounding pixels values which are not
  23558. present in video frame are drawn in gradient of 2 color components which are
  23559. set by option <code>x</code> and <code>y</code>. The 3rd color component is static.
  23560. </p>
  23561. </dd>
  23562. <dt>&lsquo;<samp>color2</samp>&rsquo;</dt>
  23563. <dd><p>Actual color components values present in video frame are displayed on graph.
  23564. </p>
  23565. </dd>
  23566. <dt>&lsquo;<samp>color3</samp>&rsquo;</dt>
  23567. <dd><p>Similar as color2 but higher frequency of same values <code>x</code> and <code>y</code>
  23568. on graph increases value of another color component, which is luminance by
  23569. default values of <code>x</code> and <code>y</code>.
  23570. </p>
  23571. </dd>
  23572. <dt>&lsquo;<samp>color4</samp>&rsquo;</dt>
  23573. <dd><p>Actual colors present in video frame are displayed on graph. If two different
  23574. colors map to same position on graph then color with higher value of component
  23575. not present in graph is picked.
  23576. </p>
  23577. </dd>
  23578. <dt>&lsquo;<samp>color5</samp>&rsquo;</dt>
  23579. <dd><p>Gray values are displayed on graph. Similar to <code>color</code> but with 3rd color
  23580. component picked from radial gradient.
  23581. </p></dd>
  23582. </dl>
  23583. </dd>
  23584. <dt><samp>x</samp></dt>
  23585. <dd><p>Set which color component will be represented on X-axis. Default is <code>1</code>.
  23586. </p>
  23587. </dd>
  23588. <dt><samp>y</samp></dt>
  23589. <dd><p>Set which color component will be represented on Y-axis. Default is <code>2</code>.
  23590. </p>
  23591. </dd>
  23592. <dt><samp>intensity, i</samp></dt>
  23593. <dd><p>Set intensity, used by modes: gray, color, color3 and color5 for increasing brightness
  23594. of color component which represents frequency of (X, Y) location in graph.
  23595. </p>
  23596. </dd>
  23597. <dt><samp>envelope, e</samp></dt>
  23598. <dd><dl compact="compact">
  23599. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  23600. <dd><p>No envelope, this is default.
  23601. </p>
  23602. </dd>
  23603. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  23604. <dd><p>Instant envelope, even darkest single pixel will be clearly highlighted.
  23605. </p>
  23606. </dd>
  23607. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  23608. <dd><p>Hold maximum and minimum values presented in graph over time. This way you
  23609. can still spot out of range values without constantly looking at vectorscope.
  23610. </p>
  23611. </dd>
  23612. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  23613. <dd><p>Peak and instant envelope combined together.
  23614. </p></dd>
  23615. </dl>
  23616. </dd>
  23617. <dt><samp>graticule, g</samp></dt>
  23618. <dd><p>Set what kind of graticule to draw.
  23619. </p><dl compact="compact">
  23620. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  23621. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  23622. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  23623. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  23624. </dl>
  23625. </dd>
  23626. <dt><samp>opacity, o</samp></dt>
  23627. <dd><p>Set graticule opacity.
  23628. </p>
  23629. </dd>
  23630. <dt><samp>flags, f</samp></dt>
  23631. <dd><p>Set graticule flags.
  23632. </p>
  23633. <dl compact="compact">
  23634. <dt>&lsquo;<samp>white</samp>&rsquo;</dt>
  23635. <dd><p>Draw graticule for white point.
  23636. </p>
  23637. </dd>
  23638. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  23639. <dd><p>Draw graticule for black point.
  23640. </p>
  23641. </dd>
  23642. <dt>&lsquo;<samp>name</samp>&rsquo;</dt>
  23643. <dd><p>Draw color points short names.
  23644. </p></dd>
  23645. </dl>
  23646. </dd>
  23647. <dt><samp>bgopacity, b</samp></dt>
  23648. <dd><p>Set background opacity.
  23649. </p>
  23650. </dd>
  23651. <dt><samp>lthreshold, l</samp></dt>
  23652. <dd><p>Set low threshold for color component not represented on X or Y axis.
  23653. Values lower than this value will be ignored. Default is 0.
  23654. Note this value is multiplied with actual max possible value one pixel component
  23655. can have. So for 8-bit input and low threshold value of 0.1 actual threshold
  23656. is 0.1 * 255 = 25.
  23657. </p>
  23658. </dd>
  23659. <dt><samp>hthreshold, h</samp></dt>
  23660. <dd><p>Set high threshold for color component not represented on X or Y axis.
  23661. Values higher than this value will be ignored. Default is 1.
  23662. Note this value is multiplied with actual max possible value one pixel component
  23663. can have. So for 8-bit input and high threshold value of 0.9 actual threshold
  23664. is 0.9 * 255 = 230.
  23665. </p>
  23666. </dd>
  23667. <dt><samp>colorspace, c</samp></dt>
  23668. <dd><p>Set what kind of colorspace to use when drawing graticule.
  23669. </p><dl compact="compact">
  23670. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  23671. <dt>&lsquo;<samp>601</samp>&rsquo;</dt>
  23672. <dt>&lsquo;<samp>709</samp>&rsquo;</dt>
  23673. </dl>
  23674. <p>Default is auto.
  23675. </p>
  23676. </dd>
  23677. <dt><samp>tint0, t0</samp></dt>
  23678. <dt><samp>tint1, t1</samp></dt>
  23679. <dd><p>Set color tint for gray/tint vectorscope mode. By default both options are zero.
  23680. This means no tint, and output will remain gray.
  23681. </p></dd>
  23682. </dl>
  23683. <span id="vidstabdetect"></span><a name="vidstabdetect-1"></a>
  23684. <h3 class="section">11.240 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>
  23685. <p>Analyze video stabilization/deshaking. Perform pass 1 of 2, see
  23686. <a href="#vidstabtransform">vidstabtransform</a> for pass 2.
  23687. </p>
  23688. <p>This filter generates a file with relative translation and rotation
  23689. transform information about subsequent frames, which is then used by
  23690. the <a href="#vidstabtransform">vidstabtransform</a> filter.
  23691. </p>
  23692. <p>To enable compilation of this filter you need to configure FFmpeg with
  23693. <code>--enable-libvidstab</code>.
  23694. </p>
  23695. <p>This filter accepts the following options:
  23696. </p>
  23697. <dl compact="compact">
  23698. <dt><samp>result</samp></dt>
  23699. <dd><p>Set the path to the file used to write the transforms information.
  23700. Default value is <samp>transforms.trf</samp>.
  23701. </p>
  23702. </dd>
  23703. <dt><samp>shakiness</samp></dt>
  23704. <dd><p>Set how shaky the video is and how quick the camera is. It accepts an
  23705. integer in the range 1-10, a value of 1 means little shakiness, a
  23706. value of 10 means strong shakiness. Default value is 5.
  23707. </p>
  23708. </dd>
  23709. <dt><samp>accuracy</samp></dt>
  23710. <dd><p>Set the accuracy of the detection process. It must be a value in the
  23711. range 1-15. A value of 1 means low accuracy, a value of 15 means high
  23712. accuracy. Default value is 15.
  23713. </p>
  23714. </dd>
  23715. <dt><samp>stepsize</samp></dt>
  23716. <dd><p>Set stepsize of the search process. The region around minimum is
  23717. scanned with 1 pixel resolution. Default value is 6.
  23718. </p>
  23719. </dd>
  23720. <dt><samp>mincontrast</samp></dt>
  23721. <dd><p>Set minimum contrast. Below this value a local measurement field is
  23722. discarded. Must be a floating point value in the range 0-1. Default
  23723. value is 0.3.
  23724. </p>
  23725. </dd>
  23726. <dt><samp>tripod</samp></dt>
  23727. <dd><p>Set reference frame number for tripod mode.
  23728. </p>
  23729. <p>If enabled, the motion of the frames is compared to a reference frame
  23730. in the filtered stream, identified by the specified number. The idea
  23731. is to compensate all movements in a more-or-less static scene and keep
  23732. the camera view absolutely still.
  23733. </p>
  23734. <p>If set to 0, it is disabled. The frames are counted starting from 1.
  23735. </p>
  23736. </dd>
  23737. <dt><samp>show</samp></dt>
  23738. <dd><p>Show fields and transforms in the resulting frames. It accepts an
  23739. integer in the range 0-2. Default value is 0, which disables any
  23740. visualization.
  23741. </p></dd>
  23742. </dl>
  23743. <a name="Examples-118"></a>
  23744. <h4 class="subsection">11.240.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>
  23745. <ul>
  23746. <li> Use default values:
  23747. <div class="example">
  23748. <pre class="example">vidstabdetect
  23749. </pre></div>
  23750. </li><li> Analyze strongly shaky movie and put the results in file
  23751. <samp>mytransforms.trf</samp>:
  23752. <div class="example">
  23753. <pre class="example">vidstabdetect=shakiness=10:accuracy=15:result=&quot;mytransforms.trf&quot;
  23754. </pre></div>
  23755. </li><li> Visualize the result of internal transformations in the resulting
  23756. video:
  23757. <div class="example">
  23758. <pre class="example">vidstabdetect=show=1
  23759. </pre></div>
  23760. </li><li> Analyze a video with medium shakiness using <code>ffmpeg</code>:
  23761. <div class="example">
  23762. <pre class="example">ffmpeg -i input -vf vidstabdetect=shakiness=5:show=1 dummy.avi
  23763. </pre></div>
  23764. </li></ul>
  23765. <span id="vidstabtransform"></span><a name="vidstabtransform-1"></a>
  23766. <h3 class="section">11.241 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>
  23767. <p>Video stabilization/deshaking: pass 2 of 2,
  23768. see <a href="#vidstabdetect">vidstabdetect</a> for pass 1.
  23769. </p>
  23770. <p>Read a file with transform information for each frame and
  23771. apply/compensate them. Together with the <a href="#vidstabdetect">vidstabdetect</a>
  23772. filter this can be used to deshake videos. See also
  23773. <a href="http://public.hronopik.de/vid.stab">http://public.hronopik.de/vid.stab</a>. It is important to also use
  23774. the <a href="#unsharp">unsharp</a> filter, see below.
  23775. </p>
  23776. <p>To enable compilation of this filter you need to configure FFmpeg with
  23777. <code>--enable-libvidstab</code>.
  23778. </p>
  23779. <a name="Options-3"></a>
  23780. <h4 class="subsection">11.241.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>
  23781. <dl compact="compact">
  23782. <dt><samp>input</samp></dt>
  23783. <dd><p>Set path to the file used to read the transforms. Default value is
  23784. <samp>transforms.trf</samp>.
  23785. </p>
  23786. </dd>
  23787. <dt><samp>smoothing</samp></dt>
  23788. <dd><p>Set the number of frames (value*2 + 1) used for lowpass filtering the
  23789. camera movements. Default value is 10.
  23790. </p>
  23791. <p>For example a number of 10 means that 21 frames are used (10 in the
  23792. past and 10 in the future) to smoothen the motion in the video. A
  23793. larger value leads to a smoother video, but limits the acceleration of
  23794. the camera (pan/tilt movements). 0 is a special case where a static
  23795. camera is simulated.
  23796. </p>
  23797. </dd>
  23798. <dt><samp>optalgo</samp></dt>
  23799. <dd><p>Set the camera path optimization algorithm.
  23800. </p>
  23801. <p>Accepted values are:
  23802. </p><dl compact="compact">
  23803. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  23804. <dd><p>gaussian kernel low-pass filter on camera motion (default)
  23805. </p></dd>
  23806. <dt>&lsquo;<samp>avg</samp>&rsquo;</dt>
  23807. <dd><p>averaging on transformations
  23808. </p></dd>
  23809. </dl>
  23810. </dd>
  23811. <dt><samp>maxshift</samp></dt>
  23812. <dd><p>Set maximal number of pixels to translate frames. Default value is -1,
  23813. meaning no limit.
  23814. </p>
  23815. </dd>
  23816. <dt><samp>maxangle</samp></dt>
  23817. <dd><p>Set maximal angle in radians (degree*PI/180) to rotate frames. Default
  23818. value is -1, meaning no limit.
  23819. </p>
  23820. </dd>
  23821. <dt><samp>crop</samp></dt>
  23822. <dd><p>Specify how to deal with borders that may be visible due to movement
  23823. compensation.
  23824. </p>
  23825. <p>Available values are:
  23826. </p><dl compact="compact">
  23827. <dt>&lsquo;<samp>keep</samp>&rsquo;</dt>
  23828. <dd><p>keep image information from previous frame (default)
  23829. </p></dd>
  23830. <dt>&lsquo;<samp>black</samp>&rsquo;</dt>
  23831. <dd><p>fill the border black
  23832. </p></dd>
  23833. </dl>
  23834. </dd>
  23835. <dt><samp>invert</samp></dt>
  23836. <dd><p>Invert transforms if set to 1. Default value is 0.
  23837. </p>
  23838. </dd>
  23839. <dt><samp>relative</samp></dt>
  23840. <dd><p>Consider transforms as relative to previous frame if set to 1,
  23841. absolute if set to 0. Default value is 0.
  23842. </p>
  23843. </dd>
  23844. <dt><samp>zoom</samp></dt>
  23845. <dd><p>Set percentage to zoom. A positive value will result in a zoom-in
  23846. effect, a negative value in a zoom-out effect. Default value is 0 (no
  23847. zoom).
  23848. </p>
  23849. </dd>
  23850. <dt><samp>optzoom</samp></dt>
  23851. <dd><p>Set optimal zooming to avoid borders.
  23852. </p>
  23853. <p>Accepted values are:
  23854. </p><dl compact="compact">
  23855. <dt>&lsquo;<samp>0</samp>&rsquo;</dt>
  23856. <dd><p>disabled
  23857. </p></dd>
  23858. <dt>&lsquo;<samp>1</samp>&rsquo;</dt>
  23859. <dd><p>optimal static zoom value is determined (only very strong movements
  23860. will lead to visible borders) (default)
  23861. </p></dd>
  23862. <dt>&lsquo;<samp>2</samp>&rsquo;</dt>
  23863. <dd><p>optimal adaptive zoom value is determined (no borders will be
  23864. visible), see <samp>zoomspeed</samp>
  23865. </p></dd>
  23866. </dl>
  23867. <p>Note that the value given at zoom is added to the one calculated here.
  23868. </p>
  23869. </dd>
  23870. <dt><samp>zoomspeed</samp></dt>
  23871. <dd><p>Set percent to zoom maximally each frame (enabled when
  23872. <samp>optzoom</samp> is set to 2). Range is from 0 to 5, default value is
  23873. 0.25.
  23874. </p>
  23875. </dd>
  23876. <dt><samp>interpol</samp></dt>
  23877. <dd><p>Specify type of interpolation.
  23878. </p>
  23879. <p>Available values are:
  23880. </p><dl compact="compact">
  23881. <dt>&lsquo;<samp>no</samp>&rsquo;</dt>
  23882. <dd><p>no interpolation
  23883. </p></dd>
  23884. <dt>&lsquo;<samp>linear</samp>&rsquo;</dt>
  23885. <dd><p>linear only horizontal
  23886. </p></dd>
  23887. <dt>&lsquo;<samp>bilinear</samp>&rsquo;</dt>
  23888. <dd><p>linear in both directions (default)
  23889. </p></dd>
  23890. <dt>&lsquo;<samp>bicubic</samp>&rsquo;</dt>
  23891. <dd><p>cubic in both directions (slow)
  23892. </p></dd>
  23893. </dl>
  23894. </dd>
  23895. <dt><samp>tripod</samp></dt>
  23896. <dd><p>Enable virtual tripod mode if set to 1, which is equivalent to
  23897. <code>relative=0:smoothing=0</code>. Default value is 0.
  23898. </p>
  23899. <p>Use also <code>tripod</code> option of <a href="#vidstabdetect">vidstabdetect</a>.
  23900. </p>
  23901. </dd>
  23902. <dt><samp>debug</samp></dt>
  23903. <dd><p>Increase log verbosity if set to 1. Also the detected global motions
  23904. are written to the temporary file <samp>global_motions.trf</samp>. Default
  23905. value is 0.
  23906. </p></dd>
  23907. </dl>
  23908. <a name="Examples-119"></a>
  23909. <h4 class="subsection">11.241.2 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>
  23910. <ul>
  23911. <li> Use <code>ffmpeg</code> for a typical stabilization with default values:
  23912. <div class="example">
  23913. <pre class="example">ffmpeg -i inp.mpeg -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 inp_stabilized.mpeg
  23914. </pre></div>
  23915. <p>Note the use of the <a href="#unsharp">unsharp</a> filter which is always recommended.
  23916. </p>
  23917. </li><li> Zoom in a bit more and load transform data from a given file:
  23918. <div class="example">
  23919. <pre class="example">vidstabtransform=zoom=5:input=&quot;mytransforms.trf&quot;
  23920. </pre></div>
  23921. </li><li> Smoothen the video even more:
  23922. <div class="example">
  23923. <pre class="example">vidstabtransform=smoothing=30
  23924. </pre></div>
  23925. </li></ul>
  23926. <a name="vflip"></a>
  23927. <h3 class="section">11.242 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>
  23928. <p>Flip the input video vertically.
  23929. </p>
  23930. <p>For example, to vertically flip a video with <code>ffmpeg</code>:
  23931. </p><div class="example">
  23932. <pre class="example">ffmpeg -i in.avi -vf &quot;vflip&quot; out.avi
  23933. </pre></div>
  23934. <a name="vfrdet"></a>
  23935. <h3 class="section">11.243 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>
  23936. <p>Detect variable frame rate video.
  23937. </p>
  23938. <p>This filter tries to detect if the input is variable or constant frame rate.
  23939. </p>
  23940. <p>At end it will output number of frames detected as having variable delta pts,
  23941. and ones with constant delta pts.
  23942. If there was frames with variable delta, than it will also show min, max and
  23943. average delta encountered.
  23944. </p>
  23945. <a name="vibrance"></a>
  23946. <h3 class="section">11.244 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>
  23947. <p>Boost or alter saturation.
  23948. </p>
  23949. <p>The filter accepts the following options:
  23950. </p><dl compact="compact">
  23951. <dt><samp>intensity</samp></dt>
  23952. <dd><p>Set strength of boost if positive value or strength of alter if negative value.
  23953. Default is 0. Allowed range is from -2 to 2.
  23954. </p>
  23955. </dd>
  23956. <dt><samp>rbal</samp></dt>
  23957. <dd><p>Set the red balance. Default is 1. Allowed range is from -10 to 10.
  23958. </p>
  23959. </dd>
  23960. <dt><samp>gbal</samp></dt>
  23961. <dd><p>Set the green balance. Default is 1. Allowed range is from -10 to 10.
  23962. </p>
  23963. </dd>
  23964. <dt><samp>bbal</samp></dt>
  23965. <dd><p>Set the blue balance. Default is 1. Allowed range is from -10 to 10.
  23966. </p>
  23967. </dd>
  23968. <dt><samp>rlum</samp></dt>
  23969. <dd><p>Set the red luma coefficient.
  23970. </p>
  23971. </dd>
  23972. <dt><samp>glum</samp></dt>
  23973. <dd><p>Set the green luma coefficient.
  23974. </p>
  23975. </dd>
  23976. <dt><samp>blum</samp></dt>
  23977. <dd><p>Set the blue luma coefficient.
  23978. </p>
  23979. </dd>
  23980. <dt><samp>alternate</samp></dt>
  23981. <dd><p>If <code>intensity</code> is negative and this is set to 1, colors will change,
  23982. otherwise colors will be less saturated, more towards gray.
  23983. </p></dd>
  23984. </dl>
  23985. <a name="Commands-130"></a>
  23986. <h4 class="subsection">11.244.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>
  23987. <p>This filter supports the all above options as <a href="#commands">commands</a>.
  23988. </p>
  23989. <a name="vif"></a>
  23990. <h3 class="section">11.245 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>
  23991. <p>Obtain the average VIF (Visual Information Fidelity) between two input videos.
  23992. </p>
  23993. <p>This filter takes two input videos.
  23994. </p>
  23995. <p>Both input videos must have the same resolution and pixel format for
  23996. this filter to work correctly. Also it assumes that both inputs
  23997. have the same number of frames, which are compared one by one.
  23998. </p>
  23999. <p>The obtained average VIF score is printed through the logging system.
  24000. </p>
  24001. <p>The filter stores the calculated VIF score of each frame.
  24002. </p>
  24003. <p>In the below example the input file <samp>main.mpg</samp> being processed is compared
  24004. with the reference file <samp>ref.mpg</samp>.
  24005. </p>
  24006. <div class="example">
  24007. <pre class="example">ffmpeg -i main.mpg -i ref.mpg -lavfi vif -f null -
  24008. </pre></div>
  24009. <span id="vignette"></span><a name="vignette-1"></a>
  24010. <h3 class="section">11.246 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>
  24011. <p>Make or reverse a natural vignetting effect.
  24012. </p>
  24013. <p>The filter accepts the following options:
  24014. </p>
  24015. <dl compact="compact">
  24016. <dt><samp>angle, a</samp></dt>
  24017. <dd><p>Set lens angle expression as a number of radians.
  24018. </p>
  24019. <p>The value is clipped in the <code>[0,PI/2]</code> range.
  24020. </p>
  24021. <p>Default value: <code>&quot;PI/5&quot;</code>
  24022. </p>
  24023. </dd>
  24024. <dt><samp>x0</samp></dt>
  24025. <dt><samp>y0</samp></dt>
  24026. <dd><p>Set center coordinates expressions. Respectively <code>&quot;w/2&quot;</code> and <code>&quot;h/2&quot;</code>
  24027. by default.
  24028. </p>
  24029. </dd>
  24030. <dt><samp>mode</samp></dt>
  24031. <dd><p>Set forward/backward mode.
  24032. </p>
  24033. <p>Available modes are:
  24034. </p><dl compact="compact">
  24035. <dt>&lsquo;<samp>forward</samp>&rsquo;</dt>
  24036. <dd><p>The larger the distance from the central point, the darker the image becomes.
  24037. </p>
  24038. </dd>
  24039. <dt>&lsquo;<samp>backward</samp>&rsquo;</dt>
  24040. <dd><p>The larger the distance from the central point, the brighter the image becomes.
  24041. This can be used to reverse a vignette effect, though there is no automatic
  24042. detection to extract the lens <samp>angle</samp> and other settings (yet). It can
  24043. also be used to create a burning effect.
  24044. </p></dd>
  24045. </dl>
  24046. <p>Default value is &lsquo;<samp>forward</samp>&rsquo;.
  24047. </p>
  24048. </dd>
  24049. <dt><samp>eval</samp></dt>
  24050. <dd><p>Set evaluation mode for the expressions (<samp>angle</samp>, <samp>x0</samp>, <samp>y0</samp>).
  24051. </p>
  24052. <p>It accepts the following values:
  24053. </p><dl compact="compact">
  24054. <dt>&lsquo;<samp>init</samp>&rsquo;</dt>
  24055. <dd><p>Evaluate expressions only once during the filter initialization.
  24056. </p>
  24057. </dd>
  24058. <dt>&lsquo;<samp>frame</samp>&rsquo;</dt>
  24059. <dd><p>Evaluate expressions for each incoming frame. This is way slower than the
  24060. &lsquo;<samp>init</samp>&rsquo; mode since it requires all the scalers to be re-computed, but it
  24061. allows advanced dynamic expressions.
  24062. </p></dd>
  24063. </dl>
  24064. <p>Default value is &lsquo;<samp>init</samp>&rsquo;.
  24065. </p>
  24066. </dd>
  24067. <dt><samp>dither</samp></dt>
  24068. <dd><p>Set dithering to reduce the circular banding effects. Default is <code>1</code>
  24069. (enabled).
  24070. </p>
  24071. </dd>
  24072. <dt><samp>aspect</samp></dt>
  24073. <dd><p>Set vignette aspect. This setting allows one to adjust the shape of the vignette.
  24074. Setting this value to the SAR of the input will make a rectangular vignetting
  24075. following the dimensions of the video.
  24076. </p>
  24077. <p>Default is <code>1/1</code>.
  24078. </p></dd>
  24079. </dl>
  24080. <a name="Expressions"></a>
  24081. <h4 class="subsection">11.246.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>
  24082. <p>The <samp>alpha</samp>, <samp>x0</samp> and <samp>y0</samp> expressions can contain the
  24083. following parameters.
  24084. </p>
  24085. <dl compact="compact">
  24086. <dt><samp>w</samp></dt>
  24087. <dt><samp>h</samp></dt>
  24088. <dd><p>input width and height
  24089. </p>
  24090. </dd>
  24091. <dt><samp>n</samp></dt>
  24092. <dd><p>the number of input frame, starting from 0
  24093. </p>
  24094. </dd>
  24095. <dt><samp>pts</samp></dt>
  24096. <dd><p>the PTS (Presentation TimeStamp) time of the filtered video frame, expressed in
  24097. <var>TB</var> units, NAN if undefined
  24098. </p>
  24099. </dd>
  24100. <dt><samp>r</samp></dt>
  24101. <dd><p>frame rate of the input video, NAN if the input frame rate is unknown
  24102. </p>
  24103. </dd>
  24104. <dt><samp>t</samp></dt>
  24105. <dd><p>the PTS (Presentation TimeStamp) of the filtered video frame,
  24106. expressed in seconds, NAN if undefined
  24107. </p>
  24108. </dd>
  24109. <dt><samp>tb</samp></dt>
  24110. <dd><p>time base of the input video
  24111. </p></dd>
  24112. </dl>
  24113. <a name="Examples-120"></a>
  24114. <h4 class="subsection">11.246.2 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>
  24115. <ul>
  24116. <li> Apply simple strong vignetting effect:
  24117. <div class="example">
  24118. <pre class="example">vignette=PI/4
  24119. </pre></div>
  24120. </li><li> Make a flickering vignetting:
  24121. <div class="example">
  24122. <pre class="example">vignette='PI/4+random(1)*PI/50':eval=frame
  24123. </pre></div>
  24124. </li></ul>
  24125. <a name="vmafmotion"></a>
  24126. <h3 class="section">11.247 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>
  24127. <p>Obtain the average VMAF motion score of a video.
  24128. It is one of the component metrics of VMAF.
  24129. </p>
  24130. <p>The obtained average motion score is printed through the logging system.
  24131. </p>
  24132. <p>The filter accepts the following options:
  24133. </p>
  24134. <dl compact="compact">
  24135. <dt><samp>stats_file</samp></dt>
  24136. <dd><p>If specified, the filter will use the named file to save the motion score of
  24137. each frame with respect to the previous frame.
  24138. When filename equals &quot;-&quot; the data is sent to standard output.
  24139. </p></dd>
  24140. </dl>
  24141. <p>Example:
  24142. </p><div class="example">
  24143. <pre class="example">ffmpeg -i ref.mpg -vf vmafmotion -f null -
  24144. </pre></div>
  24145. <a name="vstack"></a>
  24146. <h3 class="section">11.248 vstack<span class="pull-right"><a class="anchor hidden-xs" href="#vstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-vstack" aria-hidden="true">TOC</a></span></h3>
  24147. <p>Stack input videos vertically.
  24148. </p>
  24149. <p>All streams must be of same pixel format and of same width.
  24150. </p>
  24151. <p>Note that this filter is faster than using <a href="#overlay">overlay</a> and <a href="#pad">pad</a> filter
  24152. to create same output.
  24153. </p>
  24154. <p>The filter accepts the following options:
  24155. </p>
  24156. <dl compact="compact">
  24157. <dt><samp>inputs</samp></dt>
  24158. <dd><p>Set number of input streams. Default is 2.
  24159. </p>
  24160. </dd>
  24161. <dt><samp>shortest</samp></dt>
  24162. <dd><p>If set to 1, force the output to terminate when the shortest input
  24163. terminates. Default value is 0.
  24164. </p></dd>
  24165. </dl>
  24166. <a name="w3fdif"></a>
  24167. <h3 class="section">11.249 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>
  24168. <p>Deinterlace the input video (&quot;w3fdif&quot; stands for &quot;Weston 3 Field
  24169. Deinterlacing Filter&quot;).
  24170. </p>
  24171. <p>Based on the process described by Martin Weston for BBC R&amp;D, and
  24172. implemented based on the de-interlace algorithm written by Jim
  24173. Easterbrook for BBC R&amp;D, the Weston 3 field deinterlacing filter
  24174. uses filter coefficients calculated by BBC R&amp;D.
  24175. </p>
  24176. <p>This filter uses field-dominance information in frame to decide which
  24177. of each pair of fields to place first in the output.
  24178. If it gets it wrong use <a href="#setfield">setfield</a> filter before <code>w3fdif</code> filter.
  24179. </p>
  24180. <p>There are two sets of filter coefficients, so called &quot;simple&quot;
  24181. and &quot;complex&quot;. Which set of filter coefficients is used can
  24182. be set by passing an optional parameter:
  24183. </p>
  24184. <dl compact="compact">
  24185. <dt><samp>filter</samp></dt>
  24186. <dd><p>Set the interlacing filter coefficients. Accepts one of the following values:
  24187. </p>
  24188. <dl compact="compact">
  24189. <dt>&lsquo;<samp>simple</samp>&rsquo;</dt>
  24190. <dd><p>Simple filter coefficient set.
  24191. </p></dd>
  24192. <dt>&lsquo;<samp>complex</samp>&rsquo;</dt>
  24193. <dd><p>More-complex filter coefficient set.
  24194. </p></dd>
  24195. </dl>
  24196. <p>Default value is &lsquo;<samp>complex</samp>&rsquo;.
  24197. </p>
  24198. </dd>
  24199. <dt><samp>mode</samp></dt>
  24200. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  24201. </p>
  24202. <dl compact="compact">
  24203. <dt><samp>frame</samp></dt>
  24204. <dd><p>Output one frame for each frame.
  24205. </p></dd>
  24206. <dt><samp>field</samp></dt>
  24207. <dd><p>Output one frame for each field.
  24208. </p></dd>
  24209. </dl>
  24210. <p>The default value is <code>field</code>.
  24211. </p>
  24212. </dd>
  24213. <dt><samp>parity</samp></dt>
  24214. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  24215. of the following values:
  24216. </p>
  24217. <dl compact="compact">
  24218. <dt><samp>tff</samp></dt>
  24219. <dd><p>Assume the top field is first.
  24220. </p></dd>
  24221. <dt><samp>bff</samp></dt>
  24222. <dd><p>Assume the bottom field is first.
  24223. </p></dd>
  24224. <dt><samp>auto</samp></dt>
  24225. <dd><p>Enable automatic detection of field parity.
  24226. </p></dd>
  24227. </dl>
  24228. <p>The default value is <code>auto</code>.
  24229. If the interlacing is unknown or the decoder does not export this information,
  24230. top field first will be assumed.
  24231. </p>
  24232. </dd>
  24233. <dt><samp>deint</samp></dt>
  24234. <dd><p>Specify which frames to deinterlace. Accepts one of the following values:
  24235. </p>
  24236. <dl compact="compact">
  24237. <dt>&lsquo;<samp>all</samp>&rsquo;</dt>
  24238. <dd><p>Deinterlace all frames,
  24239. </p></dd>
  24240. <dt>&lsquo;<samp>interlaced</samp>&rsquo;</dt>
  24241. <dd><p>Only deinterlace frames marked as interlaced.
  24242. </p></dd>
  24243. </dl>
  24244. <p>Default value is &lsquo;<samp>all</samp>&rsquo;.
  24245. </p></dd>
  24246. </dl>
  24247. <a name="Commands-131"></a>
  24248. <h4 class="subsection">11.249.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>
  24249. <p>This filter supports same <a href="#commands">commands</a> as options.
  24250. </p>
  24251. <a name="waveform"></a>
  24252. <h3 class="section">11.250 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>
  24253. <p>Video waveform monitor.
  24254. </p>
  24255. <p>The waveform monitor plots color component intensity. By default luminance
  24256. only. Each column of the waveform corresponds to a column of pixels in the
  24257. source video.
  24258. </p>
  24259. <p>It accepts the following options:
  24260. </p>
  24261. <dl compact="compact">
  24262. <dt><samp>mode, m</samp></dt>
  24263. <dd><p>Can be either <code>row</code>, or <code>column</code>. Default is <code>column</code>.
  24264. In row mode, the graph on the left side represents color component value 0 and
  24265. the right side represents value = 255. In column mode, the top side represents
  24266. color component value = 0 and bottom side represents value = 255.
  24267. </p>
  24268. </dd>
  24269. <dt><samp>intensity, i</samp></dt>
  24270. <dd><p>Set intensity. Smaller values are useful to find out how many values of the same
  24271. luminance are distributed across input rows/columns.
  24272. Default value is <code>0.04</code>. Allowed range is [0, 1].
  24273. </p>
  24274. </dd>
  24275. <dt><samp>mirror, r</samp></dt>
  24276. <dd><p>Set mirroring mode. <code>0</code> means unmirrored, <code>1</code> means mirrored.
  24277. In mirrored mode, higher values will be represented on the left
  24278. side for <code>row</code> mode and at the top for <code>column</code> mode. Default is
  24279. <code>1</code> (mirrored).
  24280. </p>
  24281. </dd>
  24282. <dt><samp>display, d</samp></dt>
  24283. <dd><p>Set display mode.
  24284. It accepts the following values:
  24285. </p><dl compact="compact">
  24286. <dt>&lsquo;<samp>overlay</samp>&rsquo;</dt>
  24287. <dd><p>Presents information identical to that in the <code>parade</code>, except
  24288. that the graphs representing color components are superimposed directly
  24289. over one another.
  24290. </p>
  24291. <p>This display mode makes it easier to spot relative differences or similarities
  24292. in overlapping areas of the color components that are supposed to be identical,
  24293. such as neutral whites, grays, or blacks.
  24294. </p>
  24295. </dd>
  24296. <dt>&lsquo;<samp>stack</samp>&rsquo;</dt>
  24297. <dd><p>Display separate graph for the color components side by side in
  24298. <code>row</code> mode or one below the other in <code>column</code> mode.
  24299. </p>
  24300. </dd>
  24301. <dt>&lsquo;<samp>parade</samp>&rsquo;</dt>
  24302. <dd><p>Display separate graph for the color components side by side in
  24303. <code>column</code> mode or one below the other in <code>row</code> mode.
  24304. </p>
  24305. <p>Using this display mode makes it easy to spot color casts in the highlights
  24306. and shadows of an image, by comparing the contours of the top and the bottom
  24307. graphs of each waveform. Since whites, grays, and blacks are characterized
  24308. by exactly equal amounts of red, green, and blue, neutral areas of the picture
  24309. should display three waveforms of roughly equal width/height. If not, the
  24310. correction is easy to perform by making level adjustments the three waveforms.
  24311. </p></dd>
  24312. </dl>
  24313. <p>Default is <code>stack</code>.
  24314. </p>
  24315. </dd>
  24316. <dt><samp>components, c</samp></dt>
  24317. <dd><p>Set which color components to display. Default is 1, which means only luminance
  24318. or red color component if input is in RGB colorspace. If is set for example to
  24319. 7 it will display all 3 (if) available color components.
  24320. </p>
  24321. </dd>
  24322. <dt><samp>envelope, e</samp></dt>
  24323. <dd><dl compact="compact">
  24324. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  24325. <dd><p>No envelope, this is default.
  24326. </p>
  24327. </dd>
  24328. <dt>&lsquo;<samp>instant</samp>&rsquo;</dt>
  24329. <dd><p>Instant envelope, minimum and maximum values presented in graph will be easily
  24330. visible even with small <code>step</code> value.
  24331. </p>
  24332. </dd>
  24333. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  24334. <dd><p>Hold minimum and maximum values presented in graph across time. This way you
  24335. can still spot out of range values without constantly looking at waveforms.
  24336. </p>
  24337. </dd>
  24338. <dt>&lsquo;<samp>peak+instant</samp>&rsquo;</dt>
  24339. <dd><p>Peak and instant envelope combined together.
  24340. </p></dd>
  24341. </dl>
  24342. </dd>
  24343. <dt><samp>filter, f</samp></dt>
  24344. <dd><dl compact="compact">
  24345. <dt>&lsquo;<samp>lowpass</samp>&rsquo;</dt>
  24346. <dd><p>No filtering, this is default.
  24347. </p>
  24348. </dd>
  24349. <dt>&lsquo;<samp>flat</samp>&rsquo;</dt>
  24350. <dd><p>Luma and chroma combined together.
  24351. </p>
  24352. </dd>
  24353. <dt>&lsquo;<samp>aflat</samp>&rsquo;</dt>
  24354. <dd><p>Similar as above, but shows difference between blue and red chroma.
  24355. </p>
  24356. </dd>
  24357. <dt>&lsquo;<samp>xflat</samp>&rsquo;</dt>
  24358. <dd><p>Similar as above, but use different colors.
  24359. </p>
  24360. </dd>
  24361. <dt>&lsquo;<samp>yflat</samp>&rsquo;</dt>
  24362. <dd><p>Similar as above, but again with different colors.
  24363. </p>
  24364. </dd>
  24365. <dt>&lsquo;<samp>chroma</samp>&rsquo;</dt>
  24366. <dd><p>Displays only chroma.
  24367. </p>
  24368. </dd>
  24369. <dt>&lsquo;<samp>color</samp>&rsquo;</dt>
  24370. <dd><p>Displays actual color value on waveform.
  24371. </p>
  24372. </dd>
  24373. <dt>&lsquo;<samp>acolor</samp>&rsquo;</dt>
  24374. <dd><p>Similar as above, but with luma showing frequency of chroma values.
  24375. </p></dd>
  24376. </dl>
  24377. </dd>
  24378. <dt><samp>graticule, g</samp></dt>
  24379. <dd><p>Set which graticule to display.
  24380. </p>
  24381. <dl compact="compact">
  24382. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  24383. <dd><p>Do not display graticule.
  24384. </p>
  24385. </dd>
  24386. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  24387. <dd><p>Display green graticule showing legal broadcast ranges.
  24388. </p>
  24389. </dd>
  24390. <dt>&lsquo;<samp>orange</samp>&rsquo;</dt>
  24391. <dd><p>Display orange graticule showing legal broadcast ranges.
  24392. </p>
  24393. </dd>
  24394. <dt>&lsquo;<samp>invert</samp>&rsquo;</dt>
  24395. <dd><p>Display invert graticule showing legal broadcast ranges.
  24396. </p></dd>
  24397. </dl>
  24398. </dd>
  24399. <dt><samp>opacity, o</samp></dt>
  24400. <dd><p>Set graticule opacity.
  24401. </p>
  24402. </dd>
  24403. <dt><samp>flags, fl</samp></dt>
  24404. <dd><p>Set graticule flags.
  24405. </p>
  24406. <dl compact="compact">
  24407. <dt>&lsquo;<samp>numbers</samp>&rsquo;</dt>
  24408. <dd><p>Draw numbers above lines. By default enabled.
  24409. </p>
  24410. </dd>
  24411. <dt>&lsquo;<samp>dots</samp>&rsquo;</dt>
  24412. <dd><p>Draw dots instead of lines.
  24413. </p></dd>
  24414. </dl>
  24415. </dd>
  24416. <dt><samp>scale, s</samp></dt>
  24417. <dd><p>Set scale used for displaying graticule.
  24418. </p>
  24419. <dl compact="compact">
  24420. <dt>&lsquo;<samp>digital</samp>&rsquo;</dt>
  24421. <dt>&lsquo;<samp>millivolts</samp>&rsquo;</dt>
  24422. <dt>&lsquo;<samp>ire</samp>&rsquo;</dt>
  24423. </dl>
  24424. <p>Default is digital.
  24425. </p>
  24426. </dd>
  24427. <dt><samp>bgopacity, b</samp></dt>
  24428. <dd><p>Set background opacity.
  24429. </p>
  24430. </dd>
  24431. <dt><samp>tint0, t0</samp></dt>
  24432. <dt><samp>tint1, t1</samp></dt>
  24433. <dd><p>Set tint for output.
  24434. Only used with lowpass filter and when display is not overlay and input
  24435. pixel formats are not RGB.
  24436. </p></dd>
  24437. </dl>
  24438. <a name="weave_002c-doubleweave"></a>
  24439. <h3 class="section">11.251 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>
  24440. <p>The <code>weave</code> takes a field-based video input and join
  24441. each two sequential fields into single frame, producing a new double
  24442. height clip with half the frame rate and half the frame count.
  24443. </p>
  24444. <p>The <code>doubleweave</code> works same as <code>weave</code> but without
  24445. halving frame rate and frame count.
  24446. </p>
  24447. <p>It accepts the following option:
  24448. </p>
  24449. <dl compact="compact">
  24450. <dt><samp>first_field</samp></dt>
  24451. <dd><p>Set first field. Available values are:
  24452. </p>
  24453. <dl compact="compact">
  24454. <dt>&lsquo;<samp>top, t</samp>&rsquo;</dt>
  24455. <dd><p>Set the frame as top-field-first.
  24456. </p>
  24457. </dd>
  24458. <dt>&lsquo;<samp>bottom, b</samp>&rsquo;</dt>
  24459. <dd><p>Set the frame as bottom-field-first.
  24460. </p></dd>
  24461. </dl>
  24462. </dd>
  24463. </dl>
  24464. <a name="Examples-121"></a>
  24465. <h4 class="subsection">11.251.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>
  24466. <ul>
  24467. <li> Interlace video using <a href="#select">select</a> and <a href="#separatefields">separatefields</a> filter:
  24468. <div class="example">
  24469. <pre class="example">separatefields,select=eq(mod(n,4),0)+eq(mod(n,4),3),weave
  24470. </pre></div>
  24471. </li></ul>
  24472. <a name="xbr"></a>
  24473. <h3 class="section">11.252 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>
  24474. <p>Apply the xBR high-quality magnification filter which is designed for pixel
  24475. art. It follows a set of edge-detection rules, see
  24476. <a href="https://forums.libretro.com/t/xbr-algorithm-tutorial/123">https://forums.libretro.com/t/xbr-algorithm-tutorial/123</a>.
  24477. </p>
  24478. <p>It accepts the following option:
  24479. </p>
  24480. <dl compact="compact">
  24481. <dt><samp>n</samp></dt>
  24482. <dd><p>Set the scaling dimension: <code>2</code> for <code>2xBR</code>, <code>3</code> for
  24483. <code>3xBR</code> and <code>4</code> for <code>4xBR</code>.
  24484. Default is <code>3</code>.
  24485. </p></dd>
  24486. </dl>
  24487. <a name="xfade"></a>
  24488. <h3 class="section">11.253 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>
  24489. <p>Apply cross fade from one input video stream to another input video stream.
  24490. The cross fade is applied for specified duration.
  24491. </p>
  24492. <p>The filter accepts the following options:
  24493. </p>
  24494. <dl compact="compact">
  24495. <dt><samp>transition</samp></dt>
  24496. <dd><p>Set one of available transition effects:
  24497. </p>
  24498. <dl compact="compact">
  24499. <dt>&lsquo;<samp>custom</samp>&rsquo;</dt>
  24500. <dt>&lsquo;<samp>fade</samp>&rsquo;</dt>
  24501. <dt>&lsquo;<samp>wipeleft</samp>&rsquo;</dt>
  24502. <dt>&lsquo;<samp>wiperight</samp>&rsquo;</dt>
  24503. <dt>&lsquo;<samp>wipeup</samp>&rsquo;</dt>
  24504. <dt>&lsquo;<samp>wipedown</samp>&rsquo;</dt>
  24505. <dt>&lsquo;<samp>slideleft</samp>&rsquo;</dt>
  24506. <dt>&lsquo;<samp>slideright</samp>&rsquo;</dt>
  24507. <dt>&lsquo;<samp>slideup</samp>&rsquo;</dt>
  24508. <dt>&lsquo;<samp>slidedown</samp>&rsquo;</dt>
  24509. <dt>&lsquo;<samp>circlecrop</samp>&rsquo;</dt>
  24510. <dt>&lsquo;<samp>rectcrop</samp>&rsquo;</dt>
  24511. <dt>&lsquo;<samp>distance</samp>&rsquo;</dt>
  24512. <dt>&lsquo;<samp>fadeblack</samp>&rsquo;</dt>
  24513. <dt>&lsquo;<samp>fadewhite</samp>&rsquo;</dt>
  24514. <dt>&lsquo;<samp>radial</samp>&rsquo;</dt>
  24515. <dt>&lsquo;<samp>smoothleft</samp>&rsquo;</dt>
  24516. <dt>&lsquo;<samp>smoothright</samp>&rsquo;</dt>
  24517. <dt>&lsquo;<samp>smoothup</samp>&rsquo;</dt>
  24518. <dt>&lsquo;<samp>smoothdown</samp>&rsquo;</dt>
  24519. <dt>&lsquo;<samp>circleopen</samp>&rsquo;</dt>
  24520. <dt>&lsquo;<samp>circleclose</samp>&rsquo;</dt>
  24521. <dt>&lsquo;<samp>vertopen</samp>&rsquo;</dt>
  24522. <dt>&lsquo;<samp>vertclose</samp>&rsquo;</dt>
  24523. <dt>&lsquo;<samp>horzopen</samp>&rsquo;</dt>
  24524. <dt>&lsquo;<samp>horzclose</samp>&rsquo;</dt>
  24525. <dt>&lsquo;<samp>dissolve</samp>&rsquo;</dt>
  24526. <dt>&lsquo;<samp>pixelize</samp>&rsquo;</dt>
  24527. <dt>&lsquo;<samp>diagtl</samp>&rsquo;</dt>
  24528. <dt>&lsquo;<samp>diagtr</samp>&rsquo;</dt>
  24529. <dt>&lsquo;<samp>diagbl</samp>&rsquo;</dt>
  24530. <dt>&lsquo;<samp>diagbr</samp>&rsquo;</dt>
  24531. <dt>&lsquo;<samp>hlslice</samp>&rsquo;</dt>
  24532. <dt>&lsquo;<samp>hrslice</samp>&rsquo;</dt>
  24533. <dt>&lsquo;<samp>vuslice</samp>&rsquo;</dt>
  24534. <dt>&lsquo;<samp>vdslice</samp>&rsquo;</dt>
  24535. <dt>&lsquo;<samp>hblur</samp>&rsquo;</dt>
  24536. <dt>&lsquo;<samp>fadegrays</samp>&rsquo;</dt>
  24537. <dt>&lsquo;<samp>wipetl</samp>&rsquo;</dt>
  24538. <dt>&lsquo;<samp>wipetr</samp>&rsquo;</dt>
  24539. <dt>&lsquo;<samp>wipebl</samp>&rsquo;</dt>
  24540. <dt>&lsquo;<samp>wipebr</samp>&rsquo;</dt>
  24541. <dt>&lsquo;<samp>squeezeh</samp>&rsquo;</dt>
  24542. <dt>&lsquo;<samp>squeezev</samp>&rsquo;</dt>
  24543. </dl>
  24544. <p>Default transition effect is fade.
  24545. </p>
  24546. </dd>
  24547. <dt><samp>duration</samp></dt>
  24548. <dd><p>Set cross fade duration in seconds.
  24549. Default duration is 1 second.
  24550. </p>
  24551. </dd>
  24552. <dt><samp>offset</samp></dt>
  24553. <dd><p>Set cross fade start relative to first input stream in seconds.
  24554. Default offset is 0.
  24555. </p>
  24556. </dd>
  24557. <dt><samp>expr</samp></dt>
  24558. <dd><p>Set expression for custom transition effect.
  24559. </p>
  24560. <p>The expressions can use the following variables and functions:
  24561. </p>
  24562. <dl compact="compact">
  24563. <dt><samp>X</samp></dt>
  24564. <dt><samp>Y</samp></dt>
  24565. <dd><p>The coordinates of the current sample.
  24566. </p>
  24567. </dd>
  24568. <dt><samp>W</samp></dt>
  24569. <dt><samp>H</samp></dt>
  24570. <dd><p>The width and height of the image.
  24571. </p>
  24572. </dd>
  24573. <dt><samp>P</samp></dt>
  24574. <dd><p>Progress of transition effect.
  24575. </p>
  24576. </dd>
  24577. <dt><samp>PLANE</samp></dt>
  24578. <dd><p>Currently processed plane.
  24579. </p>
  24580. </dd>
  24581. <dt><samp>A</samp></dt>
  24582. <dd><p>Return value of first input at current location and plane.
  24583. </p>
  24584. </dd>
  24585. <dt><samp>B</samp></dt>
  24586. <dd><p>Return value of second input at current location and plane.
  24587. </p>
  24588. </dd>
  24589. <dt><samp>a0(x, y)</samp></dt>
  24590. <dt><samp>a1(x, y)</samp></dt>
  24591. <dt><samp>a2(x, y)</samp></dt>
  24592. <dt><samp>a3(x, y)</samp></dt>
  24593. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  24594. first/second/third/fourth component of first input.
  24595. </p>
  24596. </dd>
  24597. <dt><samp>b0(x, y)</samp></dt>
  24598. <dt><samp>b1(x, y)</samp></dt>
  24599. <dt><samp>b2(x, y)</samp></dt>
  24600. <dt><samp>b3(x, y)</samp></dt>
  24601. <dd><p>Return the value of the pixel at location (<var>x</var>,<var>y</var>) of the
  24602. first/second/third/fourth component of second input.
  24603. </p></dd>
  24604. </dl>
  24605. </dd>
  24606. </dl>
  24607. <a name="Examples-122"></a>
  24608. <h4 class="subsection">11.253.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>
  24609. <ul>
  24610. <li> Cross fade from one input video to another input video, with fade transition and duration of transition
  24611. of 2 seconds starting at offset of 5 seconds:
  24612. <div class="example">
  24613. <pre class="example">ffmpeg -i first.mp4 -i second.mp4 -filter_complex xfade=transition=fade:duration=2:offset=5 output.mp4
  24614. </pre></div>
  24615. </li></ul>
  24616. <a name="xmedian"></a>
  24617. <h3 class="section">11.254 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>
  24618. <p>Pick median pixels from several input videos.
  24619. </p>
  24620. <p>The filter accepts the following options:
  24621. </p>
  24622. <dl compact="compact">
  24623. <dt><samp>inputs</samp></dt>
  24624. <dd><p>Set number of inputs.
  24625. Default is 3. Allowed range is from 3 to 255.
  24626. If number of inputs is even number, than result will be mean value between two median values.
  24627. </p>
  24628. </dd>
  24629. <dt><samp>planes</samp></dt>
  24630. <dd><p>Set which planes to filter. Default value is <code>15</code>, by which all planes are processed.
  24631. </p>
  24632. </dd>
  24633. <dt><samp>percentile</samp></dt>
  24634. <dd><p>Set median percentile. Default value is <code>0.5</code>.
  24635. Default value of <code>0.5</code> will pick always median values, while <code>0</code> will pick
  24636. minimum values, and <code>1</code> maximum values.
  24637. </p></dd>
  24638. </dl>
  24639. <a name="Commands-132"></a>
  24640. <h4 class="subsection">11.254.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>
  24641. <p>This filter supports all above options as <a href="#commands">commands</a>, excluding option <code>inputs</code>.
  24642. </p>
  24643. <a name="xstack"></a>
  24644. <h3 class="section">11.255 xstack<span class="pull-right"><a class="anchor hidden-xs" href="#xstack" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-xstack" aria-hidden="true">TOC</a></span></h3>
  24645. <p>Stack video inputs into custom layout.
  24646. </p>
  24647. <p>All streams must be of same pixel format.
  24648. </p>
  24649. <p>The filter accepts the following options:
  24650. </p>
  24651. <dl compact="compact">
  24652. <dt><samp>inputs</samp></dt>
  24653. <dd><p>Set number of input streams. Default is 2.
  24654. </p>
  24655. </dd>
  24656. <dt><samp>layout</samp></dt>
  24657. <dd><p>Specify layout of inputs.
  24658. This option requires the desired layout configuration to be explicitly set by the user.
  24659. This sets position of each video input in output. Each input
  24660. is separated by &rsquo;|&rsquo;.
  24661. The first number represents the column, and the second number represents the row.
  24662. Numbers start at 0 and are separated by &rsquo;_&rsquo;. Optionally one can use wX and hX,
  24663. where X is video input from which to take width or height.
  24664. Multiple values can be used when separated by &rsquo;+&rsquo;. In such
  24665. case values are summed together.
  24666. </p>
  24667. <p>Note that if inputs are of different sizes gaps may appear, as not all of
  24668. the output video frame will be filled. Similarly, videos can overlap each
  24669. other if their position doesn&rsquo;t leave enough space for the full frame of
  24670. adjoining videos.
  24671. </p>
  24672. <p>For 2 inputs, a default layout of <code>0_0|w0_0</code> is set. In all other cases,
  24673. a layout must be set by the user.
  24674. </p>
  24675. </dd>
  24676. <dt><samp>shortest</samp></dt>
  24677. <dd><p>If set to 1, force the output to terminate when the shortest input
  24678. terminates. Default value is 0.
  24679. </p>
  24680. </dd>
  24681. <dt><samp>fill</samp></dt>
  24682. <dd><p>If set to valid color, all unused pixels will be filled with that color.
  24683. By default fill is set to none, so it is disabled.
  24684. </p></dd>
  24685. </dl>
  24686. <a name="Examples-123"></a>
  24687. <h4 class="subsection">11.255.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>
  24688. <ul>
  24689. <li> Display 4 inputs into 2x2 grid.
  24690. <p>Layout:
  24691. </p><div class="example">
  24692. <pre class="example">input1(0, 0) | input3(w0, 0)
  24693. input2(0, h0) | input4(w0, h0)
  24694. </pre></div>
  24695. <div class="example">
  24696. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|w0_0|w0_h0
  24697. </pre></div>
  24698. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  24699. </p>
  24700. </li><li> Display 4 inputs into 1x4 grid.
  24701. <p>Layout:
  24702. </p><div class="example">
  24703. <pre class="example">input1(0, 0)
  24704. input2(0, h0)
  24705. input3(0, h0+h1)
  24706. input4(0, h0+h1+h2)
  24707. </pre></div>
  24708. <div class="example">
  24709. <pre class="example">xstack=inputs=4:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2
  24710. </pre></div>
  24711. <p>Note that if inputs are of different widths, unused space will appear.
  24712. </p>
  24713. </li><li> Display 9 inputs into 3x3 grid.
  24714. <p>Layout:
  24715. </p><div class="example">
  24716. <pre class="example">input1(0, 0) | input4(w0, 0) | input7(w0+w3, 0)
  24717. input2(0, h0) | input5(w0, h0) | input8(w0+w3, h0)
  24718. input3(0, h0+h1) | input6(w0, h0+h1) | input9(w0+w3, h0+h1)
  24719. </pre></div>
  24720. <div class="example">
  24721. <pre class="example">xstack=inputs=9:layout=0_0|0_h0|0_h0+h1|w0_0|w0_h0|w0_h0+h1|w0+w3_0|w0+w3_h0|w0+w3_h0+h1
  24722. </pre></div>
  24723. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  24724. </p>
  24725. </li><li> Display 16 inputs into 4x4 grid.
  24726. <p>Layout:
  24727. </p><div class="example">
  24728. <pre class="example">input1(0, 0) | input5(w0, 0) | input9 (w0+w4, 0) | input13(w0+w4+w8, 0)
  24729. input2(0, h0) | input6(w0, h0) | input10(w0+w4, h0) | input14(w0+w4+w8, h0)
  24730. input3(0, h0+h1) | input7(w0, h0+h1) | input11(w0+w4, h0+h1) | input15(w0+w4+w8, h0+h1)
  24731. input4(0, h0+h1+h2)| input8(w0, h0+h1+h2)| input12(w0+w4, h0+h1+h2)| input16(w0+w4+w8, h0+h1+h2)
  24732. </pre></div>
  24733. <div class="example">
  24734. <pre class="example">xstack=inputs=16:layout=0_0|0_h0|0_h0+h1|0_h0+h1+h2|w0_0|w0_h0|w0_h0+h1|w0_h0+h1+h2|w0+w4_0|
  24735. 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
  24736. </pre></div>
  24737. <p>Note that if inputs are of different sizes, gaps or overlaps may occur.
  24738. </p>
  24739. </li></ul>
  24740. <span id="yadif"></span><a name="yadif-1"></a>
  24741. <h3 class="section">11.256 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>
  24742. <p>Deinterlace the input video (&quot;yadif&quot; means &quot;yet another deinterlacing
  24743. filter&quot;).
  24744. </p>
  24745. <p>It accepts the following parameters:
  24746. </p>
  24747. <dl compact="compact">
  24748. <dt><samp>mode</samp></dt>
  24749. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  24750. </p>
  24751. <dl compact="compact">
  24752. <dt><samp>0, send_frame</samp></dt>
  24753. <dd><p>Output one frame for each frame.
  24754. </p></dd>
  24755. <dt><samp>1, send_field</samp></dt>
  24756. <dd><p>Output one frame for each field.
  24757. </p></dd>
  24758. <dt><samp>2, send_frame_nospatial</samp></dt>
  24759. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  24760. </p></dd>
  24761. <dt><samp>3, send_field_nospatial</samp></dt>
  24762. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  24763. </p></dd>
  24764. </dl>
  24765. <p>The default value is <code>send_frame</code>.
  24766. </p>
  24767. </dd>
  24768. <dt><samp>parity</samp></dt>
  24769. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  24770. of the following values:
  24771. </p>
  24772. <dl compact="compact">
  24773. <dt><samp>0, tff</samp></dt>
  24774. <dd><p>Assume the top field is first.
  24775. </p></dd>
  24776. <dt><samp>1, bff</samp></dt>
  24777. <dd><p>Assume the bottom field is first.
  24778. </p></dd>
  24779. <dt><samp>-1, auto</samp></dt>
  24780. <dd><p>Enable automatic detection of field parity.
  24781. </p></dd>
  24782. </dl>
  24783. <p>The default value is <code>auto</code>.
  24784. If the interlacing is unknown or the decoder does not export this information,
  24785. top field first will be assumed.
  24786. </p>
  24787. </dd>
  24788. <dt><samp>deint</samp></dt>
  24789. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  24790. values:
  24791. </p>
  24792. <dl compact="compact">
  24793. <dt><samp>0, all</samp></dt>
  24794. <dd><p>Deinterlace all frames.
  24795. </p></dd>
  24796. <dt><samp>1, interlaced</samp></dt>
  24797. <dd><p>Only deinterlace frames marked as interlaced.
  24798. </p></dd>
  24799. </dl>
  24800. <p>The default value is <code>all</code>.
  24801. </p></dd>
  24802. </dl>
  24803. <a name="yadif_005fcuda"></a>
  24804. <h3 class="section">11.257 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></h3>
  24805. <p>Deinterlace the input video using the <a href="#yadif">yadif</a> algorithm, but implemented
  24806. in CUDA so that it can work as part of a GPU accelerated pipeline with nvdec
  24807. and/or nvenc.
  24808. </p>
  24809. <p>It accepts the following parameters:
  24810. </p>
  24811. <dl compact="compact">
  24812. <dt><samp>mode</samp></dt>
  24813. <dd><p>The interlacing mode to adopt. It accepts one of the following values:
  24814. </p>
  24815. <dl compact="compact">
  24816. <dt><samp>0, send_frame</samp></dt>
  24817. <dd><p>Output one frame for each frame.
  24818. </p></dd>
  24819. <dt><samp>1, send_field</samp></dt>
  24820. <dd><p>Output one frame for each field.
  24821. </p></dd>
  24822. <dt><samp>2, send_frame_nospatial</samp></dt>
  24823. <dd><p>Like <code>send_frame</code>, but it skips the spatial interlacing check.
  24824. </p></dd>
  24825. <dt><samp>3, send_field_nospatial</samp></dt>
  24826. <dd><p>Like <code>send_field</code>, but it skips the spatial interlacing check.
  24827. </p></dd>
  24828. </dl>
  24829. <p>The default value is <code>send_frame</code>.
  24830. </p>
  24831. </dd>
  24832. <dt><samp>parity</samp></dt>
  24833. <dd><p>The picture field parity assumed for the input interlaced video. It accepts one
  24834. of the following values:
  24835. </p>
  24836. <dl compact="compact">
  24837. <dt><samp>0, tff</samp></dt>
  24838. <dd><p>Assume the top field is first.
  24839. </p></dd>
  24840. <dt><samp>1, bff</samp></dt>
  24841. <dd><p>Assume the bottom field is first.
  24842. </p></dd>
  24843. <dt><samp>-1, auto</samp></dt>
  24844. <dd><p>Enable automatic detection of field parity.
  24845. </p></dd>
  24846. </dl>
  24847. <p>The default value is <code>auto</code>.
  24848. If the interlacing is unknown or the decoder does not export this information,
  24849. top field first will be assumed.
  24850. </p>
  24851. </dd>
  24852. <dt><samp>deint</samp></dt>
  24853. <dd><p>Specify which frames to deinterlace. Accepts one of the following
  24854. values:
  24855. </p>
  24856. <dl compact="compact">
  24857. <dt><samp>0, all</samp></dt>
  24858. <dd><p>Deinterlace all frames.
  24859. </p></dd>
  24860. <dt><samp>1, interlaced</samp></dt>
  24861. <dd><p>Only deinterlace frames marked as interlaced.
  24862. </p></dd>
  24863. </dl>
  24864. <p>The default value is <code>all</code>.
  24865. </p></dd>
  24866. </dl>
  24867. <a name="yaepblur"></a>
  24868. <h3 class="section">11.258 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>
  24869. <p>Apply blur filter while preserving edges (&quot;yaepblur&quot; means &quot;yet another edge preserving blur filter&quot;).
  24870. The algorithm is described in
  24871. &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;
  24872. </p>
  24873. <p>It accepts the following parameters:
  24874. </p>
  24875. <dl compact="compact">
  24876. <dt><samp>radius, r</samp></dt>
  24877. <dd><p>Set the window radius. Default value is 3.
  24878. </p>
  24879. </dd>
  24880. <dt><samp>planes, p</samp></dt>
  24881. <dd><p>Set which planes to filter. Default is only the first plane.
  24882. </p>
  24883. </dd>
  24884. <dt><samp>sigma, s</samp></dt>
  24885. <dd><p>Set blur strength. Default value is 128.
  24886. </p></dd>
  24887. </dl>
  24888. <a name="Commands-133"></a>
  24889. <h4 class="subsection">11.258.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>
  24890. <p>This filter supports same <a href="#commands">commands</a> as options.
  24891. </p>
  24892. <a name="zoompan"></a>
  24893. <h3 class="section">11.259 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>
  24894. <p>Apply Zoom &amp; Pan effect.
  24895. </p>
  24896. <p>This filter accepts the following options:
  24897. </p>
  24898. <dl compact="compact">
  24899. <dt><samp>zoom, z</samp></dt>
  24900. <dd><p>Set the zoom expression. Range is 1-10. Default is 1.
  24901. </p>
  24902. </dd>
  24903. <dt><samp>x</samp></dt>
  24904. <dt><samp>y</samp></dt>
  24905. <dd><p>Set the x and y expression. Default is 0.
  24906. </p>
  24907. </dd>
  24908. <dt><samp>d</samp></dt>
  24909. <dd><p>Set the duration expression in number of frames.
  24910. This sets for how many number of frames effect will last for
  24911. single input image. Default is 90.
  24912. </p>
  24913. </dd>
  24914. <dt><samp>s</samp></dt>
  24915. <dd><p>Set the output image size, default is &rsquo;hd720&rsquo;.
  24916. </p>
  24917. </dd>
  24918. <dt><samp>fps</samp></dt>
  24919. <dd><p>Set the output frame rate, default is &rsquo;25&rsquo;.
  24920. </p></dd>
  24921. </dl>
  24922. <p>Each expression can contain the following constants:
  24923. </p>
  24924. <dl compact="compact">
  24925. <dt><samp>in_w, iw</samp></dt>
  24926. <dd><p>Input width.
  24927. </p>
  24928. </dd>
  24929. <dt><samp>in_h, ih</samp></dt>
  24930. <dd><p>Input height.
  24931. </p>
  24932. </dd>
  24933. <dt><samp>out_w, ow</samp></dt>
  24934. <dd><p>Output width.
  24935. </p>
  24936. </dd>
  24937. <dt><samp>out_h, oh</samp></dt>
  24938. <dd><p>Output height.
  24939. </p>
  24940. </dd>
  24941. <dt><samp>in</samp></dt>
  24942. <dd><p>Input frame count.
  24943. </p>
  24944. </dd>
  24945. <dt><samp>on</samp></dt>
  24946. <dd><p>Output frame count.
  24947. </p>
  24948. </dd>
  24949. <dt><samp>in_time, it</samp></dt>
  24950. <dd><p>The input timestamp expressed in seconds. It&rsquo;s NAN if the input timestamp is unknown.
  24951. </p>
  24952. </dd>
  24953. <dt><samp>out_time, time, ot</samp></dt>
  24954. <dd><p>The output timestamp expressed in seconds.
  24955. </p>
  24956. </dd>
  24957. <dt><samp>x</samp></dt>
  24958. <dt><samp>y</samp></dt>
  24959. <dd><p>Last calculated &rsquo;x&rsquo; and &rsquo;y&rsquo; position from &rsquo;x&rsquo; and &rsquo;y&rsquo; expression
  24960. for current input frame.
  24961. </p>
  24962. </dd>
  24963. <dt><samp>px</samp></dt>
  24964. <dt><samp>py</samp></dt>
  24965. <dd><p>&rsquo;x&rsquo; and &rsquo;y&rsquo; of last output frame of previous input frame or 0 when there was
  24966. not yet such frame (first input frame).
  24967. </p>
  24968. </dd>
  24969. <dt><samp>zoom</samp></dt>
  24970. <dd><p>Last calculated zoom from &rsquo;z&rsquo; expression for current input frame.
  24971. </p>
  24972. </dd>
  24973. <dt><samp>pzoom</samp></dt>
  24974. <dd><p>Last calculated zoom of last output frame of previous input frame.
  24975. </p>
  24976. </dd>
  24977. <dt><samp>duration</samp></dt>
  24978. <dd><p>Number of output frames for current input frame. Calculated from &rsquo;d&rsquo; expression
  24979. for each input frame.
  24980. </p>
  24981. </dd>
  24982. <dt><samp>pduration</samp></dt>
  24983. <dd><p>number of output frames created for previous input frame
  24984. </p>
  24985. </dd>
  24986. <dt><samp>a</samp></dt>
  24987. <dd><p>Rational number: input width / input height
  24988. </p>
  24989. </dd>
  24990. <dt><samp>sar</samp></dt>
  24991. <dd><p>sample aspect ratio
  24992. </p>
  24993. </dd>
  24994. <dt><samp>dar</samp></dt>
  24995. <dd><p>display aspect ratio
  24996. </p>
  24997. </dd>
  24998. </dl>
  24999. <a name="Examples-124"></a>
  25000. <h4 class="subsection">11.259.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>
  25001. <ul>
  25002. <li> Zoom in up to 1.5x and pan at same time to some spot near center of picture:
  25003. <div class="example">
  25004. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='if(gte(zoom,1.5),x,x+1/a)':y='if(gte(zoom,1.5),y,y+1)':s=640x360
  25005. </pre></div>
  25006. </li><li> Zoom in up to 1.5x and pan always at center of picture:
  25007. <div class="example">
  25008. <pre class="example">zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  25009. </pre></div>
  25010. </li><li> Same as above but without pausing:
  25011. <div class="example">
  25012. <pre class="example">zoompan=z='min(max(zoom,pzoom)+0.0015,1.5)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  25013. </pre></div>
  25014. </li><li> Zoom in 2x into center of picture only for the first second of the input video:
  25015. <div class="example">
  25016. <pre class="example">zoompan=z='if(between(in_time,0,1),2,1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
  25017. </pre></div>
  25018. </li></ul>
  25019. <span id="zscale"></span><a name="zscale-1"></a>
  25020. <h3 class="section">11.260 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>
  25021. <p>Scale (resize) the input video, using the z.lib library:
  25022. <a href="https://github.com/sekrit-twc/zimg">https://github.com/sekrit-twc/zimg</a>. To enable compilation of this
  25023. filter, you need to configure FFmpeg with <code>--enable-libzimg</code>.
  25024. </p>
  25025. <p>The zscale filter forces the output display aspect ratio to be the same
  25026. as the input, by changing the output sample aspect ratio.
  25027. </p>
  25028. <p>If the input image format is different from the format requested by
  25029. the next filter, the zscale filter will convert the input to the
  25030. requested format.
  25031. </p>
  25032. <a name="Options-4"></a>
  25033. <h4 class="subsection">11.260.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>
  25034. <p>The filter accepts the following options.
  25035. </p>
  25036. <dl compact="compact">
  25037. <dt><samp>width, w</samp></dt>
  25038. <dt><samp>height, h</samp></dt>
  25039. <dd><p>Set the output video dimension expression. Default value is the input
  25040. dimension.
  25041. </p>
  25042. <p>If the <var>width</var> or <var>w</var> value is 0, the input width is used for
  25043. the output. If the <var>height</var> or <var>h</var> value is 0, the input height
  25044. is used for the output.
  25045. </p>
  25046. <p>If one and only one of the values is -n with n &gt;= 1, the zscale filter
  25047. will use a value that maintains the aspect ratio of the input image,
  25048. calculated from the other specified dimension. After that it will,
  25049. however, make sure that the calculated dimension is divisible by n and
  25050. adjust the value if necessary.
  25051. </p>
  25052. <p>If both values are -n with n &gt;= 1, the behavior will be identical to
  25053. both values being set to 0 as previously detailed.
  25054. </p>
  25055. <p>See below for the list of accepted constants for use in the dimension
  25056. expression.
  25057. </p>
  25058. </dd>
  25059. <dt><samp>size, s</samp></dt>
  25060. <dd><p>Set the video size. For the syntax of this option, check the
  25061. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  25062. </p>
  25063. </dd>
  25064. <dt><samp>dither, d</samp></dt>
  25065. <dd><p>Set the dither type.
  25066. </p>
  25067. <p>Possible values are:
  25068. </p><dl compact="compact">
  25069. <dt><var>none</var></dt>
  25070. <dt><var>ordered</var></dt>
  25071. <dt><var>random</var></dt>
  25072. <dt><var>error_diffusion</var></dt>
  25073. </dl>
  25074. <p>Default is none.
  25075. </p>
  25076. </dd>
  25077. <dt><samp>filter, f</samp></dt>
  25078. <dd><p>Set the resize filter type.
  25079. </p>
  25080. <p>Possible values are:
  25081. </p><dl compact="compact">
  25082. <dt><var>point</var></dt>
  25083. <dt><var>bilinear</var></dt>
  25084. <dt><var>bicubic</var></dt>
  25085. <dt><var>spline16</var></dt>
  25086. <dt><var>spline36</var></dt>
  25087. <dt><var>lanczos</var></dt>
  25088. </dl>
  25089. <p>Default is bilinear.
  25090. </p>
  25091. </dd>
  25092. <dt><samp>range, r</samp></dt>
  25093. <dd><p>Set the color range.
  25094. </p>
  25095. <p>Possible values are:
  25096. </p><dl compact="compact">
  25097. <dt><var>input</var></dt>
  25098. <dt><var>limited</var></dt>
  25099. <dt><var>full</var></dt>
  25100. </dl>
  25101. <p>Default is same as input.
  25102. </p>
  25103. </dd>
  25104. <dt><samp>primaries, p</samp></dt>
  25105. <dd><p>Set the color primaries.
  25106. </p>
  25107. <p>Possible values are:
  25108. </p><dl compact="compact">
  25109. <dt><var>input</var></dt>
  25110. <dt><var>709</var></dt>
  25111. <dt><var>unspecified</var></dt>
  25112. <dt><var>170m</var></dt>
  25113. <dt><var>240m</var></dt>
  25114. <dt><var>2020</var></dt>
  25115. </dl>
  25116. <p>Default is same as input.
  25117. </p>
  25118. </dd>
  25119. <dt><samp>transfer, t</samp></dt>
  25120. <dd><p>Set the transfer characteristics.
  25121. </p>
  25122. <p>Possible values are:
  25123. </p><dl compact="compact">
  25124. <dt><var>input</var></dt>
  25125. <dt><var>709</var></dt>
  25126. <dt><var>unspecified</var></dt>
  25127. <dt><var>601</var></dt>
  25128. <dt><var>linear</var></dt>
  25129. <dt><var>2020_10</var></dt>
  25130. <dt><var>2020_12</var></dt>
  25131. <dt><var>smpte2084</var></dt>
  25132. <dt><var>iec61966-2-1</var></dt>
  25133. <dt><var>arib-std-b67</var></dt>
  25134. </dl>
  25135. <p>Default is same as input.
  25136. </p>
  25137. </dd>
  25138. <dt><samp>matrix, m</samp></dt>
  25139. <dd><p>Set the colorspace matrix.
  25140. </p>
  25141. <p>Possible value are:
  25142. </p><dl compact="compact">
  25143. <dt><var>input</var></dt>
  25144. <dt><var>709</var></dt>
  25145. <dt><var>unspecified</var></dt>
  25146. <dt><var>470bg</var></dt>
  25147. <dt><var>170m</var></dt>
  25148. <dt><var>2020_ncl</var></dt>
  25149. <dt><var>2020_cl</var></dt>
  25150. </dl>
  25151. <p>Default is same as input.
  25152. </p>
  25153. </dd>
  25154. <dt><samp>rangein, rin</samp></dt>
  25155. <dd><p>Set the input color range.
  25156. </p>
  25157. <p>Possible values are:
  25158. </p><dl compact="compact">
  25159. <dt><var>input</var></dt>
  25160. <dt><var>limited</var></dt>
  25161. <dt><var>full</var></dt>
  25162. </dl>
  25163. <p>Default is same as input.
  25164. </p>
  25165. </dd>
  25166. <dt><samp>primariesin, pin</samp></dt>
  25167. <dd><p>Set the input color primaries.
  25168. </p>
  25169. <p>Possible values are:
  25170. </p><dl compact="compact">
  25171. <dt><var>input</var></dt>
  25172. <dt><var>709</var></dt>
  25173. <dt><var>unspecified</var></dt>
  25174. <dt><var>170m</var></dt>
  25175. <dt><var>240m</var></dt>
  25176. <dt><var>2020</var></dt>
  25177. </dl>
  25178. <p>Default is same as input.
  25179. </p>
  25180. </dd>
  25181. <dt><samp>transferin, tin</samp></dt>
  25182. <dd><p>Set the input transfer characteristics.
  25183. </p>
  25184. <p>Possible values are:
  25185. </p><dl compact="compact">
  25186. <dt><var>input</var></dt>
  25187. <dt><var>709</var></dt>
  25188. <dt><var>unspecified</var></dt>
  25189. <dt><var>601</var></dt>
  25190. <dt><var>linear</var></dt>
  25191. <dt><var>2020_10</var></dt>
  25192. <dt><var>2020_12</var></dt>
  25193. </dl>
  25194. <p>Default is same as input.
  25195. </p>
  25196. </dd>
  25197. <dt><samp>matrixin, min</samp></dt>
  25198. <dd><p>Set the input colorspace matrix.
  25199. </p>
  25200. <p>Possible value are:
  25201. </p><dl compact="compact">
  25202. <dt><var>input</var></dt>
  25203. <dt><var>709</var></dt>
  25204. <dt><var>unspecified</var></dt>
  25205. <dt><var>470bg</var></dt>
  25206. <dt><var>170m</var></dt>
  25207. <dt><var>2020_ncl</var></dt>
  25208. <dt><var>2020_cl</var></dt>
  25209. </dl>
  25210. </dd>
  25211. <dt><samp>chromal, c</samp></dt>
  25212. <dd><p>Set the output chroma location.
  25213. </p>
  25214. <p>Possible values are:
  25215. </p><dl compact="compact">
  25216. <dt><var>input</var></dt>
  25217. <dt><var>left</var></dt>
  25218. <dt><var>center</var></dt>
  25219. <dt><var>topleft</var></dt>
  25220. <dt><var>top</var></dt>
  25221. <dt><var>bottomleft</var></dt>
  25222. <dt><var>bottom</var></dt>
  25223. </dl>
  25224. </dd>
  25225. <dt><samp>chromalin, cin</samp></dt>
  25226. <dd><p>Set the input chroma location.
  25227. </p>
  25228. <p>Possible values are:
  25229. </p><dl compact="compact">
  25230. <dt><var>input</var></dt>
  25231. <dt><var>left</var></dt>
  25232. <dt><var>center</var></dt>
  25233. <dt><var>topleft</var></dt>
  25234. <dt><var>top</var></dt>
  25235. <dt><var>bottomleft</var></dt>
  25236. <dt><var>bottom</var></dt>
  25237. </dl>
  25238. </dd>
  25239. <dt><samp>npl</samp></dt>
  25240. <dd><p>Set the nominal peak luminance.
  25241. </p>
  25242. </dd>
  25243. <dt><samp>param_a</samp></dt>
  25244. <dd><p>Parameter A for scaling filters. Parameter &quot;b&quot; for bicubic, and the number of
  25245. filter taps for lanczos.
  25246. </p>
  25247. </dd>
  25248. <dt><samp>param_b</samp></dt>
  25249. <dd><p>Parameter B for scaling filters. Parameter &quot;c&quot; for bicubic.
  25250. </p></dd>
  25251. </dl>
  25252. <p>The values of the <samp>w</samp> and <samp>h</samp> options are expressions
  25253. containing the following constants:
  25254. </p>
  25255. <dl compact="compact">
  25256. <dt><var>in_w</var></dt>
  25257. <dt><var>in_h</var></dt>
  25258. <dd><p>The input width and height
  25259. </p>
  25260. </dd>
  25261. <dt><var>iw</var></dt>
  25262. <dt><var>ih</var></dt>
  25263. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  25264. </p>
  25265. </dd>
  25266. <dt><var>out_w</var></dt>
  25267. <dt><var>out_h</var></dt>
  25268. <dd><p>The output (scaled) width and height
  25269. </p>
  25270. </dd>
  25271. <dt><var>ow</var></dt>
  25272. <dt><var>oh</var></dt>
  25273. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>
  25274. </p>
  25275. </dd>
  25276. <dt><var>a</var></dt>
  25277. <dd><p>The same as <var>iw</var> / <var>ih</var>
  25278. </p>
  25279. </dd>
  25280. <dt><var>sar</var></dt>
  25281. <dd><p>input sample aspect ratio
  25282. </p>
  25283. </dd>
  25284. <dt><var>dar</var></dt>
  25285. <dd><p>The input display aspect ratio. Calculated from <code>(iw / ih) * sar</code>.
  25286. </p>
  25287. </dd>
  25288. <dt><var>hsub</var></dt>
  25289. <dt><var>vsub</var></dt>
  25290. <dd><p>horizontal and vertical input chroma subsample values. For example for the
  25291. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  25292. </p>
  25293. </dd>
  25294. <dt><var>ohsub</var></dt>
  25295. <dt><var>ovsub</var></dt>
  25296. <dd><p>horizontal and vertical output chroma subsample values. For example for the
  25297. pixel format &quot;yuv422p&quot; <var>hsub</var> is 2 and <var>vsub</var> is 1.
  25298. </p></dd>
  25299. </dl>
  25300. <a name="Commands-134"></a>
  25301. <h4 class="subsection">11.260.2 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>
  25302. <p>This filter supports the following commands:
  25303. </p><dl compact="compact">
  25304. <dt><samp>width, w</samp></dt>
  25305. <dt><samp>height, h</samp></dt>
  25306. <dd><p>Set the output video dimension expression.
  25307. The command accepts the same syntax of the corresponding option.
  25308. </p>
  25309. <p>If the specified expression is not valid, it is kept at its current
  25310. value.
  25311. </p></dd>
  25312. </dl>
  25313. <a name="OpenCL-Video-Filters"></a>
  25314. <h2 class="chapter">12 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>
  25315. <p>Below is a description of the currently available OpenCL video filters.
  25316. </p>
  25317. <p>To enable compilation of these filters you need to configure FFmpeg with
  25318. <code>--enable-opencl</code>.
  25319. </p>
  25320. <p>Running OpenCL filters requires you to initialize a hardware device and to pass that device to all filters in any filter graph.
  25321. </p><dl compact="compact">
  25322. <dt><samp>-init_hw_device opencl[=<var>name</var>][:<var>device</var>[,<var>key=value</var>...]]</samp></dt>
  25323. <dd><p>Initialise a new hardware device of type <var>opencl</var> called <var>name</var>, using the
  25324. given device parameters.
  25325. </p>
  25326. </dd>
  25327. <dt><samp>-filter_hw_device <var>name</var></samp></dt>
  25328. <dd><p>Pass the hardware device called <var>name</var> to all filters in any filter graph.
  25329. </p>
  25330. </dd>
  25331. </dl>
  25332. <p>For more detailed information see <a href="https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options">https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options</a>
  25333. </p>
  25334. <ul>
  25335. <li> Example of choosing the first device on the second platform and running avgblur_opencl filter with default parameters on it.
  25336. <div class="example">
  25337. <pre class="example">-init_hw_device opencl=gpu:1.0 -filter_hw_device gpu -i INPUT -vf &quot;hwupload, avgblur_opencl, hwdownload&quot; OUTPUT
  25338. </pre></div>
  25339. </li></ul>
  25340. <p>Since OpenCL filters are not able to access frame data in normal memory, all frame data needs to be uploaded(<a href="#hwupload">hwupload</a>) to hardware surfaces connected to the appropriate device before being used and then downloaded(<a href="#hwdownload">hwdownload</a>) back to normal memory. Note that <a href="#hwupload">hwupload</a> will upload to a surface with the same layout as the software frame, so it may be necessary to add a <a href="#format">format</a> filter immediately before to get the input into the right format and <a href="#hwdownload">hwdownload</a> does not support all formats on the output - it may be necessary to insert an additional <a href="#format">format</a> filter immediately following in the graph to get the output in a supported format.
  25341. </p>
  25342. <a name="avgblur_005fopencl"></a>
  25343. <h3 class="section">12.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>
  25344. <p>Apply average blur filter.
  25345. </p>
  25346. <p>The filter accepts the following options:
  25347. </p>
  25348. <dl compact="compact">
  25349. <dt><samp>sizeX</samp></dt>
  25350. <dd><p>Set horizontal radius size.
  25351. Range is <code>[1, 1024]</code> and default value is <code>1</code>.
  25352. </p>
  25353. </dd>
  25354. <dt><samp>planes</samp></dt>
  25355. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  25356. </p>
  25357. </dd>
  25358. <dt><samp>sizeY</samp></dt>
  25359. <dd><p>Set vertical radius size. Range is <code>[1, 1024]</code> and default value is <code>0</code>. If zero, <code>sizeX</code> value will be used.
  25360. </p></dd>
  25361. </dl>
  25362. <a name="Example"></a>
  25363. <h4 class="subsection">12.1.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>
  25364. <ul>
  25365. <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.
  25366. <div class="example">
  25367. <pre class="example">-i INPUT -vf &quot;hwupload, avgblur_opencl=3, hwdownload&quot; OUTPUT
  25368. </pre></div>
  25369. </li></ul>
  25370. <a name="boxblur_005fopencl"></a>
  25371. <h3 class="section">12.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>
  25372. <p>Apply a boxblur algorithm to the input video.
  25373. </p>
  25374. <p>It accepts the following parameters:
  25375. </p>
  25376. <dl compact="compact">
  25377. <dt><samp>luma_radius, lr</samp></dt>
  25378. <dt><samp>luma_power, lp</samp></dt>
  25379. <dt><samp>chroma_radius, cr</samp></dt>
  25380. <dt><samp>chroma_power, cp</samp></dt>
  25381. <dt><samp>alpha_radius, ar</samp></dt>
  25382. <dt><samp>alpha_power, ap</samp></dt>
  25383. </dl>
  25384. <p>A description of the accepted options follows.
  25385. </p>
  25386. <dl compact="compact">
  25387. <dt><samp>luma_radius, lr</samp></dt>
  25388. <dt><samp>chroma_radius, cr</samp></dt>
  25389. <dt><samp>alpha_radius, ar</samp></dt>
  25390. <dd><p>Set an expression for the box radius in pixels used for blurring the
  25391. corresponding input plane.
  25392. </p>
  25393. <p>The radius value must be a non-negative number, and must not be
  25394. greater than the value of the expression <code>min(w,h)/2</code> for the
  25395. luma and alpha planes, and of <code>min(cw,ch)/2</code> for the chroma
  25396. planes.
  25397. </p>
  25398. <p>Default value for <samp>luma_radius</samp> is &quot;2&quot;. If not specified,
  25399. <samp>chroma_radius</samp> and <samp>alpha_radius</samp> default to the
  25400. corresponding value set for <samp>luma_radius</samp>.
  25401. </p>
  25402. <p>The expressions can contain the following constants:
  25403. </p><dl compact="compact">
  25404. <dt><samp>w</samp></dt>
  25405. <dt><samp>h</samp></dt>
  25406. <dd><p>The input width and height in pixels.
  25407. </p>
  25408. </dd>
  25409. <dt><samp>cw</samp></dt>
  25410. <dt><samp>ch</samp></dt>
  25411. <dd><p>The input chroma image width and height in pixels.
  25412. </p>
  25413. </dd>
  25414. <dt><samp>hsub</samp></dt>
  25415. <dt><samp>vsub</samp></dt>
  25416. <dd><p>The horizontal and vertical chroma subsample values. For example, for the
  25417. pixel format &quot;yuv422p&quot;, <var>hsub</var> is 2 and <var>vsub</var> is 1.
  25418. </p></dd>
  25419. </dl>
  25420. </dd>
  25421. <dt><samp>luma_power, lp</samp></dt>
  25422. <dt><samp>chroma_power, cp</samp></dt>
  25423. <dt><samp>alpha_power, ap</samp></dt>
  25424. <dd><p>Specify how many times the boxblur filter is applied to the
  25425. corresponding plane.
  25426. </p>
  25427. <p>Default value for <samp>luma_power</samp> is 2. If not specified,
  25428. <samp>chroma_power</samp> and <samp>alpha_power</samp> default to the
  25429. corresponding value set for <samp>luma_power</samp>.
  25430. </p>
  25431. <p>A value of 0 will disable the effect.
  25432. </p></dd>
  25433. </dl>
  25434. <a name="Examples-125"></a>
  25435. <h4 class="subsection">12.2.1 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>
  25436. <p>Apply boxblur filter, setting each pixel of the output to the average value of box-radiuses <var>luma_radius</var>, <var>chroma_radius</var>, <var>alpha_radius</var> for each plane respectively. The filter will apply <var>luma_power</var>, <var>chroma_power</var>, <var>alpha_power</var> times onto the corresponding plane. For pixels on the edges of the image, the radius does not extend beyond the image boundaries, and so out-of-range coordinates are not used in the calculations.
  25437. </p>
  25438. <ul>
  25439. <li> Apply a boxblur filter with the luma, chroma, and alpha radius
  25440. 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.
  25441. <div class="example">
  25442. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=luma_radius=2:luma_power=3, hwdownload&quot; OUTPUT
  25443. -i INPUT -vf &quot;hwupload, boxblur_opencl=2:3, hwdownload&quot; OUTPUT
  25444. </pre></div>
  25445. </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.
  25446. <p>For the luma plane, a 2x2 box radius will be run once.
  25447. </p>
  25448. <p>For the chroma plane, a 4x4 box radius will be run 5 times.
  25449. </p>
  25450. <p>For the alpha plane, a 3x3 box radius will be run 7 times.
  25451. </p><div class="example">
  25452. <pre class="example">-i INPUT -vf &quot;hwupload, boxblur_opencl=2:1:4:5:3:7, hwdownload&quot; OUTPUT
  25453. </pre></div>
  25454. </li></ul>
  25455. <a name="colorkey_005fopencl"></a>
  25456. <h3 class="section">12.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>
  25457. <p>RGB colorspace color keying.
  25458. </p>
  25459. <p>The filter accepts the following options:
  25460. </p>
  25461. <dl compact="compact">
  25462. <dt><samp>color</samp></dt>
  25463. <dd><p>The color which will be replaced with transparency.
  25464. </p>
  25465. </dd>
  25466. <dt><samp>similarity</samp></dt>
  25467. <dd><p>Similarity percentage with the key color.
  25468. </p>
  25469. <p>0.01 matches only the exact key color, while 1.0 matches everything.
  25470. </p>
  25471. </dd>
  25472. <dt><samp>blend</samp></dt>
  25473. <dd><p>Blend percentage.
  25474. </p>
  25475. <p>0.0 makes pixels either fully transparent, or not transparent at all.
  25476. </p>
  25477. <p>Higher values result in semi-transparent pixels, with a higher transparency
  25478. the more similar the pixels color is to the key color.
  25479. </p></dd>
  25480. </dl>
  25481. <a name="Examples-126"></a>
  25482. <h4 class="subsection">12.3.1 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>
  25483. <ul>
  25484. <li> Make every semi-green pixel in the input transparent with some slight blending:
  25485. <div class="example">
  25486. <pre class="example">-i INPUT -vf &quot;hwupload, colorkey_opencl=green:0.3:0.1, hwdownload&quot; OUTPUT
  25487. </pre></div>
  25488. </li></ul>
  25489. <a name="convolution_005fopencl"></a>
  25490. <h3 class="section">12.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>
  25491. <p>Apply convolution of 3x3, 5x5, 7x7 matrix.
  25492. </p>
  25493. <p>The filter accepts the following options:
  25494. </p>
  25495. <dl compact="compact">
  25496. <dt><samp>0m</samp></dt>
  25497. <dt><samp>1m</samp></dt>
  25498. <dt><samp>2m</samp></dt>
  25499. <dt><samp>3m</samp></dt>
  25500. <dd><p>Set matrix for each plane.
  25501. Matrix is sequence of 9, 25 or 49 signed numbers.
  25502. Default value for each plane is <code>0 0 0 0 1 0 0 0 0</code>.
  25503. </p>
  25504. </dd>
  25505. <dt><samp>0rdiv</samp></dt>
  25506. <dt><samp>1rdiv</samp></dt>
  25507. <dt><samp>2rdiv</samp></dt>
  25508. <dt><samp>3rdiv</samp></dt>
  25509. <dd><p>Set multiplier for calculated value for each plane.
  25510. If unset or 0, it will be sum of all matrix elements.
  25511. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>1.0</code>.
  25512. </p>
  25513. </dd>
  25514. <dt><samp>0bias</samp></dt>
  25515. <dt><samp>1bias</samp></dt>
  25516. <dt><samp>2bias</samp></dt>
  25517. <dt><samp>3bias</samp></dt>
  25518. <dd><p>Set bias for each plane. This value is added to the result of the multiplication.
  25519. Useful for making the overall image brighter or darker.
  25520. The option value must be a float number greater or equal to <code>0.0</code>. Default value is <code>0.0</code>.
  25521. </p>
  25522. </dd>
  25523. </dl>
  25524. <a name="Examples-127"></a>
  25525. <h4 class="subsection">12.4.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>
  25526. <ul>
  25527. <li> Apply sharpen:
  25528. <div class="example">
  25529. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0:0 -1 0 -1 5 -1 0 -1 0, hwdownload&quot; OUTPUT
  25530. </pre></div>
  25531. </li><li> Apply blur:
  25532. <div class="example">
  25533. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1 1 1 1 1 1 1 1 1:1/9:1/9:1/9:1/9, hwdownload&quot; OUTPUT
  25534. </pre></div>
  25535. </li><li> Apply edge enhance:
  25536. <div class="example">
  25537. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:0 0 0 -1 1 0 0 0 0:5:1:1:1:0:128:128:128, hwdownload&quot; OUTPUT
  25538. </pre></div>
  25539. </li><li> Apply edge detect:
  25540. <div class="example">
  25541. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:0 1 0 1 -4 1 0 1 0:5:5:5:1:0:128:128:128, hwdownload&quot; OUTPUT
  25542. </pre></div>
  25543. </li><li> Apply laplacian edge detector which includes diagonals:
  25544. <div class="example">
  25545. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:1 1 1 1 -8 1 1 1 1:5:5:5:1:0:128:128:0, hwdownload&quot; OUTPUT
  25546. </pre></div>
  25547. </li><li> Apply emboss:
  25548. <div class="example">
  25549. <pre class="example">-i INPUT -vf &quot;hwupload, convolution_opencl=-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2:-2 -1 0 -1 1 1 0 1 2, hwdownload&quot; OUTPUT
  25550. </pre></div>
  25551. </li></ul>
  25552. <a name="erosion_005fopencl"></a>
  25553. <h3 class="section">12.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>
  25554. <p>Apply erosion effect to the video.
  25555. </p>
  25556. <p>This filter replaces the pixel by the local(3x3) minimum.
  25557. </p>
  25558. <p>It accepts the following options:
  25559. </p>
  25560. <dl compact="compact">
  25561. <dt><samp>threshold0</samp></dt>
  25562. <dt><samp>threshold1</samp></dt>
  25563. <dt><samp>threshold2</samp></dt>
  25564. <dt><samp>threshold3</samp></dt>
  25565. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  25566. If <code>0</code>, plane will remain unchanged.
  25567. </p>
  25568. </dd>
  25569. <dt><samp>coordinates</samp></dt>
  25570. <dd><p>Flag which specifies the pixel to refer to.
  25571. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  25572. </p>
  25573. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  25574. </p>
  25575. <p>1 2 3
  25576. </p>
  25577. <p>4 x 5
  25578. </p>
  25579. <p>6 7 8
  25580. </p></dd>
  25581. </dl>
  25582. <a name="Example-1"></a>
  25583. <h4 class="subsection">12.5.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>
  25584. <ul>
  25585. <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.
  25586. <div class="example">
  25587. <pre class="example">-i INPUT -vf &quot;hwupload, erosion_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  25588. </pre></div>
  25589. </li></ul>
  25590. <a name="deshake_005fopencl"></a>
  25591. <h3 class="section">12.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>
  25592. <p>Feature-point based video stabilization filter.
  25593. </p>
  25594. <p>The filter accepts the following options:
  25595. </p>
  25596. <dl compact="compact">
  25597. <dt><samp>tripod</samp></dt>
  25598. <dd><p>Simulates a tripod by preventing any camera movement whatsoever from the original frame. Defaults to <code>0</code>.
  25599. </p>
  25600. </dd>
  25601. <dt><samp>debug</samp></dt>
  25602. <dd><p>Whether or not additional debug info should be displayed, both in the processed output and in the console.
  25603. </p>
  25604. <p>Note that in order to see console debug output you will also need to pass <code>-v verbose</code> to ffmpeg.
  25605. </p>
  25606. <p>Viewing point matches in the output video is only supported for RGB input.
  25607. </p>
  25608. <p>Defaults to <code>0</code>.
  25609. </p>
  25610. </dd>
  25611. <dt><samp>adaptive_crop</samp></dt>
  25612. <dd><p>Whether or not to do a tiny bit of cropping at the borders to cut down on the amount of mirrored pixels.
  25613. </p>
  25614. <p>Defaults to <code>1</code>.
  25615. </p>
  25616. </dd>
  25617. <dt><samp>refine_features</samp></dt>
  25618. <dd><p>Whether or not feature points should be refined at a sub-pixel level.
  25619. </p>
  25620. <p>This can be turned off for a slight performance gain at the cost of precision.
  25621. </p>
  25622. <p>Defaults to <code>1</code>.
  25623. </p>
  25624. </dd>
  25625. <dt><samp>smooth_strength</samp></dt>
  25626. <dd><p>The strength of the smoothing applied to the camera path from <code>0.0</code> to <code>1.0</code>.
  25627. </p>
  25628. <p><code>1.0</code> is the maximum smoothing strength while values less than that result in less smoothing.
  25629. </p>
  25630. <p><code>0.0</code> causes the filter to adaptively choose a smoothing strength on a per-frame basis.
  25631. </p>
  25632. <p>Defaults to <code>0.0</code>.
  25633. </p>
  25634. </dd>
  25635. <dt><samp>smooth_window_multiplier</samp></dt>
  25636. <dd><p>Controls the size of the smoothing window (the number of frames buffered to determine motion information from).
  25637. </p>
  25638. <p>The size of the smoothing window is determined by multiplying the framerate of the video by this number.
  25639. </p>
  25640. <p>Acceptable values range from <code>0.1</code> to <code>10.0</code>.
  25641. </p>
  25642. <p>Larger values increase the amount of motion data available for determining how to smooth the camera path,
  25643. potentially improving smoothness, but also increase latency and memory usage.
  25644. </p>
  25645. <p>Defaults to <code>2.0</code>.
  25646. </p>
  25647. </dd>
  25648. </dl>
  25649. <a name="Examples-128"></a>
  25650. <h4 class="subsection">12.6.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>
  25651. <ul>
  25652. <li> Stabilize a video with a fixed, medium smoothing strength:
  25653. <div class="example">
  25654. <pre class="example">-i INPUT -vf &quot;hwupload, deshake_opencl=smooth_strength=0.5, hwdownload&quot; OUTPUT
  25655. </pre></div>
  25656. </li><li> Stabilize a video with debugging (both in console and in rendered video):
  25657. <div class="example">
  25658. <pre class="example">-i INPUT -filter_complex &quot;[0:v]format=rgba, hwupload, deshake_opencl=debug=1, hwdownload, format=rgba, format=yuv420p&quot; -v verbose OUTPUT
  25659. </pre></div>
  25660. </li></ul>
  25661. <a name="dilation_005fopencl"></a>
  25662. <h3 class="section">12.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>
  25663. <p>Apply dilation effect to the video.
  25664. </p>
  25665. <p>This filter replaces the pixel by the local(3x3) maximum.
  25666. </p>
  25667. <p>It accepts the following options:
  25668. </p>
  25669. <dl compact="compact">
  25670. <dt><samp>threshold0</samp></dt>
  25671. <dt><samp>threshold1</samp></dt>
  25672. <dt><samp>threshold2</samp></dt>
  25673. <dt><samp>threshold3</samp></dt>
  25674. <dd><p>Limit the maximum change for each plane. Range is <code>[0, 65535]</code> and default value is <code>65535</code>.
  25675. If <code>0</code>, plane will remain unchanged.
  25676. </p>
  25677. </dd>
  25678. <dt><samp>coordinates</samp></dt>
  25679. <dd><p>Flag which specifies the pixel to refer to.
  25680. Range is <code>[0, 255]</code> and default value is <code>255</code>, i.e. all eight pixels are used.
  25681. </p>
  25682. <p>Flags to local 3x3 coordinates region centered on <code>x</code>:
  25683. </p>
  25684. <p>1 2 3
  25685. </p>
  25686. <p>4 x 5
  25687. </p>
  25688. <p>6 7 8
  25689. </p></dd>
  25690. </dl>
  25691. <a name="Example-2"></a>
  25692. <h4 class="subsection">12.7.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>
  25693. <ul>
  25694. <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.
  25695. <div class="example">
  25696. <pre class="example">-i INPUT -vf &quot;hwupload, dilation_opencl=30:40:50:coordinates=231, hwdownload&quot; OUTPUT
  25697. </pre></div>
  25698. </li></ul>
  25699. <a name="nlmeans_005fopencl"></a>
  25700. <h3 class="section">12.8 nlmeans_opencl<span class="pull-right"><a class="anchor hidden-xs" href="#nlmeans_005fopencl" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-nlmeans_005fopencl" aria-hidden="true">TOC</a></span></h3>
  25701. <p>Non-local Means denoise filter through OpenCL, this filter accepts same options as <a href="#nlmeans">nlmeans</a>.
  25702. </p>
  25703. <a name="overlay_005fopencl"></a>
  25704. <h3 class="section">12.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>
  25705. <p>Overlay one video on top of another.
  25706. </p>
  25707. <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.
  25708. This filter requires same memory layout for all the inputs. So, format conversion may be needed.
  25709. </p>
  25710. <p>The filter accepts the following options:
  25711. </p>
  25712. <dl compact="compact">
  25713. <dt><samp>x</samp></dt>
  25714. <dd><p>Set the x coordinate of the overlaid video on the main video.
  25715. Default value is <code>0</code>.
  25716. </p>
  25717. </dd>
  25718. <dt><samp>y</samp></dt>
  25719. <dd><p>Set the y coordinate of the overlaid video on the main video.
  25720. Default value is <code>0</code>.
  25721. </p>
  25722. </dd>
  25723. </dl>
  25724. <a name="Examples-129"></a>
  25725. <h4 class="subsection">12.9.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>
  25726. <ul>
  25727. <li> Overlay an image LOGO at the top-left corner of the INPUT video. Both inputs are yuv420p format.
  25728. <div class="example">
  25729. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuv420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  25730. </pre></div>
  25731. </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.
  25732. <div class="example">
  25733. <pre class="example">-i INPUT -i LOGO -filter_complex &quot;[0:v]hwupload[a], [1:v]format=yuva420p, hwupload[b], [a][b]overlay_opencl, hwdownload&quot; OUTPUT
  25734. </pre></div>
  25735. </li></ul>
  25736. <a name="pad_005fopencl"></a>
  25737. <h3 class="section">12.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>
  25738. <p>Add paddings to the input image, and place the original input at the
  25739. provided <var>x</var>, <var>y</var> coordinates.
  25740. </p>
  25741. <p>It accepts the following options:
  25742. </p>
  25743. <dl compact="compact">
  25744. <dt><samp>width, w</samp></dt>
  25745. <dt><samp>height, h</samp></dt>
  25746. <dd><p>Specify an expression for the size of the output image with the
  25747. paddings added. If the value for <var>width</var> or <var>height</var> is 0, the
  25748. corresponding input size is used for the output.
  25749. </p>
  25750. <p>The <var>width</var> expression can reference the value set by the
  25751. <var>height</var> expression, and vice versa.
  25752. </p>
  25753. <p>The default value of <var>width</var> and <var>height</var> is 0.
  25754. </p>
  25755. </dd>
  25756. <dt><samp>x</samp></dt>
  25757. <dt><samp>y</samp></dt>
  25758. <dd><p>Specify the offsets to place the input image at within the padded area,
  25759. with respect to the top/left border of the output image.
  25760. </p>
  25761. <p>The <var>x</var> expression can reference the value set by the <var>y</var>
  25762. expression, and vice versa.
  25763. </p>
  25764. <p>The default value of <var>x</var> and <var>y</var> is 0.
  25765. </p>
  25766. <p>If <var>x</var> or <var>y</var> evaluate to a negative number, they&rsquo;ll be changed
  25767. so the input image is centered on the padded area.
  25768. </p>
  25769. </dd>
  25770. <dt><samp>color</samp></dt>
  25771. <dd><p>Specify the color of the padded area. For the syntax of this option,
  25772. check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils
  25773. manual</a>.
  25774. </p>
  25775. </dd>
  25776. <dt><samp>aspect</samp></dt>
  25777. <dd><p>Pad to an aspect instead to a resolution.
  25778. </p></dd>
  25779. </dl>
  25780. <p>The value for the <var>width</var>, <var>height</var>, <var>x</var>, and <var>y</var>
  25781. options are expressions containing the following constants:
  25782. </p>
  25783. <dl compact="compact">
  25784. <dt><samp>in_w</samp></dt>
  25785. <dt><samp>in_h</samp></dt>
  25786. <dd><p>The input video width and height.
  25787. </p>
  25788. </dd>
  25789. <dt><samp>iw</samp></dt>
  25790. <dt><samp>ih</samp></dt>
  25791. <dd><p>These are the same as <var>in_w</var> and <var>in_h</var>.
  25792. </p>
  25793. </dd>
  25794. <dt><samp>out_w</samp></dt>
  25795. <dt><samp>out_h</samp></dt>
  25796. <dd><p>The output width and height (the size of the padded area), as
  25797. specified by the <var>width</var> and <var>height</var> expressions.
  25798. </p>
  25799. </dd>
  25800. <dt><samp>ow</samp></dt>
  25801. <dt><samp>oh</samp></dt>
  25802. <dd><p>These are the same as <var>out_w</var> and <var>out_h</var>.
  25803. </p>
  25804. </dd>
  25805. <dt><samp>x</samp></dt>
  25806. <dt><samp>y</samp></dt>
  25807. <dd><p>The x and y offsets as specified by the <var>x</var> and <var>y</var>
  25808. expressions, or NAN if not yet specified.
  25809. </p>
  25810. </dd>
  25811. <dt><samp>a</samp></dt>
  25812. <dd><p>same as <var>iw</var> / <var>ih</var>
  25813. </p>
  25814. </dd>
  25815. <dt><samp>sar</samp></dt>
  25816. <dd><p>input sample aspect ratio
  25817. </p>
  25818. </dd>
  25819. <dt><samp>dar</samp></dt>
  25820. <dd><p>input display aspect ratio, it is the same as (<var>iw</var> / <var>ih</var>) * <var>sar</var>
  25821. </p></dd>
  25822. </dl>
  25823. <a name="prewitt_005fopencl"></a>
  25824. <h3 class="section">12.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>
  25825. <p>Apply the Prewitt operator (<a href="https://en.wikipedia.org/wiki/Prewitt_operator">https://en.wikipedia.org/wiki/Prewitt_operator</a>) to input video stream.
  25826. </p>
  25827. <p>The filter accepts the following option:
  25828. </p>
  25829. <dl compact="compact">
  25830. <dt><samp>planes</samp></dt>
  25831. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  25832. </p>
  25833. </dd>
  25834. <dt><samp>scale</samp></dt>
  25835. <dd><p>Set value which will be multiplied with filtered result.
  25836. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  25837. </p>
  25838. </dd>
  25839. <dt><samp>delta</samp></dt>
  25840. <dd><p>Set value which will be added to filtered result.
  25841. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  25842. </p></dd>
  25843. </dl>
  25844. <a name="Example-3"></a>
  25845. <h4 class="subsection">12.11.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>
  25846. <ul>
  25847. <li> Apply the Prewitt operator with scale set to 2 and delta set to 10.
  25848. <div class="example">
  25849. <pre class="example">-i INPUT -vf &quot;hwupload, prewitt_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  25850. </pre></div>
  25851. </li></ul>
  25852. <span id="program_005fopencl"></span><a name="program_005fopencl-1"></a>
  25853. <h3 class="section">12.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>
  25854. <p>Filter video using an OpenCL program.
  25855. </p>
  25856. <dl compact="compact">
  25857. <dt><samp>source</samp></dt>
  25858. <dd><p>OpenCL program source file.
  25859. </p>
  25860. </dd>
  25861. <dt><samp>kernel</samp></dt>
  25862. <dd><p>Kernel name in program.
  25863. </p>
  25864. </dd>
  25865. <dt><samp>inputs</samp></dt>
  25866. <dd><p>Number of inputs to the filter. Defaults to 1.
  25867. </p>
  25868. </dd>
  25869. <dt><samp>size, s</samp></dt>
  25870. <dd><p>Size of output frames. Defaults to the same as the first input.
  25871. </p>
  25872. </dd>
  25873. </dl>
  25874. <p>The <code>program_opencl</code> filter also supports the <a href="#framesync">framesync</a> options.
  25875. </p>
  25876. <p>The program source file must contain a kernel function with the given name,
  25877. which will be run once for each plane of the output. Each run on a plane
  25878. gets enqueued as a separate 2D global NDRange with one work-item for each
  25879. pixel to be generated. The global ID offset for each work-item is therefore
  25880. the coordinates of a pixel in the destination image.
  25881. </p>
  25882. <p>The kernel function needs to take the following arguments:
  25883. </p><ul>
  25884. <li> Destination image, <var>__write_only image2d_t</var>.
  25885. <p>This image will become the output; the kernel should write all of it.
  25886. </p></li><li> Frame index, <var>unsigned int</var>.
  25887. <p>This is a counter starting from zero and increasing by one for each frame.
  25888. </p></li><li> Source images, <var>__read_only image2d_t</var>.
  25889. <p>These are the most recent images on each input. The kernel may read from
  25890. them to generate the output, but they can&rsquo;t be written to.
  25891. </p></li></ul>
  25892. <p>Example programs:
  25893. </p>
  25894. <ul>
  25895. <li> Copy the input to the output (output must be the same size as the input).
  25896. <pre class="verbatim">__kernel void copy(__write_only image2d_t destination,
  25897. unsigned int index,
  25898. __read_only image2d_t source)
  25899. {
  25900. const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE;
  25901. int2 location = (int2)(get_global_id(0), get_global_id(1));
  25902. float4 value = read_imagef(source, sampler, location);
  25903. write_imagef(destination, location, value);
  25904. }
  25905. </pre>
  25906. </li><li> Apply a simple transformation, rotating the input by an amount increasing
  25907. with the index counter. Pixel values are linearly interpolated by the
  25908. sampler, and the output need not have the same dimensions as the input.
  25909. <pre class="verbatim">__kernel void rotate_image(__write_only image2d_t dst,
  25910. unsigned int index,
  25911. __read_only image2d_t src)
  25912. {
  25913. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  25914. CLK_FILTER_LINEAR);
  25915. float angle = (float)index / 100.0f;
  25916. float2 dst_dim = convert_float2(get_image_dim(dst));
  25917. float2 src_dim = convert_float2(get_image_dim(src));
  25918. float2 dst_cen = dst_dim / 2.0f;
  25919. float2 src_cen = src_dim / 2.0f;
  25920. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  25921. float2 dst_pos = convert_float2(dst_loc) - dst_cen;
  25922. float2 src_pos = {
  25923. cos(angle) * dst_pos.x - sin(angle) * dst_pos.y,
  25924. sin(angle) * dst_pos.x + cos(angle) * dst_pos.y
  25925. };
  25926. src_pos = src_pos * src_dim / dst_dim;
  25927. float2 src_loc = src_pos + src_cen;
  25928. if (src_loc.x &lt; 0.0f || src_loc.y &lt; 0.0f ||
  25929. src_loc.x &gt; src_dim.x || src_loc.y &gt; src_dim.y)
  25930. write_imagef(dst, dst_loc, 0.5f);
  25931. else
  25932. write_imagef(dst, dst_loc, read_imagef(src, sampler, src_loc));
  25933. }
  25934. </pre>
  25935. </li><li> Blend two inputs together, with the amount of each input used varying
  25936. with the index counter.
  25937. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  25938. unsigned int index,
  25939. __read_only image2d_t src1,
  25940. __read_only image2d_t src2)
  25941. {
  25942. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  25943. CLK_FILTER_LINEAR);
  25944. float blend = (cos((float)index / 50.0f) + 1.0f) / 2.0f;
  25945. int2 dst_loc = (int2)(get_global_id(0), get_global_id(1));
  25946. int2 src1_loc = dst_loc * get_image_dim(src1) / get_image_dim(dst);
  25947. int2 src2_loc = dst_loc * get_image_dim(src2) / get_image_dim(dst);
  25948. float4 val1 = read_imagef(src1, sampler, src1_loc);
  25949. float4 val2 = read_imagef(src2, sampler, src2_loc);
  25950. write_imagef(dst, dst_loc, val1 * blend + val2 * (1.0f - blend));
  25951. }
  25952. </pre>
  25953. </li></ul>
  25954. <a name="roberts_005fopencl"></a>
  25955. <h3 class="section">12.13 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>
  25956. <p>Apply the Roberts cross operator (<a href="https://en.wikipedia.org/wiki/Roberts_cross">https://en.wikipedia.org/wiki/Roberts_cross</a>) to input video stream.
  25957. </p>
  25958. <p>The filter accepts the following option:
  25959. </p>
  25960. <dl compact="compact">
  25961. <dt><samp>planes</samp></dt>
  25962. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  25963. </p>
  25964. </dd>
  25965. <dt><samp>scale</samp></dt>
  25966. <dd><p>Set value which will be multiplied with filtered result.
  25967. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  25968. </p>
  25969. </dd>
  25970. <dt><samp>delta</samp></dt>
  25971. <dd><p>Set value which will be added to filtered result.
  25972. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  25973. </p></dd>
  25974. </dl>
  25975. <a name="Example-4"></a>
  25976. <h4 class="subsection">12.13.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>
  25977. <ul>
  25978. <li> Apply the Roberts cross operator with scale set to 2 and delta set to 10
  25979. <div class="example">
  25980. <pre class="example">-i INPUT -vf &quot;hwupload, roberts_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  25981. </pre></div>
  25982. </li></ul>
  25983. <a name="sobel_005fopencl"></a>
  25984. <h3 class="section">12.14 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>
  25985. <p>Apply the Sobel operator (<a href="https://en.wikipedia.org/wiki/Sobel_operator">https://en.wikipedia.org/wiki/Sobel_operator</a>) to input video stream.
  25986. </p>
  25987. <p>The filter accepts the following option:
  25988. </p>
  25989. <dl compact="compact">
  25990. <dt><samp>planes</samp></dt>
  25991. <dd><p>Set which planes to filter. Default value is <code>0xf</code>, by which all planes are processed.
  25992. </p>
  25993. </dd>
  25994. <dt><samp>scale</samp></dt>
  25995. <dd><p>Set value which will be multiplied with filtered result.
  25996. Range is <code>[0.0, 65535]</code> and default value is <code>1.0</code>.
  25997. </p>
  25998. </dd>
  25999. <dt><samp>delta</samp></dt>
  26000. <dd><p>Set value which will be added to filtered result.
  26001. Range is <code>[-65535, 65535]</code> and default value is <code>0.0</code>.
  26002. </p></dd>
  26003. </dl>
  26004. <a name="Example-5"></a>
  26005. <h4 class="subsection">12.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>
  26006. <ul>
  26007. <li> Apply sobel operator with scale set to 2 and delta set to 10
  26008. <div class="example">
  26009. <pre class="example">-i INPUT -vf &quot;hwupload, sobel_opencl=scale=2:delta=10, hwdownload&quot; OUTPUT
  26010. </pre></div>
  26011. </li></ul>
  26012. <a name="tonemap_005fopencl"></a>
  26013. <h3 class="section">12.15 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>
  26014. <p>Perform HDR(PQ/HLG) to SDR conversion with tone-mapping.
  26015. </p>
  26016. <p>It accepts the following parameters:
  26017. </p>
  26018. <dl compact="compact">
  26019. <dt><samp>tonemap</samp></dt>
  26020. <dd><p>Specify the tone-mapping operator to be used. Same as tonemap option in <a href="#tonemap">tonemap</a>.
  26021. </p>
  26022. </dd>
  26023. <dt><samp>param</samp></dt>
  26024. <dd><p>Tune the tone mapping algorithm. same as param option in <a href="#tonemap">tonemap</a>.
  26025. </p>
  26026. </dd>
  26027. <dt><samp>desat</samp></dt>
  26028. <dd><p>Apply desaturation for highlights that exceed this level of brightness. The
  26029. higher the parameter, the more color information will be preserved. This
  26030. setting helps prevent unnaturally blown-out colors for super-highlights, by
  26031. (smoothly) turning into white instead. This makes images feel more natural,
  26032. at the cost of reducing information about out-of-range colors.
  26033. </p>
  26034. <p>The default value is 0.5, and the algorithm here is a little different from
  26035. the cpu version tonemap currently. A setting of 0.0 disables this option.
  26036. </p>
  26037. </dd>
  26038. <dt><samp>threshold</samp></dt>
  26039. <dd><p>The tonemapping algorithm parameters is fine-tuned per each scene. And a threshold
  26040. is used to detect whether the scene has changed or not. If the distance between
  26041. the current frame average brightness and the current running average exceeds
  26042. a threshold value, we would re-calculate scene average and peak brightness.
  26043. The default value is 0.2.
  26044. </p>
  26045. </dd>
  26046. <dt><samp>format</samp></dt>
  26047. <dd><p>Specify the output pixel format.
  26048. </p>
  26049. <p>Currently supported formats are:
  26050. </p><dl compact="compact">
  26051. <dt><var>p010</var></dt>
  26052. <dt><var>nv12</var></dt>
  26053. </dl>
  26054. </dd>
  26055. <dt><samp>range, r</samp></dt>
  26056. <dd><p>Set the output color range.
  26057. </p>
  26058. <p>Possible values are:
  26059. </p><dl compact="compact">
  26060. <dt><var>tv/mpeg</var></dt>
  26061. <dt><var>pc/jpeg</var></dt>
  26062. </dl>
  26063. <p>Default is same as input.
  26064. </p>
  26065. </dd>
  26066. <dt><samp>primaries, p</samp></dt>
  26067. <dd><p>Set the output color primaries.
  26068. </p>
  26069. <p>Possible values are:
  26070. </p><dl compact="compact">
  26071. <dt><var>bt709</var></dt>
  26072. <dt><var>bt2020</var></dt>
  26073. </dl>
  26074. <p>Default is same as input.
  26075. </p>
  26076. </dd>
  26077. <dt><samp>transfer, t</samp></dt>
  26078. <dd><p>Set the output transfer characteristics.
  26079. </p>
  26080. <p>Possible values are:
  26081. </p><dl compact="compact">
  26082. <dt><var>bt709</var></dt>
  26083. <dt><var>bt2020</var></dt>
  26084. </dl>
  26085. <p>Default is bt709.
  26086. </p>
  26087. </dd>
  26088. <dt><samp>matrix, m</samp></dt>
  26089. <dd><p>Set the output colorspace matrix.
  26090. </p>
  26091. <p>Possible value are:
  26092. </p><dl compact="compact">
  26093. <dt><var>bt709</var></dt>
  26094. <dt><var>bt2020</var></dt>
  26095. </dl>
  26096. <p>Default is same as input.
  26097. </p>
  26098. </dd>
  26099. </dl>
  26100. <a name="Example-6"></a>
  26101. <h4 class="subsection">12.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>
  26102. <ul>
  26103. <li> Convert HDR(PQ/HLG) video to bt2020-transfer-characteristic p010 format using linear operator.
  26104. <div class="example">
  26105. <pre class="example">-i INPUT -vf &quot;format=p010,hwupload,tonemap_opencl=t=bt2020:tonemap=linear:format=p010,hwdownload,format=p010&quot; OUTPUT
  26106. </pre></div>
  26107. </li></ul>
  26108. <a name="unsharp_005fopencl"></a>
  26109. <h3 class="section">12.16 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>
  26110. <p>Sharpen or blur the input video.
  26111. </p>
  26112. <p>It accepts the following parameters:
  26113. </p>
  26114. <dl compact="compact">
  26115. <dt><samp>luma_msize_x, lx</samp></dt>
  26116. <dd><p>Set the luma matrix horizontal size.
  26117. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  26118. </p>
  26119. </dd>
  26120. <dt><samp>luma_msize_y, ly</samp></dt>
  26121. <dd><p>Set the luma matrix vertical size.
  26122. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  26123. </p>
  26124. </dd>
  26125. <dt><samp>luma_amount, la</samp></dt>
  26126. <dd><p>Set the luma effect strength.
  26127. Range is <code>[-10, 10]</code> and default value is <code>1.0</code>.
  26128. </p>
  26129. <p>Negative values will blur the input video, while positive values will
  26130. sharpen it, a value of zero will disable the effect.
  26131. </p>
  26132. </dd>
  26133. <dt><samp>chroma_msize_x, cx</samp></dt>
  26134. <dd><p>Set the chroma matrix horizontal size.
  26135. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  26136. </p>
  26137. </dd>
  26138. <dt><samp>chroma_msize_y, cy</samp></dt>
  26139. <dd><p>Set the chroma matrix vertical size.
  26140. Range is <code>[1, 23]</code> and default value is <code>5</code>.
  26141. </p>
  26142. </dd>
  26143. <dt><samp>chroma_amount, ca</samp></dt>
  26144. <dd><p>Set the chroma effect strength.
  26145. Range is <code>[-10, 10]</code> and default value is <code>0.0</code>.
  26146. </p>
  26147. <p>Negative values will blur the input video, while positive values will
  26148. sharpen it, a value of zero will disable the effect.
  26149. </p>
  26150. </dd>
  26151. </dl>
  26152. <p>All parameters are optional and default to the equivalent of the
  26153. string &rsquo;5:5:1.0:5:5:0.0&rsquo;.
  26154. </p>
  26155. <a name="Examples-130"></a>
  26156. <h4 class="subsection">12.16.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>
  26157. <ul>
  26158. <li> Apply strong luma sharpen effect:
  26159. <div class="example">
  26160. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=luma_msize_x=7:luma_msize_y=7:luma_amount=2.5, hwdownload&quot; OUTPUT
  26161. </pre></div>
  26162. </li><li> Apply a strong blur of both luma and chroma parameters:
  26163. <div class="example">
  26164. <pre class="example">-i INPUT -vf &quot;hwupload, unsharp_opencl=7:7:-2:7:7:-2, hwdownload&quot; OUTPUT
  26165. </pre></div>
  26166. </li></ul>
  26167. <a name="xfade_005fopencl"></a>
  26168. <h3 class="section">12.17 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>
  26169. <p>Cross fade two videos with custom transition effect by using OpenCL.
  26170. </p>
  26171. <p>It accepts the following options:
  26172. </p>
  26173. <dl compact="compact">
  26174. <dt><samp>transition</samp></dt>
  26175. <dd><p>Set one of possible transition effects.
  26176. </p>
  26177. <dl compact="compact">
  26178. <dt><samp>custom</samp></dt>
  26179. <dd><p>Select custom transition effect, the actual transition description
  26180. will be picked from source and kernel options.
  26181. </p>
  26182. </dd>
  26183. <dt><samp>fade</samp></dt>
  26184. <dt><samp>wipeleft</samp></dt>
  26185. <dt><samp>wiperight</samp></dt>
  26186. <dt><samp>wipeup</samp></dt>
  26187. <dt><samp>wipedown</samp></dt>
  26188. <dt><samp>slideleft</samp></dt>
  26189. <dt><samp>slideright</samp></dt>
  26190. <dt><samp>slideup</samp></dt>
  26191. <dt><samp>slidedown</samp></dt>
  26192. <dd>
  26193. <p>Default transition is fade.
  26194. </p></dd>
  26195. </dl>
  26196. </dd>
  26197. <dt><samp>source</samp></dt>
  26198. <dd><p>OpenCL program source file for custom transition.
  26199. </p>
  26200. </dd>
  26201. <dt><samp>kernel</samp></dt>
  26202. <dd><p>Set name of kernel to use for custom transition from program source file.
  26203. </p>
  26204. </dd>
  26205. <dt><samp>duration</samp></dt>
  26206. <dd><p>Set duration of video transition.
  26207. </p>
  26208. </dd>
  26209. <dt><samp>offset</samp></dt>
  26210. <dd><p>Set time of start of transition relative to first video.
  26211. </p></dd>
  26212. </dl>
  26213. <p>The program source file must contain a kernel function with the given name,
  26214. which will be run once for each plane of the output. Each run on a plane
  26215. gets enqueued as a separate 2D global NDRange with one work-item for each
  26216. pixel to be generated. The global ID offset for each work-item is therefore
  26217. the coordinates of a pixel in the destination image.
  26218. </p>
  26219. <p>The kernel function needs to take the following arguments:
  26220. </p><ul>
  26221. <li> Destination image, <var>__write_only image2d_t</var>.
  26222. <p>This image will become the output; the kernel should write all of it.
  26223. </p>
  26224. </li><li> First Source image, <var>__read_only image2d_t</var>.
  26225. Second Source image, <var>__read_only image2d_t</var>.
  26226. <p>These are the most recent images on each input. The kernel may read from
  26227. them to generate the output, but they can&rsquo;t be written to.
  26228. </p>
  26229. </li><li> Transition progress, <var>float</var>. This value is always between 0 and 1 inclusive.
  26230. </li></ul>
  26231. <p>Example programs:
  26232. </p>
  26233. <ul>
  26234. <li> Apply dots curtain transition effect:
  26235. <pre class="verbatim">__kernel void blend_images(__write_only image2d_t dst,
  26236. __read_only image2d_t src1,
  26237. __read_only image2d_t src2,
  26238. float progress)
  26239. {
  26240. const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
  26241. CLK_FILTER_LINEAR);
  26242. int2 p = (int2)(get_global_id(0), get_global_id(1));
  26243. float2 rp = (float2)(get_global_id(0), get_global_id(1));
  26244. float2 dim = (float2)(get_image_dim(src1).x, get_image_dim(src1).y);
  26245. rp = rp / dim;
  26246. float2 dots = (float2)(20.0, 20.0);
  26247. float2 center = (float2)(0,0);
  26248. float2 unused;
  26249. float4 val1 = read_imagef(src1, sampler, p);
  26250. float4 val2 = read_imagef(src2, sampler, p);
  26251. bool next = distance(fract(rp * dots, &amp;unused), (float2)(0.5, 0.5)) &lt; (progress / distance(rp, center));
  26252. write_imagef(dst, p, next ? val1 : val2);
  26253. }
  26254. </pre>
  26255. </li></ul>
  26256. <a name="VAAPI-Video-Filters"></a>
  26257. <h2 class="chapter">13 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>
  26258. <p>VAAPI Video filters are usually used with VAAPI decoder and VAAPI encoder. Below is a description of VAAPI video filters.
  26259. </p>
  26260. <p>To enable compilation of these filters you need to configure FFmpeg with
  26261. <code>--enable-vaapi</code>.
  26262. </p>
  26263. <p>To use vaapi filters, you need to setup the vaapi device correctly. For more information, please read <a href="https://trac.ffmpeg.org/wiki/Hardware/VAAPI">https://trac.ffmpeg.org/wiki/Hardware/VAAPI</a>
  26264. </p>
  26265. <a name="tonemap_005fvaapi"></a>
  26266. <h3 class="section">13.1 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>
  26267. <p>Perform HDR(High Dynamic Range) to SDR(Standard Dynamic Range) conversion with tone-mapping.
  26268. It maps the dynamic range of HDR10 content to the SDR content.
  26269. It currently only accepts HDR10 as input.
  26270. </p>
  26271. <p>It accepts the following parameters:
  26272. </p>
  26273. <dl compact="compact">
  26274. <dt><samp>format</samp></dt>
  26275. <dd><p>Specify the output pixel format.
  26276. </p>
  26277. <p>Currently supported formats are:
  26278. </p><dl compact="compact">
  26279. <dt><var>p010</var></dt>
  26280. <dt><var>nv12</var></dt>
  26281. </dl>
  26282. <p>Default is nv12.
  26283. </p>
  26284. </dd>
  26285. <dt><samp>primaries, p</samp></dt>
  26286. <dd><p>Set the output color primaries.
  26287. </p>
  26288. <p>Default is same as input.
  26289. </p>
  26290. </dd>
  26291. <dt><samp>transfer, t</samp></dt>
  26292. <dd><p>Set the output transfer characteristics.
  26293. </p>
  26294. <p>Default is bt709.
  26295. </p>
  26296. </dd>
  26297. <dt><samp>matrix, m</samp></dt>
  26298. <dd><p>Set the output colorspace matrix.
  26299. </p>
  26300. <p>Default is same as input.
  26301. </p>
  26302. </dd>
  26303. </dl>
  26304. <a name="Example-7"></a>
  26305. <h4 class="subsection">13.1.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>
  26306. <ul>
  26307. <li> Convert HDR(HDR10) video to bt2020-transfer-characteristic p010 format
  26308. <div class="example">
  26309. <pre class="example">tonemap_vaapi=format=p010:t=bt2020-10
  26310. </pre></div>
  26311. </li></ul>
  26312. <a name="Video-Sources"></a>
  26313. <h2 class="chapter">14 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>
  26314. <p>Below is a description of the currently available video sources.
  26315. </p>
  26316. <a name="buffer"></a>
  26317. <h3 class="section">14.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>
  26318. <p>Buffer video frames, and make them available to the filter chain.
  26319. </p>
  26320. <p>This source is mainly intended for a programmatic use, in particular
  26321. through the interface defined in <samp>libavfilter/buffersrc.h</samp>.
  26322. </p>
  26323. <p>It accepts the following parameters:
  26324. </p>
  26325. <dl compact="compact">
  26326. <dt><samp>video_size</samp></dt>
  26327. <dd><p>Specify the size (width and height) of the buffered video frames. For the
  26328. syntax of this option, check the
  26329. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26330. </p>
  26331. </dd>
  26332. <dt><samp>width</samp></dt>
  26333. <dd><p>The input video width.
  26334. </p>
  26335. </dd>
  26336. <dt><samp>height</samp></dt>
  26337. <dd><p>The input video height.
  26338. </p>
  26339. </dd>
  26340. <dt><samp>pix_fmt</samp></dt>
  26341. <dd><p>A string representing the pixel format of the buffered video frames.
  26342. It may be a number corresponding to a pixel format, or a pixel format
  26343. name.
  26344. </p>
  26345. </dd>
  26346. <dt><samp>time_base</samp></dt>
  26347. <dd><p>Specify the timebase assumed by the timestamps of the buffered frames.
  26348. </p>
  26349. </dd>
  26350. <dt><samp>frame_rate</samp></dt>
  26351. <dd><p>Specify the frame rate expected for the video stream.
  26352. </p>
  26353. </dd>
  26354. <dt><samp>pixel_aspect, sar</samp></dt>
  26355. <dd><p>The sample (pixel) aspect ratio of the input video.
  26356. </p>
  26357. </dd>
  26358. <dt><samp>sws_param</samp></dt>
  26359. <dd><p>This option is deprecated and ignored. Prepend <code>sws_flags=<var>flags</var>;</code>
  26360. to the filtergraph description to specify swscale flags for automatically
  26361. inserted scalers. See <a href="#Filtergraph-syntax">Filtergraph syntax</a>.
  26362. </p>
  26363. </dd>
  26364. <dt><samp>hw_frames_ctx</samp></dt>
  26365. <dd><p>When using a hardware pixel format, this should be a reference to an
  26366. AVHWFramesContext describing input frames.
  26367. </p></dd>
  26368. </dl>
  26369. <p>For example:
  26370. </p><div class="example">
  26371. <pre class="example">buffer=width=320:height=240:pix_fmt=yuv410p:time_base=1/24:sar=1
  26372. </pre></div>
  26373. <p>will instruct the source to accept video frames with size 320x240 and
  26374. with format &quot;yuv410p&quot;, assuming 1/24 as the timestamps timebase and
  26375. square pixels (1:1 sample aspect ratio).
  26376. Since the pixel format with name &quot;yuv410p&quot; corresponds to the number 6
  26377. (check the enum AVPixelFormat definition in <samp>libavutil/pixfmt.h</samp>),
  26378. this example corresponds to:
  26379. </p><div class="example">
  26380. <pre class="example">buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1
  26381. </pre></div>
  26382. <p>Alternatively, the options can be specified as a flat string, but this
  26383. syntax is deprecated:
  26384. </p>
  26385. <p><var>width</var>:<var>height</var>:<var>pix_fmt</var>:<var>time_base.num</var>:<var>time_base.den</var>:<var>pixel_aspect.num</var>:<var>pixel_aspect.den</var>
  26386. </p>
  26387. <a name="cellauto"></a>
  26388. <h3 class="section">14.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>
  26389. <p>Create a pattern generated by an elementary cellular automaton.
  26390. </p>
  26391. <p>The initial state of the cellular automaton can be defined through the
  26392. <samp>filename</samp> and <samp>pattern</samp> options. If such options are
  26393. not specified an initial state is created randomly.
  26394. </p>
  26395. <p>At each new frame a new row in the video is filled with the result of
  26396. the cellular automaton next generation. The behavior when the whole
  26397. frame is filled is defined by the <samp>scroll</samp> option.
  26398. </p>
  26399. <p>This source accepts the following options:
  26400. </p>
  26401. <dl compact="compact">
  26402. <dt><samp>filename, f</samp></dt>
  26403. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  26404. the specified file.
  26405. In the file, each non-whitespace character is considered an alive
  26406. cell, a newline will terminate the row, and further characters in the
  26407. file will be ignored.
  26408. </p>
  26409. </dd>
  26410. <dt><samp>pattern, p</samp></dt>
  26411. <dd><p>Read the initial cellular automaton state, i.e. the starting row, from
  26412. the specified string.
  26413. </p>
  26414. <p>Each non-whitespace character in the string is considered an alive
  26415. cell, a newline will terminate the row, and further characters in the
  26416. string will be ignored.
  26417. </p>
  26418. </dd>
  26419. <dt><samp>rate, r</samp></dt>
  26420. <dd><p>Set the video rate, that is the number of frames generated per second.
  26421. Default is 25.
  26422. </p>
  26423. </dd>
  26424. <dt><samp>random_fill_ratio, ratio</samp></dt>
  26425. <dd><p>Set the random fill ratio for the initial cellular automaton row. It
  26426. is a floating point number value ranging from 0 to 1, defaults to
  26427. 1/PHI.
  26428. </p>
  26429. <p>This option is ignored when a file or a pattern is specified.
  26430. </p>
  26431. </dd>
  26432. <dt><samp>random_seed, seed</samp></dt>
  26433. <dd><p>Set the seed for filling randomly the initial row, must be an integer
  26434. included between 0 and UINT32_MAX. If not specified, or if explicitly
  26435. set to -1, the filter will try to use a good random seed on a best
  26436. effort basis.
  26437. </p>
  26438. </dd>
  26439. <dt><samp>rule</samp></dt>
  26440. <dd><p>Set the cellular automaton rule, it is a number ranging from 0 to 255.
  26441. Default value is 110.
  26442. </p>
  26443. </dd>
  26444. <dt><samp>size, s</samp></dt>
  26445. <dd><p>Set the size of the output video. For the syntax of this option, check the
  26446. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26447. </p>
  26448. <p>If <samp>filename</samp> or <samp>pattern</samp> is specified, the size is set
  26449. by default to the width of the specified initial state row, and the
  26450. height is set to <var>width</var> * PHI.
  26451. </p>
  26452. <p>If <samp>size</samp> is set, it must contain the width of the specified
  26453. pattern string, and the specified pattern will be centered in the
  26454. larger row.
  26455. </p>
  26456. <p>If a filename or a pattern string is not specified, the size value
  26457. defaults to &quot;320x518&quot; (used for a randomly generated initial state).
  26458. </p>
  26459. </dd>
  26460. <dt><samp>scroll</samp></dt>
  26461. <dd><p>If set to 1, scroll the output upward when all the rows in the output
  26462. have been already filled. If set to 0, the new generated row will be
  26463. written over the top row just after the bottom row is filled.
  26464. Defaults to 1.
  26465. </p>
  26466. </dd>
  26467. <dt><samp>start_full, full</samp></dt>
  26468. <dd><p>If set to 1, completely fill the output with generated rows before
  26469. outputting the first frame.
  26470. This is the default behavior, for disabling set the value to 0.
  26471. </p>
  26472. </dd>
  26473. <dt><samp>stitch</samp></dt>
  26474. <dd><p>If set to 1, stitch the left and right row edges together.
  26475. This is the default behavior, for disabling set the value to 0.
  26476. </p></dd>
  26477. </dl>
  26478. <a name="Examples-131"></a>
  26479. <h4 class="subsection">14.2.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>
  26480. <ul>
  26481. <li> Read the initial state from <samp>pattern</samp>, and specify an output of
  26482. size 200x400.
  26483. <div class="example">
  26484. <pre class="example">cellauto=f=pattern:s=200x400
  26485. </pre></div>
  26486. </li><li> Generate a random initial row with a width of 200 cells, with a fill
  26487. ratio of 2/3:
  26488. <div class="example">
  26489. <pre class="example">cellauto=ratio=2/3:s=200x200
  26490. </pre></div>
  26491. </li><li> Create a pattern generated by rule 18 starting by a single alive cell
  26492. centered on an initial row with width 100:
  26493. <div class="example">
  26494. <pre class="example">cellauto=p=@:s=100x400:full=0:rule=18
  26495. </pre></div>
  26496. </li><li> Specify a more elaborated initial pattern:
  26497. <div class="example">
  26498. <pre class="example">cellauto=p='@@ @ @@':s=100x400:full=0:rule=18
  26499. </pre></div>
  26500. </li></ul>
  26501. <span id="coreimagesrc"></span><a name="coreimagesrc-1"></a>
  26502. <h3 class="section">14.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>
  26503. <p>Video source generated on GPU using Apple&rsquo;s CoreImage API on OSX.
  26504. </p>
  26505. <p>This video source is a specialized version of the <a href="#coreimage">coreimage</a> video filter.
  26506. Use a core image generator at the beginning of the applied filterchain to
  26507. generate the content.
  26508. </p>
  26509. <p>The coreimagesrc video source accepts the following options:
  26510. </p><dl compact="compact">
  26511. <dt><samp>list_generators</samp></dt>
  26512. <dd><p>List all available generators along with all their respective options as well as
  26513. possible minimum and maximum values along with the default values.
  26514. </p><div class="example">
  26515. <pre class="example">list_generators=true
  26516. </pre></div>
  26517. </dd>
  26518. <dt><samp>size, s</samp></dt>
  26519. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  26520. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26521. The default value is <code>320x240</code>.
  26522. </p>
  26523. </dd>
  26524. <dt><samp>rate, r</samp></dt>
  26525. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  26526. generated per second. It has to be a string in the format
  26527. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  26528. number or a valid video frame rate abbreviation. The default value is
  26529. &quot;25&quot;.
  26530. </p>
  26531. </dd>
  26532. <dt><samp>sar</samp></dt>
  26533. <dd><p>Set the sample aspect ratio of the sourced video.
  26534. </p>
  26535. </dd>
  26536. <dt><samp>duration, d</samp></dt>
  26537. <dd><p>Set the duration of the sourced video. See
  26538. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26539. for the accepted syntax.
  26540. </p>
  26541. <p>If not specified, or the expressed duration is negative, the video is
  26542. supposed to be generated forever.
  26543. </p></dd>
  26544. </dl>
  26545. <p>Additionally, all options of the <a href="#coreimage">coreimage</a> video filter are accepted.
  26546. A complete filterchain can be used for further processing of the
  26547. generated input without CPU-HOST transfer. See <a href="#coreimage">coreimage</a> documentation
  26548. and examples for details.
  26549. </p>
  26550. <a name="Examples-132"></a>
  26551. <h4 class="subsection">14.3.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>
  26552. <ul>
  26553. <li> Use CIQRCodeGenerator to create a QR code for the FFmpeg homepage,
  26554. given as complete and escaped command-line for Apple&rsquo;s standard bash shell:
  26555. <div class="example">
  26556. <pre class="example">ffmpeg -f lavfi -i coreimagesrc=s=100x100:filter=CIQRCodeGenerator@inputMessage=https\\\\\://FFmpeg.org/@inputCorrectionLevel=H -frames:v 1 QRCode.png
  26557. </pre></div>
  26558. <p>This example is equivalent to the QRCode example of <a href="#coreimage">coreimage</a> without the
  26559. need for a nullsrc video source.
  26560. </p></li></ul>
  26561. <a name="gradients"></a>
  26562. <h3 class="section">14.4 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>
  26563. <p>Generate several gradients.
  26564. </p>
  26565. <dl compact="compact">
  26566. <dt><samp>size, s</samp></dt>
  26567. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  26568. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  26569. </p>
  26570. </dd>
  26571. <dt><samp>rate, r</samp></dt>
  26572. <dd><p>Set frame rate, expressed as number of frames per second. Default
  26573. value is &quot;25&quot;.
  26574. </p>
  26575. </dd>
  26576. <dt><samp>c0, c1, c2, c3, c4, c5, c6, c7</samp></dt>
  26577. <dd><p>Set 8 colors. Default values for colors is to pick random one.
  26578. </p>
  26579. </dd>
  26580. <dt><samp>x0, y0, y0, y1</samp></dt>
  26581. <dd><p>Set gradient line source and destination points. If negative or out of range, random ones
  26582. are picked.
  26583. </p>
  26584. </dd>
  26585. <dt><samp>nb_colors, n</samp></dt>
  26586. <dd><p>Set number of colors to use at once. Allowed range is from 2 to 8. Default value is 2.
  26587. </p>
  26588. </dd>
  26589. <dt><samp>seed</samp></dt>
  26590. <dd><p>Set seed for picking gradient line points.
  26591. </p>
  26592. </dd>
  26593. <dt><samp>duration, d</samp></dt>
  26594. <dd><p>Set the duration of the sourced video. See
  26595. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26596. for the accepted syntax.
  26597. </p>
  26598. <p>If not specified, or the expressed duration is negative, the video is
  26599. supposed to be generated forever.
  26600. </p>
  26601. </dd>
  26602. <dt><samp>speed</samp></dt>
  26603. <dd><p>Set speed of gradients rotation.
  26604. </p></dd>
  26605. </dl>
  26606. <a name="mandelbrot"></a>
  26607. <h3 class="section">14.5 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>
  26608. <p>Generate a Mandelbrot set fractal, and progressively zoom towards the
  26609. point specified with <var>start_x</var> and <var>start_y</var>.
  26610. </p>
  26611. <p>This source accepts the following options:
  26612. </p>
  26613. <dl compact="compact">
  26614. <dt><samp>end_pts</samp></dt>
  26615. <dd><p>Set the terminal pts value. Default value is 400.
  26616. </p>
  26617. </dd>
  26618. <dt><samp>end_scale</samp></dt>
  26619. <dd><p>Set the terminal scale value.
  26620. Must be a floating point value. Default value is 0.3.
  26621. </p>
  26622. </dd>
  26623. <dt><samp>inner</samp></dt>
  26624. <dd><p>Set the inner coloring mode, that is the algorithm used to draw the
  26625. Mandelbrot fractal internal region.
  26626. </p>
  26627. <p>It shall assume one of the following values:
  26628. </p><dl compact="compact">
  26629. <dt><samp>black</samp></dt>
  26630. <dd><p>Set black mode.
  26631. </p></dd>
  26632. <dt><samp>convergence</samp></dt>
  26633. <dd><p>Show time until convergence.
  26634. </p></dd>
  26635. <dt><samp>mincol</samp></dt>
  26636. <dd><p>Set color based on point closest to the origin of the iterations.
  26637. </p></dd>
  26638. <dt><samp>period</samp></dt>
  26639. <dd><p>Set period mode.
  26640. </p></dd>
  26641. </dl>
  26642. <p>Default value is <var>mincol</var>.
  26643. </p>
  26644. </dd>
  26645. <dt><samp>bailout</samp></dt>
  26646. <dd><p>Set the bailout value. Default value is 10.0.
  26647. </p>
  26648. </dd>
  26649. <dt><samp>maxiter</samp></dt>
  26650. <dd><p>Set the maximum of iterations performed by the rendering
  26651. algorithm. Default value is 7189.
  26652. </p>
  26653. </dd>
  26654. <dt><samp>outer</samp></dt>
  26655. <dd><p>Set outer coloring mode.
  26656. It shall assume one of following values:
  26657. </p><dl compact="compact">
  26658. <dt><samp>iteration_count</samp></dt>
  26659. <dd><p>Set iteration count mode.
  26660. </p></dd>
  26661. <dt><samp>normalized_iteration_count</samp></dt>
  26662. <dd><p>set normalized iteration count mode.
  26663. </p></dd>
  26664. </dl>
  26665. <p>Default value is <var>normalized_iteration_count</var>.
  26666. </p>
  26667. </dd>
  26668. <dt><samp>rate, r</samp></dt>
  26669. <dd><p>Set frame rate, expressed as number of frames per second. Default
  26670. value is &quot;25&quot;.
  26671. </p>
  26672. </dd>
  26673. <dt><samp>size, s</samp></dt>
  26674. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  26675. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  26676. </p>
  26677. </dd>
  26678. <dt><samp>start_scale</samp></dt>
  26679. <dd><p>Set the initial scale value. Default value is 3.0.
  26680. </p>
  26681. </dd>
  26682. <dt><samp>start_x</samp></dt>
  26683. <dd><p>Set the initial x position. Must be a floating point value between
  26684. -100 and 100. Default value is -0.743643887037158704752191506114774.
  26685. </p>
  26686. </dd>
  26687. <dt><samp>start_y</samp></dt>
  26688. <dd><p>Set the initial y position. Must be a floating point value between
  26689. -100 and 100. Default value is -0.131825904205311970493132056385139.
  26690. </p></dd>
  26691. </dl>
  26692. <a name="mptestsrc"></a>
  26693. <h3 class="section">14.6 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>
  26694. <p>Generate various test patterns, as generated by the MPlayer test filter.
  26695. </p>
  26696. <p>The size of the generated video is fixed, and is 256x256.
  26697. This source is useful in particular for testing encoding features.
  26698. </p>
  26699. <p>This source accepts the following options:
  26700. </p>
  26701. <dl compact="compact">
  26702. <dt><samp>rate, r</samp></dt>
  26703. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  26704. generated per second. It has to be a string in the format
  26705. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  26706. number or a valid video frame rate abbreviation. The default value is
  26707. &quot;25&quot;.
  26708. </p>
  26709. </dd>
  26710. <dt><samp>duration, d</samp></dt>
  26711. <dd><p>Set the duration of the sourced video. See
  26712. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26713. for the accepted syntax.
  26714. </p>
  26715. <p>If not specified, or the expressed duration is negative, the video is
  26716. supposed to be generated forever.
  26717. </p>
  26718. </dd>
  26719. <dt><samp>test, t</samp></dt>
  26720. <dd>
  26721. <p>Set the number or the name of the test to perform. Supported tests are:
  26722. </p><dl compact="compact">
  26723. <dt><samp>dc_luma</samp></dt>
  26724. <dt><samp>dc_chroma</samp></dt>
  26725. <dt><samp>freq_luma</samp></dt>
  26726. <dt><samp>freq_chroma</samp></dt>
  26727. <dt><samp>amp_luma</samp></dt>
  26728. <dt><samp>amp_chroma</samp></dt>
  26729. <dt><samp>cbp</samp></dt>
  26730. <dt><samp>mv</samp></dt>
  26731. <dt><samp>ring1</samp></dt>
  26732. <dt><samp>ring2</samp></dt>
  26733. <dt><samp>all</samp></dt>
  26734. <dt><samp>max_frames, m</samp></dt>
  26735. <dd><p>Set the maximum number of frames generated for each test, default value is 30.
  26736. </p>
  26737. </dd>
  26738. </dl>
  26739. <p>Default value is &quot;all&quot;, which will cycle through the list of all tests.
  26740. </p></dd>
  26741. </dl>
  26742. <p>Some examples:
  26743. </p><div class="example">
  26744. <pre class="example">mptestsrc=t=dc_luma
  26745. </pre></div>
  26746. <p>will generate a &quot;dc_luma&quot; test pattern.
  26747. </p>
  26748. <a name="frei0r_005fsrc"></a>
  26749. <h3 class="section">14.7 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>
  26750. <p>Provide a frei0r source.
  26751. </p>
  26752. <p>To enable compilation of this filter you need to install the frei0r
  26753. header and configure FFmpeg with <code>--enable-frei0r</code>.
  26754. </p>
  26755. <p>This source accepts the following parameters:
  26756. </p>
  26757. <dl compact="compact">
  26758. <dt><samp>size</samp></dt>
  26759. <dd><p>The size of the video to generate. For the syntax of this option, check the
  26760. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26761. </p>
  26762. </dd>
  26763. <dt><samp>framerate</samp></dt>
  26764. <dd><p>The framerate of the generated video. It may be a string of the form
  26765. <var>num</var>/<var>den</var> or a frame rate abbreviation.
  26766. </p>
  26767. </dd>
  26768. <dt><samp>filter_name</samp></dt>
  26769. <dd><p>The name to the frei0r source to load. For more information regarding frei0r and
  26770. how to set the parameters, read the <a href="#frei0r">frei0r</a> section in the video filters
  26771. documentation.
  26772. </p>
  26773. </dd>
  26774. <dt><samp>filter_params</samp></dt>
  26775. <dd><p>A &rsquo;|&rsquo;-separated list of parameters to pass to the frei0r source.
  26776. </p>
  26777. </dd>
  26778. </dl>
  26779. <p>For example, to generate a frei0r partik0l source with size 200x200
  26780. and frame rate 10 which is overlaid on the overlay filter main input:
  26781. </p><div class="example">
  26782. <pre class="example">frei0r_src=size=200x200:framerate=10:filter_name=partik0l:filter_params=1234 [overlay]; [in][overlay] overlay
  26783. </pre></div>
  26784. <a name="life"></a>
  26785. <h3 class="section">14.8 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>
  26786. <p>Generate a life pattern.
  26787. </p>
  26788. <p>This source is based on a generalization of John Conway&rsquo;s life game.
  26789. </p>
  26790. <p>The sourced input represents a life grid, each pixel represents a cell
  26791. which can be in one of two possible states, alive or dead. Every cell
  26792. interacts with its eight neighbours, which are the cells that are
  26793. horizontally, vertically, or diagonally adjacent.
  26794. </p>
  26795. <p>At each interaction the grid evolves according to the adopted rule,
  26796. which specifies the number of neighbor alive cells which will make a
  26797. cell stay alive or born. The <samp>rule</samp> option allows one to specify
  26798. the rule to adopt.
  26799. </p>
  26800. <p>This source accepts the following options:
  26801. </p>
  26802. <dl compact="compact">
  26803. <dt><samp>filename, f</samp></dt>
  26804. <dd><p>Set the file from which to read the initial grid state. In the file,
  26805. each non-whitespace character is considered an alive cell, and newline
  26806. is used to delimit the end of each row.
  26807. </p>
  26808. <p>If this option is not specified, the initial grid is generated
  26809. randomly.
  26810. </p>
  26811. </dd>
  26812. <dt><samp>rate, r</samp></dt>
  26813. <dd><p>Set the video rate, that is the number of frames generated per second.
  26814. Default is 25.
  26815. </p>
  26816. </dd>
  26817. <dt><samp>random_fill_ratio, ratio</samp></dt>
  26818. <dd><p>Set the random fill ratio for the initial random grid. It is a
  26819. floating point number value ranging from 0 to 1, defaults to 1/PHI.
  26820. It is ignored when a file is specified.
  26821. </p>
  26822. </dd>
  26823. <dt><samp>random_seed, seed</samp></dt>
  26824. <dd><p>Set the seed for filling the initial random grid, must be an integer
  26825. included between 0 and UINT32_MAX. If not specified, or if explicitly
  26826. set to -1, the filter will try to use a good random seed on a best
  26827. effort basis.
  26828. </p>
  26829. </dd>
  26830. <dt><samp>rule</samp></dt>
  26831. <dd><p>Set the life rule.
  26832. </p>
  26833. <p>A rule can be specified with a code of the kind &quot;S<var>NS</var>/B<var>NB</var>&quot;,
  26834. where <var>NS</var> and <var>NB</var> are sequences of numbers in the range 0-8,
  26835. <var>NS</var> specifies the number of alive neighbor cells which make a
  26836. live cell stay alive, and <var>NB</var> the number of alive neighbor cells
  26837. which make a dead cell to become alive (i.e. to &quot;born&quot;).
  26838. &quot;s&quot; and &quot;b&quot; can be used in place of &quot;S&quot; and &quot;B&quot;, respectively.
  26839. </p>
  26840. <p>Alternatively a rule can be specified by an 18-bits integer. The 9
  26841. high order bits are used to encode the next cell state if it is alive
  26842. for each number of neighbor alive cells, the low order bits specify
  26843. the rule for &quot;borning&quot; new cells. Higher order bits encode for an
  26844. higher number of neighbor cells.
  26845. For example the number 6153 = <code>(12&lt;&lt;9)+9</code> specifies a stay alive
  26846. rule of 12 and a born rule of 9, which corresponds to &quot;S23/B03&quot;.
  26847. </p>
  26848. <p>Default value is &quot;S23/B3&quot;, which is the original Conway&rsquo;s game of life
  26849. rule, and will keep a cell alive if it has 2 or 3 neighbor alive
  26850. cells, and will born a new cell if there are three alive cells around
  26851. a dead cell.
  26852. </p>
  26853. </dd>
  26854. <dt><samp>size, s</samp></dt>
  26855. <dd><p>Set the size of the output video. For the syntax of this option, check the
  26856. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26857. </p>
  26858. <p>If <samp>filename</samp> is specified, the size is set by default to the
  26859. same size of the input file. If <samp>size</samp> is set, it must contain
  26860. the size specified in the input file, and the initial grid defined in
  26861. that file is centered in the larger resulting area.
  26862. </p>
  26863. <p>If a filename is not specified, the size value defaults to &quot;320x240&quot;
  26864. (used for a randomly generated initial grid).
  26865. </p>
  26866. </dd>
  26867. <dt><samp>stitch</samp></dt>
  26868. <dd><p>If set to 1, stitch the left and right grid edges together, and the
  26869. top and bottom edges also. Defaults to 1.
  26870. </p>
  26871. </dd>
  26872. <dt><samp>mold</samp></dt>
  26873. <dd><p>Set cell mold speed. If set, a dead cell will go from <samp>death_color</samp> to
  26874. <samp>mold_color</samp> with a step of <samp>mold</samp>. <samp>mold</samp> can have a
  26875. value from 0 to 255.
  26876. </p>
  26877. </dd>
  26878. <dt><samp>life_color</samp></dt>
  26879. <dd><p>Set the color of living (or new born) cells.
  26880. </p>
  26881. </dd>
  26882. <dt><samp>death_color</samp></dt>
  26883. <dd><p>Set the color of dead cells. If <samp>mold</samp> is set, this is the first color
  26884. used to represent a dead cell.
  26885. </p>
  26886. </dd>
  26887. <dt><samp>mold_color</samp></dt>
  26888. <dd><p>Set mold color, for definitely dead and moldy cells.
  26889. </p>
  26890. <p>For the syntax of these 3 color options, check the <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the
  26891. ffmpeg-utils manual</a>.
  26892. </p></dd>
  26893. </dl>
  26894. <a name="Examples-133"></a>
  26895. <h4 class="subsection">14.8.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>
  26896. <ul>
  26897. <li> Read a grid from <samp>pattern</samp>, and center it on a grid of size
  26898. 300x300 pixels:
  26899. <div class="example">
  26900. <pre class="example">life=f=pattern:s=300x300
  26901. </pre></div>
  26902. </li><li> Generate a random grid of size 200x200, with a fill ratio of 2/3:
  26903. <div class="example">
  26904. <pre class="example">life=ratio=2/3:s=200x200
  26905. </pre></div>
  26906. </li><li> Specify a custom rule for evolving a randomly generated grid:
  26907. <div class="example">
  26908. <pre class="example">life=rule=S14/B34
  26909. </pre></div>
  26910. </li><li> Full example with slow death effect (mold) using <code>ffplay</code>:
  26911. <div class="example">
  26912. <pre class="example">ffplay -f lavfi life=s=300x200:mold=10:r=60:ratio=0.1:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16
  26913. </pre></div>
  26914. </li></ul>
  26915. <span id="allrgb"></span><span id="allyuv"></span><span id="color"></span><span id="haldclutsrc"></span><span id="nullsrc"></span><span id="pal75bars"></span><span id="pal100bars"></span><span id="rgbtestsrc"></span><span id="smptebars"></span><span id="smptehdbars"></span><span id="testsrc"></span><span id="testsrc2"></span><span id="yuvtestsrc"></span><a name="allrgb_002c-allyuv_002c-color_002c-haldclutsrc_002c-nullsrc_002c-pal75bars_002c-pal100bars_002c-rgbtestsrc_002c-smptebars_002c-smptehdbars_002c-testsrc_002c-testsrc2_002c-yuvtestsrc"></a>
  26916. <h3 class="section">14.9 allrgb, allyuv, color, 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-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-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>
  26917. <p>The <code>allrgb</code> source returns frames of size 4096x4096 of all rgb colors.
  26918. </p>
  26919. <p>The <code>allyuv</code> source returns frames of size 4096x4096 of all yuv colors.
  26920. </p>
  26921. <p>The <code>color</code> source provides an uniformly colored input.
  26922. </p>
  26923. <p>The <code>haldclutsrc</code> source provides an identity Hald CLUT. See also
  26924. <a href="#haldclut">haldclut</a> filter.
  26925. </p>
  26926. <p>The <code>nullsrc</code> source returns unprocessed video frames. It is
  26927. mainly useful to be employed in analysis / debugging tools, or as the
  26928. source for filters which ignore the input data.
  26929. </p>
  26930. <p>The <code>pal75bars</code> source generates a color bars pattern, based on
  26931. EBU PAL recommendations with 75% color levels.
  26932. </p>
  26933. <p>The <code>pal100bars</code> source generates a color bars pattern, based on
  26934. EBU PAL recommendations with 100% color levels.
  26935. </p>
  26936. <p>The <code>rgbtestsrc</code> source generates an RGB test pattern useful for
  26937. detecting RGB vs BGR issues. You should see a red, green and blue
  26938. stripe from top to bottom.
  26939. </p>
  26940. <p>The <code>smptebars</code> source generates a color bars pattern, based on
  26941. the SMPTE Engineering Guideline EG 1-1990.
  26942. </p>
  26943. <p>The <code>smptehdbars</code> source generates a color bars pattern, based on
  26944. the SMPTE RP 219-2002.
  26945. </p>
  26946. <p>The <code>testsrc</code> source generates a test video pattern, showing a
  26947. color pattern, a scrolling gradient and a timestamp. This is mainly
  26948. intended for testing purposes.
  26949. </p>
  26950. <p>The <code>testsrc2</code> source is similar to testsrc, but supports more
  26951. pixel formats instead of just <code>rgb24</code>. This allows using it as an
  26952. input for other tests without requiring a format conversion.
  26953. </p>
  26954. <p>The <code>yuvtestsrc</code> source generates an YUV test pattern. You should
  26955. see a y, cb and cr stripe from top to bottom.
  26956. </p>
  26957. <p>The sources accept the following parameters:
  26958. </p>
  26959. <dl compact="compact">
  26960. <dt><samp>level</samp></dt>
  26961. <dd><p>Specify the level of the Hald CLUT, only available in the <code>haldclutsrc</code>
  26962. source. A level of <code>N</code> generates a picture of <code>N*N*N</code> by <code>N*N*N</code>
  26963. pixels to be used as identity matrix for 3D lookup tables. Each component is
  26964. coded on a <code>1/(N*N)</code> scale.
  26965. </p>
  26966. </dd>
  26967. <dt><samp>color, c</samp></dt>
  26968. <dd><p>Specify the color of the source, only available in the <code>color</code>
  26969. source. For the syntax of this option, check the
  26970. <a href="ffmpeg-utils.html#color-syntax">(ffmpeg-utils)&quot;Color&quot; section in the ffmpeg-utils manual</a>.
  26971. </p>
  26972. </dd>
  26973. <dt><samp>size, s</samp></dt>
  26974. <dd><p>Specify the size of the sourced video. For the syntax of this option, check the
  26975. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  26976. The default value is <code>320x240</code>.
  26977. </p>
  26978. <p>This option is not available with the <code>allrgb</code>, <code>allyuv</code>, and
  26979. <code>haldclutsrc</code> filters.
  26980. </p>
  26981. </dd>
  26982. <dt><samp>rate, r</samp></dt>
  26983. <dd><p>Specify the frame rate of the sourced video, as the number of frames
  26984. generated per second. It has to be a string in the format
  26985. <var>frame_rate_num</var>/<var>frame_rate_den</var>, an integer number, a floating point
  26986. number or a valid video frame rate abbreviation. The default value is
  26987. &quot;25&quot;.
  26988. </p>
  26989. </dd>
  26990. <dt><samp>duration, d</samp></dt>
  26991. <dd><p>Set the duration of the sourced video. See
  26992. <a href="ffmpeg-utils.html#time-duration-syntax">(ffmpeg-utils)the Time duration section in the ffmpeg-utils(1) manual</a>
  26993. for the accepted syntax.
  26994. </p>
  26995. <p>If not specified, or the expressed duration is negative, the video is
  26996. supposed to be generated forever.
  26997. </p>
  26998. <p>Since the frame rate is used as time base, all frames including the last one
  26999. will have their full duration. If the specified duration is not a multiple
  27000. of the frame duration, it will be rounded up.
  27001. </p>
  27002. </dd>
  27003. <dt><samp>sar</samp></dt>
  27004. <dd><p>Set the sample aspect ratio of the sourced video.
  27005. </p>
  27006. </dd>
  27007. <dt><samp>alpha</samp></dt>
  27008. <dd><p>Specify the alpha (opacity) of the background, only available in the
  27009. <code>testsrc2</code> source. The value must be between 0 (fully transparent) and
  27010. 255 (fully opaque, the default).
  27011. </p>
  27012. </dd>
  27013. <dt><samp>decimals, n</samp></dt>
  27014. <dd><p>Set the number of decimals to show in the timestamp, only available in the
  27015. <code>testsrc</code> source.
  27016. </p>
  27017. <p>The displayed timestamp value will correspond to the original
  27018. timestamp value multiplied by the power of 10 of the specified
  27019. value. Default value is 0.
  27020. </p></dd>
  27021. </dl>
  27022. <a name="Examples-134"></a>
  27023. <h4 class="subsection">14.9.1 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>
  27024. <ul>
  27025. <li> Generate a video with a duration of 5.3 seconds, with size
  27026. 176x144 and a frame rate of 10 frames per second:
  27027. <div class="example">
  27028. <pre class="example">testsrc=duration=5.3:size=qcif:rate=10
  27029. </pre></div>
  27030. </li><li> The following graph description will generate a red source
  27031. with an opacity of 0.2, with size &quot;qcif&quot; and a frame rate of 10
  27032. frames per second:
  27033. <div class="example">
  27034. <pre class="example">color=c=red@0.2:s=qcif:r=10
  27035. </pre></div>
  27036. </li><li> If the input content is to be ignored, <code>nullsrc</code> can be used. The
  27037. following command generates noise in the luminance plane by employing
  27038. the <code>geq</code> filter:
  27039. <div class="example">
  27040. <pre class="example">nullsrc=s=256x256, geq=random(1)*255:128:128
  27041. </pre></div>
  27042. </li></ul>
  27043. <a name="Commands-135"></a>
  27044. <h4 class="subsection">14.9.2 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>
  27045. <p>The <code>color</code> source supports the following commands:
  27046. </p>
  27047. <dl compact="compact">
  27048. <dt><samp>c, color</samp></dt>
  27049. <dd><p>Set the color of the created image. Accepts the same syntax of the
  27050. corresponding <samp>color</samp> option.
  27051. </p></dd>
  27052. </dl>
  27053. <a name="openclsrc"></a>
  27054. <h3 class="section">14.10 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>
  27055. <p>Generate video using an OpenCL program.
  27056. </p>
  27057. <dl compact="compact">
  27058. <dt><samp>source</samp></dt>
  27059. <dd><p>OpenCL program source file.
  27060. </p>
  27061. </dd>
  27062. <dt><samp>kernel</samp></dt>
  27063. <dd><p>Kernel name in program.
  27064. </p>
  27065. </dd>
  27066. <dt><samp>size, s</samp></dt>
  27067. <dd><p>Size of frames to generate. This must be set.
  27068. </p>
  27069. </dd>
  27070. <dt><samp>format</samp></dt>
  27071. <dd><p>Pixel format to use for the generated frames. This must be set.
  27072. </p>
  27073. </dd>
  27074. <dt><samp>rate, r</samp></dt>
  27075. <dd><p>Number of frames generated every second. Default value is &rsquo;25&rsquo;.
  27076. </p>
  27077. </dd>
  27078. </dl>
  27079. <p>For details of how the program loading works, see the <a href="#program_005fopencl">program_opencl</a>
  27080. filter.
  27081. </p>
  27082. <p>Example programs:
  27083. </p>
  27084. <ul>
  27085. <li> Generate a colour ramp by setting pixel values from the position of the pixel
  27086. in the output image. (Note that this will work with all pixel formats, but
  27087. the generated output will not be the same.)
  27088. <pre class="verbatim">__kernel void ramp(__write_only image2d_t dst,
  27089. unsigned int index)
  27090. {
  27091. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  27092. float4 val;
  27093. val.xy = val.zw = convert_float2(loc) / convert_float2(get_image_dim(dst));
  27094. write_imagef(dst, loc, val);
  27095. }
  27096. </pre>
  27097. </li><li> Generate a Sierpinski carpet pattern, panning by a single pixel each frame.
  27098. <pre class="verbatim">__kernel void sierpinski_carpet(__write_only image2d_t dst,
  27099. unsigned int index)
  27100. {
  27101. int2 loc = (int2)(get_global_id(0), get_global_id(1));
  27102. float4 value = 0.0f;
  27103. int x = loc.x + index;
  27104. int y = loc.y + index;
  27105. while (x &gt; 0 || y &gt; 0) {
  27106. if (x % 3 == 1 &amp;&amp; y % 3 == 1) {
  27107. value = 1.0f;
  27108. break;
  27109. }
  27110. x /= 3;
  27111. y /= 3;
  27112. }
  27113. write_imagef(dst, loc, value);
  27114. }
  27115. </pre>
  27116. </li></ul>
  27117. <a name="sierpinski"></a>
  27118. <h3 class="section">14.11 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>
  27119. <p>Generate a Sierpinski carpet/triangle fractal, and randomly pan around.
  27120. </p>
  27121. <p>This source accepts the following options:
  27122. </p>
  27123. <dl compact="compact">
  27124. <dt><samp>size, s</samp></dt>
  27125. <dd><p>Set frame size. For the syntax of this option, check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video
  27126. size&quot; section in the ffmpeg-utils manual</a>. Default value is &quot;640x480&quot;.
  27127. </p>
  27128. </dd>
  27129. <dt><samp>rate, r</samp></dt>
  27130. <dd><p>Set frame rate, expressed as number of frames per second. Default
  27131. value is &quot;25&quot;.
  27132. </p>
  27133. </dd>
  27134. <dt><samp>seed</samp></dt>
  27135. <dd><p>Set seed which is used for random panning.
  27136. </p>
  27137. </dd>
  27138. <dt><samp>jump</samp></dt>
  27139. <dd><p>Set max jump for single pan destination. Allowed range is from 1 to 10000.
  27140. </p>
  27141. </dd>
  27142. <dt><samp>type</samp></dt>
  27143. <dd><p>Set fractal type, can be default <code>carpet</code> or <code>triangle</code>.
  27144. </p></dd>
  27145. </dl>
  27146. <a name="Video-Sinks"></a>
  27147. <h2 class="chapter">15 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>
  27148. <p>Below is a description of the currently available video sinks.
  27149. </p>
  27150. <a name="buffersink"></a>
  27151. <h3 class="section">15.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>
  27152. <p>Buffer video frames, and make them available to the end of the filter
  27153. graph.
  27154. </p>
  27155. <p>This sink is mainly intended for programmatic use, in particular
  27156. through the interface defined in <samp>libavfilter/buffersink.h</samp>
  27157. or the options system.
  27158. </p>
  27159. <p>It accepts a pointer to an AVBufferSinkContext structure, which
  27160. defines the incoming buffers&rsquo; formats, to be passed as the opaque
  27161. parameter to <code>avfilter_init_filter</code> for initialization.
  27162. </p>
  27163. <a name="nullsink"></a>
  27164. <h3 class="section">15.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>
  27165. <p>Null video sink: do absolutely nothing with the input video. It is
  27166. mainly useful as a template and for use in analysis / debugging
  27167. tools.
  27168. </p>
  27169. <a name="Multimedia-Filters"></a>
  27170. <h2 class="chapter">16 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>
  27171. <p>Below is a description of the currently available multimedia filters.
  27172. </p>
  27173. <a name="abitscope"></a>
  27174. <h3 class="section">16.1 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>
  27175. <p>Convert input audio to a video output, displaying the audio bit scope.
  27176. </p>
  27177. <p>The filter accepts the following options:
  27178. </p>
  27179. <dl compact="compact">
  27180. <dt><samp>rate, r</samp></dt>
  27181. <dd><p>Set frame rate, expressed as number of frames per second. Default
  27182. value is &quot;25&quot;.
  27183. </p>
  27184. </dd>
  27185. <dt><samp>size, s</samp></dt>
  27186. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  27187. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27188. Default value is <code>1024x256</code>.
  27189. </p>
  27190. </dd>
  27191. <dt><samp>colors</samp></dt>
  27192. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  27193. draw channels. Unrecognized or missing colors will be replaced
  27194. by white color.
  27195. </p></dd>
  27196. </dl>
  27197. <a name="adrawgraph"></a>
  27198. <h3 class="section">16.2 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>
  27199. <p>Draw a graph using input audio metadata.
  27200. </p>
  27201. <p>See <a href="#drawgraph">drawgraph</a>
  27202. </p>
  27203. <a name="agraphmonitor"></a>
  27204. <h3 class="section">16.3 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>
  27205. <p>See <a href="#graphmonitor">graphmonitor</a>.
  27206. </p>
  27207. <a name="ahistogram"></a>
  27208. <h3 class="section">16.4 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>
  27209. <p>Convert input audio to a video output, displaying the volume histogram.
  27210. </p>
  27211. <p>The filter accepts the following options:
  27212. </p>
  27213. <dl compact="compact">
  27214. <dt><samp>dmode</samp></dt>
  27215. <dd><p>Specify how histogram is calculated.
  27216. </p>
  27217. <p>It accepts the following values:
  27218. </p><dl compact="compact">
  27219. <dt>&lsquo;<samp>single</samp>&rsquo;</dt>
  27220. <dd><p>Use single histogram for all channels.
  27221. </p></dd>
  27222. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  27223. <dd><p>Use separate histogram for each channel.
  27224. </p></dd>
  27225. </dl>
  27226. <p>Default is <code>single</code>.
  27227. </p>
  27228. </dd>
  27229. <dt><samp>rate, r</samp></dt>
  27230. <dd><p>Set frame rate, expressed as number of frames per second. Default
  27231. value is &quot;25&quot;.
  27232. </p>
  27233. </dd>
  27234. <dt><samp>size, s</samp></dt>
  27235. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  27236. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27237. Default value is <code>hd720</code>.
  27238. </p>
  27239. </dd>
  27240. <dt><samp>scale</samp></dt>
  27241. <dd><p>Set display scale.
  27242. </p>
  27243. <p>It accepts the following values:
  27244. </p><dl compact="compact">
  27245. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27246. <dd><p>logarithmic
  27247. </p></dd>
  27248. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  27249. <dd><p>square root
  27250. </p></dd>
  27251. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  27252. <dd><p>cubic root
  27253. </p></dd>
  27254. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27255. <dd><p>linear
  27256. </p></dd>
  27257. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  27258. <dd><p>reverse logarithmic
  27259. </p></dd>
  27260. </dl>
  27261. <p>Default is <code>log</code>.
  27262. </p>
  27263. </dd>
  27264. <dt><samp>ascale</samp></dt>
  27265. <dd><p>Set amplitude scale.
  27266. </p>
  27267. <p>It accepts the following values:
  27268. </p><dl compact="compact">
  27269. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27270. <dd><p>logarithmic
  27271. </p></dd>
  27272. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27273. <dd><p>linear
  27274. </p></dd>
  27275. </dl>
  27276. <p>Default is <code>log</code>.
  27277. </p>
  27278. </dd>
  27279. <dt><samp>acount</samp></dt>
  27280. <dd><p>Set how much frames to accumulate in histogram.
  27281. Default is 1. Setting this to -1 accumulates all frames.
  27282. </p>
  27283. </dd>
  27284. <dt><samp>rheight</samp></dt>
  27285. <dd><p>Set histogram ratio of window height.
  27286. </p>
  27287. </dd>
  27288. <dt><samp>slide</samp></dt>
  27289. <dd><p>Set sonogram sliding.
  27290. </p>
  27291. <p>It accepts the following values:
  27292. </p><dl compact="compact">
  27293. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  27294. <dd><p>replace old rows with new ones.
  27295. </p></dd>
  27296. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  27297. <dd><p>scroll from top to bottom.
  27298. </p></dd>
  27299. </dl>
  27300. <p>Default is <code>replace</code>.
  27301. </p></dd>
  27302. </dl>
  27303. <a name="aphasemeter"></a>
  27304. <h3 class="section">16.5 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>
  27305. <p>Measures phase of input audio, which is exported as metadata <code>lavfi.aphasemeter.phase</code>,
  27306. representing mean phase of current audio frame. A video output can also be produced and is
  27307. enabled by default. The audio is passed through as first output.
  27308. </p>
  27309. <p>Audio will be rematrixed to stereo if it has a different channel layout. Phase value is in
  27310. range <code>[-1, 1]</code> where <code>-1</code> means left and right channels are completely out of phase
  27311. and <code>1</code> means channels are in phase.
  27312. </p>
  27313. <p>The filter accepts the following options, all related to its video output:
  27314. </p>
  27315. <dl compact="compact">
  27316. <dt><samp>rate, r</samp></dt>
  27317. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  27318. </p>
  27319. </dd>
  27320. <dt><samp>size, s</samp></dt>
  27321. <dd><p>Set the video size for the output. For the syntax of this option, check the
  27322. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27323. Default value is <code>800x400</code>.
  27324. </p>
  27325. </dd>
  27326. <dt><samp>rc</samp></dt>
  27327. <dt><samp>gc</samp></dt>
  27328. <dt><samp>bc</samp></dt>
  27329. <dd><p>Specify the red, green, blue contrast. Default values are <code>2</code>,
  27330. <code>7</code> and <code>1</code>.
  27331. Allowed range is <code>[0, 255]</code>.
  27332. </p>
  27333. </dd>
  27334. <dt><samp>mpc</samp></dt>
  27335. <dd><p>Set color which will be used for drawing median phase. If color is
  27336. <code>none</code> which is default, no median phase value will be drawn.
  27337. </p>
  27338. </dd>
  27339. <dt><samp>video</samp></dt>
  27340. <dd><p>Enable video output. Default is enabled.
  27341. </p></dd>
  27342. </dl>
  27343. <a name="phasing-detection"></a>
  27344. <h4 class="subsection">16.5.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>
  27345. <p>The filter also detects out of phase and mono sequences in stereo streams.
  27346. It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
  27347. </p>
  27348. <p>The filter accepts the following options for this detection:
  27349. </p>
  27350. <dl compact="compact">
  27351. <dt><samp>phasing</samp></dt>
  27352. <dd><p>Enable mono and out of phase detection. Default is disabled.
  27353. </p>
  27354. </dd>
  27355. <dt><samp>tolerance, t</samp></dt>
  27356. <dd><p>Set phase tolerance for mono detection, in amplitude ratio. Default is <code>0</code>.
  27357. Allowed range is <code>[0, 1]</code>.
  27358. </p>
  27359. </dd>
  27360. <dt><samp>angle, a</samp></dt>
  27361. <dd><p>Set angle threshold for out of phase detection, in degree. Default is <code>170</code>.
  27362. Allowed range is <code>[90, 180]</code>.
  27363. </p>
  27364. </dd>
  27365. <dt><samp>duration, d</samp></dt>
  27366. <dd><p>Set mono or out of phase duration until notification, expressed in seconds. Default is <code>2</code>.
  27367. </p></dd>
  27368. </dl>
  27369. <a name="Examples-135"></a>
  27370. <h4 class="subsection">16.5.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>
  27371. <ul>
  27372. <li> Complete example with <code>ffmpeg</code> to detect 1 second of mono with 0.001 phase tolerance:
  27373. <div class="example">
  27374. <pre class="example">ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
  27375. </pre></div>
  27376. </li></ul>
  27377. <a name="avectorscope"></a>
  27378. <h3 class="section">16.6 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>
  27379. <p>Convert input audio to a video output, representing the audio vector
  27380. scope.
  27381. </p>
  27382. <p>The filter is used to measure the difference between channels of stereo
  27383. audio stream. A monaural signal, consisting of identical left and right
  27384. signal, results in straight vertical line. Any stereo separation is visible
  27385. as a deviation from this line, creating a Lissajous figure.
  27386. If the straight (or deviation from it) but horizontal line appears this
  27387. indicates that the left and right channels are out of phase.
  27388. </p>
  27389. <p>The filter accepts the following options:
  27390. </p>
  27391. <dl compact="compact">
  27392. <dt><samp>mode, m</samp></dt>
  27393. <dd><p>Set the vectorscope mode.
  27394. </p>
  27395. <p>Available values are:
  27396. </p><dl compact="compact">
  27397. <dt>&lsquo;<samp>lissajous</samp>&rsquo;</dt>
  27398. <dd><p>Lissajous rotated by 45 degrees.
  27399. </p>
  27400. </dd>
  27401. <dt>&lsquo;<samp>lissajous_xy</samp>&rsquo;</dt>
  27402. <dd><p>Same as above but not rotated.
  27403. </p>
  27404. </dd>
  27405. <dt>&lsquo;<samp>polar</samp>&rsquo;</dt>
  27406. <dd><p>Shape resembling half of circle.
  27407. </p></dd>
  27408. </dl>
  27409. <p>Default value is &lsquo;<samp>lissajous</samp>&rsquo;.
  27410. </p>
  27411. </dd>
  27412. <dt><samp>size, s</samp></dt>
  27413. <dd><p>Set the video size for the output. For the syntax of this option, check the
  27414. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27415. Default value is <code>400x400</code>.
  27416. </p>
  27417. </dd>
  27418. <dt><samp>rate, r</samp></dt>
  27419. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  27420. </p>
  27421. </dd>
  27422. <dt><samp>rc</samp></dt>
  27423. <dt><samp>gc</samp></dt>
  27424. <dt><samp>bc</samp></dt>
  27425. <dt><samp>ac</samp></dt>
  27426. <dd><p>Specify the red, green, blue and alpha contrast. Default values are <code>40</code>,
  27427. <code>160</code>, <code>80</code> and <code>255</code>.
  27428. Allowed range is <code>[0, 255]</code>.
  27429. </p>
  27430. </dd>
  27431. <dt><samp>rf</samp></dt>
  27432. <dt><samp>gf</samp></dt>
  27433. <dt><samp>bf</samp></dt>
  27434. <dt><samp>af</samp></dt>
  27435. <dd><p>Specify the red, green, blue and alpha fade. Default values are <code>15</code>,
  27436. <code>10</code>, <code>5</code> and <code>5</code>.
  27437. Allowed range is <code>[0, 255]</code>.
  27438. </p>
  27439. </dd>
  27440. <dt><samp>zoom</samp></dt>
  27441. <dd><p>Set the zoom factor. Default value is <code>1</code>. Allowed range is <code>[0, 10]</code>.
  27442. Values lower than <var>1</var> will auto adjust zoom factor to maximal possible value.
  27443. </p>
  27444. </dd>
  27445. <dt><samp>draw</samp></dt>
  27446. <dd><p>Set the vectorscope drawing mode.
  27447. </p>
  27448. <p>Available values are:
  27449. </p><dl compact="compact">
  27450. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  27451. <dd><p>Draw dot for each sample.
  27452. </p>
  27453. </dd>
  27454. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  27455. <dd><p>Draw line between previous and current sample.
  27456. </p></dd>
  27457. </dl>
  27458. <p>Default value is &lsquo;<samp>dot</samp>&rsquo;.
  27459. </p>
  27460. </dd>
  27461. <dt><samp>scale</samp></dt>
  27462. <dd><p>Specify amplitude scale of audio samples.
  27463. </p>
  27464. <p>Available values are:
  27465. </p><dl compact="compact">
  27466. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  27467. <dd><p>Linear.
  27468. </p>
  27469. </dd>
  27470. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  27471. <dd><p>Square root.
  27472. </p>
  27473. </dd>
  27474. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  27475. <dd><p>Cubic root.
  27476. </p>
  27477. </dd>
  27478. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  27479. <dd><p>Logarithmic.
  27480. </p></dd>
  27481. </dl>
  27482. </dd>
  27483. <dt><samp>swap</samp></dt>
  27484. <dd><p>Swap left channel axis with right channel axis.
  27485. </p>
  27486. </dd>
  27487. <dt><samp>mirror</samp></dt>
  27488. <dd><p>Mirror axis.
  27489. </p>
  27490. <dl compact="compact">
  27491. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  27492. <dd><p>No mirror.
  27493. </p>
  27494. </dd>
  27495. <dt>&lsquo;<samp>x</samp>&rsquo;</dt>
  27496. <dd><p>Mirror only x axis.
  27497. </p>
  27498. </dd>
  27499. <dt>&lsquo;<samp>y</samp>&rsquo;</dt>
  27500. <dd><p>Mirror only y axis.
  27501. </p>
  27502. </dd>
  27503. <dt>&lsquo;<samp>xy</samp>&rsquo;</dt>
  27504. <dd><p>Mirror both axis.
  27505. </p></dd>
  27506. </dl>
  27507. </dd>
  27508. </dl>
  27509. <a name="Examples-136"></a>
  27510. <h4 class="subsection">16.6.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>
  27511. <ul>
  27512. <li> Complete example using <code>ffplay</code>:
  27513. <div class="example">
  27514. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  27515. [a] avectorscope=zoom=1.3:rc=2:gc=200:bc=10:rf=1:gf=8:bf=7 [out0]'
  27516. </pre></div>
  27517. </li></ul>
  27518. <a name="bench_002c-abench"></a>
  27519. <h3 class="section">16.7 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>
  27520. <p>Benchmark part of a filtergraph.
  27521. </p>
  27522. <p>The filter accepts the following options:
  27523. </p>
  27524. <dl compact="compact">
  27525. <dt><samp>action</samp></dt>
  27526. <dd><p>Start or stop a timer.
  27527. </p>
  27528. <p>Available values are:
  27529. </p><dl compact="compact">
  27530. <dt>&lsquo;<samp>start</samp>&rsquo;</dt>
  27531. <dd><p>Get the current time, set it as frame metadata (using the key
  27532. <code>lavfi.bench.start_time</code>), and forward the frame to the next filter.
  27533. </p>
  27534. </dd>
  27535. <dt>&lsquo;<samp>stop</samp>&rsquo;</dt>
  27536. <dd><p>Get the current time and fetch the <code>lavfi.bench.start_time</code> metadata from
  27537. the input frame metadata to get the time difference. Time difference, average,
  27538. maximum and minimum time (respectively <code>t</code>, <code>avg</code>, <code>max</code> and
  27539. <code>min</code>) are then printed. The timestamps are expressed in seconds.
  27540. </p></dd>
  27541. </dl>
  27542. </dd>
  27543. </dl>
  27544. <a name="Examples-137"></a>
  27545. <h4 class="subsection">16.7.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>
  27546. <ul>
  27547. <li> Benchmark <a href="#selectivecolor">selectivecolor</a> filter:
  27548. <div class="example">
  27549. <pre class="example">bench=start,selectivecolor=reds=-.2 .12 -.49,bench=stop
  27550. </pre></div>
  27551. </li></ul>
  27552. <a name="concat"></a>
  27553. <h3 class="section">16.8 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>
  27554. <p>Concatenate audio and video streams, joining them together one after the
  27555. other.
  27556. </p>
  27557. <p>The filter works on segments of synchronized video and audio streams. All
  27558. segments must have the same number of streams of each type, and that will
  27559. also be the number of streams at output.
  27560. </p>
  27561. <p>The filter accepts the following options:
  27562. </p>
  27563. <dl compact="compact">
  27564. <dt><samp>n</samp></dt>
  27565. <dd><p>Set the number of segments. Default is 2.
  27566. </p>
  27567. </dd>
  27568. <dt><samp>v</samp></dt>
  27569. <dd><p>Set the number of output video streams, that is also the number of video
  27570. streams in each segment. Default is 1.
  27571. </p>
  27572. </dd>
  27573. <dt><samp>a</samp></dt>
  27574. <dd><p>Set the number of output audio streams, that is also the number of audio
  27575. streams in each segment. Default is 0.
  27576. </p>
  27577. </dd>
  27578. <dt><samp>unsafe</samp></dt>
  27579. <dd><p>Activate unsafe mode: do not fail if segments have a different format.
  27580. </p>
  27581. </dd>
  27582. </dl>
  27583. <p>The filter has <var>v</var>+<var>a</var> outputs: first <var>v</var> video outputs, then
  27584. <var>a</var> audio outputs.
  27585. </p>
  27586. <p>There are <var>n</var>x(<var>v</var>+<var>a</var>) inputs: first the inputs for the first
  27587. segment, in the same order as the outputs, then the inputs for the second
  27588. segment, etc.
  27589. </p>
  27590. <p>Related streams do not always have exactly the same duration, for various
  27591. reasons including codec frame size or sloppy authoring. For that reason,
  27592. related synchronized streams (e.g. a video and its audio track) should be
  27593. concatenated at once. The concat filter will use the duration of the longest
  27594. stream in each segment (except the last one), and if necessary pad shorter
  27595. audio streams with silence.
  27596. </p>
  27597. <p>For this filter to work correctly, all segments must start at timestamp 0.
  27598. </p>
  27599. <p>All corresponding streams must have the same parameters in all segments; the
  27600. filtering system will automatically select a common pixel format for video
  27601. streams, and a common sample format, sample rate and channel layout for
  27602. audio streams, but other settings, such as resolution, must be converted
  27603. explicitly by the user.
  27604. </p>
  27605. <p>Different frame rates are acceptable but will result in variable frame rate
  27606. at output; be sure to configure the output file to handle it.
  27607. </p>
  27608. <a name="Examples-138"></a>
  27609. <h4 class="subsection">16.8.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>
  27610. <ul>
  27611. <li> Concatenate an opening, an episode and an ending, all in bilingual version
  27612. (video in stream 0, audio in streams 1 and 2):
  27613. <div class="example">
  27614. <pre class="example">ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv -filter_complex \
  27615. '[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]
  27616. concat=n=3:v=1:a=2 [v] [a1] [a2]' \
  27617. -map '[v]' -map '[a1]' -map '[a2]' output.mkv
  27618. </pre></div>
  27619. </li><li> Concatenate two parts, handling audio and video separately, using the
  27620. (a)movie sources, and adjusting the resolution:
  27621. <div class="example">
  27622. <pre class="example">movie=part1.mp4, scale=512:288 [v1] ; amovie=part1.mp4 [a1] ;
  27623. movie=part2.mp4, scale=512:288 [v2] ; amovie=part2.mp4 [a2] ;
  27624. [v1] [v2] concat [outv] ; [a1] [a2] concat=v=0:a=1 [outa]
  27625. </pre></div>
  27626. <p>Note that a desync will happen at the stitch if the audio and video streams
  27627. do not have exactly the same duration in the first file.
  27628. </p>
  27629. </li></ul>
  27630. <a name="Commands-136"></a>
  27631. <h4 class="subsection">16.8.2 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>
  27632. <p>This filter supports the following commands:
  27633. </p><dl compact="compact">
  27634. <dt><samp>next</samp></dt>
  27635. <dd><p>Close the current segment and step to the next one
  27636. </p></dd>
  27637. </dl>
  27638. <span id="ebur128"></span><a name="ebur128-1"></a>
  27639. <h3 class="section">16.9 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>
  27640. <p>EBU R128 scanner filter. This filter takes an audio stream and analyzes its loudness
  27641. level. By default, it logs a message at a frequency of 10Hz with the
  27642. Momentary loudness (identified by <code>M</code>), Short-term loudness (<code>S</code>),
  27643. Integrated loudness (<code>I</code>) and Loudness Range (<code>LRA</code>).
  27644. </p>
  27645. <p>The filter can only analyze streams which have a sampling rate of 48000 Hz and whose
  27646. sample format is double-precision floating point. The input stream will be converted to
  27647. this specification, if needed. Users may need to insert aformat and/or aresample filters
  27648. after this filter to obtain the original parameters.
  27649. </p>
  27650. <p>The filter also has a video output (see the <var>video</var> option) with a real
  27651. time graph to observe the loudness evolution. The graphic contains the logged
  27652. message mentioned above, so it is not printed anymore when this option is set,
  27653. unless the verbose logging is set. The main graphing area contains the
  27654. short-term loudness (3 seconds of analysis), and the gauge on the right is for
  27655. the momentary loudness (400 milliseconds), but can optionally be configured
  27656. to instead display short-term loudness (see <var>gauge</var>).
  27657. </p>
  27658. <p>The green area marks a +/- 1LU target range around the target loudness
  27659. (-23LUFS by default, unless modified through <var>target</var>).
  27660. </p>
  27661. <p>More information about the Loudness Recommendation EBU R128 on
  27662. <a href="http://tech.ebu.ch/loudness">http://tech.ebu.ch/loudness</a>.
  27663. </p>
  27664. <p>The filter accepts the following options:
  27665. </p>
  27666. <dl compact="compact">
  27667. <dt><samp>video</samp></dt>
  27668. <dd><p>Activate the video output. The audio stream is passed unchanged whether this
  27669. option is set or no. The video stream will be the first output stream if
  27670. activated. Default is <code>0</code>.
  27671. </p>
  27672. </dd>
  27673. <dt><samp>size</samp></dt>
  27674. <dd><p>Set the video size. This option is for video only. For the syntax of this
  27675. option, check the
  27676. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  27677. Default and minimum resolution is <code>640x480</code>.
  27678. </p>
  27679. </dd>
  27680. <dt><samp>meter</samp></dt>
  27681. <dd><p>Set the EBU scale meter. Default is <code>9</code>. Common values are <code>9</code> and
  27682. <code>18</code>, respectively for EBU scale meter +9 and EBU scale meter +18. Any
  27683. other integer value between this range is allowed.
  27684. </p>
  27685. </dd>
  27686. <dt><samp>metadata</samp></dt>
  27687. <dd><p>Set metadata injection. If set to <code>1</code>, the audio input will be segmented
  27688. into 100ms output frames, each of them containing various loudness information
  27689. in metadata. All the metadata keys are prefixed with <code>lavfi.r128.</code>.
  27690. </p>
  27691. <p>Default is <code>0</code>.
  27692. </p>
  27693. </dd>
  27694. <dt><samp>framelog</samp></dt>
  27695. <dd><p>Force the frame logging level.
  27696. </p>
  27697. <p>Available values are:
  27698. </p><dl compact="compact">
  27699. <dt>&lsquo;<samp>info</samp>&rsquo;</dt>
  27700. <dd><p>information logging level
  27701. </p></dd>
  27702. <dt>&lsquo;<samp>verbose</samp>&rsquo;</dt>
  27703. <dd><p>verbose logging level
  27704. </p></dd>
  27705. </dl>
  27706. <p>By default, the logging level is set to <var>info</var>. If the <samp>video</samp> or
  27707. the <samp>metadata</samp> options are set, it switches to <var>verbose</var>.
  27708. </p>
  27709. </dd>
  27710. <dt><samp>peak</samp></dt>
  27711. <dd><p>Set peak mode(s).
  27712. </p>
  27713. <p>Available modes can be cumulated (the option is a <code>flag</code> type). Possible
  27714. values are:
  27715. </p><dl compact="compact">
  27716. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  27717. <dd><p>Disable any peak mode (default).
  27718. </p></dd>
  27719. <dt>&lsquo;<samp>sample</samp>&rsquo;</dt>
  27720. <dd><p>Enable sample-peak mode.
  27721. </p>
  27722. <p>Simple peak mode looking for the higher sample value. It logs a message
  27723. for sample-peak (identified by <code>SPK</code>).
  27724. </p></dd>
  27725. <dt>&lsquo;<samp>true</samp>&rsquo;</dt>
  27726. <dd><p>Enable true-peak mode.
  27727. </p>
  27728. <p>If enabled, the peak lookup is done on an over-sampled version of the input
  27729. stream for better peak accuracy. It logs a message for true-peak.
  27730. (identified by <code>TPK</code>) and true-peak per frame (identified by <code>FTPK</code>).
  27731. This mode requires a build with <code>libswresample</code>.
  27732. </p></dd>
  27733. </dl>
  27734. </dd>
  27735. <dt><samp>dualmono</samp></dt>
  27736. <dd><p>Treat mono input files as &quot;dual mono&quot;. If a mono file is intended for playback
  27737. on a stereo system, its EBU R128 measurement will be perceptually incorrect.
  27738. If set to <code>true</code>, this option will compensate for this effect.
  27739. Multi-channel input files are not affected by this option.
  27740. </p>
  27741. </dd>
  27742. <dt><samp>panlaw</samp></dt>
  27743. <dd><p>Set a specific pan law to be used for the measurement of dual mono files.
  27744. This parameter is optional, and has a default value of -3.01dB.
  27745. </p>
  27746. </dd>
  27747. <dt><samp>target</samp></dt>
  27748. <dd><p>Set a specific target level (in LUFS) used as relative zero in the visualization.
  27749. This parameter is optional and has a default value of -23LUFS as specified
  27750. by EBU R128. However, material published online may prefer a level of -16LUFS
  27751. (e.g. for use with podcasts or video platforms).
  27752. </p>
  27753. </dd>
  27754. <dt><samp>gauge</samp></dt>
  27755. <dd><p>Set the value displayed by the gauge. Valid values are <code>momentary</code> and s
  27756. <code>shortterm</code>. By default the momentary value will be used, but in certain
  27757. scenarios it may be more useful to observe the short term value instead (e.g.
  27758. live mixing).
  27759. </p>
  27760. </dd>
  27761. <dt><samp>scale</samp></dt>
  27762. <dd><p>Sets the display scale for the loudness. Valid parameters are <code>absolute</code>
  27763. (in LUFS) or <code>relative</code> (LU) relative to the target. This only affects the
  27764. video output, not the summary or continuous log output.
  27765. </p></dd>
  27766. </dl>
  27767. <a name="Examples-139"></a>
  27768. <h4 class="subsection">16.9.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>
  27769. <ul>
  27770. <li> Real-time graph using <code>ffplay</code>, with a EBU scale meter +18:
  27771. <div class="example">
  27772. <pre class="example">ffplay -f lavfi -i &quot;amovie=input.mp3,ebur128=video=1:meter=18 [out0][out1]&quot;
  27773. </pre></div>
  27774. </li><li> Run an analysis with <code>ffmpeg</code>:
  27775. <div class="example">
  27776. <pre class="example">ffmpeg -nostats -i input.mp3 -filter_complex ebur128 -f null -
  27777. </pre></div>
  27778. </li></ul>
  27779. <a name="interleave_002c-ainterleave"></a>
  27780. <h3 class="section">16.10 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>
  27781. <p>Temporally interleave frames from several inputs.
  27782. </p>
  27783. <p><code>interleave</code> works with video inputs, <code>ainterleave</code> with audio.
  27784. </p>
  27785. <p>These filters read frames from several inputs and send the oldest
  27786. queued frame to the output.
  27787. </p>
  27788. <p>Input streams must have well defined, monotonically increasing frame
  27789. timestamp values.
  27790. </p>
  27791. <p>In order to submit one frame to output, these filters need to enqueue
  27792. at least one frame for each input, so they cannot work in case one
  27793. input is not yet terminated and will not receive incoming frames.
  27794. </p>
  27795. <p>For example consider the case when one input is a <code>select</code> filter
  27796. which always drops input frames. The <code>interleave</code> filter will keep
  27797. reading from that input, but it will never be able to send new frames
  27798. to output until the input sends an end-of-stream signal.
  27799. </p>
  27800. <p>Also, depending on inputs synchronization, the filters will drop
  27801. frames in case one input receives more frames than the other ones, and
  27802. the queue is already filled.
  27803. </p>
  27804. <p>These filters accept the following options:
  27805. </p>
  27806. <dl compact="compact">
  27807. <dt><samp>nb_inputs, n</samp></dt>
  27808. <dd><p>Set the number of different inputs, it is 2 by default.
  27809. </p>
  27810. </dd>
  27811. <dt><samp>duration</samp></dt>
  27812. <dd><p>How to determine the end-of-stream.
  27813. </p>
  27814. <dl compact="compact">
  27815. <dt><samp>longest</samp></dt>
  27816. <dd><p>The duration of the longest input. (default)
  27817. </p>
  27818. </dd>
  27819. <dt><samp>shortest</samp></dt>
  27820. <dd><p>The duration of the shortest input.
  27821. </p>
  27822. </dd>
  27823. <dt><samp>first</samp></dt>
  27824. <dd><p>The duration of the first input.
  27825. </p></dd>
  27826. </dl>
  27827. </dd>
  27828. </dl>
  27829. <a name="Examples-140"></a>
  27830. <h4 class="subsection">16.10.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>
  27831. <ul>
  27832. <li> Interleave frames belonging to different streams using <code>ffmpeg</code>:
  27833. <div class="example">
  27834. <pre class="example">ffmpeg -i bambi.avi -i pr0n.mkv -filter_complex &quot;[0:v][1:v] interleave&quot; out.avi
  27835. </pre></div>
  27836. </li><li> Add flickering blur effect:
  27837. <div class="example">
  27838. <pre class="example">select='if(gt(random(0), 0.2), 1, 2)':n=2 [tmp], boxblur=2:2, [tmp] interleave
  27839. </pre></div>
  27840. </li></ul>
  27841. <a name="metadata_002c-ametadata"></a>
  27842. <h3 class="section">16.11 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>
  27843. <p>Manipulate frame metadata.
  27844. </p>
  27845. <p>This filter accepts the following options:
  27846. </p>
  27847. <dl compact="compact">
  27848. <dt><samp>mode</samp></dt>
  27849. <dd><p>Set mode of operation of the filter.
  27850. </p>
  27851. <p>Can be one of the following:
  27852. </p>
  27853. <dl compact="compact">
  27854. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  27855. <dd><p>If both <code>value</code> and <code>key</code> is set, select frames
  27856. which have such metadata. If only <code>key</code> is set, select
  27857. every frame that has such key in metadata.
  27858. </p>
  27859. </dd>
  27860. <dt>&lsquo;<samp>add</samp>&rsquo;</dt>
  27861. <dd><p>Add new metadata <code>key</code> and <code>value</code>. If key is already available
  27862. do nothing.
  27863. </p>
  27864. </dd>
  27865. <dt>&lsquo;<samp>modify</samp>&rsquo;</dt>
  27866. <dd><p>Modify value of already present key.
  27867. </p>
  27868. </dd>
  27869. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  27870. <dd><p>If <code>value</code> is set, delete only keys that have such value.
  27871. Otherwise, delete key. If <code>key</code> is not set, delete all metadata values in
  27872. the frame.
  27873. </p>
  27874. </dd>
  27875. <dt>&lsquo;<samp>print</samp>&rsquo;</dt>
  27876. <dd><p>Print key and its value if metadata was found. If <code>key</code> is not set print all
  27877. metadata values available in frame.
  27878. </p></dd>
  27879. </dl>
  27880. </dd>
  27881. <dt><samp>key</samp></dt>
  27882. <dd><p>Set key used with all modes. Must be set for all modes except <code>print</code> and <code>delete</code>.
  27883. </p>
  27884. </dd>
  27885. <dt><samp>value</samp></dt>
  27886. <dd><p>Set metadata value which will be used. This option is mandatory for
  27887. <code>modify</code> and <code>add</code> mode.
  27888. </p>
  27889. </dd>
  27890. <dt><samp>function</samp></dt>
  27891. <dd><p>Which function to use when comparing metadata value and <code>value</code>.
  27892. </p>
  27893. <p>Can be one of following:
  27894. </p>
  27895. <dl compact="compact">
  27896. <dt>&lsquo;<samp>same_str</samp>&rsquo;</dt>
  27897. <dd><p>Values are interpreted as strings, returns true if metadata value is same as <code>value</code>.
  27898. </p>
  27899. </dd>
  27900. <dt>&lsquo;<samp>starts_with</samp>&rsquo;</dt>
  27901. <dd><p>Values are interpreted as strings, returns true if metadata value starts with
  27902. the <code>value</code> option string.
  27903. </p>
  27904. </dd>
  27905. <dt>&lsquo;<samp>less</samp>&rsquo;</dt>
  27906. <dd><p>Values are interpreted as floats, returns true if metadata value is less than <code>value</code>.
  27907. </p>
  27908. </dd>
  27909. <dt>&lsquo;<samp>equal</samp>&rsquo;</dt>
  27910. <dd><p>Values are interpreted as floats, returns true if <code>value</code> is equal with metadata value.
  27911. </p>
  27912. </dd>
  27913. <dt>&lsquo;<samp>greater</samp>&rsquo;</dt>
  27914. <dd><p>Values are interpreted as floats, returns true if metadata value is greater than <code>value</code>.
  27915. </p>
  27916. </dd>
  27917. <dt>&lsquo;<samp>expr</samp>&rsquo;</dt>
  27918. <dd><p>Values are interpreted as floats, returns true if expression from option <code>expr</code>
  27919. evaluates to true.
  27920. </p>
  27921. </dd>
  27922. <dt>&lsquo;<samp>ends_with</samp>&rsquo;</dt>
  27923. <dd><p>Values are interpreted as strings, returns true if metadata value ends with
  27924. the <code>value</code> option string.
  27925. </p></dd>
  27926. </dl>
  27927. </dd>
  27928. <dt><samp>expr</samp></dt>
  27929. <dd><p>Set expression which is used when <code>function</code> is set to <code>expr</code>.
  27930. The expression is evaluated through the eval API and can contain the following
  27931. constants:
  27932. </p>
  27933. <dl compact="compact">
  27934. <dt><samp>VALUE1</samp></dt>
  27935. <dd><p>Float representation of <code>value</code> from metadata key.
  27936. </p>
  27937. </dd>
  27938. <dt><samp>VALUE2</samp></dt>
  27939. <dd><p>Float representation of <code>value</code> as supplied by user in <code>value</code> option.
  27940. </p></dd>
  27941. </dl>
  27942. </dd>
  27943. <dt><samp>file</samp></dt>
  27944. <dd><p>If specified in <code>print</code> mode, output is written to the named file. Instead of
  27945. plain filename any writable url can be specified. Filename &ldquo;-&rdquo; is a shorthand
  27946. for standard output. If <code>file</code> option is not set, output is written to the log
  27947. with AV_LOG_INFO loglevel.
  27948. </p>
  27949. </dd>
  27950. <dt><samp>direct</samp></dt>
  27951. <dd><p>Reduces buffering in print mode when output is written to a URL set using <var>file</var>.
  27952. </p>
  27953. </dd>
  27954. </dl>
  27955. <a name="Examples-141"></a>
  27956. <h4 class="subsection">16.11.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>
  27957. <ul>
  27958. <li> Print all metadata values for frames with key <code>lavfi.signalstats.YDIF</code> with values
  27959. between 0 and 1.
  27960. <div class="example">
  27961. <pre class="example">signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
  27962. </pre></div>
  27963. </li><li> Print silencedetect output to file <samp>metadata.txt</samp>.
  27964. <div class="example">
  27965. <pre class="example">silencedetect,ametadata=mode=print:file=metadata.txt
  27966. </pre></div>
  27967. </li><li> Direct all metadata to a pipe with file descriptor 4.
  27968. <div class="example">
  27969. <pre class="example">metadata=mode=print:file='pipe\:4'
  27970. </pre></div>
  27971. </li></ul>
  27972. <a name="perms_002c-aperms"></a>
  27973. <h3 class="section">16.12 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>
  27974. <p>Set read/write permissions for the output frames.
  27975. </p>
  27976. <p>These filters are mainly aimed at developers to test direct path in the
  27977. following filter in the filtergraph.
  27978. </p>
  27979. <p>The filters accept the following options:
  27980. </p>
  27981. <dl compact="compact">
  27982. <dt><samp>mode</samp></dt>
  27983. <dd><p>Select the permissions mode.
  27984. </p>
  27985. <p>It accepts the following values:
  27986. </p><dl compact="compact">
  27987. <dt>&lsquo;<samp>none</samp>&rsquo;</dt>
  27988. <dd><p>Do nothing. This is the default.
  27989. </p></dd>
  27990. <dt>&lsquo;<samp>ro</samp>&rsquo;</dt>
  27991. <dd><p>Set all the output frames read-only.
  27992. </p></dd>
  27993. <dt>&lsquo;<samp>rw</samp>&rsquo;</dt>
  27994. <dd><p>Set all the output frames directly writable.
  27995. </p></dd>
  27996. <dt>&lsquo;<samp>toggle</samp>&rsquo;</dt>
  27997. <dd><p>Make the frame read-only if writable, and writable if read-only.
  27998. </p></dd>
  27999. <dt>&lsquo;<samp>random</samp>&rsquo;</dt>
  28000. <dd><p>Set each output frame read-only or writable randomly.
  28001. </p></dd>
  28002. </dl>
  28003. </dd>
  28004. <dt><samp>seed</samp></dt>
  28005. <dd><p>Set the seed for the <var>random</var> mode, must be an integer included between
  28006. <code>0</code> and <code>UINT32_MAX</code>. If not specified, or if explicitly set to
  28007. <code>-1</code>, the filter will try to use a good random seed on a best effort
  28008. basis.
  28009. </p></dd>
  28010. </dl>
  28011. <p>Note: in case of auto-inserted filter between the permission filter and the
  28012. following one, the permission might not be received as expected in that
  28013. following filter. Inserting a <a href="#format">format</a> or <a href="#aformat">aformat</a> filter before the
  28014. perms/aperms filter can avoid this problem.
  28015. </p>
  28016. <a name="realtime_002c-arealtime"></a>
  28017. <h3 class="section">16.13 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>
  28018. <p>Slow down filtering to match real time approximately.
  28019. </p>
  28020. <p>These filters will pause the filtering for a variable amount of time to
  28021. match the output rate with the input timestamps.
  28022. They are similar to the <samp>re</samp> option to <code>ffmpeg</code>.
  28023. </p>
  28024. <p>They accept the following options:
  28025. </p>
  28026. <dl compact="compact">
  28027. <dt><samp>limit</samp></dt>
  28028. <dd><p>Time limit for the pauses. Any pause longer than that will be considered
  28029. a timestamp discontinuity and reset the timer. Default is 2 seconds.
  28030. </p></dd>
  28031. <dt><samp>speed</samp></dt>
  28032. <dd><p>Speed factor for processing. The value must be a float larger than zero.
  28033. Values larger than 1.0 will result in faster than realtime processing,
  28034. smaller will slow processing down. The <var>limit</var> is automatically adapted
  28035. accordingly. Default is 1.0.
  28036. </p>
  28037. <p>A processing speed faster than what is possible without these filters cannot
  28038. be achieved.
  28039. </p></dd>
  28040. </dl>
  28041. <span id="select"></span><a name="select_002c-aselect"></a>
  28042. <h3 class="section">16.14 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>
  28043. <p>Select frames to pass in output.
  28044. </p>
  28045. <p>This filter accepts the following options:
  28046. </p>
  28047. <dl compact="compact">
  28048. <dt><samp>expr, e</samp></dt>
  28049. <dd><p>Set expression, which is evaluated for each input frame.
  28050. </p>
  28051. <p>If the expression is evaluated to zero, the frame is discarded.
  28052. </p>
  28053. <p>If the evaluation result is negative or NaN, the frame is sent to the
  28054. first output; otherwise it is sent to the output with index
  28055. <code>ceil(val)-1</code>, assuming that the input index starts from 0.
  28056. </p>
  28057. <p>For example a value of <code>1.2</code> corresponds to the output with index
  28058. <code>ceil(1.2)-1 = 2-1 = 1</code>, that is the second output.
  28059. </p>
  28060. </dd>
  28061. <dt><samp>outputs, n</samp></dt>
  28062. <dd><p>Set the number of outputs. The output to which to send the selected
  28063. frame is based on the result of the evaluation. Default value is 1.
  28064. </p></dd>
  28065. </dl>
  28066. <p>The expression can contain the following constants:
  28067. </p>
  28068. <dl compact="compact">
  28069. <dt><samp>n</samp></dt>
  28070. <dd><p>The (sequential) number of the filtered frame, starting from 0.
  28071. </p>
  28072. </dd>
  28073. <dt><samp>selected_n</samp></dt>
  28074. <dd><p>The (sequential) number of the selected frame, starting from 0.
  28075. </p>
  28076. </dd>
  28077. <dt><samp>prev_selected_n</samp></dt>
  28078. <dd><p>The sequential number of the last selected frame. It&rsquo;s NAN if undefined.
  28079. </p>
  28080. </dd>
  28081. <dt><samp>TB</samp></dt>
  28082. <dd><p>The timebase of the input timestamps.
  28083. </p>
  28084. </dd>
  28085. <dt><samp>pts</samp></dt>
  28086. <dd><p>The PTS (Presentation TimeStamp) of the filtered video frame,
  28087. expressed in <var>TB</var> units. It&rsquo;s NAN if undefined.
  28088. </p>
  28089. </dd>
  28090. <dt><samp>t</samp></dt>
  28091. <dd><p>The PTS of the filtered video frame,
  28092. expressed in seconds. It&rsquo;s NAN if undefined.
  28093. </p>
  28094. </dd>
  28095. <dt><samp>prev_pts</samp></dt>
  28096. <dd><p>The PTS of the previously filtered video frame. It&rsquo;s NAN if undefined.
  28097. </p>
  28098. </dd>
  28099. <dt><samp>prev_selected_pts</samp></dt>
  28100. <dd><p>The PTS of the last previously filtered video frame. It&rsquo;s NAN if undefined.
  28101. </p>
  28102. </dd>
  28103. <dt><samp>prev_selected_t</samp></dt>
  28104. <dd><p>The PTS of the last previously selected video frame, expressed in seconds. It&rsquo;s NAN if undefined.
  28105. </p>
  28106. </dd>
  28107. <dt><samp>start_pts</samp></dt>
  28108. <dd><p>The PTS of the first video frame in the video. It&rsquo;s NAN if undefined.
  28109. </p>
  28110. </dd>
  28111. <dt><samp>start_t</samp></dt>
  28112. <dd><p>The time of the first video frame in the video. It&rsquo;s NAN if undefined.
  28113. </p>
  28114. </dd>
  28115. <dt><samp>pict_type <em>(video only)</em></samp></dt>
  28116. <dd><p>The type of the filtered frame. It can assume one of the following
  28117. values:
  28118. </p><dl compact="compact">
  28119. <dt><samp>I</samp></dt>
  28120. <dt><samp>P</samp></dt>
  28121. <dt><samp>B</samp></dt>
  28122. <dt><samp>S</samp></dt>
  28123. <dt><samp>SI</samp></dt>
  28124. <dt><samp>SP</samp></dt>
  28125. <dt><samp>BI</samp></dt>
  28126. </dl>
  28127. </dd>
  28128. <dt><samp>interlace_type <em>(video only)</em></samp></dt>
  28129. <dd><p>The frame interlace type. It can assume one of the following values:
  28130. </p><dl compact="compact">
  28131. <dt><samp>PROGRESSIVE</samp></dt>
  28132. <dd><p>The frame is progressive (not interlaced).
  28133. </p></dd>
  28134. <dt><samp>TOPFIRST</samp></dt>
  28135. <dd><p>The frame is top-field-first.
  28136. </p></dd>
  28137. <dt><samp>BOTTOMFIRST</samp></dt>
  28138. <dd><p>The frame is bottom-field-first.
  28139. </p></dd>
  28140. </dl>
  28141. </dd>
  28142. <dt><samp>consumed_sample_n <em>(audio only)</em></samp></dt>
  28143. <dd><p>the number of selected samples before the current frame
  28144. </p>
  28145. </dd>
  28146. <dt><samp>samples_n <em>(audio only)</em></samp></dt>
  28147. <dd><p>the number of samples in the current frame
  28148. </p>
  28149. </dd>
  28150. <dt><samp>sample_rate <em>(audio only)</em></samp></dt>
  28151. <dd><p>the input sample rate
  28152. </p>
  28153. </dd>
  28154. <dt><samp>key</samp></dt>
  28155. <dd><p>This is 1 if the filtered frame is a key-frame, 0 otherwise.
  28156. </p>
  28157. </dd>
  28158. <dt><samp>pos</samp></dt>
  28159. <dd><p>the position in the file of the filtered frame, -1 if the information
  28160. is not available (e.g. for synthetic video)
  28161. </p>
  28162. </dd>
  28163. <dt><samp>scene <em>(video only)</em></samp></dt>
  28164. <dd><p>value between 0 and 1 to indicate a new scene; a low value reflects a low
  28165. probability for the current frame to introduce a new scene, while a higher
  28166. value means the current frame is more likely to be one (see the example below)
  28167. </p>
  28168. </dd>
  28169. <dt><samp>concatdec_select</samp></dt>
  28170. <dd><p>The concat demuxer can select only part of a concat input file by setting an
  28171. inpoint and an outpoint, but the output packets may not be entirely contained
  28172. in the selected interval. By using this variable, it is possible to skip frames
  28173. generated by the concat demuxer which are not exactly contained in the selected
  28174. interval.
  28175. </p>
  28176. <p>This works by comparing the frame pts against the <var>lavf.concat.start_time</var>
  28177. and the <var>lavf.concat.duration</var> packet metadata values which are also
  28178. present in the decoded frames.
  28179. </p>
  28180. <p>The <var>concatdec_select</var> variable is -1 if the frame pts is at least
  28181. start_time and either the duration metadata is missing or the frame pts is less
  28182. than start_time + duration, 0 otherwise, and NaN if the start_time metadata is
  28183. missing.
  28184. </p>
  28185. <p>That basically means that an input frame is selected if its pts is within the
  28186. interval set by the concat demuxer.
  28187. </p>
  28188. </dd>
  28189. </dl>
  28190. <p>The default value of the select expression is &quot;1&quot;.
  28191. </p>
  28192. <a name="Examples-142"></a>
  28193. <h4 class="subsection">16.14.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>
  28194. <ul>
  28195. <li> Select all frames in input:
  28196. <div class="example">
  28197. <pre class="example">select
  28198. </pre></div>
  28199. <p>The example above is the same as:
  28200. </p><div class="example">
  28201. <pre class="example">select=1
  28202. </pre></div>
  28203. </li><li> Skip all frames:
  28204. <div class="example">
  28205. <pre class="example">select=0
  28206. </pre></div>
  28207. </li><li> Select only I-frames:
  28208. <div class="example">
  28209. <pre class="example">select='eq(pict_type\,I)'
  28210. </pre></div>
  28211. </li><li> Select one frame every 100:
  28212. <div class="example">
  28213. <pre class="example">select='not(mod(n\,100))'
  28214. </pre></div>
  28215. </li><li> Select only frames contained in the 10-20 time interval:
  28216. <div class="example">
  28217. <pre class="example">select=between(t\,10\,20)
  28218. </pre></div>
  28219. </li><li> Select only I-frames contained in the 10-20 time interval:
  28220. <div class="example">
  28221. <pre class="example">select=between(t\,10\,20)*eq(pict_type\,I)
  28222. </pre></div>
  28223. </li><li> Select frames with a minimum distance of 10 seconds:
  28224. <div class="example">
  28225. <pre class="example">select='isnan(prev_selected_t)+gte(t-prev_selected_t\,10)'
  28226. </pre></div>
  28227. </li><li> Use aselect to select only audio frames with samples number &gt; 100:
  28228. <div class="example">
  28229. <pre class="example">aselect='gt(samples_n\,100)'
  28230. </pre></div>
  28231. </li><li> Create a mosaic of the first scenes:
  28232. <div class="example">
  28233. <pre class="example">ffmpeg -i video.avi -vf select='gt(scene\,0.4)',scale=160:120,tile -frames:v 1 preview.png
  28234. </pre></div>
  28235. <p>Comparing <var>scene</var> against a value between 0.3 and 0.5 is generally a sane
  28236. choice.
  28237. </p>
  28238. </li><li> Send even and odd frames to separate outputs, and compose them:
  28239. <div class="example">
  28240. <pre class="example">select=n=2:e='mod(n, 2)+1' [odd][even]; [odd] pad=h=2*ih [tmp]; [tmp][even] overlay=y=h
  28241. </pre></div>
  28242. </li><li> Select useful frames from an ffconcat file which is using inpoints and
  28243. outpoints but where the source files are not intra frame only.
  28244. <div class="example">
  28245. <pre class="example">ffmpeg -copyts -vsync 0 -segment_time_metadata 1 -i input.ffconcat -vf select=concatdec_select -af aselect=concatdec_select output.avi
  28246. </pre></div>
  28247. </li></ul>
  28248. <a name="sendcmd_002c-asendcmd"></a>
  28249. <h3 class="section">16.15 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>
  28250. <p>Send commands to filters in the filtergraph.
  28251. </p>
  28252. <p>These filters read commands to be sent to other filters in the
  28253. filtergraph.
  28254. </p>
  28255. <p><code>sendcmd</code> must be inserted between two video filters,
  28256. <code>asendcmd</code> must be inserted between two audio filters, but apart
  28257. from that they act the same way.
  28258. </p>
  28259. <p>The specification of commands can be provided in the filter arguments
  28260. with the <var>commands</var> option, or in a file specified by the
  28261. <var>filename</var> option.
  28262. </p>
  28263. <p>These filters accept the following options:
  28264. </p><dl compact="compact">
  28265. <dt><samp>commands, c</samp></dt>
  28266. <dd><p>Set the commands to be read and sent to the other filters.
  28267. </p></dd>
  28268. <dt><samp>filename, f</samp></dt>
  28269. <dd><p>Set the filename of the commands to be read and sent to the other
  28270. filters.
  28271. </p></dd>
  28272. </dl>
  28273. <a name="Commands-syntax"></a>
  28274. <h4 class="subsection">16.15.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>
  28275. <p>A commands description consists of a sequence of interval
  28276. specifications, comprising a list of commands to be executed when a
  28277. particular event related to that interval occurs. The occurring event
  28278. is typically the current frame time entering or leaving a given time
  28279. interval.
  28280. </p>
  28281. <p>An interval is specified by the following syntax:
  28282. </p><div class="example">
  28283. <pre class="example"><var>START</var>[-<var>END</var>] <var>COMMANDS</var>;
  28284. </pre></div>
  28285. <p>The time interval is specified by the <var>START</var> and <var>END</var> times.
  28286. <var>END</var> is optional and defaults to the maximum time.
  28287. </p>
  28288. <p>The current frame time is considered within the specified interval if
  28289. it is included in the interval [<var>START</var>, <var>END</var>), that is when
  28290. the time is greater or equal to <var>START</var> and is lesser than
  28291. <var>END</var>.
  28292. </p>
  28293. <p><var>COMMANDS</var> consists of a sequence of one or more command
  28294. specifications, separated by &quot;,&quot;, relating to that interval. The
  28295. syntax of a command specification is given by:
  28296. </p><div class="example">
  28297. <pre class="example">[<var>FLAGS</var>] <var>TARGET</var> <var>COMMAND</var> <var>ARG</var>
  28298. </pre></div>
  28299. <p><var>FLAGS</var> is optional and specifies the type of events relating to
  28300. the time interval which enable sending the specified command, and must
  28301. be a non-null sequence of identifier flags separated by &quot;+&quot; or &quot;|&quot; and
  28302. enclosed between &quot;[&quot; and &quot;]&quot;.
  28303. </p>
  28304. <p>The following flags are recognized:
  28305. </p><dl compact="compact">
  28306. <dt><samp>enter</samp></dt>
  28307. <dd><p>The command is sent when the current frame timestamp enters the
  28308. specified interval. In other words, the command is sent when the
  28309. previous frame timestamp was not in the given interval, and the
  28310. current is.
  28311. </p>
  28312. </dd>
  28313. <dt><samp>leave</samp></dt>
  28314. <dd><p>The command is sent when the current frame timestamp leaves the
  28315. specified interval. In other words, the command is sent when the
  28316. previous frame timestamp was in the given interval, and the
  28317. current is not.
  28318. </p>
  28319. </dd>
  28320. <dt><samp>expr</samp></dt>
  28321. <dd><p>The command <var>ARG</var> is interpreted as expression and result of
  28322. expression is passed as <var>ARG</var>.
  28323. </p>
  28324. <p>The expression is evaluated through the eval API and can contain the following
  28325. constants:
  28326. </p>
  28327. <dl compact="compact">
  28328. <dt><samp>POS</samp></dt>
  28329. <dd><p>Original position in the file of the frame, or undefined if undefined
  28330. for the current frame.
  28331. </p>
  28332. </dd>
  28333. <dt><samp>PTS</samp></dt>
  28334. <dd><p>The presentation timestamp in input.
  28335. </p>
  28336. </dd>
  28337. <dt><samp>N</samp></dt>
  28338. <dd><p>The count of the input frame for video or audio, starting from 0.
  28339. </p>
  28340. </dd>
  28341. <dt><samp>T</samp></dt>
  28342. <dd><p>The time in seconds of the current frame.
  28343. </p>
  28344. </dd>
  28345. <dt><samp>TS</samp></dt>
  28346. <dd><p>The start time in seconds of the current command interval.
  28347. </p>
  28348. </dd>
  28349. <dt><samp>TE</samp></dt>
  28350. <dd><p>The end time in seconds of the current command interval.
  28351. </p>
  28352. </dd>
  28353. <dt><samp>TI</samp></dt>
  28354. <dd><p>The interpolated time of the current command interval, TI = (T - TS) / (TE - TS).
  28355. </p></dd>
  28356. </dl>
  28357. </dd>
  28358. </dl>
  28359. <p>If <var>FLAGS</var> is not specified, a default value of <code>[enter]</code> is
  28360. assumed.
  28361. </p>
  28362. <p><var>TARGET</var> specifies the target of the command, usually the name of
  28363. the filter class or a specific filter instance name.
  28364. </p>
  28365. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  28366. </p>
  28367. <p><var>ARG</var> is optional and specifies the optional list of argument for
  28368. the given <var>COMMAND</var>.
  28369. </p>
  28370. <p>Between one interval specification and another, whitespaces, or
  28371. sequences of characters starting with <code>#</code> until the end of line,
  28372. are ignored and can be used to annotate comments.
  28373. </p>
  28374. <p>A simplified BNF description of the commands specification syntax
  28375. follows:
  28376. </p><div class="example">
  28377. <pre class="example"><var>COMMAND_FLAG</var> ::= &quot;enter&quot; | &quot;leave&quot;
  28378. <var>COMMAND_FLAGS</var> ::= <var>COMMAND_FLAG</var> [(+|&quot;|&quot;)<var>COMMAND_FLAG</var>]
  28379. <var>COMMAND</var> ::= [&quot;[&quot; <var>COMMAND_FLAGS</var> &quot;]&quot;] <var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  28380. <var>COMMANDS</var> ::= <var>COMMAND</var> [,<var>COMMANDS</var>]
  28381. <var>INTERVAL</var> ::= <var>START</var>[-<var>END</var>] <var>COMMANDS</var>
  28382. <var>INTERVALS</var> ::= <var>INTERVAL</var>[;<var>INTERVALS</var>]
  28383. </pre></div>
  28384. <a name="Examples-143"></a>
  28385. <h4 class="subsection">16.15.2 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>
  28386. <ul>
  28387. <li> Specify audio tempo change at second 4:
  28388. <div class="example">
  28389. <pre class="example">asendcmd=c='4.0 atempo tempo 1.5',atempo
  28390. </pre></div>
  28391. </li><li> Target a specific filter instance:
  28392. <div class="example">
  28393. <pre class="example">asendcmd=c='4.0 atempo@my tempo 1.5',atempo@my
  28394. </pre></div>
  28395. </li><li> Specify a list of drawtext and hue commands in a file.
  28396. <div class="example">
  28397. <pre class="example"># show text in the interval 5-10
  28398. 5.0-10.0 [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=hello world',
  28399. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=';
  28400. # desaturate the image in the interval 15-20
  28401. 15.0-20.0 [enter] hue s 0,
  28402. [enter] drawtext reinit 'fontfile=FreeSerif.ttf:text=nocolor',
  28403. [leave] hue s 1,
  28404. [leave] drawtext reinit 'fontfile=FreeSerif.ttf:text=color';
  28405. # apply an exponential saturation fade-out effect, starting from time 25
  28406. 25 [enter] hue s exp(25-t)
  28407. </pre></div>
  28408. <p>A filtergraph allowing to read and process the above command list
  28409. stored in a file <samp>test.cmd</samp>, can be specified with:
  28410. </p><div class="example">
  28411. <pre class="example">sendcmd=f=test.cmd,drawtext=fontfile=FreeSerif.ttf:text='',hue
  28412. </pre></div>
  28413. </li></ul>
  28414. <span id="setpts"></span><a name="setpts_002c-asetpts"></a>
  28415. <h3 class="section">16.16 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>
  28416. <p>Change the PTS (presentation timestamp) of the input frames.
  28417. </p>
  28418. <p><code>setpts</code> works on video frames, <code>asetpts</code> on audio frames.
  28419. </p>
  28420. <p>This filter accepts the following options:
  28421. </p>
  28422. <dl compact="compact">
  28423. <dt><samp>expr</samp></dt>
  28424. <dd><p>The expression which is evaluated for each frame to construct its timestamp.
  28425. </p>
  28426. </dd>
  28427. </dl>
  28428. <p>The expression is evaluated through the eval API and can contain the following
  28429. constants:
  28430. </p>
  28431. <dl compact="compact">
  28432. <dt><samp>FRAME_RATE, FR</samp></dt>
  28433. <dd><p>frame rate, only defined for constant frame-rate video
  28434. </p>
  28435. </dd>
  28436. <dt><samp>PTS</samp></dt>
  28437. <dd><p>The presentation timestamp in input
  28438. </p>
  28439. </dd>
  28440. <dt><samp>N</samp></dt>
  28441. <dd><p>The count of the input frame for video or the number of consumed samples,
  28442. not including the current frame for audio, starting from 0.
  28443. </p>
  28444. </dd>
  28445. <dt><samp>NB_CONSUMED_SAMPLES</samp></dt>
  28446. <dd><p>The number of consumed samples, not including the current frame (only
  28447. audio)
  28448. </p>
  28449. </dd>
  28450. <dt><samp>NB_SAMPLES, S</samp></dt>
  28451. <dd><p>The number of samples in the current frame (only audio)
  28452. </p>
  28453. </dd>
  28454. <dt><samp>SAMPLE_RATE, SR</samp></dt>
  28455. <dd><p>The audio sample rate.
  28456. </p>
  28457. </dd>
  28458. <dt><samp>STARTPTS</samp></dt>
  28459. <dd><p>The PTS of the first frame.
  28460. </p>
  28461. </dd>
  28462. <dt><samp>STARTT</samp></dt>
  28463. <dd><p>the time in seconds of the first frame
  28464. </p>
  28465. </dd>
  28466. <dt><samp>INTERLACED</samp></dt>
  28467. <dd><p>State whether the current frame is interlaced.
  28468. </p>
  28469. </dd>
  28470. <dt><samp>T</samp></dt>
  28471. <dd><p>the time in seconds of the current frame
  28472. </p>
  28473. </dd>
  28474. <dt><samp>POS</samp></dt>
  28475. <dd><p>original position in the file of the frame, or undefined if undefined
  28476. for the current frame
  28477. </p>
  28478. </dd>
  28479. <dt><samp>PREV_INPTS</samp></dt>
  28480. <dd><p>The previous input PTS.
  28481. </p>
  28482. </dd>
  28483. <dt><samp>PREV_INT</samp></dt>
  28484. <dd><p>previous input time in seconds
  28485. </p>
  28486. </dd>
  28487. <dt><samp>PREV_OUTPTS</samp></dt>
  28488. <dd><p>The previous output PTS.
  28489. </p>
  28490. </dd>
  28491. <dt><samp>PREV_OUTT</samp></dt>
  28492. <dd><p>previous output time in seconds
  28493. </p>
  28494. </dd>
  28495. <dt><samp>RTCTIME</samp></dt>
  28496. <dd><p>The wallclock (RTC) time in microseconds. This is deprecated, use time(0)
  28497. instead.
  28498. </p>
  28499. </dd>
  28500. <dt><samp>RTCSTART</samp></dt>
  28501. <dd><p>The wallclock (RTC) time at the start of the movie in microseconds.
  28502. </p>
  28503. </dd>
  28504. <dt><samp>TB</samp></dt>
  28505. <dd><p>The timebase of the input timestamps.
  28506. </p>
  28507. </dd>
  28508. </dl>
  28509. <a name="Examples-144"></a>
  28510. <h4 class="subsection">16.16.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>
  28511. <ul>
  28512. <li> Start counting PTS from zero
  28513. <div class="example">
  28514. <pre class="example">setpts=PTS-STARTPTS
  28515. </pre></div>
  28516. </li><li> Apply fast motion effect:
  28517. <div class="example">
  28518. <pre class="example">setpts=0.5*PTS
  28519. </pre></div>
  28520. </li><li> Apply slow motion effect:
  28521. <div class="example">
  28522. <pre class="example">setpts=2.0*PTS
  28523. </pre></div>
  28524. </li><li> Set fixed rate of 25 frames per second:
  28525. <div class="example">
  28526. <pre class="example">setpts=N/(25*TB)
  28527. </pre></div>
  28528. </li><li> Set fixed rate 25 fps with some jitter:
  28529. <div class="example">
  28530. <pre class="example">setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
  28531. </pre></div>
  28532. </li><li> Apply an offset of 10 seconds to the input PTS:
  28533. <div class="example">
  28534. <pre class="example">setpts=PTS+10/TB
  28535. </pre></div>
  28536. </li><li> Generate timestamps from a &quot;live source&quot; and rebase onto the current timebase:
  28537. <div class="example">
  28538. <pre class="example">setpts='(RTCTIME - RTCSTART) / (TB * 1000000)'
  28539. </pre></div>
  28540. </li><li> Generate timestamps by counting samples:
  28541. <div class="example">
  28542. <pre class="example">asetpts=N/SR/TB
  28543. </pre></div>
  28544. </li></ul>
  28545. <a name="setrange"></a>
  28546. <h3 class="section">16.17 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>
  28547. <p>Force color range for the output video frame.
  28548. </p>
  28549. <p>The <code>setrange</code> filter marks the color range property for the
  28550. output frames. It does not change the input frame, but only sets the
  28551. corresponding property, which affects how the frame is treated by
  28552. following filters.
  28553. </p>
  28554. <p>The filter accepts the following options:
  28555. </p>
  28556. <dl compact="compact">
  28557. <dt><samp>range</samp></dt>
  28558. <dd><p>Available values are:
  28559. </p>
  28560. <dl compact="compact">
  28561. <dt>&lsquo;<samp>auto</samp>&rsquo;</dt>
  28562. <dd><p>Keep the same color range property.
  28563. </p>
  28564. </dd>
  28565. <dt>&lsquo;<samp>unspecified, unknown</samp>&rsquo;</dt>
  28566. <dd><p>Set the color range as unspecified.
  28567. </p>
  28568. </dd>
  28569. <dt>&lsquo;<samp>limited, tv, mpeg</samp>&rsquo;</dt>
  28570. <dd><p>Set the color range as limited.
  28571. </p>
  28572. </dd>
  28573. <dt>&lsquo;<samp>full, pc, jpeg</samp>&rsquo;</dt>
  28574. <dd><p>Set the color range as full.
  28575. </p></dd>
  28576. </dl>
  28577. </dd>
  28578. </dl>
  28579. <a name="settb_002c-asettb"></a>
  28580. <h3 class="section">16.18 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>
  28581. <p>Set the timebase to use for the output frames timestamps.
  28582. It is mainly useful for testing timebase configuration.
  28583. </p>
  28584. <p>It accepts the following parameters:
  28585. </p>
  28586. <dl compact="compact">
  28587. <dt><samp>expr, tb</samp></dt>
  28588. <dd><p>The expression which is evaluated into the output timebase.
  28589. </p>
  28590. </dd>
  28591. </dl>
  28592. <p>The value for <samp>tb</samp> is an arithmetic expression representing a
  28593. rational. The expression can contain the constants &quot;AVTB&quot; (the default
  28594. timebase), &quot;intb&quot; (the input timebase) and &quot;sr&quot; (the sample rate,
  28595. audio only). Default value is &quot;intb&quot;.
  28596. </p>
  28597. <a name="Examples-145"></a>
  28598. <h4 class="subsection">16.18.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>
  28599. <ul>
  28600. <li> Set the timebase to 1/25:
  28601. <div class="example">
  28602. <pre class="example">settb=expr=1/25
  28603. </pre></div>
  28604. </li><li> Set the timebase to 1/10:
  28605. <div class="example">
  28606. <pre class="example">settb=expr=0.1
  28607. </pre></div>
  28608. </li><li> Set the timebase to 1001/1000:
  28609. <div class="example">
  28610. <pre class="example">settb=1+0.001
  28611. </pre></div>
  28612. </li><li> Set the timebase to 2*intb:
  28613. <div class="example">
  28614. <pre class="example">settb=2*intb
  28615. </pre></div>
  28616. </li><li> Set the default timebase value:
  28617. <div class="example">
  28618. <pre class="example">settb=AVTB
  28619. </pre></div>
  28620. </li></ul>
  28621. <a name="showcqt"></a>
  28622. <h3 class="section">16.19 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>
  28623. <p>Convert input audio to a video output representing frequency spectrum
  28624. logarithmically using Brown-Puckette constant Q transform algorithm with
  28625. direct frequency domain coefficient calculation (but the transform itself
  28626. is not really constant Q, instead the Q factor is actually variable/clamped),
  28627. with musical tone scale, from E0 to D#10.
  28628. </p>
  28629. <p>The filter accepts the following options:
  28630. </p>
  28631. <dl compact="compact">
  28632. <dt><samp>size, s</samp></dt>
  28633. <dd><p>Specify the video size for the output. It must be even. For the syntax of this option,
  28634. check the <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28635. Default value is <code>1920x1080</code>.
  28636. </p>
  28637. </dd>
  28638. <dt><samp>fps, rate, r</samp></dt>
  28639. <dd><p>Set the output frame rate. Default value is <code>25</code>.
  28640. </p>
  28641. </dd>
  28642. <dt><samp>bar_h</samp></dt>
  28643. <dd><p>Set the bargraph height. It must be even. Default value is <code>-1</code> which
  28644. computes the bargraph height automatically.
  28645. </p>
  28646. </dd>
  28647. <dt><samp>axis_h</samp></dt>
  28648. <dd><p>Set the axis height. It must be even. Default value is <code>-1</code> which computes
  28649. the axis height automatically.
  28650. </p>
  28651. </dd>
  28652. <dt><samp>sono_h</samp></dt>
  28653. <dd><p>Set the sonogram height. It must be even. Default value is <code>-1</code> which
  28654. computes the sonogram height automatically.
  28655. </p>
  28656. </dd>
  28657. <dt><samp>fullhd</samp></dt>
  28658. <dd><p>Set the fullhd resolution. This option is deprecated, use <var>size</var>, <var>s</var>
  28659. instead. Default value is <code>1</code>.
  28660. </p>
  28661. </dd>
  28662. <dt><samp>sono_v, volume</samp></dt>
  28663. <dd><p>Specify the sonogram volume expression. It can contain variables:
  28664. </p><dl compact="compact">
  28665. <dt><samp>bar_v</samp></dt>
  28666. <dd><p>the <var>bar_v</var> evaluated expression
  28667. </p></dd>
  28668. <dt><samp>frequency, freq, f</samp></dt>
  28669. <dd><p>the frequency where it is evaluated
  28670. </p></dd>
  28671. <dt><samp>timeclamp, tc</samp></dt>
  28672. <dd><p>the value of <var>timeclamp</var> option
  28673. </p></dd>
  28674. </dl>
  28675. <p>and functions:
  28676. </p><dl compact="compact">
  28677. <dt><samp>a_weighting(f)</samp></dt>
  28678. <dd><p>A-weighting of equal loudness
  28679. </p></dd>
  28680. <dt><samp>b_weighting(f)</samp></dt>
  28681. <dd><p>B-weighting of equal loudness
  28682. </p></dd>
  28683. <dt><samp>c_weighting(f)</samp></dt>
  28684. <dd><p>C-weighting of equal loudness.
  28685. </p></dd>
  28686. </dl>
  28687. <p>Default value is <code>16</code>.
  28688. </p>
  28689. </dd>
  28690. <dt><samp>bar_v, volume2</samp></dt>
  28691. <dd><p>Specify the bargraph volume expression. It can contain variables:
  28692. </p><dl compact="compact">
  28693. <dt><samp>sono_v</samp></dt>
  28694. <dd><p>the <var>sono_v</var> evaluated expression
  28695. </p></dd>
  28696. <dt><samp>frequency, freq, f</samp></dt>
  28697. <dd><p>the frequency where it is evaluated
  28698. </p></dd>
  28699. <dt><samp>timeclamp, tc</samp></dt>
  28700. <dd><p>the value of <var>timeclamp</var> option
  28701. </p></dd>
  28702. </dl>
  28703. <p>and functions:
  28704. </p><dl compact="compact">
  28705. <dt><samp>a_weighting(f)</samp></dt>
  28706. <dd><p>A-weighting of equal loudness
  28707. </p></dd>
  28708. <dt><samp>b_weighting(f)</samp></dt>
  28709. <dd><p>B-weighting of equal loudness
  28710. </p></dd>
  28711. <dt><samp>c_weighting(f)</samp></dt>
  28712. <dd><p>C-weighting of equal loudness.
  28713. </p></dd>
  28714. </dl>
  28715. <p>Default value is <code>sono_v</code>.
  28716. </p>
  28717. </dd>
  28718. <dt><samp>sono_g, gamma</samp></dt>
  28719. <dd><p>Specify the sonogram gamma. Lower gamma makes the spectrum more contrast,
  28720. higher gamma makes the spectrum having more range. Default value is <code>3</code>.
  28721. Acceptable range is <code>[1, 7]</code>.
  28722. </p>
  28723. </dd>
  28724. <dt><samp>bar_g, gamma2</samp></dt>
  28725. <dd><p>Specify the bargraph gamma. Default value is <code>1</code>. Acceptable range is
  28726. <code>[1, 7]</code>.
  28727. </p>
  28728. </dd>
  28729. <dt><samp>bar_t</samp></dt>
  28730. <dd><p>Specify the bargraph transparency level. Lower value makes the bargraph sharper.
  28731. Default value is <code>1</code>. Acceptable range is <code>[0, 1]</code>.
  28732. </p>
  28733. </dd>
  28734. <dt><samp>timeclamp, tc</samp></dt>
  28735. <dd><p>Specify the transform timeclamp. At low frequency, there is trade-off between
  28736. accuracy in time domain and frequency domain. If timeclamp is lower,
  28737. event in time domain is represented more accurately (such as fast bass drum),
  28738. otherwise event in frequency domain is represented more accurately
  28739. (such as bass guitar). Acceptable range is <code>[0.002, 1]</code>. Default value is <code>0.17</code>.
  28740. </p>
  28741. </dd>
  28742. <dt><samp>attack</samp></dt>
  28743. <dd><p>Set attack time in seconds. The default is <code>0</code> (disabled). Otherwise, it
  28744. limits future samples by applying asymmetric windowing in time domain, useful
  28745. when low latency is required. Accepted range is <code>[0, 1]</code>.
  28746. </p>
  28747. </dd>
  28748. <dt><samp>basefreq</samp></dt>
  28749. <dd><p>Specify the transform base frequency. Default value is <code>20.01523126408007475</code>,
  28750. which is frequency 50 cents below E0. Acceptable range is <code>[10, 100000]</code>.
  28751. </p>
  28752. </dd>
  28753. <dt><samp>endfreq</samp></dt>
  28754. <dd><p>Specify the transform end frequency. Default value is <code>20495.59681441799654</code>,
  28755. which is frequency 50 cents above D#10. Acceptable range is <code>[10, 100000]</code>.
  28756. </p>
  28757. </dd>
  28758. <dt><samp>coeffclamp</samp></dt>
  28759. <dd><p>This option is deprecated and ignored.
  28760. </p>
  28761. </dd>
  28762. <dt><samp>tlength</samp></dt>
  28763. <dd><p>Specify the transform length in time domain. Use this option to control accuracy
  28764. trade-off between time domain and frequency domain at every frequency sample.
  28765. It can contain variables:
  28766. </p><dl compact="compact">
  28767. <dt><samp>frequency, freq, f</samp></dt>
  28768. <dd><p>the frequency where it is evaluated
  28769. </p></dd>
  28770. <dt><samp>timeclamp, tc</samp></dt>
  28771. <dd><p>the value of <var>timeclamp</var> option.
  28772. </p></dd>
  28773. </dl>
  28774. <p>Default value is <code>384*tc/(384+tc*f)</code>.
  28775. </p>
  28776. </dd>
  28777. <dt><samp>count</samp></dt>
  28778. <dd><p>Specify the transform count for every video frame. Default value is <code>6</code>.
  28779. Acceptable range is <code>[1, 30]</code>.
  28780. </p>
  28781. </dd>
  28782. <dt><samp>fcount</samp></dt>
  28783. <dd><p>Specify the transform count for every single pixel. Default value is <code>0</code>,
  28784. which makes it computed automatically. Acceptable range is <code>[0, 10]</code>.
  28785. </p>
  28786. </dd>
  28787. <dt><samp>fontfile</samp></dt>
  28788. <dd><p>Specify font file for use with freetype to draw the axis. If not specified,
  28789. use embedded font. Note that drawing with font file or embedded font is not
  28790. implemented with custom <var>basefreq</var> and <var>endfreq</var>, use <var>axisfile</var>
  28791. option instead.
  28792. </p>
  28793. </dd>
  28794. <dt><samp>font</samp></dt>
  28795. <dd><p>Specify fontconfig pattern. This has lower priority than <var>fontfile</var>. The
  28796. <code>:</code> in the pattern may be replaced by <code>|</code> to avoid unnecessary
  28797. escaping.
  28798. </p>
  28799. </dd>
  28800. <dt><samp>fontcolor</samp></dt>
  28801. <dd><p>Specify font color expression. This is arithmetic expression that should return
  28802. integer value 0xRRGGBB. It can contain variables:
  28803. </p><dl compact="compact">
  28804. <dt><samp>frequency, freq, f</samp></dt>
  28805. <dd><p>the frequency where it is evaluated
  28806. </p></dd>
  28807. <dt><samp>timeclamp, tc</samp></dt>
  28808. <dd><p>the value of <var>timeclamp</var> option
  28809. </p></dd>
  28810. </dl>
  28811. <p>and functions:
  28812. </p><dl compact="compact">
  28813. <dt><samp>midi(f)</samp></dt>
  28814. <dd><p>midi number of frequency f, some midi numbers: E0(16), C1(24), C2(36), A4(69)
  28815. </p></dd>
  28816. <dt><samp>r(x), g(x), b(x)</samp></dt>
  28817. <dd><p>red, green, and blue value of intensity x.
  28818. </p></dd>
  28819. </dl>
  28820. <p>Default value is <code>st(0, (midi(f)-59.5)/12);
  28821. st(1, if(between(ld(0),0,1), 0.5-0.5*cos(2*PI*ld(0)), 0));
  28822. r(1-ld(1)) + b(ld(1))</code>.
  28823. </p>
  28824. </dd>
  28825. <dt><samp>axisfile</samp></dt>
  28826. <dd><p>Specify image file to draw the axis. This option override <var>fontfile</var> and
  28827. <var>fontcolor</var> option.
  28828. </p>
  28829. </dd>
  28830. <dt><samp>axis, text</samp></dt>
  28831. <dd><p>Enable/disable drawing text to the axis. If it is set to <code>0</code>, drawing to
  28832. the axis is disabled, ignoring <var>fontfile</var> and <var>axisfile</var> option.
  28833. Default value is <code>1</code>.
  28834. </p>
  28835. </dd>
  28836. <dt><samp>csp</samp></dt>
  28837. <dd><p>Set colorspace. The accepted values are:
  28838. </p><dl compact="compact">
  28839. <dt>&lsquo;<samp>unspecified</samp>&rsquo;</dt>
  28840. <dd><p>Unspecified (default)
  28841. </p>
  28842. </dd>
  28843. <dt>&lsquo;<samp>bt709</samp>&rsquo;</dt>
  28844. <dd><p>BT.709
  28845. </p>
  28846. </dd>
  28847. <dt>&lsquo;<samp>fcc</samp>&rsquo;</dt>
  28848. <dd><p>FCC
  28849. </p>
  28850. </dd>
  28851. <dt>&lsquo;<samp>bt470bg</samp>&rsquo;</dt>
  28852. <dd><p>BT.470BG or BT.601-6 625
  28853. </p>
  28854. </dd>
  28855. <dt>&lsquo;<samp>smpte170m</samp>&rsquo;</dt>
  28856. <dd><p>SMPTE-170M or BT.601-6 525
  28857. </p>
  28858. </dd>
  28859. <dt>&lsquo;<samp>smpte240m</samp>&rsquo;</dt>
  28860. <dd><p>SMPTE-240M
  28861. </p>
  28862. </dd>
  28863. <dt>&lsquo;<samp>bt2020ncl</samp>&rsquo;</dt>
  28864. <dd><p>BT.2020 with non-constant luminance
  28865. </p>
  28866. </dd>
  28867. </dl>
  28868. </dd>
  28869. <dt><samp>cscheme</samp></dt>
  28870. <dd><p>Set spectrogram color scheme. This is list of floating point values with format
  28871. <code>left_r|left_g|left_b|right_r|right_g|right_b</code>.
  28872. The default is <code>1|0.5|0|0|0.5|1</code>.
  28873. </p>
  28874. </dd>
  28875. </dl>
  28876. <a name="Examples-146"></a>
  28877. <h4 class="subsection">16.19.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>
  28878. <ul>
  28879. <li> Playing audio while showing the spectrum:
  28880. <div class="example">
  28881. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt [out0]'
  28882. </pre></div>
  28883. </li><li> Same as above, but with frame rate 30 fps:
  28884. <div class="example">
  28885. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=fps=30:count=5 [out0]'
  28886. </pre></div>
  28887. </li><li> Playing at 1280x720:
  28888. <div class="example">
  28889. <pre class="example">ffplay -f lavfi 'amovie=a.mp3, asplit [a][out1]; [a] showcqt=s=1280x720:count=4 [out0]'
  28890. </pre></div>
  28891. </li><li> Disable sonogram display:
  28892. <div class="example">
  28893. <pre class="example">sono_h=0
  28894. </pre></div>
  28895. </li><li> A1 and its harmonics: A1, A2, (near)E3, A3:
  28896. <div class="example">
  28897. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  28898. asplit[a][out1]; [a] showcqt [out0]'
  28899. </pre></div>
  28900. </li><li> Same as above, but with more accuracy in frequency domain:
  28901. <div class="example">
  28902. <pre class="example">ffplay -f lavfi 'aevalsrc=0.1*sin(2*PI*55*t)+0.1*sin(4*PI*55*t)+0.1*sin(6*PI*55*t)+0.1*sin(8*PI*55*t),
  28903. asplit[a][out1]; [a] showcqt=timeclamp=0.5 [out0]'
  28904. </pre></div>
  28905. </li><li> Custom volume:
  28906. <div class="example">
  28907. <pre class="example">bar_v=10:sono_v=bar_v*a_weighting(f)
  28908. </pre></div>
  28909. </li><li> Custom gamma, now spectrum is linear to the amplitude.
  28910. <div class="example">
  28911. <pre class="example">bar_g=2:sono_g=2
  28912. </pre></div>
  28913. </li><li> Custom tlength equation:
  28914. <div class="example">
  28915. <pre class="example">tc=0.33:tlength='st(0,0.17); 384*tc / (384 / ld(0) + tc*f /(1-ld(0))) + 384*tc / (tc*f / ld(0) + 384 /(1-ld(0)))'
  28916. </pre></div>
  28917. </li><li> Custom fontcolor and fontfile, C-note is colored green, others are colored blue:
  28918. <div class="example">
  28919. <pre class="example">fontcolor='if(mod(floor(midi(f)+0.5),12), 0x0000FF, g(1))':fontfile=myfont.ttf
  28920. </pre></div>
  28921. </li><li> Custom font using fontconfig:
  28922. <div class="example">
  28923. <pre class="example">font='Courier New,Monospace,mono|bold'
  28924. </pre></div>
  28925. </li><li> Custom frequency range with custom axis using image file:
  28926. <div class="example">
  28927. <pre class="example">axisfile=myaxis.png:basefreq=40:endfreq=10000
  28928. </pre></div>
  28929. </li></ul>
  28930. <a name="showfreqs"></a>
  28931. <h3 class="section">16.20 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>
  28932. <p>Convert input audio to video output representing the audio power spectrum.
  28933. Audio amplitude is on Y-axis while frequency is on X-axis.
  28934. </p>
  28935. <p>The filter accepts the following options:
  28936. </p>
  28937. <dl compact="compact">
  28938. <dt><samp>size, s</samp></dt>
  28939. <dd><p>Specify size of video. For the syntax of this option, check the
  28940. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  28941. Default is <code>1024x512</code>.
  28942. </p>
  28943. </dd>
  28944. <dt><samp>mode</samp></dt>
  28945. <dd><p>Set display mode.
  28946. This set how each frequency bin will be represented.
  28947. </p>
  28948. <p>It accepts the following values:
  28949. </p><dl compact="compact">
  28950. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  28951. <dt>&lsquo;<samp>bar</samp>&rsquo;</dt>
  28952. <dt>&lsquo;<samp>dot</samp>&rsquo;</dt>
  28953. </dl>
  28954. <p>Default is <code>bar</code>.
  28955. </p>
  28956. </dd>
  28957. <dt><samp>ascale</samp></dt>
  28958. <dd><p>Set amplitude scale.
  28959. </p>
  28960. <p>It accepts the following values:
  28961. </p><dl compact="compact">
  28962. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28963. <dd><p>Linear scale.
  28964. </p>
  28965. </dd>
  28966. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  28967. <dd><p>Square root scale.
  28968. </p>
  28969. </dd>
  28970. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  28971. <dd><p>Cubic root scale.
  28972. </p>
  28973. </dd>
  28974. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28975. <dd><p>Logarithmic scale.
  28976. </p></dd>
  28977. </dl>
  28978. <p>Default is <code>log</code>.
  28979. </p>
  28980. </dd>
  28981. <dt><samp>fscale</samp></dt>
  28982. <dd><p>Set frequency scale.
  28983. </p>
  28984. <p>It accepts the following values:
  28985. </p><dl compact="compact">
  28986. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  28987. <dd><p>Linear scale.
  28988. </p>
  28989. </dd>
  28990. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  28991. <dd><p>Logarithmic scale.
  28992. </p>
  28993. </dd>
  28994. <dt>&lsquo;<samp>rlog</samp>&rsquo;</dt>
  28995. <dd><p>Reverse logarithmic scale.
  28996. </p></dd>
  28997. </dl>
  28998. <p>Default is <code>lin</code>.
  28999. </p>
  29000. </dd>
  29001. <dt><samp>win_size</samp></dt>
  29002. <dd><p>Set window size. Allowed range is from 16 to 65536.
  29003. </p>
  29004. <p>Default is <code>2048</code>
  29005. </p>
  29006. </dd>
  29007. <dt><samp>win_func</samp></dt>
  29008. <dd><p>Set windowing function.
  29009. </p>
  29010. <p>It accepts the following values:
  29011. </p><dl compact="compact">
  29012. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  29013. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  29014. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  29015. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  29016. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  29017. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  29018. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  29019. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  29020. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  29021. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  29022. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  29023. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  29024. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  29025. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  29026. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  29027. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  29028. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  29029. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  29030. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  29031. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  29032. </dl>
  29033. <p>Default is <code>hanning</code>.
  29034. </p>
  29035. </dd>
  29036. <dt><samp>overlap</samp></dt>
  29037. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  29038. which means optimal overlap for selected window function will be picked.
  29039. </p>
  29040. </dd>
  29041. <dt><samp>averaging</samp></dt>
  29042. <dd><p>Set time averaging. Setting this to 0 will display current maximal peaks.
  29043. Default is <code>1</code>, which means time averaging is disabled.
  29044. </p>
  29045. </dd>
  29046. <dt><samp>colors</samp></dt>
  29047. <dd><p>Specify list of colors separated by space or by &rsquo;|&rsquo; which will be used to
  29048. draw channel frequencies. Unrecognized or missing colors will be replaced
  29049. by white color.
  29050. </p>
  29051. </dd>
  29052. <dt><samp>cmode</samp></dt>
  29053. <dd><p>Set channel display mode.
  29054. </p>
  29055. <p>It accepts the following values:
  29056. </p><dl compact="compact">
  29057. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  29058. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  29059. </dl>
  29060. <p>Default is <code>combined</code>.
  29061. </p>
  29062. </dd>
  29063. <dt><samp>minamp</samp></dt>
  29064. <dd><p>Set minimum amplitude used in <code>log</code> amplitude scaler.
  29065. </p>
  29066. </dd>
  29067. <dt><samp>data</samp></dt>
  29068. <dd><p>Set data display mode.
  29069. </p>
  29070. <p>It accepts the following values:
  29071. </p><dl compact="compact">
  29072. <dt>&lsquo;<samp>magnitude</samp>&rsquo;</dt>
  29073. <dt>&lsquo;<samp>phase</samp>&rsquo;</dt>
  29074. <dt>&lsquo;<samp>delay</samp>&rsquo;</dt>
  29075. </dl>
  29076. <p>Default is <code>magnitude</code>.
  29077. </p></dd>
  29078. </dl>
  29079. <a name="showspatial"></a>
  29080. <h3 class="section">16.21 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>
  29081. <p>Convert stereo input audio to a video output, representing the spatial relationship
  29082. between two channels.
  29083. </p>
  29084. <p>The filter accepts the following options:
  29085. </p>
  29086. <dl compact="compact">
  29087. <dt><samp>size, s</samp></dt>
  29088. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  29089. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29090. Default value is <code>512x512</code>.
  29091. </p>
  29092. </dd>
  29093. <dt><samp>win_size</samp></dt>
  29094. <dd><p>Set window size. Allowed range is from <var>1024</var> to <var>65536</var>. Default size is <var>4096</var>.
  29095. </p>
  29096. </dd>
  29097. <dt><samp>win_func</samp></dt>
  29098. <dd><p>Set window function.
  29099. </p>
  29100. <p>It accepts the following values:
  29101. </p><dl compact="compact">
  29102. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  29103. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  29104. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  29105. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  29106. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  29107. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  29108. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  29109. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  29110. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  29111. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  29112. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  29113. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  29114. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  29115. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  29116. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  29117. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  29118. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  29119. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  29120. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  29121. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  29122. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  29123. </dl>
  29124. <p>Default value is <code>hann</code>.
  29125. </p>
  29126. </dd>
  29127. <dt><samp>overlap</samp></dt>
  29128. <dd><p>Set ratio of overlap window. Default value is <code>0.5</code>.
  29129. When value is <code>1</code> overlap is set to recommended size for specific
  29130. window function currently used.
  29131. </p></dd>
  29132. </dl>
  29133. <span id="showspectrum"></span><a name="showspectrum-1"></a>
  29134. <h3 class="section">16.22 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>
  29135. <p>Convert input audio to a video output, representing the audio frequency
  29136. spectrum.
  29137. </p>
  29138. <p>The filter accepts the following options:
  29139. </p>
  29140. <dl compact="compact">
  29141. <dt><samp>size, s</samp></dt>
  29142. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  29143. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29144. Default value is <code>640x512</code>.
  29145. </p>
  29146. </dd>
  29147. <dt><samp>slide</samp></dt>
  29148. <dd><p>Specify how the spectrum should slide along the window.
  29149. </p>
  29150. <p>It accepts the following values:
  29151. </p><dl compact="compact">
  29152. <dt>&lsquo;<samp>replace</samp>&rsquo;</dt>
  29153. <dd><p>the samples start again on the left when they reach the right
  29154. </p></dd>
  29155. <dt>&lsquo;<samp>scroll</samp>&rsquo;</dt>
  29156. <dd><p>the samples scroll from right to left
  29157. </p></dd>
  29158. <dt>&lsquo;<samp>fullframe</samp>&rsquo;</dt>
  29159. <dd><p>frames are only produced when the samples reach the right
  29160. </p></dd>
  29161. <dt>&lsquo;<samp>rscroll</samp>&rsquo;</dt>
  29162. <dd><p>the samples scroll from left to right
  29163. </p></dd>
  29164. </dl>
  29165. <p>Default value is <code>replace</code>.
  29166. </p>
  29167. </dd>
  29168. <dt><samp>mode</samp></dt>
  29169. <dd><p>Specify display mode.
  29170. </p>
  29171. <p>It accepts the following values:
  29172. </p><dl compact="compact">
  29173. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  29174. <dd><p>all channels are displayed in the same row
  29175. </p></dd>
  29176. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  29177. <dd><p>all channels are displayed in separate rows
  29178. </p></dd>
  29179. </dl>
  29180. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  29181. </p>
  29182. </dd>
  29183. <dt><samp>color</samp></dt>
  29184. <dd><p>Specify display color mode.
  29185. </p>
  29186. <p>It accepts the following values:
  29187. </p><dl compact="compact">
  29188. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  29189. <dd><p>each channel is displayed in a separate color
  29190. </p></dd>
  29191. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  29192. <dd><p>each channel is displayed using the same color scheme
  29193. </p></dd>
  29194. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  29195. <dd><p>each channel is displayed using the rainbow color scheme
  29196. </p></dd>
  29197. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  29198. <dd><p>each channel is displayed using the moreland color scheme
  29199. </p></dd>
  29200. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  29201. <dd><p>each channel is displayed using the nebulae color scheme
  29202. </p></dd>
  29203. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  29204. <dd><p>each channel is displayed using the fire color scheme
  29205. </p></dd>
  29206. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  29207. <dd><p>each channel is displayed using the fiery color scheme
  29208. </p></dd>
  29209. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  29210. <dd><p>each channel is displayed using the fruit color scheme
  29211. </p></dd>
  29212. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  29213. <dd><p>each channel is displayed using the cool color scheme
  29214. </p></dd>
  29215. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  29216. <dd><p>each channel is displayed using the magma color scheme
  29217. </p></dd>
  29218. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  29219. <dd><p>each channel is displayed using the green color scheme
  29220. </p></dd>
  29221. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  29222. <dd><p>each channel is displayed using the viridis color scheme
  29223. </p></dd>
  29224. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  29225. <dd><p>each channel is displayed using the plasma color scheme
  29226. </p></dd>
  29227. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  29228. <dd><p>each channel is displayed using the cividis color scheme
  29229. </p></dd>
  29230. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  29231. <dd><p>each channel is displayed using the terrain color scheme
  29232. </p></dd>
  29233. </dl>
  29234. <p>Default value is &lsquo;<samp>channel</samp>&rsquo;.
  29235. </p>
  29236. </dd>
  29237. <dt><samp>scale</samp></dt>
  29238. <dd><p>Specify scale used for calculating intensity color values.
  29239. </p>
  29240. <p>It accepts the following values:
  29241. </p><dl compact="compact">
  29242. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29243. <dd><p>linear
  29244. </p></dd>
  29245. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  29246. <dd><p>square root, default
  29247. </p></dd>
  29248. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  29249. <dd><p>cubic root
  29250. </p></dd>
  29251. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29252. <dd><p>logarithmic
  29253. </p></dd>
  29254. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  29255. <dd><p>4th root
  29256. </p></dd>
  29257. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  29258. <dd><p>5th root
  29259. </p></dd>
  29260. </dl>
  29261. <p>Default value is &lsquo;<samp>sqrt</samp>&rsquo;.
  29262. </p>
  29263. </dd>
  29264. <dt><samp>fscale</samp></dt>
  29265. <dd><p>Specify frequency scale.
  29266. </p>
  29267. <p>It accepts the following values:
  29268. </p><dl compact="compact">
  29269. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29270. <dd><p>linear
  29271. </p></dd>
  29272. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29273. <dd><p>logarithmic
  29274. </p></dd>
  29275. </dl>
  29276. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  29277. </p>
  29278. </dd>
  29279. <dt><samp>saturation</samp></dt>
  29280. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  29281. alternative color scheme. <code>0</code> is no saturation at all.
  29282. Saturation must be in [-10.0, 10.0] range.
  29283. Default value is <code>1</code>.
  29284. </p>
  29285. </dd>
  29286. <dt><samp>win_func</samp></dt>
  29287. <dd><p>Set window function.
  29288. </p>
  29289. <p>It accepts the following values:
  29290. </p><dl compact="compact">
  29291. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  29292. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  29293. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  29294. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  29295. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  29296. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  29297. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  29298. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  29299. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  29300. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  29301. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  29302. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  29303. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  29304. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  29305. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  29306. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  29307. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  29308. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  29309. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  29310. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  29311. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  29312. </dl>
  29313. <p>Default value is <code>hann</code>.
  29314. </p>
  29315. </dd>
  29316. <dt><samp>orientation</samp></dt>
  29317. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  29318. <code>horizontal</code>. Default is <code>vertical</code>.
  29319. </p>
  29320. </dd>
  29321. <dt><samp>overlap</samp></dt>
  29322. <dd><p>Set ratio of overlap window. Default value is <code>0</code>.
  29323. When value is <code>1</code> overlap is set to recommended size for specific
  29324. window function currently used.
  29325. </p>
  29326. </dd>
  29327. <dt><samp>gain</samp></dt>
  29328. <dd><p>Set scale gain for calculating intensity color values.
  29329. Default value is <code>1</code>.
  29330. </p>
  29331. </dd>
  29332. <dt><samp>data</samp></dt>
  29333. <dd><p>Set which data to display. Can be <code>magnitude</code>, default or <code>phase</code>.
  29334. </p>
  29335. </dd>
  29336. <dt><samp>rotation</samp></dt>
  29337. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  29338. Default value is <code>0</code>.
  29339. </p>
  29340. </dd>
  29341. <dt><samp>start</samp></dt>
  29342. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  29343. </p>
  29344. </dd>
  29345. <dt><samp>stop</samp></dt>
  29346. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  29347. </p>
  29348. </dd>
  29349. <dt><samp>fps</samp></dt>
  29350. <dd><p>Set upper frame rate limit. Default is <code>auto</code>, unlimited.
  29351. </p>
  29352. </dd>
  29353. <dt><samp>legend</samp></dt>
  29354. <dd><p>Draw time and frequency axes and legends. Default is disabled.
  29355. </p></dd>
  29356. </dl>
  29357. <p>The usage is very similar to the showwaves filter; see the examples in that
  29358. section.
  29359. </p>
  29360. <a name="Examples-147"></a>
  29361. <h4 class="subsection">16.22.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>
  29362. <ul>
  29363. <li> Large window with logarithmic color scaling:
  29364. <div class="example">
  29365. <pre class="example">showspectrum=s=1280x480:scale=log
  29366. </pre></div>
  29367. </li><li> Complete example for a colored and sliding spectrum per channel using <code>ffplay</code>:
  29368. <div class="example">
  29369. <pre class="example">ffplay -f lavfi 'amovie=input.mp3, asplit [a][out1];
  29370. [a] showspectrum=mode=separate:color=intensity:slide=1:scale=cbrt [out0]'
  29371. </pre></div>
  29372. </li></ul>
  29373. <a name="showspectrumpic"></a>
  29374. <h3 class="section">16.23 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>
  29375. <p>Convert input audio to a single video frame, representing the audio frequency
  29376. spectrum.
  29377. </p>
  29378. <p>The filter accepts the following options:
  29379. </p>
  29380. <dl compact="compact">
  29381. <dt><samp>size, s</samp></dt>
  29382. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  29383. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29384. Default value is <code>4096x2048</code>.
  29385. </p>
  29386. </dd>
  29387. <dt><samp>mode</samp></dt>
  29388. <dd><p>Specify display mode.
  29389. </p>
  29390. <p>It accepts the following values:
  29391. </p><dl compact="compact">
  29392. <dt>&lsquo;<samp>combined</samp>&rsquo;</dt>
  29393. <dd><p>all channels are displayed in the same row
  29394. </p></dd>
  29395. <dt>&lsquo;<samp>separate</samp>&rsquo;</dt>
  29396. <dd><p>all channels are displayed in separate rows
  29397. </p></dd>
  29398. </dl>
  29399. <p>Default value is &lsquo;<samp>combined</samp>&rsquo;.
  29400. </p>
  29401. </dd>
  29402. <dt><samp>color</samp></dt>
  29403. <dd><p>Specify display color mode.
  29404. </p>
  29405. <p>It accepts the following values:
  29406. </p><dl compact="compact">
  29407. <dt>&lsquo;<samp>channel</samp>&rsquo;</dt>
  29408. <dd><p>each channel is displayed in a separate color
  29409. </p></dd>
  29410. <dt>&lsquo;<samp>intensity</samp>&rsquo;</dt>
  29411. <dd><p>each channel is displayed using the same color scheme
  29412. </p></dd>
  29413. <dt>&lsquo;<samp>rainbow</samp>&rsquo;</dt>
  29414. <dd><p>each channel is displayed using the rainbow color scheme
  29415. </p></dd>
  29416. <dt>&lsquo;<samp>moreland</samp>&rsquo;</dt>
  29417. <dd><p>each channel is displayed using the moreland color scheme
  29418. </p></dd>
  29419. <dt>&lsquo;<samp>nebulae</samp>&rsquo;</dt>
  29420. <dd><p>each channel is displayed using the nebulae color scheme
  29421. </p></dd>
  29422. <dt>&lsquo;<samp>fire</samp>&rsquo;</dt>
  29423. <dd><p>each channel is displayed using the fire color scheme
  29424. </p></dd>
  29425. <dt>&lsquo;<samp>fiery</samp>&rsquo;</dt>
  29426. <dd><p>each channel is displayed using the fiery color scheme
  29427. </p></dd>
  29428. <dt>&lsquo;<samp>fruit</samp>&rsquo;</dt>
  29429. <dd><p>each channel is displayed using the fruit color scheme
  29430. </p></dd>
  29431. <dt>&lsquo;<samp>cool</samp>&rsquo;</dt>
  29432. <dd><p>each channel is displayed using the cool color scheme
  29433. </p></dd>
  29434. <dt>&lsquo;<samp>magma</samp>&rsquo;</dt>
  29435. <dd><p>each channel is displayed using the magma color scheme
  29436. </p></dd>
  29437. <dt>&lsquo;<samp>green</samp>&rsquo;</dt>
  29438. <dd><p>each channel is displayed using the green color scheme
  29439. </p></dd>
  29440. <dt>&lsquo;<samp>viridis</samp>&rsquo;</dt>
  29441. <dd><p>each channel is displayed using the viridis color scheme
  29442. </p></dd>
  29443. <dt>&lsquo;<samp>plasma</samp>&rsquo;</dt>
  29444. <dd><p>each channel is displayed using the plasma color scheme
  29445. </p></dd>
  29446. <dt>&lsquo;<samp>cividis</samp>&rsquo;</dt>
  29447. <dd><p>each channel is displayed using the cividis color scheme
  29448. </p></dd>
  29449. <dt>&lsquo;<samp>terrain</samp>&rsquo;</dt>
  29450. <dd><p>each channel is displayed using the terrain color scheme
  29451. </p></dd>
  29452. </dl>
  29453. <p>Default value is &lsquo;<samp>intensity</samp>&rsquo;.
  29454. </p>
  29455. </dd>
  29456. <dt><samp>scale</samp></dt>
  29457. <dd><p>Specify scale used for calculating intensity color values.
  29458. </p>
  29459. <p>It accepts the following values:
  29460. </p><dl compact="compact">
  29461. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29462. <dd><p>linear
  29463. </p></dd>
  29464. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  29465. <dd><p>square root, default
  29466. </p></dd>
  29467. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  29468. <dd><p>cubic root
  29469. </p></dd>
  29470. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29471. <dd><p>logarithmic
  29472. </p></dd>
  29473. <dt>&lsquo;<samp>4thrt</samp>&rsquo;</dt>
  29474. <dd><p>4th root
  29475. </p></dd>
  29476. <dt>&lsquo;<samp>5thrt</samp>&rsquo;</dt>
  29477. <dd><p>5th root
  29478. </p></dd>
  29479. </dl>
  29480. <p>Default value is &lsquo;<samp>log</samp>&rsquo;.
  29481. </p>
  29482. </dd>
  29483. <dt><samp>fscale</samp></dt>
  29484. <dd><p>Specify frequency scale.
  29485. </p>
  29486. <p>It accepts the following values:
  29487. </p><dl compact="compact">
  29488. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29489. <dd><p>linear
  29490. </p></dd>
  29491. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29492. <dd><p>logarithmic
  29493. </p></dd>
  29494. </dl>
  29495. <p>Default value is &lsquo;<samp>lin</samp>&rsquo;.
  29496. </p>
  29497. </dd>
  29498. <dt><samp>saturation</samp></dt>
  29499. <dd><p>Set saturation modifier for displayed colors. Negative values provide
  29500. alternative color scheme. <code>0</code> is no saturation at all.
  29501. Saturation must be in [-10.0, 10.0] range.
  29502. Default value is <code>1</code>.
  29503. </p>
  29504. </dd>
  29505. <dt><samp>win_func</samp></dt>
  29506. <dd><p>Set window function.
  29507. </p>
  29508. <p>It accepts the following values:
  29509. </p><dl compact="compact">
  29510. <dt>&lsquo;<samp>rect</samp>&rsquo;</dt>
  29511. <dt>&lsquo;<samp>bartlett</samp>&rsquo;</dt>
  29512. <dt>&lsquo;<samp>hann</samp>&rsquo;</dt>
  29513. <dt>&lsquo;<samp>hanning</samp>&rsquo;</dt>
  29514. <dt>&lsquo;<samp>hamming</samp>&rsquo;</dt>
  29515. <dt>&lsquo;<samp>blackman</samp>&rsquo;</dt>
  29516. <dt>&lsquo;<samp>welch</samp>&rsquo;</dt>
  29517. <dt>&lsquo;<samp>flattop</samp>&rsquo;</dt>
  29518. <dt>&lsquo;<samp>bharris</samp>&rsquo;</dt>
  29519. <dt>&lsquo;<samp>bnuttall</samp>&rsquo;</dt>
  29520. <dt>&lsquo;<samp>bhann</samp>&rsquo;</dt>
  29521. <dt>&lsquo;<samp>sine</samp>&rsquo;</dt>
  29522. <dt>&lsquo;<samp>nuttall</samp>&rsquo;</dt>
  29523. <dt>&lsquo;<samp>lanczos</samp>&rsquo;</dt>
  29524. <dt>&lsquo;<samp>gauss</samp>&rsquo;</dt>
  29525. <dt>&lsquo;<samp>tukey</samp>&rsquo;</dt>
  29526. <dt>&lsquo;<samp>dolph</samp>&rsquo;</dt>
  29527. <dt>&lsquo;<samp>cauchy</samp>&rsquo;</dt>
  29528. <dt>&lsquo;<samp>parzen</samp>&rsquo;</dt>
  29529. <dt>&lsquo;<samp>poisson</samp>&rsquo;</dt>
  29530. <dt>&lsquo;<samp>bohman</samp>&rsquo;</dt>
  29531. </dl>
  29532. <p>Default value is <code>hann</code>.
  29533. </p>
  29534. </dd>
  29535. <dt><samp>orientation</samp></dt>
  29536. <dd><p>Set orientation of time vs frequency axis. Can be <code>vertical</code> or
  29537. <code>horizontal</code>. Default is <code>vertical</code>.
  29538. </p>
  29539. </dd>
  29540. <dt><samp>gain</samp></dt>
  29541. <dd><p>Set scale gain for calculating intensity color values.
  29542. Default value is <code>1</code>.
  29543. </p>
  29544. </dd>
  29545. <dt><samp>legend</samp></dt>
  29546. <dd><p>Draw time and frequency axes and legends. Default is enabled.
  29547. </p>
  29548. </dd>
  29549. <dt><samp>rotation</samp></dt>
  29550. <dd><p>Set color rotation, must be in [-1.0, 1.0] range.
  29551. Default value is <code>0</code>.
  29552. </p>
  29553. </dd>
  29554. <dt><samp>start</samp></dt>
  29555. <dd><p>Set start frequency from which to display spectrogram. Default is <code>0</code>.
  29556. </p>
  29557. </dd>
  29558. <dt><samp>stop</samp></dt>
  29559. <dd><p>Set stop frequency to which to display spectrogram. Default is <code>0</code>.
  29560. </p></dd>
  29561. </dl>
  29562. <a name="Examples-148"></a>
  29563. <h4 class="subsection">16.23.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>
  29564. <ul>
  29565. <li> Extract an audio spectrogram of a whole audio track
  29566. in a 1024x1024 picture using <code>ffmpeg</code>:
  29567. <div class="example">
  29568. <pre class="example">ffmpeg -i audio.flac -lavfi showspectrumpic=s=1024x1024 spectrogram.png
  29569. </pre></div>
  29570. </li></ul>
  29571. <a name="showvolume"></a>
  29572. <h3 class="section">16.24 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>
  29573. <p>Convert input audio volume to a video output.
  29574. </p>
  29575. <p>The filter accepts the following options:
  29576. </p>
  29577. <dl compact="compact">
  29578. <dt><samp>rate, r</samp></dt>
  29579. <dd><p>Set video rate.
  29580. </p>
  29581. </dd>
  29582. <dt><samp>b</samp></dt>
  29583. <dd><p>Set border width, allowed range is [0, 5]. Default is 1.
  29584. </p>
  29585. </dd>
  29586. <dt><samp>w</samp></dt>
  29587. <dd><p>Set channel width, allowed range is [80, 8192]. Default is 400.
  29588. </p>
  29589. </dd>
  29590. <dt><samp>h</samp></dt>
  29591. <dd><p>Set channel height, allowed range is [1, 900]. Default is 20.
  29592. </p>
  29593. </dd>
  29594. <dt><samp>f</samp></dt>
  29595. <dd><p>Set fade, allowed range is [0, 1]. Default is 0.95.
  29596. </p>
  29597. </dd>
  29598. <dt><samp>c</samp></dt>
  29599. <dd><p>Set volume color expression.
  29600. </p>
  29601. <p>The expression can use the following variables:
  29602. </p>
  29603. <dl compact="compact">
  29604. <dt><samp>VOLUME</samp></dt>
  29605. <dd><p>Current max volume of channel in dB.
  29606. </p>
  29607. </dd>
  29608. <dt><samp>PEAK</samp></dt>
  29609. <dd><p>Current peak.
  29610. </p>
  29611. </dd>
  29612. <dt><samp>CHANNEL</samp></dt>
  29613. <dd><p>Current channel number, starting from 0.
  29614. </p></dd>
  29615. </dl>
  29616. </dd>
  29617. <dt><samp>t</samp></dt>
  29618. <dd><p>If set, displays channel names. Default is enabled.
  29619. </p>
  29620. </dd>
  29621. <dt><samp>v</samp></dt>
  29622. <dd><p>If set, displays volume values. Default is enabled.
  29623. </p>
  29624. </dd>
  29625. <dt><samp>o</samp></dt>
  29626. <dd><p>Set orientation, can be horizontal: <code>h</code> or vertical: <code>v</code>,
  29627. default is <code>h</code>.
  29628. </p>
  29629. </dd>
  29630. <dt><samp>s</samp></dt>
  29631. <dd><p>Set step size, allowed range is [0, 5]. Default is 0, which means
  29632. step is disabled.
  29633. </p>
  29634. </dd>
  29635. <dt><samp>p</samp></dt>
  29636. <dd><p>Set background opacity, allowed range is [0, 1]. Default is 0.
  29637. </p>
  29638. </dd>
  29639. <dt><samp>m</samp></dt>
  29640. <dd><p>Set metering mode, can be peak: <code>p</code> or rms: <code>r</code>,
  29641. default is <code>p</code>.
  29642. </p>
  29643. </dd>
  29644. <dt><samp>ds</samp></dt>
  29645. <dd><p>Set display scale, can be linear: <code>lin</code> or log: <code>log</code>,
  29646. default is <code>lin</code>.
  29647. </p>
  29648. </dd>
  29649. <dt><samp>dm</samp></dt>
  29650. <dd><p>In second.
  29651. If set to &gt; 0., display a line for the max level
  29652. in the previous seconds.
  29653. default is disabled: <code>0.</code>
  29654. </p>
  29655. </dd>
  29656. <dt><samp>dmc</samp></dt>
  29657. <dd><p>The color of the max line. Use when <code>dm</code> option is set to &gt; 0.
  29658. default is: <code>orange</code>
  29659. </p></dd>
  29660. </dl>
  29661. <a name="showwaves"></a>
  29662. <h3 class="section">16.25 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>
  29663. <p>Convert input audio to a video output, representing the samples waves.
  29664. </p>
  29665. <p>The filter accepts the following options:
  29666. </p>
  29667. <dl compact="compact">
  29668. <dt><samp>size, s</samp></dt>
  29669. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  29670. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29671. Default value is <code>600x240</code>.
  29672. </p>
  29673. </dd>
  29674. <dt><samp>mode</samp></dt>
  29675. <dd><p>Set display mode.
  29676. </p>
  29677. <p>Available values are:
  29678. </p><dl compact="compact">
  29679. <dt>&lsquo;<samp>point</samp>&rsquo;</dt>
  29680. <dd><p>Draw a point for each sample.
  29681. </p>
  29682. </dd>
  29683. <dt>&lsquo;<samp>line</samp>&rsquo;</dt>
  29684. <dd><p>Draw a vertical line for each sample.
  29685. </p>
  29686. </dd>
  29687. <dt>&lsquo;<samp>p2p</samp>&rsquo;</dt>
  29688. <dd><p>Draw a point for each sample and a line between them.
  29689. </p>
  29690. </dd>
  29691. <dt>&lsquo;<samp>cline</samp>&rsquo;</dt>
  29692. <dd><p>Draw a centered vertical line for each sample.
  29693. </p></dd>
  29694. </dl>
  29695. <p>Default value is <code>point</code>.
  29696. </p>
  29697. </dd>
  29698. <dt><samp>n</samp></dt>
  29699. <dd><p>Set the number of samples which are printed on the same column. A
  29700. larger value will decrease the frame rate. Must be a positive
  29701. integer. This option can be set only if the value for <var>rate</var>
  29702. is not explicitly specified.
  29703. </p>
  29704. </dd>
  29705. <dt><samp>rate, r</samp></dt>
  29706. <dd><p>Set the (approximate) output frame rate. This is done by setting the
  29707. option <var>n</var>. Default value is &quot;25&quot;.
  29708. </p>
  29709. </dd>
  29710. <dt><samp>split_channels</samp></dt>
  29711. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  29712. </p>
  29713. </dd>
  29714. <dt><samp>colors</samp></dt>
  29715. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  29716. </p>
  29717. </dd>
  29718. <dt><samp>scale</samp></dt>
  29719. <dd><p>Set amplitude scale.
  29720. </p>
  29721. <p>Available values are:
  29722. </p><dl compact="compact">
  29723. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29724. <dd><p>Linear.
  29725. </p>
  29726. </dd>
  29727. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29728. <dd><p>Logarithmic.
  29729. </p>
  29730. </dd>
  29731. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  29732. <dd><p>Square root.
  29733. </p>
  29734. </dd>
  29735. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  29736. <dd><p>Cubic root.
  29737. </p></dd>
  29738. </dl>
  29739. <p>Default is linear.
  29740. </p>
  29741. </dd>
  29742. <dt><samp>draw</samp></dt>
  29743. <dd><p>Set the draw mode. This is mostly useful to set for high <var>n</var>.
  29744. </p>
  29745. <p>Available values are:
  29746. </p><dl compact="compact">
  29747. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  29748. <dd><p>Scale pixel values for each drawn sample.
  29749. </p>
  29750. </dd>
  29751. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  29752. <dd><p>Draw every sample directly.
  29753. </p></dd>
  29754. </dl>
  29755. <p>Default value is <code>scale</code>.
  29756. </p></dd>
  29757. </dl>
  29758. <a name="Examples-149"></a>
  29759. <h4 class="subsection">16.25.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>
  29760. <ul>
  29761. <li> Output the input file audio and the corresponding video representation
  29762. at the same time:
  29763. <div class="example">
  29764. <pre class="example">amovie=a.mp3,asplit[out0],showwaves[out1]
  29765. </pre></div>
  29766. </li><li> Create a synthetic signal and show it with showwaves, forcing a
  29767. frame rate of 30 frames per second:
  29768. <div class="example">
  29769. <pre class="example">aevalsrc=sin(1*2*PI*t)*sin(880*2*PI*t):cos(2*PI*200*t),asplit[out0],showwaves=r=30[out1]
  29770. </pre></div>
  29771. </li></ul>
  29772. <a name="showwavespic"></a>
  29773. <h3 class="section">16.26 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>
  29774. <p>Convert input audio to a single video frame, representing the samples waves.
  29775. </p>
  29776. <p>The filter accepts the following options:
  29777. </p>
  29778. <dl compact="compact">
  29779. <dt><samp>size, s</samp></dt>
  29780. <dd><p>Specify the video size for the output. For the syntax of this option, check the
  29781. <a href="ffmpeg-utils.html#video-size-syntax">(ffmpeg-utils)&quot;Video size&quot; section in the ffmpeg-utils manual</a>.
  29782. Default value is <code>600x240</code>.
  29783. </p>
  29784. </dd>
  29785. <dt><samp>split_channels</samp></dt>
  29786. <dd><p>Set if channels should be drawn separately or overlap. Default value is 0.
  29787. </p>
  29788. </dd>
  29789. <dt><samp>colors</samp></dt>
  29790. <dd><p>Set colors separated by &rsquo;|&rsquo; which are going to be used for drawing of each channel.
  29791. </p>
  29792. </dd>
  29793. <dt><samp>scale</samp></dt>
  29794. <dd><p>Set amplitude scale.
  29795. </p>
  29796. <p>Available values are:
  29797. </p><dl compact="compact">
  29798. <dt>&lsquo;<samp>lin</samp>&rsquo;</dt>
  29799. <dd><p>Linear.
  29800. </p>
  29801. </dd>
  29802. <dt>&lsquo;<samp>log</samp>&rsquo;</dt>
  29803. <dd><p>Logarithmic.
  29804. </p>
  29805. </dd>
  29806. <dt>&lsquo;<samp>sqrt</samp>&rsquo;</dt>
  29807. <dd><p>Square root.
  29808. </p>
  29809. </dd>
  29810. <dt>&lsquo;<samp>cbrt</samp>&rsquo;</dt>
  29811. <dd><p>Cubic root.
  29812. </p></dd>
  29813. </dl>
  29814. <p>Default is linear.
  29815. </p>
  29816. </dd>
  29817. <dt><samp>draw</samp></dt>
  29818. <dd><p>Set the draw mode.
  29819. </p>
  29820. <p>Available values are:
  29821. </p><dl compact="compact">
  29822. <dt>&lsquo;<samp>scale</samp>&rsquo;</dt>
  29823. <dd><p>Scale pixel values for each drawn sample.
  29824. </p>
  29825. </dd>
  29826. <dt>&lsquo;<samp>full</samp>&rsquo;</dt>
  29827. <dd><p>Draw every sample directly.
  29828. </p></dd>
  29829. </dl>
  29830. <p>Default value is <code>scale</code>.
  29831. </p>
  29832. </dd>
  29833. <dt><samp>filter</samp></dt>
  29834. <dd><p>Set the filter mode.
  29835. </p>
  29836. <p>Available values are:
  29837. </p><dl compact="compact">
  29838. <dt>&lsquo;<samp>average</samp>&rsquo;</dt>
  29839. <dd><p>Use average samples values for each drawn sample.
  29840. </p>
  29841. </dd>
  29842. <dt>&lsquo;<samp>peak</samp>&rsquo;</dt>
  29843. <dd><p>Use peak samples values for each drawn sample.
  29844. </p></dd>
  29845. </dl>
  29846. <p>Default value is <code>average</code>.
  29847. </p></dd>
  29848. </dl>
  29849. <a name="Examples-150"></a>
  29850. <h4 class="subsection">16.26.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>
  29851. <ul>
  29852. <li> Extract a channel split representation of the wave form of a whole audio track
  29853. in a 1024x800 picture using <code>ffmpeg</code>:
  29854. <div class="example">
  29855. <pre class="example">ffmpeg -i audio.flac -lavfi showwavespic=split_channels=1:s=1024x800 waveform.png
  29856. </pre></div>
  29857. </li></ul>
  29858. <a name="sidedata_002c-asidedata"></a>
  29859. <h3 class="section">16.27 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>
  29860. <p>Delete frame side data, or select frames based on it.
  29861. </p>
  29862. <p>This filter accepts the following options:
  29863. </p>
  29864. <dl compact="compact">
  29865. <dt><samp>mode</samp></dt>
  29866. <dd><p>Set mode of operation of the filter.
  29867. </p>
  29868. <p>Can be one of the following:
  29869. </p>
  29870. <dl compact="compact">
  29871. <dt>&lsquo;<samp>select</samp>&rsquo;</dt>
  29872. <dd><p>Select every frame with side data of <code>type</code>.
  29873. </p>
  29874. </dd>
  29875. <dt>&lsquo;<samp>delete</samp>&rsquo;</dt>
  29876. <dd><p>Delete side data of <code>type</code>. If <code>type</code> is not set, delete all side
  29877. data in the frame.
  29878. </p>
  29879. </dd>
  29880. </dl>
  29881. </dd>
  29882. <dt><samp>type</samp></dt>
  29883. <dd><p>Set side data type used with all modes. Must be set for <code>select</code> mode. For
  29884. the list of frame side data types, refer to the <code>AVFrameSideDataType</code> enum
  29885. in <samp>libavutil/frame.h</samp>. For example, to choose
  29886. <code>AV_FRAME_DATA_PANSCAN</code> side data, you must specify <code>PANSCAN</code>.
  29887. </p>
  29888. </dd>
  29889. </dl>
  29890. <a name="spectrumsynth"></a>
  29891. <h3 class="section">16.28 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>
  29892. <p>Synthesize audio from 2 input video spectrums, first input stream represents
  29893. magnitude across time and second represents phase across time.
  29894. The filter will transform from frequency domain as displayed in videos back
  29895. to time domain as presented in audio output.
  29896. </p>
  29897. <p>This filter is primarily created for reversing processed <a href="#showspectrum">showspectrum</a>
  29898. filter outputs, but can synthesize sound from other spectrograms too.
  29899. But in such case results are going to be poor if the phase data is not
  29900. available, because in such cases phase data need to be recreated, usually
  29901. it&rsquo;s just recreated from random noise.
  29902. For best results use gray only output (<code>channel</code> color mode in
  29903. <a href="#showspectrum">showspectrum</a> filter) and <code>log</code> scale for magnitude video and
  29904. <code>lin</code> scale for phase video. To produce phase, for 2nd video, use
  29905. <code>data</code> option. Inputs videos should generally use <code>fullframe</code>
  29906. slide mode as that saves resources needed for decoding video.
  29907. </p>
  29908. <p>The filter accepts the following options:
  29909. </p>
  29910. <dl compact="compact">
  29911. <dt><samp>sample_rate</samp></dt>
  29912. <dd><p>Specify sample rate of output audio, the sample rate of audio from which
  29913. spectrum was generated may differ.
  29914. </p>
  29915. </dd>
  29916. <dt><samp>channels</samp></dt>
  29917. <dd><p>Set number of channels represented in input video spectrums.
  29918. </p>
  29919. </dd>
  29920. <dt><samp>scale</samp></dt>
  29921. <dd><p>Set scale which was used when generating magnitude input spectrum.
  29922. Can be <code>lin</code> or <code>log</code>. Default is <code>log</code>.
  29923. </p>
  29924. </dd>
  29925. <dt><samp>slide</samp></dt>
  29926. <dd><p>Set slide which was used when generating inputs spectrums.
  29927. Can be <code>replace</code>, <code>scroll</code>, <code>fullframe</code> or <code>rscroll</code>.
  29928. Default is <code>fullframe</code>.
  29929. </p>
  29930. </dd>
  29931. <dt><samp>win_func</samp></dt>
  29932. <dd><p>Set window function used for resynthesis.
  29933. </p>
  29934. </dd>
  29935. <dt><samp>overlap</samp></dt>
  29936. <dd><p>Set window overlap. In range <code>[0, 1]</code>. Default is <code>1</code>,
  29937. which means optimal overlap for selected window function will be picked.
  29938. </p>
  29939. </dd>
  29940. <dt><samp>orientation</samp></dt>
  29941. <dd><p>Set orientation of input videos. Can be <code>vertical</code> or <code>horizontal</code>.
  29942. Default is <code>vertical</code>.
  29943. </p></dd>
  29944. </dl>
  29945. <a name="Examples-151"></a>
  29946. <h4 class="subsection">16.28.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>
  29947. <ul>
  29948. <li> First create magnitude and phase videos from audio, assuming audio is stereo with 44100 sample rate,
  29949. then resynthesize videos back to audio with spectrumsynth:
  29950. <div class="example">
  29951. <pre class="example">ffmpeg -i input.flac -lavfi showspectrum=mode=separate:scale=log:overlap=0.875:color=channel:slide=fullframe:data=magnitude -an -c:v rawvideo magnitude.nut
  29952. 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
  29953. ffmpeg -i magnitude.nut -i phase.nut -lavfi spectrumsynth=channels=2:sample_rate=44100:win_func=hann:overlap=0.875:slide=fullframe output.flac
  29954. </pre></div>
  29955. </li></ul>
  29956. <a name="split_002c-asplit"></a>
  29957. <h3 class="section">16.29 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>
  29958. <p>Split input into several identical outputs.
  29959. </p>
  29960. <p><code>asplit</code> works with audio input, <code>split</code> with video.
  29961. </p>
  29962. <p>The filter accepts a single parameter which specifies the number of outputs. If
  29963. unspecified, it defaults to 2.
  29964. </p>
  29965. <a name="Examples-152"></a>
  29966. <h4 class="subsection">16.29.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>
  29967. <ul>
  29968. <li> Create two separate outputs from the same input:
  29969. <div class="example">
  29970. <pre class="example">[in] split [out0][out1]
  29971. </pre></div>
  29972. </li><li> To create 3 or more outputs, you need to specify the number of
  29973. outputs, like in:
  29974. <div class="example">
  29975. <pre class="example">[in] asplit=3 [out0][out1][out2]
  29976. </pre></div>
  29977. </li><li> Create two separate outputs from the same input, one cropped and
  29978. one padded:
  29979. <div class="example">
  29980. <pre class="example">[in] split [splitout1][splitout2];
  29981. [splitout1] crop=100:100:0:0 [cropout];
  29982. [splitout2] pad=200:200:100:100 [padout];
  29983. </pre></div>
  29984. </li><li> Create 5 copies of the input audio with <code>ffmpeg</code>:
  29985. <div class="example">
  29986. <pre class="example">ffmpeg -i INPUT -filter_complex asplit=5 OUTPUT
  29987. </pre></div>
  29988. </li></ul>
  29989. <a name="zmq_002c-azmq"></a>
  29990. <h3 class="section">16.30 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>
  29991. <p>Receive commands sent through a libzmq client, and forward them to
  29992. filters in the filtergraph.
  29993. </p>
  29994. <p><code>zmq</code> and <code>azmq</code> work as a pass-through filters. <code>zmq</code>
  29995. must be inserted between two video filters, <code>azmq</code> between two
  29996. audio filters. Both are capable to send messages to any filter type.
  29997. </p>
  29998. <p>To enable these filters you need to install the libzmq library and
  29999. headers and configure FFmpeg with <code>--enable-libzmq</code>.
  30000. </p>
  30001. <p>For more information about libzmq see:
  30002. <a href="http://www.zeromq.org/">http://www.zeromq.org/</a>
  30003. </p>
  30004. <p>The <code>zmq</code> and <code>azmq</code> filters work as a libzmq server, which
  30005. receives messages sent through a network interface defined by the
  30006. <samp>bind_address</samp> (or the abbreviation &quot;<samp>b</samp>&quot;) option.
  30007. Default value of this option is <samp>tcp://localhost:5555</samp>. You may
  30008. want to alter this value to your needs, but do not forget to escape any
  30009. &rsquo;:&rsquo; signs (see <a href="#filtergraph-escaping">filtergraph escaping</a>).
  30010. </p>
  30011. <p>The received message must be in the form:
  30012. </p><div class="example">
  30013. <pre class="example"><var>TARGET</var> <var>COMMAND</var> [<var>ARG</var>]
  30014. </pre></div>
  30015. <p><var>TARGET</var> specifies the target of the command, usually the name of
  30016. the filter class or a specific filter instance name. The default
  30017. filter instance name uses the pattern &lsquo;<samp>Parsed_&lt;filter_name&gt;_&lt;index&gt;</samp>&rsquo;,
  30018. but you can override this by using the &lsquo;<samp>filter_name@id</samp>&rsquo; syntax
  30019. (see <a href="#Filtergraph-syntax">Filtergraph syntax</a>).
  30020. </p>
  30021. <p><var>COMMAND</var> specifies the name of the command for the target filter.
  30022. </p>
  30023. <p><var>ARG</var> is optional and specifies the optional argument list for the
  30024. given <var>COMMAND</var>.
  30025. </p>
  30026. <p>Upon reception, the message is processed and the corresponding command
  30027. is injected into the filtergraph. Depending on the result, the filter
  30028. will send a reply to the client, adopting the format:
  30029. </p><div class="example">
  30030. <pre class="example"><var>ERROR_CODE</var> <var>ERROR_REASON</var>
  30031. <var>MESSAGE</var>
  30032. </pre></div>
  30033. <p><var>MESSAGE</var> is optional.
  30034. </p>
  30035. <a name="Examples-153"></a>
  30036. <h4 class="subsection">16.30.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>
  30037. <p>Look at <samp>tools/zmqsend</samp> for an example of a zmq client which can
  30038. be used to send commands processed by these filters.
  30039. </p>
  30040. <p>Consider the following filtergraph generated by <code>ffplay</code>.
  30041. In this example the last overlay filter has an instance name. All other
  30042. filters will have default instance names.
  30043. </p>
  30044. <div class="example">
  30045. <pre class="example">ffplay -dumpgraph 1 -f lavfi &quot;
  30046. color=s=100x100:c=red [l];
  30047. color=s=100x100:c=blue [r];
  30048. nullsrc=s=200x100, zmq [bg];
  30049. [bg][l] overlay [bg+l];
  30050. [bg+l][r] overlay@my=x=100 &quot;
  30051. </pre></div>
  30052. <p>To change the color of the left side of the video, the following
  30053. command can be used:
  30054. </p><div class="example">
  30055. <pre class="example">echo Parsed_color_0 c yellow | tools/zmqsend
  30056. </pre></div>
  30057. <p>To change the right side:
  30058. </p><div class="example">
  30059. <pre class="example">echo Parsed_color_1 c pink | tools/zmqsend
  30060. </pre></div>
  30061. <p>To change the position of the right side:
  30062. </p><div class="example">
  30063. <pre class="example">echo overlay@my x 150 | tools/zmqsend
  30064. </pre></div>
  30065. <a name="Multimedia-Sources"></a>
  30066. <h2 class="chapter">17 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>
  30067. <p>Below is a description of the currently available multimedia sources.
  30068. </p>
  30069. <a name="amovie"></a>
  30070. <h3 class="section">17.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>
  30071. <p>This is the same as <a href="#movie">movie</a> source, except it selects an audio
  30072. stream by default.
  30073. </p>
  30074. <span id="movie"></span><a name="movie-1"></a>
  30075. <h3 class="section">17.2 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>
  30076. <p>Read audio and/or video stream(s) from a movie container.
  30077. </p>
  30078. <p>It accepts the following parameters:
  30079. </p>
  30080. <dl compact="compact">
  30081. <dt><samp>filename</samp></dt>
  30082. <dd><p>The name of the resource to read (not necessarily a file; it can also be a
  30083. device or a stream accessed through some protocol).
  30084. </p>
  30085. </dd>
  30086. <dt><samp>format_name, f</samp></dt>
  30087. <dd><p>Specifies the format assumed for the movie to read, and can be either
  30088. the name of a container or an input device. If not specified, the
  30089. format is guessed from <var>movie_name</var> or by probing.
  30090. </p>
  30091. </dd>
  30092. <dt><samp>seek_point, sp</samp></dt>
  30093. <dd><p>Specifies the seek point in seconds. The frames will be output
  30094. starting from this seek point. The parameter is evaluated with
  30095. <code>av_strtod</code>, so the numerical value may be suffixed by an IS
  30096. postfix. The default value is &quot;0&quot;.
  30097. </p>
  30098. </dd>
  30099. <dt><samp>streams, s</samp></dt>
  30100. <dd><p>Specifies the streams to read. Several streams can be specified,
  30101. separated by &quot;+&quot;. The source will then have as many outputs, in the
  30102. same order. The syntax is explained in the <a href="ffmpeg.html#Stream-specifiers">(ffmpeg)&quot;Stream specifiers&quot;
  30103. section in the ffmpeg manual</a>. Two special names, &quot;dv&quot; and &quot;da&quot; specify
  30104. respectively the default (best suited) video and audio stream. Default
  30105. is &quot;dv&quot;, or &quot;da&quot; if the filter is called as &quot;amovie&quot;.
  30106. </p>
  30107. </dd>
  30108. <dt><samp>stream_index, si</samp></dt>
  30109. <dd><p>Specifies the index of the video stream to read. If the value is -1,
  30110. the most suitable video stream will be automatically selected. The default
  30111. value is &quot;-1&quot;. Deprecated. If the filter is called &quot;amovie&quot;, it will select
  30112. audio instead of video.
  30113. </p>
  30114. </dd>
  30115. <dt><samp>loop</samp></dt>
  30116. <dd><p>Specifies how many times to read the stream in sequence.
  30117. If the value is 0, the stream will be looped infinitely.
  30118. Default value is &quot;1&quot;.
  30119. </p>
  30120. <p>Note that when the movie is looped the source timestamps are not
  30121. changed, so it will generate non monotonically increasing timestamps.
  30122. </p>
  30123. </dd>
  30124. <dt><samp>discontinuity</samp></dt>
  30125. <dd><p>Specifies the time difference between frames above which the point is
  30126. considered a timestamp discontinuity which is removed by adjusting the later
  30127. timestamps.
  30128. </p></dd>
  30129. </dl>
  30130. <p>It allows overlaying a second video on top of the main input of
  30131. a filtergraph, as shown in this graph:
  30132. </p><div class="example">
  30133. <pre class="example">input -----------&gt; deltapts0 --&gt; overlay --&gt; output
  30134. ^
  30135. |
  30136. movie --&gt; scale--&gt; deltapts1 -------+
  30137. </pre></div>
  30138. <a name="Examples-154"></a>
  30139. <h4 class="subsection">17.2.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>
  30140. <ul>
  30141. <li> Skip 3.2 seconds from the start of the AVI file in.avi, and overlay it
  30142. on top of the input labelled &quot;in&quot;:
  30143. <div class="example">
  30144. <pre class="example">movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [over];
  30145. [in] setpts=PTS-STARTPTS [main];
  30146. [main][over] overlay=16:16 [out]
  30147. </pre></div>
  30148. </li><li> Read from a video4linux2 device, and overlay it on top of the input
  30149. labelled &quot;in&quot;:
  30150. <div class="example">
  30151. <pre class="example">movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [over];
  30152. [in] setpts=PTS-STARTPTS [main];
  30153. [main][over] overlay=16:16 [out]
  30154. </pre></div>
  30155. </li><li> Read the first video stream and the audio stream with id 0x81 from
  30156. dvd.vob; the video is connected to the pad named &quot;video&quot; and the audio is
  30157. connected to the pad named &quot;audio&quot;:
  30158. <div class="example">
  30159. <pre class="example">movie=dvd.vob:s=v:0+#0x81 [video] [audio]
  30160. </pre></div>
  30161. </li></ul>
  30162. <a name="Commands-137"></a>
  30163. <h4 class="subsection">17.2.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>
  30164. <p>Both movie and amovie support the following commands:
  30165. </p><dl compact="compact">
  30166. <dt><samp>seek</samp></dt>
  30167. <dd><p>Perform seek using &quot;av_seek_frame&quot;.
  30168. The syntax is: seek <var>stream_index</var>|<var>timestamp</var>|<var>flags</var>
  30169. </p><ul>
  30170. <li> <var>stream_index</var>: If stream_index is -1, a default
  30171. stream is selected, and <var>timestamp</var> is automatically converted
  30172. from AV_TIME_BASE units to the stream specific time_base.
  30173. </li><li> <var>timestamp</var>: Timestamp in AVStream.time_base units
  30174. or, if no stream is specified, in AV_TIME_BASE units.
  30175. </li><li> <var>flags</var>: Flags which select direction and seeking mode.
  30176. </li></ul>
  30177. </dd>
  30178. <dt><samp>get_duration</samp></dt>
  30179. <dd><p>Get movie duration in AV_TIME_BASE units.
  30180. </p>
  30181. </dd>
  30182. </dl>
  30183. <a name="See-Also"></a>
  30184. <h2 class="chapter">18 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>
  30185. <p><a href="ffmpeg.html">ffmpeg</a>, <a href="ffplay.html">ffplay</a>, <a href="ffprobe.html">ffprobe</a>,
  30186. <a href="libavfilter.html">libavfilter</a>
  30187. </p>
  30188. <a name="Authors"></a>
  30189. <h2 class="chapter">19 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>
  30190. <p>The FFmpeg developers.
  30191. </p>
  30192. <p>For details about the authorship, see the Git history of the project
  30193. (git://source.ffmpeg.org/ffmpeg), e.g. by typing the command
  30194. <code>git log</code> in the FFmpeg source directory, or browsing the
  30195. online repository at <a href="http://source.ffmpeg.org">http://source.ffmpeg.org</a>.
  30196. </p>
  30197. <p>Maintainers for the specific components are listed in the file
  30198. <samp>MAINTAINERS</samp> in the source code tree.
  30199. </p>
  30200. <p style="font-size: small;">
  30201. This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  30202. </p>
  30203. </div>
  30204. </body>
  30205. </html>